orbcafe-ui 1.3.3 → 1.3.6

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.mjs CHANGED
@@ -1,17 +1,17 @@
1
- import {a}from'./chunk-74Z76O3S.mjs';export{b as COrbCanvas}from'./chunk-74Z76O3S.mjs';import*as vt from'react';import vt__default,{createContext,forwardRef,useMemo,useContext,useState,useEffect,useCallback,Fragment as Fragment$1,useRef,useLayoutEffect}from'react';import {usePathname,useRouter}from'next/navigation';import {ChevronRight,Search,Plus,Mic,ThumbsDown,ThumbsUp,Volume2,RefreshCw,Copy,Terminal,Clock,X,ChevronDown,Box as Box$1,Lightbulb,AlertCircle,RotateCw,Check,Clipboard,CheckCircle,XCircle,Loader2,AlertTriangle,Info,BarChart,MapPin,Globe,TrendingDown,GitBranch,Grid as Grid$1,Activity,PieChart,LineChart}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import Jp from'@mui/material/Dialog';import eu from'@mui/material/DialogTitle';import tu from'@mui/material/DialogContent';import Bf from'@mui/material/DialogContentText';import ou from'@mui/material/DialogActions';import Xn from'@mui/material/Box';import Lf from'@mui/icons-material/CheckCircle';import zf from'@mui/icons-material/Warning';import Nf from'@mui/icons-material/Error';import Vf from'@mui/icons-material/Info';import {styled,Paper,IconButton,Tooltip,TextField,InputAdornment,CircularProgress,Dialog,DialogTitle,Box,Typography,DialogContent,Stack,Button,TableContainer,Table,TableHead,TableRow,TableCell,TableBody,Checkbox,DialogActions,Link,MenuItem,Chip,InputBase,useTheme,Autocomplete,FormControlLabel,Menu,ListItemText,Divider,Collapse,Grid,ListItemIcon,Alert,Tabs,Tab,LinearProgress,Avatar,AppBar,Toolbar,createTheme,ThemeProvider,FormControl,Select,Switch,Portal,useMediaQuery,Drawer,Popover,ListSubheader,Badge,TableFooter,InputLabel}from'@mui/material';import {alpha,useTheme as useTheme$1,createTheme as createTheme$1,ThemeProvider as ThemeProvider$1}from'@mui/material/styles';import Qf from'@mui/icons-material/Clear';import Jf from'@mui/icons-material/Close';import Wd from'@mui/icons-material/Search';import ax from'@mui/material/Paper';import rx from'@mui/material/Table';import nx from'@mui/material/TableBody';import Ls from'@mui/material/TableCell';import nu from'@mui/material/TableContainer';import Rh from'@mui/material/TableHead';import Dh from'@mui/material/TableRow';import au from'@mui/material/TextField';import gl from'@mui/material/Button';import ru from'@mui/material/Alert';import {DndContext,closestCenter,useSensors,useSensor,PointerSensor,TouchSensor,closestCorners,DragOverlay,useDroppable,useDraggable}from'@dnd-kit/core';import {restrictToHorizontalAxis}from'@dnd-kit/modifiers';import gh from'@mui/icons-material/ViewColumn';import jp from'@mui/icons-material/Save';import hh from'@mui/icons-material/Download';import yh from'@mui/icons-material/AccountTree';import bh from'@mui/icons-material/Functions';import xh from'@mui/icons-material/Insights';import vh from'@mui/icons-material/Add';import Ch from'@mui/icons-material/Edit';import kh from'@mui/icons-material/Delete';import Sh from'@mui/icons-material/KeyboardArrowLeft';import wh from'@mui/icons-material/KeyboardArrowRight';import Mh from'@mui/material/Checkbox';import Ah from'@mui/material/TableSortLabel';import Bh from'@mui/material/IconButton';import Eh from'@mui/material/Tooltip';import Fh from'@mui/icons-material/UnfoldMore';import Lh from'@mui/icons-material/UnfoldLess';import Wh from'@mui/icons-material/KeyboardArrowDown';import ty from'@mui/icons-material/Check';import oy from'@mui/icons-material/ClearAll';import Ny from'@mui/icons-material/MicNoneOutlined';import Vy from'@mui/icons-material/SettingsOutlined';import Oy from'@mui/icons-material/SendOutlined';import Lb from'@mui/icons-material/Settings';import zb from'@mui/icons-material/KeyboardArrowUp';import Vb from'@mui/icons-material/ArrowRightAlt';import ib from'@mui/icons-material/Star';import {DateCalendar}from'@mui/x-date-pickers/DateCalendar';import {PickersDay}from'@mui/x-date-pickers/PickersDay';import {LocalizationProvider}from'@mui/x-date-pickers/LocalizationProvider';import {AdapterDayjs}from'@mui/x-date-pickers/AdapterDayjs';import Cb from'@mui/icons-material/CalendarMonth';import Sb from'@mui/icons-material/ArrowForward';import ta from'dayjs';import wb from'dayjs/plugin/isBetween';import Tb 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 Qb from'@mui/icons-material/StarBorder';import Jb from'@mui/icons-material/ViewQuilt';import C0 from'@mui/icons-material/CloseOutlined';import Cx from'@mui/icons-material/ContentCopyOutlined';import kx from'@mui/icons-material/CheckOutlined';import Yx from'@mui/icons-material/ExpandMore';import {arrayMove,SortableContext,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import Nu from'@mui/icons-material/Language';import iv from'@mui/icons-material/DesktopWindows';import lv from'@mui/icons-material/DarkMode';import sv from'@mui/icons-material/LightMode';import dv from'@mui/icons-material/Logout';import TC from'@mui/icons-material/DeleteOutline';import Ev from'@mui/icons-material/DragIndicator';import Yv from'@mui/icons-material/FilterList';import Qv from'@mui/icons-material/TableRows';import Vv from'@mui/icons-material/LayersClear';import XC from'@mui/icons-material/CameraAltRounded';import YC from'@mui/icons-material/QrCodeScannerRounded';import tk from'@mui/icons-material/DragIndicatorRounded';import nk from'@mui/icons-material/BackspaceRounded';import ik from'@mui/icons-material/CloseRounded';import lk from'@mui/icons-material/CheckRounded';import kk from'@mui/icons-material/SearchRounded';import Sk from'@mui/icons-material/MenuOpenRounded';import wk from'@mui/icons-material/MenuRounded';import Tk from'@mui/icons-material/ExpandMoreRounded';import Ik from'@mui/icons-material/ChevronRightRounded';import qk from'next/dynamic';import {AnimatePresence,motion}from'framer-motion';import iw from'react-markdown';import lw from'remark-gfm';import sw from'remark-math';import cw from'rehype-katex';import dw from'rehype-raw';import {Prism}from'react-syntax-highlighter';import {oneDark,oneLight}from'react-syntax-highlighter/dist/esm/styles/prism';import {useTheme as useTheme$2}from'next-themes';import cg from'mermaid';import Cw from'@mui/icons-material/MicRounded';import kw from'@mui/icons-material/MicOffRounded';import {InsertDriveFile,Close,Stop}from'@mui/icons-material';import Pw from'@mui/icons-material/SendRounded';import Rw from'@mui/icons-material/AddRounded';import Dw from'@mui/icons-material/HardwareRounded';import Qw from'@mui/icons-material/LockOutlined';import Vg from'@mui/icons-material/MailOutline';import Og from'@mui/icons-material/PersonOutline';import Jw from'@mui/icons-material/VpnKeyOutlined';import h1 from'dayjs/plugin/isoWeek';import w1 from'@mui/icons-material/CalendarMonthOutlined';import R1 from'@mui/icons-material/KeyboardDoubleArrowLeftOutlined';import D1 from'@mui/icons-material/KeyboardDoubleArrowRightOutlined';import M1 from'@mui/icons-material/SplitscreenOutlined';import A1 from'@mui/icons-material/Sort';function ko(...e){return twMerge(clsx(e))}var ks={primary:"#000000",primaryHover:"#333333"},Ri={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"},Dn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},Sd=()=>"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 nf=cva(Sd(),{variants:{variant:{default:`${Ri.primary} shadow-sm`,destructive:"bg-red-500 text-white hover:bg-red-600 active:bg-red-700 dark:bg-red-600 dark:hover:bg-red-500 dark:active:bg-red-700 shadow-sm",outline:`${Ri.outline} shadow-sm`,secondary:"bg-gray-200 text-gray-700 hover:bg-gray-300 active:bg-gray-400 dark:bg-gray-700 dark:text-gray-200 dark:hover:bg-gray-600 dark:active:bg-gray-500 shadow-sm",ghost:Ri.ghost,link:"text-blue-600 dark:text-blue-400 underline-offset-4 hover:underline hover:text-blue-700 dark:hover:text-blue-300 active:text-blue-800 dark:active:text-blue-200","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-[${ks.primary}] hover:bg-[${ks.primaryHover}] text-white 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-red-500 hover:bg-red-600 border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 text-white 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:Dn.none,sm:Dn.sm,md:Dn.md,full:Dn.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),Ss=vt.forwardRef(({className:e,variant:t,size:o,asChild:a=false,...r},n)=>jsx(a?Slot:"button",{className:ko(nf({variant:t,size:o,className:e})),ref:n,...r}));Ss.displayName="Button";var sf={"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.theme.system":"Theme: System","header.theme.dark":"Theme: Dark","header.theme.light":"Theme: Light","header.menu.setting":"Setting","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}","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","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.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?","messageBox.confirm":"OK","messageBox.cancel":"Cancel"},cf={"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.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.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}","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","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.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","messageBox.confirm":"\u786E\u5B9A","messageBox.cancel":"\u53D6\u6D88"},df={"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.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.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}","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","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.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 ?","messageBox.confirm":"OK","messageBox.cancel":"Annuler"},pf={"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.theme.system":"Theme: System","header.theme.dark":"Theme: Dunkel","header.theme.light":"Theme: Hell","header.menu.setting":"Einstellungen","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","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","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.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?","messageBox.confirm":"OK","messageBox.cancel":"Abbrechen"},uf={"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.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.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","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","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.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","messageBox.confirm":"OK","messageBox.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB"},mf={"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.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.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","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","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.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?","messageBox.confirm":"\uD655\uC778","messageBox.cancel":"\uCDE8\uC18C"},Mn={en:sf,zh:cf,fr:df,de:pf,ja:uf,ko:mf};var Td=(e,t)=>t?e.replace(/\{(\w+)\}/g,(o,a)=>{let r=t[a];return r==null?"":String(r)}):e,yf={locale:"en",t:(e,t)=>Td(Mn.en[e]||e,t)},Id=createContext(yf),Di=({locale:e="en",messages:t,children:o})=>{let a=useMemo(()=>{let r=Mn[e]||Mn.en,n=t?.[e]||{},i={...Mn.en,...r,...n};return {locale:e,t:(s,p)=>Td(i[s]||s,p)}},[e,t]);return jsx(Id.Provider,{value:a,children:o})},ee=()=>useContext(Id);function Ts({items:e,onItemClick:t,className:o="",level:a=0,expandedIds:r,onToggleExpand:n,colorMode:i="light"}){let{t:s}=ee(),p=i==="dark",l=usePathname(),[c,g]=useState(false),[f,u]=useState(new Set),h=r!==void 0&&n!==void 0,w=h?r:f;useEffect(()=>{g(true);},[]);let d=m=>{if(h)n(m);else {let y=new Set(f);y.has(m)?y.delete(m):y.add(m),u(y);}},C=m=>{m.children&&m.children.length>0&&d(m.id),t&&t(m);};return !e||!Array.isArray(e)?jsx("div",{className:ko("tree-menu",o),children:jsx("div",{className:"text-sm text-gray-500 p-2",children:s("navigation.noItems")})}):jsx("div",{className:ko("tree-menu",o),children:e.map(m=>{let y=w.has(m.id)||m.isExpanded,b=m.children&&m.children.length>0,T=m.appurl||m.href,A=c&&T?l===T:false;return jsxs("div",{className:"tree-menu-item relative",children:[A&&jsx("div",{className:ko("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",p?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxs(Ss,{variant:"ghost",className:ko("w-full justify-start gap-2 h-auto py-2 relative overflow-hidden group",`ml-${a*4}`,A?p?"bg-transparent text-[#90caf9] hover:bg-gray-800/35":"bg-transparent text-[#1976d2] hover:bg-gray-100/60":p?"hover:bg-gray-800/50 text-gray-300":"hover:bg-gray-100/50 text-gray-700"),onClick:()=>C(m),children:[b&&jsx("div",{className:ko("flex-shrink-0 transition-transform duration-200",y&&"rotate-90",A?p?"text-[#90caf9]":"text-[#1976d2]":p?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:jsx(ChevronRight,{className:"h-4 w-4"})}),!b&&jsx("div",{className:"w-4 h-4 flex-shrink-0"}),m.icon&&jsx("div",{className:ko("flex-shrink-0 transition-colors duration-200",A?p?"text-[#90caf9]":"text-[#1976d2]":p?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:m.icon}),jsxs("div",{className:"flex-1 text-left overflow-hidden z-10",children:[jsx("div",{className:ko("text-sm truncate transition-colors duration-200",A?"font-semibold":"font-medium"),children:m.title||m.label}),m.description&&jsx("div",{className:ko("text-xs truncate transition-colors duration-200",A?p?"text-[#90caf9]/70":"text-[#1976d2]/75":p?"text-gray-400":"text-gray-500"),title:m.description,children:m.description})]})]}),b&&jsx("div",{className:ko("grid transition-[grid-template-rows] duration-300 ease-in-out",y?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsx("div",{className:"overflow-hidden",children:jsx(Ts,{items:m.children,onItemClick:t,level:a+1,expandedIds:r,onToggleExpand:n,colorMode:i})})})]},m.id)})})}var Bd=({collapsed:e,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light"})=>{let{t:i}=ee(),s=n==="dark",p=useRouter(),[l,c]=useState(""),[g,f]=useState(new Set);useEffect(()=>{e&&f(new Set);},[e]);let u=useCallback(C=>{let m=[],y=b=>{b.forEach(T=>{m.push(T.id),T.children&&y(T.children);});};return y(C),m},[]),h=useMemo(()=>{if(!l.trim())return r;let C=m=>m.reduce((y,b)=>{let T=b.title?.toLowerCase().includes(l.toLowerCase())||b.description?.toLowerCase().includes(l.toLowerCase()),A=b.children?C(b.children):[];return (T||A.length>0)&&y.push({...b,children:A.length>0?A:b.children}),y},[]);return C(r)},[l,r]),w=useMemo(()=>l.trim()?new Set(u(r)):g,[l,r,g,u]),d=useCallback(async C=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",C),C.id==="chat"||C.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{p.push("/chat?new=true");}catch(y){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",y),p.push("/chat");}return}let m=C.appurl||C.href;m&&(m.startsWith("http://")||m.startsWith("https://")?window.open(m,"_blank"):p.push(m));},[p]);return jsxs("div",{className:`flex flex-col backdrop-blur-xl border shadow-[0_4px_8px_0_rgba(31,38,135,0.1)] ${e?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${o} ${s?"bg-[#111111] border-white/10":"bg-white/70 border-white/30"}`,style:{backdropFilter:"blur(16px) saturate(180%)",WebkitBackdropFilter:"blur(16px) saturate(180%)",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",maxHeight:a?`${a}px`:void 0},children:[jsx("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${e?"px-1":"px-2"}`,children:e?jsx("div",{className:"flex justify-center",children:jsx("button",{onClick:t,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${s?"text-gray-300 hover:bg-gray-800":"text-gray-500 hover:bg-gray-50"}`,title:i("navigation.expand"),children:jsx(Search,{className:"h-5 w-5"})})}):jsxs("div",{className:`relative transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:[jsx("input",{type:"text",placeholder:i("navigation.searchPlaceholder"),value:l,onChange:C=>c(C.target.value),className:`w-full pl-10 pr-4 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent ${s?"border-gray-700 bg-[#1A1A1A] text-white placeholder-gray-400":"border-gray-300 bg-white text-gray-900 placeholder-gray-500"}`}),jsx("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:jsx(Search,{className:`h-4 w-4 ${s?"text-gray-500":"text-gray-400"}`})})]})}),jsx("nav",{className:`flex-1 pb-4 transition-all duration-500 ease-in-out overflow-y-auto min-h-0 ${e?"px-1":"px-2"}`,children:h.length===0?jsx("div",{className:"flex items-center justify-center py-8 text-gray-500 text-sm",children:e?"\u{1F4C2}":i(l?"navigation.noMatch":"navigation.noAccessibleApp")}):jsxs(Fragment,{children:[!e&&jsx("div",{className:`transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:jsx(Ts,{items:h,onItemClick:d,className:"space-y-1",expandedIds:w,colorMode:n,onToggleExpand:C=>{let m=new Set(g);h.some(b=>b.id===C)?m.has(C)?m.delete(C):(h.forEach(b=>{b.id!==C&&m.has(b.id)&&m.delete(b.id);}),m.add(C)):m.has(C)?m.delete(C):m.add(C),f(m);}})}),e&&jsx("div",{className:"space-y-2",children:r.map(C=>jsx("div",{className:"space-y-1",children:jsx("button",{onClick:()=>{t();let m=new Set([C.id]);f(m);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${s?"text-gray-400 hover:bg-gray-800":"text-gray-600 hover:bg-gray-50"}`,title:i("navigation.expandView",{title:C.title||""}),children:C.icon||jsx("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${s?"bg-[#90caf9] text-[#0b0b0b]":"bg-[#1976d2] text-white"}`,children:C.title?.charAt(0)||"?"})})},C.id))})]})}),!e&&jsx("button",{onClick:t,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 ${s?"hover:bg-gray-800/50":"hover:bg-white/20"}`,title:i("navigation.collapse"),children:jsx("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:jsx("div",{className:s?"border-yellow-400":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid #21BCFF",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})})]})};var Fd=(e={})=>{let{initialCollapsed:t=false,content:o=[]}=e,[a,r]=useState(t),[n,i]=useState(o),s=useCallback(()=>{r(l=>!l);},[]),p=useMemo(()=>({collapsed:a,onToggle:s,menuData:n}),[a,s,n]);return {collapsed:a,setCollapsed:r,toggleCollapsed:s,menuData:n,setMenuData:i,navigationIslandProps:p}};var Bo=e=>jsx(Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var Ps=class{constructor(){a(this,"listener",null);}register(t){this.listener=t;}unregister(){this.listener=null;}show(t,o,a){this.listener&&this.listener({type:t,content:o,options:a});}hide(){this.listener&&this.listener(null);}},ca=new Ps,ET={success:(e,t)=>ca.show("success",e,t),error:(e,t)=>ca.show("error",e,t),warning:(e,t)=>ca.show("warning",e,t),info:(e,t)=>ca.show("info",e,t),show:(e,t,o)=>ca.show(e,t,o),hide:()=>ca.hide()};var Of={success:{icon:jsx(Lf,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsx(zf,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsx(Nf,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsx(Vf,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},An=({open:e,title:t,message:o,onClose:a,onConfirm:r,confirmText:n,cancelText:i,showCancel:s=true,maxWidth:p="xs",type:l="default"})=>{let{t:c}=ee(),g=n||c("messageBox.confirm"),f=i||c("messageBox.cancel"),u=()=>{r?r():a();},h=Of[l],w=l!=="default";return jsxs(Jp,{open:e,onClose:a,maxWidth:p,fullWidth:true,PaperProps:{sx:{borderRadius:3,...w&&{borderTop:`6px solid ${h.iconColor}`}}},children:[w&&jsx(Xn,{sx:{display:"flex",justifyContent:"center",pt:3,color:h.iconColor},children:h.icon}),t&&jsx(eu,{sx:{textAlign:w?"center":"left",pt:w?1:2},children:t}),jsx(tu,{sx:{textAlign:w?"center":"left"},children:typeof o=="string"?jsx(Bf,{children:o}):o}),jsxs(ou,{sx:{justifyContent:w?"center":"flex-end",pb:3,px:3},children:[s&&jsx(Bo,{onClick:a,variant:"text",color:"inherit",children:f}),jsx(Bo,{onClick:u,variant:"contained",sx:{bgcolor:w?h.iconColor:void 0,"&:hover":{bgcolor:w?h.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:g})]})]})},XT=()=>{let[e,t]=vt__default.useState(null),[o,a]=vt__default.useState(false);vt__default.useEffect(()=>{let i=s=>{s?(t(s),a(true)):(a(false),t(null));};return ca.register(i),()=>ca.unregister()},[]);let r=()=>{a(false),e?.options?.onClose&&e.options.onClose(),t(null);},n=()=>{e?.options?.onConfirm&&e.options.onConfirm(),a(false),t(null);};return e?jsx(An,{open:o,type:e.type,message:e.content,title:e.options?.title,onClose:r,onConfirm:n,confirmText:e.options?.confirmText,cancelText:e.options?.cancelText,showCancel:e.options?.showCancel,maxWidth:e.options?.maxWidth}):null};var eh=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],$d=e=>Array.isArray(e)?e:e==null||e===""?[]:[e],jo=e=>String(e),Gd=(e,t)=>e[t],Ud=e=>{let t=e.value??e.id??e.key??e.code;return typeof t=="number"||typeof t=="string"?t:""},th=e=>{let t=e.label??e.description??e.name??e.title;return String(typeof t=="number"||typeof t=="string"?t:Ud(e))},oh=e=>{let t=e.description??e.subtitle;return typeof t=="number"||typeof t=="string"?String(t):void 0},Kd=({value:e=null,items:t=[],columns:o,mode:a="single",dialogTitle:r="Value Help",searchPlaceholder:n="Search values...",selectLabel:i="Select",clearLabel:s="Clear",cancelLabel:p="Cancel",valueHelpLabel:l="Open value help",noResultsText:c="No matching values",loading:g=false,clearable:f=true,selectedItems:u=[],displayValue:h,getOptionValue:w=Ud,getOptionLabel:d=th,getOptionDescription:C=oh,onChange:m,onSearch:y,disabled:b,InputProps:T,onKeyDown:A,...R})=>{let S=a==="multiple",[B,P]=useState(false),[v,M]=useState(""),[k,I]=useState(null),[D,G]=useState(false),[V,X]=useState(()=>$d(e)),de=useMemo(()=>o&&o.length>0?o:eh,[o]),oe=k??t,re=useMemo(()=>{let j=[...u,...t,...k??[]],pe=new Map;return j.forEach(De=>{pe.set(jo(w(De)),De);}),pe},[w,t,k,u]),_=useMemo(()=>$d(e),[e]);useEffect(()=>{B||X(_);},[B,_]);let qe=useMemo(()=>{let j=v.trim().toLowerCase();if(!j||y)return oe;let pe=de.filter(De=>De.searchable!==false);return oe.filter(De=>[w(De),d(De),C(De),...pe.map(We=>Gd(De,We.field))].some(We=>String(We??"").toLowerCase().includes(j)))},[oe,C,d,w,y,v,de]),it=useMemo(()=>{if(h!==void 0)return h;if(_.length===0)return "";let j=pe=>{let De=re.get(jo(pe));if(!De)return String(pe);let Le=d(De);return Le&&Le!==String(pe)?`${pe} - ${Le}`:String(pe)};return S?_.length>2?`${_.length} selected`:_.map(j).join(", "):j(_[0])},[h,d,S,re,_]),Y=useCallback(async()=>{if(y){G(true);try{let j=await y(v);Array.isArray(j)&&I(j);}finally{G(false);}}},[y,v]),le=()=>{b||(X(_),P(true));},Be=()=>{P(false);},Ee=()=>{m?.(S?[]:null,S?[]:null),X([]);},Ue=j=>{let pe=w(j);if(S){X(De=>De.some(We=>jo(We)===jo(pe))?De.filter(We=>jo(We)!==jo(pe)):[...De,pe]);return}X([pe]);},ot=()=>{let j=V.map(pe=>re.get(jo(pe))).filter(pe=>!!pe);S?m?.(V,j):m?.(V[0]??null,j[0]??null),P(false);},Fe=j=>{if(j.key==="F4"){j.preventDefault(),le();return}A?.(j);},_e=g||D,ht=_.length>0;return jsxs(Fragment,{children:[jsx(TextField,{...R,disabled:b,value:it,onKeyDown:Fe,InputProps:{...T,readOnly:true,endAdornment:jsxs(InputAdornment,{position:"end",children:[_e?jsx(CircularProgress,{size:18}):null,f&&ht&&!b?jsx(Tooltip,{title:s,children:jsx(IconButton,{size:"small",edge:"end","aria-label":s,onClick:Ee,children:jsx(Qf,{fontSize:"small"})})}):null,jsx(Tooltip,{title:l,children:jsx("span",{children:jsx(IconButton,{size:"small",edge:"end","aria-label":l,onClick:le,disabled:b,children:jsx(Wd,{fontSize:"small"})})})})]})}}),jsxs(Dialog,{open:B,onClose:Be,fullWidth:true,maxWidth:"md",PaperProps:{sx:j=>({borderRadius:2,overflow:"hidden",border:`1px solid ${j.palette.divider}`,boxShadow:j.palette.mode==="dark"?`0 24px 80px ${alpha(j.palette.common.black,.72)}`:`0 24px 80px ${alpha(j.palette.common.black,.18)}`})},children:[jsxs(DialogTitle,{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:[jsxs(Box,{children:[jsx(Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:r}),S?jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${V.length} selected`}):null]}),jsx(IconButton,{"aria-label":"Close",onClick:Be,size:"small",children:jsx(Jf,{fontSize:"small"})})]}),jsxs(DialogContent,{sx:{p:0},children:[jsxs(Stack,{direction:{xs:"column",sm:"row"},spacing:1,sx:j=>({px:2.5,py:1.5,borderBottom:`1px solid ${j.palette.divider}`,bgcolor:j.palette.mode==="dark"?alpha(j.palette.common.white,.025):alpha(j.palette.primary.main,.035)}),children:[jsx(TextField,{size:"small",fullWidth:true,value:v,placeholder:n,onChange:j=>M(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),Y());},InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Wd,{fontSize:"small"})}),sx:j=>({borderRadius:1,bgcolor:j.palette.background.paper,"& fieldset":{borderColor:alpha(j.palette.text.primary,j.palette.mode==="dark"?.2:.16)},"&:hover fieldset":{borderColor:alpha(j.palette.primary.main,.52)},"&.Mui-focused fieldset":{borderColor:j.palette.primary.main}})}}),y?jsx(Button,{variant:"outlined",onClick:()=>{Y();},disabled:_e,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:_e?jsx(CircularProgress,{size:18}):"Search"}):null]}),jsx(TableContainer,{sx:{maxHeight:420},children:jsxs(Table,{stickyHeader:true,size:"small",children:[jsx(TableHead,{children:jsxs(TableRow,{children:[jsx(TableCell,{padding:"checkbox",sx:j=>({bgcolor:j.palette.mode==="dark"?"#111111":j.palette.background.paper,borderBottom:`1px solid ${j.palette.divider}`})}),de.map(j=>jsx(TableCell,{align:j.align,sx:pe=>({minWidth:j.minWidth,width:j.width,fontSize:"0.78rem",fontWeight:800,bgcolor:pe.palette.mode==="dark"?"#111111":pe.palette.background.paper,borderBottom:`1px solid ${pe.palette.divider}`}),children:j.label},String(j.field)))]})}),jsxs(TableBody,{children:[qe.map(j=>{let pe=w(j),De=V.some(Le=>jo(Le)===jo(pe));return jsxs(TableRow,{hover:true,selected:De,onClick:()=>Ue(j),onDoubleClick:()=>{S||(X([pe]),m?.(pe,j),P(false));},sx:Le=>({cursor:"pointer","&.Mui-selected":{bgcolor:alpha(Le.palette.primary.main,Le.palette.mode==="dark"?.22:.12)},"&.Mui-selected:hover":{bgcolor:alpha(Le.palette.primary.main,Le.palette.mode==="dark"?.28:.18)}}),children:[jsx(TableCell,{padding:"checkbox",children:jsx(Checkbox,{size:"small",checked:De})}),de.map(Le=>{let We=Gd(j,Le.field);return jsx(TableCell,{align:Le.align,sx:{fontSize:"0.82rem",py:1},children:Le.render?Le.render(We,j):String(We??"")},String(Le.field))})]},jo(pe))}),qe.length===0?jsx(TableRow,{children:jsx(TableCell,{colSpan:de.length+1,children:jsx(Box,{sx:{py:5,textAlign:"center",color:"text.secondary"},children:c})})}):null]})]})})]}),jsxs(DialogActions,{sx:j=>({px:2.5,py:1.5,borderTop:`1px solid ${j.palette.divider}`,bgcolor:j.palette.background.paper,"& .MuiButton-root":{textTransform:"none",fontWeight:700}}),children:[f&&(ht||V.length>0)?jsx(Button,{onClick:Ee,children:s}):null,jsx(Box,{sx:{flex:1}}),jsx(Button,{onClick:Be,children:p}),jsx(Button,{variant:"contained",onClick:ot,disabled:!S&&V.length===0,children:i})]})]})]})};var qd=({title:e,hideHeader:t,children:o})=>jsxs(Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!t&&jsx(Box,{sx:{mb:2},children:jsx(Typography,{variant:"h4",children:e})}),jsx(Box,{sx:{flex:1,overflow:"hidden"},children:o})]});var Ai=e=>{let{t}=ee(),o="0.85rem",a=Array.isArray(e.actions)?e.actions:e.actions?[e.actions]:[],r=Array.isArray(e.extraTools)?e.extraTools:e.extraTools?[e.extraTools]:[],n=[...a,...r],i=typeof e.rowsPerPage=="number"?e.rowsPerPage:20,s=Array.isArray(e.rowsPerPageOptions)&&e.rowsPerPageOptions.length>0?e.rowsPerPageOptions:[20,50,100,-1],p=typeof e.count=="number"?e.count:0,l=Math.max(0,typeof e.page=="number"?e.page:0),c=i===-1?1:Math.max(1,Math.ceil(p/i)),g=Math.min(l+1,c),f=l>0,u=l<c-1&&i!==-1;return jsxs(Toolbar,{sx:{pl:{sm:2},pr:{xs:1,sm:1},alignItems:"center",gap:1},children:[jsx(TextField,{size:"small",placeholder:t("table.toolbar.searchPlaceholder"),value:e.filterText,onChange:h=>e.setFilterText(h.target.value),InputProps:{sx:{fontSize:o,"& .MuiInputBase-input":{fontSize:o,color:"text.primary"},"& .MuiInputBase-input::placeholder":{fontSize:o,opacity:1}},startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Wd,{fontSize:"small"})})},sx:{width:300}}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[jsx(Typography,{sx:{fontSize:o,color:"text.secondary",whiteSpace:"nowrap"},children:t("table.toolbar.itemsPerPage")}),jsx(Select,{size:"small",variant:"standard",value:i,disableUnderline:true,onChange:h=>e.onRowsPerPageChange?.(Number(h.target.value)),sx:{fontSize:o,fontWeight:600,color:"text.primary",minWidth:64,"& .MuiSelect-select":{py:.25,pr:"16px !important"},"& .MuiSvgIcon-root":{color:"text.primary"}},children:s.map(h=>jsx(MenuItem,{value:h,sx:{fontSize:o},children:h===-1?t("common.all"):h},`rows-per-page-${h}`))}),jsx(IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.max(l-1,0)),disabled:!f,sx:{p:.35,color:"text.primary"},children:jsx(Sh,{fontSize:"small"})}),jsx(Typography,{sx:{fontSize:o,fontWeight:600,minWidth:88,textAlign:"center",color:"text.primary"},children:t("table.toolbar.pageOf",{current:g,total:c})}),jsx(IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.min(l+1,c-1)),disabled:!u,sx:{p:.35,color:"text.primary"},children:jsx(wh,{fontSize:"small"})})]}),jsx(Box,{sx:{flex:1}}),jsxs(Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[n.length>0&&jsx(Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:n.map((h,w)=>jsx(vt__default.Fragment,{children:h},`toolbar-custom-${w}`))}),jsx(Box,{sx:{width:"1px",height:20,bgcolor:"divider",mx:.5}}),jsx(Tooltip,{title:t("table.toolbar.groupBy"),children:jsx(IconButton,{sx:{color:"text.primary"},onClick:h=>e.setGroupAnchorEl(h.currentTarget),children:jsx(Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsx(yh,{})})})}),jsx(Tooltip,{title:t("table.toolbar.summary"),children:jsx(IconButton,{sx:{color:e.showSummary?"primary.main":"text.primary"},onClick:h=>e.setSummaryAnchorEl(h.currentTarget),children:jsx(bh,{})})}),jsx(Tooltip,{title:t("table.toolbar.columns"),children:jsx(IconButton,{sx:{color:"text.primary"},onClick:h=>e.setAnchorEl(h.currentTarget),children:jsx(gh,{})})}),jsx(Tooltip,{title:t("table.toolbar.export"),children:jsx(IconButton,{sx:{color:"text.primary"},onClick:e.handleExport,children:jsx(hh,{})})}),e.showCreateButton&&jsx(Tooltip,{title:t("table.toolbar.newItem"),children:jsx(IconButton,{onClick:e.onOpenCreateDialog,color:"primary",children:jsx(vh,{})})}),e.showEditButton&&jsx(Tooltip,{title:t("table.toolbar.editItem"),children:jsx("span",{children:jsx(IconButton,{onClick:e.onOpenEditDialog,color:"primary",disabled:!!e.editDisabled,children:jsx(Ch,{})})})}),e.showDeleteButton&&jsx(Tooltip,{title:t("table.toolbar.deleteItem"),children:jsx("span",{children:jsx(IconButton,{onClick:e.onOpenDeleteConfirm,color:"error",disabled:!!e.deleteDisabled,children:jsx(kh,{})})})}),e.onOpenGraphReport&&jsx(Tooltip,{title:t("table.toolbar.graphicReport"),children:jsx(IconButton,{sx:{color:"text.primary"},onClick:e.onOpenGraphReport,children:jsx(xh,{})})}),e.onLayoutSave&&!e.layoutManager&&jsx(Tooltip,{title:t("table.toolbar.saveLayout"),children:jsx(IconButton,{sx:{color:"text.primary"},onClick:h=>e.onLayoutSave(h),children:jsx(jp,{})})}),e.layoutManager]})]})};var Bi=e=>{let{t}=ee(),{onSelectAllClick:o,order:a,orderBy:r,numSelected:n=0,rowCount:i=0,onRequestSort:s,columns:p,visibleColumns:l,selectionMode:c,grouping:g=[],isAllExpanded:f=false,handleToggleAll:u,onColumnResize:h,columnWidths:w}=e,[d,C]=useState(null),m=useRef(null),y=v=>M=>{d||s(v);},b=(v,M,k)=>{v.preventDefault(),v.stopPropagation(),C(M),m.current={startX:v.clientX,startWidth:k,colId:M},document.addEventListener("mousemove",T),document.addEventListener("mouseup",A),document.body.style.cursor="col-resize";},T=v=>{if(!m.current)return;let{startX:M,startWidth:k,colId:I}=m.current,D=v.clientX-M,G=Math.max(50,k+D);h&&h(I,G);},A=()=>{C(null),m.current=null,document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",A),document.body.style.cursor="";};useEffect(()=>()=>{document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",A);},[]);let R=c==="multiple"||c==="single",S=g.length>0&&!!u,B=t(f?"table.group.collapseAll":"table.group.expandAll"),P=p.filter(v=>l.includes(v.id));return jsx(Rh,{children:jsxs(Dh,{children:[R&&jsx(Ls,{padding:"checkbox",sx:v=>({width:48,position:"sticky",top:0,zIndex:4,backgroundColor:v.palette.mode==="dark"?"#000000":"#f5f5f5",color:v.palette.mode==="dark"?"#ffffff":v.palette.text.primary}),children:jsx(Mh,{color:"primary",indeterminate:n>0&&n<i,checked:i>0&&n===i,onChange:o,disabled:c==="single"})}),S&&jsx(Ls,{align:"center",padding:"checkbox",sx:v=>({width:44,position:"sticky",top:0,zIndex:4,backgroundColor:v.palette.mode==="dark"?"#000000":"#f5f5f5",color:v.palette.mode==="dark"?"#ffffff":v.palette.text.primary}),children:jsx(Eh,{title:B,children:jsx(Bh,{size:"small",onClick:v=>{v.stopPropagation(),u?.(!f);},sx:{p:.2},children:f?jsx(Lh,{fontSize:"small"}):jsx(Fh,{fontSize:"small"})})})}),P.map(v=>{let M=w?.[v.id]||v.minWidth||100;return jsxs(Ls,{align:"left",padding:v.disablePadding?"none":"normal",sortDirection:r===v.id?a:false,style:{width:M,minWidth:M,maxWidth:M},sx:k=>({position:"sticky",top:0,zIndex:4,backgroundColor:k.palette.mode==="dark"?"#000000":"#f5f5f5",color:k.palette.mode==="dark"?"#ffffff":k.palette.text.primary,fontWeight:"bold",userSelect:"none"}),children:[jsx(Ah,{active:r===v.id,direction:r===v.id?a:"asc",onClick:y(v.id),sx:k=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:k.palette.mode==="dark"?"#ffffff":k.palette.text.primary,opacity:r===v.id?1:0,transition:"opacity 0.2s"},"&:hover .MuiTableSortLabel-icon":{opacity:.5},"&.Mui-active .MuiTableSortLabel-icon":{opacity:1,color:k.palette.mode==="dark"?"#ffffff":k.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:k.palette.mode==="dark"?"#ffffff":k.palette.text.primary}),children:jsx(Xn,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1},children:v.label})}),jsx(Xn,{onMouseDown:k=>b(k,v.id,typeof M=="number"?M:100),onClick:k=>k.stopPropagation(),sx:{position:"absolute",right:0,top:0,bottom:0,width:5,cursor:"col-resize","&:hover":{backgroundColor:"primary.main",opacity:.5},zIndex:1}})]},v.id)})]})})};var Qd=e=>{let{t}=ee(),{visibleRows:o,visibleColumns:a,selected:r=[],handleClick:n,columns:i,toggleGroupExpand:s,expandedGroups:p=new Set,selectionMode:l,grouping:c=[],isGroupFullyExpanded:g,handleExpandGroupRecursively:f,handleCollapseGroupRecursively:u}=e,h=m=>r.indexOf(m)!==-1,w=l==="multiple"||l==="single",d=c.length>0,C=a.length+(w?1:0)+(d?1:0);return jsxs(TableBody,{children:[o.map((m,y)=>{if(m.type==="group"){let b=p.has(m.id),T=m.childIds||[],A=T.filter(P=>h(P)).length,R=T.length>0&&A===T.length,S=A>0&&A<T.length;return jsxs(TableRow,{sx:P=>({backgroundColor:P.palette.mode==="dark"?"#111111":"#f5f5f5","& .MuiTableCell-root":{color:P.palette.text.primary,borderBottomColor:P.palette.divider},"& .MuiIconButton-root":{color:P.palette.text.primary},"& .MuiCheckbox-root":{color:P.palette.text.secondary},"& .MuiCheckbox-root.Mui-checked, & .MuiCheckbox-root.MuiCheckbox-indeterminate":{color:P.palette.primary.main}}),children:[w&&jsx(TableCell,{padding:"checkbox",children:jsx(Checkbox,{size:"small",checked:R,indeterminate:S,onChange:P=>{if(P.stopPropagation(),!!e.onSelectionChange)if(R){let v=r.filter(M=>!T.includes(M));e.onSelectionChange(v);}else {let v=Array.from(new Set([...r,...T]));e.onSelectionChange(v);}},onClick:P=>P.stopPropagation(),sx:{p:.5}})}),d&&jsx(TableCell,{padding:"checkbox",sx:{width:44},children:jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.25},children:[c.length>1&&m.level<c.length-1&&jsx(Tooltip,{title:g?.(m.id)?t("table.group.collapseAll"):t("table.group.expandAll"),children:jsx(IconButton,{size:"small",onClick:()=>{g?.(m.id)?u?.(m.id):f?.(m.id);},sx:{p:.25},children:g?.(m.id)?jsx(Lh,{fontSize:"small"}):jsx(Fh,{fontSize:"small"})})}),jsx(IconButton,{size:"small",onClick:()=>s&&s(m.id),sx:{p:.25},children:b?jsx(Wh,{}):jsx(wh,{})})]})}),jsx(TableCell,{colSpan:a.length,sx:{py:1,pl:m.level*3+1},children:jsxs(Typography,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[m.field,": ",m.value," (",m.count,")"]})})]},m.id)}else {let b=m.data||m,T=m.id||b.id||y,A=h(T),R=`enhanced-table-checkbox-${y}`,B=(m.level!==void 0?m.level:0)*4;return jsxs(TableRow,{hover:true,onClick:P=>n&&n(P,b),role:"checkbox","aria-checked":A,tabIndex:-1,selected:A,sx:{cursor:"pointer"},children:[w&&jsx(TableCell,{padding:"checkbox",sx:{pl:B>0?B+1:void 0},children:jsx(Checkbox,{color:"primary",checked:A,inputProps:{"aria-labelledby":R}})}),d&&jsx(TableCell,{padding:"checkbox",sx:{width:44}}),i.filter(P=>a.includes(P.id)).map((P,v)=>{let k=!w&&v===0&&B>0?{pl:B+2}:{};return jsx(TableCell,{align:"left",sx:k,children:P.render?P.render(b[P.id],b):(function(){let D=b[P.id];if(P.numeric){if(typeof D=="number")return D.toLocaleString();if(typeof D=="string"&&D.trim()!==""&&!isNaN(Number(D)))return Number(D).toLocaleString()}return D})()},P.id)})]},T)}}),o.length===0&&jsx(TableRow,{children:jsx(TableCell,{colSpan:C,align:"center",children:t("common.noData")})})]})};var Jd=e=>{let{visibleColumns:t,summaryRow:o,selectionMode:a,grouping:r=[]}=e;if(!e.showSummary)return null;let n=a==="multiple"||a==="single",i=r.length>0;return jsx(TableFooter,{sx:{position:"sticky",bottom:0,zIndex:e.zIndex,bgcolor:"background.paper"},children:jsxs(TableRow,{children:[n&&jsx(TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper"}}),i&&jsx(TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper",width:44}}),t.map(s=>jsx(TableCell,{sx:{fontWeight:"bold",fontSize:"0.85rem",bgcolor:"background.paper",color:"text.primary"},children:(function(){let l=o[s];return l==null||l===""?"":typeof l=="number"?l.toLocaleString():typeof l=="string"&&l.trim()!==""&&!isNaN(Number(l))?Number(l).toLocaleString():l})()},s))]})})};var tp=e=>{let{t}=ee();return jsx(Box,{sx:{p:2},children:jsx(Typography,{children:t("table.mobile.notImplemented")})})};var Wr=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:o,setGrouping:a,columns:r,toggleGroupField:n})=>{let{t:i}=ee();return jsxs(Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxs(Box,{sx:{p:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsx(Typography,{variant:"subtitle2",sx:{px:1},children:i("table.menu.groupBy")}),o.length>0&&jsx(Button,{size:"small",color:"error",onClick:()=>a([]),startIcon:jsx(oy,{}),children:i("table.menu.clearAll")})]}),jsx(Divider,{}),r.map(s=>{let p=o.includes(s.id),l=o.indexOf(s.id)+1;return jsx(MenuItem,{onClick:()=>n(s.id),children:jsxs(Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsx(Checkbox,{checked:p,size:"small"}),jsx(ListItemText,{primary:s.label}),p&&jsx(Badge,{badgeContent:l,color:"primary",sx:{mr:2}})]})},s.id)})]})},$r=({anchorEl:e,setAnchorEl:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=ee();return jsxs(Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:n("table.menu.visibleColumns")})}),jsx(Divider,{}),o.map(i=>jsxs(MenuItem,{onClick:()=>r(i.id),children:[jsx(Checkbox,{checked:a.includes(i.id),size:"small"}),jsx(ListItemText,{primary:i.label})]},i.id))]})},zi=({anchorEl:e,setAnchorEl:t,showSummary:o,setShowSummary:a,columns:r,summaryColumns:n,toggleSummaryColumn:i})=>{let{t:s}=ee();return jsxs(Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsx(MenuItem,{children:jsx(FormControlLabel,{control:jsx(Switch,{checked:o,onChange:p=>a(p.target.checked),size:"small"}),label:s("table.menu.showSummaryRow")})}),jsx(Divider,{}),r.filter(p=>p.numeric).map(p=>jsxs(MenuItem,{onClick:()=>i(p.id),disabled:!o,children:[jsx(Checkbox,{checked:n.includes(p.id),size:"small"}),jsx(ListItemText,{primary:p.label})]},p.id)),r.filter(p=>p.numeric).length===0&&jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:s("table.menu.noNumericColumns")})})]})},Ni=({contextMenu:e,handleCloseContextMenu:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=ee();return jsxs(Menu,{open:e!==null,onClose:t,anchorReference:"anchorPosition",anchorPosition:e!==null?{top:e.mouseY,left:e.mouseX}:void 0,children:[jsx(MenuItem,{onClick:t,children:n("common.copy")}),jsx(Divider,{}),jsx(MenuItem,{disabled:true,children:n("table.menu.visibleColumns")}),o.map(i=>jsxs(MenuItem,{onClick:()=>r(i.id),children:[jsx(ListItemIcon,{children:a.includes(i.id)&&jsx(ty,{fontSize:"small"})}),jsx(ListItemText,{children:i.label})]},i.id))]})};var Nn=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),rp=({kpis:e})=>{let{t}=ee(),o=[{label:t("graph.kpi.totalRecords"),value:Nn(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:Nn(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:Nn(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:Nn(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:Nn(e.flaggedCount,0),color:"error.main"}];return jsx(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(6, minmax(0, 1fr))"},gap:1.5},children:o.map(a=>jsxs(Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsx(Typography,{variant:"caption",color:"text.secondary",children:a.label}),jsx(Typography,{variant:"h4",fontWeight:800,sx:{color:a.color},children:a.value})]},a.label))})};var Vi=({title:e,subtitle:t,children:o})=>jsxs(Paper,{variant:"outlined",sx:{p:2,borderRadius:2},children:[jsx(Typography,{variant:"subtitle1",fontWeight:700,children:e}),t&&jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mb:2},children:t}),o]});var On=({data:e,orientation:t="horizontal",valueSuffix:o="",minHeight:a=210,activeName:r,onItemClick:n})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=Math.max(...e.map(s=>s.value),1);return t==="vertical"?jsx(Box,{sx:{display:"flex",gap:1,alignItems:"flex-end",minHeight:a},children:e.map(s=>jsxs(Box,{sx:{flex:1,minWidth:0},children:[jsx(Box,{onClick:()=>n?.(s),sx:{height:`${Math.max(s.value/i*180,6)}px`,bgcolor:s.name===r?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:n?"pointer":"default",opacity:r&&s.name!==r?.45:1}}),jsx(Typography,{variant:"caption",noWrap:true,title:s.name,sx:{display:"block",mt:.5},children:s.name}),jsxs(Typography,{variant:"caption",color:"text.secondary",children:[s.value.toFixed(1),o]})]},s.name))}):jsx(Stack,{spacing:1,children:e.map(s=>jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[jsx(Typography,{variant:"caption",color:"text.secondary",noWrap:true,title:s.name,children:s.name}),jsx(Box,{onClick:()=>n?.(s),sx:{alignSelf:"center",bgcolor:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:n?"pointer":"default",opacity:r&&s.name!==r?.45:1},children:jsx(Box,{sx:{width:`${s.value/i*100}%`,height:"100%",bgcolor:s.name===r?"primary.dark":"primary.main"}})}),jsxs(Typography,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[s.value.toFixed(1),o]})]},s.name))})};var lp=({data:e,color:t="#42A5F5",valueSuffix:o="",height:a=220})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let r=640,n=28,i=e.map(f=>f.value),s=Math.min(...i,0),l=Math.max(...i,1)-s||1,c=e.map((f,u)=>{let h=n+u*(r-n*2)/Math.max(e.length-1,1),w=a-n-(f.value-s)/l*(a-n*2);return {x:h,y:w,...f}}),g=c.map(f=>`${f.x},${f.y}`).join(" ");return jsxs(Box,{children:[jsxs(Box,{component:"svg",viewBox:`0 0 ${r} ${a}`,sx:{width:"100%",height:a},children:[jsx("line",{x1:n,y1:a-n,x2:r-n,y2:a-n,stroke:"rgba(148,163,184,0.4)"}),jsx("polyline",{fill:"none",stroke:t,strokeWidth:3,points:g}),c.map(f=>jsx("circle",{cx:f.x,cy:f.y,r:4,fill:t},f.name))]}),jsx(Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(f=>jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"caption",noWrap:true,title:f.name,sx:{display:"block"},children:f.name}),jsxs(Typography,{variant:"caption",color:"text.secondary",children:[f.value.toFixed(1),o]})]},f.name))})]})};var sp=({data:e,barColor:t="#64B5F6",lineColor:o="#FFB74D",height:a=220})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let r=640,n=28,i=Math.max(...e.map(c=>c.barValue),1),s=Math.max(...e.map(c=>c.lineValue),1),p=e.map((c,g)=>{let f=(r-n*2)/e.length,u=Math.max(f*.5,8),h=n+g*f+(f-u)/2,w=c.barValue/i*(a-n*2),d=a-n-w;return {x:h,y:d,barHeight:w,barWidth:u,item:c}}),l=e.map((c,g)=>{let f=(r-n*2)/e.length,u=n+g*f+f/2,h=a-n-c.lineValue/s*(a-n*2);return {x:u,y:h,item:c}});return jsxs(Stack,{spacing:1.25,children:[jsxs(Box,{component:"svg",viewBox:`0 0 ${r} ${a}`,sx:{width:"100%",height:a},children:[jsx("line",{x1:n,y1:a-n,x2:r-n,y2:a-n,stroke:"rgba(148,163,184,0.4)"}),p.map(c=>jsx("rect",{x:c.x,y:c.y,width:c.barWidth,height:Math.max(c.barHeight,4),rx:6,fill:t},c.item.name)),jsx("polyline",{fill:"none",stroke:o,strokeWidth:3,points:l.map(c=>`${c.x},${c.y}`).join(" ")}),l.map(c=>jsx("circle",{cx:c.x,cy:c.y,r:3.5,fill:o},`${c.item.name}-line`))]}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(c=>jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"caption",noWrap:true,title:c.name,sx:{display:"block"},children:c.name}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Bar: ",c.barValue.toFixed(1)]}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Line: ",c.lineValue.toFixed(1)]})]},c.name))})]})};var dy=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,dp=({data:e})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let t=Array.from(new Set(e.map(n=>n.x))),o=Array.from(new Set(e.map(n=>n.y))),a=Math.max(...e.map(n=>n.value),1),r=new Map(e.map(n=>[`${n.y}__${n.x}`,n.value]));return jsx(Box,{sx:{overflowX:"auto"},children:jsxs(Box,{sx:{display:"grid",gridTemplateColumns:`120px repeat(${t.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+t.length*64},children:[jsx(Box,{}),t.map(n=>jsx(Typography,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:n},n)),o.map(n=>jsxs(Box,{sx:{display:"contents"},children:[jsx(Typography,{variant:"caption",sx:{alignSelf:"center"},children:n}),t.map(i=>{let s=r.get(`${n}__${i}`)||0,p=s/a;return jsx(Box,{sx:{height:36,borderRadius:1,bgcolor:dy(p),border:"1px solid rgba(148,163,184,0.2)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsx(Typography,{variant:"caption",fontWeight:700,children:s.toFixed(1)})},`${n}-${i}`)})]},n))]})})};var py=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],Ki=({data:e,variant:t="donut",colors:o=py,size:a=180,activeName:r,onItemClick:n})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=0,s=e.map((p,l)=>{let c=i;return i+=p.percent,`${o[l%o.length]} ${c}% ${i}%`});return jsxs(Stack,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[jsx(Box,{sx:{width:a,height:a,borderRadius:"50%",background:`conic-gradient(${s.join(", ")})`,position:"relative",flexShrink:0},children:t==="donut"&&jsx(Box,{sx:{position:"absolute",inset:Math.round(a*.18),bgcolor:"background.paper",borderRadius:"50%"}})}),jsx(Stack,{spacing:1,sx:{minWidth:180},children:e.map((p,l)=>jsxs(Box,{onClick:()=>n?.(p),sx:{display:"flex",alignItems:"center",gap:1,cursor:n?"pointer":"default",opacity:r&&p.name!==r?.45:1},children:[jsx(Box,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:o[l%o.length]}}),jsx(Typography,{variant:"caption",sx:{flex:1},children:p.name}),jsxs(Typography,{variant:"caption",sx:{fontWeight:700},children:[p.percent.toFixed(0),"%"]})]},p.name))})]})};var up=({effect:e,branches:t})=>{if(t.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let o=t.filter((r,n)=>n%2===0),a=t.filter((r,n)=>n%2===1);return jsxs(Stack,{spacing:1.5,children:[jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(r=>jsxs(Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsx(Typography,{variant:"caption",fontWeight:700,children:r.title}),r.causes.map(n=>jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},r.title))}),jsxs(Box,{sx:{position:"relative",height:32},children:[jsx(Box,{sx:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),jsx(Box,{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,bgcolor:"primary.main",color:"primary.contrastText"},children:jsx(Typography,{variant:"caption",fontWeight:700,children:e})})]}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(a.length,1)}, minmax(0, 1fr))`,gap:1},children:a.map(r=>jsxs(Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsx(Typography,{variant:"caption",fontWeight:700,children:r.title}),r.causes.map(n=>jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},r.title))})]})};var gp=({data:e,height:t=240})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let o=0,a=e.map(g=>{let f=g.type==="total"?0:o,u=g.type==="total"?g.value:o+g.value;return g.type!=="total"&&(o=u),{...g,start:f,end:u,delta:u-f}}),r=a.flatMap(g=>[g.start,g.end]),n=Math.min(...r,0),i=Math.max(...r,1),s=680,p=30,l=i-n||1,c=g=>t-p-(g-n)/l*(t-p*2);return jsxs(Box,{children:[jsxs(Box,{component:"svg",viewBox:`0 0 ${s} ${t}`,sx:{width:"100%",height:t},children:[jsx("line",{x1:p,y1:c(0),x2:s-p,y2:c(0),stroke:"rgba(148,163,184,0.4)"}),a.map((g,f)=>{let u=(s-p*2)/a.length,h=Math.max(u*.55,8),w=p+f*u+(u-h)/2,d=c(Math.max(g.start,g.end)),C=c(Math.min(g.start,g.end)),m=g.type==="total"?"#42A5F5":g.delta>=0?"#66BB6A":"#EF5350";return jsxs("g",{children:[jsx("rect",{x:w,y:d,width:h,height:Math.max(C-d,4),rx:6,fill:m}),jsx("text",{x:w+h/2,y:d-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:g.end.toFixed(1)})]},g.name)})]}),jsx(Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${a.length}, minmax(0, 1fr))`,gap:1},children:a.map(g=>jsx(Typography,{variant:"caption",noWrap:true,title:g.name,children:g.name},g.name))})]})};var $n=({apiKey:e,query:t,zoom:o=14,mapType:a="roadmap"})=>{let r=encodeURIComponent(t);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(e)}&q=${r}&zoom=${o}&maptype=${a}`},NP=(e,t=360)=>{let o=$n(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};var yp=({apiKey:e,query:t,embedUrl:o,zoom:a=14,mapType:r="roadmap",height:n=320})=>{let i=o||(e&&t?$n({apiKey:e,query:t,zoom:a,mapType:r}):"");return i?jsxs(Box,{children:[jsx(Box,{component:"iframe",src:i,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsx(Link,{href:i,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):jsx(Box,{children:jsx(Typography,{variant:"body2",color:"text.secondary",children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var ji=({keyword:e,location:t,src:o="orbcafe-ui"})=>{if(t){let a=encodeURIComponent(t.name||e||"Location");return `https://uri.amap.com/marker?position=${t.lng},${t.lat}&name=${a}&src=${encodeURIComponent(o)}&coordinate=gaode&callnative=0`}return e?`https://uri.amap.com/search?keyword=${encodeURIComponent(e)}&src=${encodeURIComponent(o)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};var Cp=({keyword:e,location:t,embedUrl:o,height:a=320})=>{let r=o||ji({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0});return jsxs(Box,{children:[jsx(Box,{component:"iframe",src:r,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:a,border:0,borderRadius:2}}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsx(Link,{href:r,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var kp=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:o,interaction:a})=>{let{t:r}=ee();return jsxs(Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsx(Vi,{title:r("graph.chart.billable.title"),subtitle:r("graph.chart.billable.subtitle"),children:jsx(On,{data:e,orientation:"horizontal",activeName:a?.filters?.primaryDimension,onItemClick:n=>a?.onPrimaryDimensionClick?.(n.name)})}),jsx(Vi,{title:r("graph.chart.efficiency.title"),subtitle:r("graph.chart.efficiency.subtitle"),children:jsx(On,{data:t,orientation:"vertical",valueSuffix:"%",activeName:a?.filters?.secondaryDimension,onItemClick:n=>a?.onSecondaryDimensionClick?.(n.name)})}),jsx(Vi,{title:r("graph.chart.status.title"),subtitle:r("graph.chart.status.subtitle"),children:jsx(Ki,{data:o,variant:"donut",activeName:a?.filters?.status,onItemClick:n=>a?.onStatusClick?.(n.name)})})]})};var _t=e=>jsx(TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var _s=e=>jsx(TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var My=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],Ay=["zh","en","de","fr","ja","ko"],Tp=({open:e,onClose:t,value:o,onSaveAll:a,modelOptions:r=My,promptLangOptions:n=Ay,analysisTemplateOptions:i=[],responseTemplateOptions:s=[],defaultAnalysisTemplateId:p,defaultResponseTemplateId:l})=>{let[c,g]=useState(o),[f,u]=useState(p||""),[h,w]=useState(l||""),[d,C]=useState(false);useEffect(()=>{e&&(g(o),u(p||""),w(l||""));},[e,o,p,l]);let m=(b,T)=>{g(A=>({...A,[b]:T}));},y=async()=>{if(a)try{C(!0),await a({settings:c,analysisTemplateId:f||void 0,responseTemplateId:h||void 0});}finally{C(false);}};return jsxs(Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"lg",children:[jsxs(DialogTitle,{sx:{pr:7,pb:2.2},children:[jsx(Typography,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),jsx(IconButton,{onClick:t,sx:{position:"absolute",right:12,top:12},children:jsx(Jf,{})})]}),jsx(DialogContent,{sx:{pt:"18px !important"},children:jsxs(Stack,{spacing:2.2,children:[jsxs(Box,{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[jsx(Box,{children:jsx(_t,{size:"small",value:c.baseUrl,onChange:b=>m("baseUrl",b.target.value),fullWidth:true,label:"Base URL"})}),jsx(Box,{children:jsx(_t,{size:"small",type:"password",value:c.apiKey,onChange:b=>m("apiKey",b.target.value),fullWidth:true,label:"API Key"})}),jsx(Box,{children:jsx(_t,{size:"small",value:c.model,onChange:b=>m("model",b.target.value),fullWidth:true,select:true,label:"Model",children:r.map(b=>jsx(MenuItem,{value:b,children:b},b))})}),jsx(Box,{children:jsx(_t,{size:"small",value:c.promptLang,onChange:b=>m("promptLang",b.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:n.map(b=>jsx(MenuItem,{value:b,children:b},b))})})]}),jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[jsxs(_t,{size:"small",value:f,onChange:b=>u(b.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[jsx(MenuItem,{value:"",children:"Default"}),i.map(b=>jsx(MenuItem,{value:b.id,children:b.label},b.id))]}),jsx(_s,{multiline:true,minRows:8,value:c.analysisPrompt,onChange:b=>m("analysisPrompt",b.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxs(_t,{size:"small",value:h,onChange:b=>w(b.target.value),fullWidth:true,select:true,label:"Response Template",children:[jsx(MenuItem,{value:"",children:"Default"}),s.map(b=>jsx(MenuItem,{value:b.id,children:b.label},b.id))]}),jsx(_s,{multiline:true,minRows:8,value:c.responsePrompt,onChange:b=>m("responsePrompt",b.target.value),fullWidth:true,label:"Response Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),jsxs(DialogActions,{sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[jsx(Button,{variant:"outlined",onClick:t,children:"Cancel"}),jsx(Button,{variant:"contained",onClick:y,disabled:!a||d,children:"Save"})]})]})};var Ji=({open:e,onClose:t,model:o,tableContent:a,extraCharts:r,interaction:n,aiAssistant:i})=>{let{t:s}=ee(),[p,l]=useState(i?.defaultPrompt||""),[c,g]=useState(false),[f,u]=useState(false),h=n?.enabled!==false&&!!n,w=i?.enabled!==false,d=n?.filters||{},C=!!(d.primaryDimension||d.secondaryDimension||d.status),m=i?.placeholder||"Ask AI to analyze data, create charts, or find insights...";useEffect(()=>{e&&l(i?.defaultPrompt||"");},[e,i?.defaultPrompt]);let y=i?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},b=async()=>{let T=p.trim();if(!(!T||!i?.onSubmit))try{g(!0),await i.onSubmit(T,{filters:d,model:o});}finally{g(false);}};return jsx(Dialog,{open:e,onClose:t,fullScreen:true,children:jsxs(Box,{sx:{height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[jsx(Box,{sx:{p:2,borderBottom:1,borderColor:"divider"},children:jsxs(Stack,{direction:{xs:"column",lg:"row"},alignItems:{xs:"stretch",lg:"center"},justifyContent:"space-between",spacing:1.5,children:[jsxs(Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{flexWrap:"wrap"},children:[jsx(Typography,{variant:"h5",fontWeight:800,children:o.title}),jsx(Chip,{size:"small",label:s("graph.records",{count:o.kpis.totalRecords})}),h&&d.primaryDimension&&jsx(Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.primaryDimension}: ${d.primaryDimension}`,onDelete:()=>n?.onClearFilter("primaryDimension")}),h&&d.secondaryDimension&&jsx(Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.secondaryDimension}: ${d.secondaryDimension}`,onDelete:()=>n?.onClearFilter("secondaryDimension")}),h&&d.status&&jsx(Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.status}: ${d.status}`,onDelete:()=>n?.onClearFilter("status")}),h&&C&&jsx(Button,{size:"small",onClick:()=>n?.onClearAll(),children:"Clear"})]}),jsxs(Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{width:{xs:"100%",lg:"auto"}},children:[w&&jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minWidth:{xs:0,lg:520},flex:{xs:1,lg:"0 0 auto"}},children:[jsx(IconButton,{size:"small",onClick:i?.onVoiceInput,children:jsx(Ny,{sx:{fontSize:18,color:"text.secondary"}})}),jsx(InputBase,{fullWidth:true,value:p,onChange:T=>l(T.target.value),onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),b());},placeholder:m,sx:{fontSize:"0.9rem"}}),jsx(IconButton,{size:"small",onClick:b,disabled:c||!p.trim(),children:jsx(Oy,{sx:{fontSize:18}})}),jsx(IconButton,{size:"small",onClick:()=>u(true),children:jsx(Vy,{sx:{fontSize:18}})})]}),jsx(IconButton,{onClick:t,children:jsx(Jf,{})})]})]})}),jsxs(Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,overflow:"auto",minHeight:0},children:[jsx(rp,{kpis:o.kpis}),jsx(kp,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:h?{filters:d,onPrimaryDimensionClick:T=>n?.onPrimaryDimensionClick(T),onSecondaryDimensionClick:T=>n?.onSecondaryDimensionClick(T),onStatusClick:T=>n?.onStatusClick(T)}:void 0}),r,a]}),jsx(Tp,{open:f,onClose:()=>u(false),value:y,onSaveAll:i?.onSaveAll,modelOptions:i?.modelOptions,promptLangOptions:i?.promptLangOptions,analysisTemplateOptions:i?.analysisTemplateOptions,responseTemplateOptions:i?.responseTemplateOptions,defaultAnalysisTemplateId:i?.defaultAnalysisTemplateId,defaultResponseTemplateId:i?.defaultResponseTemplateId})]})})};var za={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"]},Wy=5,Ip=e=>e.toLowerCase().replace(/[\s_-]/g,""),Na=(e,t,o,a)=>{if(t)return t;if(e.length===0)return a;let r=Object.keys(e[0]),n=new Map(r.map(i=>[Ip(i),i]));for(let i of o){let s=n.get(Ip(i));if(s)return s}return r[0]||a},po=e=>{if(typeof e=="number")return Number.isFinite(e)?e:0;if(typeof e=="string"){let t=Number(e.replace(/,/g,"").trim());return Number.isFinite(t)?t:0}return 0},$t=(e,t)=>e==null||e===""?t:String(e),$y=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let s=$t(i[t],r);n.set(s,(n.get(s)||0)+po(i[o]));}),Array.from(n.entries()).map(([i,s])=>({name:i,value:s})).sort((i,s)=>s.value-i.value).slice(0,a)},Gy=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(s=>{let p=$t(s[t],n),l=i.get(p)||{report:0,billable:0};l.report+=po(s[o]),l.billable+=po(s[a]),i.set(p,l);}),Array.from(i.entries()).map(([s,p])=>({name:s,value:p.report>0?p.billable/p.report*100:0})).sort((s,p)=>s.value-p.value).slice(0,r)},Uy=(e,t,o)=>{let a=e.length;if(a===0)return [];let r=new Map;return e.forEach(n=>{let i=$t(n[t],o);r.set(i,(r.get(i)||0)+1);}),Array.from(r.entries()).map(([n,i])=>({name:n,value:i,percent:i/a*100}))},Pp=(e,t,o)=>{let a=new Map;return e.forEach(r=>{let n=$t(r[t],"N/A");a.set(n,(a.get(n)||0)+po(r[o]));}),Array.from(a.entries()).sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>({name:r,value:n}))},Ky=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(s=>{let p=$t(s[t],n),l=i.get(p)||{report:0,billable:0};l.report+=po(s[o]),l.billable+=po(s[a]),i.set(p,l);}),Array.from(i.entries()).map(([s,p])=>({name:s,barValue:p.billable,lineValue:p.report>0?p.billable/p.report*100:0})).sort((s,p)=>p.barValue-s.barValue).slice(0,r)},qy=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let s=$t(i[t],r),p=$t(i[o],r),l=`${s}__${p}`;n.set(l,(n.get(l)||0)+po(i[a]));}),Array.from(n.entries()).map(([i,s])=>{let[p,l]=i.split("__");return {x:p,y:l,value:s}})},_y=(e,t,o)=>{let a=Pp(e,t,o),r=a.map(i=>({name:i.name,value:i.value,type:"delta"})),n=a.reduce((i,s)=>i+s.value,0);return [...r,{name:"Total",value:n,type:"total"}]},jy=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(s=>{let p=$t(s[t],n),l=`${$t(s[o],n)} / ${$t(s[a],n)}`,c=i.get(p)||new Map;c.set(l,(c.get(l)||0)+1),i.set(p,c);}),Array.from(i.entries()).map(([s,p])=>({title:s,causes:Array.from(p.entries()).sort((l,c)=>c[1]-l[1]).slice(0,r).map(([l,c])=>`${l} (${c})`)})).slice(0,6)},Qr=({rows:e,config:t})=>{let{t:o}=ee(),a=o("graph.unassigned"),r=useMemo(()=>{let c=t?.fieldMapping;return {primaryDimension:Na(e,c?.primaryDimension,za.primaryDimension,"Category"),secondaryDimension:Na(e,c?.secondaryDimension,za.secondaryDimension,"Owner"),status:Na(e,c?.status,za.status,"Status"),date:Na(e,c?.date,za.date,"Date"),description:Na(e,c?.description,za.description,"Description"),reportHours:Na(e,c?.reportHours,za.reportHours,"ReportHours"),billableHours:Na(e,c?.billableHours,za.billableHours,"BillableHours"),amount:Na(e,c?.amount,za.amount,"Amount")}},[e,t?.fieldMapping]),n=useMemo(()=>e.map((c,g)=>{let f=po(c[r.reportHours]),u=po(c[r.billableHours]),h=po(c[r.amount]),w=f>0?u/f*100:0;return {id:`graph-row-${g}`,Date:$t(c[r.date],""),Primary:$t(c[r.primaryDimension],a),Secondary:$t(c[r.secondaryDimension],a),Description:$t(c[r.description],""),ReportHours:f,BillableHours:u,Amount:h,Efficiency:w,Status:$t(c[r.status],a)}}),[e,r,a]),i=useMemo(()=>{let c=n.length,g=n.reduce((C,m)=>C+po(m.ReportHours),0),f=n.reduce((C,m)=>C+po(m.BillableHours),0),u=n.reduce((C,m)=>C+po(m.Amount),0),h=g>0?f/g*100:0,w=t?.statusFlagValues||["flag","flagged","warning","risk"],d=n.filter(C=>w.includes($t(C.Status,"").toLowerCase())).length;return {totalRecords:c,totalReportHours:g,totalBillableHours:f,efficiency:h,totalAmount:u,flaggedCount:d}},[n,t?.statusFlagValues]),s=t?.topN||Wy,p=useMemo(()=>({billableByPrimary:$y(n,"Primary","BillableHours",s,a),efficiencyBySecondary:Gy(n,"Secondary","ReportHours","BillableHours",s,a),statusDistribution:Uy(n,"Status",a),lineByDate:Pp(n,"Date","BillableHours"),comboByPrimary:Ky(n,"Primary","ReportHours","BillableHours",s,a),heatmapPrimarySecondary:qy(n,"Primary","Secondary","BillableHours",a),waterfallBillable:_y(n,"Date","BillableHours"),fishboneStatusCauses:jy(n,"Status","Primary","Secondary",3,a)}),[n,s,a]),l=useMemo(()=>({title:t?.title||o("graph.reportTitle"),kpis:i,charts:p,table:{columns:[{id:"Date",label:r.date},{id:"Primary",label:r.primaryDimension},{id:"Secondary",label:r.secondaryDimension},{id:"Description",label:r.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:r.status}],rows:n}}),[p,t?.title,r,i,n,o]);return {fieldMapping:r,model:l}};var Jr=e=>String(e??"").trim(),tl=(e={})=>{let[t,o]=useState(e),a=useCallback((p,l)=>{o(c=>{let g=l?.trim();if(!g){let f={...c};return delete f[p],f}if(c[p]===g){let f={...c};return delete f[p],f}return {...c,[p]:g}});},[]),r=useCallback(p=>{o(l=>{if(!l[p])return l;let c={...l};return delete c[p],c});},[]),n=useCallback(()=>{o({});},[]),i=useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),s=useCallback((p,l)=>p.filter(c=>!(t.primaryDimension&&Jr(c[l.primaryDimension])!==Jr(t.primaryDimension)||t.secondaryDimension&&Jr(c[l.secondaryDimension])!==Jr(t.secondaryDimension)||t.status&&Jr(c[l.status])!==Jr(t.status))),[t]);return {filters:t,setFilter:a,clearFilter:r,clearAll:n,hasActiveFilters:i,applyRows:s}};var al=({variants:e,currentVariantId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=ee(),p=useTheme().palette.mode==="dark",l="0.85rem",c={xs:"calc((100% - 1 * 16px) / 2)",sm:"calc((100% - 2 * 16px) / 3)",md:"calc((100% - 3 * 16px) / 4)",lg:"calc((100% - 5 * 16px) / 6)"},[g,f]=useState(false),[u,h]=useState(""),[w,d]=useState(false),[C,m]=useState(false),y=e.find(A=>A.id===t),b=()=>{h(y?.name||i("variant.newVariant")),d(y?.isDefault||false),m(y?.isPublic||false),f(true);},T=()=>{a({name:u,isDefault:w,isPublic:C,description:""}),f(false);};return jsxs(Box,{sx:{display:"flex",gap:1,alignItems:"center",width:"100%",maxWidth:"100%"},children:[jsx(Autocomplete,{size:"small",sx:{width:c,"& .MuiInputBase-root":{fontSize:l,bgcolor:p?"rgba(25, 118, 210, 0.2)":"#e7f1ff","& .MuiOutlinedInput-notchedOutline":{borderColor:p?"rgba(144,202,249,0.45)":"rgba(25,118,210,0.45)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:p?"rgba(144,202,249,0.7)":"rgba(25,118,210,0.65)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:p?"rgba(144,202,249,0.9)":"rgba(25,118,210,0.85)"}},"& .MuiInputBase-input":{fontSize:l},"& .MuiAutocomplete-noOptions":{fontSize:l}},noOptionsText:jsx(Typography,{sx:{fontSize:l},children:i("variant.noOptions")}),options:e,getOptionLabel:A=>A.name+(A.isDefault?` (${i("variant.defaultSuffix")})`:""),value:y||null,onChange:(A,R)=>{R&&o(R);},renderInput:A=>jsx(TextField,{...A,variant:"outlined",size:"small",InputProps:{...A.InputProps,sx:{fontSize:l,color:p?"#E3F2FD":"#0D47A1"}},placeholder:i("variant.selectVariant")}),renderOption:(A,R)=>jsx("li",{...A,children:jsxs(Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsx(Typography,{sx:{flex:1,fontSize:l},children:R.name}),R.isDefault&&jsx(ib,{fontSize:"small",color:"action"})]})})}),jsx(Tooltip,{title:i("variant.saveView"),children:jsx(IconButton,{onClick:b,size:"small",color:"primary",children:jsx(jp,{fontSize:"small"})})}),jsxs(Dialog,{open:g,onClose:()=>f(false),children:[jsx(DialogTitle,{children:i("variant.saveView")}),jsxs(DialogContent,{children:[jsx(TextField,{autoFocus:true,margin:"dense",label:i("variant.viewName"),fullWidth:true,variant:"outlined",value:u,onChange:A=>h(A.target.value)}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:w,onChange:A=>d(A.target.checked)}),label:i("variant.setDefault")}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:C,onChange:A=>m(A.target.checked)}),label:i("variant.publicAllUsers")})]}),jsxs(DialogActions,{children:[jsx(Button,{onClick:()=>f(false),children:i("common.cancel")}),jsx(Button,{onClick:T,variant:"contained",children:i("common.save")})]})]})]})};var Lp=({appId:e,tableKey:t="default",currentFilters:o,currentLayoutId:a,layoutRefs:r,onLoad:n,variantService:i,serviceUrl:s,onError:p,onSuccess:l,currentVariantId:c,onVariantChange:g})=>{let{t:f}=ee(),[u,h]=useState([]),[w,d]=useState(""),C=`orbcafe.variants.${e}.${t}`,m=c!==void 0?c:w,y=M=>{c===void 0&&d(M),g&&g(M);},b=useCallback(()=>{try{let M=localStorage.getItem(C);if(!M)return [];let k=JSON.parse(M);return Array.isArray(k)?k:[]}catch{return []}},[C]),T=useCallback(M=>{try{localStorage.setItem(C,JSON.stringify(M));}catch{}},[C]),A=useCallback(M=>{h(M);let k=M.find(I=>I.isDefault);k&&!m&&(y(k.id),n(k));},[m,n,y]),R=useCallback(async()=>{if(!e)return [];try{let M=[];if(i)M=await i.getVariants(e,t);else if(s){let k=await fetch(`${s}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!k.ok)throw new Error(f("variant.toast.fetchFailed"));M=await k.json();}else M=b();return A(M),M}catch(M){console.error("Error fetching variants",M);let k=b();return A(k),p&&p(f("variant.toast.fetchFailed")),k}},[e,t,i,s,b,A,p,f]);return useEffect(()=>{R();},[e,t]),jsx(al,{variants:u,currentVariantId:m,onLoad:M=>{y(M.id),n(M);},onSave:async M=>{let k=Date.now().toString(),I;try{let D=M.scope||"Both",G=u.find(oe=>oe.name===M.name);k=G?G.id:Date.now().toString();let V=[];if(G&&(Array.isArray(G.filters)?V=[...G.filters]:G.filters&&(V=[{scope:"default",filters:G.filters}])),D==="Search"||D==="Both"){let oe=(Array.isArray(o),o);if(oe)if(Array.isArray(oe)&&oe.length>0&&oe[0].scope)oe.forEach(re=>{let _=V.findIndex(qe=>qe.scope===re.scope);_>=0?V[_]=re:V.push(re);});else {let re={scope:t,filters:oe},_=V.findIndex(qe=>qe.scope===t);_>=0?V[_]=re:V.push(re);}}let X=G?.layout||{},de=[];if(G&&Array.isArray(G.layoutRefs)&&(de=[...G.layoutRefs]),D==="Layout"||D==="Both")if(r&&r.length>0)r.forEach(oe=>{let re=de.findIndex(_=>_.tableKey===oe.tableKey);re>=0?de[re]=oe:de.push(oe);});else {let oe={tableKey:t,layoutId:a||null},re=de.findIndex(_=>_.tableKey===t);re>=0?de[re]=oe:de.push(oe);}if(I={appId:e,tableKey:t,...M,scope:D,id:k,createdAt:new Date().toISOString(),filters:V,layout:X,layoutRefs:de},i)await i.saveVariant(I,e,t);else if(s){if(!(await fetch(`${s}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(I)})).ok)throw new Error(f("variant.toast.saveFailed"))}else {let re=u.some(_=>_.id===k)?u.map(_=>_.id===k?I:_):[...u,I];h(re),T(re);}l&&l(f("variant.toast.saveSuccess")),(i||s)&&await R(),y(k),n(I);}catch(D){console.error("Error saving variant",D);let V=u.some(X=>X.id===k)?u.map(X=>X.id===k?I:X):[...u,I];h(V),T(V),y(k),n(I),p&&p(f("variant.toast.saveFailed"));}},onDelete:async M=>{try{if(i)await i.deleteVariant(M);else if(s){if(!(await fetch(`${s}/api/variants/${M}`,{method:"DELETE"})).ok)throw new Error(f("variant.toast.deleteFailed"))}else {let k=u.filter(I=>I.id!==M);h(k),T(k);}m===M&&y(""),(i||s)&&R(),l&&l(f("variant.toast.deleteSuccess"));}catch(k){console.error("Error deleting variant",k);let I=u.filter(D=>D.id!==M);h(I),T(I),m===M&&y(""),p&&p(f("variant.toast.deleteFailed"));}},onSetDefault:async M=>{try{let k=u.find(D=>D.id===M);if(!k)return;let I={appId:e,tableKey:t,...k,isDefault:!0};if(i)await i.setDefaultVariant(M,e,t);else if(s){if(!(await fetch(`${s}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(I)})).ok)throw new Error(f("variant.toast.defaultFailed"))}else {let D=u.map(G=>({...G,isDefault:G.id===M}));h(D),T(D);}(i||s)&&await R(),l&&l(f("variant.toast.defaultSuccess"));}catch(k){console.error("Error setting default variant",k);let I=u.map(D=>({...D,isDefault:D.id===M}));h(I),T(I),p&&p(f("variant.toast.defaultFailed"));}}})};ta.extend(wb);ta.extend(Tb);var Ib=[null,null],Qs="0.85rem",Pb={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},Rb=styled(PickersDay,{shouldForwardProp:e=>e!=="isInRange"&&e!=="isStart"&&e!=="isEnd"&&e!=="isHovered"})(({theme:e,isInRange:t,isStart:o,isEnd:a,isHovered:r})=>({...t&&{borderRadius:0,backgroundColor:e.palette.primary.light,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.main}},...r&&!t&&!o&&!a&&{borderRadius:0,backgroundColor:e.palette.action.hover,border:`1px dashed ${e.palette.primary.main}`},...o&&{borderRadius:"50% 0 0 50%",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...a&&{borderRadius:"0 50% 50% 0",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...o&&a&&{borderRadius:"50%"}})),Vp=({label:e,value:t=Ib,onChange:o})=>{let{t:a,locale:r}=ee(),n=Pb[r]||"en",i=e||a("dateRange.label"),[s,p]=useState(null),[l,c]=useState(t),[g,f]=useState("start"),[u,h]=useState(null),[w,d]=useState((t[0]||ta()).locale(n)),C=vt__default.useRef(t);useEffect(()=>{let[k,I]=t,[D,G]=C.current,V=oe=>oe&&typeof oe.isSame=="function",X=!(k===null&&D===null||V(k)&&V(D)&&k.isSame(D,"day")),de=!(I===null&&G===null||V(I)&&V(G)&&I.isSame(G,"day"));(X||de)&&(c(t),t[0]&&V(t[0])&&d(t[0].locale(n))),C.current=t;},[t,n]);let m=k=>{p(k.currentTarget);},y=()=>{p(null),f("start"),h(null);},b=!!s,T=k=>{if(!k)return;let I=[...l];if(g==="start")I=[k,null],f("end");else {let D=I[0];D&&k.isBefore(D)?(I=[k,null],f("end")):(I=[D,k],f("start"));}c(I);},A=k=>{let I=ta().locale(n),D=[null,null];switch(k){case "today":D=[I,I];break;case "week":D=[I.startOf("week"),I.endOf("week")];break;case "month":D=[I.startOf("month"),I.endOf("month")];break}c(D),f("start"),d(I);},R=()=>{c([null,null]),f("start"),d(ta().locale(n));},S=()=>{o&&o(l),y();},B=()=>{c(t),f("start"),y();},P=useCallback(k=>{let{day:I,...D}=k,[G,V]=l,X=G?I.isSame(G,"day"):false,de=V?I.isSame(V,"day"):false,oe=G&&V?I.isBetween(G,V,"day","()"):false,re=false;return g==="end"&&G&&!V&&u&&I.isAfter(G,"day")&&I.isBefore(u.add(1,"day"),"day")&&(re=true),jsx(Rb,{...D,day:I,disableMargin:true,isStart:X,isEnd:de,isInRange:oe||re,onMouseEnter:()=>h(I)})},[l,g,u]),v=k=>k?k.locale(n).format("YYYY-MM-DD"):"",M=k=>k?k.locale(n).format("ll"):"";return jsxs(Box,{children:[jsx(TextField,{label:i,value:l[0]?`${v(l[0])} - ${v(l[1])}`:"",onClick:m,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Qs}},InputProps:{readOnly:true,sx:{fontSize:Qs,"& .MuiOutlinedInput-input":{fontSize:Qs},paddingRight:"4px"},endAdornment:jsxs(InputAdornment,{position:"end",sx:{ml:0},children:[(l[0]||l[1])&&jsx(IconButton,{size:"small",onClick:k=>{k.stopPropagation(),R();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsx(Qf,{sx:{fontSize:"1rem"}})}),jsx(IconButton,{size:"small",edge:"end",onClick:m,sx:{padding:"2px"},children:jsx(Cb,{sx:{fontSize:"1rem"},color:"action"})})]})}}),jsxs(Popover,{open:b,anchorEl:s,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{display:"flex",flexDirection:"column",p:0,minWidth:320}}},children:[jsx(Box,{sx:{p:2,bgcolor:"background.default",borderBottom:1,borderColor:"divider"},children:jsxs(Stack,{direction:"row",alignItems:"center",spacing:2,justifyContent:"space-between",children:[jsxs(Box,{sx:{p:1,border:1,borderColor:g==="start"?"primary.main":"divider",borderRadius:1,bgcolor:g==="start"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>f("start"),children:[jsx(Typography,{variant:"caption",color:"text.secondary",display:"block",children:a("dateRange.startDate")}),jsx(Typography,{variant:"body2",fontWeight:500,children:l[0]?M(l[0]):a("dateRange.select")})]}),jsx(Sb,{color:"action",fontSize:"small"}),jsxs(Box,{sx:{p:1,border:1,borderColor:g==="end"?"primary.main":"divider",borderRadius:1,bgcolor:g==="end"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>{l[0]&&f("end");},children:[jsx(Typography,{variant:"caption",color:"text.secondary",display:"block",children:a("dateRange.endDate")}),jsx(Typography,{variant:"body2",fontWeight:500,children:l[1]?M(l[1]):a("dateRange.select")})]})]})}),jsx(Box,{sx:{p:2,pb:0},children:jsxs(Stack,{direction:"row",spacing:1,justifyContent:"center",children:[jsx(Chip,{label:a("dateRange.today"),onClick:()=>A("today"),clickable:true,size:"small",variant:"outlined"}),jsx(Chip,{label:a("dateRange.thisWeek"),onClick:()=>A("week"),clickable:true,size:"small",variant:"outlined"}),jsx(Chip,{label:a("dateRange.thisMonth"),onClick:()=>A("month"),clickable:true,size:"small",variant:"outlined"})]})}),jsx(LocalizationProvider,{dateAdapter:AdapterDayjs,adapterLocale:n,children:jsx(DateCalendar,{value:null,referenceDate:w,onMonthChange:d,onYearChange:d,onChange:T,slots:{day:P},views:["day"],showDaysOutsideCurrentMonth:true,sx:{m:0}})}),jsx(Divider,{}),jsxs(Stack,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[jsx(Button,{size:"small",onClick:B,color:"inherit",children:a("common.cancel")}),jsx(Button,{size:"small",variant:"contained",onClick:S,children:a("common.done")})]})]})]})};var ll={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},Ob={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"},Hb=["equals","contains","notContains","wildcard"],Wp=["=","!=",">","<",">=","<=","between"],mt="0.85rem",Wb=({field:e,value:t,onChange:o})=>{let{t:a}=ee(),[r,n]=useState(null),[i,s]=useState(null),[p,l]=useState(""),[c,g]=useState(""),[f,u]=useState(false),[h,w]=useState(""),[d,C]=useState("");useEffect(()=>{let v=setTimeout(()=>{C(h);},1e3);return ()=>clearTimeout(v)},[h]);let m=t?.operator||(e.type==="number"?"=":"equals"),y=t?.value,b=v=>{let M=Ob[v];return M?a(M):v},T=v=>{n(v.currentTarget);},A=v=>{o({...t,operator:v,value:y}),n(null);},R={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:mt}},InputProps:{sx:{fontSize:mt}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:mt,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},S=e.type||"text";if(S==="date"){let M=(k=>{if(!k)return [null,null];if(Array.isArray(k)&&k.length===2){let I=k[0]?ta.isDayjs(k[0])?k[0]:ta(k[0]):null,D=k[1]?ta.isDayjs(k[1])?k[1]:ta(k[1]):null;return [I,D]}return ta.isDayjs(k)||typeof k=="string"?[ta.isDayjs(k)?k:ta(k),null]:[null,null]})(y);return jsx(Vp,{label:e.label,value:M,onChange:k=>o({value:k,operator:"between"})})}if(S==="number"&&m==="between"){let v=()=>{o({value:[p,c],operator:"between"}),s(null);},M=Array.isArray(y)?`${y[0]||""} - ${y[1]||""}`:"";return jsxs(Fragment,{children:[jsx(TextField,{...R,label:e.label,value:M,placeholder:a("smartFilter.minMaxPlaceholder"),InputProps:{...R.InputProps,startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Tooltip,{title:b("between"),children:jsx(IconButton,{size:"small",onClick:T,sx:{width:24,height:24,fontSize:mt},children:ll.between})})}),readOnly:true},onClick:k=>s(k.currentTarget)}),jsx(Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:mt,minHeight:"auto",py:.5}}},children:Wp.map(k=>jsxs(MenuItem,{selected:k===m,onClick:()=>A(k),children:[jsx(Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:ll[k]}),jsx(ListItemText,{primary:b(k),primaryTypographyProps:{fontSize:mt}})]},k))}),jsx(Popover,{open:!!i,anchorEl:i,onClose:()=>s(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:jsxs(Box,{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[jsx(TextField,{size:"small",label:a("smartFilter.min"),type:"number",value:p,onChange:k=>l(k.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:mt}},InputProps:{sx:{fontSize:mt}}}),jsx(Vb,{color:"action"}),jsx(TextField,{size:"small",label:a("smartFilter.max"),type:"number",value:c,onChange:k=>g(k.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:mt}},InputProps:{sx:{fontSize:mt}}}),jsx(Button,{variant:"contained",size:"small",onClick:v,children:a("common.ok")})]})})]})}if(e.isValueHelp||S==="value-help"){let v=e.valueHelp?.mode||"single";return jsx(Kd,{...R,...e.valueHelp,label:e.label,placeholder:e.placeholder||e.valueHelp?.placeholder,value:y??(v==="multiple"?[]:null),mode:v,onChange:M=>o({value:M,operator:v==="multiple"?"anyOf":"equals"})})}if(S==="select")return jsxs(TextField,{...R,select:true,label:e.label,value:y||"",onChange:v=>o({...t,value:v.target.value,operator:"equals"}),children:[jsx(MenuItem,{value:"",children:jsx("em",{children:a("common.none")})}),e.options?.map(v=>jsx(MenuItem,{value:v.value,children:v.label},v.value))]});if(S==="multi-select"){let v=Array.isArray(y)?y:[],M=e.options?.filter(k=>k.label.toLowerCase().includes(d.toLowerCase()))||[];return jsxs(TextField,{...R,select:true,label:e.label,value:v,onChange:k=>o({...t,value:k.target.value,operator:"anyOf"}),SelectProps:{...R.SelectProps,multiple:true,onClose:()=>{w(""),C("");},renderValue:k=>{if(!Array.isArray(k)||k.length===0)return jsx("em",{children:a("common.none")});let I=G=>e.options?.find(V=>V.value===G)?.label||G,D=k.map(I);return D.length>2?`${D.slice(0,2).join(", ")} +${D.length-2}`:D.join(", ")}},children:[jsx(ListSubheader,{children:jsx(TextField,{size:"small",autoFocus:true,placeholder:a("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Wd,{fontSize:"small"})}),sx:{fontSize:mt}},value:h,onChange:k=>w(k.target.value),onKeyDown:k=>{k.key!=="Escape"&&k.stopPropagation();},onClick:k=>k.stopPropagation()})}),M.length>0?M.map(k=>jsxs(MenuItem,{value:k.value,children:[jsx(Checkbox,{checked:v.indexOf(k.value)>-1,size:"small"}),jsx(ListItemText,{primary:k.label,primaryTypographyProps:{fontSize:mt}})]},k.value)):jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:a("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:mt}})})]})}let B=S==="number"?Wp:Hb,P=f||y!==void 0&&y!==""&&y!==null||!!r;return jsxs(Fragment,{children:[jsx(TextField,{...R,label:e.label,sx:{minWidth:"120px"},value:y||"",type:S==="number"?"number":"text",onChange:v=>o({...t,value:v.target.value,operator:m}),onFocus:()=>u(true),onBlur:()=>u(false),InputProps:{...R.InputProps,startAdornment:P?jsx(InputAdornment,{position:"start",children:jsx(Tooltip,{title:b(m),children:jsx(IconButton,{size:"small",onClick:T,onMouseDown:v=>v.preventDefault(),sx:{width:24,height:24,fontSize:mt,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:ll[m]})})}):null,endAdornment:e.hasSearchIcon?jsx(InputAdornment,{position:"end",children:jsx(Wd,{color:"action"})}):void 0}}),jsx(Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:mt,minHeight:"auto",py:.5}}},children:B.map(v=>jsxs(MenuItem,{selected:v===m,onClick:()=>A(v),children:[jsx(Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:ll[v]}),jsx(ListItemText,{primary:b(v),primaryTypographyProps:{fontSize:mt}})]},v))})]})},ma=({fields:e,filters:t,onFilterChange:o,variants:a=[],currentVariantId:r,onVariantLoad:n,onVariantSave:i,onVariantDelete:s,onVariantSetDefault:p,onSearch:l,loading:c=false,appId:g,tableKey:f,currentLayout:u,currentLayoutId:h,layoutRefs:w,variantService:d,serviceUrl:C})=>{let{t:m}=ee(),[y,b]=useState(true),[T,A]=useState(null),[R,S]=useState(e.filter(M=>!M.hidden).map(M=>M.id)),B=(M,k)=>{o({...t,[M]:k});},P=M=>{R.includes(M)?S(R.filter(k=>k!==M)):S([...R,M]);};return jsxs(Paper,{sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[jsxs(Box,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[g?jsx(Lp,{appId:g,tableKey:f,currentFilters:{values:t,visibleFields:R},currentLayout:u,currentLayoutId:h,layoutRefs:w,onLoad:M=>{if(!M.filters)return;let k=null;if(Array.isArray(M.filters)){let I=f||"default",D=M.filters.find(G=>G.scope===I);k=D?D.filters:null;}else k=M.filters;k&&(k.values||k.visibleFields?(k.visibleFields&&Array.isArray(k.visibleFields)&&S(k.visibleFields),k.values&&o(k.values)):o(k)),n&&n(M);},variantService:d,serviceUrl:C,currentVariantId:r}):jsx(al,{variants:a,currentVariantId:r,onLoad:n,onSave:M=>{i&&i({...M,filters:{values:t,visibleFields:R}});},onDelete:s,onSetDefault:p}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(Tooltip,{title:m("smartFilter.addFilters"),children:jsx(Button,{onClick:M=>A(M.currentTarget),size:"small",color:"primary",startIcon:jsx(Lb,{fontSize:"small"}),sx:{textTransform:"none",fontSize:mt,whiteSpace:"nowrap",minWidth:"fit-content"},children:m("smartFilter.adaptFilters")})}),jsx(Button,{variant:"contained",size:"small",onClick:l,disabled:c,sx:{minWidth:"52px",fontWeight:"bold",fontSize:mt},children:m(c?"common.loading":"smartFilter.go")}),jsxs(Menu,{anchorEl:T,open:!!T,onClose:()=>A(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:mt,minHeight:32}}}},children:[jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:m("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:mt}})}),jsx(Divider,{}),e.map(M=>jsxs(MenuItem,{onClick:()=>P(M.id),children:[jsx(Checkbox,{checked:R.includes(M.id),size:"small"}),jsx(ListItemText,{primary:M.label,primaryTypographyProps:{fontSize:mt}})]},M.id))]})]})]}),jsx(Collapse,{in:y,children:jsx(Box,{sx:{px:2,pb:2},children:jsx(Grid,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:e.filter(M=>R.includes(M.id)).map(M=>jsx(Grid,{size:1,children:jsx(Wb,{field:M,value:t[M.id]||{value:"",operator:M.type==="number"?"=":"equals"},onChange:k=>B(M.id,k)})},M.id))})})}),jsx(Box,{sx:{position:"absolute",bottom:0,left:"50%",transform:"translate(-50%, 50%)",zIndex:10},children:jsx(IconButton,{size:"small",onClick:()=>b(!y),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:20,height:20,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:y?jsx(zb,{sx:{fontSize:16},color:"action"}):jsx(Wh,{sx:{fontSize:16},color:"action"})})})]})};var Zp=({layouts:e,currentLayoutId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=ee(),[s,p]=useState(null),[l,c]=useState(false),[g,f]=useState(""),[u,h]=useState(""),[w,d]=useState({isDefault:false,isPublic:false}),C=e.find(R=>R.id===t),m=R=>{p(R.currentTarget);},y=()=>{p(null);},b=R=>{o(R),y();},T=()=>{f(""),h(""),d({isDefault:false,isPublic:false}),c(true),y();},A=()=>{g.trim()&&(a({name:g,description:u,...w}),c(false));};return jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(Tooltip,{title:i("layout.saveLayout"),children:jsx(IconButton,{onClick:T,color:"primary",size:"small",children:jsx(jp,{})})}),jsx(Tooltip,{title:i("layout.layoutOptions"),children:jsx(IconButton,{onClick:m,color:C?"primary":"default",children:jsx(Jb,{})})}),jsxs(Menu,{anchorEl:s,open:!!s,onClose:y,PaperProps:{sx:{width:320,maxHeight:400}},children:[jsx(MenuItem,{disabled:true,children:jsx(Typography,{variant:"caption",children:i("layout.selectLayout")})}),jsxs(MenuItem,{onClick:T,children:[jsx(ListItemIcon,{children:jsx(jp,{fontSize:"small"})}),jsx(ListItemText,{children:i("layout.saveCurrentLayout")})]}),jsx(Divider,{}),e.length===0&&jsx(MenuItem,{disabled:true,children:jsx(Typography,{variant:"body2",color:"text.secondary",children:i("layout.noSavedLayouts")})}),e.map((R,S)=>jsx(MenuItem,{onClick:()=>b(R),selected:R.id===t,children:jsxs(Box,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[jsxs(Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[jsx(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsx(Typography,{variant:"body2",fontWeight:R.id===t?"bold":"normal",noWrap:true,children:R.name})}),R.description&&jsx(Typography,{variant:"caption",color:"text.secondary",noWrap:true,children:R.description})]}),jsxs(Box,{sx:{display:"flex",alignItems:"center"},onClick:B=>B.stopPropagation(),children:[jsx(Tooltip,{title:R.isDefault?i("layout.removeDefault"):i("layout.setAsDefault"),children:jsx(IconButton,{size:"small",onClick:B=>{B.stopPropagation(),n(R.id);},children:R.isDefault?jsx(ib,{fontSize:"small",color:"warning"}):jsx(Qb,{fontSize:"small"})})}),jsx(Tooltip,{title:i("common.delete"),children:jsx(IconButton,{size:"small",color:"error",onClick:B=>{B.stopPropagation(),r(R.id);},children:jsx(kh,{fontSize:"small"})})})]})]})},R.id||S))]}),jsxs(Dialog,{open:l,onClose:()=>c(false),maxWidth:"xs",fullWidth:true,children:[jsx(DialogTitle,{children:i("layout.saveLayout")}),jsx(DialogContent,{children:jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[jsx(TextField,{label:i("layout.layoutName"),value:g,onChange:R=>f(R.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:i("layout.layoutNameHelper")}),e.some(R=>R.name===g)&&jsx(Typography,{variant:"caption",color:"warning.main",sx:{ml:1},children:i("layout.warningOverwrite")}),jsx(TextField,{label:i("layout.layoutDescription"),value:u,onChange:R=>h(R.target.value),fullWidth:true,size:"small"}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:w.isDefault,onChange:R=>d({...w,isDefault:R.target.checked})}),label:i("layout.useAsDefault")}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:w.isPublic,onChange:R=>d({...w,isPublic:R.target.checked})}),label:i("layout.publicAllUsers")})]})}),jsxs(DialogActions,{children:[jsx(Button,{onClick:()=>c(false),children:i("common.cancel")}),jsx(Button,{onClick:A,variant:"contained",disabled:!g,children:i("common.save")})]})]})]})};var pl=({appId:e,tableKey:t="default",currentLayoutData:o,onLayoutLoad:a,targetLayoutId:r,activeLayoutId:n,serviceUrl:i,onError:s,onSuccess:p})=>{let{t:l}=ee(),[c,g]=useState([]),[f,u]=useState(""),h=`orbcafe.layouts.${e}.${t}`,w=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??{}}),d=S=>({appId:e,tableKey:t,layoutId:S.id,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt,layout:S.layoutData}),C=useCallback(()=>{try{let S=localStorage.getItem(h);if(!S)return [];let B=JSON.parse(S);return Array.isArray(B)?B:[]}catch{return []}},[h]),m=useCallback(S=>{try{localStorage.setItem(h,JSON.stringify(S));}catch{}},[h]);useEffect(()=>{n!==void 0&&u(n);},[n]),useEffect(()=>{if(r&&c.length>0){let S=c.find(B=>B.id===r);S&&(u(S.id),a(S));}},[r,c,a]);let y=useCallback(async()=>{if(e){if(!i){let S=C();g(S);let B=S.find(P=>P.isDefault);B&&!f&&!r&&(u(B.id),a(B));return}try{let S=await fetch(`${i}/api/layouts?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!S.ok)throw new Error("LAYOUT_FETCH_FAILED");let P=(await S.json()).map(w);g(P);let v=P.find(M=>M.isDefault);v&&!f&&!r&&(u(v.id),a(v));}catch(S){console.error("Error fetching layouts",S);let B=C();g(B);let P=B.find(v=>v.isDefault);P&&!f&&!r&&(u(P.id),a(P)),s&&s(l("layout.toast.loadFallback"));}}},[e,t,i,s,f,a,r,C,l]);return useEffect(()=>{y();},[e,t]),jsx(Zp,{layouts:c,currentLayoutId:f,onLoad:S=>{u(S.id),a(S);},onSave:async S=>{let B=c.find(M=>M.name===S.name),P=B?B.id:Date.now().toString(),v={id:P,...S,createdAt:new Date().toISOString(),layoutData:o,isDefault:S.isDefault??false,isPublic:S.isPublic??false};if(!i){let k=c.some(I=>I.id===P)?c.map(I=>I.id===P?v:I):[...c,v];g(k),m(k),u(P),a(v),p&&p(l("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d(v))})).ok)throw new Error("LAYOUT_SAVE_FAILED");p&&p(l("layout.toast.saveSuccess")),await y(),u(P),a(v);}catch(M){console.error("Error saving layout",M);let I=c.some(D=>D.id===P)?c.map(D=>D.id===P?v:D):[...c,v];g(I),m(I),u(P),a(v),p&&p(l("layout.toast.saveLocalSuccess")),s&&s(l("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async S=>{if(!i){let B=c.filter(P=>P.id!==S);g(B),m(B),f===S&&u(""),p&&p(l("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts/${encodeURIComponent(S)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f===S&&u(""),p&&p(l("layout.toast.deleteSuccess")),await y();}catch(B){console.error("Error deleting layout",B);let P=c.filter(v=>v.id!==S);g(P),m(P),f===S&&u(""),p&&p(l("layout.toast.deleteLocalSuccess")),s&&s(l("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async S=>{if(!i){let B=c.map(P=>({...P,isDefault:P.id===S}));g(B),m(B),p&&p(l("layout.toast.defaultLocalSuccess"));return}try{let B=c.find(v=>v.id===S);if(!B)return;if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d({...B,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");p&&p(l("layout.toast.defaultSuccess")),await y();}catch(B){console.error("Error setting default",B);let P=c.map(v=>({...v,isDefault:v.id===S}));g(P),m(P),p&&p(l("layout.toast.defaultLocalSuccess")),s&&s(l("layout.toast.backendUnavailableDefaultLocal"));}}})};var Yp=(e,t)=>{if(!e||!e.filters)return null;if(Array.isArray(e.filters)){let o=e.filters.find(r=>r.scope===t);if(o)return o.filters;let a=e.filters.find(r=>r.scope==="default");return a?a.filters:null}return typeof e.filters=="object"?e.filters:null},ul=(e,t)=>{if(!e)return {layout:null,layoutId:null};let o=null,a=null;if(Array.isArray(e.layoutRefs)){let r=e.layoutRefs.find(n=>n.tableKey===t);r&&(o=r.layoutId);}return !o&&e.layoutId&&(o=e.layoutId),e.layout&&typeof e.layout=="object"&&!Array.isArray(e.layout)&&(a=e.layout),{layoutId:o,layout:a}};function Qp(e,t,o){return t[o]<e[o]?-1:t[o]>e[o]?1:0}function tx(e,t){return e==="desc"?(o,a)=>Qp(o,a,t):(o,a)=>-Qp(o,a,t)}function ox(e,t){let o=e.map((a,r)=>[a,r]);return o.sort((a,r)=>{let n=t(a[0],r[0]);return n!==0?n:a[1]-r[1]}),o.map(a=>a[0])}var on=e=>{let t=useCallback(z=>{let N=String(z?.label??z?.id??"").length*9+64,ne=typeof z?.minWidth=="number"?z.minWidth:0;return Math.max(100,ne,N)},[]),o=useCallback(()=>(e.columns||[]).filter(z=>!!z?.numeric).map(z=>z.id),[e.columns]),[a,r]=useState(""),[n,i]=useState(e.order||"asc"),[s,p]=useState(e.orderBy||""),[l,c]=useState(e.page||0),[g,f]=useState(e.rowsPerPage||20),[u,h]=useState(e.selected||[]),[w,d]=useState(e.columns?e.columns.map(z=>z.id):[]),[C,m]=useState(e.showSummary||false),[y,b]=useState(()=>o()),[T,A]=useState([]),[R,S]=useState(new Set),[B,P]=useState(()=>{let z={};return (e.columns||[]).forEach(O=>{z[O.id]=t(O);}),z}),[v,M]=useState(null),[k,I]=useState(null),[D,G]=useState(null),[V,X]=useState(null),[de,oe]=useState(false),[re,_]=useState(""),[qe,it]=useState("");useEffect(()=>{e.layout&&ze(e.layout);},[e.layout]),useEffect(()=>{e.order!==void 0&&i(e.order),e.orderBy!==void 0&&p(e.orderBy);},[e.order,e.orderBy]),useEffect(()=>{e.selected!==void 0&&h(e.selected);},[e.selected]),useEffect(()=>{e.page!==void 0&&c(e.page);},[e.page]),useEffect(()=>{e.rowsPerPage!==void 0&&f(e.rowsPerPage);},[e.rowsPerPage]),useEffect(()=>{let z=o();b(O=>O.filter(ne=>z.includes(ne)));},[o]),useEffect(()=>{P(z=>{let O={...z};return (e.columns||[]).forEach(N=>{O[N.id]===void 0&&(O[N.id]=t(N));}),O});},[e.columns,t]);let Y=useMemo(()=>{let z=e.rows||[];return a&&(z=z.filter(O=>Object.keys(O).some(N=>String(O[N]).toLowerCase().includes(a.toLowerCase())))),z},[e.rows,a]),le=useMemo(()=>e.onSortChange||!s?Y:ox(Y,tx(n,s)),[Y,n,s,e.onSortChange]),Be=useCallback(z=>{if(T.length===0)return z.map(we=>({type:"row",data:we,id:we[e.rowKey||"id"]}));let O=[...z].sort((we,ae)=>{for(let Me of T){if(we[Me]<ae[Me])return -1;if(we[Me]>ae[Me])return 1}return 0}),N=(we,ae=0)=>{if(ae>=T.length)return we;let Me=T[ae],Te={},Ne=[];return we.forEach(Ie=>{let Re=Ie[Me],Ve=`${Me}:${Re}`;Te[Ve]||(Te[Ve]={key:Ve,field:Me,value:Re,children:[],count:0,level:ae},Ne.push(Te[Ve])),Te[Ve].children.push(Ie),Te[Ve].count++;}),Ne.forEach(Ie=>{Ie.children&&(Ie.children=N(Ie.children,ae+1));}),Ne},ne=N(O),se=(we,ae="")=>{let Me=[];return we.forEach(Te=>{if(Te.children){let Ne=ae?`${ae}>${Te.key}`:Te.key,Ie=R.has(Ne);Me.push({type:"group",id:Ne,field:Te.field,value:Te.value,level:Te.level,count:Te.count,isExpanded:Ie,childIds:(function Re(Ve){let It=[];return Ve.children.forEach(xo=>{xo.children?It=It.concat(Re(xo)):It.push(xo[e.rowKey||"id"]);}),It})(Te)}),Ie&&(Me=Me.concat(se(Te.children,Ne)));}else Me.push({type:"row",data:Te,id:Te[e.rowKey||"id"],level:T.length});}),Me};return se(ne)},[T,R,e.rowKey]),Ee=useCallback(z=>{if(T.length===0)return [];let O=[...z].sort((se,we)=>{for(let ae of T){if(se[ae]<we[ae])return -1;if(se[ae]>we[ae])return 1}return 0}),N=[],ne=(se,we,ae)=>{if(we>=T.length)return;let Me=T[we],Te=new Map;se.forEach(Ne=>{let Ie=Ne[Me],Re=Te.get(Ie);Re?Re.push(Ne):Te.set(Ie,[Ne]);}),Te.forEach((Ne,Ie)=>{let Re=`${Me}:${Ie}`,Ve=ae?`${ae}>${Re}`:Re;N.push(Ve),ne(Ne,we+1,Ve);});};return ne(O,0,""),N},[T]),Ue=useMemo(()=>Be(le),[le,Be]),ot=useMemo(()=>Ee(le),[le,Ee]),Fe=useMemo(()=>{let z=(e.rows||[]).length;return typeof e.count=="number"&&e.count>z},[e.count,e.rows]),_e=useMemo(()=>Fe?Ue:g>0?Ue.slice(l*g,l*g+g):Ue,[Ue,l,g,Fe]),ht=useMemo(()=>Fe&&typeof e.count=="number"?e.count:Ue.length,[Ue.length,Fe,e.count]),j=z=>{S(O=>{let N=new Set(O);return N.has(z)?N.delete(z):N.add(z),N});},pe=z=>{let O=ot.filter(N=>N===z||N.startsWith(`${z}>`));S(N=>{let ne=new Set(N);return O.forEach(se=>ne.add(se)),ne});},De=z=>{S(O=>{let N=new Set(O);return Array.from(N).forEach(ne=>{(ne===z||ne.startsWith(`${z}>`))&&N.delete(ne);}),N});},Le=z=>{if(!z){S(new Set);return}S(new Set(ot));},We=z=>{let O=ot.filter(N=>N.startsWith(`${z}>`));return O.length===0?R.has(z):R.has(z)&&O.every(N=>R.has(N))},U=z=>{let O=s===z&&n==="asc",N=s===z&&n==="desc";if(e.onSortChange){O?e.onSortChange(z,"desc"):N?e.onSortChange("","asc"):e.onSortChange(z,"asc");return}O?(i("desc"),p(z)):N?(i("asc"),p("")):(i("asc"),p(z));},ye=(z,O)=>{P(N=>({...N,[z]:O}));},be=z=>{if(z.target.checked){let O=Y.map(N=>N[e.rowKey||"id"]);h(O),e.onSelectionChange&&e.onSelectionChange(O);return}h([]),e.onSelectionChange&&e.onSelectionChange([]);},Pe=(z,O)=>{let N=O[e.rowKey||"id"],ne=u.indexOf(N),se=[];ne===-1?se=se.concat(u,N):ne===0?se=se.concat(u.slice(1)):ne===u.length-1?se=se.concat(u.slice(0,-1)):ne>0&&(se=se.concat(u.slice(0,ne),u.slice(ne+1))),h(se),e.onSelectionChange&&e.onSelectionChange(se);},et=z=>{c(z),e.onPageChange&&e.onPageChange(z);},Ge=z=>{f(z),c(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(z);},Tt=z=>{let O=w.indexOf(z),N=[...w];O===-1?N.push(z):N.splice(O,1),d(N);},ro=z=>{let O=T.indexOf(z),N=[...T];O===-1?N.push(z):N.splice(O,1),A(N);},Yt=z=>{o().includes(z)&&b(N=>N.includes(z)?N.filter(ne=>ne!==z):[...N,z]);},Ht=z=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:w,order:n,orderBy:s,grouping:T,columnWidths:B,showSummary:C,summaryColumns:y});},Qt=z=>{let{layout:O,layoutId:N}=ul(z,e.tableKey||"default");N?(it(N),_(N)):(it(""),_("")),O&&(O.visibleColumns&&d(O.visibleColumns),O.order&&i(O.order),O.orderBy&&p(O.orderBy),O.grouping&&A(O.grouping),O.columnWidths&&P(O.columnWidths),O.showSummary!==void 0&&m(!!O.showSummary),Array.isArray(O.summaryColumns)&&b(O.summaryColumns));},ze=z=>{let O=z?.layoutData||z?.layout||z||{};O.visibleColumns&&d(O.visibleColumns),O.order&&i(O.order),O.orderBy!==void 0&&p(O.orderBy),O.grouping&&A(O.grouping),O.columnWidths&&P(O.columnWidths),O.showSummary!==void 0&&m(!!O.showSummary),Array.isArray(O.summaryColumns)&&b(O.summaryColumns),S(new Set),c(0),z?.id&&_(z.id),it("");};useEffect(()=>{e.layout&&Qt({layout:e.layout});},[e.layout]);let Ce=z=>{z.preventDefault(),X(V===null?{mouseX:z.clientX+2,mouseY:z.clientY-6}:null);},L=()=>{X(null);},$=useMemo(()=>{if(!C)return {};let z={};e.columns.forEach(N=>{if(N.numeric&&y.includes(N.id)){let ne=Y.reduce((se,we)=>{let ae=parseFloat(we[N.id]);return se+(isNaN(ae)?0:ae)},0);z[N.id]=ne.toFixed(2);}else z[N.id]="";});let O=e.columns.find(N=>w.includes(N.id));return O&&!O.numeric&&(z[O.id]="Total"),z},[Y,e.columns,C,y,w]),Z=()=>{if(!e.columns||!Y)return;let z=e.columns.map(we=>we.label).join(","),O=Y.map(we=>e.columns.map(ae=>{let Me=we[ae.id];return `"${(Me==null?"":String(Me)).replace(/"/g,'""')}"`}).join(",")).join(`
2
- `),N=`data:text/csv;charset=utf-8,${z}
3
- ${O}`,ne=encodeURI(N),se=document.createElement("a");se.setAttribute("href",ne),se.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(se),se.click(),document.body.removeChild(se);},te=()=>{oe(true);},ke=()=>{oe(false);};return {isMobile:false,columns:e.columns,order:n,setOrder:i,orderBy:s,setOrderBy:p,filterText:a,setFilterText:r,visibleColumns:w,setVisibleColumns:d,showSummary:C,setShowSummary:m,summaryColumns:y,grouping:T,setGrouping:A,expandedGroups:R,setExpandedGroups:S,groupAnchorEl:k,setGroupAnchorEl:I,summaryAnchorEl:D,setSummaryAnchorEl:G,columnWidths:B,setColumnWidths:P,anchorEl:v,setAnchorEl:M,contextMenu:V,setContextMenu:X,sensors:void 0,sortedAndFilteredRows:le,visibleRows:_e,summaryRow:$,page:l,setPage:et,rowsPerPage:g,setRowsPerPage:Ge,totalDisplayCount:ht,selected:u,setSelected:h,isAllExpanded:ot.length>0&&ot.every(z=>R.has(z)),handleColumnResize:ye,handleRequestSort:U,handleSelectAllClick:be,handleClick:Pe,toggleSummaryColumn:Yt,handleDragEnd:()=>{},handleExport:Z,handleContextMenu:Ce,handleCloseContextMenu:L,toggleColumnVisibility:Tt,toggleGroupExpand:j,toggleGroupField:ro,handleToggleAll:Le,handleExpandGroupRecursively:pe,handleCollapseGroupRecursively:De,isGroupFullyExpanded:We,handleLayoutLoad:ze,handleVariantLoad:Qt,handleLayoutSave:Ht,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:w,order:n,orderBy:s,grouping:T,columnWidths:B,showSummary:C,summaryColumns:y},currentLayoutId:re,layoutIdToLoad:qe,onPageChange:et,onRowsPerPageChange:Ge,graphReportOpen:de,handleOpenGraphReport:te,handleCloseGraphReport:ke}};var TM=e=>jsx(nx,{...e}),IM=e=>jsx(Ls,{...e}),PM=e=>jsx(nu,{...e}),RM=e=>jsx(Rh,{...e}),DM=e=>jsx(Dh,{...e}),$a=e=>{let{t}=ee(),o="0.85rem",{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:s,actions:p,extraTools:l,fitContainer:c=false,fullWidth:g=false,maxHeight:f,loading:u=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:w,filterConfig:d,rowKey:C,tableKey:m="default",graphReport:y,quickCreate:b,quickEdit:T,quickDelete:A,serviceUrl:R}=e,S=a||t("table.title.default"),{isMobile:B,columns:P,order:v,orderBy:M,filterText:k,setFilterText:I,visibleColumns:D,showSummary:G,setShowSummary:V,summaryColumns:X,grouping:de,setGrouping:oe,expandedGroups:re,groupAnchorEl:_,setGroupAnchorEl:qe,summaryAnchorEl:it,setSummaryAnchorEl:Y,columnWidths:le,anchorEl:Be,setAnchorEl:Ee,contextMenu:Ue,sensors:ot,sortedAndFilteredRows:Fe,summaryRow:_e,visibleRows:ht,isAllExpanded:j,page:pe,setPage:De,rowsPerPage:Le,setRowsPerPage:We,totalDisplayCount:U,setSelected:ye,handleColumnResize:be,handleRequestSort:Pe,handleSelectAllClick:et,handleClick:Ge,toggleSummaryColumn:Tt,handleDragEnd:ro,handleExport:Yt,handleContextMenu:Ht,handleCloseContextMenu:Qt,toggleColumnVisibility:ze,toggleGroupExpand:Ce,toggleGroupField:L,handleToggleAll:$,handleExpandGroupRecursively:Z,handleCollapseGroupRecursively:te,isGroupFullyExpanded:ke,handleLayoutLoad:z,handleVariantLoad:O,handleLayoutSave:N,effectiveAppId:ne,currentLayoutData:se,currentLayoutId:we,layoutIdToLoad:ae,graphReportOpen:Me,handleOpenGraphReport:Te,handleCloseGraphReport:Ne}=on(e),Ie=y?.enabled??false,Re=Ie&&(y?.interaction?.enabled??true),Ve=tl(),It=!!b?.enabled,xo=!!T?.enabled,yt=!!A?.enabled,At=b?.fields,vo=b?.excludeFields||[],Ra=b?.initialValues||{},[Br,Do]=vt__default.useState(false),[no,er]=vt__default.useState(false),[oa,Kt]=vt__default.useState({}),[io,Wt]=vt__default.useState(false),[je,aa]=vt__default.useState(false),[Go,ra]=vt__default.useState({}),[tr,Uo]=vt__default.useState(false),[or,ar]=vt__default.useState(false),Ko=u||no||je||or,na=vt__default.useMemo(()=>{let H=[...P];if(Array.isArray(At)&&At.length>0){let J=new Set(At);H=H.filter(Q=>J.has(Q.id));}if(vo.length>0){let J=new Set(vo);H=H.filter(Q=>!J.has(Q.id));}return H.filter(J=>!!J?.id)},[P,vo,At]),Da=C||"id",qt=vt__default.useMemo(()=>{let H=new Set(i);return Fe.filter(J=>H.has(J?.[Da]))},[i,Fe,Da]),Mo=qt.length===1?qt[0]:null,ia=T?.fields,Co=T?.excludeFields||[],qo=T?.editableFields||[],rr=T?.nonEditableFields||[],Er=T?.primaryKeys?.length?T.primaryKeys:[Da],Ma=vt__default.useMemo(()=>{let H=[...P];if(Array.isArray(ia)&&ia.length>0){let J=new Set(ia);H=H.filter(Q=>J.has(Q.id));}if(Co.length>0){let J=new Set(Co);H=H.filter(Q=>!J.has(Q.id));}return H.filter(J=>!!J?.id)},[P,Co,ia]),nr=vt__default.useMemo(()=>new Set(Er),[Er]),la=vt__default.useMemo(()=>new Set(qo),[qo]),Jt=vt__default.useMemo(()=>new Set(rr),[rr]),Ao=vt__default.useCallback(H=>la.size>0?la.has(H):!(Jt.has(H)||nr.has(H)),[la,Jt,nr]);vt__default.useEffect(()=>{!Me&&Ve.hasActiveFilters&&Ve.clearAll();},[Me,Ve.hasActiveFilters,Ve.clearAll]);let Fr=()=>{let H={};na.forEach(J=>{H[J.id]=Ra[J.id]??"";}),Kt(H),Do(true);},ir=()=>{no||Do(false);},Lr=(H,J)=>{Kt(Q=>({...Q,[H]:J}));},zr=async()=>{if(!b?.onSubmit){Do(false);return}try{er(!0),await b.onSubmit(oa),Do(!1);}finally{er(false);}},Nr=()=>{if(!Mo)return;let H={};Ma.forEach(Q=>{H[Q.id]=Mo[Q.id]??"";});let J=T?.getInitialValues?{...H,...T.getInitialValues(Mo)}:H;ra(J),Wt(true);},lo=()=>{je||Wt(false);},Vr=(H,J)=>{ra(Q=>({...Q,[H]:J}));},Or=async()=>{if(Mo){if(!T?.onSubmit){Wt(false);return}try{aa(!0),await T.onSubmit(Go,Mo),Wt(!1);}finally{aa(false);}}},lr=()=>{qt.length!==0&&Uo(true);},sa=()=>{or||Uo(false);},Aa=async()=>{if(qt.length===0){Uo(false);return}if(!A?.onConfirm){Uo(false),ye([]),s?.([]);return}try{ar(!0),await A.onConfirm(qt),Uo(!1),ye([]),s?.([]);}finally{ar(false);}},Ba=Fe,{fieldMapping:x}=Qr({rows:Ba,config:{...y,title:y?.title||`${S} ${t("graph.reportTitle")}`}}),E=vt__default.useMemo(()=>Re?Ve.applyRows(Ba,x):Ba,[Re,Ve.applyRows,Ba,x]),{model:F}=Qr({rows:E,config:{...y,title:y?.title||`${S} ${t("graph.reportTitle")}`,fieldMapping:x}}),K=F.table.columns.map(H=>({id:H.id,label:H.label,align:H.align||"left",minWidth:120,numeric:H.align==="right"})),ce=ne?jsx(pl,{appId:ne,tableKey:m,currentLayoutData:se,onLayoutLoad:z,targetLayoutId:ae,activeLayoutId:we,serviceUrl:R??d?.serviceUrl}):null,Se=jsxs(Fragment,{children:[jsx(Wr,{groupAnchorEl:_,setGroupAnchorEl:qe,grouping:de,setGrouping:oe,columns:P,toggleGroupField:L}),jsx($r,{anchorEl:Be,setAnchorEl:Ee,columns:P,visibleColumns:D,toggleColumnVisibility:ze}),jsx(zi,{anchorEl:it,setAnchorEl:Y,showSummary:G,setShowSummary:V,columns:P,summaryColumns:X,toggleSummaryColumn:Tt}),jsx(Ni,{contextMenu:Ue,handleCloseContextMenu:Qt,columns:P,visibleColumns:D,toggleColumnVisibility:ze})]});return B?jsxs(Xn,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[d&&jsx(ma,{fields:d.fields,filters:d.filters,onFilterChange:d.onFilterChange,onSearch:d.onSearch,variants:d.variants||[],currentVariantId:d.currentVariantId,onVariantLoad:d.onVariantLoad,onVariantSave:d.onVariantSave,onVariantDelete:d.onVariantDelete,onVariantSetDefault:d.onVariantSetDefault,appId:d.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:se}],variantService:d.variantService,serviceUrl:R??d.serviceUrl}),jsx(tp,{title:S,loading:u,showSummary:G,setShowSummary:V,setAnchorEl:Ee,setSummaryAnchorEl:Y,filterText:k,setFilterText:I,sortedAndFilteredRows:Fe,selected:i,columns:P,visibleColumns:D,summaryRow:_e,handleClick:Ge,selectionMode:n}),Se]}):jsxs(Xn,{sx:{width:g?"100%":"auto",mb:c?0:2,...c?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[d&&jsx(Xn,{sx:{mb:2},children:jsx(ma,{fields:d.fields,filters:d.filters,onFilterChange:d.onFilterChange,onSearch:d.onSearch,variants:d.variants||[],currentVariantId:d.currentVariantId,onVariantLoad:H=>{O(H),d.onVariantLoad&&d.onVariantLoad(H);},onVariantSave:d.onVariantSave,onVariantDelete:d.onVariantDelete,onVariantSetDefault:d.onVariantSetDefault,loading:u,appId:d.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:se}],currentLayoutId:we,layoutRefs:[{tableKey:m,layoutId:we}],variantService:d.variantService,serviceUrl:R??d.serviceUrl})}),jsxs(ax,{sx:{width:g?"100%":"auto",mb:c?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":Ko?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, rgba(25, 118, 210, 0) 0%, rgba(25, 118, 210, 0.25) 25%, rgba(25, 118, 210, 1) 50%, rgba(25, 118, 210, 0.25) 75%, rgba(25, 118, 210, 0) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...f?{height:f}:c?{flex:1,minHeight:0,height:"100%"}:{}},children:[r&&jsx(Ai,{filterText:k,setFilterText:I,onRowsPerPageChange:We,rowsPerPage:Le,rowsPerPageOptions:h,page:pe,count:U,onPageChange:De,actions:p,extraTools:l,grouping:de,setGroupAnchorEl:qe,showSummary:G,setShowSummary:V,setAnchorEl:Ee,setSummaryAnchorEl:Y,handleExport:Yt,showCreateButton:It,onOpenCreateDialog:Fr,showEditButton:xo,onOpenEditDialog:Nr,editDisabled:qt.length!==1,showDeleteButton:yt,onOpenDeleteConfirm:lr,deleteDisabled:qt.length===0,onLayoutSave:w||d?.variantService&&d?.appId?N:void 0,loading:u,layoutManager:ce,onOpenGraphReport:Ie?Te:void 0}),jsx(nu,{sx:{flex:1,...f?{maxHeight:f,height:f}:c?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:jsx(DndContext,{sensors:ot,collisionDetection:closestCenter,onDragEnd:ro,modifiers:[restrictToHorizontalAxis],children:jsxs(rx,{sx:{minWidth:g?750:"auto",width:g?"100%":"auto",tableLayout:Object.keys(le).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,"& .MuiTableCell-root":{fontSize:o}},"aria-labelledby":"tableTitle",size:"small",stickyHeader:true,children:[jsx(Bi,{columns:P,visibleColumns:D,order:v,orderBy:M,onRequestSort:Pe,onContextMenu:Ht,selectionMode:n,grouping:de,isAllExpanded:j,handleToggleAll:$,rowCount:Fe.length,numSelected:i.length,onSelectAllClick:et,columnWidths:le,onColumnResize:be}),jsx(Qd,{visibleRows:ht,columns:P,visibleColumns:D,selectionMode:n,selected:i,orderBy:M,loading:u,expandedGroups:re,toggleGroupExpand:Ce,handleExpandGroupRecursively:Z,handleCollapseGroupRecursively:te,isGroupFullyExpanded:ke,handleClick:Ge,onSelectionChange:s,grouping:de,rowKeyProp:C,page:pe,rowsPerPage:Le}),G&&jsx(Jd,{showSummary:G,columns:P,visibleColumns:D,summaryRow:_e,selectionMode:n?.toString(),grouping:de,orderBy:M,zIndex:3})]})})})]}),It&&jsxs(Jp,{open:Br,onClose:ir,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:H=>`1px solid ${H.palette.divider}`,bgcolor:"background.paper"}}},children:[jsx(eu,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:b?.title||t("quickCreate.createWithTitle",{title:S})}),jsx(tu,{sx:{pt:"8px !important"},children:jsxs(Xn,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[na.map(H=>{let J=H.type==="number"||H.numeric?"number":H.type==="date"?"date":"text",Q=H.label||H.id;return jsx(au,{label:Q,value:oa[H.id]??"",onChange:at=>Lr(H.id,at.target.value),type:J,size:"small",fullWidth:true,InputLabelProps:{shrink:J==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${H.id}`)}),b?.description&&jsx(ru,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:b.description})]})}),jsxs(ou,{sx:{px:3,pb:2},children:[jsx(gl,{onClick:ir,sx:{fontSize:"0.85rem"},disabled:no,children:b?.cancelLabel||t("common.cancel")}),jsx(gl,{onClick:zr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:no,children:b?.submitLabel||t("common.save")})]})]}),xo&&jsxs(Jp,{open:io,onClose:lo,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:H=>`1px solid ${H.palette.divider}`,bgcolor:"background.paper"}}},children:[jsx(eu,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:T?.title||t("quickEdit.editWithTitle",{title:S})}),jsx(tu,{sx:{pt:"8px !important"},children:jsxs(Xn,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Ma.map(H=>{let J=H.type==="number"||H.numeric?"number":H.type==="date"?"date":"text",Q=H.label||H.id,at=Ao(H.id);return jsx(au,{label:Q,value:Go[H.id]??"",onChange:W=>Vr(H.id,W.target.value),type:J,size:"small",fullWidth:true,disabled:!at,InputLabelProps:{shrink:J==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${H.id}`)}),T?.description&&jsx(ru,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:T.description})]})}),jsxs(ou,{sx:{px:3,pb:2},children:[jsx(gl,{onClick:lo,sx:{fontSize:"0.85rem"},disabled:je,children:T?.cancelLabel||t("common.cancel")}),jsx(gl,{onClick:Or,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:je||!Mo,children:T?.submitLabel||t("common.save")})]})]}),yt&&jsx(An,{open:tr,type:"warning",title:A?.title||t("quickDelete.confirmTitle"),message:A?.message||(qt.length>1?t("quickDelete.confirmMessageMultiple",{count:qt.length}):t("quickDelete.confirmMessageSingle")),confirmText:A?.confirmText||t("common.delete"),cancelText:A?.cancelText||t("common.cancel"),onClose:sa,onConfirm:Aa}),Se,Ie&&jsx(Ji,{open:Me,onClose:Ne,model:F,aiAssistant:y?.aiAssistant,interaction:Re?{enabled:true,filters:Ve.filters,fieldMapping:x,onPrimaryDimensionClick:H=>Ve.setFilter("primaryDimension",H),onSecondaryDimensionClick:H=>Ve.setFilter("secondaryDimension",H),onStatusClick:H=>Ve.setFilter("status",H),onClearFilter:Ve.clearFilter,onClearAll:Ve.clearAll}:void 0,tableContent:jsx($a,{appId:ne||"graph-report-internal",title:t("graph.dataBody"),columns:K,rows:F.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},MM=$a;var NM=({id:e,title:t,hideHeader:o=true,filterConfig:a,tableProps:r,children:n,spacing:i=1,mode:s="separated"})=>{let p=a?{...a,appId:a.appId||e}:void 0,l={...r,appId:r.appId||e};return jsxs(qd,{title:t,hideHeader:o,children:[jsxs(Stack,{spacing:i,sx:{height:"100%",overflow:"hidden"},children:[s==="separated"&&p&&jsx(Box,{sx:{flexShrink:0},children:jsx(ma,{...p})}),jsx(Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsx($a,{...l,fitContainer:true,filterConfig:s==="integrated"?p:void 0})})]}),n]})};var GM=({metadata:e,fetchData:t,initialRowsPerPage:o=20,rowsPerPageOptions:a=[20,50,100,-1],tableKey:r="default",mode:n="integrated",serviceUrl:i,variantService:s})=>{let{t:p}=ee(),[l,c]=useState(false),[g,f]=useState([]),[u,h]=useState({}),[w,d]=useState(e.variants||[]),[C,m]=useState(e.layout||null),[y,b]=useState(""),[T,A]=useState(0),[R,S]=useState(0),[B,P]=useState(o),[v,M]=useState([]),[k,I]=useState("asc"),[D,G]=useState("");useEffect(()=>{let le={};e.filters.forEach(Be=>{Be.defaultValue!==void 0&&(le[Be.id]=Be.defaultValue);}),h(le);},[e.filters]);let V=useCallback(async(le,Be,Ee,Ue,ot)=>{c(true);try{let Fe={...le,page:Be+1,limit:Ee,sort:ot,order:Ue},_e;t?_e=await t(Fe):typeof e.api=="function"?_e=await e.api(Fe):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,Fe),_e={rows:[],total:0}):(console.warn("No API configured for report"),_e={rows:[],total:0}),_e&&(f(_e.rows||[]),A(_e.total||0));}catch(Fe){console.error("Failed to fetch report data",Fe);}finally{c(false);}},[e.api,t]);useEffect(()=>{V(u,R,B,k,D);},[V,R,B,k,D]);let X=()=>{S(0),V(u,0,B,k,D);},de=le=>{S(0),P(le);},oe=(le,Be)=>{I(Be),G(le);},re=le=>{h(le);},_=le=>{b(le?.id||"");let Be=Yp(le,r);if(Be){let Ue=Be.values??Be;h(Ue),V(Ue,0,B,k,D),S(0);}let{layout:Ee}=ul(le,r);Ee&&m(Ee);},qe=le=>{let Be={...le,id:Date.now().toString(),createdAt:new Date().toISOString()};d(Ee=>[...Ee,Be]);},it=le=>{m(le);};return {pageProps:{id:e.id,title:e.title,mode:n,filterConfig:{appId:e.id,tableKey:r,fields:e.filters,filters:u,onFilterChange:re,onSearch:X,onVariantLoad:_,onVariantSave:qe,onVariantDelete:le=>d(Be=>Be.filter(Ee=>Ee.id!==le)),onVariantSetDefault:le=>{d(Be=>Be.map(Ee=>({...Ee,isDefault:Ee.id===le})));},variants:w,currentVariantId:y,variantService:s,serviceUrl:i},tableProps:{appId:e.id,tableKey:r,columns:e.columns,rows:g,loading:l,rowKey:"id",count:T,page:R,rowsPerPage:B,rowsPerPageOptions:a,onPageChange:S,onRowsPerPageChange:de,selectionMode:"multiple",selected:v,onSelectionChange:M,onLayoutSave:it,layout:C,title:e.title,showSummary:true,order:k,orderBy:D,serviceUrl:i,onSortChange:oe,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${p("graph.reportTitle")}`}}},filters:u,rows:g,loading:l,refresh:X}};var fx=e=>[...e].sort((t,o)=>o.value-t.value),qM=({bars:e=[],lines:t=[],combos:o=[],heatmap:a=[],pies:r=[],waterfalls:n=[]})=>{let i=useMemo(()=>fx(e),[e]),s=useMemo(()=>[...t],[t]),p=useMemo(()=>[...o],[o]),l=useMemo(()=>[...a],[a]),c=useMemo(()=>{let f=r.reduce((u,h)=>u+h.value,0);return r.map(u=>({...u,percent:f>0?u.value/f*100:u.percent}))},[r]),g=useMemo(()=>[...n],[n]);return {bars:i,lines:s,combos:p,heatmap:l,pies:c,waterfalls:g}};var YM=({apiKey:e,query:t,zoom:o=14,mapType:a="roadmap"})=>useMemo(()=>!e||!t?"":$n({apiKey:e,query:t,zoom:o,mapType:a}),[e,t,o,a]),QM=({keyword:e,location:t})=>useMemo(()=>ji({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var Yn=({code:e,language:t="text",copyable:o=true,showLineNumbers:a=false,wrapLongLines:r=false,maxHeight:n})=>{let[i,s]=useState(false),p=useMemo(()=>e.replace(/\n$/,"").split(`
4
- `),[e]);return jsxs(Box,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",bgcolor:"background.paper"},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.6,bgcolor:"action.hover",borderBottom:"1px solid",borderColor:"divider"},children:[jsx(Typography,{variant:"caption",sx:{textTransform:"uppercase",letterSpacing:.5,color:"text.secondary",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:t}),o&&jsx(Tooltip,{title:i?"Copied":"Copy",children:jsx(IconButton,{size:"small",onClick:async()=>{try{await navigator.clipboard.writeText(e),s(!0),window.setTimeout(()=>s(!1),1400);}catch{s(false);}},children:i?jsx(kx,{fontSize:"inherit"}):jsx(Cx,{fontSize:"inherit"})})})]}),jsx(Box,{component:"pre",sx:{m:0,p:1.25,fontSize:"0.82rem",lineHeight:1.55,overflow:"auto",maxHeight:n,bgcolor:"background.default",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:a?p.map((c,g)=>jsxs(Box,{sx:{display:"flex"},children:[jsx(Box,{component:"span",sx:{width:34,flexShrink:0,textAlign:"right",pr:1,color:"text.disabled",userSelect:"none"},children:g+1}),jsx(Box,{component:"span",sx:{whiteSpace:r?"pre-wrap":"pre",wordBreak:r?"break-word":"normal"},children:c})]},`${g}-${c}`)):jsx(Box,{component:"code",sx:{display:"block",whiteSpace:r?"pre-wrap":"pre",wordBreak:r?"break-word":"normal"},children:e})})]})};var Px=e=>{let t=e.trim();return t.startsWith("$$")&&t.endsWith("$$")&&t.length>=4&&(t=t.slice(2,-2).trim()),t.startsWith("$")&&t.endsWith("$")&&t.length>=2&&(t=t.slice(1,-1).trim()),t},Rx=async e=>new Function("m","return import(m)")(e),Qn=({expression:e,inline:t=false,allowKatex:o=false})=>{let a=useMemo(()=>Px(e),[e]),[r,n]=useState("");return useEffect(()=>{let i=true;return (async()=>{if(!o||!a){n("");return}try{let p=await Rx("katex"),c=(p?.default||p)?.renderToString?.(a,{displayMode:!t,throwOnError:!1,strict:"warn"});i&&typeof c=="string"&&n(c);}catch{i&&n("");}})(),()=>{i=false;}},[o,a,t]),a?r?jsx(Box,{component:t?"span":"div",sx:{display:t?"inline-flex":"block",my:t?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:r}}):t?jsx(Box,{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:a}):jsx(Box,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:jsx(Typography,{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:a})}):null};var Lx=async e=>new Function("m","return import(m)")(e),cc=({code:e,title:t="Mermaid Diagram",height:o=320,enabled:a=true})=>{let[r,n]=useState(""),[i,s]=useState(""),[p,l]=useState(false),c=useMemo(()=>e.trim(),[e]);return useEffect(()=>{let g=true;return (async()=>{if(!a||!c){n(""),s("");return}l(true),s(""),n("");try{let u=await Lx("mermaid"),h=u?.default||u;if(!h||typeof h.render!="function")throw new Error("Mermaid runtime is not available");h.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let w=await h.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,c),d=typeof w=="string"?w:w?.svg;g&&typeof d=="string"&&n(d);}catch(u){if(g){let h=u instanceof Error?u.message:"Failed to render Mermaid diagram";s(h);}}finally{g&&l(false);}})(),()=>{g=false;}},[a,c]),jsxs(Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[jsx(Box,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsx(Typography,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:t})}),jsxs(Box,{sx:{p:1},children:[p&&jsx(Box,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:jsx(CircularProgress,{size:20})}),!p&&r&&jsx(Box,{sx:{maxHeight:o,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:r}}),!p&&!r&&jsxs(Box,{children:[i&&jsx(Alert,{severity:"info",sx:{mb:1},children:i}),jsx(Yn,{code:c,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var dc=e=>e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),Gx=e=>/^:?-{3,}:?$/.test(e.trim()),Ux=e=>{let t=e.trim(),o=t.startsWith(":"),a=t.endsWith(":");return o&&a?"center":a?"right":"left"},yl=e=>{let t=e.split(`
5
- `).map(i=>i.trim()).filter(Boolean);if(t.length<2)return null;let o=dc(t[0]),a=dc(t[1]);if(o.length===0||a.length!==o.length||!a.every(Gx))return null;let r=a.map(Ux),n=t.slice(2).filter(i=>i.includes("|")).map(i=>{let s=dc(i);return s.length<o.length?[...s,...Array.from({length:o.length-s.length},()=>"")]:s.slice(0,o.length)});return {headers:o,aligns:r,rows:n}},pc=({markdown:e,table:t,maxHeight:o=360})=>{let a=useMemo(()=>t||(e?yl(e):null),[t,e]);return !a||a.headers.length===0?jsx(Paper,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:jsx(Typography,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):jsx(Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:jsx(TableContainer,{sx:{maxHeight:o},children:jsxs(Table,{size:"small",stickyHeader:true,children:[jsx(TableHead,{children:jsx(TableRow,{children:a.headers.map((r,n)=>jsx(TableCell,{align:a.aligns[n],sx:{fontWeight:700,bgcolor:"background.paper"},children:r},`${r}-${n}`))})}),jsx(TableBody,{children:a.rows.map((r,n)=>jsx(TableRow,{hover:true,children:r.map((i,s)=>jsx(TableCell,{align:a.aligns[s],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i||jsx(Box,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${n}-${s}`))},`row-${n}`))})]})})})};var xl=({content:e,title:t="Thinking",defaultExpanded:o=false,isStreaming:a=false})=>{let[r,n]=useState(o);return jsxs(Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[jsxs(Stack,{direction:"row",alignItems:"center",spacing:.6,children:[jsx(IconButton,{size:"small",onClick:()=>n(i=>!i),sx:{transform:r?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:jsx(Yx,{fontSize:"inherit"})}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[t,a?" ...":""]})]}),jsx(Collapse,{in:r,children:jsx(Typography,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:e})})]})};var mc=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,vl=e=>e.trim().startsWith("```"),fu=e=>/^#{1,6}\s+/.test(e.trim()),gc=e=>/^[-*+]\s+/.test(e.trim()),fc=e=>/^\d+\.\s+/.test(e.trim()),hu=e=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(e.trim()),hc=e=>e.trim().startsWith(">"),yu=(e,t)=>{if(t+1>=e.length)return false;let o=e[t],a=e[t+1];return !o.includes("|")||!a.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(a.trim())},bu=e=>e.trim().startsWith("<think>")||e.trim()===":::think",ti=(e,t,o)=>{let a=[],r=0,n=0;mc.lastIndex=0;let i=mc.exec(e);for(;i;){i.index>r&&a.push(e.slice(r,i.index));let s=i[0],p=`${o}-${n}`;if(s.startsWith("**")&&s.endsWith("**"))a.push(jsx("strong",{children:s.slice(2,-2)},p));else if(s.startsWith("*")&&s.endsWith("*"))a.push(jsx("em",{children:s.slice(1,-1)},p));else if(s.startsWith("`")&&s.endsWith("`"))a.push(jsx(Box,{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:s.slice(1,-1)},p));else if(s.startsWith("[")&&s.includes("](")&&s.endsWith(")")){let l=s.match(/^\[([^\]]+)\]\(([^)]+)\)$/);l?a.push(jsx(Link,{href:l[2],target:"_blank",rel:"noreferrer",underline:"hover",children:l[1]},p)):a.push(s);}else s.startsWith("$")&&s.endsWith("$")&&t.enableMath?a.push(jsx(Qn,{expression:s,inline:true,allowKatex:true},p)):a.push(s);r=i.index+s.length,n+=1,i=mc.exec(e);}return r<e.length&&a.push(e.slice(r)),a.length>0?a:[e]},oi=({markdown:e,content:t,className:o,enableMath:a=true,enableMermaid:r=true,enableThinkBlock:n=true,codeCopyable:i=true,codeLineNumbers:s=false})=>{let p=e??t??"",l=useMemo(()=>{let c=[],g=p.replace(/\r\n/g,`
1
+ import {a}from'./chunk-74Z76O3S.mjs';export{b as COrbCanvas}from'./chunk-74Z76O3S.mjs';import*as Dt from'react';import Dt__default,{createContext,forwardRef,useMemo,useContext,useState,useEffect,useCallback,Fragment as Fragment$1,useRef,useLayoutEffect}from'react';import {usePathname,useRouter}from'next/navigation';import {ChevronRight,Search,Plus,Mic,ThumbsDown,ThumbsUp,Volume2,RefreshCw,Copy,Terminal,Clock,X,ChevronDown,Box as Box$1,Lightbulb,AlertCircle,RotateCw,Check,Clipboard,CheckCircle,XCircle,Loader2,AlertTriangle,Info,BarChart,MapPin,Globe,TrendingDown,GitBranch,Grid as Grid$1,Activity,PieChart,LineChart}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import fp from'@mui/material/Dialog';import hp from'@mui/material/DialogTitle';import bp from'@mui/material/DialogContent';import Zf from'@mui/material/DialogContentText';import yp from'@mui/material/DialogActions';import ei from'@mui/material/Box';import Qf from'@mui/icons-material/CheckCircle';import Jf from'@mui/icons-material/Warning';import eh from'@mui/icons-material/Error';import th from'@mui/icons-material/Info';import {styled,Paper,IconButton,Tooltip,TextField,InputAdornment,CircularProgress,Dialog,DialogTitle,Box,Typography,DialogContent,Stack,Button,TableContainer,Table,TableHead,TableRow,TableCell,TableBody,Checkbox,DialogActions,Link,MenuItem,Chip,InputBase,useTheme,Autocomplete,FormControlLabel,Menu,ListItemText,Divider,Collapse,Grid,ListItemIcon,Alert,Tabs,Tab,LinearProgress,Avatar,AppBar,Toolbar,createTheme,ThemeProvider,FormControl,Select,Switch,Portal,useMediaQuery,Drawer,Popover,ListSubheader,Badge,TableFooter,InputLabel}from'@mui/material';import {alpha,useTheme as useTheme$1,createTheme as createTheme$1,ThemeProvider as ThemeProvider$1}from'@mui/material/styles';import fh from'@mui/icons-material/Clear';import hh from'@mui/icons-material/Close';import Xd from'@mui/icons-material/Search';import Dx from'@mui/material/Paper';import Mx from'@mui/material/Table';import Ax from'@mui/material/TableBody';import $s from'@mui/material/TableCell';import Cp from'@mui/material/TableContainer';import Kh from'@mui/material/TableHead';import qh from'@mui/material/TableRow';import xp from'@mui/material/TextField';import yl from'@mui/material/Button';import vp from'@mui/material/Alert';import {DndContext,closestCenter,useSensors,useSensor,PointerSensor,TouchSensor,closestCorners,DragOverlay,useDroppable,useDraggable}from'@dnd-kit/core';import {restrictToHorizontalAxis}from'@dnd-kit/modifiers';import Ah from'@mui/icons-material/ViewColumn';import dp from'@mui/icons-material/Save';import Eh from'@mui/icons-material/Download';import Fh from'@mui/icons-material/AccountTree';import Lh from'@mui/icons-material/Functions';import zh from'@mui/icons-material/Insights';import hu from'@mui/icons-material/Add';import Vh from'@mui/icons-material/Edit';import Oh from'@mui/icons-material/Delete';import Hh from'@mui/icons-material/KeyboardArrowLeft';import df from'@mui/icons-material/KeyboardArrowRight';import _h from'@mui/material/Checkbox';import jh from'@mui/material/TableSortLabel';import Zh from'@mui/material/IconButton';import Xh from'@mui/material/Tooltip';import Yh from'@mui/icons-material/UnfoldMore';import Qh from'@mui/icons-material/UnfoldLess';import {arrayMove,SortableContext,horizontalListSortingStrategy,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import sb from'@mui/icons-material/KeyboardArrowDown';import kb from'@mui/icons-material/Check';import mu from'@mui/icons-material/ClearAll';import gu from'@mui/icons-material/ArrowUpward';import fu from'@mui/icons-material/ArrowDownward';import Sb from'@mui/icons-material/VisibilityOff';import Ib from'@mui/icons-material/DeleteOutline';import cy from'@mui/icons-material/MicNoneOutlined';import dy from'@mui/icons-material/SettingsOutlined';import uy from'@mui/icons-material/SendOutlined';import lx from'@mui/icons-material/Settings';import sx from'@mui/icons-material/KeyboardArrowUp';import dx from'@mui/icons-material/ArrowRightAlt';import By from'@mui/icons-material/Star';import {DateCalendar}from'@mui/x-date-pickers/DateCalendar';import {PickersDay}from'@mui/x-date-pickers/PickersDay';import {LocalizationProvider}from'@mui/x-date-pickers/LocalizationProvider';import {AdapterDayjs}from'@mui/x-date-pickers/AdapterDayjs';import _y from'@mui/icons-material/CalendarMonth';import Zy from'@mui/icons-material/ArrowForward';import mr from'dayjs';import Xy from'dayjs/plugin/isBetween';import Yy 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 wx from'@mui/icons-material/StarBorder';import Tx from'@mui/icons-material/ViewQuilt';import _0 from'@mui/icons-material/CloseOutlined';import _x from'@mui/icons-material/ContentCopyOutlined';import jx from'@mui/icons-material/CheckOutlined';import S0 from'@mui/icons-material/ExpandMore';import Jp from'@mui/icons-material/Language';import Bv from'@mui/icons-material/DesktopWindows';import Ev from'@mui/icons-material/DarkMode';import Fv from'@mui/icons-material/LightMode';import zv from'@mui/icons-material/Logout';import nC from'@mui/icons-material/DragIndicator';import SC from'@mui/icons-material/FilterList';import wC from'@mui/icons-material/TableRows';import dC from'@mui/icons-material/LayersClear';import kk from'@mui/icons-material/CameraAltRounded';import Sk from'@mui/icons-material/QrCodeScannerRounded';import Pk from'@mui/icons-material/DragIndicatorRounded';import Ak from'@mui/icons-material/BackspaceRounded';import Bk from'@mui/icons-material/CloseRounded';import Ek from'@mui/icons-material/CheckRounded';import jk from'@mui/icons-material/SearchRounded';import Zk from'@mui/icons-material/MenuOpenRounded';import Xk from'@mui/icons-material/MenuRounded';import Yk from'@mui/icons-material/ExpandMoreRounded';import Qk from'@mui/icons-material/ChevronRightRounded';import yS from'next/dynamic';import {AnimatePresence,motion}from'framer-motion';import Bw from'react-markdown';import Ew from'remark-gfm';import Fw from'remark-math';import Lw from'rehype-katex';import zw from'rehype-raw';import {Prism}from'react-syntax-highlighter';import {oneDark,oneLight}from'react-syntax-highlighter/dist/esm/styles/prism';import {useTheme as useTheme$2}from'next-themes';import Tg from'mermaid';import _w from'@mui/icons-material/MicRounded';import jw from'@mui/icons-material/MicOffRounded';import {InsertDriveFile,Close,Stop}from'@mui/icons-material';import Jw from'@mui/icons-material/SendRounded';import e1 from'@mui/icons-material/AddRounded';import t1 from'@mui/icons-material/HardwareRounded';import w1 from'@mui/icons-material/LockOutlined';import ef from'@mui/icons-material/MailOutline';import tf from'@mui/icons-material/PersonOutline';import T1 from'@mui/icons-material/VpnKeyOutlined';import $1 from'dayjs/plugin/isoWeek';import iT from'@mui/icons-material/KeyboardDoubleArrowLeftOutlined';import lT from'@mui/icons-material/KeyboardDoubleArrowRightOutlined';import sT from'@mui/icons-material/SplitscreenOutlined';import cT from'@mui/icons-material/Sort';function No(...e){return twMerge(clsx(e))}var Rs={primary:"#000000",primaryHover:"#333333"},Bi={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"},An={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},Bd=()=>"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 Sf=cva(Bd(),{variants:{variant:{default:`${Bi.primary} shadow-sm`,destructive:"bg-red-500 text-white hover:bg-red-600 active:bg-red-700 dark:bg-red-600 dark:hover:bg-red-500 dark:active:bg-red-700 shadow-sm",outline:`${Bi.outline} shadow-sm`,secondary:"bg-gray-200 text-gray-700 hover:bg-gray-300 active:bg-gray-400 dark:bg-gray-700 dark:text-gray-200 dark:hover:bg-gray-600 dark:active:bg-gray-500 shadow-sm",ghost:Bi.ghost,link:"text-blue-600 dark:text-blue-400 underline-offset-4 hover:underline hover:text-blue-700 dark:hover:text-blue-300 active:text-blue-800 dark:active:text-blue-200","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-[${Rs.primary}] hover:bg-[${Rs.primaryHover}] text-white 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-red-500 hover:bg-red-600 border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 text-white 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:An.none,sm:An.sm,md:An.md,full:An.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),Ds=Dt.forwardRef(({className:e,variant:t,size:o,asChild:r=false,...a},n)=>jsx(r?Slot:"button",{className:No(Sf({variant:t,size:o,className:e})),ref:n,...a}));Ds.displayName="Button";var Tf={"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.theme.system":"Theme: System","header.theme.dark":"Theme: Dark","header.theme.light":"Theme: Light","header.menu.setting":"Setting","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}","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.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?","messageBox.confirm":"OK","messageBox.cancel":"Cancel"},If={"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.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.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}","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.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","messageBox.confirm":"\u786E\u5B9A","messageBox.cancel":"\u53D6\u6D88"},Pf={"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.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.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}","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.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 ?","messageBox.confirm":"OK","messageBox.cancel":"Annuler"},Rf={"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.theme.system":"Theme: System","header.theme.dark":"Theme: Dunkel","header.theme.light":"Theme: Hell","header.menu.setting":"Einstellungen","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","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.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?","messageBox.confirm":"OK","messageBox.cancel":"Abbrechen"},Df={"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.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.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","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.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","messageBox.confirm":"OK","messageBox.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB"},Mf={"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.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.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","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.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?","messageBox.confirm":"\uD655\uC778","messageBox.cancel":"\uCDE8\uC18C"},Bn={en:Tf,zh:If,fr:Pf,de:Rf,ja:Df,ko:Mf};var Fd=(e,t)=>t?e.replace(/\{(\w+)\}/g,(o,r)=>{let a=t[r];return a==null?"":String(a)}):e,Ff={locale:"en",t:(e,t)=>Fd(Bn.en[e]||e,t)},Ld=createContext(Ff),Ei=({locale:e="en",messages:t,children:o})=>{let r=useMemo(()=>{let a=Bn[e]||Bn.en,n=t?.[e]||{},i={...Bn.en,...a,...n};return {locale:e,t:(s,d)=>Fd(i[s]||s,d)}},[e,t]);return jsx(Ld.Provider,{value:r,children:o})},ee=()=>useContext(Ld);function As({items:e,onItemClick:t,className:o="",level:r=0,expandedIds:a,onToggleExpand:n,colorMode:i="light"}){let{t:s}=ee(),d=i==="dark",l=usePathname(),[c,g]=useState(false),[h,m]=useState(new Set),b=a!==void 0&&n!==void 0,C=b?a:h;useEffect(()=>{g(true);},[]);let u=p=>{if(b)n(p);else {let f=new Set(h);f.has(p)?f.delete(p):f.add(p),m(f);}},v=p=>{p.children&&p.children.length>0&&u(p.id),t&&t(p);};return !e||!Array.isArray(e)?jsx("div",{className:No("tree-menu",o),children:jsx("div",{className:"text-sm text-gray-500 p-2",children:s("navigation.noItems")})}):jsx("div",{className:No("tree-menu",o),children:e.map(p=>{let f=C.has(p.id)||p.isExpanded,y=p.children&&p.children.length>0,k=p.appurl||p.href,E=c&&k?l===k:false;return jsxs("div",{className:"tree-menu-item relative",children:[E&&jsx("div",{className:No("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",d?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxs(Ds,{variant:"ghost",className:No("w-full justify-start gap-2 h-auto py-2 relative overflow-hidden group",`ml-${r*4}`,E?d?"bg-transparent text-[#90caf9] hover:bg-gray-800/35":"bg-transparent text-[#1976d2] hover:bg-gray-100/60":d?"hover:bg-gray-800/50 text-gray-300":"hover:bg-gray-100/50 text-gray-700"),onClick:()=>v(p),children:[y&&jsx("div",{className:No("flex-shrink-0 transition-transform duration-200",f&&"rotate-90",E?d?"text-[#90caf9]":"text-[#1976d2]":d?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:jsx(ChevronRight,{className:"h-4 w-4"})}),!y&&jsx("div",{className:"w-4 h-4 flex-shrink-0"}),p.icon&&jsx("div",{className:No("flex-shrink-0 transition-colors duration-200",E?d?"text-[#90caf9]":"text-[#1976d2]":d?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:p.icon}),jsxs("div",{className:"flex-1 text-left overflow-hidden z-10",children:[jsx("div",{className:No("text-sm truncate transition-colors duration-200",E?"font-semibold":"font-medium"),children:p.title||p.label}),p.description&&jsx("div",{className:No("text-xs truncate transition-colors duration-200",E?d?"text-[#90caf9]/70":"text-[#1976d2]/75":d?"text-gray-400":"text-gray-500"),title:p.description,children:p.description})]})]}),y&&jsx("div",{className:No("grid transition-[grid-template-rows] duration-300 ease-in-out",f?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsx("div",{className:"overflow-hidden",children:jsx(As,{items:p.children,onItemClick:t,level:r+1,expandedIds:a,onToggleExpand:n,colorMode:i})})})]},p.id)})})}var Wd=({collapsed:e,onToggle:t,className:o="",maxHeight:r,menuData:a=[],colorMode:n="light"})=>{let{t:i}=ee(),s=n==="dark",d=useRouter(),[l,c]=useState(""),[g,h]=useState(new Set);useEffect(()=>{e&&h(new Set);},[e]);let m=useCallback(v=>{let p=[],f=y=>{y.forEach(k=>{p.push(k.id),k.children&&f(k.children);});};return f(v),p},[]),b=useMemo(()=>{if(!l.trim())return a;let v=p=>p.reduce((f,y)=>{let k=y.title?.toLowerCase().includes(l.toLowerCase())||y.description?.toLowerCase().includes(l.toLowerCase()),E=y.children?v(y.children):[];return (k||E.length>0)&&f.push({...y,children:E.length>0?E:y.children}),f},[]);return v(a)},[l,a]),C=useMemo(()=>l.trim()?new Set(m(a)):g,[l,a,g,m]),u=useCallback(async v=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",v),v.id==="chat"||v.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{d.push("/chat?new=true");}catch(f){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",f),d.push("/chat");}return}let p=v.appurl||v.href;p&&(p.startsWith("http://")||p.startsWith("https://")?window.open(p,"_blank"):d.push(p));},[d]);return jsxs("div",{className:`flex flex-col backdrop-blur-xl border shadow-[0_4px_8px_0_rgba(31,38,135,0.1)] ${e?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${o} ${s?"bg-[#111111] border-white/10":"bg-white/70 border-white/30"}`,style:{backdropFilter:"blur(16px) saturate(180%)",WebkitBackdropFilter:"blur(16px) saturate(180%)",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",maxHeight:r?`${r}px`:void 0},children:[jsx("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${e?"px-1":"px-2"}`,children:e?jsx("div",{className:"flex justify-center",children:jsx("button",{onClick:t,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${s?"text-gray-300 hover:bg-gray-800":"text-gray-500 hover:bg-gray-50"}`,title:i("navigation.expand"),children:jsx(Search,{className:"h-5 w-5"})})}):jsxs("div",{className:`relative transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:[jsx("input",{type:"text",placeholder:i("navigation.searchPlaceholder"),value:l,onChange:v=>c(v.target.value),className:`w-full pl-10 pr-4 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent ${s?"border-gray-700 bg-[#1A1A1A] text-white placeholder-gray-400":"border-gray-300 bg-white text-gray-900 placeholder-gray-500"}`}),jsx("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:jsx(Search,{className:`h-4 w-4 ${s?"text-gray-500":"text-gray-400"}`})})]})}),jsx("nav",{className:`flex-1 pb-4 transition-all duration-500 ease-in-out overflow-y-auto min-h-0 ${e?"px-1":"px-2"}`,children:b.length===0?jsx("div",{className:"flex items-center justify-center py-8 text-gray-500 text-sm",children:e?"\u{1F4C2}":i(l?"navigation.noMatch":"navigation.noAccessibleApp")}):jsxs(Fragment,{children:[!e&&jsx("div",{className:`transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:jsx(As,{items:b,onItemClick:u,className:"space-y-1",expandedIds:C,colorMode:n,onToggleExpand:v=>{let p=new Set(g);b.some(y=>y.id===v)?p.has(v)?p.delete(v):(b.forEach(y=>{y.id!==v&&p.has(y.id)&&p.delete(y.id);}),p.add(v)):p.has(v)?p.delete(v):p.add(v),h(p);}})}),e&&jsx("div",{className:"space-y-2",children:a.map(v=>jsx("div",{className:"space-y-1",children:jsx("button",{onClick:()=>{t();let p=new Set([v.id]);h(p);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${s?"text-gray-400 hover:bg-gray-800":"text-gray-600 hover:bg-gray-50"}`,title:i("navigation.expandView",{title:v.title||""}),children:v.icon||jsx("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${s?"bg-[#90caf9] text-[#0b0b0b]":"bg-[#1976d2] text-white"}`,children:v.title?.charAt(0)||"?"})})},v.id))})]})}),!e&&jsx("button",{onClick:t,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 ${s?"hover:bg-gray-800/50":"hover:bg-white/20"}`,title:i("navigation.collapse"),children:jsx("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:jsx("div",{className:s?"border-yellow-400":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid #21BCFF",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})})]})};var Gd=(e={})=>{let{initialCollapsed:t=false,content:o=[]}=e,[r,a]=useState(t),[n,i]=useState(o),s=useCallback(()=>{a(l=>!l);},[]),d=useMemo(()=>({collapsed:r,onToggle:s,menuData:n}),[r,s,n]);return {collapsed:r,setCollapsed:a,toggleCollapsed:s,menuData:n,setMenuData:i,navigationIslandProps:d}};var jo=e=>jsx(Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var Es=class{constructor(){a(this,"listener",null);}register(t){this.listener=t;}unregister(){this.listener=null;}show(t,o,r){this.listener&&this.listener({type:t,content:o,options:r});}hide(){this.listener&&this.listener(null);}},yr=new Es,uI={success:(e,t)=>yr.show("success",e,t),error:(e,t)=>yr.show("error",e,t),warning:(e,t)=>yr.show("warning",e,t),info:(e,t)=>yr.show("info",e,t),show:(e,t,o)=>yr.show(e,t,o),hide:()=>yr.hide()};var oh={success:{icon:jsx(Qf,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsx(Jf,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsx(eh,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsx(th,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},En=({open:e,title:t,message:o,onClose:r,onConfirm:a,confirmText:n,cancelText:i,showCancel:s=true,maxWidth:d="xs",type:l="default"})=>{let{t:c}=ee(),g=n||c("messageBox.confirm"),h=i||c("messageBox.cancel"),m=()=>{a?a():r();},b=oh[l],C=l!=="default";return jsxs(fp,{open:e,onClose:r,maxWidth:d,fullWidth:true,PaperProps:{sx:{borderRadius:3,...C&&{borderTop:`6px solid ${b.iconColor}`}}},children:[C&&jsx(ei,{sx:{display:"flex",justifyContent:"center",pt:3,color:b.iconColor},children:b.icon}),t&&jsx(hp,{sx:{textAlign:C?"center":"left",pt:C?1:2},children:t}),jsx(bp,{sx:{textAlign:C?"center":"left"},children:typeof o=="string"?jsx(Zf,{children:o}):o}),jsxs(yp,{sx:{justifyContent:C?"center":"flex-end",pb:3,px:3},children:[s&&jsx(jo,{onClick:r,variant:"text",color:"inherit",children:h}),jsx(jo,{onClick:m,variant:"contained",sx:{bgcolor:C?b.iconColor:void 0,"&:hover":{bgcolor:C?b.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:g})]})]})},RI=()=>{let[e,t]=Dt__default.useState(null),[o,r]=Dt__default.useState(false);Dt__default.useEffect(()=>{let i=s=>{s?(t(s),r(true)):(r(false),t(null));};return yr.register(i),()=>yr.unregister()},[]);let a=()=>{r(false),e?.options?.onClose&&e.options.onClose(),t(null);},n=()=>{e?.options?.onConfirm&&e.options.onConfirm(),r(false),t(null);};return e?jsx(En,{open:o,type:e.type,message:e.content,title:e.options?.title,onClose:a,onConfirm:n,confirmText:e.options?.confirmText,cancelText:e.options?.cancelText,showCancel:e.options?.showCancel,maxWidth:e.options?.maxWidth}):null};var bh=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],Yd=e=>Array.isArray(e)?e:e==null||e===""?[]:[e],ir=e=>String(e),Qd=(e,t)=>e[t],Jd=e=>{let t=e.value??e.id??e.key??e.code;return typeof t=="number"||typeof t=="string"?t:""},yh=e=>{let t=e.label??e.description??e.name??e.title;return String(typeof t=="number"||typeof t=="string"?t:Jd(e))},xh=e=>{let t=e.description??e.subtitle;return typeof t=="number"||typeof t=="string"?String(t):void 0},eu=({value:e=null,items:t=[],columns:o,mode:r="single",dialogTitle:a="Value Help",searchPlaceholder:n="Search values...",selectLabel:i="Select",clearLabel:s="Clear",cancelLabel:d="Cancel",valueHelpLabel:l="Open value help",noResultsText:c="No matching values",loading:g=false,clearable:h=true,selectedItems:m=[],displayValue:b,getOptionValue:C=Jd,getOptionLabel:u=yh,getOptionDescription:v=xh,onChange:p,onSearch:f,disabled:y,InputProps:k,onKeyDown:E,...M})=>{let S=r==="multiple",[D,P]=useState(false),[w,B]=useState(""),[R,I]=useState(null),[A,q]=useState(false),[O,K]=useState(()=>Yd(e)),Q=useMemo(()=>o&&o.length>0?o:bh,[o]),ne=R??t,ie=useMemo(()=>{let _=[...m,...t,...R??[]],le=new Map;return _.forEach(Re=>{le.set(ir(C(Re)),Re);}),le},[C,t,R,m]),Y=useMemo(()=>Yd(e),[e]);useEffect(()=>{D||K(Y);},[D,Y]);let Ae=useMemo(()=>{let _=w.trim().toLowerCase();if(!_||f)return ne;let le=Q.filter(Re=>Re.searchable!==false);return ne.filter(Re=>[C(Re),u(Re),v(Re),...le.map(G=>Qd(Re,G.field))].some(G=>String(G??"").toLowerCase().includes(_)))},[ne,v,u,C,f,w,Q]),Ze=useMemo(()=>{if(b!==void 0)return b;if(Y.length===0)return "";let _=le=>{let Re=ie.get(ir(le));if(!Re)return String(le);let Ne=u(Re);return Ne&&Ne!==String(le)?`${le} - ${Ne}`:String(le)};return S?Y.length>2?`${Y.length} selected`:Y.map(_).join(", "):_(Y[0])},[b,u,S,ie,Y]),ht=useCallback(async()=>{if(f){q(true);try{let _=await f(w);Array.isArray(_)&&I(_);}finally{q(false);}}},[f,w]),fe=()=>{y||(K(Y),P(true));},We=()=>{P(false);},Ee=()=>{p?.(S?[]:null,S?[]:null),K([]);},Tt=_=>{let le=C(_);if(S){K(Re=>Re.some(G=>ir(G)===ir(le))?Re.filter(G=>ir(G)!==ir(le)):[...Re,le]);return}K([le]);},_e=()=>{let _=O.map(le=>ie.get(ir(le))).filter(le=>!!le);S?p?.(O,_):p?.(O[0]??null,_[0]??null),P(false);},ze=_=>{if(_.key==="F4"){_.preventDefault(),fe();return}E?.(_);},Ue=g||A,tt=Y.length>0;return jsxs(Fragment,{children:[jsx(TextField,{...M,disabled:y,value:Ze,onKeyDown:ze,InputProps:{...k,readOnly:true,endAdornment:jsxs(InputAdornment,{position:"end",children:[Ue?jsx(CircularProgress,{size:18}):null,h&&tt&&!y?jsx(Tooltip,{title:s,children:jsx(IconButton,{size:"small",edge:"end","aria-label":s,onClick:Ee,children:jsx(fh,{fontSize:"small"})})}):null,jsx(Tooltip,{title:l,children:jsx("span",{children:jsx(IconButton,{size:"small",edge:"end","aria-label":l,onClick:fe,disabled:y,children:jsx(Xd,{fontSize:"small"})})})})]})}}),jsxs(Dialog,{open:D,onClose:We,fullWidth:true,maxWidth:"md",PaperProps:{sx:_=>({borderRadius:2,overflow:"hidden",border:`1px solid ${_.palette.divider}`,boxShadow:_.palette.mode==="dark"?`0 24px 80px ${alpha(_.palette.common.black,.72)}`:`0 24px 80px ${alpha(_.palette.common.black,.18)}`})},children:[jsxs(DialogTitle,{sx:_=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${_.palette.divider}`,bgcolor:_.palette.background.paper}),children:[jsxs(Box,{children:[jsx(Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),S?jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${O.length} selected`}):null]}),jsx(IconButton,{"aria-label":"Close",onClick:We,size:"small",children:jsx(hh,{fontSize:"small"})})]}),jsxs(DialogContent,{sx:{p:0},children:[jsxs(Stack,{direction:{xs:"column",sm:"row"},spacing:1,sx:_=>({px:2.5,py:1.5,borderBottom:`1px solid ${_.palette.divider}`,bgcolor:_.palette.mode==="dark"?alpha(_.palette.common.white,.025):alpha(_.palette.primary.main,.035)}),children:[jsx(TextField,{size:"small",fullWidth:true,value:w,placeholder:n,onChange:_=>B(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),ht());},InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Xd,{fontSize:"small"})}),sx:_=>({borderRadius:1,bgcolor:_.palette.background.paper,"& fieldset":{borderColor:alpha(_.palette.text.primary,_.palette.mode==="dark"?.2:.16)},"&:hover fieldset":{borderColor:alpha(_.palette.primary.main,.52)},"&.Mui-focused fieldset":{borderColor:_.palette.primary.main}})}}),f?jsx(Button,{variant:"outlined",onClick:()=>{ht();},disabled:Ue,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:Ue?jsx(CircularProgress,{size:18}):"Search"}):null]}),jsx(TableContainer,{sx:{maxHeight:420},children:jsxs(Table,{stickyHeader:true,size:"small",children:[jsx(TableHead,{children:jsxs(TableRow,{children:[jsx(TableCell,{padding:"checkbox",sx:_=>({bgcolor:_.palette.mode==="dark"?"#111111":_.palette.background.paper,borderBottom:`1px solid ${_.palette.divider}`})}),Q.map(_=>jsx(TableCell,{align:_.align,sx:le=>({minWidth:_.minWidth,width:_.width,fontSize:"0.78rem",fontWeight:800,bgcolor:le.palette.mode==="dark"?"#111111":le.palette.background.paper,borderBottom:`1px solid ${le.palette.divider}`}),children:_.label},String(_.field)))]})}),jsxs(TableBody,{children:[Ae.map(_=>{let le=C(_),Re=O.some(Ne=>ir(Ne)===ir(le));return jsxs(TableRow,{hover:true,selected:Re,onClick:()=>Tt(_),onDoubleClick:()=>{S||(K([le]),p?.(le,_),P(false));},sx:Ne=>({cursor:"pointer","&.Mui-selected":{bgcolor:alpha(Ne.palette.primary.main,Ne.palette.mode==="dark"?.22:.12)},"&.Mui-selected:hover":{bgcolor:alpha(Ne.palette.primary.main,Ne.palette.mode==="dark"?.28:.18)}}),children:[jsx(TableCell,{padding:"checkbox",children:jsx(Checkbox,{size:"small",checked:Re})}),Q.map(Ne=>{let G=Qd(_,Ne.field);return jsx(TableCell,{align:Ne.align,sx:{fontSize:"0.82rem",py:1},children:Ne.render?Ne.render(G,_):String(G??"")},String(Ne.field))})]},ir(le))}),Ae.length===0?jsx(TableRow,{children:jsx(TableCell,{colSpan:Q.length+1,children:jsx(Box,{sx:{py:5,textAlign:"center",color:"text.secondary"},children:c})})}):null]})]})})]}),jsxs(DialogActions,{sx:_=>({px:2.5,py:1.5,borderTop:`1px solid ${_.palette.divider}`,bgcolor:_.palette.background.paper,"& .MuiButton-root":{textTransform:"none",fontWeight:700}}),children:[h&&(tt||O.length>0)?jsx(Button,{onClick:Ee,children:s}):null,jsx(Box,{sx:{flex:1}}),jsx(Button,{onClick:We,children:d}),jsx(Button,{variant:"contained",onClick:_e,disabled:!S&&O.length===0,children:i})]})]})]})};var tu=({title:e,hideHeader:t,children:o})=>jsxs(Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!t&&jsx(Box,{sx:{mb:2},children:jsx(Typography,{variant:"h4",children:e})}),jsx(Box,{sx:{flex:1,overflow:"hidden"},children:o})]});var Li=e=>{let{t}=ee(),o="0.85rem",r=Array.isArray(e.actions)?e.actions:e.actions?[e.actions]:[],a=Array.isArray(e.extraTools)?e.extraTools:e.extraTools?[e.extraTools]:[],n=[...r,...a],i=typeof e.rowsPerPage=="number"?e.rowsPerPage:20,s=Array.isArray(e.rowsPerPageOptions)&&e.rowsPerPageOptions.length>0?e.rowsPerPageOptions:[20,50,100,-1],d=typeof e.count=="number"?e.count:0,l=Math.max(0,typeof e.page=="number"?e.page:0),c=i===-1?1:Math.max(1,Math.ceil(d/i)),g=Math.min(l+1,c),h=l>0,m=l<c-1&&i!==-1;return jsxs(Toolbar,{sx:{pl:{sm:2},pr:{xs:1,sm:1},alignItems:"center",gap:1},children:[jsx(TextField,{size:"small",placeholder:t("table.toolbar.searchPlaceholder"),value:e.filterText,onChange:b=>e.setFilterText(b.target.value),InputProps:{sx:{fontSize:o,"& .MuiInputBase-input":{fontSize:o,color:"text.primary"},"& .MuiInputBase-input::placeholder":{fontSize:o,opacity:1}},startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Xd,{fontSize:"small"})})},sx:{width:300}}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[jsx(Typography,{sx:{fontSize:o,color:"text.secondary",whiteSpace:"nowrap"},children:t("table.toolbar.itemsPerPage")}),jsx(Select,{size:"small",variant:"standard",value:i,disableUnderline:true,onChange:b=>e.onRowsPerPageChange?.(Number(b.target.value)),sx:{fontSize:o,fontWeight:600,color:"text.primary",minWidth:64,"& .MuiSelect-select":{py:.25,pr:"16px !important"},"& .MuiSvgIcon-root":{color:"text.primary"}},children:s.map(b=>jsx(MenuItem,{value:b,sx:{fontSize:o},children:b===-1?t("common.all"):b},`rows-per-page-${b}`))}),jsx(IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.max(l-1,0)),disabled:!h,sx:{p:.35,color:"text.primary"},children:jsx(Hh,{fontSize:"small"})}),jsx(Typography,{sx:{fontSize:o,fontWeight:600,minWidth:88,textAlign:"center",color:"text.primary"},children:t("table.toolbar.pageOf",{current:g,total:c})}),jsx(IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.min(l+1,c-1)),disabled:!m,sx:{p:.35,color:"text.primary"},children:jsx(df,{fontSize:"small"})})]}),jsx(Box,{sx:{flex:1}}),jsxs(Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[n.length>0&&jsx(Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:n.map((b,C)=>jsx(Dt__default.Fragment,{children:b},`toolbar-custom-${C}`))}),jsx(Box,{sx:{width:"1px",height:20,bgcolor:"divider",mx:.5}}),jsx(Tooltip,{title:t("table.toolbar.groupBy"),children:jsx(IconButton,{sx:{color:"text.primary"},onClick:b=>e.setGroupAnchorEl(b.currentTarget),children:jsx(Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsx(Fh,{})})})}),jsx(Tooltip,{title:t("table.toolbar.summary"),children:jsx(IconButton,{sx:{color:e.showSummary?"primary.main":"text.primary"},onClick:b=>e.setSummaryAnchorEl(b.currentTarget),children:jsx(Lh,{})})}),jsx(Tooltip,{title:t("table.toolbar.columns"),children:jsx(IconButton,{sx:{color:"text.primary"},onClick:b=>e.setAnchorEl(b.currentTarget),children:jsx(Ah,{})})}),jsx(Tooltip,{title:t("table.toolbar.export"),children:jsx(IconButton,{sx:{color:"text.primary"},onClick:e.handleExport,children:jsx(Eh,{})})}),e.showCreateButton&&jsx(Tooltip,{title:t("table.toolbar.newItem"),children:jsx(IconButton,{onClick:e.onOpenCreateDialog,color:"primary",children:jsx(hu,{})})}),e.showEditButton&&jsx(Tooltip,{title:t("table.toolbar.editItem"),children:jsx("span",{children:jsx(IconButton,{onClick:e.onOpenEditDialog,color:"primary",disabled:!!e.editDisabled,children:jsx(Vh,{})})})}),e.showDeleteButton&&jsx(Tooltip,{title:t("table.toolbar.deleteItem"),children:jsx("span",{children:jsx(IconButton,{onClick:e.onOpenDeleteConfirm,color:"error",disabled:!!e.deleteDisabled,children:jsx(Oh,{})})})}),e.onOpenGraphReport&&jsx(Tooltip,{title:t("table.toolbar.graphicReport"),children:jsx(IconButton,{sx:{color:"text.primary"},onClick:e.onOpenGraphReport,children:jsx(zh,{})})}),e.onLayoutSave&&!e.layoutManager&&jsx(Tooltip,{title:t("table.toolbar.saveLayout"),children:jsx(IconButton,{sx:{color:"text.primary"},onClick:b=>e.onLayoutSave(b),children:jsx(dp,{})})}),e.layoutManager]})]})};var zi=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:o}=e;return "translate3d("+(t?Math.round(t):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:o}=e;return "scaleX("+t+") scaleY("+o+")"}},Transform:{toString(e){if(e)return [zi.Translate.toString(e),zi.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:o,easing:r}=e;return t+" "+o+"ms "+r}}});var Ni=e=>{let{t}=ee(),{onSelectAllClick:o,order:r,orderBy:a,sortBy:n=[],numSelected:i=0,rowCount:s=0,onRequestSort:d,onContextMenu:l,columns:c,visibleColumns:g,selectionMode:h,grouping:m=[],isAllExpanded:b=false,handleToggleAll:C,onColumnResize:u,columnWidths:v,enableColumnReorder:p=false}=e,[f,y]=useState(null),k=useRef(null),E=K=>Q=>{f||d(K);},M=(K,Q,ne)=>{K.preventDefault(),K.stopPropagation(),y(Q),k.current={startX:K.clientX,startWidth:ne,colId:Q},document.addEventListener("mousemove",S),document.addEventListener("mouseup",D),document.body.style.cursor="col-resize";},S=K=>{if(!k.current)return;let{startX:Q,startWidth:ne,colId:ie}=k.current,Y=K.clientX-Q,Ae=Math.max(50,ne+Y);u&&u(ie,Ae);},D=()=>{y(null),k.current=null,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",D),document.body.style.cursor="";};useEffect(()=>()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",D);},[]);let P=h==="multiple"||h==="single",w=m.length>0&&!!C,B=t(b?"table.group.collapseAll":"table.group.expandAll"),R=c.filter(K=>g.includes(K.id)),I=new Map(n.map((K,Q)=>[K.field,{...K,priority:Q+1}])),A=R.map(K=>{let Q=v?.[K.id]||K.minWidth||100,ne=I.get(K.id);return jsx(ob,{headCell:K,width:typeof Q=="number"?Q:100,order:r,orderBy:a,multiSortInfo:ne,onRequestSort:E(K.id),onContextMenu:l,onResizeMouseDown:ie=>M(ie,K.id,typeof Q=="number"?Q:100),enableColumnReorder:p},K.id)}),q=R.map(K=>K.id),O=jsxs(qh,{children:[P&&jsx($s,{padding:"checkbox",sx:K=>({width:48,position:"sticky",top:0,zIndex:4,backgroundColor:K.palette.mode==="dark"?"#000000":"#f5f5f5",color:K.palette.mode==="dark"?"#ffffff":K.palette.text.primary}),children:jsx(_h,{color:"primary",indeterminate:i>0&&i<s,checked:s>0&&i===s,onChange:o,disabled:h==="single"})}),w&&jsx($s,{align:"center",padding:"checkbox",sx:K=>({width:44,position:"sticky",top:0,zIndex:4,backgroundColor:K.palette.mode==="dark"?"#000000":"#f5f5f5",color:K.palette.mode==="dark"?"#ffffff":K.palette.text.primary}),children:jsx(Xh,{title:B,children:jsx(Zh,{size:"small",onClick:K=>{K.stopPropagation(),C?.(!b);},sx:{p:.2},children:b?jsx(Qh,{fontSize:"small"}):jsx(Yh,{fontSize:"small"})})})}),p?jsx(SortableContext,{items:q,strategy:horizontalListSortingStrategy,children:A}):A]});return jsx(Kh,{children:O})},ob=({headCell:e,width:t,order:o,orderBy:r,multiSortInfo:a,onRequestSort:n,onContextMenu:i,onResizeMouseDown:s,enableColumnReorder:d})=>{let{setNodeRef:l,attributes:c,listeners:g,transform:h,transition:m,isDragging:b}=useSortable({id:e.id,disabled:!d}),C=d?{transform:zi.Transform.toString(h),transition:m,opacity:b?.6:1}:{},u=a?.direction??(r===e.id?o:"asc"),v=!!a||r===e.id;return jsxs($s,{ref:d?l:void 0,align:"left",padding:e.disablePadding?"none":"normal",sortDirection:v?u:false,onContextMenu:i?p=>i(p,e.id):void 0,style:{width:t,minWidth:t,maxWidth:t,...C},sx:p=>({position:"sticky",top:0,zIndex:4,backgroundColor:p.palette.mode==="dark"?"#000000":"#f5f5f5",color:p.palette.mode==="dark"?"#ffffff":p.palette.text.primary,fontWeight:"bold",userSelect:"none",cursor:d?b?"grabbing":"grab":void 0}),...d?c:{},...d?g:{},children:[jsx(jh,{active:v,direction:u,onClick:n,sx:p=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:p.palette.mode==="dark"?"#ffffff":p.palette.text.primary,opacity:v?1:0,transition:"opacity 0.2s"},"&:hover .MuiTableSortLabel-icon":{opacity:.5},"&.Mui-active .MuiTableSortLabel-icon":{opacity:1,color:p.palette.mode==="dark"?"#ffffff":p.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:p.palette.mode==="dark"?"#ffffff":p.palette.text.primary}),children:jsxs(ei,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1,display:"inline-flex",alignItems:"center",gap:.5},children:[e.label,a&&jsx(ei,{component:"span",sx:p=>({display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:16,height:16,px:.5,borderRadius:999,fontSize:10,fontWeight:700,color:"#fff",backgroundColor:p.palette.primary.main}),children:a.priority})]})}),jsx(ei,{onMouseDown:s,onPointerDown:p=>p.stopPropagation(),onClick:p=>p.stopPropagation(),sx:p=>({position:"absolute",right:0,top:0,bottom:0,width:5,cursor:"col-resize",backgroundColor:"transparent",transition:"background-color 120ms ease","&:hover":{backgroundColor:p.palette.mode==="dark"?"rgba(148,163,184,0.28)":"rgba(15,23,42,0.12)"},zIndex:1})})]})};var nu=e=>{let{t}=ee(),{visibleRows:o,visibleColumns:r,selected:a=[],handleClick:n,columns:i,toggleGroupExpand:s,expandedGroups:d=new Set,selectionMode:l,grouping:c=[],isGroupFullyExpanded:g,handleExpandGroupRecursively:h,handleCollapseGroupRecursively:m}=e,b=p=>a.indexOf(p)!==-1,C=l==="multiple"||l==="single",u=c.length>0,v=r.length+(C?1:0)+(u?1:0);return jsxs(TableBody,{children:[o.map((p,f)=>{if(p.type==="group"){let y=d.has(p.id),k=p.childIds||[],E=k.filter(P=>b(P)).length,M=k.length>0&&E===k.length,S=E>0&&E<k.length;return jsxs(TableRow,{sx:P=>({backgroundColor:P.palette.mode==="dark"?"#111111":"#f5f5f5","& .MuiTableCell-root":{color:P.palette.text.primary,borderBottomColor:P.palette.divider},"& .MuiIconButton-root":{color:P.palette.text.primary},"& .MuiCheckbox-root":{color:P.palette.text.secondary},"& .MuiCheckbox-root.Mui-checked, & .MuiCheckbox-root.MuiCheckbox-indeterminate":{color:P.palette.primary.main}}),children:[C&&jsx(TableCell,{padding:"checkbox",children:jsx(Checkbox,{size:"small",checked:M,indeterminate:S,onChange:P=>{if(P.stopPropagation(),!!e.onSelectionChange)if(M){let w=a.filter(B=>!k.includes(B));e.onSelectionChange(w);}else {let w=Array.from(new Set([...a,...k]));e.onSelectionChange(w);}},onClick:P=>P.stopPropagation(),sx:{p:.5}})}),u&&jsx(TableCell,{padding:"checkbox",sx:{width:44},children:jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.25},children:[c.length>1&&p.level<c.length-1&&jsx(Tooltip,{title:g?.(p.id)?t("table.group.collapseAll"):t("table.group.expandAll"),children:jsx(IconButton,{size:"small",onClick:()=>{g?.(p.id)?m?.(p.id):h?.(p.id);},sx:{p:.25},children:g?.(p.id)?jsx(Qh,{fontSize:"small"}):jsx(Yh,{fontSize:"small"})})}),jsx(IconButton,{size:"small",onClick:()=>s&&s(p.id),sx:{p:.25},children:y?jsx(sb,{}):jsx(df,{})})]})}),jsx(TableCell,{colSpan:r.length,sx:{py:1,pl:p.level*3+1},children:jsxs(Typography,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[p.field,": ",p.value," (",p.count,")"]})})]},p.id)}else {let y=p.data||p,k=p.id||y.id||f,E=b(k),M=`enhanced-table-checkbox-${f}`,D=(p.level!==void 0?p.level:0)*4;return jsxs(TableRow,{hover:true,onClick:P=>n&&n(P,y),role:"checkbox","aria-checked":E,tabIndex:-1,selected:E,sx:{cursor:"pointer"},children:[C&&jsx(TableCell,{padding:"checkbox",sx:{pl:D>0?D+1:void 0},children:jsx(Checkbox,{color:"primary",checked:E,inputProps:{"aria-labelledby":M}})}),u&&jsx(TableCell,{padding:"checkbox",sx:{width:44}}),i.filter(P=>r.includes(P.id)).map((P,w)=>{let R=!C&&w===0&&D>0?{pl:D+2}:{};return jsx(TableCell,{align:"left",sx:R,children:P.render?P.render(y[P.id],y):(function(){let A=y[P.id];if(P.numeric){if(typeof A=="number")return A.toLocaleString();if(typeof A=="string"&&A.trim()!==""&&!isNaN(Number(A)))return Number(A).toLocaleString()}return A})()},P.id)})]},k)}}),o.length===0&&jsx(TableRow,{children:jsx(TableCell,{colSpan:v,align:"center",children:t("common.noData")})})]})};var iu=e=>{let{visibleColumns:t,summaryRow:o,selectionMode:r,grouping:a=[]}=e;if(!e.showSummary)return null;let n=r==="multiple"||r==="single",i=a.length>0;return jsx(TableFooter,{sx:{position:"sticky",bottom:0,zIndex:e.zIndex,bgcolor:"background.paper"},children:jsxs(TableRow,{children:[n&&jsx(TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper"}}),i&&jsx(TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper",width:44}}),t.map(s=>jsx(TableCell,{sx:{fontWeight:"bold",fontSize:"0.85rem",bgcolor:"background.paper",color:"text.primary"},children:(function(){let l=o[s];return l==null||l===""?"":typeof l=="number"?l.toLocaleString():typeof l=="string"&&l.trim()!==""&&!isNaN(Number(l))?Number(l).toLocaleString():l})()},s))]})})};var su=e=>{let{t}=ee();return jsx(Box,{sx:{p:2},children:jsx(Typography,{children:t("table.mobile.notImplemented")})})};var Ua=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:o,setGrouping:r,columns:a,toggleGroupField:n})=>{let{t:i}=ee();return jsxs(Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxs(Box,{sx:{p:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsx(Typography,{variant:"subtitle2",sx:{px:1},children:i("table.menu.groupBy")}),o.length>0&&jsx(Button,{size:"small",color:"error",onClick:()=>r([]),startIcon:jsx(mu,{}),children:i("table.menu.clearAll")})]}),jsx(Divider,{}),a.map(s=>{let d=o.includes(s.id),l=o.indexOf(s.id)+1;return jsx(MenuItem,{onClick:()=>n(s.id),children:jsxs(Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsx(Checkbox,{checked:d,size:"small"}),jsx(ListItemText,{primary:s.label}),d&&jsx(Badge,{badgeContent:l,color:"primary",sx:{mr:2}})]})},s.id)})]})},Ka=({anchorEl:e,setAnchorEl:t,columns:o,visibleColumns:r,toggleColumnVisibility:a})=>{let{t:n}=ee();return jsxs(Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:n("table.menu.visibleColumns")})}),jsx(Divider,{}),o.map(i=>jsxs(MenuItem,{onClick:()=>a(i.id),children:[jsx(Checkbox,{checked:r.includes(i.id),size:"small"}),jsx(ListItemText,{primary:i.label})]},i.id))]})},Hi=({anchorEl:e,setAnchorEl:t,showSummary:o,setShowSummary:r,columns:a,summaryColumns:n,toggleSummaryColumn:i})=>{let{t:s}=ee();return jsxs(Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsx(MenuItem,{children:jsx(FormControlLabel,{control:jsx(Switch,{checked:o,onChange:d=>r(d.target.checked),size:"small"}),label:s("table.menu.showSummaryRow")})}),jsx(Divider,{}),a.filter(d=>d.numeric).map(d=>jsxs(MenuItem,{onClick:()=>i(d.id),disabled:!o,children:[jsx(Checkbox,{checked:n.includes(d.id),size:"small"}),jsx(ListItemText,{primary:d.label})]},d.id)),a.filter(d=>d.numeric).length===0&&jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:s("table.menu.noNumericColumns")})})]})},Wi=({contextMenu:e,handleCloseContextMenu:t,columns:o,visibleColumns:r,toggleColumnVisibility:a})=>{let{t:n}=ee();return jsxs(Menu,{open:e!==null,onClose:t,anchorReference:"anchorPosition",anchorPosition:e!==null?{top:e.mouseY,left:e.mouseX}:void 0,children:[jsx(MenuItem,{onClick:t,children:n("common.copy")}),jsx(Divider,{}),jsx(MenuItem,{disabled:true,children:n("table.menu.visibleColumns")}),o.map(i=>jsxs(MenuItem,{onClick:()=>a(i.id),children:[jsx(ListItemIcon,{children:r.includes(i.id)&&jsx(kb,{fontSize:"small"})}),jsx(ListItemText,{children:i.label})]},i.id))]})},bu=({contextMenu:e,handleClose:t,columns:o,visibleColumns:r,grouping:a,summaryColumns:n,showSummary:i,sortBy:s,orderBy:d,order:l,onSortAsc:c,onSortDesc:g,onClearSort:h,onHideColumn:m,onToggleGroup:b,onToggleSummary:C,onOpenSortDialog:u})=>{let{t:v}=ee(),p=e?.columnId??"",f=o.find(w=>w.id===p),y=a.includes(p),k=n.includes(p),E=!!f?.numeric,M=s.find(w=>w.field===p),S=M?M.direction==="asc":d===p&&l==="asc",D=M?M.direction==="desc":d===p&&l==="desc",P=S||D;return jsxs(Menu,{open:e!==null,onClose:t,anchorReference:"anchorPosition",anchorPosition:e!==null?{top:e.mouseY,left:e.mouseX}:void 0,children:[jsx(MenuItem,{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:jsx(ListItemText,{primary:f?.label??p})}),jsx(Divider,{}),jsxs(MenuItem,{onClick:()=>{c(p),t();},selected:S,children:[jsx(ListItemIcon,{children:jsx(gu,{fontSize:"small"})}),jsx(ListItemText,{primary:v("table.headerMenu.sortAsc")})]}),jsxs(MenuItem,{onClick:()=>{g(p),t();},selected:D,children:[jsx(ListItemIcon,{children:jsx(fu,{fontSize:"small"})}),jsx(ListItemText,{primary:v("table.headerMenu.sortDesc")})]}),P&&jsxs(MenuItem,{onClick:()=>{h(p),t();},children:[jsx(ListItemIcon,{children:jsx(mu,{fontSize:"small"})}),jsx(ListItemText,{primary:v("table.headerMenu.clearSort")})]}),jsxs(MenuItem,{onClick:()=>{u(),t();},children:[jsx(ListItemIcon,{children:jsx(hu,{fontSize:"small"})}),jsx(ListItemText,{primary:v("table.headerMenu.configureSort")})]}),jsx(Divider,{}),jsxs(MenuItem,{onClick:()=>{b(p),t();},selected:y,children:[jsx(ListItemIcon,{children:jsx(Fh,{fontSize:"small"})}),jsx(ListItemText,{primary:v(y?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),E&&i&&jsxs(MenuItem,{onClick:()=>{C(p),t();},selected:k,children:[jsx(ListItemIcon,{children:jsx(Lh,{fontSize:"small"})}),jsx(ListItemText,{primary:v(k?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),jsx(Divider,{}),jsxs(MenuItem,{onClick:()=>{m(p),t();},children:[jsx(ListItemIcon,{children:jsx(Sb,{fontSize:"small"})}),jsx(ListItemText,{primary:v("table.headerMenu.hideColumn")})]})]})},yu=({open:e,onClose:t,columns:o,initialRules:r,onApply:a,onClear:n})=>{let{t:i}=ee(),[s,d]=useState([]);useEffect(()=>{e&&d(r.length>0?r.map(C=>({...C})):[]);},[e,r]);let l=useMemo(()=>new Set(s.map(C=>C.field)),[s]),c=useMemo(()=>o.filter(C=>!l.has(C.id)),[o,l]),g=()=>{let C=c[0];C&&d(u=>[...u,{field:C.id,direction:"asc"}]);},h=C=>{d(u=>u.filter((v,p)=>p!==C));},m=(C,u)=>{d(v=>v.map((p,f)=>f===C?{...p,...u}:p));},b=(C,u)=>{d(v=>{let p=C+u;if(p<0||p>=v.length)return v;let f=[...v],[y]=f.splice(C,1);return f.splice(p,0,y),f});};return jsxs(Dialog,{open:e,onClose:t,maxWidth:"sm",fullWidth:true,children:[jsx(DialogTitle,{children:i("table.sortDialog.title")}),jsxs(DialogContent,{dividers:true,children:[s.length===0?jsx(Typography,{variant:"body2",sx:{color:"text.secondary",py:2},children:i("table.sortDialog.empty")}):jsx(Stack,{spacing:1,children:s.map((C,u)=>{let v=new Set(s.filter((f,y)=>y!==u).map(f=>f.field)),p=o.filter(f=>!v.has(f.id));return jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"24px 1fr 110px auto auto",alignItems:"center",gap:1},children:[jsx(Badge,{badgeContent:u+1,color:"primary",sx:{ml:.5}}),jsx("select",{value:C.field,onChange:f=>m(u,{field:f.target.value}),style:{padding:6,fontSize:13,borderRadius:4},children:p.map(f=>jsx("option",{value:f.id,children:f.label},f.id))}),jsxs("select",{value:C.direction,onChange:f=>m(u,{direction:f.target.value}),style:{padding:6,fontSize:13,borderRadius:4},children:[jsx("option",{value:"asc",children:i("table.sortDialog.asc")}),jsx("option",{value:"desc",children:i("table.sortDialog.desc")})]}),jsx(IconButton,{size:"small",onClick:()=>b(u,-1),disabled:u===0,children:jsx(gu,{fontSize:"small"})}),jsxs(Stack,{direction:"row",children:[jsx(IconButton,{size:"small",onClick:()=>b(u,1),disabled:u===s.length-1,children:jsx(fu,{fontSize:"small"})}),jsx(IconButton,{size:"small",onClick:()=>h(u),children:jsx(Ib,{fontSize:"small"})})]})]},`sort-rule-${u}`)})}),jsx(Button,{size:"small",onClick:g,disabled:c.length===0,startIcon:jsx(hu,{}),sx:{mt:2},children:i("table.sortDialog.addRule")})]}),jsxs(DialogActions,{children:[jsx(Button,{color:"inherit",onClick:()=>{n(),t();},children:i("table.sortDialog.clearAll")}),jsx(Box,{sx:{flex:1}}),jsx(Button,{onClick:t,children:i("common.cancel")}),jsx(Button,{variant:"contained",onClick:()=>{a(s),t();},children:i("common.ok")})]})]})};var Wn=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),vu=({kpis:e})=>{let{t}=ee(),o=[{label:t("graph.kpi.totalRecords"),value:Wn(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:Wn(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:Wn(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:Wn(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:Wn(e.flaggedCount,0),color:"error.main"}];return jsx(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(6, minmax(0, 1fr))"},gap:1.5},children:o.map(r=>jsxs(Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsx(Typography,{variant:"caption",color:"text.secondary",children:r.label}),jsx(Typography,{variant:"h4",fontWeight:800,sx:{color:r.color},children:r.value})]},r.label))})};var $i=({title:e,subtitle:t,children:o})=>jsxs(Paper,{variant:"outlined",sx:{p:2,borderRadius:2},children:[jsx(Typography,{variant:"subtitle1",fontWeight:700,children:e}),t&&jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mb:2},children:t}),o]});var Gn=({data:e,orientation:t="horizontal",valueSuffix:o="",minHeight:r=210,activeName:a,onItemClick:n})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=Math.max(...e.map(s=>s.value),1);return t==="vertical"?jsx(Box,{sx:{display:"flex",gap:1,alignItems:"flex-end",minHeight:r},children:e.map(s=>jsxs(Box,{sx:{flex:1,minWidth:0},children:[jsx(Box,{onClick:()=>n?.(s),sx:{height:`${Math.max(s.value/i*180,6)}px`,bgcolor:s.name===a?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:n?"pointer":"default",opacity:a&&s.name!==a?.45:1}}),jsx(Typography,{variant:"caption",noWrap:true,title:s.name,sx:{display:"block",mt:.5},children:s.name}),jsxs(Typography,{variant:"caption",color:"text.secondary",children:[s.value.toFixed(1),o]})]},s.name))}):jsx(Stack,{spacing:1,children:e.map(s=>jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[jsx(Typography,{variant:"caption",color:"text.secondary",noWrap:true,title:s.name,children:s.name}),jsx(Box,{onClick:()=>n?.(s),sx:{alignSelf:"center",bgcolor:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:n?"pointer":"default",opacity:a&&s.name!==a?.45:1},children:jsx(Box,{sx:{width:`${s.value/i*100}%`,height:"100%",bgcolor:s.name===a?"primary.dark":"primary.main"}})}),jsxs(Typography,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[s.value.toFixed(1),o]})]},s.name))})};var Su=({data:e,color:t="#42A5F5",valueSuffix:o="",height:r=220})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let a=640,n=28,i=e.map(h=>h.value),s=Math.min(...i,0),l=Math.max(...i,1)-s||1,c=e.map((h,m)=>{let b=n+m*(a-n*2)/Math.max(e.length-1,1),C=r-n-(h.value-s)/l*(r-n*2);return {x:b,y:C,...h}}),g=c.map(h=>`${h.x},${h.y}`).join(" ");return jsxs(Box,{children:[jsxs(Box,{component:"svg",viewBox:`0 0 ${a} ${r}`,sx:{width:"100%",height:r},children:[jsx("line",{x1:n,y1:r-n,x2:a-n,y2:r-n,stroke:"rgba(148,163,184,0.4)"}),jsx("polyline",{fill:"none",stroke:t,strokeWidth:3,points:g}),c.map(h=>jsx("circle",{cx:h.x,cy:h.y,r:4,fill:t},h.name))]}),jsx(Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(h=>jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"caption",noWrap:true,title:h.name,sx:{display:"block"},children:h.name}),jsxs(Typography,{variant:"caption",color:"text.secondary",children:[h.value.toFixed(1),o]})]},h.name))})]})};var wu=({data:e,barColor:t="#64B5F6",lineColor:o="#FFB74D",height:r=220})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let a=640,n=28,i=Math.max(...e.map(c=>c.barValue),1),s=Math.max(...e.map(c=>c.lineValue),1),d=e.map((c,g)=>{let h=(a-n*2)/e.length,m=Math.max(h*.5,8),b=n+g*h+(h-m)/2,C=c.barValue/i*(r-n*2),u=r-n-C;return {x:b,y:u,barHeight:C,barWidth:m,item:c}}),l=e.map((c,g)=>{let h=(a-n*2)/e.length,m=n+g*h+h/2,b=r-n-c.lineValue/s*(r-n*2);return {x:m,y:b,item:c}});return jsxs(Stack,{spacing:1.25,children:[jsxs(Box,{component:"svg",viewBox:`0 0 ${a} ${r}`,sx:{width:"100%",height:r},children:[jsx("line",{x1:n,y1:r-n,x2:a-n,y2:r-n,stroke:"rgba(148,163,184,0.4)"}),d.map(c=>jsx("rect",{x:c.x,y:c.y,width:c.barWidth,height:Math.max(c.barHeight,4),rx:6,fill:t},c.item.name)),jsx("polyline",{fill:"none",stroke:o,strokeWidth:3,points:l.map(c=>`${c.x},${c.y}`).join(" ")}),l.map(c=>jsx("circle",{cx:c.x,cy:c.y,r:3.5,fill:o},`${c.item.name}-line`))]}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(c=>jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"caption",noWrap:true,title:c.name,sx:{display:"block"},children:c.name}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Bar: ",c.barValue.toFixed(1)]}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Line: ",c.lineValue.toFixed(1)]})]},c.name))})]})};var zb=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,Iu=({data:e})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let t=Array.from(new Set(e.map(n=>n.x))),o=Array.from(new Set(e.map(n=>n.y))),r=Math.max(...e.map(n=>n.value),1),a=new Map(e.map(n=>[`${n.y}__${n.x}`,n.value]));return jsx(Box,{sx:{overflowX:"auto"},children:jsxs(Box,{sx:{display:"grid",gridTemplateColumns:`120px repeat(${t.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+t.length*64},children:[jsx(Box,{}),t.map(n=>jsx(Typography,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:n},n)),o.map(n=>jsxs(Box,{sx:{display:"contents"},children:[jsx(Typography,{variant:"caption",sx:{alignSelf:"center"},children:n}),t.map(i=>{let s=a.get(`${n}__${i}`)||0,d=s/r;return jsx(Box,{sx:{height:36,borderRadius:1,bgcolor:zb(d),border:"1px solid rgba(148,163,184,0.2)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsx(Typography,{variant:"caption",fontWeight:700,children:s.toFixed(1)})},`${n}-${i}`)})]},n))]})})};var Nb=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],Zi=({data:e,variant:t="donut",colors:o=Nb,size:r=180,activeName:a,onItemClick:n})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=0,s=e.map((d,l)=>{let c=i;return i+=d.percent,`${o[l%o.length]} ${c}% ${i}%`});return jsxs(Stack,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[jsx(Box,{sx:{width:r,height:r,borderRadius:"50%",background:`conic-gradient(${s.join(", ")})`,position:"relative",flexShrink:0},children:t==="donut"&&jsx(Box,{sx:{position:"absolute",inset:Math.round(r*.18),bgcolor:"background.paper",borderRadius:"50%"}})}),jsx(Stack,{spacing:1,sx:{minWidth:180},children:e.map((d,l)=>jsxs(Box,{onClick:()=>n?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:n?"pointer":"default",opacity:a&&d.name!==a?.45:1},children:[jsx(Box,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:o[l%o.length]}}),jsx(Typography,{variant:"caption",sx:{flex:1},children:d.name}),jsxs(Typography,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};var Ru=({effect:e,branches:t})=>{if(t.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let o=t.filter((a,n)=>n%2===0),r=t.filter((a,n)=>n%2===1);return jsxs(Stack,{spacing:1.5,children:[jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(a=>jsxs(Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsx(Typography,{variant:"caption",fontWeight:700,children:a.title}),a.causes.map(n=>jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},a.title))}),jsxs(Box,{sx:{position:"relative",height:32},children:[jsx(Box,{sx:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),jsx(Box,{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,bgcolor:"primary.main",color:"primary.contrastText"},children:jsx(Typography,{variant:"caption",fontWeight:700,children:e})})]}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(r.length,1)}, minmax(0, 1fr))`,gap:1},children:r.map(a=>jsxs(Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsx(Typography,{variant:"caption",fontWeight:700,children:a.title}),a.causes.map(n=>jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},a.title))})]})};var Mu=({data:e,height:t=240})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let o=0,r=e.map(g=>{let h=g.type==="total"?0:o,m=g.type==="total"?g.value:o+g.value;return g.type!=="total"&&(o=m),{...g,start:h,end:m,delta:m-h}}),a=r.flatMap(g=>[g.start,g.end]),n=Math.min(...a,0),i=Math.max(...a,1),s=680,d=30,l=i-n||1,c=g=>t-d-(g-n)/l*(t-d*2);return jsxs(Box,{children:[jsxs(Box,{component:"svg",viewBox:`0 0 ${s} ${t}`,sx:{width:"100%",height:t},children:[jsx("line",{x1:d,y1:c(0),x2:s-d,y2:c(0),stroke:"rgba(148,163,184,0.4)"}),r.map((g,h)=>{let m=(s-d*2)/r.length,b=Math.max(m*.55,8),C=d+h*m+(m-b)/2,u=c(Math.max(g.start,g.end)),v=c(Math.min(g.start,g.end)),p=g.type==="total"?"#42A5F5":g.delta>=0?"#66BB6A":"#EF5350";return jsxs("g",{children:[jsx("rect",{x:C,y:u,width:b,height:Math.max(v-u,4),rx:6,fill:p}),jsx("text",{x:C+b/2,y:u-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:g.end.toFixed(1)})]},g.name)})]}),jsx(Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${r.length}, minmax(0, 1fr))`,gap:1},children:r.map(g=>jsx(Typography,{variant:"caption",noWrap:true,title:g.name,children:g.name},g.name))})]})};var qn=({apiKey:e,query:t,zoom:o=14,mapType:r="roadmap"})=>{let a=encodeURIComponent(t);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(e)}&q=${a}&zoom=${o}&maptype=${r}`},ER=(e,t=360)=>{let o=qn(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};var Eu=({apiKey:e,query:t,embedUrl:o,zoom:r=14,mapType:a="roadmap",height:n=320})=>{let i=o||(e&&t?qn({apiKey:e,query:t,zoom:r,mapType:a}):"");return i?jsxs(Box,{children:[jsx(Box,{component:"iframe",src:i,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsx(Link,{href:i,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):jsx(Box,{children:jsx(Typography,{variant:"body2",color:"text.secondary",children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var Qi=({keyword:e,location:t,src:o="orbcafe-ui"})=>{if(t){let r=encodeURIComponent(t.name||e||"Location");return `https://uri.amap.com/marker?position=${t.lng},${t.lat}&name=${r}&src=${encodeURIComponent(o)}&coordinate=gaode&callnative=0`}return e?`https://uri.amap.com/search?keyword=${encodeURIComponent(e)}&src=${encodeURIComponent(o)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};var Nu=({keyword:e,location:t,embedUrl:o,height:r=320})=>{let a=o||Qi({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0});return jsxs(Box,{children:[jsx(Box,{component:"iframe",src:a,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:r,border:0,borderRadius:2}}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsx(Link,{href:a,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var Vu=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:o,interaction:r})=>{let{t:a}=ee();return jsxs(Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsx($i,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:jsx(Gn,{data:e,orientation:"horizontal",activeName:r?.filters?.primaryDimension,onItemClick:n=>r?.onPrimaryDimensionClick?.(n.name)})}),jsx($i,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:jsx(Gn,{data:t,orientation:"vertical",valueSuffix:"%",activeName:r?.filters?.secondaryDimension,onItemClick:n=>r?.onSecondaryDimensionClick?.(n.name)})}),jsx($i,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:jsx(Zi,{data:o,variant:"donut",activeName:r?.filters?.status,onItemClick:n=>r?.onStatusClick?.(n.name)})})]})};var io=e=>jsx(TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var oc=e=>jsx(TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var oy=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],ry=["zh","en","de","fr","ja","ko"],Wu=({open:e,onClose:t,value:o,onSaveAll:r,modelOptions:a=oy,promptLangOptions:n=ry,analysisTemplateOptions:i=[],responseTemplateOptions:s=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:l})=>{let[c,g]=useState(o),[h,m]=useState(d||""),[b,C]=useState(l||""),[u,v]=useState(false);useEffect(()=>{e&&(g(o),m(d||""),C(l||""));},[e,o,d,l]);let p=(y,k)=>{g(E=>({...E,[y]:k}));},f=async()=>{if(r)try{v(!0),await r({settings:c,analysisTemplateId:h||void 0,responseTemplateId:b||void 0});}finally{v(false);}};return jsxs(Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"lg",children:[jsxs(DialogTitle,{sx:{pr:7,pb:2.2},children:[jsx(Typography,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),jsx(IconButton,{onClick:t,sx:{position:"absolute",right:12,top:12},children:jsx(hh,{})})]}),jsx(DialogContent,{sx:{pt:"18px !important"},children:jsxs(Stack,{spacing:2.2,children:[jsxs(Box,{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[jsx(Box,{children:jsx(io,{size:"small",value:c.baseUrl,onChange:y=>p("baseUrl",y.target.value),fullWidth:true,label:"Base URL"})}),jsx(Box,{children:jsx(io,{size:"small",type:"password",value:c.apiKey,onChange:y=>p("apiKey",y.target.value),fullWidth:true,label:"API Key"})}),jsx(Box,{children:jsx(io,{size:"small",value:c.model,onChange:y=>p("model",y.target.value),fullWidth:true,select:true,label:"Model",children:a.map(y=>jsx(MenuItem,{value:y,children:y},y))})}),jsx(Box,{children:jsx(io,{size:"small",value:c.promptLang,onChange:y=>p("promptLang",y.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:n.map(y=>jsx(MenuItem,{value:y,children:y},y))})})]}),jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[jsxs(io,{size:"small",value:h,onChange:y=>m(y.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[jsx(MenuItem,{value:"",children:"Default"}),i.map(y=>jsx(MenuItem,{value:y.id,children:y.label},y.id))]}),jsx(oc,{multiline:true,minRows:8,value:c.analysisPrompt,onChange:y=>p("analysisPrompt",y.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxs(io,{size:"small",value:b,onChange:y=>C(y.target.value),fullWidth:true,select:true,label:"Response Template",children:[jsx(MenuItem,{value:"",children:"Default"}),s.map(y=>jsx(MenuItem,{value:y.id,children:y.label},y.id))]}),jsx(oc,{multiline:true,minRows:8,value:c.responsePrompt,onChange:y=>p("responsePrompt",y.target.value),fullWidth:true,label:"Response Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),jsxs(DialogActions,{sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[jsx(Button,{variant:"outlined",onClick:t,children:"Cancel"}),jsx(Button,{variant:"contained",onClick:f,disabled:!r||u,children:"Save"})]})]})};var rl=({open:e,onClose:t,model:o,tableContent:r,extraCharts:a,interaction:n,aiAssistant:i})=>{let{t:s}=ee(),[d,l]=useState(i?.defaultPrompt||""),[c,g]=useState(false),[h,m]=useState(false),b=n?.enabled!==false&&!!n,C=i?.enabled!==false,u=n?.filters||{},v=!!(u.primaryDimension||u.secondaryDimension||u.status),p=i?.placeholder||"Ask AI to analyze data, create charts, or find insights...";useEffect(()=>{e&&l(i?.defaultPrompt||"");},[e,i?.defaultPrompt]);let f=i?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},y=async()=>{let k=d.trim();if(!(!k||!i?.onSubmit))try{g(!0),await i.onSubmit(k,{filters:u,model:o});}finally{g(false);}};return jsx(Dialog,{open:e,onClose:t,fullScreen:true,children:jsxs(Box,{sx:{height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[jsx(Box,{sx:{p:2,borderBottom:1,borderColor:"divider"},children:jsxs(Stack,{direction:{xs:"column",lg:"row"},alignItems:{xs:"stretch",lg:"center"},justifyContent:"space-between",spacing:1.5,children:[jsxs(Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{flexWrap:"wrap"},children:[jsx(Typography,{variant:"h5",fontWeight:800,children:o.title}),jsx(Chip,{size:"small",label:s("graph.records",{count:o.kpis.totalRecords})}),b&&u.primaryDimension&&jsx(Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.primaryDimension}: ${u.primaryDimension}`,onDelete:()=>n?.onClearFilter("primaryDimension")}),b&&u.secondaryDimension&&jsx(Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.secondaryDimension}: ${u.secondaryDimension}`,onDelete:()=>n?.onClearFilter("secondaryDimension")}),b&&u.status&&jsx(Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.status}: ${u.status}`,onDelete:()=>n?.onClearFilter("status")}),b&&v&&jsx(Button,{size:"small",onClick:()=>n?.onClearAll(),children:"Clear"})]}),jsxs(Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{width:{xs:"100%",lg:"auto"}},children:[C&&jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minWidth:{xs:0,lg:520},flex:{xs:1,lg:"0 0 auto"}},children:[jsx(IconButton,{size:"small",onClick:i?.onVoiceInput,children:jsx(cy,{sx:{fontSize:18,color:"text.secondary"}})}),jsx(InputBase,{fullWidth:true,value:d,onChange:k=>l(k.target.value),onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),y());},placeholder:p,sx:{fontSize:"0.9rem"}}),jsx(IconButton,{size:"small",onClick:y,disabled:c||!d.trim(),children:jsx(uy,{sx:{fontSize:18}})}),jsx(IconButton,{size:"small",onClick:()=>m(true),children:jsx(dy,{sx:{fontSize:18}})})]}),jsx(IconButton,{onClick:t,children:jsx(hh,{})})]})]})}),jsxs(Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,overflow:"auto",minHeight:0},children:[jsx(vu,{kpis:o.kpis}),jsx(Vu,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:b?{filters:u,onPrimaryDimensionClick:k=>n?.onPrimaryDimensionClick(k),onSecondaryDimensionClick:k=>n?.onSecondaryDimensionClick(k),onStatusClick:k=>n?.onStatusClick(k)}:void 0}),a,r]}),jsx(Wu,{open:h,onClose:()=>m(false),value:f,onSaveAll:i?.onSaveAll,modelOptions:i?.modelOptions,promptLangOptions:i?.promptLangOptions,analysisTemplateOptions:i?.analysisTemplateOptions,responseTemplateOptions:i?.responseTemplateOptions,defaultAnalysisTemplateId:i?.defaultAnalysisTemplateId,defaultResponseTemplateId:i?.defaultResponseTemplateId})]})})};var qr={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"]},my=5,$u=e=>e.toLowerCase().replace(/[\s_-]/g,""),_r=(e,t,o,r)=>{if(t)return t;if(e.length===0)return r;let a=Object.keys(e[0]),n=new Map(a.map(i=>[$u(i),i]));for(let i of o){let s=n.get($u(i));if(s)return s}return a[0]||r},Ro=e=>{if(typeof e=="number")return Number.isFinite(e)?e:0;if(typeof e=="string"){let t=Number(e.replace(/,/g,"").trim());return Number.isFinite(t)?t:0}return 0},Yt=(e,t)=>e==null||e===""?t:String(e),gy=(e,t,o,r,a)=>{let n=new Map;return e.forEach(i=>{let s=Yt(i[t],a);n.set(s,(n.get(s)||0)+Ro(i[o]));}),Array.from(n.entries()).map(([i,s])=>({name:i,value:s})).sort((i,s)=>s.value-i.value).slice(0,r)},fy=(e,t,o,r,a,n)=>{let i=new Map;return e.forEach(s=>{let d=Yt(s[t],n),l=i.get(d)||{report:0,billable:0};l.report+=Ro(s[o]),l.billable+=Ro(s[r]),i.set(d,l);}),Array.from(i.entries()).map(([s,d])=>({name:s,value:d.report>0?d.billable/d.report*100:0})).sort((s,d)=>s.value-d.value).slice(0,a)},hy=(e,t,o)=>{let r=e.length;if(r===0)return [];let a=new Map;return e.forEach(n=>{let i=Yt(n[t],o);a.set(i,(a.get(i)||0)+1);}),Array.from(a.entries()).map(([n,i])=>({name:n,value:i,percent:i/r*100}))},Gu=(e,t,o)=>{let r=new Map;return e.forEach(a=>{let n=Yt(a[t],"N/A");r.set(n,(r.get(n)||0)+Ro(a[o]));}),Array.from(r.entries()).sort(([a],[n])=>a.localeCompare(n)).map(([a,n])=>({name:a,value:n}))},by=(e,t,o,r,a,n)=>{let i=new Map;return e.forEach(s=>{let d=Yt(s[t],n),l=i.get(d)||{report:0,billable:0};l.report+=Ro(s[o]),l.billable+=Ro(s[r]),i.set(d,l);}),Array.from(i.entries()).map(([s,d])=>({name:s,barValue:d.billable,lineValue:d.report>0?d.billable/d.report*100:0})).sort((s,d)=>d.barValue-s.barValue).slice(0,a)},yy=(e,t,o,r,a)=>{let n=new Map;return e.forEach(i=>{let s=Yt(i[t],a),d=Yt(i[o],a),l=`${s}__${d}`;n.set(l,(n.get(l)||0)+Ro(i[r]));}),Array.from(n.entries()).map(([i,s])=>{let[d,l]=i.split("__");return {x:d,y:l,value:s}})},xy=(e,t,o)=>{let r=Gu(e,t,o),a=r.map(i=>({name:i.name,value:i.value,type:"delta"})),n=r.reduce((i,s)=>i+s.value,0);return [...a,{name:"Total",value:n,type:"total"}]},vy=(e,t,o,r,a,n)=>{let i=new Map;return e.forEach(s=>{let d=Yt(s[t],n),l=`${Yt(s[o],n)} / ${Yt(s[r],n)}`,c=i.get(d)||new Map;c.set(l,(c.get(l)||0)+1),i.set(d,c);}),Array.from(i.entries()).map(([s,d])=>({title:s,causes:Array.from(d.entries()).sort((l,c)=>c[1]-l[1]).slice(0,a).map(([l,c])=>`${l} (${c})`)})).slice(0,6)},tn=({rows:e,config:t})=>{let{t:o}=ee(),r=o("graph.unassigned"),a=useMemo(()=>{let c=t?.fieldMapping;return {primaryDimension:_r(e,c?.primaryDimension,qr.primaryDimension,"Category"),secondaryDimension:_r(e,c?.secondaryDimension,qr.secondaryDimension,"Owner"),status:_r(e,c?.status,qr.status,"Status"),date:_r(e,c?.date,qr.date,"Date"),description:_r(e,c?.description,qr.description,"Description"),reportHours:_r(e,c?.reportHours,qr.reportHours,"ReportHours"),billableHours:_r(e,c?.billableHours,qr.billableHours,"BillableHours"),amount:_r(e,c?.amount,qr.amount,"Amount")}},[e,t?.fieldMapping]),n=useMemo(()=>e.map((c,g)=>{let h=Ro(c[a.reportHours]),m=Ro(c[a.billableHours]),b=Ro(c[a.amount]),C=h>0?m/h*100:0;return {id:`graph-row-${g}`,Date:Yt(c[a.date],""),Primary:Yt(c[a.primaryDimension],r),Secondary:Yt(c[a.secondaryDimension],r),Description:Yt(c[a.description],""),ReportHours:h,BillableHours:m,Amount:b,Efficiency:C,Status:Yt(c[a.status],r)}}),[e,a,r]),i=useMemo(()=>{let c=n.length,g=n.reduce((v,p)=>v+Ro(p.ReportHours),0),h=n.reduce((v,p)=>v+Ro(p.BillableHours),0),m=n.reduce((v,p)=>v+Ro(p.Amount),0),b=g>0?h/g*100:0,C=t?.statusFlagValues||["flag","flagged","warning","risk"],u=n.filter(v=>C.includes(Yt(v.Status,"").toLowerCase())).length;return {totalRecords:c,totalReportHours:g,totalBillableHours:h,efficiency:b,totalAmount:m,flaggedCount:u}},[n,t?.statusFlagValues]),s=t?.topN||my,d=useMemo(()=>({billableByPrimary:gy(n,"Primary","BillableHours",s,r),efficiencyBySecondary:fy(n,"Secondary","ReportHours","BillableHours",s,r),statusDistribution:hy(n,"Status",r),lineByDate:Gu(n,"Date","BillableHours"),comboByPrimary:by(n,"Primary","ReportHours","BillableHours",s,r),heatmapPrimarySecondary:yy(n,"Primary","Secondary","BillableHours",r),waterfallBillable:xy(n,"Date","BillableHours"),fishboneStatusCauses:vy(n,"Status","Primary","Secondary",3,r)}),[n,s,r]),l=useMemo(()=>({title:t?.title||o("graph.reportTitle"),kpis:i,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:n}}),[d,t?.title,a,i,n,o]);return {fieldMapping:a,model:l}};var on=e=>String(e??"").trim(),nl=(e={})=>{let[t,o]=useState(e),r=useCallback((d,l)=>{o(c=>{let g=l?.trim();if(!g){let h={...c};return delete h[d],h}if(c[d]===g){let h={...c};return delete h[d],h}return {...c,[d]:g}});},[]),a=useCallback(d=>{o(l=>{if(!l[d])return l;let c={...l};return delete c[d],c});},[]),n=useCallback(()=>{o({});},[]),i=useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),s=useCallback((d,l)=>d.filter(c=>!(t.primaryDimension&&on(c[l.primaryDimension])!==on(t.primaryDimension)||t.secondaryDimension&&on(c[l.secondaryDimension])!==on(t.secondaryDimension)||t.status&&on(c[l.status])!==on(t.status))),[t]);return {filters:t,setFilter:r,clearFilter:a,clearAll:n,hasActiveFilters:i,applyRows:s}};var ll=({variants:e,currentVariantId:t,onLoad:o,onSave:r,onDelete:a,onSetDefault:n})=>{let{t:i}=ee(),d=useTheme().palette.mode==="dark",l="0.85rem",c={xs:"calc((100% - 1 * 16px) / 2)",sm:"calc((100% - 2 * 16px) / 3)",md:"calc((100% - 3 * 16px) / 4)",lg:"calc((100% - 5 * 16px) / 6)"},[g,h]=useState(false),[m,b]=useState(""),[C,u]=useState(false),[v,p]=useState(false),f=e.find(E=>E.id===t),y=()=>{b(f?.name||i("variant.newVariant")),u(f?.isDefault||false),p(f?.isPublic||false),h(true);},k=()=>{r({name:m,isDefault:C,isPublic:v,description:""}),h(false);};return jsxs(Box,{sx:{display:"flex",gap:1,alignItems:"center",width:"100%",maxWidth:"100%"},children:[jsx(Autocomplete,{size:"small",sx:{width:c,"& .MuiInputBase-root":{fontSize:l,bgcolor:d?"rgba(25, 118, 210, 0.2)":"#e7f1ff","& .MuiOutlinedInput-notchedOutline":{borderColor:d?"rgba(144,202,249,0.45)":"rgba(25,118,210,0.45)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:d?"rgba(144,202,249,0.7)":"rgba(25,118,210,0.65)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:d?"rgba(144,202,249,0.9)":"rgba(25,118,210,0.85)"}},"& .MuiInputBase-input":{fontSize:l},"& .MuiAutocomplete-noOptions":{fontSize:l}},noOptionsText:jsx(Typography,{sx:{fontSize:l},children:i("variant.noOptions")}),options:e,getOptionLabel:E=>E.name+(E.isDefault?` (${i("variant.defaultSuffix")})`:""),value:f||null,onChange:(E,M)=>{M&&o(M);},renderInput:E=>jsx(TextField,{...E,variant:"outlined",size:"small",InputProps:{...E.InputProps,sx:{fontSize:l,color:d?"#E3F2FD":"#0D47A1"}},placeholder:i("variant.selectVariant")}),renderOption:(E,M)=>jsx("li",{...E,children:jsxs(Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsx(Typography,{sx:{flex:1,fontSize:l},children:M.name}),M.isDefault&&jsx(By,{fontSize:"small",color:"action"})]})})}),jsx(Tooltip,{title:i("variant.saveView"),children:jsx(IconButton,{onClick:y,size:"small",color:"primary",children:jsx(dp,{fontSize:"small"})})}),jsxs(Dialog,{open:g,onClose:()=>h(false),children:[jsx(DialogTitle,{children:i("variant.saveView")}),jsxs(DialogContent,{children:[jsx(TextField,{autoFocus:true,margin:"dense",label:i("variant.viewName"),fullWidth:true,variant:"outlined",value:m,onChange:E=>b(E.target.value)}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:C,onChange:E=>u(E.target.checked)}),label:i("variant.setDefault")}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:v,onChange:E=>p(E.target.checked)}),label:i("variant.publicAllUsers")})]}),jsxs(DialogActions,{children:[jsx(Button,{onClick:()=>h(false),children:i("common.cancel")}),jsx(Button,{onClick:k,variant:"contained",children:i("common.save")})]})]})]})};var Yu=({appId:e,tableKey:t="default",currentFilters:o,currentLayoutId:r,layoutRefs:a,onLoad:n,variantService:i,serviceUrl:s,onError:d,onSuccess:l,currentVariantId:c,onVariantChange:g})=>{let{t:h}=ee(),[m,b]=useState([]),[C,u]=useState(""),v=`orbcafe.variants.${e}.${t}`,p=c!==void 0?c:C,f=B=>{c===void 0&&u(B),g&&g(B);},y=useCallback(()=>{try{let B=localStorage.getItem(v);if(!B)return [];let R=JSON.parse(B);return Array.isArray(R)?R:[]}catch{return []}},[v]),k=useCallback(B=>{try{localStorage.setItem(v,JSON.stringify(B));}catch{}},[v]),E=useCallback(B=>{b(B);let R=B.find(I=>I.isDefault);R&&!p&&(f(R.id),n(R));},[p,n,f]),M=useCallback(async()=>{if(!e)return [];try{let B=[];if(i)B=await i.getVariants(e,t);else if(s){let R=await fetch(`${s}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!R.ok)throw new Error(h("variant.toast.fetchFailed"));B=await R.json();}else B=y();return E(B),B}catch(B){console.error("Error fetching variants",B);let R=y();return E(R),d&&d(h("variant.toast.fetchFailed")),R}},[e,t,i,s,y,E,d,h]);return useEffect(()=>{M();},[e,t]),jsx(ll,{variants:m,currentVariantId:p,onLoad:B=>{f(B.id),n(B);},onSave:async B=>{let R=Date.now().toString(),I;try{let A=B.scope||"Both",q=m.find(ne=>ne.name===B.name);R=q?q.id:Date.now().toString();let O=[];if(q&&(Array.isArray(q.filters)?O=[...q.filters]:q.filters&&(O=[{scope:"default",filters:q.filters}])),A==="Search"||A==="Both"){let ne=(Array.isArray(o),o);if(ne)if(Array.isArray(ne)&&ne.length>0&&ne[0].scope)ne.forEach(ie=>{let Y=O.findIndex(Ae=>Ae.scope===ie.scope);Y>=0?O[Y]=ie:O.push(ie);});else {let ie={scope:t,filters:ne},Y=O.findIndex(Ae=>Ae.scope===t);Y>=0?O[Y]=ie:O.push(ie);}}let K=q?.layout||{},Q=[];if(q&&Array.isArray(q.layoutRefs)&&(Q=[...q.layoutRefs]),A==="Layout"||A==="Both")if(a&&a.length>0)a.forEach(ne=>{let ie=Q.findIndex(Y=>Y.tableKey===ne.tableKey);ie>=0?Q[ie]=ne:Q.push(ne);});else {let ne={tableKey:t,layoutId:r||null},ie=Q.findIndex(Y=>Y.tableKey===t);ie>=0?Q[ie]=ne:Q.push(ne);}if(I={appId:e,tableKey:t,...B,scope:A,id:R,createdAt:new Date().toISOString(),filters:O,layout:K,layoutRefs:Q},i)await i.saveVariant(I,e,t);else if(s){if(!(await fetch(`${s}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(I)})).ok)throw new Error(h("variant.toast.saveFailed"))}else {let ie=m.some(Y=>Y.id===R)?m.map(Y=>Y.id===R?I:Y):[...m,I];b(ie),k(ie);}l&&l(h("variant.toast.saveSuccess")),(i||s)&&await M(),f(R),n(I);}catch(A){console.error("Error saving variant",A);let O=m.some(K=>K.id===R)?m.map(K=>K.id===R?I:K):[...m,I];b(O),k(O),f(R),n(I),d&&d(h("variant.toast.saveFailed"));}},onDelete:async B=>{try{if(i)await i.deleteVariant(B);else if(s){if(!(await fetch(`${s}/api/variants/${B}`,{method:"DELETE"})).ok)throw new Error(h("variant.toast.deleteFailed"))}else {let R=m.filter(I=>I.id!==B);b(R),k(R);}p===B&&f(""),(i||s)&&M(),l&&l(h("variant.toast.deleteSuccess"));}catch(R){console.error("Error deleting variant",R);let I=m.filter(A=>A.id!==B);b(I),k(I),p===B&&f(""),d&&d(h("variant.toast.deleteFailed"));}},onSetDefault:async B=>{try{let R=m.find(A=>A.id===B);if(!R)return;let I={appId:e,tableKey:t,...R,isDefault:!0};if(i)await i.setDefaultVariant(B,e,t);else if(s){if(!(await fetch(`${s}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(I)})).ok)throw new Error(h("variant.toast.defaultFailed"))}else {let A=m.map(q=>({...q,isDefault:q.id===B}));b(A),k(A);}(i||s)&&await M(),l&&l(h("variant.toast.defaultSuccess"));}catch(R){console.error("Error setting default variant",R);let I=m.map(A=>({...A,isDefault:A.id===B}));b(I),k(I),d&&d(h("variant.toast.defaultFailed"));}}})};mr.extend(Xy);mr.extend(Yy);var Qy=[null,null],lc="0.85rem",Jy={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},ex=styled(PickersDay,{shouldForwardProp:e=>e!=="isInRange"&&e!=="isStart"&&e!=="isEnd"&&e!=="isHovered"})(({theme:e,isInRange:t,isStart:o,isEnd:r,isHovered:a})=>({...t&&{borderRadius:0,backgroundColor:e.palette.primary.light,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.main}},...a&&!t&&!o&&!r&&{borderRadius:0,backgroundColor:e.palette.action.hover,border:`1px dashed ${e.palette.primary.main}`},...o&&{borderRadius:"50% 0 0 50%",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...r&&{borderRadius:"0 50% 50% 0",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...o&&r&&{borderRadius:"50%"}})),ep=({label:e,value:t=Qy,onChange:o})=>{let{t:r,locale:a}=ee(),n=Jy[a]||"en",i=e||r("dateRange.label"),[s,d]=useState(null),[l,c]=useState(t),[g,h]=useState("start"),[m,b]=useState(null),[C,u]=useState((t[0]||mr()).locale(n)),v=Dt__default.useRef(t);useEffect(()=>{let[R,I]=t,[A,q]=v.current,O=ne=>ne&&typeof ne.isSame=="function",K=!(R===null&&A===null||O(R)&&O(A)&&R.isSame(A,"day")),Q=!(I===null&&q===null||O(I)&&O(q)&&I.isSame(q,"day"));(K||Q)&&(c(t),t[0]&&O(t[0])&&u(t[0].locale(n))),v.current=t;},[t,n]);let p=R=>{d(R.currentTarget);},f=()=>{d(null),h("start"),b(null);},y=!!s,k=R=>{if(!R)return;let I=[...l];if(g==="start")I=[R,null],h("end");else {let A=I[0];A&&R.isBefore(A)?(I=[R,null],h("end")):(I=[A,R],h("start"));}c(I);},E=R=>{let I=mr().locale(n),A=[null,null];switch(R){case "today":A=[I,I];break;case "week":A=[I.startOf("week"),I.endOf("week")];break;case "month":A=[I.startOf("month"),I.endOf("month")];break}c(A),h("start"),u(I);},M=()=>{c([null,null]),h("start"),u(mr().locale(n));},S=()=>{o&&o(l),f();},D=()=>{c(t),h("start"),f();},P=useCallback(R=>{let{day:I,...A}=R,[q,O]=l,K=q?I.isSame(q,"day"):false,Q=O?I.isSame(O,"day"):false,ne=q&&O?I.isBetween(q,O,"day","()"):false,ie=false;return g==="end"&&q&&!O&&m&&I.isAfter(q,"day")&&I.isBefore(m.add(1,"day"),"day")&&(ie=true),jsx(ex,{...A,day:I,disableMargin:true,isStart:K,isEnd:Q,isInRange:ne||ie,onMouseEnter:()=>b(I)})},[l,g,m]),w=R=>R?R.locale(n).format("YYYY-MM-DD"):"",B=R=>R?R.locale(n).format("ll"):"";return jsxs(Box,{children:[jsx(TextField,{label:i,value:l[0]?`${w(l[0])} - ${w(l[1])}`:"",onClick:p,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:lc}},InputProps:{readOnly:true,sx:{fontSize:lc,"& .MuiOutlinedInput-input":{fontSize:lc},paddingRight:"4px"},endAdornment:jsxs(InputAdornment,{position:"end",sx:{ml:0},children:[(l[0]||l[1])&&jsx(IconButton,{size:"small",onClick:R=>{R.stopPropagation(),M();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsx(fh,{sx:{fontSize:"1rem"}})}),jsx(IconButton,{size:"small",edge:"end",onClick:p,sx:{padding:"2px"},children:jsx(_y,{sx:{fontSize:"1rem"},color:"action"})})]})}}),jsxs(Popover,{open:y,anchorEl:s,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{display:"flex",flexDirection:"column",p:0,minWidth:320}}},children:[jsx(Box,{sx:{p:2,bgcolor:"background.default",borderBottom:1,borderColor:"divider"},children:jsxs(Stack,{direction:"row",alignItems:"center",spacing:2,justifyContent:"space-between",children:[jsxs(Box,{sx:{p:1,border:1,borderColor:g==="start"?"primary.main":"divider",borderRadius:1,bgcolor:g==="start"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>h("start"),children:[jsx(Typography,{variant:"caption",color:"text.secondary",display:"block",children:r("dateRange.startDate")}),jsx(Typography,{variant:"body2",fontWeight:500,children:l[0]?B(l[0]):r("dateRange.select")})]}),jsx(Zy,{color:"action",fontSize:"small"}),jsxs(Box,{sx:{p:1,border:1,borderColor:g==="end"?"primary.main":"divider",borderRadius:1,bgcolor:g==="end"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>{l[0]&&h("end");},children:[jsx(Typography,{variant:"caption",color:"text.secondary",display:"block",children:r("dateRange.endDate")}),jsx(Typography,{variant:"body2",fontWeight:500,children:l[1]?B(l[1]):r("dateRange.select")})]})]})}),jsx(Box,{sx:{p:2,pb:0},children:jsxs(Stack,{direction:"row",spacing:1,justifyContent:"center",children:[jsx(Chip,{label:r("dateRange.today"),onClick:()=>E("today"),clickable:true,size:"small",variant:"outlined"}),jsx(Chip,{label:r("dateRange.thisWeek"),onClick:()=>E("week"),clickable:true,size:"small",variant:"outlined"}),jsx(Chip,{label:r("dateRange.thisMonth"),onClick:()=>E("month"),clickable:true,size:"small",variant:"outlined"})]})}),jsx(LocalizationProvider,{dateAdapter:AdapterDayjs,adapterLocale:n,children:jsx(DateCalendar,{value:null,referenceDate:C,onMonthChange:u,onYearChange:u,onChange:k,slots:{day:P},views:["day"],showDaysOutsideCurrentMonth:true,sx:{m:0}})}),jsx(Divider,{}),jsxs(Stack,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[jsx(Button,{size:"small",onClick:D,color:"inherit",children:r("common.cancel")}),jsx(Button,{size:"small",variant:"contained",onClick:S,children:r("common.done")})]})]})]})};var ul={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},ux={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"},px=["equals","contains","notContains","wildcard"],rp=["=","!=",">","<",">=","<=","between"],Ct="0.85rem",mx=({field:e,value:t,onChange:o})=>{let{t:r}=ee(),[a,n]=useState(null),[i,s]=useState(null),[d,l]=useState(""),[c,g]=useState(""),[h,m]=useState(false),[b,C]=useState(""),[u,v]=useState("");useEffect(()=>{let w=setTimeout(()=>{v(b);},1e3);return ()=>clearTimeout(w)},[b]);let p=t?.operator||(e.type==="number"?"=":"equals"),f=t?.value,y=w=>{let B=ux[w];return B?r(B):w},k=w=>{n(w.currentTarget);},E=w=>{o({...t,operator:w,value:f}),n(null);},M={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:Ct}},InputProps:{sx:{fontSize:Ct}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Ct,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},S=e.type||"text";if(S==="date"){let B=(R=>{if(!R)return [null,null];if(Array.isArray(R)&&R.length===2){let I=R[0]?mr.isDayjs(R[0])?R[0]:mr(R[0]):null,A=R[1]?mr.isDayjs(R[1])?R[1]:mr(R[1]):null;return [I,A]}return mr.isDayjs(R)||typeof R=="string"?[mr.isDayjs(R)?R:mr(R),null]:[null,null]})(f);return jsx(ep,{label:e.label,value:B,onChange:R=>o({value:R,operator:"between"})})}if(S==="number"&&p==="between"){let w=()=>{o({value:[d,c],operator:"between"}),s(null);},B=Array.isArray(f)?`${f[0]||""} - ${f[1]||""}`:"";return jsxs(Fragment,{children:[jsx(TextField,{...M,label:e.label,value:B,placeholder:r("smartFilter.minMaxPlaceholder"),InputProps:{...M.InputProps,startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Tooltip,{title:y("between"),children:jsx(IconButton,{size:"small",onClick:k,sx:{width:24,height:24,fontSize:Ct},children:ul.between})})}),readOnly:true},onClick:R=>s(R.currentTarget)}),jsx(Menu,{anchorEl:a,open:!!a,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Ct,minHeight:"auto",py:.5}}},children:rp.map(R=>jsxs(MenuItem,{selected:R===p,onClick:()=>E(R),children:[jsx(Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:ul[R]}),jsx(ListItemText,{primary:y(R),primaryTypographyProps:{fontSize:Ct}})]},R))}),jsx(Popover,{open:!!i,anchorEl:i,onClose:()=>s(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:jsxs(Box,{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[jsx(TextField,{size:"small",label:r("smartFilter.min"),type:"number",value:d,onChange:R=>l(R.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Ct}},InputProps:{sx:{fontSize:Ct}}}),jsx(dx,{color:"action"}),jsx(TextField,{size:"small",label:r("smartFilter.max"),type:"number",value:c,onChange:R=>g(R.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Ct}},InputProps:{sx:{fontSize:Ct}}}),jsx(Button,{variant:"contained",size:"small",onClick:w,children:r("common.ok")})]})})]})}if(e.isValueHelp||S==="value-help"){let w=e.valueHelp?.mode||"single";return jsx(eu,{...M,...e.valueHelp,label:e.label,placeholder:e.placeholder||e.valueHelp?.placeholder,value:f??(w==="multiple"?[]:null),mode:w,onChange:B=>o({value:B,operator:w==="multiple"?"anyOf":"equals"})})}if(S==="select")return jsxs(TextField,{...M,select:true,label:e.label,value:f||"",onChange:w=>o({...t,value:w.target.value,operator:"equals"}),children:[jsx(MenuItem,{value:"",children:jsx("em",{children:r("common.none")})}),e.options?.map(w=>jsx(MenuItem,{value:w.value,children:w.label},w.value))]});if(S==="multi-select"){let w=Array.isArray(f)?f:[],B=e.options?.filter(R=>R.label.toLowerCase().includes(u.toLowerCase()))||[];return jsxs(TextField,{...M,select:true,label:e.label,value:w,onChange:R=>o({...t,value:R.target.value,operator:"anyOf"}),SelectProps:{...M.SelectProps,multiple:true,onClose:()=>{C(""),v("");},renderValue:R=>{if(!Array.isArray(R)||R.length===0)return jsx("em",{children:r("common.none")});let I=q=>e.options?.find(O=>O.value===q)?.label||q,A=R.map(I);return A.length>2?`${A.slice(0,2).join(", ")} +${A.length-2}`:A.join(", ")}},children:[jsx(ListSubheader,{children:jsx(TextField,{size:"small",autoFocus:true,placeholder:r("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Xd,{fontSize:"small"})}),sx:{fontSize:Ct}},value:b,onChange:R=>C(R.target.value),onKeyDown:R=>{R.key!=="Escape"&&R.stopPropagation();},onClick:R=>R.stopPropagation()})}),B.length>0?B.map(R=>jsxs(MenuItem,{value:R.value,children:[jsx(Checkbox,{checked:w.indexOf(R.value)>-1,size:"small"}),jsx(ListItemText,{primary:R.label,primaryTypographyProps:{fontSize:Ct}})]},R.value)):jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:r("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:Ct}})})]})}let D=S==="number"?rp:px,P=h||f!==void 0&&f!==""&&f!==null||!!a;return jsxs(Fragment,{children:[jsx(TextField,{...M,label:e.label,sx:{minWidth:"120px"},value:f||"",type:S==="number"?"number":"text",onChange:w=>o({...t,value:w.target.value,operator:p}),onFocus:()=>m(true),onBlur:()=>m(false),InputProps:{...M.InputProps,startAdornment:P?jsx(InputAdornment,{position:"start",children:jsx(Tooltip,{title:y(p),children:jsx(IconButton,{size:"small",onClick:k,onMouseDown:w=>w.preventDefault(),sx:{width:24,height:24,fontSize:Ct,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:ul[p]})})}):null,endAdornment:e.hasSearchIcon?jsx(InputAdornment,{position:"end",children:jsx(Xd,{color:"action"})}):void 0}}),jsx(Menu,{anchorEl:a,open:!!a,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Ct,minHeight:"auto",py:.5}}},children:D.map(w=>jsxs(MenuItem,{selected:w===p,onClick:()=>E(w),children:[jsx(Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:ul[w]}),jsx(ListItemText,{primary:y(w),primaryTypographyProps:{fontSize:Ct}})]},w))})]})},vr=({fields:e,filters:t,onFilterChange:o,variants:r=[],currentVariantId:a,onVariantLoad:n,onVariantSave:i,onVariantDelete:s,onVariantSetDefault:d,onSearch:l,loading:c=false,appId:g,tableKey:h,currentLayout:m,currentLayoutId:b,layoutRefs:C,variantService:u,serviceUrl:v})=>{let{t:p}=ee(),[f,y]=useState(true),[k,E]=useState(null),[M,S]=useState(e.filter(B=>!B.hidden).map(B=>B.id)),D=(B,R)=>{o({...t,[B]:R});},P=B=>{M.includes(B)?S(M.filter(R=>R!==B)):S([...M,B]);};return jsxs(Paper,{sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[jsxs(Box,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[g?jsx(Yu,{appId:g,tableKey:h,currentFilters:{values:t,visibleFields:M},currentLayout:m,currentLayoutId:b,layoutRefs:C,onLoad:B=>{if(!B.filters)return;let R=null;if(Array.isArray(B.filters)){let I=h||"default",A=B.filters.find(q=>q.scope===I);R=A?A.filters:null;}else R=B.filters;R&&(R.values||R.visibleFields?(R.visibleFields&&Array.isArray(R.visibleFields)&&S(R.visibleFields),R.values&&o(R.values)):o(R)),n&&n(B);},variantService:u,serviceUrl:v,currentVariantId:a}):jsx(ll,{variants:r,currentVariantId:a,onLoad:n,onSave:B=>{i&&i({...B,filters:{values:t,visibleFields:M}});},onDelete:s,onSetDefault:d}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(Tooltip,{title:p("smartFilter.addFilters"),children:jsx(Button,{onClick:B=>E(B.currentTarget),size:"small",color:"primary",startIcon:jsx(lx,{fontSize:"small"}),sx:{textTransform:"none",fontSize:Ct,whiteSpace:"nowrap",minWidth:"fit-content"},children:p("smartFilter.adaptFilters")})}),jsx(Button,{variant:"contained",size:"small",onClick:l,disabled:c,sx:{minWidth:"52px",fontWeight:"bold",fontSize:Ct},children:p(c?"common.loading":"smartFilter.go")}),jsxs(Menu,{anchorEl:k,open:!!k,onClose:()=>E(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:Ct,minHeight:32}}}},children:[jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:p("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:Ct}})}),jsx(Divider,{}),e.map(B=>jsxs(MenuItem,{onClick:()=>P(B.id),children:[jsx(Checkbox,{checked:M.includes(B.id),size:"small"}),jsx(ListItemText,{primary:B.label,primaryTypographyProps:{fontSize:Ct}})]},B.id))]})]})]}),jsx(Collapse,{in:f,children:jsx(Box,{sx:{px:2,pb:2},children:jsx(Grid,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:e.filter(B=>M.includes(B.id)).map(B=>jsx(Grid,{size:1,children:jsx(mx,{field:B,value:t[B.id]||{value:"",operator:B.type==="number"?"=":"equals"},onChange:R=>D(B.id,R)})},B.id))})})}),jsx(Box,{sx:{position:"absolute",bottom:0,left:"50%",transform:"translate(-50%, 50%)",zIndex:10},children:jsx(IconButton,{size:"small",onClick:()=>y(!f),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:20,height:20,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:f?jsx(sx,{sx:{fontSize:16},color:"action"}):jsx(sb,{sx:{fontSize:16},color:"action"})})})]})};var up=({layouts:e,currentLayoutId:t,onLoad:o,onSave:r,onDelete:a,onSetDefault:n})=>{let{t:i}=ee(),[s,d]=useState(null),[l,c]=useState(false),[g,h]=useState(""),[m,b]=useState(""),[C,u]=useState({isDefault:false,isPublic:false}),v=e.find(M=>M.id===t),p=M=>{d(M.currentTarget);},f=()=>{d(null);},y=M=>{o(M),f();},k=()=>{h(""),b(""),u({isDefault:false,isPublic:false}),c(true),f();},E=()=>{g.trim()&&(r({name:g,description:m,...C}),c(false));};return jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(Tooltip,{title:i("layout.saveLayout"),children:jsx(IconButton,{onClick:k,color:"primary",size:"small",children:jsx(dp,{})})}),jsx(Tooltip,{title:i("layout.layoutOptions"),children:jsx(IconButton,{onClick:p,color:v?"primary":"default",children:jsx(Tx,{})})}),jsxs(Menu,{anchorEl:s,open:!!s,onClose:f,PaperProps:{sx:{width:320,maxHeight:400}},children:[jsx(MenuItem,{disabled:true,children:jsx(Typography,{variant:"caption",children:i("layout.selectLayout")})}),jsxs(MenuItem,{onClick:k,children:[jsx(ListItemIcon,{children:jsx(dp,{fontSize:"small"})}),jsx(ListItemText,{children:i("layout.saveCurrentLayout")})]}),jsx(Divider,{}),e.length===0&&jsx(MenuItem,{disabled:true,children:jsx(Typography,{variant:"body2",color:"text.secondary",children:i("layout.noSavedLayouts")})}),e.map((M,S)=>jsx(MenuItem,{onClick:()=>y(M),selected:M.id===t,children:jsxs(Box,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[jsxs(Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[jsx(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsx(Typography,{variant:"body2",fontWeight:M.id===t?"bold":"normal",noWrap:true,children:M.name})}),M.description&&jsx(Typography,{variant:"caption",color:"text.secondary",noWrap:true,children:M.description})]}),jsxs(Box,{sx:{display:"flex",alignItems:"center"},onClick:D=>D.stopPropagation(),children:[jsx(Tooltip,{title:M.isDefault?i("layout.removeDefault"):i("layout.setAsDefault"),children:jsx(IconButton,{size:"small",onClick:D=>{D.stopPropagation(),n(M.id);},children:M.isDefault?jsx(By,{fontSize:"small",color:"warning"}):jsx(wx,{fontSize:"small"})})}),jsx(Tooltip,{title:i("common.delete"),children:jsx(IconButton,{size:"small",color:"error",onClick:D=>{D.stopPropagation(),a(M.id);},children:jsx(Oh,{fontSize:"small"})})})]})]})},M.id||S))]}),jsxs(Dialog,{open:l,onClose:()=>c(false),maxWidth:"xs",fullWidth:true,children:[jsx(DialogTitle,{children:i("layout.saveLayout")}),jsx(DialogContent,{children:jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[jsx(TextField,{label:i("layout.layoutName"),value:g,onChange:M=>h(M.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:i("layout.layoutNameHelper")}),e.some(M=>M.name===g)&&jsx(Typography,{variant:"caption",color:"warning.main",sx:{ml:1},children:i("layout.warningOverwrite")}),jsx(TextField,{label:i("layout.layoutDescription"),value:m,onChange:M=>b(M.target.value),fullWidth:true,size:"small"}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:C.isDefault,onChange:M=>u({...C,isDefault:M.target.checked})}),label:i("layout.useAsDefault")}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:C.isPublic,onChange:M=>u({...C,isPublic:M.target.checked})}),label:i("layout.publicAllUsers")})]})}),jsxs(DialogActions,{children:[jsx(Button,{onClick:()=>c(false),children:i("common.cancel")}),jsx(Button,{onClick:E,variant:"contained",disabled:!g,children:i("common.save")})]})]})]})};var fl=({appId:e,tableKey:t="default",currentLayoutData:o,onLayoutLoad:r,targetLayoutId:a,activeLayoutId:n,serviceUrl:i,onError:s,onSuccess:d})=>{let{t:l}=ee(),[c,g]=useState([]),[h,m]=useState(""),b=`orbcafe.layouts.${e}.${t}`,C=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??{}}),u=S=>({appId:e,tableKey:t,layoutId:S.id,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt,layout:S.layoutData}),v=useCallback(()=>{try{let S=localStorage.getItem(b);if(!S)return [];let D=JSON.parse(S);return Array.isArray(D)?D:[]}catch{return []}},[b]),p=useCallback(S=>{try{localStorage.setItem(b,JSON.stringify(S));}catch{}},[b]);useEffect(()=>{n!==void 0&&m(n);},[n]),useEffect(()=>{if(a&&c.length>0){let S=c.find(D=>D.id===a);S&&(m(S.id),r(S));}},[a,c,r]);let f=useCallback(async()=>{if(e){if(!i){let S=v();g(S);let D=S.find(P=>P.isDefault);D&&!h&&!a&&(m(D.id),r(D));return}try{let S=await fetch(`${i}/api/layouts?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!S.ok)throw new Error("LAYOUT_FETCH_FAILED");let P=(await S.json()).map(C);g(P);let w=P.find(B=>B.isDefault);w&&!h&&!a&&(m(w.id),r(w));}catch(S){console.error("Error fetching layouts",S);let D=v();g(D);let P=D.find(w=>w.isDefault);P&&!h&&!a&&(m(P.id),r(P)),s&&s(l("layout.toast.loadFallback"));}}},[e,t,i,s,h,r,a,v,l]);return useEffect(()=>{f();},[e,t]),jsx(up,{layouts:c,currentLayoutId:h,onLoad:S=>{m(S.id),r(S);},onSave:async S=>{let D=c.find(B=>B.name===S.name),P=D?D.id:Date.now().toString(),w={id:P,...S,createdAt:new Date().toISOString(),layoutData:o,isDefault:S.isDefault??false,isPublic:S.isPublic??false};if(!i){let R=c.some(I=>I.id===P)?c.map(I=>I.id===P?w:I):[...c,w];g(R),p(R),m(P),r(w),d&&d(l("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u(w))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(l("layout.toast.saveSuccess")),await f(),m(P),r(w);}catch(B){console.error("Error saving layout",B);let I=c.some(A=>A.id===P)?c.map(A=>A.id===P?w:A):[...c,w];g(I),p(I),m(P),r(w),d&&d(l("layout.toast.saveLocalSuccess")),s&&s(l("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async S=>{if(!i){let D=c.filter(P=>P.id!==S);g(D),p(D),h===S&&m(""),d&&d(l("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts/${encodeURIComponent(S)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");h===S&&m(""),d&&d(l("layout.toast.deleteSuccess")),await f();}catch(D){console.error("Error deleting layout",D);let P=c.filter(w=>w.id!==S);g(P),p(P),h===S&&m(""),d&&d(l("layout.toast.deleteLocalSuccess")),s&&s(l("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async S=>{if(!i){let D=c.map(P=>({...P,isDefault:P.id===S}));g(D),p(D),d&&d(l("layout.toast.defaultLocalSuccess"));return}try{let D=c.find(w=>w.id===S);if(!D)return;if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u({...D,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(l("layout.toast.defaultSuccess")),await f();}catch(D){console.error("Error setting default",D);let P=c.map(w=>({...w,isDefault:w.id===S}));g(P),p(P),d&&d(l("layout.toast.defaultLocalSuccess")),s&&s(l("layout.toast.backendUnavailableDefaultLocal"));}}})};var mp=(e,t)=>{if(!e||!e.filters)return null;if(Array.isArray(e.filters)){let o=e.filters.find(a=>a.scope===t);if(o)return o.filters;let r=e.filters.find(a=>a.scope==="default");return r?r.filters:null}return typeof e.filters=="object"?e.filters:null},hl=(e,t)=>{if(!e)return {layout:null,layoutId:null};let o=null,r=null;if(Array.isArray(e.layoutRefs)){let a=e.layoutRefs.find(n=>n.tableKey===t);a&&(o=a.layoutId);}return !o&&e.layoutId&&(o=e.layoutId),e.layout&&typeof e.layout=="object"&&!Array.isArray(e.layout)&&(r=e.layout),{layoutId:o,layout:r}};function gp(e,t,o){return t[o]<e[o]?-1:t[o]>e[o]?1:0}function Px(e,t){return e==="desc"?(o,r)=>gp(o,r,t):(o,r)=>-gp(o,r,t)}function Rx(e,t){let o=e.map((r,a)=>[r,a]);return o.sort((r,a)=>{let n=t(r[0],a[0]);return n!==0?n:r[1]-a[1]}),o.map(r=>r[0])}var nn=e=>{let t=useCallback(z=>{let H=String(z?.label??z?.id??"").length*9+64,ae=typeof z?.minWidth=="number"?z.minWidth:0;return Math.max(100,ae,H)},[]),o=useCallback(()=>(e.columns||[]).filter(z=>!!z?.numeric).map(z=>z.id),[e.columns]),[r,a]=useState(""),[n,i]=useState(e.order||"asc"),[s,d]=useState(e.orderBy||""),[l,c]=useState([]),[g,h]=useState(e.page||0),[m,b]=useState(e.rowsPerPage||20),[C,u]=useState(e.selected||[]),[v,p]=useState(e.columns?e.columns.map(z=>z.id):[]),[f,y]=useState(e.columns?e.columns.map(z=>z.id):[]),[k,E]=useState(e.showSummary||false),[M,S]=useState(()=>o()),[D,P]=useState([]),[w,B]=useState(new Set),[R,I]=useState(()=>{let z={};return (e.columns||[]).forEach(V=>{z[V.id]=t(V);}),z}),[A,q]=useState(null),[O,K]=useState(null),[Q,ne]=useState(null),[ie,Y]=useState(null),[Ae,Ze]=useState(false),[ht,fe]=useState(""),[We,Ee]=useState("");useEffect(()=>{e.layout&&fo(e.layout);},[e.layout]),useEffect(()=>{e.order!==void 0&&i(e.order),e.orderBy!==void 0&&d(e.orderBy);},[e.order,e.orderBy]),useEffect(()=>{e.selected!==void 0&&u(e.selected);},[e.selected]),useEffect(()=>{e.page!==void 0&&h(e.page);},[e.page]),useEffect(()=>{e.rowsPerPage!==void 0&&b(e.rowsPerPage);},[e.rowsPerPage]),useEffect(()=>{let z=o();S(V=>V.filter(ae=>z.includes(ae)));},[o]),useEffect(()=>{I(z=>{let V={...z};return (e.columns||[]).forEach(H=>{V[H.id]===void 0&&(V[H.id]=t(H));}),V});},[e.columns,t]),useEffect(()=>{y(z=>{let V=(e.columns||[]).map(N=>N.id),H=new Set(V),ae=z.filter(N=>H.has(N)),se=new Set(ae),ke=V.filter(N=>!se.has(N)),T=[...ae,...ke];return T.length===z.length&&T.every((N,U)=>N===z[U])?z:T});},[e.columns]);let Tt=useMemo(()=>{let z=e.columns||[];if(f.length===0)return z;let V=new Map(z.map(se=>[se.id,se])),H=[],ae=new Set;return f.forEach(se=>{let ke=V.get(se);ke&&(H.push(ke),ae.add(se));}),z.forEach(se=>{ae.has(se.id)||H.push(se);}),H},[e.columns,f]),_e=useMemo(()=>{let z=e.rows||[];return r&&(z=z.filter(V=>Object.keys(V).some(H=>String(V[H]).toLowerCase().includes(r.toLowerCase())))),z},[e.rows,r]),ze=useMemo(()=>{if(e.onSortChange)return _e;if(l.length>0){let z=[..._e];return z.sort((V,H)=>{for(let ae of l){let se=V?.[ae.field],ke=H?.[ae.field];if(!(se==null&&ke==null)){if(se==null)return ae.direction==="asc"?-1:1;if(ke==null)return ae.direction==="asc"?1:-1;if(se<ke)return ae.direction==="asc"?-1:1;if(se>ke)return ae.direction==="asc"?1:-1}}return 0}),z}return s?Rx(_e,Px(n,s)):_e},[_e,n,s,l,e.onSortChange]),Ue=useCallback(z=>{if(D.length===0)return z.map(ke=>({type:"row",data:ke,id:ke[e.rowKey||"id"]}));let V=[...z].sort((ke,T)=>{for(let N of D){if(ke[N]<T[N])return -1;if(ke[N]>T[N])return 1}return 0}),H=(ke,T=0)=>{if(T>=D.length)return ke;let N=D[T],U={},J=[];return ke.forEach(ue=>{let he=ue[N],ye=`${N}:${he}`;U[ye]||(U[ye]={key:ye,field:N,value:he,children:[],count:0,level:T},J.push(U[ye])),U[ye].children.push(ue),U[ye].count++;}),J.forEach(ue=>{ue.children&&(ue.children=H(ue.children,T+1));}),J},ae=H(V),se=(ke,T="")=>{let N=[];return ke.forEach(U=>{if(U.children){let J=T?`${T}>${U.key}`:U.key,ue=w.has(J);N.push({type:"group",id:J,field:U.field,value:U.value,level:U.level,count:U.count,isExpanded:ue,childIds:(function he(ye){let me=[];return ye.children.forEach(Be=>{Be.children?me=me.concat(he(Be)):me.push(Be[e.rowKey||"id"]);}),me})(U)}),ue&&(N=N.concat(se(U.children,J)));}else N.push({type:"row",data:U,id:U[e.rowKey||"id"],level:D.length});}),N};return se(ae)},[D,w,e.rowKey]),tt=useCallback(z=>{if(D.length===0)return [];let V=[...z].sort((se,ke)=>{for(let T of D){if(se[T]<ke[T])return -1;if(se[T]>ke[T])return 1}return 0}),H=[],ae=(se,ke,T)=>{if(ke>=D.length)return;let N=D[ke],U=new Map;se.forEach(J=>{let ue=J[N],he=U.get(ue);he?he.push(J):U.set(ue,[J]);}),U.forEach((J,ue)=>{let he=`${N}:${ue}`,ye=T?`${T}>${he}`:he;H.push(ye),ae(J,ke+1,ye);});};return ae(V,0,""),H},[D]),_=useMemo(()=>Ue(ze),[ze,Ue]),le=useMemo(()=>tt(ze),[ze,tt]),Re=useMemo(()=>{let z=(e.rows||[]).length;return typeof e.count=="number"&&e.count>z},[e.count,e.rows]),Ne=useMemo(()=>Re?_:m>0?_.slice(g*m,g*m+m):_,[_,g,m,Re]),G=useMemo(()=>Re&&typeof e.count=="number"?e.count:_.length,[_.length,Re,e.count]),j=z=>{B(V=>{let H=new Set(V);return H.has(z)?H.delete(z):H.add(z),H});},Te=z=>{let V=le.filter(H=>H===z||H.startsWith(`${z}>`));B(H=>{let ae=new Set(H);return V.forEach(se=>ae.add(se)),ae});},Ce=z=>{B(V=>{let H=new Set(V);return Array.from(H).forEach(ae=>{(ae===z||ae.startsWith(`${z}>`))&&H.delete(ae);}),H});},De=z=>{if(!z){B(new Set);return}B(new Set(le));},ot=z=>{let V=le.filter(H=>H.startsWith(`${z}>`));return V.length===0?w.has(z):w.has(z)&&V.every(H=>w.has(H))},je=z=>{l.length>0&&c([]);let V=s===z&&n==="asc",H=s===z&&n==="desc";if(e.onSortChange){V?e.onSortChange(z,"desc"):H?e.onSortChange("","asc"):e.onSortChange(z,"asc");return}V?(i("desc"),d(z)):H?(i("asc"),d("")):(i("asc"),d(z));},eo=z=>{let V=z.filter(H=>H&&H.field);c(V),V.length>0&&d("");},Zt=()=>{c([]);},It=(z,V)=>{I(H=>({...H,[z]:V}));},po=z=>{if(z.target.checked){let V=_e.map(H=>H[e.rowKey||"id"]);u(V),e.onSelectionChange&&e.onSelectionChange(V);return}u([]),e.onSelectionChange&&e.onSelectionChange([]);},Et=(z,V)=>{let H=V[e.rowKey||"id"],ae=C.indexOf(H),se=[];ae===-1?se=se.concat(C,H):ae===0?se=se.concat(C.slice(1)):ae===C.length-1?se=se.concat(C.slice(0,-1)):ae>0&&(se=se.concat(C.slice(0,ae),C.slice(ae+1))),u(se),e.onSelectionChange&&e.onSelectionChange(se);},Fe=z=>{h(z),e.onPageChange&&e.onPageChange(z);},Se=z=>{b(z),h(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(z);},bt=z=>{let V=v.indexOf(z),H=[...v];V===-1?H.push(z):H.splice(V,1),p(H);},Ke=z=>{let V=D.indexOf(z),H=[...D];V===-1?H.push(z):H.splice(V,1),P(H);},Ft=z=>{o().includes(z)&&S(H=>H.includes(z)?H.filter(ae=>ae!==z):[...H,z]);},mo=(z,V)=>{!z||!V||z===V||y(H=>{let ae=H.indexOf(z),se=H.indexOf(V);if(ae===-1||se===-1)return H;let ke=[...H];return ke.splice(ae,1),ke.splice(se,0,z),ke});},go=z=>{let V=z?.active?.id,H=z?.over?.id;typeof V=="string"&&typeof H=="string"&&mo(V,H);},Xt=z=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:v,columnOrder:f,order:n,orderBy:s,sortBy:l,grouping:D,columnWidths:R,showSummary:k,summaryColumns:M});},yt=z=>{let{layout:V,layoutId:H}=hl(z,e.tableKey||"default");H?(Ee(H),fe(H)):(Ee(""),fe("")),V&&(V.visibleColumns&&p(V.visibleColumns),Array.isArray(V.columnOrder)&&y(V.columnOrder),V.order&&i(V.order),V.orderBy&&d(V.orderBy),Array.isArray(V.sortBy)&&c(V.sortBy),V.grouping&&P(V.grouping),V.columnWidths&&I(V.columnWidths),V.showSummary!==void 0&&E(!!V.showSummary),Array.isArray(V.summaryColumns)&&S(V.summaryColumns));},fo=z=>{let V=z?.layoutData||z?.layout||z||{};V.visibleColumns&&p(V.visibleColumns),Array.isArray(V.columnOrder)&&y(V.columnOrder),V.order&&i(V.order),V.orderBy!==void 0&&d(V.orderBy),Array.isArray(V.sortBy)&&c(V.sortBy),V.grouping&&P(V.grouping),V.columnWidths&&I(V.columnWidths),V.showSummary!==void 0&&E(!!V.showSummary),Array.isArray(V.summaryColumns)&&S(V.summaryColumns),B(new Set),h(0),z?.id&&fe(z.id),Ee("");};useEffect(()=>{e.layout&&yt({layout:e.layout});},[e.layout]);let ho=z=>{z.preventDefault(),Y(ie===null?{mouseX:z.clientX+2,mouseY:z.clientY-6}:null);},bo=()=>{Y(null);},Uo=useMemo(()=>{if(!k)return {};let z={};e.columns.forEach(H=>{if(H.numeric&&M.includes(H.id)){let ae=_e.reduce((se,ke)=>{let T=parseFloat(ke[H.id]);return se+(isNaN(T)?0:T)},0);z[H.id]=ae.toFixed(2);}else z[H.id]="";});let V=e.columns.find(H=>v.includes(H.id));return V&&!V.numeric&&(z[V.id]="Total"),z},[_e,e.columns,k,M,v]),ut=()=>{if(!e.columns||!_e)return;let z=e.columns.map(ke=>ke.label).join(","),V=_e.map(ke=>e.columns.map(T=>{let N=ke[T.id];return `"${(N==null?"":String(N)).replace(/"/g,'""')}"`}).join(",")).join(`
2
+ `),H=`data:text/csv;charset=utf-8,${z}
3
+ ${V}`,ae=encodeURI(H),se=document.createElement("a");se.setAttribute("href",ae),se.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(se),se.click(),document.body.removeChild(se);},to=()=>{Ze(true);},xt=()=>{Ze(false);};return {isMobile:false,columns:Tt,order:n,setOrder:i,orderBy:s,setOrderBy:d,sortBy:l,setSortBy:c,applyMultiSort:eo,clearMultiSort:Zt,columnOrder:f,setColumnOrder:y,filterText:r,setFilterText:a,visibleColumns:v,setVisibleColumns:p,showSummary:k,setShowSummary:E,summaryColumns:M,grouping:D,setGrouping:P,expandedGroups:w,setExpandedGroups:B,groupAnchorEl:O,setGroupAnchorEl:K,summaryAnchorEl:Q,setSummaryAnchorEl:ne,columnWidths:R,setColumnWidths:I,anchorEl:A,setAnchorEl:q,contextMenu:ie,setContextMenu:Y,sensors:void 0,sortedAndFilteredRows:ze,visibleRows:Ne,summaryRow:Uo,page:g,setPage:Fe,rowsPerPage:m,setRowsPerPage:Se,totalDisplayCount:G,selected:C,setSelected:u,isAllExpanded:le.length>0&&le.every(z=>w.has(z)),handleColumnResize:It,handleRequestSort:je,handleSelectAllClick:po,handleClick:Et,toggleSummaryColumn:Ft,handleDragEnd:go,handleColumnReorder:mo,handleExport:ut,handleContextMenu:ho,handleCloseContextMenu:bo,toggleColumnVisibility:bt,toggleGroupExpand:j,toggleGroupField:Ke,handleToggleAll:De,handleExpandGroupRecursively:Te,handleCollapseGroupRecursively:Ce,isGroupFullyExpanded:ot,handleLayoutLoad:fo,handleVariantLoad:yt,handleLayoutSave:Xt,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:v,order:n,orderBy:s,sortBy:l,columnOrder:f,grouping:D,columnWidths:R,showSummary:k,summaryColumns:M},currentLayoutId:ht,layoutIdToLoad:We,onPageChange:Fe,onRowsPerPageChange:Se,graphReportOpen:Ae,handleOpenGraphReport:to,handleCloseGraphReport:xt}};var CA=e=>jsx(Ax,{...e}),kA=e=>jsx($s,{...e}),SA=e=>jsx(Cp,{...e}),wA=e=>jsx(Kh,{...e}),TA=e=>jsx(qh,{...e}),Xr=e=>{let{t}=ee(),o="0.85rem",{title:r,showToolbar:a=true,selectionMode:n,selected:i=[],onSelectionChange:s,actions:d,extraTools:l,fitContainer:c=false,fullWidth:g=false,maxHeight:h,loading:m=false,rowsPerPageOptions:b=[20,50,100,-1],onLayoutSave:C,filterConfig:u,rowKey:v,tableKey:p="default",graphReport:f,quickCreate:y,quickEdit:k,quickDelete:E,serviceUrl:M}=e,S=r||t("table.title.default"),{isMobile:D,columns:P,order:w,orderBy:B,filterText:R,setFilterText:I,visibleColumns:A,showSummary:q,setShowSummary:O,summaryColumns:K,grouping:Q,setGrouping:ne,expandedGroups:ie,groupAnchorEl:Y,setGroupAnchorEl:Ae,summaryAnchorEl:Ze,setSummaryAnchorEl:ht,columnWidths:fe,anchorEl:We,setAnchorEl:Ee,contextMenu:Tt,sensors:_e,sortedAndFilteredRows:ze,summaryRow:Ue,visibleRows:tt,isAllExpanded:_,page:le,setPage:Re,rowsPerPage:Ne,setRowsPerPage:G,totalDisplayCount:j,setSelected:Te,handleColumnResize:Ce,handleRequestSort:De,handleSelectAllClick:ot,handleClick:je,toggleSummaryColumn:eo,handleDragEnd:Zt,handleExport:It,handleContextMenu:po,handleCloseContextMenu:Et,toggleColumnVisibility:Fe,toggleGroupExpand:Se,toggleGroupField:bt,handleToggleAll:Ke,handleExpandGroupRecursively:Ft,handleCollapseGroupRecursively:mo,isGroupFullyExpanded:go,handleLayoutLoad:Xt,handleVariantLoad:yt,handleLayoutSave:fo,effectiveAppId:ho,currentLayoutData:bo,currentLayoutId:Uo,layoutIdToLoad:ut,graphReportOpen:to,handleOpenGraphReport:xt,handleCloseGraphReport:z}=nn(e),V=f?.enabled??false,H=V&&(f?.interaction?.enabled??true),ae=nl(),se=!!y?.enabled,ke=!!k?.enabled,T=!!E?.enabled,N=y?.fields,U=y?.excludeFields||[],J=y?.initialValues||{},[ue,he]=Dt__default.useState(false),[ye,me]=Dt__default.useState(false),[Be,Ve]=Dt__default.useState({}),[it,Ge]=Dt__default.useState(false),[Le,Lt]=Dt__default.useState(false),[Ot,pt]=Dt__default.useState({}),[oo,mt]=Dt__default.useState(false),[ro,Ko]=Dt__default.useState(false),ao=m||ye||Le||ro,gr=Dt__default.useMemo(()=>{let W=[...P];if(Array.isArray(N)&&N.length>0){let re=new Set(N);W=W.filter(oe=>re.has(oe.id));}if(U.length>0){let re=new Set(U);W=W.filter(oe=>!re.has(oe.id));}return W.filter(re=>!!re?.id)},[P,U,N]),Vr=v||"id",no=Dt__default.useMemo(()=>{let W=new Set(i);return ze.filter(re=>W.has(re?.[Vr]))},[i,ze,Vr]),qo=no.length===1?no[0]:null,fr=k?.fields,zo=k?.excludeFields||[],ar=k?.editableFields||[],sa=k?.nonEditableFields||[],Na=k?.primaryKeys?.length?k.primaryKeys:[Vr],Or=Dt__default.useMemo(()=>{let W=[...P];if(Array.isArray(fr)&&fr.length>0){let re=new Set(fr);W=W.filter(oe=>re.has(oe.id));}if(zo.length>0){let re=new Set(zo);W=W.filter(oe=>!re.has(oe.id));}return W.filter(re=>!!re?.id)},[P,zo,fr]),ca=Dt__default.useMemo(()=>new Set(Na),[Na]),hr=Dt__default.useMemo(()=>new Set(ar),[ar]),yo=Dt__default.useMemo(()=>new Set(sa),[sa]),_o=Dt__default.useCallback(W=>hr.size>0?hr.has(W):!(yo.has(W)||ca.has(W)),[hr,yo,ca]);Dt__default.useEffect(()=>{!to&&ae.hasActiveFilters&&ae.clearAll();},[to,ae.hasActiveFilters,ae.clearAll]);let Va=()=>{let W={};gr.forEach(re=>{W[re.id]=J[re.id]??"";}),Ve(W),he(true);},da=()=>{ye||he(false);},Oa=(W,re)=>{Ve(oe=>({...oe,[W]:re}));},Ha=async()=>{if(!y?.onSubmit){he(false);return}try{me(!0),await y.onSubmit(Be),he(!1);}finally{me(false);}},Wa=()=>{if(!qo)return;let W={};Or.forEach(oe=>{W[oe.id]=qo[oe.id]??"";});let re=k?.getInitialValues?{...W,...k.getInitialValues(qo)}:W;pt(re),Ge(true);},wo=()=>{Le||Ge(false);},$a=(W,re)=>{pt(oe=>({...oe,[W]:re}));},Ga=async()=>{if(qo){if(!k?.onSubmit){Ge(false);return}try{Lt(!0),await k.onSubmit(Ot,qo),Ge(!1);}finally{Lt(false);}}},ua=()=>{no.length!==0&&mt(true);},br=()=>{ro||mt(false);},Hr=async()=>{if(no.length===0){mt(false);return}if(!E?.onConfirm){mt(false),Te([]),s?.([]);return}try{Ko(!0),await E.onConfirm(no),mt(!1),Te([]),s?.([]);}finally{Ko(false);}},Wr=ze,{fieldMapping:x}=tn({rows:Wr,config:{...f,title:f?.title||`${S} ${t("graph.reportTitle")}`}}),F=Dt__default.useMemo(()=>H?ae.applyRows(Wr,x):Wr,[H,ae.applyRows,Wr,x]),{model:L}=tn({rows:F,config:{...f,title:f?.title||`${S} ${t("graph.reportTitle")}`,fieldMapping:x}}),Z=L.table.columns.map(W=>({id:W.id,label:W.label,align:W.align||"left",minWidth:120,numeric:W.align==="right"})),de=ho?jsx(fl,{appId:ho,tableKey:p,currentLayoutData:bo,onLayoutLoad:Xt,targetLayoutId:ut,activeLayoutId:Uo,serviceUrl:M??u?.serviceUrl}):null,Pe=jsxs(Fragment,{children:[jsx(Ua,{groupAnchorEl:Y,setGroupAnchorEl:Ae,grouping:Q,setGrouping:ne,columns:P,toggleGroupField:bt}),jsx(Ka,{anchorEl:We,setAnchorEl:Ee,columns:P,visibleColumns:A,toggleColumnVisibility:Fe}),jsx(Hi,{anchorEl:Ze,setAnchorEl:ht,showSummary:q,setShowSummary:O,columns:P,summaryColumns:K,toggleSummaryColumn:eo}),jsx(Wi,{contextMenu:Tt,handleCloseContextMenu:Et,columns:P,visibleColumns:A,toggleColumnVisibility:Fe})]});return D?jsxs(ei,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[u&&jsx(vr,{fields:u.fields,filters:u.filters,onFilterChange:u.onFilterChange,onSearch:u.onSearch,variants:u.variants||[],currentVariantId:u.currentVariantId,onVariantLoad:u.onVariantLoad,onVariantSave:u.onVariantSave,onVariantDelete:u.onVariantDelete,onVariantSetDefault:u.onVariantSetDefault,appId:u.appId,tableKey:p,currentLayout:[{tableKey:p,layoutData:bo}],variantService:u.variantService,serviceUrl:M??u.serviceUrl}),jsx(su,{title:S,loading:m,showSummary:q,setShowSummary:O,setAnchorEl:Ee,setSummaryAnchorEl:ht,filterText:R,setFilterText:I,sortedAndFilteredRows:ze,selected:i,columns:P,visibleColumns:A,summaryRow:Ue,handleClick:je,selectionMode:n}),Pe]}):jsxs(ei,{sx:{width:g?"100%":"auto",mb:c?0:2,...c?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[u&&jsx(ei,{sx:{mb:2},children:jsx(vr,{fields:u.fields,filters:u.filters,onFilterChange:u.onFilterChange,onSearch:u.onSearch,variants:u.variants||[],currentVariantId:u.currentVariantId,onVariantLoad:W=>{yt(W),u.onVariantLoad&&u.onVariantLoad(W);},onVariantSave:u.onVariantSave,onVariantDelete:u.onVariantDelete,onVariantSetDefault:u.onVariantSetDefault,loading:m,appId:u.appId,tableKey:p,currentLayout:[{tableKey:p,layoutData:bo}],currentLayoutId:Uo,layoutRefs:[{tableKey:p,layoutId:Uo}],variantService:u.variantService,serviceUrl:M??u.serviceUrl})}),jsxs(Dx,{sx:{width:g?"100%":"auto",mb:c?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":ao?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, rgba(25, 118, 210, 0) 0%, rgba(25, 118, 210, 0.25) 25%, rgba(25, 118, 210, 1) 50%, rgba(25, 118, 210, 0.25) 75%, rgba(25, 118, 210, 0) 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}:c?{flex:1,minHeight:0,height:"100%"}:{}},children:[a&&jsx(Li,{filterText:R,setFilterText:I,onRowsPerPageChange:G,rowsPerPage:Ne,rowsPerPageOptions:b,page:le,count:j,onPageChange:Re,actions:d,extraTools:l,grouping:Q,setGroupAnchorEl:Ae,showSummary:q,setShowSummary:O,setAnchorEl:Ee,setSummaryAnchorEl:ht,handleExport:It,showCreateButton:se,onOpenCreateDialog:Va,showEditButton:ke,onOpenEditDialog:Wa,editDisabled:no.length!==1,showDeleteButton:T,onOpenDeleteConfirm:ua,deleteDisabled:no.length===0,onLayoutSave:C||u?.variantService&&u?.appId?fo:void 0,loading:m,layoutManager:de,onOpenGraphReport:V?xt:void 0}),jsx(Cp,{sx:{flex:1,...h?{maxHeight:h,height:h}:c?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:jsx(DndContext,{sensors:_e,collisionDetection:closestCenter,onDragEnd:Zt,modifiers:[restrictToHorizontalAxis],children:jsxs(Mx,{sx:{minWidth:g?750:"auto",width:g?"100%":"auto",tableLayout:Object.keys(fe).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,"& .MuiTableCell-root":{fontSize:o}},"aria-labelledby":"tableTitle",size:"small",stickyHeader:true,children:[jsx(Ni,{columns:P,visibleColumns:A,order:w,orderBy:B,onRequestSort:De,onContextMenu:po,selectionMode:n,grouping:Q,isAllExpanded:_,handleToggleAll:Ke,rowCount:ze.length,numSelected:i.length,onSelectAllClick:ot,columnWidths:fe,onColumnResize:Ce}),jsx(nu,{visibleRows:tt,columns:P,visibleColumns:A,selectionMode:n,selected:i,orderBy:B,loading:m,expandedGroups:ie,toggleGroupExpand:Se,handleExpandGroupRecursively:Ft,handleCollapseGroupRecursively:mo,isGroupFullyExpanded:go,handleClick:je,onSelectionChange:s,grouping:Q,rowKeyProp:v,page:le,rowsPerPage:Ne}),q&&jsx(iu,{showSummary:q,columns:P,visibleColumns:A,summaryRow:Ue,selectionMode:n?.toString(),grouping:Q,orderBy:B,zIndex:3})]})})})]}),se&&jsxs(fp,{open:ue,onClose:da,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:W=>`1px solid ${W.palette.divider}`,bgcolor:"background.paper"}}},children:[jsx(hp,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:y?.title||t("quickCreate.createWithTitle",{title:S})}),jsx(bp,{sx:{pt:"8px !important"},children:jsxs(ei,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[gr.map(W=>{let re=W.type==="number"||W.numeric?"number":W.type==="date"?"date":"text",oe=W.label||W.id;return jsx(xp,{label:oe,value:Be[W.id]??"",onChange:rt=>Oa(W.id,rt.target.value),type:re,size:"small",fullWidth:true,InputLabelProps:{shrink:re==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${W.id}`)}),y?.description&&jsx(vp,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:y.description})]})}),jsxs(yp,{sx:{px:3,pb:2},children:[jsx(yl,{onClick:da,sx:{fontSize:"0.85rem"},disabled:ye,children:y?.cancelLabel||t("common.cancel")}),jsx(yl,{onClick:Ha,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ye,children:y?.submitLabel||t("common.save")})]})]}),ke&&jsxs(fp,{open:it,onClose:wo,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:W=>`1px solid ${W.palette.divider}`,bgcolor:"background.paper"}}},children:[jsx(hp,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:k?.title||t("quickEdit.editWithTitle",{title:S})}),jsx(bp,{sx:{pt:"8px !important"},children:jsxs(ei,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Or.map(W=>{let re=W.type==="number"||W.numeric?"number":W.type==="date"?"date":"text",oe=W.label||W.id,rt=_o(W.id);return jsx(xp,{label:oe,value:Ot[W.id]??"",onChange:$=>$a(W.id,$.target.value),type:re,size:"small",fullWidth:true,disabled:!rt,InputLabelProps:{shrink:re==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${W.id}`)}),k?.description&&jsx(vp,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:k.description})]})}),jsxs(yp,{sx:{px:3,pb:2},children:[jsx(yl,{onClick:wo,sx:{fontSize:"0.85rem"},disabled:Le,children:k?.cancelLabel||t("common.cancel")}),jsx(yl,{onClick:Ga,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Le||!qo,children:k?.submitLabel||t("common.save")})]})]}),T&&jsx(En,{open:oo,type:"warning",title:E?.title||t("quickDelete.confirmTitle"),message:E?.message||(no.length>1?t("quickDelete.confirmMessageMultiple",{count:no.length}):t("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||t("common.delete"),cancelText:E?.cancelText||t("common.cancel"),onClose:br,onConfirm:Hr}),Pe,V&&jsx(rl,{open:to,onClose:z,model:L,aiAssistant:f?.aiAssistant,interaction:H?{enabled:true,filters:ae.filters,fieldMapping:x,onPrimaryDimensionClick:W=>ae.setFilter("primaryDimension",W),onSecondaryDimensionClick:W=>ae.setFilter("secondaryDimension",W),onStatusClick:W=>ae.setFilter("status",W),onClearFilter:ae.clearFilter,onClearAll:ae.clearAll}:void 0,tableContent:jsx(Xr,{appId:ho||"graph-report-internal",title:t("graph.dataBody"),columns:Z,rows:L.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},IA=Xr;var EA=({id:e,title:t,hideHeader:o=true,filterConfig:r,tableProps:a,children:n,spacing:i=1,mode:s="separated"})=>{let d=r?{...r,appId:r.appId||e}:void 0,l={...a,appId:a.appId||e};return jsxs(tu,{title:t,hideHeader:o,children:[jsxs(Stack,{spacing:i,sx:{height:"100%",overflow:"hidden"},children:[s==="separated"&&d&&jsx(Box,{sx:{flexShrink:0},children:jsx(vr,{...d})}),jsx(Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsx(Xr,{...l,fitContainer:true,filterConfig:s==="integrated"?d:void 0})})]}),n]})};var OA=({metadata:e,fetchData:t,initialRowsPerPage:o=20,rowsPerPageOptions:r=[20,50,100,-1],tableKey:a="default",mode:n="integrated",serviceUrl:i,variantService:s})=>{let{t:d}=ee(),[l,c]=useState(false),[g,h]=useState([]),[m,b]=useState({}),[C,u]=useState(e.variants||[]),[v,p]=useState(e.layout||null),[f,y]=useState(""),[k,E]=useState(0),[M,S]=useState(0),[D,P]=useState(o),[w,B]=useState([]),[R,I]=useState("asc"),[A,q]=useState("");useEffect(()=>{let fe={};e.filters.forEach(We=>{We.defaultValue!==void 0&&(fe[We.id]=We.defaultValue);}),b(fe);},[e.filters]);let O=useCallback(async(fe,We,Ee,Tt,_e)=>{c(true);try{let ze={...fe,page:We+1,limit:Ee,sort:_e,order:Tt},Ue;t?Ue=await t(ze):typeof e.api=="function"?Ue=await e.api(ze):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,ze),Ue={rows:[],total:0}):(console.warn("No API configured for report"),Ue={rows:[],total:0}),Ue&&(h(Ue.rows||[]),E(Ue.total||0));}catch(ze){console.error("Failed to fetch report data",ze);}finally{c(false);}},[e.api,t]);useEffect(()=>{O(m,M,D,R,A);},[O,M,D,R,A]);let K=()=>{S(0),O(m,0,D,R,A);},Q=fe=>{S(0),P(fe);},ne=(fe,We)=>{I(We),q(fe);},ie=fe=>{b(fe);},Y=fe=>{y(fe?.id||"");let We=mp(fe,a);if(We){let Tt=We.values??We;b(Tt),O(Tt,0,D,R,A),S(0);}let{layout:Ee}=hl(fe,a);Ee&&p(Ee);},Ae=fe=>{let We={...fe,id:Date.now().toString(),createdAt:new Date().toISOString()};u(Ee=>[...Ee,We]);},Ze=fe=>{p(fe);};return {pageProps:{id:e.id,title:e.title,mode:n,filterConfig:{appId:e.id,tableKey:a,fields:e.filters,filters:m,onFilterChange:ie,onSearch:K,onVariantLoad:Y,onVariantSave:Ae,onVariantDelete:fe=>u(We=>We.filter(Ee=>Ee.id!==fe)),onVariantSetDefault:fe=>{u(We=>We.map(Ee=>({...Ee,isDefault:Ee.id===fe})));},variants:C,currentVariantId:f,variantService:s,serviceUrl:i},tableProps:{appId:e.id,tableKey:a,columns:e.columns,rows:g,loading:l,rowKey:"id",count:k,page:M,rowsPerPage:D,rowsPerPageOptions:r,onPageChange:S,onRowsPerPageChange:Q,selectionMode:"multiple",selected:w,onSelectionChange:B,onLayoutSave:Ze,layout:v,title:e.title,showSummary:true,order:R,orderBy:A,serviceUrl:i,onSortChange:ne,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${d("graph.reportTitle")}`}}},filters:m,rows:g,loading:l,refresh:K}};var Wx=e=>[...e].sort((t,o)=>o.value-t.value),$A=({bars:e=[],lines:t=[],combos:o=[],heatmap:r=[],pies:a=[],waterfalls:n=[]})=>{let i=useMemo(()=>Wx(e),[e]),s=useMemo(()=>[...t],[t]),d=useMemo(()=>[...o],[o]),l=useMemo(()=>[...r],[r]),c=useMemo(()=>{let h=a.reduce((m,b)=>m+b.value,0);return a.map(m=>({...m,percent:h>0?m.value/h*100:m.percent}))},[a]),g=useMemo(()=>[...n],[n]);return {bars:i,lines:s,combos:d,heatmap:l,pies:c,waterfalls:g}};var _A=({apiKey:e,query:t,zoom:o=14,mapType:r="roadmap"})=>useMemo(()=>!e||!t?"":qn({apiKey:e,query:t,zoom:o,mapType:r}),[e,t,o,r]),jA=({keyword:e,location:t})=>useMemo(()=>Qi({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var ti=({code:e,language:t="text",copyable:o=true,showLineNumbers:r=false,wrapLongLines:a=false,maxHeight:n})=>{let[i,s]=useState(false),d=useMemo(()=>e.replace(/\n$/,"").split(`
4
+ `),[e]);return jsxs(Box,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",bgcolor:"background.paper"},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.6,bgcolor:"action.hover",borderBottom:"1px solid",borderColor:"divider"},children:[jsx(Typography,{variant:"caption",sx:{textTransform:"uppercase",letterSpacing:.5,color:"text.secondary",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:t}),o&&jsx(Tooltip,{title:i?"Copied":"Copy",children:jsx(IconButton,{size:"small",onClick:async()=>{try{await navigator.clipboard.writeText(e),s(!0),window.setTimeout(()=>s(!1),1400);}catch{s(false);}},children:i?jsx(jx,{fontSize:"inherit"}):jsx(_x,{fontSize:"inherit"})})})]}),jsx(Box,{component:"pre",sx:{m:0,p:1.25,fontSize:"0.82rem",lineHeight:1.55,overflow:"auto",maxHeight:n,bgcolor:"background.default",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:r?d.map((c,g)=>jsxs(Box,{sx:{display:"flex"},children:[jsx(Box,{component:"span",sx:{width:34,flexShrink:0,textAlign:"right",pr:1,color:"text.disabled",userSelect:"none"},children:g+1}),jsx(Box,{component:"span",sx:{whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:c})]},`${g}-${c}`)):jsx(Box,{component:"code",sx:{display:"block",whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:e})})]})};var Jx=e=>{let t=e.trim();return t.startsWith("$$")&&t.endsWith("$$")&&t.length>=4&&(t=t.slice(2,-2).trim()),t.startsWith("$")&&t.endsWith("$")&&t.length>=2&&(t=t.slice(1,-1).trim()),t},e0=async e=>new Function("m","return import(m)")(e),oi=({expression:e,inline:t=false,allowKatex:o=false})=>{let r=useMemo(()=>Jx(e),[e]),[a,n]=useState("");return useEffect(()=>{let i=true;return (async()=>{if(!o||!r){n("");return}try{let d=await e0("katex"),c=(d?.default||d)?.renderToString?.(r,{displayMode:!t,throwOnError:!1,strict:"warn"});i&&typeof c=="string"&&n(c);}catch{i&&n("");}})(),()=>{i=false;}},[o,r,t]),r?a?jsx(Box,{component:t?"span":"div",sx:{display:t?"inline-flex":"block",my:t?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:a}}):t?jsx(Box,{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:r}):jsx(Box,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:jsx(Typography,{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:r})}):null};var l0=async e=>new Function("m","return import(m)")(e),yc=({code:e,title:t="Mermaid Diagram",height:o=320,enabled:r=true})=>{let[a,n]=useState(""),[i,s]=useState(""),[d,l]=useState(false),c=useMemo(()=>e.trim(),[e]);return useEffect(()=>{let g=true;return (async()=>{if(!r||!c){n(""),s("");return}l(true),s(""),n("");try{let m=await l0("mermaid"),b=m?.default||m;if(!b||typeof b.render!="function")throw new Error("Mermaid runtime is not available");b.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let C=await b.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,c),u=typeof C=="string"?C:C?.svg;g&&typeof u=="string"&&n(u);}catch(m){if(g){let b=m instanceof Error?m.message:"Failed to render Mermaid diagram";s(b);}}finally{g&&l(false);}})(),()=>{g=false;}},[r,c]),jsxs(Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[jsx(Box,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsx(Typography,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:t})}),jsxs(Box,{sx:{p:1},children:[d&&jsx(Box,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:jsx(CircularProgress,{size:20})}),!d&&a&&jsx(Box,{sx:{maxHeight:o,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:a}}),!d&&!a&&jsxs(Box,{children:[i&&jsx(Alert,{severity:"info",sx:{mb:1},children:i}),jsx(ti,{code:c,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var xc=e=>e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),f0=e=>/^:?-{3,}:?$/.test(e.trim()),h0=e=>{let t=e.trim(),o=t.startsWith(":"),r=t.endsWith(":");return o&&r?"center":r?"right":"left"},Cl=e=>{let t=e.split(`
5
+ `).map(i=>i.trim()).filter(Boolean);if(t.length<2)return null;let o=xc(t[0]),r=xc(t[1]);if(o.length===0||r.length!==o.length||!r.every(f0))return null;let a=r.map(h0),n=t.slice(2).filter(i=>i.includes("|")).map(i=>{let s=xc(i);return s.length<o.length?[...s,...Array.from({length:o.length-s.length},()=>"")]:s.slice(0,o.length)});return {headers:o,aligns:a,rows:n}},vc=({markdown:e,table:t,maxHeight:o=360})=>{let r=useMemo(()=>t||(e?Cl(e):null),[t,e]);return !r||r.headers.length===0?jsx(Paper,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:jsx(Typography,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):jsx(Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:jsx(TableContainer,{sx:{maxHeight:o},children:jsxs(Table,{size:"small",stickyHeader:true,children:[jsx(TableHead,{children:jsx(TableRow,{children:r.headers.map((a,n)=>jsx(TableCell,{align:r.aligns[n],sx:{fontWeight:700,bgcolor:"background.paper"},children:a},`${a}-${n}`))})}),jsx(TableBody,{children:r.rows.map((a,n)=>jsx(TableRow,{hover:true,children:a.map((i,s)=>jsx(TableCell,{align:r.aligns[s],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i||jsx(Box,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${n}-${s}`))},`row-${n}`))})]})})})};var Sl=({content:e,title:t="Thinking",defaultExpanded:o=false,isStreaming:r=false})=>{let[a,n]=useState(o);return jsxs(Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[jsxs(Stack,{direction:"row",alignItems:"center",spacing:.6,children:[jsx(IconButton,{size:"small",onClick:()=>n(i=>!i),sx:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:jsx(S0,{fontSize:"inherit"})}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[t,r?" ...":""]})]}),jsx(Collapse,{in:a,children:jsx(Typography,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:e})})]})};var kc=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,wl=e=>e.trim().startsWith("```"),Ap=e=>/^#{1,6}\s+/.test(e.trim()),Sc=e=>/^[-*+]\s+/.test(e.trim()),wc=e=>/^\d+\.\s+/.test(e.trim()),Bp=e=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(e.trim()),Tc=e=>e.trim().startsWith(">"),Ep=(e,t)=>{if(t+1>=e.length)return false;let o=e[t],r=e[t+1];return !o.includes("|")||!r.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(r.trim())},Fp=e=>e.trim().startsWith("<think>")||e.trim()===":::think",ni=(e,t,o)=>{let r=[],a=0,n=0;kc.lastIndex=0;let i=kc.exec(e);for(;i;){i.index>a&&r.push(e.slice(a,i.index));let s=i[0],d=`${o}-${n}`;if(s.startsWith("**")&&s.endsWith("**"))r.push(jsx("strong",{children:s.slice(2,-2)},d));else if(s.startsWith("*")&&s.endsWith("*"))r.push(jsx("em",{children:s.slice(1,-1)},d));else if(s.startsWith("`")&&s.endsWith("`"))r.push(jsx(Box,{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:s.slice(1,-1)},d));else if(s.startsWith("[")&&s.includes("](")&&s.endsWith(")")){let l=s.match(/^\[([^\]]+)\]\(([^)]+)\)$/);l?r.push(jsx(Link,{href:l[2],target:"_blank",rel:"noreferrer",underline:"hover",children:l[1]},d)):r.push(s);}else s.startsWith("$")&&s.endsWith("$")&&t.enableMath?r.push(jsx(oi,{expression:s,inline:true,allowKatex:true},d)):r.push(s);a=i.index+s.length,n+=1,i=kc.exec(e);}return a<e.length&&r.push(e.slice(a)),r.length>0?r:[e]},ii=({markdown:e,content:t,className:o,enableMath:r=true,enableMermaid:a=true,enableThinkBlock:n=true,codeCopyable:i=true,codeLineNumbers:s=false})=>{let d=e??t??"",l=useMemo(()=>{let c=[],g=d.replace(/\r\n/g,`
6
6
  `).split(`
7
- `),f={enableMath:a},u=0;for(;u<g.length;){let h=g[u],w=h.trim();if(!w){u+=1;continue}if(n&&bu(h)){if(w.startsWith("<think>")){let m=[],y=h;for(;;){let b=y.indexOf("<think>"),T=b>=0?y.slice(b+7):y,A=T.indexOf("</think>");if(A>=0){m.push(T.slice(0,A)),u+=1;break}if(m.push(T),u+=1,u>=g.length)break;y=g[u];}c.push(jsx(xl,{content:m.join(`
8
- `).trim()},`think-tag-${u}`));continue}u+=1;let C=[];for(;u<g.length&&g[u].trim()!==":::";)C.push(g[u]),u+=1;u<g.length&&g[u].trim()===":::"&&(u+=1),c.push(jsx(xl,{content:C.join(`
9
- `).trim()},`think-fence-${u}`));continue}if(vl(h)){let C=w.slice(3).trim().toLowerCase(),m=[];for(u+=1;u<g.length&&!vl(g[u]);)m.push(g[u]),u+=1;u<g.length&&vl(g[u])&&(u+=1);let y=m.join(`
10
- `);if(r&&C==="mermaid"){c.push(jsx(cc,{code:y},`mermaid-${u}`));continue}if(a&&["math","latex","katex"].includes(C)){c.push(jsx(Qn,{expression:y,allowKatex:true},`math-fence-${u}`));continue}c.push(jsx(Yn,{code:y,language:C||"text",copyable:i,showLineNumbers:s,wrapLongLines:true},`code-${u}`));continue}if(a&&w.startsWith("$$")){let C=[];if(w.endsWith("$$")&&w!=="$$")C.push(w.slice(2,-2)),u+=1;else {let y=h.slice(h.indexOf("$$")+2);for(y.trim()&&C.push(y),u+=1;u<g.length;){let b=g[u],T=b.indexOf("$$");if(T>=0){C.push(b.slice(0,T)),u+=1;break}C.push(b),u+=1;}}c.push(jsx(Qn,{expression:C.join(`
11
- `).trim(),allowKatex:true},`math-${u}`));continue}if(fu(h)){let C=Math.min(6,h.match(/^#{1,6}/)?.[0]?.length||1),m=h.replace(/^#{1,6}\s+/,""),y=C===1?"h5":C===2?"h6":"subtitle1";c.push(jsx(Typography,{variant:y,sx:{mt:C===1?1.2:.8,mb:.5,fontWeight:700},children:ti(m,f,`h-${u}`)},`heading-${u}`)),u+=1;continue}if(hu(h)){c.push(jsx(Divider,{sx:{my:1.2}},`hr-${u}`)),u+=1;continue}if(yu(g,u)){let C=u+2;for(;C<g.length&&g[C].trim()&&g[C].includes("|");)C+=1;let m=g.slice(u,C).join(`
12
- `),y=yl(m);if(y){c.push(jsx(pc,{table:y},`table-${u}`)),u=C;continue}}if(hc(h)){let C=[];for(;u<g.length&&hc(g[u]);)C.push(g[u].replace(/^\s*>\s?/,"")),u+=1;c.push(jsx(Paper,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:jsx(Typography,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:C.map((m,y)=>jsxs(Fragment$1,{children:[y>0&&jsx("br",{}),ti(m,f,`q-${u}-${y}`)]},`quote-line-${y}`))})},`quote-${u}`));continue}if(gc(h)){let C=[];for(;u<g.length&&gc(g[u]);)C.push(g[u].trim().replace(/^[-*+]\s+/,"")),u+=1;c.push(jsx(Box,{component:"ul",sx:{my:.8,pl:2.5},children:C.map((m,y)=>jsx(Box,{component:"li",sx:{mb:.45},children:jsx(Typography,{variant:"body2",children:ti(m,f,`ul-${u}-${y}`)})},`ul-item-${y}`))},`ul-${u}`));continue}if(fc(h)){let C=[];for(;u<g.length&&fc(g[u]);)C.push(g[u].trim().replace(/^\d+\.\s+/,"")),u+=1;c.push(jsx(Box,{component:"ol",sx:{my:.8,pl:2.7},children:C.map((m,y)=>jsx(Box,{component:"li",sx:{mb:.45},children:jsx(Typography,{variant:"body2",children:ti(m,f,`ol-${u}-${y}`)})},`ol-item-${y}`))},`ol-${u}`));continue}let d=[];for(;u<g.length;){let C=g[u],m=C.trim();if(!m||vl(C)||fu(C)||hu(C)||gc(C)||fc(C)||hc(C)||yu(g,u)||n&&bu(C)||a&&m.startsWith("$$"))break;d.push(C),u+=1;}d.length>0?c.push(jsx(Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:d.map((C,m)=>jsxs(Fragment$1,{children:[m>0&&jsx("br",{}),ti(C,f,`p-${u}-${m}`)]},`p-line-${m}`))},`p-${u}`)):u+=1;}return c},[p,a,r,n,i,s]);return jsx(Box,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:l})};var FA=(e,t)=>jsx(oi,{markdown:e,...t});var Cu=({value:e,onChange:t,onSubmit:o,onVoiceInput:a,onClear:r,placeholder:n,statusText:i,loading:s=false,compact:p=false,showStatusText:l=true})=>jsxs(Stack,{spacing:.75,children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:p?.25:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minHeight:p?38:44},children:[jsx(Wd,{sx:{fontSize:p?16:18,color:"text.secondary"}}),jsx(InputBase,{fullWidth:true,value:e,onChange:c=>t(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),o());},placeholder:n,sx:{fontSize:p?"0.84rem":"0.9rem"}}),e&&r&&jsx(IconButton,{size:"small",onClick:r,children:jsx(Jf,{sx:{fontSize:p?16:18}})}),a&&jsx(IconButton,{size:"small",onClick:a,children:jsx(Ny,{sx:{fontSize:p?16:18}})}),jsx(IconButton,{size:"small",onClick:o,disabled:s||!e.trim(),children:jsx(Oy,{sx:{fontSize:p?16:18}})})]}),l&&i&&jsx(Typography,{variant:"caption",color:"text.secondary",children:i})]});var ku=(e,t)=>{let o=t.trim();if(!o)return e;let a=e.toLowerCase(),r=o.toLowerCase(),n=a.indexOf(r);return n<0?e:jsxs(Fragment,{children:[e.slice(0,n),jsx(Box,{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:e.slice(n,n+o.length)}),e.slice(n+o.length)]})},Cl=({section:e,highlightQuery:t=""})=>{let o=e.columns||2;return jsxs(Paper,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[jsx(Typography,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:e.title}),jsx(Box,{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:e.fields.map(a=>{let r=typeof a.value=="string"||typeof a.value=="number"?String(a.value):null;return jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:ku(a.label,t)}),jsx(Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:r?ku(r,t):a.value})]},a.id)})})]})};var Cc=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",Sl=e=>e.trim().toLowerCase(),f0=(e,t)=>{let o=[];return e.forEach(a=>{a.fields.forEach(r=>{let n=r.searchableText||Cc(r.value),i={source:"section",sourceId:a.id,sourceSectionId:a.id,sourceTitle:a.title,fieldId:r.id,fieldLabel:r.label,fieldValue:n};o.push({hit:i,text:Sl(`${a.title} ${r.label} ${n}`)});});}),t.forEach(a=>{(a.fields||[]).forEach(r=>{let n=r.searchableText||Cc(r.value),i={source:"tab",sourceId:a.id,sourceTitle:a.label,fieldId:r.id,fieldLabel:r.label,fieldValue:n};o.push({hit:i,text:Sl(`${a.label} ${r.label} ${n}`)});}),(a.sections||[]).forEach(r=>{r.fields.forEach(n=>{let i=n.searchableText||Cc(n.value),s={source:"tab",sourceId:a.id,sourceSectionId:r.id,sourceTitle:`${a.label} / ${r.title}`,fieldId:n.id,fieldLabel:n.label,fieldValue:i};o.push({hit:s,text:Sl(`${a.label} ${r.title} ${n.label} ${i}`)});});});}),o},Su=({sections:e,tabs:t=[],defaultTabId:o,ai:a})=>{let{t:r}=ee(),[n,i]=useState(""),[s,p]=useState(o||t[0]?.id),[l,c]=useState("idle"),[g,f]=useState([]),[u,h]=useState(""),[w,d]=useState(""),[C,m]=useState(false),y=useMemo(()=>f0(e,t),[e,t]);useEffect(()=>{if(t.length===0){p(void 0);return}t.some(B=>B.id===s)||p(o||t[0]?.id);},[t,s,o]);let b=useCallback(()=>{c("idle"),f([]),h(""),d("");},[]),T=useCallback(S=>{i(S),S.trim()||(c("idle"),f([]),h(""),d(""));},[]),A=useCallback(S=>{let B=Sl(S);return B?y.filter(P=>P.text.includes(B)).map(P=>P.hit):[]},[y]),R=useCallback(async()=>{let S=n.trim();if(!S)return;m(true);let B=A(S);if(f(B),B.length>0){c("search"),d(""),h(r("detail.searchAi.matches",{count:B.length})),m(false);return}if(a?.enabled!==false&&a?.onSubmit){c("ai"),h(r("detail.searchAi.autoAiFallback"));try{let v=await a.onSubmit(S,{query:S,hits:B,activeTabId:s,sections:e,tabs:t});d(typeof v=="string"?v:"");}finally{m(false);}return}c("search"),d(""),h(r("detail.searchAi.noMatch")),m(false);},[n,A,r,a,s,e,t]);return {query:n,setQuery:T,activeTabId:s,setActiveTabId:p,searchMode:l,hits:g,statusText:u,aiResponse:w,searching:C,handleSubmit:R,clearResult:b}};var p2=({title:e,subtitle:t,sections:o,tabs:a=[],defaultTabId:r,table:n,ai:i,rightHeaderSlot:s,searchBarWidth:p=460,onClose:l,closeLabel:c="Close"})=>{let{t:g}=ee(),{query:f,setQuery:u,activeTabId:h,setActiveTabId:w,searchMode:d,hits:C,statusText:m,aiResponse:y,searching:b,handleSubmit:T,clearResult:A}=Su({sections:o,tabs:a,defaultTabId:r,ai:i}),R=useMemo(()=>a.find(P=>P.id===h)||a[0],[a,h]),S=useCallback(P=>{let v=M=>{let k=document.getElementById(P);if(k){k.scrollIntoView({behavior:"smooth",block:"center"});return}M<4&&setTimeout(()=>v(M+1),60);};requestAnimationFrame(()=>v(0));},[]),B=useCallback((P,v)=>{if(a.some(M=>M.id===P)){w(P),S(v?`detail-tab-${P}-section-${v}`:`detail-tab-${P}`);return}S(`detail-section-${P}`);},[a,w,S]);return jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[jsxs(Stack,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:e}),t&&jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:t})]}),jsxs(Stack,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[jsx(Box,{sx:{width:{xs:"100%",md:p},maxWidth:"100%",minWidth:{md:320}},children:jsx(Cu,{value:f,onChange:u,onSubmit:T,onVoiceInput:i?.onVoiceInput,onClear:()=>{u(""),A();},placeholder:i?.placeholder||g("detail.searchAi.placeholder"),statusText:m,loading:b,compact:true,showStatusText:false})}),l&&jsx(Tooltip,{title:c,children:jsx(IconButton,{size:"small",onClick:l,children:jsx(C0,{fontSize:"small"})})}),s]})]}),m&&jsx(Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:m}),d==="search"&&C.length>0&&jsxs(Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:g("detail.searchAi.matches",{count:C.length})}),jsx(Stack,{spacing:.35,children:C.slice(0,8).map(P=>jsx(Box,{component:"button",type:"button",onClick:()=>B(P.sourceId,P.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:jsxs(Typography,{variant:"body2",sx:{fontSize:"0.84rem"},children:[jsx(Box,{component:"span",sx:{color:"text.secondary"},children:P.sourceTitle})," \xB7 ",jsx(Box,{component:"span",sx:{fontWeight:700},children:P.fieldLabel})," = ",jsx(Box,{component:"span",children:P.fieldValue||"-"})]})},`${P.source}|${P.sourceId}|${P.fieldId}`))})]}),d==="ai"&&y&&jsxs(Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsx(Typography,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:g("detail.searchAi.aiResultTitle")}),jsx(Box,{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:jsx(oi,{markdown:y})})]}),jsx(Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(P=>jsx(Box,{id:`detail-section-${P.id}`,children:jsx(Cl,{section:P,highlightQuery:f})},P.id))}),a.length>0&&jsxs(Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsx(Tabs,{value:R?.id||false,onChange:(P,v)=>w(v),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:a.map(P=>jsx(Tab,{value:P.id,label:P.label,sx:{textTransform:"none"}},P.id))}),jsxs(Box,{sx:{p:1.5},children:[jsx(Box,{id:`detail-tab-${R?.id||""}`}),R?.description&&jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:R.description}),R?.content?R.content:jsxs(Stack,{spacing:1.5,children:[(R?.sections||[]).map(P=>jsx(Box,{id:`detail-tab-${R?.id}-section-${P.id}`,children:jsx(Cl,{section:P,highlightQuery:f})},P.id)),R?.fields&&R.fields.length>0&&jsx(Cl,{section:{id:`${R.id}-fields`,title:R.label,fields:R.fields,columns:2},highlightQuery:f})]})]})]}),n&&jsx($a,{title:n.title||g("detail.table.title"),...n.tableProps,filterConfig:void 0,fitContainer:false})]})};var Pu=({bucket:e,cardCount:t,highlighted:o=false,children:a,emptyLabel:r,maxHeight:n,sx:i})=>{let{t:s}=ee();return jsx(Paper,{sx:[p=>{let l=e.accentColor??p.palette.primary.main;return {position:"relative",minWidth:0,borderRadius:4,overflow:"hidden",border:`1px solid ${alpha(l,o?.58:p.palette.mode==="dark"?.28:.18)}`,bgcolor:alpha(p.palette.background.paper,p.palette.mode==="dark"?.92:.97),boxShadow:o?`0 18px 40px ${alpha(l,.22)}`:`0 10px 28px ${alpha(p.palette.common.black,p.palette.mode==="dark"?.18:.08)}`,transition:"border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease","&::before":{content:'""',display:"block",height:4,bgcolor:l}}},...Array.isArray(i)?i:i?[i]:[]],children:jsxs(Stack,{spacing:1.2,sx:{p:1.5},children:[jsxs(Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxs(Box,{sx:{minWidth:0},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[e.icon,jsx(Typography,{sx:{fontSize:"0.96rem",fontWeight:800},children:e.title})]}),e.description&&jsx(Typography,{sx:{mt:.45,fontSize:"0.76rem",color:"text.secondary",lineHeight:1.45},children:e.description})]}),jsxs(Stack,{direction:"row",spacing:.8,sx:{flexShrink:0},children:[jsx(Chip,{size:"small",label:t,sx:{fontWeight:700}}),typeof e.limit=="number"&&jsx(Chip,{size:"small",label:`${s("kanban.bucket.limit")} ${e.limit}`,color:t>e.limit?"warning":"default",variant:"outlined"})]})]}),o&&jsx(Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700},children:s("kanban.bucket.dropHere")}),jsx(Box,{sx:{minHeight:220,maxHeight:n,overflowY:n?"auto":"visible",pr:n?.4:0},children:t>0?a:jsx(Box,{sx:p=>({minHeight:160,borderRadius:3,border:`1px dashed ${alpha(p.palette.divider,.9)}`,bgcolor:p.palette.mode==="dark"?alpha(p.palette.common.white,.02):alpha(p.palette.primary.main,.03),display:"grid",placeItems:"center",px:2,textAlign:"center"}),children:jsx(Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:r??e.emptyLabel??s("kanban.empty")})})})]})})};var I0={success:"success",warning:"warning",info:"info",error:"error"},P0={critical:"error",high:"warning",medium:"info",low:"success"},R0=(e,t)=>{switch(e){case "critical":return t("kanban.priority.critical");case "high":return t("kanban.priority.high");case "medium":return t("kanban.priority.medium");case "low":return t("kanban.priority.low");default:return e}},D0=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",Sc=({card:e,bucket:t,dragging:o=false,overlay:a=false,onClick:r,sx:n})=>{let{t:i}=ee(),s=!!(r&&t),p=e.tone??(e.priority?P0[e.priority]:"default"),l=p==="default"?"primary":I0[p],c=t?{card:e,bucket:t}:void 0;return jsx(Paper,{onClick:s?()=>c&&r?.(c):void 0,onKeyDown:s?g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),c&&r?.(c));}:void 0,role:s?"button":void 0,tabIndex:s?0:void 0,sx:[g=>{let f=p==="default"?g.palette.primary.main:g.palette[l].main;return {position:"relative",overflow:"hidden",p:1.4,borderRadius:3,border:`1px solid ${alpha(f,g.palette.mode==="dark"?.42:.2)}`,bgcolor:alpha(g.palette.background.paper,g.palette.mode==="dark"?.96:.98),boxShadow:a?`0 20px 45px ${alpha(g.palette.common.black,.24)}`:o?"none":`0 8px 24px ${alpha(g.palette.common.black,g.palette.mode==="dark"?.18:.08)}`,transform:a?"rotate(1deg) scale(1.01)":"none",transition:"transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease",cursor:s?"pointer":"default",opacity:o?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:4,bgcolor:f},"&:hover":s?{transform:"translateY(-1px)",boxShadow:`0 14px 32px ${alpha(g.palette.common.black,g.palette.mode==="dark"?.28:.12)}`}:void 0}},...Array.isArray(n)?n:n?[n]:[]],children:jsxs(Stack,{spacing:1.1,children:[jsxs(Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxs(Box,{sx:{minWidth:0,flex:1},children:[(e.kicker||t?.title)&&jsx(Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:.4,color:"text.secondary",textTransform:"uppercase"},children:e.kicker??t?.title}),jsx(Typography,{sx:{mt:.2,fontSize:"0.98rem",fontWeight:800,lineHeight:1.3},children:e.title})]}),e.priority&&jsx(Chip,{size:"small",color:l,label:R0(e.priority,i),variant:p==="default"?"outlined":"filled",sx:{height:22,fontWeight:700}})]}),e.summary&&jsx(Typography,{sx:{fontSize:"0.82rem",color:"text.secondary",lineHeight:1.5},children:e.summary}),e.metrics&&e.metrics.length>0&&jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(e.metrics.length,3)}, minmax(0, 1fr))`,gap:.9},children:e.metrics.slice(0,3).map(g=>jsxs(Box,{sx:f=>({borderRadius:2,px:1,py:.8,bgcolor:f.palette.mode==="dark"?alpha(f.palette.common.white,.05):alpha(f.palette.primary.main,.05)}),children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",textTransform:"uppercase",letterSpacing:.35},children:g.label}),jsx(Typography,{sx:{fontSize:"0.86rem",fontWeight:700},children:g.value})]},g.id))}),typeof e.progress=="number"&&jsxs(Box,{children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:i("kanban.card.progress")}),jsxs(Typography,{sx:{fontSize:"0.72rem",fontWeight:700},children:[Math.round(e.progress),"%"]})]}),jsx(LinearProgress,{variant:"determinate",value:Math.max(0,Math.min(100,e.progress)),color:l,sx:{height:8,borderRadius:999}})]}),(e.tags?.length||e.assignee||e.dueDate||e.footer||s)&&jsxs(Stack,{spacing:.9,children:[e.tags&&e.tags.length>0&&jsx(Box,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:e.tags.map(g=>jsx(Chip,{size:"small",label:g.label,color:g.color??"default",variant:"outlined"},g.id))}),jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8,minWidth:0},children:[e.assignee&&jsxs(Fragment,{children:[jsx(Avatar,{src:e.assignee.avatarSrc,sx:{width:28,height:28,fontSize:"0.75rem"},children:e.assignee.initials??D0(e.assignee.name)}),jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{sx:{fontSize:"0.78rem",fontWeight:700,lineHeight:1.2},noWrap:true,children:e.assignee.name}),e.dueDate&&jsx(Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},noWrap:true,children:e.dueDate})]})]}),!e.assignee&&e.dueDate&&jsx(Typography,{sx:{fontSize:"0.76rem",color:"text.secondary"},children:e.dueDate})]}),s&&jsx(Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700,whiteSpace:"nowrap"},children:i("kanban.card.openDetail")})]}),e.footer]})]})})};var A0=(e,t)=>Number.isNaN(e)||e<0?0:e>t?t:e,Mu=({buckets:e,cards:t})=>{let o=new Map;return t.forEach((a,r)=>{let n=o.get(a.bucketId)??[];n.push({card:a,sourceIndex:r}),o.set(a.bucketId,n);}),{buckets:e.map(a=>{let r=[...o.get(a.id)??[]].sort((n,i)=>n.card.position===void 0&&i.card.position===void 0?n.sourceIndex-i.sourceIndex:n.card.position===void 0?1:i.card.position===void 0?-1:n.card.position-i.card.position||n.sourceIndex-i.sourceIndex).map(({card:n},i)=>({...n,bucketId:a.id,position:i}));return {...a,cards:r}})}},Oo=(e,t)=>{for(let o=0;o<e.buckets.length;o+=1){let a=e.buckets[o],r=a.cards.findIndex(n=>n.id===t);if(r>=0)return {card:a.cards[r],bucket:a,bucketIndex:o,cardIndex:r}}},Il=(e,t)=>{let o=Oo(e,t.cardId);if(!o)return e;let a=e.buckets.findIndex(l=>l.id===t.toBucketId);if(a<0)return e;let r=e.buckets.map(l=>({...l,cards:l.cards.map(c=>({...c}))})),n=r[o.bucketIndex],[i]=n.cards.splice(o.cardIndex,1);if(!i)return e;let s=r[a],p=A0(t.targetIndex??s.cards.length,s.cards.length);return s.cards.splice(p,0,{...i,bucketId:t.toBucketId}),{buckets:r.map(l=>({...l,cards:l.cards.map((c,g)=>({...c,bucketId:l.id,position:g}))}))}};var wc="kanban-card|",Tc="kanban-bucket|",Fu=e=>`${wc}${e}`,U0=e=>`${Tc}${e}`,Pl=e=>e?.startsWith(wc)?e.slice(wc.length):void 0,Eu=e=>e?.startsWith(Tc)?e.slice(Tc.length):void 0,K0=({card:e,bucket:t,onCardClick:o})=>{let{setNodeRef:a,attributes:r,listeners:n,transform:i,transition:s,isDragging:p}=useSortable({id:Fu(e.id)}),l={transform:i?`translate3d(${i.x}px, ${i.y}px, 0)`:void 0,transition:s,zIndex:p?2:1,touchAction:"none",cursor:p?"grabbing":"grab"};return jsx(Box,{ref:a,style:l,...r,...n,children:jsx(Sc,{card:e,bucket:t,dragging:p,onClick:o})})},q0=({bucket:e,highlighted:t,bucketMaxHeight:o,emptyBucketLabel:a,onCardClick:r})=>{let{isOver:n,setNodeRef:i}=useDroppable({id:U0(e.id)});return jsx(Box,{ref:i,sx:{minWidth:0},children:jsx(Pu,{bucket:e,cardCount:e.cards.length,highlighted:t||n,emptyLabel:a,maxHeight:o,children:jsx(SortableContext,{items:e.cards.map(s=>Fu(s.id)),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:1,children:e.cards.map(s=>jsx(K0,{card:s,bucket:e,onCardClick:r},s.id))})})})})},B2=({model:e,onCardMove:t,onCardClick:o,minBucketWidth:a=320,bucketMaxHeight:r,emptyBucketLabel:n,sx:i})=>{let[s,p]=useState(null),[l,c]=useState(),g=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:6}}),useSensor(TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),f=useMemo(()=>s?Oo(e,s):void 0,[s,e]),u=useCallback(()=>{p(null),c(void 0);},[]),h=useCallback(m=>{if(!m)return;let y=Pl(m);return y?Oo(e,y)?.bucket.id:Eu(m)},[e]),w=useCallback(m=>{p(Pl(String(m.active.id))??null);},[]),d=useCallback(m=>{c(h(m.over?String(m.over.id):void 0));},[h]),C=useCallback(m=>{let y=Pl(String(m.active.id)),b=m.over?String(m.over.id):void 0;if(!y||!b){u();return}let T=Oo(e,y);if(!T){u();return}let A=T.bucket.id,R=T.cardIndex,S=Pl(b);if(S){let v=Oo(e,S);if(!v){u();return}A=v.bucket.id,R=v.cardIndex;}else {let v=Eu(b),M=e.buckets.find(k=>k.id===v);if(!v||!M){u();return}A=v,R=M.cards.length;}if(T.bucket.id===A&&T.cardIndex===R){u();return}let B=Il(e,{cardId:y,fromBucketId:T.bucket.id,toBucketId:A,targetIndex:R}),P=Oo(B,y);P&&!(P.bucket.id===T.bucket.id&&P.cardIndex===T.cardIndex)&&t?.({cardId:y,fromBucketId:T.bucket.id,toBucketId:P.bucket.id,targetIndex:P.cardIndex,card:P.card,model:B}),u();},[e,t,u]);return jsxs(DndContext,{sensors:g,collisionDetection:closestCorners,onDragStart:w,onDragOver:d,onDragEnd:C,onDragCancel:u,children:[jsx(Box,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${a}px, 1fr)`,gap:2,alignItems:"start",overflowX:"auto",pb:.5},...Array.isArray(i)?i:i?[i]:[]],children:e.buckets.map(m=>jsx(q0,{bucket:m,highlighted:m.id===l,bucketMaxHeight:r,emptyBucketLabel:n,onCardClick:o},m.id))}),jsx(DragOverlay,{children:f?jsx(Box,{sx:{width:Math.max(a-24,260)},children:jsx(Sc,{card:f.card,bucket:f.bucket,overlay:true})}):null})]})};var X0=({initialModel:e,initialBuckets:t,initialCards:o})=>e||Mu({buckets:t??[],cards:o??[]}),N2=e=>{let{onCardMove:t,onCardClick:o}=e,[a,r]=useState(()=>X0(e)),n=useCallback(c=>{r(g=>typeof c=="function"?c(g):c);},[]),i=useCallback(c=>Oo(a,c),[a]),s=useCallback((c,g,f)=>{let u=Oo(a,c);if(!u)return;let h=Il(a,{cardId:c,fromBucketId:u.bucket.id,toBucketId:g,targetIndex:f}),w=Oo(h,c);if(!w||w.bucket.id===u.bucket.id&&w.cardIndex===u.cardIndex)return;r(h);let d={cardId:c,fromBucketId:u.bucket.id,toBucketId:w.bucket.id,targetIndex:w.cardIndex,card:w.card,model:h};return t?.(d),d},[a,t]),p=useCallback((c,g)=>{r(f=>({buckets:f.buckets.map(u=>({...u,cards:u.cards.map(h=>h.id!==c?h:typeof g=="function"?g(h):{...h,...g})}))}));},[]),l=useMemo(()=>({model:a,onCardMove:c=>{s(c.cardId,c.toBucketId,c.targetIndex);},onCardClick:o}),[a,s,o]);return {model:a,actions:{replaceModel:n,moveCard:s,updateCard:p,getCard:i},boardProps:l}};var Vu=64,pv="#E9EDF2",uv="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",mv=["en","zh","fr","de","ja","ko"],Ou={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},Al=({appTitle:e,logo:t,mode:o="dark",onToggleMode:a,locale:r,localeLabel:n,localeOptions:i,onLocaleChange:s,searchPlaceholder:p,onSearch:l,user:c,onUserSetting:g,onUserLogout:f,userMenuItems:u,leftSlot:h,rightSlot:w})=>{let{t:d,locale:C}=ee(),y=useTheme().palette.mode==="dark",[b,T]=useState(""),[A,R]=useState(null),[S,B]=useState(null),P=_=>{_.preventDefault(),l&&l(b.trim());},v=o==="system"?jsx(iv,{fontSize:"small"}):o==="dark"?jsx(lv,{fontSize:"small"}):jsx(sv,{fontSize:"small"}),M=d(o==="system"?"header.theme.system":o==="dark"?"header.theme.dark":"header.theme.light"),k=r||C,I=i&&i.length>0?i:mv,D=n||Ou[k]||k.toUpperCase(),G=!!A,V=p||d("header.searchPlaceholder"),X=!!S,de=[{key:"setting",label:d("header.menu.setting"),icon:jsx(Lb,{sx:{fontSize:18}}),onClick:g},{key:"logout",label:d("header.menu.logout"),icon:jsx(dv,{sx:{fontSize:18}}),onClick:f}],oe=u&&u.length>0?u:de,re=_=>{B(null),_?.();};return jsxs(AppBar,{position:"sticky",elevation:0,sx:_=>({top:0,zIndex:_.zIndex.drawer+10,height:Vu,backgroundColor:_.palette.mode==="dark"?"#0D0D0D":pv,backgroundImage:_.palette.mode==="dark"?["radial-gradient(circle at 18% 22%, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 45%)","radial-gradient(circle at 78% 32%, rgba(144,202,249,0.14) 0%, rgba(144,202,249,0) 42%)","linear-gradient(90deg, #0A0A0A 0%, #151515 50%, #0A0A0A 100%)","linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px)","linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px)"].join(","):["radial-gradient(circle at 22% 22%, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 48%)","radial-gradient(circle at 76% 24%, rgba(203,213,225,0.45) 0%, rgba(203,213,225,0) 42%)",uv,"linear-gradient(rgba(15,23,42,0.05) 1px, transparent 1px)","linear-gradient(90deg, rgba(15,23,42,0.04) 1px, transparent 1px)"].join(","),backgroundSize:"auto, auto, auto, 24px 24px, 24px 24px",borderBottom:"1px solid",borderColor:_.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)"}),children:[jsxs(Toolbar,{sx:{minHeight:`${Vu}px !important`,px:2,gap:2},children:[jsxs(Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[h,t===null?null:t||jsx(Box,{component:"img",src:"/orbcafe.png",alt:"ORBCAFE Logo",sx:{width:44,height:44,display:"block",objectFit:"contain",flexShrink:0}}),e&&jsx(Typography,{variant:"h6",sx:{fontWeight:700,color:y?"common.white":"#111827"},children:e})]}),jsx(Box,{sx:{flex:1,display:"flex",justifyContent:"center",minWidth:0},children:jsx(Box,{component:"form",onSubmit:P,sx:{width:"100%",maxWidth:540},children:jsx(TextField,{size:"small",fullWidth:true,value:b,onChange:_=>T(_.target.value),placeholder:V,InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Wd,{sx:{color:y?"rgba(255,255,255,0.7)":"rgba(15,23,42,0.55)",fontSize:18}})}),sx:{color:y?"common.white":"rgba(17,24,39,0.9)",bgcolor:y?"rgba(255,255,255,0.08)":"#ffffff",borderRadius:999,"& .MuiOutlinedInput-notchedOutline":{borderColor:y?"rgba(255,255,255,0.15)":"rgba(15,23,42,0.2)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:y?"rgba(255,255,255,0.35)":"rgba(15,23,42,0.35)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:y?"rgba(255,255,255,0.5)":"rgba(15,23,42,0.55)"}}},inputProps:{style:{color:y?"white":"#111827"}}})})}),jsxs(Stack,{direction:"row",alignItems:"center",spacing:1.5,children:[s?jsxs(Fragment,{children:[jsx(IconButton,{size:"small",onClick:_=>R(_.currentTarget),sx:{color:y?"common.white":"#111827",borderRadius:1,px:.5},children:jsxs(Stack,{direction:"row",alignItems:"center",spacing:.45,children:[jsx(Nu,{sx:{fontSize:18}}),jsx(Typography,{variant:"caption",sx:{fontWeight:500},children:D})]})}),jsx(Menu,{anchorEl:A,open:G,onClose:()=>R(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:I.map(_=>jsx(MenuItem,{selected:_===k,onClick:()=>{s(_),R(null);},sx:{fontSize:"0.82rem"},children:Ou[_]},_))})]}):jsxs(Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsx(Nu,{sx:{color:y?"common.white":"#111827",fontSize:18}}),jsx(Typography,{variant:"caption",sx:{color:y?"common.white":"#111827",fontWeight:500},children:D})]}),jsx(IconButton,{size:"small",sx:{color:y?"common.white":"#111827"},onClick:a,title:M,children:v}),c&&jsxs(Stack,{direction:"row",alignItems:"center",spacing:1,children:[jsxs(Box,{sx:{textAlign:"right",minWidth:0},children:[jsx(Typography,{variant:"body2",sx:{color:y?"common.white":"#111827",fontWeight:700,lineHeight:1.15},children:c.name}),c.subtitle&&jsx(Typography,{variant:"caption",sx:{display:"block",mt:.25,color:y?"rgba(255,255,255,0.72)":"rgba(17,24,39,0.62)",fontSize:"0.72rem",lineHeight:1.1,letterSpacing:"0.01em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:220},title:c.subtitle,children:c.subtitle})]}),jsx(IconButton,{size:"small",onClick:_=>B(_.currentTarget),sx:{p:0},children:jsx(Avatar,{src:c.avatarSrc,imgProps:{style:{objectFit:"cover"}},sx:{width:34,height:34,bgcolor:"grey.100",color:"grey.700",fontSize:"0.85rem"},children:c.avatarText||c.name.slice(0,1).toUpperCase()})})]}),w]})]}),c&&jsx(Menu,{anchorEl:S,open:X,onClose:()=>B(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{minWidth:160,"& .MuiMenuItem-root":{minHeight:34,py:.5,px:1.25}}}},children:oe.map(_=>jsxs(MenuItem,{disabled:_.disabled,onClick:()=>re(_.onClick),children:[_.icon&&jsx(ListItemIcon,{children:_.icon}),jsx(ListItemText,{primary:_.label,slotProps:{primary:{sx:{fontSize:"0.86rem",fontWeight:500}}}})]},_.key))})]})};var Hu=({menuData:e=[],initialNavigationCollapsed:t=false}={})=>{let{navigationIslandProps:o}=Fd({initialCollapsed:t,content:e}),[a,r]=useState(900);useEffect(()=>{let i=()=>r(window.innerHeight);return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);let n=useMemo(()=>Math.max(280,a-100),[a]);return {navigationIslandProps:o,navigationMaxHeight:n}};var lB=({appTitle:e,menuData:t=[],children:o,showNavigation:a=true,locale:r="en",localeLabel:n,localeOptions:i,onLocaleChange:s,user:p,onUserSetting:l,onUserLogout:c,userMenuItems:g,logo:f,onSearch:u,rightHeaderSlot:h,leftHeaderSlot:w,contentSx:d})=>{let C="orbcafe:page-layout-mode",[m,y]=useState("system"),[b,T]=useState("light"),[A,R]=useState(false),S=m==="system"?A?b:"light":m;useEffect(()=>{try{let I=window.localStorage.getItem(C);(I==="light"||I==="dark"||I==="system")&&y(I);}catch{}R(true);let M=window.matchMedia("(prefers-color-scheme: dark)"),k=()=>{T(M.matches?"dark":"light");};return k(),M.addEventListener("change",k),()=>M.removeEventListener("change",k)},[]),useEffect(()=>{if(A)try{window.localStorage.setItem(C,m);}catch{}},[A,m]),useEffect(()=>{S==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[S]);let B=useMemo(()=>createTheme({palette:{mode:S}}),[S]),{navigationIslandProps:P,navigationMaxHeight:v}=Hu({menuData:t,initialNavigationCollapsed:false});return jsx(ThemeProvider,{theme:B,children:jsx(Di,{locale:r,children:jsxs(Box,{sx:M=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:M.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":M.palette.background.default}),children:[jsx(Al,{appTitle:e,logo:f,mode:m,onToggleMode:()=>y(M=>M==="system"?"dark":M==="dark"?"light":"system"),locale:r,localeLabel:n,localeOptions:i,onLocaleChange:s,user:p,onUserSetting:l,onUserLogout:c,userMenuItems:g,onSearch:u,leftSlot:w,rightSlot:h}),jsxs(Box,{sx:{flex:1,minHeight:0,display:"flex"},children:[a&&jsx(Box,{sx:{p:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsx(Bd,{...P,maxHeight:v,colorMode:S})}),jsx(Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...d},children:o})]})]})})})};var El="(blank)",$u="Result",Gu="Grand Total",Uu={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Ku=["sum","count","avg","min","max"];var qu=["palette","rows","columns","filters","values"];var _u=e=>qu.includes(e),ju=e=>e==="rows"||e==="columns"||e==="filters",Fl=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&_u(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&_u(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},ba=e=>e==null||e===""?El:e instanceof Date?e.toISOString().slice(0,10):String(e),Cr=e=>JSON.stringify(e),Zu=(e,t)=>{let o=e.join(""),a=t.join("");return o.localeCompare(a,void 0,{sensitivity:"base"})},Cv=e=>{if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null},ln=(e,t,o)=>{if(o==="count")return e.length;let a=e.map(r=>Cv(r[t])).filter(r=>r!==null);return a.length===0?0:o==="sum"?a.reduce((r,n)=>r+n,0):o==="avg"?a.reduce((r,n)=>r+n,0)/a.length:o==="min"?Math.min(...a):Math.max(...a)},Rt=(e,t)=>{if(!e||e.length===0)return [];let o=new Set,a=[];return e.forEach(r=>{!t.has(r)||o.has(r)||(o.add(r),a.push(r));}),a},xa=(e,t)=>e.length!==t.length?false:e.every((o,a)=>o===t[a]),Xu=(e,t)=>{let o=Object.keys(e),a=Object.keys(t);return o.length!==a.length?false:o.every(r=>{let n=e[r]??[],i=t[r]??[];return xa(n,i)})},Ll=(e,t)=>e.length!==t.length?false:e.every((o,a)=>{let r=t[a];return o.tokenId===r.tokenId&&o.fieldId===r.fieldId&&o.aggregation===r.aggregation}),Mc=e=>!e?.aggregations||e.aggregations.length===0?Ku:e.aggregations,jt=(e,t)=>{let o=Mc(t);return e&&o.includes(e)?e:t?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},ci=(e,t,o)=>{let a=o.get(t.fieldId);return a?.formatValue?a.formatValue(e):t.aggregation==="count"?Math.round(e).toLocaleString():e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var Ju=({options:e,selectedValues:t,onChange:o,minWidth:a=96})=>{let{t:r}=ee(),[n,i]=useState(""),s=useMemo(()=>{let l=n.trim().toLowerCase();return l?e.filter(c=>c.toLowerCase().includes(l)):e},[e,n]),p=e.length>0&&t.length===e.length;return jsx(FormControl,{size:"small",sx:{minWidth:a},children:jsxs(Select,{multiple:true,value:t,onChange:l=>{let c=l.target.value,g=typeof c=="string"?c.split(","):c;o(g);},onClick:l=>l.stopPropagation(),onMouseDown:l=>l.stopPropagation(),renderValue:l=>{let c=l;return e.length===0?r("pivot.filter.na"):c.length===0?r("common.none"):c.length===e.length?r("common.all"):`${c.length}/${e.length}`},MenuProps:{PaperProps:{sx:{maxHeight:320,bgcolor:"background.paper"}}},sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:[jsx(ListSubheader,{disableSticky:true,sx:l=>({bgcolor:"background.paper",py:.8,lineHeight:"normal",borderBottom:`1px solid ${l.palette.divider}`}),children:jsx(TextField,{size:"small",placeholder:`${r("common.search")}...`,fullWidth:true,value:n,onChange:l=>i(l.target.value),onKeyDown:l=>l.stopPropagation(),onClick:l=>l.stopPropagation(),sx:{m:0,"& .MuiInputBase-input":{fontSize:"0.75rem",py:.7}}})}),jsx(Box,{sx:l=>({px:1.5,py:.5,borderBottom:`1px solid ${l.palette.divider}`,bgcolor:"background.paper"}),onMouseDown:l=>{l.preventDefault(),l.stopPropagation();},onClick:l=>{l.preventDefault(),l.stopPropagation();},children:jsx(Button,{variant:"text",size:"small",onClick:l=>{l.preventDefault(),l.stopPropagation(),o(p?[]:e);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:r(p?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),s.length===0&&jsx(MenuItem,{disabled:true,sx:{fontSize:"0.75rem"},children:r("pivot.filter.noResults")}),s.map(l=>{let c=t.includes(l);return jsxs(MenuItem,{value:l,sx:{fontSize:"0.75rem",py:.25},children:[jsx(Checkbox,{size:"small",checked:c,sx:{p:.5,mr:.5}}),jsx(ListItemText,{primary:l,primaryTypographyProps:{sx:{fontSize:"0.75rem",lineHeight:1.2}}})]},l)})]})})};var Bc=({label:e,subtitle:t,isDragging:o,dragRef:a,listeners:r,attributes:n,style:i})=>jsx(Paper,{ref:a,...r,...n,sx:s=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:s.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none"}),style:{...i,opacity:o?.3:1,cursor:o?"grabbing":"grab"},children:jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsx(Box,{sx:s=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.3,borderRadius:1,bgcolor:s.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)"}),children:jsx(Ev,{sx:{fontSize:16,color:"text.secondary"}})}),jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary",lineHeight:1.2},children:t})]})]})}),om=({id:e,label:t,subtitle:o})=>{let{setNodeRef:a,listeners:r,attributes:n,isDragging:i}=useDraggable({id:e});return jsx(Bc,{label:t,subtitle:o,isDragging:i,dragRef:a,listeners:r,attributes:n})};var dn=({zone:e,title:t,hint:o,icon:a,children:r,itemCount:n,onClear:i})=>{let s=`container|${e}`,{isOver:p,setNodeRef:l}=useDroppable({id:s}),{t:c}=ee();return jsxs(Paper,{ref:l,sx:g=>({p:1.1,borderRadius:3,border:"1px dashed",borderColor:p?"primary.main":g.palette.divider,bgcolor:p?g.palette.mode==="dark"?"rgba(25, 118, 210, 0.16)":"rgba(47, 91, 255, 0.06)":g.palette.mode==="dark"?"rgba(255,255,255,0.02)":"rgba(245, 248, 255, 0.86)",transition:"all 120ms ease",minHeight:120,display:"flex",flexDirection:"column"}),children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[a,jsx(Typography,{sx:{fontSize:"0.79rem",fontWeight:800,letterSpacing:.2},children:t}),jsxs(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:["(",n,")"]})]}),n>0&&i&&jsx(Tooltip,{title:c("pivot.clearArea"),children:jsx(IconButton,{size:"small",onClick:i,sx:{p:.25},children:jsx(Vv,{sx:{fontSize:16}})})})]}),jsx(Typography,{sx:{mt:.5,mb:.9,fontSize:"0.7rem",color:"text.secondary"},children:o}),jsx(Box,{sx:{flex:1},children:r})]})};var rm={xs:1.2,md:1.6},un=({title:e,subtitle:t,collapsed:o,onToggleCollapse:a,expandAriaLabel:r,collapseAriaLabel:n,children:i,bodySx:s,unmountOnExit:p=false,headerActions:l})=>jsxs(Paper,{sx:c=>({borderRadius:3,border:`1px solid ${c.palette.divider}`,overflow:"hidden",bgcolor:alpha(c.palette.background.paper,.95)}),children:[jsxs(Box,{sx:c=>({px:rm,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,borderBottom:o?"none":`1px solid ${c.palette.divider}`}),children:[jsxs(Box,{sx:{minWidth:0,flex:1},children:[jsx(Typography,{sx:{fontSize:"0.9rem",fontWeight:800},children:e}),jsx(Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t})]}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[l,jsx(IconButton,{size:"small","aria-label":o?r:n,onClick:a,sx:c=>({border:`1px solid ${c.palette.divider}`,bgcolor:alpha(c.palette.background.paper,.88),width:28,height:28,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:c.palette.mode==="dark"?alpha(c.palette.primary.main,.18):alpha(c.palette.primary.main,.08)}}),children:jsx(zb,{sx:{fontSize:16,transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:o?"rotate(180deg)":"rotate(0deg)"}})})]})]}),jsx(Collapse,{in:!o,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:p,children:jsx(Box,{sx:[{px:rm,py:{xs:1.2,md:1.6}},...Array.isArray(s)?s:s?[s]:[]],children:i})})]});var Hl=({label:e,caption:t,onRemove:o,trailing:a,isDragging:r,dragRef:n,listeners:i,attributes:s,style:p})=>jsx(Paper,{ref:n,style:p,sx:l=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:l.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none",opacity:r?0:1}),children:jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsx(Box,{...s,...i,sx:l=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.25,borderRadius:1,bgcolor:l.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)",cursor:"grab"}),children:jsx(Ev,{sx:{fontSize:15,color:"text.secondary"}})}),jsxs(Box,{sx:{minWidth:0,flex:1},children:[jsx(Typography,{sx:{fontSize:"0.8rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsx(Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},children:t})]}),a,o&&jsx(IconButton,{size:"small",onClick:l=>{l.stopPropagation(),o();},sx:{p:.2},children:jsx(Jf,{sx:{fontSize:16}})})]})}),di=({id:e,label:t,caption:o,onRemove:a,trailing:r})=>{let{setNodeRef:n,attributes:i,listeners:s,transform:p,transition:l,isDragging:c}=useSortable({id:e}),g={transform:p?`translate3d(${p.x}px, ${p.y}px, 0)`:void 0,transition:l,zIndex:c?999:"auto"};return jsx(Hl,{label:t,caption:o,onRemove:a,trailing:r,isDragging:c,dragRef:n,listeners:s,attributes:i,style:g})};var Gl={rows:jsx(Qv,{fontSize:"small"}),columns:jsx(gh,{fontSize:"small"}),filters:jsx(Yv,{fontSize:"small"}),values:jsx(bh,{fontSize:"small"})},lm=({isConfiguratorCollapsed:e,onToggleCollapse:t,availableFields:o,fieldMap:a,filterFields:r,columnFields:n,rowFields:i,valueFields:s,clearZone:p,removeFieldFromZone:l,getFilterSelectionSummary:c,renderDimensionFilterSelect:g,renderAggregationSelect:f,getAggregationLabel:u})=>{let{t:h}=ee(),w=[`${h("pivot.zone.rows")} ${i.length}`,`${h("pivot.zone.columns")} ${n.length}`,`${h("pivot.zone.filters")} ${r.length}`,`${h("pivot.zone.values")} ${s.length}`].join(" \xB7 ");return jsx(un,{title:h("pivot.config.title"),subtitle:w,collapsed:e,onToggleCollapse:t,expandAriaLabel:h("pivot.collapse.ariaExpand"),collapseAriaLabel:h("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:jsxs(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[jsx(dn,{zone:"palette",title:h("pivot.fieldList"),hint:h("pivot.availableDimensions"),itemCount:o.length,icon:jsx(Ev,{sx:{fontSize:16,color:"text.secondary"}}),children:jsxs(Stack,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[o.length===0&&jsx(Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",py:1},children:h("pivot.allFieldsInUse")}),o.map(d=>jsx(om,{id:`item|palette|${d.id}`,label:d.label,subtitle:d.type??"string"},d.id))]})}),jsxs(Stack,{spacing:2,children:[jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsx(dn,{zone:"filters",title:h("pivot.zone.filters"),hint:h("pivot.hint.filters"),icon:Gl.filters,itemCount:r.length,onClear:()=>p("filters"),children:jsx(SortableContext,{items:r.map(d=>`item|filters|${d}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:r.map(d=>jsx(di,{id:`item|filters|${d}`,label:a.get(d)?.label??d,caption:c(d),trailing:g(d),onRemove:()=>l("filters",d)},d))})})}),jsx(dn,{zone:"columns",title:h("pivot.zone.columns"),hint:h("pivot.hint.columns"),icon:Gl.columns,itemCount:n.length,onClear:()=>p("columns"),children:jsx(SortableContext,{items:n.map(d=>`item|columns|${d}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:n.map(d=>jsx(di,{id:`item|columns|${d}`,label:a.get(d)?.label??d,caption:`${a.get(d)?.type??"dimension"} \u2022 ${c(d)}`,trailing:g(d),onRemove:()=>l("columns",d)},d))})})})]}),jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsx(dn,{zone:"rows",title:h("pivot.zone.rows"),hint:h("pivot.hint.rows"),icon:Gl.rows,itemCount:i.length,onClear:()=>p("rows"),children:jsx(SortableContext,{items:i.map(d=>`item|rows|${d}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:i.map(d=>jsx(di,{id:`item|rows|${d}`,label:a.get(d)?.label??d,caption:`${a.get(d)?.type??"dimension"} \u2022 ${c(d)}`,trailing:g(d),onRemove:()=>l("rows",d)},d))})})}),jsx(dn,{zone:"values",title:h("pivot.zone.values"),hint:h("pivot.hint.values"),icon:Gl.values,itemCount:s.length,onClear:()=>p("values"),children:jsx(SortableContext,{items:s.map(d=>`item|values|${d.tokenId}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:s.map(d=>{let C=a.get(d.fieldId)?.label??d.fieldId,m=`${u(d.aggregation)}(${C})`;return jsx(di,{id:`item|values|${d.tokenId}`,label:C,caption:m,trailing:f(d),onRemove:()=>l("values",d.tokenId)},d.tokenId)})})})})]})]})]})})};var sm=e=>e.toLocaleString(void 0,{maximumFractionDigits:1}),cm=({data:e,primaryLabel:t,secondaryLabel:o,formatPrimaryValue:a,formatSecondaryValue:r})=>{let n=useTheme$1();if(e.length===0)return null;let i=720,s=250,p={top:20,right:24,bottom:40,left:52},l=o?e.map(d=>d.primaryValue):e.map((d,C)=>C+1),c=o?e.map(d=>d.secondaryValue??0):e.map(d=>d.primaryValue),g=Math.max(...l,1),f=Math.max(...c,1),u=i-p.left-p.right,h=s-p.top-p.bottom,w=e.map((d,C)=>{let m=o?d.primaryValue:C+1,y=o?d.secondaryValue??0:d.primaryValue,b=p.left+m/g*u,T=s-p.bottom-y/f*h;return {...d,x:b,y:T,rawX:m,rawY:y}});return jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[jsx(Box,{sx:{overflowX:"auto"},children:jsxs(Box,{component:"svg",viewBox:`0 0 ${i} ${s}`,sx:{width:"100%",minWidth:i,height:s},children:[jsx("line",{x1:p.left,y1:s-p.bottom,x2:i-p.right,y2:s-p.bottom,stroke:alpha(n.palette.text.secondary,.35)}),jsx("line",{x1:p.left,y1:p.top,x2:p.left,y2:s-p.bottom,stroke:alpha(n.palette.text.secondary,.35)}),w.map(d=>jsxs("g",{children:[jsx("circle",{cx:d.x,cy:d.y,r:7,fill:alpha(n.palette.primary.main,.18)}),jsx("circle",{cx:d.x,cy:d.y,r:4.5,fill:n.palette.primary.main,children:jsxs("title",{children:[d.name,`
13
- `,o?`${t}: ${a(d.primaryValue)}`:`${t}: ${a(d.primaryValue)}`,o?`
14
- ${o}: ${(r??a)(d.secondaryValue??0)}`:""]})}),jsx("text",{x:d.x,y:Math.max(d.y-12,p.top+8),textAnchor:"middle",fontSize:"10",fill:n.palette.text.secondary,children:d.name})]},d.name)),jsx("text",{x:i/2,y:s-10,textAnchor:"middle",fontSize:"11",fill:n.palette.text.secondary,children:o?t:"Index"}),jsx("text",{x:16,y:s/2,textAnchor:"middle",transform:`rotate(-90 16 ${s/2})`,fontSize:"11",fill:n.palette.text.secondary,children:o??t}),jsx("text",{x:p.left,y:p.top-4,fontSize:"10",fill:n.palette.text.secondary,children:sm(f)}),jsx("text",{x:i-p.right,y:s-p.bottom+16,textAnchor:"end",fontSize:"10",fill:n.palette.text.secondary,children:sm(g)})]})}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(3, minmax(0, 1fr))"},gap:1},children:e.map(d=>jsxs(Box,{sx:C=>({borderRadius:2,px:1.25,py:1,border:`1px solid ${alpha(C.palette.divider,.7)}`,bgcolor:alpha(C.palette.background.default,.35)}),children:[jsx(Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:d.name,children:d.name}),jsxs(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[t,": ",a(d.primaryValue)]}),o&&jsxs(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[o,": ",(r??a)(d.secondaryValue??0)]})]},d.name))})]})};var Vc=e=>Math.max(...e,1),pm=({data:e,chartType:t,primaryLabel:o,secondaryLabel:a,formatPrimaryValue:r,formatSecondaryValue:n})=>{let i=useTheme$1(),s=i.palette.primary.main,p=i.palette.warning.main;if(e.length===0)return null;if(t==="bar-horizontal"){let m=Vc(e.flatMap(y=>[y.primaryValue,y.secondaryValue??0]));return jsx(Stack,{spacing:1.1,children:e.map(y=>jsxs(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[jsx(Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:y.name,children:y.name}),jsxs(Stack,{spacing:.65,children:[jsx(Box,{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:alpha(i.palette.action.active,.08)},children:jsx(Box,{sx:{width:`${y.primaryValue/m*100}%`,height:"100%",bgcolor:s}})}),a&&jsx(Box,{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:alpha(i.palette.action.active,.08)},children:jsx(Box,{sx:{width:`${(y.secondaryValue??0)/m*100}%`,height:"100%",bgcolor:p}})})]}),jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700},children:r(y.primaryValue)}),a&&jsx(Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"text.secondary"},children:(n??r)(y.secondaryValue??0)})]})]},y.name))})}if(t==="bar-vertical"){let m=Vc(e.flatMap(b=>[b.primaryValue,b.secondaryValue??0])),y=a?92:76;return jsx(Box,{sx:{overflowX:"auto",pb:.5},children:jsx(Box,{sx:{minWidth:Math.max(620,e.length*y),display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:e.map(b=>jsxs(Box,{sx:{minWidth:0},children:[jsxs(Box,{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[jsx(Box,{sx:{width:a?16:26,minHeight:8,height:`${Math.max(b.primaryValue/m*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:s},title:`${o}: ${r(b.primaryValue)}`}),a&&jsx(Box,{sx:{width:16,minHeight:8,height:`${Math.max((b.secondaryValue??0)/m*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:p},title:`${a}: ${(n??r)(b.secondaryValue??0)}`})]}),jsx(Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:b.name,children:b.name}),jsx(Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:r(b.primaryValue),children:r(b.primaryValue)}),a&&jsx(Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:(n??r)(b.secondaryValue??0),children:(n??r)(b.secondaryValue??0)})]},b.name))})})}let l=Math.max(680,e.length*74),c=240,g={top:20,right:18,bottom:36,left:18},f=Vc(e.flatMap(m=>[m.primaryValue,m.secondaryValue??0])),u=l-g.left-g.right,h=c-g.top-g.bottom,w=m=>e.map((y,b)=>{let T=g.left+b*u/Math.max(e.length-1,1),A=c-g.bottom-m(y)/f*h;return {x:T,y:A,item:y}}),d=w(m=>m.primaryValue),C=a?w(m=>m.secondaryValue??0):[];return jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[jsx(Box,{sx:{overflowX:"auto"},children:jsxs(Box,{component:"svg",viewBox:`0 0 ${l} ${c}`,sx:{width:"100%",minWidth:l,height:c},children:[jsx("line",{x1:g.left,y1:c-g.bottom,x2:l-g.right,y2:c-g.bottom,stroke:alpha(i.palette.text.secondary,.35)}),jsx("polyline",{fill:"none",stroke:s,strokeWidth:3,points:d.map(m=>`${m.x},${m.y}`).join(" ")}),d.map(m=>jsx("circle",{cx:m.x,cy:m.y,r:4,fill:s,children:jsxs("title",{children:[m.item.name,`
15
- `,o,": ",r(m.item.primaryValue)]})},`primary-${m.item.name}`)),a&&jsxs(Fragment,{children:[jsx("polyline",{fill:"none",stroke:p,strokeWidth:2.5,strokeDasharray:"5 5",points:C.map(m=>`${m.x},${m.y}`).join(" ")}),C.map(m=>jsx("circle",{cx:m.x,cy:m.y,r:3.5,fill:p,children:jsxs("title",{children:[m.item.name,`
16
- `,a,": ",(n??r)(m.item.secondaryValue??0)]})},`secondary-${m.item.name}`))]})]})}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:e.map(m=>jsxs(Box,{sx:y=>({borderRadius:2,px:1.1,py:.9,border:`1px solid ${alpha(y.palette.divider,.7)}`,bgcolor:alpha(y.palette.background.default,.35)}),children:[jsx(Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:m.name,children:m.name}),jsx(Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:r(m.primaryValue)}),a&&jsx(Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:(n??r)(m.secondaryValue??0)})]},m.name))})]})};var um=(e,t,o)=>{let a=new Set,r=[];return e.forEach(n=>{a.has(n)||(a.add(n),r.push({fieldId:n,label:o.get(n)?.label??n,zone:"rows"}));}),t.forEach(n=>{a.has(n)||(a.add(n),r.push({fieldId:n,label:o.get(n)?.label??n,zone:"columns"}));}),r},mm=(e,t,o)=>e.map(a=>{let r=t.get(a.fieldId),n=r?.label??a.fieldId;return {fieldId:a.fieldId,label:`${o(a.aggregation)} \xB7 ${n}`,item:a,field:r}}),gm=({rows:e,dimensionFieldId:t,primaryValue:o,secondaryValue:a})=>{if(!t)return [];let r=new Map;return e.forEach(n=>{let i=ba(n[t]),s=r.get(i);if(s){s.push(n);return}r.set(i,[n]);}),Array.from(r.entries()).sort((n,i)=>n[0].localeCompare(i[0],void 0,{sensitivity:"base"})).map(([n,i])=>({name:n,primaryValue:ln(i,o.fieldId,o.aggregation),secondaryValue:a?ln(i,a.fieldId,a.aggregation):void 0}))};var fm=({rows:e,fieldMap:t,rowFields:o,columnFields:a,valueFields:r,chartDimensionFieldId:n,chartPrimaryValueFieldId:i,chartSecondaryValueFieldId:s,chartType:p,isCollapsed:l,onChartDimensionFieldIdChange:c,onChartPrimaryValueFieldIdChange:g,onChartSecondaryValueFieldIdChange:f,onChartTypeChange:u,onToggleCollapse:h,getAggregationLabel:w})=>{let{t:d}=ee(),C=useMemo(()=>um(o,a,t),[a,t,o]),m=useMemo(()=>mm(r,t,w),[t,w,r]),y=m.find(v=>v.fieldId===i)??m[0],b=m.find(v=>v.fieldId===s&&v.fieldId!==y?.fieldId)??null,T=C.find(v=>v.fieldId===n)??C[0],A=T&&y?d("pivot.chart.subtitleReady",{dimension:T.label,measure:b?`${y.label} / ${b.label}`:y.label}):d("pivot.chart.subtitle"),R=useMemo(()=>!T||!y?[]:gm({rows:e,dimensionFieldId:T.fieldId,primaryValue:y.item,secondaryValue:b?.item}),[y,e,b,T]),S=v=>y?ci(v,y.item,t):v.toLocaleString(),B=v=>b?ci(v,b.item,t):v.toLocaleString(),P=C.length>1||m.length>1;return jsxs(un,{title:d("pivot.chart.title"),subtitle:A,collapsed:l,onToggleCollapse:h,expandAriaLabel:d("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:d("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[P&&jsxs(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[jsxs(FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:d("pivot.chart.dimension")}),jsx(Select,{value:T?.fieldId??"",onChange:v=>c(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:C.map(v=>jsx(MenuItem,{value:v.fieldId,sx:{fontSize:"0.75rem"},children:v.label},v.fieldId))})]}),jsxs(FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:d("pivot.chart.primaryMeasure")}),jsx(Select,{value:y?.fieldId??"",onChange:v=>g(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:m.map(v=>jsx(MenuItem,{value:v.fieldId,sx:{fontSize:"0.75rem"},children:v.label},v.fieldId))})]}),jsxs(FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:d("pivot.chart.secondaryMeasure")}),jsxs(Select,{value:b?.fieldId??"",onChange:v=>f(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsx(MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:d("common.none")}),m.filter(v=>v.fieldId!==y?.fieldId).map(v=>jsx(MenuItem,{value:v.fieldId,sx:{fontSize:"0.75rem"},children:v.label},v.fieldId))]})]}),jsxs(FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:d("pivot.chart.chartType")}),jsxs(Select,{value:p,onChange:v=>u(v.target.value),sx:{fontSize:"0.75rem",height:32},children:[jsx(MenuItem,{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:d("pivot.chart.style.barVertical")}),jsx(MenuItem,{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:d("pivot.chart.style.barHorizontal")}),jsx(MenuItem,{value:"line",sx:{fontSize:"0.75rem"},children:d("pivot.chart.style.line")}),jsx(MenuItem,{value:"scatter",sx:{fontSize:"0.75rem"},children:d("pivot.chart.style.scatter")})]})]})]}),jsx(Box,{children:T?y?R.length===0?jsx(Box,{sx:{py:5,textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:d("pivot.chart.emptyNoData")})}):p==="scatter"?jsx(cm,{data:R,primaryLabel:y.label,secondaryLabel:b?.label,formatPrimaryValue:S,formatSecondaryValue:B}):jsx(pm,{data:R,chartType:p,primaryLabel:y.label,secondaryLabel:b?.label,formatPrimaryValue:S,formatSecondaryValue:B}):jsx(Box,{sx:{py:5,textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:d("pivot.chart.emptyNoValue")})}):jsx(Box,{sx:{py:5,textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:d("pivot.chart.emptyNoDimension")})})})]})};var ql=({node:e,dataColumns:t,fieldMap:o,level:a,expandedKeys:r,onToggle:n,getValue:i})=>{let s=r.has(e.key),p=e.children.length>0,l=e.isGrandTotal;return jsxs(Fragment,{children:[jsxs(TableRow,{sx:c=>({bgcolor:l?c.palette.mode==="dark"?"rgba(25, 118, 210, 0.22)":"rgba(47, 91, 255, 0.08)":c.palette.mode==="dark"?"#111111":"background.paper","&:hover":{bgcolor:l?c.palette.mode==="dark"?"rgba(25, 118, 210, 0.28)":"rgba(47, 91, 255, 0.12)":c.palette.mode==="dark"?"#181818":"rgba(0, 0, 0, 0.02)"}}),children:[jsxs(TableCell,{sx:c=>({fontSize:"0.76rem",fontWeight:l?800:600,borderBottom:`1px solid ${c.palette.divider}`,whiteSpace:"nowrap",pl:a*2+1,display:"flex",alignItems:"center",height:40}),children:[p&&!l&&jsx(IconButton,{size:"small",onClick:()=>n(e.key),sx:{p:.2,mr:.5,ml:-1},children:s?jsx(Wh,{sx:{fontSize:16}}):jsx(wh,{sx:{fontSize:16}})}),!p&&!l&&a>0&&jsx(Box,{sx:{width:20}}),e.value]}),t.map(c=>jsx(TableCell,{align:"right",sx:{fontSize:"0.76rem",fontWeight:l?800:500,borderBottom:g=>`1px solid ${g.palette.divider}`,whiteSpace:"nowrap"},children:ci(i?i(e,c.id):e.aggregatedValues[c.id]??0,c.valueItem,o)},`${e.key}-${c.id}`))]}),s&&e.children.map(c=>jsx(ql,{node:c,dataColumns:t,fieldMap:o,level:a+1,expandedKeys:r,onToggle:n,getValue:i},c.key))]})};var Gc=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},Zl=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",Uc=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",km=e=>{let t=new Set,o=a=>{a.forEach(r=>{r.children.length>0&&(t.add(r.key),o(r.children));});};return o(e),t},wm=(e,t,o=0)=>e.length===0?o:e.reduce((a,r)=>r.children.length===0||!t.has(r.key)?Math.max(a,o+1):Math.max(a,wm(r.children,t,o+1)),o),FC=(e,t)=>{let o=[],a=r=>{r.forEach(n=>{if(n.children.length>0&&t.has(n.key)){a(n.children);return}o.push(n);});};return a(e),o},Z5=({title:e,rows:t,fields:o,initialLayout:a,initialChart:r,emptyText:n,maxPreviewHeight:i=520,initialChartCollapsed:s=false,initialTableCollapsed:p=false,model:l,enablePresetManagement:c=false,presets:g,defaultPresets:f,onPresetsChange:u,initialPresetId:h,onPresetApplied:w})=>{let{t:d}=ee(),C=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}})),m=useRef(0),y=useRef(false),b=e??d("pivot.title.default"),T=n??d("pivot.empty"),A=useMemo(()=>({sum:d("pivot.agg.sum"),count:d("pivot.agg.count"),avg:d("pivot.agg.avg"),min:d("pivot.agg.min"),max:d("pivot.agg.max")}),[d]),R=useCallback(x=>A[x]??Uu[x],[A]),S=useMemo(()=>new Set(o.map(x=>x.id)),[o]),B=useMemo(()=>new Map(o.map(x=>[x.id,x])),[o]),[P,v]=useState(()=>Rt(a?.rows,S)),[M,k]=useState(()=>Rt(a?.columns,S)),[I,D]=useState(()=>Rt(a?.filters,S)),[G,V]=useState(()=>{let x=a?.values??[],E=new Set,F=[];return x.forEach(K=>{if(!S.has(K.fieldId)||E.has(K.fieldId))return;E.add(K.fieldId),m.current+=1;let ce=B.get(K.fieldId);F.push({tokenId:`v${m.current}`,fieldId:K.fieldId,aggregation:jt(K.aggregation,ce)});}),F}),[X,de]=useState({}),[oe,re]=useState(true),[_,qe]=useState(false),[it,Y]=useState(()=>Gc(Rt(a?.rows,S),Rt(a?.columns,S),r?.dimensionFieldId)),[le,Be]=useState(()=>{let x=(a?.values??[]).filter((E,F,K)=>S.has(E.fieldId)&&K.findIndex(ce=>ce.fieldId===E.fieldId)===F).map(E=>({tokenId:E.fieldId,fieldId:E.fieldId,aggregation:jt(E.aggregation,B.get(E.fieldId))}));return Zl(x,r?.primaryValueFieldId)}),[Ee,Ue]=useState(()=>{let x=(a?.values??[]).filter((F,K,ce)=>S.has(F.fieldId)&&ce.findIndex(Se=>Se.fieldId===F.fieldId)===K).map(F=>({tokenId:F.fieldId,fieldId:F.fieldId,aggregation:jt(F.aggregation,B.get(F.fieldId))})),E=Zl(x,r?.primaryValueFieldId);return Uc(x,E,r?.secondaryValueFieldId)}),[ot,Fe]=useState(r?.chartType??"bar-vertical"),[_e,ht]=useState(s),[j,pe]=useState(p),[De,Le]=useState(()=>f??[]),[We,U]=useState(""),[ye,be]=useState(false),[Pe,et]=useState(""),[Ge,Tt]=useState(null),[ro,Yt]=useState(new Set(["__grand_total__"])),[Ht,Qt]=useState(new Set),ze=l?.rowFields??P,Ce=l?.columnFields??M,L=l?.filterFields??I,$=l?.valueFields??G,Z=l?.filterSelections??X,te=l?.showGrandTotal??oe,ke=l?.isConfiguratorCollapsed??_,z=l?.chartDimensionFieldId??it,O=l?.chartPrimaryValueFieldId??le,N=l?.chartSecondaryValueFieldId??Ee,ne=l?.chartType??ot,se=l?.isChartCollapsed??_e,we=l?.isTableCollapsed??j,ae=g??De,Me=c||ae.length>0||!!u,Te=useCallback(x=>{if(l?.setRowFields){l.setRowFields(x);return}v(x);},[l]),Ne=useCallback(x=>{if(l?.setColumnFields){l.setColumnFields(x);return}k(x);},[l]),Ie=useCallback(x=>{if(l?.setFilterFields){l.setFilterFields(x);return}D(x);},[l]),Re=useCallback(x=>{if(l?.setValueFields){l.setValueFields(x);return}V(x);},[l]),Ve=useCallback(x=>{if(l?.setFilterSelections){l.setFilterSelections(x);return}de(x);},[l]),It=useCallback(x=>{if(l?.setShowGrandTotal){l.setShowGrandTotal(x);return}re(x);},[l]),xo=useCallback(x=>{if(l?.setIsConfiguratorCollapsed){l.setIsConfiguratorCollapsed(x);return}qe(x);},[l]),yt=useCallback(x=>{if(l?.setChartDimensionFieldId){l.setChartDimensionFieldId(x);return}Y(x);},[l]),At=useCallback(x=>{if(l?.setChartPrimaryValueFieldId){l.setChartPrimaryValueFieldId(x);return}Be(x);},[l]),vo=useCallback(x=>{if(l?.setChartSecondaryValueFieldId){l.setChartSecondaryValueFieldId(x);return}Ue(x);},[l]),Ra=useCallback(x=>{if(l?.setChartType){l.setChartType(x);return}Fe(x);},[l]),Br=useCallback(x=>{if(l?.setIsChartCollapsed){l.setIsChartCollapsed(x);return}ht(x);},[l]),Do=useCallback(x=>{if(l?.setIsTableCollapsed){l.setIsTableCollapsed(x);return}pe(x);},[l]),no=useCallback(x=>{let E=typeof x=="function"?x(ae):x;g||Le(E),u?.(E);},[u,ae,g]),er=useMemo(()=>new Set([...ze,...Ce,...L]),[ze,Ce,L]),oa=useMemo(()=>o.filter(x=>!er.has(x.id)),[o,er]),Kt=useMemo(()=>{let x=[...ze,...Ce,...L],E=new Set,F=[];return x.forEach(K=>{E.has(K)||(E.add(K),F.push(K));}),F},[Ce,L,ze]);useEffect(()=>{Te(x=>{let E=x.filter(F=>S.has(F));return xa(x,E)?x:E}),Ne(x=>{let E=x.filter(F=>S.has(F));return xa(x,E)?x:E}),Ie(x=>{let E=x.filter(F=>S.has(F));return xa(x,E)?x:E}),Re(x=>{let E=x.filter(F=>S.has(F.fieldId)).map(F=>({...F,aggregation:jt(F.aggregation,B.get(F.fieldId))}));return Ll(x,E)?x:E});},[B,S]);let io=useMemo(()=>{let x={};return Kt.forEach(E=>{let F=new Set;t.forEach(K=>{F.add(ba(K[E]));}),x[E]=Array.from(F).sort((K,ce)=>K.localeCompare(ce));}),x},[Kt,t]);useEffect(()=>{Ve(x=>{let E={};return Kt.forEach(F=>{let K=io[F]??[],Se=(x[F]??[]).filter(J=>K.includes(J)),H=Object.prototype.hasOwnProperty.call(x,F);E[F]=H?Se:K;}),Xu(x,E)?x:E});},[Kt,io]),useEffect(()=>{yt(x=>Gc(ze,Ce,x));},[Ce,ze,yt]),useEffect(()=>{At(x=>Zl($,x));},[At,$]),useEffect(()=>{vo(x=>Uc($,O,x));},[O,vo,$]);let Wt=useMemo(()=>t.filter(x=>Kt.every(E=>{let F=Z[E]??[],K=io[E]??[];if(F.length===K.length)return true;if(F.length===0)return false;let ce=ba(x[E]);return F.includes(ce)})),[Kt,io,Z,t]),je=useMemo(()=>{if($.length===0)return null;let x=new Map;if(Wt.forEach(H=>{let J=Ce.length>0?Ce.map(at=>ba(H[at])):[d("pivot.valueLabel")],Q=Cr(J);x.set(Q,J);}),x.size===0){let H=Ce.length>0?Ce.map(()=>El):[d("pivot.valueLabel")];x.set(Cr(H),H);}let E=Array.from(x.entries()).sort((H,J)=>Zu(H[1],J[1])),F=E.flatMap(([H,J])=>$.map(Q=>{let at=B.get(Q.fieldId),W=`${R(Q.aggregation)} ${at?.label??Q.fieldId}`,ie=Ce.length===0||$.length>1?`${J.join(" / ")} \u2022 ${W}`:J.join(" / ");return {id:`${H}::${Q.tokenId}`,colKey:H,valueItem:Q,label:ie}})),K=[];Ce.length>0&&E.forEach(([H,J])=>{let Q=F.filter(ie=>ie.colKey===H),at=K,W=[];J.forEach((ie,q)=>{W.push(`d${q}:${ie}`);let ge=`col::${Cr(W)}`,Ze=at.find(_o=>_o.key===ge);Ze||(Ze={key:ge,label:ie,children:[],leafColumnIds:[],path:J.slice(0,q+1),depth:q},at.push(Ze)),Q.forEach(_o=>{Ze.leafColumnIds.includes(_o.id)||Ze.leafColumnIds.push(_o.id);}),at=Ze.children;});});let ce=H=>{let J={};return F.forEach(Q=>{let at=H.filter(W=>{let ie=Ce.length>0?Ce.map(q=>ba(W[q])):[d("pivot.valueLabel")];return Cr(ie)===Q.colKey});J[Q.id]=ln(at,Q.valueItem.fieldId,Q.valueItem.aggregation);}),J},Se=[];if(ze.length===0)Se.push({key:"root",value:d("pivot.resultLabel")||$u,children:[],isLeaf:true,aggregatedValues:ce(Wt),path:[],depth:0});else {let H=(J,Q,at)=>{if(Q>=ze.length)return [];let W=ze[Q],ie=new Map;return J.forEach(q=>{let ge=ba(q[W]);ie.has(ge)||ie.set(ge,[]),ie.get(ge).push(q);}),Array.from(ie.keys()).sort().map(q=>{let ge=ie.get(q),Ze=[...at,q];return {key:Cr(Ze),value:q,fieldId:W,aggregatedValues:ce(ge),children:H(ge,Q+1,Ze),isLeaf:Q===ze.length-1,path:Ze,depth:Q}})};Se.push(...H(Wt,0,[]));}return {dataColumns:F,columnTree:K,rowTree:Se}},[Ce,B,Wt,R,ze,d,$]),aa=useCallback((x,E)=>(m.current+=1,{tokenId:`v${m.current}`,fieldId:x,aggregation:jt(E,B.get(x))}),[B]),Go=useCallback(x=>{if(x==="rows")return Te([]);if(x==="columns")return Ne([]);if(x==="filters")return Ie([]);Re([]);},[]),ra=useCallback((x,E)=>{if(x==="rows")return Te(F=>F.filter(K=>K!==E));if(x==="columns")return Ne(F=>F.filter(K=>K!==E));if(x==="filters")return Ie(F=>F.filter(K=>K!==E));Re(F=>F.filter(K=>K.tokenId!==E));},[]),tr=useCallback((x,E)=>{Re(F=>F.map(K=>K.tokenId===x?{...K,aggregation:jt(E,B.get(K.fieldId))}:K));},[B]),Uo=useCallback(x=>{Tt(String(x.active.id));},[]),or=useCallback(x=>{if(Tt(null),!x.over)return;let E=Fl(String(x.active.id)),F=Fl(String(x.over.id));if(!E||!F||E.kind!=="item"||!E.key)return;if(E.zone===F.zone&&F.kind==="item"){if(E.zone==="rows"){let q=ze.indexOf(E.key),ge=ze.indexOf(F.key??"");q!==-1&&ge!==-1&&q!==ge&&Te(Ze=>arrayMove(Ze,q,ge));return}if(E.zone==="columns"){let q=Ce.indexOf(E.key),ge=Ce.indexOf(F.key??"");q!==-1&&ge!==-1&&q!==ge&&Ne(Ze=>arrayMove(Ze,q,ge));return}if(E.zone==="filters"){let q=L.indexOf(E.key),ge=L.indexOf(F.key??"");q!==-1&&ge!==-1&&q!==ge&&Ie(Ze=>arrayMove(Ze,q,ge));return}if(E.zone==="values"){let q=$.findIndex(Ze=>Ze.tokenId===E.key),ge=$.findIndex(Ze=>Ze.tokenId===(F.key??""));q!==-1&&ge!==-1&&q!==ge&&Re(Ze=>arrayMove(Ze,q,ge));}return}let K=F.zone,ce=[...ze],Se=[...Ce],H=[...L],J=[...$],Q="",at=null;if(E.zone==="palette")Q=E.key;else if(E.zone==="values"){let q=J.find(ge=>ge.tokenId===E.key);if(!q)return;Q=q.fieldId,at=q,J=J.filter(ge=>ge.tokenId!==E.key);}else E.zone==="rows"?(Q=E.key,ce=ce.filter(q=>q!==Q)):E.zone==="columns"?(Q=E.key,Se=Se.filter(q=>q!==Q)):E.zone==="filters"&&(Q=E.key,H=H.filter(q=>q!==Q));if(!Q)return;let W=()=>{ce=ce.filter(q=>q!==Q),Se=Se.filter(q=>q!==Q),H=H.filter(q=>q!==Q);},ie=q=>{if(F.kind!=="item"||!F.key)return q==="rows"?ce.length:q==="columns"?Se.length:q==="filters"?H.length:q==="values"?J.length:0;if(q==="rows"){let ge=ce.indexOf(F.key);return ge>=0?ge:ce.length}if(q==="columns"){let ge=Se.indexOf(F.key);return ge>=0?ge:Se.length}if(q==="filters"){let ge=H.indexOf(F.key);return ge>=0?ge:H.length}if(q==="values"){let ge=J.findIndex(Ze=>Ze.tokenId===F.key);return ge>=0?ge:J.length}return 0};if(K==="palette"){Te(ce),Ne(Se),Ie(H),Re(J);return}if(K==="values"){let q=ie("values"),ge=at??aa(Q);J.splice(q,0,ge),Te(ce),Ne(Se),Ie(H),Re(J);return}if(ju(K)){W();let q=ie(K);K==="rows"?ce.splice(q,0,Q):K==="columns"?Se.splice(q,0,Q):H.splice(q,0,Q),Te(ce),Ne(Se),Ie(H),Re(J);}},[Ce,aa,L,ze,$]),ar=useCallback((x,E)=>{Ve(F=>({...F,[x]:E}));},[]),Ko=useCallback(x=>{Yt(E=>{let F=new Set(E);return F.has(x)?F.delete(x):F.add(x),F});},[]),na=useCallback(x=>{Qt(E=>{let F=new Set(E);return F.has(x)?F.delete(x):F.add(x),F});},[]),Da=useCallback(x=>{let E=B.get(x.fieldId),F=Mc(E);return jsx(FormControl,{size:"small",sx:{minWidth:98},children:jsx(Select,{value:x.aggregation,onChange:K=>tr(x.tokenId,K.target.value),onClick:K=>K.stopPropagation(),onMouseDown:K=>K.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:F.map(K=>jsx(MenuItem,{value:K,sx:{fontSize:"0.75rem"},children:R(K)},K))})})},[B,R,tr]),qt=useCallback(x=>{let E=io[x]??[],F=Z[x]??E;return E.length===0?d("pivot.filter.noValues"):F.length===0?d("pivot.filter.noneSelected"):F.length===E.length?d("pivot.filter.allValues"):d("pivot.filter.selectedCount",{selected:F.length,total:E.length})},[io,Z,d]),Mo=useCallback(x=>{let E=io[x]??[],F=Z[x]??E;return jsx(Ju,{options:E,selectedValues:F,onChange:K=>ar(x,K)})},[io,Z,ar]),ia=useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),Co=useCallback(()=>{let x={};return new Set([...Kt,...Object.keys(Z)]).forEach(F=>{if(!S.has(F))return;let K=Z[F]??[];x[F]=[...K];}),{layout:{rows:[...ze],columns:[...Ce],filters:[...L],values:$.map(F=>({fieldId:F.fieldId,aggregation:F.aggregation}))},filterSelections:x,showGrandTotal:te,chart:{dimensionFieldId:z,primaryValueFieldId:O,secondaryValueFieldId:N,chartType:ne}}},[Kt,z,O,N,ne,Ce,L,Z,ze,te,S,$]),qo=useCallback(x=>{let E=Rt(x.layout.rows,S),F=Rt(x.layout.columns,S),K=Rt(x.layout.filters,S),ce=new Set,Se=(x.layout.values??[]).filter(Q=>!S.has(Q.fieldId)||ce.has(Q.fieldId)?false:(ce.add(Q.fieldId),true)).map(Q=>aa(Q.fieldId,Q.aggregation)),H={};Object.entries(x.filterSelections??{}).forEach(([Q,at])=>{!S.has(Q)||!Array.isArray(at)||(H[Q]=Array.from(new Set(at.map(W=>String(W)))));}),Te(E),Ne(F),Ie(K),Re(Se),Ve(H),typeof x.showGrandTotal=="boolean"&&It(x.showGrandTotal),yt(Gc(E,F,x.chart?.dimensionFieldId));let J=Zl(Se,x.chart?.primaryValueFieldId);At(J),vo(Uc(Se,J,x.chart?.secondaryValueFieldId)),Ra(x.chart?.chartType??"bar-vertical"),U(x.id),w?.(x);},[aa,w,yt,At,vo,Ra,Ne,Ie,Ve,Te,It,Re,S]),rr=useCallback(x=>{if(!x){U("");return}let E=ae.find(F=>F.id===x);if(!E){U("");return}qo(E);},[qo,ae]),Er=useCallback(()=>{let x=d("pivot.preset.defaultName",{index:ae.length+1});et(x),be(true);},[ae.length,d]),Ma=useCallback(()=>{let x=Pe.trim();if(!x)return;let E={id:ia(),name:x,...Co()};no(F=>[...F,E]),U(E.id),be(false);},[Co,ia,Pe,no]),nr=useCallback(()=>{We&&(no(x=>x.filter(E=>E.id!==We)),U(""));},[We,no]);useEffect(()=>{if(!h||y.current)return;let x=ae.find(E=>E.id===h);x&&(y.current=true,qo(x));},[qo,h,ae]),useEffect(()=>{We&&(ae.some(x=>x.id===We)||U(""));},[We,ae]);let la=useMemo(()=>{if(!te||!je||!ze.length)return null;let x={};return je.dataColumns.forEach(E=>{let F=Wt.filter(K=>{let ce=Ce.length>0?Ce.map(Se=>ba(K[Se])):[d("pivot.valueLabel")];return Cr(ce)===E.colKey});x[E.id]=ln(F,E.valueItem.fieldId,E.valueItem.aggregation);}),{key:"__grand_total__",value:d("pivot.grandTotal")||Gu,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:x,path:[],depth:-1}},[te,je,Wt,Ce,ze.length,d]),Jt=useMemo(()=>km(je?.rowTree??[]),[je]),Ao=useMemo(()=>km(je?.columnTree??[]),[je]);useEffect(()=>{Yt(x=>{let E=new Set;return x.has("__grand_total__")&&E.add("__grand_total__"),Jt.forEach(F=>{x.has(F)&&E.add(F);}),E});},[Jt]),useEffect(()=>{Qt(x=>{let E=new Set;return Ao.forEach(F=>{x.has(F)&&E.add(F);}),E});},[Ao]);let Fr=useCallback(()=>{Yt(x=>{let E=new Set(x);return Jt.forEach(F=>E.add(F)),E});},[Jt]),ir=useCallback(()=>{Yt(x=>{let E=new Set;return x.has("__grand_total__")&&E.add("__grand_total__"),E});},[]),Lr=useCallback(()=>{Qt(new Set(Ao));},[Ao]),zr=useCallback(()=>{Qt(new Set);},[]),Nr=useMemo(()=>!je||Ce.length===0?[]:FC(je.columnTree,Ht),[Ce.length,Ht,je]),lo=useMemo(()=>{if(!je)return [];if(Ce.length===0)return je.dataColumns.map(E=>({id:E.id,label:E.label,leafColumnIds:[E.id],valueItem:E.valueItem}));let x=new Map(je.dataColumns.map(E=>[E.id,E]));return Nr.flatMap(E=>{let F=new Map;return E.leafColumnIds.forEach(K=>{let ce=x.get(K);if(!ce)return;let Se=ce.valueItem.tokenId,H=`${R(ce.valueItem.aggregation)} ${B.get(ce.valueItem.fieldId)?.label??ce.valueItem.fieldId}`,J=F.get(Se);if(J){J.leafColumnIds.push(K);return}F.set(Se,{id:`${E.key}::${Se}`,label:$.length>1?H:E.label,leafColumnIds:[K],valueItem:ce.valueItem});}),Array.from(F.values())})},[Ce.length,B,R,je,$.length,Nr]),Vr=useMemo(()=>new Map(lo.map(x=>[x.id,x])),[lo]),Or=useMemo(()=>lo.map(x=>({id:x.id,colKey:x.id,valueItem:x.valueItem,label:x.label})),[lo]),lr=useMemo(()=>{if(!je||Ce.length===0)return [];let x=[],E=wm(je.columnTree,Ht),F=E+($.length>1?1:0),K=(ce,Se)=>{x[Se]??(x[Se]=[]),ce.forEach(H=>{let J=H.children.length>0&&Ht.has(H.key),Q=lo.filter(W=>H.leafColumnIds.some(ie=>W.leafColumnIds.includes(ie))).length,at=J||$.length>1?1:F-Se;x[Se].push({key:H.key,label:H.label,colSpan:Q,rowSpan:at,expandable:H.children.length>0,expanded:J}),J&&K(H.children,Se+1);});};return K(je.columnTree,0),$.length>1&&(x[E]=lo.map(ce=>({key:ce.id,label:ce.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),x},[Ce.length,Ht,je,$.length,lo]),sa=useCallback((x,E)=>E.leafColumnIds.reduce((F,K)=>F+(x.aggregatedValues[K]??0),0),[]),Aa=useMemo(()=>jsxs(Fragment,{children:[jsx(Button,{size:"small",variant:"text",onClick:Fr,disabled:Jt.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:d("pivot.table.expandRowsAll")}),jsx(Button,{size:"small",variant:"text",onClick:ir,disabled:Jt.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:d("pivot.table.collapseRowsAll")}),jsx(Divider,{orientation:"vertical",flexItem:true}),jsx(Button,{size:"small",variant:"text",onClick:Lr,disabled:Ao.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:d("pivot.table.expandColumnsAll")}),jsx(Button,{size:"small",variant:"text",onClick:zr,disabled:Ce.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:d("pivot.table.collapseColumnsAll")})]}),[Ce.length,Ao.size,Jt.size,zr,ir,Lr,Fr,d]),Ba=()=>{if(!Ge)return null;let x=Fl(Ge);if(!x||x.kind!=="item"||!x.key)return null;if(x.zone==="palette"){let ce=B.get(x.key);return ce?jsx(Bc,{label:ce.label,subtitle:ce.type}):null}if(x.zone==="values"){let ce=$.find(Q=>Q.tokenId===x.key);if(!ce)return null;let H=B.get(ce.fieldId)?.label??ce.fieldId,J=`${R(ce.aggregation)}(${H})`;return jsx(Hl,{label:H,caption:J})}let F=B.get(x.key)?.label??x.key,K=qt(x.key);return jsx(Hl,{label:F,caption:K})};return jsxs(Paper,{sx:x=>({p:{xs:1.2,md:2},borderRadius:4,border:`1px solid ${x.palette.divider}`,bgcolor:"background.paper",boxShadow:x.palette.mode==="dark"?"none":"0 12px 28px rgba(15, 23, 42, 0.08)",display:"flex",flexDirection:"column",gap:2}),children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[jsxs(Box,{children:[jsx(Typography,{sx:{fontSize:"1.05rem",fontWeight:800},children:b}),jsx(Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:d("pivot.subtitle.default")})]}),jsxs(Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[Me&&jsxs(Fragment,{children:[jsx(FormControl,{size:"small",sx:{minWidth:200},children:jsxs(Select,{value:We,displayEmpty:true,onChange:x=>rr(String(x.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsx(MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:d("pivot.preset.selectPlaceholder")}),ae.map(x=>jsx(MenuItem,{value:x.id,sx:{fontSize:"0.75rem"},children:x.name},x.id))]})}),jsx(Tooltip,{title:d("pivot.preset.save"),children:jsx(IconButton,{size:"small",onClick:Er,"aria-label":d("pivot.preset.save"),children:jsx(jp,{sx:{fontSize:18}})})}),jsx(Tooltip,{title:d("pivot.preset.delete"),children:jsx("span",{children:jsx(IconButton,{size:"small",onClick:nr,disabled:!We,"aria-label":d("pivot.preset.delete"),children:jsx(TC,{sx:{fontSize:18}})})})}),jsx(Divider,{flexItem:true,orientation:"vertical"})]}),jsxs(Typography,{sx:{fontSize:"0.74rem",color:"text.secondary"},children:[d("pivot.records"),": ",jsx("strong",{children:t.length.toLocaleString()})," / ",d("pivot.afterFilter"),":"," ",jsx("strong",{children:Wt.length.toLocaleString()})]}),jsx(Divider,{flexItem:true,orientation:"vertical"}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.6},children:[jsx(Typography,{sx:{fontSize:"0.74rem"},children:d("pivot.grandTotal")}),jsx(Switch,{size:"small",checked:te,onChange:x=>It(x.target.checked)})]})]})]}),jsx(Divider,{}),jsxs(DndContext,{sensors:C,collisionDetection:closestCenter,onDragStart:Uo,onDragEnd:or,children:[jsx(lm,{isConfiguratorCollapsed:ke,onToggleCollapse:()=>xo(x=>!x),availableFields:oa,fieldMap:B,filterFields:L,columnFields:Ce,rowFields:ze,valueFields:$,clearZone:Go,removeFieldFromZone:ra,getFilterSelectionSummary:qt,renderDimensionFilterSelect:Mo,renderAggregationSelect:Da,getAggregationLabel:R}),jsx(Portal,{children:jsx(DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Ba()})})]}),jsx(fm,{rows:Wt,fieldMap:B,rowFields:ze,columnFields:Ce,valueFields:$,chartDimensionFieldId:z,chartPrimaryValueFieldId:O,chartSecondaryValueFieldId:N,chartType:ne,isCollapsed:se,onChartDimensionFieldIdChange:x=>yt(x),onChartPrimaryValueFieldIdChange:x=>At(x),onChartSecondaryValueFieldIdChange:x=>vo(x),onChartTypeChange:x=>Ra(x),onToggleCollapse:()=>Br(x=>!x),getAggregationLabel:R}),jsx(un,{title:d("pivot.table.sectionTitle"),subtitle:ze.length>0?ze.map(x=>B.get(x)?.label??x).join(" > "):d("pivot.table.dimensions"),collapsed:we,onToggleCollapse:()=>Do(x=>!x),expandAriaLabel:d("pivot.table.collapse.ariaExpand"),collapseAriaLabel:d("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:Aa,children:je===null?jsx(Box,{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:T})}):jsx(TableContainer,{sx:{maxHeight:i},children:jsxs(Table,{size:"small",stickyHeader:true,children:[jsx(TableHead,{children:(lr.length>0?lr:[[]]).map((x,E)=>jsxs(TableRow,{children:[E===0&&jsx(TableCell,{rowSpan:Math.max(lr.length,1),sx:F=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:F.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${F.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:ze.length>0?ze.map(F=>B.get(F)?.label).join(" > "):d("pivot.table.dimensions")}),(x.length>0?x:lo.map(F=>({key:F.id,label:F.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(F=>jsx(TableCell,{align:"center",colSpan:F.colSpan,rowSpan:F.rowSpan,sx:K=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:K.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${K.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:jsxs(Box,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[F.expandable&&jsx(IconButton,{size:"small",onClick:()=>na(F.key),sx:{p:.1,ml:-0.3},children:F.expanded?jsx(Wh,{sx:{fontSize:16}}):jsx(wh,{sx:{fontSize:16}})}),jsx(Box,{component:"span",children:F.label})]})},F.key))]},`pivot-header-row-${E}`))}),jsxs(TableBody,{children:[je.rowTree.map(x=>jsx(ql,{node:x,dataColumns:Or,fieldMap:B,level:0,expandedKeys:ro,onToggle:Ko,getValue:(E,F)=>{let K=Vr.get(F);return K?sa(E,K):0}},x.key)),la&&jsx(ql,{node:la,dataColumns:Or,fieldMap:B,level:0,expandedKeys:ro,onToggle:Ko,getValue:(x,E)=>{let F=Vr.get(E);return F?sa(x,F):0}})]})]})})}),jsxs(Dialog,{open:ye,onClose:()=>be(false),maxWidth:"xs",fullWidth:true,children:[jsx(DialogTitle,{children:d("pivot.preset.saveDialogTitle")}),jsx(DialogContent,{children:jsx(TextField,{autoFocus:true,fullWidth:true,margin:"dense",label:d("pivot.preset.nameLabel"),value:Pe,onChange:x=>et(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),Ma());}})}),jsxs(DialogActions,{children:[jsx(Button,{onClick:()=>be(false),children:d("common.cancel")}),jsx(Button,{variant:"contained",onClick:Ma,disabled:!Pe.trim(),children:d("common.save")})]})]})]})};var Tm=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},qc=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",Im=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",eE=({fields:e,initialLayout:t,initialFilterSelections:o={},initialShowGrandTotal:a=true,initialConfiguratorCollapsed:r=false,initialChart:n,initialChartCollapsed:i=false,initialTableCollapsed:s=false})=>{let p=useRef(0),l=useMemo(()=>new Set(e.map(U=>U.id)),[e]),c=useMemo(()=>new Map(e.map(U=>[U.id,U])),[e]),[g,f]=useState(()=>Rt(t?.rows,l)),[u,h]=useState(()=>Rt(t?.columns,l)),[w,d]=useState(()=>Rt(t?.filters,l)),[C,m]=useState(()=>{let U=t?.values??[],ye=new Set,be=[];return U.forEach(Pe=>{!l.has(Pe.fieldId)||ye.has(Pe.fieldId)||(ye.add(Pe.fieldId),p.current+=1,be.push({tokenId:`v${p.current}`,fieldId:Pe.fieldId,aggregation:jt(Pe.aggregation,c.get(Pe.fieldId))}));}),be}),[y,b]=useState(o),[T,A]=useState(a),[R,S]=useState(r),[B,P]=useState(()=>Tm(Rt(t?.rows,l),Rt(t?.columns,l),n?.dimensionFieldId)),[v,M]=useState(()=>{let U=(()=>{let ye=t?.values??[],be=new Set,Pe=[];return ye.forEach(et=>{!l.has(et.fieldId)||be.has(et.fieldId)||(be.add(et.fieldId),Pe.push({tokenId:et.fieldId,fieldId:et.fieldId,aggregation:jt(et.aggregation,c.get(et.fieldId))}));}),Pe})();return qc(U,n?.primaryValueFieldId)}),[k,I]=useState(()=>{let U=(()=>{let be=t?.values??[],Pe=new Set,et=[];return be.forEach(Ge=>{!l.has(Ge.fieldId)||Pe.has(Ge.fieldId)||(Pe.add(Ge.fieldId),et.push({tokenId:Ge.fieldId,fieldId:Ge.fieldId,aggregation:jt(Ge.aggregation,c.get(Ge.fieldId))}));}),et})(),ye=qc(U,n?.primaryValueFieldId);return Im(U,ye,n?.secondaryValueFieldId)}),[D,G]=useState(n?.chartType??"bar-vertical"),[V,X]=useState(i),[de,oe]=useState(s);useEffect(()=>{f(U=>{let ye=U.filter(be=>l.has(be));return xa(U,ye)?U:ye}),h(U=>{let ye=U.filter(be=>l.has(be));return xa(U,ye)?U:ye}),d(U=>{let ye=U.filter(be=>l.has(be));return xa(U,ye)?U:ye}),m(U=>{let ye=U.filter(be=>l.has(be.fieldId)).map(be=>({...be,aggregation:jt(be.aggregation,c.get(be.fieldId))}));return Ll(U,ye)?U:ye});},[c,l]),useEffect(()=>{P(U=>Tm(g,u,U));},[u,g]),useEffect(()=>{M(U=>qc(C,U));},[C]),useEffect(()=>{I(U=>Im(C,v,U));},[v,C]);let re=useCallback(U=>{f(Rt(U,l));},[l]),_=useCallback(U=>{h(Rt(U,l));},[l]),qe=useCallback(U=>{d(Rt(U,l));},[l]),it=useCallback(U=>{m(ye=>{let be=U??[],Pe=new Set,et=[];return be.forEach(Ge=>{if(!l.has(Ge.fieldId)||Pe.has(Ge.fieldId))return;Pe.add(Ge.fieldId);let Tt=ye.find(ro=>ro.fieldId===Ge.fieldId);if(Tt){et.push({...Tt,aggregation:jt(Ge.aggregation??Tt.aggregation,c.get(Ge.fieldId))});return}p.current+=1,et.push({tokenId:`v${p.current}`,fieldId:Ge.fieldId,aggregation:jt(Ge.aggregation,c.get(Ge.fieldId))});}),et});},[c,l]),Y=useCallback(U=>{re(U.rows??[]),_(U.columns??[]),qe(U.filters??[]),it(U.values??[]);},[_,qe,re,it]),le=useCallback(U=>{if(U==="rows")return f([]);if(U==="columns")return h([]);if(U==="filters")return d([]);m([]);},[]),Be=useCallback((U,ye)=>{if(U==="rows")return f(be=>be.filter(Pe=>Pe!==ye));if(U==="columns")return h(be=>be.filter(Pe=>Pe!==ye));if(U==="filters")return d(be=>be.filter(Pe=>Pe!==ye));m(be=>be.filter(Pe=>Pe.tokenId!==ye));},[]),Ee=useCallback((U,ye)=>{m(be=>be.map(Pe=>Pe.tokenId===U?{...Pe,aggregation:jt(ye,c.get(Pe.fieldId))}:Pe));},[c]),Ue=useCallback((U,ye)=>{b(be=>({...be,[U]:ye}));},[]),ot=useCallback(()=>{b({});},[]),Fe=useCallback(()=>{A(U=>!U);},[]),_e=useCallback(()=>{S(U=>!U);},[]),ht=useCallback(U=>{P(U);},[]),j=useCallback(U=>{M(U);},[]),pe=useCallback(U=>{I(U);},[]),De=useCallback(()=>{X(U=>!U);},[]),Le=useCallback(()=>{oe(U=>!U);},[]);return {model:useMemo(()=>({rowFields:g,setRowFields:f,columnFields:u,setColumnFields:h,filterFields:w,setFilterFields:d,valueFields:C,setValueFields:m,filterSelections:y,setFilterSelections:b,showGrandTotal:T,setShowGrandTotal:A,isConfiguratorCollapsed:R,setIsConfiguratorCollapsed:S,chartDimensionFieldId:B,setChartDimensionFieldId:P,chartPrimaryValueFieldId:v,setChartPrimaryValueFieldId:M,chartSecondaryValueFieldId:k,setChartSecondaryValueFieldId:I,chartType:D,setChartType:G,isChartCollapsed:V,setIsChartCollapsed:X,isTableCollapsed:de,setIsTableCollapsed:oe}),[B,v,k,D,u,w,y,V,R,de,g,T,C]),actions:{setRows:re,setColumns:_,setFilters:qe,setValues:it,setLayout:Y,clearZone:le,removeFieldFromZone:Be,setAggregationForValue:Ee,setFilterSelection:Ue,resetFilterSelections:ot,toggleGrandTotal:Fe,toggleConfigurator:_e,setChartDimension:ht,setChartPrimaryValue:j,setChartSecondaryValue:pe,setChartType:G,toggleChart:De,toggleTable:Le}}};var nE=({orientation:e="auto",defaultNavigationOpen:t,onNavOpenChange:o}={})=>{let a=useTheme$1(),r=useMediaQuery("(orientation: portrait)",{noSsr:true}),n=useMediaQuery(a.breakpoints.down("md"),{noSsr:true}),i=useMemo(()=>e==="auto"?r||n?"portrait":"landscape":e,[n,r,e]),[s,p]=useState(t??i==="landscape");useEffect(()=>{p(t??i==="landscape");},[t,i]);let l=g=>{p(g),o?.(g);};return {resolvedOrientation:i,isPortraitViewport:r,isCompactViewport:n,navigationOpen:s,setNavigationOpen:l,toggleNavigationOpen:()=>l(!s)}};var WC=e=>{let t=Number(e||0);return Number.isFinite(t)?t:0},sE=({rows:e,rowKey:t="id",numericField:o,defaultSelectedId:a})=>{let n=e[0]?.[t],[i,s]=useState(a??n),p=useMemo(()=>e.find(u=>u[t]===i)||e[0],[t,e,i]),[l,c]=useState(()=>{let u=p?.[o];return u==null?"0":String(u)});return {selectedId:i,selectedRecord:p,editorValue:l,setEditorValue:c,selectRecord:u=>{let h=u[t];s(h);let w=u[o];c(w==null?"0":String(w));},applyEditorValue:u=>{if(i===void 0)return;let h=WC(l),w=e.map(d=>d[t]===i?{...d,[o]:h}:d);u(w);}}};var QC=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],Bm=(e,t,o,a)=>{t?.(e),a&&o?.();},gE=({open:e,onClose:t,title:o="Scan barcode",subtitle:a="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:r=QC,facingMode:n="environment",manualEntry:i=true,autoCloseOnDetect:s=true,scanIntervalMs:p=600,confirmLabel:l="Use code",cancelLabel:c="Close",manualPlaceholder:g="Enter barcode manually",onDetected:f,onError:u,sx:h})=>{let w=vt__default.useRef(null),d=vt__default.useRef(null),C=vt__default.useRef(null),m=vt__default.useRef(null),[y,b]=vt__default.useState("idle"),[T,A]=vt__default.useState(""),[R,S]=vt__default.useState(null),[B,P]=vt__default.useState(null),v=vt__default.useCallback(()=>{C.current!==null&&(window.clearInterval(C.current),C.current=null),d.current&&(d.current.getTracks().forEach(I=>I.stop()),d.current=null),w.current&&(w.current.srcObject=null);},[]),M=vt__default.useCallback(I=>{P(I),b("error"),u?.(I);},[u]);vt__default.useEffect(()=>{if(!e){v(),b("idle"),P(null),A("");return}let I=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){b("unsupported"),P("Camera access is not supported in this browser.");return}b("starting"),P(null);try{let G=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:n}}});if(I){G.getTracks().forEach(V=>V.stop());return}if(d.current=G,w.current&&(w.current.srcObject=G,await w.current.play()),!window.BarcodeDetector){b("unsupported"),P("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}m.current=new window.BarcodeDetector({formats:r}),b("ready"),C.current=window.setInterval(async()=>{if(!(!w.current||!m.current)&&!(w.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let X=(await m.current.detect(w.current)).find(oe=>oe.rawValue);if(!X?.rawValue)return;let de={rawValue:X.rawValue,format:X.format};S(de),v(),Bm(de,f,t,s);}catch(V){M(V instanceof Error?V.message:"Failed to detect barcode.");}},p);}catch(G){M(G instanceof Error?G.message:"Unable to start camera.");}}})(),()=>{I=true,v();}},[s,n,r,t,f,e,M,p,v]);let k=()=>{let I=T.trim();if(!I)return;let D={rawValue:I,format:"manual"};S(D),Bm(D,f,t,s);};return jsxs(Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"sm",children:[jsx(DialogTitle,{sx:{fontSize:"1rem",fontWeight:900},children:o}),jsx(DialogContent,{sx:{pt:"8px !important"},children:jsxs(Stack,{spacing:2,sx:h,children:[jsx(Typography,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:a}),jsxs(Paper,{elevation:0,sx:I=>({position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:I.palette.mode==="dark"?"linear-gradient(180deg, rgba(15,23,42,0.92), rgba(2,6,23,0.96))":"linear-gradient(180deg, rgba(241,245,249,1), rgba(226,232,240,0.92))"}),children:[jsx("video",{ref:w,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),jsx(Box,{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:jsx(Box,{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:jsx(Box,{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"#38bdf8",boxShadow:"0 0 18px rgba(56,189,248,0.85)"}})})}),jsxs(Box,{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[jsx(Chip,{icon:jsx(XC,{}),label:y==="ready"?"Camera ready":y==="starting"?"Starting camera":y==="unsupported"?"Preview only":y==="error"?"Scanner error":"Idle",size:"small",color:y==="error"?"error":"primary",variant:"filled"}),R?jsx(Chip,{icon:jsx(YC,{}),label:`${R.format||"barcode"}: ${R.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),B?jsx(Alert,{severity:y==="unsupported"?"info":"warning",children:B}):null,i?jsxs(Stack,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[jsx(TextField,{fullWidth:true,label:"Barcode",placeholder:g,value:T,onChange:I=>A(I.target.value)}),jsx(Button,{variant:"contained",onClick:k,sx:{minHeight:56,px:2.5},children:l})]}):null]})}),jsx(DialogActions,{sx:{px:3,pb:2},children:jsx(Button,{onClick:t,children:c})})]})};var ok={default:"#475569",primary:"#1d4ed8",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#0369a1"},vE=({title:e,description:t,kicker:o,icon:a,badges:r=[],metrics:n=[],footer:i,children:s,selected:p=false,draggable:l=false,isDragging:c=false,swipeThreshold:g=88,startAction:f,endAction:u,dragHandleProps:h,onClick:w,onSwipe:d,sx:C})=>{let[m,y]=useState(0),[b,T]=useState(false),A=useRef(null),R=useRef(0),S=useRef(0),B=!!(f||u),P=132,v=()=>{y(0),T(false),A.current=null,R.current=0,S.current=0;},M=V=>{(V==="start"?f:u)?.onTrigger?.(),d?.(V),v();},k=V=>{!B||V.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(A.current=V.pointerId,R.current=V.clientX,S.current=V.clientX,T(true),V.currentTarget.setPointerCapture(V.pointerId));},I=V=>{if(!b||A.current!==V.pointerId)return;S.current=V.clientX;let X=S.current-R.current,de=Math.max(-P,Math.min(P,X));y(de);},D=V=>{if(!b||A.current!==V.pointerId)return;let X=S.current-R.current;if(X>=g&&f){M("start");return}if(X<=-g&&u){M("end");return}Math.abs(X)<12&&w?.(),v();},G=(V,X)=>{if(!V)return null;let de=V.backgroundColor||ok[V.tone||"default"];return jsx(Box,{sx:{position:"absolute",top:0,bottom:0,[X]:0,width:P,px:2,display:"flex",alignItems:"center",justifyContent:X==="left"?"flex-start":"flex-end",color:"#fff",background:`linear-gradient(135deg, ${de}, rgba(15,23,42,0.92))`},children:jsxs(Stack,{direction:"row",spacing:1,alignItems:"center",children:[V.icon,jsx(Typography,{sx:{fontWeight:700,fontSize:"0.95rem"},children:V.label})]})})};return jsxs(Box,{sx:{position:"relative",overflow:"hidden",borderRadius:4,...C},children:[G(f,"left"),G(u,"right"),jsx(Paper,{elevation:0,onPointerDown:k,onPointerMove:I,onPointerUp:D,onPointerCancel:v,sx:V=>({position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:p?"primary.main":"divider",background:V.palette.mode==="dark"?"linear-gradient(180deg, rgba(30,41,59,0.96), rgba(15,23,42,0.92))":"linear-gradient(180deg, #ffffff, #f8fafc)",color:"text.primary",boxShadow:p?"0 18px 42px rgba(37, 99, 235, 0.18)":"0 12px 28px rgba(15, 23, 42, 0.08)",transform:`translate3d(${m}px, 0, 0) scale(${c?.985:1})`,transition:b?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:w?"pointer":"default",opacity:c?.9:1}),children:jsxs(Stack,{spacing:1.5,children:[jsxs(Stack,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[a?jsx(Box,{sx:{mt:.25},children:a}):null,jsxs(Box,{sx:{flex:1,minWidth:0},children:[o?jsx(Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:o}):null,jsx(Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:e}),t?jsx(Typography,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:t}):null]}),l?jsx(Box,{"data-no-swipe":"true",...h,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:jsx(IconButton,{size:"small",children:jsx(tk,{})})}):null]}),r.length>0?jsx(Stack,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:r.map((V,X)=>jsx(Chip,{label:V,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},X))}):null,n.length>0?jsx(Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:n.map(V=>jsxs(Paper,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:V.label}),jsx(Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:V.value})]},V.id))}):null,s,i]})})]})};var xi=({label:e,onPress:t,emphasis:o="default"})=>jsx(Box,{component:"button",type:"button",onClick:t,sx:a=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:o==="primary"?"primary.main":"divider",background:o==="primary"?a.palette.primary.main:o==="danger"?a.palette.mode==="dark"?"rgba(239,68,68,0.18)":"rgba(239,68,68,0.10)":a.palette.mode==="dark"?"rgba(255,255,255,0.04)":"#fff",color:o==="primary"?"#fff":"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:e}),DE=({value:e,defaultValue:t="",title:o,subtitle:a,placeholder:r="0",allowDecimal:n=false,allowNegative:i=false,maxLength:s,confirmLabel:p,clearLabel:l,backspaceLabel:c,onChange:g,onSubmit:f,onClose:u,sx:h})=>{let{t:w}=ee(),[d,C]=useState(t),m=e??d,y=v=>{e===void 0&&C(v),g?.(v);},b=v=>{s&&m.length>=s||y(`${m}${v}`);},T=v=>{if(v==="00"){if(!m){y("0");return}b("00");return}b(v);},A=()=>{!n||m.includes(".")||y(m?`${m}.`:"0.");},R=()=>{if(i){if(m.startsWith("-")){y(m.slice(1));return}y(m?`-${m}`:"-");}},S=()=>{y(m.slice(0,-1));},B=()=>{y("");},P=()=>{f?.(m);};return jsx(Paper,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...h},children:jsxs(Stack,{spacing:2,children:[jsxs(Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxs(Box,{sx:{minWidth:0},children:[o?jsx(Typography,{sx:{fontSize:"1rem",fontWeight:800},children:o}):null,a?jsx(Typography,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:a}):null]}),u?jsx(IconButton,{onClick:u,size:"small",children:jsx(ik,{})}):null]}),jsx(Paper,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsx(Typography,{sx:{minHeight:38,fontSize:m?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:m?"text.primary":"text.disabled"},children:m||r})}),jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(v=>jsx(xi,{label:v,onPress:()=>T(v)},v)),jsx(xi,{label:i?"+/-":"00",onPress:i?R:()=>T("00")}),jsx(xi,{label:"0",onPress:()=>T("0")}),jsx(xi,{label:n?".":c?String(c):"DEL",onPress:n?A:S})]}),jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[jsx(Box,{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:jsxs(Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsx(nk,{}),jsx(Typography,{sx:{fontWeight:700},children:c||"DEL"})]})}),jsx(xi,{label:String(l||"CLR"),onPress:B,emphasis:"danger"}),jsx(Box,{component:"button",type:"button",onClick:P,sx:v=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:v.palette.primary.main,color:"#fff",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:jsxs(Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsx(lk,{}),jsx(Typography,{sx:{fontWeight:800},children:p||w("common.ok")})]})})]})]})})};var Nm=({touchMode:e="comfortable",sx:t,...o})=>{let a=e==="expanded";return jsx(Box,{sx:{"& .MuiPaper-root":{borderRadius:4},"& .MuiAutocomplete-root":{minWidth:{xs:"100%",md:260}},"& .MuiAutocomplete-root .MuiInputBase-root":{backgroundColor:"transparent !important"},"& .MuiInputBase-root":{minHeight:a?56:50,borderRadius:3,fontSize:a?"0.98rem":"0.92rem"},"& .MuiInputBase-input":{py:a?1.6:1.25,fontSize:a?"0.98rem":"0.92rem"},"& .MuiInputLabel-root":{fontSize:a?"0.95rem":"0.88rem"},"& .MuiButton-root":{minHeight:a?48:44,px:a?2.25:1.75,borderRadius:3,fontSize:a?"0.95rem":"0.88rem",fontWeight:700},"& .MuiIconButton-root":{width:a?40:36,height:a?40:36},"& .MuiMenuItem-root":{minHeight:a?44:38,fontSize:a?"0.95rem":"0.88rem"},"& .MuiListSubheader-root":{py:1},"& .MuiCheckbox-root":{p:a?1:.75},"& .MuiFormControlLabel-label":{fontSize:a?"0.95rem":"0.88rem"},"& .MuiDialog-paper":{borderRadius:4},"& .MuiDialogTitle-root":{fontSize:a?"1.05rem":"0.98rem",fontWeight:800},"& .MuiDialogContent-root .MuiInputBase-root":{minHeight:52},'& .MuiGrid-root > .MuiGrid-item, & .MuiGrid-root > .MuiGrid-sizeXs-1, & .MuiGrid-root > [class*="MuiGrid-grid-"]':{minWidth:0},...t},children:jsx(ma,{...o})})};var gk=(e,t,o)=>{if(o?.(t),!!t.href){if(t.href.startsWith("http://")||t.href.startsWith("https://")){window.open(t.href,"_blank");return}e.push(t.href);}},Hm=({items:e,selectedId:t,orientation:o="auto",onItemSelect:a,sx:r})=>{let n=useTheme$1(),[i,s]=useState(false);useEffect(()=>{s(true);},[]);let p=useMediaQuery("(orientation: portrait)",{noSsr:true}),l=useMediaQuery(n.breakpoints.down("md"),{noSsr:true}),c=o==="auto"?p||l?"portrait":"landscape":o,g=useRouter();return jsx(Box,{sx:{display:"grid",gridTemplateColumns:!i||c==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...r},children:e.map(f=>{let u=f.id===t,h=f.color||(u?n.palette.primary.main:n.palette.divider);return jsx(Paper,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:u?"primary.main":"divider",boxShadow:u?"0 18px 40px rgba(37, 99, 235, 0.16)":"none",bgcolor:n.palette.mode==="dark"?"rgba(30,41,59,0.6)":"background.paper"},children:jsx(Box,{component:"button",type:"button",disabled:f.disabled,onClick:()=>gk(g,f,a),sx:{width:"100%",p:2,minHeight:c==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:f.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:jsxs(Stack,{spacing:1.5,sx:{height:"100%"},children:[jsxs(Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsx(Box,{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:u?"#fff":"text.primary",background:u?h:"action.hover"},children:f.icon||jsx(Typography,{sx:{fontSize:"1rem",fontWeight:900},children:f.title.slice(0,1).toUpperCase()})}),f.badge!==void 0?jsx(Box,{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:u?"primary.main":"action.hover",color:u?"#fff":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:f.badge}):null]}),jsxs(Box,{sx:{flex:1,minWidth:0},children:[jsx(Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:f.title}),f.caption?jsx(Typography,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:f.caption}):null,f.description?jsx(Typography,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:f.description}):null]})]})})},f.id)})})};var Um=(e,t)=>t.trim()?e.reduce((o,a)=>{let r=a.title?.toLowerCase().includes(t.toLowerCase())||a.label?.toLowerCase().includes(t.toLowerCase())||a.description?.toLowerCase().includes(t.toLowerCase()),n=a.children?Um(a.children,t):[];return (r||n.length>0)&&o.push({...a,children:n.length>0?n:a.children}),o},[]):e,Pk=e=>{let t=new Set,o=a=>{a.forEach(r=>{r.children?.length&&(t.add(r.id),o(r.children));});};return o(e),t},Km=({collapsed:e=false,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light",orientation:i="auto",headerSlot:s,footerSlot:p,activeHref:l,onItemSelect:c})=>{let{t:g}=ee(),f=useTheme$1(),u=useMediaQuery("(orientation: portrait)"),h=useMediaQuery(f.breakpoints.down("md")),w=i==="auto"?u||h?"portrait":"landscape":i,d=n==="dark",C=useRouter(),m=usePathname(),[y,b]=useState(""),[T,A]=useState(new Set),R=useMemo(()=>Um(r,y),[r,y]),S=useMemo(()=>y.trim()?Pk(R):T,[T,R,y]);useEffect(()=>{e&&A(new Set);},[e]);let B=I=>I.appurl||I.href||"",P=I=>{c?.(I);let D=B(I);if(D){if(D.startsWith("http://")||D.startsWith("https://")){window.open(D,"_blank");return}C.push(D);}},v=I=>{let D=!!I.children?.length;if(e&&D){t?.();return}if(D){A(G=>{let V=new Set(G);return V.has(I.id)?V.delete(I.id):V.add(I.id),V});return}P(I);},M=I=>{let D=l||m,G=B(I);return !!(G&&D===G)},k=(I,D=0)=>{let G=!!I.children?.length,V=S.has(I.id),X=M(I);return jsx(Box,{sx:{pl:D===0?0:1.5},children:jsxs(Paper,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:X?"primary.main":"divider",bgcolor:X?"action.selected":"background.paper"},children:[jsxs(Box,{component:"button",type:"button",onClick:()=>v(I),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:[jsx(Avatar,{variant:"rounded",sx:{width:40,height:40,bgcolor:X?"primary.main":"action.hover",color:X?"#fff":"text.primary"},children:I.icon||(I.title||I.label||"?").slice(0,1).toUpperCase()}),jsxs(Box,{sx:{flex:1,minWidth:0},children:[jsx(Typography,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:I.title||I.label}),I.description?jsx(Typography,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:I.description}):null]}),G?jsx(Tk,{sx:{transform:V?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):jsx(Ik,{color:"action"})]}),G?jsx(Collapse,{in:V,children:jsx(Box,{sx:{px:1.25,pb:1.25},children:I.children?.map(de=>k(de,D+1))})}):null]})},I.id)};return e?jsx(Paper,{elevation:0,className:o,sx:{width:w==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:d?"#101828":"rgba(255,255,255,0.88)",maxHeight:a?`${a}px`:void 0,overflowY:"auto"},children:jsxs(Stack,{spacing:1,children:[jsx(IconButton,{onClick:t,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:g("navigation.expand"),children:jsx(wk,{})}),r.map(I=>jsx(IconButton,{onClick:()=>v(I),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:M(I)?"primary.main":"action.hover",color:M(I)?"#fff":"text.primary"},children:I.icon||(I.title||I.label||"?").slice(0,1).toUpperCase()},I.id))]})}):jsx(Paper,{elevation:0,className:o,sx:{width:w==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:d?"#101828":"rgba(255,255,255,0.88)",maxHeight:a?`${a}px`:void 0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxs(Stack,{spacing:1.25,sx:{flex:1,minHeight:0},children:[jsxs(Stack,{direction:"row",spacing:1,alignItems:"center",children:[jsx(TextField,{value:y,onChange:I=>b(I.target.value),placeholder:g("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:jsx(kk,{fontSize:"small",color:"action"})}}),w==="landscape"&&!e?jsx(IconButton,{onClick:t,sx:{bgcolor:"action.hover"},children:jsx(Sk,{})}):null]}),s,jsx(Box,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:R.length>0?R.map(I=>k(I)):jsx(Typography,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:g("navigation.noMatch")})}),p]})})};var Jm=(e,t)=>{let o=t[e.id];if(e.render)return e.render(o,t);if(o==null||o==="")return "--";if(e.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)},Ek=e=>vt__default.isValidElement(e)?jsx(Box,{sx:{display:"inline-flex",alignItems:"center"},children:e}):jsx(Typography,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:e}),Fk=(e,t)=>{let o=t[e.id];if(o==null||o==="")return "--";if(e.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)},Lk=({summaryRow:e,visibleColumns:t,columns:o})=>{let a=o.filter(r=>t.includes(r.id)&&e[r.id]!=="");return a.length===0?null:jsx(Paper,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxs(Stack,{spacing:1,children:[jsx(Typography,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:a.map(r=>jsxs(Paper,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:r.label}),jsx(Typography,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:e[r.id]})]},`summary-${r.id}`))})]})})},zk=e=>{let{t}=ee(),o=useTheme$1(),{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:s,actions:p,extraTools:l,fitContainer:c=false,fullWidth:g=false,maxHeight:f,loading:u=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:w,filterConfig:d,rowKey:C,tableKey:m="default",graphReport:y,quickCreate:b,quickEdit:T,quickDelete:A,serviceUrl:R,orientation:S="auto",cardTitleField:B,cardSubtitleFields:P,toolbarSlot:v,emptyState:M,rowHeight:k="comfortable",cardActionSlot:I,renderCardFooter:D,onRowClick:G}=e,V=a||t("table.title.default"),X=useMediaQuery("(orientation: portrait)"),de=useMediaQuery(o.breakpoints.down("md")),oe=S==="auto"?X||de?"portrait":"landscape":S,{columns:re,filterText:_,setFilterText:qe,visibleColumns:it,showSummary:Y,setShowSummary:le,summaryColumns:Be,grouping:Ee,setGrouping:Ue,expandedGroups:ot,groupAnchorEl:Fe,setGroupAnchorEl:_e,summaryAnchorEl:ht,setSummaryAnchorEl:j,anchorEl:pe,setAnchorEl:De,contextMenu:Le,sortedAndFilteredRows:We,summaryRow:U,visibleRows:ye,page:be,setPage:Pe,rowsPerPage:et,setRowsPerPage:Ge,totalDisplayCount:Tt,setSelected:ro,handleClick:Yt,toggleSummaryColumn:Ht,handleExport:Qt,handleCloseContextMenu:ze,toggleColumnVisibility:Ce,toggleGroupExpand:L,toggleGroupField:$,handleExpandGroupRecursively:Z,handleCollapseGroupRecursively:te,handleLayoutLoad:ke,handleVariantLoad:z,handleLayoutSave:O,effectiveAppId:N,currentLayoutData:ne,currentLayoutId:se,layoutIdToLoad:we,graphReportOpen:ae,handleOpenGraphReport:Me,handleCloseGraphReport:Te}=on(e),Ne=y?.enabled??false,Ie=Ne&&(y?.interaction?.enabled??true),Re=tl(),Ve=C||"id",It=vt__default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:alpha(o.palette.divider,o.palette.mode==="dark"?.55:.3),bgcolor:o.palette.mode==="dark"?alpha(o.palette.common.white,.06):alpha(o.palette.background.paper,.92),color:o.palette.text.primary,"& .MuiChip-label":{px:1.05}}),[o]),xo=vt__default.useMemo(()=>({...It,borderColor:alpha(o.palette.primary.main,o.palette.mode==="dark"?.42:.24),bgcolor:o.palette.mode==="dark"?alpha(o.palette.primary.main,.16):alpha(o.palette.primary.main,.08)}),[It,o]),yt=vt__default.useMemo(()=>{let W=new Set(i);return We.filter(ie=>W.has(ie?.[Ve]))},[Ve,i,We]),At=yt.length===1?yt[0]:null,vo=!!b?.enabled,Ra=!!T?.enabled,Br=!!A?.enabled,Do=b?.fields,no=b?.excludeFields||[],er=b?.initialValues||{},oa=T?.fields,Kt=T?.excludeFields||[],io=T?.editableFields||[],Wt=T?.nonEditableFields||[],je=T?.primaryKeys?.length?T.primaryKeys:[Ve],[aa,Go]=vt__default.useState(false),[ra,tr]=vt__default.useState(false),[Uo,or]=vt__default.useState({}),[ar,Ko]=vt__default.useState(false),[na,Da]=vt__default.useState(false),[qt,Mo]=vt__default.useState({}),[ia,Co]=vt__default.useState(false),[qo,rr]=vt__default.useState(false),Er=u||ra||na||qo,Ma=vt__default.useMemo(()=>{let W=[...re];if(Array.isArray(Do)&&Do.length>0){let ie=new Set(Do);W=W.filter(q=>ie.has(q.id));}if(no.length>0){let ie=new Set(no);W=W.filter(q=>!ie.has(q.id));}return W.filter(ie=>!!ie?.id)},[re,no,Do]),nr=vt__default.useMemo(()=>{let W=[...re];if(Array.isArray(oa)&&oa.length>0){let ie=new Set(oa);W=W.filter(q=>ie.has(q.id));}if(Kt.length>0){let ie=new Set(Kt);W=W.filter(q=>!ie.has(q.id));}return W.filter(ie=>!!ie?.id)},[re,Kt,oa]),la=vt__default.useMemo(()=>new Set(je),[je]),Jt=vt__default.useMemo(()=>new Set(io),[io]),Ao=vt__default.useMemo(()=>new Set(Wt),[Wt]),Fr=vt__default.useCallback(W=>Jt.size>0?Jt.has(W):!(Ao.has(W)||la.has(W)),[Jt,Ao,la]);vt__default.useEffect(()=>{!ae&&Re.hasActiveFilters&&Re.clearAll();},[Re,ae]);let ir=()=>{let W={};Ma.forEach(ie=>{W[ie.id]=er[ie.id]??"";}),or(W),Go(true);},Lr=(W,ie)=>{or(q=>({...q,[W]:ie}));},zr=async()=>{if(!b?.onSubmit){Go(false);return}try{tr(!0),await b.onSubmit(Uo),Go(!1);}finally{tr(false);}},Nr=()=>{if(!At)return;let W={};nr.forEach(q=>{W[q.id]=At[q.id]??"";});let ie=T?.getInitialValues?{...W,...T.getInitialValues(At)}:W;Mo(ie),Ko(true);},lo=(W,ie)=>{Mo(q=>({...q,[W]:ie}));},Vr=async()=>{if(At){if(!T?.onSubmit){Ko(false);return}try{Da(!0),await T.onSubmit(qt,At),Ko(!1);}finally{Da(false);}}},Or=()=>{yt.length!==0&&Co(true);},lr=async()=>{if(yt.length===0){Co(false);return}if(!A?.onConfirm){Co(false),ro([]),s?.([]);return}try{rr(!0),await A.onConfirm(yt),Co(!1),ro([]),s?.([]);}finally{rr(false);}},sa=We,{fieldMapping:Aa}=Qr({rows:sa,config:{...y,title:y?.title||`${V} ${t("graph.reportTitle")}`}}),Ba=vt__default.useMemo(()=>Ie?Re.applyRows(sa,Aa):sa,[Aa,Re,Ie,sa]),{model:x}=Qr({rows:Ba,config:{...y,title:y?.title||`${V} ${t("graph.reportTitle")}`,fieldMapping:Aa}}),E=x.table.columns.map(W=>({id:W.id,label:W.label,align:W.align||"left",minWidth:120,numeric:W.align==="right"})),F=N?jsx(pl,{appId:N,tableKey:m,currentLayoutData:ne,onLayoutLoad:ke,targetLayoutId:we,activeLayoutId:se,serviceUrl:R??d?.serviceUrl}):null,K=re.filter(W=>it.includes(W.id)),ce=K.find(W=>W.id===B)||K[0],Se=P?.map(W=>K.find(ie=>ie.id===W)).filter(Boolean)||K.filter(W=>W.id!==ce?.id).slice(0,oe==="portrait"?2:3),H=K.filter(W=>W.id!==ce?.id&&!Se.some(ie=>ie.id===W.id)),J=[v,l].filter(Boolean),Q=jsxs(Fragment,{children:[jsx(Wr,{groupAnchorEl:Fe,setGroupAnchorEl:_e,grouping:Ee,setGrouping:Ue,columns:re,toggleGroupField:$}),jsx($r,{anchorEl:pe,setAnchorEl:De,columns:re,visibleColumns:it,toggleColumnVisibility:Ce}),jsx(zi,{anchorEl:ht,setAnchorEl:j,showSummary:Y,setShowSummary:le,columns:re,summaryColumns:Be,toggleSummaryColumn:Ht}),jsx(Ni,{contextMenu:Le,handleCloseContextMenu:ze,columns:re,visibleColumns:it,toggleColumnVisibility:Ce})]}),at=(W,ie,q)=>{let ge=i.includes(ie),Ze=oe==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",_o=q%2===0?alpha(o.palette.primary.main,o.palette.mode==="dark"?.09:.04):alpha(o.palette.primary.main,o.palette.mode==="dark"?.05:.022),ef=alpha(o.palette.divider,.22);return jsx(Paper,{elevation:0,onClick:()=>{Yt({},W),G?.(W);},sx:{p:k==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:ge?alpha(o.palette.primary.main,.38):ef,background:ge?`linear-gradient(135deg, ${alpha(o.palette.primary.main,.13)}, ${alpha(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${_o}, ${alpha(o.palette.primary.main,.015)})`,boxShadow:ge?`0 12px 30px ${alpha(o.palette.primary.main,.2)}`:`0 3px 10px ${alpha(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:ge?o.palette.primary.main:q%2===0?alpha(o.palette.primary.main,.26):alpha(o.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${alpha(o.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:jsxs(Stack,{spacing:1.25,children:[jsxs(Stack,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[n?jsx(Checkbox,{checked:ge,onClick:so=>so.stopPropagation(),onChange:()=>Yt({},W),sx:{mt:-0.6,ml:-0.6}}):null,jsxs(Box,{sx:{flex:1,minWidth:0},children:[ce?jsx(Typography,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:Jm(ce,W)}):null,Se.length>0?jsx(Stack,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Se.map(so=>jsx(Chip,{label:`${so.label}: ${Fk(so,W)}`,size:"small",variant:"outlined",sx:It},`${ie}-${so.id}`))}):null]}),I?jsx(Box,{onClick:so=>so.stopPropagation(),children:I(W)}):null]}),H.length>0?jsx(Box,{sx:{display:"grid",gridTemplateColumns:Ze,gap:1},children:H.map(so=>jsxs(Paper,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:o.palette.mode==="dark"?alpha(o.palette.background.default,.7):alpha(o.palette.background.paper,.92),border:"0.1px solid",borderColor:alpha(o.palette.divider,.24)},children:[jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:so.label}),Ek(Jm(so,W))]},`${ie}-${so.id}-detail`))}):null,D?jsxs(Fragment,{children:[jsx(Divider,{}),jsx(Box,{onClick:so=>so.stopPropagation(),children:D(W)})]}):null]})},ie)};return jsxs(Box,{sx:{width:g?"100%":"auto",mb:c?0:2,...c?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[d?jsx(Box,{sx:{mb:2},children:jsx(Nm,{...d,onVariantLoad:W=>{z(W),d.onVariantLoad?.(W);},appId:d.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:ne}],currentLayoutId:se,layoutRefs:[{tableKey:m,layoutId:se}],variantService:d.variantService,serviceUrl:R??d.serviceUrl,touchMode:oe==="portrait"?"expanded":"comfortable"})}):null,jsxs(Paper,{sx:{width:g?"100%":"auto",mb:c?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":Er?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, rgba(25, 118, 210, 0) 0%, rgba(25, 118, 210, 0.25) 25%, rgba(25, 118, 210, 1) 50%, rgba(25, 118, 210, 0.25) 75%, rgba(25, 118, 210, 0) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...f?{height:f}:c?{flex:1,minHeight:0,height:"100%"}:{}},children:[r?jsx(Box,{sx:{"& .MuiToolbar-root":{minHeight:60,alignItems:{xs:"flex-start",md:"center"},flexWrap:"wrap",rowGap:1,columnGap:1},"& .MuiToolbar-root > :nth-of-type(1)":{width:{xs:"100%",md:"auto"},"& .MuiTextField-root":{width:{xs:"100%",md:300}}},"& .MuiToolbar-root > :nth-of-type(2)":{flexShrink:0},"& .MuiToolbar-root > :nth-of-type(3)":{display:{xs:"none",md:"block"}},"& .MuiToolbar-root > :nth-of-type(4)":{ml:"auto",justifyContent:"flex-end",flexWrap:"wrap"},"& .MuiInputBase-root":{minHeight:46},"& .MuiIconButton-root":{width:40,height:40},"& .MuiTypography-root":{fontSize:"0.9rem"},"& .MuiButtonBase-root":{borderRadius:2.5}},children:jsx(Ai,{filterText:_,setFilterText:qe,onRowsPerPageChange:Ge,rowsPerPage:et,rowsPerPageOptions:h,page:be,count:Tt,onPageChange:Pe,actions:p,extraTools:J,grouping:Ee,setGroupAnchorEl:_e,showSummary:Y,setShowSummary:le,setAnchorEl:De,setSummaryAnchorEl:j,handleExport:Qt,showCreateButton:vo,onOpenCreateDialog:ir,showEditButton:Ra,onOpenEditDialog:Nr,editDisabled:yt.length!==1,showDeleteButton:Br,onOpenDeleteConfirm:Or,deleteDisabled:yt.length===0,onLayoutSave:w||d?.variantService&&d?.appId?O:void 0,loading:u,layoutManager:F,onOpenGraphReport:Ne?Me:void 0})}):null,jsx(Box,{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:jsxs(Stack,{spacing:1.25,children:[ye.length===0&&!u?M||jsx(Paper,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:t("common.noData")})}):null,ye.map((W,ie)=>{if(W.type==="group"){let Ze=ot.has(W.id);return jsx(Paper,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxs(Box,{component:"button",type:"button",onClick:()=>L(W.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:[Ze?jsx(Tk,{}):jsx(Ik,{}),jsxs(Box,{sx:{flex:1,minWidth:0},children:[jsxs(Typography,{sx:{fontSize:"0.94rem",fontWeight:800},children:[W.field,": ",W.value]}),jsxs(Typography,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[W.count," records"]})]}),Ee.length>1&&W.level<Ee.length-1?jsxs(Stack,{direction:"row",spacing:.5,children:[jsx(Chip,{size:"small",label:t("table.group.expandAll"),onClick:_o=>{_o.stopPropagation(),Z(W.id);},sx:xo}),jsx(Chip,{size:"small",label:t("table.group.collapseAll"),onClick:_o=>{_o.stopPropagation(),te(W.id);},sx:xo})]}):null]})},W.id)}let q=W.data||W,ge=W.id||q[Ve]||ie;return at(q,ge,ie)}),Y?jsx(Lk,{summaryRow:U,visibleColumns:it,columns:re}):null,u?jsx(Typography,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:t("common.loading")}):null]})})]}),vo?jsxs(Dialog,{open:aa,onClose:()=>!ra&&Go(false),fullWidth:true,maxWidth:"sm",children:[jsx(DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:b?.title||t("quickCreate.createWithTitle",{title:V})}),jsx(DialogContent,{sx:{pt:"8px !important"},children:jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Ma.map(W=>{let ie=W.type==="number"||W.numeric?"number":W.type==="date"?"date":"text";return jsx(TextField,{label:W.label||W.id,value:Uo[W.id]??"",onChange:q=>Lr(W.id,q.target.value),type:ie,fullWidth:true,InputLabelProps:{shrink:ie==="date"?true:void 0}},`quick-create-${W.id}`)}),b?.description?jsx(Alert,{severity:"info",children:b.description}):null]})}),jsxs(DialogActions,{sx:{px:3,pb:2},children:[jsx(Button,{onClick:()=>Go(false),disabled:ra,children:b?.cancelLabel||t("common.cancel")}),jsx(Button,{onClick:zr,variant:"contained",disabled:ra,children:b?.submitLabel||t("common.save")})]})]}):null,Ra?jsxs(Dialog,{open:ar,onClose:()=>!na&&Ko(false),fullWidth:true,maxWidth:"sm",children:[jsx(DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:T?.title||t("quickEdit.editWithTitle",{title:V})}),jsx(DialogContent,{sx:{pt:"8px !important"},children:jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[nr.map(W=>{let ie=W.type==="number"||W.numeric?"number":W.type==="date"?"date":"text";return jsx(TextField,{label:W.label||W.id,value:qt[W.id]??"",onChange:q=>lo(W.id,q.target.value),type:ie,disabled:!Fr(W.id),fullWidth:true,InputLabelProps:{shrink:ie==="date"?true:void 0}},`quick-edit-${W.id}`)}),T?.description?jsx(Alert,{severity:"info",children:T.description}):null]})}),jsxs(DialogActions,{sx:{px:3,pb:2},children:[jsx(Button,{onClick:()=>Ko(false),disabled:na,children:T?.cancelLabel||t("common.cancel")}),jsx(Button,{onClick:Vr,variant:"contained",disabled:na||!At,children:T?.submitLabel||t("common.save")})]})]}):null,Br?jsx(An,{open:ia,type:"warning",title:A?.title||t("quickDelete.confirmTitle"),message:A?.message||(yt.length>1?t("quickDelete.confirmMessageMultiple",{count:yt.length}):t("quickDelete.confirmMessageSingle")),confirmText:A?.confirmText||t("common.delete"),cancelText:A?.cancelText||t("common.cancel"),onClose:()=>!qo&&Co(false),onConfirm:lr}):null,Q,Ne?jsx(Ji,{open:ae,onClose:Te,model:x,aiAssistant:y?.aiAssistant,interaction:Ie?{enabled:true,filters:Re.filters,fieldMapping:Aa,onPrimaryDimensionClick:W=>Re.setFilter("primaryDimension",W),onSecondaryDimensionClick:W=>Re.setFilter("secondaryDimension",W),onStatusClick:W=>Re.setFilter("status",W),onClearFilter:Re.clearFilter,onClearAll:Re.clearAll}:void 0,tableContent:jsx(zk,{appId:N||"graph-report-internal",title:t("graph.dataBody"),columns:E,rows:x.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var TF=({appTitle:e,children:t,menuData:o=[],workloadItems:a=[],workloadSelectedId:r,showNavigation:n=true,showWorkloadNav:i=true,orientation:s="auto",logo:p,headerSlot:l,actionSlot:c,portraitBottomSlot:g,contentSx:f,containerSx:u,user:h,onSearch:w,defaultNavigationOpen:d,navOpen:C,onNavOpenChange:m,onWorkloadSelect:y,locale:b="en",localeLabel:T,localeOptions:A,onLocaleChange:R,onUserSetting:S,onUserLogout:B,userMenuItems:P,leftHeaderSlot:v,rightHeaderSlot:M})=>{let k="orbcafe:page-layout-mode",[I,D]=useState("system"),[G,V]=useState("light"),[X,de]=useState(false),[oe,re]=useState(false),_=I==="system"?oe?G:"light":I;useEffect(()=>{de(true);},[]),useEffect(()=>{try{let Le=window.localStorage.getItem(k);(Le==="light"||Le==="dark"||Le==="system")&&D(Le);}catch{}re(true);let pe=window.matchMedia("(prefers-color-scheme: dark)"),De=()=>{V(pe.matches?"dark":"light");};return De(),pe.addEventListener("change",De),()=>pe.removeEventListener("change",De)},[]),useEffect(()=>{if(oe)try{window.localStorage.setItem(k,I);}catch{}},[oe,I]),useEffect(()=>{_==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[_]);let qe=useMemo(()=>createTheme$1({palette:_==="dark"?{mode:"dark",primary:{main:"#93c5fd"},background:{default:"#060913",paper:"#101826"},text:{primary:"#f8fafc",secondary:"rgba(226,232,240,0.74)"},divider:"rgba(148,163,184,0.18)",action:{hover:"rgba(148,163,184,0.10)",selected:"rgba(59,130,246,0.18)"}}:{mode:"light",background:{default:"#eef3f8",paper:"#ffffff"}},components:{MuiCssBaseline:{styleOverrides:{body:{backgroundColor:_==="dark"?"#060913":"#eef3f8"}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"}}}}}),[_]),it=useMediaQuery("(orientation: portrait)"),Y=useMediaQuery(qe.breakpoints.down("md")),le=s==="auto"?!X||it||Y?"portrait":"landscape":s,[Be,Ee]=useState({landscape:d??true,portrait:false}),Ue=Be[le],ot=C??Ue,Fe=pe=>{C===void 0&&Ee(De=>({...De,[le]:pe})),m?.(pe);},_e=jsxs(Stack,{direction:"row",spacing:1,alignItems:"center",children:[!X||n&&le==="portrait"?jsx(IconButton,{onClick:()=>Fe(!ot),sx:{bgcolor:"action.hover"},children:jsx(wk,{})}):null,v]}),ht=jsxs(Stack,{direction:"row",spacing:1,alignItems:"center",children:[c,M]}),j=jsx(Km,{collapsed:le==="landscape"?!ot:false,onToggle:()=>Fe(!ot),menuData:o,orientation:le,colorMode:_,maxHeight:le==="landscape"?900:void 0});return jsx(ThemeProvider$1,{theme:qe,children:jsx(Di,{locale:b,children:jsxs(Box,{sx:[pe=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:pe.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":pe.palette.background.default}),...Array.isArray(u)?u:[u]],children:[jsx(Al,{appTitle:e,logo:p===void 0?null:p,mode:I,onToggleMode:()=>D(pe=>pe==="system"?"dark":pe==="dark"?"light":"system"),locale:b,localeLabel:T,localeOptions:A,onLocaleChange:R,user:h,onUserSetting:S,onUserLogout:B,userMenuItems:P,onSearch:w,leftSlot:_e,rightSlot:ht}),l?jsx(Box,{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:l}):null,jsxs(Box,{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[X&&n&&le==="landscape"?jsx(Box,{sx:{p:1.5,pr:0,flexShrink:0},children:j}):null,!X||n&&le==="portrait"?jsx(Drawer,{open:ot,onClose:()=>Fe(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:j}):null,jsx(Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...f},children:jsxs(Stack,{spacing:1.5,children:[i&&a.length>0?jsx(Hm,{items:a,selectedId:r,orientation:le,onItemSelect:y}):null,jsx(Paper,{elevation:0,sx:{flex:1,minHeight:le==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:qe.palette.mode==="dark"?"rgba(15,23,42,0.72)":"rgba(255,255,255,0.72)",backdropFilter:"blur(12px)",color:"text.primary"},children:t})]})})]}),le==="portrait"&&g?jsxs(Fragment,{children:[jsx(Divider,{}),jsx(Box,{sx:{p:1.5},children:g})]}):null]})})})};var og=qk(()=>import('./COrbCanvas-EGX5NO3Y.mjs').then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsx("div",{className:"h-full w-full bg-transparent"})});function td({isRecording:e}){return jsx(AnimatePresence,{children:e&&jsx(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:jsxs("div",{className:"relative flex h-full w-full items-center justify-center",children:[jsx("div",{className:"absolute inset-0",children:jsx(og,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),jsx("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:jsx(og,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var MF=td;function as({onTextUpdate:e,onComplete:t,onError:o,wsUrl:a="ws://localhost:8765",silenceThresholdMs:r=2e3,minVolumeRms:n=.015}){let[i,s]=useState(false),p=useRef(null),l=useRef(null),c=useRef(null),g=useRef(null),f=useRef(null),u=useRef(0),h=useRef(false),w=useRef(false),d=useCallback(()=>{p.current&&(p.current.close(),p.current=null),g.current&&(g.current.disconnect(),g.current=null),f.current&&(f.current.disconnect(),f.current=null),l.current&&(l.current.getTracks().forEach(y=>y.stop()),l.current=null),c.current&&(c.current.close(),c.current=null),w.current=false,s(false);},[]),C=useCallback(()=>{h.current||(h.current=true,p.current?.readyState===WebSocket.OPEN&&p.current.send(JSON.stringify({type:"stop"})),setTimeout(d,500));},[d]),m=useCallback(async()=>{if(!(i||w.current)){w.current=true,h.current=false,u.current=Date.now();try{let y=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});l.current=y;let b=new WebSocket(a);p.current=b,b.onopen=()=>{s(!0),w.current=!1;},b.onmessage=B=>{try{let P=JSON.parse(B.data);if(P.type==="recognition")P.is_final?t(P.text):e?.(P.text);else if(P.type==="error"){let v=P.message||"Voice recognition error";o?.(v),C();}}catch{o?.("Failed to parse voice message");}},b.onerror=()=>{o?.("Voice service connection failed"),d();},b.onclose=()=>{d();};let T=window.AudioContext||window.webkitAudioContext;if(!T)throw new Error("AudioContext is not supported in this browser");let A=new T({sampleRate:16e3});c.current=A;let R=A.createMediaStreamSource(y);f.current=R;let S=A.createScriptProcessor(4096,1,1);g.current=S,S.onaudioprocess=B=>{if(p.current?.readyState!==WebSocket.OPEN)return;let P=B.inputBuffer.getChannelData(0),v=0;for(let I=0;I<P.length;I+=1)v+=P[I]*P[I];if(Math.sqrt(v/P.length)>n)u.current=Date.now();else if(Date.now()-u.current>r&&!h.current){C();return}let k=new Int16Array(P.length);for(let I=0;I<P.length;I+=1){let D=Math.max(-1,Math.min(1,P[I]));k[I]=D<0?D*32768:D*32767;}p.current.send(k.buffer);},R.connect(S),S.connect(A.destination);}catch{o?.("Cannot access microphone"),d();}}},[d,i,n,t,o,e,r,C,a]);return useEffect(()=>d,[d]),{isRecording:i,startRecording:m,stopRecording:C}}var rg=createContext(null);function oS(e){if(!e||!(e instanceof HTMLElement))return false;let t=e.tagName;return !!(t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable||e.closest('[data-voice-hotkey-ignore="true"]'))}function aS({children:e,onVoiceSubmit:t,onVoicePartial:o,onVoiceError:a,longPressMs:r=200,disableSpaceTrigger:n=false,ignoreWhenFocusedInput:i=true,renderOverlay:s=true,wsUrl:p,silenceThresholdMs:l,minVolumeRms:c}){let[g,f]=useState(false),[u,h]=useState(false),w=useRef(null),d=useRef(false),C=useRef(false),m=useCallback(()=>{C.current=false,f(false);},[]),{isRecording:y,startRecording:b,stopRecording:T}=as({wsUrl:p,silenceThresholdMs:l,minVolumeRms:c,onTextUpdate:B=>{o?.(B);},onComplete:async B=>{try{B.trim()&&(h(!0),await t(B.trim()));}catch(P){let v=P instanceof Error?P.message:"Failed to process voice command";a?.(v);}finally{h(!1),m();}},onError:B=>{a?.(B),h(!1),d.current||m();}}),A=useCallback(async()=>{C.current=false,await b();},[b]),R=useCallback(()=>{T();},[T]);useEffect(()=>{if(n)return;let B=v=>{v.isComposing||(v.code==="Space"||v.key===" ")&&(d.current||v.repeat||i&&oS(document.activeElement)||(d.current=true,v.preventDefault(),w.current=setTimeout(()=>{C.current=true,f(true),b();},r)));},P=v=>{(v.code==="Space"||v.key===" ")&&(w.current&&(clearTimeout(w.current),w.current=null),d.current=false,C.current&&(v.preventDefault(),f(false),T()));};return window.addEventListener("keydown",B),window.addEventListener("keyup",P),()=>{window.removeEventListener("keydown",B),window.removeEventListener("keyup",P),w.current&&(clearTimeout(w.current),w.current=null);}},[n,i,r,b,T]);let S=useMemo(()=>({isRecording:y,isHotkeyRecording:g,isSubmitting:u,startRecording:A,stopRecording:R}),[g,y,u,A,R]);return jsxs(rg.Provider,{value:S,children:[s?jsx(td,{isRecording:g}):null,e]})}function rS(){let e=useContext(rg);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var VF=aS,OF=rS;function He(...e){return twMerge(clsx(e))}var pS=({content:e,theme:t="light",size:o="base",defaultExpanded:a=false})=>{let[r,n]=useState(a),i=useMemo(()=>`${(o==="sm"?14:o==="lg"?18:16)-2}px`,[o]);return jsxs("div",{className:`my-6 rounded-lg overflow-hidden transition-all duration-200 ${t==="dark"?"bg-gray-800":"bg-white"}`,style:{border:`0.5px solid ${t==="dark"?"#4b5563":"#d1d5db"}`},children:[jsxs("div",{className:`px-4 py-3 cursor-pointer flex items-center justify-between transition-colors duration-200 ${t==="dark"?"bg-gray-700 hover:bg-gray-650":"bg-gray-50 hover:bg-gray-100"}`,style:{borderBottom:`0.5px solid ${t==="dark"?"#4b5563":"#e5e7eb"}`},onClick:()=>n(!r),children:[jsxs("span",{className:"flex items-center",children:[jsx("span",{className:"mr-2",children:"\u{1F914}"}),jsx("span",{className:`font-medium ${t==="dark"?"text-gray-300":"text-gray-700"}`,style:{fontSize:o==="sm"?"14px":o==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),jsx("svg",{className:`w-4 h-4 transition-transform duration-200 ${r?"rotate-180":""} ${t==="dark"?"text-gray-400":"text-gray-500"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),r&&jsx("div",{className:`p-4 whitespace-pre-wrap italic font-light ${t==="dark"?"text-gray-400":"text-gray-600"}`,style:{fontSize:i,lineHeight:"1.3 !important"},children:e})]})},ng=pS;var xS=({content:e,language:t="text",isStreaming:o=false,className:a=""})=>{let{theme:r}=useTheme$2(),[n,i]=useState(false),s=async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3);}catch(l){console.error("\u590D\u5236\u5931\u8D25:",l);}},p=r==="dark"?oneDark:oneLight;return jsxs("div",{className:He("rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 my-4",a),children:[jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:[jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-300 uppercase",children:t}),jsx("button",{onClick:s,className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",disabled:o,title:n?"Copied":"Copy code",children:n?jsx(Check,{size:14,className:"text-green-500"}):jsx(Clipboard,{size:14,className:"text-gray-500 dark:text-gray-400"})})]}),jsx("div",{className:"text-sm",children:jsx(Prism,{language:t,style:p,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:r==="dark"?"#1f2937":"#ffffff"},wrapLongLines:true,children:e})})]})},lg=xS;var SS=({content:e,isLoading:t,className:o="",style:a})=>{let r=useRef(null),[n,i]=useState(false),[s,p]=useState(null),{theme:l}=useTheme$2();return useEffect(()=>{let c=async()=>{if(!(!e.trim()||!r.current)){i(true),p(null);try{cg.initialize({startOnLoad:!1,theme:l==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit"});let f=`mermaid-${Math.random().toString(36).substr(2,9)}`,u=e.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:h}=await cg.render(f,u);r.current&&(r.current.innerHTML=h);}catch(f){console.error("Mermaid render failed:",f),p(f instanceof Error?f.message:"Render failed"),r.current&&(r.current.innerText=e);}finally{i(false);}}},g=setTimeout(()=>{c();},100);return ()=>clearTimeout(g)},[e,l]),t||n?jsx("div",{className:`mermaid-block loading ${o}`,style:a,children:jsxs("div",{className:"flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700",children:[jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500 mr-2"}),jsx("span",{className:"text-sm text-gray-500",children:"Generating Diagram..."})]})}):s?jsxs("div",{className:"p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded text-red-600 dark:text-red-400 text-sm overflow-auto",children:[jsx("p",{className:"font-semibold mb-2",children:"Mermaid Error:"}),jsx("pre",{children:s}),jsx("pre",{className:"mt-4 text-xs text-gray-500",children:e})]}):jsx("div",{className:`mermaid-block overflow-x-auto ${o}`,style:a,ref:r})},pg=SS;var DS=({title:e="\u53D1\u751F\u9519\u8BEF",content:t,errorCode:o,stack:a,icon:r,closable:n=true,onClose:i,onRetry:s,className:p="",...l})=>{let[c,g]=useState(false),[f,u]=useState(false),h=async()=>{if(s){u(true);try{await s();}catch(w){console.error("\u91CD\u8BD5\u5931\u8D25:",w);}finally{u(false);}}};return jsxs("div",{className:`relative w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${p}`,...l,children:[jsxs("div",{className:"flex p-4 border-l-4 border-l-red-500 bg-red-50 dark:bg-red-900/10",children:[jsx("div",{className:"flex-shrink-0 mr-3 text-red-500 mt-0.5",children:r||jsx(AlertCircle,{className:"w-5 h-5"})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsx("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300",children:o})]}),t&&jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3 leading-relaxed",children:typeof t=="string"?jsx("p",{className:"whitespace-pre-wrap",children:t}):t}),(s||a)&&jsxs("div",{className:"flex items-center space-x-4 mt-2",children:[s&&jsxs("button",{onClick:h,disabled:f,className:"flex items-center text-xs font-medium text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 transition-colors disabled:opacity-50",children:[jsx(RotateCw,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),a&&jsxs("button",{onClick:()=>g(!c),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 transition-colors",children:[c?jsx(ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsx(ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),c?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),n&&i&&jsx("button",{onClick:i,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors self-start",children:jsx(X,{className:"w-4 h-4"})})]}),a&&c&&jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 border-t border-gray-100 dark:border-gray-800",children:jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto whitespace-pre-wrap p-2 bg-white dark:bg-gray-900 rounded border border-gray-200 dark:border-gray-800",children:a})})]})},rs=DS;var LS=({title:e="\u8B66\u544A",content:t,warningType:o,severity:a="warning",warnings:r=[],icon:n,closable:i=true,onClose:s,onConfirm:p,actionText:l,className:c="",...g})=>{let f=()=>{switch(a){case "info":return {borderLeftColor:"border-l-blue-500",iconColor:"text-blue-500",bgColor:"bg-blue-50 dark:bg-blue-900/10"};case "error":return {borderLeftColor:"border-l-red-500",iconColor:"text-red-500",bgColor:"bg-red-50 dark:bg-red-900/10"};case "success":return {borderLeftColor:"border-l-green-500",iconColor:"text-green-500",bgColor:"bg-green-50 dark:bg-green-900/10"};default:return {borderLeftColor:"border-l-yellow-500",iconColor:"text-yellow-500",bgColor:"bg-yellow-50 dark:bg-yellow-900/10"}}},u=()=>{switch(a){case "info":return jsx(Info,{className:"w-5 h-5"});case "error":return jsx(XCircle,{className:"w-5 h-5"});case "success":return jsx(CheckCircle,{className:"w-5 h-5"});default:return jsx(AlertTriangle,{className:"w-5 h-5"})}},h=f();return jsxs("div",{className:`relative w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${c}`,...g,children:[jsxs("div",{className:`flex p-4 border-l-4 ${h.borderLeftColor} ${h.bgColor}`,children:[jsx("div",{className:`flex-shrink-0 mr-3 ${h.iconColor}`,children:n||u()}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsx("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400",children:o})]}),t&&jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:t}),r&&r.length>0&&jsx("ul",{className:"mt-2 space-y-1",children:r.map((w,d)=>jsxs("li",{className:"flex items-start text-sm text-gray-600 dark:text-gray-300",children:[jsx("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-gray-400 dark:bg-gray-500 flex-shrink-0"}),jsx("span",{children:w})]},d))})]}),i&&s&&jsx("button",{onClick:s,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:jsx(X,{className:"w-4 h-4"})})]}),p&&jsx("div",{className:"bg-gray-50 dark:bg-gray-800/50 px-4 py-3 flex justify-end border-t border-gray-100 dark:border-gray-800",children:jsx("button",{onClick:p,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:l||"\u786E\u8BA4"})})]})},ns=LS;var OS=({title:e="\u76F8\u5173\u63A8\u8350",content:t,suggestions:o,onSuggestionClick:a,maxDisplay:r=5,icon:n,closable:i=false,onClose:s,className:p="",...l})=>{let[c,g]=useState(false),[f,u]=useState(""),[h,w]=useState(false),d=useMemo(()=>f.trim()?o.filter(y=>y.toLowerCase().includes(f.toLowerCase())):o,[o,f]),C=useMemo(()=>c?d:d.slice(0,r),[d,c,r]),m=y=>{a?.(y);};return !o||o.length===0?null:jsxs("div",{className:`w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${p}`,...l,children:[jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-blue-50/30 dark:bg-blue-900/10",children:[jsxs("div",{className:"flex items-center space-x-2.5",children:[jsx("div",{className:"text-blue-500 flex-shrink-0",children:n||jsx(Lightbulb,{className:"w-5 h-5"})}),jsxs("div",{className:"flex flex-col",children:[jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 leading-tight",children:e}),t&&jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]})]}),jsxs("div",{className:"flex items-center space-x-1",children:[o.length>3&&jsx("button",{onClick:()=>w(!h),className:`p-1.5 rounded-md transition-colors ${h?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800"}`,title:h?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:jsx(Search,{className:"w-4 h-4"})}),i&&s&&jsx("button",{onClick:s,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",title:"\u5173\u95ED",children:jsx(X,{className:"w-4 h-4"})})]})]}),h&&jsx("div",{className:"px-4 py-2 border-b border-gray-100 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/50",children:jsxs("div",{className:"relative",children:[jsx("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:f,onChange:y=>u(y.target.value),className:"w-full text-sm px-3 py-1.5 pl-8 rounded border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-1 focus:ring-blue-500 focus:border-blue-500 outline-none transition-shadow",autoFocus:true}),jsx(Search,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-gray-400"})]})}),jsxs("div",{className:"p-2",children:[jsx("ul",{className:"space-y-1",children:C.map((y,b)=>jsx("li",{children:jsxs("button",{onClick:()=>m(y),className:"w-full text-left px-3 py-2 rounded-md text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-blue-600 dark:hover:text-blue-400 transition-colors group flex items-start justify-between",children:[jsx("span",{children:y}),jsx(ChevronRight,{className:"w-4 h-4 text-gray-300 group-hover:text-blue-400 opacity-0 group-hover:opacity-100 transition-all transform group-hover:translate-x-0.5"})]})},b))}),d.length>r&&jsx("button",{onClick:()=>g(!c),className:"w-full text-center py-2 text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 transition-colors border-t border-gray-50 dark:border-gray-800/50 mt-1",children:c?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${d.length})`}),d.length===0&&f&&jsx("div",{className:"text-center py-4 text-sm text-gray-500 dark:text-gray-400",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},is=OS;var qS=({title:e,content:t,toolName:o,parameters:a,result:r,status:n,duration:i,icon:s,closable:p=false,onClose:l,onAction:c,actionText:g,className:f="",...u})=>{let[h,w]=useState(false),[d,C]=useState(true),m=()=>{switch(n){case "pending":return {iconColor:"text-blue-500",badgeBg:"bg-blue-50 dark:bg-blue-900/30",badgeText:"text-blue-600 dark:text-blue-400",label:"\u6267\u884C\u4E2D"};case "error":return {iconColor:"text-red-500",badgeBg:"bg-red-50 dark:bg-red-900/30",badgeText:"text-red-600 dark:text-red-400",label:"\u5931\u8D25"};default:return {iconColor:"text-green-500",badgeBg:"bg-green-50 dark:bg-green-900/30",badgeText:"text-green-600 dark:text-green-400",label:"\u6210\u529F"}}},y=()=>{switch(n){case "pending":return jsx(Loader2,{className:"w-5 h-5 animate-spin"});case "error":return jsx(XCircle,{className:"w-5 h-5"});default:return jsx(CheckCircle,{className:"w-5 h-5"})}},b=R=>R?R<1e3?`${R}ms`:`${(R/1e3).toFixed(2)}s`:"",T=m(),A=e||o||"\u5DE5\u5177\u8C03\u7528";return jsxs("div",{className:`w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${f}`,...u,children:[jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50",children:[jsxs("div",{className:"flex items-center space-x-3",children:[jsx("div",{className:`flex-shrink-0 ${T.iconColor}`,children:s||y()}),jsxs("div",{children:[jsxs("div",{className:"flex items-center space-x-2",children:[jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:A}),jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${T.badgeBg} ${T.badgeText}`,children:T.label})]}),o&&e&&jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 flex items-center mt-0.5",children:[jsx(Terminal,{className:"w-3 h-3 mr-1"}),o]})]})]}),jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500 dark:text-gray-400",children:[i&&jsxs("div",{className:"flex items-center bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded",children:[jsx(Clock,{className:"w-3 h-3 mr-1"}),b(i)]}),p&&l&&jsx("button",{onClick:l,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors p-1 rounded",children:jsx(X,{className:"w-4 h-4"})})]})]}),jsxs("div",{className:"p-4",children:[t&&jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-4 leading-relaxed",children:t}),a&&jsxs("div",{className:"mb-3",children:[jsxs("button",{onClick:()=>w(!h),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 mb-2",children:[h?jsx(ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsx(ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsx(Box$1,{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),h&&jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsx("pre",{className:"p-3 text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto",children:JSON.stringify(a,null,2)})})]}),r&&jsxs("div",{children:[jsxs("button",{onClick:()=>C(!d),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 mb-2",children:[d?jsx(ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsx(ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsx(Terminal,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),d&&jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsx("pre",{className:"p-3 text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto",children:typeof r=="string"?r:JSON.stringify(r,null,2)})})]}),c&&jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 dark:border-gray-800 flex justify-end",children:jsx("button",{onClick:c,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:g||"\u6267\u884C\u64CD\u4F5C"})})]})]})},ls=qS;var jS=({data:e})=>{if(!e)return null;let t=useMemo(()=>{let o=[],a=[],r="\u6570\u636E\u8868\u683C";return Array.isArray(e)?(o=e,o.length>0&&(a=Object.keys(o[0]).map(n=>({id:n,label:n.charAt(0).toUpperCase()+n.slice(1),numeric:typeof o[0][n]=="number"})))):typeof e=="object"&&(r=e.title||r,o=Array.isArray(e.rows)?e.rows:Array.isArray(e.data)?e.data:[],Array.isArray(e.columns)?a=e.columns.map(i=>({id:i.key||i.id,label:i.title||i.label,numeric:i.dataType==="number"||i.numeric})):o.length>0&&(a=Object.keys(o[0]).map(i=>({id:i,label:i,numeric:typeof o[0][i]=="number"})))),o=o.map((n,i)=>({...n,id:n.id||`row_${i}`})),{title:r,columns:a,rows:o}},[e]);return t.rows.length===0?jsx("div",{className:"w-full my-4 p-4 border border-dashed border-gray-300 rounded text-center text-gray-500",children:"\u6682\u65E0\u8868\u683C\u6570\u636E"}):jsx("div",{className:"w-full my-4",children:jsx($a,{appId:"agent-ui-table-card",title:t.title,columns:t.columns,rows:t.rows,count:t.rows.length,rowKey:"id",fitContainer:false,maxHeight:"500px",rowsPerPage:10,rowsPerPageOptions:[5,10,20,50]})})},ss=jS;var aw=({title:e,subtitle:t,data:o,type:a,config:r={}})=>{let n=()=>{switch(a){case "bar-chart-card":return jsx(BarChart,{className:"w-4 h-4 text-blue-500"});case "line-chart-card":return jsx(LineChart,{className:"w-4 h-4 text-green-500"});case "pie-chart-card":return jsx(PieChart,{className:"w-4 h-4 text-purple-500"});case "combo-chart-card":return jsx(Activity,{className:"w-4 h-4 text-orange-500"});case "heatmap-chart-card":return jsx(Grid$1,{className:"w-4 h-4 text-red-500"});case "fishbone-chart-card":return jsx(GitBranch,{className:"w-4 h-4 text-indigo-500"});case "waterfall-chart-card":return jsx(TrendingDown,{className:"w-4 h-4 text-teal-500"});case "google-map-card":return jsx(Globe,{className:"w-4 h-4 text-blue-600"});case "amap-card":return jsx(MapPin,{className:"w-4 h-4 text-blue-600"});default:return jsx(BarChart,{className:"w-4 h-4"})}},i=()=>{if(!o&&a!=="google-map-card"&&a!=="amap-card")return jsx("div",{className:"text-gray-500 text-sm p-4 text-center",children:"No data available"});try{switch(a){case "bar-chart-card":return jsx(On,{data:o,orientation:r.orientation||"horizontal",valueSuffix:r.valueSuffix||"",minHeight:r.minHeight});case "line-chart-card":return jsx(lp,{data:o,color:r.color,valueSuffix:r.valueSuffix||"",height:r.height});case "pie-chart-card":let s=o.reduce((l,c)=>l+(Number(c.value)||0),0),p=o.map(l=>({name:l.name,value:Number(l.value)||0,percent:typeof l.percent=="number"?l.percent:s>0?(Number(l.value)||0)/s*100:0}));return jsx(Ki,{data:p,variant:r.variant||"donut",size:r.size,colors:r.colors});case "combo-chart-card":return jsx(sp,{data:o,barColor:r.barColor,lineColor:r.lineColor});case "heatmap-chart-card":return jsx(dp,{data:o});case "fishbone-chart-card":return jsx(up,{branches:o,effect:r.effect||e||"Problem"});case "waterfall-chart-card":return jsx(gp,{data:o,height:r.height});case "google-map-card":return jsx(yp,{embedUrl:r.embedUrl||o&&o[0]?.embedUrl,apiKey:r.apiKey,query:r.query||o&&o[0]?.query||e,height:r.height});case "amap-card":return jsx(Cp,{embedUrl:r.embedUrl||o&&o[0]?.embedUrl,keyword:r.keyword||o&&o[0]?.keyword||e,height:r.height});default:return jsxs("div",{className:"text-gray-500 text-sm p-4 text-center",children:["Unsupported chart type: ",a]})}}catch(s){return console.error("Error rendering chart:",s),jsx("div",{className:"text-red-500 text-sm p-4 text-center",children:"Error rendering chart"})}};return jsxs("div",{className:"w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md",children:[jsxs("div",{className:"flex items-center px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50",children:[jsx("div",{className:"mr-2 flex-shrink-0",children:n()}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",children:e}),t&&jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 truncate",children:t})]})]}),jsxs("div",{className:"p-4",children:[jsx("div",{className:"overflow-x-auto",children:i()}),jsx("div",{className:"mt-3",children:jsxs("details",{className:"text-xs text-gray-500 dark:text-gray-400",children:[jsx("summary",{className:"cursor-pointer hover:text-gray-700 dark:hover:text-gray-300 transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),jsx("pre",{className:"mt-2 p-2 bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-x-auto max-h-40",children:JSON.stringify(o,null,2)})]})})]})]})},cs=aw;var nw=({type:e,manifest:t})=>jsxs("div",{className:"w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md",children:[jsxs("div",{className:"flex items-center px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-blue-50/50 dark:bg-blue-900/10",children:[jsx(Box$1,{className:"w-4 h-4 mr-2 text-blue-600 dark:text-blue-400"}),jsxs("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:["SAP Card: ",e]})]}),jsx("div",{className:"p-4",children:jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 rounded border border-gray-100 dark:border-gray-800 overflow-x-auto",children:jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 whitespace-pre-wrap",children:JSON.stringify(t,null,2)})})})]}),ps=nw;var us=e=>{let t;try{t=JSON.parse(e);}catch{return null}return t&&typeof t=="object"&&((t.type==="bar-chart-card"||t.type==="line-chart-card"||t.type==="pie-chart-card"||t.type==="combo-chart-card"||t.type==="heatmap-chart-card"||t.type==="fishbone-chart-card"||t.type==="waterfall-chart-card"||t.type==="google-map-card"||t.type==="amap-card")&&t.title||(t.type==="sap-analytical-card"||t.type==="sap-list-card"||t.type==="sap-object-card"||t.type==="sap-component-card")&&t.manifest||t.type==="error-card"||t.type==="warning-card"||t.type==="suggestions-card"||t.type==="tool-result-card"||t.type==="table"&&t.data)?t:null};var pw=({content:e,theme:t,size:o="base",className:a,enableCodeHighlight:r=true,enableMermaid:n=true,messageId:i,cardHooks:s})=>{let p=useMemo(()=>e?e.replace(/<think>([\s\S]*?)<\/think>/g,(f,u)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(u.trim())}"></div>`):"",[e]),l=(f,u,h,w,d)=>{s?.onCardEvent?.({messageId:i,cardType:f,action:u,title:h,payload:w,rawData:d});},c=(f,u,h,w,d,C)=>{if(!(!d&&!s?.onCardEvent))return (...m)=>{let y=d?.(...m),b=C?C(...m):void 0;return l(f,u,h,b,w),y}},g=useMemo(()=>({div(f){let{"data-component":u,"data-think-content":h,...w}=f;return u==="thinkbox"&&h?jsx(ng,{content:decodeURIComponent(h),theme:t,size:o,defaultExpanded:false}):jsx("div",{...w})},table({children:f}){return jsx("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-gray-200 dark:border-gray-800",children:jsx("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:f})})},thead({children:f}){return jsx("thead",{className:"bg-gray-50 dark:bg-gray-900/60",children:f})},tbody({children:f}){return jsx("tbody",{className:"bg-white dark:bg-gray-950",children:f})},tr({children:f}){return jsx("tr",{className:"border-b border-gray-200 dark:border-gray-800 last:border-b-0",children:f})},th({children:f,align:u}){return jsx("th",{className:`px-3 py-2 font-semibold text-gray-800 dark:text-gray-100 ${u==="center"?"text-center":u==="right"?"text-right":"text-left"}`,children:f})},td({children:f,align:u}){return jsx("td",{className:`px-3 py-2 text-gray-700 dark:text-gray-200 align-top ${u==="center"?"text-center":u==="right"?"text-right":"text-left"}`,children:f})},code({inline:f,className:u,children:h,...w}){let d=/language-([\w-]+)/.exec(u||""),C=d?d[1]:"";if(f)return jsx("code",{className:"font-mono text-sm bg-gray-100 dark:bg-gray-800 px-1 py-0.5 rounded text-red-600 dark:text-red-400",...w,children:h});let m=String(h).replace(/\n$/,"");if(n&&C==="mermaid")return jsx(pg,{content:m});if(C==="json"){let y=us(m);if(y)switch(y.type){case "table":return jsx(ss,{data:y.data});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 jsx(cs,{...y});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsx(ps,{...y});case "error-card":{let b=y;return jsx(rs,{...b,onClose:c("error-card","close",b.title,b,b.onClose),onRetry:c("error-card","retry",b.title,b,b.onRetry)})}case "warning-card":{let b=y,T=b.onConfirm?c("warning-card","confirm",b.title,b,b.onConfirm):b.actionText&&s?.onCardEvent?c("warning-card","confirm",b.title,b):void 0;return jsx(ns,{...b,onClose:c("warning-card","close",b.title,b,b.onClose),onConfirm:T})}case "suggestions-card":{let b=y;return jsx(is,{...b,onClose:c("suggestions-card","close",b.title,b,b.onClose),onSuggestionClick:c("suggestions-card","suggestion-click",b.title,b,b.onSuggestionClick,T=>({suggestion:T}))})}case "tool-result-card":{let b=y;return jsx(ls,{...b,onClose:c("tool-result-card","close",b.title,b,b.onClose),onAction:c("tool-result-card","action",b.title,b,b.onAction)})}}}return r?jsx(lg,{content:m,language:C,className:"not-prose"}):jsx("code",{className:u,...w,children:h})}}),[t,o,n,r,s,i]);return jsx("div",{className:He("markdown-body prose dark:prose-invert max-w-none",a),children:jsx(iw,{remarkPlugins:[lw,sw],rehypePlugins:[cw,dw],components:g,children:p})})},ms=pw;var uw=({content:e,messageId:t,cardHooks:o})=>{let a=(i,s,p,l,c)=>{o?.onCardEvent?.({messageId:t,cardType:i,action:s,title:p,payload:l,rawData:c});},r=(i,s,p,l,c,g)=>{if(!(!c&&!o?.onCardEvent))return (...f)=>{let u=c?.(...f),h=g?g(...f):void 0;return a(i,s,p,h,l),u}},n=us(e);if(n)switch(n.type){case "table":return jsx(ss,{data:n.data});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 jsx(cs,{...n});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsx(ps,{...n});case "error-card":{let i=n;return jsx(rs,{...i,onClose:r("error-card","close",i.title,i,i.onClose),onRetry:r("error-card","retry",i.title,i,i.onRetry)})}case "warning-card":{let i=n,s=i.onConfirm?r("warning-card","confirm",i.title,i,i.onConfirm):i.actionText&&o?.onCardEvent?r("warning-card","confirm",i.title,i):void 0;return jsx(ns,{...i,onClose:r("warning-card","close",i.title,i,i.onClose),onConfirm:s})}case "suggestions-card":{let i=n;return jsx(is,{...i,onClose:r("suggestions-card","close",i.title,i,i.onClose),onSuggestionClick:r("suggestions-card","suggestion-click",i.title,i,i.onSuggestionClick,s=>({suggestion:s}))})}case "tool-result-card":{let i=n;return jsx(ls,{...i,onClose:r("tool-result-card","close",i.title,i,i.onClose),onAction:r("tool-result-card","action",i.title,i,i.onAction)})}}return jsx("div",{className:"dynamic-card-fallback",children:jsx(ms,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:o})})},Cg=uw;var dd=class{static analyze(t){if(!t.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let a=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(t),r=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(t),n=t.includes("NQ#")||t.includes("data-component");return a||r||n?{blocks:[{type:"mixed",content:t,startIndex:0,endIndex:t.length}],hasComplexContent:true,overallType:"complex"}:{blocks:[{type:"markdown",content:t,startIndex:0,endIndex:t.length}],hasComplexContent:false,overallType:"simple"}}},gw=({content:e,className:t="",messageId:o,cardHooks:a})=>{let r=vt__default.useMemo(()=>dd.analyze(e),[e]);return jsx("div",{className:`universal-content-renderer ${t}`,children:r.blocks.map((n,i)=>n.type==="mixed"||n.type==="json-card"?jsx(Cg,{content:n.content,messageId:o,cardHooks:a},`block-${i}`):jsx(ms,{content:n.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:a},`block-${i}`))})},kg=gw;var fw=({content:e,isStreaming:t=true,onComplete:o,className:a="",streamIntervalMs:r=24,streamChunkSize:n=3,messageId:i,cardHooks:s})=>{let[p,l]=useState(t?0:e.length),[c,g]=useState(!t);useEffect(()=>{if(t){l(0),g(false);return}l(e.length),g(true);},[e,t]),useEffect(()=>{if(!t||c)return;if(p>=e.length){g(true),o?.();return}let d=window.setTimeout(()=>{l(C=>Math.min(C+n,e.length));},r);return ()=>{window.clearTimeout(d);}},[e.length,c,t,o,n,r,p]);let f=()=>{t&&!c&&(l(e.length),g(true),o?.());},u=t?e.slice(0,p):e,h=t&&!c,w=t&&!c;return jsxs("div",{className:`streaming-markdown ${a}`,onClick:f,style:{cursor:t?"pointer":"default"},children:[jsxs("div",{className:"relative",children:[jsx(kg,{content:u,messageId:i,cardHooks:s}),h&&jsx("span",{className:"inline-block w-0.5 h-5 bg-blue-500 ml-1 animate-pulse",style:{verticalAlign:"text-bottom"}})]}),w&&jsx("div",{className:"streaming-hint",style:{fontSize:"9px",color:"#999",marginTop:"8px",fontStyle:"italic",opacity:.7},children:"\u70B9\u51FB\u6B64\u5904\u663E\u793A\u5B8C\u6574\u5185\u5BB9"})]})},Ig=fw;var Pg=({buttons:e,className:t})=>{let o=a=>{switch(a){case "copy":return jsx(Copy,{size:14});case "refresh":return jsx(RefreshCw,{size:14});case "volume":return jsx(Volume2,{size:14});case "like":return jsx(ThumbsUp,{size:14});case "dislike":return jsx(ThumbsDown,{size:14});default:return null}};return jsx("div",{className:He("flex items-center gap-1",t),children:e.map((a,r)=>jsx("button",{onClick:a.onClick,disabled:a.disabled,className:He("p-1.5 rounded-md transition-colors","text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-800","disabled:opacity-50 disabled:cursor-not-allowed",a.active&&"text-blue-600 bg-blue-50 dark:text-blue-400 dark:bg-blue-900/20",a.type==="refresh"&&a.disabled&&"animate-spin"),title:a.type,type:"button",children:o(a.type)},`${a.type}-${r}`))})};var gs=({message:e,onStreamingComplete:t,assistantActions:o,streamIntervalMs:a,streamChunkSize:r,cardHooks:n})=>e.type==="assistant"?jsx("div",{className:"flex justify-start mb-4",children:jsxs("div",{className:"w-full bg-transparent text-black dark:text-gray-100 rounded-2xl px-4 py-3 mr-auto",style:{lineHeight:"1.5",fontSize:"16px",fontWeight:"280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[jsx(Ig,{content:e.content,isStreaming:e.isStreaming??false,onComplete:t,streamIntervalMs:a,streamChunkSize:r,messageId:e.id,cardHooks:n}),e.content&&o?.isLatestAssistant&&jsx("div",{className:"flex flex-row justify-start gap-2 mt-3 pt-2 border-t border-gray-100 dark:border-gray-700",children:jsx(Pg,{buttons:[{type:"refresh",onClick:()=>o?.onRegenerate?.(),disabled:!o?.onRegenerate},{type:"copy",onClick:()=>navigator.clipboard.writeText(e.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"})}),jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})}):jsx("div",{className:"flex justify-end",children:jsxs("div",{className:"max-w-[80%] bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-100 rounded-2xl px-4 py-3 ml-auto",style:{lineHeight:"1.5",fontSize:"16px",fontWeight:"280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[jsx("div",{className:"whitespace-pre-wrap",style:{lineHeight:"1.5",fontSize:"16px",fontWeight:"280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:e.content}),jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})});var Dg=({onTextUpdate:e,onComplete:t,onCancel:o,disabled:a,className:r})=>{let{isRecording:n,startRecording:i,stopRecording:s}=as({onTextUpdate:e,onComplete:l=>{t?.(l);},onError:l=>{console.error("Voice input error:",l),o?.();}});return jsx("button",{onClick:async()=>{n?s():await i();},disabled:a,className:He("transition-all duration-200 flex items-center justify-center rounded-full",n?"bg-red-100 text-red-600 hover:bg-red-200 animate-pulse":"bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400 active:scale-95",a&&"opacity-50 cursor-not-allowed",r),title:n?"Stop recording":"Start recording",type:"button",children:n?jsx(kw,{sx:{fontSize:24}}):jsx(Cw,{sx:{fontSize:24}})})};var Ct={container:"w-full max-w-4xl mx-auto",inputContainer:He("w-full border backdrop-blur-xl transition-all duration-300 shadow-2xl flex flex-col","bg-white/80 dark:bg-gray-900/80","border-gray-200/60 dark:border-gray-600/40","shadow-gray-900/5","hover:border-blue-300/80 hover:shadow-blue-500/10 hover:shadow-2xl","focus-within:border-blue-400/90 focus-within:shadow-blue-500/20 focus-within:shadow-3xl focus-within:scale-[1.005] transform-gpu"),dragActive:"border-blue-500 bg-blue-50/50 dark:bg-blue-900/20",textareaWrapper:"flex-1 relative flex items-center",textarea:He("w-full outline-none appearance-none resize-none bg-transparent border-none text-sm font-normal py-3 px-2","placeholder:text-gray-400/70 dark:placeholder:text-gray-500/60 placeholder:font-normal","text-gray-800 dark:text-gray-100 selection:bg-blue-200/50 dark:selection:bg-blue-500/30","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-gray-300 dark:scrollbar-thumb-gray-600"),filePreviewArea:"px-6 pt-3 pb-1 flex flex-wrap gap-2",fileTag:He("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium","bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300","border border-gray-200 dark:border-gray-700","transition-all hover:bg-gray-200 dark:hover:bg-gray-700"),buttonBase:"flex items-center justify-center transition-all duration-200 rounded-full",buttonSmall:"w-10 h-10",buttonNormal:He("bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400","cursor-pointer active:scale-95"),sendButton:He("cursor-pointer bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400 shadow-none active:scale-95"),sendButtonDisabled:He("cursor-not-allowed opacity-40 bg-transparent text-gray-400"),stopButton:He("cursor-pointer bg-red-500 hover:bg-red-600 text-white shadow-sm active:scale-95")},Mw={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},Aw=({enabled:e,onClick:t})=>jsx("button",{className:He(Ct.buttonBase,Ct.buttonSmall,Ct.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsx(Rw,{sx:{fontSize:24}})}),Bw=()=>jsxs("button",{className:He(Ct.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",Ct.buttonNormal),"aria-label":"Tools",type:"button",children:[jsx(Dw,{sx:{fontSize:20}}),jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),Ew=({canSend:e,isResponding:t,onSend:o,onStop:a})=>t?jsx("button",{className:He(Ct.buttonBase,Ct.buttonSmall,Ct.stopButton),onClick:a,"aria-label":"Stop generating",type:"button",children:jsx(Stop,{sx:{fontSize:20}})}):jsx("button",{className:He(Ct.buttonBase,Ct.buttonSmall,e?Ct.sendButton:Ct.sendButtonDisabled),onClick:o,disabled:!e,"aria-label":"Send message",type:"button",children:jsx(Pw,{sx:{fontSize:24},className:e?"text-gray-500 dark:text-gray-400":"text-gray-300 dark:text-gray-600"})}),Mg=({onSend:e,onStop:t,isResponding:o=false,placeholder:a,getText:r})=>{let[n,i]=useState(""),[s,p]=useState([]),[l,c]=useState(false),[g,f]=useState(false),u=useRef(null),h=a||(r?r("00019","Type a message..."):"Type a message..."),w=(n.trim().length>0||s.length>0)&&!o,d={enabled:true},C=useCallback(D=>{i(D.target.value),D.target.style.height="auto",D.target.style.height=`${Math.min(D.target.scrollHeight,200)}px`;},[]),m=useCallback(D=>{if(D.target.files&&D.target.files.length>0){let G=Array.from(D.target.files);p(V=>{let X=G.filter(oe=>V.some(re=>re.name===oe.name&&re.size===oe.size));X.length>0&&console.warn("Duplicate files ignored:",X.map(oe=>oe.name));let de=G.filter(oe=>!V.some(re=>re.name===oe.name&&re.size===oe.size));return [...V,...de]}),u.current&&(u.current.value="");}},[]),y=useCallback(D=>{p(G=>G.filter((V,X)=>X!==D));},[]),b=useCallback(()=>{u.current?.click();},[]),T=useCallback(async()=>{if(!w)return;let D=n,G=[...s];i(""),p([]),u.current&&(u.current.value="");try{await e(D,G);}catch(V){console.error("Failed to send message:",V),i(D),p(G);}},[n,w,e,s]),A=useCallback(D=>{D.key==="Enter"&&!D.shiftKey&&!l&&(D.preventDefault(),T());},[T,l]),R=useCallback(()=>{c(true);},[]),S=useCallback(()=>{c(false);},[]),B=useCallback(D=>{i(D);},[]),P=useCallback(D=>{i(D);},[]),v=useCallback(()=>{},[]),M=useCallback(D=>{D.preventDefault(),f(true);},[]),k=useCallback(D=>{D.preventDefault(),f(false);},[]),I=useCallback(D=>{if(D.preventDefault(),f(false),D.dataTransfer.files&&D.dataTransfer.files.length>0){let G=Array.from(D.dataTransfer.files);p(V=>[...V,...G]);}},[]);return jsx("div",{className:Ct.container,children:jsxs("div",{className:"relative",children:[jsx("input",{type:"file",multiple:true,className:"hidden",ref:u,onChange:m}),jsxs("div",{className:He(Ct.inputContainer,g&&Ct.dragActive),style:{borderRadius:"32px"},onDragOver:M,onDragLeave:k,onDrop:I,children:[s.length>0&&jsx("div",{className:Ct.filePreviewArea,children:s.map((D,G)=>jsxs("div",{className:Ct.fileTag,children:[jsx(InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsx("span",{className:"truncate max-w-[150px]",children:D.name}),jsx("button",{onClick:()=>y(G),className:"ml-1 hover:text-red-500 focus:outline-none",type:"button",children:jsx(Close,{sx:{fontSize:16}})})]},`${D.name}-${G}`))}),jsxs("div",{className:"flex flex-col w-full p-2",children:[jsx("div",{className:He(Ct.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsx("textarea",{className:He(Ct.textarea,"min-h-[24px] py-0 px-0"),placeholder:h,value:n,onChange:C,onKeyDown:A,onCompositionStart:R,onCompositionEnd:S,style:Mw,"aria-label":"Message input",spellCheck:false,rows:1})}),jsxs("div",{className:"flex items-center justify-between px-1 pb-1",children:[jsxs("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:[jsx(Aw,{enabled:d.enabled,onClick:b}),jsx(Bw,{})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(Dg,{onTextUpdate:B,onComplete:P,onCancel:v,disabled:o,className:Ct.buttonSmall}),jsx(Ew,{canSend:w,isResponding:o,onSend:T,onStop:t})]})]})]})]})]})})};var Eg=({messages:e,onSend:t,onStop:o,onRegenerate:a,isResponding:r=false,className:n,placeholder:i,streamIntervalMs:s,streamChunkSize:p,onMessageStreamingComplete:l,cardHooks:c,showInput:g=true})=>{let f=useRef(null),u=useRef(e.length);return useEffect(()=>{e.length>u.current&&f.current?.scrollIntoView({behavior:"smooth"}),u.current=e.length;},[e]),jsxs("div",{className:He("flex flex-col h-full w-full relative",n),children:[jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600",children:[e.map((h,w)=>{let d=h.type==="assistant"&&w===e.length-1,C=h.type==="assistant"?{isLatestAssistant:d,onRegenerate:a?()=>a(h.id):void 0}:void 0;return jsx(gs,{message:h,assistantActions:C,onStreamingComplete:()=>l?.(h.id),streamIntervalMs:s,streamChunkSize:p,cardHooks:c},h.id)}),jsx("div",{ref:f})]}),g&&jsx("div",{className:"p-4 bg-gradient-to-t from-white via-white to-transparent dark:from-gray-900 dark:via-gray-900 pb-8 z-10",children:jsx(Mg,{onSend:t||(async()=>{}),onStop:o||(()=>{}),isResponding:r,placeholder:i})})]})};var yo={};var zw={idle:"Idle",running:"Running",success:"Success",error:"Error",pending:"Pending"},dN=({title:e="AI Agent",description:t,headerActions:o,className:a,agentStatus:r,showInput:n=false,...i})=>{let s=r??(i.isResponding?"running":"idle");return jsxs("div",{className:He("relative flex h-full w-full",yo.agentPanel,a),"data-status":s,children:[jsx("div",{className:yo.colorHalo,"data-status":s,"aria-hidden":"true"}),jsxs("div",{className:yo.marqueeBorder,"data-status":s,"aria-hidden":"true",children:[jsx("span",{className:He(yo.edge,yo.top)}),jsx("span",{className:He(yo.edge,yo.right)}),jsx("span",{className:He(yo.edge,yo.bottom)}),jsx("span",{className:He(yo.edge,yo.left)})]}),jsxs("div",{className:"relative z-10 flex h-full w-full flex-col rounded-xl border border-slate-200/70 bg-white shadow-sm overflow-hidden dark:border-slate-800 dark:bg-gray-950",children:[jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 dark:border-gray-800 bg-white/50 dark:bg-gray-900/50 backdrop-blur-sm z-20",children:[jsxs("div",{children:[jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e}),t&&jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("div",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-full bg-gray-100/80 dark:bg-gray-800/70",children:[jsx("span",{className:yo.statusDot,"data-status":s}),jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-gray-600 dark:text-gray-300",children:zw[s]})]}),o]})]}),jsx("div",{className:"flex-1 min-h-0 relative z-10",children:jsx(Eg,{...i,showInput:n})})]})]})};var Ww={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},bN=({messages:e,onSend:t,onRegenerate:o,isResponding:a=false,className:r,placeholder:n,title:i="Copilot",corner:s="bottom-right",onCollapse:p,onHeaderPointerDown:l,onPlusClick:c,onMicClick:g,streamIntervalMs:f,streamChunkSize:u,onMessageStreamingComplete:h,cardHooks:w})=>{let[d,C]=useState(""),[m,y]=useState(false),b=useRef(null),T=Ww[s];useEffect(()=>{b.current?.scrollIntoView({behavior:"smooth"});},[e,a]);let A=useCallback(async()=>{let S=d.trim();!S||a||(C(""),await t(S));},[a,t,d]),R=useCallback(async S=>{S.key==="Enter"&&!m&&(S.preventDefault(),await A());},[A,m]);return jsxs("div",{className:He("relative flex h-full w-full min-h-[460px] min-w-[340px] flex-col overflow-hidden rounded-3xl border border-gray-200 bg-white shadow-none dark:border-gray-800 dark:bg-gray-900",r),children:[p&&jsx("button",{onClick:p,className:He("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",T==="top-left"&&"-left-2 -top-2",T==="top-right"&&"-right-2 -top-2",T==="bottom-left"&&"-bottom-2 -left-2",T==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:jsx("span",{className:He("block h-4 w-4 border-[#21BCFF]",T==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",T==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",T==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",T==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 px-4 py-3 dark:border-gray-800",onPointerDown:l,children:[jsx("div",{className:"flex items-center",children:jsx("h3",{className:"text-base font-semibold tracking-tight text-gray-900 dark:text-gray-100",children:i})}),jsx("div",{})]}),jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600",children:[e.map((S,B)=>{let P=S.type==="assistant"&&B===e.length-1,v=S.type==="assistant"?{isLatestAssistant:P,onRegenerate:o?()=>o(S.id):void 0}:void 0;return jsx(gs,{message:S,assistantActions:v,onStreamingComplete:()=>h?.(S.id),streamIntervalMs:f,streamChunkSize:u,cardHooks:w},S.id)}),jsx("div",{ref:b})]}),jsx("div",{className:"border-t border-gray-100 px-3 py-3 dark:border-gray-800",children:jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-blue-300/80 bg-white px-2 py-1.5 dark:bg-gray-900",children:[jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",onClick:c,type:"button","aria-label":"Add",children:jsx(Plus,{className:"h-4 w-4"})}),jsx("input",{className:"h-7 flex-1 border-none bg-transparent text-sm text-gray-800 outline-none placeholder:text-gray-400 dark:text-gray-100 dark:placeholder:text-gray-500",placeholder:n||"Ask Copilot...",value:d,onChange:S=>C(S.target.value),onCompositionStart:()=>y(true),onCompositionEnd:()=>y(false),onKeyDown:R,"aria-label":"Copilot input",spellCheck:false}),jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",onClick:g,type:"button","aria-label":"Microphone",children:jsx(Mic,{className:"h-4 w-4"})})]})})]})};var kN=({defaultMode:e="login",onLogin:t,onRegister:o,onForgotPassword:a}={})=>{let[r,n]=useState(e),[i,s]=useState(false),p=useCallback(async u=>{s(true);try{await u?.();}finally{s(false);}},[]),l=useCallback(u=>p(()=>t?.(u)),[t,p]),c=useCallback(u=>p(()=>o?.(u)),[o,p]),g=useCallback(u=>p(()=>a?.(u)),[a,p]),f=useMemo(()=>({mode:r,loading:i,onModeChange:n,onLogin:l,onRegister:c,onForgotPassword:g}),[g,l,c,i,r]);return {mode:r,loading:i,setMode:n,authPageProps:f}};var md=({label:e,...t})=>jsx(FormControlLabel,{control:jsx(Checkbox,{...t}),label:e});var Ti=forwardRef((e,t)=>jsx(Paper,{ref:t,...e,elevation:e.elevation||1,sx:{p:2,mb:2,...e.sx}}));Ti.displayName="CPaper";var e1={productName:"ORBCAFE",headline:"Operational workbench",subheadline:"A focused entry point for reports, planning, agent workflows, and enterprise operations.",loginTitle:"Sign in",loginSubtitle:"Use your workspace 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."},$N=({mode:e,defaultMode:t="login",onModeChange:o,onLogin:a,onRegister:r,onForgotPassword:n,loading:i=false,logo:s,copy:p,sx:l})=>{let c=useTheme(),g=e!==void 0,[f,u]=useState(t),h=e??f,w=useMemo(()=>({...e1,...p}),[p]),[d,C]=useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[m,y]=useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[b,T]=useState({email:""}),[A,R]=useState(""),S=I=>{g||u(I),R(""),o?.(I);},B=async I=>{I.preventDefault(),await a?.(d),R("Demo login accepted. No real authentication request was sent.");},P=async I=>{I.preventDefault(),await r?.(m),R("Demo registration saved locally for this screen.");},v=async I=>{I.preventDefault(),await n?.(b),R("Demo reset link request created. No email was sent.");},M=h==="login"?w.loginTitle:h==="register"?w.registerTitle:w.forgotTitle,k=h==="login"?w.loginSubtitle:h==="register"?w.registerSubtitle:w.forgotSubtitle;return jsxs(Box,{sx:{minHeight:"100vh",display:"grid",gridTemplateColumns:{xs:"1fr",md:"minmax(320px, 0.9fr) minmax(420px, 1.1fr)"},background:c.palette.mode==="dark"?"linear-gradient(135deg, #071018 0%, #151515 48%, #101827 100%)":"linear-gradient(135deg, #eef3f8 0%, #ffffff 52%, #e8f2f0 100%)",...l},children:[jsxs(Box,{sx:{display:{xs:"none",md:"flex"},flexDirection:"column",justifyContent:"space-between",p:{md:6,lg:8},borderRight:`1px solid ${c.palette.divider}`},children:[jsxs(Stack,{spacing:4,children:[jsx(Box,{children:s}),jsxs(Stack,{spacing:2,children:[jsx(Typography,{sx:{fontSize:14,fontWeight:700,color:"primary.main",textTransform:"uppercase"},children:w.productName}),jsx(Typography,{sx:{fontSize:{md:34,lg:42},lineHeight:1.06,fontWeight:800},children:w.headline}),jsx(Typography,{sx:{maxWidth:460,color:"text.secondary",fontSize:16,lineHeight:1.7},children:w.subheadline})]})]}),jsxs(Stack,{direction:"row",spacing:2,sx:{color:"text.secondary",fontSize:13},children:[jsx(Typography,{variant:"caption",children:"Reports"}),jsx(Typography,{variant:"caption",children:"Planning"}),jsx(Typography,{variant:"caption",children:"Agent UI"})]})]}),jsx(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",p:{xs:2,sm:4,md:6}},children:jsx(Ti,{elevation:0,sx:{width:"100%",maxWidth:460,m:0,p:{xs:2.5,sm:4},borderRadius:3,border:`1px solid ${c.palette.divider}`,backgroundColor:c.palette.mode==="dark"?"rgba(15, 23, 42, 0.86)":"rgba(255, 255, 255, 0.88)",backdropFilter:"blur(18px)",boxShadow:c.palette.mode==="dark"?"0 24px 80px rgba(0,0,0,0.34)":"0 24px 80px rgba(15,23,42,0.10)"},children:jsxs(Stack,{spacing:3,children:[jsxs(Stack,{spacing:1,children:[jsx(Box,{sx:{display:{xs:"block",md:"none"},mb:1},children:s}),jsx(Typography,{sx:{fontSize:28,fontWeight:800},children:M}),jsx(Typography,{sx:{color:"text.secondary"},children:k})]}),A&&jsx(Alert,{severity:"success",children:A}),h==="login"&&jsx(Box,{component:"form",onSubmit:B,children:jsxs(Stack,{spacing:2,children:[jsx(_t,{label:"Email or user ID",value:d.username,onChange:I=>C(D=>({...D,username:I.target.value})),InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Og,{fontSize:"small"})})}}),jsx(_t,{label:"Password",type:"password",value:d.password,onChange:I=>C(D=>({...D,password:I.target.value})),InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Qw,{fontSize:"small"})})}}),jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[jsx(md,{label:"Remember me",checked:d.remember,onChange:I=>C(D=>({...D,remember:I.target.checked}))}),jsx(Bo,{type:"button",variant:"text",size:"small",onClick:()=>S("forgot"),children:"Forgot?"})]}),jsx(Bo,{type:"submit",size:"large",disabled:i,children:"Sign in"}),jsxs(Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["New user?"," ",jsx(Bo,{type:"button",variant:"text",size:"small",onClick:()=>S("register"),sx:{minWidth:0,p:0},children:"Register"})]})]})}),h==="register"&&jsx(Box,{component:"form",onSubmit:P,children:jsxs(Stack,{spacing:2,children:[jsx(_t,{label:"Full name",value:m.name,onChange:I=>y(D=>({...D,name:I.target.value})),InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Og,{fontSize:"small"})})}}),jsx(_t,{label:"Work email",type:"email",value:m.email,onChange:I=>y(D=>({...D,email:I.target.value})),InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Vg,{fontSize:"small"})})}}),jsx(_t,{label:"Password",type:"password",value:m.password,onChange:I=>y(D=>({...D,password:I.target.value})),InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Jw,{fontSize:"small"})})}}),jsx(_t,{label:"Confirm password",type:"password",value:m.confirmPassword,onChange:I=>y(D=>({...D,confirmPassword:I.target.value}))}),jsx(md,{label:"I accept the demo workspace terms",checked:m.acceptedTerms,onChange:I=>y(D=>({...D,acceptedTerms:I.target.checked}))}),jsx(Bo,{type:"submit",size:"large",disabled:i,children:"Create demo account"}),jsxs(Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["Already have an account?"," ",jsx(Bo,{type:"button",variant:"text",size:"small",onClick:()=>S("login"),sx:{minWidth:0,p:0},children:"Sign in"})]})]})}),h==="forgot"&&jsx(Box,{component:"form",onSubmit:v,children:jsxs(Stack,{spacing:2,children:[jsx(_t,{label:"Work email",type:"email",value:b.email,onChange:I=>T({email:I.target.value}),InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Vg,{fontSize:"small"})})}}),jsx(Bo,{type:"submit",size:"large",disabled:i,children:"Send reset request"}),jsxs(Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["Remember your password?"," ",jsx(Bo,{type:"button",variant:"text",size:"small",onClick:()=>S("login"),sx:{minWidth:0,p:0},children:"Back to sign in"})]})]})}),jsx(Divider,{}),jsx(Typography,{variant:"caption",sx:{color:"text.secondary"},children:"Demo credentials: demo@orbcafe.local / orbcafe-demo"})]})})})]})};var a1={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},r1=[{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"}],Hg=({tasks:e,defaultScale:t="week",defaultSelectedTaskId:o,initialFilters:a,filterFields:r,filterAppId:n="planning-gantt-filter",filterTableKey:i="planning",columns:s,onFilterSearch:p,onFilterVariantLoad:l,enableRowReorder:c,onTaskReorder:g})=>{let[f,u]=useState(t),[h,w]=useState(o??e[0]?.id??""),[d,C]=useState({...a1,...a}),m=useMemo(()=>{let A=String(d.keyword?.value??"").trim().toLowerCase(),R=String(d.status?.value??"").trim(),S=String(d.owner?.value??"").trim().toLowerCase(),B=String(d.workCenter?.value??"").trim().toLowerCase(),P=d.dateRange?.value,v=P?.[0]?ta(P[0]):null,M=P?.[1]?ta(P[1]):null;return e.filter(k=>{if(A&&![k.id,k.code,k.title,k.project,k.workCenter,k.owner?.name].join(" ").toLowerCase().includes(A)||R&&k.status!==R||S&&!String(k.owner?.name??"").toLowerCase().includes(S)||B&&!String(k.workCenter??"").toLowerCase().includes(B))return false;if(v||M){let I=ta(k.startDate),D=ta(k.endDate),G=v?D.isAfter(v)||D.isSame(v,"day"):true,V=M?I.isBefore(M)||I.isSame(M,"day"):true;if(!G||!V)return false}return true})},[d,e]);useEffect(()=>{m.length!==0&&(m.some(A=>A.id===h)||w(m[0].id));},[m,h]);let y=useCallback(A=>{w(A.id);},[]),b=useMemo(()=>({appId:n,tableKey:i,fields:r??r1,filters:d,onFilterChange:C,onVariantLoad:l??(()=>{}),onSearch:p??(()=>{})}),[n,r,i,d,p,l]),T=useMemo(()=>({tasks:m,columns:s,scale:f,onScaleChange:u,selectedTaskId:h,onTaskSelect:y,enableRowReorder:c,onTaskReorder:g}),[s,c,m,g,y,f,h]);return {scale:f,setScale:u,selectedTaskId:h,setSelectedTaskId:w,filters:d,setFilters:C,filteredTasks:m,smartFilterProps:b,planningGanttProps:T}};var XN=e=>{let t=Hg(e),o=useMemo(()=>({filterProps:t.smartFilterProps,ganttProps:t.planningGanttProps}),[t.planningGanttProps,t.smartFilterProps]);return {...t,layoutProps:o}};var Wg=e=>jsx(Chip,{...e,size:e.size||"small",variant:e.variant||"outlined"});var Qa=forwardRef(({tooltip:e,...t},o)=>{let a=jsx(IconButton,{ref:o,...t,size:t.size||"small"});return e?jsx(Tooltip,{title:e,children:a}):a});Qa.displayName="CIconButton";var Gg=({label:e,options:t,minWidth:o=120,...a})=>jsxs(FormControl,{fullWidth:true,size:"small",sx:{minWidth:o},children:[e&&jsx(InputLabel,{children:e}),jsx(Select,{label:e,...a,children:t.map(r=>jsx(MenuItem,{value:r.value,children:r.label},r.value))})]});ta.extend(h1);var yd=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],bd=56,Ar=58,xd=8,vd=260,E1=320,Ja="220ms cubic-bezier(0.2, 0, 0, 1)",_g={"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"}},F1=e=>e?_g[e]?.label??e:"Planned",L1=e=>e?_g[e]?.color??"default":"info",jg=e=>Math.min(100,Math.max(0,e??0)),Zg=(e,t=0)=>e.flatMap(o=>[{...o,level:t},...Zg(o.children??[],t+1)]),z1=e=>({id:e.id,code:e.code??e.id,title:e.title,titleSub:e.project??e.workCenter??"General",project:e.project??"",workCenter:e.workCenter??"",owner:e.owner?.name??"Unassigned",status:F1(e.status),statusTone:e.status??"planned",progress:jg(e.progress),startDate:e.startDate,endDate:e.endDate,color:e.color,reorderable:e.reorderable!==false}),Xg=(e,t)=>t==="month"?e.startOf("month"):t==="week"?e.startOf("week"):t==="day"?e.startOf("day"):e.startOf("hour"),Yg=(e,t)=>t==="month"?e.endOf("month"):t==="week"?e.endOf("week"):t==="day"?e.endOf("day"):e.endOf("hour"),N1=(e,t,o)=>{let a=[],r=Xg(e,o),n=Yg(t,o);for(;r.isBefore(n)||r.isSame(n);){let i=o==="month"?r.add(1,"month"):o==="week"?r.add(1,"week"):o==="day"?r.add(1,"day"):r.add(1,"hour");a.push({key:`${o}-${r.valueOf()}`,label:o==="month"?r.format("MMM YYYY"):o==="week"?r.format("MMM D"):o==="day"?r.format("D"):r.format("HH:mm"),contextLabel:o==="hour"?r.format("MMM D"):o==="day"?r.format("MMM"):o==="week"?`W${r.isoWeek()}`:void 0,title:o==="hour"?r.format("MMM D, YYYY HH:mm"):o==="day"?r.format("MMM D, YYYY"):o==="week"?`${r.format("MMM D, YYYY")} - Week ${r.isoWeek()}`:void 0,start:r,end:i}),r=i;}return a},Cd=(e,t,o)=>{let a=0;for(let r of t){if(e.isBefore(r.start))return a;if(e.isBefore(r.end)){let n=Math.max(1,r.end.valueOf()-r.start.valueOf()),i=Math.max(0,e.valueOf()-r.start.valueOf());return a+i/n*o}a+=o;}return a},Qg=({title:e="Project Plan",subtitle:t="Task table and timeline view",extraTools:o,bodyHeight:a=560,tasks:r,columns:n,scale:i="week",onScaleChange:s,timelineStart:p,timelineEnd:l,selectedTaskId:c,onTaskSelect:g,enableRowReorder:f=true,onTaskReorder:u,emptyLabel:h="No planning tasks available.",sx:w})=>{let d=useTheme(),C=useRef(null),m=useRef(null),y=useRef(null),b=useRef(false),[T,A]=useState(null),[R,S]=useState(null),[B,P]=useState({}),[v,M]=useState(bd),[k,I]=useState([]),[D,G]=useState({activeId:null,overId:null}),V=useRef(null),X=useMemo(()=>Zg(r),[r]),de=useMemo(()=>{if(k.length===0)return X;let L=new Map(X.map(te=>[te.id,te])),$=k.map(te=>L.get(te)).filter(te=>!!te),Z=new Set($.map(te=>te.id));return [...$,...X.filter(te=>!Z.has(te.id))]},[X,k]),oe=useMemo(()=>new Map(de.map(L=>[L.id,L])),[de]),re=useMemo(()=>de.map(L=>z1(L)),[de]),_=useMemo(()=>new Map(re.map(L=>[L.id,L])),[re]),qe=useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(L,$)=>jsxs(Stack,{spacing:.2,children:[jsx(Typography,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:$.title}),jsx(Typography,{sx:{fontSize:13,color:"text.secondary"},children:$.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(L,$)=>jsx(Wg,{label:$.status,color:L1($.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:L=>jsxs(Stack,{spacing:.6,children:[jsxs(Typography,{variant:"caption",sx:{color:"text.secondary"},children:[L,"%"]}),jsx(LinearProgress,{variant:"determinate",value:L,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),it=useMemo(()=>{if(!n||n.length===0)return qe;let L=new Map(qe.map($=>[$.id,$]));return n.map($=>{let Z=L.get($.id),te=$.width??Z?.minWidth??120,ke={id:$.id,label:$.label,minWidth:te};if(Z?.numeric&&(ke.numeric=true),$.render){let z=$.render;return ke.render=(O,N)=>{let ne=oe.get(N.id);return z(ne||N)},ke}return Z?.render?(ke.render=Z.render,ke):(ke.render=(z,O)=>{let N=O[$.id];if(N!=null&&String(N).length>0)return String(N);let se=oe.get(O.id)?.[$.id];return se!=null&&String(se).length>0?String(se):"-"},ke)})},[n,qe,oe]),Y=on({appId:"planning-gantt",title:e,columns:it,rows:re,rowKey:"id",rowsPerPage:-1,rowsPerPageOptions:[-1],count:re.length,showSummary:false}),le=Y.visibleRows;useEffect(()=>{let L=X.map($=>$.id);I($=>{let Z=new Set(L),te=$.filter(N=>Z.has(N)),ke=new Set(te),z=L.filter(N=>!ke.has(N)),O=[...te,...z];return O.length===$.length&&O.every((N,ne)=>N===$[ne])?$:O});},[X]);let Be=L=>L.type==="group"?`group-${L.id}`:`row-${(L.data||L)?.id}`,Ee=useMemo(()=>{let L=re.map(ne=>ta(ne.startDate)),$=re.map(ne=>ta(ne.endDate)),Z=p?ta(p):L.reduce((ne,se)=>se.isBefore(ne)?se:ne,L[0]??ta()),te=l?ta(l):$.reduce((ne,se)=>se.isAfter(ne)?se:ne,$[0]??ta().add(30,"day")),ke=i==="month"?"month":i==="week"?"week":i==="day"?"day":"hour",z=i==="month"?"month":i==="week"?"week":i==="day"?"day":"hour",O=i==="hour"?12:1,N=i==="hour"?12:1;return {start:Xg(Z.subtract(O,ke),i),end:Yg(te.add(N,z),i)}},[re,i,l,p]),Ue=yd.find(L=>L.value===i)??yd[1],ot=Array.isArray(o)?o:o?[o]:[],Fe=useMemo(()=>N1(Ee.start,Ee.end,i),[Ee.end,Ee.start,i]),_e=Fe.length*Ue.width,ht=(Y.columns||[]).filter(L=>Y.visibleColumns.includes(L.id)).reduce((L,$)=>L+(Y.columnWidths?.[$.id]||$.minWidth||100),0),j=T??ht,pe=R==="table",De=R==="timeline",Le=De?0:pe?"100%":j,We=R==="timeline",U=R==="table",ye=!We&&!U,be=pe?"minmax(0, 1fr) 0px 0px":De?"0px 0px minmax(0, 1fr)":`${j}px ${xd}px minmax(0, 1fr)`;useEffect(()=>{A(L=>L===null?null:Math.min(Math.max(L,vd),ht));},[ht]);let Pe=L=>{L.preventDefault(),L.currentTarget.setPointerCapture(L.pointerId),S(null),V.current={startX:L.clientX,startWidth:j};let $=te=>{let ke=V.current;if(!ke)return;let z=C.current?.clientWidth??0,O=z>0?Math.max(vd,z-xd-E1):ht,N=Math.min(Math.max(ke.startWidth+te.clientX-ke.startX,vd),O);A(N);},Z=()=>{V.current=null,window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",Z),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",$),window.addEventListener("pointerup",Z);},et=()=>{S(null),A(null);},Ge=L=>!f||!L?false:_.get(L)?.reorderable!==false,Tt=(L,$)=>{if(!L||!$||L===$||!Ge(L)||!Ge($))return false;if(Y.grouping.length===0)return true;let Z=_.get(L),te=_.get($);return !Z||!te?false:Y.grouping.every(ke=>Z[ke]===te[ke])},ro=(L,$)=>{if(!Tt(L,$))return;let Z=le.filter(ae=>ae.type!=="group").map(ae=>String((ae.data||ae)?.id)),te=Z.indexOf(L),ke=Z.indexOf($);if(te<0||ke<0)return;let z=[...Z];[z[te],z[ke]]=[z[ke],z[te]];let O=new Set(Z),N=de.map(ae=>ae.id),ne=[...z,...N.filter(ae=>!O.has(ae))],se=oe.get(L),we=oe.get($);if(Y.setOrder("asc"),Y.setOrderBy(""),I(ne),se&&we){let{level:ae,...Me}=se,{level:Te,...Ne}=we,Ie=ne.reduce((Re,Ve)=>{let It=oe.get(Ve);if(It){let{level:xo,...yt}=It;Re.push(yt);}return Re},[]);u?.(Ie,{activeTask:Me,targetTask:Ne});}},Yt=(L,$)=>{if(!Ge($.id)){L.preventDefault();return}L.stopPropagation(),L.dataTransfer.effectAllowed="move",L.dataTransfer.setData("text/plain",$.id),G({activeId:$.id,overId:null}),g?.(oe.get($.id)||$);},Ht=(L,$)=>{if(!Tt(D.activeId,$)){G(Z=>Z.overId===null?Z:{...Z,overId:null});return}L.preventDefault(),L.stopPropagation(),L.dataTransfer.dropEffect="move",G(Z=>Z.overId===$?Z:{...Z,overId:$});},Qt=(L,$)=>{let Z=D.activeId||L.dataTransfer.getData("text/plain");if(!Tt(Z,$)){G({activeId:null,overId:null});return}L.preventDefault(),L.stopPropagation(),ro(Z,$),G({activeId:null,overId:null});},ze=()=>{G({activeId:null,overId:null});},Ce=L=>{if(b.current)return;let $=L==="table"?m.current:y.current,Z=L==="table"?y.current:m.current;!$||!Z||(b.current=true,Z.scrollTop=$.scrollTop,window.requestAnimationFrame(()=>{b.current=false;}));};return useLayoutEffect(()=>{if(!c||U)return;let L=y.current,$=m.current;if(!L)return;let Z=`row-${c}`,te=Array.from(L.querySelectorAll("[data-planning-timeline-row-key]")).find(O=>O.dataset.planningTimelineRowKey===Z),ke=_.get(c);if(!te||!ke)return;let z=window.requestAnimationFrame(()=>{let O=L.getBoundingClientRect(),N=te.getBoundingClientRect(),ne=Math.max(1,L.clientHeight-v),se=L.scrollTop+N.top-O.top-v-(ne-N.height)/2;b.current=true,L.scrollTop=Math.max(0,se),$&&!We&&($.scrollTop=L.scrollTop);let we=Cd(ta(ke.startDate),Fe,Ue.width),ae=Math.max(0,we-Ue.width);L.scrollLeft=Math.min(ae,Math.max(0,_e-L.clientWidth)),window.requestAnimationFrame(()=>{b.current=false;});});return ()=>window.cancelAnimationFrame(z)},[Ue.width,v,c,We,_,U,le,_e,Fe]),useLayoutEffect(()=>{let L=m.current;if(!L)return;let $=0,Z=()=>{let N=L.querySelector("thead"),ne=Array.from(L.querySelectorAll("tbody tr[data-planning-row-key]"));if(ne.length===0)return;let se=N?.getBoundingClientRect().height||bd,we={};ne.forEach(ae=>{let Me=ae.dataset.planningRowKey;Me&&(we[Me]=ae.getBoundingClientRect().height);}),M(ae=>Math.abs(ae-se)<.01?ae:se),P(ae=>{let Me=Object.keys(ae),Te=Object.keys(we);return Me.length===Te.length&&Te.every(Ne=>Math.abs((ae[Ne]??0)-we[Ne])<.01)?ae:we});},te=()=>{window.cancelAnimationFrame($),$=window.requestAnimationFrame(Z);};if(Z(),typeof ResizeObserver>"u")return window.addEventListener("resize",te),()=>{window.cancelAnimationFrame($),window.removeEventListener("resize",te);};let ke=new ResizeObserver(te),z=L.querySelector("table"),O=L.querySelector("thead");return z&&ke.observe(z),O&&ke.observe(O),L.querySelectorAll("tbody tr[data-planning-row-key]").forEach(N=>ke.observe(N)),window.addEventListener("resize",te),()=>{window.cancelAnimationFrame($),ke.disconnect(),window.removeEventListener("resize",te);}},[le,Y.visibleColumns,Y.grouping,Y.columnWidths]),jsxs(Ti,{elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:3,border:`1px solid ${d.palette.divider}`,backgroundColor:d.palette.background.paper,...w},children:[jsxs(Stack,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"stretch",md:"center"},spacing:2,sx:{px:2,py:1.75,borderBottom:`1px solid ${d.palette.divider}`},children:[jsxs(Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[jsx(Box,{sx:{width:38,height:38,borderRadius:2,display:"grid",placeItems:"center",backgroundColor:"primary.main",color:"primary.contrastText"},children:jsx(w1,{fontSize:"small"})}),jsxs(Box,{children:[jsx(Typography,{sx:{fontSize:18,fontWeight:800},children:e}),jsx(Typography,{variant:"body2",sx:{color:"text.secondary"},children:t})]})]}),jsxs(Stack,{direction:"row",spacing:1,alignItems:"center",sx:{flexWrap:"wrap"},children:[ot.length>0&&jsx(Stack,{direction:"row",spacing:.75,alignItems:"center",children:ot.map((L,$)=>jsx(Box,{sx:{display:"flex",alignItems:"center"},children:L},`planning-extra-tool-${$}`))}),jsxs(Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsx(Qa,{tooltip:"Column visibility",onClick:L=>Y.setAnchorEl(L.currentTarget),color:"default",children:jsx(gh,{fontSize:"small"})}),jsx(Qa,{tooltip:"Group by",onClick:L=>Y.setGroupAnchorEl(L.currentTarget),color:"default",children:jsx(yh,{fontSize:"small"})}),jsx(Qa,{tooltip:"Sort by first visible column",onClick:()=>{let L=(Y.columns||[]).find($=>Y.visibleColumns.includes($.id));L&&Y.handleRequestSort(L.id);},color:Y.orderBy?"primary":"default",children:jsx(A1,{fontSize:"small"})})]}),jsxs(Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsx(Qa,{tooltip:"Expand task table",onClick:()=>S("table"),color:R==="table"?"primary":"default",children:jsx(D1,{fontSize:"small"})}),jsx(Qa,{tooltip:"Reset split",onClick:et,color:R===null?"primary":"default",children:jsx(M1,{fontSize:"small"})}),jsx(Qa,{tooltip:"Expand timeline",onClick:()=>S("timeline"),color:R==="timeline"?"primary":"default",children:jsx(R1,{fontSize:"small"})})]}),jsx(Box,{sx:{minWidth:120},children:jsx(Gg,{label:"",value:i,options:yd.map(L=>({value:L.value,label:L.label})),onChange:L=>s?.(L.target.value),sx:{"& .MuiSelect-select":{fontSize:"0.92rem",py:.65},"& .MuiSvgIcon-root":{fontSize:20}}})})]})]}),re.length===0?jsx(Box,{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:h}):jsx(Box,{sx:{overflow:"hidden",flex:1,minHeight:0},children:jsxs(Box,{ref:C,sx:{height:"100%",display:"grid",gridTemplateColumns:be,transition:`grid-template-columns ${Ja}`},children:[jsx(TableContainer,{"data-planning-scroll-pane":"table",ref:m,onScroll:()=>Ce("table"),sx:{width:Le,height:a,overflowX:"auto",overflowY:"auto",opacity:We?0:1,transform:We?"translateX(-10px)":"translateX(0)",pointerEvents:We?"none":"auto",transition:`opacity ${Ja}, transform ${Ja}, width ${Ja}`},children:jsxs(Table,{size:"small",stickyHeader:true,sx:{tableLayout:"fixed",width:ht,"& thead .MuiTableCell-root":{height:bd,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[jsx(Bi,{columns:Y.columns,visibleColumns:Y.visibleColumns,order:Y.order,orderBy:Y.orderBy,onRequestSort:Y.handleRequestSort,grouping:Y.grouping,isAllExpanded:Y.isAllExpanded,handleToggleAll:Y.handleToggleAll,columnWidths:Y.columnWidths,onColumnResize:Y.handleColumnResize}),jsx(TableBody,{children:le.map(L=>{let $=Be(L);if(L.type==="group")return jsxs(TableRow,{"data-planning-row-key":$,sx:{height:Ar,backgroundColor:d.palette.action.hover},children:[Y.grouping.length>0&&jsx(TableCell,{sx:{width:44,height:Ar,py:0,borderBottom:`1px solid ${d.palette.divider}`},children:jsx(IconButton,{size:"small",onClick:()=>Y.toggleGroupExpand(L.id),children:L.isExpanded?jsx(Wh,{fontSize:"small"}):jsx(wh,{fontSize:"small"})})}),jsx(TableCell,{colSpan:Y.visibleColumns.length,sx:{height:Ar,py:0,borderBottom:`1px solid ${d.palette.divider}`},children:jsxs(Typography,{sx:{fontSize:13,fontWeight:700},children:[L.field,": ",L.value," (",L.count,")"]})})]},L.id);let Z=L.data||L,te=Z.id===c,ke=Ge(Z.id),z=D.activeId===Z.id,O=D.overId===Z.id&&Tt(D.activeId,Z.id);return jsxs(TableRow,{"data-planning-row-key":$,draggable:ke,hover:true,selected:te,onDragStart:N=>Yt(N,Z),onDragOver:N=>Ht(N,Z.id),onDragEnter:N=>Ht(N,Z.id),onDrop:N=>Qt(N,Z.id),onDragEnd:ze,onClick:()=>g?.(oe.get(Z.id)||Z),sx:{cursor:z?"grabbing":ke?"grab":g?"pointer":"default",height:Ar,opacity:z?.56:1,"& .MuiTableCell-root":O?{borderTop:`2px solid ${d.palette.primary.main}`}:void 0,transition:"background-color 120ms ease, opacity 120ms ease"},children:[Y.grouping.length>0&&jsx(TableCell,{sx:{width:44,height:Ar,py:0,borderBottom:`1px solid ${d.palette.divider}`}}),(Y.columns||[]).filter(N=>Y.visibleColumns.includes(N.id)).map(N=>jsx(TableCell,{sx:{width:Y.columnWidths?.[N.id]||N.minWidth||100,height:Ar,py:0,overflow:"hidden",borderBottom:`1px solid ${d.palette.divider}`},children:N.render?N.render(Z[N.id],Z):String(Z[N.id]??"-")},`${Z.id}-${N.id}`))]},Z.id)})})]})}),jsx(Box,{onPointerDown:ye?Pe:void 0,role:"separator","aria-orientation":"vertical",sx:{width:ye?xd:0,cursor:ye?"col-resize":"default",opacity:ye?1:0,pointerEvents:ye?"auto":"none",borderLeft:ye?`1px solid ${d.palette.divider}`:"0 solid transparent",borderRight:ye?`1px solid ${d.palette.divider}`:"0 solid transparent",backgroundColor:d.palette.mode==="dark"?"rgba(148,163,184,0.10)":"rgba(15,23,42,0.04)",transition:`width ${Ja}, opacity ${Ja}, 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:ye?"col-resize":"default"}}}),jsx(Box,{sx:{minWidth:0,overflow:"hidden",opacity:U?0:1,transform:U?"translateX(10px)":"translateX(0)",pointerEvents:U?"none":"auto",transition:`opacity ${Ja}, transform ${Ja}`},children:jsx(Box,{"data-planning-scroll-pane":"timeline",ref:y,onScroll:()=>Ce("timeline"),sx:{width:"100%",height:a,overflowX:"auto",overflowY:"auto"},children:jsxs(Box,{sx:{width:_e},children:[jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Fe.length}, ${Ue.width}px)`,height:v,boxSizing:"border-box",borderBottom:`1px solid ${d.palette.divider}`,position:"sticky",top:0,zIndex:2,backgroundColor:d.palette.background.paper},children:Fe.map(L=>jsxs(Box,{title:L.title,sx:{px:.75,display:"flex",flexDirection:L.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:L.contextLabel?.15:0,borderRight:`1px solid ${d.palette.divider}`,color:L.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[L.contextLabel&&jsx(Typography,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"text.secondary",fontSize:11,fontWeight:700,lineHeight:1.1},children:L.contextLabel}),jsx(Typography,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:L.label})]},L.key))}),jsx(Stack,{sx:{position:"relative"},children:le.map(L=>{let $=Be(L),Z=B[$]??Ar;if(L.type==="group")return jsx(Box,{"data-planning-timeline-row-key":$,sx:{position:"relative",height:Z,boxSizing:"border-box",borderBottom:`1px solid ${d.palette.divider}`,backgroundColor:d.palette.action.hover}},L.id);let te=L.data||L,ke=ta(te.startDate),z=ta(te.endDate),O=Cd(ke,Fe,Ue.width),N=Cd(z,Fe,Ue.width),ne=Math.max(18,N-O),se=jg(te.progress),we=te.id===c,ae=Ge(te.id),Me=D.activeId===te.id,Te=D.overId===te.id&&Tt(D.activeId,te.id),Ne=te.color??(te.statusTone==="blocked"?d.palette.error.main:d.palette.primary.main);return jsx(Box,{"data-planning-timeline-row-key":$,draggable:ae,onDragStart:Ie=>Yt(Ie,te),onDragOver:Ie=>Ht(Ie,te.id),onDragEnter:Ie=>Ht(Ie,te.id),onDrop:Ie=>Qt(Ie,te.id),onDragEnd:ze,onClick:()=>g?.(oe.get(te.id)||te),sx:{position:"relative",height:Z,boxSizing:"border-box",borderBottom:`1px solid ${d.palette.divider}`,opacity:Me?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:d.palette.primary.main,opacity:Te?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:d.palette.mode==="dark"?"linear-gradient(90deg, rgba(148,163,184,0.08) 1px, transparent 1px)":"linear-gradient(90deg, rgba(15,23,42,0.06) 1px, transparent 1px)",backgroundSize:`${Ue.width}px 100%`,cursor:Me?"grabbing":ae?"grab":g?"pointer":"default",transition:"opacity 120ms ease"},children:jsx(Tooltip,{title:`${te.title}: ${ke.format("MMM D HH:mm")} - ${z.format("MMM D HH:mm")}`,children:jsxs(Box,{sx:{position:"absolute",left:O,top:Math.max(8,(Z-24)/2),width:ne,height:24,borderRadius:999,overflow:"hidden",backgroundColor:d.palette.mode==="dark"?"rgba(148,163,184,0.18)":"rgba(15,23,42,0.10)",outline:we?`2px solid ${d.palette.warning.main}`:"none",outlineOffset:2},children:[jsx(Box,{sx:{height:"100%",width:`${se}%`,backgroundColor:Ne}}),jsx(Typography,{sx:{position:"absolute",inset:0,px:1,display:"flex",alignItems:"center",color:"#fff",fontSize:11,fontWeight:800,textShadow:"0 1px 4px rgba(0,0,0,0.45)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:te.code})]})})},te.id)})})]})})})]})}),jsx(Wr,{groupAnchorEl:Y.groupAnchorEl,setGroupAnchorEl:Y.setGroupAnchorEl,grouping:Y.grouping,setGrouping:Y.setGrouping,columns:Y.columns,toggleGroupField:Y.toggleGroupField}),jsx($r,{anchorEl:Y.anchorEl,setAnchorEl:Y.setAnchorEl,columns:Y.columns,visibleColumns:Y.visibleColumns,toggleColumnVisibility:Y.toggleColumnVisibility})]})};var FV=({filterProps:e,ganttProps:t,spacing:o=2,sx:a,children:r})=>{let n=a?[{height:"100%",overflow:"hidden"},a]:{height:"100%",overflow:"hidden"},i=t.sx?[{height:"100%"},t.sx]:{height:"100%"};return jsxs(Stack,{spacing:o,sx:n,children:[jsx(Box,{sx:{flexShrink:0},children:jsx(ma,{...e})}),jsx(Box,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:jsx(Qg,{...t,bodyHeight:t.bodyHeight??"100%",sx:i})}),r]})};var K1={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)"}}},OV=({children:e,transitionKey:t,variant:o="fade",durationMs:a=220,delayMs:r=0,easing:n="cubic-bezier(0.22, 1, 0.36, 1)",disabled:i=false,sx:s})=>{let p=useMediaQuery("(prefers-reduced-motion: reduce)"),[l,c]=useState("to"),g=!i&&!p&&o!=="none";useEffect(()=>{if(!g){c("to");return}c("from");let h=requestAnimationFrame(()=>{h=requestAnimationFrame(()=>{c("to");});});return ()=>cancelAnimationFrame(h)},[t,g]);let f=K1[o],u=useMemo(()=>g?l==="from"?f.from:f.to:{opacity:1,transform:"none"},[g,l,f.from,f.to]);return jsx(Box,{sx:{willChange:g?"opacity, transform":"auto",transition:g?`opacity ${a}ms ${n} ${r}ms, transform ${a}ms ${n} ${r}ms`:"none",backfaceVisibility:"hidden",...u,...s},children:e})},HV={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};
17
- export{dN as AgentPanel,Ss as Button,aS as CAINavProvider,Cp as CAmapChart,Al as CAppHeader,lB as CAppPageLayout,$N as CAuthPage,On as CBarChart,Vi as CChartCard,sp as CComboChart,Tp as CCustomizeAgent,p2 as CDetailInfoPage,Cu as CDetailSearchAiBar,Cl as CDetailSectionCard,up as CFishboneChart,yp as CGoogleMapChart,kp as CGraphCharts,rp as CGraphKpiCards,Ji as CGraphReport,dp as CHeatmapChart,B2 as CKanbanBoard,Pu as CKanbanBucket,Sc as CKanbanCard,Zp as CLayoutManagement,pl as CLayoutManager,lp as CLineChart,An as CMessageBox,qd as CPageLayout,OV as CPageTransition,Ki as CPieChart,Z5 as CPivotTable,Qg as CPlanningGantt,FV as CPlanningLayout,ma as CSmartFilter,MM as CSmartTable,NM as CStandardPage,$a as CTable,TM as CTableBody,IM as CTableCell,PM as CTableContainer,RM as CTableHead,DM as CTableRow,Kd as CValueHelp,al as CVariantManagement,Lp as CVariantManager,td as CVoiceWaveOverlay,gp as CWaterfallChart,Yn as CodeBlock,bN as CopilotChat,XT as GlobalMessage,oi as MarkdownRenderer,Qn as MathBlock,cc as MermaidBlock,Bd as NavigationIsland,Mn as ORBCAFE_I18N_MESSAGES,Di as OrbcafeI18nProvider,HV as PAGE_TRANSITION_PRESETS,TF as PAppPageLayout,gE as PBarcodeScanner,Km as PNavIsland,DE as PNumericKeypad,Nm as PSmartFilter,zk as PTable,vE as PTouchCard,Hm as PWorkloadNav,fm as PivotChartPanel,Eg as StdChat,pc as TableBlock,xl as ThinkBlock,Ts as TreeMenu,VF as VoiceNavigatorProvider,MF as VoiceWaveOverlay,ji as buildAmapEmbedUrl,$n as buildGoogleMapEmbedUrl,NP as buildGoogleMapIframe,nf as buttonVariants,Mu as createKanbanBoardModel,Oo as findKanbanCard,ET as message,ca as messageManager,Il as moveKanbanCard,yl as parseMarkdownTable,FA as renderMarkdown,Yp as resolveVariantFilters,ul as resolveVariantLayout,rS as useAINav,QM as useAmapEmbedUrl,kN as useAuthPage,Su as useDetailInfo,YM as useGoogleMapEmbedUrl,qM as useGraphChartData,tl as useGraphInteraction,Qr as useGraphReport,N2 as useKanbanBoard,Fd as useNavigationIsland,ee as useOrbcafeI18n,nE as usePadLayout,sE as usePadRecordEditor,Hu as usePageLayout,eE as usePivotTable,Hg as usePlanningGantt,XN as usePlanningLayout,GM as useStandardReport,as as useVoiceInput,OF as useVoiceNavigator};
7
+ `),h={enableMath:r},m=0;for(;m<g.length;){let b=g[m],C=b.trim();if(!C){m+=1;continue}if(n&&Fp(b)){if(C.startsWith("<think>")){let p=[],f=b;for(;;){let y=f.indexOf("<think>"),k=y>=0?f.slice(y+7):f,E=k.indexOf("</think>");if(E>=0){p.push(k.slice(0,E)),m+=1;break}if(p.push(k),m+=1,m>=g.length)break;f=g[m];}c.push(jsx(Sl,{content:p.join(`
8
+ `).trim()},`think-tag-${m}`));continue}m+=1;let v=[];for(;m<g.length&&g[m].trim()!==":::";)v.push(g[m]),m+=1;m<g.length&&g[m].trim()===":::"&&(m+=1),c.push(jsx(Sl,{content:v.join(`
9
+ `).trim()},`think-fence-${m}`));continue}if(wl(b)){let v=C.slice(3).trim().toLowerCase(),p=[];for(m+=1;m<g.length&&!wl(g[m]);)p.push(g[m]),m+=1;m<g.length&&wl(g[m])&&(m+=1);let f=p.join(`
10
+ `);if(a&&v==="mermaid"){c.push(jsx(yc,{code:f},`mermaid-${m}`));continue}if(r&&["math","latex","katex"].includes(v)){c.push(jsx(oi,{expression:f,allowKatex:true},`math-fence-${m}`));continue}c.push(jsx(ti,{code:f,language:v||"text",copyable:i,showLineNumbers:s,wrapLongLines:true},`code-${m}`));continue}if(r&&C.startsWith("$$")){let v=[];if(C.endsWith("$$")&&C!=="$$")v.push(C.slice(2,-2)),m+=1;else {let f=b.slice(b.indexOf("$$")+2);for(f.trim()&&v.push(f),m+=1;m<g.length;){let y=g[m],k=y.indexOf("$$");if(k>=0){v.push(y.slice(0,k)),m+=1;break}v.push(y),m+=1;}}c.push(jsx(oi,{expression:v.join(`
11
+ `).trim(),allowKatex:true},`math-${m}`));continue}if(Ap(b)){let v=Math.min(6,b.match(/^#{1,6}/)?.[0]?.length||1),p=b.replace(/^#{1,6}\s+/,""),f=v===1?"h5":v===2?"h6":"subtitle1";c.push(jsx(Typography,{variant:f,sx:{mt:v===1?1.2:.8,mb:.5,fontWeight:700},children:ni(p,h,`h-${m}`)},`heading-${m}`)),m+=1;continue}if(Bp(b)){c.push(jsx(Divider,{sx:{my:1.2}},`hr-${m}`)),m+=1;continue}if(Ep(g,m)){let v=m+2;for(;v<g.length&&g[v].trim()&&g[v].includes("|");)v+=1;let p=g.slice(m,v).join(`
12
+ `),f=Cl(p);if(f){c.push(jsx(vc,{table:f},`table-${m}`)),m=v;continue}}if(Tc(b)){let v=[];for(;m<g.length&&Tc(g[m]);)v.push(g[m].replace(/^\s*>\s?/,"")),m+=1;c.push(jsx(Paper,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:jsx(Typography,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:v.map((p,f)=>jsxs(Fragment$1,{children:[f>0&&jsx("br",{}),ni(p,h,`q-${m}-${f}`)]},`quote-line-${f}`))})},`quote-${m}`));continue}if(Sc(b)){let v=[];for(;m<g.length&&Sc(g[m]);)v.push(g[m].trim().replace(/^[-*+]\s+/,"")),m+=1;c.push(jsx(Box,{component:"ul",sx:{my:.8,pl:2.5},children:v.map((p,f)=>jsx(Box,{component:"li",sx:{mb:.45},children:jsx(Typography,{variant:"body2",children:ni(p,h,`ul-${m}-${f}`)})},`ul-item-${f}`))},`ul-${m}`));continue}if(wc(b)){let v=[];for(;m<g.length&&wc(g[m]);)v.push(g[m].trim().replace(/^\d+\.\s+/,"")),m+=1;c.push(jsx(Box,{component:"ol",sx:{my:.8,pl:2.7},children:v.map((p,f)=>jsx(Box,{component:"li",sx:{mb:.45},children:jsx(Typography,{variant:"body2",children:ni(p,h,`ol-${m}-${f}`)})},`ol-item-${f}`))},`ol-${m}`));continue}let u=[];for(;m<g.length;){let v=g[m],p=v.trim();if(!p||wl(v)||Ap(v)||Bp(v)||Sc(v)||wc(v)||Tc(v)||Ep(g,m)||n&&Fp(v)||r&&p.startsWith("$$"))break;u.push(v),m+=1;}u.length>0?c.push(jsx(Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:u.map((v,p)=>jsxs(Fragment$1,{children:[p>0&&jsx("br",{}),ni(v,h,`p-${m}-${p}`)]},`p-line-${p}`))},`p-${m}`)):m+=1;}return c},[d,r,a,n,i,s]);return jsx(Box,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:l})};var M2=(e,t)=>jsx(ii,{markdown:e,...t});var Np=({value:e,onChange:t,onSubmit:o,onVoiceInput:r,onClear:a,placeholder:n,statusText:i,loading:s=false,compact:d=false,showStatusText:l=true})=>jsxs(Stack,{spacing:.75,children:[jsxs(Box,{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:[jsx(Xd,{sx:{fontSize:d?16:18,color:"text.secondary"}}),jsx(InputBase,{fullWidth:true,value:e,onChange:c=>t(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),o());},placeholder:n,sx:{fontSize:d?"0.84rem":"0.9rem"}}),e&&a&&jsx(IconButton,{size:"small",onClick:a,children:jsx(hh,{sx:{fontSize:d?16:18}})}),r&&jsx(IconButton,{size:"small",onClick:r,children:jsx(cy,{sx:{fontSize:d?16:18}})}),jsx(IconButton,{size:"small",onClick:o,disabled:s||!e.trim(),children:jsx(uy,{sx:{fontSize:d?16:18}})})]}),l&&i&&jsx(Typography,{variant:"caption",color:"text.secondary",children:i})]});var Vp=(e,t)=>{let o=t.trim();if(!o)return e;let r=e.toLowerCase(),a=o.toLowerCase(),n=r.indexOf(a);return n<0?e:jsxs(Fragment,{children:[e.slice(0,n),jsx(Box,{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:e.slice(n,n+o.length)}),e.slice(n+o.length)]})},Tl=({section:e,highlightQuery:t=""})=>{let o=e.columns||2;return jsxs(Paper,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[jsx(Typography,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:e.title}),jsx(Box,{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:e.fields.map(r=>{let a=typeof r.value=="string"||typeof r.value=="number"?String(r.value):null;return jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:Vp(r.label,t)}),jsx(Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?Vp(a,t):r.value})]},r.id)})})]})};var Mc=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",Pl=e=>e.trim().toLowerCase(),W0=(e,t)=>{let o=[];return e.forEach(r=>{r.fields.forEach(a=>{let n=a.searchableText||Mc(a.value),i={source:"section",sourceId:r.id,sourceSectionId:r.id,sourceTitle:r.title,fieldId:a.id,fieldLabel:a.label,fieldValue:n};o.push({hit:i,text:Pl(`${r.title} ${a.label} ${n}`)});});}),t.forEach(r=>{(r.fields||[]).forEach(a=>{let n=a.searchableText||Mc(a.value),i={source:"tab",sourceId:r.id,sourceTitle:r.label,fieldId:a.id,fieldLabel:a.label,fieldValue:n};o.push({hit:i,text:Pl(`${r.label} ${a.label} ${n}`)});}),(r.sections||[]).forEach(a=>{a.fields.forEach(n=>{let i=n.searchableText||Mc(n.value),s={source:"tab",sourceId:r.id,sourceSectionId:a.id,sourceTitle:`${r.label} / ${a.title}`,fieldId:n.id,fieldLabel:n.label,fieldValue:i};o.push({hit:s,text:Pl(`${r.label} ${a.title} ${n.label} ${i}`)});});});}),o},Op=({sections:e,tabs:t=[],defaultTabId:o,ai:r})=>{let{t:a}=ee(),[n,i]=useState(""),[s,d]=useState(o||t[0]?.id),[l,c]=useState("idle"),[g,h]=useState([]),[m,b]=useState(""),[C,u]=useState(""),[v,p]=useState(false),f=useMemo(()=>W0(e,t),[e,t]);useEffect(()=>{if(t.length===0){d(void 0);return}t.some(D=>D.id===s)||d(o||t[0]?.id);},[t,s,o]);let y=useCallback(()=>{c("idle"),h([]),b(""),u("");},[]),k=useCallback(S=>{i(S),S.trim()||(c("idle"),h([]),b(""),u(""));},[]),E=useCallback(S=>{let D=Pl(S);return D?f.filter(P=>P.text.includes(D)).map(P=>P.hit):[]},[f]),M=useCallback(async()=>{let S=n.trim();if(!S)return;p(true);let D=E(S);if(h(D),D.length>0){c("search"),u(""),b(a("detail.searchAi.matches",{count:D.length})),p(false);return}if(r?.enabled!==false&&r?.onSubmit){c("ai"),b(a("detail.searchAi.autoAiFallback"));try{let w=await r.onSubmit(S,{query:S,hits:D,activeTabId:s,sections:e,tabs:t});u(typeof w=="string"?w:"");}finally{p(false);}return}c("search"),u(""),b(a("detail.searchAi.noMatch")),p(false);},[n,E,a,r,s,e,t]);return {query:n,setQuery:k,activeTabId:s,setActiveTabId:d,searchMode:l,hits:g,statusText:m,aiResponse:C,searching:v,handleSubmit:M,clearResult:y}};var lB=({title:e,subtitle:t,sections:o,tabs:r=[],defaultTabId:a,table:n,ai:i,rightHeaderSlot:s,searchBarWidth:d=460,onClose:l,closeLabel:c="Close"})=>{let{t:g}=ee(),{query:h,setQuery:m,activeTabId:b,setActiveTabId:C,searchMode:u,hits:v,statusText:p,aiResponse:f,searching:y,handleSubmit:k,clearResult:E}=Op({sections:o,tabs:r,defaultTabId:a,ai:i}),M=useMemo(()=>r.find(P=>P.id===b)||r[0],[r,b]),S=useCallback(P=>{let w=B=>{let R=document.getElementById(P);if(R){R.scrollIntoView({behavior:"smooth",block:"center"});return}B<4&&setTimeout(()=>w(B+1),60);};requestAnimationFrame(()=>w(0));},[]),D=useCallback((P,w)=>{if(r.some(B=>B.id===P)){C(P),S(w?`detail-tab-${P}-section-${w}`:`detail-tab-${P}`);return}S(`detail-section-${P}`);},[r,C,S]);return jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[jsxs(Stack,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:e}),t&&jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:t})]}),jsxs(Stack,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[jsx(Box,{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:jsx(Np,{value:h,onChange:m,onSubmit:k,onVoiceInput:i?.onVoiceInput,onClear:()=>{m(""),E();},placeholder:i?.placeholder||g("detail.searchAi.placeholder"),statusText:p,loading:y,compact:true,showStatusText:false})}),l&&jsx(Tooltip,{title:c,children:jsx(IconButton,{size:"small",onClick:l,children:jsx(_0,{fontSize:"small"})})}),s]})]}),p&&jsx(Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:p}),u==="search"&&v.length>0&&jsxs(Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:g("detail.searchAi.matches",{count:v.length})}),jsx(Stack,{spacing:.35,children:v.slice(0,8).map(P=>jsx(Box,{component:"button",type:"button",onClick:()=>D(P.sourceId,P.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:jsxs(Typography,{variant:"body2",sx:{fontSize:"0.84rem"},children:[jsx(Box,{component:"span",sx:{color:"text.secondary"},children:P.sourceTitle})," \xB7 ",jsx(Box,{component:"span",sx:{fontWeight:700},children:P.fieldLabel})," = ",jsx(Box,{component:"span",children:P.fieldValue||"-"})]})},`${P.source}|${P.sourceId}|${P.fieldId}`))})]}),u==="ai"&&f&&jsxs(Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsx(Typography,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:g("detail.searchAi.aiResultTitle")}),jsx(Box,{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:jsx(ii,{markdown:f})})]}),jsx(Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(P=>jsx(Box,{id:`detail-section-${P.id}`,children:jsx(Tl,{section:P,highlightQuery:h})},P.id))}),r.length>0&&jsxs(Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsx(Tabs,{value:M?.id||false,onChange:(P,w)=>C(w),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:r.map(P=>jsx(Tab,{value:P.id,label:P.label,sx:{textTransform:"none"}},P.id))}),jsxs(Box,{sx:{p:1.5},children:[jsx(Box,{id:`detail-tab-${M?.id||""}`}),M?.description&&jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:M.description}),M?.content?M.content:jsxs(Stack,{spacing:1.5,children:[(M?.sections||[]).map(P=>jsx(Box,{id:`detail-tab-${M?.id}-section-${P.id}`,children:jsx(Tl,{section:P,highlightQuery:h})},P.id)),M?.fields&&M.fields.length>0&&jsx(Tl,{section:{id:`${M.id}-fields`,title:M.label,fields:M.fields,columns:2},highlightQuery:h})]})]})]}),n&&jsx(Xr,{title:n.title||g("detail.table.title"),...n.tableProps,filterConfig:void 0,fitContainer:false})]})};var Gp=({bucket:e,cardCount:t,highlighted:o=false,children:r,emptyLabel:a,maxHeight:n,sx:i})=>{let{t:s}=ee();return jsx(Paper,{sx:[d=>{let l=e.accentColor??d.palette.primary.main;return {position:"relative",minWidth:0,borderRadius:4,overflow:"hidden",border:`1px solid ${alpha(l,o?.58:d.palette.mode==="dark"?.28:.18)}`,bgcolor:alpha(d.palette.background.paper,d.palette.mode==="dark"?.92:.97),boxShadow:o?`0 18px 40px ${alpha(l,.22)}`:`0 10px 28px ${alpha(d.palette.common.black,d.palette.mode==="dark"?.18:.08)}`,transition:"border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease","&::before":{content:'""',display:"block",height:4,bgcolor:l}}},...Array.isArray(i)?i:i?[i]:[]],children:jsxs(Stack,{spacing:1.2,sx:{p:1.5},children:[jsxs(Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxs(Box,{sx:{minWidth:0},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[e.icon,jsx(Typography,{sx:{fontSize:"0.96rem",fontWeight:800},children:e.title})]}),e.description&&jsx(Typography,{sx:{mt:.45,fontSize:"0.76rem",color:"text.secondary",lineHeight:1.45},children:e.description})]}),jsxs(Stack,{direction:"row",spacing:.8,sx:{flexShrink:0},children:[jsx(Chip,{size:"small",label:t,sx:{fontWeight:700}}),typeof e.limit=="number"&&jsx(Chip,{size:"small",label:`${s("kanban.bucket.limit")} ${e.limit}`,color:t>e.limit?"warning":"default",variant:"outlined"})]})]}),o&&jsx(Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700},children:s("kanban.bucket.dropHere")}),jsx(Box,{sx:{minHeight:220,maxHeight:n,overflowY:n?"auto":"visible",pr:n?.4:0},children:t>0?r:jsx(Box,{sx:d=>({minHeight:160,borderRadius:3,border:`1px dashed ${alpha(d.palette.divider,.9)}`,bgcolor:d.palette.mode==="dark"?alpha(d.palette.common.white,.02):alpha(d.palette.primary.main,.03),display:"grid",placeItems:"center",px:2,textAlign:"center"}),children:jsx(Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:a??e.emptyLabel??s("kanban.empty")})})})]})})};var Q0={success:"success",warning:"warning",info:"info",error:"error"},J0={critical:"error",high:"warning",medium:"info",low:"success"},ev=(e,t)=>{switch(e){case "critical":return t("kanban.priority.critical");case "high":return t("kanban.priority.high");case "medium":return t("kanban.priority.medium");case "low":return t("kanban.priority.low");default:return e}},tv=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",Bc=({card:e,bucket:t,dragging:o=false,overlay:r=false,onClick:a,sx:n})=>{let{t:i}=ee(),s=!!(a&&t),d=e.tone??(e.priority?J0[e.priority]:"default"),l=d==="default"?"primary":Q0[d],c=t?{card:e,bucket:t}:void 0;return jsx(Paper,{onClick:s?()=>c&&a?.(c):void 0,onKeyDown:s?g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),c&&a?.(c));}:void 0,role:s?"button":void 0,tabIndex:s?0:void 0,sx:[g=>{let h=d==="default"?g.palette.primary.main:g.palette[l].main;return {position:"relative",overflow:"hidden",p:1.4,borderRadius:3,border:`1px solid ${alpha(h,g.palette.mode==="dark"?.42:.2)}`,bgcolor:alpha(g.palette.background.paper,g.palette.mode==="dark"?.96:.98),boxShadow:r?`0 20px 45px ${alpha(g.palette.common.black,.24)}`:o?"none":`0 8px 24px ${alpha(g.palette.common.black,g.palette.mode==="dark"?.18:.08)}`,transform:r?"rotate(1deg) scale(1.01)":"none",transition:"transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease",cursor:s?"pointer":"default",opacity:o?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:4,bgcolor:h},"&:hover":s?{transform:"translateY(-1px)",boxShadow:`0 14px 32px ${alpha(g.palette.common.black,g.palette.mode==="dark"?.28:.12)}`}:void 0}},...Array.isArray(n)?n:n?[n]:[]],children:jsxs(Stack,{spacing:1.1,children:[jsxs(Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxs(Box,{sx:{minWidth:0,flex:1},children:[(e.kicker||t?.title)&&jsx(Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:.4,color:"text.secondary",textTransform:"uppercase"},children:e.kicker??t?.title}),jsx(Typography,{sx:{mt:.2,fontSize:"0.98rem",fontWeight:800,lineHeight:1.3},children:e.title})]}),e.priority&&jsx(Chip,{size:"small",color:l,label:ev(e.priority,i),variant:d==="default"?"outlined":"filled",sx:{height:22,fontWeight:700}})]}),e.summary&&jsx(Typography,{sx:{fontSize:"0.82rem",color:"text.secondary",lineHeight:1.5},children:e.summary}),e.metrics&&e.metrics.length>0&&jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(e.metrics.length,3)}, minmax(0, 1fr))`,gap:.9},children:e.metrics.slice(0,3).map(g=>jsxs(Box,{sx:h=>({borderRadius:2,px:1,py:.8,bgcolor:h.palette.mode==="dark"?alpha(h.palette.common.white,.05):alpha(h.palette.primary.main,.05)}),children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",textTransform:"uppercase",letterSpacing:.35},children:g.label}),jsx(Typography,{sx:{fontSize:"0.86rem",fontWeight:700},children:g.value})]},g.id))}),typeof e.progress=="number"&&jsxs(Box,{children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:i("kanban.card.progress")}),jsxs(Typography,{sx:{fontSize:"0.72rem",fontWeight:700},children:[Math.round(e.progress),"%"]})]}),jsx(LinearProgress,{variant:"determinate",value:Math.max(0,Math.min(100,e.progress)),color:l,sx:{height:8,borderRadius:999}})]}),(e.tags?.length||e.assignee||e.dueDate||e.footer||s)&&jsxs(Stack,{spacing:.9,children:[e.tags&&e.tags.length>0&&jsx(Box,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:e.tags.map(g=>jsx(Chip,{size:"small",label:g.label,color:g.color??"default",variant:"outlined"},g.id))}),jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8,minWidth:0},children:[e.assignee&&jsxs(Fragment,{children:[jsx(Avatar,{src:e.assignee.avatarSrc,sx:{width:28,height:28,fontSize:"0.75rem"},children:e.assignee.initials??tv(e.assignee.name)}),jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{sx:{fontSize:"0.78rem",fontWeight:700,lineHeight:1.2},noWrap:true,children:e.assignee.name}),e.dueDate&&jsx(Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},noWrap:true,children:e.dueDate})]})]}),!e.assignee&&e.dueDate&&jsx(Typography,{sx:{fontSize:"0.76rem",color:"text.secondary"},children:e.dueDate})]}),s&&jsx(Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700,whiteSpace:"nowrap"},children:i("kanban.card.openDetail")})]}),e.footer]})]})})};var rv=(e,t)=>Number.isNaN(e)||e<0?0:e>t?t:e,qp=({buckets:e,cards:t})=>{let o=new Map;return t.forEach((r,a)=>{let n=o.get(r.bucketId)??[];n.push({card:r,sourceIndex:a}),o.set(r.bucketId,n);}),{buckets:e.map(r=>{let a=[...o.get(r.id)??[]].sort((n,i)=>n.card.position===void 0&&i.card.position===void 0?n.sourceIndex-i.sourceIndex:n.card.position===void 0?1:i.card.position===void 0?-1:n.card.position-i.card.position||n.sourceIndex-i.sourceIndex).map(({card:n},i)=>({...n,bucketId:r.id,position:i}));return {...r,cards:a}})}},er=(e,t)=>{for(let o=0;o<e.buckets.length;o+=1){let r=e.buckets[o],a=r.cards.findIndex(n=>n.id===t);if(a>=0)return {card:r.cards[a],bucket:r,bucketIndex:o,cardIndex:a}}},Ml=(e,t)=>{let o=er(e,t.cardId);if(!o)return e;let r=e.buckets.findIndex(l=>l.id===t.toBucketId);if(r<0)return e;let a=e.buckets.map(l=>({...l,cards:l.cards.map(c=>({...c}))})),n=a[o.bucketIndex],[i]=n.cards.splice(o.cardIndex,1);if(!i)return e;let s=a[r],d=rv(t.targetIndex??s.cards.length,s.cards.length);return s.cards.splice(d,0,{...i,bucketId:t.toBucketId}),{buckets:a.map(l=>({...l,cards:l.cards.map((c,g)=>({...c,bucketId:l.id,position:g}))}))}};var Ec="kanban-card|",Fc="kanban-bucket|",Xp=e=>`${Ec}${e}`,hv=e=>`${Fc}${e}`,Al=e=>e?.startsWith(Ec)?e.slice(Ec.length):void 0,Zp=e=>e?.startsWith(Fc)?e.slice(Fc.length):void 0,bv=({card:e,bucket:t,onCardClick:o})=>{let{setNodeRef:r,attributes:a,listeners:n,transform:i,transition:s,isDragging:d}=useSortable({id:Xp(e.id)}),l={transform:i?`translate3d(${i.x}px, ${i.y}px, 0)`:void 0,transition:s,zIndex:d?2:1,touchAction:"none",cursor:d?"grabbing":"grab"};return jsx(Box,{ref:r,style:l,...a,...n,children:jsx(Bc,{card:e,bucket:t,dragging:d,onClick:o})})},yv=({bucket:e,highlighted:t,bucketMaxHeight:o,emptyBucketLabel:r,onCardClick:a})=>{let{isOver:n,setNodeRef:i}=useDroppable({id:hv(e.id)});return jsx(Box,{ref:i,sx:{minWidth:0},children:jsx(Gp,{bucket:e,cardCount:e.cards.length,highlighted:t||n,emptyLabel:r,maxHeight:o,children:jsx(SortableContext,{items:e.cards.map(s=>Xp(s.id)),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:1,children:e.cards.map(s=>jsx(bv,{card:s,bucket:e,onCardClick:a},s.id))})})})})},RB=({model:e,onCardMove:t,onCardClick:o,minBucketWidth:r=320,bucketMaxHeight:a,emptyBucketLabel:n,sx:i})=>{let[s,d]=useState(null),[l,c]=useState(),g=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:6}}),useSensor(TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),h=useMemo(()=>s?er(e,s):void 0,[s,e]),m=useCallback(()=>{d(null),c(void 0);},[]),b=useCallback(p=>{if(!p)return;let f=Al(p);return f?er(e,f)?.bucket.id:Zp(p)},[e]),C=useCallback(p=>{d(Al(String(p.active.id))??null);},[]),u=useCallback(p=>{c(b(p.over?String(p.over.id):void 0));},[b]),v=useCallback(p=>{let f=Al(String(p.active.id)),y=p.over?String(p.over.id):void 0;if(!f||!y){m();return}let k=er(e,f);if(!k){m();return}let E=k.bucket.id,M=k.cardIndex,S=Al(y);if(S){let w=er(e,S);if(!w){m();return}E=w.bucket.id,M=w.cardIndex;}else {let w=Zp(y),B=e.buckets.find(R=>R.id===w);if(!w||!B){m();return}E=w,M=B.cards.length;}if(k.bucket.id===E&&k.cardIndex===M){m();return}let D=Ml(e,{cardId:f,fromBucketId:k.bucket.id,toBucketId:E,targetIndex:M}),P=er(D,f);P&&!(P.bucket.id===k.bucket.id&&P.cardIndex===k.cardIndex)&&t?.({cardId:f,fromBucketId:k.bucket.id,toBucketId:P.bucket.id,targetIndex:P.cardIndex,card:P.card,model:D}),m();},[e,t,m]);return jsxs(DndContext,{sensors:g,collisionDetection:closestCorners,onDragStart:C,onDragOver:u,onDragEnd:v,onDragCancel:m,children:[jsx(Box,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${r}px, 1fr)`,gap:2,alignItems:"start",overflowX:"auto",pb:.5},...Array.isArray(i)?i:i?[i]:[]],children:e.buckets.map(p=>jsx(yv,{bucket:p,highlighted:p.id===l,bucketMaxHeight:a,emptyBucketLabel:n,onCardClick:o},p.id))}),jsx(DragOverlay,{children:h?jsx(Box,{sx:{width:Math.max(r-24,260)},children:jsx(Bc,{card:h.card,bucket:h.bucket,overlay:true})}):null})]})};var kv=({initialModel:e,initialBuckets:t,initialCards:o})=>e||qp({buckets:t??[],cards:o??[]}),EB=e=>{let{onCardMove:t,onCardClick:o}=e,[r,a]=useState(()=>kv(e)),n=useCallback(c=>{a(g=>typeof c=="function"?c(g):c);},[]),i=useCallback(c=>er(r,c),[r]),s=useCallback((c,g,h)=>{let m=er(r,c);if(!m)return;let b=Ml(r,{cardId:c,fromBucketId:m.bucket.id,toBucketId:g,targetIndex:h}),C=er(b,c);if(!C||C.bucket.id===m.bucket.id&&C.cardIndex===m.cardIndex)return;a(b);let u={cardId:c,fromBucketId:m.bucket.id,toBucketId:C.bucket.id,targetIndex:C.cardIndex,card:C.card,model:b};return t?.(u),u},[r,t]),d=useCallback((c,g)=>{a(h=>({buckets:h.buckets.map(m=>({...m,cards:m.cards.map(b=>b.id!==c?b:typeof g=="function"?g(b):{...b,...g})}))}));},[]),l=useMemo(()=>({model:r,onCardMove:c=>{s(c.cardId,c.toBucketId,c.targetIndex);},onCardClick:o}),[r,s,o]);return {model:r,actions:{replaceModel:n,moveCard:s,updateCard:d,getCard:i},boardProps:l}};var em=64,Nv="#E9EDF2",Vv="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",Ov=["en","zh","fr","de","ja","ko"],tm={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},Ll=({appTitle:e,logo:t,mode:o="dark",onToggleMode:r,locale:a,localeLabel:n,localeOptions:i,onLocaleChange:s,searchPlaceholder:d,onSearch:l,user:c,onUserSetting:g,onUserLogout:h,userMenuItems:m,leftSlot:b,rightSlot:C})=>{let{t:u,locale:v}=ee(),f=useTheme().palette.mode==="dark",[y,k]=useState(""),[E,M]=useState(null),[S,D]=useState(null),P=Y=>{Y.preventDefault(),l&&l(y.trim());},w=o==="system"?jsx(Bv,{fontSize:"small"}):o==="dark"?jsx(Ev,{fontSize:"small"}):jsx(Fv,{fontSize:"small"}),B=u(o==="system"?"header.theme.system":o==="dark"?"header.theme.dark":"header.theme.light"),R=a||v,I=i&&i.length>0?i:Ov,A=n||tm[R]||R.toUpperCase(),q=!!E,O=d||u("header.searchPlaceholder"),K=!!S,Q=[{key:"setting",label:u("header.menu.setting"),icon:jsx(lx,{sx:{fontSize:18}}),onClick:g},{key:"logout",label:u("header.menu.logout"),icon:jsx(zv,{sx:{fontSize:18}}),onClick:h}],ne=m&&m.length>0?m:Q,ie=Y=>{D(null),Y?.();};return jsxs(AppBar,{position:"sticky",elevation:0,sx:Y=>({top:0,zIndex:Y.zIndex.drawer+10,height:em,backgroundColor:Y.palette.mode==="dark"?"#0D0D0D":Nv,backgroundImage:Y.palette.mode==="dark"?["radial-gradient(circle at 18% 22%, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 45%)","radial-gradient(circle at 78% 32%, rgba(144,202,249,0.14) 0%, rgba(144,202,249,0) 42%)","linear-gradient(90deg, #0A0A0A 0%, #151515 50%, #0A0A0A 100%)","linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px)","linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px)"].join(","):["radial-gradient(circle at 22% 22%, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 48%)","radial-gradient(circle at 76% 24%, rgba(203,213,225,0.45) 0%, rgba(203,213,225,0) 42%)",Vv,"linear-gradient(rgba(15,23,42,0.05) 1px, transparent 1px)","linear-gradient(90deg, rgba(15,23,42,0.04) 1px, transparent 1px)"].join(","),backgroundSize:"auto, auto, auto, 24px 24px, 24px 24px",borderBottom:"1px solid",borderColor:Y.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)"}),children:[jsxs(Toolbar,{sx:{minHeight:`${em}px !important`,px:2,gap:2},children:[jsxs(Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[b,t===null?null:t||jsx(Box,{component:"img",src:"/orbcafe.png",alt:"ORBCAFE Logo",sx:{width:44,height:44,display:"block",objectFit:"contain",flexShrink:0}}),e&&jsx(Typography,{variant:"h6",sx:{fontWeight:700,color:f?"common.white":"#111827"},children:e})]}),jsx(Box,{sx:{flex:1,display:"flex",justifyContent:"center",minWidth:0},children:jsx(Box,{component:"form",onSubmit:P,sx:{width:"100%",maxWidth:540},children:jsx(TextField,{size:"small",fullWidth:true,value:y,onChange:Y=>k(Y.target.value),placeholder:O,InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Xd,{sx:{color:f?"rgba(255,255,255,0.7)":"rgba(15,23,42,0.55)",fontSize:18}})}),sx:{color:f?"common.white":"rgba(17,24,39,0.9)",bgcolor:f?"rgba(255,255,255,0.08)":"#ffffff",borderRadius:999,"& .MuiOutlinedInput-notchedOutline":{borderColor:f?"rgba(255,255,255,0.15)":"rgba(15,23,42,0.2)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:f?"rgba(255,255,255,0.35)":"rgba(15,23,42,0.35)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:f?"rgba(255,255,255,0.5)":"rgba(15,23,42,0.55)"}}},inputProps:{style:{color:f?"white":"#111827"}}})})}),jsxs(Stack,{direction:"row",alignItems:"center",spacing:1.5,children:[s?jsxs(Fragment,{children:[jsx(IconButton,{size:"small",onClick:Y=>M(Y.currentTarget),sx:{color:f?"common.white":"#111827",borderRadius:1,px:.5},children:jsxs(Stack,{direction:"row",alignItems:"center",spacing:.45,children:[jsx(Jp,{sx:{fontSize:18}}),jsx(Typography,{variant:"caption",sx:{fontWeight:500},children:A})]})}),jsx(Menu,{anchorEl:E,open:q,onClose:()=>M(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:I.map(Y=>jsx(MenuItem,{selected:Y===R,onClick:()=>{s(Y),M(null);},sx:{fontSize:"0.82rem"},children:tm[Y]},Y))})]}):jsxs(Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsx(Jp,{sx:{color:f?"common.white":"#111827",fontSize:18}}),jsx(Typography,{variant:"caption",sx:{color:f?"common.white":"#111827",fontWeight:500},children:A})]}),jsx(IconButton,{size:"small",sx:{color:f?"common.white":"#111827"},onClick:r,title:B,children:w}),c&&jsxs(Stack,{direction:"row",alignItems:"center",spacing:1,children:[jsxs(Box,{sx:{textAlign:"right",minWidth:0},children:[jsx(Typography,{variant:"body2",sx:{color:f?"common.white":"#111827",fontWeight:700,lineHeight:1.15},children:c.name}),c.subtitle&&jsx(Typography,{variant:"caption",sx:{display:"block",mt:.25,color:f?"rgba(255,255,255,0.72)":"rgba(17,24,39,0.62)",fontSize:"0.72rem",lineHeight:1.1,letterSpacing:"0.01em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:220},title:c.subtitle,children:c.subtitle})]}),jsx(IconButton,{size:"small",onClick:Y=>D(Y.currentTarget),sx:{p:0},children:jsx(Avatar,{src:c.avatarSrc,imgProps:{style:{objectFit:"cover"}},sx:{width:34,height:34,bgcolor:"grey.100",color:"grey.700",fontSize:"0.85rem"},children:c.avatarText||c.name.slice(0,1).toUpperCase()})})]}),C]})]}),c&&jsx(Menu,{anchorEl:S,open:K,onClose:()=>D(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{minWidth:160,"& .MuiMenuItem-root":{minHeight:34,py:.5,px:1.25}}}},children:ne.map(Y=>jsxs(MenuItem,{disabled:Y.disabled,onClick:()=>ie(Y.onClick),children:[Y.icon&&jsx(ListItemIcon,{children:Y.icon}),jsx(ListItemText,{primary:Y.label,slotProps:{primary:{sx:{fontSize:"0.86rem",fontWeight:500}}}})]},Y.key))})]})};var om=({menuData:e=[],initialNavigationCollapsed:t=false}={})=>{let{navigationIslandProps:o}=Gd({initialCollapsed:t,content:e}),[r,a]=useState(900);useEffect(()=>{let i=()=>a(window.innerHeight);return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);let n=useMemo(()=>Math.max(280,r-100),[r]);return {navigationIslandProps:o,navigationMaxHeight:n}};var rE=({appTitle:e,menuData:t=[],children:o,showNavigation:r=true,locale:a="en",localeLabel:n,localeOptions:i,onLocaleChange:s,user:d,onUserSetting:l,onUserLogout:c,userMenuItems:g,logo:h,onSearch:m,rightHeaderSlot:b,leftHeaderSlot:C,contentSx:u})=>{let v="orbcafe:page-layout-mode",[p,f]=useState("system"),[y,k]=useState("light"),[E,M]=useState(false),S=p==="system"?E?y:"light":p;useEffect(()=>{try{let I=window.localStorage.getItem(v);(I==="light"||I==="dark"||I==="system")&&f(I);}catch{}M(true);let B=window.matchMedia("(prefers-color-scheme: dark)"),R=()=>{k(B.matches?"dark":"light");};return R(),B.addEventListener("change",R),()=>B.removeEventListener("change",R)},[]),useEffect(()=>{if(E)try{window.localStorage.setItem(v,p);}catch{}},[E,p]),useEffect(()=>{S==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[S]);let D=useMemo(()=>createTheme({palette:{mode:S}}),[S]),{navigationIslandProps:P,navigationMaxHeight:w}=om({menuData:t,initialNavigationCollapsed:false});return jsx(ThemeProvider,{theme:D,children:jsx(Ei,{locale:a,children:jsxs(Box,{sx:B=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:B.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":B.palette.background.default}),children:[jsx(Ll,{appTitle:e,logo:h,mode:p,onToggleMode:()=>f(B=>B==="system"?"dark":B==="dark"?"light":"system"),locale:a,localeLabel:n,localeOptions:i,onLocaleChange:s,user:d,onUserSetting:l,onUserLogout:c,userMenuItems:g,onSearch:m,leftSlot:C,rightSlot:b}),jsxs(Box,{sx:{flex:1,minHeight:0,display:"flex"},children:[r&&jsx(Box,{sx:{p:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsx(Wd,{...P,maxHeight:w,colorMode:S})}),jsx(Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...u},children:o})]})]})})})};var Nl="(blank)",am="Result",nm="Grand Total",im={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},lm=["sum","count","avg","min","max"];var sm=["palette","rows","columns","filters","values"];var cm=e=>sm.includes(e),dm=e=>e==="rows"||e==="columns"||e==="filters",Vl=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&cm(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&cm(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},Pr=e=>e==null||e===""?Nl:e instanceof Date?e.toISOString().slice(0,10):String(e),Ia=e=>JSON.stringify(e),um=(e,t)=>{let o=e.join(""),r=t.join("");return o.localeCompare(r,void 0,{sensitivity:"base"})},_v=e=>{if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null},dn=(e,t,o)=>{if(o==="count")return e.length;let r=e.map(a=>_v(a[t])).filter(a=>a!==null);return r.length===0?0:o==="sum"?r.reduce((a,n)=>a+n,0):o==="avg"?r.reduce((a,n)=>a+n,0)/r.length:o==="min"?Math.min(...r):Math.max(...r)},Nt=(e,t)=>{if(!e||e.length===0)return [];let o=new Set,r=[];return e.forEach(a=>{!t.has(a)||o.has(a)||(o.add(a),r.push(a));}),r},Rr=(e,t)=>e.length!==t.length?false:e.every((o,r)=>o===t[r]),pm=(e,t)=>{let o=Object.keys(e),r=Object.keys(t);return o.length!==r.length?false:o.every(a=>{let n=e[a]??[],i=t[a]??[];return Rr(n,i)})},Ol=(e,t)=>e.length!==t.length?false:e.every((o,r)=>{let a=t[r];return o.tokenId===a.tokenId&&o.fieldId===a.fieldId&&o.aggregation===a.aggregation}),Oc=e=>!e?.aggregations||e.aggregations.length===0?lm:e.aggregations,lo=(e,t)=>{let o=Oc(t);return e&&o.includes(e)?e:t?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},mi=(e,t,o)=>{let r=o.get(t.fieldId);return r?.formatValue?r.formatValue(e):t.aggregation==="count"?Math.round(e).toLocaleString():e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var fm=({options:e,selectedValues:t,onChange:o,minWidth:r=96})=>{let{t:a}=ee(),[n,i]=useState(""),s=useMemo(()=>{let l=n.trim().toLowerCase();return l?e.filter(c=>c.toLowerCase().includes(l)):e},[e,n]),d=e.length>0&&t.length===e.length;return jsx(FormControl,{size:"small",sx:{minWidth:r},children:jsxs(Select,{multiple:true,value:t,onChange:l=>{let c=l.target.value,g=typeof c=="string"?c.split(","):c;o(g);},onClick:l=>l.stopPropagation(),onMouseDown:l=>l.stopPropagation(),renderValue:l=>{let c=l;return e.length===0?a("pivot.filter.na"):c.length===0?a("common.none"):c.length===e.length?a("common.all"):`${c.length}/${e.length}`},MenuProps:{PaperProps:{sx:{maxHeight:320,bgcolor:"background.paper"}}},sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:[jsx(ListSubheader,{disableSticky:true,sx:l=>({bgcolor:"background.paper",py:.8,lineHeight:"normal",borderBottom:`1px solid ${l.palette.divider}`}),children:jsx(TextField,{size:"small",placeholder:`${a("common.search")}...`,fullWidth:true,value:n,onChange:l=>i(l.target.value),onKeyDown:l=>l.stopPropagation(),onClick:l=>l.stopPropagation(),sx:{m:0,"& .MuiInputBase-input":{fontSize:"0.75rem",py:.7}}})}),jsx(Box,{sx:l=>({px:1.5,py:.5,borderBottom:`1px solid ${l.palette.divider}`,bgcolor:"background.paper"}),onMouseDown:l=>{l.preventDefault(),l.stopPropagation();},onClick:l=>{l.preventDefault(),l.stopPropagation();},children:jsx(Button,{variant:"text",size:"small",onClick:l=>{l.preventDefault(),l.stopPropagation(),o(d?[]:e);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:a(d?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),s.length===0&&jsx(MenuItem,{disabled:true,sx:{fontSize:"0.75rem"},children:a("pivot.filter.noResults")}),s.map(l=>{let c=t.includes(l);return jsxs(MenuItem,{value:l,sx:{fontSize:"0.75rem",py:.25},children:[jsx(Checkbox,{size:"small",checked:c,sx:{p:.5,mr:.5}}),jsx(ListItemText,{primary:l,primaryTypographyProps:{sx:{fontSize:"0.75rem",lineHeight:1.2}}})]},l)})]})})};var Wc=({label:e,subtitle:t,isDragging:o,dragRef:r,listeners:a,attributes:n,style:i})=>jsx(Paper,{ref:r,...a,...n,sx:s=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:s.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none"}),style:{...i,opacity:o?.3:1,cursor:o?"grabbing":"grab"},children:jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsx(Box,{sx:s=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.3,borderRadius:1,bgcolor:s.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)"}),children:jsx(nC,{sx:{fontSize:16,color:"text.secondary"}})}),jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary",lineHeight:1.2},children:t})]})]})}),ym=({id:e,label:t,subtitle:o})=>{let{setNodeRef:r,listeners:a,attributes:n,isDragging:i}=useDraggable({id:e});return jsx(Wc,{label:t,subtitle:o,isDragging:i,dragRef:r,listeners:a,attributes:n})};var mn=({zone:e,title:t,hint:o,icon:r,children:a,itemCount:n,onClear:i})=>{let s=`container|${e}`,{isOver:d,setNodeRef:l}=useDroppable({id:s}),{t:c}=ee();return jsxs(Paper,{ref:l,sx:g=>({p:1.1,borderRadius:3,border:"1px dashed",borderColor:d?"primary.main":g.palette.divider,bgcolor:d?g.palette.mode==="dark"?"rgba(25, 118, 210, 0.16)":"rgba(47, 91, 255, 0.06)":g.palette.mode==="dark"?"rgba(255,255,255,0.02)":"rgba(245, 248, 255, 0.86)",transition:"all 120ms ease",minHeight:120,display:"flex",flexDirection:"column"}),children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[r,jsx(Typography,{sx:{fontSize:"0.79rem",fontWeight:800,letterSpacing:.2},children:t}),jsxs(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:["(",n,")"]})]}),n>0&&i&&jsx(Tooltip,{title:c("pivot.clearArea"),children:jsx(IconButton,{size:"small",onClick:i,sx:{p:.25},children:jsx(dC,{sx:{fontSize:16}})})})]}),jsx(Typography,{sx:{mt:.5,mb:.9,fontSize:"0.7rem",color:"text.secondary"},children:o}),jsx(Box,{sx:{flex:1},children:a})]})};var vm={xs:1.2,md:1.6},fn=({title:e,subtitle:t,collapsed:o,onToggleCollapse:r,expandAriaLabel:a,collapseAriaLabel:n,children:i,bodySx:s,unmountOnExit:d=false,headerActions:l})=>jsxs(Paper,{sx:c=>({borderRadius:3,border:`1px solid ${c.palette.divider}`,overflow:"hidden",bgcolor:alpha(c.palette.background.paper,.95)}),children:[jsxs(Box,{sx:c=>({px:vm,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,borderBottom:o?"none":`1px solid ${c.palette.divider}`}),children:[jsxs(Box,{sx:{minWidth:0,flex:1},children:[jsx(Typography,{sx:{fontSize:"0.9rem",fontWeight:800},children:e}),jsx(Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t})]}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[l,jsx(IconButton,{size:"small","aria-label":o?a:n,onClick:r,sx:c=>({border:`1px solid ${c.palette.divider}`,bgcolor:alpha(c.palette.background.paper,.88),width:28,height:28,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:c.palette.mode==="dark"?alpha(c.palette.primary.main,.18):alpha(c.palette.primary.main,.08)}}),children:jsx(sx,{sx:{fontSize:16,transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:o?"rotate(180deg)":"rotate(0deg)"}})})]})]}),jsx(Collapse,{in:!o,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:jsx(Box,{sx:[{px:vm,py:{xs:1.2,md:1.6}},...Array.isArray(s)?s:s?[s]:[]],children:i})})]});var Ul=({label:e,caption:t,onRemove:o,trailing:r,isDragging:a,dragRef:n,listeners:i,attributes:s,style:d})=>jsx(Paper,{ref:n,style:d,sx:l=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:l.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none",opacity:a?0:1}),children:jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsx(Box,{...s,...i,sx:l=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.25,borderRadius:1,bgcolor:l.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)",cursor:"grab"}),children:jsx(nC,{sx:{fontSize:15,color:"text.secondary"}})}),jsxs(Box,{sx:{minWidth:0,flex:1},children:[jsx(Typography,{sx:{fontSize:"0.8rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsx(Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},children:t})]}),r,o&&jsx(IconButton,{size:"small",onClick:l=>{l.stopPropagation(),o();},sx:{p:.2},children:jsx(hh,{sx:{fontSize:16}})})]})}),gi=({id:e,label:t,caption:o,onRemove:r,trailing:a})=>{let{setNodeRef:n,attributes:i,listeners:s,transform:d,transition:l,isDragging:c}=useSortable({id:e}),g={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:l,zIndex:c?999:"auto"};return jsx(Ul,{label:t,caption:o,onRemove:r,trailing:a,isDragging:c,dragRef:n,listeners:s,attributes:i,style:g})};var _l={rows:jsx(wC,{fontSize:"small"}),columns:jsx(Ah,{fontSize:"small"}),filters:jsx(SC,{fontSize:"small"}),values:jsx(Lh,{fontSize:"small"})},Sm=({isConfiguratorCollapsed:e,onToggleCollapse:t,availableFields:o,fieldMap:r,filterFields:a,columnFields:n,rowFields:i,valueFields:s,clearZone:d,removeFieldFromZone:l,getFilterSelectionSummary:c,renderDimensionFilterSelect:g,renderAggregationSelect:h,getAggregationLabel:m})=>{let{t:b}=ee(),C=[`${b("pivot.zone.rows")} ${i.length}`,`${b("pivot.zone.columns")} ${n.length}`,`${b("pivot.zone.filters")} ${a.length}`,`${b("pivot.zone.values")} ${s.length}`].join(" \xB7 ");return jsx(fn,{title:b("pivot.config.title"),subtitle:C,collapsed:e,onToggleCollapse:t,expandAriaLabel:b("pivot.collapse.ariaExpand"),collapseAriaLabel:b("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:jsxs(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[jsx(mn,{zone:"palette",title:b("pivot.fieldList"),hint:b("pivot.availableDimensions"),itemCount:o.length,icon:jsx(nC,{sx:{fontSize:16,color:"text.secondary"}}),children:jsxs(Stack,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[o.length===0&&jsx(Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",py:1},children:b("pivot.allFieldsInUse")}),o.map(u=>jsx(ym,{id:`item|palette|${u.id}`,label:u.label,subtitle:u.type??"string"},u.id))]})}),jsxs(Stack,{spacing:2,children:[jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsx(mn,{zone:"filters",title:b("pivot.zone.filters"),hint:b("pivot.hint.filters"),icon:_l.filters,itemCount:a.length,onClear:()=>d("filters"),children:jsx(SortableContext,{items:a.map(u=>`item|filters|${u}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:a.map(u=>jsx(gi,{id:`item|filters|${u}`,label:r.get(u)?.label??u,caption:c(u),trailing:g(u),onRemove:()=>l("filters",u)},u))})})}),jsx(mn,{zone:"columns",title:b("pivot.zone.columns"),hint:b("pivot.hint.columns"),icon:_l.columns,itemCount:n.length,onClear:()=>d("columns"),children:jsx(SortableContext,{items:n.map(u=>`item|columns|${u}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:n.map(u=>jsx(gi,{id:`item|columns|${u}`,label:r.get(u)?.label??u,caption:`${r.get(u)?.type??"dimension"} \u2022 ${c(u)}`,trailing:g(u),onRemove:()=>l("columns",u)},u))})})})]}),jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsx(mn,{zone:"rows",title:b("pivot.zone.rows"),hint:b("pivot.hint.rows"),icon:_l.rows,itemCount:i.length,onClear:()=>d("rows"),children:jsx(SortableContext,{items:i.map(u=>`item|rows|${u}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:i.map(u=>jsx(gi,{id:`item|rows|${u}`,label:r.get(u)?.label??u,caption:`${r.get(u)?.type??"dimension"} \u2022 ${c(u)}`,trailing:g(u),onRemove:()=>l("rows",u)},u))})})}),jsx(mn,{zone:"values",title:b("pivot.zone.values"),hint:b("pivot.hint.values"),icon:_l.values,itemCount:s.length,onClear:()=>d("values"),children:jsx(SortableContext,{items:s.map(u=>`item|values|${u.tokenId}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:s.map(u=>{let v=r.get(u.fieldId)?.label??u.fieldId,p=`${m(u.aggregation)}(${v})`;return jsx(gi,{id:`item|values|${u.tokenId}`,label:v,caption:p,trailing:h(u),onRemove:()=>l("values",u.tokenId)},u.tokenId)})})})})]})]})]})})};var wm=e=>e.toLocaleString(void 0,{maximumFractionDigits:1}),Tm=({data:e,primaryLabel:t,secondaryLabel:o,formatPrimaryValue:r,formatSecondaryValue:a})=>{let n=useTheme$1();if(e.length===0)return null;let i=720,s=250,d={top:20,right:24,bottom:40,left:52},l=o?e.map(u=>u.primaryValue):e.map((u,v)=>v+1),c=o?e.map(u=>u.secondaryValue??0):e.map(u=>u.primaryValue),g=Math.max(...l,1),h=Math.max(...c,1),m=i-d.left-d.right,b=s-d.top-d.bottom,C=e.map((u,v)=>{let p=o?u.primaryValue:v+1,f=o?u.secondaryValue??0:u.primaryValue,y=d.left+p/g*m,k=s-d.bottom-f/h*b;return {...u,x:y,y:k,rawX:p,rawY:f}});return jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[jsx(Box,{sx:{overflowX:"auto"},children:jsxs(Box,{component:"svg",viewBox:`0 0 ${i} ${s}`,sx:{width:"100%",minWidth:i,height:s},children:[jsx("line",{x1:d.left,y1:s-d.bottom,x2:i-d.right,y2:s-d.bottom,stroke:alpha(n.palette.text.secondary,.35)}),jsx("line",{x1:d.left,y1:d.top,x2:d.left,y2:s-d.bottom,stroke:alpha(n.palette.text.secondary,.35)}),C.map(u=>jsxs("g",{children:[jsx("circle",{cx:u.x,cy:u.y,r:7,fill:alpha(n.palette.primary.main,.18)}),jsx("circle",{cx:u.x,cy:u.y,r:4.5,fill:n.palette.primary.main,children:jsxs("title",{children:[u.name,`
13
+ `,o?`${t}: ${r(u.primaryValue)}`:`${t}: ${r(u.primaryValue)}`,o?`
14
+ ${o}: ${(a??r)(u.secondaryValue??0)}`:""]})}),jsx("text",{x:u.x,y:Math.max(u.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:n.palette.text.secondary,children:u.name})]},u.name)),jsx("text",{x:i/2,y:s-10,textAnchor:"middle",fontSize:"11",fill:n.palette.text.secondary,children:o?t:"Index"}),jsx("text",{x:16,y:s/2,textAnchor:"middle",transform:`rotate(-90 16 ${s/2})`,fontSize:"11",fill:n.palette.text.secondary,children:o??t}),jsx("text",{x:d.left,y:d.top-4,fontSize:"10",fill:n.palette.text.secondary,children:wm(h)}),jsx("text",{x:i-d.right,y:s-d.bottom+16,textAnchor:"end",fontSize:"10",fill:n.palette.text.secondary,children:wm(g)})]})}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(3, minmax(0, 1fr))"},gap:1},children:e.map(u=>jsxs(Box,{sx:v=>({borderRadius:2,px:1.25,py:1,border:`1px solid ${alpha(v.palette.divider,.7)}`,bgcolor:alpha(v.palette.background.default,.35)}),children:[jsx(Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:u.name,children:u.name}),jsxs(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[t,": ",r(u.primaryValue)]}),o&&jsxs(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[o,": ",(a??r)(u.secondaryValue??0)]})]},u.name))})]})};var _c=e=>Math.max(...e,1),Pm=({data:e,chartType:t,primaryLabel:o,secondaryLabel:r,formatPrimaryValue:a,formatSecondaryValue:n})=>{let i=useTheme$1(),s=i.palette.primary.main,d=i.palette.warning.main;if(e.length===0)return null;if(t==="bar-horizontal"){let p=_c(e.flatMap(f=>[f.primaryValue,f.secondaryValue??0]));return jsx(Stack,{spacing:1.1,children:e.map(f=>jsxs(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[jsx(Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:f.name,children:f.name}),jsxs(Stack,{spacing:.65,children:[jsx(Box,{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:alpha(i.palette.action.active,.08)},children:jsx(Box,{sx:{width:`${f.primaryValue/p*100}%`,height:"100%",bgcolor:s}})}),r&&jsx(Box,{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:alpha(i.palette.action.active,.08)},children:jsx(Box,{sx:{width:`${(f.secondaryValue??0)/p*100}%`,height:"100%",bgcolor:d}})})]}),jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700},children:a(f.primaryValue)}),r&&jsx(Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"text.secondary"},children:(n??a)(f.secondaryValue??0)})]})]},f.name))})}if(t==="bar-vertical"){let p=_c(e.flatMap(y=>[y.primaryValue,y.secondaryValue??0])),f=r?92:76;return jsx(Box,{sx:{overflowX:"auto",pb:.5},children:jsx(Box,{sx:{minWidth:Math.max(620,e.length*f),display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:e.map(y=>jsxs(Box,{sx:{minWidth:0},children:[jsxs(Box,{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[jsx(Box,{sx:{width:r?16:26,minHeight:8,height:`${Math.max(y.primaryValue/p*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:s},title:`${o}: ${a(y.primaryValue)}`}),r&&jsx(Box,{sx:{width:16,minHeight:8,height:`${Math.max((y.secondaryValue??0)/p*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${r}: ${(n??a)(y.secondaryValue??0)}`})]}),jsx(Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:y.name,children:y.name}),jsx(Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:a(y.primaryValue),children:a(y.primaryValue)}),r&&jsx(Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:(n??a)(y.secondaryValue??0),children:(n??a)(y.secondaryValue??0)})]},y.name))})})}let l=Math.max(680,e.length*74),c=240,g={top:20,right:18,bottom:36,left:18},h=_c(e.flatMap(p=>[p.primaryValue,p.secondaryValue??0])),m=l-g.left-g.right,b=c-g.top-g.bottom,C=p=>e.map((f,y)=>{let k=g.left+y*m/Math.max(e.length-1,1),E=c-g.bottom-p(f)/h*b;return {x:k,y:E,item:f}}),u=C(p=>p.primaryValue),v=r?C(p=>p.secondaryValue??0):[];return jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[jsx(Box,{sx:{overflowX:"auto"},children:jsxs(Box,{component:"svg",viewBox:`0 0 ${l} ${c}`,sx:{width:"100%",minWidth:l,height:c},children:[jsx("line",{x1:g.left,y1:c-g.bottom,x2:l-g.right,y2:c-g.bottom,stroke:alpha(i.palette.text.secondary,.35)}),jsx("polyline",{fill:"none",stroke:s,strokeWidth:3,points:u.map(p=>`${p.x},${p.y}`).join(" ")}),u.map(p=>jsx("circle",{cx:p.x,cy:p.y,r:4,fill:s,children:jsxs("title",{children:[p.item.name,`
15
+ `,o,": ",a(p.item.primaryValue)]})},`primary-${p.item.name}`)),r&&jsxs(Fragment,{children:[jsx("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:v.map(p=>`${p.x},${p.y}`).join(" ")}),v.map(p=>jsx("circle",{cx:p.x,cy:p.y,r:3.5,fill:d,children:jsxs("title",{children:[p.item.name,`
16
+ `,r,": ",(n??a)(p.item.secondaryValue??0)]})},`secondary-${p.item.name}`))]})]})}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:e.map(p=>jsxs(Box,{sx:f=>({borderRadius:2,px:1.1,py:.9,border:`1px solid ${alpha(f.palette.divider,.7)}`,bgcolor:alpha(f.palette.background.default,.35)}),children:[jsx(Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:p.name,children:p.name}),jsx(Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:a(p.primaryValue)}),r&&jsx(Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:(n??a)(p.secondaryValue??0)})]},p.name))})]})};var Rm=(e,t,o)=>{let r=new Set,a=[];return e.forEach(n=>{r.has(n)||(r.add(n),a.push({fieldId:n,label:o.get(n)?.label??n,zone:"rows"}));}),t.forEach(n=>{r.has(n)||(r.add(n),a.push({fieldId:n,label:o.get(n)?.label??n,zone:"columns"}));}),a},Dm=(e,t,o)=>e.map(r=>{let a=t.get(r.fieldId),n=a?.label??r.fieldId;return {fieldId:r.fieldId,label:`${o(r.aggregation)} \xB7 ${n}`,item:r,field:a}}),Mm=({rows:e,dimensionFieldId:t,primaryValue:o,secondaryValue:r})=>{if(!t)return [];let a=new Map;return e.forEach(n=>{let i=Pr(n[t]),s=a.get(i);if(s){s.push(n);return}a.set(i,[n]);}),Array.from(a.entries()).sort((n,i)=>n[0].localeCompare(i[0],void 0,{sensitivity:"base"})).map(([n,i])=>({name:n,primaryValue:dn(i,o.fieldId,o.aggregation),secondaryValue:r?dn(i,r.fieldId,r.aggregation):void 0}))};var Am=({rows:e,fieldMap:t,rowFields:o,columnFields:r,valueFields:a,chartDimensionFieldId:n,chartPrimaryValueFieldId:i,chartSecondaryValueFieldId:s,chartType:d,isCollapsed:l,onChartDimensionFieldIdChange:c,onChartPrimaryValueFieldIdChange:g,onChartSecondaryValueFieldIdChange:h,onChartTypeChange:m,onToggleCollapse:b,getAggregationLabel:C})=>{let{t:u}=ee(),v=useMemo(()=>Rm(o,r,t),[r,t,o]),p=useMemo(()=>Dm(a,t,C),[t,C,a]),f=p.find(w=>w.fieldId===i)??p[0],y=p.find(w=>w.fieldId===s&&w.fieldId!==f?.fieldId)??null,k=v.find(w=>w.fieldId===n)??v[0],E=k&&f?u("pivot.chart.subtitleReady",{dimension:k.label,measure:y?`${f.label} / ${y.label}`:f.label}):u("pivot.chart.subtitle"),M=useMemo(()=>!k||!f?[]:Mm({rows:e,dimensionFieldId:k.fieldId,primaryValue:f.item,secondaryValue:y?.item}),[f,e,y,k]),S=w=>f?mi(w,f.item,t):w.toLocaleString(),D=w=>y?mi(w,y.item,t):w.toLocaleString(),P=v.length>1||p.length>1;return jsxs(fn,{title:u("pivot.chart.title"),subtitle:E,collapsed:l,onToggleCollapse:b,expandAriaLabel:u("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:u("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[P&&jsxs(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[jsxs(FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.dimension")}),jsx(Select,{value:k?.fieldId??"",onChange:w=>c(String(w.target.value)),sx:{fontSize:"0.75rem",height:32},children:v.map(w=>jsx(MenuItem,{value:w.fieldId,sx:{fontSize:"0.75rem"},children:w.label},w.fieldId))})]}),jsxs(FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.primaryMeasure")}),jsx(Select,{value:f?.fieldId??"",onChange:w=>g(String(w.target.value)),sx:{fontSize:"0.75rem",height:32},children:p.map(w=>jsx(MenuItem,{value:w.fieldId,sx:{fontSize:"0.75rem"},children:w.label},w.fieldId))})]}),jsxs(FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.secondaryMeasure")}),jsxs(Select,{value:y?.fieldId??"",onChange:w=>h(String(w.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsx(MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:u("common.none")}),p.filter(w=>w.fieldId!==f?.fieldId).map(w=>jsx(MenuItem,{value:w.fieldId,sx:{fontSize:"0.75rem"},children:w.label},w.fieldId))]})]}),jsxs(FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.chartType")}),jsxs(Select,{value:d,onChange:w=>m(w.target.value),sx:{fontSize:"0.75rem",height:32},children:[jsx(MenuItem,{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.barVertical")}),jsx(MenuItem,{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.barHorizontal")}),jsx(MenuItem,{value:"line",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.line")}),jsx(MenuItem,{value:"scatter",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.scatter")})]})]})]}),jsx(Box,{children:k?f?M.length===0?jsx(Box,{sx:{py:5,textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoData")})}):d==="scatter"?jsx(Tm,{data:M,primaryLabel:f.label,secondaryLabel:y?.label,formatPrimaryValue:S,formatSecondaryValue:D}):jsx(Pm,{data:M,chartType:d,primaryLabel:f.label,secondaryLabel:y?.label,formatPrimaryValue:S,formatSecondaryValue:D}):jsx(Box,{sx:{py:5,textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoValue")})}):jsx(Box,{sx:{py:5,textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoDimension")})})})]})};var Xl=({node:e,dataColumns:t,fieldMap:o,level:r,expandedKeys:a,onToggle:n,getValue:i})=>{let s=a.has(e.key),d=e.children.length>0,l=e.isGrandTotal;return jsxs(Fragment,{children:[jsxs(TableRow,{sx:c=>({bgcolor:l?c.palette.mode==="dark"?"rgba(25, 118, 210, 0.22)":"rgba(47, 91, 255, 0.08)":c.palette.mode==="dark"?"#111111":"background.paper","&:hover":{bgcolor:l?c.palette.mode==="dark"?"rgba(25, 118, 210, 0.28)":"rgba(47, 91, 255, 0.12)":c.palette.mode==="dark"?"#181818":"rgba(0, 0, 0, 0.02)"}}),children:[jsxs(TableCell,{sx:c=>({fontSize:"0.76rem",fontWeight:l?800:600,borderBottom:`1px solid ${c.palette.divider}`,whiteSpace:"nowrap",pl:r*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!l&&jsx(IconButton,{size:"small",onClick:()=>n(e.key),sx:{p:.2,mr:.5,ml:-1},children:s?jsx(sb,{sx:{fontSize:16}}):jsx(df,{sx:{fontSize:16}})}),!d&&!l&&r>0&&jsx(Box,{sx:{width:20}}),e.value]}),t.map(c=>jsx(TableCell,{align:"right",sx:{fontSize:"0.76rem",fontWeight:l?800:500,borderBottom:g=>`1px solid ${g.palette.divider}`,whiteSpace:"nowrap"},children:mi(i?i(e,c.id):e.aggregatedValues[c.id]??0,c.valueItem,o)},`${e.key}-${c.id}`))]}),s&&e.children.map(c=>jsx(Xl,{node:c,dataColumns:t,fieldMap:o,level:r+1,expandedKeys:a,onToggle:n,getValue:i},c.key))]})};var Qc=(e,t,o)=>{let r=[...e,...t];return o&&r.includes(o)?o:r[0]??""},Jl=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",Jc=(e,t,o)=>o===""?"":o&&o!==t&&e.some(r=>r.fieldId===o)?o:e.find(r=>r.fieldId!==t)?.fieldId??"",Vm=e=>{let t=new Set,o=r=>{r.forEach(a=>{a.children.length>0&&(t.add(a.key),o(a.children));});};return o(e),t},Hm=(e,t,o=0)=>e.length===0?o:e.reduce((r,a)=>a.children.length===0||!t.has(a.key)?Math.max(r,o+1):Math.max(r,Hm(a.children,t,o+1)),o),ik=(e,t)=>{let o=[],r=a=>{a.forEach(n=>{if(n.children.length>0&&t.has(n.key)){r(n.children);return}o.push(n);});};return r(e),o},KF=({title:e,rows:t,fields:o,initialLayout:r,initialChart:a,emptyText:n,maxPreviewHeight:i=520,initialChartCollapsed:s=false,initialTableCollapsed:d=false,model:l,enablePresetManagement:c=false,presets:g,defaultPresets:h,onPresetsChange:m,initialPresetId:b,onPresetApplied:C})=>{let{t:u}=ee(),v=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}})),p=useRef(0),f=useRef(false),y=e??u("pivot.title.default"),k=n??u("pivot.empty"),E=useMemo(()=>({sum:u("pivot.agg.sum"),count:u("pivot.agg.count"),avg:u("pivot.agg.avg"),min:u("pivot.agg.min"),max:u("pivot.agg.max")}),[u]),M=useCallback(x=>E[x]??im[x],[E]),S=useMemo(()=>new Set(o.map(x=>x.id)),[o]),D=useMemo(()=>new Map(o.map(x=>[x.id,x])),[o]),[P,w]=useState(()=>Nt(r?.rows,S)),[B,R]=useState(()=>Nt(r?.columns,S)),[I,A]=useState(()=>Nt(r?.filters,S)),[q,O]=useState(()=>{let x=r?.values??[],F=new Set,L=[];return x.forEach(Z=>{if(!S.has(Z.fieldId)||F.has(Z.fieldId))return;F.add(Z.fieldId),p.current+=1;let de=D.get(Z.fieldId);L.push({tokenId:`v${p.current}`,fieldId:Z.fieldId,aggregation:lo(Z.aggregation,de)});}),L}),[K,Q]=useState({}),[ne,ie]=useState(true),[Y,Ae]=useState(false),[Ze,ht]=useState(()=>Qc(Nt(r?.rows,S),Nt(r?.columns,S),a?.dimensionFieldId)),[fe,We]=useState(()=>{let x=(r?.values??[]).filter((F,L,Z)=>S.has(F.fieldId)&&Z.findIndex(de=>de.fieldId===F.fieldId)===L).map(F=>({tokenId:F.fieldId,fieldId:F.fieldId,aggregation:lo(F.aggregation,D.get(F.fieldId))}));return Jl(x,a?.primaryValueFieldId)}),[Ee,Tt]=useState(()=>{let x=(r?.values??[]).filter((L,Z,de)=>S.has(L.fieldId)&&de.findIndex(Pe=>Pe.fieldId===L.fieldId)===Z).map(L=>({tokenId:L.fieldId,fieldId:L.fieldId,aggregation:lo(L.aggregation,D.get(L.fieldId))})),F=Jl(x,a?.primaryValueFieldId);return Jc(x,F,a?.secondaryValueFieldId)}),[_e,ze]=useState(a?.chartType??"bar-vertical"),[Ue,tt]=useState(s),[_,le]=useState(d),[Re,Ne]=useState(()=>h??[]),[G,j]=useState(""),[Te,Ce]=useState(false),[De,ot]=useState(""),[je,eo]=useState(null),[Zt,It]=useState(new Set(["__grand_total__"])),[po,Et]=useState(new Set),Fe=l?.rowFields??P,Se=l?.columnFields??B,bt=l?.filterFields??I,Ke=l?.valueFields??q,Ft=l?.filterSelections??K,mo=l?.showGrandTotal??ne,go=l?.isConfiguratorCollapsed??Y,Xt=l?.chartDimensionFieldId??Ze,yt=l?.chartPrimaryValueFieldId??fe,fo=l?.chartSecondaryValueFieldId??Ee,ho=l?.chartType??_e,bo=l?.isChartCollapsed??Ue,Uo=l?.isTableCollapsed??_,ut=g??Re,to=c||ut.length>0||!!m,xt=useCallback(x=>{if(l?.setRowFields){l.setRowFields(x);return}w(x);},[l]),z=useCallback(x=>{if(l?.setColumnFields){l.setColumnFields(x);return}R(x);},[l]),V=useCallback(x=>{if(l?.setFilterFields){l.setFilterFields(x);return}A(x);},[l]),H=useCallback(x=>{if(l?.setValueFields){l.setValueFields(x);return}O(x);},[l]),ae=useCallback(x=>{if(l?.setFilterSelections){l.setFilterSelections(x);return}Q(x);},[l]),se=useCallback(x=>{if(l?.setShowGrandTotal){l.setShowGrandTotal(x);return}ie(x);},[l]),ke=useCallback(x=>{if(l?.setIsConfiguratorCollapsed){l.setIsConfiguratorCollapsed(x);return}Ae(x);},[l]),T=useCallback(x=>{if(l?.setChartDimensionFieldId){l.setChartDimensionFieldId(x);return}ht(x);},[l]),N=useCallback(x=>{if(l?.setChartPrimaryValueFieldId){l.setChartPrimaryValueFieldId(x);return}We(x);},[l]),U=useCallback(x=>{if(l?.setChartSecondaryValueFieldId){l.setChartSecondaryValueFieldId(x);return}Tt(x);},[l]),J=useCallback(x=>{if(l?.setChartType){l.setChartType(x);return}ze(x);},[l]),ue=useCallback(x=>{if(l?.setIsChartCollapsed){l.setIsChartCollapsed(x);return}tt(x);},[l]),he=useCallback(x=>{if(l?.setIsTableCollapsed){l.setIsTableCollapsed(x);return}le(x);},[l]),ye=useCallback(x=>{let F=typeof x=="function"?x(ut):x;g||Ne(F),m?.(F);},[m,ut,g]),me=useMemo(()=>new Set([...Fe,...Se,...bt]),[Fe,Se,bt]),Be=useMemo(()=>o.filter(x=>!me.has(x.id)),[o,me]),Ve=useMemo(()=>{let x=[...Fe,...Se,...bt],F=new Set,L=[];return x.forEach(Z=>{F.has(Z)||(F.add(Z),L.push(Z));}),L},[Se,bt,Fe]);useEffect(()=>{xt(x=>{let F=x.filter(L=>S.has(L));return Rr(x,F)?x:F}),z(x=>{let F=x.filter(L=>S.has(L));return Rr(x,F)?x:F}),V(x=>{let F=x.filter(L=>S.has(L));return Rr(x,F)?x:F}),H(x=>{let F=x.filter(L=>S.has(L.fieldId)).map(L=>({...L,aggregation:lo(L.aggregation,D.get(L.fieldId))}));return Ol(x,F)?x:F});},[D,S]);let it=useMemo(()=>{let x={};return Ve.forEach(F=>{let L=new Set;t.forEach(Z=>{L.add(Pr(Z[F]));}),x[F]=Array.from(L).sort((Z,de)=>Z.localeCompare(de));}),x},[Ve,t]);useEffect(()=>{ae(x=>{let F={};return Ve.forEach(L=>{let Z=it[L]??[],Pe=(x[L]??[]).filter(re=>Z.includes(re)),W=Object.prototype.hasOwnProperty.call(x,L);F[L]=W?Pe:Z;}),pm(x,F)?x:F});},[Ve,it]),useEffect(()=>{T(x=>Qc(Fe,Se,x));},[Se,Fe,T]),useEffect(()=>{N(x=>Jl(Ke,x));},[N,Ke]),useEffect(()=>{U(x=>Jc(Ke,yt,x));},[yt,U,Ke]);let Ge=useMemo(()=>t.filter(x=>Ve.every(F=>{let L=Ft[F]??[],Z=it[F]??[];if(L.length===Z.length)return true;if(L.length===0)return false;let de=Pr(x[F]);return L.includes(de)})),[Ve,it,Ft,t]),Le=useMemo(()=>{if(Ke.length===0)return null;let x=new Map;if(Ge.forEach(W=>{let re=Se.length>0?Se.map(rt=>Pr(W[rt])):[u("pivot.valueLabel")],oe=Ia(re);x.set(oe,re);}),x.size===0){let W=Se.length>0?Se.map(()=>Nl):[u("pivot.valueLabel")];x.set(Ia(W),W);}let F=Array.from(x.entries()).sort((W,re)=>um(W[1],re[1])),L=F.flatMap(([W,re])=>Ke.map(oe=>{let rt=D.get(oe.fieldId),$=`${M(oe.aggregation)} ${rt?.label??oe.fieldId}`,ce=Se.length===0||Ke.length>1?`${re.join(" / ")} \u2022 ${$}`:re.join(" / ");return {id:`${W}::${oe.tokenId}`,colKey:W,valueItem:oe,label:ce}})),Z=[];Se.length>0&&F.forEach(([W,re])=>{let oe=L.filter(ce=>ce.colKey===W),rt=Z,$=[];re.forEach((ce,X)=>{$.push(`d${X}:${ce}`);let xe=`col::${Ia($)}`,Xe=rt.find(nr=>nr.key===xe);Xe||(Xe={key:xe,label:ce,children:[],leafColumnIds:[],path:re.slice(0,X+1),depth:X},rt.push(Xe)),oe.forEach(nr=>{Xe.leafColumnIds.includes(nr.id)||Xe.leafColumnIds.push(nr.id);}),rt=Xe.children;});});let de=W=>{let re={};return L.forEach(oe=>{let rt=W.filter($=>{let ce=Se.length>0?Se.map(X=>Pr($[X])):[u("pivot.valueLabel")];return Ia(ce)===oe.colKey});re[oe.id]=dn(rt,oe.valueItem.fieldId,oe.valueItem.aggregation);}),re},Pe=[];if(Fe.length===0)Pe.push({key:"root",value:u("pivot.resultLabel")||am,children:[],isLeaf:true,aggregatedValues:de(Ge),path:[],depth:0});else {let W=(re,oe,rt)=>{if(oe>=Fe.length)return [];let $=Fe[oe],ce=new Map;return re.forEach(X=>{let xe=Pr(X[$]);ce.has(xe)||ce.set(xe,[]),ce.get(xe).push(X);}),Array.from(ce.keys()).sort().map(X=>{let xe=ce.get(X),Xe=[...rt,X];return {key:Ia(Xe),value:X,fieldId:$,aggregatedValues:de(xe),children:W(xe,oe+1,Xe),isLeaf:oe===Fe.length-1,path:Xe,depth:oe}})};Pe.push(...W(Ge,0,[]));}return {dataColumns:L,columnTree:Z,rowTree:Pe}},[Se,D,Ge,M,Fe,u,Ke]),Lt=useCallback((x,F)=>(p.current+=1,{tokenId:`v${p.current}`,fieldId:x,aggregation:lo(F,D.get(x))}),[D]),Ot=useCallback(x=>{if(x==="rows")return xt([]);if(x==="columns")return z([]);if(x==="filters")return V([]);H([]);},[]),pt=useCallback((x,F)=>{if(x==="rows")return xt(L=>L.filter(Z=>Z!==F));if(x==="columns")return z(L=>L.filter(Z=>Z!==F));if(x==="filters")return V(L=>L.filter(Z=>Z!==F));H(L=>L.filter(Z=>Z.tokenId!==F));},[]),oo=useCallback((x,F)=>{H(L=>L.map(Z=>Z.tokenId===x?{...Z,aggregation:lo(F,D.get(Z.fieldId))}:Z));},[D]),mt=useCallback(x=>{eo(String(x.active.id));},[]),ro=useCallback(x=>{if(eo(null),!x.over)return;let F=Vl(String(x.active.id)),L=Vl(String(x.over.id));if(!F||!L||F.kind!=="item"||!F.key)return;if(F.zone===L.zone&&L.kind==="item"){if(F.zone==="rows"){let X=Fe.indexOf(F.key),xe=Fe.indexOf(L.key??"");X!==-1&&xe!==-1&&X!==xe&&xt(Xe=>arrayMove(Xe,X,xe));return}if(F.zone==="columns"){let X=Se.indexOf(F.key),xe=Se.indexOf(L.key??"");X!==-1&&xe!==-1&&X!==xe&&z(Xe=>arrayMove(Xe,X,xe));return}if(F.zone==="filters"){let X=bt.indexOf(F.key),xe=bt.indexOf(L.key??"");X!==-1&&xe!==-1&&X!==xe&&V(Xe=>arrayMove(Xe,X,xe));return}if(F.zone==="values"){let X=Ke.findIndex(Xe=>Xe.tokenId===F.key),xe=Ke.findIndex(Xe=>Xe.tokenId===(L.key??""));X!==-1&&xe!==-1&&X!==xe&&H(Xe=>arrayMove(Xe,X,xe));}return}let Z=L.zone,de=[...Fe],Pe=[...Se],W=[...bt],re=[...Ke],oe="",rt=null;if(F.zone==="palette")oe=F.key;else if(F.zone==="values"){let X=re.find(xe=>xe.tokenId===F.key);if(!X)return;oe=X.fieldId,rt=X,re=re.filter(xe=>xe.tokenId!==F.key);}else F.zone==="rows"?(oe=F.key,de=de.filter(X=>X!==oe)):F.zone==="columns"?(oe=F.key,Pe=Pe.filter(X=>X!==oe)):F.zone==="filters"&&(oe=F.key,W=W.filter(X=>X!==oe));if(!oe)return;let $=()=>{de=de.filter(X=>X!==oe),Pe=Pe.filter(X=>X!==oe),W=W.filter(X=>X!==oe);},ce=X=>{if(L.kind!=="item"||!L.key)return X==="rows"?de.length:X==="columns"?Pe.length:X==="filters"?W.length:X==="values"?re.length:0;if(X==="rows"){let xe=de.indexOf(L.key);return xe>=0?xe:de.length}if(X==="columns"){let xe=Pe.indexOf(L.key);return xe>=0?xe:Pe.length}if(X==="filters"){let xe=W.indexOf(L.key);return xe>=0?xe:W.length}if(X==="values"){let xe=re.findIndex(Xe=>Xe.tokenId===L.key);return xe>=0?xe:re.length}return 0};if(Z==="palette"){xt(de),z(Pe),V(W),H(re);return}if(Z==="values"){let X=ce("values"),xe=rt??Lt(oe);re.splice(X,0,xe),xt(de),z(Pe),V(W),H(re);return}if(dm(Z)){$();let X=ce(Z);Z==="rows"?de.splice(X,0,oe):Z==="columns"?Pe.splice(X,0,oe):W.splice(X,0,oe),xt(de),z(Pe),V(W),H(re);}},[Se,Lt,bt,Fe,Ke]),Ko=useCallback((x,F)=>{ae(L=>({...L,[x]:F}));},[]),ao=useCallback(x=>{It(F=>{let L=new Set(F);return L.has(x)?L.delete(x):L.add(x),L});},[]),gr=useCallback(x=>{Et(F=>{let L=new Set(F);return L.has(x)?L.delete(x):L.add(x),L});},[]),Vr=useCallback(x=>{let F=D.get(x.fieldId),L=Oc(F);return jsx(FormControl,{size:"small",sx:{minWidth:98},children:jsx(Select,{value:x.aggregation,onChange:Z=>oo(x.tokenId,Z.target.value),onClick:Z=>Z.stopPropagation(),onMouseDown:Z=>Z.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:L.map(Z=>jsx(MenuItem,{value:Z,sx:{fontSize:"0.75rem"},children:M(Z)},Z))})})},[D,M,oo]),no=useCallback(x=>{let F=it[x]??[],L=Ft[x]??F;return F.length===0?u("pivot.filter.noValues"):L.length===0?u("pivot.filter.noneSelected"):L.length===F.length?u("pivot.filter.allValues"):u("pivot.filter.selectedCount",{selected:L.length,total:F.length})},[it,Ft,u]),qo=useCallback(x=>{let F=it[x]??[],L=Ft[x]??F;return jsx(fm,{options:F,selectedValues:L,onChange:Z=>Ko(x,Z)})},[it,Ft,Ko]),fr=useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),zo=useCallback(()=>{let x={};return new Set([...Ve,...Object.keys(Ft)]).forEach(L=>{if(!S.has(L))return;let Z=Ft[L]??[];x[L]=[...Z];}),{layout:{rows:[...Fe],columns:[...Se],filters:[...bt],values:Ke.map(L=>({fieldId:L.fieldId,aggregation:L.aggregation}))},filterSelections:x,showGrandTotal:mo,chart:{dimensionFieldId:Xt,primaryValueFieldId:yt,secondaryValueFieldId:fo,chartType:ho}}},[Ve,Xt,yt,fo,ho,Se,bt,Ft,Fe,mo,S,Ke]),ar=useCallback(x=>{let F=Nt(x.layout.rows,S),L=Nt(x.layout.columns,S),Z=Nt(x.layout.filters,S),de=new Set,Pe=(x.layout.values??[]).filter(oe=>!S.has(oe.fieldId)||de.has(oe.fieldId)?false:(de.add(oe.fieldId),true)).map(oe=>Lt(oe.fieldId,oe.aggregation)),W={};Object.entries(x.filterSelections??{}).forEach(([oe,rt])=>{!S.has(oe)||!Array.isArray(rt)||(W[oe]=Array.from(new Set(rt.map($=>String($)))));}),xt(F),z(L),V(Z),H(Pe),ae(W),typeof x.showGrandTotal=="boolean"&&se(x.showGrandTotal),T(Qc(F,L,x.chart?.dimensionFieldId));let re=Jl(Pe,x.chart?.primaryValueFieldId);N(re),U(Jc(Pe,re,x.chart?.secondaryValueFieldId)),J(x.chart?.chartType??"bar-vertical"),j(x.id),C?.(x);},[Lt,C,T,N,U,J,z,V,ae,xt,se,H,S]),sa=useCallback(x=>{if(!x){j("");return}let F=ut.find(L=>L.id===x);if(!F){j("");return}ar(F);},[ar,ut]),Na=useCallback(()=>{let x=u("pivot.preset.defaultName",{index:ut.length+1});ot(x),Ce(true);},[ut.length,u]),Or=useCallback(()=>{let x=De.trim();if(!x)return;let F={id:fr(),name:x,...zo()};ye(L=>[...L,F]),j(F.id),Ce(false);},[zo,fr,De,ye]),ca=useCallback(()=>{G&&(ye(x=>x.filter(F=>F.id!==G)),j(""));},[G,ye]);useEffect(()=>{if(!b||f.current)return;let x=ut.find(F=>F.id===b);x&&(f.current=true,ar(x));},[ar,b,ut]),useEffect(()=>{G&&(ut.some(x=>x.id===G)||j(""));},[G,ut]);let hr=useMemo(()=>{if(!mo||!Le||!Fe.length)return null;let x={};return Le.dataColumns.forEach(F=>{let L=Ge.filter(Z=>{let de=Se.length>0?Se.map(Pe=>Pr(Z[Pe])):[u("pivot.valueLabel")];return Ia(de)===F.colKey});x[F.id]=dn(L,F.valueItem.fieldId,F.valueItem.aggregation);}),{key:"__grand_total__",value:u("pivot.grandTotal")||nm,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:x,path:[],depth:-1}},[mo,Le,Ge,Se,Fe.length,u]),yo=useMemo(()=>Vm(Le?.rowTree??[]),[Le]),_o=useMemo(()=>Vm(Le?.columnTree??[]),[Le]);useEffect(()=>{It(x=>{let F=new Set;return x.has("__grand_total__")&&F.add("__grand_total__"),yo.forEach(L=>{x.has(L)&&F.add(L);}),F});},[yo]),useEffect(()=>{Et(x=>{let F=new Set;return _o.forEach(L=>{x.has(L)&&F.add(L);}),F});},[_o]);let Va=useCallback(()=>{It(x=>{let F=new Set(x);return yo.forEach(L=>F.add(L)),F});},[yo]),da=useCallback(()=>{It(x=>{let F=new Set;return x.has("__grand_total__")&&F.add("__grand_total__"),F});},[]),Oa=useCallback(()=>{Et(new Set(_o));},[_o]),Ha=useCallback(()=>{Et(new Set);},[]),Wa=useMemo(()=>!Le||Se.length===0?[]:ik(Le.columnTree,po),[Se.length,po,Le]),wo=useMemo(()=>{if(!Le)return [];if(Se.length===0)return Le.dataColumns.map(F=>({id:F.id,label:F.label,leafColumnIds:[F.id],valueItem:F.valueItem}));let x=new Map(Le.dataColumns.map(F=>[F.id,F]));return Wa.flatMap(F=>{let L=new Map;return F.leafColumnIds.forEach(Z=>{let de=x.get(Z);if(!de)return;let Pe=de.valueItem.tokenId,W=`${M(de.valueItem.aggregation)} ${D.get(de.valueItem.fieldId)?.label??de.valueItem.fieldId}`,re=L.get(Pe);if(re){re.leafColumnIds.push(Z);return}L.set(Pe,{id:`${F.key}::${Pe}`,label:Ke.length>1?W:F.label,leafColumnIds:[Z],valueItem:de.valueItem});}),Array.from(L.values())})},[Se.length,D,M,Le,Ke.length,Wa]),$a=useMemo(()=>new Map(wo.map(x=>[x.id,x])),[wo]),Ga=useMemo(()=>wo.map(x=>({id:x.id,colKey:x.id,valueItem:x.valueItem,label:x.label})),[wo]),ua=useMemo(()=>{if(!Le||Se.length===0)return [];let x=[],F=Hm(Le.columnTree,po),L=F+(Ke.length>1?1:0),Z=(de,Pe)=>{x[Pe]??(x[Pe]=[]),de.forEach(W=>{let re=W.children.length>0&&po.has(W.key),oe=wo.filter($=>W.leafColumnIds.some(ce=>$.leafColumnIds.includes(ce))).length,rt=re||Ke.length>1?1:L-Pe;x[Pe].push({key:W.key,label:W.label,colSpan:oe,rowSpan:rt,expandable:W.children.length>0,expanded:re}),re&&Z(W.children,Pe+1);});};return Z(Le.columnTree,0),Ke.length>1&&(x[F]=wo.map(de=>({key:de.id,label:de.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),x},[Se.length,po,Le,Ke.length,wo]),br=useCallback((x,F)=>F.leafColumnIds.reduce((L,Z)=>L+(x.aggregatedValues[Z]??0),0),[]),Hr=useMemo(()=>jsxs(Fragment,{children:[jsx(Button,{size:"small",variant:"text",onClick:Va,disabled:yo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.expandRowsAll")}),jsx(Button,{size:"small",variant:"text",onClick:da,disabled:yo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.collapseRowsAll")}),jsx(Divider,{orientation:"vertical",flexItem:true}),jsx(Button,{size:"small",variant:"text",onClick:Oa,disabled:_o.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.expandColumnsAll")}),jsx(Button,{size:"small",variant:"text",onClick:Ha,disabled:Se.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.collapseColumnsAll")})]}),[Se.length,_o.size,yo.size,Ha,da,Oa,Va,u]),Wr=()=>{if(!je)return null;let x=Vl(je);if(!x||x.kind!=="item"||!x.key)return null;if(x.zone==="palette"){let de=D.get(x.key);return de?jsx(Wc,{label:de.label,subtitle:de.type}):null}if(x.zone==="values"){let de=Ke.find(oe=>oe.tokenId===x.key);if(!de)return null;let W=D.get(de.fieldId)?.label??de.fieldId,re=`${M(de.aggregation)}(${W})`;return jsx(Ul,{label:W,caption:re})}let L=D.get(x.key)?.label??x.key,Z=no(x.key);return jsx(Ul,{label:L,caption:Z})};return jsxs(Paper,{sx:x=>({p:{xs:1.2,md:2},borderRadius:4,border:`1px solid ${x.palette.divider}`,bgcolor:"background.paper",boxShadow:x.palette.mode==="dark"?"none":"0 12px 28px rgba(15, 23, 42, 0.08)",display:"flex",flexDirection:"column",gap:2}),children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[jsxs(Box,{children:[jsx(Typography,{sx:{fontSize:"1.05rem",fontWeight:800},children:y}),jsx(Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:u("pivot.subtitle.default")})]}),jsxs(Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[to&&jsxs(Fragment,{children:[jsx(FormControl,{size:"small",sx:{minWidth:200},children:jsxs(Select,{value:G,displayEmpty:true,onChange:x=>sa(String(x.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsx(MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:u("pivot.preset.selectPlaceholder")}),ut.map(x=>jsx(MenuItem,{value:x.id,sx:{fontSize:"0.75rem"},children:x.name},x.id))]})}),jsx(Tooltip,{title:u("pivot.preset.save"),children:jsx(IconButton,{size:"small",onClick:Na,"aria-label":u("pivot.preset.save"),children:jsx(dp,{sx:{fontSize:18}})})}),jsx(Tooltip,{title:u("pivot.preset.delete"),children:jsx("span",{children:jsx(IconButton,{size:"small",onClick:ca,disabled:!G,"aria-label":u("pivot.preset.delete"),children:jsx(Ib,{sx:{fontSize:18}})})})}),jsx(Divider,{flexItem:true,orientation:"vertical"})]}),jsxs(Typography,{sx:{fontSize:"0.74rem",color:"text.secondary"},children:[u("pivot.records"),": ",jsx("strong",{children:t.length.toLocaleString()})," / ",u("pivot.afterFilter"),":"," ",jsx("strong",{children:Ge.length.toLocaleString()})]}),jsx(Divider,{flexItem:true,orientation:"vertical"}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.6},children:[jsx(Typography,{sx:{fontSize:"0.74rem"},children:u("pivot.grandTotal")}),jsx(Switch,{size:"small",checked:mo,onChange:x=>se(x.target.checked)})]})]})]}),jsx(Divider,{}),jsxs(DndContext,{sensors:v,collisionDetection:closestCenter,onDragStart:mt,onDragEnd:ro,children:[jsx(Sm,{isConfiguratorCollapsed:go,onToggleCollapse:()=>ke(x=>!x),availableFields:Be,fieldMap:D,filterFields:bt,columnFields:Se,rowFields:Fe,valueFields:Ke,clearZone:Ot,removeFieldFromZone:pt,getFilterSelectionSummary:no,renderDimensionFilterSelect:qo,renderAggregationSelect:Vr,getAggregationLabel:M}),jsx(Portal,{children:jsx(DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Wr()})})]}),jsx(Am,{rows:Ge,fieldMap:D,rowFields:Fe,columnFields:Se,valueFields:Ke,chartDimensionFieldId:Xt,chartPrimaryValueFieldId:yt,chartSecondaryValueFieldId:fo,chartType:ho,isCollapsed:bo,onChartDimensionFieldIdChange:x=>T(x),onChartPrimaryValueFieldIdChange:x=>N(x),onChartSecondaryValueFieldIdChange:x=>U(x),onChartTypeChange:x=>J(x),onToggleCollapse:()=>ue(x=>!x),getAggregationLabel:M}),jsx(fn,{title:u("pivot.table.sectionTitle"),subtitle:Fe.length>0?Fe.map(x=>D.get(x)?.label??x).join(" > "):u("pivot.table.dimensions"),collapsed:Uo,onToggleCollapse:()=>he(x=>!x),expandAriaLabel:u("pivot.table.collapse.ariaExpand"),collapseAriaLabel:u("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:Hr,children:Le===null?jsx(Box,{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:k})}):jsx(TableContainer,{sx:{maxHeight:i},children:jsxs(Table,{size:"small",stickyHeader:true,children:[jsx(TableHead,{children:(ua.length>0?ua:[[]]).map((x,F)=>jsxs(TableRow,{children:[F===0&&jsx(TableCell,{rowSpan:Math.max(ua.length,1),sx:L=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:L.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${L.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:Fe.length>0?Fe.map(L=>D.get(L)?.label).join(" > "):u("pivot.table.dimensions")}),(x.length>0?x:wo.map(L=>({key:L.id,label:L.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(L=>jsx(TableCell,{align:"center",colSpan:L.colSpan,rowSpan:L.rowSpan,sx:Z=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:Z.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${Z.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:jsxs(Box,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[L.expandable&&jsx(IconButton,{size:"small",onClick:()=>gr(L.key),sx:{p:.1,ml:-0.3},children:L.expanded?jsx(sb,{sx:{fontSize:16}}):jsx(df,{sx:{fontSize:16}})}),jsx(Box,{component:"span",children:L.label})]})},L.key))]},`pivot-header-row-${F}`))}),jsxs(TableBody,{children:[Le.rowTree.map(x=>jsx(Xl,{node:x,dataColumns:Ga,fieldMap:D,level:0,expandedKeys:Zt,onToggle:ao,getValue:(F,L)=>{let Z=$a.get(L);return Z?br(F,Z):0}},x.key)),hr&&jsx(Xl,{node:hr,dataColumns:Ga,fieldMap:D,level:0,expandedKeys:Zt,onToggle:ao,getValue:(x,F)=>{let L=$a.get(F);return L?br(x,L):0}})]})]})})}),jsxs(Dialog,{open:Te,onClose:()=>Ce(false),maxWidth:"xs",fullWidth:true,children:[jsx(DialogTitle,{children:u("pivot.preset.saveDialogTitle")}),jsx(DialogContent,{children:jsx(TextField,{autoFocus:true,fullWidth:true,margin:"dense",label:u("pivot.preset.nameLabel"),value:De,onChange:x=>ot(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),Or());}})}),jsxs(DialogActions,{children:[jsx(Button,{onClick:()=>Ce(false),children:u("common.cancel")}),jsx(Button,{variant:"contained",onClick:Or,disabled:!De.trim(),children:u("common.save")})]})]})]})};var Wm=(e,t,o)=>{let r=[...e,...t];return o&&r.includes(o)?o:r[0]??""},td=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",$m=(e,t,o)=>o===""?"":o&&o!==t&&e.some(r=>r.fieldId===o)?o:e.find(r=>r.fieldId!==t)?.fieldId??"",XF=({fields:e,initialLayout:t,initialFilterSelections:o={},initialShowGrandTotal:r=true,initialConfiguratorCollapsed:a=false,initialChart:n,initialChartCollapsed:i=false,initialTableCollapsed:s=false})=>{let d=useRef(0),l=useMemo(()=>new Set(e.map(j=>j.id)),[e]),c=useMemo(()=>new Map(e.map(j=>[j.id,j])),[e]),[g,h]=useState(()=>Nt(t?.rows,l)),[m,b]=useState(()=>Nt(t?.columns,l)),[C,u]=useState(()=>Nt(t?.filters,l)),[v,p]=useState(()=>{let j=t?.values??[],Te=new Set,Ce=[];return j.forEach(De=>{!l.has(De.fieldId)||Te.has(De.fieldId)||(Te.add(De.fieldId),d.current+=1,Ce.push({tokenId:`v${d.current}`,fieldId:De.fieldId,aggregation:lo(De.aggregation,c.get(De.fieldId))}));}),Ce}),[f,y]=useState(o),[k,E]=useState(r),[M,S]=useState(a),[D,P]=useState(()=>Wm(Nt(t?.rows,l),Nt(t?.columns,l),n?.dimensionFieldId)),[w,B]=useState(()=>{let j=(()=>{let Te=t?.values??[],Ce=new Set,De=[];return Te.forEach(ot=>{!l.has(ot.fieldId)||Ce.has(ot.fieldId)||(Ce.add(ot.fieldId),De.push({tokenId:ot.fieldId,fieldId:ot.fieldId,aggregation:lo(ot.aggregation,c.get(ot.fieldId))}));}),De})();return td(j,n?.primaryValueFieldId)}),[R,I]=useState(()=>{let j=(()=>{let Ce=t?.values??[],De=new Set,ot=[];return Ce.forEach(je=>{!l.has(je.fieldId)||De.has(je.fieldId)||(De.add(je.fieldId),ot.push({tokenId:je.fieldId,fieldId:je.fieldId,aggregation:lo(je.aggregation,c.get(je.fieldId))}));}),ot})(),Te=td(j,n?.primaryValueFieldId);return $m(j,Te,n?.secondaryValueFieldId)}),[A,q]=useState(n?.chartType??"bar-vertical"),[O,K]=useState(i),[Q,ne]=useState(s);useEffect(()=>{h(j=>{let Te=j.filter(Ce=>l.has(Ce));return Rr(j,Te)?j:Te}),b(j=>{let Te=j.filter(Ce=>l.has(Ce));return Rr(j,Te)?j:Te}),u(j=>{let Te=j.filter(Ce=>l.has(Ce));return Rr(j,Te)?j:Te}),p(j=>{let Te=j.filter(Ce=>l.has(Ce.fieldId)).map(Ce=>({...Ce,aggregation:lo(Ce.aggregation,c.get(Ce.fieldId))}));return Ol(j,Te)?j:Te});},[c,l]),useEffect(()=>{P(j=>Wm(g,m,j));},[m,g]),useEffect(()=>{B(j=>td(v,j));},[v]),useEffect(()=>{I(j=>$m(v,w,j));},[w,v]);let ie=useCallback(j=>{h(Nt(j,l));},[l]),Y=useCallback(j=>{b(Nt(j,l));},[l]),Ae=useCallback(j=>{u(Nt(j,l));},[l]),Ze=useCallback(j=>{p(Te=>{let Ce=j??[],De=new Set,ot=[];return Ce.forEach(je=>{if(!l.has(je.fieldId)||De.has(je.fieldId))return;De.add(je.fieldId);let eo=Te.find(Zt=>Zt.fieldId===je.fieldId);if(eo){ot.push({...eo,aggregation:lo(je.aggregation??eo.aggregation,c.get(je.fieldId))});return}d.current+=1,ot.push({tokenId:`v${d.current}`,fieldId:je.fieldId,aggregation:lo(je.aggregation,c.get(je.fieldId))});}),ot});},[c,l]),ht=useCallback(j=>{ie(j.rows??[]),Y(j.columns??[]),Ae(j.filters??[]),Ze(j.values??[]);},[Y,Ae,ie,Ze]),fe=useCallback(j=>{if(j==="rows")return h([]);if(j==="columns")return b([]);if(j==="filters")return u([]);p([]);},[]),We=useCallback((j,Te)=>{if(j==="rows")return h(Ce=>Ce.filter(De=>De!==Te));if(j==="columns")return b(Ce=>Ce.filter(De=>De!==Te));if(j==="filters")return u(Ce=>Ce.filter(De=>De!==Te));p(Ce=>Ce.filter(De=>De.tokenId!==Te));},[]),Ee=useCallback((j,Te)=>{p(Ce=>Ce.map(De=>De.tokenId===j?{...De,aggregation:lo(Te,c.get(De.fieldId))}:De));},[c]),Tt=useCallback((j,Te)=>{y(Ce=>({...Ce,[j]:Te}));},[]),_e=useCallback(()=>{y({});},[]),ze=useCallback(()=>{E(j=>!j);},[]),Ue=useCallback(()=>{S(j=>!j);},[]),tt=useCallback(j=>{P(j);},[]),_=useCallback(j=>{B(j);},[]),le=useCallback(j=>{I(j);},[]),Re=useCallback(()=>{K(j=>!j);},[]),Ne=useCallback(()=>{ne(j=>!j);},[]);return {model:useMemo(()=>({rowFields:g,setRowFields:h,columnFields:m,setColumnFields:b,filterFields:C,setFilterFields:u,valueFields:v,setValueFields:p,filterSelections:f,setFilterSelections:y,showGrandTotal:k,setShowGrandTotal:E,isConfiguratorCollapsed:M,setIsConfiguratorCollapsed:S,chartDimensionFieldId:D,setChartDimensionFieldId:P,chartPrimaryValueFieldId:w,setChartPrimaryValueFieldId:B,chartSecondaryValueFieldId:R,setChartSecondaryValueFieldId:I,chartType:A,setChartType:q,isChartCollapsed:O,setIsChartCollapsed:K,isTableCollapsed:Q,setIsTableCollapsed:ne}),[D,w,R,A,m,C,f,O,M,Q,g,k,v]),actions:{setRows:ie,setColumns:Y,setFilters:Ae,setValues:Ze,setLayout:ht,clearZone:fe,removeFieldFromZone:We,setAggregationForValue:Ee,setFilterSelection:Tt,resetFilterSelections:_e,toggleGrandTotal:ze,toggleConfigurator:Ue,setChartDimension:tt,setChartPrimaryValue:_,setChartSecondaryValue:le,setChartType:q,toggleChart:Re,toggleTable:Ne}}};var t5=({orientation:e="auto",defaultNavigationOpen:t,onNavOpenChange:o}={})=>{let r=useTheme$1(),a=useMediaQuery("(orientation: portrait)",{noSsr:true}),n=useMediaQuery(r.breakpoints.down("md"),{noSsr:true}),i=useMemo(()=>e==="auto"?a||n?"portrait":"landscape":e,[n,a,e]),[s,d]=useState(t??i==="landscape");useEffect(()=>{d(t??i==="landscape");},[t,i]);let l=g=>{d(g),o?.(g);};return {resolvedOrientation:i,isPortraitViewport:a,isCompactViewport:n,navigationOpen:s,setNavigationOpen:l,toggleNavigationOpen:()=>l(!s)}};var mk=e=>{let t=Number(e||0);return Number.isFinite(t)?t:0},a5=({rows:e,rowKey:t="id",numericField:o,defaultSelectedId:r})=>{let n=e[0]?.[t],[i,s]=useState(r??n),d=useMemo(()=>e.find(m=>m[t]===i)||e[0],[t,e,i]),[l,c]=useState(()=>{let m=d?.[o];return m==null?"0":String(m)});return {selectedId:i,selectedRecord:d,editorValue:l,setEditorValue:c,selectRecord:m=>{let b=m[t];s(b);let C=m[o];c(C==null?"0":String(C));},applyEditorValue:m=>{if(i===void 0)return;let b=mk(l),C=e.map(u=>u[t]===i?{...u,[o]:b}:u);m(C);}}};var wk=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],jm=(e,t,o,r)=>{t?.(e),r&&o?.();},d5=({open:e,onClose:t,title:o="Scan barcode",subtitle:r="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:a=wk,facingMode:n="environment",manualEntry:i=true,autoCloseOnDetect:s=true,scanIntervalMs:d=600,confirmLabel:l="Use code",cancelLabel:c="Close",manualPlaceholder:g="Enter barcode manually",onDetected:h,onError:m,sx:b})=>{let C=Dt__default.useRef(null),u=Dt__default.useRef(null),v=Dt__default.useRef(null),p=Dt__default.useRef(null),[f,y]=Dt__default.useState("idle"),[k,E]=Dt__default.useState(""),[M,S]=Dt__default.useState(null),[D,P]=Dt__default.useState(null),w=Dt__default.useCallback(()=>{v.current!==null&&(window.clearInterval(v.current),v.current=null),u.current&&(u.current.getTracks().forEach(I=>I.stop()),u.current=null),C.current&&(C.current.srcObject=null);},[]),B=Dt__default.useCallback(I=>{P(I),y("error"),m?.(I);},[m]);Dt__default.useEffect(()=>{if(!e){w(),y("idle"),P(null),E("");return}let I=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){y("unsupported"),P("Camera access is not supported in this browser.");return}y("starting"),P(null);try{let q=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:n}}});if(I){q.getTracks().forEach(O=>O.stop());return}if(u.current=q,C.current&&(C.current.srcObject=q,await C.current.play()),!window.BarcodeDetector){y("unsupported"),P("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}p.current=new window.BarcodeDetector({formats:a}),y("ready"),v.current=window.setInterval(async()=>{if(!(!C.current||!p.current)&&!(C.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let K=(await p.current.detect(C.current)).find(ne=>ne.rawValue);if(!K?.rawValue)return;let Q={rawValue:K.rawValue,format:K.format};S(Q),w(),jm(Q,h,t,s);}catch(O){B(O instanceof Error?O.message:"Failed to detect barcode.");}},d);}catch(q){B(q instanceof Error?q.message:"Unable to start camera.");}}})(),()=>{I=true,w();}},[s,n,a,t,h,e,B,d,w]);let R=()=>{let I=k.trim();if(!I)return;let A={rawValue:I,format:"manual"};S(A),jm(A,h,t,s);};return jsxs(Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"sm",children:[jsx(DialogTitle,{sx:{fontSize:"1rem",fontWeight:900},children:o}),jsx(DialogContent,{sx:{pt:"8px !important"},children:jsxs(Stack,{spacing:2,sx:b,children:[jsx(Typography,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:r}),jsxs(Paper,{elevation:0,sx:I=>({position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:I.palette.mode==="dark"?"linear-gradient(180deg, rgba(15,23,42,0.92), rgba(2,6,23,0.96))":"linear-gradient(180deg, rgba(241,245,249,1), rgba(226,232,240,0.92))"}),children:[jsx("video",{ref:C,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),jsx(Box,{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:jsx(Box,{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:jsx(Box,{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"#38bdf8",boxShadow:"0 0 18px rgba(56,189,248,0.85)"}})})}),jsxs(Box,{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[jsx(Chip,{icon:jsx(kk,{}),label:f==="ready"?"Camera ready":f==="starting"?"Starting camera":f==="unsupported"?"Preview only":f==="error"?"Scanner error":"Idle",size:"small",color:f==="error"?"error":"primary",variant:"filled"}),M?jsx(Chip,{icon:jsx(Sk,{}),label:`${M.format||"barcode"}: ${M.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),D?jsx(Alert,{severity:f==="unsupported"?"info":"warning",children:D}):null,i?jsxs(Stack,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[jsx(TextField,{fullWidth:true,label:"Barcode",placeholder:g,value:k,onChange:I=>E(I.target.value)}),jsx(Button,{variant:"contained",onClick:R,sx:{minHeight:56,px:2.5},children:l})]}):null]})}),jsx(DialogActions,{sx:{px:3,pb:2},children:jsx(Button,{onClick:t,children:c})})]})};var Rk={default:"#475569",primary:"#1d4ed8",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#0369a1"},h5=({title:e,description:t,kicker:o,icon:r,badges:a=[],metrics:n=[],footer:i,children:s,selected:d=false,draggable:l=false,isDragging:c=false,swipeThreshold:g=88,startAction:h,endAction:m,dragHandleProps:b,onClick:C,onSwipe:u,sx:v})=>{let[p,f]=useState(0),[y,k]=useState(false),E=useRef(null),M=useRef(0),S=useRef(0),D=!!(h||m),P=132,w=()=>{f(0),k(false),E.current=null,M.current=0,S.current=0;},B=O=>{(O==="start"?h:m)?.onTrigger?.(),u?.(O),w();},R=O=>{!D||O.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(E.current=O.pointerId,M.current=O.clientX,S.current=O.clientX,k(true),O.currentTarget.setPointerCapture(O.pointerId));},I=O=>{if(!y||E.current!==O.pointerId)return;S.current=O.clientX;let K=S.current-M.current,Q=Math.max(-P,Math.min(P,K));f(Q);},A=O=>{if(!y||E.current!==O.pointerId)return;let K=S.current-M.current;if(K>=g&&h){B("start");return}if(K<=-g&&m){B("end");return}Math.abs(K)<12&&C?.(),w();},q=(O,K)=>{if(!O)return null;let Q=O.backgroundColor||Rk[O.tone||"default"];return jsx(Box,{sx:{position:"absolute",top:0,bottom:0,[K]:0,width:P,px:2,display:"flex",alignItems:"center",justifyContent:K==="left"?"flex-start":"flex-end",color:"#fff",background:`linear-gradient(135deg, ${Q}, rgba(15,23,42,0.92))`},children:jsxs(Stack,{direction:"row",spacing:1,alignItems:"center",children:[O.icon,jsx(Typography,{sx:{fontWeight:700,fontSize:"0.95rem"},children:O.label})]})})};return jsxs(Box,{sx:{position:"relative",overflow:"hidden",borderRadius:4,...v},children:[q(h,"left"),q(m,"right"),jsx(Paper,{elevation:0,onPointerDown:R,onPointerMove:I,onPointerUp:A,onPointerCancel:w,sx:O=>({position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:O.palette.mode==="dark"?"linear-gradient(180deg, rgba(30,41,59,0.96), rgba(15,23,42,0.92))":"linear-gradient(180deg, #ffffff, #f8fafc)",color:"text.primary",boxShadow:d?"0 18px 42px rgba(37, 99, 235, 0.18)":"0 12px 28px rgba(15, 23, 42, 0.08)",transform:`translate3d(${p}px, 0, 0) scale(${c?.985:1})`,transition:y?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:C?"pointer":"default",opacity:c?.9:1}),children:jsxs(Stack,{spacing:1.5,children:[jsxs(Stack,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[r?jsx(Box,{sx:{mt:.25},children:r}):null,jsxs(Box,{sx:{flex:1,minWidth:0},children:[o?jsx(Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:o}):null,jsx(Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:e}),t?jsx(Typography,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:t}):null]}),l?jsx(Box,{"data-no-swipe":"true",...b,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:jsx(IconButton,{size:"small",children:jsx(Pk,{})})}):null]}),a.length>0?jsx(Stack,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((O,K)=>jsx(Chip,{label:O,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},K))}):null,n.length>0?jsx(Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:n.map(O=>jsxs(Paper,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:O.label}),jsx(Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:O.value})]},O.id))}):null,s,i]})})]})};var Si=({label:e,onPress:t,emphasis:o="default"})=>jsx(Box,{component:"button",type:"button",onClick:t,sx:r=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:o==="primary"?"primary.main":"divider",background:o==="primary"?r.palette.primary.main:o==="danger"?r.palette.mode==="dark"?"rgba(239,68,68,0.18)":"rgba(239,68,68,0.10)":r.palette.mode==="dark"?"rgba(255,255,255,0.04)":"#fff",color:o==="primary"?"#fff":"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:e}),T5=({value:e,defaultValue:t="",title:o,subtitle:r,placeholder:a="0",allowDecimal:n=false,allowNegative:i=false,maxLength:s,confirmLabel:d,clearLabel:l,backspaceLabel:c,onChange:g,onSubmit:h,onClose:m,sx:b})=>{let{t:C}=ee(),[u,v]=useState(t),p=e??u,f=w=>{e===void 0&&v(w),g?.(w);},y=w=>{s&&p.length>=s||f(`${p}${w}`);},k=w=>{if(w==="00"){if(!p){f("0");return}y("00");return}y(w);},E=()=>{!n||p.includes(".")||f(p?`${p}.`:"0.");},M=()=>{if(i){if(p.startsWith("-")){f(p.slice(1));return}f(p?`-${p}`:"-");}},S=()=>{f(p.slice(0,-1));},D=()=>{f("");},P=()=>{h?.(p);};return jsx(Paper,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...b},children:jsxs(Stack,{spacing:2,children:[jsxs(Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxs(Box,{sx:{minWidth:0},children:[o?jsx(Typography,{sx:{fontSize:"1rem",fontWeight:800},children:o}):null,r?jsx(Typography,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:r}):null]}),m?jsx(IconButton,{onClick:m,size:"small",children:jsx(Bk,{})}):null]}),jsx(Paper,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsx(Typography,{sx:{minHeight:38,fontSize:p?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:p?"text.primary":"text.disabled"},children:p||a})}),jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(w=>jsx(Si,{label:w,onPress:()=>k(w)},w)),jsx(Si,{label:i?"+/-":"00",onPress:i?M:()=>k("00")}),jsx(Si,{label:"0",onPress:()=>k("0")}),jsx(Si,{label:n?".":c?String(c):"DEL",onPress:n?E:S})]}),jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[jsx(Box,{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:jsxs(Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsx(Ak,{}),jsx(Typography,{sx:{fontWeight:700},children:c||"DEL"})]})}),jsx(Si,{label:String(l||"CLR"),onPress:D,emphasis:"danger"}),jsx(Box,{component:"button",type:"button",onClick:P,sx:w=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:w.palette.primary.main,color:"#fff",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:jsxs(Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsx(Ek,{}),jsx(Typography,{sx:{fontWeight:800},children:d||C("common.ok")})]})})]})]})})};var Jm=({touchMode:e="comfortable",sx:t,...o})=>{let r=e==="expanded";return jsx(Box,{sx:{"& .MuiPaper-root":{borderRadius:4},"& .MuiAutocomplete-root":{minWidth:{xs:"100%",md:260}},"& .MuiAutocomplete-root .MuiInputBase-root":{backgroundColor:"transparent !important"},"& .MuiInputBase-root":{minHeight:r?56:50,borderRadius:3,fontSize:r?"0.98rem":"0.92rem"},"& .MuiInputBase-input":{py:r?1.6:1.25,fontSize:r?"0.98rem":"0.92rem"},"& .MuiInputLabel-root":{fontSize:r?"0.95rem":"0.88rem"},"& .MuiButton-root":{minHeight:r?48:44,px:r?2.25:1.75,borderRadius:3,fontSize:r?"0.95rem":"0.88rem",fontWeight:700},"& .MuiIconButton-root":{width:r?40:36,height:r?40:36},"& .MuiMenuItem-root":{minHeight:r?44:38,fontSize:r?"0.95rem":"0.88rem"},"& .MuiListSubheader-root":{py:1},"& .MuiCheckbox-root":{p:r?1:.75},"& .MuiFormControlLabel-label":{fontSize:r?"0.95rem":"0.88rem"},"& .MuiDialog-paper":{borderRadius:4},"& .MuiDialogTitle-root":{fontSize:r?"1.05rem":"0.98rem",fontWeight:800},"& .MuiDialogContent-root .MuiInputBase-root":{minHeight:52},'& .MuiGrid-root > .MuiGrid-item, & .MuiGrid-root > .MuiGrid-sizeXs-1, & .MuiGrid-root > [class*="MuiGrid-grid-"]':{minWidth:0},...t},children:jsx(vr,{...o})})};var Hk=(e,t,o)=>{if(o?.(t),!!t.href){if(t.href.startsWith("http://")||t.href.startsWith("https://")){window.open(t.href,"_blank");return}e.push(t.href);}},og=({items:e,selectedId:t,orientation:o="auto",onItemSelect:r,sx:a})=>{let n=useTheme$1(),[i,s]=useState(false);useEffect(()=>{s(true);},[]);let d=useMediaQuery("(orientation: portrait)",{noSsr:true}),l=useMediaQuery(n.breakpoints.down("md"),{noSsr:true}),c=o==="auto"?d||l?"portrait":"landscape":o,g=useRouter();return jsx(Box,{sx:{display:"grid",gridTemplateColumns:!i||c==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...a},children:e.map(h=>{let m=h.id===t,b=h.color||(m?n.palette.primary.main:n.palette.divider);return jsx(Paper,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:m?"primary.main":"divider",boxShadow:m?"0 18px 40px rgba(37, 99, 235, 0.16)":"none",bgcolor:n.palette.mode==="dark"?"rgba(30,41,59,0.6)":"background.paper"},children:jsx(Box,{component:"button",type:"button",disabled:h.disabled,onClick:()=>Hk(g,h,r),sx:{width:"100%",p:2,minHeight:c==="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:jsxs(Stack,{spacing:1.5,sx:{height:"100%"},children:[jsxs(Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsx(Box,{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:m?"#fff":"text.primary",background:m?b:"action.hover"},children:h.icon||jsx(Typography,{sx:{fontSize:"1rem",fontWeight:900},children:h.title.slice(0,1).toUpperCase()})}),h.badge!==void 0?jsx(Box,{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:m?"primary.main":"action.hover",color:m?"#fff":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:h.badge}):null]}),jsxs(Box,{sx:{flex:1,minWidth:0},children:[jsx(Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:h.title}),h.caption?jsx(Typography,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:h.caption}):null,h.description?jsx(Typography,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:h.description}):null]})]})})},h.id)})})};var ig=(e,t)=>t.trim()?e.reduce((o,r)=>{let a=r.title?.toLowerCase().includes(t.toLowerCase())||r.label?.toLowerCase().includes(t.toLowerCase())||r.description?.toLowerCase().includes(t.toLowerCase()),n=r.children?ig(r.children,t):[];return (a||n.length>0)&&o.push({...r,children:n.length>0?n:r.children}),o},[]):e,Jk=e=>{let t=new Set,o=r=>{r.forEach(a=>{a.children?.length&&(t.add(a.id),o(a.children));});};return o(e),t},lg=({collapsed:e=false,onToggle:t,className:o="",maxHeight:r,menuData:a=[],colorMode:n="light",orientation:i="auto",headerSlot:s,footerSlot:d,activeHref:l,onItemSelect:c})=>{let{t:g}=ee(),h=useTheme$1(),m=useMediaQuery("(orientation: portrait)"),b=useMediaQuery(h.breakpoints.down("md")),C=i==="auto"?m||b?"portrait":"landscape":i,u=n==="dark",v=useRouter(),p=usePathname(),[f,y]=useState(""),[k,E]=useState(new Set),M=useMemo(()=>ig(a,f),[a,f]),S=useMemo(()=>f.trim()?Jk(M):k,[k,M,f]);useEffect(()=>{e&&E(new Set);},[e]);let D=I=>I.appurl||I.href||"",P=I=>{c?.(I);let A=D(I);if(A){if(A.startsWith("http://")||A.startsWith("https://")){window.open(A,"_blank");return}v.push(A);}},w=I=>{let A=!!I.children?.length;if(e&&A){t?.();return}if(A){E(q=>{let O=new Set(q);return O.has(I.id)?O.delete(I.id):O.add(I.id),O});return}P(I);},B=I=>{let A=l||p,q=D(I);return !!(q&&A===q)},R=(I,A=0)=>{let q=!!I.children?.length,O=S.has(I.id),K=B(I);return jsx(Box,{sx:{pl:A===0?0:1.5},children:jsxs(Paper,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:K?"primary.main":"divider",bgcolor:K?"action.selected":"background.paper"},children:[jsxs(Box,{component:"button",type:"button",onClick:()=>w(I),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:[jsx(Avatar,{variant:"rounded",sx:{width:40,height:40,bgcolor:K?"primary.main":"action.hover",color:K?"#fff":"text.primary"},children:I.icon||(I.title||I.label||"?").slice(0,1).toUpperCase()}),jsxs(Box,{sx:{flex:1,minWidth:0},children:[jsx(Typography,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:I.title||I.label}),I.description?jsx(Typography,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:I.description}):null]}),q?jsx(Yk,{sx:{transform:O?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):jsx(Qk,{color:"action"})]}),q?jsx(Collapse,{in:O,children:jsx(Box,{sx:{px:1.25,pb:1.25},children:I.children?.map(Q=>R(Q,A+1))})}):null]})},I.id)};return e?jsx(Paper,{elevation:0,className:o,sx:{width:C==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:u?"#101828":"rgba(255,255,255,0.88)",maxHeight:r?`${r}px`:void 0,overflowY:"auto"},children:jsxs(Stack,{spacing:1,children:[jsx(IconButton,{onClick:t,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:g("navigation.expand"),children:jsx(Xk,{})}),a.map(I=>jsx(IconButton,{onClick:()=>w(I),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:B(I)?"primary.main":"action.hover",color:B(I)?"#fff":"text.primary"},children:I.icon||(I.title||I.label||"?").slice(0,1).toUpperCase()},I.id))]})}):jsx(Paper,{elevation:0,className:o,sx:{width:C==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:u?"#101828":"rgba(255,255,255,0.88)",maxHeight:r?`${r}px`:void 0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxs(Stack,{spacing:1.25,sx:{flex:1,minHeight:0},children:[jsxs(Stack,{direction:"row",spacing:1,alignItems:"center",children:[jsx(TextField,{value:f,onChange:I=>y(I.target.value),placeholder:g("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:jsx(jk,{fontSize:"small",color:"action"})}}),C==="landscape"&&!e?jsx(IconButton,{onClick:t,sx:{bgcolor:"action.hover"},children:jsx(Zk,{})}):null]}),s,jsx(Box,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:M.length>0?M.map(I=>R(I)):jsx(Typography,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:g("navigation.noMatch")})}),d]})})};var fg=(e,t)=>{let o=t[e.id];if(e.render)return e.render(o,t);if(o==null||o==="")return "--";if(e.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)},nS=e=>Dt__default.isValidElement(e)?jsx(Box,{sx:{display:"inline-flex",alignItems:"center"},children:e}):jsx(Typography,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:e}),iS=(e,t)=>{let o=t[e.id];if(o==null||o==="")return "--";if(e.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)},lS=({summaryRow:e,visibleColumns:t,columns:o})=>{let r=o.filter(a=>t.includes(a.id)&&e[a.id]!=="");return r.length===0?null:jsx(Paper,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxs(Stack,{spacing:1,children:[jsx(Typography,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:r.map(a=>jsxs(Paper,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:a.label}),jsx(Typography,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:e[a.id]})]},`summary-${a.id}`))})]})})},sS=e=>{let{t}=ee(),o=useTheme$1(),{title:r,showToolbar:a=true,selectionMode:n,selected:i=[],onSelectionChange:s,actions:d,extraTools:l,fitContainer:c=false,fullWidth:g=false,maxHeight:h,loading:m=false,rowsPerPageOptions:b=[20,50,100,-1],onLayoutSave:C,filterConfig:u,rowKey:v,tableKey:p="default",graphReport:f,quickCreate:y,quickEdit:k,quickDelete:E,serviceUrl:M,orientation:S="auto",cardTitleField:D,cardSubtitleFields:P,toolbarSlot:w,emptyState:B,rowHeight:R="comfortable",cardActionSlot:I,renderCardFooter:A,onRowClick:q}=e,O=r||t("table.title.default"),K=useMediaQuery("(orientation: portrait)"),Q=useMediaQuery(o.breakpoints.down("md")),ne=S==="auto"?K||Q?"portrait":"landscape":S,{columns:ie,filterText:Y,setFilterText:Ae,visibleColumns:Ze,showSummary:ht,setShowSummary:fe,summaryColumns:We,grouping:Ee,setGrouping:Tt,expandedGroups:_e,groupAnchorEl:ze,setGroupAnchorEl:Ue,summaryAnchorEl:tt,setSummaryAnchorEl:_,anchorEl:le,setAnchorEl:Re,contextMenu:Ne,sortedAndFilteredRows:G,summaryRow:j,visibleRows:Te,page:Ce,setPage:De,rowsPerPage:ot,setRowsPerPage:je,totalDisplayCount:eo,setSelected:Zt,handleClick:It,toggleSummaryColumn:po,handleExport:Et,handleCloseContextMenu:Fe,toggleColumnVisibility:Se,toggleGroupExpand:bt,toggleGroupField:Ke,handleExpandGroupRecursively:Ft,handleCollapseGroupRecursively:mo,handleLayoutLoad:go,handleVariantLoad:Xt,handleLayoutSave:yt,effectiveAppId:fo,currentLayoutData:ho,currentLayoutId:bo,layoutIdToLoad:Uo,graphReportOpen:ut,handleOpenGraphReport:to,handleCloseGraphReport:xt}=nn(e),z=f?.enabled??false,V=z&&(f?.interaction?.enabled??true),H=nl(),ae=v||"id",se=Dt__default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:alpha(o.palette.divider,o.palette.mode==="dark"?.55:.3),bgcolor:o.palette.mode==="dark"?alpha(o.palette.common.white,.06):alpha(o.palette.background.paper,.92),color:o.palette.text.primary,"& .MuiChip-label":{px:1.05}}),[o]),ke=Dt__default.useMemo(()=>({...se,borderColor:alpha(o.palette.primary.main,o.palette.mode==="dark"?.42:.24),bgcolor:o.palette.mode==="dark"?alpha(o.palette.primary.main,.16):alpha(o.palette.primary.main,.08)}),[se,o]),T=Dt__default.useMemo(()=>{let $=new Set(i);return G.filter(ce=>$.has(ce?.[ae]))},[ae,i,G]),N=T.length===1?T[0]:null,U=!!y?.enabled,J=!!k?.enabled,ue=!!E?.enabled,he=y?.fields,ye=y?.excludeFields||[],me=y?.initialValues||{},Be=k?.fields,Ve=k?.excludeFields||[],it=k?.editableFields||[],Ge=k?.nonEditableFields||[],Le=k?.primaryKeys?.length?k.primaryKeys:[ae],[Lt,Ot]=Dt__default.useState(false),[pt,oo]=Dt__default.useState(false),[mt,ro]=Dt__default.useState({}),[Ko,ao]=Dt__default.useState(false),[gr,Vr]=Dt__default.useState(false),[no,qo]=Dt__default.useState({}),[fr,zo]=Dt__default.useState(false),[ar,sa]=Dt__default.useState(false),Na=m||pt||gr||ar,Or=Dt__default.useMemo(()=>{let $=[...ie];if(Array.isArray(he)&&he.length>0){let ce=new Set(he);$=$.filter(X=>ce.has(X.id));}if(ye.length>0){let ce=new Set(ye);$=$.filter(X=>!ce.has(X.id));}return $.filter(ce=>!!ce?.id)},[ie,ye,he]),ca=Dt__default.useMemo(()=>{let $=[...ie];if(Array.isArray(Be)&&Be.length>0){let ce=new Set(Be);$=$.filter(X=>ce.has(X.id));}if(Ve.length>0){let ce=new Set(Ve);$=$.filter(X=>!ce.has(X.id));}return $.filter(ce=>!!ce?.id)},[ie,Ve,Be]),hr=Dt__default.useMemo(()=>new Set(Le),[Le]),yo=Dt__default.useMemo(()=>new Set(it),[it]),_o=Dt__default.useMemo(()=>new Set(Ge),[Ge]),Va=Dt__default.useCallback($=>yo.size>0?yo.has($):!(_o.has($)||hr.has($)),[yo,_o,hr]);Dt__default.useEffect(()=>{!ut&&H.hasActiveFilters&&H.clearAll();},[H,ut]);let da=()=>{let $={};Or.forEach(ce=>{$[ce.id]=me[ce.id]??"";}),ro($),Ot(true);},Oa=($,ce)=>{ro(X=>({...X,[$]:ce}));},Ha=async()=>{if(!y?.onSubmit){Ot(false);return}try{oo(!0),await y.onSubmit(mt),Ot(!1);}finally{oo(false);}},Wa=()=>{if(!N)return;let $={};ca.forEach(X=>{$[X.id]=N[X.id]??"";});let ce=k?.getInitialValues?{...$,...k.getInitialValues(N)}:$;qo(ce),ao(true);},wo=($,ce)=>{qo(X=>({...X,[$]:ce}));},$a=async()=>{if(N){if(!k?.onSubmit){ao(false);return}try{Vr(!0),await k.onSubmit(no,N),ao(!1);}finally{Vr(false);}}},Ga=()=>{T.length!==0&&zo(true);},ua=async()=>{if(T.length===0){zo(false);return}if(!E?.onConfirm){zo(false),Zt([]),s?.([]);return}try{sa(!0),await E.onConfirm(T),zo(!1),Zt([]),s?.([]);}finally{sa(false);}},br=G,{fieldMapping:Hr}=tn({rows:br,config:{...f,title:f?.title||`${O} ${t("graph.reportTitle")}`}}),Wr=Dt__default.useMemo(()=>V?H.applyRows(br,Hr):br,[Hr,H,V,br]),{model:x}=tn({rows:Wr,config:{...f,title:f?.title||`${O} ${t("graph.reportTitle")}`,fieldMapping:Hr}}),F=x.table.columns.map($=>({id:$.id,label:$.label,align:$.align||"left",minWidth:120,numeric:$.align==="right"})),L=fo?jsx(fl,{appId:fo,tableKey:p,currentLayoutData:ho,onLayoutLoad:go,targetLayoutId:Uo,activeLayoutId:bo,serviceUrl:M??u?.serviceUrl}):null,Z=ie.filter($=>Ze.includes($.id)),de=Z.find($=>$.id===D)||Z[0],Pe=P?.map($=>Z.find(ce=>ce.id===$)).filter(Boolean)||Z.filter($=>$.id!==de?.id).slice(0,ne==="portrait"?2:3),W=Z.filter($=>$.id!==de?.id&&!Pe.some(ce=>ce.id===$.id)),re=[w,l].filter(Boolean),oe=jsxs(Fragment,{children:[jsx(Ua,{groupAnchorEl:ze,setGroupAnchorEl:Ue,grouping:Ee,setGrouping:Tt,columns:ie,toggleGroupField:Ke}),jsx(Ka,{anchorEl:le,setAnchorEl:Re,columns:ie,visibleColumns:Ze,toggleColumnVisibility:Se}),jsx(Hi,{anchorEl:tt,setAnchorEl:_,showSummary:ht,setShowSummary:fe,columns:ie,summaryColumns:We,toggleSummaryColumn:po}),jsx(Wi,{contextMenu:Ne,handleCloseContextMenu:Fe,columns:ie,visibleColumns:Ze,toggleColumnVisibility:Se})]}),rt=($,ce,X)=>{let xe=i.includes(ce),Xe=ne==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",nr=X%2===0?alpha(o.palette.primary.main,o.palette.mode==="dark"?.09:.04):alpha(o.palette.primary.main,o.palette.mode==="dark"?.05:.022),yf=alpha(o.palette.divider,.22);return jsx(Paper,{elevation:0,onClick:()=>{It({},$),q?.($);},sx:{p:R==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:xe?alpha(o.palette.primary.main,.38):yf,background:xe?`linear-gradient(135deg, ${alpha(o.palette.primary.main,.13)}, ${alpha(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${nr}, ${alpha(o.palette.primary.main,.015)})`,boxShadow:xe?`0 12px 30px ${alpha(o.palette.primary.main,.2)}`:`0 3px 10px ${alpha(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:xe?o.palette.primary.main:X%2===0?alpha(o.palette.primary.main,.26):alpha(o.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${alpha(o.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:jsxs(Stack,{spacing:1.25,children:[jsxs(Stack,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[n?jsx(Checkbox,{checked:xe,onClick:To=>To.stopPropagation(),onChange:()=>It({},$),sx:{mt:-0.6,ml:-0.6}}):null,jsxs(Box,{sx:{flex:1,minWidth:0},children:[de?jsx(Typography,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:fg(de,$)}):null,Pe.length>0?jsx(Stack,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Pe.map(To=>jsx(Chip,{label:`${To.label}: ${iS(To,$)}`,size:"small",variant:"outlined",sx:se},`${ce}-${To.id}`))}):null]}),I?jsx(Box,{onClick:To=>To.stopPropagation(),children:I($)}):null]}),W.length>0?jsx(Box,{sx:{display:"grid",gridTemplateColumns:Xe,gap:1},children:W.map(To=>jsxs(Paper,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:o.palette.mode==="dark"?alpha(o.palette.background.default,.7):alpha(o.palette.background.paper,.92),border:"0.1px solid",borderColor:alpha(o.palette.divider,.24)},children:[jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:To.label}),nS(fg(To,$))]},`${ce}-${To.id}-detail`))}):null,A?jsxs(Fragment,{children:[jsx(Divider,{}),jsx(Box,{onClick:To=>To.stopPropagation(),children:A($)})]}):null]})},ce)};return jsxs(Box,{sx:{width:g?"100%":"auto",mb:c?0:2,...c?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[u?jsx(Box,{sx:{mb:2},children:jsx(Jm,{...u,onVariantLoad:$=>{Xt($),u.onVariantLoad?.($);},appId:u.appId,tableKey:p,currentLayout:[{tableKey:p,layoutData:ho}],currentLayoutId:bo,layoutRefs:[{tableKey:p,layoutId:bo}],variantService:u.variantService,serviceUrl:M??u.serviceUrl,touchMode:ne==="portrait"?"expanded":"comfortable"})}):null,jsxs(Paper,{sx:{width:g?"100%":"auto",mb:c?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":Na?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, rgba(25, 118, 210, 0) 0%, rgba(25, 118, 210, 0.25) 25%, rgba(25, 118, 210, 1) 50%, rgba(25, 118, 210, 0.25) 75%, rgba(25, 118, 210, 0) 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}:c?{flex:1,minHeight:0,height:"100%"}:{}},children:[a?jsx(Box,{sx:{"& .MuiToolbar-root":{minHeight:60,alignItems:{xs:"flex-start",md:"center"},flexWrap:"wrap",rowGap:1,columnGap:1},"& .MuiToolbar-root > :nth-of-type(1)":{width:{xs:"100%",md:"auto"},"& .MuiTextField-root":{width:{xs:"100%",md:300}}},"& .MuiToolbar-root > :nth-of-type(2)":{flexShrink:0},"& .MuiToolbar-root > :nth-of-type(3)":{display:{xs:"none",md:"block"}},"& .MuiToolbar-root > :nth-of-type(4)":{ml:"auto",justifyContent:"flex-end",flexWrap:"wrap"},"& .MuiInputBase-root":{minHeight:46},"& .MuiIconButton-root":{width:40,height:40},"& .MuiTypography-root":{fontSize:"0.9rem"},"& .MuiButtonBase-root":{borderRadius:2.5}},children:jsx(Li,{filterText:Y,setFilterText:Ae,onRowsPerPageChange:je,rowsPerPage:ot,rowsPerPageOptions:b,page:Ce,count:eo,onPageChange:De,actions:d,extraTools:re,grouping:Ee,setGroupAnchorEl:Ue,showSummary:ht,setShowSummary:fe,setAnchorEl:Re,setSummaryAnchorEl:_,handleExport:Et,showCreateButton:U,onOpenCreateDialog:da,showEditButton:J,onOpenEditDialog:Wa,editDisabled:T.length!==1,showDeleteButton:ue,onOpenDeleteConfirm:Ga,deleteDisabled:T.length===0,onLayoutSave:C||u?.variantService&&u?.appId?yt:void 0,loading:m,layoutManager:L,onOpenGraphReport:z?to:void 0})}):null,jsx(Box,{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:jsxs(Stack,{spacing:1.25,children:[Te.length===0&&!m?B||jsx(Paper,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:t("common.noData")})}):null,Te.map(($,ce)=>{if($.type==="group"){let Xe=_e.has($.id);return jsx(Paper,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxs(Box,{component:"button",type:"button",onClick:()=>bt($.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?jsx(Yk,{}):jsx(Qk,{}),jsxs(Box,{sx:{flex:1,minWidth:0},children:[jsxs(Typography,{sx:{fontSize:"0.94rem",fontWeight:800},children:[$.field,": ",$.value]}),jsxs(Typography,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[$.count," records"]})]}),Ee.length>1&&$.level<Ee.length-1?jsxs(Stack,{direction:"row",spacing:.5,children:[jsx(Chip,{size:"small",label:t("table.group.expandAll"),onClick:nr=>{nr.stopPropagation(),Ft($.id);},sx:ke}),jsx(Chip,{size:"small",label:t("table.group.collapseAll"),onClick:nr=>{nr.stopPropagation(),mo($.id);},sx:ke})]}):null]})},$.id)}let X=$.data||$,xe=$.id||X[ae]||ce;return rt(X,xe,ce)}),ht?jsx(lS,{summaryRow:j,visibleColumns:Ze,columns:ie}):null,m?jsx(Typography,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:t("common.loading")}):null]})})]}),U?jsxs(Dialog,{open:Lt,onClose:()=>!pt&&Ot(false),fullWidth:true,maxWidth:"sm",children:[jsx(DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:y?.title||t("quickCreate.createWithTitle",{title:O})}),jsx(DialogContent,{sx:{pt:"8px !important"},children:jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Or.map($=>{let ce=$.type==="number"||$.numeric?"number":$.type==="date"?"date":"text";return jsx(TextField,{label:$.label||$.id,value:mt[$.id]??"",onChange:X=>Oa($.id,X.target.value),type:ce,fullWidth:true,InputLabelProps:{shrink:ce==="date"?true:void 0}},`quick-create-${$.id}`)}),y?.description?jsx(Alert,{severity:"info",children:y.description}):null]})}),jsxs(DialogActions,{sx:{px:3,pb:2},children:[jsx(Button,{onClick:()=>Ot(false),disabled:pt,children:y?.cancelLabel||t("common.cancel")}),jsx(Button,{onClick:Ha,variant:"contained",disabled:pt,children:y?.submitLabel||t("common.save")})]})]}):null,J?jsxs(Dialog,{open:Ko,onClose:()=>!gr&&ao(false),fullWidth:true,maxWidth:"sm",children:[jsx(DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:k?.title||t("quickEdit.editWithTitle",{title:O})}),jsx(DialogContent,{sx:{pt:"8px !important"},children:jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[ca.map($=>{let ce=$.type==="number"||$.numeric?"number":$.type==="date"?"date":"text";return jsx(TextField,{label:$.label||$.id,value:no[$.id]??"",onChange:X=>wo($.id,X.target.value),type:ce,disabled:!Va($.id),fullWidth:true,InputLabelProps:{shrink:ce==="date"?true:void 0}},`quick-edit-${$.id}`)}),k?.description?jsx(Alert,{severity:"info",children:k.description}):null]})}),jsxs(DialogActions,{sx:{px:3,pb:2},children:[jsx(Button,{onClick:()=>ao(false),disabled:gr,children:k?.cancelLabel||t("common.cancel")}),jsx(Button,{onClick:$a,variant:"contained",disabled:gr||!N,children:k?.submitLabel||t("common.save")})]})]}):null,ue?jsx(En,{open:fr,type:"warning",title:E?.title||t("quickDelete.confirmTitle"),message:E?.message||(T.length>1?t("quickDelete.confirmMessageMultiple",{count:T.length}):t("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||t("common.delete"),cancelText:E?.cancelText||t("common.cancel"),onClose:()=>!ar&&zo(false),onConfirm:ua}):null,oe,z?jsx(rl,{open:ut,onClose:xt,model:x,aiAssistant:f?.aiAssistant,interaction:V?{enabled:true,filters:H.filters,fieldMapping:Hr,onPrimaryDimensionClick:$=>H.setFilter("primaryDimension",$),onSecondaryDimensionClick:$=>H.setFilter("secondaryDimension",$),onStatusClick:$=>H.setFilter("status",$),onClearFilter:H.clearFilter,onClearAll:H.clearAll}:void 0,tableContent:jsx(sS,{appId:fo||"graph-report-internal",title:t("graph.dataBody"),columns:F,rows:x.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var CL=({appTitle:e,children:t,menuData:o=[],workloadItems:r=[],workloadSelectedId:a,showNavigation:n=true,showWorkloadNav:i=true,orientation:s="auto",logo:d,headerSlot:l,actionSlot:c,portraitBottomSlot:g,contentSx:h,containerSx:m,user:b,onSearch:C,defaultNavigationOpen:u,navOpen:v,onNavOpenChange:p,onWorkloadSelect:f,locale:y="en",localeLabel:k,localeOptions:E,onLocaleChange:M,onUserSetting:S,onUserLogout:D,userMenuItems:P,leftHeaderSlot:w,rightHeaderSlot:B})=>{let R="orbcafe:page-layout-mode",[I,A]=useState("system"),[q,O]=useState("light"),[K,Q]=useState(false),[ne,ie]=useState(false),Y=I==="system"?ne?q:"light":I;useEffect(()=>{Q(true);},[]),useEffect(()=>{try{let Ne=window.localStorage.getItem(R);(Ne==="light"||Ne==="dark"||Ne==="system")&&A(Ne);}catch{}ie(true);let le=window.matchMedia("(prefers-color-scheme: dark)"),Re=()=>{O(le.matches?"dark":"light");};return Re(),le.addEventListener("change",Re),()=>le.removeEventListener("change",Re)},[]),useEffect(()=>{if(ne)try{window.localStorage.setItem(R,I);}catch{}},[ne,I]),useEffect(()=>{Y==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[Y]);let Ae=useMemo(()=>createTheme$1({palette:Y==="dark"?{mode:"dark",primary:{main:"#93c5fd"},background:{default:"#060913",paper:"#101826"},text:{primary:"#f8fafc",secondary:"rgba(226,232,240,0.74)"},divider:"rgba(148,163,184,0.18)",action:{hover:"rgba(148,163,184,0.10)",selected:"rgba(59,130,246,0.18)"}}:{mode:"light",background:{default:"#eef3f8",paper:"#ffffff"}},components:{MuiCssBaseline:{styleOverrides:{body:{backgroundColor:Y==="dark"?"#060913":"#eef3f8"}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"}}}}}),[Y]),Ze=useMediaQuery("(orientation: portrait)"),ht=useMediaQuery(Ae.breakpoints.down("md")),fe=s==="auto"?!K||Ze||ht?"portrait":"landscape":s,[We,Ee]=useState({landscape:u??true,portrait:false}),Tt=We[fe],_e=v??Tt,ze=le=>{v===void 0&&Ee(Re=>({...Re,[fe]:le})),p?.(le);},Ue=jsxs(Stack,{direction:"row",spacing:1,alignItems:"center",children:[!K||n&&fe==="portrait"?jsx(IconButton,{onClick:()=>ze(!_e),sx:{bgcolor:"action.hover"},children:jsx(Xk,{})}):null,w]}),tt=jsxs(Stack,{direction:"row",spacing:1,alignItems:"center",children:[c,B]}),_=jsx(lg,{collapsed:fe==="landscape"?!_e:false,onToggle:()=>ze(!_e),menuData:o,orientation:fe,colorMode:Y,maxHeight:fe==="landscape"?900:void 0});return jsx(ThemeProvider$1,{theme:Ae,children:jsx(Ei,{locale:y,children:jsxs(Box,{sx:[le=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:le.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":le.palette.background.default}),...Array.isArray(m)?m:[m]],children:[jsx(Ll,{appTitle:e,logo:d===void 0?null:d,mode:I,onToggleMode:()=>A(le=>le==="system"?"dark":le==="dark"?"light":"system"),locale:y,localeLabel:k,localeOptions:E,onLocaleChange:M,user:b,onUserSetting:S,onUserLogout:D,userMenuItems:P,onSearch:C,leftSlot:Ue,rightSlot:tt}),l?jsx(Box,{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:l}):null,jsxs(Box,{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[K&&n&&fe==="landscape"?jsx(Box,{sx:{p:1.5,pr:0,flexShrink:0},children:_}):null,!K||n&&fe==="portrait"?jsx(Drawer,{open:_e,onClose:()=>ze(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:_}):null,jsx(Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...h},children:jsxs(Stack,{spacing:1.5,children:[i&&r.length>0?jsx(og,{items:r,selectedId:a,orientation:fe,onItemSelect:f}):null,jsx(Paper,{elevation:0,sx:{flex:1,minHeight:fe==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:Ae.palette.mode==="dark"?"rgba(15,23,42,0.72)":"rgba(255,255,255,0.72)",backdropFilter:"blur(12px)",color:"text.primary"},children:t})]})})]}),fe==="portrait"&&g?jsxs(Fragment,{children:[jsx(Divider,{}),jsx(Box,{sx:{p:1.5},children:g})]}):null]})})})};var yg=yS(()=>import('./COrbCanvas-EGX5NO3Y.mjs').then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsx("div",{className:"h-full w-full bg-transparent"})});function dd({isRecording:e}){return jsx(AnimatePresence,{children:e&&jsx(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:jsxs("div",{className:"relative flex h-full w-full items-center justify-center",children:[jsx("div",{className:"absolute inset-0",children:jsx(yg,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),jsx("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:jsx(yg,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var IL=dd;function ls({onTextUpdate:e,onComplete:t,onError:o,wsUrl:r="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:n=.015}){let[i,s]=useState(false),d=useRef(null),l=useRef(null),c=useRef(null),g=useRef(null),h=useRef(null),m=useRef(0),b=useRef(false),C=useRef(false),u=useCallback(()=>{d.current&&(d.current.close(),d.current=null),g.current&&(g.current.disconnect(),g.current=null),h.current&&(h.current.disconnect(),h.current=null),l.current&&(l.current.getTracks().forEach(f=>f.stop()),l.current=null),c.current&&(c.current.close(),c.current=null),C.current=false,s(false);},[]),v=useCallback(()=>{b.current||(b.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(u,500));},[u]),p=useCallback(async()=>{if(!(i||C.current)){C.current=true,b.current=false,m.current=Date.now();try{let f=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});l.current=f;let y=new WebSocket(r);d.current=y,y.onopen=()=>{s(!0),C.current=!1;},y.onmessage=D=>{try{let P=JSON.parse(D.data);if(P.type==="recognition")P.is_final?t(P.text):e?.(P.text);else if(P.type==="error"){let w=P.message||"Voice recognition error";o?.(w),v();}}catch{o?.("Failed to parse voice message");}},y.onerror=()=>{o?.("Voice service connection failed"),u();},y.onclose=()=>{u();};let k=window.AudioContext||window.webkitAudioContext;if(!k)throw new Error("AudioContext is not supported in this browser");let E=new k({sampleRate:16e3});c.current=E;let M=E.createMediaStreamSource(f);h.current=M;let S=E.createScriptProcessor(4096,1,1);g.current=S,S.onaudioprocess=D=>{if(d.current?.readyState!==WebSocket.OPEN)return;let P=D.inputBuffer.getChannelData(0),w=0;for(let I=0;I<P.length;I+=1)w+=P[I]*P[I];if(Math.sqrt(w/P.length)>n)m.current=Date.now();else if(Date.now()-m.current>a&&!b.current){v();return}let R=new Int16Array(P.length);for(let I=0;I<P.length;I+=1){let A=Math.max(-1,Math.min(1,P[I]));R[I]=A<0?A*32768:A*32767;}d.current.send(R.buffer);},M.connect(S),S.connect(E.destination);}catch{o?.("Cannot access microphone"),u();}}},[u,i,n,t,o,e,a,v,r]);return useEffect(()=>u,[u]),{isRecording:i,startRecording:p,stopRecording:v}}var vg=createContext(null);function RS(e){if(!e||!(e instanceof HTMLElement))return false;let t=e.tagName;return !!(t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable||e.closest('[data-voice-hotkey-ignore="true"]'))}function DS({children:e,onVoiceSubmit:t,onVoicePartial:o,onVoiceError:r,longPressMs:a=200,disableSpaceTrigger:n=false,ignoreWhenFocusedInput:i=true,renderOverlay:s=true,wsUrl:d,silenceThresholdMs:l,minVolumeRms:c}){let[g,h]=useState(false),[m,b]=useState(false),C=useRef(null),u=useRef(false),v=useRef(false),p=useCallback(()=>{v.current=false,h(false);},[]),{isRecording:f,startRecording:y,stopRecording:k}=ls({wsUrl:d,silenceThresholdMs:l,minVolumeRms:c,onTextUpdate:D=>{o?.(D);},onComplete:async D=>{try{D.trim()&&(b(!0),await t(D.trim()));}catch(P){let w=P instanceof Error?P.message:"Failed to process voice command";r?.(w);}finally{b(!1),p();}},onError:D=>{r?.(D),b(!1),u.current||p();}}),E=useCallback(async()=>{v.current=false,await y();},[y]),M=useCallback(()=>{k();},[k]);useEffect(()=>{if(n)return;let D=w=>{w.isComposing||(w.code==="Space"||w.key===" ")&&(u.current||w.repeat||i&&RS(document.activeElement)||(u.current=true,w.preventDefault(),C.current=setTimeout(()=>{v.current=true,h(true),y();},a)));},P=w=>{(w.code==="Space"||w.key===" ")&&(C.current&&(clearTimeout(C.current),C.current=null),u.current=false,v.current&&(w.preventDefault(),h(false),k()));};return window.addEventListener("keydown",D),window.addEventListener("keyup",P),()=>{window.removeEventListener("keydown",D),window.removeEventListener("keyup",P),C.current&&(clearTimeout(C.current),C.current=null);}},[n,i,a,y,k]);let S=useMemo(()=>({isRecording:f,isHotkeyRecording:g,isSubmitting:m,startRecording:E,stopRecording:M}),[g,f,m,E,M]);return jsxs(vg.Provider,{value:S,children:[s?jsx(dd,{isRecording:g}):null,e]})}function MS(){let e=useContext(vg);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var FL=DS,LL=MS;function He(...e){return twMerge(clsx(e))}var NS=({content:e,theme:t="light",size:o="base",defaultExpanded:r=false})=>{let[a,n]=useState(r),i=useMemo(()=>`${(o==="sm"?14:o==="lg"?18:16)-2}px`,[o]);return jsxs("div",{className:`my-6 rounded-lg overflow-hidden transition-all duration-200 ${t==="dark"?"bg-gray-800":"bg-white"}`,style:{border:`0.5px solid ${t==="dark"?"#4b5563":"#d1d5db"}`},children:[jsxs("div",{className:`px-4 py-3 cursor-pointer flex items-center justify-between transition-colors duration-200 ${t==="dark"?"bg-gray-700 hover:bg-gray-650":"bg-gray-50 hover:bg-gray-100"}`,style:{borderBottom:`0.5px solid ${t==="dark"?"#4b5563":"#e5e7eb"}`},onClick:()=>n(!a),children:[jsxs("span",{className:"flex items-center",children:[jsx("span",{className:"mr-2",children:"\u{1F914}"}),jsx("span",{className:`font-medium ${t==="dark"?"text-gray-300":"text-gray-700"}`,style:{fontSize:o==="sm"?"14px":o==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),jsx("svg",{className:`w-4 h-4 transition-transform duration-200 ${a?"rotate-180":""} ${t==="dark"?"text-gray-400":"text-gray-500"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),a&&jsx("div",{className:`p-4 whitespace-pre-wrap italic font-light ${t==="dark"?"text-gray-400":"text-gray-600"}`,style:{fontSize:i,lineHeight:"1.3 !important"},children:e})]})},Cg=NS;var KS=({content:e,language:t="text",isStreaming:o=false,className:r=""})=>{let{theme:a}=useTheme$2(),[n,i]=useState(false),s=async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3);}catch(l){console.error("\u590D\u5236\u5931\u8D25:",l);}},d=a==="dark"?oneDark:oneLight;return jsxs("div",{className:He("rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 my-4",r),children:[jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:[jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-300 uppercase",children:t}),jsx("button",{onClick:s,className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",disabled:o,title:n?"Copied":"Copy code",children:n?jsx(Check,{size:14,className:"text-green-500"}):jsx(Clipboard,{size:14,className:"text-gray-500 dark:text-gray-400"})})]}),jsx("div",{className:"text-sm",children:jsx(Prism,{language:t,style:d,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:a==="dark"?"#1f2937":"#ffffff"},wrapLongLines:true,children:e})})]})},Sg=KS;var ZS=({content:e,isLoading:t,className:o="",style:r})=>{let a=useRef(null),[n,i]=useState(false),[s,d]=useState(null),{theme:l}=useTheme$2();return useEffect(()=>{let c=async()=>{if(!(!e.trim()||!a.current)){i(true),d(null);try{Tg.initialize({startOnLoad:!1,theme:l==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit"});let h=`mermaid-${Math.random().toString(36).substr(2,9)}`,m=e.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:b}=await Tg.render(h,m);a.current&&(a.current.innerHTML=b);}catch(h){console.error("Mermaid render failed:",h),d(h instanceof Error?h.message:"Render failed"),a.current&&(a.current.innerText=e);}finally{i(false);}}},g=setTimeout(()=>{c();},100);return ()=>clearTimeout(g)},[e,l]),t||n?jsx("div",{className:`mermaid-block loading ${o}`,style:r,children:jsxs("div",{className:"flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700",children:[jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500 mr-2"}),jsx("span",{className:"text-sm text-gray-500",children:"Generating Diagram..."})]})}):s?jsxs("div",{className:"p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded text-red-600 dark:text-red-400 text-sm overflow-auto",children:[jsx("p",{className:"font-semibold mb-2",children:"Mermaid Error:"}),jsx("pre",{children:s}),jsx("pre",{className:"mt-4 text-xs text-gray-500",children:e})]}):jsx("div",{className:`mermaid-block overflow-x-auto ${o}`,style:r,ref:a})},Pg=ZS;var tw=({title:e="\u53D1\u751F\u9519\u8BEF",content:t,errorCode:o,stack:r,icon:a,closable:n=true,onClose:i,onRetry:s,className:d="",...l})=>{let[c,g]=useState(false),[h,m]=useState(false),b=async()=>{if(s){m(true);try{await s();}catch(C){console.error("\u91CD\u8BD5\u5931\u8D25:",C);}finally{m(false);}}};return jsxs("div",{className:`relative w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${d}`,...l,children:[jsxs("div",{className:"flex p-4 border-l-4 border-l-red-500 bg-red-50 dark:bg-red-900/10",children:[jsx("div",{className:"flex-shrink-0 mr-3 text-red-500 mt-0.5",children:a||jsx(AlertCircle,{className:"w-5 h-5"})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsx("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300",children:o})]}),t&&jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3 leading-relaxed",children:typeof t=="string"?jsx("p",{className:"whitespace-pre-wrap",children:t}):t}),(s||r)&&jsxs("div",{className:"flex items-center space-x-4 mt-2",children:[s&&jsxs("button",{onClick:b,disabled:h,className:"flex items-center text-xs font-medium text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 transition-colors disabled:opacity-50",children:[jsx(RotateCw,{className:`w-3.5 h-3.5 mr-1.5 ${h?"animate-spin":""}`}),h?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),r&&jsxs("button",{onClick:()=>g(!c),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 transition-colors",children:[c?jsx(ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsx(ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),c?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),n&&i&&jsx("button",{onClick:i,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors self-start",children:jsx(X,{className:"w-4 h-4"})})]}),r&&c&&jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 border-t border-gray-100 dark:border-gray-800",children:jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto whitespace-pre-wrap p-2 bg-white dark:bg-gray-900 rounded border border-gray-200 dark:border-gray-800",children:r})})]})},ss=tw;var lw=({title:e="\u8B66\u544A",content:t,warningType:o,severity:r="warning",warnings:a=[],icon:n,closable:i=true,onClose:s,onConfirm:d,actionText:l,className:c="",...g})=>{let h=()=>{switch(r){case "info":return {borderLeftColor:"border-l-blue-500",iconColor:"text-blue-500",bgColor:"bg-blue-50 dark:bg-blue-900/10"};case "error":return {borderLeftColor:"border-l-red-500",iconColor:"text-red-500",bgColor:"bg-red-50 dark:bg-red-900/10"};case "success":return {borderLeftColor:"border-l-green-500",iconColor:"text-green-500",bgColor:"bg-green-50 dark:bg-green-900/10"};default:return {borderLeftColor:"border-l-yellow-500",iconColor:"text-yellow-500",bgColor:"bg-yellow-50 dark:bg-yellow-900/10"}}},m=()=>{switch(r){case "info":return jsx(Info,{className:"w-5 h-5"});case "error":return jsx(XCircle,{className:"w-5 h-5"});case "success":return jsx(CheckCircle,{className:"w-5 h-5"});default:return jsx(AlertTriangle,{className:"w-5 h-5"})}},b=h();return jsxs("div",{className:`relative w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${c}`,...g,children:[jsxs("div",{className:`flex p-4 border-l-4 ${b.borderLeftColor} ${b.bgColor}`,children:[jsx("div",{className:`flex-shrink-0 mr-3 ${b.iconColor}`,children:n||m()}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsx("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400",children:o})]}),t&&jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:t}),a&&a.length>0&&jsx("ul",{className:"mt-2 space-y-1",children:a.map((C,u)=>jsxs("li",{className:"flex items-start text-sm text-gray-600 dark:text-gray-300",children:[jsx("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-gray-400 dark:bg-gray-500 flex-shrink-0"}),jsx("span",{children:C})]},u))})]}),i&&s&&jsx("button",{onClick:s,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:jsx(X,{className:"w-4 h-4"})})]}),d&&jsx("div",{className:"bg-gray-50 dark:bg-gray-800/50 px-4 py-3 flex justify-end border-t border-gray-100 dark:border-gray-800",children:jsx("button",{onClick:d,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:l||"\u786E\u8BA4"})})]})},cs=lw;var uw=({title:e="\u76F8\u5173\u63A8\u8350",content:t,suggestions:o,onSuggestionClick:r,maxDisplay:a=5,icon:n,closable:i=false,onClose:s,className:d="",...l})=>{let[c,g]=useState(false),[h,m]=useState(""),[b,C]=useState(false),u=useMemo(()=>h.trim()?o.filter(f=>f.toLowerCase().includes(h.toLowerCase())):o,[o,h]),v=useMemo(()=>c?u:u.slice(0,a),[u,c,a]),p=f=>{r?.(f);};return !o||o.length===0?null:jsxs("div",{className:`w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${d}`,...l,children:[jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-blue-50/30 dark:bg-blue-900/10",children:[jsxs("div",{className:"flex items-center space-x-2.5",children:[jsx("div",{className:"text-blue-500 flex-shrink-0",children:n||jsx(Lightbulb,{className:"w-5 h-5"})}),jsxs("div",{className:"flex flex-col",children:[jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 leading-tight",children:e}),t&&jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]})]}),jsxs("div",{className:"flex items-center space-x-1",children:[o.length>3&&jsx("button",{onClick:()=>C(!b),className:`p-1.5 rounded-md transition-colors ${b?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800"}`,title:b?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:jsx(Search,{className:"w-4 h-4"})}),i&&s&&jsx("button",{onClick:s,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",title:"\u5173\u95ED",children:jsx(X,{className:"w-4 h-4"})})]})]}),b&&jsx("div",{className:"px-4 py-2 border-b border-gray-100 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/50",children:jsxs("div",{className:"relative",children:[jsx("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:h,onChange:f=>m(f.target.value),className:"w-full text-sm px-3 py-1.5 pl-8 rounded border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-1 focus:ring-blue-500 focus:border-blue-500 outline-none transition-shadow",autoFocus:true}),jsx(Search,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-gray-400"})]})}),jsxs("div",{className:"p-2",children:[jsx("ul",{className:"space-y-1",children:v.map((f,y)=>jsx("li",{children:jsxs("button",{onClick:()=>p(f),className:"w-full text-left px-3 py-2 rounded-md text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-blue-600 dark:hover:text-blue-400 transition-colors group flex items-start justify-between",children:[jsx("span",{children:f}),jsx(ChevronRight,{className:"w-4 h-4 text-gray-300 group-hover:text-blue-400 opacity-0 group-hover:opacity-100 transition-all transform group-hover:translate-x-0.5"})]})},y))}),u.length>a&&jsx("button",{onClick:()=>g(!c),className:"w-full text-center py-2 text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 transition-colors border-t border-gray-50 dark:border-gray-800/50 mt-1",children:c?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${u.length})`}),u.length===0&&h&&jsx("div",{className:"text-center py-4 text-sm text-gray-500 dark:text-gray-400",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},ds=uw;var yw=({title:e,content:t,toolName:o,parameters:r,result:a,status:n,duration:i,icon:s,closable:d=false,onClose:l,onAction:c,actionText:g,className:h="",...m})=>{let[b,C]=useState(false),[u,v]=useState(true),p=()=>{switch(n){case "pending":return {iconColor:"text-blue-500",badgeBg:"bg-blue-50 dark:bg-blue-900/30",badgeText:"text-blue-600 dark:text-blue-400",label:"\u6267\u884C\u4E2D"};case "error":return {iconColor:"text-red-500",badgeBg:"bg-red-50 dark:bg-red-900/30",badgeText:"text-red-600 dark:text-red-400",label:"\u5931\u8D25"};default:return {iconColor:"text-green-500",badgeBg:"bg-green-50 dark:bg-green-900/30",badgeText:"text-green-600 dark:text-green-400",label:"\u6210\u529F"}}},f=()=>{switch(n){case "pending":return jsx(Loader2,{className:"w-5 h-5 animate-spin"});case "error":return jsx(XCircle,{className:"w-5 h-5"});default:return jsx(CheckCircle,{className:"w-5 h-5"})}},y=M=>M?M<1e3?`${M}ms`:`${(M/1e3).toFixed(2)}s`:"",k=p(),E=e||o||"\u5DE5\u5177\u8C03\u7528";return jsxs("div",{className:`w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${h}`,...m,children:[jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50",children:[jsxs("div",{className:"flex items-center space-x-3",children:[jsx("div",{className:`flex-shrink-0 ${k.iconColor}`,children:s||f()}),jsxs("div",{children:[jsxs("div",{className:"flex items-center space-x-2",children:[jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:E}),jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${k.badgeBg} ${k.badgeText}`,children:k.label})]}),o&&e&&jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 flex items-center mt-0.5",children:[jsx(Terminal,{className:"w-3 h-3 mr-1"}),o]})]})]}),jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500 dark:text-gray-400",children:[i&&jsxs("div",{className:"flex items-center bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded",children:[jsx(Clock,{className:"w-3 h-3 mr-1"}),y(i)]}),d&&l&&jsx("button",{onClick:l,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors p-1 rounded",children:jsx(X,{className:"w-4 h-4"})})]})]}),jsxs("div",{className:"p-4",children:[t&&jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-4 leading-relaxed",children:t}),r&&jsxs("div",{className:"mb-3",children:[jsxs("button",{onClick:()=>C(!b),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 mb-2",children:[b?jsx(ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsx(ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsx(Box$1,{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),b&&jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsx("pre",{className:"p-3 text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto",children:JSON.stringify(r,null,2)})})]}),a&&jsxs("div",{children:[jsxs("button",{onClick:()=>v(!u),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 mb-2",children:[u?jsx(ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsx(ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsx(Terminal,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),u&&jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsx("pre",{className:"p-3 text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto",children:typeof a=="string"?a:JSON.stringify(a,null,2)})})]}),c&&jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 dark:border-gray-800 flex justify-end",children:jsx("button",{onClick:c,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:g||"\u6267\u884C\u64CD\u4F5C"})})]})]})},us=yw;var vw=({data:e})=>{if(!e)return null;let t=useMemo(()=>{let o=[],r=[],a="\u6570\u636E\u8868\u683C";return Array.isArray(e)?(o=e,o.length>0&&(r=Object.keys(o[0]).map(n=>({id:n,label:n.charAt(0).toUpperCase()+n.slice(1),numeric:typeof o[0][n]=="number"})))):typeof e=="object"&&(a=e.title||a,o=Array.isArray(e.rows)?e.rows:Array.isArray(e.data)?e.data:[],Array.isArray(e.columns)?r=e.columns.map(i=>({id:i.key||i.id,label:i.title||i.label,numeric:i.dataType==="number"||i.numeric})):o.length>0&&(r=Object.keys(o[0]).map(i=>({id:i,label:i,numeric:typeof o[0][i]=="number"})))),o=o.map((n,i)=>({...n,id:n.id||`row_${i}`})),{title:a,columns:r,rows:o}},[e]);return t.rows.length===0?jsx("div",{className:"w-full my-4 p-4 border border-dashed border-gray-300 rounded text-center text-gray-500",children:"\u6682\u65E0\u8868\u683C\u6570\u636E"}):jsx("div",{className:"w-full my-4",children:jsx(Xr,{appId:"agent-ui-table-card",title:t.title,columns:t.columns,rows:t.rows,count:t.rows.length,rowKey:"id",fitContainer:false,maxHeight:"500px",rowsPerPage:10,rowsPerPageOptions:[5,10,20,50]})})},ps=vw;var Dw=({title:e,subtitle:t,data:o,type:r,config:a={}})=>{let n=()=>{switch(r){case "bar-chart-card":return jsx(BarChart,{className:"w-4 h-4 text-blue-500"});case "line-chart-card":return jsx(LineChart,{className:"w-4 h-4 text-green-500"});case "pie-chart-card":return jsx(PieChart,{className:"w-4 h-4 text-purple-500"});case "combo-chart-card":return jsx(Activity,{className:"w-4 h-4 text-orange-500"});case "heatmap-chart-card":return jsx(Grid$1,{className:"w-4 h-4 text-red-500"});case "fishbone-chart-card":return jsx(GitBranch,{className:"w-4 h-4 text-indigo-500"});case "waterfall-chart-card":return jsx(TrendingDown,{className:"w-4 h-4 text-teal-500"});case "google-map-card":return jsx(Globe,{className:"w-4 h-4 text-blue-600"});case "amap-card":return jsx(MapPin,{className:"w-4 h-4 text-blue-600"});default:return jsx(BarChart,{className:"w-4 h-4"})}},i=()=>{if(!o&&r!=="google-map-card"&&r!=="amap-card")return jsx("div",{className:"text-gray-500 text-sm p-4 text-center",children:"No data available"});try{switch(r){case "bar-chart-card":return jsx(Gn,{data:o,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return jsx(Su,{data:o,color:a.color,valueSuffix:a.valueSuffix||"",height:a.height});case "pie-chart-card":let s=o.reduce((l,c)=>l+(Number(c.value)||0),0),d=o.map(l=>({name:l.name,value:Number(l.value)||0,percent:typeof l.percent=="number"?l.percent:s>0?(Number(l.value)||0)/s*100:0}));return jsx(Zi,{data:d,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return jsx(wu,{data:o,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return jsx(Iu,{data:o});case "fishbone-chart-card":return jsx(Ru,{branches:o,effect:a.effect||e||"Problem"});case "waterfall-chart-card":return jsx(Mu,{data:o,height:a.height});case "google-map-card":return jsx(Eu,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,apiKey:a.apiKey,query:a.query||o&&o[0]?.query||e,height:a.height});case "amap-card":return jsx(Nu,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,keyword:a.keyword||o&&o[0]?.keyword||e,height:a.height});default:return jsxs("div",{className:"text-gray-500 text-sm p-4 text-center",children:["Unsupported chart type: ",r]})}}catch(s){return console.error("Error rendering chart:",s),jsx("div",{className:"text-red-500 text-sm p-4 text-center",children:"Error rendering chart"})}};return jsxs("div",{className:"w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md",children:[jsxs("div",{className:"flex items-center px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50",children:[jsx("div",{className:"mr-2 flex-shrink-0",children:n()}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",children:e}),t&&jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 truncate",children:t})]})]}),jsxs("div",{className:"p-4",children:[jsx("div",{className:"overflow-x-auto",children:i()}),jsx("div",{className:"mt-3",children:jsxs("details",{className:"text-xs text-gray-500 dark:text-gray-400",children:[jsx("summary",{className:"cursor-pointer hover:text-gray-700 dark:hover:text-gray-300 transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),jsx("pre",{className:"mt-2 p-2 bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-x-auto max-h-40",children:JSON.stringify(o,null,2)})]})})]})]})},ms=Dw;var Aw=({type:e,manifest:t})=>jsxs("div",{className:"w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md",children:[jsxs("div",{className:"flex items-center px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-blue-50/50 dark:bg-blue-900/10",children:[jsx(Box$1,{className:"w-4 h-4 mr-2 text-blue-600 dark:text-blue-400"}),jsxs("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:["SAP Card: ",e]})]}),jsx("div",{className:"p-4",children:jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 rounded border border-gray-100 dark:border-gray-800 overflow-x-auto",children:jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 whitespace-pre-wrap",children:JSON.stringify(t,null,2)})})})]}),fs=Aw;var hs=e=>{let t;try{t=JSON.parse(e);}catch{return null}return t&&typeof t=="object"&&((t.type==="bar-chart-card"||t.type==="line-chart-card"||t.type==="pie-chart-card"||t.type==="combo-chart-card"||t.type==="heatmap-chart-card"||t.type==="fishbone-chart-card"||t.type==="waterfall-chart-card"||t.type==="google-map-card"||t.type==="amap-card")&&t.title||(t.type==="sap-analytical-card"||t.type==="sap-list-card"||t.type==="sap-object-card"||t.type==="sap-component-card")&&t.manifest||t.type==="error-card"||t.type==="warning-card"||t.type==="suggestions-card"||t.type==="tool-result-card"||t.type==="table"&&t.data)?t:null};var Nw=({content:e,theme:t,size:o="base",className:r,enableCodeHighlight:a=true,enableMermaid:n=true,messageId:i,cardHooks:s})=>{let d=useMemo(()=>e?e.replace(/<think>([\s\S]*?)<\/think>/g,(h,m)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(m.trim())}"></div>`):"",[e]),l=(h,m,b,C,u)=>{s?.onCardEvent?.({messageId:i,cardType:h,action:m,title:b,payload:C,rawData:u});},c=(h,m,b,C,u,v)=>{if(!(!u&&!s?.onCardEvent))return (...p)=>{let f=u?.(...p),y=v?v(...p):void 0;return l(h,m,b,y,C),f}},g=useMemo(()=>({div(h){let{"data-component":m,"data-think-content":b,...C}=h;return m==="thinkbox"&&b?jsx(Cg,{content:decodeURIComponent(b),theme:t,size:o,defaultExpanded:false}):jsx("div",{...C})},table({children:h}){return jsx("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-gray-200 dark:border-gray-800",children:jsx("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:h})})},thead({children:h}){return jsx("thead",{className:"bg-gray-50 dark:bg-gray-900/60",children:h})},tbody({children:h}){return jsx("tbody",{className:"bg-white dark:bg-gray-950",children:h})},tr({children:h}){return jsx("tr",{className:"border-b border-gray-200 dark:border-gray-800 last:border-b-0",children:h})},th({children:h,align:m}){return jsx("th",{className:`px-3 py-2 font-semibold text-gray-800 dark:text-gray-100 ${m==="center"?"text-center":m==="right"?"text-right":"text-left"}`,children:h})},td({children:h,align:m}){return jsx("td",{className:`px-3 py-2 text-gray-700 dark:text-gray-200 align-top ${m==="center"?"text-center":m==="right"?"text-right":"text-left"}`,children:h})},code({inline:h,className:m,children:b,...C}){let u=/language-([\w-]+)/.exec(m||""),v=u?u[1]:"";if(h)return jsx("code",{className:"font-mono text-sm bg-gray-100 dark:bg-gray-800 px-1 py-0.5 rounded text-red-600 dark:text-red-400",...C,children:b});let p=String(b).replace(/\n$/,"");if(n&&v==="mermaid")return jsx(Pg,{content:p});if(v==="json"){let f=hs(p);if(f)switch(f.type){case "table":return jsx(ps,{data:f.data});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 jsx(ms,{...f});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsx(fs,{...f});case "error-card":{let y=f;return jsx(ss,{...y,onClose:c("error-card","close",y.title,y,y.onClose),onRetry:c("error-card","retry",y.title,y,y.onRetry)})}case "warning-card":{let y=f,k=y.onConfirm?c("warning-card","confirm",y.title,y,y.onConfirm):y.actionText&&s?.onCardEvent?c("warning-card","confirm",y.title,y):void 0;return jsx(cs,{...y,onClose:c("warning-card","close",y.title,y,y.onClose),onConfirm:k})}case "suggestions-card":{let y=f;return jsx(ds,{...y,onClose:c("suggestions-card","close",y.title,y,y.onClose),onSuggestionClick:c("suggestions-card","suggestion-click",y.title,y,y.onSuggestionClick,k=>({suggestion:k}))})}case "tool-result-card":{let y=f;return jsx(us,{...y,onClose:c("tool-result-card","close",y.title,y,y.onClose),onAction:c("tool-result-card","action",y.title,y,y.onAction)})}}}return a?jsx(Sg,{content:p,language:v,className:"not-prose"}):jsx("code",{className:m,...C,children:b})}}),[t,o,n,a,s,i]);return jsx("div",{className:He("markdown-body prose dark:prose-invert max-w-none",r),children:jsx(Bw,{remarkPlugins:[Ew,Fw],rehypePlugins:[Lw,zw],components:g,children:d})})},bs=Nw;var Vw=({content:e,messageId:t,cardHooks:o})=>{let r=(i,s,d,l,c)=>{o?.onCardEvent?.({messageId:t,cardType:i,action:s,title:d,payload:l,rawData:c});},a=(i,s,d,l,c,g)=>{if(!(!c&&!o?.onCardEvent))return (...h)=>{let m=c?.(...h),b=g?g(...h):void 0;return r(i,s,d,b,l),m}},n=hs(e);if(n)switch(n.type){case "table":return jsx(ps,{data:n.data});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 jsx(ms,{...n});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsx(fs,{...n});case "error-card":{let i=n;return jsx(ss,{...i,onClose:a("error-card","close",i.title,i,i.onClose),onRetry:a("error-card","retry",i.title,i,i.onRetry)})}case "warning-card":{let i=n,s=i.onConfirm?a("warning-card","confirm",i.title,i,i.onConfirm):i.actionText&&o?.onCardEvent?a("warning-card","confirm",i.title,i):void 0;return jsx(cs,{...i,onClose:a("warning-card","close",i.title,i,i.onClose),onConfirm:s})}case "suggestions-card":{let i=n;return jsx(ds,{...i,onClose:a("suggestions-card","close",i.title,i,i.onClose),onSuggestionClick:a("suggestions-card","suggestion-click",i.title,i,i.onSuggestionClick,s=>({suggestion:s}))})}case "tool-result-card":{let i=n;return jsx(us,{...i,onClose:a("tool-result-card","close",i.title,i,i.onClose),onAction:a("tool-result-card","action",i.title,i,i.onAction)})}}return jsx("div",{className:"dynamic-card-fallback",children:jsx(bs,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:o})})},Ng=Vw;var xd=class{static analyze(t){if(!t.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let r=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(t),a=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(t),n=t.includes("NQ#")||t.includes("data-component");return r||a||n?{blocks:[{type:"mixed",content:t,startIndex:0,endIndex:t.length}],hasComplexContent:true,overallType:"complex"}:{blocks:[{type:"markdown",content:t,startIndex:0,endIndex:t.length}],hasComplexContent:false,overallType:"simple"}}},Hw=({content:e,className:t="",messageId:o,cardHooks:r})=>{let a=Dt__default.useMemo(()=>xd.analyze(e),[e]);return jsx("div",{className:`universal-content-renderer ${t}`,children:a.blocks.map((n,i)=>n.type==="mixed"||n.type==="json-card"?jsx(Ng,{content:n.content,messageId:o,cardHooks:r},`block-${i}`):jsx(bs,{content:n.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:r},`block-${i}`))})},Vg=Hw;var Ww=({content:e,isStreaming:t=true,onComplete:o,className:r="",streamIntervalMs:a=24,streamChunkSize:n=3,messageId:i,cardHooks:s})=>{let[d,l]=useState(t?0:e.length),[c,g]=useState(!t);useEffect(()=>{if(t){l(0),g(false);return}l(e.length),g(true);},[e,t]),useEffect(()=>{if(!t||c)return;if(d>=e.length){g(true),o?.();return}let u=window.setTimeout(()=>{l(v=>Math.min(v+n,e.length));},a);return ()=>{window.clearTimeout(u);}},[e.length,c,t,o,n,a,d]);let h=()=>{t&&!c&&(l(e.length),g(true),o?.());},m=t?e.slice(0,d):e,b=t&&!c,C=t&&!c;return jsxs("div",{className:`streaming-markdown ${r}`,onClick:h,style:{cursor:t?"pointer":"default"},children:[jsxs("div",{className:"relative",children:[jsx(Vg,{content:m,messageId:i,cardHooks:s}),b&&jsx("span",{className:"inline-block w-0.5 h-5 bg-blue-500 ml-1 animate-pulse",style:{verticalAlign:"text-bottom"}})]}),C&&jsx("div",{className:"streaming-hint",style:{fontSize:"9px",color:"#999",marginTop:"8px",fontStyle:"italic",opacity:.7},children:"\u70B9\u51FB\u6B64\u5904\u663E\u793A\u5B8C\u6574\u5185\u5BB9"})]})},$g=Ww;var Gg=({buttons:e,className:t})=>{let o=r=>{switch(r){case "copy":return jsx(Copy,{size:14});case "refresh":return jsx(RefreshCw,{size:14});case "volume":return jsx(Volume2,{size:14});case "like":return jsx(ThumbsUp,{size:14});case "dislike":return jsx(ThumbsDown,{size:14});default:return null}};return jsx("div",{className:He("flex items-center gap-1",t),children:e.map((r,a)=>jsx("button",{onClick:r.onClick,disabled:r.disabled,className:He("p-1.5 rounded-md transition-colors","text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-800","disabled:opacity-50 disabled:cursor-not-allowed",r.active&&"text-blue-600 bg-blue-50 dark:text-blue-400 dark:bg-blue-900/20",r.type==="refresh"&&r.disabled&&"animate-spin"),title:r.type,type:"button",children:o(r.type)},`${r.type}-${a}`))})};var ys=({message:e,onStreamingComplete:t,assistantActions:o,streamIntervalMs:r,streamChunkSize:a,cardHooks:n})=>e.type==="assistant"?jsx("div",{className:"flex justify-start mb-4",children:jsxs("div",{className:"w-full bg-transparent text-black dark:text-gray-100 rounded-2xl px-4 py-3 mr-auto",style:{lineHeight:"1.5",fontSize:"16px",fontWeight:"280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[jsx($g,{content:e.content,isStreaming:e.isStreaming??false,onComplete:t,streamIntervalMs:r,streamChunkSize:a,messageId:e.id,cardHooks:n}),e.content&&o?.isLatestAssistant&&jsx("div",{className:"flex flex-row justify-start gap-2 mt-3 pt-2 border-t border-gray-100 dark:border-gray-700",children:jsx(Gg,{buttons:[{type:"refresh",onClick:()=>o?.onRegenerate?.(),disabled:!o?.onRegenerate},{type:"copy",onClick:()=>navigator.clipboard.writeText(e.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"})}),jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})}):jsx("div",{className:"flex justify-end",children:jsxs("div",{className:"max-w-[80%] bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-100 rounded-2xl px-4 py-3 ml-auto",style:{lineHeight:"1.5",fontSize:"16px",fontWeight:"280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[jsx("div",{className:"whitespace-pre-wrap",style:{lineHeight:"1.5",fontSize:"16px",fontWeight:"280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:e.content}),jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})});var Kg=({onTextUpdate:e,onComplete:t,onCancel:o,disabled:r,className:a})=>{let{isRecording:n,startRecording:i,stopRecording:s}=ls({onTextUpdate:e,onComplete:l=>{t?.(l);},onError:l=>{console.error("Voice input error:",l),o?.();}});return jsx("button",{onClick:async()=>{n?s():await i();},disabled:r,className:He("transition-all duration-200 flex items-center justify-center rounded-full",n?"bg-red-100 text-red-600 hover:bg-red-200 animate-pulse":"bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400 active:scale-95",r&&"opacity-50 cursor-not-allowed",a),title:n?"Stop recording":"Start recording",type:"button",children:n?jsx(jw,{sx:{fontSize:24}}):jsx(_w,{sx:{fontSize:24}})})};var Mt={container:"w-full max-w-4xl mx-auto",inputContainer:He("w-full border backdrop-blur-xl transition-all duration-300 shadow-2xl flex flex-col","bg-white/80 dark:bg-gray-900/80","border-gray-200/60 dark:border-gray-600/40","shadow-gray-900/5","hover:border-blue-300/80 hover:shadow-blue-500/10 hover:shadow-2xl","focus-within:border-blue-400/90 focus-within:shadow-blue-500/20 focus-within:shadow-3xl focus-within:scale-[1.005] transform-gpu"),dragActive:"border-blue-500 bg-blue-50/50 dark:bg-blue-900/20",textareaWrapper:"flex-1 relative flex items-center",textarea:He("w-full outline-none appearance-none resize-none bg-transparent border-none text-sm font-normal py-3 px-2","placeholder:text-gray-400/70 dark:placeholder:text-gray-500/60 placeholder:font-normal","text-gray-800 dark:text-gray-100 selection:bg-blue-200/50 dark:selection:bg-blue-500/30","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-gray-300 dark:scrollbar-thumb-gray-600"),filePreviewArea:"px-6 pt-3 pb-1 flex flex-wrap gap-2",fileTag:He("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium","bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300","border border-gray-200 dark:border-gray-700","transition-all hover:bg-gray-200 dark:hover:bg-gray-700"),buttonBase:"flex items-center justify-center transition-all duration-200 rounded-full",buttonSmall:"w-10 h-10",buttonNormal:He("bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400","cursor-pointer active:scale-95"),sendButton:He("cursor-pointer bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400 shadow-none active:scale-95"),sendButtonDisabled:He("cursor-not-allowed opacity-40 bg-transparent text-gray-400"),stopButton:He("cursor-pointer bg-red-500 hover:bg-red-600 text-white shadow-sm active:scale-95")},o1={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},r1=({enabled:e,onClick:t})=>jsx("button",{className:He(Mt.buttonBase,Mt.buttonSmall,Mt.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsx(e1,{sx:{fontSize:24}})}),a1=()=>jsxs("button",{className:He(Mt.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",Mt.buttonNormal),"aria-label":"Tools",type:"button",children:[jsx(t1,{sx:{fontSize:20}}),jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),n1=({canSend:e,isResponding:t,onSend:o,onStop:r})=>t?jsx("button",{className:He(Mt.buttonBase,Mt.buttonSmall,Mt.stopButton),onClick:r,"aria-label":"Stop generating",type:"button",children:jsx(Stop,{sx:{fontSize:20}})}):jsx("button",{className:He(Mt.buttonBase,Mt.buttonSmall,e?Mt.sendButton:Mt.sendButtonDisabled),onClick:o,disabled:!e,"aria-label":"Send message",type:"button",children:jsx(Jw,{sx:{fontSize:24},className:e?"text-gray-500 dark:text-gray-400":"text-gray-300 dark:text-gray-600"})}),qg=({onSend:e,onStop:t,isResponding:o=false,placeholder:r,getText:a})=>{let[n,i]=useState(""),[s,d]=useState([]),[l,c]=useState(false),[g,h]=useState(false),m=useRef(null),b=r||(a?a("00019","Type a message..."):"Type a message..."),C=(n.trim().length>0||s.length>0)&&!o,u={enabled:true},v=useCallback(A=>{i(A.target.value),A.target.style.height="auto",A.target.style.height=`${Math.min(A.target.scrollHeight,200)}px`;},[]),p=useCallback(A=>{if(A.target.files&&A.target.files.length>0){let q=Array.from(A.target.files);d(O=>{let K=q.filter(ne=>O.some(ie=>ie.name===ne.name&&ie.size===ne.size));K.length>0&&console.warn("Duplicate files ignored:",K.map(ne=>ne.name));let Q=q.filter(ne=>!O.some(ie=>ie.name===ne.name&&ie.size===ne.size));return [...O,...Q]}),m.current&&(m.current.value="");}},[]),f=useCallback(A=>{d(q=>q.filter((O,K)=>K!==A));},[]),y=useCallback(()=>{m.current?.click();},[]),k=useCallback(async()=>{if(!C)return;let A=n,q=[...s];i(""),d([]),m.current&&(m.current.value="");try{await e(A,q);}catch(O){console.error("Failed to send message:",O),i(A),d(q);}},[n,C,e,s]),E=useCallback(A=>{A.key==="Enter"&&!A.shiftKey&&!l&&(A.preventDefault(),k());},[k,l]),M=useCallback(()=>{c(true);},[]),S=useCallback(()=>{c(false);},[]),D=useCallback(A=>{i(A);},[]),P=useCallback(A=>{i(A);},[]),w=useCallback(()=>{},[]),B=useCallback(A=>{A.preventDefault(),h(true);},[]),R=useCallback(A=>{A.preventDefault(),h(false);},[]),I=useCallback(A=>{if(A.preventDefault(),h(false),A.dataTransfer.files&&A.dataTransfer.files.length>0){let q=Array.from(A.dataTransfer.files);d(O=>[...O,...q]);}},[]);return jsx("div",{className:Mt.container,children:jsxs("div",{className:"relative",children:[jsx("input",{type:"file",multiple:true,className:"hidden",ref:m,onChange:p}),jsxs("div",{className:He(Mt.inputContainer,g&&Mt.dragActive),style:{borderRadius:"32px"},onDragOver:B,onDragLeave:R,onDrop:I,children:[s.length>0&&jsx("div",{className:Mt.filePreviewArea,children:s.map((A,q)=>jsxs("div",{className:Mt.fileTag,children:[jsx(InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsx("span",{className:"truncate max-w-[150px]",children:A.name}),jsx("button",{onClick:()=>f(q),className:"ml-1 hover:text-red-500 focus:outline-none",type:"button",children:jsx(Close,{sx:{fontSize:16}})})]},`${A.name}-${q}`))}),jsxs("div",{className:"flex flex-col w-full p-2",children:[jsx("div",{className:He(Mt.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsx("textarea",{className:He(Mt.textarea,"min-h-[24px] py-0 px-0"),placeholder:b,value:n,onChange:v,onKeyDown:E,onCompositionStart:M,onCompositionEnd:S,style:o1,"aria-label":"Message input",spellCheck:false,rows:1})}),jsxs("div",{className:"flex items-center justify-between px-1 pb-1",children:[jsxs("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:[jsx(r1,{enabled:u.enabled,onClick:y}),jsx(a1,{})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(Kg,{onTextUpdate:D,onComplete:P,onCancel:w,disabled:o,className:Mt.buttonSmall}),jsx(n1,{canSend:C,isResponding:o,onSend:k,onStop:t})]})]})]})]})]})})};var Zg=({messages:e,onSend:t,onStop:o,onRegenerate:r,isResponding:a=false,className:n,placeholder:i,streamIntervalMs:s,streamChunkSize:d,onMessageStreamingComplete:l,cardHooks:c,showInput:g=true})=>{let h=useRef(null),m=useRef(e.length);return useEffect(()=>{e.length>m.current&&h.current?.scrollIntoView({behavior:"smooth"}),m.current=e.length;},[e]),jsxs("div",{className:He("flex flex-col h-full w-full relative",n),children:[jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600",children:[e.map((b,C)=>{let u=b.type==="assistant"&&C===e.length-1,v=b.type==="assistant"?{isLatestAssistant:u,onRegenerate:r?()=>r(b.id):void 0}:void 0;return jsx(ys,{message:b,assistantActions:v,onStreamingComplete:()=>l?.(b.id),streamIntervalMs:s,streamChunkSize:d,cardHooks:c},b.id)}),jsx("div",{ref:h})]}),g&&jsx("div",{className:"p-4 bg-gradient-to-t from-white via-white to-transparent dark:from-gray-900 dark:via-gray-900 pb-8 z-10",children:jsx(qg,{onSend:t||(async()=>{}),onStop:o||(()=>{}),isResponding:a,placeholder:i})})]})};var Fo={};var s1={idle:"Idle",running:"Running",success:"Success",error:"Error",pending:"Pending"},iV=({title:e="AI Agent",description:t,headerActions:o,className:r,agentStatus:a,showInput:n=false,...i})=>{let s=a??(i.isResponding?"running":"idle");return jsxs("div",{className:He("relative flex h-full w-full",Fo.agentPanel,r),"data-status":s,children:[jsx("div",{className:Fo.colorHalo,"data-status":s,"aria-hidden":"true"}),jsxs("div",{className:Fo.marqueeBorder,"data-status":s,"aria-hidden":"true",children:[jsx("span",{className:He(Fo.edge,Fo.top)}),jsx("span",{className:He(Fo.edge,Fo.right)}),jsx("span",{className:He(Fo.edge,Fo.bottom)}),jsx("span",{className:He(Fo.edge,Fo.left)})]}),jsxs("div",{className:"relative z-10 flex h-full w-full flex-col rounded-xl border border-slate-200/70 bg-white shadow-sm overflow-hidden dark:border-slate-800 dark:bg-gray-950",children:[jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 dark:border-gray-800 bg-white/50 dark:bg-gray-900/50 backdrop-blur-sm z-20",children:[jsxs("div",{children:[jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e}),t&&jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("div",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-full bg-gray-100/80 dark:bg-gray-800/70",children:[jsx("span",{className:Fo.statusDot,"data-status":s}),jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-gray-600 dark:text-gray-300",children:s1[s]})]}),o]})]}),jsx("div",{className:"flex-1 min-h-0 relative z-10",children:jsx(Zg,{...i,showInput:n})})]})]})};var m1={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},gV=({messages:e,onSend:t,onRegenerate:o,isResponding:r=false,className:a,placeholder:n,title:i="Copilot",corner:s="bottom-right",onCollapse:d,onHeaderPointerDown:l,onPlusClick:c,onMicClick:g,streamIntervalMs:h,streamChunkSize:m,onMessageStreamingComplete:b,cardHooks:C})=>{let[u,v]=useState(""),[p,f]=useState(false),y=useRef(null),k=m1[s];useEffect(()=>{y.current?.scrollIntoView({behavior:"smooth"});},[e,r]);let E=useCallback(async()=>{let S=u.trim();!S||r||(v(""),await t(S));},[r,t,u]),M=useCallback(async S=>{S.key==="Enter"&&!p&&(S.preventDefault(),await E());},[E,p]);return jsxs("div",{className:He("relative flex h-full w-full min-h-[460px] min-w-[340px] flex-col overflow-hidden rounded-3xl border border-gray-200 bg-white shadow-none dark:border-gray-800 dark:bg-gray-900",a),children:[d&&jsx("button",{onClick:d,className:He("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",k==="top-left"&&"-left-2 -top-2",k==="top-right"&&"-right-2 -top-2",k==="bottom-left"&&"-bottom-2 -left-2",k==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:jsx("span",{className:He("block h-4 w-4 border-[#21BCFF]",k==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",k==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",k==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",k==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 px-4 py-3 dark:border-gray-800",onPointerDown:l,children:[jsx("div",{className:"flex items-center",children:jsx("h3",{className:"text-base font-semibold tracking-tight text-gray-900 dark:text-gray-100",children:i})}),jsx("div",{})]}),jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600",children:[e.map((S,D)=>{let P=S.type==="assistant"&&D===e.length-1,w=S.type==="assistant"?{isLatestAssistant:P,onRegenerate:o?()=>o(S.id):void 0}:void 0;return jsx(ys,{message:S,assistantActions:w,onStreamingComplete:()=>b?.(S.id),streamIntervalMs:h,streamChunkSize:m,cardHooks:C},S.id)}),jsx("div",{ref:y})]}),jsx("div",{className:"border-t border-gray-100 px-3 py-3 dark:border-gray-800",children:jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-blue-300/80 bg-white px-2 py-1.5 dark:bg-gray-900",children:[jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",onClick:c,type:"button","aria-label":"Add",children:jsx(Plus,{className:"h-4 w-4"})}),jsx("input",{className:"h-7 flex-1 border-none bg-transparent text-sm text-gray-800 outline-none placeholder:text-gray-400 dark:text-gray-100 dark:placeholder:text-gray-500",placeholder:n||"Ask Copilot...",value:u,onChange:S=>v(S.target.value),onCompositionStart:()=>f(true),onCompositionEnd:()=>f(false),onKeyDown:M,"aria-label":"Copilot input",spellCheck:false}),jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",onClick:g,type:"button","aria-label":"Microphone",children:jsx(Mic,{className:"h-4 w-4"})})]})})]})};var yV=({defaultMode:e="login",onLogin:t,onRegister:o,onForgotPassword:r}={})=>{let[a,n]=useState(e),[i,s]=useState(false),d=useCallback(async m=>{s(true);try{await m?.();}finally{s(false);}},[]),l=useCallback(m=>d(()=>t?.(m)),[t,d]),c=useCallback(m=>d(()=>o?.(m)),[o,d]),g=useCallback(m=>d(()=>r?.(m)),[r,d]),h=useMemo(()=>({mode:a,loading:i,onModeChange:n,onLogin:l,onRegister:c,onForgotPassword:g}),[g,l,c,i,a]);return {mode:a,loading:i,setMode:n,authPageProps:h}};var kd=({label:e,...t})=>jsx(FormControlLabel,{control:jsx(Checkbox,{...t}),label:e});var Di=forwardRef((e,t)=>jsx(Paper,{ref:t,...e,elevation:e.elevation||1,sx:{p:2,mb:2,...e.sx}}));Di.displayName="CPaper";var I1={productName:"ORBCAFE",headline:"Operational workbench",subheadline:"A focused entry point for reports, planning, agent workflows, and enterprise operations.",loginTitle:"Sign in",loginSubtitle:"Use your workspace 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."},VV=({mode:e,defaultMode:t="login",onModeChange:o,onLogin:r,onRegister:a,onForgotPassword:n,loading:i=false,logo:s,copy:d,sx:l})=>{let c=useTheme(),g=e!==void 0,[h,m]=useState(t),b=e??h,C=useMemo(()=>({...I1,...d}),[d]),[u,v]=useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[p,f]=useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[y,k]=useState({email:""}),[E,M]=useState(""),S=I=>{g||m(I),M(""),o?.(I);},D=async I=>{I.preventDefault(),await r?.(u),M("Demo login accepted. No real authentication request was sent.");},P=async I=>{I.preventDefault(),await a?.(p),M("Demo registration saved locally for this screen.");},w=async I=>{I.preventDefault(),await n?.(y),M("Demo reset link request created. No email was sent.");},B=b==="login"?C.loginTitle:b==="register"?C.registerTitle:C.forgotTitle,R=b==="login"?C.loginSubtitle:b==="register"?C.registerSubtitle:C.forgotSubtitle;return jsxs(Box,{sx:{minHeight:"100vh",display:"grid",gridTemplateColumns:{xs:"1fr",md:"minmax(320px, 0.9fr) minmax(420px, 1.1fr)"},background:c.palette.mode==="dark"?"linear-gradient(135deg, #071018 0%, #151515 48%, #101827 100%)":"linear-gradient(135deg, #eef3f8 0%, #ffffff 52%, #e8f2f0 100%)",...l},children:[jsxs(Box,{sx:{display:{xs:"none",md:"flex"},flexDirection:"column",justifyContent:"space-between",p:{md:6,lg:8},borderRight:`1px solid ${c.palette.divider}`},children:[jsxs(Stack,{spacing:4,children:[jsx(Box,{children:s}),jsxs(Stack,{spacing:2,children:[jsx(Typography,{sx:{fontSize:14,fontWeight:700,color:"primary.main",textTransform:"uppercase"},children:C.productName}),jsx(Typography,{sx:{fontSize:{md:34,lg:42},lineHeight:1.06,fontWeight:800},children:C.headline}),jsx(Typography,{sx:{maxWidth:460,color:"text.secondary",fontSize:16,lineHeight:1.7},children:C.subheadline})]})]}),jsxs(Stack,{direction:"row",spacing:2,sx:{color:"text.secondary",fontSize:13},children:[jsx(Typography,{variant:"caption",children:"Reports"}),jsx(Typography,{variant:"caption",children:"Planning"}),jsx(Typography,{variant:"caption",children:"Agent UI"})]})]}),jsx(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",p:{xs:2,sm:4,md:6}},children:jsx(Di,{elevation:0,sx:{width:"100%",maxWidth:460,m:0,p:{xs:2.5,sm:4},borderRadius:3,border:`1px solid ${c.palette.divider}`,backgroundColor:c.palette.mode==="dark"?"rgba(15, 23, 42, 0.86)":"rgba(255, 255, 255, 0.88)",backdropFilter:"blur(18px)",boxShadow:c.palette.mode==="dark"?"0 24px 80px rgba(0,0,0,0.34)":"0 24px 80px rgba(15,23,42,0.10)"},children:jsxs(Stack,{spacing:3,children:[jsxs(Stack,{spacing:1,children:[jsx(Box,{sx:{display:{xs:"block",md:"none"},mb:1},children:s}),jsx(Typography,{sx:{fontSize:28,fontWeight:800},children:B}),jsx(Typography,{sx:{color:"text.secondary"},children:R})]}),E&&jsx(Alert,{severity:"success",children:E}),b==="login"&&jsx(Box,{component:"form",onSubmit:D,children:jsxs(Stack,{spacing:2,children:[jsx(io,{label:"Email or user ID",value:u.username,onChange:I=>v(A=>({...A,username:I.target.value})),InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(tf,{fontSize:"small"})})}}),jsx(io,{label:"Password",type:"password",value:u.password,onChange:I=>v(A=>({...A,password:I.target.value})),InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(w1,{fontSize:"small"})})}}),jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[jsx(kd,{label:"Remember me",checked:u.remember,onChange:I=>v(A=>({...A,remember:I.target.checked}))}),jsx(jo,{type:"button",variant:"text",size:"small",onClick:()=>S("forgot"),children:"Forgot?"})]}),jsx(jo,{type:"submit",size:"large",disabled:i,children:"Sign in"}),jsxs(Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["New user?"," ",jsx(jo,{type:"button",variant:"text",size:"small",onClick:()=>S("register"),sx:{minWidth:0,p:0},children:"Register"})]})]})}),b==="register"&&jsx(Box,{component:"form",onSubmit:P,children:jsxs(Stack,{spacing:2,children:[jsx(io,{label:"Full name",value:p.name,onChange:I=>f(A=>({...A,name:I.target.value})),InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(tf,{fontSize:"small"})})}}),jsx(io,{label:"Work email",type:"email",value:p.email,onChange:I=>f(A=>({...A,email:I.target.value})),InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(ef,{fontSize:"small"})})}}),jsx(io,{label:"Password",type:"password",value:p.password,onChange:I=>f(A=>({...A,password:I.target.value})),InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(T1,{fontSize:"small"})})}}),jsx(io,{label:"Confirm password",type:"password",value:p.confirmPassword,onChange:I=>f(A=>({...A,confirmPassword:I.target.value}))}),jsx(kd,{label:"I accept the demo workspace terms",checked:p.acceptedTerms,onChange:I=>f(A=>({...A,acceptedTerms:I.target.checked}))}),jsx(jo,{type:"submit",size:"large",disabled:i,children:"Create demo account"}),jsxs(Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["Already have an account?"," ",jsx(jo,{type:"button",variant:"text",size:"small",onClick:()=>S("login"),sx:{minWidth:0,p:0},children:"Sign in"})]})]})}),b==="forgot"&&jsx(Box,{component:"form",onSubmit:w,children:jsxs(Stack,{spacing:2,children:[jsx(io,{label:"Work email",type:"email",value:y.email,onChange:I=>k({email:I.target.value}),InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(ef,{fontSize:"small"})})}}),jsx(jo,{type:"submit",size:"large",disabled:i,children:"Send reset request"}),jsxs(Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["Remember your password?"," ",jsx(jo,{type:"button",variant:"text",size:"small",onClick:()=>S("login"),sx:{minWidth:0,p:0},children:"Back to sign in"})]})]})}),jsx(Divider,{}),jsx(Typography,{variant:"caption",sx:{color:"text.secondary"},children:"Demo credentials: demo@orbcafe.local / orbcafe-demo"})]})})})]})};var D1={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},M1=[{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"}],of=({tasks:e,defaultScale:t="week",defaultSelectedTaskId:o,initialFilters:r,filterFields:a,filterAppId:n="planning-gantt-filter",filterTableKey:i="planning",columns:s,page:d,rowsPerPage:l,rowsPerPageOptions:c,count:g,onPageChange:h,onRowsPerPageChange:m,onFilterSearch:b,onFilterVariantLoad:C,enableRowReorder:u,onTaskReorder:v})=>{let[p,f]=useState(t),[y,k]=useState(o??e[0]?.id??""),[E,M]=useState({...D1,...r}),S=useMemo(()=>{let B=String(E.keyword?.value??"").trim().toLowerCase(),R=String(E.status?.value??"").trim(),I=String(E.owner?.value??"").trim().toLowerCase(),A=String(E.workCenter?.value??"").trim().toLowerCase(),q=E.dateRange?.value,O=q?.[0]?mr(q[0]):null,K=q?.[1]?mr(q[1]):null;return e.filter(Q=>{if(B&&![Q.id,Q.code,Q.title,Q.project,Q.workCenter,Q.owner?.name].join(" ").toLowerCase().includes(B)||R&&Q.status!==R||I&&!String(Q.owner?.name??"").toLowerCase().includes(I)||A&&!String(Q.workCenter??"").toLowerCase().includes(A))return false;if(O||K){let ne=mr(Q.startDate),ie=mr(Q.endDate),Y=O?ie.isAfter(O)||ie.isSame(O,"day"):true,Ae=K?ne.isBefore(K)||ne.isSame(K,"day"):true;if(!Y||!Ae)return false}return true})},[E,e]);useEffect(()=>{S.length!==0&&(S.some(B=>B.id===y)||k(S[0].id));},[S,y]);let D=useCallback(B=>{k(B.id);},[]),P=useMemo(()=>({appId:n,tableKey:i,fields:a??M1,filters:E,onFilterChange:M,onVariantLoad:C??(()=>{}),onSearch:b??(()=>{})}),[n,a,i,E,b,C]),w=useMemo(()=>({tasks:S,columns:s,scale:p,onScaleChange:f,page:d,rowsPerPage:l,rowsPerPageOptions:c,count:g,onPageChange:h,onRowsPerPageChange:m,selectedTaskId:y,onTaskSelect:D,enableRowReorder:u,onTaskReorder:v}),[s,g,u,S,h,m,v,D,d,l,c,p,y]);return {scale:p,setScale:f,selectedTaskId:y,setSelectedTaskId:k,filters:E,setFilters:M,filteredTasks:S,smartFilterProps:P,planningGanttProps:w}};var qV=e=>{let t=of(e),o=useMemo(()=>({filterProps:t.smartFilterProps,ganttProps:t.planningGanttProps}),[t.planningGanttProps,t.smartFilterProps]);return {...t,layoutProps:o}};var rf=e=>jsx(Chip,{...e,size:e.size||"small",variant:e.variant||"outlined"});var ia=forwardRef(({tooltip:e,...t},o)=>{let r=jsx(IconButton,{ref:o,...t,size:t.size||"small"});return e?jsx(Tooltip,{title:e,children:r}):r});ia.displayName="CIconButton";var nf=({label:e,options:t,minWidth:o=120,...r})=>jsxs(FormControl,{fullWidth:true,size:"small",sx:{minWidth:o},children:[e&&jsx(InputLabel,{children:e}),jsx(Select,{label:e,...r,children:t.map(a=>jsx(MenuItem,{value:a.value,children:a.label},a.value))})]});mr.extend($1);var Pd=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],Rd=56,za=58,Ts=8,Dd=260,uT=320,Is="0.85rem",la="220ms cubic-bezier(0.2, 0, 0, 1)",uf={"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"}},pT=e=>e?uf[e]?.label??e:"Planned",mT=e=>e?uf[e]?.color??"default":"info",pf=e=>Math.min(100,Math.max(0,e??0)),mf=(e,t=0)=>e.flatMap(o=>[{...o,level:t},...mf(o.children??[],t+1)]),gT=e=>({id:e.id,code:e.code??e.id,title:e.title,titleSub:e.project??e.workCenter??"General",project:e.project??"",workCenter:e.workCenter??"",owner:e.owner?.name??"Unassigned",status:pT(e.status),statusTone:e.status??"planned",progress:pf(e.progress),startDate:e.startDate,endDate:e.endDate,color:e.color,reorderable:e.reorderable!==false}),gf=(e,t)=>t==="month"?e.startOf("month"):t==="week"?e.startOf("week"):t==="day"?e.startOf("day"):e.startOf("hour"),ff=(e,t)=>t==="month"?e.endOf("month"):t==="week"?e.endOf("week"):t==="day"?e.endOf("day"):e.endOf("hour"),fT=(e,t,o)=>{let r=[],a=gf(e,o),n=ff(t,o);for(;a.isBefore(n)||a.isSame(n);){let i=o==="month"?a.add(1,"month"):o==="week"?a.add(1,"week"):o==="day"?a.add(1,"day"):a.add(1,"hour");r.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:i}),a=i;}return r},Md=(e,t,o)=>{let r=0;for(let a of t){if(e.isBefore(a.start))return r;if(e.isBefore(a.end)){let n=Math.max(1,a.end.valueOf()-a.start.valueOf()),i=Math.max(0,e.valueOf()-a.start.valueOf());return r+i/n*o}r+=o;}return r},hf=({title:e="Project Plan",extraTools:t,bodyHeight:o=560,tasks:r,columns:a,scale:n="week",onScaleChange:i,page:s,rowsPerPage:d=20,rowsPerPageOptions:l=[20,50,100,-1],count:c,onPageChange:g,onRowsPerPageChange:h,timelineStart:m,timelineEnd:b,selectedTaskId:C,onTaskSelect:u,enableRowReorder:v=true,onTaskReorder:p,emptyLabel:f="No planning tasks available.",sx:y})=>{let k=useTheme(),{t:E}=ee(),M=useRef(null),S=useRef(null),D=useRef(null),P=useRef(false),[w,B]=useState(null),[R,I]=useState("content"),[A,q]=useState(null),[O,K]=useState({}),[Q,ne]=useState(Rd),[ie,Y]=useState([]),[Ae,Ze]=useState({activeId:null,overId:null}),[ht,fe]=useState(null),[We,Ee]=useState(false),Tt=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:4}})),_e=useRef(null),ze=useMemo(()=>mf(r),[r]),Ue=useMemo(()=>{if(ie.length===0)return ze;let T=new Map(ze.map(J=>[J.id,J])),N=ie.map(J=>T.get(J)).filter(J=>!!J),U=new Set(N.map(J=>J.id));return [...N,...ze.filter(J=>!U.has(J.id))]},[ze,ie]),tt=useMemo(()=>new Map(Ue.map(T=>[T.id,T])),[Ue]),_=useMemo(()=>Ue.map(T=>gT(T)),[Ue]),le=useMemo(()=>new Map(_.map(T=>[T.id,T])),[_]),Re=useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(T,N)=>jsxs(Stack,{spacing:.2,children:[jsx(Typography,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:N.title}),jsx(Typography,{sx:{fontSize:13,color:"text.secondary"},children:N.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(T,N)=>jsx(rf,{label:N.status,color:mT(N.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:T=>jsxs(Stack,{spacing:.6,children:[jsxs(Typography,{variant:"caption",sx:{color:"text.secondary"},children:[T,"%"]}),jsx(LinearProgress,{variant:"determinate",value:T,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),Ne=useMemo(()=>{if(!a||a.length===0)return Re;let T=new Map(Re.map(N=>[N.id,N]));return a.map(N=>{let U=T.get(N.id),J=N.width??U?.minWidth??120,ue={id:N.id,label:N.label,minWidth:J};if(U?.numeric&&(ue.numeric=true),N.render){let he=N.render;return ue.render=(ye,me)=>{let Be=tt.get(me.id);return he(Be||me)},ue}return U?.render?(ue.render=U.render,ue):(ue.render=(he,ye)=>{let me=ye[N.id];if(me!=null&&String(me).length>0)return String(me);let Ve=tt.get(ye.id)?.[N.id];return Ve!=null&&String(Ve).length>0?String(Ve):"-"},ue)})},[a,Re,tt]),G=nn({appId:"planning-gantt",title:e,columns:Ne,rows:_,rowKey:"id",page:s,rowsPerPage:d,rowsPerPageOptions:l,count:c??_.length,onPageChange:g,onRowsPerPageChange:h,showSummary:false}),j=G.visibleRows,Te=G.rowsPerPage===-1?1:Math.max(1,Math.ceil(G.totalDisplayCount/G.rowsPerPage)),Ce=Math.max(0,Math.min(G.page,Te-1)),De=Math.min(Ce+1,Te),ot=Ce>0,je=Ce<Te-1&&G.rowsPerPage!==-1;useEffect(()=>{let T=ze.map(N=>N.id);Y(N=>{let U=new Set(T),J=N.filter(me=>U.has(me)),ue=new Set(J),he=T.filter(me=>!ue.has(me)),ye=[...J,...he];return ye.length===N.length&&ye.every((me,Be)=>me===N[Be])?N:ye});},[ze]);let eo=T=>T.type==="group"?`group-${T.id}`:`row-${(T.data||T)?.id}`,Zt=useMemo(()=>{let T=_.map(Be=>mr(Be.startDate)),N=_.map(Be=>mr(Be.endDate)),U=m?mr(m):T.reduce((Be,Ve)=>Ve.isBefore(Be)?Ve:Be,T[0]??mr()),J=b?mr(b):N.reduce((Be,Ve)=>Ve.isAfter(Be)?Ve:Be,N[0]??mr().add(30,"day")),ue=n==="month"?"month":n==="week"?"week":n==="day"?"day":"hour",he=n==="month"?"month":n==="week"?"week":n==="day"?"day":"hour",ye=n==="hour"?12:1,me=n==="hour"?12:1;return {start:gf(U.subtract(ye,ue),n),end:ff(J.add(me,he),n)}},[_,n,b,m]),It=Pd.find(T=>T.value===n)??Pd[1],po=Array.isArray(t)?t:t?[t]:[],Et=useMemo(()=>fT(Zt.start,Zt.end,n),[Zt.end,Zt.start,n]),Fe=Et.length*It.width,Se=(G.columns||[]).filter(T=>G.visibleColumns.includes(T.id)).reduce((T,N)=>T+(G.columnWidths?.[N.id]||N.minWidth||100),0),bt=R==="manual"&&w!==null?w:Se,Ke=A==="table",Ft=A==="timeline",mo=Ft?0:Ke||R==="even"?"100%":bt,go=A==="timeline",Xt=A==="table",yt=!go&&!Xt,fo=Ke?"minmax(0, 1fr) 0px 0px":Ft?"0px 0px minmax(0, 1fr)":R==="even"?`minmax(0, 1fr) ${Ts}px minmax(0, 1fr)`:`${bt}px ${Ts}px minmax(0, 1fr)`,ho=()=>{let T=M.current?.clientWidth??0;return T>0?Math.max(Dd,T-Ts-uT):Math.max(Dd,Se)},bo=T=>Math.min(Math.max(T,Dd),ho());useEffect(()=>{R==="manual"&&B(T=>T===null?null:bo(T));},[R,Se]);let Uo=T=>{T.preventDefault(),T.currentTarget.setPointerCapture(T.pointerId),q(null),I("manual"),_e.current={startX:T.clientX,startWidth:S.current?.getBoundingClientRect().width??bt};let N=J=>{let ue=_e.current;if(!ue)return;let he=bo(ue.startWidth+J.clientX-ue.startX);B(he);},U=()=>{_e.current=null,window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",U),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",N),window.addEventListener("pointerup",U);},ut=()=>{q(null),I("even"),B(null);},to=T=>!v||!T?false:le.get(T)?.reorderable!==false,xt=(T,N)=>{if(!T||!N||T===N||!to(T)||!to(N))return false;if(G.grouping.length===0)return true;let U=le.get(T),J=le.get(N);return !U||!J?false:G.grouping.every(ue=>U[ue]===J[ue])},z=(T,N)=>{if(!xt(T,N))return;let U=j.filter(Ge=>Ge.type!=="group").map(Ge=>String((Ge.data||Ge)?.id)),J=U.indexOf(T),ue=U.indexOf(N);if(J<0||ue<0)return;let he=[...U];[he[J],he[ue]]=[he[ue],he[J]];let ye=new Set(U),me=Ue.map(Ge=>Ge.id),Be=[...he,...me.filter(Ge=>!ye.has(Ge))],Ve=tt.get(T),it=tt.get(N);if(G.setOrder("asc"),G.setOrderBy(""),Y(Be),Ve&&it){let{level:Ge,...Le}=Ve,{level:Lt,...Ot}=it,pt=Be.reduce((oo,mt)=>{let ro=tt.get(mt);if(ro){let{level:Ko,...ao}=ro;oo.push(ao);}return oo},[]);p?.(pt,{activeTask:Le,targetTask:Ot});}},V=(T,N)=>{if(!to(N.id)){T.preventDefault();return}T.stopPropagation(),T.dataTransfer.effectAllowed="move",T.dataTransfer.setData("text/plain",N.id),Ze({activeId:N.id,overId:null}),u?.(tt.get(N.id)||N);},H=(T,N)=>{if(!xt(Ae.activeId,N)){Ze(U=>U.overId===null?U:{...U,overId:null});return}T.preventDefault(),T.stopPropagation(),T.dataTransfer.dropEffect="move",Ze(U=>U.overId===N?U:{...U,overId:N});},ae=(T,N)=>{let U=Ae.activeId||T.dataTransfer.getData("text/plain");if(!xt(U,N)){Ze({activeId:null,overId:null});return}T.preventDefault(),T.stopPropagation(),z(U,N),Ze({activeId:null,overId:null});},se=()=>{Ze({activeId:null,overId:null});},ke=T=>{if(P.current)return;let N=T==="table"?S.current:D.current,U=T==="table"?D.current:S.current;!N||!U||(P.current=true,U.scrollTop=N.scrollTop,window.requestAnimationFrame(()=>{P.current=false;}));};return useLayoutEffect(()=>{if(!C||Xt)return;let T=D.current,N=S.current;if(!T)return;let U=`row-${C}`,J=Array.from(T.querySelectorAll("[data-planning-timeline-row-key]")).find(ye=>ye.dataset.planningTimelineRowKey===U),ue=le.get(C);if(!J||!ue)return;let he=window.requestAnimationFrame(()=>{let ye=T.getBoundingClientRect(),me=J.getBoundingClientRect(),Be=Math.max(1,T.clientHeight-Q),Ve=T.scrollTop+me.top-ye.top-Q-(Be-me.height)/2;P.current=true,T.scrollTop=Math.max(0,Ve),N&&!go&&(N.scrollTop=T.scrollTop);let it=Md(mr(ue.startDate),Et,It.width),Ge=Math.max(0,it-It.width);T.scrollLeft=Math.min(Ge,Math.max(0,Fe-T.clientWidth)),window.requestAnimationFrame(()=>{P.current=false;});});return ()=>window.cancelAnimationFrame(he)},[It.width,Q,C,go,le,Xt,j,Fe,Et]),useLayoutEffect(()=>{let T=S.current;if(!T)return;let N=0,U=0,J=false,ue=()=>{if(J)return;let Lt=T.querySelector("thead"),Ot=Array.from(T.querySelectorAll("tbody tr[data-planning-row-key]"));if(Ot.length===0)return;let pt=Lt?.getBoundingClientRect().height||Rd,oo={};Ot.forEach(mt=>{let ro=mt.dataset.planningRowKey;ro&&(oo[ro]=mt.getBoundingClientRect().height);}),ne(mt=>Math.abs(mt-pt)<.01?mt:pt),K(mt=>{let ro=Object.keys(mt),Ko=Object.keys(oo);return ro.length===Ko.length&&Ko.every(ao=>Math.abs((mt[ao]??0)-oo[ao])<.01)?mt:oo});},he=()=>{window.cancelAnimationFrame(N),N=window.requestAnimationFrame(ue);};if(ue(),window.cancelAnimationFrame(U),U=window.requestAnimationFrame(()=>{U=window.requestAnimationFrame(ue);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{J||he();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",he),()=>{J=true,window.cancelAnimationFrame(N),window.cancelAnimationFrame(U),window.removeEventListener("resize",he);};let ye=new ResizeObserver(he),me=T.querySelector("table"),Be=T.querySelector("tbody"),Ve=T.querySelector("thead");me&&ye.observe(me),Ve&&ye.observe(Ve);let it=new WeakSet,Ge=()=>{T.querySelectorAll("tbody tr[data-planning-row-key]").forEach(Lt=>{it.has(Lt)||(ye.observe(Lt),it.add(Lt));});};Ge();let Le=null;return Be&&typeof MutationObserver<"u"&&(Le=new MutationObserver(()=>{Ge(),he();}),Le.observe(Be,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",he),()=>{J=true,window.cancelAnimationFrame(N),window.cancelAnimationFrame(U),ye.disconnect(),Le?.disconnect(),window.removeEventListener("resize",he);}},[j,G.visibleColumns,G.grouping,G.columnWidths]),jsxs(Di,{elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:3,border:`1px solid ${k.palette.divider}`,backgroundColor:k.palette.background.paper,...y},children:[jsxs(Stack,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"stretch",md:"center"},spacing:2,sx:{px:2,py:1.75,borderBottom:`1px solid ${k.palette.divider}`},children:[jsxs(Stack,{direction:"row",spacing:.75,alignItems:"center",sx:{p:.5,borderRadius:2,backgroundColor:"action.hover",minHeight:38},children:[jsx(Typography,{sx:{fontSize:Is,color:"text.secondary",whiteSpace:"nowrap"},children:E("table.toolbar.itemsPerPage")}),jsx(Select,{size:"small",variant:"standard",value:G.rowsPerPage,disableUnderline:true,onChange:T=>G.setRowsPerPage(Number(T.target.value)),sx:{fontSize:Is,fontWeight:600,color:"text.primary",minWidth:64,"& .MuiSelect-select":{py:.25,pr:"16px !important"},"& .MuiSvgIcon-root":{color:"text.primary"}},children:l.map(T=>jsx(MenuItem,{value:T,sx:{fontSize:Is},children:T===-1?E("common.all"):T},`planning-rows-per-page-${T}`))}),jsx(IconButton,{size:"small",onClick:()=>G.setPage(Math.max(Ce-1,0)),disabled:!ot,sx:{p:.35,color:"text.primary"},children:jsx(Hh,{fontSize:"small"})}),jsx(Typography,{sx:{fontSize:Is,fontWeight:600,minWidth:88,textAlign:"center",color:"text.primary"},children:E("table.toolbar.pageOf",{current:De,total:Te})}),jsx(IconButton,{size:"small",onClick:()=>G.setPage(Math.min(Ce+1,Te-1)),disabled:!je,sx:{p:.35,color:"text.primary"},children:jsx(df,{fontSize:"small"})})]}),jsxs(Stack,{direction:"row",spacing:1,alignItems:"center",sx:{flexWrap:"wrap"},children:[po.length>0&&jsx(Stack,{direction:"row",spacing:.75,alignItems:"center",children:po.map((T,N)=>jsx(Box,{sx:{display:"flex",alignItems:"center"},children:T},`planning-extra-tool-${N}`))}),jsxs(Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsx(ia,{tooltip:"Column visibility",onClick:T=>G.setAnchorEl(T.currentTarget),color:"default",children:jsx(Ah,{fontSize:"small"})}),jsx(ia,{tooltip:"Group by",onClick:T=>G.setGroupAnchorEl(T.currentTarget),color:"default",children:jsx(Fh,{fontSize:"small"})}),jsx(ia,{tooltip:"Sort by...",onClick:()=>Ee(true),color:G.sortBy.length>0||G.orderBy?"primary":"default",children:jsx(cT,{fontSize:"small"})})]}),jsxs(Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsx(ia,{tooltip:"Expand task table",onClick:()=>q("table"),color:A==="table"?"primary":"default",children:jsx(lT,{fontSize:"small"})}),jsx(ia,{tooltip:"Split evenly",onClick:ut,color:A===null&&R==="even"?"primary":"default",children:jsx(sT,{fontSize:"small"})}),jsx(ia,{tooltip:"Expand timeline",onClick:()=>q("timeline"),color:A==="timeline"?"primary":"default",children:jsx(iT,{fontSize:"small"})})]}),jsx(Box,{sx:{minWidth:120},children:jsx(nf,{label:"",value:n,options:Pd.map(T=>({value:T.value,label:T.label})),onChange:T=>i?.(T.target.value),sx:{"& .MuiSelect-select":{fontSize:"0.92rem",py:.65},"& .MuiSvgIcon-root":{fontSize:20}}})})]})]}),_.length===0?jsx(Box,{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:f}):jsx(Box,{sx:{overflow:"hidden",flex:1,minHeight:0},children:jsxs(Box,{ref:M,sx:{height:"100%",display:"grid",gridTemplateColumns:fo,minWidth:0,transition:`grid-template-columns ${la}`},children:[jsx(TableContainer,{"data-planning-scroll-pane":"table",ref:S,onScroll:()=>ke("table"),sx:{width:mo,minWidth:0,maxWidth:"100%",height:o,overflowX:"auto",overflowY:"auto",opacity:go?0:1,transform:go?"translateX(-10px)":"translateX(0)",pointerEvents:go?"none":"auto",transition:`opacity ${la}, transform ${la}, width ${la}`},children:jsxs(Table,{size:"small",stickyHeader:true,sx:{tableLayout:"fixed",width:Se,"& thead .MuiTableCell-root":{height:Rd,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[jsx(DndContext,{sensors:Tt,collisionDetection:closestCenter,modifiers:[restrictToHorizontalAxis],onDragEnd:T=>{let N=T?.active?.id,U=T?.over?.id;typeof N=="string"&&typeof U=="string"&&G.handleColumnReorder(N,U);},children:jsx(Ni,{columns:G.columns,visibleColumns:G.visibleColumns,order:G.order,orderBy:G.orderBy,sortBy:G.sortBy,onRequestSort:G.handleRequestSort,onContextMenu:(T,N)=>{T.preventDefault(),T.stopPropagation(),fe({mouseX:T.clientX+2,mouseY:T.clientY-6,columnId:N});},grouping:G.grouping,isAllExpanded:G.isAllExpanded,handleToggleAll:G.handleToggleAll,columnWidths:G.columnWidths,onColumnResize:G.handleColumnResize,enableColumnReorder:true})}),jsx(TableBody,{children:j.map(T=>{let N=eo(T);if(T.type==="group")return jsxs(TableRow,{"data-planning-row-key":N,sx:{height:za,backgroundColor:k.palette.action.hover},children:[G.grouping.length>0&&jsx(TableCell,{sx:{width:44,height:za,py:0,borderBottom:`1px solid ${k.palette.divider}`},children:jsx(IconButton,{size:"small",onClick:()=>G.toggleGroupExpand(T.id),children:T.isExpanded?jsx(sb,{fontSize:"small"}):jsx(df,{fontSize:"small"})})}),jsx(TableCell,{colSpan:G.visibleColumns.length,sx:{height:za,py:0,borderBottom:`1px solid ${k.palette.divider}`},children:jsxs(Typography,{sx:{fontSize:13,fontWeight:700},children:[T.field,": ",T.value," (",T.count,")"]})})]},T.id);let U=T.data||T,J=U.id===C,ue=to(U.id),he=Ae.activeId===U.id,ye=Ae.overId===U.id&&xt(Ae.activeId,U.id);return jsxs(TableRow,{"data-planning-row-key":N,draggable:ue,hover:true,selected:J,onDragStart:me=>V(me,U),onDragOver:me=>H(me,U.id),onDragEnter:me=>H(me,U.id),onDrop:me=>ae(me,U.id),onDragEnd:se,onClick:()=>u?.(tt.get(U.id)||U),sx:{cursor:he?"grabbing":ue?"grab":u?"pointer":"default",height:za,opacity:he?.56:1,"& .MuiTableCell-root":ye?{borderTop:`2px solid ${k.palette.primary.main}`}:void 0,transition:"background-color 120ms ease, opacity 120ms ease"},children:[G.grouping.length>0&&jsx(TableCell,{sx:{width:44,height:za,py:0,borderBottom:`1px solid ${k.palette.divider}`}}),(G.columns||[]).filter(me=>G.visibleColumns.includes(me.id)).map(me=>jsx(TableCell,{sx:{width:G.columnWidths?.[me.id]||me.minWidth||100,height:za,py:0,overflow:"hidden",borderBottom:`1px solid ${k.palette.divider}`},children:me.render?me.render(U[me.id],U):String(U[me.id]??"-")},`${U.id}-${me.id}`))]},U.id)})})]})}),jsx(Box,{onPointerDown:yt?Uo:void 0,role:"separator","aria-orientation":"vertical",sx:{width:yt?Ts:0,cursor:yt?"col-resize":"default",opacity:yt?1:0,pointerEvents:yt?"auto":"none",borderLeft:yt?`1px solid ${k.palette.divider}`:"0 solid transparent",borderRight:yt?`1px solid ${k.palette.divider}`:"0 solid transparent",backgroundColor:k.palette.mode==="dark"?"rgba(148,163,184,0.10)":"rgba(15,23,42,0.04)",transition:`width ${la}, opacity ${la}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:k.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:yt?"col-resize":"default"}}}),jsx(Box,{sx:{minWidth:0,overflow:"hidden",opacity:Xt?0:1,transform:Xt?"translateX(10px)":"translateX(0)",pointerEvents:Xt?"none":"auto",transition:`opacity ${la}, transform ${la}`},children:jsx(Box,{"data-planning-scroll-pane":"timeline",ref:D,onScroll:()=>ke("timeline"),sx:{width:"100%",height:o,overflowX:"auto",overflowY:"auto"},children:jsxs(Box,{sx:{width:Fe},children:[jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Et.length}, ${It.width}px)`,height:Q,boxSizing:"border-box",borderBottom:`1px solid ${k.palette.divider}`,position:"sticky",top:0,zIndex:2,backgroundColor:k.palette.background.paper},children:Et.map(T=>jsxs(Box,{title:T.title,sx:{px:.75,display:"flex",flexDirection:T.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:T.contextLabel?.15:0,borderRight:`1px solid ${k.palette.divider}`,color:T.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[T.contextLabel&&jsx(Typography,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"text.secondary",fontSize:11,fontWeight:700,lineHeight:1.1},children:T.contextLabel}),jsx(Typography,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:T.label})]},T.key))}),jsx(Stack,{sx:{position:"relative"},children:j.map(T=>{let N=eo(T),U=O[N]??za;if(T.type==="group")return jsx(Box,{"data-planning-timeline-row-key":N,sx:{position:"relative",height:U,boxSizing:"border-box",borderBottom:`1px solid ${k.palette.divider}`,backgroundColor:k.palette.action.hover}},T.id);let J=T.data||T,ue=mr(J.startDate),he=mr(J.endDate),ye=Md(ue,Et,It.width),me=Md(he,Et,It.width),Be=Math.max(18,me-ye),Ve=pf(J.progress),it=J.id===C,Ge=to(J.id),Le=Ae.activeId===J.id,Lt=Ae.overId===J.id&&xt(Ae.activeId,J.id),Ot=J.color??(J.statusTone==="blocked"?k.palette.error.main:k.palette.primary.main);return jsx(Box,{"data-planning-timeline-row-key":N,draggable:Ge,onDragStart:pt=>V(pt,J),onDragOver:pt=>H(pt,J.id),onDragEnter:pt=>H(pt,J.id),onDrop:pt=>ae(pt,J.id),onDragEnd:se,onClick:()=>u?.(tt.get(J.id)||J),sx:{position:"relative",height:U,boxSizing:"border-box",borderBottom:`1px solid ${k.palette.divider}`,opacity:Le?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:k.palette.primary.main,opacity:Lt?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:k.palette.mode==="dark"?"linear-gradient(90deg, rgba(148,163,184,0.08) 1px, transparent 1px)":"linear-gradient(90deg, rgba(15,23,42,0.06) 1px, transparent 1px)",backgroundSize:`${It.width}px 100%`,cursor:Le?"grabbing":Ge?"grab":u?"pointer":"default",transition:"opacity 120ms ease"},children:jsx(Tooltip,{title:`${J.title}: ${ue.format("MMM D HH:mm")} - ${he.format("MMM D HH:mm")}`,children:jsxs(Box,{sx:{position:"absolute",left:ye,top:Math.max(8,(U-24)/2),width:Be,height:24,borderRadius:999,overflow:"hidden",backgroundColor:k.palette.mode==="dark"?"rgba(148,163,184,0.18)":"rgba(15,23,42,0.10)",outline:it?`2px solid ${k.palette.warning.main}`:"none",outlineOffset:2},children:[jsx(Box,{sx:{height:"100%",width:`${Ve}%`,backgroundColor:Ot}}),jsx(Typography,{sx:{position:"absolute",inset:0,px:1,display:"flex",alignItems:"center",color:"#fff",fontSize:11,fontWeight:800,textShadow:"0 1px 4px rgba(0,0,0,0.45)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:J.code})]})})},J.id)})})]})})})]})}),jsx(Ua,{groupAnchorEl:G.groupAnchorEl,setGroupAnchorEl:G.setGroupAnchorEl,grouping:G.grouping,setGrouping:G.setGrouping,columns:G.columns,toggleGroupField:G.toggleGroupField}),jsx(Ka,{anchorEl:G.anchorEl,setAnchorEl:G.setAnchorEl,columns:G.columns,visibleColumns:G.visibleColumns,toggleColumnVisibility:G.toggleColumnVisibility}),jsx(bu,{contextMenu:ht,handleClose:()=>fe(null),columns:G.columns,visibleColumns:G.visibleColumns,grouping:G.grouping,summaryColumns:G.summaryColumns,showSummary:G.showSummary,sortBy:G.sortBy,orderBy:G.orderBy,order:G.order,onSortAsc:T=>{G.applyMultiSort([{field:T,direction:"asc"}]);},onSortDesc:T=>{G.applyMultiSort([{field:T,direction:"desc"}]);},onClearSort:T=>{let N=G.sortBy.filter(U=>U.field!==T);N.length>0?G.applyMultiSort(N):(G.clearMultiSort(),G.orderBy===T&&G.setOrderBy(""));},onHideColumn:T=>{G.visibleColumns.includes(T)&&G.toggleColumnVisibility(T);},onToggleGroup:T=>G.toggleGroupField(T),onToggleSummary:T=>G.toggleSummaryColumn(T),onOpenSortDialog:()=>Ee(true)}),jsx(yu,{open:We,onClose:()=>Ee(false),columns:G.columns,initialRules:G.sortBy.length>0?G.sortBy:G.orderBy?[{field:G.orderBy,direction:G.order}]:[],onApply:T=>G.applyMultiSort(T),onClear:()=>{G.clearMultiSort(),G.setOrderBy("");}})]})};var EO=({filterProps:e,ganttProps:t,spacing:o=2,sx:r,children:a})=>{let n=r?[{height:"100%",overflow:"hidden"},r]:{height:"100%",overflow:"hidden"},i=t.sx?[{height:"100%"},t.sx]:{height:"100%"};return jsxs(Stack,{spacing:o,sx:n,children:[jsx(Box,{sx:{flexShrink:0},children:jsx(vr,{...e})}),jsx(Box,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:jsx(hf,{...t,bodyHeight:t.bodyHeight??"100%",sx:i})}),a]})};var ST={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)"}}},VO=({children:e,transitionKey:t,variant:o="fade",durationMs:r=220,delayMs:a=0,easing:n="cubic-bezier(0.22, 1, 0.36, 1)",disabled:i=false,sx:s})=>{let d=useMediaQuery("(prefers-reduced-motion: reduce)"),[l,c]=useState("to"),g=!i&&!d&&o!=="none";useEffect(()=>{if(!g){c("to");return}c("from");let b=requestAnimationFrame(()=>{b=requestAnimationFrame(()=>{c("to");});});return ()=>cancelAnimationFrame(b)},[t,g]);let h=ST[o],m=useMemo(()=>g?l==="from"?h.from:h.to:{opacity:1,transform:"none"},[g,l,h.from,h.to]);return jsx(Box,{sx:{willChange:g?"opacity, transform":"auto",transition:g?`opacity ${r}ms ${n} ${a}ms, transform ${r}ms ${n} ${a}ms`:"none",backfaceVisibility:"hidden",...m,...s},children:e})},OO={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};
17
+ export{iV as AgentPanel,Ds as Button,DS as CAINavProvider,Nu as CAmapChart,Ll as CAppHeader,rE as CAppPageLayout,VV as CAuthPage,Gn as CBarChart,$i as CChartCard,wu as CComboChart,Wu as CCustomizeAgent,lB as CDetailInfoPage,Np as CDetailSearchAiBar,Tl as CDetailSectionCard,Ru as CFishboneChart,Eu as CGoogleMapChart,Vu as CGraphCharts,vu as CGraphKpiCards,rl as CGraphReport,Iu as CHeatmapChart,RB as CKanbanBoard,Gp as CKanbanBucket,Bc as CKanbanCard,up as CLayoutManagement,fl as CLayoutManager,Su as CLineChart,En as CMessageBox,tu as CPageLayout,VO as CPageTransition,Zi as CPieChart,KF as CPivotTable,hf as CPlanningGantt,EO as CPlanningLayout,vr as CSmartFilter,IA as CSmartTable,EA as CStandardPage,Xr as CTable,CA as CTableBody,kA as CTableCell,SA as CTableContainer,wA as CTableHead,TA as CTableRow,eu as CValueHelp,ll as CVariantManagement,Yu as CVariantManager,dd as CVoiceWaveOverlay,Mu as CWaterfallChart,ti as CodeBlock,gV as CopilotChat,RI as GlobalMessage,ii as MarkdownRenderer,oi as MathBlock,yc as MermaidBlock,Wd as NavigationIsland,Bn as ORBCAFE_I18N_MESSAGES,Ei as OrbcafeI18nProvider,OO as PAGE_TRANSITION_PRESETS,CL as PAppPageLayout,d5 as PBarcodeScanner,lg as PNavIsland,T5 as PNumericKeypad,Jm as PSmartFilter,sS as PTable,h5 as PTouchCard,og as PWorkloadNav,Am as PivotChartPanel,Zg as StdChat,vc as TableBlock,Sl as ThinkBlock,As as TreeMenu,FL as VoiceNavigatorProvider,IL as VoiceWaveOverlay,Qi as buildAmapEmbedUrl,qn as buildGoogleMapEmbedUrl,ER as buildGoogleMapIframe,Sf as buttonVariants,qp as createKanbanBoardModel,er as findKanbanCard,uI as message,yr as messageManager,Ml as moveKanbanCard,Cl as parseMarkdownTable,M2 as renderMarkdown,mp as resolveVariantFilters,hl as resolveVariantLayout,MS as useAINav,jA as useAmapEmbedUrl,yV as useAuthPage,Op as useDetailInfo,_A as useGoogleMapEmbedUrl,$A as useGraphChartData,nl as useGraphInteraction,tn as useGraphReport,EB as useKanbanBoard,Gd as useNavigationIsland,ee as useOrbcafeI18n,t5 as usePadLayout,a5 as usePadRecordEditor,om as usePageLayout,XF as usePivotTable,of as usePlanningGantt,qV as usePlanningLayout,OA as useStandardReport,ls as useVoiceInput,LL as useVoiceNavigator};