orbcafe-ui 1.2.7 → 1.2.8

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.js CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var ogl=require('ogl'),mt=require('react'),jsxRuntime=require('react/jsx-runtime'),navigation=require('next/navigation'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),Ep=require('@mui/material/Dialog'),Fp=require('@mui/material/DialogTitle'),Lp=require('@mui/material/DialogContent'),yf=require('@mui/material/DialogContentText'),zp=require('@mui/material/DialogActions'),Gn=require('@mui/material/Box'),vf=require('@mui/icons-material/CheckCircle'),Cf=require('@mui/icons-material/Warning'),kf=require('@mui/icons-material/Error'),Sf=require('@mui/icons-material/Info'),material=require('@mui/material'),wb=require('@mui/material/Paper'),Tb=require('@mui/material/Table'),Ib=require('@mui/material/TableBody'),Tl=require('@mui/material/TableCell'),Op=require('@mui/material/TableContainer'),Zf=require('@mui/material/TableHead'),Xf=require('@mui/material/TableRow'),Np=require('@mui/material/TextField'),is=require('@mui/material/Button'),Vp=require('@mui/material/Alert'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),vp=require('@mui/icons-material/Search'),Lf=require('@mui/icons-material/ViewColumn'),Rp=require('@mui/icons-material/Save'),Nf=require('@mui/icons-material/Download'),Vf=require('@mui/icons-material/AccountTree'),Of=require('@mui/icons-material/Functions'),Wf=require('@mui/icons-material/Insights'),$f=require('@mui/icons-material/Add'),Hf=require('@mui/icons-material/Edit'),Gf=require('@mui/icons-material/Delete'),Uf=require('@mui/icons-material/KeyboardArrowLeft'),Kf=require('@mui/icons-material/KeyboardArrowRight'),Qf=require('@mui/material/Checkbox'),Yf=require('@mui/material/TableSortLabel'),Jf=require('@mui/material/IconButton'),eh=require('@mui/material/Tooltip'),th=require('@mui/icons-material/UnfoldMore'),oh=require('@mui/icons-material/UnfoldLess'),lh=require('@mui/icons-material/KeyboardArrowDown'),kh=require('@mui/icons-material/Check'),Sh=require('@mui/icons-material/ClearAll'),Xh=require('@mui/icons-material/Close'),ry=require('@mui/icons-material/MicNoneOutlined'),ny=require('@mui/icons-material/SettingsOutlined'),iy=require('@mui/icons-material/SendOutlined'),ob=require('@mui/icons-material/Settings'),ab=require('@mui/icons-material/KeyboardArrowUp'),nb=require('@mui/icons-material/ArrowRightAlt'),Py=require('@mui/icons-material/Star'),DateCalendar=require('@mui/x-date-pickers/DateCalendar'),PickersDay=require('@mui/x-date-pickers/PickersDay'),LocalizationProvider=require('@mui/x-date-pickers/LocalizationProvider'),AdapterDayjs=require('@mui/x-date-pickers/AdapterDayjs'),Hy=require('@mui/icons-material/CalendarMonth'),Gy=require('@mui/icons-material/Clear'),Uy=require('@mui/icons-material/ArrowForward'),Ka=require('dayjs'),Ky=require('dayjs/plugin/isBetween'),qy=require('dayjs/plugin/localizedFormat');require('dayjs/locale/zh-cn'),require('dayjs/locale/fr'),require('dayjs/locale/de'),require('dayjs/locale/ja'),require('dayjs/locale/ko');var xb=require('@mui/icons-material/StarBorder'),vb=require('@mui/icons-material/ViewQuilt'),Hx=require('@mui/icons-material/CloseOutlined'),Hb=require('@mui/icons-material/ContentCopyOutlined'),Gb=require('@mui/icons-material/CheckOutlined'),bx=require('@mui/icons-material/ExpandMore'),sortable=require('@dnd-kit/sortable'),styles=require('@mui/material/styles'),yu=require('@mui/icons-material/Language'),P0=require('@mui/icons-material/DesktopWindows'),R0=require('@mui/icons-material/DarkMode'),D0=require('@mui/icons-material/LightMode'),A0=require('@mui/icons-material/Logout'),qv=require('@mui/icons-material/DeleteOutline'),ev=require('@mui/icons-material/DragIndicator'),bv=require('@mui/icons-material/FilterList'),xv=require('@mui/icons-material/TableRows'),nv=require('@mui/icons-material/LayersClear'),yC=require('@mui/icons-material/CameraAltRounded'),bC=require('@mui/icons-material/QrCodeScannerRounded'),kC=require('@mui/icons-material/DragIndicatorRounded'),IC=require('@mui/icons-material/BackspaceRounded'),PC=require('@mui/icons-material/CloseRounded'),RC=require('@mui/icons-material/CheckRounded'),GC=require('@mui/icons-material/SearchRounded'),UC=require('@mui/icons-material/MenuOpenRounded'),KC=require('@mui/icons-material/MenuRounded'),qC=require('@mui/icons-material/ExpandMoreRounded'),_C=require('@mui/icons-material/ChevronRightRounded'),kk=require('next/dynamic'),framerMotion=require('framer-motion'),zS=require('react-markdown'),NS=require('remark-gfm'),VS=require('remark-math'),OS=require('rehype-katex'),WS=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),nextThemes=require('next-themes'),qm=require('mermaid'),QS=require('@mui/icons-material/MicRounded'),YS=require('@mui/icons-material/MicOffRounded'),iconsMaterial=require('@mui/icons-material'),aw=require('@mui/icons-material/SendRounded'),rw=require('@mui/icons-material/AddRounded'),nw=require('@mui/icons-material/HardwareRounded'),Rw=require('@mui/icons-material/LockOutlined'),Cg=require('@mui/icons-material/MailOutline'),kg=require('@mui/icons-material/PersonOutline'),Dw=require('@mui/icons-material/VpnKeyOutlined'),t1=require('@mui/icons-material/CalendarMonthOutlined'),n1=require('@mui/icons-material/KeyboardDoubleArrowLeftOutlined'),i1=require('@mui/icons-material/KeyboardDoubleArrowRightOutlined'),s1=require('@mui/icons-material/SplitscreenOutlined'),l1=require('@mui/icons-material/Sort');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var mt__namespace=/*#__PURE__*/_interopNamespace(mt);var Ep__default=/*#__PURE__*/_interopDefault(Ep);var Fp__default=/*#__PURE__*/_interopDefault(Fp);var Lp__default=/*#__PURE__*/_interopDefault(Lp);var yf__default=/*#__PURE__*/_interopDefault(yf);var zp__default=/*#__PURE__*/_interopDefault(zp);var Gn__default=/*#__PURE__*/_interopDefault(Gn);var vf__default=/*#__PURE__*/_interopDefault(vf);var Cf__default=/*#__PURE__*/_interopDefault(Cf);var kf__default=/*#__PURE__*/_interopDefault(kf);var Sf__default=/*#__PURE__*/_interopDefault(Sf);var wb__default=/*#__PURE__*/_interopDefault(wb);var Tb__default=/*#__PURE__*/_interopDefault(Tb);var Ib__default=/*#__PURE__*/_interopDefault(Ib);var Tl__default=/*#__PURE__*/_interopDefault(Tl);var Op__default=/*#__PURE__*/_interopDefault(Op);var Zf__default=/*#__PURE__*/_interopDefault(Zf);var Xf__default=/*#__PURE__*/_interopDefault(Xf);var Np__default=/*#__PURE__*/_interopDefault(Np);var is__default=/*#__PURE__*/_interopDefault(is);var Vp__default=/*#__PURE__*/_interopDefault(Vp);var vp__default=/*#__PURE__*/_interopDefault(vp);var Lf__default=/*#__PURE__*/_interopDefault(Lf);var Rp__default=/*#__PURE__*/_interopDefault(Rp);var Nf__default=/*#__PURE__*/_interopDefault(Nf);var Vf__default=/*#__PURE__*/_interopDefault(Vf);var Of__default=/*#__PURE__*/_interopDefault(Of);var Wf__default=/*#__PURE__*/_interopDefault(Wf);var $f__default=/*#__PURE__*/_interopDefault($f);var Hf__default=/*#__PURE__*/_interopDefault(Hf);var Gf__default=/*#__PURE__*/_interopDefault(Gf);var Uf__default=/*#__PURE__*/_interopDefault(Uf);var Kf__default=/*#__PURE__*/_interopDefault(Kf);var Qf__default=/*#__PURE__*/_interopDefault(Qf);var Yf__default=/*#__PURE__*/_interopDefault(Yf);var Jf__default=/*#__PURE__*/_interopDefault(Jf);var eh__default=/*#__PURE__*/_interopDefault(eh);var th__default=/*#__PURE__*/_interopDefault(th);var oh__default=/*#__PURE__*/_interopDefault(oh);var lh__default=/*#__PURE__*/_interopDefault(lh);var kh__default=/*#__PURE__*/_interopDefault(kh);var Sh__default=/*#__PURE__*/_interopDefault(Sh);var Xh__default=/*#__PURE__*/_interopDefault(Xh);var ry__default=/*#__PURE__*/_interopDefault(ry);var ny__default=/*#__PURE__*/_interopDefault(ny);var iy__default=/*#__PURE__*/_interopDefault(iy);var ob__default=/*#__PURE__*/_interopDefault(ob);var ab__default=/*#__PURE__*/_interopDefault(ab);var nb__default=/*#__PURE__*/_interopDefault(nb);var Py__default=/*#__PURE__*/_interopDefault(Py);var Hy__default=/*#__PURE__*/_interopDefault(Hy);var Gy__default=/*#__PURE__*/_interopDefault(Gy);var Uy__default=/*#__PURE__*/_interopDefault(Uy);var Ka__default=/*#__PURE__*/_interopDefault(Ka);var Ky__default=/*#__PURE__*/_interopDefault(Ky);var qy__default=/*#__PURE__*/_interopDefault(qy);var xb__default=/*#__PURE__*/_interopDefault(xb);var vb__default=/*#__PURE__*/_interopDefault(vb);var Hx__default=/*#__PURE__*/_interopDefault(Hx);var Hb__default=/*#__PURE__*/_interopDefault(Hb);var Gb__default=/*#__PURE__*/_interopDefault(Gb);var bx__default=/*#__PURE__*/_interopDefault(bx);var yu__default=/*#__PURE__*/_interopDefault(yu);var P0__default=/*#__PURE__*/_interopDefault(P0);var R0__default=/*#__PURE__*/_interopDefault(R0);var D0__default=/*#__PURE__*/_interopDefault(D0);var A0__default=/*#__PURE__*/_interopDefault(A0);var qv__default=/*#__PURE__*/_interopDefault(qv);var ev__default=/*#__PURE__*/_interopDefault(ev);var bv__default=/*#__PURE__*/_interopDefault(bv);var xv__default=/*#__PURE__*/_interopDefault(xv);var nv__default=/*#__PURE__*/_interopDefault(nv);var yC__default=/*#__PURE__*/_interopDefault(yC);var bC__default=/*#__PURE__*/_interopDefault(bC);var kC__default=/*#__PURE__*/_interopDefault(kC);var IC__default=/*#__PURE__*/_interopDefault(IC);var PC__default=/*#__PURE__*/_interopDefault(PC);var RC__default=/*#__PURE__*/_interopDefault(RC);var GC__default=/*#__PURE__*/_interopDefault(GC);var UC__default=/*#__PURE__*/_interopDefault(UC);var KC__default=/*#__PURE__*/_interopDefault(KC);var qC__default=/*#__PURE__*/_interopDefault(qC);var _C__default=/*#__PURE__*/_interopDefault(_C);var kk__default=/*#__PURE__*/_interopDefault(kk);var zS__default=/*#__PURE__*/_interopDefault(zS);var NS__default=/*#__PURE__*/_interopDefault(NS);var VS__default=/*#__PURE__*/_interopDefault(VS);var OS__default=/*#__PURE__*/_interopDefault(OS);var WS__default=/*#__PURE__*/_interopDefault(WS);var qm__default=/*#__PURE__*/_interopDefault(qm);var QS__default=/*#__PURE__*/_interopDefault(QS);var YS__default=/*#__PURE__*/_interopDefault(YS);var aw__default=/*#__PURE__*/_interopDefault(aw);var rw__default=/*#__PURE__*/_interopDefault(rw);var nw__default=/*#__PURE__*/_interopDefault(nw);var Rw__default=/*#__PURE__*/_interopDefault(Rw);var Cg__default=/*#__PURE__*/_interopDefault(Cg);var kg__default=/*#__PURE__*/_interopDefault(kg);var Dw__default=/*#__PURE__*/_interopDefault(Dw);var t1__default=/*#__PURE__*/_interopDefault(t1);var n1__default=/*#__PURE__*/_interopDefault(n1);var i1__default=/*#__PURE__*/_interopDefault(i1);var s1__default=/*#__PURE__*/_interopDefault(s1);var l1__default=/*#__PURE__*/_interopDefault(l1);var pd=Object.defineProperty;var Ng=(e,t,o)=>t in e?pd(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var Vg=(e,t)=>()=>(e&&(t=e(e=0)),t);var Og=(e,t)=>{for(var o in t)pd(e,o,{get:t[o],enumerable:true});};var ud=(e,t,o)=>Ng(e,t+"",o);var Nm={};Og(Nm,{COrbCanvas:()=>xk});function xk({hue:e=0,hoverIntensity:t=.2,rotateOnHover:o=true,forceHoverState:a=false,backgroundColor:r="transparent"}){let n=mt.useRef(null),i=`
1
+ 'use strict';var ogl=require('ogl'),ht=require('react'),jsxRuntime=require('react/jsx-runtime'),navigation=require('next/navigation'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),Ep=require('@mui/material/Dialog'),Fp=require('@mui/material/DialogTitle'),Lp=require('@mui/material/DialogContent'),bf=require('@mui/material/DialogContentText'),zp=require('@mui/material/DialogActions'),Un=require('@mui/material/Box'),Cf=require('@mui/icons-material/CheckCircle'),kf=require('@mui/icons-material/Warning'),Sf=require('@mui/icons-material/Error'),wf=require('@mui/icons-material/Info'),material=require('@mui/material'),Tb=require('@mui/material/Paper'),Ib=require('@mui/material/Table'),Pb=require('@mui/material/TableBody'),Tl=require('@mui/material/TableCell'),Op=require('@mui/material/TableContainer'),Xf=require('@mui/material/TableHead'),Qf=require('@mui/material/TableRow'),Np=require('@mui/material/TextField'),ss=require('@mui/material/Button'),Vp=require('@mui/material/Alert'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),vp=require('@mui/icons-material/Search'),zf=require('@mui/icons-material/ViewColumn'),Rp=require('@mui/icons-material/Save'),Vf=require('@mui/icons-material/Download'),Of=require('@mui/icons-material/AccountTree'),Wf=require('@mui/icons-material/Functions'),$f=require('@mui/icons-material/Insights'),Hf=require('@mui/icons-material/Add'),Gf=require('@mui/icons-material/Edit'),Uf=require('@mui/icons-material/Delete'),Kf=require('@mui/icons-material/KeyboardArrowLeft'),qf=require('@mui/icons-material/KeyboardArrowRight'),Yf=require('@mui/material/Checkbox'),Jf=require('@mui/material/TableSortLabel'),eh=require('@mui/material/IconButton'),th=require('@mui/material/Tooltip'),oh=require('@mui/icons-material/UnfoldMore'),ah=require('@mui/icons-material/UnfoldLess'),ch=require('@mui/icons-material/KeyboardArrowDown'),Sh=require('@mui/icons-material/Check'),wh=require('@mui/icons-material/ClearAll'),Qh=require('@mui/icons-material/Close'),ny=require('@mui/icons-material/MicNoneOutlined'),iy=require('@mui/icons-material/SettingsOutlined'),sy=require('@mui/icons-material/SendOutlined'),ab=require('@mui/icons-material/Settings'),rb=require('@mui/icons-material/KeyboardArrowUp'),ib=require('@mui/icons-material/ArrowRightAlt'),Ry=require('@mui/icons-material/Star'),DateCalendar=require('@mui/x-date-pickers/DateCalendar'),PickersDay=require('@mui/x-date-pickers/PickersDay'),LocalizationProvider=require('@mui/x-date-pickers/LocalizationProvider'),AdapterDayjs=require('@mui/x-date-pickers/AdapterDayjs'),Gy=require('@mui/icons-material/CalendarMonth'),Uy=require('@mui/icons-material/Clear'),Ky=require('@mui/icons-material/ArrowForward'),_a=require('dayjs'),qy=require('dayjs/plugin/isBetween'),_y=require('dayjs/plugin/localizedFormat');require('dayjs/locale/zh-cn'),require('dayjs/locale/fr'),require('dayjs/locale/de'),require('dayjs/locale/ja'),require('dayjs/locale/ko');var vb=require('@mui/icons-material/StarBorder'),Cb=require('@mui/icons-material/ViewQuilt'),Gx=require('@mui/icons-material/CloseOutlined'),Gb=require('@mui/icons-material/ContentCopyOutlined'),Ub=require('@mui/icons-material/CheckOutlined'),xx=require('@mui/icons-material/ExpandMore'),sortable=require('@dnd-kit/sortable'),styles=require('@mui/material/styles'),yu=require('@mui/icons-material/Language'),R0=require('@mui/icons-material/DesktopWindows'),D0=require('@mui/icons-material/DarkMode'),M0=require('@mui/icons-material/LightMode'),B0=require('@mui/icons-material/Logout'),_v=require('@mui/icons-material/DeleteOutline'),tv=require('@mui/icons-material/DragIndicator'),xv=require('@mui/icons-material/FilterList'),vv=require('@mui/icons-material/TableRows'),iv=require('@mui/icons-material/LayersClear'),bC=require('@mui/icons-material/CameraAltRounded'),xC=require('@mui/icons-material/QrCodeScannerRounded'),SC=require('@mui/icons-material/DragIndicatorRounded'),PC=require('@mui/icons-material/BackspaceRounded'),RC=require('@mui/icons-material/CloseRounded'),DC=require('@mui/icons-material/CheckRounded'),UC=require('@mui/icons-material/SearchRounded'),KC=require('@mui/icons-material/MenuOpenRounded'),qC=require('@mui/icons-material/MenuRounded'),_C=require('@mui/icons-material/ExpandMoreRounded'),jC=require('@mui/icons-material/ChevronRightRounded'),Sk=require('next/dynamic'),framerMotion=require('framer-motion'),NS=require('react-markdown'),VS=require('remark-gfm'),OS=require('remark-math'),WS=require('rehype-katex'),$S=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),nextThemes=require('next-themes'),qm=require('mermaid'),YS=require('@mui/icons-material/MicRounded'),JS=require('@mui/icons-material/MicOffRounded'),iconsMaterial=require('@mui/icons-material'),rw=require('@mui/icons-material/SendRounded'),nw=require('@mui/icons-material/AddRounded'),iw=require('@mui/icons-material/HardwareRounded'),Dw=require('@mui/icons-material/LockOutlined'),Cg=require('@mui/icons-material/MailOutline'),kg=require('@mui/icons-material/PersonOutline'),Mw=require('@mui/icons-material/VpnKeyOutlined'),t1=require('@mui/icons-material/CalendarMonthOutlined'),n1=require('@mui/icons-material/KeyboardDoubleArrowLeftOutlined'),i1=require('@mui/icons-material/KeyboardDoubleArrowRightOutlined'),s1=require('@mui/icons-material/SplitscreenOutlined'),l1=require('@mui/icons-material/Sort');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var ht__namespace=/*#__PURE__*/_interopNamespace(ht);var Ep__default=/*#__PURE__*/_interopDefault(Ep);var Fp__default=/*#__PURE__*/_interopDefault(Fp);var Lp__default=/*#__PURE__*/_interopDefault(Lp);var bf__default=/*#__PURE__*/_interopDefault(bf);var zp__default=/*#__PURE__*/_interopDefault(zp);var Un__default=/*#__PURE__*/_interopDefault(Un);var Cf__default=/*#__PURE__*/_interopDefault(Cf);var kf__default=/*#__PURE__*/_interopDefault(kf);var Sf__default=/*#__PURE__*/_interopDefault(Sf);var wf__default=/*#__PURE__*/_interopDefault(wf);var Tb__default=/*#__PURE__*/_interopDefault(Tb);var Ib__default=/*#__PURE__*/_interopDefault(Ib);var Pb__default=/*#__PURE__*/_interopDefault(Pb);var Tl__default=/*#__PURE__*/_interopDefault(Tl);var Op__default=/*#__PURE__*/_interopDefault(Op);var Xf__default=/*#__PURE__*/_interopDefault(Xf);var Qf__default=/*#__PURE__*/_interopDefault(Qf);var Np__default=/*#__PURE__*/_interopDefault(Np);var ss__default=/*#__PURE__*/_interopDefault(ss);var Vp__default=/*#__PURE__*/_interopDefault(Vp);var vp__default=/*#__PURE__*/_interopDefault(vp);var zf__default=/*#__PURE__*/_interopDefault(zf);var Rp__default=/*#__PURE__*/_interopDefault(Rp);var Vf__default=/*#__PURE__*/_interopDefault(Vf);var Of__default=/*#__PURE__*/_interopDefault(Of);var Wf__default=/*#__PURE__*/_interopDefault(Wf);var $f__default=/*#__PURE__*/_interopDefault($f);var Hf__default=/*#__PURE__*/_interopDefault(Hf);var Gf__default=/*#__PURE__*/_interopDefault(Gf);var Uf__default=/*#__PURE__*/_interopDefault(Uf);var Kf__default=/*#__PURE__*/_interopDefault(Kf);var qf__default=/*#__PURE__*/_interopDefault(qf);var Yf__default=/*#__PURE__*/_interopDefault(Yf);var Jf__default=/*#__PURE__*/_interopDefault(Jf);var eh__default=/*#__PURE__*/_interopDefault(eh);var th__default=/*#__PURE__*/_interopDefault(th);var oh__default=/*#__PURE__*/_interopDefault(oh);var ah__default=/*#__PURE__*/_interopDefault(ah);var ch__default=/*#__PURE__*/_interopDefault(ch);var Sh__default=/*#__PURE__*/_interopDefault(Sh);var wh__default=/*#__PURE__*/_interopDefault(wh);var Qh__default=/*#__PURE__*/_interopDefault(Qh);var ny__default=/*#__PURE__*/_interopDefault(ny);var iy__default=/*#__PURE__*/_interopDefault(iy);var sy__default=/*#__PURE__*/_interopDefault(sy);var ab__default=/*#__PURE__*/_interopDefault(ab);var rb__default=/*#__PURE__*/_interopDefault(rb);var ib__default=/*#__PURE__*/_interopDefault(ib);var Ry__default=/*#__PURE__*/_interopDefault(Ry);var Gy__default=/*#__PURE__*/_interopDefault(Gy);var Uy__default=/*#__PURE__*/_interopDefault(Uy);var Ky__default=/*#__PURE__*/_interopDefault(Ky);var _a__default=/*#__PURE__*/_interopDefault(_a);var qy__default=/*#__PURE__*/_interopDefault(qy);var _y__default=/*#__PURE__*/_interopDefault(_y);var vb__default=/*#__PURE__*/_interopDefault(vb);var Cb__default=/*#__PURE__*/_interopDefault(Cb);var Gx__default=/*#__PURE__*/_interopDefault(Gx);var Gb__default=/*#__PURE__*/_interopDefault(Gb);var Ub__default=/*#__PURE__*/_interopDefault(Ub);var xx__default=/*#__PURE__*/_interopDefault(xx);var yu__default=/*#__PURE__*/_interopDefault(yu);var R0__default=/*#__PURE__*/_interopDefault(R0);var D0__default=/*#__PURE__*/_interopDefault(D0);var M0__default=/*#__PURE__*/_interopDefault(M0);var B0__default=/*#__PURE__*/_interopDefault(B0);var _v__default=/*#__PURE__*/_interopDefault(_v);var tv__default=/*#__PURE__*/_interopDefault(tv);var xv__default=/*#__PURE__*/_interopDefault(xv);var vv__default=/*#__PURE__*/_interopDefault(vv);var iv__default=/*#__PURE__*/_interopDefault(iv);var bC__default=/*#__PURE__*/_interopDefault(bC);var xC__default=/*#__PURE__*/_interopDefault(xC);var SC__default=/*#__PURE__*/_interopDefault(SC);var PC__default=/*#__PURE__*/_interopDefault(PC);var RC__default=/*#__PURE__*/_interopDefault(RC);var DC__default=/*#__PURE__*/_interopDefault(DC);var UC__default=/*#__PURE__*/_interopDefault(UC);var KC__default=/*#__PURE__*/_interopDefault(KC);var qC__default=/*#__PURE__*/_interopDefault(qC);var _C__default=/*#__PURE__*/_interopDefault(_C);var jC__default=/*#__PURE__*/_interopDefault(jC);var Sk__default=/*#__PURE__*/_interopDefault(Sk);var NS__default=/*#__PURE__*/_interopDefault(NS);var VS__default=/*#__PURE__*/_interopDefault(VS);var OS__default=/*#__PURE__*/_interopDefault(OS);var WS__default=/*#__PURE__*/_interopDefault(WS);var $S__default=/*#__PURE__*/_interopDefault($S);var qm__default=/*#__PURE__*/_interopDefault(qm);var YS__default=/*#__PURE__*/_interopDefault(YS);var JS__default=/*#__PURE__*/_interopDefault(JS);var rw__default=/*#__PURE__*/_interopDefault(rw);var nw__default=/*#__PURE__*/_interopDefault(nw);var iw__default=/*#__PURE__*/_interopDefault(iw);var Dw__default=/*#__PURE__*/_interopDefault(Dw);var Cg__default=/*#__PURE__*/_interopDefault(Cg);var kg__default=/*#__PURE__*/_interopDefault(kg);var Mw__default=/*#__PURE__*/_interopDefault(Mw);var t1__default=/*#__PURE__*/_interopDefault(t1);var n1__default=/*#__PURE__*/_interopDefault(n1);var i1__default=/*#__PURE__*/_interopDefault(i1);var s1__default=/*#__PURE__*/_interopDefault(s1);var l1__default=/*#__PURE__*/_interopDefault(l1);var pd=Object.defineProperty;var Vg=(e,t,o)=>t in e?pd(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var Og=(e,t)=>()=>(e&&(t=e(e=0)),t);var Wg=(e,t)=>{for(var o in t)pd(e,o,{get:t[o],enumerable:true});};var ud=(e,t,o)=>Vg(e,t+"",o);var Nm={};Wg(Nm,{COrbCanvas:()=>vk});function vk({hue:e=0,hoverIntensity:t=.2,rotateOnHover:o=true,forceHoverState:a=false,backgroundColor:r="transparent"}){let n=ht.useRef(null),i=`
2
2
  precision highp float;
3
3
  attribute vec2 position;
4
4
  attribute vec2 uv;
@@ -180,20 +180,20 @@
180
180
  vec4 col = mainImage(fragCoord);
181
181
  gl_FragColor = vec4(col.rgb * col.a, col.a);
182
182
  }
183
- `;return mt.useEffect(()=>{let d=n.current;if(!d)return;let s=new ogl.Renderer({alpha:true,premultipliedAlpha:false}),l=s.gl;l.clearColor(0,0,0,0),d.appendChild(l.canvas);let m=new ogl.Triangle(l),f=new ogl.Program(l,{vertex:i,fragment:c,uniforms:{iTime:{value:0},iResolution:{value:new ogl.Vec3(l.canvas.width,l.canvas.height,l.canvas.width/l.canvas.height)},hue:{value:e},hover:{value:0},rot:{value:0},hoverIntensity:{value:t},backgroundColor:{value:zm(r)}}}),p=new ogl.Mesh(l,{geometry:m,program:f});function h(){if(!d)return;let D=window.devicePixelRatio||1,w=d.clientWidth,A=d.clientHeight;s.setSize(w*D,A*D),l.canvas.style.width=w+"px",l.canvas.style.height=A+"px",f.uniforms.iResolution.value.set(l.canvas.width,l.canvas.height,l.canvas.width/l.canvas.height);}window.addEventListener("resize",h),h();let k=0,u=0,C=0,g=.3,y=D=>{let w=d.getBoundingClientRect(),A=D.clientX-w.left,P=D.clientY-w.top,v=w.width,M=w.height,T=Math.min(v,M),R=v/2,I=M/2,$=(A-R)/T*2,N=(P-I)/T*2;Math.sqrt($*$+N*N)<.8?k=1:k=0;},b=()=>{k=0;};d.addEventListener("mousemove",y),d.addEventListener("mouseleave",b);let S,E=D=>{S=requestAnimationFrame(E);let w=(D-u)*.001;u=D,f.uniforms.iTime.value=D*.001,f.uniforms.hue.value=e,f.uniforms.hoverIntensity.value=t,f.uniforms.backgroundColor.value=zm(r);let A=a?1:k;f.uniforms.hover.value+=(A-f.uniforms.hover.value)*.1,o&&A>.5&&(C+=w*g),f.uniforms.rot.value=C,s.render({scene:p});};return S=requestAnimationFrame(E),()=>{cancelAnimationFrame(S),window.removeEventListener("resize",h),d.removeEventListener("mousemove",y),d.removeEventListener("mouseleave",b),l.canvas.parentNode===d&&d.removeChild(l.canvas),l.getExtension("WEBGL_lose_context")?.loseContext();}},[e,t,o,a,r]),jsxRuntime.jsx("div",{ref:n,className:"w-full h-full"})}function vk(e,t,o){let a,r,n;if(t===0)a=r=n=o;else {let i=(s,l,m)=>(m<0&&(m+=1),m>1&&(m-=1),m<.16666666666666666?s+(l-s)*6*m:m<.5?l:m<.6666666666666666?s+(l-s)*(.6666666666666666-m)*6:s),c=o<.5?o*(1+t):o+t-o*t,d=2*o-c;a=i(d,c,e+1/3),r=i(d,c,e),n=i(d,c,e-1/3);}return new ogl.Vec3(a,r,n)}function zm(e){if(e==="transparent")return new ogl.Vec3(0,0,0);if(e.startsWith("#")){let a=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255;return new ogl.Vec3(a,r,n)}let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(t)return new ogl.Vec3(parseInt(t[1])/255,parseInt(t[2])/255,parseInt(t[3])/255);let o=e.match(/hsla?\((\d+),\s*(\d+)%,\s*(\d+)%/);if(o){let a=parseInt(o[1])/360,r=parseInt(o[2])/100,n=parseInt(o[3])/100;return vk(a,r,n)}return new ogl.Vec3(0,0,0)}var Vm=Vg(()=>{"use client";});function bo(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var fl={primary:"#000000",primaryHover:"#333333"},Ci={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"},Tn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},md=()=>"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 Ug=classVarianceAuthority.cva(md(),{variants:{variant:{default:`${Ci.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:`${Ci.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:Ci.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-[${fl.primary}] hover:bg-[${fl.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:Tn.none,sm:Tn.sm,md:Tn.md,full:Tn.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),hl=mt__namespace.forwardRef(({className:e,variant:t,size:o,asChild:a=false,...r},n)=>jsxRuntime.jsx(a?reactSlot.Slot:"button",{className:bo(Ug({variant:t,size:o,className:e})),ref:n,...r}));hl.displayName="Button";var qg={"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"},_g={"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"},jg={"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"},Zg={"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"},Xg={"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"},Qg={"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"},In={en:qg,zh:_g,fr:jg,de:Zg,ja:Xg,ko:Qg};var fd=(e,t)=>t?e.replace(/\{(\w+)\}/g,(o,a)=>{let r=t[a];return r==null?"":String(r)}):e,tf={locale:"en",t:(e,t)=>fd(In.en[e]||e,t)},hd=mt.createContext(tf),ki=({locale:e="en",messages:t,children:o})=>{let a=mt.useMemo(()=>{let r=In[e]||In.en,n=t?.[e]||{},i={...In.en,...r,...n};return {locale:e,t:(c,d)=>fd(i[c]||c,d)}},[e,t]);return jsxRuntime.jsx(hd.Provider,{value:a,children:o})},j=()=>mt.useContext(hd);function bl({items:e,onItemClick:t,className:o="",level:a=0,expandedIds:r,onToggleExpand:n,colorMode:i="light"}){let{t:c}=j(),d=i==="dark",s=navigation.usePathname(),[l,m]=mt.useState(false),[f,p]=mt.useState(new Set),h=r!==void 0&&n!==void 0,k=h?r:f;mt.useEffect(()=>{m(true);},[]);let u=g=>{if(h)n(g);else {let y=new Set(f);y.has(g)?y.delete(g):y.add(g),p(y);}},C=g=>{g.children&&g.children.length>0&&u(g.id),t&&t(g);};return !e||!Array.isArray(e)?jsxRuntime.jsx("div",{className:bo("tree-menu",o),children:jsxRuntime.jsx("div",{className:"text-sm text-gray-500 p-2",children:c("navigation.noItems")})}):jsxRuntime.jsx("div",{className:bo("tree-menu",o),children:e.map(g=>{let y=k.has(g.id)||g.isExpanded,b=g.children&&g.children.length>0,S=g.appurl||g.href,E=l&&S?s===S:false;return jsxRuntime.jsxs("div",{className:"tree-menu-item relative",children:[E&&jsxRuntime.jsx("div",{className:bo("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",d?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxRuntime.jsxs(hl,{variant:"ghost",className:bo("w-full justify-start gap-2 h-auto py-2 relative overflow-hidden group",`ml-${a*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:()=>C(g),children:[b&&jsxRuntime.jsx("div",{className:bo("flex-shrink-0 transition-transform duration-200",y&&"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:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})}),!b&&jsxRuntime.jsx("div",{className:"w-4 h-4 flex-shrink-0"}),g.icon&&jsxRuntime.jsx("div",{className:bo("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:g.icon}),jsxRuntime.jsxs("div",{className:"flex-1 text-left overflow-hidden z-10",children:[jsxRuntime.jsx("div",{className:bo("text-sm truncate transition-colors duration-200",E?"font-semibold":"font-medium"),children:g.title||g.label}),g.description&&jsxRuntime.jsx("div",{className:bo("text-xs truncate transition-colors duration-200",E?d?"text-[#90caf9]/70":"text-[#1976d2]/75":d?"text-gray-400":"text-gray-500"),title:g.description,children:g.description})]})]}),b&&jsxRuntime.jsx("div",{className:bo("grid transition-[grid-template-rows] duration-300 ease-in-out",y?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsx(bl,{items:g.children,onItemClick:t,level:a+1,expandedIds:r,onToggleExpand:n,colorMode:i})})})]},g.id)})})}var kd=({collapsed:e,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light"})=>{let{t:i}=j(),c=n==="dark",d=navigation.useRouter(),[s,l]=mt.useState(""),[m,f]=mt.useState(new Set);mt.useEffect(()=>{e&&f(new Set);},[e]);let p=mt.useCallback(C=>{let g=[],y=b=>{b.forEach(S=>{g.push(S.id),S.children&&y(S.children);});};return y(C),g},[]),h=mt.useMemo(()=>{if(!s.trim())return r;let C=g=>g.reduce((y,b)=>{let S=b.title?.toLowerCase().includes(s.toLowerCase())||b.description?.toLowerCase().includes(s.toLowerCase()),E=b.children?C(b.children):[];return (S||E.length>0)&&y.push({...b,children:E.length>0?E:b.children}),y},[]);return C(r)},[s,r]),k=mt.useMemo(()=>s.trim()?new Set(p(r)):m,[s,r,m,p]),u=mt.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{d.push("/chat?new=true");}catch(y){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",y),d.push("/chat");}return}let g=C.appurl||C.href;g&&(g.startsWith("http://")||g.startsWith("https://")?window.open(g,"_blank"):d.push(g));},[d]);return jsxRuntime.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} ${c?"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:[jsxRuntime.jsx("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${e?"px-1":"px-2"}`,children:e?jsxRuntime.jsx("div",{className:"flex justify-center",children:jsxRuntime.jsx("button",{onClick:t,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${c?"text-gray-300 hover:bg-gray-800":"text-gray-500 hover:bg-gray-50"}`,title:i("navigation.expand"),children:jsxRuntime.jsx(lucideReact.Search,{className:"h-5 w-5"})})}):jsxRuntime.jsxs("div",{className:`relative transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:[jsxRuntime.jsx("input",{type:"text",placeholder:i("navigation.searchPlaceholder"),value:s,onChange:C=>l(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 ${c?"border-gray-700 bg-[#1A1A1A] text-white placeholder-gray-400":"border-gray-300 bg-white text-gray-900 placeholder-gray-500"}`}),jsxRuntime.jsx("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:jsxRuntime.jsx(lucideReact.Search,{className:`h-4 w-4 ${c?"text-gray-500":"text-gray-400"}`})})]})}),jsxRuntime.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?jsxRuntime.jsx("div",{className:"flex items-center justify-center py-8 text-gray-500 text-sm",children:e?"\u{1F4C2}":i(s?"navigation.noMatch":"navigation.noAccessibleApp")}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!e&&jsxRuntime.jsx("div",{className:`transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:jsxRuntime.jsx(bl,{items:h,onItemClick:u,className:"space-y-1",expandedIds:k,colorMode:n,onToggleExpand:C=>{let g=new Set(m);h.some(b=>b.id===C)?g.has(C)?g.delete(C):(h.forEach(b=>{b.id!==C&&g.has(b.id)&&g.delete(b.id);}),g.add(C)):g.has(C)?g.delete(C):g.add(C),f(g);}})}),e&&jsxRuntime.jsx("div",{className:"space-y-2",children:r.map(C=>jsxRuntime.jsx("div",{className:"space-y-1",children:jsxRuntime.jsx("button",{onClick:()=>{t();let g=new Set([C.id]);f(g);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${c?"text-gray-400 hover:bg-gray-800":"text-gray-600 hover:bg-gray-50"}`,title:i("navigation.expandView",{title:C.title||""}),children:C.icon||jsxRuntime.jsx("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${c?"bg-[#90caf9] text-[#0b0b0b]":"bg-[#1976d2] text-white"}`,children:C.title?.charAt(0)||"?"})})},C.id))})]})}),!e&&jsxRuntime.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 ${c?"hover:bg-gray-800/50":"hover:bg-white/20"}`,title:i("navigation.collapse"),children:jsxRuntime.jsx("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:jsxRuntime.jsx("div",{className:c?"border-yellow-400":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid #21BCFF",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})})]})};var wd=(e={})=>{let{initialCollapsed:t=false,content:o=[]}=e,[a,r]=mt.useState(t),[n,i]=mt.useState(o),c=mt.useCallback(()=>{r(s=>!s);},[]),d=mt.useMemo(()=>({collapsed:a,onToggle:c,menuData:n}),[a,c,n]);return {collapsed:a,setCollapsed:r,toggleCollapsed:c,menuData:n,setMenuData:i,navigationIslandProps:d}};var Do=e=>jsxRuntime.jsx(material.Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var vl=class{constructor(){ud(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);}},ra=new vl,dT={success:(e,t)=>ra.show("success",e,t),error:(e,t)=>ra.show("error",e,t),warning:(e,t)=>ra.show("warning",e,t),info:(e,t)=>ra.show("info",e,t),show:(e,t,o)=>ra.show(e,t,o),hide:()=>ra.hide()};var wf={success:{icon:jsxRuntime.jsx(vf__default.default,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsxRuntime.jsx(Cf__default.default,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsxRuntime.jsx(kf__default.default,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsxRuntime.jsx(Sf__default.default,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},Pn=({open:e,title:t,message:o,onClose:a,onConfirm:r,confirmText:n,cancelText:i,showCancel:c=true,maxWidth:d="xs",type:s="default"})=>{let{t:l}=j(),m=n||l("messageBox.confirm"),f=i||l("messageBox.cancel"),p=()=>{r?r():a();},h=wf[s],k=s!=="default";return jsxRuntime.jsxs(Ep__default.default,{open:e,onClose:a,maxWidth:d,fullWidth:true,PaperProps:{sx:{borderRadius:3,...k&&{borderTop:`6px solid ${h.iconColor}`}}},children:[k&&jsxRuntime.jsx(Gn__default.default,{sx:{display:"flex",justifyContent:"center",pt:3,color:h.iconColor},children:h.icon}),t&&jsxRuntime.jsx(Fp__default.default,{sx:{textAlign:k?"center":"left",pt:k?1:2},children:t}),jsxRuntime.jsx(Lp__default.default,{sx:{textAlign:k?"center":"left"},children:typeof o=="string"?jsxRuntime.jsx(yf__default.default,{children:o}):o}),jsxRuntime.jsxs(zp__default.default,{sx:{justifyContent:k?"center":"flex-end",pb:3,px:3},children:[c&&jsxRuntime.jsx(Do,{onClick:a,variant:"text",color:"inherit",children:f}),jsxRuntime.jsx(Do,{onClick:p,variant:"contained",sx:{bgcolor:k?h.iconColor:void 0,"&:hover":{bgcolor:k?h.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:m})]})]})},PT=()=>{let[e,t]=mt__namespace.default.useState(null),[o,a]=mt__namespace.default.useState(false);mt__namespace.default.useEffect(()=>{let i=c=>{c?(t(c),a(true)):(a(false),t(null));};return ra.register(i),()=>ra.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?jsxRuntime.jsx(Pn,{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 Id=({title:e,hideHeader:t,children:o})=>jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!t&&jsxRuntime.jsx(material.Box,{sx:{mb:2},children:jsxRuntime.jsx(material.Typography,{variant:"h4",children:e})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,overflow:"hidden"},children:o})]});var Si=e=>{let{t}=j(),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,c=Array.isArray(e.rowsPerPageOptions)&&e.rowsPerPageOptions.length>0?e.rowsPerPageOptions:[20,50,100,-1],d=typeof e.count=="number"?e.count:0,s=Math.max(0,typeof e.page=="number"?e.page:0),l=i===-1?1:Math.max(1,Math.ceil(d/i)),m=Math.min(s+1,l),f=s>0,p=s<l-1&&i!==-1;return jsxRuntime.jsxs(material.Toolbar,{sx:{pl:{sm:2},pr:{xs:1,sm:1},alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.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:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(vp__default.default,{fontSize:"small"})})},sx:{width:300}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:o,color:"text.secondary",whiteSpace:"nowrap"},children:t("table.toolbar.itemsPerPage")}),jsxRuntime.jsx(material.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:c.map(h=>jsxRuntime.jsx(material.MenuItem,{value:h,sx:{fontSize:o},children:h===-1?t("common.all"):h},`rows-per-page-${h}`))}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.max(s-1,0)),disabled:!f,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(Uf__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:o,fontWeight:600,minWidth:88,textAlign:"center",color:"text.primary"},children:t("table.toolbar.pageOf",{current:m,total:l})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.min(s+1,l-1)),disabled:!p,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(Kf__default.default,{fontSize:"small"})})]}),jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[n.length>0&&jsxRuntime.jsx(material.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:n.map((h,k)=>jsxRuntime.jsx(mt__namespace.default.Fragment,{children:h},`toolbar-custom-${k}`))}),jsxRuntime.jsx(material.Box,{sx:{width:"1px",height:20,bgcolor:"divider",mx:.5}}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.groupBy"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:h=>e.setGroupAnchorEl(h.currentTarget),children:jsxRuntime.jsx(material.Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsxRuntime.jsx(Vf__default.default,{})})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.summary"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:e.showSummary?"primary.main":"text.primary"},onClick:h=>e.setSummaryAnchorEl(h.currentTarget),children:jsxRuntime.jsx(Of__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.columns"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:h=>e.setAnchorEl(h.currentTarget),children:jsxRuntime.jsx(Lf__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.export"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:e.handleExport,children:jsxRuntime.jsx(Nf__default.default,{})})}),e.showCreateButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.newItem"),children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenCreateDialog,color:"primary",children:jsxRuntime.jsx($f__default.default,{})})}),e.showEditButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.editItem"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenEditDialog,color:"primary",disabled:!!e.editDisabled,children:jsxRuntime.jsx(Hf__default.default,{})})})}),e.showDeleteButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.deleteItem"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenDeleteConfirm,color:"error",disabled:!!e.deleteDisabled,children:jsxRuntime.jsx(Gf__default.default,{})})})}),e.onOpenGraphReport&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.graphicReport"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:e.onOpenGraphReport,children:jsxRuntime.jsx(Wf__default.default,{})})}),e.onLayoutSave&&!e.layoutManager&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.saveLayout"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:h=>e.onLayoutSave(h),children:jsxRuntime.jsx(Rp__default.default,{})})}),e.layoutManager]})]})};var wi=e=>{let{t}=j(),{onSelectAllClick:o,order:a,orderBy:r,numSelected:n=0,rowCount:i=0,onRequestSort:c,columns:d,visibleColumns:s,selectionMode:l,grouping:m=[],isAllExpanded:f=false,handleToggleAll:p,onColumnResize:h,columnWidths:k}=e,[u,C]=mt.useState(null),g=mt.useRef(null),y=v=>M=>{u||c(v);},b=(v,M,T)=>{v.preventDefault(),v.stopPropagation(),C(M),g.current={startX:v.clientX,startWidth:T,colId:M},document.addEventListener("mousemove",S),document.addEventListener("mouseup",E),document.body.style.cursor="col-resize";},S=v=>{if(!g.current)return;let{startX:M,startWidth:T,colId:R}=g.current,I=v.clientX-M,$=Math.max(50,T+I);h&&h(R,$);},E=()=>{C(null),g.current=null,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",E),document.body.style.cursor="";};mt.useEffect(()=>()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",E);},[]);let D=l==="multiple"||l==="single",w=m.length>0&&!!p,A=t(f?"table.group.collapseAll":"table.group.expandAll"),P=d.filter(v=>s.includes(v.id));return jsxRuntime.jsx(Zf__default.default,{children:jsxRuntime.jsxs(Xf__default.default,{children:[D&&jsxRuntime.jsx(Tl__default.default,{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:jsxRuntime.jsx(Qf__default.default,{color:"primary",indeterminate:n>0&&n<i,checked:i>0&&n===i,onChange:o,disabled:l==="single"})}),w&&jsxRuntime.jsx(Tl__default.default,{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:jsxRuntime.jsx(eh__default.default,{title:A,children:jsxRuntime.jsx(Jf__default.default,{size:"small",onClick:v=>{v.stopPropagation(),p?.(!f);},sx:{p:.2},children:f?jsxRuntime.jsx(oh__default.default,{fontSize:"small"}):jsxRuntime.jsx(th__default.default,{fontSize:"small"})})})}),P.map(v=>{let M=k?.[v.id]||v.minWidth||100;return jsxRuntime.jsxs(Tl__default.default,{align:"left",padding:v.disablePadding?"none":"normal",sortDirection:r===v.id?a:false,style:{width:M,minWidth:M,maxWidth:M},sx:T=>({position:"sticky",top:0,zIndex:4,backgroundColor:T.palette.mode==="dark"?"#000000":"#f5f5f5",color:T.palette.mode==="dark"?"#ffffff":T.palette.text.primary,fontWeight:"bold",userSelect:"none"}),children:[jsxRuntime.jsx(Yf__default.default,{active:r===v.id,direction:r===v.id?a:"asc",onClick:y(v.id),sx:T=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:T.palette.mode==="dark"?"#ffffff":T.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:T.palette.mode==="dark"?"#ffffff":T.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:T.palette.mode==="dark"?"#ffffff":T.palette.text.primary}),children:jsxRuntime.jsx(Gn__default.default,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1},children:v.label})}),jsxRuntime.jsx(Gn__default.default,{onMouseDown:T=>b(T,v.id,typeof M=="number"?M:100),onClick:T=>T.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 Bd=e=>{let{t}=j(),{visibleRows:o,visibleColumns:a,selected:r=[],handleClick:n,columns:i,toggleGroupExpand:c,expandedGroups:d=new Set,selectionMode:s,grouping:l=[],isGroupFullyExpanded:m,handleExpandGroupRecursively:f,handleCollapseGroupRecursively:p}=e,h=g=>r.indexOf(g)!==-1,k=s==="multiple"||s==="single",u=l.length>0,C=a.length+(k?1:0)+(u?1:0);return jsxRuntime.jsxs(material.TableBody,{children:[o.map((g,y)=>{if(g.type==="group"){let b=d.has(g.id),S=g.childIds||[],E=S.filter(P=>h(P)).length,D=S.length>0&&E===S.length,w=E>0&&E<S.length;return jsxRuntime.jsxs(material.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:[k&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:D,indeterminate:w,onChange:P=>{if(P.stopPropagation(),!!e.onSelectionChange)if(D){let v=r.filter(M=>!S.includes(M));e.onSelectionChange(v);}else {let v=Array.from(new Set([...r,...S]));e.onSelectionChange(v);}},onClick:P=>P.stopPropagation(),sx:{p:.5}})}),u&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{width:44},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.25},children:[l.length>1&&g.level<l.length-1&&jsxRuntime.jsx(material.Tooltip,{title:m?.(g.id)?t("table.group.collapseAll"):t("table.group.expandAll"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>{m?.(g.id)?p?.(g.id):f?.(g.id);},sx:{p:.25},children:m?.(g.id)?jsxRuntime.jsx(oh__default.default,{fontSize:"small"}):jsxRuntime.jsx(th__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>c&&c(g.id),sx:{p:.25},children:b?jsxRuntime.jsx(lh__default.default,{}):jsxRuntime.jsx(Kf__default.default,{})})]})}),jsxRuntime.jsx(material.TableCell,{colSpan:a.length,sx:{py:1,pl:g.level*3+1},children:jsxRuntime.jsxs(material.Typography,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[g.field,": ",g.value," (",g.count,")"]})})]},g.id)}else {let b=g.data||g,S=g.id||b.id||y,E=h(S),D=`enhanced-table-checkbox-${y}`,A=(g.level!==void 0?g.level:0)*4;return jsxRuntime.jsxs(material.TableRow,{hover:true,onClick:P=>n&&n(P,b),role:"checkbox","aria-checked":E,tabIndex:-1,selected:E,sx:{cursor:"pointer"},children:[k&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{pl:A>0?A+1:void 0},children:jsxRuntime.jsx(material.Checkbox,{color:"primary",checked:E,inputProps:{"aria-labelledby":D}})}),u&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{width:44}}),i.filter(P=>a.includes(P.id)).map((P,v)=>{let T=!k&&v===0&&A>0?{pl:A+2}:{};return jsxRuntime.jsx(material.TableCell,{align:"left",sx:T,children:P.render?P.render(b[P.id],b):(function(){let I=b[P.id];if(P.numeric){if(typeof I=="number")return I.toLocaleString();if(typeof I=="string"&&I.trim()!==""&&!isNaN(Number(I)))return Number(I).toLocaleString()}return I})()},P.id)})]},S)}}),o.length===0&&jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:C,align:"center",children:t("common.noData")})})]})};var Ed=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 jsxRuntime.jsx(material.TableFooter,{sx:{position:"sticky",bottom:0,zIndex:e.zIndex,bgcolor:"background.paper"},children:jsxRuntime.jsxs(material.TableRow,{children:[n&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper"}}),i&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper",width:44}}),t.map(c=>jsxRuntime.jsx(material.TableCell,{sx:{fontWeight:"bold",fontSize:"0.85rem",bgcolor:"background.paper",color:"text.primary"},children:(function(){let s=o[c];return s==null||s===""?"":typeof s=="number"?s.toLocaleString():typeof s=="string"&&s.trim()!==""&&!isNaN(Number(s))?Number(s).toLocaleString():s})()},c))]})})};var Ld=e=>{let{t}=j();return jsxRuntime.jsx(material.Box,{sx:{p:2},children:jsxRuntime.jsx(material.Typography,{children:t("table.mobile.notImplemented")})})};var zr=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:o,setGrouping:a,columns:r,toggleGroupField:n})=>{let{t:i}=j();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsxs(material.Box,{sx:{p:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle2",sx:{px:1},children:i("table.menu.groupBy")}),o.length>0&&jsxRuntime.jsx(material.Button,{size:"small",color:"error",onClick:()=>a([]),startIcon:jsxRuntime.jsx(Sh__default.default,{}),children:i("table.menu.clearAll")})]}),jsxRuntime.jsx(material.Divider,{}),r.map(c=>{let d=o.includes(c.id),s=o.indexOf(c.id)+1;return jsxRuntime.jsx(material.MenuItem,{onClick:()=>n(c.id),children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsxRuntime.jsx(material.Checkbox,{checked:d,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:c.label}),d&&jsxRuntime.jsx(material.Badge,{badgeContent:s,color:"primary",sx:{mr:2}})]})},c.id)})]})},Nr=({anchorEl:e,setAnchorEl:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=j();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:n("table.menu.visibleColumns")})}),jsxRuntime.jsx(material.Divider,{}),o.map(i=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>r(i.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:a.includes(i.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:i.label})]},i.id))]})},Ri=({anchorEl:e,setAnchorEl:t,showSummary:o,setShowSummary:a,columns:r,summaryColumns:n,toggleSummaryColumn:i})=>{let{t:c}=j();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsx(material.MenuItem,{children:jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Switch,{checked:o,onChange:d=>a(d.target.checked),size:"small"}),label:c("table.menu.showSummaryRow")})}),jsxRuntime.jsx(material.Divider,{}),r.filter(d=>d.numeric).map(d=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>i(d.id),disabled:!o,children:[jsxRuntime.jsx(material.Checkbox,{checked:n.includes(d.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:d.label})]},d.id)),r.filter(d=>d.numeric).length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:c("table.menu.noNumericColumns")})})]})},Di=({contextMenu:e,handleCloseContextMenu:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=j();return jsxRuntime.jsxs(material.Menu,{open:e!==null,onClose:t,anchorReference:"anchorPosition",anchorPosition:e!==null?{top:e.mouseY,left:e.mouseX}:void 0,children:[jsxRuntime.jsx(material.MenuItem,{onClick:t,children:n("common.copy")}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.MenuItem,{disabled:true,children:n("table.menu.visibleColumns")}),o.map(i=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>r(i.id),children:[jsxRuntime.jsx(material.ListItemIcon,{children:a.includes(i.id)&&jsxRuntime.jsx(kh__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i.label})]},i.id))]})};var Mn=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),Vd=({kpis:e})=>{let{t}=j(),o=[{label:t("graph.kpi.totalRecords"),value:Mn(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:Mn(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:Mn(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:Mn(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:Mn(e.flaggedCount,0),color:"error.main"}];return jsxRuntime.jsx(material.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=>jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:a.label}),jsxRuntime.jsx(material.Typography,{variant:"h4",fontWeight:800,sx:{color:a.color},children:a.value})]},a.label))})};var Mi=({title:e,subtitle:t,children:o})=>jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:2,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle1",fontWeight:700,children:e}),t&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mb:2},children:t}),o]});var Bn=({data:e,orientation:t="horizontal",valueSuffix:o="",minHeight:a=210,activeName:r,onItemClick:n})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=Math.max(...e.map(c=>c.value),1);return t==="vertical"?jsxRuntime.jsx(material.Box,{sx:{display:"flex",gap:1,alignItems:"flex-end",minHeight:a},children:e.map(c=>jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.Box,{onClick:()=>n?.(c),sx:{height:`${Math.max(c.value/i*180,6)}px`,bgcolor:c.name===r?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:n?"pointer":"default",opacity:r&&c.name!==r?.45:1}}),jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:c.name,sx:{display:"block",mt:.5},children:c.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",children:[c.value.toFixed(1),o]})]},c.name))}):jsxRuntime.jsx(material.Stack,{spacing:1,children:e.map(c=>jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,title:c.name,children:c.name}),jsxRuntime.jsx(material.Box,{onClick:()=>n?.(c),sx:{alignSelf:"center",bgcolor:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:n?"pointer":"default",opacity:r&&c.name!==r?.45:1},children:jsxRuntime.jsx(material.Box,{sx:{width:`${c.value/i*100}%`,height:"100%",bgcolor:c.name===r?"primary.dark":"primary.main"}})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[c.value.toFixed(1),o]})]},c.name))})};var $d=({data:e,color:t="#42A5F5",valueSuffix:o="",height:a=220})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let r=640,n=28,i=e.map(f=>f.value),c=Math.min(...i,0),s=Math.max(...i,1)-c||1,l=e.map((f,p)=>{let h=n+p*(r-n*2)/Math.max(e.length-1,1),k=a-n-(f.value-c)/s*(a-n*2);return {x:h,y:k,...f}}),m=l.map(f=>`${f.x},${f.y}`).join(" ");return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${r} ${a}`,sx:{width:"100%",height:a},children:[jsxRuntime.jsx("line",{x1:n,y1:a-n,x2:r-n,y2:a-n,stroke:"rgba(148,163,184,0.4)"}),jsxRuntime.jsx("polyline",{fill:"none",stroke:t,strokeWidth:3,points:m}),l.map(f=>jsxRuntime.jsx("circle",{cx:f.x,cy:f.y,r:4,fill:t},f.name))]}),jsxRuntime.jsx(material.Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(f=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:f.name,sx:{display:"block"},children:f.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",children:[f.value.toFixed(1),o]})]},f.name))})]})};var Hd=({data:e,barColor:t="#64B5F6",lineColor:o="#FFB74D",height:a=220})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let r=640,n=28,i=Math.max(...e.map(l=>l.barValue),1),c=Math.max(...e.map(l=>l.lineValue),1),d=e.map((l,m)=>{let f=(r-n*2)/e.length,p=Math.max(f*.5,8),h=n+m*f+(f-p)/2,k=l.barValue/i*(a-n*2),u=a-n-k;return {x:h,y:u,barHeight:k,barWidth:p,item:l}}),s=e.map((l,m)=>{let f=(r-n*2)/e.length,p=n+m*f+f/2,h=a-n-l.lineValue/c*(a-n*2);return {x:p,y:h,item:l}});return jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${r} ${a}`,sx:{width:"100%",height:a},children:[jsxRuntime.jsx("line",{x1:n,y1:a-n,x2:r-n,y2:a-n,stroke:"rgba(148,163,184,0.4)"}),d.map(l=>jsxRuntime.jsx("rect",{x:l.x,y:l.y,width:l.barWidth,height:Math.max(l.barHeight,4),rx:6,fill:t},l.item.name)),jsxRuntime.jsx("polyline",{fill:"none",stroke:o,strokeWidth:3,points:s.map(l=>`${l.x},${l.y}`).join(" ")}),s.map(l=>jsxRuntime.jsx("circle",{cx:l.x,cy:l.y,r:3.5,fill:o},`${l.item.name}-line`))]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(l=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:l.name,sx:{display:"block"},children:l.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Bar: ",l.barValue.toFixed(1)]}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Line: ",l.lineValue.toFixed(1)]})]},l.name))})]})};var Ah=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,Ud=({data:e})=>{if(e.length===0)return jsxRuntime.jsx(material.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 jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:`120px repeat(${t.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+t.length*64},children:[jsxRuntime.jsx(material.Box,{}),t.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:n},n)),o.map(n=>jsxRuntime.jsxs(material.Box,{sx:{display:"contents"},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{alignSelf:"center"},children:n}),t.map(i=>{let c=r.get(`${n}__${i}`)||0,d=c/a;return jsxRuntime.jsx(material.Box,{sx:{height:36,borderRadius:1,bgcolor:Ah(d),border:"1px solid rgba(148,163,184,0.2)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:c.toFixed(1)})},`${n}-${i}`)})]},n))]})})};var Bh=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],Ni=({data:e,variant:t="donut",colors:o=Bh,size:a=180,activeName:r,onItemClick:n})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=0,c=e.map((d,s)=>{let l=i;return i+=d.percent,`${o[s%o.length]} ${l}% ${i}%`});return jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[jsxRuntime.jsx(material.Box,{sx:{width:a,height:a,borderRadius:"50%",background:`conic-gradient(${c.join(", ")})`,position:"relative",flexShrink:0},children:t==="donut"&&jsxRuntime.jsx(material.Box,{sx:{position:"absolute",inset:Math.round(a*.18),bgcolor:"background.paper",borderRadius:"50%"}})}),jsxRuntime.jsx(material.Stack,{spacing:1,sx:{minWidth:180},children:e.map((d,s)=>jsxRuntime.jsxs(material.Box,{onClick:()=>n?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:n?"pointer":"default",opacity:r&&d.name!==r?.45:1},children:[jsxRuntime.jsx(material.Box,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:o[s%o.length]}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{flex:1},children:d.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};var qd=({effect:e,branches:t})=>{if(t.length===0)return jsxRuntime.jsx(material.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 jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(r=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:r.title}),r.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},r.title))}),jsxRuntime.jsxs(material.Box,{sx:{position:"relative",height:32},children:[jsxRuntime.jsx(material.Box,{sx:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),jsxRuntime.jsx(material.Box,{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,bgcolor:"primary.main",color:"primary.contrastText"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:e})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(a.length,1)}, minmax(0, 1fr))`,gap:1},children:a.map(r=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:r.title}),r.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},r.title))})]})};var jd=({data:e,height:t=240})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let o=0,a=e.map(m=>{let f=m.type==="total"?0:o,p=m.type==="total"?m.value:o+m.value;return m.type!=="total"&&(o=p),{...m,start:f,end:p,delta:p-f}}),r=a.flatMap(m=>[m.start,m.end]),n=Math.min(...r,0),i=Math.max(...r,1),c=680,d=30,s=i-n||1,l=m=>t-d-(m-n)/s*(t-d*2);return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${c} ${t}`,sx:{width:"100%",height:t},children:[jsxRuntime.jsx("line",{x1:d,y1:l(0),x2:c-d,y2:l(0),stroke:"rgba(148,163,184,0.4)"}),a.map((m,f)=>{let p=(c-d*2)/a.length,h=Math.max(p*.55,8),k=d+f*p+(p-h)/2,u=l(Math.max(m.start,m.end)),C=l(Math.min(m.start,m.end)),g=m.type==="total"?"#42A5F5":m.delta>=0?"#66BB6A":"#EF5350";return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:k,y:u,width:h,height:Math.max(C-u,4),rx:6,fill:g}),jsxRuntime.jsx("text",{x:k+h/2,y:u-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:m.end.toFixed(1)})]},m.name)})]}),jsxRuntime.jsx(material.Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${a.length}, minmax(0, 1fr))`,gap:1},children:a.map(m=>jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:m.name,children:m.name},m.name))})]})};var Ln=({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}`},iP=(e,t=360)=>{let o=Ln(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};var Qd=({apiKey:e,query:t,embedUrl:o,zoom:a=14,mapType:r="roadmap",height:n=320})=>{let i=o||(e&&t?Ln({apiKey:e,query:t,zoom:a,mapType:r}):"");return i?jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Box,{component:"iframe",src:i,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsxRuntime.jsx(material.Link,{href:i,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var Wi=({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 tp=({keyword:e,location:t,embedUrl:o,height:a=320})=>{let r=o||Wi({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0});return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Box,{component:"iframe",src:r,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:a,border:0,borderRadius:2}}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsxRuntime.jsx(material.Link,{href:r,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var op=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:o,interaction:a})=>{let{t:r}=j();return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsxRuntime.jsx(Mi,{title:r("graph.chart.billable.title"),subtitle:r("graph.chart.billable.subtitle"),children:jsxRuntime.jsx(Bn,{data:e,orientation:"horizontal",activeName:a?.filters?.primaryDimension,onItemClick:n=>a?.onPrimaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(Mi,{title:r("graph.chart.efficiency.title"),subtitle:r("graph.chart.efficiency.subtitle"),children:jsxRuntime.jsx(Bn,{data:t,orientation:"vertical",valueSuffix:"%",activeName:a?.filters?.secondaryDimension,onItemClick:n=>a?.onSecondaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(Mi,{title:r("graph.chart.status.title"),subtitle:r("graph.chart.status.subtitle"),children:jsxRuntime.jsx(Ni,{data:o,variant:"donut",activeName:a?.filters?.status,onItemClick:n=>a?.onStatusClick?.(n.name)})})]})};var Ut=e=>jsxRuntime.jsx(material.TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var Nl=e=>jsxRuntime.jsx(material.TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var Qh=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],Yh=["zh","en","de","fr","ja","ko"],np=({open:e,onClose:t,value:o,onSaveAll:a,modelOptions:r=Qh,promptLangOptions:n=Yh,analysisTemplateOptions:i=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:s})=>{let[l,m]=mt.useState(o),[f,p]=mt.useState(d||""),[h,k]=mt.useState(s||""),[u,C]=mt.useState(false);mt.useEffect(()=>{e&&(m(o),p(d||""),k(s||""));},[e,o,d,s]);let g=(b,S)=>{m(E=>({...E,[b]:S}));},y=async()=>{if(a)try{C(!0),await a({settings:l,analysisTemplateId:f||void 0,responseTemplateId:h||void 0});}finally{C(false);}};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"lg",children:[jsxRuntime.jsxs(material.DialogTitle,{sx:{pr:7,pb:2.2},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{position:"absolute",right:12,top:12},children:jsxRuntime.jsx(Xh__default.default,{})})]}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"18px !important"},children:jsxRuntime.jsxs(material.Stack,{spacing:2.2,children:[jsxRuntime.jsxs(material.Box,{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Ut,{size:"small",value:l.baseUrl,onChange:b=>g("baseUrl",b.target.value),fullWidth:true,label:"Base URL"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Ut,{size:"small",type:"password",value:l.apiKey,onChange:b=>g("apiKey",b.target.value),fullWidth:true,label:"API Key"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Ut,{size:"small",value:l.model,onChange:b=>g("model",b.target.value),fullWidth:true,select:true,label:"Model",children:r.map(b=>jsxRuntime.jsx(material.MenuItem,{value:b,children:b},b))})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Ut,{size:"small",value:l.promptLang,onChange:b=>g("promptLang",b.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:n.map(b=>jsxRuntime.jsx(material.MenuItem,{value:b,children:b},b))})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[jsxRuntime.jsxs(Ut,{size:"small",value:f,onChange:b=>p(b.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),i.map(b=>jsxRuntime.jsx(material.MenuItem,{value:b.id,children:b.label},b.id))]}),jsxRuntime.jsx(Nl,{multiline:true,minRows:8,value:l.analysisPrompt,onChange:b=>g("analysisPrompt",b.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxRuntime.jsxs(Ut,{size:"small",value:h,onChange:b=>k(b.target.value),fullWidth:true,select:true,label:"Response Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),c.map(b=>jsxRuntime.jsx(material.MenuItem,{value:b.id,children:b.label},b.id))]}),jsxRuntime.jsx(Nl,{multiline:true,minRows:8,value:l.responsePrompt,onChange:b=>g("responsePrompt",b.target.value),fullWidth:true,label:"Response Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[jsxRuntime.jsx(material.Button,{variant:"outlined",onClick:t,children:"Cancel"}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:y,disabled:!a||u,children:"Save"})]})]})};var Ki=({open:e,onClose:t,model:o,tableContent:a,extraCharts:r,interaction:n,aiAssistant:i})=>{let{t:c}=j(),[d,s]=mt.useState(i?.defaultPrompt||""),[l,m]=mt.useState(false),[f,p]=mt.useState(false),h=n?.enabled!==false&&!!n,k=i?.enabled!==false,u=n?.filters||{},C=!!(u.primaryDimension||u.secondaryDimension||u.status),g=i?.placeholder||"Ask AI to analyze data, create charts, or find insights...";mt.useEffect(()=>{e&&s(i?.defaultPrompt||"");},[e,i?.defaultPrompt]);let y=i?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},b=async()=>{let S=d.trim();if(!(!S||!i?.onSubmit))try{m(!0),await i.onSubmit(S,{filters:u,model:o});}finally{m(false);}};return jsxRuntime.jsx(material.Dialog,{open:e,onClose:t,fullScreen:true,children:jsxRuntime.jsxs(material.Box,{sx:{height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[jsxRuntime.jsx(material.Box,{sx:{p:2,borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",lg:"row"},alignItems:{xs:"stretch",lg:"center"},justifyContent:"space-between",spacing:1.5,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{flexWrap:"wrap"},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",fontWeight:800,children:o.title}),jsxRuntime.jsx(material.Chip,{size:"small",label:c("graph.records",{count:o.kpis.totalRecords})}),h&&u.primaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.primaryDimension}: ${u.primaryDimension}`,onDelete:()=>n?.onClearFilter("primaryDimension")}),h&&u.secondaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.secondaryDimension}: ${u.secondaryDimension}`,onDelete:()=>n?.onClearFilter("secondaryDimension")}),h&&u.status&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.status}: ${u.status}`,onDelete:()=>n?.onClearFilter("status")}),h&&C&&jsxRuntime.jsx(material.Button,{size:"small",onClick:()=>n?.onClearAll(),children:"Clear"})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{width:{xs:"100%",lg:"auto"}},children:[k&&jsxRuntime.jsxs(material.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:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:i?.onVoiceInput,children:jsxRuntime.jsx(ry__default.default,{sx:{fontSize:18,color:"text.secondary"}})}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:d,onChange:S=>s(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),b());},placeholder:g,sx:{fontSize:"0.9rem"}}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:b,disabled:l||!d.trim(),children:jsxRuntime.jsx(iy__default.default,{sx:{fontSize:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>p(true),children:jsxRuntime.jsx(ny__default.default,{sx:{fontSize:18}})})]}),jsxRuntime.jsx(material.IconButton,{onClick:t,children:jsxRuntime.jsx(Xh__default.default,{})})]})]})}),jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,overflow:"auto",minHeight:0},children:[jsxRuntime.jsx(Vd,{kpis:o.kpis}),jsxRuntime.jsx(op,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:h?{filters:u,onPrimaryDimensionClick:S=>n?.onPrimaryDimensionClick(S),onSecondaryDimensionClick:S=>n?.onSecondaryDimensionClick(S),onStatusClick:S=>n?.onStatusClick(S)}:void 0}),r,a]}),jsxRuntime.jsx(np,{open:f,onClose:()=>p(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 Ra={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"]},ly=5,ip=e=>e.toLowerCase().replace(/[\s_-]/g,""),Da=(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 c=n.get(ip(i));if(c)return c}return r[0]||a},so=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},Nt=(e,t)=>e==null||e===""?t:String(e),cy=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=Nt(i[t],r);n.set(c,(n.get(c)||0)+so(i[o]));}),Array.from(n.entries()).map(([i,c])=>({name:i,value:c})).sort((i,c)=>c.value-i.value).slice(0,a)},dy=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=Nt(c[t],n),s=i.get(d)||{report:0,billable:0};s.report+=so(c[o]),s.billable+=so(c[a]),i.set(d,s);}),Array.from(i.entries()).map(([c,d])=>({name:c,value:d.report>0?d.billable/d.report*100:0})).sort((c,d)=>c.value-d.value).slice(0,r)},py=(e,t,o)=>{let a=e.length;if(a===0)return [];let r=new Map;return e.forEach(n=>{let i=Nt(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}))},sp=(e,t,o)=>{let a=new Map;return e.forEach(r=>{let n=Nt(r[t],"N/A");a.set(n,(a.get(n)||0)+so(r[o]));}),Array.from(a.entries()).sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>({name:r,value:n}))},uy=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=Nt(c[t],n),s=i.get(d)||{report:0,billable:0};s.report+=so(c[o]),s.billable+=so(c[a]),i.set(d,s);}),Array.from(i.entries()).map(([c,d])=>({name:c,barValue:d.billable,lineValue:d.report>0?d.billable/d.report*100:0})).sort((c,d)=>d.barValue-c.barValue).slice(0,r)},my=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=Nt(i[t],r),d=Nt(i[o],r),s=`${c}__${d}`;n.set(s,(n.get(s)||0)+so(i[a]));}),Array.from(n.entries()).map(([i,c])=>{let[d,s]=i.split("__");return {x:d,y:s,value:c}})},gy=(e,t,o)=>{let a=sp(e,t,o),r=a.map(i=>({name:i.name,value:i.value,type:"delta"})),n=a.reduce((i,c)=>i+c.value,0);return [...r,{name:"Total",value:n,type:"total"}]},fy=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=Nt(c[t],n),s=`${Nt(c[o],n)} / ${Nt(c[a],n)}`,l=i.get(d)||new Map;l.set(s,(l.get(s)||0)+1),i.set(d,l);}),Array.from(i.entries()).map(([c,d])=>({title:c,causes:Array.from(d.entries()).sort((s,l)=>l[1]-s[1]).slice(0,r).map(([s,l])=>`${s} (${l})`)})).slice(0,6)},_r=({rows:e,config:t})=>{let{t:o}=j(),a=o("graph.unassigned"),r=mt.useMemo(()=>{let l=t?.fieldMapping;return {primaryDimension:Da(e,l?.primaryDimension,Ra.primaryDimension,"Category"),secondaryDimension:Da(e,l?.secondaryDimension,Ra.secondaryDimension,"Owner"),status:Da(e,l?.status,Ra.status,"Status"),date:Da(e,l?.date,Ra.date,"Date"),description:Da(e,l?.description,Ra.description,"Description"),reportHours:Da(e,l?.reportHours,Ra.reportHours,"ReportHours"),billableHours:Da(e,l?.billableHours,Ra.billableHours,"BillableHours"),amount:Da(e,l?.amount,Ra.amount,"Amount")}},[e,t?.fieldMapping]),n=mt.useMemo(()=>e.map((l,m)=>{let f=so(l[r.reportHours]),p=so(l[r.billableHours]),h=so(l[r.amount]),k=f>0?p/f*100:0;return {id:`graph-row-${m}`,Date:Nt(l[r.date],""),Primary:Nt(l[r.primaryDimension],a),Secondary:Nt(l[r.secondaryDimension],a),Description:Nt(l[r.description],""),ReportHours:f,BillableHours:p,Amount:h,Efficiency:k,Status:Nt(l[r.status],a)}}),[e,r,a]),i=mt.useMemo(()=>{let l=n.length,m=n.reduce((C,g)=>C+so(g.ReportHours),0),f=n.reduce((C,g)=>C+so(g.BillableHours),0),p=n.reduce((C,g)=>C+so(g.Amount),0),h=m>0?f/m*100:0,k=t?.statusFlagValues||["flag","flagged","warning","risk"],u=n.filter(C=>k.includes(Nt(C.Status,"").toLowerCase())).length;return {totalRecords:l,totalReportHours:m,totalBillableHours:f,efficiency:h,totalAmount:p,flaggedCount:u}},[n,t?.statusFlagValues]),c=t?.topN||ly,d=mt.useMemo(()=>({billableByPrimary:cy(n,"Primary","BillableHours",c,a),efficiencyBySecondary:dy(n,"Secondary","ReportHours","BillableHours",c,a),statusDistribution:py(n,"Status",a),lineByDate:sp(n,"Date","BillableHours"),comboByPrimary:uy(n,"Primary","ReportHours","BillableHours",c,a),heatmapPrimarySecondary:my(n,"Primary","Secondary","BillableHours",a),waterfallBillable:gy(n,"Date","BillableHours"),fishboneStatusCauses:fy(n,"Status","Primary","Secondary",3,a)}),[n,c,a]),s=mt.useMemo(()=>({title:t?.title||o("graph.reportTitle"),kpis:i,charts:d,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}}),[d,t?.title,r,i,n,o]);return {fieldMapping:r,model:s}};var jr=e=>String(e??"").trim(),_i=(e={})=>{let[t,o]=mt.useState(e),a=mt.useCallback((d,s)=>{o(l=>{let m=s?.trim();if(!m){let f={...l};return delete f[d],f}if(l[d]===m){let f={...l};return delete f[d],f}return {...l,[d]:m}});},[]),r=mt.useCallback(d=>{o(s=>{if(!s[d])return s;let l={...s};return delete l[d],l});},[]),n=mt.useCallback(()=>{o({});},[]),i=mt.useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),c=mt.useCallback((d,s)=>d.filter(l=>!(t.primaryDimension&&jr(l[s.primaryDimension])!==jr(t.primaryDimension)||t.secondaryDimension&&jr(l[s.secondaryDimension])!==jr(t.secondaryDimension)||t.status&&jr(l[s.status])!==jr(t.status))),[t]);return {filters:t,setFilter:a,clearFilter:r,clearAll:n,hasActiveFilters:i,applyRows:c}};var Zi=({variants:e,currentVariantId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=j(),d=material.useTheme().palette.mode==="dark",s="0.85rem",l={xs:"calc((100% - 1 * 16px) / 2)",sm:"calc((100% - 2 * 16px) / 3)",md:"calc((100% - 3 * 16px) / 4)",lg:"calc((100% - 5 * 16px) / 6)"},[m,f]=mt.useState(false),[p,h]=mt.useState(""),[k,u]=mt.useState(false),[C,g]=mt.useState(false),y=e.find(E=>E.id===t),b=()=>{h(y?.name||i("variant.newVariant")),u(y?.isDefault||false),g(y?.isPublic||false),f(true);},S=()=>{a({name:p,isDefault:k,isPublic:C,description:""}),f(false);};return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",gap:1,alignItems:"center",width:"100%",maxWidth:"100%"},children:[jsxRuntime.jsx(material.Autocomplete,{size:"small",sx:{width:l,"& .MuiInputBase-root":{fontSize:s,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:s},"& .MuiAutocomplete-noOptions":{fontSize:s}},noOptionsText:jsxRuntime.jsx(material.Typography,{sx:{fontSize:s},children:i("variant.noOptions")}),options:e,getOptionLabel:E=>E.name+(E.isDefault?` (${i("variant.defaultSuffix")})`:""),value:y||null,onChange:(E,D)=>{D&&o(D);},renderInput:E=>jsxRuntime.jsx(material.TextField,{...E,variant:"outlined",size:"small",InputProps:{...E.InputProps,sx:{fontSize:s,color:d?"#E3F2FD":"#0D47A1"}},placeholder:i("variant.selectVariant")}),renderOption:(E,D)=>jsxRuntime.jsx("li",{...E,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{flex:1,fontSize:s},children:D.name}),D.isDefault&&jsxRuntime.jsx(Py__default.default,{fontSize:"small",color:"action"})]})})}),jsxRuntime.jsx(material.Tooltip,{title:i("variant.saveView"),children:jsxRuntime.jsx(material.IconButton,{onClick:b,size:"small",color:"primary",children:jsxRuntime.jsx(Rp__default.default,{fontSize:"small"})})}),jsxRuntime.jsxs(material.Dialog,{open:m,onClose:()=>f(false),children:[jsxRuntime.jsx(material.DialogTitle,{children:i("variant.saveView")}),jsxRuntime.jsxs(material.DialogContent,{children:[jsxRuntime.jsx(material.TextField,{autoFocus:true,margin:"dense",label:i("variant.viewName"),fullWidth:true,variant:"outlined",value:p,onChange:E=>h(E.target.value)}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:k,onChange:E=>u(E.target.checked)}),label:i("variant.setDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:C,onChange:E=>g(E.target.checked)}),label:i("variant.publicAllUsers")})]}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>f(false),children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:S,variant:"contained",children:i("common.save")})]})]})]})};var fp=({appId:e,tableKey:t="default",currentFilters:o,currentLayoutId:a,layoutRefs:r,onLoad:n,variantService:i,serviceUrl:c,onError:d,onSuccess:s,currentVariantId:l,onVariantChange:m})=>{let{t:f}=j(),[p,h]=mt.useState([]),[k,u]=mt.useState(""),C=`orbcafe.variants.${e}.${t}`,g=l!==void 0?l:k,y=M=>{l===void 0&&u(M),m&&m(M);},b=mt.useCallback(()=>{try{let M=localStorage.getItem(C);if(!M)return [];let T=JSON.parse(M);return Array.isArray(T)?T:[]}catch{return []}},[C]),S=mt.useCallback(M=>{try{localStorage.setItem(C,JSON.stringify(M));}catch{}},[C]),E=mt.useCallback(M=>{h(M);let T=M.find(R=>R.isDefault);T&&!g&&(y(T.id),n(T));},[g,n,y]),D=mt.useCallback(async()=>{if(!e)return [];try{let M=[];if(i)M=await i.getVariants(e,t);else if(c){let T=await fetch(`${c}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!T.ok)throw new Error(f("variant.toast.fetchFailed"));M=await T.json();}else M=b();return E(M),M}catch(M){console.error("Error fetching variants",M);let T=b();return E(T),d&&d(f("variant.toast.fetchFailed")),T}},[e,t,i,c,b,E,d,f]);return mt.useEffect(()=>{D();},[e,t]),jsxRuntime.jsx(Zi,{variants:p,currentVariantId:g,onLoad:M=>{y(M.id),n(M);},onSave:async M=>{let T=Date.now().toString(),R;try{let I=M.scope||"Both",$=p.find(J=>J.name===M.name);T=$?$.id:Date.now().toString();let N=[];if($&&(Array.isArray($.filters)?N=[...$.filters]:$.filters&&(N=[{scope:"default",filters:$.filters}])),I==="Search"||I==="Both"){let J=(Array.isArray(o),o);if(J)if(Array.isArray(J)&&J.length>0&&J[0].scope)J.forEach(ee=>{let Z=N.findIndex(Oe=>Oe.scope===ee.scope);Z>=0?N[Z]=ee:N.push(ee);});else {let ee={scope:t,filters:J},Z=N.findIndex(Oe=>Oe.scope===t);Z>=0?N[Z]=ee:N.push(ee);}}let X=$?.layout||{},se=[];if($&&Array.isArray($.layoutRefs)&&(se=[...$.layoutRefs]),I==="Layout"||I==="Both")if(r&&r.length>0)r.forEach(J=>{let ee=se.findIndex(Z=>Z.tableKey===J.tableKey);ee>=0?se[ee]=J:se.push(J);});else {let J={tableKey:t,layoutId:a||null},ee=se.findIndex(Z=>Z.tableKey===t);ee>=0?se[ee]=J:se.push(J);}if(R={appId:e,tableKey:t,...M,scope:I,id:T,createdAt:new Date().toISOString(),filters:N,layout:X,layoutRefs:se},i)await i.saveVariant(R,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)})).ok)throw new Error(f("variant.toast.saveFailed"))}else {let ee=p.some(Z=>Z.id===T)?p.map(Z=>Z.id===T?R:Z):[...p,R];h(ee),S(ee);}s&&s(f("variant.toast.saveSuccess")),(i||c)&&await D(),y(T),n(R);}catch(I){console.error("Error saving variant",I);let N=p.some(X=>X.id===T)?p.map(X=>X.id===T?R:X):[...p,R];h(N),S(N),y(T),n(R),d&&d(f("variant.toast.saveFailed"));}},onDelete:async M=>{try{if(i)await i.deleteVariant(M);else if(c){if(!(await fetch(`${c}/api/variants/${M}`,{method:"DELETE"})).ok)throw new Error(f("variant.toast.deleteFailed"))}else {let T=p.filter(R=>R.id!==M);h(T),S(T);}g===M&&y(""),(i||c)&&D(),s&&s(f("variant.toast.deleteSuccess"));}catch(T){console.error("Error deleting variant",T);let R=p.filter(I=>I.id!==M);h(R),S(R),g===M&&y(""),d&&d(f("variant.toast.deleteFailed"));}},onSetDefault:async M=>{try{let T=p.find(I=>I.id===M);if(!T)return;let R={appId:e,tableKey:t,...T,isDefault:!0};if(i)await i.setDefaultVariant(M,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)})).ok)throw new Error(f("variant.toast.defaultFailed"))}else {let I=p.map($=>({...$,isDefault:$.id===M}));h(I),S(I);}(i||c)&&await D(),s&&s(f("variant.toast.defaultSuccess"));}catch(T){console.error("Error setting default variant",T);let R=p.map(I=>({...I,isDefault:I.id===M}));h(R),S(R),d&&d(f("variant.toast.defaultFailed"));}}})};Ka__default.default.extend(Ky__default.default);Ka__default.default.extend(qy__default.default);var _y=[null,null],Hl="0.85rem",jy={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},Zy=material.styled(PickersDay.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%"}})),bp=({label:e,value:t=_y,onChange:o})=>{let{t:a,locale:r}=j(),n=jy[r]||"en",i=e||a("dateRange.label"),[c,d]=mt.useState(null),[s,l]=mt.useState(t),[m,f]=mt.useState("start"),[p,h]=mt.useState(null),[k,u]=mt.useState((t[0]||Ka__default.default()).locale(n)),C=mt__namespace.default.useRef(t);mt.useEffect(()=>{let[T,R]=t,[I,$]=C.current,N=J=>J&&typeof J.isSame=="function",X=!(T===null&&I===null||N(T)&&N(I)&&T.isSame(I,"day")),se=!(R===null&&$===null||N(R)&&N($)&&R.isSame($,"day"));(X||se)&&(l(t),t[0]&&N(t[0])&&u(t[0].locale(n))),C.current=t;},[t,n]);let g=T=>{d(T.currentTarget);},y=()=>{d(null),f("start"),h(null);},b=!!c,S=T=>{if(!T)return;let R=[...s];if(m==="start")R=[T,null],f("end");else {let I=R[0];I&&T.isBefore(I)?(R=[T,null],f("end")):(R=[I,T],f("start"));}l(R);},E=T=>{let R=Ka__default.default().locale(n),I=[null,null];switch(T){case "today":I=[R,R];break;case "week":I=[R.startOf("week"),R.endOf("week")];break;case "month":I=[R.startOf("month"),R.endOf("month")];break}l(I),f("start"),u(R);},D=()=>{l([null,null]),f("start"),u(Ka__default.default().locale(n));},w=()=>{o&&o(s),y();},A=()=>{l(t),f("start"),y();},P=mt.useCallback(T=>{let{day:R,...I}=T,[$,N]=s,X=$?R.isSame($,"day"):false,se=N?R.isSame(N,"day"):false,J=$&&N?R.isBetween($,N,"day","()"):false,ee=false;return m==="end"&&$&&!N&&p&&R.isAfter($,"day")&&R.isBefore(p.add(1,"day"),"day")&&(ee=true),jsxRuntime.jsx(Zy,{...I,day:R,disableMargin:true,isStart:X,isEnd:se,isInRange:J||ee,onMouseEnter:()=>h(R)})},[s,m,p]),v=T=>T?T.locale(n).format("YYYY-MM-DD"):"",M=T=>T?T.locale(n).format("ll"):"";return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.TextField,{label:i,value:s[0]?`${v(s[0])} - ${v(s[1])}`:"",onClick:g,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Hl}},InputProps:{readOnly:true,sx:{fontSize:Hl,"& .MuiOutlinedInput-input":{fontSize:Hl},paddingRight:"4px"},endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",sx:{ml:0},children:[(s[0]||s[1])&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:T=>{T.stopPropagation(),D();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsxRuntime.jsx(Gy__default.default,{sx:{fontSize:"1rem"}})}),jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end",onClick:g,sx:{padding:"2px"},children:jsxRuntime.jsx(Hy__default.default,{sx:{fontSize:"1rem"},color:"action"})})]})}}),jsxRuntime.jsxs(material.Popover,{open:b,anchorEl:c,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{display:"flex",flexDirection:"column",p:0,minWidth:320}}},children:[jsxRuntime.jsx(material.Box,{sx:{p:2,bgcolor:"background.default",borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:2,justifyContent:"space-between",children:[jsxRuntime.jsxs(material.Box,{sx:{p:1,border:1,borderColor:m==="start"?"primary.main":"divider",borderRadius:1,bgcolor:m==="start"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>f("start"),children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",display:"block",children:a("dateRange.startDate")}),jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:500,children:s[0]?M(s[0]):a("dateRange.select")})]}),jsxRuntime.jsx(Uy__default.default,{color:"action",fontSize:"small"}),jsxRuntime.jsxs(material.Box,{sx:{p:1,border:1,borderColor:m==="end"?"primary.main":"divider",borderRadius:1,bgcolor:m==="end"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>{s[0]&&f("end");},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",display:"block",children:a("dateRange.endDate")}),jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:500,children:s[1]?M(s[1]):a("dateRange.select")})]})]})}),jsxRuntime.jsx(material.Box,{sx:{p:2,pb:0},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",children:[jsxRuntime.jsx(material.Chip,{label:a("dateRange.today"),onClick:()=>E("today"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:a("dateRange.thisWeek"),onClick:()=>E("week"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:a("dateRange.thisMonth"),onClick:()=>E("month"),clickable:true,size:"small",variant:"outlined"})]})}),jsxRuntime.jsx(LocalizationProvider.LocalizationProvider,{dateAdapter:AdapterDayjs.AdapterDayjs,adapterLocale:n,children:jsxRuntime.jsx(DateCalendar.DateCalendar,{value:null,referenceDate:k,onMonthChange:u,onYearChange:u,onChange:S,slots:{day:P},views:["day"],showDaysOutsideCurrentMonth:true,sx:{m:0}})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[jsxRuntime.jsx(material.Button,{size:"small",onClick:A,color:"inherit",children:a("common.cancel")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"contained",onClick:w,children:a("common.done")})]})]})]})};var Ji={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},ib={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"},sb=["equals","contains","notContains","wildcard"],Cp=["=","!=",">","<",">=","<=","between"],lt="0.85rem",lb=({field:e,value:t,onChange:o})=>{let{t:a}=j(),[r,n]=mt.useState(null),[i,c]=mt.useState(null),[d,s]=mt.useState(""),[l,m]=mt.useState(""),[f,p]=mt.useState(false),[h,k]=mt.useState(""),[u,C]=mt.useState("");mt.useEffect(()=>{let v=setTimeout(()=>{C(h);},1e3);return ()=>clearTimeout(v)},[h]);let g=t?.operator||(e.type==="number"?"=":"equals"),y=t?.value,b=v=>{let M=ib[v];return M?a(M):v},S=v=>{n(v.currentTarget);},E=v=>{o({...t,operator:v,value:y}),n(null);},D={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:lt}},InputProps:{sx:{fontSize:lt}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:lt,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},w=e.type||"text";if(w==="date"){let M=(T=>{if(!T)return [null,null];if(Array.isArray(T)&&T.length===2){let R=T[0]?Ka__default.default.isDayjs(T[0])?T[0]:Ka__default.default(T[0]):null,I=T[1]?Ka__default.default.isDayjs(T[1])?T[1]:Ka__default.default(T[1]):null;return [R,I]}return Ka__default.default.isDayjs(T)||typeof T=="string"?[Ka__default.default.isDayjs(T)?T:Ka__default.default(T),null]:[null,null]})(y);return jsxRuntime.jsx(bp,{label:e.label,value:M,onChange:T=>o({value:T,operator:"between"})})}if(w==="number"&&g==="between"){let v=()=>{o({value:[d,l],operator:"between"}),c(null);},M=Array.isArray(y)?`${y[0]||""} - ${y[1]||""}`:"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...D,label:e.label,value:M,placeholder:a("smartFilter.minMaxPlaceholder"),InputProps:{...D.InputProps,startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:b("between"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:S,sx:{width:24,height:24,fontSize:lt},children:Ji.between})})}),readOnly:true},onClick:T=>c(T.currentTarget)}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:lt,minHeight:"auto",py:.5}}},children:Cp.map(T=>jsxRuntime.jsxs(material.MenuItem,{selected:T===g,onClick:()=>E(T),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Ji[T]}),jsxRuntime.jsx(material.ListItemText,{primary:b(T),primaryTypographyProps:{fontSize:lt}})]},T))}),jsxRuntime.jsx(material.Popover,{open:!!i,anchorEl:i,onClose:()=>c(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[jsxRuntime.jsx(material.TextField,{size:"small",label:a("smartFilter.min"),type:"number",value:d,onChange:T=>s(T.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:lt}},InputProps:{sx:{fontSize:lt}}}),jsxRuntime.jsx(nb__default.default,{color:"action"}),jsxRuntime.jsx(material.TextField,{size:"small",label:a("smartFilter.max"),type:"number",value:l,onChange:T=>m(T.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:lt}},InputProps:{sx:{fontSize:lt}}}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:v,children:a("common.ok")})]})})]})}if(w==="select")return jsxRuntime.jsxs(material.TextField,{...D,select:true,label:e.label,value:y||"",onChange:v=>o({...t,value:v.target.value,operator:"equals"}),children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:jsxRuntime.jsx("em",{children:a("common.none")})}),e.options?.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v.value,children:v.label},v.value))]});if(w==="multi-select"){let v=Array.isArray(y)?y:[],M=e.options?.filter(T=>T.label.toLowerCase().includes(u.toLowerCase()))||[];return jsxRuntime.jsxs(material.TextField,{...D,select:true,label:e.label,value:v,onChange:T=>o({...t,value:T.target.value,operator:"anyOf"}),SelectProps:{...D.SelectProps,multiple:true,onClose:()=>{k(""),C("");},renderValue:T=>{if(!Array.isArray(T)||T.length===0)return jsxRuntime.jsx("em",{children:a("common.none")});let R=$=>e.options?.find(N=>N.value===$)?.label||$,I=T.map(R);return I.length>2?`${I.slice(0,2).join(", ")} +${I.length-2}`:I.join(", ")}},children:[jsxRuntime.jsx(material.ListSubheader,{children:jsxRuntime.jsx(material.TextField,{size:"small",autoFocus:true,placeholder:a("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(vp__default.default,{fontSize:"small"})}),sx:{fontSize:lt}},value:h,onChange:T=>k(T.target.value),onKeyDown:T=>{T.key!=="Escape"&&T.stopPropagation();},onClick:T=>T.stopPropagation()})}),M.length>0?M.map(T=>jsxRuntime.jsxs(material.MenuItem,{value:T.value,children:[jsxRuntime.jsx(material.Checkbox,{checked:v.indexOf(T.value)>-1,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:T.label,primaryTypographyProps:{fontSize:lt}})]},T.value)):jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:a("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:lt}})})]})}let A=w==="number"?Cp:sb,P=f||y!==void 0&&y!==""&&y!==null||!!r;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...D,label:e.label,sx:{minWidth:"120px"},value:y||"",type:w==="number"?"number":"text",onChange:v=>o({...t,value:v.target.value,operator:g}),onFocus:()=>p(true),onBlur:()=>p(false),InputProps:{...D.InputProps,startAdornment:P?jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:b(g),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:S,onMouseDown:v=>v.preventDefault(),sx:{width:24,height:24,fontSize:lt,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Ji[g]})})}):null,endAdornment:e.hasSearchIcon?jsxRuntime.jsx(material.InputAdornment,{position:"end",children:jsxRuntime.jsx(vp__default.default,{color:"action"})}):void 0}}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:lt,minHeight:"auto",py:.5}}},children:A.map(v=>jsxRuntime.jsxs(material.MenuItem,{selected:v===g,onClick:()=>E(v),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Ji[v]}),jsxRuntime.jsx(material.ListItemText,{primary:b(v),primaryTypographyProps:{fontSize:lt}})]},v))})]})},la=({fields:e,filters:t,onFilterChange:o,variants:a=[],currentVariantId:r,onVariantLoad:n,onVariantSave:i,onVariantDelete:c,onVariantSetDefault:d,onSearch:s,loading:l=false,appId:m,tableKey:f,currentLayout:p,currentLayoutId:h,layoutRefs:k,variantService:u,serviceUrl:C})=>{let{t:g}=j(),[y,b]=mt.useState(true),[S,E]=mt.useState(null),[D,w]=mt.useState(e.filter(M=>!M.hidden).map(M=>M.id)),A=(M,T)=>{o({...t,[M]:T});},P=M=>{D.includes(M)?w(D.filter(T=>T!==M)):w([...D,M]);};return jsxRuntime.jsxs(material.Paper,{sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[m?jsxRuntime.jsx(fp,{appId:m,tableKey:f,currentFilters:{values:t,visibleFields:D},currentLayout:p,currentLayoutId:h,layoutRefs:k,onLoad:M=>{if(!M.filters)return;let T=null;if(Array.isArray(M.filters)){let R=f||"default",I=M.filters.find($=>$.scope===R);T=I?I.filters:null;}else T=M.filters;T&&(T.values||T.visibleFields?(T.visibleFields&&Array.isArray(T.visibleFields)&&w(T.visibleFields),T.values&&o(T.values)):o(T)),n&&n(M);},variantService:u,serviceUrl:C,currentVariantId:r}):jsxRuntime.jsx(Zi,{variants:a,currentVariantId:r,onLoad:n,onSave:M=>{i&&i({...M,filters:{values:t,visibleFields:D}});},onDelete:c,onSetDefault:d}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Tooltip,{title:g("smartFilter.addFilters"),children:jsxRuntime.jsx(material.Button,{onClick:M=>E(M.currentTarget),size:"small",color:"primary",startIcon:jsxRuntime.jsx(ob__default.default,{fontSize:"small"}),sx:{textTransform:"none",fontSize:lt,whiteSpace:"nowrap",minWidth:"fit-content"},children:g("smartFilter.adaptFilters")})}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:s,disabled:l,sx:{minWidth:"52px",fontWeight:"bold",fontSize:lt},children:g(l?"common.loading":"smartFilter.go")}),jsxRuntime.jsxs(material.Menu,{anchorEl:S,open:!!S,onClose:()=>E(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:lt,minHeight:32}}}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:g("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:lt}})}),jsxRuntime.jsx(material.Divider,{}),e.map(M=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>P(M.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:D.includes(M.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:M.label,primaryTypographyProps:{fontSize:lt}})]},M.id))]})]})]}),jsxRuntime.jsx(material.Collapse,{in:y,children:jsxRuntime.jsx(material.Box,{sx:{px:2,pb:2},children:jsxRuntime.jsx(material.Grid,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:e.filter(M=>D.includes(M.id)).map(M=>jsxRuntime.jsx(material.Grid,{size:1,children:jsxRuntime.jsx(lb,{field:M,value:t[M.id]||{value:"",operator:M.type==="number"?"=":"equals"},onChange:T=>A(M.id,T)})},M.id))})})}),jsxRuntime.jsx(material.Box,{sx:{position:"absolute",bottom:0,left:"50%",transform:"translate(-50%, 50%)",zIndex:10},children:jsxRuntime.jsx(material.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?jsxRuntime.jsx(ab__default.default,{sx:{fontSize:16},color:"action"}):jsxRuntime.jsx(lh__default.default,{sx:{fontSize:16},color:"action"})})})]})};var Dp=({layouts:e,currentLayoutId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=j(),[c,d]=mt.useState(null),[s,l]=mt.useState(false),[m,f]=mt.useState(""),[p,h]=mt.useState(""),[k,u]=mt.useState({isDefault:false,isPublic:false}),C=e.find(D=>D.id===t),g=D=>{d(D.currentTarget);},y=()=>{d(null);},b=D=>{o(D),y();},S=()=>{f(""),h(""),u({isDefault:false,isPublic:false}),l(true),y();},E=()=>{m.trim()&&(a({name:m,description:p,...k}),l(false));};return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Tooltip,{title:i("layout.saveLayout"),children:jsxRuntime.jsx(material.IconButton,{onClick:S,color:"primary",size:"small",children:jsxRuntime.jsx(Rp__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:i("layout.layoutOptions"),children:jsxRuntime.jsx(material.IconButton,{onClick:g,color:C?"primary":"default",children:jsxRuntime.jsx(vb__default.default,{})})}),jsxRuntime.jsxs(material.Menu,{anchorEl:c,open:!!c,onClose:y,PaperProps:{sx:{width:320,maxHeight:400}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.Typography,{variant:"caption",children:i("layout.selectLayout")})}),jsxRuntime.jsxs(material.MenuItem,{onClick:S,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Rp__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i("layout.saveCurrentLayout")})]}),jsxRuntime.jsx(material.Divider,{}),e.length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:i("layout.noSavedLayouts")})}),e.map((D,w)=>jsxRuntime.jsx(material.MenuItem,{onClick:()=>b(D),selected:D.id===t,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:D.id===t?"bold":"normal",noWrap:true,children:D.name})}),D.description&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,children:D.description})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center"},onClick:A=>A.stopPropagation(),children:[jsxRuntime.jsx(material.Tooltip,{title:D.isDefault?i("layout.removeDefault"):i("layout.setAsDefault"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:A=>{A.stopPropagation(),n(D.id);},children:D.isDefault?jsxRuntime.jsx(Py__default.default,{fontSize:"small",color:"warning"}):jsxRuntime.jsx(xb__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.Tooltip,{title:i("common.delete"),children:jsxRuntime.jsx(material.IconButton,{size:"small",color:"error",onClick:A=>{A.stopPropagation(),r(D.id);},children:jsxRuntime.jsx(Gf__default.default,{fontSize:"small"})})})]})]})},D.id||w))]}),jsxRuntime.jsxs(material.Dialog,{open:s,onClose:()=>l(false),maxWidth:"xs",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:i("layout.saveLayout")}),jsxRuntime.jsx(material.DialogContent,{children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[jsxRuntime.jsx(material.TextField,{label:i("layout.layoutName"),value:m,onChange:D=>f(D.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:i("layout.layoutNameHelper")}),e.some(D=>D.name===m)&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"warning.main",sx:{ml:1},children:i("layout.warningOverwrite")}),jsxRuntime.jsx(material.TextField,{label:i("layout.layoutDescription"),value:p,onChange:D=>h(D.target.value),fullWidth:true,size:"small"}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:k.isDefault,onChange:D=>u({...k,isDefault:D.target.checked})}),label:i("layout.useAsDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:k.isPublic,onChange:D=>u({...k,isPublic:D.target.checked})}),label:i("layout.publicAllUsers")})]})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>l(false),children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:E,variant:"contained",disabled:!m,children:i("common.save")})]})]})]})};var as=({appId:e,tableKey:t="default",currentLayoutData:o,onLayoutLoad:a,targetLayoutId:r,activeLayoutId:n,serviceUrl:i,onError:c,onSuccess:d})=>{let{t:s}=j(),[l,m]=mt.useState([]),[f,p]=mt.useState(""),h=`orbcafe.layouts.${e}.${t}`,k=w=>({id:w.layoutId,name:w.name,description:w.description??"",isDefault:!!w.isDefault,isPublic:!!w.isPublic,createdAt:w.createdAt??new Date().toISOString(),layoutData:w.layout??{}}),u=w=>({appId:e,tableKey:t,layoutId:w.id,name:w.name,description:w.description??"",isDefault:!!w.isDefault,isPublic:!!w.isPublic,createdAt:w.createdAt,layout:w.layoutData}),C=mt.useCallback(()=>{try{let w=localStorage.getItem(h);if(!w)return [];let A=JSON.parse(w);return Array.isArray(A)?A:[]}catch{return []}},[h]),g=mt.useCallback(w=>{try{localStorage.setItem(h,JSON.stringify(w));}catch{}},[h]);mt.useEffect(()=>{n!==void 0&&p(n);},[n]),mt.useEffect(()=>{if(r&&l.length>0){let w=l.find(A=>A.id===r);w&&(p(w.id),a(w));}},[r,l,a]);let y=mt.useCallback(async()=>{if(e){if(!i){let w=C();m(w);let A=w.find(P=>P.isDefault);A&&!f&&!r&&(p(A.id),a(A));return}try{let w=await fetch(`${i}/api/layouts?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!w.ok)throw new Error("LAYOUT_FETCH_FAILED");let P=(await w.json()).map(k);m(P);let v=P.find(M=>M.isDefault);v&&!f&&!r&&(p(v.id),a(v));}catch(w){console.error("Error fetching layouts",w);let A=C();m(A);let P=A.find(v=>v.isDefault);P&&!f&&!r&&(p(P.id),a(P)),c&&c(s("layout.toast.loadFallback"));}}},[e,t,i,c,f,a,r,C,s]);return mt.useEffect(()=>{y();},[e,t]),jsxRuntime.jsx(Dp,{layouts:l,currentLayoutId:f,onLoad:w=>{p(w.id),a(w);},onSave:async w=>{let A=l.find(M=>M.name===w.name),P=A?A.id:Date.now().toString(),v={id:P,...w,createdAt:new Date().toISOString(),layoutData:o,isDefault:w.isDefault??false,isPublic:w.isPublic??false};if(!i){let T=l.some(R=>R.id===P)?l.map(R=>R.id===P?v:R):[...l,v];m(T),g(T),p(P),a(v),d&&d(s("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u(v))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(s("layout.toast.saveSuccess")),await y(),p(P),a(v);}catch(M){console.error("Error saving layout",M);let R=l.some(I=>I.id===P)?l.map(I=>I.id===P?v:I):[...l,v];m(R),g(R),p(P),a(v),d&&d(s("layout.toast.saveLocalSuccess")),c&&c(s("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async w=>{if(!i){let A=l.filter(P=>P.id!==w);m(A),g(A),f===w&&p(""),d&&d(s("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts/${encodeURIComponent(w)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f===w&&p(""),d&&d(s("layout.toast.deleteSuccess")),await y();}catch(A){console.error("Error deleting layout",A);let P=l.filter(v=>v.id!==w);m(P),g(P),f===w&&p(""),d&&d(s("layout.toast.deleteLocalSuccess")),c&&c(s("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async w=>{if(!i){let A=l.map(P=>({...P,isDefault:P.id===w}));m(A),g(A),d&&d(s("layout.toast.defaultLocalSuccess"));return}try{let A=l.find(v=>v.id===w);if(!A)return;if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u({...A,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(s("layout.toast.defaultSuccess")),await y();}catch(A){console.error("Error setting default",A);let P=l.map(v=>({...v,isDefault:v.id===w}));m(P),g(P),d&&d(s("layout.toast.defaultLocalSuccess")),c&&c(s("layout.toast.backendUnavailableDefaultLocal"));}}})};var Ap=(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},rs=(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 Bp(e,t,o){return t[o]<e[o]?-1:t[o]>e[o]?1:0}function kb(e,t){return e==="desc"?(o,a)=>Bp(o,a,t):(o,a)=>-Bp(o,a,t)}function Sb(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 Qr=e=>{let t=mt.useCallback(O=>{let K=String(O?.label??O?.id??"").length*9+64,Ce=typeof O?.minWidth=="number"?O.minWidth:0;return Math.max(100,Ce,K)},[]),o=mt.useCallback(()=>(e.columns||[]).filter(O=>!!O?.numeric).map(O=>O.id),[e.columns]),[a,r]=mt.useState(""),[n,i]=mt.useState(e.order||"asc"),[c,d]=mt.useState(e.orderBy||""),[s,l]=mt.useState(e.page||0),[m,f]=mt.useState(e.rowsPerPage||20),[p,h]=mt.useState(e.selected||[]),[k,u]=mt.useState(e.columns?e.columns.map(O=>O.id):[]),[C,g]=mt.useState(e.showSummary||false),[y,b]=mt.useState(()=>o()),[S,E]=mt.useState([]),[D,w]=mt.useState(new Set),[A,P]=mt.useState(()=>{let O={};return (e.columns||[]).forEach(H=>{O[H.id]=t(H);}),O}),[v,M]=mt.useState(null),[T,R]=mt.useState(null),[I,$]=mt.useState(null),[N,X]=mt.useState(null),[se,J]=mt.useState(false),[ee,Z]=mt.useState(""),[Oe,Je]=mt.useState("");mt.useEffect(()=>{e.layout&&Ae(e.layout);},[e.layout]),mt.useEffect(()=>{e.order!==void 0&&i(e.order),e.orderBy!==void 0&&d(e.orderBy);},[e.order,e.orderBy]),mt.useEffect(()=>{e.selected!==void 0&&h(e.selected);},[e.selected]),mt.useEffect(()=>{e.page!==void 0&&l(e.page);},[e.page]),mt.useEffect(()=>{e.rowsPerPage!==void 0&&f(e.rowsPerPage);},[e.rowsPerPage]),mt.useEffect(()=>{let O=o();b(H=>H.filter(Ce=>O.includes(Ce)));},[o]),mt.useEffect(()=>{P(O=>{let H={...O};return (e.columns||[]).forEach(K=>{H[K.id]===void 0&&(H[K.id]=t(K));}),H});},[e.columns,t]);let Ke=mt.useMemo(()=>{let O=e.rows||[];return a&&(O=O.filter(H=>Object.keys(H).some(K=>String(H[K]).toLowerCase().includes(a.toLowerCase())))),O},[e.rows,a]),ae=mt.useMemo(()=>e.onSortChange||!c?Ke:Sb(Ke,kb(n,c)),[Ke,n,c,e.onSortChange]),Be=mt.useCallback(O=>{if(S.length===0)return O.map(Fe=>({type:"row",data:Fe,id:Fe[e.rowKey||"id"]}));let H=[...O].sort((Fe,fe)=>{for(let Ne of S){if(Fe[Ne]<fe[Ne])return -1;if(Fe[Ne]>fe[Ne])return 1}return 0}),K=(Fe,fe=0)=>{if(fe>=S.length)return Fe;let Ne=S[fe],Te={},Ve=[];return Fe.forEach(Ee=>{let we=Ee[Ne],Me=`${Ne}:${we}`;Te[Me]||(Te[Me]={key:Me,field:Ne,value:we,children:[],count:0,level:fe},Ve.push(Te[Me])),Te[Me].children.push(Ee),Te[Me].count++;}),Ve.forEach(Ee=>{Ee.children&&(Ee.children=K(Ee.children,fe+1));}),Ve},Ce=K(H),Se=(Fe,fe="")=>{let Ne=[];return Fe.forEach(Te=>{if(Te.children){let Ve=fe?`${fe}>${Te.key}`:Te.key,Ee=D.has(Ve);Ne.push({type:"group",id:Ve,field:Te.field,value:Te.value,level:Te.level,count:Te.count,isExpanded:Ee,childIds:(function we(Me){let $t=[];return Me.children.forEach(To=>{To.children?$t=$t.concat(we(To)):$t.push(To[e.rowKey||"id"]);}),$t})(Te)}),Ee&&(Ne=Ne.concat(Se(Te.children,Ve)));}else Ne.push({type:"row",data:Te,id:Te[e.rowKey||"id"],level:S.length});}),Ne};return Se(Ce)},[S,D,e.rowKey]),De=mt.useCallback(O=>{if(S.length===0)return [];let H=[...O].sort((Se,Fe)=>{for(let fe of S){if(Se[fe]<Fe[fe])return -1;if(Se[fe]>Fe[fe])return 1}return 0}),K=[],Ce=(Se,Fe,fe)=>{if(Fe>=S.length)return;let Ne=S[Fe],Te=new Map;Se.forEach(Ve=>{let Ee=Ve[Ne],we=Te.get(Ee);we?we.push(Ve):Te.set(Ee,[Ve]);}),Te.forEach((Ve,Ee)=>{let we=`${Ne}:${Ee}`,Me=fe?`${fe}>${we}`:we;K.push(Me),Ce(Ve,Fe+1,Me);});};return Ce(H,0,""),K},[S]),qe=mt.useMemo(()=>Be(ae),[ae,Be]),Le=mt.useMemo(()=>De(ae),[ae,De]),We=mt.useMemo(()=>{let O=(e.rows||[]).length;return typeof e.count=="number"&&e.count>O},[e.count,e.rows]),et=mt.useMemo(()=>We?qe:m>0?qe.slice(s*m,s*m+m):qe,[qe,s,m,We]),to=mt.useMemo(()=>We&&typeof e.count=="number"?e.count:qe.length,[qe.length,We,e.count]),Ft=O=>{w(H=>{let K=new Set(H);return K.has(O)?K.delete(O):K.add(O),K});},W=O=>{let H=Le.filter(K=>K===O||K.startsWith(`${O}>`));w(K=>{let Ce=new Set(K);return H.forEach(Se=>Ce.add(Se)),Ce});},le=O=>{w(H=>{let K=new Set(H);return Array.from(K).forEach(Ce=>{(Ce===O||Ce.startsWith(`${O}>`))&&K.delete(Ce);}),K});},be=O=>{if(!O){w(new Set);return}w(new Set(Le));},he=O=>{let H=Le.filter(K=>K.startsWith(`${O}>`));return H.length===0?D.has(O):D.has(O)&&H.every(K=>D.has(K))},V=O=>{let H=c===O&&n==="asc",K=c===O&&n==="desc";if(e.onSortChange){H?e.onSortChange(O,"desc"):K?e.onSortChange("","asc"):e.onSortChange(O,"asc");return}H?(i("desc"),d(O)):K?(i("asc"),d("")):(i("asc"),d(O));},ce=(O,H)=>{P(K=>({...K,[O]:H}));},te=O=>{if(O.target.checked){let H=Ke.map(K=>K[e.rowKey||"id"]);h(H),e.onSelectionChange&&e.onSelectionChange(H);return}h([]),e.onSelectionChange&&e.onSelectionChange([]);},de=(O,H)=>{let K=H[e.rowKey||"id"],Ce=p.indexOf(K),Se=[];Ce===-1?Se=Se.concat(p,K):Ce===0?Se=Se.concat(p.slice(1)):Ce===p.length-1?Se=Se.concat(p.slice(0,-1)):Ce>0&&(Se=Se.concat(p.slice(0,Ce),p.slice(Ce+1))),h(Se),e.onSelectionChange&&e.onSelectionChange(Se);},xe=O=>{l(O),e.onPageChange&&e.onPageChange(O);},ve=O=>{f(O),l(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(O);},ft=O=>{let H=k.indexOf(O),K=[...k];H===-1?K.push(O):K.splice(H,1),u(K);},tt=O=>{let H=S.indexOf(O),K=[...S];H===-1?K.push(O):K.splice(H,1),E(K);},Lt=O=>{o().includes(O)&&b(K=>K.includes(O)?K.filter(Ce=>Ce!==O):[...K,O]);},jt=O=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:k,order:n,orderBy:c,grouping:S,columnWidths:A,showSummary:C,summaryColumns:y});},Zt=O=>{let{layout:H,layoutId:K}=rs(O,e.tableKey||"default");K?(Je(K),Z(K)):(Je(""),Z("")),H&&(H.visibleColumns&&u(H.visibleColumns),H.order&&i(H.order),H.orderBy&&d(H.orderBy),H.grouping&&E(H.grouping),H.columnWidths&&P(H.columnWidths),H.showSummary!==void 0&&g(!!H.showSummary),Array.isArray(H.summaryColumns)&&b(H.summaryColumns));},Ae=O=>{let H=O?.layoutData||O?.layout||O||{};H.visibleColumns&&u(H.visibleColumns),H.order&&i(H.order),H.orderBy!==void 0&&d(H.orderBy),H.grouping&&E(H.grouping),H.columnWidths&&P(H.columnWidths),H.showSummary!==void 0&&g(!!H.showSummary),Array.isArray(H.summaryColumns)&&b(H.summaryColumns),w(new Set),l(0),O?.id&&Z(O.id),Je("");};mt.useEffect(()=>{e.layout&&Zt({layout:e.layout});},[e.layout]);let ye=O=>{O.preventDefault(),X(N===null?{mouseX:O.clientX+2,mouseY:O.clientY-6}:null);},St=()=>{X(null);},ze=mt.useMemo(()=>{if(!C)return {};let O={};e.columns.forEach(K=>{if(K.numeric&&y.includes(K.id)){let Ce=Ke.reduce((Se,Fe)=>{let fe=parseFloat(Fe[K.id]);return Se+(isNaN(fe)?0:fe)},0);O[K.id]=Ce.toFixed(2);}else O[K.id]="";});let H=e.columns.find(K=>k.includes(K.id));return H&&!H.numeric&&(O[H.id]="Total"),O},[Ke,e.columns,C,y,k]),Wt=()=>{if(!e.columns||!Ke)return;let O=e.columns.map(Fe=>Fe.label).join(","),H=Ke.map(Fe=>e.columns.map(fe=>{let Ne=Fe[fe.id];return `"${(Ne==null?"":String(Ne)).replace(/"/g,'""')}"`}).join(",")).join(`
184
- `),K=`data:text/csv;charset=utf-8,${O}
185
- ${H}`,Ce=encodeURI(K),Se=document.createElement("a");Se.setAttribute("href",Ce),Se.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(Se),Se.click(),document.body.removeChild(Se);},wo=()=>{J(true);},_a=()=>{J(false);};return {isMobile:false,columns:e.columns,order:n,orderBy:c,filterText:a,setFilterText:r,visibleColumns:k,setVisibleColumns:u,showSummary:C,setShowSummary:g,summaryColumns:y,grouping:S,setGrouping:E,expandedGroups:D,setExpandedGroups:w,groupAnchorEl:T,setGroupAnchorEl:R,summaryAnchorEl:I,setSummaryAnchorEl:$,columnWidths:A,setColumnWidths:P,anchorEl:v,setAnchorEl:M,contextMenu:N,setContextMenu:X,sensors:void 0,sortedAndFilteredRows:ae,visibleRows:et,summaryRow:ze,page:s,setPage:xe,rowsPerPage:m,setRowsPerPage:ve,totalDisplayCount:to,selected:p,setSelected:h,isAllExpanded:Le.length>0&&Le.every(O=>D.has(O)),handleColumnResize:ce,handleRequestSort:V,handleSelectAllClick:te,handleClick:de,toggleSummaryColumn:Lt,handleDragEnd:()=>{},handleExport:Wt,handleContextMenu:ye,handleCloseContextMenu:St,toggleColumnVisibility:ft,toggleGroupExpand:Ft,toggleGroupField:tt,handleToggleAll:be,handleExpandGroupRecursively:W,handleCollapseGroupRecursively:le,isGroupFullyExpanded:he,handleLayoutLoad:Ae,handleVariantLoad:Zt,handleLayoutSave:jt,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:k,order:n,orderBy:c,grouping:S,columnWidths:A,showSummary:C,summaryColumns:y},currentLayoutId:ee,layoutIdToLoad:Oe,onPageChange:xe,onRowsPerPageChange:ve,graphReportOpen:se,handleOpenGraphReport:wo,handleCloseGraphReport:_a}};var _D=e=>jsxRuntime.jsx(Ib__default.default,{...e}),jD=e=>jsxRuntime.jsx(Tl__default.default,{...e}),ZD=e=>jsxRuntime.jsx(Op__default.default,{...e}),XD=e=>jsxRuntime.jsx(Zf__default.default,{...e}),QD=e=>jsxRuntime.jsx(Xf__default.default,{...e}),Fa=e=>{let{t}=j(),o="0.85rem",{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:s,fitContainer:l=false,fullWidth:m=false,maxHeight:f,loading:p=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:k,filterConfig:u,rowKey:C,tableKey:g="default",graphReport:y,quickCreate:b,quickEdit:S,quickDelete:E,serviceUrl:D}=e,w=a||t("table.title.default"),{isMobile:A,columns:P,order:v,orderBy:M,filterText:T,setFilterText:R,visibleColumns:I,showSummary:$,setShowSummary:N,summaryColumns:X,grouping:se,setGrouping:J,expandedGroups:ee,groupAnchorEl:Z,setGroupAnchorEl:Oe,summaryAnchorEl:Je,setSummaryAnchorEl:Ke,columnWidths:ae,anchorEl:Be,setAnchorEl:De,contextMenu:qe,sensors:Le,sortedAndFilteredRows:We,summaryRow:et,visibleRows:to,isAllExpanded:Ft,page:W,setPage:le,rowsPerPage:be,setRowsPerPage:he,totalDisplayCount:V,setSelected:ce,handleColumnResize:te,handleRequestSort:de,handleSelectAllClick:xe,handleClick:ve,toggleSummaryColumn:ft,handleDragEnd:tt,handleExport:Lt,handleContextMenu:jt,handleCloseContextMenu:Zt,toggleColumnVisibility:Ae,toggleGroupExpand:ye,toggleGroupField:St,handleToggleAll:ze,handleExpandGroupRecursively:Wt,handleCollapseGroupRecursively:wo,isGroupFullyExpanded:_a,handleLayoutLoad:O,handleVariantLoad:H,handleLayoutSave:K,effectiveAppId:Ce,currentLayoutData:Se,currentLayoutId:Fe,layoutIdToLoad:fe,graphReportOpen:Ne,handleOpenGraphReport:Te,handleCloseGraphReport:Ve}=Qr(e),Ee=y?.enabled??false,we=Ee&&(y?.interaction?.enabled??true),Me=_i(),$t=!!b?.enabled,To=!!S?.enabled,xt=!!E?.enabled,wt=b?.fields,ho=b?.excludeFields||[],Ca=b?.initialValues||{},[Pr,Io]=mt__namespace.default.useState(false),[oo,ja]=mt__namespace.default.useState(false),[Qo,Ht]=mt__namespace.default.useState({}),[ao,zt]=mt__namespace.default.useState(false),[$e,Yo]=mt__namespace.default.useState(false),[Wo,Jo]=mt__namespace.default.useState({}),[Za,$o]=mt__namespace.default.useState(false),[Xa,Qa]=mt__namespace.default.useState(false),Ho=p||oo||$e||Xa,ea=mt__namespace.default.useMemo(()=>{let L=[...P];if(Array.isArray(wt)&&wt.length>0){let _=new Set(wt);L=L.filter(q=>_.has(q.id));}if(ho.length>0){let _=new Set(ho);L=L.filter(q=>!_.has(q.id));}return L.filter(_=>!!_?.id)},[P,ho,wt]),ka=C||"id",Gt=mt__namespace.default.useMemo(()=>{let L=new Set(i);return We.filter(_=>L.has(_?.[ka]))},[i,We,ka]),Po=Gt.length===1?Gt[0]:null,ta=S?.fields,yo=S?.excludeFields||[],Go=S?.editableFields||[],Ya=S?.nonEditableFields||[],Rr=S?.primaryKeys?.length?S.primaryKeys:[ka],Sa=mt__namespace.default.useMemo(()=>{let L=[...P];if(Array.isArray(ta)&&ta.length>0){let _=new Set(ta);L=L.filter(q=>_.has(q.id));}if(yo.length>0){let _=new Set(yo);L=L.filter(q=>!_.has(q.id));}return L.filter(_=>!!_?.id)},[P,yo,ta]),Ja=mt__namespace.default.useMemo(()=>new Set(Rr),[Rr]),oa=mt__namespace.default.useMemo(()=>new Set(Go),[Go]),Xt=mt__namespace.default.useMemo(()=>new Set(Ya),[Ya]),Ro=mt__namespace.default.useCallback(L=>oa.size>0?oa.has(L):!(Xt.has(L)||Ja.has(L)),[oa,Xt,Ja]);mt__namespace.default.useEffect(()=>{!Ne&&Me.hasActiveFilters&&Me.clearAll();},[Ne,Me.hasActiveFilters,Me.clearAll]);let Dr=()=>{let L={};ea.forEach(_=>{L[_.id]=Ca[_.id]??"";}),Ht(L),Io(true);},er=()=>{oo||Io(false);},Mr=(L,_)=>{Ht(q=>({...q,[L]:_}));},Ar=async()=>{if(!b?.onSubmit){Io(false);return}try{ja(!0),await b.onSubmit(Qo),Io(!1);}finally{ja(false);}},Br=()=>{if(!Po)return;let L={};Sa.forEach(q=>{L[q.id]=Po[q.id]??"";});let _=S?.getInitialValues?{...L,...S.getInitialValues(Po)}:L;Jo(_),zt(true);},ro=()=>{$e||zt(false);},Er=(L,_)=>{Jo(q=>({...q,[L]:_}));},Fr=async()=>{if(Po){if(!S?.onSubmit){zt(false);return}try{Yo(!0),await S.onSubmit(Wo,Po),zt(!1);}finally{Yo(false);}}},tr=()=>{Gt.length!==0&&$o(true);},aa=()=>{Xa||$o(false);},wa=async()=>{if(Gt.length===0){$o(false);return}if(!E?.onConfirm){$o(false),ce([]),c?.([]);return}try{Qa(!0),await E.onConfirm(Gt),$o(!1),ce([]),c?.([]);}finally{Qa(false);}},Ta=We,{fieldMapping:x}=_r({rows:Ta,config:{...y,title:y?.title||`${w} ${t("graph.reportTitle")}`}}),B=mt__namespace.default.useMemo(()=>we?Me.applyRows(Ta,x):Ta,[we,Me.applyRows,Ta,x]),{model:F}=_r({rows:B,config:{...y,title:y?.title||`${w} ${t("graph.reportTitle")}`,fieldMapping:x}}),G=F.table.columns.map(L=>({id:L.id,label:L.label,align:L.align||"left",minWidth:120,numeric:L.align==="right"})),Y=Ce?jsxRuntime.jsx(as,{appId:Ce,tableKey:g,currentLayoutData:Se,onLayoutLoad:O,targetLayoutId:fe,activeLayoutId:Fe,serviceUrl:D??u?.serviceUrl}):null,ge=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(zr,{groupAnchorEl:Z,setGroupAnchorEl:Oe,grouping:se,setGrouping:J,columns:P,toggleGroupField:St}),jsxRuntime.jsx(Nr,{anchorEl:Be,setAnchorEl:De,columns:P,visibleColumns:I,toggleColumnVisibility:Ae}),jsxRuntime.jsx(Ri,{anchorEl:Je,setAnchorEl:Ke,showSummary:$,setShowSummary:N,columns:P,summaryColumns:X,toggleSummaryColumn:ft}),jsxRuntime.jsx(Di,{contextMenu:qe,handleCloseContextMenu:Zt,columns:P,visibleColumns:I,toggleColumnVisibility:Ae})]});return A?jsxRuntime.jsxs(Gn__default.default,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[u&&jsxRuntime.jsx(la,{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:g,currentLayout:[{tableKey:g,layoutData:Se}],variantService:u.variantService,serviceUrl:D??u.serviceUrl}),jsxRuntime.jsx(Ld,{title:w,loading:p,showSummary:$,setShowSummary:N,setAnchorEl:De,setSummaryAnchorEl:Ke,filterText:T,setFilterText:R,sortedAndFilteredRows:We,selected:i,columns:P,visibleColumns:I,summaryRow:et,handleClick:ve,selectionMode:n}),ge]}):jsxRuntime.jsxs(Gn__default.default,{sx:{width:m?"100%":"auto",mb:l?0:2,...l?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[u&&jsxRuntime.jsx(Gn__default.default,{sx:{mb:2},children:jsxRuntime.jsx(la,{fields:u.fields,filters:u.filters,onFilterChange:u.onFilterChange,onSearch:u.onSearch,variants:u.variants||[],currentVariantId:u.currentVariantId,onVariantLoad:L=>{H(L),u.onVariantLoad&&u.onVariantLoad(L);},onVariantSave:u.onVariantSave,onVariantDelete:u.onVariantDelete,onVariantSetDefault:u.onVariantSetDefault,loading:p,appId:u.appId,tableKey:g,currentLayout:[{tableKey:g,layoutData:Se}],currentLayoutId:Fe,layoutRefs:[{tableKey:g,layoutId:Fe}],variantService:u.variantService,serviceUrl:D??u.serviceUrl})}),jsxRuntime.jsxs(wb__default.default,{sx:{width:m?"100%":"auto",mb:l?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":Ho?{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}:l?{flex:1,minHeight:0,height:"100%"}:{}},children:[r&&jsxRuntime.jsx(Si,{filterText:T,setFilterText:R,onRowsPerPageChange:he,rowsPerPage:be,rowsPerPageOptions:h,page:W,count:V,onPageChange:le,actions:d,extraTools:s,grouping:se,setGroupAnchorEl:Oe,showSummary:$,setShowSummary:N,setAnchorEl:De,setSummaryAnchorEl:Ke,handleExport:Lt,showCreateButton:$t,onOpenCreateDialog:Dr,showEditButton:To,onOpenEditDialog:Br,editDisabled:Gt.length!==1,showDeleteButton:xt,onOpenDeleteConfirm:tr,deleteDisabled:Gt.length===0,onLayoutSave:k||u?.variantService&&u?.appId?K:void 0,loading:p,layoutManager:Y,onOpenGraphReport:Ee?Te:void 0}),jsxRuntime.jsx(Op__default.default,{sx:{flex:1,...f?{maxHeight:f,height:f}:l?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:jsxRuntime.jsx(core.DndContext,{sensors:Le,collisionDetection:core.closestCenter,onDragEnd:tt,modifiers:[modifiers.restrictToHorizontalAxis],children:jsxRuntime.jsxs(Tb__default.default,{sx:{minWidth:m?750:"auto",width:m?"100%":"auto",tableLayout:Object.keys(ae).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,"& .MuiTableCell-root":{fontSize:o}},"aria-labelledby":"tableTitle",size:"small",stickyHeader:true,children:[jsxRuntime.jsx(wi,{columns:P,visibleColumns:I,order:v,orderBy:M,onRequestSort:de,onContextMenu:jt,selectionMode:n,grouping:se,isAllExpanded:Ft,handleToggleAll:ze,rowCount:We.length,numSelected:i.length,onSelectAllClick:xe,columnWidths:ae,onColumnResize:te}),jsxRuntime.jsx(Bd,{visibleRows:to,columns:P,visibleColumns:I,selectionMode:n,selected:i,orderBy:M,loading:p,expandedGroups:ee,toggleGroupExpand:ye,handleExpandGroupRecursively:Wt,handleCollapseGroupRecursively:wo,isGroupFullyExpanded:_a,handleClick:ve,onSelectionChange:c,grouping:se,rowKeyProp:C,page:W,rowsPerPage:be}),$&&jsxRuntime.jsx(Ed,{showSummary:$,columns:P,visibleColumns:I,summaryRow:et,selectionMode:n?.toString(),grouping:se,orderBy:M,zIndex:3})]})})})]}),$t&&jsxRuntime.jsxs(Ep__default.default,{open:Pr,onClose:er,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:L=>`1px solid ${L.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(Fp__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:b?.title||t("quickCreate.createWithTitle",{title:w})}),jsxRuntime.jsx(Lp__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(Gn__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[ea.map(L=>{let _=L.type==="number"||L.numeric?"number":L.type==="date"?"date":"text",q=L.label||L.id;return jsxRuntime.jsx(Np__default.default,{label:q,value:Qo[L.id]??"",onChange:Xe=>Mr(L.id,Xe.target.value),type:_,size:"small",fullWidth:true,InputLabelProps:{shrink:_==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${L.id}`)}),b?.description&&jsxRuntime.jsx(Vp__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:b.description})]})}),jsxRuntime.jsxs(zp__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(is__default.default,{onClick:er,sx:{fontSize:"0.85rem"},disabled:oo,children:b?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(is__default.default,{onClick:Ar,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:oo,children:b?.submitLabel||t("common.save")})]})]}),To&&jsxRuntime.jsxs(Ep__default.default,{open:ao,onClose:ro,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:L=>`1px solid ${L.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(Fp__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:S?.title||t("quickEdit.editWithTitle",{title:w})}),jsxRuntime.jsx(Lp__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(Gn__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Sa.map(L=>{let _=L.type==="number"||L.numeric?"number":L.type==="date"?"date":"text",q=L.label||L.id,Xe=Ro(L.id);return jsxRuntime.jsx(Np__default.default,{label:q,value:Wo[L.id]??"",onChange:z=>Er(L.id,z.target.value),type:_,size:"small",fullWidth:true,disabled:!Xe,InputLabelProps:{shrink:_==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${L.id}`)}),S?.description&&jsxRuntime.jsx(Vp__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:S.description})]})}),jsxRuntime.jsxs(zp__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(is__default.default,{onClick:ro,sx:{fontSize:"0.85rem"},disabled:$e,children:S?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(is__default.default,{onClick:Fr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:$e||!Po,children:S?.submitLabel||t("common.save")})]})]}),xt&&jsxRuntime.jsx(Pn,{open:Za,type:"warning",title:E?.title||t("quickDelete.confirmTitle"),message:E?.message||(Gt.length>1?t("quickDelete.confirmMessageMultiple",{count:Gt.length}):t("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||t("common.delete"),cancelText:E?.cancelText||t("common.cancel"),onClose:aa,onConfirm:wa}),ge,Ee&&jsxRuntime.jsx(Ki,{open:Ne,onClose:Ve,model:F,aiAssistant:y?.aiAssistant,interaction:we?{enabled:true,filters:Me.filters,fieldMapping:x,onPrimaryDimensionClick:L=>Me.setFilter("primaryDimension",L),onSecondaryDimensionClick:L=>Me.setFilter("secondaryDimension",L),onStatusClick:L=>Me.setFilter("status",L),onClearFilter:Me.clearFilter,onClearAll:Me.clearAll}:void 0,tableContent:jsxRuntime.jsx(Fa,{appId:Ce||"graph-report-internal",title:t("graph.dataBody"),columns:G,rows:F.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},YD=Fa;var nM=({id:e,title:t,hideHeader:o=true,filterConfig:a,tableProps:r,children:n,spacing:i=1,mode:c="separated"})=>{let d=a?{...a,appId:a.appId||e}:void 0,s={...r,appId:r.appId||e};return jsxRuntime.jsxs(Id,{title:t,hideHeader:o,children:[jsxRuntime.jsxs(material.Stack,{spacing:i,sx:{height:"100%",overflow:"hidden"},children:[c==="separated"&&d&&jsxRuntime.jsx(material.Box,{sx:{flexShrink:0},children:jsxRuntime.jsx(la,{...d})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsx(Fa,{...s,fitContainer:true,filterConfig:c==="integrated"?d:void 0})})]}),n]})};var pM=({metadata:e,fetchData:t,initialRowsPerPage:o=20,rowsPerPageOptions:a=[20,50,100,-1],tableKey:r="default",mode:n="integrated",serviceUrl:i,variantService:c})=>{let{t:d}=j(),[s,l]=mt.useState(false),[m,f]=mt.useState([]),[p,h]=mt.useState({}),[k,u]=mt.useState(e.variants||[]),[C,g]=mt.useState(e.layout||null),[y,b]=mt.useState(""),[S,E]=mt.useState(0),[D,w]=mt.useState(0),[A,P]=mt.useState(o),[v,M]=mt.useState([]),[T,R]=mt.useState("asc"),[I,$]=mt.useState("");mt.useEffect(()=>{let ae={};e.filters.forEach(Be=>{Be.defaultValue!==void 0&&(ae[Be.id]=Be.defaultValue);}),h(ae);},[e.filters]);let N=mt.useCallback(async(ae,Be,De,qe,Le)=>{l(true);try{let We={...ae,page:Be+1,limit:De,sort:Le,order:qe},et;t?et=await t(We):typeof e.api=="function"?et=await e.api(We):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,We),et={rows:[],total:0}):(console.warn("No API configured for report"),et={rows:[],total:0}),et&&(f(et.rows||[]),E(et.total||0));}catch(We){console.error("Failed to fetch report data",We);}finally{l(false);}},[e.api,t]);mt.useEffect(()=>{N(p,D,A,T,I);},[N,D,A,T,I]);let X=()=>{w(0),N(p,0,A,T,I);},se=ae=>{w(0),P(ae);},J=(ae,Be)=>{R(Be),$(ae);},ee=ae=>{h(ae);},Z=ae=>{b(ae?.id||"");let Be=Ap(ae,r);if(Be){let qe=Be.values??Be;h(qe),N(qe,0,A,T,I),w(0);}let{layout:De}=rs(ae,r);De&&g(De);},Oe=ae=>{let Be={...ae,id:Date.now().toString(),createdAt:new Date().toISOString()};u(De=>[...De,Be]);},Je=ae=>{g(ae);};return {pageProps:{id:e.id,title:e.title,mode:n,filterConfig:{appId:e.id,tableKey:r,fields:e.filters,filters:p,onFilterChange:ee,onSearch:X,onVariantLoad:Z,onVariantSave:Oe,onVariantDelete:ae=>u(Be=>Be.filter(De=>De.id!==ae)),onVariantSetDefault:ae=>{u(Be=>Be.map(De=>({...De,isDefault:De.id===ae})));},variants:k,currentVariantId:y,variantService:c,serviceUrl:i},tableProps:{appId:e.id,tableKey:r,columns:e.columns,rows:m,loading:s,rowKey:"id",count:S,page:D,rowsPerPage:A,rowsPerPageOptions:a,onPageChange:w,onRowsPerPageChange:se,selectionMode:"multiple",selected:v,onSelectionChange:M,onLayoutSave:Je,layout:C,title:e.title,showSummary:true,order:T,orderBy:I,serviceUrl:i,onSortChange:J,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${d("graph.reportTitle")}`}}},filters:p,rows:m,loading:s,refresh:X}};var zb=e=>[...e].sort((t,o)=>o.value-t.value),gM=({bars:e=[],lines:t=[],combos:o=[],heatmap:a=[],pies:r=[],waterfalls:n=[]})=>{let i=mt.useMemo(()=>zb(e),[e]),c=mt.useMemo(()=>[...t],[t]),d=mt.useMemo(()=>[...o],[o]),s=mt.useMemo(()=>[...a],[a]),l=mt.useMemo(()=>{let f=r.reduce((p,h)=>p+h.value,0);return r.map(p=>({...p,percent:f>0?p.value/f*100:p.percent}))},[r]),m=mt.useMemo(()=>[...n],[n]);return {bars:i,lines:c,combos:d,heatmap:s,pies:l,waterfalls:m}};var xM=({apiKey:e,query:t,zoom:o=14,mapType:a="roadmap"})=>mt.useMemo(()=>!e||!t?"":Ln({apiKey:e,query:t,zoom:o,mapType:a}),[e,t,o,a]),vM=({keyword:e,location:t})=>mt.useMemo(()=>Wi({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var Un=({code:e,language:t="text",copyable:o=true,showLineNumbers:a=false,wrapLongLines:r=false,maxHeight:n})=>{let[i,c]=mt.useState(false),d=mt.useMemo(()=>e.replace(/\n$/,"").split(`
186
- `),[e]);return jsxRuntime.jsxs(material.Box,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",bgcolor:"background.paper"},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.6,bgcolor:"action.hover",borderBottom:"1px solid",borderColor:"divider"},children:[jsxRuntime.jsx(material.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&&jsxRuntime.jsx(material.Tooltip,{title:i?"Copied":"Copy",children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:async()=>{try{await navigator.clipboard.writeText(e),c(!0),window.setTimeout(()=>c(!1),1400);}catch{c(false);}},children:i?jsxRuntime.jsx(Gb__default.default,{fontSize:"inherit"}):jsxRuntime.jsx(Hb__default.default,{fontSize:"inherit"})})})]}),jsxRuntime.jsx(material.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?d.map((l,m)=>jsxRuntime.jsxs(material.Box,{sx:{display:"flex"},children:[jsxRuntime.jsx(material.Box,{component:"span",sx:{width:34,flexShrink:0,textAlign:"right",pr:1,color:"text.disabled",userSelect:"none"},children:m+1}),jsxRuntime.jsx(material.Box,{component:"span",sx:{whiteSpace:r?"pre-wrap":"pre",wordBreak:r?"break-word":"normal"},children:l})]},`${m}-${l}`)):jsxRuntime.jsx(material.Box,{component:"code",sx:{display:"block",whiteSpace:r?"pre-wrap":"pre",wordBreak:r?"break-word":"normal"},children:e})})]})};var jb=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},Zb=async e=>new Function("m","return import(m)")(e),Kn=({expression:e,inline:t=false,allowKatex:o=false})=>{let a=mt.useMemo(()=>jb(e),[e]),[r,n]=mt.useState("");return mt.useEffect(()=>{let i=true;return (async()=>{if(!o||!a){n("");return}try{let d=await Zb("katex"),l=(d?.default||d)?.renderToString?.(a,{displayMode:!t,throwOnError:!1,strict:"warn"});i&&typeof l=="string"&&n(l);}catch{i&&n("");}})(),()=>{i=false;}},[o,a,t]),a?r?jsxRuntime.jsx(material.Box,{component:t?"span":"div",sx:{display:t?"inline-flex":"block",my:t?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:r}}):t?jsxRuntime.jsx(material.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}):jsxRuntime.jsx(material.Box,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:jsxRuntime.jsx(material.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 ox=async e=>new Function("m","return import(m)")(e),Jl=({code:e,title:t="Mermaid Diagram",height:o=320,enabled:a=true})=>{let[r,n]=mt.useState(""),[i,c]=mt.useState(""),[d,s]=mt.useState(false),l=mt.useMemo(()=>e.trim(),[e]);return mt.useEffect(()=>{let m=true;return (async()=>{if(!a||!l){n(""),c("");return}s(true),c(""),n("");try{let p=await ox("mermaid"),h=p?.default||p;if(!h||typeof h.render!="function")throw new Error("Mermaid runtime is not available");h.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let k=await h.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,l),u=typeof k=="string"?k:k?.svg;m&&typeof u=="string"&&n(u);}catch(p){if(m){let h=p instanceof Error?p.message:"Failed to render Mermaid diagram";c(h);}}finally{m&&s(false);}})(),()=>{m=false;}},[a,l]),jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[jsxRuntime.jsx(material.Box,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:t})}),jsxRuntime.jsxs(material.Box,{sx:{p:1},children:[d&&jsxRuntime.jsx(material.Box,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(material.CircularProgress,{size:20})}),!d&&r&&jsxRuntime.jsx(material.Box,{sx:{maxHeight:o,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:r}}),!d&&!r&&jsxRuntime.jsxs(material.Box,{children:[i&&jsxRuntime.jsx(material.Alert,{severity:"info",sx:{mb:1},children:i}),jsxRuntime.jsx(Un,{code:l,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var ec=e=>e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),dx=e=>/^:?-{3,}:?$/.test(e.trim()),px=e=>{let t=e.trim(),o=t.startsWith(":"),a=t.endsWith(":");return o&&a?"center":a?"right":"left"},cs=e=>{let t=e.split(`
187
- `).map(i=>i.trim()).filter(Boolean);if(t.length<2)return null;let o=ec(t[0]),a=ec(t[1]);if(o.length===0||a.length!==o.length||!a.every(dx))return null;let r=a.map(px),n=t.slice(2).filter(i=>i.includes("|")).map(i=>{let c=ec(i);return c.length<o.length?[...c,...Array.from({length:o.length-c.length},()=>"")]:c.slice(0,o.length)});return {headers:o,aligns:r,rows:n}},tc=({markdown:e,table:t,maxHeight:o=360})=>{let a=mt.useMemo(()=>t||(e?cs(e):null),[t,e]);return !a||a.headers.length===0?jsxRuntime.jsx(material.Paper,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):jsxRuntime.jsx(material.Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:o},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsx(material.TableRow,{children:a.headers.map((r,n)=>jsxRuntime.jsx(material.TableCell,{align:a.aligns[n],sx:{fontWeight:700,bgcolor:"background.paper"},children:r},`${r}-${n}`))})}),jsxRuntime.jsx(material.TableBody,{children:a.rows.map((r,n)=>jsxRuntime.jsx(material.TableRow,{hover:true,children:r.map((i,c)=>jsxRuntime.jsx(material.TableCell,{align:a.aligns[c],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i||jsxRuntime.jsx(material.Box,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${n}-${c}`))},`row-${n}`))})]})})})};var ps=({content:e,title:t="Thinking",defaultExpanded:o=false,isStreaming:a=false})=>{let[r,n]=mt.useState(o);return jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.6,children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>n(i=>!i),sx:{transform:r?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:jsxRuntime.jsx(bx__default.default,{fontSize:"inherit"})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[t,a?" ...":""]})]}),jsxRuntime.jsx(material.Collapse,{in:r,children:jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:e})})]})};var ac=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,us=e=>e.trim().startsWith("```"),Zp=e=>/^#{1,6}\s+/.test(e.trim()),rc=e=>/^[-*+]\s+/.test(e.trim()),nc=e=>/^\d+\.\s+/.test(e.trim()),Xp=e=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(e.trim()),ic=e=>e.trim().startsWith(">"),Qp=(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())},Yp=e=>e.trim().startsWith("<think>")||e.trim()===":::think",jn=(e,t,o)=>{let a=[],r=0,n=0;ac.lastIndex=0;let i=ac.exec(e);for(;i;){i.index>r&&a.push(e.slice(r,i.index));let c=i[0],d=`${o}-${n}`;if(c.startsWith("**")&&c.endsWith("**"))a.push(jsxRuntime.jsx("strong",{children:c.slice(2,-2)},d));else if(c.startsWith("*")&&c.endsWith("*"))a.push(jsxRuntime.jsx("em",{children:c.slice(1,-1)},d));else if(c.startsWith("`")&&c.endsWith("`"))a.push(jsxRuntime.jsx(material.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:c.slice(1,-1)},d));else if(c.startsWith("[")&&c.includes("](")&&c.endsWith(")")){let s=c.match(/^\[([^\]]+)\]\(([^)]+)\)$/);s?a.push(jsxRuntime.jsx(material.Link,{href:s[2],target:"_blank",rel:"noreferrer",underline:"hover",children:s[1]},d)):a.push(c);}else c.startsWith("$")&&c.endsWith("$")&&t.enableMath?a.push(jsxRuntime.jsx(Kn,{expression:c,inline:true,allowKatex:true},d)):a.push(c);r=i.index+c.length,n+=1,i=ac.exec(e);}return r<e.length&&a.push(e.slice(r)),a.length>0?a:[e]},Zn=({markdown:e,content:t,className:o,enableMath:a=true,enableMermaid:r=true,enableThinkBlock:n=true,codeCopyable:i=true,codeLineNumbers:c=false})=>{let d=e??t??"",s=mt.useMemo(()=>{let l=[],m=d.replace(/\r\n/g,`
183
+ `;return ht.useEffect(()=>{let d=n.current;if(!d)return;let l=new ogl.Renderer({alpha:true,premultipliedAlpha:false}),s=l.gl;s.clearColor(0,0,0,0),d.appendChild(s.canvas);let g=new ogl.Triangle(s),f=new ogl.Program(s,{vertex:i,fragment:c,uniforms:{iTime:{value:0},iResolution:{value:new ogl.Vec3(s.canvas.width,s.canvas.height,s.canvas.width/s.canvas.height)},hue:{value:e},hover:{value:0},rot:{value:0},hoverIntensity:{value:t},backgroundColor:{value:zm(r)}}}),u=new ogl.Mesh(s,{geometry:g,program:f});function h(){if(!d)return;let R=window.devicePixelRatio||1,w=d.clientWidth,A=d.clientHeight;l.setSize(w*R,A*R),s.canvas.style.width=w+"px",s.canvas.style.height=A+"px",f.uniforms.iResolution.value.set(s.canvas.width,s.canvas.height,s.canvas.width/s.canvas.height);}window.addEventListener("resize",h),h();let v=0,p=0,C=0,m=.3,y=R=>{let w=d.getBoundingClientRect(),A=R.clientX-w.left,P=R.clientY-w.top,k=w.width,D=w.height,T=Math.min(k,D),I=k/2,M=D/2,H=(A-I)/T*2,V=(P-M)/T*2;Math.sqrt(H*H+V*V)<.8?v=1:v=0;},x=()=>{v=0;};d.addEventListener("mousemove",y),d.addEventListener("mouseleave",x);let S,B=R=>{S=requestAnimationFrame(B);let w=(R-p)*.001;p=R,f.uniforms.iTime.value=R*.001,f.uniforms.hue.value=e,f.uniforms.hoverIntensity.value=t,f.uniforms.backgroundColor.value=zm(r);let A=a?1:v;f.uniforms.hover.value+=(A-f.uniforms.hover.value)*.1,o&&A>.5&&(C+=w*m),f.uniforms.rot.value=C,l.render({scene:u});};return S=requestAnimationFrame(B),()=>{cancelAnimationFrame(S),window.removeEventListener("resize",h),d.removeEventListener("mousemove",y),d.removeEventListener("mouseleave",x),s.canvas.parentNode===d&&d.removeChild(s.canvas),s.getExtension("WEBGL_lose_context")?.loseContext();}},[e,t,o,a,r]),jsxRuntime.jsx("div",{ref:n,className:"w-full h-full"})}function Ck(e,t,o){let a,r,n;if(t===0)a=r=n=o;else {let i=(l,s,g)=>(g<0&&(g+=1),g>1&&(g-=1),g<.16666666666666666?l+(s-l)*6*g:g<.5?s:g<.6666666666666666?l+(s-l)*(.6666666666666666-g)*6:l),c=o<.5?o*(1+t):o+t-o*t,d=2*o-c;a=i(d,c,e+1/3),r=i(d,c,e),n=i(d,c,e-1/3);}return new ogl.Vec3(a,r,n)}function zm(e){if(e==="transparent")return new ogl.Vec3(0,0,0);if(e.startsWith("#")){let a=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255;return new ogl.Vec3(a,r,n)}let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(t)return new ogl.Vec3(parseInt(t[1])/255,parseInt(t[2])/255,parseInt(t[3])/255);let o=e.match(/hsla?\((\d+),\s*(\d+)%,\s*(\d+)%/);if(o){let a=parseInt(o[1])/360,r=parseInt(o[2])/100,n=parseInt(o[3])/100;return Ck(a,r,n)}return new ogl.Vec3(0,0,0)}var Vm=Og(()=>{"use client";});function vo(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var fl={primary:"#000000",primaryHover:"#333333"},ki={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"},In={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},md=()=>"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 Kg=classVarianceAuthority.cva(md(),{variants:{variant:{default:`${ki.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:`${ki.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:ki.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-[${fl.primary}] hover:bg-[${fl.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:In.none,sm:In.sm,md:In.md,full:In.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),hl=ht__namespace.forwardRef(({className:e,variant:t,size:o,asChild:a=false,...r},n)=>jsxRuntime.jsx(a?reactSlot.Slot:"button",{className:vo(Kg({variant:t,size:o,className:e})),ref:n,...r}));hl.displayName="Button";var _g={"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"},jg={"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"},Zg={"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"},Xg={"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"},Qg={"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"},Yg={"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"},Pn={en:_g,zh:jg,fr:Zg,de:Xg,ja:Qg,ko:Yg};var fd=(e,t)=>t?e.replace(/\{(\w+)\}/g,(o,a)=>{let r=t[a];return r==null?"":String(r)}):e,of={locale:"en",t:(e,t)=>fd(Pn.en[e]||e,t)},hd=ht.createContext(of),Si=({locale:e="en",messages:t,children:o})=>{let a=ht.useMemo(()=>{let r=Pn[e]||Pn.en,n=t?.[e]||{},i={...Pn.en,...r,...n};return {locale:e,t:(c,d)=>fd(i[c]||c,d)}},[e,t]);return jsxRuntime.jsx(hd.Provider,{value:a,children:o})},Q=()=>ht.useContext(hd);function bl({items:e,onItemClick:t,className:o="",level:a=0,expandedIds:r,onToggleExpand:n,colorMode:i="light"}){let{t:c}=Q(),d=i==="dark",l=navigation.usePathname(),[s,g]=ht.useState(false),[f,u]=ht.useState(new Set),h=r!==void 0&&n!==void 0,v=h?r:f;ht.useEffect(()=>{g(true);},[]);let p=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&&p(m.id),t&&t(m);};return !e||!Array.isArray(e)?jsxRuntime.jsx("div",{className:vo("tree-menu",o),children:jsxRuntime.jsx("div",{className:"text-sm text-gray-500 p-2",children:c("navigation.noItems")})}):jsxRuntime.jsx("div",{className:vo("tree-menu",o),children:e.map(m=>{let y=v.has(m.id)||m.isExpanded,x=m.children&&m.children.length>0,S=m.appurl||m.href,B=s&&S?l===S:false;return jsxRuntime.jsxs("div",{className:"tree-menu-item relative",children:[B&&jsxRuntime.jsx("div",{className:vo("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",d?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxRuntime.jsxs(hl,{variant:"ghost",className:vo("w-full justify-start gap-2 h-auto py-2 relative overflow-hidden group",`ml-${a*4}`,B?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:()=>C(m),children:[x&&jsxRuntime.jsx("div",{className:vo("flex-shrink-0 transition-transform duration-200",y&&"rotate-90",B?d?"text-[#90caf9]":"text-[#1976d2]":d?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})}),!x&&jsxRuntime.jsx("div",{className:"w-4 h-4 flex-shrink-0"}),m.icon&&jsxRuntime.jsx("div",{className:vo("flex-shrink-0 transition-colors duration-200",B?d?"text-[#90caf9]":"text-[#1976d2]":d?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:m.icon}),jsxRuntime.jsxs("div",{className:"flex-1 text-left overflow-hidden z-10",children:[jsxRuntime.jsx("div",{className:vo("text-sm truncate transition-colors duration-200",B?"font-semibold":"font-medium"),children:m.title||m.label}),m.description&&jsxRuntime.jsx("div",{className:vo("text-xs truncate transition-colors duration-200",B?d?"text-[#90caf9]/70":"text-[#1976d2]/75":d?"text-gray-400":"text-gray-500"),title:m.description,children:m.description})]})]}),x&&jsxRuntime.jsx("div",{className:vo("grid transition-[grid-template-rows] duration-300 ease-in-out",y?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsx(bl,{items:m.children,onItemClick:t,level:a+1,expandedIds:r,onToggleExpand:n,colorMode:i})})})]},m.id)})})}var kd=({collapsed:e,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light"})=>{let{t:i}=Q(),c=n==="dark",d=navigation.useRouter(),[l,s]=ht.useState(""),[g,f]=ht.useState(new Set);ht.useEffect(()=>{e&&f(new Set);},[e]);let u=ht.useCallback(C=>{let m=[],y=x=>{x.forEach(S=>{m.push(S.id),S.children&&y(S.children);});};return y(C),m},[]),h=ht.useMemo(()=>{if(!l.trim())return r;let C=m=>m.reduce((y,x)=>{let S=x.title?.toLowerCase().includes(l.toLowerCase())||x.description?.toLowerCase().includes(l.toLowerCase()),B=x.children?C(x.children):[];return (S||B.length>0)&&y.push({...x,children:B.length>0?B:x.children}),y},[]);return C(r)},[l,r]),v=ht.useMemo(()=>l.trim()?new Set(u(r)):g,[l,r,g,u]),p=ht.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{d.push("/chat?new=true");}catch(y){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",y),d.push("/chat");}return}let m=C.appurl||C.href;m&&(m.startsWith("http://")||m.startsWith("https://")?window.open(m,"_blank"):d.push(m));},[d]);return jsxRuntime.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} ${c?"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:[jsxRuntime.jsx("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${e?"px-1":"px-2"}`,children:e?jsxRuntime.jsx("div",{className:"flex justify-center",children:jsxRuntime.jsx("button",{onClick:t,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${c?"text-gray-300 hover:bg-gray-800":"text-gray-500 hover:bg-gray-50"}`,title:i("navigation.expand"),children:jsxRuntime.jsx(lucideReact.Search,{className:"h-5 w-5"})})}):jsxRuntime.jsxs("div",{className:`relative transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:[jsxRuntime.jsx("input",{type:"text",placeholder:i("navigation.searchPlaceholder"),value:l,onChange:C=>s(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 ${c?"border-gray-700 bg-[#1A1A1A] text-white placeholder-gray-400":"border-gray-300 bg-white text-gray-900 placeholder-gray-500"}`}),jsxRuntime.jsx("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:jsxRuntime.jsx(lucideReact.Search,{className:`h-4 w-4 ${c?"text-gray-500":"text-gray-400"}`})})]})}),jsxRuntime.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?jsxRuntime.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")}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!e&&jsxRuntime.jsx("div",{className:`transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:jsxRuntime.jsx(bl,{items:h,onItemClick:p,className:"space-y-1",expandedIds:v,colorMode:n,onToggleExpand:C=>{let m=new Set(g);h.some(x=>x.id===C)?m.has(C)?m.delete(C):(h.forEach(x=>{x.id!==C&&m.has(x.id)&&m.delete(x.id);}),m.add(C)):m.has(C)?m.delete(C):m.add(C),f(m);}})}),e&&jsxRuntime.jsx("div",{className:"space-y-2",children:r.map(C=>jsxRuntime.jsx("div",{className:"space-y-1",children:jsxRuntime.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 ${c?"text-gray-400 hover:bg-gray-800":"text-gray-600 hover:bg-gray-50"}`,title:i("navigation.expandView",{title:C.title||""}),children:C.icon||jsxRuntime.jsx("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${c?"bg-[#90caf9] text-[#0b0b0b]":"bg-[#1976d2] text-white"}`,children:C.title?.charAt(0)||"?"})})},C.id))})]})}),!e&&jsxRuntime.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 ${c?"hover:bg-gray-800/50":"hover:bg-white/20"}`,title:i("navigation.collapse"),children:jsxRuntime.jsx("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:jsxRuntime.jsx("div",{className:c?"border-yellow-400":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid #21BCFF",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})})]})};var wd=(e={})=>{let{initialCollapsed:t=false,content:o=[]}=e,[a,r]=ht.useState(t),[n,i]=ht.useState(o),c=ht.useCallback(()=>{r(l=>!l);},[]),d=ht.useMemo(()=>({collapsed:a,onToggle:c,menuData:n}),[a,c,n]);return {collapsed:a,setCollapsed:r,toggleCollapsed:c,menuData:n,setMenuData:i,navigationIslandProps:d}};var Mo=e=>jsxRuntime.jsx(material.Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var vl=class{constructor(){ud(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);}},na=new vl,dT={success:(e,t)=>na.show("success",e,t),error:(e,t)=>na.show("error",e,t),warning:(e,t)=>na.show("warning",e,t),info:(e,t)=>na.show("info",e,t),show:(e,t,o)=>na.show(e,t,o),hide:()=>na.hide()};var Tf={success:{icon:jsxRuntime.jsx(Cf__default.default,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsxRuntime.jsx(kf__default.default,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsxRuntime.jsx(Sf__default.default,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsxRuntime.jsx(wf__default.default,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},Rn=({open:e,title:t,message:o,onClose:a,onConfirm:r,confirmText:n,cancelText:i,showCancel:c=true,maxWidth:d="xs",type:l="default"})=>{let{t:s}=Q(),g=n||s("messageBox.confirm"),f=i||s("messageBox.cancel"),u=()=>{r?r():a();},h=Tf[l],v=l!=="default";return jsxRuntime.jsxs(Ep__default.default,{open:e,onClose:a,maxWidth:d,fullWidth:true,PaperProps:{sx:{borderRadius:3,...v&&{borderTop:`6px solid ${h.iconColor}`}}},children:[v&&jsxRuntime.jsx(Un__default.default,{sx:{display:"flex",justifyContent:"center",pt:3,color:h.iconColor},children:h.icon}),t&&jsxRuntime.jsx(Fp__default.default,{sx:{textAlign:v?"center":"left",pt:v?1:2},children:t}),jsxRuntime.jsx(Lp__default.default,{sx:{textAlign:v?"center":"left"},children:typeof o=="string"?jsxRuntime.jsx(bf__default.default,{children:o}):o}),jsxRuntime.jsxs(zp__default.default,{sx:{justifyContent:v?"center":"flex-end",pb:3,px:3},children:[c&&jsxRuntime.jsx(Mo,{onClick:a,variant:"text",color:"inherit",children:f}),jsxRuntime.jsx(Mo,{onClick:u,variant:"contained",sx:{bgcolor:v?h.iconColor:void 0,"&:hover":{bgcolor:v?h.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:g})]})]})},PT=()=>{let[e,t]=ht__namespace.default.useState(null),[o,a]=ht__namespace.default.useState(false);ht__namespace.default.useEffect(()=>{let i=c=>{c?(t(c),a(true)):(a(false),t(null));};return na.register(i),()=>na.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?jsxRuntime.jsx(Rn,{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 Id=({title:e,hideHeader:t,children:o})=>jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!t&&jsxRuntime.jsx(material.Box,{sx:{mb:2},children:jsxRuntime.jsx(material.Typography,{variant:"h4",children:e})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,overflow:"hidden"},children:o})]});var wi=e=>{let{t}=Q(),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,c=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),s=i===-1?1:Math.max(1,Math.ceil(d/i)),g=Math.min(l+1,s),f=l>0,u=l<s-1&&i!==-1;return jsxRuntime.jsxs(material.Toolbar,{sx:{pl:{sm:2},pr:{xs:1,sm:1},alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.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:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(vp__default.default,{fontSize:"small"})})},sx:{width:300}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:o,color:"text.secondary",whiteSpace:"nowrap"},children:t("table.toolbar.itemsPerPage")}),jsxRuntime.jsx(material.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:c.map(h=>jsxRuntime.jsx(material.MenuItem,{value:h,sx:{fontSize:o},children:h===-1?t("common.all"):h},`rows-per-page-${h}`))}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.max(l-1,0)),disabled:!f,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(Kf__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:o,fontWeight:600,minWidth:88,textAlign:"center",color:"text.primary"},children:t("table.toolbar.pageOf",{current:g,total:s})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.min(l+1,s-1)),disabled:!u,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(qf__default.default,{fontSize:"small"})})]}),jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[n.length>0&&jsxRuntime.jsx(material.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:n.map((h,v)=>jsxRuntime.jsx(ht__namespace.default.Fragment,{children:h},`toolbar-custom-${v}`))}),jsxRuntime.jsx(material.Box,{sx:{width:"1px",height:20,bgcolor:"divider",mx:.5}}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.groupBy"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:h=>e.setGroupAnchorEl(h.currentTarget),children:jsxRuntime.jsx(material.Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsxRuntime.jsx(Of__default.default,{})})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.summary"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:e.showSummary?"primary.main":"text.primary"},onClick:h=>e.setSummaryAnchorEl(h.currentTarget),children:jsxRuntime.jsx(Wf__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.columns"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:h=>e.setAnchorEl(h.currentTarget),children:jsxRuntime.jsx(zf__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.export"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:e.handleExport,children:jsxRuntime.jsx(Vf__default.default,{})})}),e.showCreateButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.newItem"),children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenCreateDialog,color:"primary",children:jsxRuntime.jsx(Hf__default.default,{})})}),e.showEditButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.editItem"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenEditDialog,color:"primary",disabled:!!e.editDisabled,children:jsxRuntime.jsx(Gf__default.default,{})})})}),e.showDeleteButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.deleteItem"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenDeleteConfirm,color:"error",disabled:!!e.deleteDisabled,children:jsxRuntime.jsx(Uf__default.default,{})})})}),e.onOpenGraphReport&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.graphicReport"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:e.onOpenGraphReport,children:jsxRuntime.jsx($f__default.default,{})})}),e.onLayoutSave&&!e.layoutManager&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.saveLayout"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:h=>e.onLayoutSave(h),children:jsxRuntime.jsx(Rp__default.default,{})})}),e.layoutManager]})]})};var Ti=e=>{let{t}=Q(),{onSelectAllClick:o,order:a,orderBy:r,numSelected:n=0,rowCount:i=0,onRequestSort:c,columns:d,visibleColumns:l,selectionMode:s,grouping:g=[],isAllExpanded:f=false,handleToggleAll:u,onColumnResize:h,columnWidths:v}=e,[p,C]=ht.useState(null),m=ht.useRef(null),y=k=>D=>{p||c(k);},x=(k,D,T)=>{k.preventDefault(),k.stopPropagation(),C(D),m.current={startX:k.clientX,startWidth:T,colId:D},document.addEventListener("mousemove",S),document.addEventListener("mouseup",B),document.body.style.cursor="col-resize";},S=k=>{if(!m.current)return;let{startX:D,startWidth:T,colId:I}=m.current,M=k.clientX-D,H=Math.max(50,T+M);h&&h(I,H);},B=()=>{C(null),m.current=null,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",B),document.body.style.cursor="";};ht.useEffect(()=>()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",B);},[]);let R=s==="multiple"||s==="single",w=g.length>0&&!!u,A=t(f?"table.group.collapseAll":"table.group.expandAll"),P=d.filter(k=>l.includes(k.id));return jsxRuntime.jsx(Xf__default.default,{children:jsxRuntime.jsxs(Qf__default.default,{children:[R&&jsxRuntime.jsx(Tl__default.default,{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:jsxRuntime.jsx(Yf__default.default,{color:"primary",indeterminate:n>0&&n<i,checked:i>0&&n===i,onChange:o,disabled:s==="single"})}),w&&jsxRuntime.jsx(Tl__default.default,{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:jsxRuntime.jsx(th__default.default,{title:A,children:jsxRuntime.jsx(eh__default.default,{size:"small",onClick:k=>{k.stopPropagation(),u?.(!f);},sx:{p:.2},children:f?jsxRuntime.jsx(ah__default.default,{fontSize:"small"}):jsxRuntime.jsx(oh__default.default,{fontSize:"small"})})})}),P.map(k=>{let D=v?.[k.id]||k.minWidth||100;return jsxRuntime.jsxs(Tl__default.default,{align:"left",padding:k.disablePadding?"none":"normal",sortDirection:r===k.id?a:false,style:{width:D,minWidth:D,maxWidth:D},sx:T=>({position:"sticky",top:0,zIndex:4,backgroundColor:T.palette.mode==="dark"?"#000000":"#f5f5f5",color:T.palette.mode==="dark"?"#ffffff":T.palette.text.primary,fontWeight:"bold",userSelect:"none"}),children:[jsxRuntime.jsx(Jf__default.default,{active:r===k.id,direction:r===k.id?a:"asc",onClick:y(k.id),sx:T=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:T.palette.mode==="dark"?"#ffffff":T.palette.text.primary,opacity:r===k.id?1:0,transition:"opacity 0.2s"},"&:hover .MuiTableSortLabel-icon":{opacity:.5},"&.Mui-active .MuiTableSortLabel-icon":{opacity:1,color:T.palette.mode==="dark"?"#ffffff":T.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:T.palette.mode==="dark"?"#ffffff":T.palette.text.primary}),children:jsxRuntime.jsx(Un__default.default,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1},children:k.label})}),jsxRuntime.jsx(Un__default.default,{onMouseDown:T=>x(T,k.id,typeof D=="number"?D:100),onClick:T=>T.stopPropagation(),sx:{position:"absolute",right:0,top:0,bottom:0,width:5,cursor:"col-resize","&:hover":{backgroundColor:"primary.main",opacity:.5},zIndex:1}})]},k.id)})]})})};var Bd=e=>{let{t}=Q(),{visibleRows:o,visibleColumns:a,selected:r=[],handleClick:n,columns:i,toggleGroupExpand:c,expandedGroups:d=new Set,selectionMode:l,grouping:s=[],isGroupFullyExpanded:g,handleExpandGroupRecursively:f,handleCollapseGroupRecursively:u}=e,h=m=>r.indexOf(m)!==-1,v=l==="multiple"||l==="single",p=s.length>0,C=a.length+(v?1:0)+(p?1:0);return jsxRuntime.jsxs(material.TableBody,{children:[o.map((m,y)=>{if(m.type==="group"){let x=d.has(m.id),S=m.childIds||[],B=S.filter(P=>h(P)).length,R=S.length>0&&B===S.length,w=B>0&&B<S.length;return jsxRuntime.jsxs(material.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:[v&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:R,indeterminate:w,onChange:P=>{if(P.stopPropagation(),!!e.onSelectionChange)if(R){let k=r.filter(D=>!S.includes(D));e.onSelectionChange(k);}else {let k=Array.from(new Set([...r,...S]));e.onSelectionChange(k);}},onClick:P=>P.stopPropagation(),sx:{p:.5}})}),p&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{width:44},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.25},children:[s.length>1&&m.level<s.length-1&&jsxRuntime.jsx(material.Tooltip,{title:g?.(m.id)?t("table.group.collapseAll"):t("table.group.expandAll"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>{g?.(m.id)?u?.(m.id):f?.(m.id);},sx:{p:.25},children:g?.(m.id)?jsxRuntime.jsx(ah__default.default,{fontSize:"small"}):jsxRuntime.jsx(oh__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>c&&c(m.id),sx:{p:.25},children:x?jsxRuntime.jsx(ch__default.default,{}):jsxRuntime.jsx(qf__default.default,{})})]})}),jsxRuntime.jsx(material.TableCell,{colSpan:a.length,sx:{py:1,pl:m.level*3+1},children:jsxRuntime.jsxs(material.Typography,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[m.field,": ",m.value," (",m.count,")"]})})]},m.id)}else {let x=m.data||m,S=m.id||x.id||y,B=h(S),R=`enhanced-table-checkbox-${y}`,A=(m.level!==void 0?m.level:0)*4;return jsxRuntime.jsxs(material.TableRow,{hover:true,onClick:P=>n&&n(P,x),role:"checkbox","aria-checked":B,tabIndex:-1,selected:B,sx:{cursor:"pointer"},children:[v&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{pl:A>0?A+1:void 0},children:jsxRuntime.jsx(material.Checkbox,{color:"primary",checked:B,inputProps:{"aria-labelledby":R}})}),p&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{width:44}}),i.filter(P=>a.includes(P.id)).map((P,k)=>{let T=!v&&k===0&&A>0?{pl:A+2}:{};return jsxRuntime.jsx(material.TableCell,{align:"left",sx:T,children:P.render?P.render(x[P.id],x):(function(){let M=x[P.id];if(P.numeric){if(typeof M=="number")return M.toLocaleString();if(typeof M=="string"&&M.trim()!==""&&!isNaN(Number(M)))return Number(M).toLocaleString()}return M})()},P.id)})]},S)}}),o.length===0&&jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:C,align:"center",children:t("common.noData")})})]})};var Ed=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 jsxRuntime.jsx(material.TableFooter,{sx:{position:"sticky",bottom:0,zIndex:e.zIndex,bgcolor:"background.paper"},children:jsxRuntime.jsxs(material.TableRow,{children:[n&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper"}}),i&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper",width:44}}),t.map(c=>jsxRuntime.jsx(material.TableCell,{sx:{fontWeight:"bold",fontSize:"0.85rem",bgcolor:"background.paper",color:"text.primary"},children:(function(){let l=o[c];return l==null||l===""?"":typeof l=="number"?l.toLocaleString():typeof l=="string"&&l.trim()!==""&&!isNaN(Number(l))?Number(l).toLocaleString():l})()},c))]})})};var Ld=e=>{let{t}=Q();return jsxRuntime.jsx(material.Box,{sx:{p:2},children:jsxRuntime.jsx(material.Typography,{children:t("table.mobile.notImplemented")})})};var Nr=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:o,setGrouping:a,columns:r,toggleGroupField:n})=>{let{t:i}=Q();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsxs(material.Box,{sx:{p:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle2",sx:{px:1},children:i("table.menu.groupBy")}),o.length>0&&jsxRuntime.jsx(material.Button,{size:"small",color:"error",onClick:()=>a([]),startIcon:jsxRuntime.jsx(wh__default.default,{}),children:i("table.menu.clearAll")})]}),jsxRuntime.jsx(material.Divider,{}),r.map(c=>{let d=o.includes(c.id),l=o.indexOf(c.id)+1;return jsxRuntime.jsx(material.MenuItem,{onClick:()=>n(c.id),children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsxRuntime.jsx(material.Checkbox,{checked:d,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:c.label}),d&&jsxRuntime.jsx(material.Badge,{badgeContent:l,color:"primary",sx:{mr:2}})]})},c.id)})]})},Vr=({anchorEl:e,setAnchorEl:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=Q();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:n("table.menu.visibleColumns")})}),jsxRuntime.jsx(material.Divider,{}),o.map(i=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>r(i.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:a.includes(i.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:i.label})]},i.id))]})},Di=({anchorEl:e,setAnchorEl:t,showSummary:o,setShowSummary:a,columns:r,summaryColumns:n,toggleSummaryColumn:i})=>{let{t:c}=Q();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsx(material.MenuItem,{children:jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Switch,{checked:o,onChange:d=>a(d.target.checked),size:"small"}),label:c("table.menu.showSummaryRow")})}),jsxRuntime.jsx(material.Divider,{}),r.filter(d=>d.numeric).map(d=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>i(d.id),disabled:!o,children:[jsxRuntime.jsx(material.Checkbox,{checked:n.includes(d.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:d.label})]},d.id)),r.filter(d=>d.numeric).length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:c("table.menu.noNumericColumns")})})]})},Mi=({contextMenu:e,handleCloseContextMenu:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=Q();return jsxRuntime.jsxs(material.Menu,{open:e!==null,onClose:t,anchorReference:"anchorPosition",anchorPosition:e!==null?{top:e.mouseY,left:e.mouseX}:void 0,children:[jsxRuntime.jsx(material.MenuItem,{onClick:t,children:n("common.copy")}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.MenuItem,{disabled:true,children:n("table.menu.visibleColumns")}),o.map(i=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>r(i.id),children:[jsxRuntime.jsx(material.ListItemIcon,{children:a.includes(i.id)&&jsxRuntime.jsx(Sh__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i.label})]},i.id))]})};var An=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),Vd=({kpis:e})=>{let{t}=Q(),o=[{label:t("graph.kpi.totalRecords"),value:An(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:An(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:An(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:An(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:An(e.flaggedCount,0),color:"error.main"}];return jsxRuntime.jsx(material.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=>jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:a.label}),jsxRuntime.jsx(material.Typography,{variant:"h4",fontWeight:800,sx:{color:a.color},children:a.value})]},a.label))})};var Ai=({title:e,subtitle:t,children:o})=>jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:2,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle1",fontWeight:700,children:e}),t&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mb:2},children:t}),o]});var En=({data:e,orientation:t="horizontal",valueSuffix:o="",minHeight:a=210,activeName:r,onItemClick:n})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=Math.max(...e.map(c=>c.value),1);return t==="vertical"?jsxRuntime.jsx(material.Box,{sx:{display:"flex",gap:1,alignItems:"flex-end",minHeight:a},children:e.map(c=>jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.Box,{onClick:()=>n?.(c),sx:{height:`${Math.max(c.value/i*180,6)}px`,bgcolor:c.name===r?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:n?"pointer":"default",opacity:r&&c.name!==r?.45:1}}),jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:c.name,sx:{display:"block",mt:.5},children:c.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",children:[c.value.toFixed(1),o]})]},c.name))}):jsxRuntime.jsx(material.Stack,{spacing:1,children:e.map(c=>jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,title:c.name,children:c.name}),jsxRuntime.jsx(material.Box,{onClick:()=>n?.(c),sx:{alignSelf:"center",bgcolor:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:n?"pointer":"default",opacity:r&&c.name!==r?.45:1},children:jsxRuntime.jsx(material.Box,{sx:{width:`${c.value/i*100}%`,height:"100%",bgcolor:c.name===r?"primary.dark":"primary.main"}})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[c.value.toFixed(1),o]})]},c.name))})};var $d=({data:e,color:t="#42A5F5",valueSuffix:o="",height:a=220})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let r=640,n=28,i=e.map(f=>f.value),c=Math.min(...i,0),l=Math.max(...i,1)-c||1,s=e.map((f,u)=>{let h=n+u*(r-n*2)/Math.max(e.length-1,1),v=a-n-(f.value-c)/l*(a-n*2);return {x:h,y:v,...f}}),g=s.map(f=>`${f.x},${f.y}`).join(" ");return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${r} ${a}`,sx:{width:"100%",height:a},children:[jsxRuntime.jsx("line",{x1:n,y1:a-n,x2:r-n,y2:a-n,stroke:"rgba(148,163,184,0.4)"}),jsxRuntime.jsx("polyline",{fill:"none",stroke:t,strokeWidth:3,points:g}),s.map(f=>jsxRuntime.jsx("circle",{cx:f.x,cy:f.y,r:4,fill:t},f.name))]}),jsxRuntime.jsx(material.Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(f=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:f.name,sx:{display:"block"},children:f.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",children:[f.value.toFixed(1),o]})]},f.name))})]})};var Hd=({data:e,barColor:t="#64B5F6",lineColor:o="#FFB74D",height:a=220})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let r=640,n=28,i=Math.max(...e.map(s=>s.barValue),1),c=Math.max(...e.map(s=>s.lineValue),1),d=e.map((s,g)=>{let f=(r-n*2)/e.length,u=Math.max(f*.5,8),h=n+g*f+(f-u)/2,v=s.barValue/i*(a-n*2),p=a-n-v;return {x:h,y:p,barHeight:v,barWidth:u,item:s}}),l=e.map((s,g)=>{let f=(r-n*2)/e.length,u=n+g*f+f/2,h=a-n-s.lineValue/c*(a-n*2);return {x:u,y:h,item:s}});return jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${r} ${a}`,sx:{width:"100%",height:a},children:[jsxRuntime.jsx("line",{x1:n,y1:a-n,x2:r-n,y2:a-n,stroke:"rgba(148,163,184,0.4)"}),d.map(s=>jsxRuntime.jsx("rect",{x:s.x,y:s.y,width:s.barWidth,height:Math.max(s.barHeight,4),rx:6,fill:t},s.item.name)),jsxRuntime.jsx("polyline",{fill:"none",stroke:o,strokeWidth:3,points:l.map(s=>`${s.x},${s.y}`).join(" ")}),l.map(s=>jsxRuntime.jsx("circle",{cx:s.x,cy:s.y,r:3.5,fill:o},`${s.item.name}-line`))]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(s=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:s.name,sx:{display:"block"},children:s.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Bar: ",s.barValue.toFixed(1)]}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Line: ",s.lineValue.toFixed(1)]})]},s.name))})]})};var Bh=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,Ud=({data:e})=>{if(e.length===0)return jsxRuntime.jsx(material.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 jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:`120px repeat(${t.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+t.length*64},children:[jsxRuntime.jsx(material.Box,{}),t.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:n},n)),o.map(n=>jsxRuntime.jsxs(material.Box,{sx:{display:"contents"},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{alignSelf:"center"},children:n}),t.map(i=>{let c=r.get(`${n}__${i}`)||0,d=c/a;return jsxRuntime.jsx(material.Box,{sx:{height:36,borderRadius:1,bgcolor:Bh(d),border:"1px solid rgba(148,163,184,0.2)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:c.toFixed(1)})},`${n}-${i}`)})]},n))]})})};var Eh=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],Vi=({data:e,variant:t="donut",colors:o=Eh,size:a=180,activeName:r,onItemClick:n})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=0,c=e.map((d,l)=>{let s=i;return i+=d.percent,`${o[l%o.length]} ${s}% ${i}%`});return jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[jsxRuntime.jsx(material.Box,{sx:{width:a,height:a,borderRadius:"50%",background:`conic-gradient(${c.join(", ")})`,position:"relative",flexShrink:0},children:t==="donut"&&jsxRuntime.jsx(material.Box,{sx:{position:"absolute",inset:Math.round(a*.18),bgcolor:"background.paper",borderRadius:"50%"}})}),jsxRuntime.jsx(material.Stack,{spacing:1,sx:{minWidth:180},children:e.map((d,l)=>jsxRuntime.jsxs(material.Box,{onClick:()=>n?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:n?"pointer":"default",opacity:r&&d.name!==r?.45:1},children:[jsxRuntime.jsx(material.Box,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:o[l%o.length]}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{flex:1},children:d.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};var qd=({effect:e,branches:t})=>{if(t.length===0)return jsxRuntime.jsx(material.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 jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(r=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:r.title}),r.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},r.title))}),jsxRuntime.jsxs(material.Box,{sx:{position:"relative",height:32},children:[jsxRuntime.jsx(material.Box,{sx:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),jsxRuntime.jsx(material.Box,{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,bgcolor:"primary.main",color:"primary.contrastText"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:e})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(a.length,1)}, minmax(0, 1fr))`,gap:1},children:a.map(r=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:r.title}),r.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},r.title))})]})};var jd=({data:e,height:t=240})=>{if(e.length===0)return jsxRuntime.jsx(material.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),c=680,d=30,l=i-n||1,s=g=>t-d-(g-n)/l*(t-d*2);return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${c} ${t}`,sx:{width:"100%",height:t},children:[jsxRuntime.jsx("line",{x1:d,y1:s(0),x2:c-d,y2:s(0),stroke:"rgba(148,163,184,0.4)"}),a.map((g,f)=>{let u=(c-d*2)/a.length,h=Math.max(u*.55,8),v=d+f*u+(u-h)/2,p=s(Math.max(g.start,g.end)),C=s(Math.min(g.start,g.end)),m=g.type==="total"?"#42A5F5":g.delta>=0?"#66BB6A":"#EF5350";return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:v,y:p,width:h,height:Math.max(C-p,4),rx:6,fill:m}),jsxRuntime.jsx("text",{x:v+h/2,y:p-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:g.end.toFixed(1)})]},g.name)})]}),jsxRuntime.jsx(material.Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${a.length}, minmax(0, 1fr))`,gap:1},children:a.map(g=>jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:g.name,children:g.name},g.name))})]})};var zn=({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}`},iP=(e,t=360)=>{let o=zn(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};var Qd=({apiKey:e,query:t,embedUrl:o,zoom:a=14,mapType:r="roadmap",height:n=320})=>{let i=o||(e&&t?zn({apiKey:e,query:t,zoom:a,mapType:r}):"");return i?jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Box,{component:"iframe",src:i,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsxRuntime.jsx(material.Link,{href:i,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var $i=({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 tp=({keyword:e,location:t,embedUrl:o,height:a=320})=>{let r=o||$i({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0});return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Box,{component:"iframe",src:r,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:a,border:0,borderRadius:2}}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsxRuntime.jsx(material.Link,{href:r,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var op=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:o,interaction:a})=>{let{t:r}=Q();return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsxRuntime.jsx(Ai,{title:r("graph.chart.billable.title"),subtitle:r("graph.chart.billable.subtitle"),children:jsxRuntime.jsx(En,{data:e,orientation:"horizontal",activeName:a?.filters?.primaryDimension,onItemClick:n=>a?.onPrimaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(Ai,{title:r("graph.chart.efficiency.title"),subtitle:r("graph.chart.efficiency.subtitle"),children:jsxRuntime.jsx(En,{data:t,orientation:"vertical",valueSuffix:"%",activeName:a?.filters?.secondaryDimension,onItemClick:n=>a?.onSecondaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(Ai,{title:r("graph.chart.status.title"),subtitle:r("graph.chart.status.subtitle"),children:jsxRuntime.jsx(Vi,{data:o,variant:"donut",activeName:a?.filters?.status,onItemClick:n=>a?.onStatusClick?.(n.name)})})]})};var Kt=e=>jsxRuntime.jsx(material.TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var Nl=e=>jsxRuntime.jsx(material.TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var Yh=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],Jh=["zh","en","de","fr","ja","ko"],np=({open:e,onClose:t,value:o,onSaveAll:a,modelOptions:r=Yh,promptLangOptions:n=Jh,analysisTemplateOptions:i=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:l})=>{let[s,g]=ht.useState(o),[f,u]=ht.useState(d||""),[h,v]=ht.useState(l||""),[p,C]=ht.useState(false);ht.useEffect(()=>{e&&(g(o),u(d||""),v(l||""));},[e,o,d,l]);let m=(x,S)=>{g(B=>({...B,[x]:S}));},y=async()=>{if(a)try{C(!0),await a({settings:s,analysisTemplateId:f||void 0,responseTemplateId:h||void 0});}finally{C(false);}};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"lg",children:[jsxRuntime.jsxs(material.DialogTitle,{sx:{pr:7,pb:2.2},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{position:"absolute",right:12,top:12},children:jsxRuntime.jsx(Qh__default.default,{})})]}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"18px !important"},children:jsxRuntime.jsxs(material.Stack,{spacing:2.2,children:[jsxRuntime.jsxs(material.Box,{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Kt,{size:"small",value:s.baseUrl,onChange:x=>m("baseUrl",x.target.value),fullWidth:true,label:"Base URL"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Kt,{size:"small",type:"password",value:s.apiKey,onChange:x=>m("apiKey",x.target.value),fullWidth:true,label:"API Key"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Kt,{size:"small",value:s.model,onChange:x=>m("model",x.target.value),fullWidth:true,select:true,label:"Model",children:r.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x,children:x},x))})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Kt,{size:"small",value:s.promptLang,onChange:x=>m("promptLang",x.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:n.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x,children:x},x))})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[jsxRuntime.jsxs(Kt,{size:"small",value:f,onChange:x=>u(x.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),i.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x.id,children:x.label},x.id))]}),jsxRuntime.jsx(Nl,{multiline:true,minRows:8,value:s.analysisPrompt,onChange:x=>m("analysisPrompt",x.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxRuntime.jsxs(Kt,{size:"small",value:h,onChange:x=>v(x.target.value),fullWidth:true,select:true,label:"Response Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),c.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x.id,children:x.label},x.id))]}),jsxRuntime.jsx(Nl,{multiline:true,minRows:8,value:s.responsePrompt,onChange:x=>m("responsePrompt",x.target.value),fullWidth:true,label:"Response Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[jsxRuntime.jsx(material.Button,{variant:"outlined",onClick:t,children:"Cancel"}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:y,disabled:!a||p,children:"Save"})]})]})};var qi=({open:e,onClose:t,model:o,tableContent:a,extraCharts:r,interaction:n,aiAssistant:i})=>{let{t:c}=Q(),[d,l]=ht.useState(i?.defaultPrompt||""),[s,g]=ht.useState(false),[f,u]=ht.useState(false),h=n?.enabled!==false&&!!n,v=i?.enabled!==false,p=n?.filters||{},C=!!(p.primaryDimension||p.secondaryDimension||p.status),m=i?.placeholder||"Ask AI to analyze data, create charts, or find insights...";ht.useEffect(()=>{e&&l(i?.defaultPrompt||"");},[e,i?.defaultPrompt]);let y=i?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},x=async()=>{let S=d.trim();if(!(!S||!i?.onSubmit))try{g(!0),await i.onSubmit(S,{filters:p,model:o});}finally{g(false);}};return jsxRuntime.jsx(material.Dialog,{open:e,onClose:t,fullScreen:true,children:jsxRuntime.jsxs(material.Box,{sx:{height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[jsxRuntime.jsx(material.Box,{sx:{p:2,borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",lg:"row"},alignItems:{xs:"stretch",lg:"center"},justifyContent:"space-between",spacing:1.5,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{flexWrap:"wrap"},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",fontWeight:800,children:o.title}),jsxRuntime.jsx(material.Chip,{size:"small",label:c("graph.records",{count:o.kpis.totalRecords})}),h&&p.primaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.primaryDimension}: ${p.primaryDimension}`,onDelete:()=>n?.onClearFilter("primaryDimension")}),h&&p.secondaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.secondaryDimension}: ${p.secondaryDimension}`,onDelete:()=>n?.onClearFilter("secondaryDimension")}),h&&p.status&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.status}: ${p.status}`,onDelete:()=>n?.onClearFilter("status")}),h&&C&&jsxRuntime.jsx(material.Button,{size:"small",onClick:()=>n?.onClearAll(),children:"Clear"})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{width:{xs:"100%",lg:"auto"}},children:[v&&jsxRuntime.jsxs(material.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:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:i?.onVoiceInput,children:jsxRuntime.jsx(ny__default.default,{sx:{fontSize:18,color:"text.secondary"}})}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:d,onChange:S=>l(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),x());},placeholder:m,sx:{fontSize:"0.9rem"}}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:x,disabled:s||!d.trim(),children:jsxRuntime.jsx(sy__default.default,{sx:{fontSize:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>u(true),children:jsxRuntime.jsx(iy__default.default,{sx:{fontSize:18}})})]}),jsxRuntime.jsx(material.IconButton,{onClick:t,children:jsxRuntime.jsx(Qh__default.default,{})})]})]})}),jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,overflow:"auto",minHeight:0},children:[jsxRuntime.jsx(Vd,{kpis:o.kpis}),jsxRuntime.jsx(op,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:h?{filters:p,onPrimaryDimensionClick:S=>n?.onPrimaryDimensionClick(S),onSecondaryDimensionClick:S=>n?.onSecondaryDimensionClick(S),onStatusClick:S=>n?.onStatusClick(S)}:void 0}),r,a]}),jsxRuntime.jsx(np,{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 Da={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"]},cy=5,ip=e=>e.toLowerCase().replace(/[\s_-]/g,""),Ma=(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 c=n.get(ip(i));if(c)return c}return r[0]||a},co=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},Ot=(e,t)=>e==null||e===""?t:String(e),dy=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=Ot(i[t],r);n.set(c,(n.get(c)||0)+co(i[o]));}),Array.from(n.entries()).map(([i,c])=>({name:i,value:c})).sort((i,c)=>c.value-i.value).slice(0,a)},py=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=Ot(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=co(c[o]),l.billable+=co(c[a]),i.set(d,l);}),Array.from(i.entries()).map(([c,d])=>({name:c,value:d.report>0?d.billable/d.report*100:0})).sort((c,d)=>c.value-d.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=Ot(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}))},sp=(e,t,o)=>{let a=new Map;return e.forEach(r=>{let n=Ot(r[t],"N/A");a.set(n,(a.get(n)||0)+co(r[o]));}),Array.from(a.entries()).sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>({name:r,value:n}))},my=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=Ot(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=co(c[o]),l.billable+=co(c[a]),i.set(d,l);}),Array.from(i.entries()).map(([c,d])=>({name:c,barValue:d.billable,lineValue:d.report>0?d.billable/d.report*100:0})).sort((c,d)=>d.barValue-c.barValue).slice(0,r)},gy=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=Ot(i[t],r),d=Ot(i[o],r),l=`${c}__${d}`;n.set(l,(n.get(l)||0)+co(i[a]));}),Array.from(n.entries()).map(([i,c])=>{let[d,l]=i.split("__");return {x:d,y:l,value:c}})},fy=(e,t,o)=>{let a=sp(e,t,o),r=a.map(i=>({name:i.name,value:i.value,type:"delta"})),n=a.reduce((i,c)=>i+c.value,0);return [...r,{name:"Total",value:n,type:"total"}]},hy=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=Ot(c[t],n),l=`${Ot(c[o],n)} / ${Ot(c[a],n)}`,s=i.get(d)||new Map;s.set(l,(s.get(l)||0)+1),i.set(d,s);}),Array.from(i.entries()).map(([c,d])=>({title:c,causes:Array.from(d.entries()).sort((l,s)=>s[1]-l[1]).slice(0,r).map(([l,s])=>`${l} (${s})`)})).slice(0,6)},jr=({rows:e,config:t})=>{let{t:o}=Q(),a=o("graph.unassigned"),r=ht.useMemo(()=>{let s=t?.fieldMapping;return {primaryDimension:Ma(e,s?.primaryDimension,Da.primaryDimension,"Category"),secondaryDimension:Ma(e,s?.secondaryDimension,Da.secondaryDimension,"Owner"),status:Ma(e,s?.status,Da.status,"Status"),date:Ma(e,s?.date,Da.date,"Date"),description:Ma(e,s?.description,Da.description,"Description"),reportHours:Ma(e,s?.reportHours,Da.reportHours,"ReportHours"),billableHours:Ma(e,s?.billableHours,Da.billableHours,"BillableHours"),amount:Ma(e,s?.amount,Da.amount,"Amount")}},[e,t?.fieldMapping]),n=ht.useMemo(()=>e.map((s,g)=>{let f=co(s[r.reportHours]),u=co(s[r.billableHours]),h=co(s[r.amount]),v=f>0?u/f*100:0;return {id:`graph-row-${g}`,Date:Ot(s[r.date],""),Primary:Ot(s[r.primaryDimension],a),Secondary:Ot(s[r.secondaryDimension],a),Description:Ot(s[r.description],""),ReportHours:f,BillableHours:u,Amount:h,Efficiency:v,Status:Ot(s[r.status],a)}}),[e,r,a]),i=ht.useMemo(()=>{let s=n.length,g=n.reduce((C,m)=>C+co(m.ReportHours),0),f=n.reduce((C,m)=>C+co(m.BillableHours),0),u=n.reduce((C,m)=>C+co(m.Amount),0),h=g>0?f/g*100:0,v=t?.statusFlagValues||["flag","flagged","warning","risk"],p=n.filter(C=>v.includes(Ot(C.Status,"").toLowerCase())).length;return {totalRecords:s,totalReportHours:g,totalBillableHours:f,efficiency:h,totalAmount:u,flaggedCount:p}},[n,t?.statusFlagValues]),c=t?.topN||cy,d=ht.useMemo(()=>({billableByPrimary:dy(n,"Primary","BillableHours",c,a),efficiencyBySecondary:py(n,"Secondary","ReportHours","BillableHours",c,a),statusDistribution:uy(n,"Status",a),lineByDate:sp(n,"Date","BillableHours"),comboByPrimary:my(n,"Primary","ReportHours","BillableHours",c,a),heatmapPrimarySecondary:gy(n,"Primary","Secondary","BillableHours",a),waterfallBillable:fy(n,"Date","BillableHours"),fishboneStatusCauses:hy(n,"Status","Primary","Secondary",3,a)}),[n,c,a]),l=ht.useMemo(()=>({title:t?.title||o("graph.reportTitle"),kpis:i,charts:d,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}}),[d,t?.title,r,i,n,o]);return {fieldMapping:r,model:l}};var Zr=e=>String(e??"").trim(),ji=(e={})=>{let[t,o]=ht.useState(e),a=ht.useCallback((d,l)=>{o(s=>{let g=l?.trim();if(!g){let f={...s};return delete f[d],f}if(s[d]===g){let f={...s};return delete f[d],f}return {...s,[d]:g}});},[]),r=ht.useCallback(d=>{o(l=>{if(!l[d])return l;let s={...l};return delete s[d],s});},[]),n=ht.useCallback(()=>{o({});},[]),i=ht.useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),c=ht.useCallback((d,l)=>d.filter(s=>!(t.primaryDimension&&Zr(s[l.primaryDimension])!==Zr(t.primaryDimension)||t.secondaryDimension&&Zr(s[l.secondaryDimension])!==Zr(t.secondaryDimension)||t.status&&Zr(s[l.status])!==Zr(t.status))),[t]);return {filters:t,setFilter:a,clearFilter:r,clearAll:n,hasActiveFilters:i,applyRows:c}};var Xi=({variants:e,currentVariantId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=Q(),d=material.useTheme().palette.mode==="dark",l="0.85rem",s={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]=ht.useState(false),[u,h]=ht.useState(""),[v,p]=ht.useState(false),[C,m]=ht.useState(false),y=e.find(B=>B.id===t),x=()=>{h(y?.name||i("variant.newVariant")),p(y?.isDefault||false),m(y?.isPublic||false),f(true);},S=()=>{a({name:u,isDefault:v,isPublic:C,description:""}),f(false);};return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",gap:1,alignItems:"center",width:"100%",maxWidth:"100%"},children:[jsxRuntime.jsx(material.Autocomplete,{size:"small",sx:{width:s,"& .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:jsxRuntime.jsx(material.Typography,{sx:{fontSize:l},children:i("variant.noOptions")}),options:e,getOptionLabel:B=>B.name+(B.isDefault?` (${i("variant.defaultSuffix")})`:""),value:y||null,onChange:(B,R)=>{R&&o(R);},renderInput:B=>jsxRuntime.jsx(material.TextField,{...B,variant:"outlined",size:"small",InputProps:{...B.InputProps,sx:{fontSize:l,color:d?"#E3F2FD":"#0D47A1"}},placeholder:i("variant.selectVariant")}),renderOption:(B,R)=>jsxRuntime.jsx("li",{...B,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{flex:1,fontSize:l},children:R.name}),R.isDefault&&jsxRuntime.jsx(Ry__default.default,{fontSize:"small",color:"action"})]})})}),jsxRuntime.jsx(material.Tooltip,{title:i("variant.saveView"),children:jsxRuntime.jsx(material.IconButton,{onClick:x,size:"small",color:"primary",children:jsxRuntime.jsx(Rp__default.default,{fontSize:"small"})})}),jsxRuntime.jsxs(material.Dialog,{open:g,onClose:()=>f(false),children:[jsxRuntime.jsx(material.DialogTitle,{children:i("variant.saveView")}),jsxRuntime.jsxs(material.DialogContent,{children:[jsxRuntime.jsx(material.TextField,{autoFocus:true,margin:"dense",label:i("variant.viewName"),fullWidth:true,variant:"outlined",value:u,onChange:B=>h(B.target.value)}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:v,onChange:B=>p(B.target.checked)}),label:i("variant.setDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:C,onChange:B=>m(B.target.checked)}),label:i("variant.publicAllUsers")})]}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>f(false),children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:S,variant:"contained",children:i("common.save")})]})]})]})};var fp=({appId:e,tableKey:t="default",currentFilters:o,currentLayoutId:a,layoutRefs:r,onLoad:n,variantService:i,serviceUrl:c,onError:d,onSuccess:l,currentVariantId:s,onVariantChange:g})=>{let{t:f}=Q(),[u,h]=ht.useState([]),[v,p]=ht.useState(""),C=`orbcafe.variants.${e}.${t}`,m=s!==void 0?s:v,y=D=>{s===void 0&&p(D),g&&g(D);},x=ht.useCallback(()=>{try{let D=localStorage.getItem(C);if(!D)return [];let T=JSON.parse(D);return Array.isArray(T)?T:[]}catch{return []}},[C]),S=ht.useCallback(D=>{try{localStorage.setItem(C,JSON.stringify(D));}catch{}},[C]),B=ht.useCallback(D=>{h(D);let T=D.find(I=>I.isDefault);T&&!m&&(y(T.id),n(T));},[m,n,y]),R=ht.useCallback(async()=>{if(!e)return [];try{let D=[];if(i)D=await i.getVariants(e,t);else if(c){let T=await fetch(`${c}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!T.ok)throw new Error(f("variant.toast.fetchFailed"));D=await T.json();}else D=x();return B(D),D}catch(D){console.error("Error fetching variants",D);let T=x();return B(T),d&&d(f("variant.toast.fetchFailed")),T}},[e,t,i,c,x,B,d,f]);return ht.useEffect(()=>{R();},[e,t]),jsxRuntime.jsx(Xi,{variants:u,currentVariantId:m,onLoad:D=>{y(D.id),n(D);},onSave:async D=>{let T=Date.now().toString(),I;try{let M=D.scope||"Both",H=u.find(te=>te.name===D.name);T=H?H.id:Date.now().toString();let V=[];if(H&&(Array.isArray(H.filters)?V=[...H.filters]:H.filters&&(V=[{scope:"default",filters:H.filters}])),M==="Search"||M==="Both"){let te=(Array.isArray(o),o);if(te)if(Array.isArray(te)&&te.length>0&&te[0].scope)te.forEach(ne=>{let ee=V.findIndex(Y=>Y.scope===ne.scope);ee>=0?V[ee]=ne:V.push(ne);});else {let ne={scope:t,filters:te},ee=V.findIndex(Y=>Y.scope===t);ee>=0?V[ee]=ne:V.push(ne);}}let J=H?.layout||{},ce=[];if(H&&Array.isArray(H.layoutRefs)&&(ce=[...H.layoutRefs]),M==="Layout"||M==="Both")if(r&&r.length>0)r.forEach(te=>{let ne=ce.findIndex(ee=>ee.tableKey===te.tableKey);ne>=0?ce[ne]=te:ce.push(te);});else {let te={tableKey:t,layoutId:a||null},ne=ce.findIndex(ee=>ee.tableKey===t);ne>=0?ce[ne]=te:ce.push(te);}if(I={appId:e,tableKey:t,...D,scope:M,id:T,createdAt:new Date().toISOString(),filters:V,layout:J,layoutRefs:ce},i)await i.saveVariant(I,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(I)})).ok)throw new Error(f("variant.toast.saveFailed"))}else {let ne=u.some(ee=>ee.id===T)?u.map(ee=>ee.id===T?I:ee):[...u,I];h(ne),S(ne);}l&&l(f("variant.toast.saveSuccess")),(i||c)&&await R(),y(T),n(I);}catch(M){console.error("Error saving variant",M);let V=u.some(J=>J.id===T)?u.map(J=>J.id===T?I:J):[...u,I];h(V),S(V),y(T),n(I),d&&d(f("variant.toast.saveFailed"));}},onDelete:async D=>{try{if(i)await i.deleteVariant(D);else if(c){if(!(await fetch(`${c}/api/variants/${D}`,{method:"DELETE"})).ok)throw new Error(f("variant.toast.deleteFailed"))}else {let T=u.filter(I=>I.id!==D);h(T),S(T);}m===D&&y(""),(i||c)&&R(),l&&l(f("variant.toast.deleteSuccess"));}catch(T){console.error("Error deleting variant",T);let I=u.filter(M=>M.id!==D);h(I),S(I),m===D&&y(""),d&&d(f("variant.toast.deleteFailed"));}},onSetDefault:async D=>{try{let T=u.find(M=>M.id===D);if(!T)return;let I={appId:e,tableKey:t,...T,isDefault:!0};if(i)await i.setDefaultVariant(D,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(I)})).ok)throw new Error(f("variant.toast.defaultFailed"))}else {let M=u.map(H=>({...H,isDefault:H.id===D}));h(M),S(M);}(i||c)&&await R(),l&&l(f("variant.toast.defaultSuccess"));}catch(T){console.error("Error setting default variant",T);let I=u.map(M=>({...M,isDefault:M.id===D}));h(I),S(I),d&&d(f("variant.toast.defaultFailed"));}}})};_a__default.default.extend(qy__default.default);_a__default.default.extend(_y__default.default);var jy=[null,null],Hl="0.85rem",Zy={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},Xy=material.styled(PickersDay.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%"}})),bp=({label:e,value:t=jy,onChange:o})=>{let{t:a,locale:r}=Q(),n=Zy[r]||"en",i=e||a("dateRange.label"),[c,d]=ht.useState(null),[l,s]=ht.useState(t),[g,f]=ht.useState("start"),[u,h]=ht.useState(null),[v,p]=ht.useState((t[0]||_a__default.default()).locale(n)),C=ht__namespace.default.useRef(t);ht.useEffect(()=>{let[T,I]=t,[M,H]=C.current,V=te=>te&&typeof te.isSame=="function",J=!(T===null&&M===null||V(T)&&V(M)&&T.isSame(M,"day")),ce=!(I===null&&H===null||V(I)&&V(H)&&I.isSame(H,"day"));(J||ce)&&(s(t),t[0]&&V(t[0])&&p(t[0].locale(n))),C.current=t;},[t,n]);let m=T=>{d(T.currentTarget);},y=()=>{d(null),f("start"),h(null);},x=!!c,S=T=>{if(!T)return;let I=[...l];if(g==="start")I=[T,null],f("end");else {let M=I[0];M&&T.isBefore(M)?(I=[T,null],f("end")):(I=[M,T],f("start"));}s(I);},B=T=>{let I=_a__default.default().locale(n),M=[null,null];switch(T){case "today":M=[I,I];break;case "week":M=[I.startOf("week"),I.endOf("week")];break;case "month":M=[I.startOf("month"),I.endOf("month")];break}s(M),f("start"),p(I);},R=()=>{s([null,null]),f("start"),p(_a__default.default().locale(n));},w=()=>{o&&o(l),y();},A=()=>{s(t),f("start"),y();},P=ht.useCallback(T=>{let{day:I,...M}=T,[H,V]=l,J=H?I.isSame(H,"day"):false,ce=V?I.isSame(V,"day"):false,te=H&&V?I.isBetween(H,V,"day","()"):false,ne=false;return g==="end"&&H&&!V&&u&&I.isAfter(H,"day")&&I.isBefore(u.add(1,"day"),"day")&&(ne=true),jsxRuntime.jsx(Xy,{...M,day:I,disableMargin:true,isStart:J,isEnd:ce,isInRange:te||ne,onMouseEnter:()=>h(I)})},[l,g,u]),k=T=>T?T.locale(n).format("YYYY-MM-DD"):"",D=T=>T?T.locale(n).format("ll"):"";return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.TextField,{label:i,value:l[0]?`${k(l[0])} - ${k(l[1])}`:"",onClick:m,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Hl}},InputProps:{readOnly:true,sx:{fontSize:Hl,"& .MuiOutlinedInput-input":{fontSize:Hl},paddingRight:"4px"},endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",sx:{ml:0},children:[(l[0]||l[1])&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:T=>{T.stopPropagation(),R();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsxRuntime.jsx(Uy__default.default,{sx:{fontSize:"1rem"}})}),jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end",onClick:m,sx:{padding:"2px"},children:jsxRuntime.jsx(Gy__default.default,{sx:{fontSize:"1rem"},color:"action"})})]})}}),jsxRuntime.jsxs(material.Popover,{open:x,anchorEl:c,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{display:"flex",flexDirection:"column",p:0,minWidth:320}}},children:[jsxRuntime.jsx(material.Box,{sx:{p:2,bgcolor:"background.default",borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:2,justifyContent:"space-between",children:[jsxRuntime.jsxs(material.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:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",display:"block",children:a("dateRange.startDate")}),jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:500,children:l[0]?D(l[0]):a("dateRange.select")})]}),jsxRuntime.jsx(Ky__default.default,{color:"action",fontSize:"small"}),jsxRuntime.jsxs(material.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:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",display:"block",children:a("dateRange.endDate")}),jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:500,children:l[1]?D(l[1]):a("dateRange.select")})]})]})}),jsxRuntime.jsx(material.Box,{sx:{p:2,pb:0},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",children:[jsxRuntime.jsx(material.Chip,{label:a("dateRange.today"),onClick:()=>B("today"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:a("dateRange.thisWeek"),onClick:()=>B("week"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:a("dateRange.thisMonth"),onClick:()=>B("month"),clickable:true,size:"small",variant:"outlined"})]})}),jsxRuntime.jsx(LocalizationProvider.LocalizationProvider,{dateAdapter:AdapterDayjs.AdapterDayjs,adapterLocale:n,children:jsxRuntime.jsx(DateCalendar.DateCalendar,{value:null,referenceDate:v,onMonthChange:p,onYearChange:p,onChange:S,slots:{day:P},views:["day"],showDaysOutsideCurrentMonth:true,sx:{m:0}})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[jsxRuntime.jsx(material.Button,{size:"small",onClick:A,color:"inherit",children:a("common.cancel")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"contained",onClick:w,children:a("common.done")})]})]})]})};var es={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},sb={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"},lb=["equals","contains","notContains","wildcard"],Cp=["=","!=",">","<",">=","<=","between"],dt="0.85rem",cb=({field:e,value:t,onChange:o})=>{let{t:a}=Q(),[r,n]=ht.useState(null),[i,c]=ht.useState(null),[d,l]=ht.useState(""),[s,g]=ht.useState(""),[f,u]=ht.useState(false),[h,v]=ht.useState(""),[p,C]=ht.useState("");ht.useEffect(()=>{let k=setTimeout(()=>{C(h);},1e3);return ()=>clearTimeout(k)},[h]);let m=t?.operator||(e.type==="number"?"=":"equals"),y=t?.value,x=k=>{let D=sb[k];return D?a(D):k},S=k=>{n(k.currentTarget);},B=k=>{o({...t,operator:k,value:y}),n(null);},R={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:dt}},InputProps:{sx:{fontSize:dt}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:dt,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},w=e.type||"text";if(w==="date"){let D=(T=>{if(!T)return [null,null];if(Array.isArray(T)&&T.length===2){let I=T[0]?_a__default.default.isDayjs(T[0])?T[0]:_a__default.default(T[0]):null,M=T[1]?_a__default.default.isDayjs(T[1])?T[1]:_a__default.default(T[1]):null;return [I,M]}return _a__default.default.isDayjs(T)||typeof T=="string"?[_a__default.default.isDayjs(T)?T:_a__default.default(T),null]:[null,null]})(y);return jsxRuntime.jsx(bp,{label:e.label,value:D,onChange:T=>o({value:T,operator:"between"})})}if(w==="number"&&m==="between"){let k=()=>{o({value:[d,s],operator:"between"}),c(null);},D=Array.isArray(y)?`${y[0]||""} - ${y[1]||""}`:"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...R,label:e.label,value:D,placeholder:a("smartFilter.minMaxPlaceholder"),InputProps:{...R.InputProps,startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:x("between"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:S,sx:{width:24,height:24,fontSize:dt},children:es.between})})}),readOnly:true},onClick:T=>c(T.currentTarget)}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:dt,minHeight:"auto",py:.5}}},children:Cp.map(T=>jsxRuntime.jsxs(material.MenuItem,{selected:T===m,onClick:()=>B(T),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:es[T]}),jsxRuntime.jsx(material.ListItemText,{primary:x(T),primaryTypographyProps:{fontSize:dt}})]},T))}),jsxRuntime.jsx(material.Popover,{open:!!i,anchorEl:i,onClose:()=>c(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[jsxRuntime.jsx(material.TextField,{size:"small",label:a("smartFilter.min"),type:"number",value:d,onChange:T=>l(T.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:dt}},InputProps:{sx:{fontSize:dt}}}),jsxRuntime.jsx(ib__default.default,{color:"action"}),jsxRuntime.jsx(material.TextField,{size:"small",label:a("smartFilter.max"),type:"number",value:s,onChange:T=>g(T.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:dt}},InputProps:{sx:{fontSize:dt}}}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:k,children:a("common.ok")})]})})]})}if(w==="select")return jsxRuntime.jsxs(material.TextField,{...R,select:true,label:e.label,value:y||"",onChange:k=>o({...t,value:k.target.value,operator:"equals"}),children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:jsxRuntime.jsx("em",{children:a("common.none")})}),e.options?.map(k=>jsxRuntime.jsx(material.MenuItem,{value:k.value,children:k.label},k.value))]});if(w==="multi-select"){let k=Array.isArray(y)?y:[],D=e.options?.filter(T=>T.label.toLowerCase().includes(p.toLowerCase()))||[];return jsxRuntime.jsxs(material.TextField,{...R,select:true,label:e.label,value:k,onChange:T=>o({...t,value:T.target.value,operator:"anyOf"}),SelectProps:{...R.SelectProps,multiple:true,onClose:()=>{v(""),C("");},renderValue:T=>{if(!Array.isArray(T)||T.length===0)return jsxRuntime.jsx("em",{children:a("common.none")});let I=H=>e.options?.find(V=>V.value===H)?.label||H,M=T.map(I);return M.length>2?`${M.slice(0,2).join(", ")} +${M.length-2}`:M.join(", ")}},children:[jsxRuntime.jsx(material.ListSubheader,{children:jsxRuntime.jsx(material.TextField,{size:"small",autoFocus:true,placeholder:a("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(vp__default.default,{fontSize:"small"})}),sx:{fontSize:dt}},value:h,onChange:T=>v(T.target.value),onKeyDown:T=>{T.key!=="Escape"&&T.stopPropagation();},onClick:T=>T.stopPropagation()})}),D.length>0?D.map(T=>jsxRuntime.jsxs(material.MenuItem,{value:T.value,children:[jsxRuntime.jsx(material.Checkbox,{checked:k.indexOf(T.value)>-1,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:T.label,primaryTypographyProps:{fontSize:dt}})]},T.value)):jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:a("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:dt}})})]})}let A=w==="number"?Cp:lb,P=f||y!==void 0&&y!==""&&y!==null||!!r;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...R,label:e.label,sx:{minWidth:"120px"},value:y||"",type:w==="number"?"number":"text",onChange:k=>o({...t,value:k.target.value,operator:m}),onFocus:()=>u(true),onBlur:()=>u(false),InputProps:{...R.InputProps,startAdornment:P?jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:x(m),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:S,onMouseDown:k=>k.preventDefault(),sx:{width:24,height:24,fontSize:dt,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:es[m]})})}):null,endAdornment:e.hasSearchIcon?jsxRuntime.jsx(material.InputAdornment,{position:"end",children:jsxRuntime.jsx(vp__default.default,{color:"action"})}):void 0}}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:dt,minHeight:"auto",py:.5}}},children:A.map(k=>jsxRuntime.jsxs(material.MenuItem,{selected:k===m,onClick:()=>B(k),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:es[k]}),jsxRuntime.jsx(material.ListItemText,{primary:x(k),primaryTypographyProps:{fontSize:dt}})]},k))})]})},ca=({fields:e,filters:t,onFilterChange:o,variants:a=[],currentVariantId:r,onVariantLoad:n,onVariantSave:i,onVariantDelete:c,onVariantSetDefault:d,onSearch:l,loading:s=false,appId:g,tableKey:f,currentLayout:u,currentLayoutId:h,layoutRefs:v,variantService:p,serviceUrl:C})=>{let{t:m}=Q(),[y,x]=ht.useState(true),[S,B]=ht.useState(null),[R,w]=ht.useState(e.filter(D=>!D.hidden).map(D=>D.id)),A=(D,T)=>{o({...t,[D]:T});},P=D=>{R.includes(D)?w(R.filter(T=>T!==D)):w([...R,D]);};return jsxRuntime.jsxs(material.Paper,{sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[g?jsxRuntime.jsx(fp,{appId:g,tableKey:f,currentFilters:{values:t,visibleFields:R},currentLayout:u,currentLayoutId:h,layoutRefs:v,onLoad:D=>{if(!D.filters)return;let T=null;if(Array.isArray(D.filters)){let I=f||"default",M=D.filters.find(H=>H.scope===I);T=M?M.filters:null;}else T=D.filters;T&&(T.values||T.visibleFields?(T.visibleFields&&Array.isArray(T.visibleFields)&&w(T.visibleFields),T.values&&o(T.values)):o(T)),n&&n(D);},variantService:p,serviceUrl:C,currentVariantId:r}):jsxRuntime.jsx(Xi,{variants:a,currentVariantId:r,onLoad:n,onSave:D=>{i&&i({...D,filters:{values:t,visibleFields:R}});},onDelete:c,onSetDefault:d}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Tooltip,{title:m("smartFilter.addFilters"),children:jsxRuntime.jsx(material.Button,{onClick:D=>B(D.currentTarget),size:"small",color:"primary",startIcon:jsxRuntime.jsx(ab__default.default,{fontSize:"small"}),sx:{textTransform:"none",fontSize:dt,whiteSpace:"nowrap",minWidth:"fit-content"},children:m("smartFilter.adaptFilters")})}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:l,disabled:s,sx:{minWidth:"52px",fontWeight:"bold",fontSize:dt},children:m(s?"common.loading":"smartFilter.go")}),jsxRuntime.jsxs(material.Menu,{anchorEl:S,open:!!S,onClose:()=>B(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:dt,minHeight:32}}}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:m("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:dt}})}),jsxRuntime.jsx(material.Divider,{}),e.map(D=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>P(D.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:R.includes(D.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:D.label,primaryTypographyProps:{fontSize:dt}})]},D.id))]})]})]}),jsxRuntime.jsx(material.Collapse,{in:y,children:jsxRuntime.jsx(material.Box,{sx:{px:2,pb:2},children:jsxRuntime.jsx(material.Grid,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:e.filter(D=>R.includes(D.id)).map(D=>jsxRuntime.jsx(material.Grid,{size:1,children:jsxRuntime.jsx(cb,{field:D,value:t[D.id]||{value:"",operator:D.type==="number"?"=":"equals"},onChange:T=>A(D.id,T)})},D.id))})})}),jsxRuntime.jsx(material.Box,{sx:{position:"absolute",bottom:0,left:"50%",transform:"translate(-50%, 50%)",zIndex:10},children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>x(!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?jsxRuntime.jsx(rb__default.default,{sx:{fontSize:16},color:"action"}):jsxRuntime.jsx(ch__default.default,{sx:{fontSize:16},color:"action"})})})]})};var Dp=({layouts:e,currentLayoutId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=Q(),[c,d]=ht.useState(null),[l,s]=ht.useState(false),[g,f]=ht.useState(""),[u,h]=ht.useState(""),[v,p]=ht.useState({isDefault:false,isPublic:false}),C=e.find(R=>R.id===t),m=R=>{d(R.currentTarget);},y=()=>{d(null);},x=R=>{o(R),y();},S=()=>{f(""),h(""),p({isDefault:false,isPublic:false}),s(true),y();},B=()=>{g.trim()&&(a({name:g,description:u,...v}),s(false));};return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Tooltip,{title:i("layout.saveLayout"),children:jsxRuntime.jsx(material.IconButton,{onClick:S,color:"primary",size:"small",children:jsxRuntime.jsx(Rp__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:i("layout.layoutOptions"),children:jsxRuntime.jsx(material.IconButton,{onClick:m,color:C?"primary":"default",children:jsxRuntime.jsx(Cb__default.default,{})})}),jsxRuntime.jsxs(material.Menu,{anchorEl:c,open:!!c,onClose:y,PaperProps:{sx:{width:320,maxHeight:400}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.Typography,{variant:"caption",children:i("layout.selectLayout")})}),jsxRuntime.jsxs(material.MenuItem,{onClick:S,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Rp__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i("layout.saveCurrentLayout")})]}),jsxRuntime.jsx(material.Divider,{}),e.length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:i("layout.noSavedLayouts")})}),e.map((R,w)=>jsxRuntime.jsx(material.MenuItem,{onClick:()=>x(R),selected:R.id===t,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:R.id===t?"bold":"normal",noWrap:true,children:R.name})}),R.description&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,children:R.description})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center"},onClick:A=>A.stopPropagation(),children:[jsxRuntime.jsx(material.Tooltip,{title:R.isDefault?i("layout.removeDefault"):i("layout.setAsDefault"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:A=>{A.stopPropagation(),n(R.id);},children:R.isDefault?jsxRuntime.jsx(Ry__default.default,{fontSize:"small",color:"warning"}):jsxRuntime.jsx(vb__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.Tooltip,{title:i("common.delete"),children:jsxRuntime.jsx(material.IconButton,{size:"small",color:"error",onClick:A=>{A.stopPropagation(),r(R.id);},children:jsxRuntime.jsx(Uf__default.default,{fontSize:"small"})})})]})]})},R.id||w))]}),jsxRuntime.jsxs(material.Dialog,{open:l,onClose:()=>s(false),maxWidth:"xs",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:i("layout.saveLayout")}),jsxRuntime.jsx(material.DialogContent,{children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[jsxRuntime.jsx(material.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)&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"warning.main",sx:{ml:1},children:i("layout.warningOverwrite")}),jsxRuntime.jsx(material.TextField,{label:i("layout.layoutDescription"),value:u,onChange:R=>h(R.target.value),fullWidth:true,size:"small"}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:v.isDefault,onChange:R=>p({...v,isDefault:R.target.checked})}),label:i("layout.useAsDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:v.isPublic,onChange:R=>p({...v,isPublic:R.target.checked})}),label:i("layout.publicAllUsers")})]})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>s(false),children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:B,variant:"contained",disabled:!g,children:i("common.save")})]})]})]})};var rs=({appId:e,tableKey:t="default",currentLayoutData:o,onLayoutLoad:a,targetLayoutId:r,activeLayoutId:n,serviceUrl:i,onError:c,onSuccess:d})=>{let{t:l}=Q(),[s,g]=ht.useState([]),[f,u]=ht.useState(""),h=`orbcafe.layouts.${e}.${t}`,v=w=>({id:w.layoutId,name:w.name,description:w.description??"",isDefault:!!w.isDefault,isPublic:!!w.isPublic,createdAt:w.createdAt??new Date().toISOString(),layoutData:w.layout??{}}),p=w=>({appId:e,tableKey:t,layoutId:w.id,name:w.name,description:w.description??"",isDefault:!!w.isDefault,isPublic:!!w.isPublic,createdAt:w.createdAt,layout:w.layoutData}),C=ht.useCallback(()=>{try{let w=localStorage.getItem(h);if(!w)return [];let A=JSON.parse(w);return Array.isArray(A)?A:[]}catch{return []}},[h]),m=ht.useCallback(w=>{try{localStorage.setItem(h,JSON.stringify(w));}catch{}},[h]);ht.useEffect(()=>{n!==void 0&&u(n);},[n]),ht.useEffect(()=>{if(r&&s.length>0){let w=s.find(A=>A.id===r);w&&(u(w.id),a(w));}},[r,s,a]);let y=ht.useCallback(async()=>{if(e){if(!i){let w=C();g(w);let A=w.find(P=>P.isDefault);A&&!f&&!r&&(u(A.id),a(A));return}try{let w=await fetch(`${i}/api/layouts?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!w.ok)throw new Error("LAYOUT_FETCH_FAILED");let P=(await w.json()).map(v);g(P);let k=P.find(D=>D.isDefault);k&&!f&&!r&&(u(k.id),a(k));}catch(w){console.error("Error fetching layouts",w);let A=C();g(A);let P=A.find(k=>k.isDefault);P&&!f&&!r&&(u(P.id),a(P)),c&&c(l("layout.toast.loadFallback"));}}},[e,t,i,c,f,a,r,C,l]);return ht.useEffect(()=>{y();},[e,t]),jsxRuntime.jsx(Dp,{layouts:s,currentLayoutId:f,onLoad:w=>{u(w.id),a(w);},onSave:async w=>{let A=s.find(D=>D.name===w.name),P=A?A.id:Date.now().toString(),k={id:P,...w,createdAt:new Date().toISOString(),layoutData:o,isDefault:w.isDefault??false,isPublic:w.isPublic??false};if(!i){let T=s.some(I=>I.id===P)?s.map(I=>I.id===P?k:I):[...s,k];g(T),m(T),u(P),a(k),d&&d(l("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p(k))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(l("layout.toast.saveSuccess")),await y(),u(P),a(k);}catch(D){console.error("Error saving layout",D);let I=s.some(M=>M.id===P)?s.map(M=>M.id===P?k:M):[...s,k];g(I),m(I),u(P),a(k),d&&d(l("layout.toast.saveLocalSuccess")),c&&c(l("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async w=>{if(!i){let A=s.filter(P=>P.id!==w);g(A),m(A),f===w&&u(""),d&&d(l("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts/${encodeURIComponent(w)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f===w&&u(""),d&&d(l("layout.toast.deleteSuccess")),await y();}catch(A){console.error("Error deleting layout",A);let P=s.filter(k=>k.id!==w);g(P),m(P),f===w&&u(""),d&&d(l("layout.toast.deleteLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async w=>{if(!i){let A=s.map(P=>({...P,isDefault:P.id===w}));g(A),m(A),d&&d(l("layout.toast.defaultLocalSuccess"));return}try{let A=s.find(k=>k.id===w);if(!A)return;if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p({...A,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(l("layout.toast.defaultSuccess")),await y();}catch(A){console.error("Error setting default",A);let P=s.map(k=>({...k,isDefault:k.id===w}));g(P),m(P),d&&d(l("layout.toast.defaultLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDefaultLocal"));}}})};var Ap=(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},ns=(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 Bp(e,t,o){return t[o]<e[o]?-1:t[o]>e[o]?1:0}function Sb(e,t){return e==="desc"?(o,a)=>Bp(o,a,t):(o,a)=>-Bp(o,a,t)}function wb(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 Yr=e=>{let t=ht.useCallback(z=>{let G=String(z?.label??z?.id??"").length*9+64,ue=typeof z?.minWidth=="number"?z.minWidth:0;return Math.max(100,ue,G)},[]),o=ht.useCallback(()=>(e.columns||[]).filter(z=>!!z?.numeric).map(z=>z.id),[e.columns]),[a,r]=ht.useState(""),[n,i]=ht.useState(e.order||"asc"),[c,d]=ht.useState(e.orderBy||""),[l,s]=ht.useState(e.page||0),[g,f]=ht.useState(e.rowsPerPage||20),[u,h]=ht.useState(e.selected||[]),[v,p]=ht.useState(e.columns?e.columns.map(z=>z.id):[]),[C,m]=ht.useState(e.showSummary||false),[y,x]=ht.useState(()=>o()),[S,B]=ht.useState([]),[R,w]=ht.useState(new Set),[A,P]=ht.useState(()=>{let z={};return (e.columns||[]).forEach(W=>{z[W.id]=t(W);}),z}),[k,D]=ht.useState(null),[T,I]=ht.useState(null),[M,H]=ht.useState(null),[V,J]=ht.useState(null),[ce,te]=ht.useState(false),[ne,ee]=ht.useState(""),[Y,Ze]=ht.useState("");ht.useEffect(()=>{e.layout&&L(e.layout);},[e.layout]),ht.useEffect(()=>{e.order!==void 0&&i(e.order),e.orderBy!==void 0&&d(e.orderBy);},[e.order,e.orderBy]),ht.useEffect(()=>{e.selected!==void 0&&h(e.selected);},[e.selected]),ht.useEffect(()=>{e.page!==void 0&&s(e.page);},[e.page]),ht.useEffect(()=>{e.rowsPerPage!==void 0&&f(e.rowsPerPage);},[e.rowsPerPage]),ht.useEffect(()=>{let z=o();x(W=>W.filter(ue=>z.includes(ue)));},[o]),ht.useEffect(()=>{P(z=>{let W={...z};return (e.columns||[]).forEach(G=>{W[G.id]===void 0&&(W[G.id]=t(G));}),W});},[e.columns,t]);let Ue=ht.useMemo(()=>{let z=e.rows||[];return a&&(z=z.filter(W=>Object.keys(W).some(G=>String(W[G]).toLowerCase().includes(a.toLowerCase())))),z},[e.rows,a]),ie=ht.useMemo(()=>e.onSortChange||!c?Ue:wb(Ue,Sb(n,c)),[Ue,n,c,e.onSortChange]),Ie=ht.useCallback(z=>{if(S.length===0)return z.map(Se=>({type:"row",data:Se,id:Se[e.rowKey||"id"]}));let W=[...z].sort((Se,ge)=>{for(let Pe of S){if(Se[Pe]<ge[Pe])return -1;if(Se[Pe]>ge[Pe])return 1}return 0}),G=(Se,ge=0)=>{if(ge>=S.length)return Se;let Pe=S[ge],he={},ze=[];return Se.forEach(Be=>{let we=Be[Pe],Me=`${Pe}:${we}`;he[Me]||(he[Me]={key:Me,field:Pe,value:we,children:[],count:0,level:ge},ze.push(he[Me])),he[Me].children.push(Be),he[Me].count++;}),ze.forEach(Be=>{Be.children&&(Be.children=G(Be.children,ge+1));}),ze},ue=G(W),oe=(Se,ge="")=>{let Pe=[];return Se.forEach(he=>{if(he.children){let ze=ge?`${ge}>${he.key}`:he.key,Be=R.has(ze);Pe.push({type:"group",id:ze,field:he.field,value:he.value,level:he.level,count:he.count,isExpanded:Be,childIds:(function we(Me){let Tt=[];return Me.children.forEach(Io=>{Io.children?Tt=Tt.concat(we(Io)):Tt.push(Io[e.rowKey||"id"]);}),Tt})(he)}),Be&&(Pe=Pe.concat(oe(he.children,ze)));}else Pe.push({type:"row",data:he,id:he[e.rowKey||"id"],level:S.length});}),Pe};return oe(ue)},[S,R,e.rowKey]),Fe=ht.useCallback(z=>{if(S.length===0)return [];let W=[...z].sort((oe,Se)=>{for(let ge of S){if(oe[ge]<Se[ge])return -1;if(oe[ge]>Se[ge])return 1}return 0}),G=[],ue=(oe,Se,ge)=>{if(Se>=S.length)return;let Pe=S[Se],he=new Map;oe.forEach(ze=>{let Be=ze[Pe],we=he.get(Be);we?we.push(ze):he.set(Be,[ze]);}),he.forEach((ze,Be)=>{let we=`${Pe}:${Be}`,Me=ge?`${ge}>${we}`:we;G.push(Me),ue(ze,Se+1,Me);});};return ue(W,0,""),G},[S]),Oe=ht.useMemo(()=>Ie(ie),[ie,Ie]),nt=ht.useMemo(()=>Fe(ie),[ie,Fe]),Le=ht.useMemo(()=>{let z=(e.rows||[]).length;return typeof e.count=="number"&&e.count>z},[e.count,e.rows]),Xe=ht.useMemo(()=>Le?Oe:g>0?Oe.slice(l*g,l*g+g):Oe,[Oe,l,g,Le]),Zt=ht.useMemo(()=>Le&&typeof e.count=="number"?e.count:Oe.length,[Oe.length,Le,e.count]),zt=z=>{w(W=>{let G=new Set(W);return G.has(z)?G.delete(z):G.add(z),G});},Qe=z=>{let W=nt.filter(G=>G===z||G.startsWith(`${z}>`));w(G=>{let ue=new Set(G);return W.forEach(oe=>ue.add(oe)),ue});},lt=z=>{w(W=>{let G=new Set(W);return Array.from(G).forEach(ue=>{(ue===z||ue.startsWith(`${z}>`))&&G.delete(ue);}),G});},mt=z=>{if(!z){w(new Set);return}w(new Set(nt));},_e=z=>{let W=nt.filter(G=>G.startsWith(`${z}>`));return W.length===0?R.has(z):R.has(z)&&W.every(G=>R.has(G))},K=z=>{let W=c===z&&n==="asc",G=c===z&&n==="desc";if(e.onSortChange){W?e.onSortChange(z,"desc"):G?e.onSortChange("","asc"):e.onSortChange(z,"asc");return}W?(i("desc"),d(z)):G?(i("asc"),d("")):(i("asc"),d(z));},Ce=(z,W)=>{P(G=>({...G,[z]:W}));},fe=z=>{if(z.target.checked){let W=Ue.map(G=>G[e.rowKey||"id"]);h(W),e.onSelectionChange&&e.onSelectionChange(W);return}h([]),e.onSelectionChange&&e.onSelectionChange([]);},be=(z,W)=>{let G=W[e.rowKey||"id"],ue=u.indexOf(G),oe=[];ue===-1?oe=oe.concat(u,G):ue===0?oe=oe.concat(u.slice(1)):ue===u.length-1?oe=oe.concat(u.slice(0,-1)):ue>0&&(oe=oe.concat(u.slice(0,ue),u.slice(ue+1))),h(oe),e.onSelectionChange&&e.onSelectionChange(oe);},Ne=z=>{s(z),e.onPageChange&&e.onPageChange(z);},Ve=z=>{f(z),s(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(z);},Ht=z=>{let W=v.indexOf(z),G=[...v];W===-1?G.push(z):G.splice(W,1),p(G);},Nt=z=>{let W=S.indexOf(z),G=[...S];W===-1?G.push(z):G.splice(W,1),B(G);},Xt=z=>{o().includes(z)&&x(G=>G.includes(z)?G.filter(ue=>ue!==z):[...G,z]);},Qt=z=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:v,order:n,orderBy:c,grouping:S,columnWidths:A,showSummary:C,summaryColumns:y});},Yt=z=>{let{layout:W,layoutId:G}=ns(z,e.tableKey||"default");G?(Ze(G),ee(G)):(Ze(""),ee("")),W&&(W.visibleColumns&&p(W.visibleColumns),W.order&&i(W.order),W.orderBy&&d(W.orderBy),W.grouping&&B(W.grouping),W.columnWidths&&P(W.columnWidths),W.showSummary!==void 0&&m(!!W.showSummary),Array.isArray(W.summaryColumns)&&x(W.summaryColumns));},L=z=>{let W=z?.layoutData||z?.layout||z||{};W.visibleColumns&&p(W.visibleColumns),W.order&&i(W.order),W.orderBy!==void 0&&d(W.orderBy),W.grouping&&B(W.grouping),W.columnWidths&&P(W.columnWidths),W.showSummary!==void 0&&m(!!W.showSummary),Array.isArray(W.summaryColumns)&&x(W.summaryColumns),w(new Set),s(0),z?.id&&ee(z.id),Ze("");};ht.useEffect(()=>{e.layout&&Yt({layout:e.layout});},[e.layout]);let $=z=>{z.preventDefault(),J(V===null?{mouseX:z.clientX+2,mouseY:z.clientY-6}:null);},j=()=>{J(null);},_=ht.useMemo(()=>{if(!C)return {};let z={};e.columns.forEach(G=>{if(G.numeric&&y.includes(G.id)){let ue=Ue.reduce((oe,Se)=>{let ge=parseFloat(Se[G.id]);return oe+(isNaN(ge)?0:ge)},0);z[G.id]=ue.toFixed(2);}else z[G.id]="";});let W=e.columns.find(G=>v.includes(G.id));return W&&!W.numeric&&(z[W.id]="Total"),z},[Ue,e.columns,C,y,v]),ke=()=>{if(!e.columns||!Ue)return;let z=e.columns.map(Se=>Se.label).join(","),W=Ue.map(Se=>e.columns.map(ge=>{let Pe=Se[ge.id];return `"${(Pe==null?"":String(Pe)).replace(/"/g,'""')}"`}).join(",")).join(`
184
+ `),G=`data:text/csv;charset=utf-8,${z}
185
+ ${W}`,ue=encodeURI(G),oe=document.createElement("a");oe.setAttribute("href",ue),oe.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(oe),oe.click(),document.body.removeChild(oe);},Ee=()=>{te(true);},Ye=()=>{te(false);};return {isMobile:false,columns:e.columns,order:n,setOrder:i,orderBy:c,setOrderBy:d,filterText:a,setFilterText:r,visibleColumns:v,setVisibleColumns:p,showSummary:C,setShowSummary:m,summaryColumns:y,grouping:S,setGrouping:B,expandedGroups:R,setExpandedGroups:w,groupAnchorEl:T,setGroupAnchorEl:I,summaryAnchorEl:M,setSummaryAnchorEl:H,columnWidths:A,setColumnWidths:P,anchorEl:k,setAnchorEl:D,contextMenu:V,setContextMenu:J,sensors:void 0,sortedAndFilteredRows:ie,visibleRows:Xe,summaryRow:_,page:l,setPage:Ne,rowsPerPage:g,setRowsPerPage:Ve,totalDisplayCount:Zt,selected:u,setSelected:h,isAllExpanded:nt.length>0&&nt.every(z=>R.has(z)),handleColumnResize:Ce,handleRequestSort:K,handleSelectAllClick:fe,handleClick:be,toggleSummaryColumn:Xt,handleDragEnd:()=>{},handleExport:ke,handleContextMenu:$,handleCloseContextMenu:j,toggleColumnVisibility:Ht,toggleGroupExpand:zt,toggleGroupField:Nt,handleToggleAll:mt,handleExpandGroupRecursively:Qe,handleCollapseGroupRecursively:lt,isGroupFullyExpanded:_e,handleLayoutLoad:L,handleVariantLoad:Yt,handleLayoutSave:Qt,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:v,order:n,orderBy:c,grouping:S,columnWidths:A,showSummary:C,summaryColumns:y},currentLayoutId:ne,layoutIdToLoad:Y,onPageChange:Ne,onRowsPerPageChange:Ve,graphReportOpen:ce,handleOpenGraphReport:Ee,handleCloseGraphReport:Ye}};var _D=e=>jsxRuntime.jsx(Pb__default.default,{...e}),jD=e=>jsxRuntime.jsx(Tl__default.default,{...e}),ZD=e=>jsxRuntime.jsx(Op__default.default,{...e}),XD=e=>jsxRuntime.jsx(Xf__default.default,{...e}),QD=e=>jsxRuntime.jsx(Qf__default.default,{...e}),La=e=>{let{t}=Q(),o="0.85rem",{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:l,fitContainer:s=false,fullWidth:g=false,maxHeight:f,loading:u=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:v,filterConfig:p,rowKey:C,tableKey:m="default",graphReport:y,quickCreate:x,quickEdit:S,quickDelete:B,serviceUrl:R}=e,w=a||t("table.title.default"),{isMobile:A,columns:P,order:k,orderBy:D,filterText:T,setFilterText:I,visibleColumns:M,showSummary:H,setShowSummary:V,summaryColumns:J,grouping:ce,setGrouping:te,expandedGroups:ne,groupAnchorEl:ee,setGroupAnchorEl:Y,summaryAnchorEl:Ze,setSummaryAnchorEl:Ue,columnWidths:ie,anchorEl:Ie,setAnchorEl:Fe,contextMenu:Oe,sensors:nt,sortedAndFilteredRows:Le,summaryRow:Xe,visibleRows:Zt,isAllExpanded:zt,page:Qe,setPage:lt,rowsPerPage:mt,setRowsPerPage:_e,totalDisplayCount:K,setSelected:Ce,handleColumnResize:fe,handleRequestSort:be,handleSelectAllClick:Ne,handleClick:Ve,toggleSummaryColumn:Ht,handleDragEnd:Nt,handleExport:Xt,handleContextMenu:Qt,handleCloseContextMenu:Yt,toggleColumnVisibility:L,toggleGroupExpand:$,toggleGroupField:j,handleToggleAll:_,handleExpandGroupRecursively:ke,handleCollapseGroupRecursively:Ee,isGroupFullyExpanded:Ye,handleLayoutLoad:z,handleVariantLoad:W,handleLayoutSave:G,effectiveAppId:ue,currentLayoutData:oe,currentLayoutId:Se,layoutIdToLoad:ge,graphReportOpen:Pe,handleOpenGraphReport:he,handleCloseGraphReport:ze}=Yr(e),Be=y?.enabled??false,we=Be&&(y?.interaction?.enabled??true),Me=ji(),Tt=!!x?.enabled,Io=!!S?.enabled,Ct=!!B?.enabled,It=x?.fields,bo=x?.excludeFields||[],ka=x?.initialValues||{},[Rr,Po]=ht__namespace.default.useState(false),[ro,Za]=ht__namespace.default.useState(false),[Yo,Gt]=ht__namespace.default.useState({}),[no,Vt]=ht__namespace.default.useState(false),[We,Jo]=ht__namespace.default.useState(false),[$o,ea]=ht__namespace.default.useState({}),[Xa,Ho]=ht__namespace.default.useState(false),[Qa,Ya]=ht__namespace.default.useState(false),Go=u||ro||We||Qa,ta=ht__namespace.default.useMemo(()=>{let N=[...P];if(Array.isArray(It)&&It.length>0){let X=new Set(It);N=N.filter(Z=>X.has(Z.id));}if(bo.length>0){let X=new Set(bo);N=N.filter(Z=>!X.has(Z.id));}return N.filter(X=>!!X?.id)},[P,bo,It]),Sa=C||"id",Ut=ht__namespace.default.useMemo(()=>{let N=new Set(i);return Le.filter(X=>N.has(X?.[Sa]))},[i,Le,Sa]),Ro=Ut.length===1?Ut[0]:null,oa=S?.fields,xo=S?.excludeFields||[],Uo=S?.editableFields||[],Ja=S?.nonEditableFields||[],Dr=S?.primaryKeys?.length?S.primaryKeys:[Sa],wa=ht__namespace.default.useMemo(()=>{let N=[...P];if(Array.isArray(oa)&&oa.length>0){let X=new Set(oa);N=N.filter(Z=>X.has(Z.id));}if(xo.length>0){let X=new Set(xo);N=N.filter(Z=>!X.has(Z.id));}return N.filter(X=>!!X?.id)},[P,xo,oa]),er=ht__namespace.default.useMemo(()=>new Set(Dr),[Dr]),aa=ht__namespace.default.useMemo(()=>new Set(Uo),[Uo]),Jt=ht__namespace.default.useMemo(()=>new Set(Ja),[Ja]),Do=ht__namespace.default.useCallback(N=>aa.size>0?aa.has(N):!(Jt.has(N)||er.has(N)),[aa,Jt,er]);ht__namespace.default.useEffect(()=>{!Pe&&Me.hasActiveFilters&&Me.clearAll();},[Pe,Me.hasActiveFilters,Me.clearAll]);let Mr=()=>{let N={};ta.forEach(X=>{N[X.id]=ka[X.id]??"";}),Gt(N),Po(true);},tr=()=>{ro||Po(false);},Ar=(N,X)=>{Gt(Z=>({...Z,[N]:X}));},Br=async()=>{if(!x?.onSubmit){Po(false);return}try{Za(!0),await x.onSubmit(Yo),Po(!1);}finally{Za(false);}},Er=()=>{if(!Ro)return;let N={};wa.forEach(Z=>{N[Z.id]=Ro[Z.id]??"";});let X=S?.getInitialValues?{...N,...S.getInitialValues(Ro)}:N;ea(X),Vt(true);},io=()=>{We||Vt(false);},Fr=(N,X)=>{ea(Z=>({...Z,[N]:X}));},Lr=async()=>{if(Ro){if(!S?.onSubmit){Vt(false);return}try{Jo(!0),await S.onSubmit($o,Ro),Vt(!1);}finally{Jo(false);}}},or=()=>{Ut.length!==0&&Ho(true);},ra=()=>{Qa||Ho(false);},Ta=async()=>{if(Ut.length===0){Ho(false);return}if(!B?.onConfirm){Ho(false),Ce([]),c?.([]);return}try{Ya(!0),await B.onConfirm(Ut),Ho(!1),Ce([]),c?.([]);}finally{Ya(false);}},Ia=Le,{fieldMapping:b}=jr({rows:Ia,config:{...y,title:y?.title||`${w} ${t("graph.reportTitle")}`}}),E=ht__namespace.default.useMemo(()=>we?Me.applyRows(Ia,b):Ia,[we,Me.applyRows,Ia,b]),{model:F}=jr({rows:E,config:{...y,title:y?.title||`${w} ${t("graph.reportTitle")}`,fieldMapping:b}}),U=F.table.columns.map(N=>({id:N.id,label:N.label,align:N.align||"left",minWidth:120,numeric:N.align==="right"})),re=ue?jsxRuntime.jsx(rs,{appId:ue,tableKey:m,currentLayoutData:oe,onLayoutLoad:z,targetLayoutId:ge,activeLayoutId:Se,serviceUrl:R??p?.serviceUrl}):null,ve=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Nr,{groupAnchorEl:ee,setGroupAnchorEl:Y,grouping:ce,setGrouping:te,columns:P,toggleGroupField:j}),jsxRuntime.jsx(Vr,{anchorEl:Ie,setAnchorEl:Fe,columns:P,visibleColumns:M,toggleColumnVisibility:L}),jsxRuntime.jsx(Di,{anchorEl:Ze,setAnchorEl:Ue,showSummary:H,setShowSummary:V,columns:P,summaryColumns:J,toggleSummaryColumn:Ht}),jsxRuntime.jsx(Mi,{contextMenu:Oe,handleCloseContextMenu:Yt,columns:P,visibleColumns:M,toggleColumnVisibility:L})]});return A?jsxRuntime.jsxs(Un__default.default,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[p&&jsxRuntime.jsx(ca,{fields:p.fields,filters:p.filters,onFilterChange:p.onFilterChange,onSearch:p.onSearch,variants:p.variants||[],currentVariantId:p.currentVariantId,onVariantLoad:p.onVariantLoad,onVariantSave:p.onVariantSave,onVariantDelete:p.onVariantDelete,onVariantSetDefault:p.onVariantSetDefault,appId:p.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:oe}],variantService:p.variantService,serviceUrl:R??p.serviceUrl}),jsxRuntime.jsx(Ld,{title:w,loading:u,showSummary:H,setShowSummary:V,setAnchorEl:Fe,setSummaryAnchorEl:Ue,filterText:T,setFilterText:I,sortedAndFilteredRows:Le,selected:i,columns:P,visibleColumns:M,summaryRow:Xe,handleClick:Ve,selectionMode:n}),ve]}):jsxRuntime.jsxs(Un__default.default,{sx:{width:g?"100%":"auto",mb:s?0:2,...s?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[p&&jsxRuntime.jsx(Un__default.default,{sx:{mb:2},children:jsxRuntime.jsx(ca,{fields:p.fields,filters:p.filters,onFilterChange:p.onFilterChange,onSearch:p.onSearch,variants:p.variants||[],currentVariantId:p.currentVariantId,onVariantLoad:N=>{W(N),p.onVariantLoad&&p.onVariantLoad(N);},onVariantSave:p.onVariantSave,onVariantDelete:p.onVariantDelete,onVariantSetDefault:p.onVariantSetDefault,loading:u,appId:p.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:oe}],currentLayoutId:Se,layoutRefs:[{tableKey:m,layoutId:Se}],variantService:p.variantService,serviceUrl:R??p.serviceUrl})}),jsxRuntime.jsxs(Tb__default.default,{sx:{width:g?"100%":"auto",mb:s?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":Go?{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}:s?{flex:1,minHeight:0,height:"100%"}:{}},children:[r&&jsxRuntime.jsx(wi,{filterText:T,setFilterText:I,onRowsPerPageChange:_e,rowsPerPage:mt,rowsPerPageOptions:h,page:Qe,count:K,onPageChange:lt,actions:d,extraTools:l,grouping:ce,setGroupAnchorEl:Y,showSummary:H,setShowSummary:V,setAnchorEl:Fe,setSummaryAnchorEl:Ue,handleExport:Xt,showCreateButton:Tt,onOpenCreateDialog:Mr,showEditButton:Io,onOpenEditDialog:Er,editDisabled:Ut.length!==1,showDeleteButton:Ct,onOpenDeleteConfirm:or,deleteDisabled:Ut.length===0,onLayoutSave:v||p?.variantService&&p?.appId?G:void 0,loading:u,layoutManager:re,onOpenGraphReport:Be?he:void 0}),jsxRuntime.jsx(Op__default.default,{sx:{flex:1,...f?{maxHeight:f,height:f}:s?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:jsxRuntime.jsx(core.DndContext,{sensors:nt,collisionDetection:core.closestCenter,onDragEnd:Nt,modifiers:[modifiers.restrictToHorizontalAxis],children:jsxRuntime.jsxs(Ib__default.default,{sx:{minWidth:g?750:"auto",width:g?"100%":"auto",tableLayout:Object.keys(ie).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,"& .MuiTableCell-root":{fontSize:o}},"aria-labelledby":"tableTitle",size:"small",stickyHeader:true,children:[jsxRuntime.jsx(Ti,{columns:P,visibleColumns:M,order:k,orderBy:D,onRequestSort:be,onContextMenu:Qt,selectionMode:n,grouping:ce,isAllExpanded:zt,handleToggleAll:_,rowCount:Le.length,numSelected:i.length,onSelectAllClick:Ne,columnWidths:ie,onColumnResize:fe}),jsxRuntime.jsx(Bd,{visibleRows:Zt,columns:P,visibleColumns:M,selectionMode:n,selected:i,orderBy:D,loading:u,expandedGroups:ne,toggleGroupExpand:$,handleExpandGroupRecursively:ke,handleCollapseGroupRecursively:Ee,isGroupFullyExpanded:Ye,handleClick:Ve,onSelectionChange:c,grouping:ce,rowKeyProp:C,page:Qe,rowsPerPage:mt}),H&&jsxRuntime.jsx(Ed,{showSummary:H,columns:P,visibleColumns:M,summaryRow:Xe,selectionMode:n?.toString(),grouping:ce,orderBy:D,zIndex:3})]})})})]}),Tt&&jsxRuntime.jsxs(Ep__default.default,{open:Rr,onClose:tr,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:N=>`1px solid ${N.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(Fp__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:x?.title||t("quickCreate.createWithTitle",{title:w})}),jsxRuntime.jsx(Lp__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(Un__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[ta.map(N=>{let X=N.type==="number"||N.numeric?"number":N.type==="date"?"date":"text",Z=N.label||N.id;return jsxRuntime.jsx(Np__default.default,{label:Z,value:Yo[N.id]??"",onChange:Je=>Ar(N.id,Je.target.value),type:X,size:"small",fullWidth:true,InputLabelProps:{shrink:X==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${N.id}`)}),x?.description&&jsxRuntime.jsx(Vp__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:x.description})]})}),jsxRuntime.jsxs(zp__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(ss__default.default,{onClick:tr,sx:{fontSize:"0.85rem"},disabled:ro,children:x?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(ss__default.default,{onClick:Br,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ro,children:x?.submitLabel||t("common.save")})]})]}),Io&&jsxRuntime.jsxs(Ep__default.default,{open:no,onClose:io,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:N=>`1px solid ${N.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(Fp__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:S?.title||t("quickEdit.editWithTitle",{title:w})}),jsxRuntime.jsx(Lp__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(Un__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[wa.map(N=>{let X=N.type==="number"||N.numeric?"number":N.type==="date"?"date":"text",Z=N.label||N.id,Je=Do(N.id);return jsxRuntime.jsx(Np__default.default,{label:Z,value:$o[N.id]??"",onChange:O=>Fr(N.id,O.target.value),type:X,size:"small",fullWidth:true,disabled:!Je,InputLabelProps:{shrink:X==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${N.id}`)}),S?.description&&jsxRuntime.jsx(Vp__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:S.description})]})}),jsxRuntime.jsxs(zp__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(ss__default.default,{onClick:io,sx:{fontSize:"0.85rem"},disabled:We,children:S?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(ss__default.default,{onClick:Lr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:We||!Ro,children:S?.submitLabel||t("common.save")})]})]}),Ct&&jsxRuntime.jsx(Rn,{open:Xa,type:"warning",title:B?.title||t("quickDelete.confirmTitle"),message:B?.message||(Ut.length>1?t("quickDelete.confirmMessageMultiple",{count:Ut.length}):t("quickDelete.confirmMessageSingle")),confirmText:B?.confirmText||t("common.delete"),cancelText:B?.cancelText||t("common.cancel"),onClose:ra,onConfirm:Ta}),ve,Be&&jsxRuntime.jsx(qi,{open:Pe,onClose:ze,model:F,aiAssistant:y?.aiAssistant,interaction:we?{enabled:true,filters:Me.filters,fieldMapping:b,onPrimaryDimensionClick:N=>Me.setFilter("primaryDimension",N),onSecondaryDimensionClick:N=>Me.setFilter("secondaryDimension",N),onStatusClick:N=>Me.setFilter("status",N),onClearFilter:Me.clearFilter,onClearAll:Me.clearAll}:void 0,tableContent:jsxRuntime.jsx(La,{appId:ue||"graph-report-internal",title:t("graph.dataBody"),columns:U,rows:F.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},YD=La;var nM=({id:e,title:t,hideHeader:o=true,filterConfig:a,tableProps:r,children:n,spacing:i=1,mode:c="separated"})=>{let d=a?{...a,appId:a.appId||e}:void 0,l={...r,appId:r.appId||e};return jsxRuntime.jsxs(Id,{title:t,hideHeader:o,children:[jsxRuntime.jsxs(material.Stack,{spacing:i,sx:{height:"100%",overflow:"hidden"},children:[c==="separated"&&d&&jsxRuntime.jsx(material.Box,{sx:{flexShrink:0},children:jsxRuntime.jsx(ca,{...d})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsx(La,{...l,fitContainer:true,filterConfig:c==="integrated"?d:void 0})})]}),n]})};var pM=({metadata:e,fetchData:t,initialRowsPerPage:o=20,rowsPerPageOptions:a=[20,50,100,-1],tableKey:r="default",mode:n="integrated",serviceUrl:i,variantService:c})=>{let{t:d}=Q(),[l,s]=ht.useState(false),[g,f]=ht.useState([]),[u,h]=ht.useState({}),[v,p]=ht.useState(e.variants||[]),[C,m]=ht.useState(e.layout||null),[y,x]=ht.useState(""),[S,B]=ht.useState(0),[R,w]=ht.useState(0),[A,P]=ht.useState(o),[k,D]=ht.useState([]),[T,I]=ht.useState("asc"),[M,H]=ht.useState("");ht.useEffect(()=>{let ie={};e.filters.forEach(Ie=>{Ie.defaultValue!==void 0&&(ie[Ie.id]=Ie.defaultValue);}),h(ie);},[e.filters]);let V=ht.useCallback(async(ie,Ie,Fe,Oe,nt)=>{s(true);try{let Le={...ie,page:Ie+1,limit:Fe,sort:nt,order:Oe},Xe;t?Xe=await t(Le):typeof e.api=="function"?Xe=await e.api(Le):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,Le),Xe={rows:[],total:0}):(console.warn("No API configured for report"),Xe={rows:[],total:0}),Xe&&(f(Xe.rows||[]),B(Xe.total||0));}catch(Le){console.error("Failed to fetch report data",Le);}finally{s(false);}},[e.api,t]);ht.useEffect(()=>{V(u,R,A,T,M);},[V,R,A,T,M]);let J=()=>{w(0),V(u,0,A,T,M);},ce=ie=>{w(0),P(ie);},te=(ie,Ie)=>{I(Ie),H(ie);},ne=ie=>{h(ie);},ee=ie=>{x(ie?.id||"");let Ie=Ap(ie,r);if(Ie){let Oe=Ie.values??Ie;h(Oe),V(Oe,0,A,T,M),w(0);}let{layout:Fe}=ns(ie,r);Fe&&m(Fe);},Y=ie=>{let Ie={...ie,id:Date.now().toString(),createdAt:new Date().toISOString()};p(Fe=>[...Fe,Ie]);},Ze=ie=>{m(ie);};return {pageProps:{id:e.id,title:e.title,mode:n,filterConfig:{appId:e.id,tableKey:r,fields:e.filters,filters:u,onFilterChange:ne,onSearch:J,onVariantLoad:ee,onVariantSave:Y,onVariantDelete:ie=>p(Ie=>Ie.filter(Fe=>Fe.id!==ie)),onVariantSetDefault:ie=>{p(Ie=>Ie.map(Fe=>({...Fe,isDefault:Fe.id===ie})));},variants:v,currentVariantId:y,variantService:c,serviceUrl:i},tableProps:{appId:e.id,tableKey:r,columns:e.columns,rows:g,loading:l,rowKey:"id",count:S,page:R,rowsPerPage:A,rowsPerPageOptions:a,onPageChange:w,onRowsPerPageChange:ce,selectionMode:"multiple",selected:k,onSelectionChange:D,onLayoutSave:Ze,layout:C,title:e.title,showSummary:true,order:T,orderBy:M,serviceUrl:i,onSortChange:te,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${d("graph.reportTitle")}`}}},filters:u,rows:g,loading:l,refresh:J}};var Nb=e=>[...e].sort((t,o)=>o.value-t.value),gM=({bars:e=[],lines:t=[],combos:o=[],heatmap:a=[],pies:r=[],waterfalls:n=[]})=>{let i=ht.useMemo(()=>Nb(e),[e]),c=ht.useMemo(()=>[...t],[t]),d=ht.useMemo(()=>[...o],[o]),l=ht.useMemo(()=>[...a],[a]),s=ht.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=ht.useMemo(()=>[...n],[n]);return {bars:i,lines:c,combos:d,heatmap:l,pies:s,waterfalls:g}};var xM=({apiKey:e,query:t,zoom:o=14,mapType:a="roadmap"})=>ht.useMemo(()=>!e||!t?"":zn({apiKey:e,query:t,zoom:o,mapType:a}),[e,t,o,a]),vM=({keyword:e,location:t})=>ht.useMemo(()=>$i({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var Kn=({code:e,language:t="text",copyable:o=true,showLineNumbers:a=false,wrapLongLines:r=false,maxHeight:n})=>{let[i,c]=ht.useState(false),d=ht.useMemo(()=>e.replace(/\n$/,"").split(`
186
+ `),[e]);return jsxRuntime.jsxs(material.Box,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",bgcolor:"background.paper"},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.6,bgcolor:"action.hover",borderBottom:"1px solid",borderColor:"divider"},children:[jsxRuntime.jsx(material.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&&jsxRuntime.jsx(material.Tooltip,{title:i?"Copied":"Copy",children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:async()=>{try{await navigator.clipboard.writeText(e),c(!0),window.setTimeout(()=>c(!1),1400);}catch{c(false);}},children:i?jsxRuntime.jsx(Ub__default.default,{fontSize:"inherit"}):jsxRuntime.jsx(Gb__default.default,{fontSize:"inherit"})})})]}),jsxRuntime.jsx(material.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?d.map((s,g)=>jsxRuntime.jsxs(material.Box,{sx:{display:"flex"},children:[jsxRuntime.jsx(material.Box,{component:"span",sx:{width:34,flexShrink:0,textAlign:"right",pr:1,color:"text.disabled",userSelect:"none"},children:g+1}),jsxRuntime.jsx(material.Box,{component:"span",sx:{whiteSpace:r?"pre-wrap":"pre",wordBreak:r?"break-word":"normal"},children:s})]},`${g}-${s}`)):jsxRuntime.jsx(material.Box,{component:"code",sx:{display:"block",whiteSpace:r?"pre-wrap":"pre",wordBreak:r?"break-word":"normal"},children:e})})]})};var Zb=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},Xb=async e=>new Function("m","return import(m)")(e),qn=({expression:e,inline:t=false,allowKatex:o=false})=>{let a=ht.useMemo(()=>Zb(e),[e]),[r,n]=ht.useState("");return ht.useEffect(()=>{let i=true;return (async()=>{if(!o||!a){n("");return}try{let d=await Xb("katex"),s=(d?.default||d)?.renderToString?.(a,{displayMode:!t,throwOnError:!1,strict:"warn"});i&&typeof s=="string"&&n(s);}catch{i&&n("");}})(),()=>{i=false;}},[o,a,t]),a?r?jsxRuntime.jsx(material.Box,{component:t?"span":"div",sx:{display:t?"inline-flex":"block",my:t?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:r}}):t?jsxRuntime.jsx(material.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}):jsxRuntime.jsx(material.Box,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:jsxRuntime.jsx(material.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 ax=async e=>new Function("m","return import(m)")(e),Jl=({code:e,title:t="Mermaid Diagram",height:o=320,enabled:a=true})=>{let[r,n]=ht.useState(""),[i,c]=ht.useState(""),[d,l]=ht.useState(false),s=ht.useMemo(()=>e.trim(),[e]);return ht.useEffect(()=>{let g=true;return (async()=>{if(!a||!s){n(""),c("");return}l(true),c(""),n("");try{let u=await ax("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 v=await h.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,s),p=typeof v=="string"?v:v?.svg;g&&typeof p=="string"&&n(p);}catch(u){if(g){let h=u instanceof Error?u.message:"Failed to render Mermaid diagram";c(h);}}finally{g&&l(false);}})(),()=>{g=false;}},[a,s]),jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[jsxRuntime.jsx(material.Box,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:t})}),jsxRuntime.jsxs(material.Box,{sx:{p:1},children:[d&&jsxRuntime.jsx(material.Box,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(material.CircularProgress,{size:20})}),!d&&r&&jsxRuntime.jsx(material.Box,{sx:{maxHeight:o,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:r}}),!d&&!r&&jsxRuntime.jsxs(material.Box,{children:[i&&jsxRuntime.jsx(material.Alert,{severity:"info",sx:{mb:1},children:i}),jsxRuntime.jsx(Kn,{code:s,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var ec=e=>e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),px=e=>/^:?-{3,}:?$/.test(e.trim()),ux=e=>{let t=e.trim(),o=t.startsWith(":"),a=t.endsWith(":");return o&&a?"center":a?"right":"left"},ds=e=>{let t=e.split(`
187
+ `).map(i=>i.trim()).filter(Boolean);if(t.length<2)return null;let o=ec(t[0]),a=ec(t[1]);if(o.length===0||a.length!==o.length||!a.every(px))return null;let r=a.map(ux),n=t.slice(2).filter(i=>i.includes("|")).map(i=>{let c=ec(i);return c.length<o.length?[...c,...Array.from({length:o.length-c.length},()=>"")]:c.slice(0,o.length)});return {headers:o,aligns:r,rows:n}},tc=({markdown:e,table:t,maxHeight:o=360})=>{let a=ht.useMemo(()=>t||(e?ds(e):null),[t,e]);return !a||a.headers.length===0?jsxRuntime.jsx(material.Paper,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):jsxRuntime.jsx(material.Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:o},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsx(material.TableRow,{children:a.headers.map((r,n)=>jsxRuntime.jsx(material.TableCell,{align:a.aligns[n],sx:{fontWeight:700,bgcolor:"background.paper"},children:r},`${r}-${n}`))})}),jsxRuntime.jsx(material.TableBody,{children:a.rows.map((r,n)=>jsxRuntime.jsx(material.TableRow,{hover:true,children:r.map((i,c)=>jsxRuntime.jsx(material.TableCell,{align:a.aligns[c],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i||jsxRuntime.jsx(material.Box,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${n}-${c}`))},`row-${n}`))})]})})})};var us=({content:e,title:t="Thinking",defaultExpanded:o=false,isStreaming:a=false})=>{let[r,n]=ht.useState(o);return jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.6,children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>n(i=>!i),sx:{transform:r?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:jsxRuntime.jsx(xx__default.default,{fontSize:"inherit"})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[t,a?" ...":""]})]}),jsxRuntime.jsx(material.Collapse,{in:r,children:jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:e})})]})};var ac=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,ms=e=>e.trim().startsWith("```"),Zp=e=>/^#{1,6}\s+/.test(e.trim()),rc=e=>/^[-*+]\s+/.test(e.trim()),nc=e=>/^\d+\.\s+/.test(e.trim()),Xp=e=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(e.trim()),ic=e=>e.trim().startsWith(">"),Qp=(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())},Yp=e=>e.trim().startsWith("<think>")||e.trim()===":::think",Zn=(e,t,o)=>{let a=[],r=0,n=0;ac.lastIndex=0;let i=ac.exec(e);for(;i;){i.index>r&&a.push(e.slice(r,i.index));let c=i[0],d=`${o}-${n}`;if(c.startsWith("**")&&c.endsWith("**"))a.push(jsxRuntime.jsx("strong",{children:c.slice(2,-2)},d));else if(c.startsWith("*")&&c.endsWith("*"))a.push(jsxRuntime.jsx("em",{children:c.slice(1,-1)},d));else if(c.startsWith("`")&&c.endsWith("`"))a.push(jsxRuntime.jsx(material.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:c.slice(1,-1)},d));else if(c.startsWith("[")&&c.includes("](")&&c.endsWith(")")){let l=c.match(/^\[([^\]]+)\]\(([^)]+)\)$/);l?a.push(jsxRuntime.jsx(material.Link,{href:l[2],target:"_blank",rel:"noreferrer",underline:"hover",children:l[1]},d)):a.push(c);}else c.startsWith("$")&&c.endsWith("$")&&t.enableMath?a.push(jsxRuntime.jsx(qn,{expression:c,inline:true,allowKatex:true},d)):a.push(c);r=i.index+c.length,n+=1,i=ac.exec(e);}return r<e.length&&a.push(e.slice(r)),a.length>0?a:[e]},Xn=({markdown:e,content:t,className:o,enableMath:a=true,enableMermaid:r=true,enableThinkBlock:n=true,codeCopyable:i=true,codeLineNumbers:c=false})=>{let d=e??t??"",l=ht.useMemo(()=>{let s=[],g=d.replace(/\r\n/g,`
188
188
  `).split(`
189
- `),f={enableMath:a},p=0;for(;p<m.length;){let h=m[p],k=h.trim();if(!k){p+=1;continue}if(n&&Yp(h)){if(k.startsWith("<think>")){let g=[],y=h;for(;;){let b=y.indexOf("<think>"),S=b>=0?y.slice(b+7):y,E=S.indexOf("</think>");if(E>=0){g.push(S.slice(0,E)),p+=1;break}if(g.push(S),p+=1,p>=m.length)break;y=m[p];}l.push(jsxRuntime.jsx(ps,{content:g.join(`
190
- `).trim()},`think-tag-${p}`));continue}p+=1;let C=[];for(;p<m.length&&m[p].trim()!==":::";)C.push(m[p]),p+=1;p<m.length&&m[p].trim()===":::"&&(p+=1),l.push(jsxRuntime.jsx(ps,{content:C.join(`
191
- `).trim()},`think-fence-${p}`));continue}if(us(h)){let C=k.slice(3).trim().toLowerCase(),g=[];for(p+=1;p<m.length&&!us(m[p]);)g.push(m[p]),p+=1;p<m.length&&us(m[p])&&(p+=1);let y=g.join(`
192
- `);if(r&&C==="mermaid"){l.push(jsxRuntime.jsx(Jl,{code:y},`mermaid-${p}`));continue}if(a&&["math","latex","katex"].includes(C)){l.push(jsxRuntime.jsx(Kn,{expression:y,allowKatex:true},`math-fence-${p}`));continue}l.push(jsxRuntime.jsx(Un,{code:y,language:C||"text",copyable:i,showLineNumbers:c,wrapLongLines:true},`code-${p}`));continue}if(a&&k.startsWith("$$")){let C=[];if(k.endsWith("$$")&&k!=="$$")C.push(k.slice(2,-2)),p+=1;else {let y=h.slice(h.indexOf("$$")+2);for(y.trim()&&C.push(y),p+=1;p<m.length;){let b=m[p],S=b.indexOf("$$");if(S>=0){C.push(b.slice(0,S)),p+=1;break}C.push(b),p+=1;}}l.push(jsxRuntime.jsx(Kn,{expression:C.join(`
193
- `).trim(),allowKatex:true},`math-${p}`));continue}if(Zp(h)){let C=Math.min(6,h.match(/^#{1,6}/)?.[0]?.length||1),g=h.replace(/^#{1,6}\s+/,""),y=C===1?"h5":C===2?"h6":"subtitle1";l.push(jsxRuntime.jsx(material.Typography,{variant:y,sx:{mt:C===1?1.2:.8,mb:.5,fontWeight:700},children:jn(g,f,`h-${p}`)},`heading-${p}`)),p+=1;continue}if(Xp(h)){l.push(jsxRuntime.jsx(material.Divider,{sx:{my:1.2}},`hr-${p}`)),p+=1;continue}if(Qp(m,p)){let C=p+2;for(;C<m.length&&m[C].trim()&&m[C].includes("|");)C+=1;let g=m.slice(p,C).join(`
194
- `),y=cs(g);if(y){l.push(jsxRuntime.jsx(tc,{table:y},`table-${p}`)),p=C;continue}}if(ic(h)){let C=[];for(;p<m.length&&ic(m[p]);)C.push(m[p].replace(/^\s*>\s?/,"")),p+=1;l.push(jsxRuntime.jsx(material.Paper,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:C.map((g,y)=>jsxRuntime.jsxs(mt.Fragment,{children:[y>0&&jsxRuntime.jsx("br",{}),jn(g,f,`q-${p}-${y}`)]},`quote-line-${y}`))})},`quote-${p}`));continue}if(rc(h)){let C=[];for(;p<m.length&&rc(m[p]);)C.push(m[p].trim().replace(/^[-*+]\s+/,"")),p+=1;l.push(jsxRuntime.jsx(material.Box,{component:"ul",sx:{my:.8,pl:2.5},children:C.map((g,y)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:jn(g,f,`ul-${p}-${y}`)})},`ul-item-${y}`))},`ul-${p}`));continue}if(nc(h)){let C=[];for(;p<m.length&&nc(m[p]);)C.push(m[p].trim().replace(/^\d+\.\s+/,"")),p+=1;l.push(jsxRuntime.jsx(material.Box,{component:"ol",sx:{my:.8,pl:2.7},children:C.map((g,y)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:jn(g,f,`ol-${p}-${y}`)})},`ol-item-${y}`))},`ol-${p}`));continue}let u=[];for(;p<m.length;){let C=m[p],g=C.trim();if(!g||us(C)||Zp(C)||Xp(C)||rc(C)||nc(C)||ic(C)||Qp(m,p)||n&&Yp(C)||a&&g.startsWith("$$"))break;u.push(C),p+=1;}u.length>0?l.push(jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:u.map((C,g)=>jsxRuntime.jsxs(mt.Fragment,{children:[g>0&&jsxRuntime.jsx("br",{}),jn(C,f,`p-${p}-${g}`)]},`p-line-${g}`))},`p-${p}`)):p+=1;}return l},[d,a,r,n,i,c]);return jsxRuntime.jsx(material.Box,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:s})};var oA=(e,t)=>jsxRuntime.jsx(Zn,{markdown:e,...t});var tu=({value:e,onChange:t,onSubmit:o,onVoiceInput:a,onClear:r,placeholder:n,statusText:i,loading:c=false,compact:d=false,showStatusText:s=true})=>jsxRuntime.jsxs(material.Stack,{spacing:.75,children:[jsxRuntime.jsxs(material.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:[jsxRuntime.jsx(vp__default.default,{sx:{fontSize:d?16:18,color:"text.secondary"}}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:e,onChange:l=>t(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),o());},placeholder:n,sx:{fontSize:d?"0.84rem":"0.9rem"}}),e&&r&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:r,children:jsxRuntime.jsx(Xh__default.default,{sx:{fontSize:d?16:18}})}),a&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:a,children:jsxRuntime.jsx(ry__default.default,{sx:{fontSize:d?16:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:o,disabled:c||!e.trim(),children:jsxRuntime.jsx(iy__default.default,{sx:{fontSize:d?16:18}})})]}),s&&i&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:i})]});var ou=(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:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e.slice(0,n),jsxRuntime.jsx(material.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)]})},ms=({section:e,highlightQuery:t=""})=>{let o=e.columns||2;return jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:e.title}),jsxRuntime.jsx(material.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 jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:ou(a.label,t)}),jsxRuntime.jsx(material.Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:r?ou(r,t):a.value})]},a.id)})})]})};var pc=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",fs=e=>e.trim().toLowerCase(),zx=(e,t)=>{let o=[];return e.forEach(a=>{a.fields.forEach(r=>{let n=r.searchableText||pc(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:fs(`${a.title} ${r.label} ${n}`)});});}),t.forEach(a=>{(a.fields||[]).forEach(r=>{let n=r.searchableText||pc(r.value),i={source:"tab",sourceId:a.id,sourceTitle:a.label,fieldId:r.id,fieldLabel:r.label,fieldValue:n};o.push({hit:i,text:fs(`${a.label} ${r.label} ${n}`)});}),(a.sections||[]).forEach(r=>{r.fields.forEach(n=>{let i=n.searchableText||pc(n.value),c={source:"tab",sourceId:a.id,sourceSectionId:r.id,sourceTitle:`${a.label} / ${r.title}`,fieldId:n.id,fieldLabel:n.label,fieldValue:i};o.push({hit:c,text:fs(`${a.label} ${r.title} ${n.label} ${i}`)});});});}),o},au=({sections:e,tabs:t=[],defaultTabId:o,ai:a})=>{let{t:r}=j(),[n,i]=mt.useState(""),[c,d]=mt.useState(o||t[0]?.id),[s,l]=mt.useState("idle"),[m,f]=mt.useState([]),[p,h]=mt.useState(""),[k,u]=mt.useState(""),[C,g]=mt.useState(false),y=mt.useMemo(()=>zx(e,t),[e,t]);mt.useEffect(()=>{if(t.length===0){d(void 0);return}t.some(A=>A.id===c)||d(o||t[0]?.id);},[t,c,o]);let b=mt.useCallback(()=>{l("idle"),f([]),h(""),u("");},[]),S=mt.useCallback(w=>{i(w),w.trim()||(l("idle"),f([]),h(""),u(""));},[]),E=mt.useCallback(w=>{let A=fs(w);return A?y.filter(P=>P.text.includes(A)).map(P=>P.hit):[]},[y]),D=mt.useCallback(async()=>{let w=n.trim();if(!w)return;g(true);let A=E(w);if(f(A),A.length>0){l("search"),u(""),h(r("detail.searchAi.matches",{count:A.length})),g(false);return}if(a?.enabled!==false&&a?.onSubmit){l("ai"),h(r("detail.searchAi.autoAiFallback"));try{let v=await a.onSubmit(w,{query:w,hits:A,activeTabId:c,sections:e,tabs:t});u(typeof v=="string"?v:"");}finally{g(false);}return}l("search"),u(""),h(r("detail.searchAi.noMatch")),g(false);},[n,E,r,a,c,e,t]);return {query:n,setQuery:S,activeTabId:c,setActiveTabId:d,searchMode:s,hits:m,statusText:p,aiResponse:k,searching:C,handleSubmit:D,clearResult:b}};var EA=({title:e,subtitle:t,sections:o,tabs:a=[],defaultTabId:r,table:n,ai:i,rightHeaderSlot:c,searchBarWidth:d=460,onClose:s,closeLabel:l="Close"})=>{let{t:m}=j(),{query:f,setQuery:p,activeTabId:h,setActiveTabId:k,searchMode:u,hits:C,statusText:g,aiResponse:y,searching:b,handleSubmit:S,clearResult:E}=au({sections:o,tabs:a,defaultTabId:r,ai:i}),D=mt.useMemo(()=>a.find(P=>P.id===h)||a[0],[a,h]),w=mt.useCallback(P=>{let v=M=>{let T=document.getElementById(P);if(T){T.scrollIntoView({behavior:"smooth",block:"center"});return}M<4&&setTimeout(()=>v(M+1),60);};requestAnimationFrame(()=>v(0));},[]),A=mt.useCallback((P,v)=>{if(a.some(M=>M.id===P)){k(P),w(v?`detail-tab-${P}-section-${v}`:`detail-tab-${P}`);return}w(`detail-section-${P}`);},[a,k,w]);return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:e}),t&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:t})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[jsxRuntime.jsx(material.Box,{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:jsxRuntime.jsx(tu,{value:f,onChange:p,onSubmit:S,onVoiceInput:i?.onVoiceInput,onClear:()=>{p(""),E();},placeholder:i?.placeholder||m("detail.searchAi.placeholder"),statusText:g,loading:b,compact:true,showStatusText:false})}),s&&jsxRuntime.jsx(material.Tooltip,{title:l,children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:s,children:jsxRuntime.jsx(Hx__default.default,{fontSize:"small"})})}),c]})]}),g&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:g}),u==="search"&&C.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:m("detail.searchAi.matches",{count:C.length})}),jsxRuntime.jsx(material.Stack,{spacing:.35,children:C.slice(0,8).map(P=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:()=>A(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:jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{fontSize:"0.84rem"},children:[jsxRuntime.jsx(material.Box,{component:"span",sx:{color:"text.secondary"},children:P.sourceTitle})," \xB7 ",jsxRuntime.jsx(material.Box,{component:"span",sx:{fontWeight:700},children:P.fieldLabel})," = ",jsxRuntime.jsx(material.Box,{component:"span",children:P.fieldValue||"-"})]})},`${P.source}|${P.sourceId}|${P.fieldId}`))})]}),u==="ai"&&y&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:m("detail.searchAi.aiResultTitle")}),jsxRuntime.jsx(material.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:jsxRuntime.jsx(Zn,{markdown:y})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(P=>jsxRuntime.jsx(material.Box,{id:`detail-section-${P.id}`,children:jsxRuntime.jsx(ms,{section:P,highlightQuery:f})},P.id))}),a.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsxRuntime.jsx(material.Tabs,{value:D?.id||false,onChange:(P,v)=>k(v),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:a.map(P=>jsxRuntime.jsx(material.Tab,{value:P.id,label:P.label,sx:{textTransform:"none"}},P.id))}),jsxRuntime.jsxs(material.Box,{sx:{p:1.5},children:[jsxRuntime.jsx(material.Box,{id:`detail-tab-${D?.id||""}`}),D?.description&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:D.description}),D?.content?D.content:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[(D?.sections||[]).map(P=>jsxRuntime.jsx(material.Box,{id:`detail-tab-${D?.id}-section-${P.id}`,children:jsxRuntime.jsx(ms,{section:P,highlightQuery:f})},P.id)),D?.fields&&D.fields.length>0&&jsxRuntime.jsx(ms,{section:{id:`${D.id}-fields`,title:D.label,fields:D.fields,columns:2},highlightQuery:f})]})]})]}),n&&jsxRuntime.jsx(Fa,{title:n.title||m("detail.table.title"),...n.tableProps,filterConfig:void 0,fitContainer:false})]})};var su=({bucket:e,cardCount:t,highlighted:o=false,children:a,emptyLabel:r,maxHeight:n,sx:i})=>{let{t:c}=j();return jsxRuntime.jsx(material.Paper,{sx:[d=>{let s=e.accentColor??d.palette.primary.main;return {position:"relative",minWidth:0,borderRadius:4,overflow:"hidden",border:`1px solid ${styles.alpha(s,o?.58:d.palette.mode==="dark"?.28:.18)}`,bgcolor:styles.alpha(d.palette.background.paper,d.palette.mode==="dark"?.92:.97),boxShadow:o?`0 18px 40px ${styles.alpha(s,.22)}`:`0 10px 28px ${styles.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:s}}},...Array.isArray(i)?i:i?[i]:[]],children:jsxRuntime.jsxs(material.Stack,{spacing:1.2,sx:{p:1.5},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[e.icon,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.96rem",fontWeight:800},children:e.title})]}),e.description&&jsxRuntime.jsx(material.Typography,{sx:{mt:.45,fontSize:"0.76rem",color:"text.secondary",lineHeight:1.45},children:e.description})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.8,sx:{flexShrink:0},children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t,sx:{fontWeight:700}}),typeof e.limit=="number"&&jsxRuntime.jsx(material.Chip,{size:"small",label:`${c("kanban.bucket.limit")} ${e.limit}`,color:t>e.limit?"warning":"default",variant:"outlined"})]})]}),o&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700},children:c("kanban.bucket.dropHere")}),jsxRuntime.jsx(material.Box,{sx:{minHeight:220,maxHeight:n,overflowY:n?"auto":"visible",pr:n?.4:0},children:t>0?a:jsxRuntime.jsx(material.Box,{sx:d=>({minHeight:160,borderRadius:3,border:`1px dashed ${styles.alpha(d.palette.divider,.9)}`,bgcolor:d.palette.mode==="dark"?styles.alpha(d.palette.common.white,.02):styles.alpha(d.palette.primary.main,.03),display:"grid",placeItems:"center",px:2,textAlign:"center"}),children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:r??e.emptyLabel??c("kanban.empty")})})})]})})};var _x={success:"success",warning:"warning",info:"info",error:"error"},jx={critical:"error",high:"warning",medium:"info",low:"success"},Zx=(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}},Xx=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",mc=({card:e,bucket:t,dragging:o=false,overlay:a=false,onClick:r,sx:n})=>{let{t:i}=j(),c=!!(r&&t),d=e.tone??(e.priority?jx[e.priority]:"default"),s=d==="default"?"primary":_x[d],l=t?{card:e,bucket:t}:void 0;return jsxRuntime.jsx(material.Paper,{onClick:c?()=>l&&r?.(l):void 0,onKeyDown:c?m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),l&&r?.(l));}:void 0,role:c?"button":void 0,tabIndex:c?0:void 0,sx:[m=>{let f=d==="default"?m.palette.primary.main:m.palette[s].main;return {position:"relative",overflow:"hidden",p:1.4,borderRadius:3,border:`1px solid ${styles.alpha(f,m.palette.mode==="dark"?.42:.2)}`,bgcolor:styles.alpha(m.palette.background.paper,m.palette.mode==="dark"?.96:.98),boxShadow:a?`0 20px 45px ${styles.alpha(m.palette.common.black,.24)}`:o?"none":`0 8px 24px ${styles.alpha(m.palette.common.black,m.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:c?"pointer":"default",opacity:o?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:4,bgcolor:f},"&:hover":c?{transform:"translateY(-1px)",boxShadow:`0 14px 32px ${styles.alpha(m.palette.common.black,m.palette.mode==="dark"?.28:.12)}`}:void 0}},...Array.isArray(n)?n:n?[n]:[]],children:jsxRuntime.jsxs(material.Stack,{spacing:1.1,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[(e.kicker||t?.title)&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:.4,color:"text.secondary",textTransform:"uppercase"},children:e.kicker??t?.title}),jsxRuntime.jsx(material.Typography,{sx:{mt:.2,fontSize:"0.98rem",fontWeight:800,lineHeight:1.3},children:e.title})]}),e.priority&&jsxRuntime.jsx(material.Chip,{size:"small",color:s,label:Zx(e.priority,i),variant:d==="default"?"outlined":"filled",sx:{height:22,fontWeight:700}})]}),e.summary&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",color:"text.secondary",lineHeight:1.5},children:e.summary}),e.metrics&&e.metrics.length>0&&jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(e.metrics.length,3)}, minmax(0, 1fr))`,gap:.9},children:e.metrics.slice(0,3).map(m=>jsxRuntime.jsxs(material.Box,{sx:f=>({borderRadius:2,px:1,py:.8,bgcolor:f.palette.mode==="dark"?styles.alpha(f.palette.common.white,.05):styles.alpha(f.palette.primary.main,.05)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",textTransform:"uppercase",letterSpacing:.35},children:m.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",fontWeight:700},children:m.value})]},m.id))}),typeof e.progress=="number"&&jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:i("kanban.card.progress")}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700},children:[Math.round(e.progress),"%"]})]}),jsxRuntime.jsx(material.LinearProgress,{variant:"determinate",value:Math.max(0,Math.min(100,e.progress)),color:s,sx:{height:8,borderRadius:999}})]}),(e.tags?.length||e.assignee||e.dueDate||e.footer||c)&&jsxRuntime.jsxs(material.Stack,{spacing:.9,children:[e.tags&&e.tags.length>0&&jsxRuntime.jsx(material.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:e.tags.map(m=>jsxRuntime.jsx(material.Chip,{size:"small",label:m.label,color:m.color??"default",variant:"outlined"},m.id))}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8,minWidth:0},children:[e.assignee&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Avatar,{src:e.assignee.avatarSrc,sx:{width:28,height:28,fontSize:"0.75rem"},children:e.assignee.initials??Xx(e.assignee.name)}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700,lineHeight:1.2},noWrap:true,children:e.assignee.name}),e.dueDate&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},noWrap:true,children:e.dueDate})]})]}),!e.assignee&&e.dueDate&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",color:"text.secondary"},children:e.dueDate})]}),c&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700,whiteSpace:"nowrap"},children:i("kanban.card.openDetail")})]}),e.footer]})]})})};var Yx=(e,t)=>Number.isNaN(e)||e<0?0:e>t?t:e,du=({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}})}},zo=(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}}},bs=(e,t)=>{let o=zo(e,t.cardId);if(!o)return e;let a=e.buckets.findIndex(s=>s.id===t.toBucketId);if(a<0)return e;let r=e.buckets.map(s=>({...s,cards:s.cards.map(l=>({...l}))})),n=r[o.bucketIndex],[i]=n.cards.splice(o.cardIndex,1);if(!i)return e;let c=r[a],d=Yx(t.targetIndex??c.cards.length,c.cards.length);return c.cards.splice(d,0,{...i,bucketId:t.toBucketId}),{buckets:r.map(s=>({...s,cards:s.cards.map((l,m)=>({...l,bucketId:s.id,position:m}))}))}};var gc="kanban-card|",fc="kanban-bucket|",gu=e=>`${gc}${e}`,p0=e=>`${fc}${e}`,xs=e=>e?.startsWith(gc)?e.slice(gc.length):void 0,mu=e=>e?.startsWith(fc)?e.slice(fc.length):void 0,u0=({card:e,bucket:t,onCardClick:o})=>{let{setNodeRef:a,attributes:r,listeners:n,transform:i,transition:c,isDragging:d}=sortable.useSortable({id:gu(e.id)}),s={transform:i?`translate3d(${i.x}px, ${i.y}px, 0)`:void 0,transition:c,zIndex:d?2:1,touchAction:"none",cursor:d?"grabbing":"grab"};return jsxRuntime.jsx(material.Box,{ref:a,style:s,...r,...n,children:jsxRuntime.jsx(mc,{card:e,bucket:t,dragging:d,onClick:o})})},m0=({bucket:e,highlighted:t,bucketMaxHeight:o,emptyBucketLabel:a,onCardClick:r})=>{let{isOver:n,setNodeRef:i}=core.useDroppable({id:p0(e.id)});return jsxRuntime.jsx(material.Box,{ref:i,sx:{minWidth:0},children:jsxRuntime.jsx(su,{bucket:e,cardCount:e.cards.length,highlighted:t||n,emptyLabel:a,maxHeight:o,children:jsxRuntime.jsx(sortable.SortableContext,{items:e.cards.map(c=>gu(c.id)),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:1,children:e.cards.map(c=>jsxRuntime.jsx(u0,{card:c,bucket:e,onCardClick:r},c.id))})})})})},e2=({model:e,onCardMove:t,onCardClick:o,minBucketWidth:a=320,bucketMaxHeight:r,emptyBucketLabel:n,sx:i})=>{let[c,d]=mt.useState(null),[s,l]=mt.useState(),m=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),f=mt.useMemo(()=>c?zo(e,c):void 0,[c,e]),p=mt.useCallback(()=>{d(null),l(void 0);},[]),h=mt.useCallback(g=>{if(!g)return;let y=xs(g);return y?zo(e,y)?.bucket.id:mu(g)},[e]),k=mt.useCallback(g=>{d(xs(String(g.active.id))??null);},[]),u=mt.useCallback(g=>{l(h(g.over?String(g.over.id):void 0));},[h]),C=mt.useCallback(g=>{let y=xs(String(g.active.id)),b=g.over?String(g.over.id):void 0;if(!y||!b){p();return}let S=zo(e,y);if(!S){p();return}let E=S.bucket.id,D=S.cardIndex,w=xs(b);if(w){let v=zo(e,w);if(!v){p();return}E=v.bucket.id,D=v.cardIndex;}else {let v=mu(b),M=e.buckets.find(T=>T.id===v);if(!v||!M){p();return}E=v,D=M.cards.length;}if(S.bucket.id===E&&S.cardIndex===D){p();return}let A=bs(e,{cardId:y,fromBucketId:S.bucket.id,toBucketId:E,targetIndex:D}),P=zo(A,y);P&&!(P.bucket.id===S.bucket.id&&P.cardIndex===S.cardIndex)&&t?.({cardId:y,fromBucketId:S.bucket.id,toBucketId:P.bucket.id,targetIndex:P.cardIndex,card:P.card,model:A}),p();},[e,t,p]);return jsxRuntime.jsxs(core.DndContext,{sensors:m,collisionDetection:core.closestCorners,onDragStart:k,onDragOver:u,onDragEnd:C,onDragCancel:p,children:[jsxRuntime.jsx(material.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(g=>jsxRuntime.jsx(m0,{bucket:g,highlighted:g.id===s,bucketMaxHeight:r,emptyBucketLabel:n,onCardClick:o},g.id))}),jsxRuntime.jsx(core.DragOverlay,{children:f?jsxRuntime.jsx(material.Box,{sx:{width:Math.max(a-24,260)},children:jsxRuntime.jsx(mc,{card:f.card,bucket:f.bucket,overlay:true})}):null})]})};var y0=({initialModel:e,initialBuckets:t,initialCards:o})=>e||du({buckets:t??[],cards:o??[]}),n2=e=>{let{onCardMove:t,onCardClick:o}=e,[a,r]=mt.useState(()=>y0(e)),n=mt.useCallback(l=>{r(m=>typeof l=="function"?l(m):l);},[]),i=mt.useCallback(l=>zo(a,l),[a]),c=mt.useCallback((l,m,f)=>{let p=zo(a,l);if(!p)return;let h=bs(a,{cardId:l,fromBucketId:p.bucket.id,toBucketId:m,targetIndex:f}),k=zo(h,l);if(!k||k.bucket.id===p.bucket.id&&k.cardIndex===p.cardIndex)return;r(h);let u={cardId:l,fromBucketId:p.bucket.id,toBucketId:k.bucket.id,targetIndex:k.cardIndex,card:k.card,model:h};return t?.(u),u},[a,t]),d=mt.useCallback((l,m)=>{r(f=>({buckets:f.buckets.map(p=>({...p,cards:p.cards.map(h=>h.id!==l?h:typeof m=="function"?m(h):{...h,...m})}))}));},[]),s=mt.useMemo(()=>({model:a,onCardMove:l=>{c(l.cardId,l.toBucketId,l.targetIndex);},onCardClick:o}),[a,c,o]);return {model:a,actions:{replaceModel:n,moveCard:c,updateCard:d,getCard:i},boardProps:s}};var bu=64,B0="#E9EDF2",E0="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",F0=["en","zh","fr","de","ja","ko"],xu={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},Ss=({appTitle:e,logo:t,mode:o="dark",onToggleMode:a,locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,searchPlaceholder:d,onSearch:s,user:l,onUserSetting:m,onUserLogout:f,userMenuItems:p,leftSlot:h,rightSlot:k})=>{let{t:u,locale:C}=j(),y=material.useTheme().palette.mode==="dark",[b,S]=mt.useState(""),[E,D]=mt.useState(null),[w,A]=mt.useState(null),P=Z=>{Z.preventDefault(),s&&s(b.trim());},v=o==="system"?jsxRuntime.jsx(P0__default.default,{fontSize:"small"}):o==="dark"?jsxRuntime.jsx(R0__default.default,{fontSize:"small"}):jsxRuntime.jsx(D0__default.default,{fontSize:"small"}),M=u(o==="system"?"header.theme.system":o==="dark"?"header.theme.dark":"header.theme.light"),T=r||C,R=i&&i.length>0?i:F0,I=n||xu[T]||T.toUpperCase(),$=!!E,N=d||u("header.searchPlaceholder"),X=!!w,se=[{key:"setting",label:u("header.menu.setting"),icon:jsxRuntime.jsx(ob__default.default,{sx:{fontSize:18}}),onClick:m},{key:"logout",label:u("header.menu.logout"),icon:jsxRuntime.jsx(A0__default.default,{sx:{fontSize:18}}),onClick:f}],J=p&&p.length>0?p:se,ee=Z=>{A(null),Z?.();};return jsxRuntime.jsxs(material.AppBar,{position:"sticky",elevation:0,sx:Z=>({top:0,zIndex:Z.zIndex.drawer+10,height:bu,backgroundColor:Z.palette.mode==="dark"?"#0D0D0D":B0,backgroundImage:Z.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%)",E0,"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:Z.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)"}),children:[jsxRuntime.jsxs(material.Toolbar,{sx:{minHeight:`${bu}px !important`,px:2,gap:2},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[h,t===null?null:t||jsxRuntime.jsx(material.Box,{component:"img",src:"/orbcafe.png",alt:"ORBCAFE Logo",sx:{width:44,height:44,display:"block",objectFit:"contain",flexShrink:0}}),e&&jsxRuntime.jsx(material.Typography,{variant:"h6",sx:{fontWeight:700,color:y?"common.white":"#111827"},children:e})]}),jsxRuntime.jsx(material.Box,{sx:{flex:1,display:"flex",justifyContent:"center",minWidth:0},children:jsxRuntime.jsx(material.Box,{component:"form",onSubmit:P,sx:{width:"100%",maxWidth:540},children:jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:b,onChange:Z=>S(Z.target.value),placeholder:N,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(vp__default.default,{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"}}})})}),jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,children:[c?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:Z=>D(Z.currentTarget),sx:{color:y?"common.white":"#111827",borderRadius:1,px:.5},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.45,children:[jsxRuntime.jsx(yu__default.default,{sx:{fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{fontWeight:500},children:I})]})}),jsxRuntime.jsx(material.Menu,{anchorEl:E,open:$,onClose:()=>D(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:R.map(Z=>jsxRuntime.jsx(material.MenuItem,{selected:Z===T,onClick:()=>{c(Z),D(null);},sx:{fontSize:"0.82rem"},children:xu[Z]},Z))})]}):jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsxRuntime.jsx(yu__default.default,{sx:{color:y?"common.white":"#111827",fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{color:y?"common.white":"#111827",fontWeight:500},children:I})]}),jsxRuntime.jsx(material.IconButton,{size:"small",sx:{color:y?"common.white":"#111827"},onClick:a,title:M,children:v}),l&&jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1,children:[jsxRuntime.jsxs(material.Box,{sx:{textAlign:"right",minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{color:y?"common.white":"#111827",fontWeight:700,lineHeight:1.15},children:l.name}),l.subtitle&&jsxRuntime.jsx(material.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:l.subtitle,children:l.subtitle})]}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:Z=>A(Z.currentTarget),sx:{p:0},children:jsxRuntime.jsx(material.Avatar,{src:l.avatarSrc,imgProps:{style:{objectFit:"cover"}},sx:{width:34,height:34,bgcolor:"grey.100",color:"grey.700",fontSize:"0.85rem"},children:l.avatarText||l.name.slice(0,1).toUpperCase()})})]}),k]})]}),l&&jsxRuntime.jsx(material.Menu,{anchorEl:w,open:X,onClose:()=>A(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:J.map(Z=>jsxRuntime.jsxs(material.MenuItem,{disabled:Z.disabled,onClick:()=>ee(Z.onClick),children:[Z.icon&&jsxRuntime.jsx(material.ListItemIcon,{children:Z.icon}),jsxRuntime.jsx(material.ListItemText,{primary:Z.label,slotProps:{primary:{sx:{fontSize:"0.86rem",fontWeight:500}}}})]},Z.key))})]})};var vu=({menuData:e=[],initialNavigationCollapsed:t=false}={})=>{let{navigationIslandProps:o}=wd({initialCollapsed:t,content:e}),[a,r]=mt.useState(900);mt.useEffect(()=>{let i=()=>r(window.innerHeight);return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);let n=mt.useMemo(()=>Math.max(280,a-100),[a]);return {navigationIslandProps:o,navigationMaxHeight:n}};var D2=({appTitle:e,menuData:t=[],children:o,showNavigation:a=true,locale:r="en",localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:s,onUserLogout:l,userMenuItems:m,logo:f,onSearch:p,rightHeaderSlot:h,leftHeaderSlot:k,contentSx:u})=>{let C="orbcafe:page-layout-mode",[g,y]=mt.useState("system"),[b,S]=mt.useState("light"),[E,D]=mt.useState(false),w=g==="system"?E?b:"light":g;mt.useEffect(()=>{try{let R=window.localStorage.getItem(C);(R==="light"||R==="dark"||R==="system")&&y(R);}catch{}D(true);let M=window.matchMedia("(prefers-color-scheme: dark)"),T=()=>{S(M.matches?"dark":"light");};return T(),M.addEventListener("change",T),()=>M.removeEventListener("change",T)},[]),mt.useEffect(()=>{if(E)try{window.localStorage.setItem(C,g);}catch{}},[E,g]),mt.useEffect(()=>{w==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[w]);let A=mt.useMemo(()=>material.createTheme({palette:{mode:w}}),[w]),{navigationIslandProps:P,navigationMaxHeight:v}=vu({menuData:t,initialNavigationCollapsed:false});return jsxRuntime.jsx(material.ThemeProvider,{theme:A,children:jsxRuntime.jsx(ki,{locale:r,children:jsxRuntime.jsxs(material.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:[jsxRuntime.jsx(Ss,{appTitle:e,logo:f,mode:g,onToggleMode:()=>y(M=>M==="system"?"dark":M==="dark"?"light":"system"),locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:s,onUserLogout:l,userMenuItems:m,onSearch:p,leftSlot:k,rightSlot:h}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,display:"flex"},children:[a&&jsxRuntime.jsx(material.Box,{sx:{p:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsxRuntime.jsx(kd,{...P,maxHeight:v,colorMode:w})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...u},children:o})]})]})})})};var Ts="(blank)",ku="Result",Su="Grand Total",wu={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Tu=["sum","count","avg","min","max"];var Iu=["palette","rows","columns","filters","values"];var Pu=e=>Iu.includes(e),Ru=e=>e==="rows"||e==="columns"||e==="filters",Is=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&Pu(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&Pu(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},ma=e=>e==null||e===""?Ts:e instanceof Date?e.toISOString().slice(0,10):String(e),fr=e=>JSON.stringify(e),Du=(e,t)=>{let o=e.join(""),a=t.join("");return o.localeCompare(a,void 0,{sensitivity:"base"})},H0=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},tn=(e,t,o)=>{if(o==="count")return e.length;let a=e.map(r=>H0(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)},Ct=(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},ga=(e,t)=>e.length!==t.length?false:e.every((o,a)=>o===t[a]),Mu=(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 ga(n,i)})},Ps=(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}),vc=e=>!e?.aggregations||e.aggregations.length===0?Tu:e.aggregations,Kt=(e,t)=>{let o=vc(t);return e&&o.includes(e)?e:t?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},oi=(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 Eu=({options:e,selectedValues:t,onChange:o,minWidth:a=96})=>{let{t:r}=j(),[n,i]=mt.useState(""),c=mt.useMemo(()=>{let s=n.trim().toLowerCase();return s?e.filter(l=>l.toLowerCase().includes(s)):e},[e,n]),d=e.length>0&&t.length===e.length;return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:a},children:jsxRuntime.jsxs(material.Select,{multiple:true,value:t,onChange:s=>{let l=s.target.value,m=typeof l=="string"?l.split(","):l;o(m);},onClick:s=>s.stopPropagation(),onMouseDown:s=>s.stopPropagation(),renderValue:s=>{let l=s;return e.length===0?r("pivot.filter.na"):l.length===0?r("common.none"):l.length===e.length?r("common.all"):`${l.length}/${e.length}`},MenuProps:{PaperProps:{sx:{maxHeight:320,bgcolor:"background.paper"}}},sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:[jsxRuntime.jsx(material.ListSubheader,{disableSticky:true,sx:s=>({bgcolor:"background.paper",py:.8,lineHeight:"normal",borderBottom:`1px solid ${s.palette.divider}`}),children:jsxRuntime.jsx(material.TextField,{size:"small",placeholder:`${r("common.search")}...`,fullWidth:true,value:n,onChange:s=>i(s.target.value),onKeyDown:s=>s.stopPropagation(),onClick:s=>s.stopPropagation(),sx:{m:0,"& .MuiInputBase-input":{fontSize:"0.75rem",py:.7}}})}),jsxRuntime.jsx(material.Box,{sx:s=>({px:1.5,py:.5,borderBottom:`1px solid ${s.palette.divider}`,bgcolor:"background.paper"}),onMouseDown:s=>{s.preventDefault(),s.stopPropagation();},onClick:s=>{s.preventDefault(),s.stopPropagation();},children:jsxRuntime.jsx(material.Button,{variant:"text",size:"small",onClick:s=>{s.preventDefault(),s.stopPropagation(),o(d?[]:e);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:r(d?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),c.length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,sx:{fontSize:"0.75rem"},children:r("pivot.filter.noResults")}),c.map(s=>{let l=t.includes(s);return jsxRuntime.jsxs(material.MenuItem,{value:s,sx:{fontSize:"0.75rem",py:.25},children:[jsxRuntime.jsx(material.Checkbox,{size:"small",checked:l,sx:{p:.5,mr:.5}}),jsxRuntime.jsx(material.ListItemText,{primary:s,primaryTypographyProps:{sx:{fontSize:"0.75rem",lineHeight:1.2}}})]},s)})]})})};var kc=({label:e,subtitle:t,isDragging:o,dragRef:a,listeners:r,attributes:n,style:i})=>jsxRuntime.jsx(material.Paper,{ref:a,...r,...n,sx:c=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:c.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none"}),style:{...i,opacity:o?.3:1,cursor:o?"grabbing":"grab"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsxRuntime.jsx(material.Box,{sx:c=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.3,borderRadius:1,bgcolor:c.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)"}),children:jsxRuntime.jsx(ev__default.default,{sx:{fontSize:16,color:"text.secondary"}})}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary",lineHeight:1.2},children:t})]})]})}),zu=({id:e,label:t,subtitle:o})=>{let{setNodeRef:a,listeners:r,attributes:n,isDragging:i}=core.useDraggable({id:e});return jsxRuntime.jsx(kc,{label:t,subtitle:o,isDragging:i,dragRef:a,listeners:r,attributes:n})};var rn=({zone:e,title:t,hint:o,icon:a,children:r,itemCount:n,onClear:i})=>{let c=`container|${e}`,{isOver:d,setNodeRef:s}=core.useDroppable({id:c}),{t:l}=j();return jsxRuntime.jsxs(material.Paper,{ref:s,sx:m=>({p:1.1,borderRadius:3,border:"1px dashed",borderColor:d?"primary.main":m.palette.divider,bgcolor:d?m.palette.mode==="dark"?"rgba(25, 118, 210, 0.16)":"rgba(47, 91, 255, 0.06)":m.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:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[a,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.79rem",fontWeight:800,letterSpacing:.2},children:t}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:["(",n,")"]})]}),n>0&&i&&jsxRuntime.jsx(material.Tooltip,{title:l("pivot.clearArea"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:i,sx:{p:.25},children:jsxRuntime.jsx(nv__default.default,{sx:{fontSize:16}})})})]}),jsxRuntime.jsx(material.Typography,{sx:{mt:.5,mb:.9,fontSize:"0.7rem",color:"text.secondary"},children:o}),jsxRuntime.jsx(material.Box,{sx:{flex:1},children:r})]})};var Vu={xs:1.2,md:1.6},sn=({title:e,subtitle:t,collapsed:o,onToggleCollapse:a,expandAriaLabel:r,collapseAriaLabel:n,children:i,bodySx:c,unmountOnExit:d=false,headerActions:s})=>jsxRuntime.jsxs(material.Paper,{sx:l=>({borderRadius:3,border:`1px solid ${l.palette.divider}`,overflow:"hidden",bgcolor:styles.alpha(l.palette.background.paper,.95)}),children:[jsxRuntime.jsxs(material.Box,{sx:l=>({px:Vu,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,borderBottom:o?"none":`1px solid ${l.palette.divider}`}),children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.9rem",fontWeight:800},children:e}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[s,jsxRuntime.jsx(material.IconButton,{size:"small","aria-label":o?r:n,onClick:a,sx:l=>({border:`1px solid ${l.palette.divider}`,bgcolor:styles.alpha(l.palette.background.paper,.88),width:28,height:28,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:l.palette.mode==="dark"?styles.alpha(l.palette.primary.main,.18):styles.alpha(l.palette.primary.main,.08)}}),children:jsxRuntime.jsx(ab__default.default,{sx:{fontSize:16,transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:o?"rotate(180deg)":"rotate(0deg)"}})})]})]}),jsxRuntime.jsx(material.Collapse,{in:!o,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:jsxRuntime.jsx(material.Box,{sx:[{px:Vu,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:i})})]});var Bs=({label:e,caption:t,onRemove:o,trailing:a,isDragging:r,dragRef:n,listeners:i,attributes:c,style:d})=>jsxRuntime.jsx(material.Paper,{ref:n,style:d,sx:s=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:s.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none",opacity:r?0:1}),children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsxRuntime.jsx(material.Box,{...c,...i,sx:s=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.25,borderRadius:1,bgcolor:s.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)",cursor:"grab"}),children:jsxRuntime.jsx(ev__default.default,{sx:{fontSize:15,color:"text.secondary"}})}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.8rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},children:t})]}),a,o&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:s=>{s.stopPropagation(),o();},sx:{p:.2},children:jsxRuntime.jsx(Xh__default.default,{sx:{fontSize:16}})})]})}),ai=({id:e,label:t,caption:o,onRemove:a,trailing:r})=>{let{setNodeRef:n,attributes:i,listeners:c,transform:d,transition:s,isDragging:l}=sortable.useSortable({id:e}),m={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:s,zIndex:l?999:"auto"};return jsxRuntime.jsx(Bs,{label:t,caption:o,onRemove:a,trailing:r,isDragging:l,dragRef:n,listeners:c,attributes:i,style:m})};var Ls={rows:jsxRuntime.jsx(xv__default.default,{fontSize:"small"}),columns:jsxRuntime.jsx(Lf__default.default,{fontSize:"small"}),filters:jsxRuntime.jsx(bv__default.default,{fontSize:"small"}),values:jsxRuntime.jsx(Of__default.default,{fontSize:"small"})},$u=({isConfiguratorCollapsed:e,onToggleCollapse:t,availableFields:o,fieldMap:a,filterFields:r,columnFields:n,rowFields:i,valueFields:c,clearZone:d,removeFieldFromZone:s,getFilterSelectionSummary:l,renderDimensionFilterSelect:m,renderAggregationSelect:f,getAggregationLabel:p})=>{let{t:h}=j(),k=[`${h("pivot.zone.rows")} ${i.length}`,`${h("pivot.zone.columns")} ${n.length}`,`${h("pivot.zone.filters")} ${r.length}`,`${h("pivot.zone.values")} ${c.length}`].join(" \xB7 ");return jsxRuntime.jsx(sn,{title:h("pivot.config.title"),subtitle:k,collapsed:e,onToggleCollapse:t,expandAriaLabel:h("pivot.collapse.ariaExpand"),collapseAriaLabel:h("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[jsxRuntime.jsx(rn,{zone:"palette",title:h("pivot.fieldList"),hint:h("pivot.availableDimensions"),itemCount:o.length,icon:jsxRuntime.jsx(ev__default.default,{sx:{fontSize:16,color:"text.secondary"}}),children:jsxRuntime.jsxs(material.Stack,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[o.length===0&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",py:1},children:h("pivot.allFieldsInUse")}),o.map(u=>jsxRuntime.jsx(zu,{id:`item|palette|${u.id}`,label:u.label,subtitle:u.type??"string"},u.id))]})}),jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(rn,{zone:"filters",title:h("pivot.zone.filters"),hint:h("pivot.hint.filters"),icon:Ls.filters,itemCount:r.length,onClear:()=>d("filters"),children:jsxRuntime.jsx(sortable.SortableContext,{items:r.map(u=>`item|filters|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:r.map(u=>jsxRuntime.jsx(ai,{id:`item|filters|${u}`,label:a.get(u)?.label??u,caption:l(u),trailing:m(u),onRemove:()=>s("filters",u)},u))})})}),jsxRuntime.jsx(rn,{zone:"columns",title:h("pivot.zone.columns"),hint:h("pivot.hint.columns"),icon:Ls.columns,itemCount:n.length,onClear:()=>d("columns"),children:jsxRuntime.jsx(sortable.SortableContext,{items:n.map(u=>`item|columns|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:n.map(u=>jsxRuntime.jsx(ai,{id:`item|columns|${u}`,label:a.get(u)?.label??u,caption:`${a.get(u)?.type??"dimension"} \u2022 ${l(u)}`,trailing:m(u),onRemove:()=>s("columns",u)},u))})})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(rn,{zone:"rows",title:h("pivot.zone.rows"),hint:h("pivot.hint.rows"),icon:Ls.rows,itemCount:i.length,onClear:()=>d("rows"),children:jsxRuntime.jsx(sortable.SortableContext,{items:i.map(u=>`item|rows|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:i.map(u=>jsxRuntime.jsx(ai,{id:`item|rows|${u}`,label:a.get(u)?.label??u,caption:`${a.get(u)?.type??"dimension"} \u2022 ${l(u)}`,trailing:m(u),onRemove:()=>s("rows",u)},u))})})}),jsxRuntime.jsx(rn,{zone:"values",title:h("pivot.zone.values"),hint:h("pivot.hint.values"),icon:Ls.values,itemCount:c.length,onClear:()=>d("values"),children:jsxRuntime.jsx(sortable.SortableContext,{items:c.map(u=>`item|values|${u.tokenId}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:c.map(u=>{let C=a.get(u.fieldId)?.label??u.fieldId,g=`${p(u.aggregation)}(${C})`;return jsxRuntime.jsx(ai,{id:`item|values|${u.tokenId}`,label:C,caption:g,trailing:f(u),onRemove:()=>s("values",u.tokenId)},u.tokenId)})})})})]})]})]})})};var Hu=e=>e.toLocaleString(void 0,{maximumFractionDigits:1}),Gu=({data:e,primaryLabel:t,secondaryLabel:o,formatPrimaryValue:a,formatSecondaryValue:r})=>{let n=styles.useTheme();if(e.length===0)return null;let i=720,c=250,d={top:20,right:24,bottom:40,left:52},s=o?e.map(u=>u.primaryValue):e.map((u,C)=>C+1),l=o?e.map(u=>u.secondaryValue??0):e.map(u=>u.primaryValue),m=Math.max(...s,1),f=Math.max(...l,1),p=i-d.left-d.right,h=c-d.top-d.bottom,k=e.map((u,C)=>{let g=o?u.primaryValue:C+1,y=o?u.secondaryValue??0:u.primaryValue,b=d.left+g/m*p,S=c-d.bottom-y/f*h;return {...u,x:b,y:S,rawX:g,rawY:y}});return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${i} ${c}`,sx:{width:"100%",minWidth:i,height:c},children:[jsxRuntime.jsx("line",{x1:d.left,y1:c-d.bottom,x2:i-d.right,y2:c-d.bottom,stroke:styles.alpha(n.palette.text.secondary,.35)}),jsxRuntime.jsx("line",{x1:d.left,y1:d.top,x2:d.left,y2:c-d.bottom,stroke:styles.alpha(n.palette.text.secondary,.35)}),k.map(u=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:u.x,cy:u.y,r:7,fill:styles.alpha(n.palette.primary.main,.18)}),jsxRuntime.jsx("circle",{cx:u.x,cy:u.y,r:4.5,fill:n.palette.primary.main,children:jsxRuntime.jsxs("title",{children:[u.name,`
195
- `,o?`${t}: ${a(u.primaryValue)}`:`${t}: ${a(u.primaryValue)}`,o?`
196
- ${o}: ${(r??a)(u.secondaryValue??0)}`:""]})}),jsxRuntime.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)),jsxRuntime.jsx("text",{x:i/2,y:c-10,textAnchor:"middle",fontSize:"11",fill:n.palette.text.secondary,children:o?t:"Index"}),jsxRuntime.jsx("text",{x:16,y:c/2,textAnchor:"middle",transform:`rotate(-90 16 ${c/2})`,fontSize:"11",fill:n.palette.text.secondary,children:o??t}),jsxRuntime.jsx("text",{x:d.left,y:d.top-4,fontSize:"10",fill:n.palette.text.secondary,children:Hu(f)}),jsxRuntime.jsx("text",{x:i-d.right,y:c-d.bottom+16,textAnchor:"end",fontSize:"10",fill:n.palette.text.secondary,children:Hu(m)})]})}),jsxRuntime.jsx(material.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=>jsxRuntime.jsxs(material.Box,{sx:C=>({borderRadius:2,px:1.25,py:1,border:`1px solid ${styles.alpha(C.palette.divider,.7)}`,bgcolor:styles.alpha(C.palette.background.default,.35)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:u.name,children:u.name}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[t,": ",a(u.primaryValue)]}),o&&jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[o,": ",(r??a)(u.secondaryValue??0)]})]},u.name))})]})};var Rc=e=>Math.max(...e,1),Ku=({data:e,chartType:t,primaryLabel:o,secondaryLabel:a,formatPrimaryValue:r,formatSecondaryValue:n})=>{let i=styles.useTheme(),c=i.palette.primary.main,d=i.palette.warning.main;if(e.length===0)return null;if(t==="bar-horizontal"){let g=Rc(e.flatMap(y=>[y.primaryValue,y.secondaryValue??0]));return jsxRuntime.jsx(material.Stack,{spacing:1.1,children:e.map(y=>jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:y.name,children:y.name}),jsxRuntime.jsxs(material.Stack,{spacing:.65,children:[jsxRuntime.jsx(material.Box,{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:styles.alpha(i.palette.action.active,.08)},children:jsxRuntime.jsx(material.Box,{sx:{width:`${y.primaryValue/g*100}%`,height:"100%",bgcolor:c}})}),a&&jsxRuntime.jsx(material.Box,{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:styles.alpha(i.palette.action.active,.08)},children:jsxRuntime.jsx(material.Box,{sx:{width:`${(y.secondaryValue??0)/g*100}%`,height:"100%",bgcolor:d}})})]}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700},children:r(y.primaryValue)}),a&&jsxRuntime.jsx(material.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 g=Rc(e.flatMap(b=>[b.primaryValue,b.secondaryValue??0])),y=a?92:76;return jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto",pb:.5},children:jsxRuntime.jsx(material.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=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsxs(material.Box,{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[jsxRuntime.jsx(material.Box,{sx:{width:a?16:26,minHeight:8,height:`${Math.max(b.primaryValue/g*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:c},title:`${o}: ${r(b.primaryValue)}`}),a&&jsxRuntime.jsx(material.Box,{sx:{width:16,minHeight:8,height:`${Math.max((b.secondaryValue??0)/g*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${a}: ${(n??r)(b.secondaryValue??0)}`})]}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:b.name,children:b.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:r(b.primaryValue),children:r(b.primaryValue)}),a&&jsxRuntime.jsx(material.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 s=Math.max(680,e.length*74),l=240,m={top:20,right:18,bottom:36,left:18},f=Rc(e.flatMap(g=>[g.primaryValue,g.secondaryValue??0])),p=s-m.left-m.right,h=l-m.top-m.bottom,k=g=>e.map((y,b)=>{let S=m.left+b*p/Math.max(e.length-1,1),E=l-m.bottom-g(y)/f*h;return {x:S,y:E,item:y}}),u=k(g=>g.primaryValue),C=a?k(g=>g.secondaryValue??0):[];return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${s} ${l}`,sx:{width:"100%",minWidth:s,height:l},children:[jsxRuntime.jsx("line",{x1:m.left,y1:l-m.bottom,x2:s-m.right,y2:l-m.bottom,stroke:styles.alpha(i.palette.text.secondary,.35)}),jsxRuntime.jsx("polyline",{fill:"none",stroke:c,strokeWidth:3,points:u.map(g=>`${g.x},${g.y}`).join(" ")}),u.map(g=>jsxRuntime.jsx("circle",{cx:g.x,cy:g.y,r:4,fill:c,children:jsxRuntime.jsxs("title",{children:[g.item.name,`
197
- `,o,": ",r(g.item.primaryValue)]})},`primary-${g.item.name}`)),a&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:C.map(g=>`${g.x},${g.y}`).join(" ")}),C.map(g=>jsxRuntime.jsx("circle",{cx:g.x,cy:g.y,r:3.5,fill:d,children:jsxRuntime.jsxs("title",{children:[g.item.name,`
198
- `,a,": ",(n??r)(g.item.secondaryValue??0)]})},`secondary-${g.item.name}`))]})]})}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:e.map(g=>jsxRuntime.jsxs(material.Box,{sx:y=>({borderRadius:2,px:1.1,py:.9,border:`1px solid ${styles.alpha(y.palette.divider,.7)}`,bgcolor:styles.alpha(y.palette.background.default,.35)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:g.name,children:g.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:r(g.primaryValue)}),a&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:(n??r)(g.secondaryValue??0)})]},g.name))})]})};var qu=(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},_u=(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}}),ju=({rows:e,dimensionFieldId:t,primaryValue:o,secondaryValue:a})=>{if(!t)return [];let r=new Map;return e.forEach(n=>{let i=ma(n[t]),c=r.get(i);if(c){c.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:tn(i,o.fieldId,o.aggregation),secondaryValue:a?tn(i,a.fieldId,a.aggregation):void 0}))};var Zu=({rows:e,fieldMap:t,rowFields:o,columnFields:a,valueFields:r,chartDimensionFieldId:n,chartPrimaryValueFieldId:i,chartSecondaryValueFieldId:c,chartType:d,isCollapsed:s,onChartDimensionFieldIdChange:l,onChartPrimaryValueFieldIdChange:m,onChartSecondaryValueFieldIdChange:f,onChartTypeChange:p,onToggleCollapse:h,getAggregationLabel:k})=>{let{t:u}=j(),C=mt.useMemo(()=>qu(o,a,t),[a,t,o]),g=mt.useMemo(()=>_u(r,t,k),[t,k,r]),y=g.find(v=>v.fieldId===i)??g[0],b=g.find(v=>v.fieldId===c&&v.fieldId!==y?.fieldId)??null,S=C.find(v=>v.fieldId===n)??C[0],E=S&&y?u("pivot.chart.subtitleReady",{dimension:S.label,measure:b?`${y.label} / ${b.label}`:y.label}):u("pivot.chart.subtitle"),D=mt.useMemo(()=>!S||!y?[]:ju({rows:e,dimensionFieldId:S.fieldId,primaryValue:y.item,secondaryValue:b?.item}),[y,e,b,S]),w=v=>y?oi(v,y.item,t):v.toLocaleString(),A=v=>b?oi(v,b.item,t):v.toLocaleString(),P=C.length>1||g.length>1;return jsxRuntime.jsxs(sn,{title:u("pivot.chart.title"),subtitle:E,collapsed:s,onToggleCollapse:h,expandAriaLabel:u("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:u("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[P&&jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.dimension")}),jsxRuntime.jsx(material.Select,{value:S?.fieldId??"",onChange:v=>l(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:C.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v.fieldId,sx:{fontSize:"0.75rem"},children:v.label},v.fieldId))})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.primaryMeasure")}),jsxRuntime.jsx(material.Select,{value:y?.fieldId??"",onChange:v=>m(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:g.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v.fieldId,sx:{fontSize:"0.75rem"},children:v.label},v.fieldId))})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.secondaryMeasure")}),jsxRuntime.jsxs(material.Select,{value:b?.fieldId??"",onChange:v=>f(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:u("common.none")}),g.filter(v=>v.fieldId!==y?.fieldId).map(v=>jsxRuntime.jsx(material.MenuItem,{value:v.fieldId,sx:{fontSize:"0.75rem"},children:v.label},v.fieldId))]})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.chartType")}),jsxRuntime.jsxs(material.Select,{value:d,onChange:v=>p(v.target.value),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.barVertical")}),jsxRuntime.jsx(material.MenuItem,{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.barHorizontal")}),jsxRuntime.jsx(material.MenuItem,{value:"line",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.line")}),jsxRuntime.jsx(material.MenuItem,{value:"scatter",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.scatter")})]})]})]}),jsxRuntime.jsx(material.Box,{children:S?y?D.length===0?jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoData")})}):d==="scatter"?jsxRuntime.jsx(Gu,{data:D,primaryLabel:y.label,secondaryLabel:b?.label,formatPrimaryValue:w,formatSecondaryValue:A}):jsxRuntime.jsx(Ku,{data:D,chartType:d,primaryLabel:y.label,secondaryLabel:b?.label,formatPrimaryValue:w,formatSecondaryValue:A}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoValue")})}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoDimension")})})})]})};var Vs=({node:e,dataColumns:t,fieldMap:o,level:a,expandedKeys:r,onToggle:n,getValue:i})=>{let c=r.has(e.key),d=e.children.length>0,s=e.isGrandTotal;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(material.TableRow,{sx:l=>({bgcolor:s?l.palette.mode==="dark"?"rgba(25, 118, 210, 0.22)":"rgba(47, 91, 255, 0.08)":l.palette.mode==="dark"?"#111111":"background.paper","&:hover":{bgcolor:s?l.palette.mode==="dark"?"rgba(25, 118, 210, 0.28)":"rgba(47, 91, 255, 0.12)":l.palette.mode==="dark"?"#181818":"rgba(0, 0, 0, 0.02)"}}),children:[jsxRuntime.jsxs(material.TableCell,{sx:l=>({fontSize:"0.76rem",fontWeight:s?800:600,borderBottom:`1px solid ${l.palette.divider}`,whiteSpace:"nowrap",pl:a*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!s&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>n(e.key),sx:{p:.2,mr:.5,ml:-1},children:c?jsxRuntime.jsx(lh__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(Kf__default.default,{sx:{fontSize:16}})}),!d&&!s&&a>0&&jsxRuntime.jsx(material.Box,{sx:{width:20}}),e.value]}),t.map(l=>jsxRuntime.jsx(material.TableCell,{align:"right",sx:{fontSize:"0.76rem",fontWeight:s?800:500,borderBottom:m=>`1px solid ${m.palette.divider}`,whiteSpace:"nowrap"},children:oi(i?i(e,l.id):e.aggregatedValues[l.id]??0,l.valueItem,o)},`${e.key}-${l.id}`))]}),c&&e.children.map(l=>jsxRuntime.jsx(Vs,{node:l,dataColumns:t,fieldMap:o,level:a+1,expandedKeys:r,onToggle:n,getValue:i},l.key))]})};var Ec=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},$s=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",Fc=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",om=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},rm=(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,rm(r.children,t,o+1)),o),tC=(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},y5=({title:e,rows:t,fields:o,initialLayout:a,initialChart:r,emptyText:n,maxPreviewHeight:i=520,initialChartCollapsed:c=false,initialTableCollapsed:d=false,model:s,enablePresetManagement:l=false,presets:m,defaultPresets:f,onPresetsChange:p,initialPresetId:h,onPresetApplied:k})=>{let{t:u}=j(),C=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),g=mt.useRef(0),y=mt.useRef(false),b=e??u("pivot.title.default"),S=n??u("pivot.empty"),E=mt.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]),D=mt.useCallback(x=>E[x]??wu[x],[E]),w=mt.useMemo(()=>new Set(o.map(x=>x.id)),[o]),A=mt.useMemo(()=>new Map(o.map(x=>[x.id,x])),[o]),[P,v]=mt.useState(()=>Ct(a?.rows,w)),[M,T]=mt.useState(()=>Ct(a?.columns,w)),[R,I]=mt.useState(()=>Ct(a?.filters,w)),[$,N]=mt.useState(()=>{let x=a?.values??[],B=new Set,F=[];return x.forEach(G=>{if(!w.has(G.fieldId)||B.has(G.fieldId))return;B.add(G.fieldId),g.current+=1;let Y=A.get(G.fieldId);F.push({tokenId:`v${g.current}`,fieldId:G.fieldId,aggregation:Kt(G.aggregation,Y)});}),F}),[X,se]=mt.useState({}),[J,ee]=mt.useState(true),[Z,Oe]=mt.useState(false),[Je,Ke]=mt.useState(()=>Ec(Ct(a?.rows,w),Ct(a?.columns,w),r?.dimensionFieldId)),[ae,Be]=mt.useState(()=>{let x=(a?.values??[]).filter((B,F,G)=>w.has(B.fieldId)&&G.findIndex(Y=>Y.fieldId===B.fieldId)===F).map(B=>({tokenId:B.fieldId,fieldId:B.fieldId,aggregation:Kt(B.aggregation,A.get(B.fieldId))}));return $s(x,r?.primaryValueFieldId)}),[De,qe]=mt.useState(()=>{let x=(a?.values??[]).filter((F,G,Y)=>w.has(F.fieldId)&&Y.findIndex(ge=>ge.fieldId===F.fieldId)===G).map(F=>({tokenId:F.fieldId,fieldId:F.fieldId,aggregation:Kt(F.aggregation,A.get(F.fieldId))})),B=$s(x,r?.primaryValueFieldId);return Fc(x,B,r?.secondaryValueFieldId)}),[Le,We]=mt.useState(r?.chartType??"bar-vertical"),[et,to]=mt.useState(c),[Ft,W]=mt.useState(d),[le,be]=mt.useState(()=>f??[]),[he,V]=mt.useState(""),[ce,te]=mt.useState(false),[de,xe]=mt.useState(""),[ve,ft]=mt.useState(null),[tt,Lt]=mt.useState(new Set(["__grand_total__"])),[jt,Zt]=mt.useState(new Set),Ae=s?.rowFields??P,ye=s?.columnFields??M,St=s?.filterFields??R,ze=s?.valueFields??$,Wt=s?.filterSelections??X,wo=s?.showGrandTotal??J,_a=s?.isConfiguratorCollapsed??Z,O=s?.chartDimensionFieldId??Je,H=s?.chartPrimaryValueFieldId??ae,K=s?.chartSecondaryValueFieldId??De,Ce=s?.chartType??Le,Se=s?.isChartCollapsed??et,Fe=s?.isTableCollapsed??Ft,fe=m??le,Ne=l||fe.length>0||!!p,Te=mt.useCallback(x=>{if(s?.setRowFields){s.setRowFields(x);return}v(x);},[s]),Ve=mt.useCallback(x=>{if(s?.setColumnFields){s.setColumnFields(x);return}T(x);},[s]),Ee=mt.useCallback(x=>{if(s?.setFilterFields){s.setFilterFields(x);return}I(x);},[s]),we=mt.useCallback(x=>{if(s?.setValueFields){s.setValueFields(x);return}N(x);},[s]),Me=mt.useCallback(x=>{if(s?.setFilterSelections){s.setFilterSelections(x);return}se(x);},[s]),$t=mt.useCallback(x=>{if(s?.setShowGrandTotal){s.setShowGrandTotal(x);return}ee(x);},[s]),To=mt.useCallback(x=>{if(s?.setIsConfiguratorCollapsed){s.setIsConfiguratorCollapsed(x);return}Oe(x);},[s]),xt=mt.useCallback(x=>{if(s?.setChartDimensionFieldId){s.setChartDimensionFieldId(x);return}Ke(x);},[s]),wt=mt.useCallback(x=>{if(s?.setChartPrimaryValueFieldId){s.setChartPrimaryValueFieldId(x);return}Be(x);},[s]),ho=mt.useCallback(x=>{if(s?.setChartSecondaryValueFieldId){s.setChartSecondaryValueFieldId(x);return}qe(x);},[s]),Ca=mt.useCallback(x=>{if(s?.setChartType){s.setChartType(x);return}We(x);},[s]),Pr=mt.useCallback(x=>{if(s?.setIsChartCollapsed){s.setIsChartCollapsed(x);return}to(x);},[s]),Io=mt.useCallback(x=>{if(s?.setIsTableCollapsed){s.setIsTableCollapsed(x);return}W(x);},[s]),oo=mt.useCallback(x=>{let B=typeof x=="function"?x(fe):x;m||be(B),p?.(B);},[p,fe,m]),ja=mt.useMemo(()=>new Set([...Ae,...ye,...St]),[Ae,ye,St]),Qo=mt.useMemo(()=>o.filter(x=>!ja.has(x.id)),[o,ja]),Ht=mt.useMemo(()=>{let x=[...Ae,...ye,...St],B=new Set,F=[];return x.forEach(G=>{B.has(G)||(B.add(G),F.push(G));}),F},[ye,St,Ae]);mt.useEffect(()=>{Te(x=>{let B=x.filter(F=>w.has(F));return ga(x,B)?x:B}),Ve(x=>{let B=x.filter(F=>w.has(F));return ga(x,B)?x:B}),Ee(x=>{let B=x.filter(F=>w.has(F));return ga(x,B)?x:B}),we(x=>{let B=x.filter(F=>w.has(F.fieldId)).map(F=>({...F,aggregation:Kt(F.aggregation,A.get(F.fieldId))}));return Ps(x,B)?x:B});},[A,w]);let ao=mt.useMemo(()=>{let x={};return Ht.forEach(B=>{let F=new Set;t.forEach(G=>{F.add(ma(G[B]));}),x[B]=Array.from(F).sort((G,Y)=>G.localeCompare(Y));}),x},[Ht,t]);mt.useEffect(()=>{Me(x=>{let B={};return Ht.forEach(F=>{let G=ao[F]??[],ge=(x[F]??[]).filter(_=>G.includes(_)),L=Object.prototype.hasOwnProperty.call(x,F);B[F]=L?ge:G;}),Mu(x,B)?x:B});},[Ht,ao]),mt.useEffect(()=>{xt(x=>Ec(Ae,ye,x));},[ye,Ae,xt]),mt.useEffect(()=>{wt(x=>$s(ze,x));},[wt,ze]),mt.useEffect(()=>{ho(x=>Fc(ze,H,x));},[H,ho,ze]);let zt=mt.useMemo(()=>t.filter(x=>Ht.every(B=>{let F=Wt[B]??[],G=ao[B]??[];if(F.length===G.length)return true;if(F.length===0)return false;let Y=ma(x[B]);return F.includes(Y)})),[Ht,ao,Wt,t]),$e=mt.useMemo(()=>{if(ze.length===0)return null;let x=new Map;if(zt.forEach(L=>{let _=ye.length>0?ye.map(Xe=>ma(L[Xe])):[u("pivot.valueLabel")],q=fr(_);x.set(q,_);}),x.size===0){let L=ye.length>0?ye.map(()=>Ts):[u("pivot.valueLabel")];x.set(fr(L),L);}let B=Array.from(x.entries()).sort((L,_)=>Du(L[1],_[1])),F=B.flatMap(([L,_])=>ze.map(q=>{let Xe=A.get(q.fieldId),z=`${D(q.aggregation)} ${Xe?.label??q.fieldId}`,Q=ye.length===0||ze.length>1?`${_.join(" / ")} \u2022 ${z}`:_.join(" / ");return {id:`${L}::${q.tokenId}`,colKey:L,valueItem:q,label:Q}})),G=[];ye.length>0&&B.forEach(([L,_])=>{let q=F.filter(Q=>Q.colKey===L),Xe=G,z=[];_.forEach((Q,U)=>{z.push(`d${U}:${Q}`);let ne=`col::${fr(z)}`,He=Xe.find(Uo=>Uo.key===ne);He||(He={key:ne,label:Q,children:[],leafColumnIds:[],path:_.slice(0,U+1),depth:U},Xe.push(He)),q.forEach(Uo=>{He.leafColumnIds.includes(Uo.id)||He.leafColumnIds.push(Uo.id);}),Xe=He.children;});});let Y=L=>{let _={};return F.forEach(q=>{let Xe=L.filter(z=>{let Q=ye.length>0?ye.map(U=>ma(z[U])):[u("pivot.valueLabel")];return fr(Q)===q.colKey});_[q.id]=tn(Xe,q.valueItem.fieldId,q.valueItem.aggregation);}),_},ge=[];if(Ae.length===0)ge.push({key:"root",value:u("pivot.resultLabel")||ku,children:[],isLeaf:true,aggregatedValues:Y(zt),path:[],depth:0});else {let L=(_,q,Xe)=>{if(q>=Ae.length)return [];let z=Ae[q],Q=new Map;return _.forEach(U=>{let ne=ma(U[z]);Q.has(ne)||Q.set(ne,[]),Q.get(ne).push(U);}),Array.from(Q.keys()).sort().map(U=>{let ne=Q.get(U),He=[...Xe,U];return {key:fr(He),value:U,fieldId:z,aggregatedValues:Y(ne),children:L(ne,q+1,He),isLeaf:q===Ae.length-1,path:He,depth:q}})};ge.push(...L(zt,0,[]));}return {dataColumns:F,columnTree:G,rowTree:ge}},[ye,A,zt,D,Ae,u,ze]),Yo=mt.useCallback((x,B)=>(g.current+=1,{tokenId:`v${g.current}`,fieldId:x,aggregation:Kt(B,A.get(x))}),[A]),Wo=mt.useCallback(x=>{if(x==="rows")return Te([]);if(x==="columns")return Ve([]);if(x==="filters")return Ee([]);we([]);},[]),Jo=mt.useCallback((x,B)=>{if(x==="rows")return Te(F=>F.filter(G=>G!==B));if(x==="columns")return Ve(F=>F.filter(G=>G!==B));if(x==="filters")return Ee(F=>F.filter(G=>G!==B));we(F=>F.filter(G=>G.tokenId!==B));},[]),Za=mt.useCallback((x,B)=>{we(F=>F.map(G=>G.tokenId===x?{...G,aggregation:Kt(B,A.get(G.fieldId))}:G));},[A]),$o=mt.useCallback(x=>{ft(String(x.active.id));},[]),Xa=mt.useCallback(x=>{if(ft(null),!x.over)return;let B=Is(String(x.active.id)),F=Is(String(x.over.id));if(!B||!F||B.kind!=="item"||!B.key)return;if(B.zone===F.zone&&F.kind==="item"){if(B.zone==="rows"){let U=Ae.indexOf(B.key),ne=Ae.indexOf(F.key??"");U!==-1&&ne!==-1&&U!==ne&&Te(He=>sortable.arrayMove(He,U,ne));return}if(B.zone==="columns"){let U=ye.indexOf(B.key),ne=ye.indexOf(F.key??"");U!==-1&&ne!==-1&&U!==ne&&Ve(He=>sortable.arrayMove(He,U,ne));return}if(B.zone==="filters"){let U=St.indexOf(B.key),ne=St.indexOf(F.key??"");U!==-1&&ne!==-1&&U!==ne&&Ee(He=>sortable.arrayMove(He,U,ne));return}if(B.zone==="values"){let U=ze.findIndex(He=>He.tokenId===B.key),ne=ze.findIndex(He=>He.tokenId===(F.key??""));U!==-1&&ne!==-1&&U!==ne&&we(He=>sortable.arrayMove(He,U,ne));}return}let G=F.zone,Y=[...Ae],ge=[...ye],L=[...St],_=[...ze],q="",Xe=null;if(B.zone==="palette")q=B.key;else if(B.zone==="values"){let U=_.find(ne=>ne.tokenId===B.key);if(!U)return;q=U.fieldId,Xe=U,_=_.filter(ne=>ne.tokenId!==B.key);}else B.zone==="rows"?(q=B.key,Y=Y.filter(U=>U!==q)):B.zone==="columns"?(q=B.key,ge=ge.filter(U=>U!==q)):B.zone==="filters"&&(q=B.key,L=L.filter(U=>U!==q));if(!q)return;let z=()=>{Y=Y.filter(U=>U!==q),ge=ge.filter(U=>U!==q),L=L.filter(U=>U!==q);},Q=U=>{if(F.kind!=="item"||!F.key)return U==="rows"?Y.length:U==="columns"?ge.length:U==="filters"?L.length:U==="values"?_.length:0;if(U==="rows"){let ne=Y.indexOf(F.key);return ne>=0?ne:Y.length}if(U==="columns"){let ne=ge.indexOf(F.key);return ne>=0?ne:ge.length}if(U==="filters"){let ne=L.indexOf(F.key);return ne>=0?ne:L.length}if(U==="values"){let ne=_.findIndex(He=>He.tokenId===F.key);return ne>=0?ne:_.length}return 0};if(G==="palette"){Te(Y),Ve(ge),Ee(L),we(_);return}if(G==="values"){let U=Q("values"),ne=Xe??Yo(q);_.splice(U,0,ne),Te(Y),Ve(ge),Ee(L),we(_);return}if(Ru(G)){z();let U=Q(G);G==="rows"?Y.splice(U,0,q):G==="columns"?ge.splice(U,0,q):L.splice(U,0,q),Te(Y),Ve(ge),Ee(L),we(_);}},[ye,Yo,St,Ae,ze]),Qa=mt.useCallback((x,B)=>{Me(F=>({...F,[x]:B}));},[]),Ho=mt.useCallback(x=>{Lt(B=>{let F=new Set(B);return F.has(x)?F.delete(x):F.add(x),F});},[]),ea=mt.useCallback(x=>{Zt(B=>{let F=new Set(B);return F.has(x)?F.delete(x):F.add(x),F});},[]),ka=mt.useCallback(x=>{let B=A.get(x.fieldId),F=vc(B);return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:98},children:jsxRuntime.jsx(material.Select,{value:x.aggregation,onChange:G=>Za(x.tokenId,G.target.value),onClick:G=>G.stopPropagation(),onMouseDown:G=>G.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:F.map(G=>jsxRuntime.jsx(material.MenuItem,{value:G,sx:{fontSize:"0.75rem"},children:D(G)},G))})})},[A,D,Za]),Gt=mt.useCallback(x=>{let B=ao[x]??[],F=Wt[x]??B;return B.length===0?u("pivot.filter.noValues"):F.length===0?u("pivot.filter.noneSelected"):F.length===B.length?u("pivot.filter.allValues"):u("pivot.filter.selectedCount",{selected:F.length,total:B.length})},[ao,Wt,u]),Po=mt.useCallback(x=>{let B=ao[x]??[],F=Wt[x]??B;return jsxRuntime.jsx(Eu,{options:B,selectedValues:F,onChange:G=>Qa(x,G)})},[ao,Wt,Qa]),ta=mt.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),yo=mt.useCallback(()=>{let x={};return new Set([...Ht,...Object.keys(Wt)]).forEach(F=>{if(!w.has(F))return;let G=Wt[F]??[];x[F]=[...G];}),{layout:{rows:[...Ae],columns:[...ye],filters:[...St],values:ze.map(F=>({fieldId:F.fieldId,aggregation:F.aggregation}))},filterSelections:x,showGrandTotal:wo,chart:{dimensionFieldId:O,primaryValueFieldId:H,secondaryValueFieldId:K,chartType:Ce}}},[Ht,O,H,K,Ce,ye,St,Wt,Ae,wo,w,ze]),Go=mt.useCallback(x=>{let B=Ct(x.layout.rows,w),F=Ct(x.layout.columns,w),G=Ct(x.layout.filters,w),Y=new Set,ge=(x.layout.values??[]).filter(q=>!w.has(q.fieldId)||Y.has(q.fieldId)?false:(Y.add(q.fieldId),true)).map(q=>Yo(q.fieldId,q.aggregation)),L={};Object.entries(x.filterSelections??{}).forEach(([q,Xe])=>{!w.has(q)||!Array.isArray(Xe)||(L[q]=Array.from(new Set(Xe.map(z=>String(z)))));}),Te(B),Ve(F),Ee(G),we(ge),Me(L),typeof x.showGrandTotal=="boolean"&&$t(x.showGrandTotal),xt(Ec(B,F,x.chart?.dimensionFieldId));let _=$s(ge,x.chart?.primaryValueFieldId);wt(_),ho(Fc(ge,_,x.chart?.secondaryValueFieldId)),Ca(x.chart?.chartType??"bar-vertical"),V(x.id),k?.(x);},[Yo,k,xt,wt,ho,Ca,Ve,Ee,Me,Te,$t,we,w]),Ya=mt.useCallback(x=>{if(!x){V("");return}let B=fe.find(F=>F.id===x);if(!B){V("");return}Go(B);},[Go,fe]),Rr=mt.useCallback(()=>{let x=u("pivot.preset.defaultName",{index:fe.length+1});xe(x),te(true);},[fe.length,u]),Sa=mt.useCallback(()=>{let x=de.trim();if(!x)return;let B={id:ta(),name:x,...yo()};oo(F=>[...F,B]),V(B.id),te(false);},[yo,ta,de,oo]),Ja=mt.useCallback(()=>{he&&(oo(x=>x.filter(B=>B.id!==he)),V(""));},[he,oo]);mt.useEffect(()=>{if(!h||y.current)return;let x=fe.find(B=>B.id===h);x&&(y.current=true,Go(x));},[Go,h,fe]),mt.useEffect(()=>{he&&(fe.some(x=>x.id===he)||V(""));},[he,fe]);let oa=mt.useMemo(()=>{if(!wo||!$e||!Ae.length)return null;let x={};return $e.dataColumns.forEach(B=>{let F=zt.filter(G=>{let Y=ye.length>0?ye.map(ge=>ma(G[ge])):[u("pivot.valueLabel")];return fr(Y)===B.colKey});x[B.id]=tn(F,B.valueItem.fieldId,B.valueItem.aggregation);}),{key:"__grand_total__",value:u("pivot.grandTotal")||Su,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:x,path:[],depth:-1}},[wo,$e,zt,ye,Ae.length,u]),Xt=mt.useMemo(()=>om($e?.rowTree??[]),[$e]),Ro=mt.useMemo(()=>om($e?.columnTree??[]),[$e]);mt.useEffect(()=>{Lt(x=>{let B=new Set;return x.has("__grand_total__")&&B.add("__grand_total__"),Xt.forEach(F=>{x.has(F)&&B.add(F);}),B});},[Xt]),mt.useEffect(()=>{Zt(x=>{let B=new Set;return Ro.forEach(F=>{x.has(F)&&B.add(F);}),B});},[Ro]);let Dr=mt.useCallback(()=>{Lt(x=>{let B=new Set(x);return Xt.forEach(F=>B.add(F)),B});},[Xt]),er=mt.useCallback(()=>{Lt(x=>{let B=new Set;return x.has("__grand_total__")&&B.add("__grand_total__"),B});},[]),Mr=mt.useCallback(()=>{Zt(new Set(Ro));},[Ro]),Ar=mt.useCallback(()=>{Zt(new Set);},[]),Br=mt.useMemo(()=>!$e||ye.length===0?[]:tC($e.columnTree,jt),[ye.length,jt,$e]),ro=mt.useMemo(()=>{if(!$e)return [];if(ye.length===0)return $e.dataColumns.map(B=>({id:B.id,label:B.label,leafColumnIds:[B.id],valueItem:B.valueItem}));let x=new Map($e.dataColumns.map(B=>[B.id,B]));return Br.flatMap(B=>{let F=new Map;return B.leafColumnIds.forEach(G=>{let Y=x.get(G);if(!Y)return;let ge=Y.valueItem.tokenId,L=`${D(Y.valueItem.aggregation)} ${A.get(Y.valueItem.fieldId)?.label??Y.valueItem.fieldId}`,_=F.get(ge);if(_){_.leafColumnIds.push(G);return}F.set(ge,{id:`${B.key}::${ge}`,label:ze.length>1?L:B.label,leafColumnIds:[G],valueItem:Y.valueItem});}),Array.from(F.values())})},[ye.length,A,D,$e,ze.length,Br]),Er=mt.useMemo(()=>new Map(ro.map(x=>[x.id,x])),[ro]),Fr=mt.useMemo(()=>ro.map(x=>({id:x.id,colKey:x.id,valueItem:x.valueItem,label:x.label})),[ro]),tr=mt.useMemo(()=>{if(!$e||ye.length===0)return [];let x=[],B=rm($e.columnTree,jt),F=B+(ze.length>1?1:0),G=(Y,ge)=>{x[ge]??(x[ge]=[]),Y.forEach(L=>{let _=L.children.length>0&&jt.has(L.key),q=ro.filter(z=>L.leafColumnIds.some(Q=>z.leafColumnIds.includes(Q))).length,Xe=_||ze.length>1?1:F-ge;x[ge].push({key:L.key,label:L.label,colSpan:q,rowSpan:Xe,expandable:L.children.length>0,expanded:_}),_&&G(L.children,ge+1);});};return G($e.columnTree,0),ze.length>1&&(x[B]=ro.map(Y=>({key:Y.id,label:Y.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),x},[ye.length,jt,$e,ze.length,ro]),aa=mt.useCallback((x,B)=>B.leafColumnIds.reduce((F,G)=>F+(x.aggregatedValues[G]??0),0),[]),wa=mt.useMemo(()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Dr,disabled:Xt.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.expandRowsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:er,disabled:Xt.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.collapseRowsAll")}),jsxRuntime.jsx(material.Divider,{orientation:"vertical",flexItem:true}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Mr,disabled:Ro.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.expandColumnsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Ar,disabled:ye.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.collapseColumnsAll")})]}),[ye.length,Ro.size,Xt.size,Ar,er,Mr,Dr,u]),Ta=()=>{if(!ve)return null;let x=Is(ve);if(!x||x.kind!=="item"||!x.key)return null;if(x.zone==="palette"){let Y=A.get(x.key);return Y?jsxRuntime.jsx(kc,{label:Y.label,subtitle:Y.type}):null}if(x.zone==="values"){let Y=ze.find(q=>q.tokenId===x.key);if(!Y)return null;let L=A.get(Y.fieldId)?.label??Y.fieldId,_=`${D(Y.aggregation)}(${L})`;return jsxRuntime.jsx(Bs,{label:L,caption:_})}let F=A.get(x.key)?.label??x.key,G=Gt(x.key);return jsxRuntime.jsx(Bs,{label:F,caption:G})};return jsxRuntime.jsxs(material.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:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800},children:b}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:u("pivot.subtitle.default")})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[Ne&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:200},children:jsxRuntime.jsxs(material.Select,{value:he,displayEmpty:true,onChange:x=>Ya(String(x.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:u("pivot.preset.selectPlaceholder")}),fe.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x.id,sx:{fontSize:"0.75rem"},children:x.name},x.id))]})}),jsxRuntime.jsx(material.Tooltip,{title:u("pivot.preset.save"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:Rr,"aria-label":u("pivot.preset.save"),children:jsxRuntime.jsx(Rp__default.default,{sx:{fontSize:18}})})}),jsxRuntime.jsx(material.Tooltip,{title:u("pivot.preset.delete"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:Ja,disabled:!he,"aria-label":u("pivot.preset.delete"),children:jsxRuntime.jsx(qv__default.default,{sx:{fontSize:18}})})})}),jsxRuntime.jsx(material.Divider,{flexItem:true,orientation:"vertical"})]}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary"},children:[u("pivot.records"),": ",jsxRuntime.jsx("strong",{children:t.length.toLocaleString()})," / ",u("pivot.afterFilter"),":"," ",jsxRuntime.jsx("strong",{children:zt.length.toLocaleString()})]}),jsxRuntime.jsx(material.Divider,{flexItem:true,orientation:"vertical"}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.6},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem"},children:u("pivot.grandTotal")}),jsxRuntime.jsx(material.Switch,{size:"small",checked:wo,onChange:x=>$t(x.target.checked)})]})]})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(core.DndContext,{sensors:C,collisionDetection:core.closestCenter,onDragStart:$o,onDragEnd:Xa,children:[jsxRuntime.jsx($u,{isConfiguratorCollapsed:_a,onToggleCollapse:()=>To(x=>!x),availableFields:Qo,fieldMap:A,filterFields:St,columnFields:ye,rowFields:Ae,valueFields:ze,clearZone:Wo,removeFieldFromZone:Jo,getFilterSelectionSummary:Gt,renderDimensionFilterSelect:Po,renderAggregationSelect:ka,getAggregationLabel:D}),jsxRuntime.jsx(material.Portal,{children:jsxRuntime.jsx(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Ta()})})]}),jsxRuntime.jsx(Zu,{rows:zt,fieldMap:A,rowFields:Ae,columnFields:ye,valueFields:ze,chartDimensionFieldId:O,chartPrimaryValueFieldId:H,chartSecondaryValueFieldId:K,chartType:Ce,isCollapsed:Se,onChartDimensionFieldIdChange:x=>xt(x),onChartPrimaryValueFieldIdChange:x=>wt(x),onChartSecondaryValueFieldIdChange:x=>ho(x),onChartTypeChange:x=>Ca(x),onToggleCollapse:()=>Pr(x=>!x),getAggregationLabel:D}),jsxRuntime.jsx(sn,{title:u("pivot.table.sectionTitle"),subtitle:Ae.length>0?Ae.map(x=>A.get(x)?.label??x).join(" > "):u("pivot.table.dimensions"),collapsed:Fe,onToggleCollapse:()=>Io(x=>!x),expandAriaLabel:u("pivot.table.collapse.ariaExpand"),collapseAriaLabel:u("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:wa,children:$e===null?jsxRuntime.jsx(material.Box,{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:S})}):jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:i},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:(tr.length>0?tr:[[]]).map((x,B)=>jsxRuntime.jsxs(material.TableRow,{children:[B===0&&jsxRuntime.jsx(material.TableCell,{rowSpan:Math.max(tr.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:Ae.length>0?Ae.map(F=>A.get(F)?.label).join(" > "):u("pivot.table.dimensions")}),(x.length>0?x:ro.map(F=>({key:F.id,label:F.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(F=>jsxRuntime.jsx(material.TableCell,{align:"center",colSpan:F.colSpan,rowSpan:F.rowSpan,sx:G=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:G.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${G.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:jsxRuntime.jsxs(material.Box,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[F.expandable&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>ea(F.key),sx:{p:.1,ml:-0.3},children:F.expanded?jsxRuntime.jsx(lh__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(Kf__default.default,{sx:{fontSize:16}})}),jsxRuntime.jsx(material.Box,{component:"span",children:F.label})]})},F.key))]},`pivot-header-row-${B}`))}),jsxRuntime.jsxs(material.TableBody,{children:[$e.rowTree.map(x=>jsxRuntime.jsx(Vs,{node:x,dataColumns:Fr,fieldMap:A,level:0,expandedKeys:tt,onToggle:Ho,getValue:(B,F)=>{let G=Er.get(F);return G?aa(B,G):0}},x.key)),oa&&jsxRuntime.jsx(Vs,{node:oa,dataColumns:Fr,fieldMap:A,level:0,expandedKeys:tt,onToggle:Ho,getValue:(x,B)=>{let F=Er.get(B);return F?aa(x,F):0}})]})]})})}),jsxRuntime.jsxs(material.Dialog,{open:ce,onClose:()=>te(false),maxWidth:"xs",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:u("pivot.preset.saveDialogTitle")}),jsxRuntime.jsx(material.DialogContent,{children:jsxRuntime.jsx(material.TextField,{autoFocus:true,fullWidth:true,margin:"dense",label:u("pivot.preset.nameLabel"),value:de,onChange:x=>xe(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),Sa());}})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>te(false),children:u("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:Sa,disabled:!de.trim(),children:u("common.save")})]})]})]})};var nm=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},zc=(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??"",k5=({fields:e,initialLayout:t,initialFilterSelections:o={},initialShowGrandTotal:a=true,initialConfiguratorCollapsed:r=false,initialChart:n,initialChartCollapsed:i=false,initialTableCollapsed:c=false})=>{let d=mt.useRef(0),s=mt.useMemo(()=>new Set(e.map(V=>V.id)),[e]),l=mt.useMemo(()=>new Map(e.map(V=>[V.id,V])),[e]),[m,f]=mt.useState(()=>Ct(t?.rows,s)),[p,h]=mt.useState(()=>Ct(t?.columns,s)),[k,u]=mt.useState(()=>Ct(t?.filters,s)),[C,g]=mt.useState(()=>{let V=t?.values??[],ce=new Set,te=[];return V.forEach(de=>{!s.has(de.fieldId)||ce.has(de.fieldId)||(ce.add(de.fieldId),d.current+=1,te.push({tokenId:`v${d.current}`,fieldId:de.fieldId,aggregation:Kt(de.aggregation,l.get(de.fieldId))}));}),te}),[y,b]=mt.useState(o),[S,E]=mt.useState(a),[D,w]=mt.useState(r),[A,P]=mt.useState(()=>nm(Ct(t?.rows,s),Ct(t?.columns,s),n?.dimensionFieldId)),[v,M]=mt.useState(()=>{let V=(()=>{let ce=t?.values??[],te=new Set,de=[];return ce.forEach(xe=>{!s.has(xe.fieldId)||te.has(xe.fieldId)||(te.add(xe.fieldId),de.push({tokenId:xe.fieldId,fieldId:xe.fieldId,aggregation:Kt(xe.aggregation,l.get(xe.fieldId))}));}),de})();return zc(V,n?.primaryValueFieldId)}),[T,R]=mt.useState(()=>{let V=(()=>{let te=t?.values??[],de=new Set,xe=[];return te.forEach(ve=>{!s.has(ve.fieldId)||de.has(ve.fieldId)||(de.add(ve.fieldId),xe.push({tokenId:ve.fieldId,fieldId:ve.fieldId,aggregation:Kt(ve.aggregation,l.get(ve.fieldId))}));}),xe})(),ce=zc(V,n?.primaryValueFieldId);return im(V,ce,n?.secondaryValueFieldId)}),[I,$]=mt.useState(n?.chartType??"bar-vertical"),[N,X]=mt.useState(i),[se,J]=mt.useState(c);mt.useEffect(()=>{f(V=>{let ce=V.filter(te=>s.has(te));return ga(V,ce)?V:ce}),h(V=>{let ce=V.filter(te=>s.has(te));return ga(V,ce)?V:ce}),u(V=>{let ce=V.filter(te=>s.has(te));return ga(V,ce)?V:ce}),g(V=>{let ce=V.filter(te=>s.has(te.fieldId)).map(te=>({...te,aggregation:Kt(te.aggregation,l.get(te.fieldId))}));return Ps(V,ce)?V:ce});},[l,s]),mt.useEffect(()=>{P(V=>nm(m,p,V));},[p,m]),mt.useEffect(()=>{M(V=>zc(C,V));},[C]),mt.useEffect(()=>{R(V=>im(C,v,V));},[v,C]);let ee=mt.useCallback(V=>{f(Ct(V,s));},[s]),Z=mt.useCallback(V=>{h(Ct(V,s));},[s]),Oe=mt.useCallback(V=>{u(Ct(V,s));},[s]),Je=mt.useCallback(V=>{g(ce=>{let te=V??[],de=new Set,xe=[];return te.forEach(ve=>{if(!s.has(ve.fieldId)||de.has(ve.fieldId))return;de.add(ve.fieldId);let ft=ce.find(tt=>tt.fieldId===ve.fieldId);if(ft){xe.push({...ft,aggregation:Kt(ve.aggregation??ft.aggregation,l.get(ve.fieldId))});return}d.current+=1,xe.push({tokenId:`v${d.current}`,fieldId:ve.fieldId,aggregation:Kt(ve.aggregation,l.get(ve.fieldId))});}),xe});},[l,s]),Ke=mt.useCallback(V=>{ee(V.rows??[]),Z(V.columns??[]),Oe(V.filters??[]),Je(V.values??[]);},[Z,Oe,ee,Je]),ae=mt.useCallback(V=>{if(V==="rows")return f([]);if(V==="columns")return h([]);if(V==="filters")return u([]);g([]);},[]),Be=mt.useCallback((V,ce)=>{if(V==="rows")return f(te=>te.filter(de=>de!==ce));if(V==="columns")return h(te=>te.filter(de=>de!==ce));if(V==="filters")return u(te=>te.filter(de=>de!==ce));g(te=>te.filter(de=>de.tokenId!==ce));},[]),De=mt.useCallback((V,ce)=>{g(te=>te.map(de=>de.tokenId===V?{...de,aggregation:Kt(ce,l.get(de.fieldId))}:de));},[l]),qe=mt.useCallback((V,ce)=>{b(te=>({...te,[V]:ce}));},[]),Le=mt.useCallback(()=>{b({});},[]),We=mt.useCallback(()=>{E(V=>!V);},[]),et=mt.useCallback(()=>{w(V=>!V);},[]),to=mt.useCallback(V=>{P(V);},[]),Ft=mt.useCallback(V=>{M(V);},[]),W=mt.useCallback(V=>{R(V);},[]),le=mt.useCallback(()=>{X(V=>!V);},[]),be=mt.useCallback(()=>{J(V=>!V);},[]);return {model:mt.useMemo(()=>({rowFields:m,setRowFields:f,columnFields:p,setColumnFields:h,filterFields:k,setFilterFields:u,valueFields:C,setValueFields:g,filterSelections:y,setFilterSelections:b,showGrandTotal:S,setShowGrandTotal:E,isConfiguratorCollapsed:D,setIsConfiguratorCollapsed:w,chartDimensionFieldId:A,setChartDimensionFieldId:P,chartPrimaryValueFieldId:v,setChartPrimaryValueFieldId:M,chartSecondaryValueFieldId:T,setChartSecondaryValueFieldId:R,chartType:I,setChartType:$,isChartCollapsed:N,setIsChartCollapsed:X,isTableCollapsed:se,setIsTableCollapsed:J}),[A,v,T,I,p,k,y,N,D,se,m,S,C]),actions:{setRows:ee,setColumns:Z,setFilters:Oe,setValues:Je,setLayout:Ke,clearZone:ae,removeFieldFromZone:Be,setAggregationForValue:De,setFilterSelection:qe,resetFilterSelections:Le,toggleGrandTotal:We,toggleConfigurator:et,setChartDimension:to,setChartPrimaryValue:Ft,setChartSecondaryValue:W,setChartType:$,toggleChart:le,toggleTable:be}}};var P5=({orientation:e="auto",defaultNavigationOpen:t,onNavOpenChange:o}={})=>{let a=styles.useTheme(),r=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),n=material.useMediaQuery(a.breakpoints.down("md"),{noSsr:true}),i=mt.useMemo(()=>e==="auto"?r||n?"portrait":"landscape":e,[n,r,e]),[c,d]=mt.useState(t??i==="landscape");mt.useEffect(()=>{d(t??i==="landscape");},[t,i]);let s=m=>{d(m),o?.(m);};return {resolvedOrientation:i,isPortraitViewport:r,isCompactViewport:n,navigationOpen:c,setNavigationOpen:s,toggleNavigationOpen:()=>s(!c)}};var lC=e=>{let t=Number(e||0);return Number.isFinite(t)?t:0},M5=({rows:e,rowKey:t="id",numericField:o,defaultSelectedId:a})=>{let n=e[0]?.[t],[i,c]=mt.useState(a??n),d=mt.useMemo(()=>e.find(p=>p[t]===i)||e[0],[t,e,i]),[s,l]=mt.useState(()=>{let p=d?.[o];return p==null?"0":String(p)});return {selectedId:i,selectedRecord:d,editorValue:s,setEditorValue:l,selectRecord:p=>{let h=p[t];c(h);let k=p[o];l(k==null?"0":String(k));},applyEditorValue:p=>{if(i===void 0)return;let h=lC(s),k=e.map(u=>u[t]===i?{...u,[o]:h}:u);p(k);}}};var xC=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],um=(e,t,o,a)=>{t?.(e),a&&o?.();},z5=({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=xC,facingMode:n="environment",manualEntry:i=true,autoCloseOnDetect:c=true,scanIntervalMs:d=600,confirmLabel:s="Use code",cancelLabel:l="Close",manualPlaceholder:m="Enter barcode manually",onDetected:f,onError:p,sx:h})=>{let k=mt__namespace.default.useRef(null),u=mt__namespace.default.useRef(null),C=mt__namespace.default.useRef(null),g=mt__namespace.default.useRef(null),[y,b]=mt__namespace.default.useState("idle"),[S,E]=mt__namespace.default.useState(""),[D,w]=mt__namespace.default.useState(null),[A,P]=mt__namespace.default.useState(null),v=mt__namespace.default.useCallback(()=>{C.current!==null&&(window.clearInterval(C.current),C.current=null),u.current&&(u.current.getTracks().forEach(R=>R.stop()),u.current=null),k.current&&(k.current.srcObject=null);},[]),M=mt__namespace.default.useCallback(R=>{P(R),b("error"),p?.(R);},[p]);mt__namespace.default.useEffect(()=>{if(!e){v(),b("idle"),P(null),E("");return}let R=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 $=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:n}}});if(R){$.getTracks().forEach(N=>N.stop());return}if(u.current=$,k.current&&(k.current.srcObject=$,await k.current.play()),!window.BarcodeDetector){b("unsupported"),P("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}g.current=new window.BarcodeDetector({formats:r}),b("ready"),C.current=window.setInterval(async()=>{if(!(!k.current||!g.current)&&!(k.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let X=(await g.current.detect(k.current)).find(J=>J.rawValue);if(!X?.rawValue)return;let se={rawValue:X.rawValue,format:X.format};w(se),v(),um(se,f,t,c);}catch(N){M(N instanceof Error?N.message:"Failed to detect barcode.");}},d);}catch($){M($ instanceof Error?$.message:"Unable to start camera.");}}})(),()=>{R=true,v();}},[c,n,r,t,f,e,M,d,v]);let T=()=>{let R=S.trim();if(!R)return;let I={rawValue:R,format:"manual"};w(I),um(I,f,t,c);};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:900},children:o}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Stack,{spacing:2,sx:h,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:a}),jsxRuntime.jsxs(material.Paper,{elevation:0,sx:R=>({position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:R.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:[jsxRuntime.jsx("video",{ref:k,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),jsxRuntime.jsx(material.Box,{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(material.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:jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"#38bdf8",boxShadow:"0 0 18px rgba(56,189,248,0.85)"}})})}),jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(yC__default.default,{}),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"}),D?jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(bC__default.default,{}),label:`${D.format||"barcode"}: ${D.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),A?jsxRuntime.jsx(material.Alert,{severity:y==="unsupported"?"info":"warning",children:A}):null,i?jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[jsxRuntime.jsx(material.TextField,{fullWidth:true,label:"Barcode",placeholder:m,value:S,onChange:R=>E(R.target.value)}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:T,sx:{minHeight:56,px:2.5},children:s})]}):null]})}),jsxRuntime.jsx(material.DialogActions,{sx:{px:3,pb:2},children:jsxRuntime.jsx(material.Button,{onClick:t,children:l})})]})};var SC={default:"#475569",primary:"#1d4ed8",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#0369a1"},H5=({title:e,description:t,kicker:o,icon:a,badges:r=[],metrics:n=[],footer:i,children:c,selected:d=false,draggable:s=false,isDragging:l=false,swipeThreshold:m=88,startAction:f,endAction:p,dragHandleProps:h,onClick:k,onSwipe:u,sx:C})=>{let[g,y]=mt.useState(0),[b,S]=mt.useState(false),E=mt.useRef(null),D=mt.useRef(0),w=mt.useRef(0),A=!!(f||p),P=132,v=()=>{y(0),S(false),E.current=null,D.current=0,w.current=0;},M=N=>{(N==="start"?f:p)?.onTrigger?.(),u?.(N),v();},T=N=>{!A||N.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(E.current=N.pointerId,D.current=N.clientX,w.current=N.clientX,S(true),N.currentTarget.setPointerCapture(N.pointerId));},R=N=>{if(!b||E.current!==N.pointerId)return;w.current=N.clientX;let X=w.current-D.current,se=Math.max(-P,Math.min(P,X));y(se);},I=N=>{if(!b||E.current!==N.pointerId)return;let X=w.current-D.current;if(X>=m&&f){M("start");return}if(X<=-m&&p){M("end");return}Math.abs(X)<12&&k?.(),v();},$=(N,X)=>{if(!N)return null;let se=N.backgroundColor||SC[N.tone||"default"];return jsxRuntime.jsx(material.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, ${se}, rgba(15,23,42,0.92))`},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[N.icon,jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700,fontSize:"0.95rem"},children:N.label})]})})};return jsxRuntime.jsxs(material.Box,{sx:{position:"relative",overflow:"hidden",borderRadius:4,...C},children:[$(f,"left"),$(p,"right"),jsxRuntime.jsx(material.Paper,{elevation:0,onPointerDown:T,onPointerMove:R,onPointerUp:I,onPointerCancel:v,sx:N=>({position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:N.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(${g}px, 0, 0) scale(${l?.985:1})`,transition:b?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:k?"pointer":"default",opacity:l?.9:1}),children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[a?jsxRuntime.jsx(material.Box,{sx:{mt:.25},children:a}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[o?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:o}):null,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:e}),t?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:t}):null]}),s?jsxRuntime.jsx(material.Box,{"data-no-swipe":"true",...h,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:jsxRuntime.jsx(material.IconButton,{size:"small",children:jsxRuntime.jsx(kC__default.default,{})})}):null]}),r.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:r.map((N,X)=>jsxRuntime.jsx(material.Chip,{label:N,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},X))}):null,n.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:n.map(N=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:N.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:N.value})]},N.id))}):null,c,i]})})]})};var ui=({label:e,onPress:t,emphasis:o="default"})=>jsxRuntime.jsx(material.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}),Q5=({value:e,defaultValue:t="",title:o,subtitle:a,placeholder:r="0",allowDecimal:n=false,allowNegative:i=false,maxLength:c,confirmLabel:d,clearLabel:s,backspaceLabel:l,onChange:m,onSubmit:f,onClose:p,sx:h})=>{let{t:k}=j(),[u,C]=mt.useState(t),g=e??u,y=v=>{e===void 0&&C(v),m?.(v);},b=v=>{c&&g.length>=c||y(`${g}${v}`);},S=v=>{if(v==="00"){if(!g){y("0");return}b("00");return}b(v);},E=()=>{!n||g.includes(".")||y(g?`${g}.`:"0.");},D=()=>{if(i){if(g.startsWith("-")){y(g.slice(1));return}y(g?`-${g}`:"-");}},w=()=>{y(g.slice(0,-1));},A=()=>{y("");},P=()=>{f?.(g);};return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...h},children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[o?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800},children:o}):null,a?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:a}):null]}),p?jsxRuntime.jsx(material.IconButton,{onClick:p,size:"small",children:jsxRuntime.jsx(PC__default.default,{})}):null]}),jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsx(material.Typography,{sx:{minHeight:38,fontSize:g?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:g?"text.primary":"text.disabled"},children:g||r})}),jsxRuntime.jsxs(material.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=>jsxRuntime.jsx(ui,{label:v,onPress:()=>S(v)},v)),jsxRuntime.jsx(ui,{label:i?"+/-":"00",onPress:i?D:()=>S("00")}),jsxRuntime.jsx(ui,{label:"0",onPress:()=>S("0")}),jsxRuntime.jsx(ui,{label:n?".":l?String(l):"DEL",onPress:n?E:w})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:w,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsxRuntime.jsx(IC__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700},children:l||"DEL"})]})}),jsxRuntime.jsx(ui,{label:String(s||"CLR"),onPress:A,emphasis:"danger"}),jsxRuntime.jsx(material.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:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsxRuntime.jsx(RC__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:800},children:d||k("common.ok")})]})})]})]})})};var ym=({touchMode:e="comfortable",sx:t,...o})=>{let a=e==="expanded";return jsxRuntime.jsx(material.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:jsxRuntime.jsx(la,{...o})})};var LC=(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);}},vm=({items:e,selectedId:t,orientation:o="auto",onItemSelect:a,sx:r})=>{let n=styles.useTheme(),[i,c]=mt.useState(false);mt.useEffect(()=>{c(true);},[]);let d=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),s=material.useMediaQuery(n.breakpoints.down("md"),{noSsr:true}),l=o==="auto"?d||s?"portrait":"landscape":o,m=navigation.useRouter();return jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:!i||l==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...r},children:e.map(f=>{let p=f.id===t,h=f.color||(p?n.palette.primary.main:n.palette.divider);return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:p?"primary.main":"divider",boxShadow:p?"0 18px 40px rgba(37, 99, 235, 0.16)":"none",bgcolor:n.palette.mode==="dark"?"rgba(30,41,59,0.6)":"background.paper"},children:jsxRuntime.jsx(material.Box,{component:"button",type:"button",disabled:f.disabled,onClick:()=>LC(m,f,a),sx:{width:"100%",p:2,minHeight:l==="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:jsxRuntime.jsxs(material.Stack,{spacing:1.5,sx:{height:"100%"},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxRuntime.jsx(material.Box,{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:p?"#fff":"text.primary",background:p?h:"action.hover"},children:f.icon||jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900},children:f.title.slice(0,1).toUpperCase()})}),f.badge!==void 0?jsxRuntime.jsx(material.Box,{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:p?"primary.main":"action.hover",color:p?"#fff":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:f.badge}):null]}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:f.title}),f.caption?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:f.caption}):null,f.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:f.description}):null]})]})})},f.id)})})};var wm=(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?wm(a.children,t):[];return (r||n.length>0)&&o.push({...a,children:n.length>0?n:a.children}),o},[]):e,jC=e=>{let t=new Set,o=a=>{a.forEach(r=>{r.children?.length&&(t.add(r.id),o(r.children));});};return o(e),t},Tm=({collapsed:e=false,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light",orientation:i="auto",headerSlot:c,footerSlot:d,activeHref:s,onItemSelect:l})=>{let{t:m}=j(),f=styles.useTheme(),p=material.useMediaQuery("(orientation: portrait)"),h=material.useMediaQuery(f.breakpoints.down("md")),k=i==="auto"?p||h?"portrait":"landscape":i,u=n==="dark",C=navigation.useRouter(),g=navigation.usePathname(),[y,b]=mt.useState(""),[S,E]=mt.useState(new Set),D=mt.useMemo(()=>wm(r,y),[r,y]),w=mt.useMemo(()=>y.trim()?jC(D):S,[S,D,y]);mt.useEffect(()=>{e&&E(new Set);},[e]);let A=R=>R.appurl||R.href||"",P=R=>{l?.(R);let I=A(R);if(I){if(I.startsWith("http://")||I.startsWith("https://")){window.open(I,"_blank");return}C.push(I);}},v=R=>{let I=!!R.children?.length;if(e&&I){t?.();return}if(I){E($=>{let N=new Set($);return N.has(R.id)?N.delete(R.id):N.add(R.id),N});return}P(R);},M=R=>{let I=s||g,$=A(R);return !!($&&I===$)},T=(R,I=0)=>{let $=!!R.children?.length,N=w.has(R.id),X=M(R);return jsxRuntime.jsx(material.Box,{sx:{pl:I===0?0:1.5},children:jsxRuntime.jsxs(material.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:[jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>v(R),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:[jsxRuntime.jsx(material.Avatar,{variant:"rounded",sx:{width:40,height:40,bgcolor:X?"primary.main":"action.hover",color:X?"#fff":"text.primary"},children:R.icon||(R.title||R.label||"?").slice(0,1).toUpperCase()}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:R.title||R.label}),R.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:R.description}):null]}),$?jsxRuntime.jsx(qC__default.default,{sx:{transform:N?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):jsxRuntime.jsx(_C__default.default,{color:"action"})]}),$?jsxRuntime.jsx(material.Collapse,{in:N,children:jsxRuntime.jsx(material.Box,{sx:{px:1.25,pb:1.25},children:R.children?.map(se=>T(se,I+1))})}):null]})},R.id)};return e?jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:k==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:u?"#101828":"rgba(255,255,255,0.88)",maxHeight:a?`${a}px`:void 0,overflowY:"auto"},children:jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:m("navigation.expand"),children:jsxRuntime.jsx(KC__default.default,{})}),r.map(R=>jsxRuntime.jsx(material.IconButton,{onClick:()=>v(R),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:M(R)?"primary.main":"action.hover",color:M(R)?"#fff":"text.primary"},children:R.icon||(R.title||R.label||"?").slice(0,1).toUpperCase()},R.id))]})}):jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:k==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:u?"#101828":"rgba(255,255,255,0.88)",maxHeight:a?`${a}px`:void 0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsxs(material.Stack,{spacing:1.25,sx:{flex:1,minHeight:0},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[jsxRuntime.jsx(material.TextField,{value:y,onChange:R=>b(R.target.value),placeholder:m("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(GC__default.default,{fontSize:"small",color:"action"})}}),k==="landscape"&&!e?jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(UC__default.default,{})}):null]}),c,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:D.length>0?D.map(R=>T(R)):jsxRuntime.jsx(material.Typography,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:m("navigation.noMatch")})}),d]})})};var Em=(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=>mt__namespace.default.isValidElement(e)?jsxRuntime.jsx(material.Box,{sx:{display:"inline-flex",alignItems:"center"},children:e}):jsxRuntime.jsx(material.Typography,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:e}),tk=(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)},ok=({summaryRow:e,visibleColumns:t,columns:o})=>{let a=o.filter(r=>t.includes(r.id)&&e[r.id]!=="");return a.length===0?null:jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:a.map(r=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:r.label}),jsxRuntime.jsx(material.Typography,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:e[r.id]})]},`summary-${r.id}`))})]})})},ak=e=>{let{t}=j(),o=styles.useTheme(),{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:s,fitContainer:l=false,fullWidth:m=false,maxHeight:f,loading:p=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:k,filterConfig:u,rowKey:C,tableKey:g="default",graphReport:y,quickCreate:b,quickEdit:S,quickDelete:E,serviceUrl:D,orientation:w="auto",cardTitleField:A,cardSubtitleFields:P,toolbarSlot:v,emptyState:M,rowHeight:T="comfortable",cardActionSlot:R,renderCardFooter:I,onRowClick:$}=e,N=a||t("table.title.default"),X=material.useMediaQuery("(orientation: portrait)"),se=material.useMediaQuery(o.breakpoints.down("md")),J=w==="auto"?X||se?"portrait":"landscape":w,{columns:ee,filterText:Z,setFilterText:Oe,visibleColumns:Je,showSummary:Ke,setShowSummary:ae,summaryColumns:Be,grouping:De,setGrouping:qe,expandedGroups:Le,groupAnchorEl:We,setGroupAnchorEl:et,summaryAnchorEl:to,setSummaryAnchorEl:Ft,anchorEl:W,setAnchorEl:le,contextMenu:be,sortedAndFilteredRows:he,summaryRow:V,visibleRows:ce,page:te,setPage:de,rowsPerPage:xe,setRowsPerPage:ve,totalDisplayCount:ft,setSelected:tt,handleClick:Lt,toggleSummaryColumn:jt,handleExport:Zt,handleCloseContextMenu:Ae,toggleColumnVisibility:ye,toggleGroupExpand:St,toggleGroupField:ze,handleExpandGroupRecursively:Wt,handleCollapseGroupRecursively:wo,handleLayoutLoad:_a,handleVariantLoad:O,handleLayoutSave:H,effectiveAppId:K,currentLayoutData:Ce,currentLayoutId:Se,layoutIdToLoad:Fe,graphReportOpen:fe,handleOpenGraphReport:Ne,handleCloseGraphReport:Te}=Qr(e),Ve=y?.enabled??false,Ee=Ve&&(y?.interaction?.enabled??true),we=_i(),Me=C||"id",$t=mt__namespace.default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:styles.alpha(o.palette.divider,o.palette.mode==="dark"?.55:.3),bgcolor:o.palette.mode==="dark"?styles.alpha(o.palette.common.white,.06):styles.alpha(o.palette.background.paper,.92),color:o.palette.text.primary,"& .MuiChip-label":{px:1.05}}),[o]),To=mt__namespace.default.useMemo(()=>({...$t,borderColor:styles.alpha(o.palette.primary.main,o.palette.mode==="dark"?.42:.24),bgcolor:o.palette.mode==="dark"?styles.alpha(o.palette.primary.main,.16):styles.alpha(o.palette.primary.main,.08)}),[$t,o]),xt=mt__namespace.default.useMemo(()=>{let z=new Set(i);return he.filter(Q=>z.has(Q?.[Me]))},[Me,i,he]),wt=xt.length===1?xt[0]:null,ho=!!b?.enabled,Ca=!!S?.enabled,Pr=!!E?.enabled,Io=b?.fields,oo=b?.excludeFields||[],ja=b?.initialValues||{},Qo=S?.fields,Ht=S?.excludeFields||[],ao=S?.editableFields||[],zt=S?.nonEditableFields||[],$e=S?.primaryKeys?.length?S.primaryKeys:[Me],[Yo,Wo]=mt__namespace.default.useState(false),[Jo,Za]=mt__namespace.default.useState(false),[$o,Xa]=mt__namespace.default.useState({}),[Qa,Ho]=mt__namespace.default.useState(false),[ea,ka]=mt__namespace.default.useState(false),[Gt,Po]=mt__namespace.default.useState({}),[ta,yo]=mt__namespace.default.useState(false),[Go,Ya]=mt__namespace.default.useState(false),Rr=p||Jo||ea||Go,Sa=mt__namespace.default.useMemo(()=>{let z=[...ee];if(Array.isArray(Io)&&Io.length>0){let Q=new Set(Io);z=z.filter(U=>Q.has(U.id));}if(oo.length>0){let Q=new Set(oo);z=z.filter(U=>!Q.has(U.id));}return z.filter(Q=>!!Q?.id)},[ee,oo,Io]),Ja=mt__namespace.default.useMemo(()=>{let z=[...ee];if(Array.isArray(Qo)&&Qo.length>0){let Q=new Set(Qo);z=z.filter(U=>Q.has(U.id));}if(Ht.length>0){let Q=new Set(Ht);z=z.filter(U=>!Q.has(U.id));}return z.filter(Q=>!!Q?.id)},[ee,Ht,Qo]),oa=mt__namespace.default.useMemo(()=>new Set($e),[$e]),Xt=mt__namespace.default.useMemo(()=>new Set(ao),[ao]),Ro=mt__namespace.default.useMemo(()=>new Set(zt),[zt]),Dr=mt__namespace.default.useCallback(z=>Xt.size>0?Xt.has(z):!(Ro.has(z)||oa.has(z)),[Xt,Ro,oa]);mt__namespace.default.useEffect(()=>{!fe&&we.hasActiveFilters&&we.clearAll();},[we,fe]);let er=()=>{let z={};Sa.forEach(Q=>{z[Q.id]=ja[Q.id]??"";}),Xa(z),Wo(true);},Mr=(z,Q)=>{Xa(U=>({...U,[z]:Q}));},Ar=async()=>{if(!b?.onSubmit){Wo(false);return}try{Za(!0),await b.onSubmit($o),Wo(!1);}finally{Za(false);}},Br=()=>{if(!wt)return;let z={};Ja.forEach(U=>{z[U.id]=wt[U.id]??"";});let Q=S?.getInitialValues?{...z,...S.getInitialValues(wt)}:z;Po(Q),Ho(true);},ro=(z,Q)=>{Po(U=>({...U,[z]:Q}));},Er=async()=>{if(wt){if(!S?.onSubmit){Ho(false);return}try{ka(!0),await S.onSubmit(Gt,wt),Ho(!1);}finally{ka(false);}}},Fr=()=>{xt.length!==0&&yo(true);},tr=async()=>{if(xt.length===0){yo(false);return}if(!E?.onConfirm){yo(false),tt([]),c?.([]);return}try{Ya(!0),await E.onConfirm(xt),yo(!1),tt([]),c?.([]);}finally{Ya(false);}},aa=he,{fieldMapping:wa}=_r({rows:aa,config:{...y,title:y?.title||`${N} ${t("graph.reportTitle")}`}}),Ta=mt__namespace.default.useMemo(()=>Ee?we.applyRows(aa,wa):aa,[wa,we,Ee,aa]),{model:x}=_r({rows:Ta,config:{...y,title:y?.title||`${N} ${t("graph.reportTitle")}`,fieldMapping:wa}}),B=x.table.columns.map(z=>({id:z.id,label:z.label,align:z.align||"left",minWidth:120,numeric:z.align==="right"})),F=K?jsxRuntime.jsx(as,{appId:K,tableKey:g,currentLayoutData:Ce,onLayoutLoad:_a,targetLayoutId:Fe,activeLayoutId:Se,serviceUrl:D??u?.serviceUrl}):null,G=ee.filter(z=>Je.includes(z.id)),Y=G.find(z=>z.id===A)||G[0],ge=P?.map(z=>G.find(Q=>Q.id===z)).filter(Boolean)||G.filter(z=>z.id!==Y?.id).slice(0,J==="portrait"?2:3),L=G.filter(z=>z.id!==Y?.id&&!ge.some(Q=>Q.id===z.id)),_=[v,s].filter(Boolean),q=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(zr,{groupAnchorEl:We,setGroupAnchorEl:et,grouping:De,setGrouping:qe,columns:ee,toggleGroupField:ze}),jsxRuntime.jsx(Nr,{anchorEl:W,setAnchorEl:le,columns:ee,visibleColumns:Je,toggleColumnVisibility:ye}),jsxRuntime.jsx(Ri,{anchorEl:to,setAnchorEl:Ft,showSummary:Ke,setShowSummary:ae,columns:ee,summaryColumns:Be,toggleSummaryColumn:jt}),jsxRuntime.jsx(Di,{contextMenu:be,handleCloseContextMenu:Ae,columns:ee,visibleColumns:Je,toggleColumnVisibility:ye})]}),Xe=(z,Q,U)=>{let ne=i.includes(Q),He=J==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",Uo=U%2===0?styles.alpha(o.palette.primary.main,o.palette.mode==="dark"?.09:.04):styles.alpha(o.palette.primary.main,o.palette.mode==="dark"?.05:.022),zg=styles.alpha(o.palette.divider,.22);return jsxRuntime.jsx(material.Paper,{elevation:0,onClick:()=>{Lt({},z),$?.(z);},sx:{p:T==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:ne?styles.alpha(o.palette.primary.main,.38):zg,background:ne?`linear-gradient(135deg, ${styles.alpha(o.palette.primary.main,.13)}, ${styles.alpha(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${Uo}, ${styles.alpha(o.palette.primary.main,.015)})`,boxShadow:ne?`0 12px 30px ${styles.alpha(o.palette.primary.main,.2)}`:`0 3px 10px ${styles.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:ne?o.palette.primary.main:U%2===0?styles.alpha(o.palette.primary.main,.26):styles.alpha(o.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${styles.alpha(o.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[n?jsxRuntime.jsx(material.Checkbox,{checked:ne,onClick:no=>no.stopPropagation(),onChange:()=>Lt({},z),sx:{mt:-0.6,ml:-0.6}}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[Y?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:Em(Y,z)}):null,ge.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:ge.map(no=>jsxRuntime.jsx(material.Chip,{label:`${no.label}: ${tk(no,z)}`,size:"small",variant:"outlined",sx:$t},`${Q}-${no.id}`))}):null]}),R?jsxRuntime.jsx(material.Box,{onClick:no=>no.stopPropagation(),children:R(z)}):null]}),L.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:He,gap:1},children:L.map(no=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:o.palette.mode==="dark"?styles.alpha(o.palette.background.default,.7):styles.alpha(o.palette.background.paper,.92),border:"0.1px solid",borderColor:styles.alpha(o.palette.divider,.24)},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:no.label}),ek(Em(no,z))]},`${Q}-${no.id}-detail`))}):null,I?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{onClick:no=>no.stopPropagation(),children:I(z)})]}):null]})},Q)};return jsxRuntime.jsxs(material.Box,{sx:{width:m?"100%":"auto",mb:l?0:2,...l?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[u?jsxRuntime.jsx(material.Box,{sx:{mb:2},children:jsxRuntime.jsx(ym,{...u,onVariantLoad:z=>{O(z),u.onVariantLoad?.(z);},appId:u.appId,tableKey:g,currentLayout:[{tableKey:g,layoutData:Ce}],currentLayoutId:Se,layoutRefs:[{tableKey:g,layoutId:Se}],variantService:u.variantService,serviceUrl:D??u.serviceUrl,touchMode:J==="portrait"?"expanded":"comfortable"})}):null,jsxRuntime.jsxs(material.Paper,{sx:{width:m?"100%":"auto",mb:l?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":Rr?{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}:l?{flex:1,minHeight:0,height:"100%"}:{}},children:[r?jsxRuntime.jsx(material.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:jsxRuntime.jsx(Si,{filterText:Z,setFilterText:Oe,onRowsPerPageChange:ve,rowsPerPage:xe,rowsPerPageOptions:h,page:te,count:ft,onPageChange:de,actions:d,extraTools:_,grouping:De,setGroupAnchorEl:et,showSummary:Ke,setShowSummary:ae,setAnchorEl:le,setSummaryAnchorEl:Ft,handleExport:Zt,showCreateButton:ho,onOpenCreateDialog:er,showEditButton:Ca,onOpenEditDialog:Br,editDisabled:xt.length!==1,showDeleteButton:Pr,onOpenDeleteConfirm:Fr,deleteDisabled:xt.length===0,onLayoutSave:k||u?.variantService&&u?.appId?H:void 0,loading:p,layoutManager:F,onOpenGraphReport:Ve?Ne:void 0})}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[ce.length===0&&!p?M||jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:t("common.noData")})}):null,ce.map((z,Q)=>{if(z.type==="group"){let He=Le.has(z.id);return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>St(z.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:[He?jsxRuntime.jsx(qC__default.default,{}):jsxRuntime.jsx(_C__default.default,{}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.94rem",fontWeight:800},children:[z.field,": ",z.value]}),jsxRuntime.jsxs(material.Typography,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[z.count," records"]})]}),De.length>1&&z.level<De.length-1?jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.5,children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.expandAll"),onClick:Uo=>{Uo.stopPropagation(),Wt(z.id);},sx:To}),jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.collapseAll"),onClick:Uo=>{Uo.stopPropagation(),wo(z.id);},sx:To})]}):null]})},z.id)}let U=z.data||z,ne=z.id||U[Me]||Q;return Xe(U,ne,Q)}),Ke?jsxRuntime.jsx(ok,{summaryRow:V,visibleColumns:Je,columns:ee}):null,p?jsxRuntime.jsx(material.Typography,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:t("common.loading")}):null]})})]}),ho?jsxRuntime.jsxs(material.Dialog,{open:Yo,onClose:()=>!Jo&&Wo(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:b?.title||t("quickCreate.createWithTitle",{title:N})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Sa.map(z=>{let Q=z.type==="number"||z.numeric?"number":z.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:z.label||z.id,value:$o[z.id]??"",onChange:U=>Mr(z.id,U.target.value),type:Q,fullWidth:true,InputLabelProps:{shrink:Q==="date"?true:void 0}},`quick-create-${z.id}`)}),b?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:b.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>Wo(false),disabled:Jo,children:b?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:Ar,variant:"contained",disabled:Jo,children:b?.submitLabel||t("common.save")})]})]}):null,Ca?jsxRuntime.jsxs(material.Dialog,{open:Qa,onClose:()=>!ea&&Ho(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:S?.title||t("quickEdit.editWithTitle",{title:N})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Ja.map(z=>{let Q=z.type==="number"||z.numeric?"number":z.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:z.label||z.id,value:Gt[z.id]??"",onChange:U=>ro(z.id,U.target.value),type:Q,disabled:!Dr(z.id),fullWidth:true,InputLabelProps:{shrink:Q==="date"?true:void 0}},`quick-edit-${z.id}`)}),S?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:S.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>Ho(false),disabled:ea,children:S?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:Er,variant:"contained",disabled:ea||!wt,children:S?.submitLabel||t("common.save")})]})]}):null,Pr?jsxRuntime.jsx(Pn,{open:ta,type:"warning",title:E?.title||t("quickDelete.confirmTitle"),message:E?.message||(xt.length>1?t("quickDelete.confirmMessageMultiple",{count:xt.length}):t("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||t("common.delete"),cancelText:E?.cancelText||t("common.cancel"),onClose:()=>!Go&&yo(false),onConfirm:tr}):null,q,Ve?jsxRuntime.jsx(Ki,{open:fe,onClose:Te,model:x,aiAssistant:y?.aiAssistant,interaction:Ee?{enabled:true,filters:we.filters,fieldMapping:wa,onPrimaryDimensionClick:z=>we.setFilter("primaryDimension",z),onSecondaryDimensionClick:z=>we.setFilter("secondaryDimension",z),onStatusClick:z=>we.setFilter("status",z),onClearFilter:we.clearFilter,onClearAll:we.clearAll}:void 0,tableContent:jsxRuntime.jsx(ak,{appId:K||"graph-report-internal",title:t("graph.dataBody"),columns:B,rows:x.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var _E=({appTitle:e,children:t,menuData:o=[],workloadItems:a=[],workloadSelectedId:r,showNavigation:n=true,showWorkloadNav:i=true,orientation:c="auto",logo:d,headerSlot:s,actionSlot:l,portraitBottomSlot:m,contentSx:f,containerSx:p,user:h,onSearch:k,defaultNavigationOpen:u,navOpen:C,onNavOpenChange:g,onWorkloadSelect:y,locale:b="en",localeLabel:S,localeOptions:E,onLocaleChange:D,onUserSetting:w,onUserLogout:A,userMenuItems:P,leftHeaderSlot:v,rightHeaderSlot:M})=>{let T="orbcafe:page-layout-mode",[R,I]=mt.useState("system"),[$,N]=mt.useState("light"),[X,se]=mt.useState(false),[J,ee]=mt.useState(false),Z=R==="system"?J?$:"light":R;mt.useEffect(()=>{se(true);},[]),mt.useEffect(()=>{try{let be=window.localStorage.getItem(T);(be==="light"||be==="dark"||be==="system")&&I(be);}catch{}ee(true);let W=window.matchMedia("(prefers-color-scheme: dark)"),le=()=>{N(W.matches?"dark":"light");};return le(),W.addEventListener("change",le),()=>W.removeEventListener("change",le)},[]),mt.useEffect(()=>{if(J)try{window.localStorage.setItem(T,R);}catch{}},[J,R]),mt.useEffect(()=>{Z==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[Z]);let Oe=mt.useMemo(()=>styles.createTheme({palette:Z==="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:Z==="dark"?"#060913":"#eef3f8"}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"}}}}}),[Z]),Je=material.useMediaQuery("(orientation: portrait)"),Ke=material.useMediaQuery(Oe.breakpoints.down("md")),ae=c==="auto"?!X||Je||Ke?"portrait":"landscape":c,[Be,De]=mt.useState({landscape:u??true,portrait:false}),qe=Be[ae],Le=C??qe,We=W=>{C===void 0&&De(le=>({...le,[ae]:W})),g?.(W);},et=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[!X||n&&ae==="portrait"?jsxRuntime.jsx(material.IconButton,{onClick:()=>We(!Le),sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(KC__default.default,{})}):null,v]}),to=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[l,M]}),Ft=jsxRuntime.jsx(Tm,{collapsed:ae==="landscape"?!Le:false,onToggle:()=>We(!Le),menuData:o,orientation:ae,colorMode:Z,maxHeight:ae==="landscape"?900:void 0});return jsxRuntime.jsx(styles.ThemeProvider,{theme:Oe,children:jsxRuntime.jsx(ki,{locale:b,children:jsxRuntime.jsxs(material.Box,{sx:[W=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:W.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":W.palette.background.default}),...Array.isArray(p)?p:[p]],children:[jsxRuntime.jsx(Ss,{appTitle:e,logo:d===void 0?null:d,mode:R,onToggleMode:()=>I(W=>W==="system"?"dark":W==="dark"?"light":"system"),locale:b,localeLabel:S,localeOptions:E,onLocaleChange:D,user:h,onUserSetting:w,onUserLogout:A,userMenuItems:P,onSearch:k,leftSlot:et,rightSlot:to}),s?jsxRuntime.jsx(material.Box,{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:s}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[X&&n&&ae==="landscape"?jsxRuntime.jsx(material.Box,{sx:{p:1.5,pr:0,flexShrink:0},children:Ft}):null,!X||n&&ae==="portrait"?jsxRuntime.jsx(material.Drawer,{open:Le,onClose:()=>We(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:Ft}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...f},children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[i&&a.length>0?jsxRuntime.jsx(vm,{items:a,selectedId:r,orientation:ae,onItemSelect:y}):null,jsxRuntime.jsx(material.Paper,{elevation:0,sx:{flex:1,minHeight:ae==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:Oe.palette.mode==="dark"?"rgba(15,23,42,0.72)":"rgba(255,255,255,0.72)",backdropFilter:"blur(12px)",color:"text.primary"},children:t})]})})]}),ae==="portrait"&&m?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{sx:{p:1.5},children:m})]}):null]})})})};var Om=kk__default.default(()=>Promise.resolve().then(()=>(Vm(),Nm)).then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsxRuntime.jsx("div",{className:"h-full w-full bg-transparent"})});function Kc({isRecording:e}){return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:e&&jsxRuntime.jsx(framerMotion.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:jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0",children:jsxRuntime.jsx(Om,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),jsxRuntime.jsx("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:jsxRuntime.jsx(Om,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var tF=Kc;function Zs({onTextUpdate:e,onComplete:t,onError:o,wsUrl:a="ws://localhost:8765",silenceThresholdMs:r=2e3,minVolumeRms:n=.015}){let[i,c]=mt.useState(false),d=mt.useRef(null),s=mt.useRef(null),l=mt.useRef(null),m=mt.useRef(null),f=mt.useRef(null),p=mt.useRef(0),h=mt.useRef(false),k=mt.useRef(false),u=mt.useCallback(()=>{d.current&&(d.current.close(),d.current=null),m.current&&(m.current.disconnect(),m.current=null),f.current&&(f.current.disconnect(),f.current=null),s.current&&(s.current.getTracks().forEach(y=>y.stop()),s.current=null),l.current&&(l.current.close(),l.current=null),k.current=false,c(false);},[]),C=mt.useCallback(()=>{h.current||(h.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(u,500));},[u]),g=mt.useCallback(async()=>{if(!(i||k.current)){k.current=true,h.current=false,p.current=Date.now();try{let y=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});s.current=y;let b=new WebSocket(a);d.current=b,b.onopen=()=>{c(!0),k.current=!1;},b.onmessage=A=>{try{let P=JSON.parse(A.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"),u();},b.onclose=()=>{u();};let S=window.AudioContext||window.webkitAudioContext;if(!S)throw new Error("AudioContext is not supported in this browser");let E=new S({sampleRate:16e3});l.current=E;let D=E.createMediaStreamSource(y);f.current=D;let w=E.createScriptProcessor(4096,1,1);m.current=w,w.onaudioprocess=A=>{if(d.current?.readyState!==WebSocket.OPEN)return;let P=A.inputBuffer.getChannelData(0),v=0;for(let R=0;R<P.length;R+=1)v+=P[R]*P[R];if(Math.sqrt(v/P.length)>n)p.current=Date.now();else if(Date.now()-p.current>r&&!h.current){C();return}let T=new Int16Array(P.length);for(let R=0;R<P.length;R+=1){let I=Math.max(-1,Math.min(1,P[R]));T[R]=I<0?I*32768:I*32767;}d.current.send(T.buffer);},D.connect(w),w.connect(E.destination);}catch{o?.("Cannot access microphone"),u();}}},[u,i,n,t,o,e,r,C,a]);return mt.useEffect(()=>u,[u]),{isRecording:i,startRecording:g,stopRecording:C}}var $m=mt.createContext(null);function Bk(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 Ek({children:e,onVoiceSubmit:t,onVoicePartial:o,onVoiceError:a,longPressMs:r=200,disableSpaceTrigger:n=false,ignoreWhenFocusedInput:i=true,renderOverlay:c=true,wsUrl:d,silenceThresholdMs:s,minVolumeRms:l}){let[m,f]=mt.useState(false),[p,h]=mt.useState(false),k=mt.useRef(null),u=mt.useRef(false),C=mt.useRef(false),g=mt.useCallback(()=>{C.current=false,f(false);},[]),{isRecording:y,startRecording:b,stopRecording:S}=Zs({wsUrl:d,silenceThresholdMs:s,minVolumeRms:l,onTextUpdate:A=>{o?.(A);},onComplete:async A=>{try{A.trim()&&(h(!0),await t(A.trim()));}catch(P){let v=P instanceof Error?P.message:"Failed to process voice command";a?.(v);}finally{h(!1),g();}},onError:A=>{a?.(A),h(!1),u.current||g();}}),E=mt.useCallback(async()=>{C.current=false,await b();},[b]),D=mt.useCallback(()=>{S();},[S]);mt.useEffect(()=>{if(n)return;let A=v=>{v.isComposing||(v.code==="Space"||v.key===" ")&&(u.current||v.repeat||i&&Bk(document.activeElement)||(u.current=true,v.preventDefault(),k.current=setTimeout(()=>{C.current=true,f(true),b();},r)));},P=v=>{(v.code==="Space"||v.key===" ")&&(k.current&&(clearTimeout(k.current),k.current=null),u.current=false,C.current&&(v.preventDefault(),f(false),S()));};return window.addEventListener("keydown",A),window.addEventListener("keyup",P),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",P),k.current&&(clearTimeout(k.current),k.current=null);}},[n,i,r,b,S]);let w=mt.useMemo(()=>({isRecording:y,isHotkeyRecording:m,isSubmitting:p,startRecording:E,stopRecording:D}),[m,y,p,E,D]);return jsxRuntime.jsxs($m.Provider,{value:w,children:[c?jsxRuntime.jsx(Kc,{isRecording:m}):null,e]})}function Fk(){let e=mt.useContext($m);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var cF=Ek,dF=Fk;function Pe(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var $k=({content:e,theme:t="light",size:o="base",defaultExpanded:a=false})=>{let[r,n]=mt.useState(a),i=mt.useMemo(()=>`${(o==="sm"?14:o==="lg"?18:16)-2}px`,[o]);return jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.jsx("span",{className:"mr-2",children:"\u{1F914}"}),jsxRuntime.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"})]}),jsxRuntime.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:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),r&&jsxRuntime.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})]})},Hm=$k;var Zk=({content:e,language:t="text",isStreaming:o=false,className:a=""})=>{let{theme:r}=nextThemes.useTheme(),[n,i]=mt.useState(false),c=async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3);}catch(s){console.error("\u590D\u5236\u5931\u8D25:",s);}},d=r==="dark"?prism.oneDark:prism.oneLight;return jsxRuntime.jsxs("div",{className:Pe("rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 my-4",a),children:[jsxRuntime.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:[jsxRuntime.jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-300 uppercase",children:t}),jsxRuntime.jsx("button",{onClick:c,className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",disabled:o,title:n?"Copied":"Copy code",children:n?jsxRuntime.jsx(lucideReact.Check,{size:14,className:"text-green-500"}):jsxRuntime.jsx(lucideReact.Clipboard,{size:14,className:"text-gray-500 dark:text-gray-400"})})]}),jsxRuntime.jsx("div",{className:"text-sm",children:jsxRuntime.jsx(reactSyntaxHighlighter.Prism,{language:t,style:d,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:r==="dark"?"#1f2937":"#ffffff"},wrapLongLines:true,children:e})})]})},Um=Zk;var Jk=({content:e,isLoading:t,className:o="",style:a})=>{let r=mt.useRef(null),[n,i]=mt.useState(false),[c,d]=mt.useState(null),{theme:s}=nextThemes.useTheme();return mt.useEffect(()=>{let l=async()=>{if(!(!e.trim()||!r.current)){i(true),d(null);try{qm__default.default.initialize({startOnLoad:!1,theme:s==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit"});let f=`mermaid-${Math.random().toString(36).substr(2,9)}`,p=e.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:h}=await qm__default.default.render(f,p);r.current&&(r.current.innerHTML=h);}catch(f){console.error("Mermaid render failed:",f),d(f instanceof Error?f.message:"Render failed"),r.current&&(r.current.innerText=e);}finally{i(false);}}},m=setTimeout(()=>{l();},100);return ()=>clearTimeout(m)},[e,s]),t||n?jsxRuntime.jsx("div",{className:`mermaid-block loading ${o}`,style:a,children:jsxRuntime.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:[jsxRuntime.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500 mr-2"}),jsxRuntime.jsx("span",{className:"text-sm text-gray-500",children:"Generating Diagram..."})]})}):c?jsxRuntime.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:[jsxRuntime.jsx("p",{className:"font-semibold mb-2",children:"Mermaid Error:"}),jsxRuntime.jsx("pre",{children:c}),jsxRuntime.jsx("pre",{className:"mt-4 text-xs text-gray-500",children:e})]}):jsxRuntime.jsx("div",{className:`mermaid-block overflow-x-auto ${o}`,style:a,ref:r})},jm=Jk;var nS=({title:e="\u53D1\u751F\u9519\u8BEF",content:t,errorCode:o,stack:a,icon:r,closable:n=true,onClose:i,onRetry:c,className:d="",...s})=>{let[l,m]=mt.useState(false),[f,p]=mt.useState(false),h=async()=>{if(c){p(true);try{await c();}catch(k){console.error("\u91CD\u8BD5\u5931\u8D25:",k);}finally{p(false);}}};return jsxRuntime.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}`,...s,children:[jsxRuntime.jsxs("div",{className:"flex p-4 border-l-4 border-l-red-500 bg-red-50 dark:bg-red-900/10",children:[jsxRuntime.jsx("div",{className:"flex-shrink-0 mr-3 text-red-500 mt-0.5",children:r||jsxRuntime.jsx(lucideReact.AlertCircle,{className:"w-5 h-5"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[jsxRuntime.jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsxRuntime.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&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3 leading-relaxed",children:typeof t=="string"?jsxRuntime.jsx("p",{className:"whitespace-pre-wrap",children:t}):t}),(c||a)&&jsxRuntime.jsxs("div",{className:"flex items-center space-x-4 mt-2",children:[c&&jsxRuntime.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:[jsxRuntime.jsx(lucideReact.RotateCw,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),a&&jsxRuntime.jsxs("button",{onClick:()=>m(!l),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:[l?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),l?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),n&&i&&jsxRuntime.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:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),a&&l&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 border-t border-gray-100 dark:border-gray-800",children:jsxRuntime.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})})]})},Xs=nS;var pS=({title:e="\u8B66\u544A",content:t,warningType:o,severity:a="warning",warnings:r=[],icon:n,closable:i=true,onClose:c,onConfirm:d,actionText:s,className:l="",...m})=>{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"}}},p=()=>{switch(a){case "info":return jsxRuntime.jsx(lucideReact.Info,{className:"w-5 h-5"});case "error":return jsxRuntime.jsx(lucideReact.XCircle,{className:"w-5 h-5"});case "success":return jsxRuntime.jsx(lucideReact.CheckCircle,{className:"w-5 h-5"});default:return jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"w-5 h-5"})}},h=f();return jsxRuntime.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 ${l}`,...m,children:[jsxRuntime.jsxs("div",{className:`flex p-4 border-l-4 ${h.borderLeftColor} ${h.bgColor}`,children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 mr-3 ${h.iconColor}`,children:n||p()}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsxRuntime.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&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:t}),r&&r.length>0&&jsxRuntime.jsx("ul",{className:"mt-2 space-y-1",children:r.map((k,u)=>jsxRuntime.jsxs("li",{className:"flex items-start text-sm text-gray-600 dark:text-gray-300",children:[jsxRuntime.jsx("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-gray-400 dark:bg-gray-500 flex-shrink-0"}),jsxRuntime.jsx("span",{children:k})]},u))})]}),i&&c&&jsxRuntime.jsx("button",{onClick:c,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),d&&jsxRuntime.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:jsxRuntime.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:s||"\u786E\u8BA4"})})]})},Qs=pS;var fS=({title:e="\u76F8\u5173\u63A8\u8350",content:t,suggestions:o,onSuggestionClick:a,maxDisplay:r=5,icon:n,closable:i=false,onClose:c,className:d="",...s})=>{let[l,m]=mt.useState(false),[f,p]=mt.useState(""),[h,k]=mt.useState(false),u=mt.useMemo(()=>f.trim()?o.filter(y=>y.toLowerCase().includes(f.toLowerCase())):o,[o,f]),C=mt.useMemo(()=>l?u:u.slice(0,r),[u,l,r]),g=y=>{a?.(y);};return !o||o.length===0?null:jsxRuntime.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}`,...s,children:[jsxRuntime.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:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2.5",children:[jsxRuntime.jsx("div",{className:"text-blue-500 flex-shrink-0",children:n||jsxRuntime.jsx(lucideReact.Lightbulb,{className:"w-5 h-5"})}),jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 leading-tight",children:e}),t&&jsxRuntime.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[o.length>3&&jsxRuntime.jsx("button",{onClick:()=>k(!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:jsxRuntime.jsx(lucideReact.Search,{className:"w-4 h-4"})}),i&&c&&jsxRuntime.jsx("button",{onClick:c,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:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]})]}),h&&jsxRuntime.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:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:f,onChange:y=>p(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}),jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-gray-400"})]})}),jsxRuntime.jsxs("div",{className:"p-2",children:[jsxRuntime.jsx("ul",{className:"space-y-1",children:C.map((y,b)=>jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{onClick:()=>g(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:[jsxRuntime.jsx("span",{children:y}),jsxRuntime.jsx(lucideReact.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))}),u.length>r&&jsxRuntime.jsx("button",{onClick:()=>m(!l),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:l?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${u.length})`}),u.length===0&&f&&jsxRuntime.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"})]})]})},Ys=fS;var kS=({title:e,content:t,toolName:o,parameters:a,result:r,status:n,duration:i,icon:c,closable:d=false,onClose:s,onAction:l,actionText:m,className:f="",...p})=>{let[h,k]=mt.useState(false),[u,C]=mt.useState(true),g=()=>{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 jsxRuntime.jsx(lucideReact.Loader2,{className:"w-5 h-5 animate-spin"});case "error":return jsxRuntime.jsx(lucideReact.XCircle,{className:"w-5 h-5"});default:return jsxRuntime.jsx(lucideReact.CheckCircle,{className:"w-5 h-5"})}},b=D=>D?D<1e3?`${D}ms`:`${(D/1e3).toFixed(2)}s`:"",S=g(),E=e||o||"\u5DE5\u5177\u8C03\u7528";return jsxRuntime.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}`,...p,children:[jsxRuntime.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:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-3",children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 ${S.iconColor}`,children:c||y()}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:E}),jsxRuntime.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${S.badgeBg} ${S.badgeText}`,children:S.label})]}),o&&e&&jsxRuntime.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 flex items-center mt-0.5",children:[jsxRuntime.jsx(lucideReact.Terminal,{className:"w-3 h-3 mr-1"}),o]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500 dark:text-gray-400",children:[i&&jsxRuntime.jsxs("div",{className:"flex items-center bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded",children:[jsxRuntime.jsx(lucideReact.Clock,{className:"w-3 h-3 mr-1"}),b(i)]}),d&&s&&jsxRuntime.jsx("button",{onClick:s,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors p-1 rounded",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[t&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-4 leading-relaxed",children:t}),a&&jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsxs("button",{onClick:()=>k(!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?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsxRuntime.jsx(lucideReact.Box,{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),h&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsxRuntime.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&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("button",{onClick:()=>C(!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?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsxRuntime.jsx(lucideReact.Terminal,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),u&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsxRuntime.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)})})]}),l&&jsxRuntime.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 dark:border-gray-800 flex justify-end",children:jsxRuntime.jsx("button",{onClick:l,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:m||"\u6267\u884C\u64CD\u4F5C"})})]})]})},Js=kS;var wS=({data:e})=>{if(!e)return null;let t=mt.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?jsxRuntime.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"}):jsxRuntime.jsx("div",{className:"w-full my-4",children:jsxRuntime.jsx(Fa,{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]})})},el=wS;var ES=({title:e,subtitle:t,data:o,type:a,config:r={}})=>{let n=()=>{switch(a){case "bar-chart-card":return jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4 text-blue-500"});case "line-chart-card":return jsxRuntime.jsx(lucideReact.LineChart,{className:"w-4 h-4 text-green-500"});case "pie-chart-card":return jsxRuntime.jsx(lucideReact.PieChart,{className:"w-4 h-4 text-purple-500"});case "combo-chart-card":return jsxRuntime.jsx(lucideReact.Activity,{className:"w-4 h-4 text-orange-500"});case "heatmap-chart-card":return jsxRuntime.jsx(lucideReact.Grid,{className:"w-4 h-4 text-red-500"});case "fishbone-chart-card":return jsxRuntime.jsx(lucideReact.GitBranch,{className:"w-4 h-4 text-indigo-500"});case "waterfall-chart-card":return jsxRuntime.jsx(lucideReact.TrendingDown,{className:"w-4 h-4 text-teal-500"});case "google-map-card":return jsxRuntime.jsx(lucideReact.Globe,{className:"w-4 h-4 text-blue-600"});case "amap-card":return jsxRuntime.jsx(lucideReact.MapPin,{className:"w-4 h-4 text-blue-600"});default:return jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"})}},i=()=>{if(!o&&a!=="google-map-card"&&a!=="amap-card")return jsxRuntime.jsx("div",{className:"text-gray-500 text-sm p-4 text-center",children:"No data available"});try{switch(a){case "bar-chart-card":return jsxRuntime.jsx(Bn,{data:o,orientation:r.orientation||"horizontal",valueSuffix:r.valueSuffix||"",minHeight:r.minHeight});case "line-chart-card":return jsxRuntime.jsx($d,{data:o,color:r.color,valueSuffix:r.valueSuffix||"",height:r.height});case "pie-chart-card":let c=o.reduce((s,l)=>s+(Number(l.value)||0),0),d=o.map(s=>({name:s.name,value:Number(s.value)||0,percent:typeof s.percent=="number"?s.percent:c>0?(Number(s.value)||0)/c*100:0}));return jsxRuntime.jsx(Ni,{data:d,variant:r.variant||"donut",size:r.size,colors:r.colors});case "combo-chart-card":return jsxRuntime.jsx(Hd,{data:o,barColor:r.barColor,lineColor:r.lineColor});case "heatmap-chart-card":return jsxRuntime.jsx(Ud,{data:o});case "fishbone-chart-card":return jsxRuntime.jsx(qd,{branches:o,effect:r.effect||e||"Problem"});case "waterfall-chart-card":return jsxRuntime.jsx(jd,{data:o,height:r.height});case "google-map-card":return jsxRuntime.jsx(Qd,{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 jsxRuntime.jsx(tp,{embedUrl:r.embedUrl||o&&o[0]?.embedUrl,keyword:r.keyword||o&&o[0]?.keyword||e,height:r.height});default:return jsxRuntime.jsxs("div",{className:"text-gray-500 text-sm p-4 text-center",children:["Unsupported chart type: ",a]})}}catch(c){return console.error("Error rendering chart:",c),jsxRuntime.jsx("div",{className:"text-red-500 text-sm p-4 text-center",children:"Error rendering chart"})}};return jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsx("div",{className:"mr-2 flex-shrink-0",children:n()}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",children:e}),t&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 truncate",children:t})]})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("div",{className:"overflow-x-auto",children:i()}),jsxRuntime.jsx("div",{className:"mt-3",children:jsxRuntime.jsxs("details",{className:"text-xs text-gray-500 dark:text-gray-400",children:[jsxRuntime.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"}),jsxRuntime.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)})]})})]})]})},tl=ES;var LS=({type:e,manifest:t})=>jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsx(lucideReact.Box,{className:"w-4 h-4 mr-2 text-blue-600 dark:text-blue-400"}),jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:["SAP Card: ",e]})]}),jsxRuntime.jsx("div",{className:"p-4",children:jsxRuntime.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:jsxRuntime.jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 whitespace-pre-wrap",children:JSON.stringify(t,null,2)})})})]}),al=LS;var rl=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 $S=({content:e,theme:t,size:o="base",className:a,enableCodeHighlight:r=true,enableMermaid:n=true,messageId:i,cardHooks:c})=>{let d=mt.useMemo(()=>e?e.replace(/<think>([\s\S]*?)<\/think>/g,(f,p)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(p.trim())}"></div>`):"",[e]),s=(f,p,h,k,u)=>{c?.onCardEvent?.({messageId:i,cardType:f,action:p,title:h,payload:k,rawData:u});},l=(f,p,h,k,u,C)=>{if(!(!u&&!c?.onCardEvent))return (...g)=>{let y=u?.(...g),b=C?C(...g):void 0;return s(f,p,h,b,k),y}},m=mt.useMemo(()=>({div(f){let{"data-component":p,"data-think-content":h,...k}=f;return p==="thinkbox"&&h?jsxRuntime.jsx(Hm,{content:decodeURIComponent(h),theme:t,size:o,defaultExpanded:false}):jsxRuntime.jsx("div",{...k})},table({children:f}){return jsxRuntime.jsx("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-gray-200 dark:border-gray-800",children:jsxRuntime.jsx("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:f})})},thead({children:f}){return jsxRuntime.jsx("thead",{className:"bg-gray-50 dark:bg-gray-900/60",children:f})},tbody({children:f}){return jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-950",children:f})},tr({children:f}){return jsxRuntime.jsx("tr",{className:"border-b border-gray-200 dark:border-gray-800 last:border-b-0",children:f})},th({children:f,align:p}){return jsxRuntime.jsx("th",{className:`px-3 py-2 font-semibold text-gray-800 dark:text-gray-100 ${p==="center"?"text-center":p==="right"?"text-right":"text-left"}`,children:f})},td({children:f,align:p}){return jsxRuntime.jsx("td",{className:`px-3 py-2 text-gray-700 dark:text-gray-200 align-top ${p==="center"?"text-center":p==="right"?"text-right":"text-left"}`,children:f})},code({inline:f,className:p,children:h,...k}){let u=/language-([\w-]+)/.exec(p||""),C=u?u[1]:"";if(f)return jsxRuntime.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",...k,children:h});let g=String(h).replace(/\n$/,"");if(n&&C==="mermaid")return jsxRuntime.jsx(jm,{content:g});if(C==="json"){let y=rl(g);if(y)switch(y.type){case "table":return jsxRuntime.jsx(el,{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 jsxRuntime.jsx(tl,{...y});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(al,{...y});case "error-card":{let b=y;return jsxRuntime.jsx(Xs,{...b,onClose:l("error-card","close",b.title,b,b.onClose),onRetry:l("error-card","retry",b.title,b,b.onRetry)})}case "warning-card":{let b=y,S=b.onConfirm?l("warning-card","confirm",b.title,b,b.onConfirm):b.actionText&&c?.onCardEvent?l("warning-card","confirm",b.title,b):void 0;return jsxRuntime.jsx(Qs,{...b,onClose:l("warning-card","close",b.title,b,b.onClose),onConfirm:S})}case "suggestions-card":{let b=y;return jsxRuntime.jsx(Ys,{...b,onClose:l("suggestions-card","close",b.title,b,b.onClose),onSuggestionClick:l("suggestions-card","suggestion-click",b.title,b,b.onSuggestionClick,S=>({suggestion:S}))})}case "tool-result-card":{let b=y;return jsxRuntime.jsx(Js,{...b,onClose:l("tool-result-card","close",b.title,b,b.onClose),onAction:l("tool-result-card","action",b.title,b,b.onAction)})}}}return r?jsxRuntime.jsx(Um,{content:g,language:C,className:"not-prose"}):jsxRuntime.jsx("code",{className:p,...k,children:h})}}),[t,o,n,r,c,i]);return jsxRuntime.jsx("div",{className:Pe("markdown-body prose dark:prose-invert max-w-none",a),children:jsxRuntime.jsx(zS__default.default,{remarkPlugins:[NS__default.default,VS__default.default],rehypePlugins:[OS__default.default,WS__default.default],components:m,children:d})})},nl=$S;var HS=({content:e,messageId:t,cardHooks:o})=>{let a=(i,c,d,s,l)=>{o?.onCardEvent?.({messageId:t,cardType:i,action:c,title:d,payload:s,rawData:l});},r=(i,c,d,s,l,m)=>{if(!(!l&&!o?.onCardEvent))return (...f)=>{let p=l?.(...f),h=m?m(...f):void 0;return a(i,c,d,h,s),p}},n=rl(e);if(n)switch(n.type){case "table":return jsxRuntime.jsx(el,{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 jsxRuntime.jsx(tl,{...n});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(al,{...n});case "error-card":{let i=n;return jsxRuntime.jsx(Xs,{...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,c=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 jsxRuntime.jsx(Qs,{...i,onClose:r("warning-card","close",i.title,i,i.onClose),onConfirm:c})}case "suggestions-card":{let i=n;return jsxRuntime.jsx(Ys,{...i,onClose:r("suggestions-card","close",i.title,i,i.onClose),onSuggestionClick:r("suggestions-card","suggestion-click",i.title,i,i.onSuggestionClick,c=>({suggestion:c}))})}case "tool-result-card":{let i=n;return jsxRuntime.jsx(Js,{...i,onClose:r("tool-result-card","close",i.title,i,i.onClose),onAction:r("tool-result-card","action",i.title,i,i.onAction)})}}return jsxRuntime.jsx("div",{className:"dynamic-card-fallback",children:jsxRuntime.jsx(nl,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:o})})},rg=HS;var ed=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"}}},US=({content:e,className:t="",messageId:o,cardHooks:a})=>{let r=mt__namespace.default.useMemo(()=>ed.analyze(e),[e]);return jsxRuntime.jsx("div",{className:`universal-content-renderer ${t}`,children:r.blocks.map((n,i)=>n.type==="mixed"||n.type==="json-card"?jsxRuntime.jsx(rg,{content:n.content,messageId:o,cardHooks:a},`block-${i}`):jsxRuntime.jsx(nl,{content:n.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:a},`block-${i}`))})},ng=US;var KS=({content:e,isStreaming:t=true,onComplete:o,className:a="",streamIntervalMs:r=24,streamChunkSize:n=3,messageId:i,cardHooks:c})=>{let[d,s]=mt.useState(t?0:e.length),[l,m]=mt.useState(!t);mt.useEffect(()=>{if(t){s(0),m(false);return}s(e.length),m(true);},[e,t]),mt.useEffect(()=>{if(!t||l)return;if(d>=e.length){m(true),o?.();return}let u=window.setTimeout(()=>{s(C=>Math.min(C+n,e.length));},r);return ()=>{window.clearTimeout(u);}},[e.length,l,t,o,n,r,d]);let f=()=>{t&&!l&&(s(e.length),m(true),o?.());},p=t?e.slice(0,d):e,h=t&&!l,k=t&&!l;return jsxRuntime.jsxs("div",{className:`streaming-markdown ${a}`,onClick:f,style:{cursor:t?"pointer":"default"},children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(ng,{content:p,messageId:i,cardHooks:c}),h&&jsxRuntime.jsx("span",{className:"inline-block w-0.5 h-5 bg-blue-500 ml-1 animate-pulse",style:{verticalAlign:"text-bottom"}})]}),k&&jsxRuntime.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"})]})},cg=KS;var dg=({buttons:e,className:t})=>{let o=a=>{switch(a){case "copy":return jsxRuntime.jsx(lucideReact.Copy,{size:14});case "refresh":return jsxRuntime.jsx(lucideReact.RefreshCw,{size:14});case "volume":return jsxRuntime.jsx(lucideReact.Volume2,{size:14});case "like":return jsxRuntime.jsx(lucideReact.ThumbsUp,{size:14});case "dislike":return jsxRuntime.jsx(lucideReact.ThumbsDown,{size:14});default:return null}};return jsxRuntime.jsx("div",{className:Pe("flex items-center gap-1",t),children:e.map((a,r)=>jsxRuntime.jsx("button",{onClick:a.onClick,disabled:a.disabled,className:Pe("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 il=({message:e,onStreamingComplete:t,assistantActions:o,streamIntervalMs:a,streamChunkSize:r,cardHooks:n})=>e.type==="assistant"?jsxRuntime.jsx("div",{className:"flex justify-start mb-4",children:jsxRuntime.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:[jsxRuntime.jsx(cg,{content:e.content,isStreaming:e.isStreaming??false,onComplete:t,streamIntervalMs:a,streamChunkSize:r,messageId:e.id,cardHooks:n}),e.content&&o?.isLatestAssistant&&jsxRuntime.jsx("div",{className:"flex flex-row justify-start gap-2 mt-3 pt-2 border-t border-gray-100 dark:border-gray-700",children:jsxRuntime.jsx(dg,{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"})}),jsxRuntime.jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})}):jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.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:[jsxRuntime.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}),jsxRuntime.jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})});var ug=({onTextUpdate:e,onComplete:t,onCancel:o,disabled:a,className:r})=>{let{isRecording:n,startRecording:i,stopRecording:c}=Zs({onTextUpdate:e,onComplete:s=>{t?.(s);},onError:s=>{console.error("Voice input error:",s),o?.();}});return jsxRuntime.jsx("button",{onClick:async()=>{n?c():await i();},disabled:a,className:Pe("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?jsxRuntime.jsx(YS__default.default,{sx:{fontSize:24}}):jsxRuntime.jsx(QS__default.default,{sx:{fontSize:24}})})};var gt={container:"w-full max-w-4xl mx-auto",inputContainer:Pe("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:Pe("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:Pe("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:Pe("bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400","cursor-pointer active:scale-95"),sendButton:Pe("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:Pe("cursor-not-allowed opacity-40 bg-transparent text-gray-400"),stopButton:Pe("cursor-pointer bg-red-500 hover:bg-red-600 text-white shadow-sm active:scale-95")},iw={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},sw=({enabled:e,onClick:t})=>jsxRuntime.jsx("button",{className:Pe(gt.buttonBase,gt.buttonSmall,gt.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsxRuntime.jsx(rw__default.default,{sx:{fontSize:24}})}),lw=()=>jsxRuntime.jsxs("button",{className:Pe(gt.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",gt.buttonNormal),"aria-label":"Tools",type:"button",children:[jsxRuntime.jsx(nw__default.default,{sx:{fontSize:20}}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),cw=({canSend:e,isResponding:t,onSend:o,onStop:a})=>t?jsxRuntime.jsx("button",{className:Pe(gt.buttonBase,gt.buttonSmall,gt.stopButton),onClick:a,"aria-label":"Stop generating",type:"button",children:jsxRuntime.jsx(iconsMaterial.Stop,{sx:{fontSize:20}})}):jsxRuntime.jsx("button",{className:Pe(gt.buttonBase,gt.buttonSmall,e?gt.sendButton:gt.sendButtonDisabled),onClick:o,disabled:!e,"aria-label":"Send message",type:"button",children:jsxRuntime.jsx(aw__default.default,{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]=mt.useState(""),[c,d]=mt.useState([]),[s,l]=mt.useState(false),[m,f]=mt.useState(false),p=mt.useRef(null),h=a||(r?r("00019","Type a message..."):"Type a message..."),k=(n.trim().length>0||c.length>0)&&!o,u={enabled:true},C=mt.useCallback(I=>{i(I.target.value),I.target.style.height="auto",I.target.style.height=`${Math.min(I.target.scrollHeight,200)}px`;},[]),g=mt.useCallback(I=>{if(I.target.files&&I.target.files.length>0){let $=Array.from(I.target.files);d(N=>{let X=$.filter(J=>N.some(ee=>ee.name===J.name&&ee.size===J.size));X.length>0&&console.warn("Duplicate files ignored:",X.map(J=>J.name));let se=$.filter(J=>!N.some(ee=>ee.name===J.name&&ee.size===J.size));return [...N,...se]}),p.current&&(p.current.value="");}},[]),y=mt.useCallback(I=>{d($=>$.filter((N,X)=>X!==I));},[]),b=mt.useCallback(()=>{p.current?.click();},[]),S=mt.useCallback(async()=>{if(!k)return;let I=n,$=[...c];i(""),d([]),p.current&&(p.current.value="");try{await e(I,$);}catch(N){console.error("Failed to send message:",N),i(I),d($);}},[n,k,e,c]),E=mt.useCallback(I=>{I.key==="Enter"&&!I.shiftKey&&!s&&(I.preventDefault(),S());},[S,s]),D=mt.useCallback(()=>{l(true);},[]),w=mt.useCallback(()=>{l(false);},[]),A=mt.useCallback(I=>{i(I);},[]),P=mt.useCallback(I=>{i(I);},[]),v=mt.useCallback(()=>{},[]),M=mt.useCallback(I=>{I.preventDefault(),f(true);},[]),T=mt.useCallback(I=>{I.preventDefault(),f(false);},[]),R=mt.useCallback(I=>{if(I.preventDefault(),f(false),I.dataTransfer.files&&I.dataTransfer.files.length>0){let $=Array.from(I.dataTransfer.files);d(N=>[...N,...$]);}},[]);return jsxRuntime.jsx("div",{className:gt.container,children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"file",multiple:true,className:"hidden",ref:p,onChange:g}),jsxRuntime.jsxs("div",{className:Pe(gt.inputContainer,m&&gt.dragActive),style:{borderRadius:"32px"},onDragOver:M,onDragLeave:T,onDrop:R,children:[c.length>0&&jsxRuntime.jsx("div",{className:gt.filePreviewArea,children:c.map((I,$)=>jsxRuntime.jsxs("div",{className:gt.fileTag,children:[jsxRuntime.jsx(iconsMaterial.InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsxRuntime.jsx("span",{className:"truncate max-w-[150px]",children:I.name}),jsxRuntime.jsx("button",{onClick:()=>y($),className:"ml-1 hover:text-red-500 focus:outline-none",type:"button",children:jsxRuntime.jsx(iconsMaterial.Close,{sx:{fontSize:16}})})]},`${I.name}-${$}`))}),jsxRuntime.jsxs("div",{className:"flex flex-col w-full p-2",children:[jsxRuntime.jsx("div",{className:Pe(gt.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsxRuntime.jsx("textarea",{className:Pe(gt.textarea,"min-h-[24px] py-0 px-0"),placeholder:h,value:n,onChange:C,onKeyDown:E,onCompositionStart:D,onCompositionEnd:w,style:iw,"aria-label":"Message input",spellCheck:false,rows:1})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-1 pb-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:[jsxRuntime.jsx(sw,{enabled:u.enabled,onClick:b}),jsxRuntime.jsx(lw,{})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(ug,{onTextUpdate:A,onComplete:P,onCancel:v,disabled:o,className:gt.buttonSmall}),jsxRuntime.jsx(cw,{canSend:k,isResponding:o,onSend:S,onStop:t})]})]})]})]})]})})};var hg=({messages:e,onSend:t,onStop:o,onRegenerate:a,isResponding:r=false,className:n,placeholder:i,streamIntervalMs:c,streamChunkSize:d,onMessageStreamingComplete:s,cardHooks:l,showInput:m=true})=>{let f=mt.useRef(null),p=mt.useRef(e.length);return mt.useEffect(()=>{e.length>p.current&&f.current?.scrollIntoView({behavior:"smooth"}),p.current=e.length;},[e]),jsxRuntime.jsxs("div",{className:Pe("flex flex-col h-full w-full relative",n),children:[jsxRuntime.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,k)=>{let u=h.type==="assistant"&&k===e.length-1,C=h.type==="assistant"?{isLatestAssistant:u,onRegenerate:a?()=>a(h.id):void 0}:void 0;return jsxRuntime.jsx(il,{message:h,assistantActions:C,onStreamingComplete:()=>s?.(h.id),streamIntervalMs:c,streamChunkSize:d,cardHooks:l},h.id)}),jsxRuntime.jsx("div",{ref:f})]}),m&&jsxRuntime.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:jsxRuntime.jsx(mg,{onSend:t||(async()=>{}),onStop:o||(()=>{}),isResponding:r,placeholder:i})})]})};var go={};var uw={idle:"Idle",running:"Running",success:"Success",error:"Error",pending:"Pending"},Lz=({title:e="AI Agent",description:t,headerActions:o,className:a,agentStatus:r,showInput:n=false,...i})=>{let c=r??(i.isResponding?"running":"idle");return jsxRuntime.jsxs("div",{className:Pe("relative flex h-full w-full",go.agentPanel,a),"data-status":c,children:[jsxRuntime.jsx("div",{className:go.colorHalo,"data-status":c,"aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:go.marqueeBorder,"data-status":c,"aria-hidden":"true",children:[jsxRuntime.jsx("span",{className:Pe(go.edge,go.top)}),jsxRuntime.jsx("span",{className:Pe(go.edge,go.right)}),jsxRuntime.jsx("span",{className:Pe(go.edge,go.bottom)}),jsxRuntime.jsx("span",{className:Pe(go.edge,go.left)})]}),jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e}),t&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.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:[jsxRuntime.jsx("span",{className:go.statusDot,"data-status":c}),jsxRuntime.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-gray-600 dark:text-gray-300",children:uw[c]})]}),o]})]}),jsxRuntime.jsx("div",{className:"flex-1 min-h-0 relative z-10",children:jsxRuntime.jsx(hg,{...i,showInput:n})})]})]})};var yw={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},Gz=({messages:e,onSend:t,onRegenerate:o,isResponding:a=false,className:r,placeholder:n,title:i="Copilot",corner:c="bottom-right",onCollapse:d,onHeaderPointerDown:s,onPlusClick:l,onMicClick:m,streamIntervalMs:f,streamChunkSize:p,onMessageStreamingComplete:h,cardHooks:k})=>{let[u,C]=mt.useState(""),[g,y]=mt.useState(false),b=mt.useRef(null),S=yw[c];mt.useEffect(()=>{b.current?.scrollIntoView({behavior:"smooth"});},[e,a]);let E=mt.useCallback(async()=>{let w=u.trim();!w||a||(C(""),await t(w));},[a,t,u]),D=mt.useCallback(async w=>{w.key==="Enter"&&!g&&(w.preventDefault(),await E());},[E,g]);return jsxRuntime.jsxs("div",{className:Pe("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:[d&&jsxRuntime.jsx("button",{onClick:d,className:Pe("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",S==="top-left"&&"-left-2 -top-2",S==="top-right"&&"-right-2 -top-2",S==="bottom-left"&&"-bottom-2 -left-2",S==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:jsxRuntime.jsx("span",{className:Pe("block h-4 w-4 border-[#21BCFF]",S==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",S==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",S==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",S==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 px-4 py-3 dark:border-gray-800",onPointerDown:s,children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsx("h3",{className:"text-base font-semibold tracking-tight text-gray-900 dark:text-gray-100",children:i})}),jsxRuntime.jsx("div",{})]}),jsxRuntime.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((w,A)=>{let P=w.type==="assistant"&&A===e.length-1,v=w.type==="assistant"?{isLatestAssistant:P,onRegenerate:o?()=>o(w.id):void 0}:void 0;return jsxRuntime.jsx(il,{message:w,assistantActions:v,onStreamingComplete:()=>h?.(w.id),streamIntervalMs:f,streamChunkSize:p,cardHooks:k},w.id)}),jsxRuntime.jsx("div",{ref:b})]}),jsxRuntime.jsx("div",{className:"border-t border-gray-100 px-3 py-3 dark:border-gray-800",children:jsxRuntime.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:[jsxRuntime.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:l,type:"button","aria-label":"Add",children:jsxRuntime.jsx(lucideReact.Plus,{className:"h-4 w-4"})}),jsxRuntime.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:w=>C(w.target.value),onCompositionStart:()=>y(true),onCompositionEnd:()=>y(false),onKeyDown:D,"aria-label":"Copilot input",spellCheck:false}),jsxRuntime.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:m,type:"button","aria-label":"Microphone",children:jsxRuntime.jsx(lucideReact.Mic,{className:"h-4 w-4"})})]})})]})};var _z=({defaultMode:e="login",onLogin:t,onRegister:o,onForgotPassword:a}={})=>{let[r,n]=mt.useState(e),[i,c]=mt.useState(false),d=mt.useCallback(async p=>{c(true);try{await p?.();}finally{c(false);}},[]),s=mt.useCallback(p=>d(()=>t?.(p)),[t,d]),l=mt.useCallback(p=>d(()=>o?.(p)),[o,d]),m=mt.useCallback(p=>d(()=>a?.(p)),[a,d]),f=mt.useMemo(()=>({mode:r,loading:i,onModeChange:n,onLogin:s,onRegister:l,onForgotPassword:m}),[m,s,l,i,r]);return {mode:r,loading:i,setMode:n,authPageProps:f}};var ad=({label:e,...t})=>jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{...t}),label:e});var bi=mt.forwardRef((e,t)=>jsxRuntime.jsx(material.Paper,{ref:t,...e,elevation:e.elevation||1,sx:{p:2,mb:2,...e.sx}}));bi.displayName="CPaper";var Mw={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."},mN=({mode:e,defaultMode:t="login",onModeChange:o,onLogin:a,onRegister:r,onForgotPassword:n,loading:i=false,logo:c,copy:d,sx:s})=>{let l=material.useTheme(),m=e!==void 0,[f,p]=mt.useState(t),h=e??f,k=mt.useMemo(()=>({...Mw,...d}),[d]),[u,C]=mt.useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[g,y]=mt.useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[b,S]=mt.useState({email:""}),[E,D]=mt.useState(""),w=R=>{m||p(R),D(""),o?.(R);},A=async R=>{R.preventDefault(),await a?.(u),D("Demo login accepted. No real authentication request was sent.");},P=async R=>{R.preventDefault(),await r?.(g),D("Demo registration saved locally for this screen.");},v=async R=>{R.preventDefault(),await n?.(b),D("Demo reset link request created. No email was sent.");},M=h==="login"?k.loginTitle:h==="register"?k.registerTitle:k.forgotTitle,T=h==="login"?k.loginSubtitle:h==="register"?k.registerSubtitle:k.forgotSubtitle;return jsxRuntime.jsxs(material.Box,{sx:{minHeight:"100vh",display:"grid",gridTemplateColumns:{xs:"1fr",md:"minmax(320px, 0.9fr) minmax(420px, 1.1fr)"},background:l.palette.mode==="dark"?"linear-gradient(135deg, #071018 0%, #151515 48%, #101827 100%)":"linear-gradient(135deg, #eef3f8 0%, #ffffff 52%, #e8f2f0 100%)",...s},children:[jsxRuntime.jsxs(material.Box,{sx:{display:{xs:"none",md:"flex"},flexDirection:"column",justifyContent:"space-between",p:{md:6,lg:8},borderRight:`1px solid ${l.palette.divider}`},children:[jsxRuntime.jsxs(material.Stack,{spacing:4,children:[jsxRuntime.jsx(material.Box,{children:c}),jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:14,fontWeight:700,color:"primary.main",textTransform:"uppercase"},children:k.productName}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:{md:34,lg:42},lineHeight:1.06,fontWeight:800},children:k.headline}),jsxRuntime.jsx(material.Typography,{sx:{maxWidth:460,color:"text.secondary",fontSize:16,lineHeight:1.7},children:k.subheadline})]})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:2,sx:{color:"text.secondary",fontSize:13},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",children:"Reports"}),jsxRuntime.jsx(material.Typography,{variant:"caption",children:"Planning"}),jsxRuntime.jsx(material.Typography,{variant:"caption",children:"Agent UI"})]})]}),jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",p:{xs:2,sm:4,md:6}},children:jsxRuntime.jsx(bi,{elevation:0,sx:{width:"100%",maxWidth:460,m:0,p:{xs:2.5,sm:4},borderRadius:3,border:`1px solid ${l.palette.divider}`,backgroundColor:l.palette.mode==="dark"?"rgba(15, 23, 42, 0.86)":"rgba(255, 255, 255, 0.88)",backdropFilter:"blur(18px)",boxShadow:l.palette.mode==="dark"?"0 24px 80px rgba(0,0,0,0.34)":"0 24px 80px rgba(15,23,42,0.10)"},children:jsxRuntime.jsxs(material.Stack,{spacing:3,children:[jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.Box,{sx:{display:{xs:"block",md:"none"},mb:1},children:c}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:28,fontWeight:800},children:M}),jsxRuntime.jsx(material.Typography,{sx:{color:"text.secondary"},children:T})]}),E&&jsxRuntime.jsx(material.Alert,{severity:"success",children:E}),h==="login"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:A,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(Ut,{label:"Email or user ID",value:u.username,onChange:R=>C(I=>({...I,username:R.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(kg__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Ut,{label:"Password",type:"password",value:u.password,onChange:R=>C(I=>({...I,password:R.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Rw__default.default,{fontSize:"small"})})}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[jsxRuntime.jsx(ad,{label:"Remember me",checked:u.remember,onChange:R=>C(I=>({...I,remember:R.target.checked}))}),jsxRuntime.jsx(Do,{type:"button",variant:"text",size:"small",onClick:()=>w("forgot"),children:"Forgot?"})]}),jsxRuntime.jsx(Do,{type:"submit",size:"large",disabled:i,children:"Sign in"}),jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["New user?"," ",jsxRuntime.jsx(Do,{type:"button",variant:"text",size:"small",onClick:()=>w("register"),sx:{minWidth:0,p:0},children:"Register"})]})]})}),h==="register"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:P,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(Ut,{label:"Full name",value:g.name,onChange:R=>y(I=>({...I,name:R.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(kg__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Ut,{label:"Work email",type:"email",value:g.email,onChange:R=>y(I=>({...I,email:R.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Cg__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Ut,{label:"Password",type:"password",value:g.password,onChange:R=>y(I=>({...I,password:R.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Dw__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Ut,{label:"Confirm password",type:"password",value:g.confirmPassword,onChange:R=>y(I=>({...I,confirmPassword:R.target.value}))}),jsxRuntime.jsx(ad,{label:"I accept the demo workspace terms",checked:g.acceptedTerms,onChange:R=>y(I=>({...I,acceptedTerms:R.target.checked}))}),jsxRuntime.jsx(Do,{type:"submit",size:"large",disabled:i,children:"Create demo account"}),jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["Already have an account?"," ",jsxRuntime.jsx(Do,{type:"button",variant:"text",size:"small",onClick:()=>w("login"),sx:{minWidth:0,p:0},children:"Sign in"})]})]})}),h==="forgot"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:v,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(Ut,{label:"Work email",type:"email",value:b.email,onChange:R=>S({email:R.target.value}),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Cg__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Do,{type:"submit",size:"large",disabled:i,children:"Send reset request"}),jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["Remember your password?"," ",jsxRuntime.jsx(Do,{type:"button",variant:"text",size:"small",onClick:()=>w("login"),sx:{minWidth:0,p:0},children:"Back to sign in"})]})]})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{color:"text.secondary"},children:"Demo credentials: demo@orbcafe.local / orbcafe-demo"})]})})})]})};var Ew={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},Fw=[{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"}],Sg=({tasks:e,defaultScale:t="week",defaultSelectedTaskId:o,initialFilters:a,filterFields:r,filterAppId:n="planning-gantt-filter",filterTableKey:i="planning",onFilterSearch:c,onFilterVariantLoad:d})=>{let[s,l]=mt.useState(t),[m,f]=mt.useState(o??e[0]?.id??""),[p,h]=mt.useState({...Ew,...a}),k=mt.useMemo(()=>{let y=String(p.keyword?.value??"").trim().toLowerCase(),b=String(p.status?.value??"").trim(),S=String(p.owner?.value??"").trim().toLowerCase(),E=String(p.workCenter?.value??"").trim().toLowerCase(),D=p.dateRange?.value,w=D?.[0]?Ka__default.default(D[0]):null,A=D?.[1]?Ka__default.default(D[1]):null;return e.filter(P=>{if(y&&![P.id,P.code,P.title,P.project,P.workCenter,P.owner?.name].join(" ").toLowerCase().includes(y)||b&&P.status!==b||S&&!String(P.owner?.name??"").toLowerCase().includes(S)||E&&!String(P.workCenter??"").toLowerCase().includes(E))return false;if(w||A){let v=Ka__default.default(P.startDate),M=Ka__default.default(P.endDate),T=w?M.isAfter(w)||M.isSame(w,"day"):true,R=A?v.isBefore(A)||v.isSame(A,"day"):true;if(!T||!R)return false}return true})},[p,e]);mt.useEffect(()=>{k.length!==0&&(k.some(y=>y.id===m)||f(k[0].id));},[k,m]);let u=mt.useCallback(y=>{f(y.id);},[]),C=mt.useMemo(()=>({appId:n,tableKey:i,fields:r??Fw,filters:p,onFilterChange:h,onVariantLoad:d??(()=>{}),onSearch:c??(()=>{})}),[n,r,i,p,c,d]),g=mt.useMemo(()=>({tasks:k,scale:s,onScaleChange:l,selectedTaskId:m,onTaskSelect:u}),[k,u,s,m]);return {scale:s,setScale:l,selectedTaskId:m,setSelectedTaskId:f,filters:p,setFilters:h,filteredTasks:k,smartFilterProps:C,planningGanttProps:g}};var CN=e=>{let t=Sg(e),o=mt.useMemo(()=>({filterProps:t.smartFilterProps,ganttProps:t.planningGanttProps}),[t.planningGanttProps,t.smartFilterProps]);return {...t,layoutProps:o}};var wg=e=>jsxRuntime.jsx(material.Chip,{...e,size:e.size||"small",variant:e.variant||"outlined"});var Ua=mt.forwardRef(({tooltip:e,...t},o)=>{let a=jsxRuntime.jsx(material.IconButton,{ref:o,...t,size:t.size||"small"});return e?jsxRuntime.jsx(material.Tooltip,{title:e,children:a}):a});Ua.displayName="CIconButton";var Ig=({label:e,options:t,minWidth:o=120,...a})=>jsxRuntime.jsxs(material.FormControl,{fullWidth:true,size:"small",sx:{minWidth:o},children:[e&&jsxRuntime.jsx(material.InputLabel,{children:e}),jsxRuntime.jsx(material.Select,{label:e,...a,children:t.map(r=>jsxRuntime.jsx(material.MenuItem,{value:r.value,children:r.label},r.value))})]});var sd=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],ld=56,Ir=58,cd=8,dd=260,d1=320,qa="220ms cubic-bezier(0.2, 0, 0, 1)",Dg={"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"}},p1=e=>e?Dg[e]?.label??e:"Planned",u1=e=>e?Dg[e]?.color??"default":"info",Mg=e=>Math.min(100,Math.max(0,e??0)),Ag=(e,t=0)=>e.flatMap(o=>[{...o,level:t},...Ag(o.children??[],t+1)]),m1=e=>({id:e.id,code:e.code??e.id,title:e.title,titleSub:e.project??e.workCenter??"General",owner:e.owner?.name??"Unassigned",status:p1(e.status),statusTone:e.status??"planned",progress:Mg(e.progress),startDate:e.startDate,endDate:e.endDate,color:e.color}),Bg=(e,t)=>t==="month"?e.startOf("month"):t==="week"?e.startOf("week"):t==="day"?e.startOf("day"):e.startOf("hour"),Eg=(e,t)=>t==="month"?e.endOf("month"):t==="week"?e.endOf("week"):t==="day"?e.endOf("day"):e.endOf("hour"),g1=(e,t,o)=>{let a=[],r=Bg(e,o),n=Eg(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"),start:r,end:i}),r=i;}return a},Rg=(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},Fg=({title:e="Project Plan",subtitle:t="Task table and timeline view",extraTools:o,bodyHeight:a=560,tasks:r,scale:n="week",onScaleChange:i,timelineStart:c,timelineEnd:d,selectedTaskId:s,onTaskSelect:l,emptyLabel:m="No planning tasks available.",sx:f})=>{let p=material.useTheme(),h=mt.useRef(null),k=mt.useRef(null),u=mt.useRef(null),C=mt.useRef(false),[g,y]=mt.useState(null),[b,S]=mt.useState(null),[E,D]=mt.useState({}),[w,A]=mt.useState(ld),P=mt.useRef(null),v=mt.useMemo(()=>Ag(r),[r]),M=mt.useMemo(()=>new Map(v.map(W=>[W.id,W])),[v]),T=mt.useMemo(()=>v.map(W=>m1(W)),[v]),R=mt.useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(W,le)=>jsxRuntime.jsxs(material.Stack,{spacing:.2,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:le.title}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:13,color:"text.secondary"},children:le.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(W,le)=>jsxRuntime.jsx(wg,{label:le.status,color:u1(le.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:W=>jsxRuntime.jsxs(material.Stack,{spacing:.6,children:[jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{color:"text.secondary"},children:[W,"%"]}),jsxRuntime.jsx(material.LinearProgress,{variant:"determinate",value:W,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),I=Qr({appId:"planning-gantt",title:e,columns:R,rows:T,rowKey:"id",rowsPerPage:-1,rowsPerPageOptions:[-1],count:T.length,showSummary:false}),$=I.visibleRows,N=W=>W.type==="group"?`group-${W.id}`:`row-${(W.data||W)?.id}`,X=mt.useMemo(()=>{let W=T.map(xe=>Ka__default.default(xe.startDate)),le=T.map(xe=>Ka__default.default(xe.endDate)),be=c?Ka__default.default(c):W.reduce((xe,ve)=>ve.isBefore(xe)?ve:xe,W[0]??Ka__default.default()),he=d?Ka__default.default(d):le.reduce((xe,ve)=>ve.isAfter(xe)?ve:xe,le[0]??Ka__default.default().add(30,"day")),V=n==="month"?"month":n==="week"?"week":n==="day"?"day":"hour",ce=n==="month"?"month":n==="week"?"week":n==="day"?"day":"hour",te=n==="hour"?12:1,de=n==="hour"?12:1;return {start:Bg(be.subtract(te,V),n),end:Eg(he.add(de,ce),n)}},[T,n,d,c]),se=sd.find(W=>W.value===n)??sd[1],J=Array.isArray(o)?o:o?[o]:[],ee=mt.useMemo(()=>g1(X.start,X.end,n),[X.end,X.start,n]),Z=ee.length*se.width,Oe=(I.columns||[]).filter(W=>I.visibleColumns.includes(W.id)).reduce((W,le)=>W+(I.columnWidths?.[le.id]||le.minWidth||100),0),Je=g??Oe,Ke=b==="table",ae=b==="timeline",Be=ae?0:Ke?"100%":Je,De=b==="timeline",qe=b==="table",Le=!De&&!qe,We=Ke?"minmax(0, 1fr) 0px 0px":ae?"0px 0px minmax(0, 1fr)":`${Je}px ${cd}px minmax(0, 1fr)`;mt.useEffect(()=>{y(W=>W===null?null:Math.min(Math.max(W,dd),Oe));},[Oe]);let et=W=>{W.preventDefault(),W.currentTarget.setPointerCapture(W.pointerId),S(null),P.current={startX:W.clientX,startWidth:Je};let le=he=>{let V=P.current;if(!V)return;let ce=h.current?.clientWidth??0,te=ce>0?Math.max(dd,ce-cd-d1):Oe,de=Math.min(Math.max(V.startWidth+he.clientX-V.startX,dd),te);y(de);},be=()=>{P.current=null,window.removeEventListener("pointermove",le),window.removeEventListener("pointerup",be),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",le),window.addEventListener("pointerup",be);},to=()=>{S(null),y(null);},Ft=W=>{if(C.current)return;let le=W==="table"?k.current:u.current,be=W==="table"?u.current:k.current;!le||!be||(C.current=true,be.scrollTop=le.scrollTop,window.requestAnimationFrame(()=>{C.current=false;}));};return mt.useLayoutEffect(()=>{let W=k.current;if(!W)return;let le=0,be=()=>{let de=W.querySelector("thead"),xe=Array.from(W.querySelectorAll("tbody tr[data-planning-row-key]"));if(xe.length===0)return;let ve=de?.getBoundingClientRect().height||ld,ft={};xe.forEach(tt=>{let Lt=tt.dataset.planningRowKey;Lt&&(ft[Lt]=tt.getBoundingClientRect().height);}),A(tt=>Math.abs(tt-ve)<.01?tt:ve),D(tt=>{let Lt=Object.keys(tt),jt=Object.keys(ft);return Lt.length===jt.length&&jt.every(Zt=>Math.abs((tt[Zt]??0)-ft[Zt])<.01)?tt:ft});},he=()=>{window.cancelAnimationFrame(le),le=window.requestAnimationFrame(be);};if(be(),typeof ResizeObserver>"u")return window.addEventListener("resize",he),()=>{window.cancelAnimationFrame(le),window.removeEventListener("resize",he);};let V=new ResizeObserver(he),ce=W.querySelector("table"),te=W.querySelector("thead");return ce&&V.observe(ce),te&&V.observe(te),W.querySelectorAll("tbody tr[data-planning-row-key]").forEach(de=>V.observe(de)),window.addEventListener("resize",he),()=>{window.cancelAnimationFrame(le),V.disconnect(),window.removeEventListener("resize",he);}},[$,I.visibleColumns,I.grouping,I.columnWidths]),jsxRuntime.jsxs(bi,{elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:3,border:`1px solid ${p.palette.divider}`,backgroundColor:p.palette.background.paper,...f},children:[jsxRuntime.jsxs(material.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 ${p.palette.divider}`},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[jsxRuntime.jsx(material.Box,{sx:{width:38,height:38,borderRadius:2,display:"grid",placeItems:"center",backgroundColor:"primary.main",color:"primary.contrastText"},children:jsxRuntime.jsx(t1__default.default,{fontSize:"small"})}),jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:18,fontWeight:800},children:e}),jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{color:"text.secondary"},children:t})]})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{flexWrap:"wrap"},children:[J.length>0&&jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,alignItems:"center",children:J.map((W,le)=>jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center"},children:W},`planning-extra-tool-${le}`))}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(Ua,{tooltip:"Column visibility",onClick:W=>I.setAnchorEl(W.currentTarget),color:"default",children:jsxRuntime.jsx(Lf__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Ua,{tooltip:"Group by",onClick:W=>I.setGroupAnchorEl(W.currentTarget),color:"default",children:jsxRuntime.jsx(Vf__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Ua,{tooltip:"Sort by first visible column",onClick:()=>{let W=(I.columns||[]).find(le=>I.visibleColumns.includes(le.id));W&&I.handleRequestSort(W.id);},color:I.orderBy?"primary":"default",children:jsxRuntime.jsx(l1__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(Ua,{tooltip:"Expand task table",onClick:()=>S("table"),color:b==="table"?"primary":"default",children:jsxRuntime.jsx(i1__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Ua,{tooltip:"Reset split",onClick:to,color:b===null?"primary":"default",children:jsxRuntime.jsx(s1__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Ua,{tooltip:"Expand timeline",onClick:()=>S("timeline"),color:b==="timeline"?"primary":"default",children:jsxRuntime.jsx(n1__default.default,{fontSize:"small"})})]}),jsxRuntime.jsx(material.Box,{sx:{minWidth:120},children:jsxRuntime.jsx(Ig,{label:"",value:n,options:sd.map(W=>({value:W.value,label:W.label})),onChange:W=>i?.(W.target.value),sx:{"& .MuiSelect-select":{fontSize:"0.92rem",py:.65},"& .MuiSvgIcon-root":{fontSize:20}}})})]})]}),T.length===0?jsxRuntime.jsx(material.Box,{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:m}):jsxRuntime.jsx(material.Box,{sx:{overflow:"hidden",flex:1,minHeight:0},children:jsxRuntime.jsxs(material.Box,{ref:h,sx:{height:"100%",display:"grid",gridTemplateColumns:We,transition:`grid-template-columns ${qa}`},children:[jsxRuntime.jsx(material.TableContainer,{"data-planning-scroll-pane":"table",ref:k,onScroll:()=>Ft("table"),sx:{width:Be,height:a,overflowX:"auto",overflowY:"auto",opacity:De?0:1,transform:De?"translateX(-10px)":"translateX(0)",pointerEvents:De?"none":"auto",transition:`opacity ${qa}, transform ${qa}, width ${qa}`},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,sx:{tableLayout:"fixed",width:Oe,"& thead .MuiTableCell-root":{height:ld,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[jsxRuntime.jsx(wi,{columns:I.columns,visibleColumns:I.visibleColumns,order:I.order,orderBy:I.orderBy,onRequestSort:I.handleRequestSort,grouping:I.grouping,isAllExpanded:I.isAllExpanded,handleToggleAll:I.handleToggleAll,columnWidths:I.columnWidths,onColumnResize:I.handleColumnResize}),jsxRuntime.jsx(material.TableBody,{children:$.map(W=>{let le=N(W);if(W.type==="group")return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":le,sx:{height:Ir,backgroundColor:p.palette.action.hover},children:[I.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{width:44,height:Ir,py:0,borderBottom:`1px solid ${p.palette.divider}`},children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>I.toggleGroupExpand(W.id),children:W.isExpanded?jsxRuntime.jsx(lh__default.default,{fontSize:"small"}):jsxRuntime.jsx(Kf__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.TableCell,{colSpan:I.visibleColumns.length,sx:{height:Ir,py:0,borderBottom:`1px solid ${p.palette.divider}`},children:jsxRuntime.jsxs(material.Typography,{sx:{fontSize:13,fontWeight:700},children:[W.field,": ",W.value," (",W.count,")"]})})]},W.id);let be=W.data||W,he=be.id===s;return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":le,hover:true,selected:he,onClick:()=>l?.(M.get(be.id)||be),sx:{cursor:l?"pointer":"default",height:Ir},children:[I.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{width:44,height:Ir,py:0,borderBottom:`1px solid ${p.palette.divider}`}}),(I.columns||[]).filter(V=>I.visibleColumns.includes(V.id)).map(V=>jsxRuntime.jsx(material.TableCell,{sx:{width:I.columnWidths?.[V.id]||V.minWidth||100,height:Ir,py:0,overflow:"hidden",borderBottom:`1px solid ${p.palette.divider}`},children:V.render?V.render(be[V.id],be):String(be[V.id]??"-")},`${be.id}-${V.id}`))]},be.id)})})]})}),jsxRuntime.jsx(material.Box,{onPointerDown:Le?et:void 0,role:"separator","aria-orientation":"vertical",sx:{width:Le?cd:0,cursor:Le?"col-resize":"default",opacity:Le?1:0,pointerEvents:Le?"auto":"none",borderLeft:Le?`1px solid ${p.palette.divider}`:"0 solid transparent",borderRight:Le?`1px solid ${p.palette.divider}`:"0 solid transparent",backgroundColor:p.palette.mode==="dark"?"rgba(148,163,184,0.10)":"rgba(15,23,42,0.04)",transition:`width ${qa}, opacity ${qa}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:p.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:Le?"col-resize":"default"}}}),jsxRuntime.jsx(material.Box,{sx:{minWidth:0,overflow:"hidden",opacity:qe?0:1,transform:qe?"translateX(10px)":"translateX(0)",pointerEvents:qe?"none":"auto",transition:`opacity ${qa}, transform ${qa}`},children:jsxRuntime.jsx(material.Box,{"data-planning-scroll-pane":"timeline",ref:u,onScroll:()=>Ft("timeline"),sx:{width:"100%",height:a,overflowX:"auto",overflowY:"auto"},children:jsxRuntime.jsxs(material.Box,{sx:{width:Z},children:[jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${ee.length}, ${se.width}px)`,height:w,boxSizing:"border-box",borderBottom:`1px solid ${p.palette.divider}`,position:"sticky",top:0,zIndex:2,backgroundColor:p.palette.background.paper},children:ee.map(W=>jsxRuntime.jsx(material.Box,{sx:{px:.75,display:"flex",alignItems:"center",borderRight:`1px solid ${p.palette.divider}`,color:"text.secondary",fontSize:12,fontWeight:700},children:W.label},W.key))}),jsxRuntime.jsx(material.Stack,{sx:{position:"relative"},children:$.map(W=>{let le=N(W),be=E[le]??Ir;if(W.type==="group")return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":le,sx:{position:"relative",height:be,boxSizing:"border-box",borderBottom:`1px solid ${p.palette.divider}`,backgroundColor:p.palette.action.hover}},W.id);let he=W.data||W,V=Ka__default.default(he.startDate),ce=Ka__default.default(he.endDate),te=Rg(V,ee,se.width),de=Rg(ce,ee,se.width),xe=Math.max(18,de-te),ve=Mg(he.progress),ft=he.id===s,tt=he.color??(he.statusTone==="blocked"?p.palette.error.main:p.palette.primary.main);return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":le,onClick:()=>l?.(M.get(he.id)||he),sx:{position:"relative",height:be,boxSizing:"border-box",borderBottom:`1px solid ${p.palette.divider}`,backgroundImage:p.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:`${se.width}px 100%`,cursor:l?"pointer":"default"},children:jsxRuntime.jsx(material.Tooltip,{title:`${he.title}: ${V.format("MMM D HH:mm")} - ${ce.format("MMM D HH:mm")}`,children:jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",left:te,top:Math.max(8,(be-24)/2),width:xe,height:24,borderRadius:999,overflow:"hidden",backgroundColor:p.palette.mode==="dark"?"rgba(148,163,184,0.18)":"rgba(15,23,42,0.10)",outline:ft?`2px solid ${p.palette.warning.main}`:"none",outlineOffset:2},children:[jsxRuntime.jsx(material.Box,{sx:{height:"100%",width:`${ve}%`,backgroundColor:tt}}),jsxRuntime.jsx(material.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:he.code})]})})},he.id)})})]})})})]})}),jsxRuntime.jsx(zr,{groupAnchorEl:I.groupAnchorEl,setGroupAnchorEl:I.setGroupAnchorEl,grouping:I.grouping,setGrouping:I.setGrouping,columns:I.columns,toggleGroupField:I.toggleGroupField}),jsxRuntime.jsx(Nr,{anchorEl:I.anchorEl,setAnchorEl:I.setAnchorEl,columns:I.columns,visibleColumns:I.visibleColumns,toggleColumnVisibility:I.toggleColumnVisibility})]})};var rV=({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 jsxRuntime.jsxs(material.Stack,{spacing:o,sx:n,children:[jsxRuntime.jsx(material.Box,{sx:{flexShrink:0},children:jsxRuntime.jsx(la,{...e})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:jsxRuntime.jsx(Fg,{...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)"}}},cV=({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:c})=>{let d=material.useMediaQuery("(prefers-reduced-motion: reduce)"),[s,l]=mt.useState("to"),m=!i&&!d&&o!=="none";mt.useEffect(()=>{if(!m){l("to");return}l("from");let h=requestAnimationFrame(()=>{h=requestAnimationFrame(()=>{l("to");});});return ()=>cancelAnimationFrame(h)},[t,m]);let f=k1[o],p=mt.useMemo(()=>m?s==="from"?f.from:f.to:{opacity:1,transform:"none"},[m,s,f.from,f.to]);return jsxRuntime.jsx(material.Box,{sx:{willChange:m?"opacity, transform":"auto",transition:m?`opacity ${a}ms ${n} ${r}ms, transform ${a}ms ${n} ${r}ms`:"none",backfaceVisibility:"hidden",...p,...c},children:e})},dV={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};
199
- exports.AgentPanel=Lz;exports.Button=hl;exports.CAINavProvider=Ek;exports.CAmapChart=tp;exports.CAppHeader=Ss;exports.CAppPageLayout=D2;exports.CAuthPage=mN;exports.CBarChart=Bn;exports.CChartCard=Mi;exports.CComboChart=Hd;exports.CCustomizeAgent=np;exports.CDetailInfoPage=EA;exports.CDetailSearchAiBar=tu;exports.CDetailSectionCard=ms;exports.CFishboneChart=qd;exports.CGoogleMapChart=Qd;exports.CGraphCharts=op;exports.CGraphKpiCards=Vd;exports.CGraphReport=Ki;exports.CHeatmapChart=Ud;exports.CKanbanBoard=e2;exports.CKanbanBucket=su;exports.CKanbanCard=mc;exports.CLayoutManagement=Dp;exports.CLayoutManager=as;exports.CLineChart=$d;exports.CMessageBox=Pn;exports.COrbCanvas=xk;exports.CPageLayout=Id;exports.CPageTransition=cV;exports.CPieChart=Ni;exports.CPivotTable=y5;exports.CPlanningGantt=Fg;exports.CPlanningLayout=rV;exports.CSmartFilter=la;exports.CSmartTable=YD;exports.CStandardPage=nM;exports.CTable=Fa;exports.CTableBody=_D;exports.CTableCell=jD;exports.CTableContainer=ZD;exports.CTableHead=XD;exports.CTableRow=QD;exports.CVariantManagement=Zi;exports.CVariantManager=fp;exports.CVoiceWaveOverlay=Kc;exports.CWaterfallChart=jd;exports.CodeBlock=Un;exports.CopilotChat=Gz;exports.GlobalMessage=PT;exports.MarkdownRenderer=Zn;exports.MathBlock=Kn;exports.MermaidBlock=Jl;exports.NavigationIsland=kd;exports.ORBCAFE_I18N_MESSAGES=In;exports.OrbcafeI18nProvider=ki;exports.PAGE_TRANSITION_PRESETS=dV;exports.PAppPageLayout=_E;exports.PBarcodeScanner=z5;exports.PNavIsland=Tm;exports.PNumericKeypad=Q5;exports.PSmartFilter=ym;exports.PTable=ak;exports.PTouchCard=H5;exports.PWorkloadNav=vm;exports.PivotChartPanel=Zu;exports.StdChat=hg;exports.TableBlock=tc;exports.ThinkBlock=ps;exports.TreeMenu=bl;exports.VoiceNavigatorProvider=cF;exports.VoiceWaveOverlay=tF;exports.buildAmapEmbedUrl=Wi;exports.buildGoogleMapEmbedUrl=Ln;exports.buildGoogleMapIframe=iP;exports.buttonVariants=Ug;exports.createKanbanBoardModel=du;exports.findKanbanCard=zo;exports.message=dT;exports.messageManager=ra;exports.moveKanbanCard=bs;exports.parseMarkdownTable=cs;exports.renderMarkdown=oA;exports.resolveVariantFilters=Ap;exports.resolveVariantLayout=rs;exports.useAINav=Fk;exports.useAmapEmbedUrl=vM;exports.useAuthPage=_z;exports.useDetailInfo=au;exports.useGoogleMapEmbedUrl=xM;exports.useGraphChartData=gM;exports.useGraphInteraction=_i;exports.useGraphReport=_r;exports.useKanbanBoard=n2;exports.useNavigationIsland=wd;exports.useOrbcafeI18n=j;exports.usePadLayout=P5;exports.usePadRecordEditor=M5;exports.usePageLayout=vu;exports.usePivotTable=k5;exports.usePlanningGantt=Sg;exports.usePlanningLayout=CN;exports.useStandardReport=pM;exports.useVoiceInput=Zs;exports.useVoiceNavigator=dF;
189
+ `),f={enableMath:a},u=0;for(;u<g.length;){let h=g[u],v=h.trim();if(!v){u+=1;continue}if(n&&Yp(h)){if(v.startsWith("<think>")){let m=[],y=h;for(;;){let x=y.indexOf("<think>"),S=x>=0?y.slice(x+7):y,B=S.indexOf("</think>");if(B>=0){m.push(S.slice(0,B)),u+=1;break}if(m.push(S),u+=1,u>=g.length)break;y=g[u];}s.push(jsxRuntime.jsx(us,{content:m.join(`
190
+ `).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),s.push(jsxRuntime.jsx(us,{content:C.join(`
191
+ `).trim()},`think-fence-${u}`));continue}if(ms(h)){let C=v.slice(3).trim().toLowerCase(),m=[];for(u+=1;u<g.length&&!ms(g[u]);)m.push(g[u]),u+=1;u<g.length&&ms(g[u])&&(u+=1);let y=m.join(`
192
+ `);if(r&&C==="mermaid"){s.push(jsxRuntime.jsx(Jl,{code:y},`mermaid-${u}`));continue}if(a&&["math","latex","katex"].includes(C)){s.push(jsxRuntime.jsx(qn,{expression:y,allowKatex:true},`math-fence-${u}`));continue}s.push(jsxRuntime.jsx(Kn,{code:y,language:C||"text",copyable:i,showLineNumbers:c,wrapLongLines:true},`code-${u}`));continue}if(a&&v.startsWith("$$")){let C=[];if(v.endsWith("$$")&&v!=="$$")C.push(v.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 x=g[u],S=x.indexOf("$$");if(S>=0){C.push(x.slice(0,S)),u+=1;break}C.push(x),u+=1;}}s.push(jsxRuntime.jsx(qn,{expression:C.join(`
193
+ `).trim(),allowKatex:true},`math-${u}`));continue}if(Zp(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";s.push(jsxRuntime.jsx(material.Typography,{variant:y,sx:{mt:C===1?1.2:.8,mb:.5,fontWeight:700},children:Zn(m,f,`h-${u}`)},`heading-${u}`)),u+=1;continue}if(Xp(h)){s.push(jsxRuntime.jsx(material.Divider,{sx:{my:1.2}},`hr-${u}`)),u+=1;continue}if(Qp(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(`
194
+ `),y=ds(m);if(y){s.push(jsxRuntime.jsx(tc,{table:y},`table-${u}`)),u=C;continue}}if(ic(h)){let C=[];for(;u<g.length&&ic(g[u]);)C.push(g[u].replace(/^\s*>\s?/,"")),u+=1;s.push(jsxRuntime.jsx(material.Paper,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:C.map((m,y)=>jsxRuntime.jsxs(ht.Fragment,{children:[y>0&&jsxRuntime.jsx("br",{}),Zn(m,f,`q-${u}-${y}`)]},`quote-line-${y}`))})},`quote-${u}`));continue}if(rc(h)){let C=[];for(;u<g.length&&rc(g[u]);)C.push(g[u].trim().replace(/^[-*+]\s+/,"")),u+=1;s.push(jsxRuntime.jsx(material.Box,{component:"ul",sx:{my:.8,pl:2.5},children:C.map((m,y)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:Zn(m,f,`ul-${u}-${y}`)})},`ul-item-${y}`))},`ul-${u}`));continue}if(nc(h)){let C=[];for(;u<g.length&&nc(g[u]);)C.push(g[u].trim().replace(/^\d+\.\s+/,"")),u+=1;s.push(jsxRuntime.jsx(material.Box,{component:"ol",sx:{my:.8,pl:2.7},children:C.map((m,y)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:Zn(m,f,`ol-${u}-${y}`)})},`ol-item-${y}`))},`ol-${u}`));continue}let p=[];for(;u<g.length;){let C=g[u],m=C.trim();if(!m||ms(C)||Zp(C)||Xp(C)||rc(C)||nc(C)||ic(C)||Qp(g,u)||n&&Yp(C)||a&&m.startsWith("$$"))break;p.push(C),u+=1;}p.length>0?s.push(jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:p.map((C,m)=>jsxRuntime.jsxs(ht.Fragment,{children:[m>0&&jsxRuntime.jsx("br",{}),Zn(C,f,`p-${u}-${m}`)]},`p-line-${m}`))},`p-${u}`)):u+=1;}return s},[d,a,r,n,i,c]);return jsxRuntime.jsx(material.Box,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:l})};var o2=(e,t)=>jsxRuntime.jsx(Xn,{markdown:e,...t});var tu=({value:e,onChange:t,onSubmit:o,onVoiceInput:a,onClear:r,placeholder:n,statusText:i,loading:c=false,compact:d=false,showStatusText:l=true})=>jsxRuntime.jsxs(material.Stack,{spacing:.75,children:[jsxRuntime.jsxs(material.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:[jsxRuntime.jsx(vp__default.default,{sx:{fontSize:d?16:18,color:"text.secondary"}}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:e,onChange:s=>t(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),o());},placeholder:n,sx:{fontSize:d?"0.84rem":"0.9rem"}}),e&&r&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:r,children:jsxRuntime.jsx(Qh__default.default,{sx:{fontSize:d?16:18}})}),a&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:a,children:jsxRuntime.jsx(ny__default.default,{sx:{fontSize:d?16:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:o,disabled:c||!e.trim(),children:jsxRuntime.jsx(sy__default.default,{sx:{fontSize:d?16:18}})})]}),l&&i&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:i})]});var ou=(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:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e.slice(0,n),jsxRuntime.jsx(material.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)]})},gs=({section:e,highlightQuery:t=""})=>{let o=e.columns||2;return jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:e.title}),jsxRuntime.jsx(material.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 jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:ou(a.label,t)}),jsxRuntime.jsx(material.Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:r?ou(r,t):a.value})]},a.id)})})]})};var pc=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",hs=e=>e.trim().toLowerCase(),Nx=(e,t)=>{let o=[];return e.forEach(a=>{a.fields.forEach(r=>{let n=r.searchableText||pc(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:hs(`${a.title} ${r.label} ${n}`)});});}),t.forEach(a=>{(a.fields||[]).forEach(r=>{let n=r.searchableText||pc(r.value),i={source:"tab",sourceId:a.id,sourceTitle:a.label,fieldId:r.id,fieldLabel:r.label,fieldValue:n};o.push({hit:i,text:hs(`${a.label} ${r.label} ${n}`)});}),(a.sections||[]).forEach(r=>{r.fields.forEach(n=>{let i=n.searchableText||pc(n.value),c={source:"tab",sourceId:a.id,sourceSectionId:r.id,sourceTitle:`${a.label} / ${r.title}`,fieldId:n.id,fieldLabel:n.label,fieldValue:i};o.push({hit:c,text:hs(`${a.label} ${r.title} ${n.label} ${i}`)});});});}),o},au=({sections:e,tabs:t=[],defaultTabId:o,ai:a})=>{let{t:r}=Q(),[n,i]=ht.useState(""),[c,d]=ht.useState(o||t[0]?.id),[l,s]=ht.useState("idle"),[g,f]=ht.useState([]),[u,h]=ht.useState(""),[v,p]=ht.useState(""),[C,m]=ht.useState(false),y=ht.useMemo(()=>Nx(e,t),[e,t]);ht.useEffect(()=>{if(t.length===0){d(void 0);return}t.some(A=>A.id===c)||d(o||t[0]?.id);},[t,c,o]);let x=ht.useCallback(()=>{s("idle"),f([]),h(""),p("");},[]),S=ht.useCallback(w=>{i(w),w.trim()||(s("idle"),f([]),h(""),p(""));},[]),B=ht.useCallback(w=>{let A=hs(w);return A?y.filter(P=>P.text.includes(A)).map(P=>P.hit):[]},[y]),R=ht.useCallback(async()=>{let w=n.trim();if(!w)return;m(true);let A=B(w);if(f(A),A.length>0){s("search"),p(""),h(r("detail.searchAi.matches",{count:A.length})),m(false);return}if(a?.enabled!==false&&a?.onSubmit){s("ai"),h(r("detail.searchAi.autoAiFallback"));try{let k=await a.onSubmit(w,{query:w,hits:A,activeTabId:c,sections:e,tabs:t});p(typeof k=="string"?k:"");}finally{m(false);}return}s("search"),p(""),h(r("detail.searchAi.noMatch")),m(false);},[n,B,r,a,c,e,t]);return {query:n,setQuery:S,activeTabId:c,setActiveTabId:d,searchMode:l,hits:g,statusText:u,aiResponse:v,searching:C,handleSubmit:R,clearResult:x}};var E2=({title:e,subtitle:t,sections:o,tabs:a=[],defaultTabId:r,table:n,ai:i,rightHeaderSlot:c,searchBarWidth:d=460,onClose:l,closeLabel:s="Close"})=>{let{t:g}=Q(),{query:f,setQuery:u,activeTabId:h,setActiveTabId:v,searchMode:p,hits:C,statusText:m,aiResponse:y,searching:x,handleSubmit:S,clearResult:B}=au({sections:o,tabs:a,defaultTabId:r,ai:i}),R=ht.useMemo(()=>a.find(P=>P.id===h)||a[0],[a,h]),w=ht.useCallback(P=>{let k=D=>{let T=document.getElementById(P);if(T){T.scrollIntoView({behavior:"smooth",block:"center"});return}D<4&&setTimeout(()=>k(D+1),60);};requestAnimationFrame(()=>k(0));},[]),A=ht.useCallback((P,k)=>{if(a.some(D=>D.id===P)){v(P),w(k?`detail-tab-${P}-section-${k}`:`detail-tab-${P}`);return}w(`detail-section-${P}`);},[a,v,w]);return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:e}),t&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:t})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[jsxRuntime.jsx(material.Box,{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:jsxRuntime.jsx(tu,{value:f,onChange:u,onSubmit:S,onVoiceInput:i?.onVoiceInput,onClear:()=>{u(""),B();},placeholder:i?.placeholder||g("detail.searchAi.placeholder"),statusText:m,loading:x,compact:true,showStatusText:false})}),l&&jsxRuntime.jsx(material.Tooltip,{title:s,children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:l,children:jsxRuntime.jsx(Gx__default.default,{fontSize:"small"})})}),c]})]}),m&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:m}),p==="search"&&C.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:g("detail.searchAi.matches",{count:C.length})}),jsxRuntime.jsx(material.Stack,{spacing:.35,children:C.slice(0,8).map(P=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:()=>A(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:jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{fontSize:"0.84rem"},children:[jsxRuntime.jsx(material.Box,{component:"span",sx:{color:"text.secondary"},children:P.sourceTitle})," \xB7 ",jsxRuntime.jsx(material.Box,{component:"span",sx:{fontWeight:700},children:P.fieldLabel})," = ",jsxRuntime.jsx(material.Box,{component:"span",children:P.fieldValue||"-"})]})},`${P.source}|${P.sourceId}|${P.fieldId}`))})]}),p==="ai"&&y&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:g("detail.searchAi.aiResultTitle")}),jsxRuntime.jsx(material.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:jsxRuntime.jsx(Xn,{markdown:y})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(P=>jsxRuntime.jsx(material.Box,{id:`detail-section-${P.id}`,children:jsxRuntime.jsx(gs,{section:P,highlightQuery:f})},P.id))}),a.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsxRuntime.jsx(material.Tabs,{value:R?.id||false,onChange:(P,k)=>v(k),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:a.map(P=>jsxRuntime.jsx(material.Tab,{value:P.id,label:P.label,sx:{textTransform:"none"}},P.id))}),jsxRuntime.jsxs(material.Box,{sx:{p:1.5},children:[jsxRuntime.jsx(material.Box,{id:`detail-tab-${R?.id||""}`}),R?.description&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:R.description}),R?.content?R.content:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[(R?.sections||[]).map(P=>jsxRuntime.jsx(material.Box,{id:`detail-tab-${R?.id}-section-${P.id}`,children:jsxRuntime.jsx(gs,{section:P,highlightQuery:f})},P.id)),R?.fields&&R.fields.length>0&&jsxRuntime.jsx(gs,{section:{id:`${R.id}-fields`,title:R.label,fields:R.fields,columns:2},highlightQuery:f})]})]})]}),n&&jsxRuntime.jsx(La,{title:n.title||g("detail.table.title"),...n.tableProps,filterConfig:void 0,fitContainer:false})]})};var su=({bucket:e,cardCount:t,highlighted:o=false,children:a,emptyLabel:r,maxHeight:n,sx:i})=>{let{t:c}=Q();return jsxRuntime.jsx(material.Paper,{sx:[d=>{let l=e.accentColor??d.palette.primary.main;return {position:"relative",minWidth:0,borderRadius:4,overflow:"hidden",border:`1px solid ${styles.alpha(l,o?.58:d.palette.mode==="dark"?.28:.18)}`,bgcolor:styles.alpha(d.palette.background.paper,d.palette.mode==="dark"?.92:.97),boxShadow:o?`0 18px 40px ${styles.alpha(l,.22)}`:`0 10px 28px ${styles.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:jsxRuntime.jsxs(material.Stack,{spacing:1.2,sx:{p:1.5},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[e.icon,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.96rem",fontWeight:800},children:e.title})]}),e.description&&jsxRuntime.jsx(material.Typography,{sx:{mt:.45,fontSize:"0.76rem",color:"text.secondary",lineHeight:1.45},children:e.description})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.8,sx:{flexShrink:0},children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t,sx:{fontWeight:700}}),typeof e.limit=="number"&&jsxRuntime.jsx(material.Chip,{size:"small",label:`${c("kanban.bucket.limit")} ${e.limit}`,color:t>e.limit?"warning":"default",variant:"outlined"})]})]}),o&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700},children:c("kanban.bucket.dropHere")}),jsxRuntime.jsx(material.Box,{sx:{minHeight:220,maxHeight:n,overflowY:n?"auto":"visible",pr:n?.4:0},children:t>0?a:jsxRuntime.jsx(material.Box,{sx:d=>({minHeight:160,borderRadius:3,border:`1px dashed ${styles.alpha(d.palette.divider,.9)}`,bgcolor:d.palette.mode==="dark"?styles.alpha(d.palette.common.white,.02):styles.alpha(d.palette.primary.main,.03),display:"grid",placeItems:"center",px:2,textAlign:"center"}),children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:r??e.emptyLabel??c("kanban.empty")})})})]})})};var jx={success:"success",warning:"warning",info:"info",error:"error"},Zx={critical:"error",high:"warning",medium:"info",low:"success"},Xx=(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}},Qx=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",mc=({card:e,bucket:t,dragging:o=false,overlay:a=false,onClick:r,sx:n})=>{let{t:i}=Q(),c=!!(r&&t),d=e.tone??(e.priority?Zx[e.priority]:"default"),l=d==="default"?"primary":jx[d],s=t?{card:e,bucket:t}:void 0;return jsxRuntime.jsx(material.Paper,{onClick:c?()=>s&&r?.(s):void 0,onKeyDown:c?g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),s&&r?.(s));}:void 0,role:c?"button":void 0,tabIndex:c?0:void 0,sx:[g=>{let f=d==="default"?g.palette.primary.main:g.palette[l].main;return {position:"relative",overflow:"hidden",p:1.4,borderRadius:3,border:`1px solid ${styles.alpha(f,g.palette.mode==="dark"?.42:.2)}`,bgcolor:styles.alpha(g.palette.background.paper,g.palette.mode==="dark"?.96:.98),boxShadow:a?`0 20px 45px ${styles.alpha(g.palette.common.black,.24)}`:o?"none":`0 8px 24px ${styles.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:c?"pointer":"default",opacity:o?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:4,bgcolor:f},"&:hover":c?{transform:"translateY(-1px)",boxShadow:`0 14px 32px ${styles.alpha(g.palette.common.black,g.palette.mode==="dark"?.28:.12)}`}:void 0}},...Array.isArray(n)?n:n?[n]:[]],children:jsxRuntime.jsxs(material.Stack,{spacing:1.1,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[(e.kicker||t?.title)&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:.4,color:"text.secondary",textTransform:"uppercase"},children:e.kicker??t?.title}),jsxRuntime.jsx(material.Typography,{sx:{mt:.2,fontSize:"0.98rem",fontWeight:800,lineHeight:1.3},children:e.title})]}),e.priority&&jsxRuntime.jsx(material.Chip,{size:"small",color:l,label:Xx(e.priority,i),variant:d==="default"?"outlined":"filled",sx:{height:22,fontWeight:700}})]}),e.summary&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",color:"text.secondary",lineHeight:1.5},children:e.summary}),e.metrics&&e.metrics.length>0&&jsxRuntime.jsx(material.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=>jsxRuntime.jsxs(material.Box,{sx:f=>({borderRadius:2,px:1,py:.8,bgcolor:f.palette.mode==="dark"?styles.alpha(f.palette.common.white,.05):styles.alpha(f.palette.primary.main,.05)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",textTransform:"uppercase",letterSpacing:.35},children:g.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",fontWeight:700},children:g.value})]},g.id))}),typeof e.progress=="number"&&jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:i("kanban.card.progress")}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700},children:[Math.round(e.progress),"%"]})]}),jsxRuntime.jsx(material.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||c)&&jsxRuntime.jsxs(material.Stack,{spacing:.9,children:[e.tags&&e.tags.length>0&&jsxRuntime.jsx(material.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:e.tags.map(g=>jsxRuntime.jsx(material.Chip,{size:"small",label:g.label,color:g.color??"default",variant:"outlined"},g.id))}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8,minWidth:0},children:[e.assignee&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Avatar,{src:e.assignee.avatarSrc,sx:{width:28,height:28,fontSize:"0.75rem"},children:e.assignee.initials??Qx(e.assignee.name)}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700,lineHeight:1.2},noWrap:true,children:e.assignee.name}),e.dueDate&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},noWrap:true,children:e.dueDate})]})]}),!e.assignee&&e.dueDate&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",color:"text.secondary"},children:e.dueDate})]}),c&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700,whiteSpace:"nowrap"},children:i("kanban.card.openDetail")})]}),e.footer]})]})})};var Jx=(e,t)=>Number.isNaN(e)||e<0?0:e>t?t:e,du=({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}})}},No=(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}}},xs=(e,t)=>{let o=No(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(s=>({...s}))})),n=r[o.bucketIndex],[i]=n.cards.splice(o.cardIndex,1);if(!i)return e;let c=r[a],d=Jx(t.targetIndex??c.cards.length,c.cards.length);return c.cards.splice(d,0,{...i,bucketId:t.toBucketId}),{buckets:r.map(l=>({...l,cards:l.cards.map((s,g)=>({...s,bucketId:l.id,position:g}))}))}};var gc="kanban-card|",fc="kanban-bucket|",gu=e=>`${gc}${e}`,u0=e=>`${fc}${e}`,vs=e=>e?.startsWith(gc)?e.slice(gc.length):void 0,mu=e=>e?.startsWith(fc)?e.slice(fc.length):void 0,m0=({card:e,bucket:t,onCardClick:o})=>{let{setNodeRef:a,attributes:r,listeners:n,transform:i,transition:c,isDragging:d}=sortable.useSortable({id:gu(e.id)}),l={transform:i?`translate3d(${i.x}px, ${i.y}px, 0)`:void 0,transition:c,zIndex:d?2:1,touchAction:"none",cursor:d?"grabbing":"grab"};return jsxRuntime.jsx(material.Box,{ref:a,style:l,...r,...n,children:jsxRuntime.jsx(mc,{card:e,bucket:t,dragging:d,onClick:o})})},g0=({bucket:e,highlighted:t,bucketMaxHeight:o,emptyBucketLabel:a,onCardClick:r})=>{let{isOver:n,setNodeRef:i}=core.useDroppable({id:u0(e.id)});return jsxRuntime.jsx(material.Box,{ref:i,sx:{minWidth:0},children:jsxRuntime.jsx(su,{bucket:e,cardCount:e.cards.length,highlighted:t||n,emptyLabel:a,maxHeight:o,children:jsxRuntime.jsx(sortable.SortableContext,{items:e.cards.map(c=>gu(c.id)),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:1,children:e.cards.map(c=>jsxRuntime.jsx(m0,{card:c,bucket:e,onCardClick:r},c.id))})})})})},eA=({model:e,onCardMove:t,onCardClick:o,minBucketWidth:a=320,bucketMaxHeight:r,emptyBucketLabel:n,sx:i})=>{let[c,d]=ht.useState(null),[l,s]=ht.useState(),g=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),f=ht.useMemo(()=>c?No(e,c):void 0,[c,e]),u=ht.useCallback(()=>{d(null),s(void 0);},[]),h=ht.useCallback(m=>{if(!m)return;let y=vs(m);return y?No(e,y)?.bucket.id:mu(m)},[e]),v=ht.useCallback(m=>{d(vs(String(m.active.id))??null);},[]),p=ht.useCallback(m=>{s(h(m.over?String(m.over.id):void 0));},[h]),C=ht.useCallback(m=>{let y=vs(String(m.active.id)),x=m.over?String(m.over.id):void 0;if(!y||!x){u();return}let S=No(e,y);if(!S){u();return}let B=S.bucket.id,R=S.cardIndex,w=vs(x);if(w){let k=No(e,w);if(!k){u();return}B=k.bucket.id,R=k.cardIndex;}else {let k=mu(x),D=e.buckets.find(T=>T.id===k);if(!k||!D){u();return}B=k,R=D.cards.length;}if(S.bucket.id===B&&S.cardIndex===R){u();return}let A=xs(e,{cardId:y,fromBucketId:S.bucket.id,toBucketId:B,targetIndex:R}),P=No(A,y);P&&!(P.bucket.id===S.bucket.id&&P.cardIndex===S.cardIndex)&&t?.({cardId:y,fromBucketId:S.bucket.id,toBucketId:P.bucket.id,targetIndex:P.cardIndex,card:P.card,model:A}),u();},[e,t,u]);return jsxRuntime.jsxs(core.DndContext,{sensors:g,collisionDetection:core.closestCorners,onDragStart:v,onDragOver:p,onDragEnd:C,onDragCancel:u,children:[jsxRuntime.jsx(material.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=>jsxRuntime.jsx(g0,{bucket:m,highlighted:m.id===l,bucketMaxHeight:r,emptyBucketLabel:n,onCardClick:o},m.id))}),jsxRuntime.jsx(core.DragOverlay,{children:f?jsxRuntime.jsx(material.Box,{sx:{width:Math.max(a-24,260)},children:jsxRuntime.jsx(mc,{card:f.card,bucket:f.bucket,overlay:true})}):null})]})};var b0=({initialModel:e,initialBuckets:t,initialCards:o})=>e||du({buckets:t??[],cards:o??[]}),nA=e=>{let{onCardMove:t,onCardClick:o}=e,[a,r]=ht.useState(()=>b0(e)),n=ht.useCallback(s=>{r(g=>typeof s=="function"?s(g):s);},[]),i=ht.useCallback(s=>No(a,s),[a]),c=ht.useCallback((s,g,f)=>{let u=No(a,s);if(!u)return;let h=xs(a,{cardId:s,fromBucketId:u.bucket.id,toBucketId:g,targetIndex:f}),v=No(h,s);if(!v||v.bucket.id===u.bucket.id&&v.cardIndex===u.cardIndex)return;r(h);let p={cardId:s,fromBucketId:u.bucket.id,toBucketId:v.bucket.id,targetIndex:v.cardIndex,card:v.card,model:h};return t?.(p),p},[a,t]),d=ht.useCallback((s,g)=>{r(f=>({buckets:f.buckets.map(u=>({...u,cards:u.cards.map(h=>h.id!==s?h:typeof g=="function"?g(h):{...h,...g})}))}));},[]),l=ht.useMemo(()=>({model:a,onCardMove:s=>{c(s.cardId,s.toBucketId,s.targetIndex);},onCardClick:o}),[a,c,o]);return {model:a,actions:{replaceModel:n,moveCard:c,updateCard:d,getCard:i},boardProps:l}};var bu=64,E0="#E9EDF2",F0="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",L0=["en","zh","fr","de","ja","ko"],xu={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},ws=({appTitle:e,logo:t,mode:o="dark",onToggleMode:a,locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,searchPlaceholder:d,onSearch:l,user:s,onUserSetting:g,onUserLogout:f,userMenuItems:u,leftSlot:h,rightSlot:v})=>{let{t:p,locale:C}=Q(),y=material.useTheme().palette.mode==="dark",[x,S]=ht.useState(""),[B,R]=ht.useState(null),[w,A]=ht.useState(null),P=ee=>{ee.preventDefault(),l&&l(x.trim());},k=o==="system"?jsxRuntime.jsx(R0__default.default,{fontSize:"small"}):o==="dark"?jsxRuntime.jsx(D0__default.default,{fontSize:"small"}):jsxRuntime.jsx(M0__default.default,{fontSize:"small"}),D=p(o==="system"?"header.theme.system":o==="dark"?"header.theme.dark":"header.theme.light"),T=r||C,I=i&&i.length>0?i:L0,M=n||xu[T]||T.toUpperCase(),H=!!B,V=d||p("header.searchPlaceholder"),J=!!w,ce=[{key:"setting",label:p("header.menu.setting"),icon:jsxRuntime.jsx(ab__default.default,{sx:{fontSize:18}}),onClick:g},{key:"logout",label:p("header.menu.logout"),icon:jsxRuntime.jsx(B0__default.default,{sx:{fontSize:18}}),onClick:f}],te=u&&u.length>0?u:ce,ne=ee=>{A(null),ee?.();};return jsxRuntime.jsxs(material.AppBar,{position:"sticky",elevation:0,sx:ee=>({top:0,zIndex:ee.zIndex.drawer+10,height:bu,backgroundColor:ee.palette.mode==="dark"?"#0D0D0D":E0,backgroundImage:ee.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%)",F0,"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:ee.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)"}),children:[jsxRuntime.jsxs(material.Toolbar,{sx:{minHeight:`${bu}px !important`,px:2,gap:2},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[h,t===null?null:t||jsxRuntime.jsx(material.Box,{component:"img",src:"/orbcafe.png",alt:"ORBCAFE Logo",sx:{width:44,height:44,display:"block",objectFit:"contain",flexShrink:0}}),e&&jsxRuntime.jsx(material.Typography,{variant:"h6",sx:{fontWeight:700,color:y?"common.white":"#111827"},children:e})]}),jsxRuntime.jsx(material.Box,{sx:{flex:1,display:"flex",justifyContent:"center",minWidth:0},children:jsxRuntime.jsx(material.Box,{component:"form",onSubmit:P,sx:{width:"100%",maxWidth:540},children:jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:x,onChange:ee=>S(ee.target.value),placeholder:V,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(vp__default.default,{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"}}})})}),jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,children:[c?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:ee=>R(ee.currentTarget),sx:{color:y?"common.white":"#111827",borderRadius:1,px:.5},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.45,children:[jsxRuntime.jsx(yu__default.default,{sx:{fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{fontWeight:500},children:M})]})}),jsxRuntime.jsx(material.Menu,{anchorEl:B,open:H,onClose:()=>R(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:I.map(ee=>jsxRuntime.jsx(material.MenuItem,{selected:ee===T,onClick:()=>{c(ee),R(null);},sx:{fontSize:"0.82rem"},children:xu[ee]},ee))})]}):jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsxRuntime.jsx(yu__default.default,{sx:{color:y?"common.white":"#111827",fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{color:y?"common.white":"#111827",fontWeight:500},children:M})]}),jsxRuntime.jsx(material.IconButton,{size:"small",sx:{color:y?"common.white":"#111827"},onClick:a,title:D,children:k}),s&&jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1,children:[jsxRuntime.jsxs(material.Box,{sx:{textAlign:"right",minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{color:y?"common.white":"#111827",fontWeight:700,lineHeight:1.15},children:s.name}),s.subtitle&&jsxRuntime.jsx(material.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:s.subtitle,children:s.subtitle})]}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:ee=>A(ee.currentTarget),sx:{p:0},children:jsxRuntime.jsx(material.Avatar,{src:s.avatarSrc,imgProps:{style:{objectFit:"cover"}},sx:{width:34,height:34,bgcolor:"grey.100",color:"grey.700",fontSize:"0.85rem"},children:s.avatarText||s.name.slice(0,1).toUpperCase()})})]}),v]})]}),s&&jsxRuntime.jsx(material.Menu,{anchorEl:w,open:J,onClose:()=>A(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:te.map(ee=>jsxRuntime.jsxs(material.MenuItem,{disabled:ee.disabled,onClick:()=>ne(ee.onClick),children:[ee.icon&&jsxRuntime.jsx(material.ListItemIcon,{children:ee.icon}),jsxRuntime.jsx(material.ListItemText,{primary:ee.label,slotProps:{primary:{sx:{fontSize:"0.86rem",fontWeight:500}}}})]},ee.key))})]})};var vu=({menuData:e=[],initialNavigationCollapsed:t=false}={})=>{let{navigationIslandProps:o}=wd({initialCollapsed:t,content:e}),[a,r]=ht.useState(900);ht.useEffect(()=>{let i=()=>r(window.innerHeight);return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);let n=ht.useMemo(()=>Math.max(280,a-100),[a]);return {navigationIslandProps:o,navigationMaxHeight:n}};var DA=({appTitle:e,menuData:t=[],children:o,showNavigation:a=true,locale:r="en",localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:l,onUserLogout:s,userMenuItems:g,logo:f,onSearch:u,rightHeaderSlot:h,leftHeaderSlot:v,contentSx:p})=>{let C="orbcafe:page-layout-mode",[m,y]=ht.useState("system"),[x,S]=ht.useState("light"),[B,R]=ht.useState(false),w=m==="system"?B?x:"light":m;ht.useEffect(()=>{try{let I=window.localStorage.getItem(C);(I==="light"||I==="dark"||I==="system")&&y(I);}catch{}R(true);let D=window.matchMedia("(prefers-color-scheme: dark)"),T=()=>{S(D.matches?"dark":"light");};return T(),D.addEventListener("change",T),()=>D.removeEventListener("change",T)},[]),ht.useEffect(()=>{if(B)try{window.localStorage.setItem(C,m);}catch{}},[B,m]),ht.useEffect(()=>{w==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[w]);let A=ht.useMemo(()=>material.createTheme({palette:{mode:w}}),[w]),{navigationIslandProps:P,navigationMaxHeight:k}=vu({menuData:t,initialNavigationCollapsed:false});return jsxRuntime.jsx(material.ThemeProvider,{theme:A,children:jsxRuntime.jsx(Si,{locale:r,children:jsxRuntime.jsxs(material.Box,{sx:D=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:D.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":D.palette.background.default}),children:[jsxRuntime.jsx(ws,{appTitle:e,logo:f,mode:m,onToggleMode:()=>y(D=>D==="system"?"dark":D==="dark"?"light":"system"),locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:l,onUserLogout:s,userMenuItems:g,onSearch:u,leftSlot:v,rightSlot:h}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,display:"flex"},children:[a&&jsxRuntime.jsx(material.Box,{sx:{p:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsxRuntime.jsx(kd,{...P,maxHeight:k,colorMode:w})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...p},children:o})]})]})})})};var Is="(blank)",ku="Result",Su="Grand Total",wu={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Tu=["sum","count","avg","min","max"];var Iu=["palette","rows","columns","filters","values"];var Pu=e=>Iu.includes(e),Ru=e=>e==="rows"||e==="columns"||e==="filters",Ps=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&Pu(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&Pu(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},ga=e=>e==null||e===""?Is:e instanceof Date?e.toISOString().slice(0,10):String(e),hr=e=>JSON.stringify(e),Du=(e,t)=>{let o=e.join(""),a=t.join("");return o.localeCompare(a,void 0,{sensitivity:"base"})},G0=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},on=(e,t,o)=>{if(o==="count")return e.length;let a=e.map(r=>G0(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)},St=(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},fa=(e,t)=>e.length!==t.length?false:e.every((o,a)=>o===t[a]),Mu=(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 fa(n,i)})},Rs=(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}),vc=e=>!e?.aggregations||e.aggregations.length===0?Tu:e.aggregations,qt=(e,t)=>{let o=vc(t);return e&&o.includes(e)?e:t?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},ai=(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 Eu=({options:e,selectedValues:t,onChange:o,minWidth:a=96})=>{let{t:r}=Q(),[n,i]=ht.useState(""),c=ht.useMemo(()=>{let l=n.trim().toLowerCase();return l?e.filter(s=>s.toLowerCase().includes(l)):e},[e,n]),d=e.length>0&&t.length===e.length;return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:a},children:jsxRuntime.jsxs(material.Select,{multiple:true,value:t,onChange:l=>{let s=l.target.value,g=typeof s=="string"?s.split(","):s;o(g);},onClick:l=>l.stopPropagation(),onMouseDown:l=>l.stopPropagation(),renderValue:l=>{let s=l;return e.length===0?r("pivot.filter.na"):s.length===0?r("common.none"):s.length===e.length?r("common.all"):`${s.length}/${e.length}`},MenuProps:{PaperProps:{sx:{maxHeight:320,bgcolor:"background.paper"}}},sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:[jsxRuntime.jsx(material.ListSubheader,{disableSticky:true,sx:l=>({bgcolor:"background.paper",py:.8,lineHeight:"normal",borderBottom:`1px solid ${l.palette.divider}`}),children:jsxRuntime.jsx(material.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}}})}),jsxRuntime.jsx(material.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:jsxRuntime.jsx(material.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:r(d?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),c.length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,sx:{fontSize:"0.75rem"},children:r("pivot.filter.noResults")}),c.map(l=>{let s=t.includes(l);return jsxRuntime.jsxs(material.MenuItem,{value:l,sx:{fontSize:"0.75rem",py:.25},children:[jsxRuntime.jsx(material.Checkbox,{size:"small",checked:s,sx:{p:.5,mr:.5}}),jsxRuntime.jsx(material.ListItemText,{primary:l,primaryTypographyProps:{sx:{fontSize:"0.75rem",lineHeight:1.2}}})]},l)})]})})};var kc=({label:e,subtitle:t,isDragging:o,dragRef:a,listeners:r,attributes:n,style:i})=>jsxRuntime.jsx(material.Paper,{ref:a,...r,...n,sx:c=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:c.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none"}),style:{...i,opacity:o?.3:1,cursor:o?"grabbing":"grab"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsxRuntime.jsx(material.Box,{sx:c=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.3,borderRadius:1,bgcolor:c.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)"}),children:jsxRuntime.jsx(tv__default.default,{sx:{fontSize:16,color:"text.secondary"}})}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary",lineHeight:1.2},children:t})]})]})}),zu=({id:e,label:t,subtitle:o})=>{let{setNodeRef:a,listeners:r,attributes:n,isDragging:i}=core.useDraggable({id:e});return jsxRuntime.jsx(kc,{label:t,subtitle:o,isDragging:i,dragRef:a,listeners:r,attributes:n})};var nn=({zone:e,title:t,hint:o,icon:a,children:r,itemCount:n,onClear:i})=>{let c=`container|${e}`,{isOver:d,setNodeRef:l}=core.useDroppable({id:c}),{t:s}=Q();return jsxRuntime.jsxs(material.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:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[a,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.79rem",fontWeight:800,letterSpacing:.2},children:t}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:["(",n,")"]})]}),n>0&&i&&jsxRuntime.jsx(material.Tooltip,{title:s("pivot.clearArea"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:i,sx:{p:.25},children:jsxRuntime.jsx(iv__default.default,{sx:{fontSize:16}})})})]}),jsxRuntime.jsx(material.Typography,{sx:{mt:.5,mb:.9,fontSize:"0.7rem",color:"text.secondary"},children:o}),jsxRuntime.jsx(material.Box,{sx:{flex:1},children:r})]})};var Vu={xs:1.2,md:1.6},ln=({title:e,subtitle:t,collapsed:o,onToggleCollapse:a,expandAriaLabel:r,collapseAriaLabel:n,children:i,bodySx:c,unmountOnExit:d=false,headerActions:l})=>jsxRuntime.jsxs(material.Paper,{sx:s=>({borderRadius:3,border:`1px solid ${s.palette.divider}`,overflow:"hidden",bgcolor:styles.alpha(s.palette.background.paper,.95)}),children:[jsxRuntime.jsxs(material.Box,{sx:s=>({px:Vu,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,borderBottom:o?"none":`1px solid ${s.palette.divider}`}),children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.9rem",fontWeight:800},children:e}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[l,jsxRuntime.jsx(material.IconButton,{size:"small","aria-label":o?r:n,onClick:a,sx:s=>({border:`1px solid ${s.palette.divider}`,bgcolor:styles.alpha(s.palette.background.paper,.88),width:28,height:28,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:s.palette.mode==="dark"?styles.alpha(s.palette.primary.main,.18):styles.alpha(s.palette.primary.main,.08)}}),children:jsxRuntime.jsx(rb__default.default,{sx:{fontSize:16,transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:o?"rotate(180deg)":"rotate(0deg)"}})})]})]}),jsxRuntime.jsx(material.Collapse,{in:!o,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:jsxRuntime.jsx(material.Box,{sx:[{px:Vu,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:i})})]});var Es=({label:e,caption:t,onRemove:o,trailing:a,isDragging:r,dragRef:n,listeners:i,attributes:c,style:d})=>jsxRuntime.jsx(material.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:r?0:1}),children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsxRuntime.jsx(material.Box,{...c,...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:jsxRuntime.jsx(tv__default.default,{sx:{fontSize:15,color:"text.secondary"}})}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.8rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},children:t})]}),a,o&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:l=>{l.stopPropagation(),o();},sx:{p:.2},children:jsxRuntime.jsx(Qh__default.default,{sx:{fontSize:16}})})]})}),ri=({id:e,label:t,caption:o,onRemove:a,trailing:r})=>{let{setNodeRef:n,attributes:i,listeners:c,transform:d,transition:l,isDragging:s}=sortable.useSortable({id:e}),g={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:l,zIndex:s?999:"auto"};return jsxRuntime.jsx(Es,{label:t,caption:o,onRemove:a,trailing:r,isDragging:s,dragRef:n,listeners:c,attributes:i,style:g})};var zs={rows:jsxRuntime.jsx(vv__default.default,{fontSize:"small"}),columns:jsxRuntime.jsx(zf__default.default,{fontSize:"small"}),filters:jsxRuntime.jsx(xv__default.default,{fontSize:"small"}),values:jsxRuntime.jsx(Wf__default.default,{fontSize:"small"})},$u=({isConfiguratorCollapsed:e,onToggleCollapse:t,availableFields:o,fieldMap:a,filterFields:r,columnFields:n,rowFields:i,valueFields:c,clearZone:d,removeFieldFromZone:l,getFilterSelectionSummary:s,renderDimensionFilterSelect:g,renderAggregationSelect:f,getAggregationLabel:u})=>{let{t:h}=Q(),v=[`${h("pivot.zone.rows")} ${i.length}`,`${h("pivot.zone.columns")} ${n.length}`,`${h("pivot.zone.filters")} ${r.length}`,`${h("pivot.zone.values")} ${c.length}`].join(" \xB7 ");return jsxRuntime.jsx(ln,{title:h("pivot.config.title"),subtitle:v,collapsed:e,onToggleCollapse:t,expandAriaLabel:h("pivot.collapse.ariaExpand"),collapseAriaLabel:h("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[jsxRuntime.jsx(nn,{zone:"palette",title:h("pivot.fieldList"),hint:h("pivot.availableDimensions"),itemCount:o.length,icon:jsxRuntime.jsx(tv__default.default,{sx:{fontSize:16,color:"text.secondary"}}),children:jsxRuntime.jsxs(material.Stack,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[o.length===0&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",py:1},children:h("pivot.allFieldsInUse")}),o.map(p=>jsxRuntime.jsx(zu,{id:`item|palette|${p.id}`,label:p.label,subtitle:p.type??"string"},p.id))]})}),jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(nn,{zone:"filters",title:h("pivot.zone.filters"),hint:h("pivot.hint.filters"),icon:zs.filters,itemCount:r.length,onClear:()=>d("filters"),children:jsxRuntime.jsx(sortable.SortableContext,{items:r.map(p=>`item|filters|${p}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:r.map(p=>jsxRuntime.jsx(ri,{id:`item|filters|${p}`,label:a.get(p)?.label??p,caption:s(p),trailing:g(p),onRemove:()=>l("filters",p)},p))})})}),jsxRuntime.jsx(nn,{zone:"columns",title:h("pivot.zone.columns"),hint:h("pivot.hint.columns"),icon:zs.columns,itemCount:n.length,onClear:()=>d("columns"),children:jsxRuntime.jsx(sortable.SortableContext,{items:n.map(p=>`item|columns|${p}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:n.map(p=>jsxRuntime.jsx(ri,{id:`item|columns|${p}`,label:a.get(p)?.label??p,caption:`${a.get(p)?.type??"dimension"} \u2022 ${s(p)}`,trailing:g(p),onRemove:()=>l("columns",p)},p))})})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(nn,{zone:"rows",title:h("pivot.zone.rows"),hint:h("pivot.hint.rows"),icon:zs.rows,itemCount:i.length,onClear:()=>d("rows"),children:jsxRuntime.jsx(sortable.SortableContext,{items:i.map(p=>`item|rows|${p}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:i.map(p=>jsxRuntime.jsx(ri,{id:`item|rows|${p}`,label:a.get(p)?.label??p,caption:`${a.get(p)?.type??"dimension"} \u2022 ${s(p)}`,trailing:g(p),onRemove:()=>l("rows",p)},p))})})}),jsxRuntime.jsx(nn,{zone:"values",title:h("pivot.zone.values"),hint:h("pivot.hint.values"),icon:zs.values,itemCount:c.length,onClear:()=>d("values"),children:jsxRuntime.jsx(sortable.SortableContext,{items:c.map(p=>`item|values|${p.tokenId}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:c.map(p=>{let C=a.get(p.fieldId)?.label??p.fieldId,m=`${u(p.aggregation)}(${C})`;return jsxRuntime.jsx(ri,{id:`item|values|${p.tokenId}`,label:C,caption:m,trailing:f(p),onRemove:()=>l("values",p.tokenId)},p.tokenId)})})})})]})]})]})})};var Hu=e=>e.toLocaleString(void 0,{maximumFractionDigits:1}),Gu=({data:e,primaryLabel:t,secondaryLabel:o,formatPrimaryValue:a,formatSecondaryValue:r})=>{let n=styles.useTheme();if(e.length===0)return null;let i=720,c=250,d={top:20,right:24,bottom:40,left:52},l=o?e.map(p=>p.primaryValue):e.map((p,C)=>C+1),s=o?e.map(p=>p.secondaryValue??0):e.map(p=>p.primaryValue),g=Math.max(...l,1),f=Math.max(...s,1),u=i-d.left-d.right,h=c-d.top-d.bottom,v=e.map((p,C)=>{let m=o?p.primaryValue:C+1,y=o?p.secondaryValue??0:p.primaryValue,x=d.left+m/g*u,S=c-d.bottom-y/f*h;return {...p,x,y:S,rawX:m,rawY:y}});return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${i} ${c}`,sx:{width:"100%",minWidth:i,height:c},children:[jsxRuntime.jsx("line",{x1:d.left,y1:c-d.bottom,x2:i-d.right,y2:c-d.bottom,stroke:styles.alpha(n.palette.text.secondary,.35)}),jsxRuntime.jsx("line",{x1:d.left,y1:d.top,x2:d.left,y2:c-d.bottom,stroke:styles.alpha(n.palette.text.secondary,.35)}),v.map(p=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:p.x,cy:p.y,r:7,fill:styles.alpha(n.palette.primary.main,.18)}),jsxRuntime.jsx("circle",{cx:p.x,cy:p.y,r:4.5,fill:n.palette.primary.main,children:jsxRuntime.jsxs("title",{children:[p.name,`
195
+ `,o?`${t}: ${a(p.primaryValue)}`:`${t}: ${a(p.primaryValue)}`,o?`
196
+ ${o}: ${(r??a)(p.secondaryValue??0)}`:""]})}),jsxRuntime.jsx("text",{x:p.x,y:Math.max(p.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:n.palette.text.secondary,children:p.name})]},p.name)),jsxRuntime.jsx("text",{x:i/2,y:c-10,textAnchor:"middle",fontSize:"11",fill:n.palette.text.secondary,children:o?t:"Index"}),jsxRuntime.jsx("text",{x:16,y:c/2,textAnchor:"middle",transform:`rotate(-90 16 ${c/2})`,fontSize:"11",fill:n.palette.text.secondary,children:o??t}),jsxRuntime.jsx("text",{x:d.left,y:d.top-4,fontSize:"10",fill:n.palette.text.secondary,children:Hu(f)}),jsxRuntime.jsx("text",{x:i-d.right,y:c-d.bottom+16,textAnchor:"end",fontSize:"10",fill:n.palette.text.secondary,children:Hu(g)})]})}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(3, minmax(0, 1fr))"},gap:1},children:e.map(p=>jsxRuntime.jsxs(material.Box,{sx:C=>({borderRadius:2,px:1.25,py:1,border:`1px solid ${styles.alpha(C.palette.divider,.7)}`,bgcolor:styles.alpha(C.palette.background.default,.35)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:p.name,children:p.name}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[t,": ",a(p.primaryValue)]}),o&&jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[o,": ",(r??a)(p.secondaryValue??0)]})]},p.name))})]})};var Rc=e=>Math.max(...e,1),Ku=({data:e,chartType:t,primaryLabel:o,secondaryLabel:a,formatPrimaryValue:r,formatSecondaryValue:n})=>{let i=styles.useTheme(),c=i.palette.primary.main,d=i.palette.warning.main;if(e.length===0)return null;if(t==="bar-horizontal"){let m=Rc(e.flatMap(y=>[y.primaryValue,y.secondaryValue??0]));return jsxRuntime.jsx(material.Stack,{spacing:1.1,children:e.map(y=>jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:y.name,children:y.name}),jsxRuntime.jsxs(material.Stack,{spacing:.65,children:[jsxRuntime.jsx(material.Box,{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:styles.alpha(i.palette.action.active,.08)},children:jsxRuntime.jsx(material.Box,{sx:{width:`${y.primaryValue/m*100}%`,height:"100%",bgcolor:c}})}),a&&jsxRuntime.jsx(material.Box,{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:styles.alpha(i.palette.action.active,.08)},children:jsxRuntime.jsx(material.Box,{sx:{width:`${(y.secondaryValue??0)/m*100}%`,height:"100%",bgcolor:d}})})]}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700},children:r(y.primaryValue)}),a&&jsxRuntime.jsx(material.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=Rc(e.flatMap(x=>[x.primaryValue,x.secondaryValue??0])),y=a?92:76;return jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto",pb:.5},children:jsxRuntime.jsx(material.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(x=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsxs(material.Box,{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[jsxRuntime.jsx(material.Box,{sx:{width:a?16:26,minHeight:8,height:`${Math.max(x.primaryValue/m*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:c},title:`${o}: ${r(x.primaryValue)}`}),a&&jsxRuntime.jsx(material.Box,{sx:{width:16,minHeight:8,height:`${Math.max((x.secondaryValue??0)/m*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${a}: ${(n??r)(x.secondaryValue??0)}`})]}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:x.name,children:x.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:r(x.primaryValue),children:r(x.primaryValue)}),a&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:(n??r)(x.secondaryValue??0),children:(n??r)(x.secondaryValue??0)})]},x.name))})})}let l=Math.max(680,e.length*74),s=240,g={top:20,right:18,bottom:36,left:18},f=Rc(e.flatMap(m=>[m.primaryValue,m.secondaryValue??0])),u=l-g.left-g.right,h=s-g.top-g.bottom,v=m=>e.map((y,x)=>{let S=g.left+x*u/Math.max(e.length-1,1),B=s-g.bottom-m(y)/f*h;return {x:S,y:B,item:y}}),p=v(m=>m.primaryValue),C=a?v(m=>m.secondaryValue??0):[];return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${l} ${s}`,sx:{width:"100%",minWidth:l,height:s},children:[jsxRuntime.jsx("line",{x1:g.left,y1:s-g.bottom,x2:l-g.right,y2:s-g.bottom,stroke:styles.alpha(i.palette.text.secondary,.35)}),jsxRuntime.jsx("polyline",{fill:"none",stroke:c,strokeWidth:3,points:p.map(m=>`${m.x},${m.y}`).join(" ")}),p.map(m=>jsxRuntime.jsx("circle",{cx:m.x,cy:m.y,r:4,fill:c,children:jsxRuntime.jsxs("title",{children:[m.item.name,`
197
+ `,o,": ",r(m.item.primaryValue)]})},`primary-${m.item.name}`)),a&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:C.map(m=>`${m.x},${m.y}`).join(" ")}),C.map(m=>jsxRuntime.jsx("circle",{cx:m.x,cy:m.y,r:3.5,fill:d,children:jsxRuntime.jsxs("title",{children:[m.item.name,`
198
+ `,a,": ",(n??r)(m.item.secondaryValue??0)]})},`secondary-${m.item.name}`))]})]})}),jsxRuntime.jsx(material.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=>jsxRuntime.jsxs(material.Box,{sx:y=>({borderRadius:2,px:1.1,py:.9,border:`1px solid ${styles.alpha(y.palette.divider,.7)}`,bgcolor:styles.alpha(y.palette.background.default,.35)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:m.name,children:m.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:r(m.primaryValue)}),a&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:(n??r)(m.secondaryValue??0)})]},m.name))})]})};var qu=(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},_u=(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}}),ju=({rows:e,dimensionFieldId:t,primaryValue:o,secondaryValue:a})=>{if(!t)return [];let r=new Map;return e.forEach(n=>{let i=ga(n[t]),c=r.get(i);if(c){c.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:on(i,o.fieldId,o.aggregation),secondaryValue:a?on(i,a.fieldId,a.aggregation):void 0}))};var Zu=({rows:e,fieldMap:t,rowFields:o,columnFields:a,valueFields:r,chartDimensionFieldId:n,chartPrimaryValueFieldId:i,chartSecondaryValueFieldId:c,chartType:d,isCollapsed:l,onChartDimensionFieldIdChange:s,onChartPrimaryValueFieldIdChange:g,onChartSecondaryValueFieldIdChange:f,onChartTypeChange:u,onToggleCollapse:h,getAggregationLabel:v})=>{let{t:p}=Q(),C=ht.useMemo(()=>qu(o,a,t),[a,t,o]),m=ht.useMemo(()=>_u(r,t,v),[t,v,r]),y=m.find(k=>k.fieldId===i)??m[0],x=m.find(k=>k.fieldId===c&&k.fieldId!==y?.fieldId)??null,S=C.find(k=>k.fieldId===n)??C[0],B=S&&y?p("pivot.chart.subtitleReady",{dimension:S.label,measure:x?`${y.label} / ${x.label}`:y.label}):p("pivot.chart.subtitle"),R=ht.useMemo(()=>!S||!y?[]:ju({rows:e,dimensionFieldId:S.fieldId,primaryValue:y.item,secondaryValue:x?.item}),[y,e,x,S]),w=k=>y?ai(k,y.item,t):k.toLocaleString(),A=k=>x?ai(k,x.item,t):k.toLocaleString(),P=C.length>1||m.length>1;return jsxRuntime.jsxs(ln,{title:p("pivot.chart.title"),subtitle:B,collapsed:l,onToggleCollapse:h,expandAriaLabel:p("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:p("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[P&&jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.dimension")}),jsxRuntime.jsx(material.Select,{value:S?.fieldId??"",onChange:k=>s(String(k.target.value)),sx:{fontSize:"0.75rem",height:32},children:C.map(k=>jsxRuntime.jsx(material.MenuItem,{value:k.fieldId,sx:{fontSize:"0.75rem"},children:k.label},k.fieldId))})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.primaryMeasure")}),jsxRuntime.jsx(material.Select,{value:y?.fieldId??"",onChange:k=>g(String(k.target.value)),sx:{fontSize:"0.75rem",height:32},children:m.map(k=>jsxRuntime.jsx(material.MenuItem,{value:k.fieldId,sx:{fontSize:"0.75rem"},children:k.label},k.fieldId))})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.secondaryMeasure")}),jsxRuntime.jsxs(material.Select,{value:x?.fieldId??"",onChange:k=>f(String(k.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:p("common.none")}),m.filter(k=>k.fieldId!==y?.fieldId).map(k=>jsxRuntime.jsx(material.MenuItem,{value:k.fieldId,sx:{fontSize:"0.75rem"},children:k.label},k.fieldId))]})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.chartType")}),jsxRuntime.jsxs(material.Select,{value:d,onChange:k=>u(k.target.value),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.barVertical")}),jsxRuntime.jsx(material.MenuItem,{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.barHorizontal")}),jsxRuntime.jsx(material.MenuItem,{value:"line",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.line")}),jsxRuntime.jsx(material.MenuItem,{value:"scatter",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.scatter")})]})]})]}),jsxRuntime.jsx(material.Box,{children:S?y?R.length===0?jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:p("pivot.chart.emptyNoData")})}):d==="scatter"?jsxRuntime.jsx(Gu,{data:R,primaryLabel:y.label,secondaryLabel:x?.label,formatPrimaryValue:w,formatSecondaryValue:A}):jsxRuntime.jsx(Ku,{data:R,chartType:d,primaryLabel:y.label,secondaryLabel:x?.label,formatPrimaryValue:w,formatSecondaryValue:A}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:p("pivot.chart.emptyNoValue")})}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:p("pivot.chart.emptyNoDimension")})})})]})};var Os=({node:e,dataColumns:t,fieldMap:o,level:a,expandedKeys:r,onToggle:n,getValue:i})=>{let c=r.has(e.key),d=e.children.length>0,l=e.isGrandTotal;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(material.TableRow,{sx:s=>({bgcolor:l?s.palette.mode==="dark"?"rgba(25, 118, 210, 0.22)":"rgba(47, 91, 255, 0.08)":s.palette.mode==="dark"?"#111111":"background.paper","&:hover":{bgcolor:l?s.palette.mode==="dark"?"rgba(25, 118, 210, 0.28)":"rgba(47, 91, 255, 0.12)":s.palette.mode==="dark"?"#181818":"rgba(0, 0, 0, 0.02)"}}),children:[jsxRuntime.jsxs(material.TableCell,{sx:s=>({fontSize:"0.76rem",fontWeight:l?800:600,borderBottom:`1px solid ${s.palette.divider}`,whiteSpace:"nowrap",pl:a*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!l&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>n(e.key),sx:{p:.2,mr:.5,ml:-1},children:c?jsxRuntime.jsx(ch__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(qf__default.default,{sx:{fontSize:16}})}),!d&&!l&&a>0&&jsxRuntime.jsx(material.Box,{sx:{width:20}}),e.value]}),t.map(s=>jsxRuntime.jsx(material.TableCell,{align:"right",sx:{fontSize:"0.76rem",fontWeight:l?800:500,borderBottom:g=>`1px solid ${g.palette.divider}`,whiteSpace:"nowrap"},children:ai(i?i(e,s.id):e.aggregatedValues[s.id]??0,s.valueItem,o)},`${e.key}-${s.id}`))]}),c&&e.children.map(s=>jsxRuntime.jsx(Os,{node:s,dataColumns:t,fieldMap:o,level:a+1,expandedKeys:r,onToggle:n,getValue:i},s.key))]})};var Ec=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},Hs=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",Fc=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",om=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},rm=(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,rm(r.children,t,o+1)),o),oC=(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},y5=({title:e,rows:t,fields:o,initialLayout:a,initialChart:r,emptyText:n,maxPreviewHeight:i=520,initialChartCollapsed:c=false,initialTableCollapsed:d=false,model:l,enablePresetManagement:s=false,presets:g,defaultPresets:f,onPresetsChange:u,initialPresetId:h,onPresetApplied:v})=>{let{t:p}=Q(),C=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),m=ht.useRef(0),y=ht.useRef(false),x=e??p("pivot.title.default"),S=n??p("pivot.empty"),B=ht.useMemo(()=>({sum:p("pivot.agg.sum"),count:p("pivot.agg.count"),avg:p("pivot.agg.avg"),min:p("pivot.agg.min"),max:p("pivot.agg.max")}),[p]),R=ht.useCallback(b=>B[b]??wu[b],[B]),w=ht.useMemo(()=>new Set(o.map(b=>b.id)),[o]),A=ht.useMemo(()=>new Map(o.map(b=>[b.id,b])),[o]),[P,k]=ht.useState(()=>St(a?.rows,w)),[D,T]=ht.useState(()=>St(a?.columns,w)),[I,M]=ht.useState(()=>St(a?.filters,w)),[H,V]=ht.useState(()=>{let b=a?.values??[],E=new Set,F=[];return b.forEach(U=>{if(!w.has(U.fieldId)||E.has(U.fieldId))return;E.add(U.fieldId),m.current+=1;let re=A.get(U.fieldId);F.push({tokenId:`v${m.current}`,fieldId:U.fieldId,aggregation:qt(U.aggregation,re)});}),F}),[J,ce]=ht.useState({}),[te,ne]=ht.useState(true),[ee,Y]=ht.useState(false),[Ze,Ue]=ht.useState(()=>Ec(St(a?.rows,w),St(a?.columns,w),r?.dimensionFieldId)),[ie,Ie]=ht.useState(()=>{let b=(a?.values??[]).filter((E,F,U)=>w.has(E.fieldId)&&U.findIndex(re=>re.fieldId===E.fieldId)===F).map(E=>({tokenId:E.fieldId,fieldId:E.fieldId,aggregation:qt(E.aggregation,A.get(E.fieldId))}));return Hs(b,r?.primaryValueFieldId)}),[Fe,Oe]=ht.useState(()=>{let b=(a?.values??[]).filter((F,U,re)=>w.has(F.fieldId)&&re.findIndex(ve=>ve.fieldId===F.fieldId)===U).map(F=>({tokenId:F.fieldId,fieldId:F.fieldId,aggregation:qt(F.aggregation,A.get(F.fieldId))})),E=Hs(b,r?.primaryValueFieldId);return Fc(b,E,r?.secondaryValueFieldId)}),[nt,Le]=ht.useState(r?.chartType??"bar-vertical"),[Xe,Zt]=ht.useState(c),[zt,Qe]=ht.useState(d),[lt,mt]=ht.useState(()=>f??[]),[_e,K]=ht.useState(""),[Ce,fe]=ht.useState(false),[be,Ne]=ht.useState(""),[Ve,Ht]=ht.useState(null),[Nt,Xt]=ht.useState(new Set(["__grand_total__"])),[Qt,Yt]=ht.useState(new Set),L=l?.rowFields??P,$=l?.columnFields??D,j=l?.filterFields??I,_=l?.valueFields??H,ke=l?.filterSelections??J,Ee=l?.showGrandTotal??te,Ye=l?.isConfiguratorCollapsed??ee,z=l?.chartDimensionFieldId??Ze,W=l?.chartPrimaryValueFieldId??ie,G=l?.chartSecondaryValueFieldId??Fe,ue=l?.chartType??nt,oe=l?.isChartCollapsed??Xe,Se=l?.isTableCollapsed??zt,ge=g??lt,Pe=s||ge.length>0||!!u,he=ht.useCallback(b=>{if(l?.setRowFields){l.setRowFields(b);return}k(b);},[l]),ze=ht.useCallback(b=>{if(l?.setColumnFields){l.setColumnFields(b);return}T(b);},[l]),Be=ht.useCallback(b=>{if(l?.setFilterFields){l.setFilterFields(b);return}M(b);},[l]),we=ht.useCallback(b=>{if(l?.setValueFields){l.setValueFields(b);return}V(b);},[l]),Me=ht.useCallback(b=>{if(l?.setFilterSelections){l.setFilterSelections(b);return}ce(b);},[l]),Tt=ht.useCallback(b=>{if(l?.setShowGrandTotal){l.setShowGrandTotal(b);return}ne(b);},[l]),Io=ht.useCallback(b=>{if(l?.setIsConfiguratorCollapsed){l.setIsConfiguratorCollapsed(b);return}Y(b);},[l]),Ct=ht.useCallback(b=>{if(l?.setChartDimensionFieldId){l.setChartDimensionFieldId(b);return}Ue(b);},[l]),It=ht.useCallback(b=>{if(l?.setChartPrimaryValueFieldId){l.setChartPrimaryValueFieldId(b);return}Ie(b);},[l]),bo=ht.useCallback(b=>{if(l?.setChartSecondaryValueFieldId){l.setChartSecondaryValueFieldId(b);return}Oe(b);},[l]),ka=ht.useCallback(b=>{if(l?.setChartType){l.setChartType(b);return}Le(b);},[l]),Rr=ht.useCallback(b=>{if(l?.setIsChartCollapsed){l.setIsChartCollapsed(b);return}Zt(b);},[l]),Po=ht.useCallback(b=>{if(l?.setIsTableCollapsed){l.setIsTableCollapsed(b);return}Qe(b);},[l]),ro=ht.useCallback(b=>{let E=typeof b=="function"?b(ge):b;g||mt(E),u?.(E);},[u,ge,g]),Za=ht.useMemo(()=>new Set([...L,...$,...j]),[L,$,j]),Yo=ht.useMemo(()=>o.filter(b=>!Za.has(b.id)),[o,Za]),Gt=ht.useMemo(()=>{let b=[...L,...$,...j],E=new Set,F=[];return b.forEach(U=>{E.has(U)||(E.add(U),F.push(U));}),F},[$,j,L]);ht.useEffect(()=>{he(b=>{let E=b.filter(F=>w.has(F));return fa(b,E)?b:E}),ze(b=>{let E=b.filter(F=>w.has(F));return fa(b,E)?b:E}),Be(b=>{let E=b.filter(F=>w.has(F));return fa(b,E)?b:E}),we(b=>{let E=b.filter(F=>w.has(F.fieldId)).map(F=>({...F,aggregation:qt(F.aggregation,A.get(F.fieldId))}));return Rs(b,E)?b:E});},[A,w]);let no=ht.useMemo(()=>{let b={};return Gt.forEach(E=>{let F=new Set;t.forEach(U=>{F.add(ga(U[E]));}),b[E]=Array.from(F).sort((U,re)=>U.localeCompare(re));}),b},[Gt,t]);ht.useEffect(()=>{Me(b=>{let E={};return Gt.forEach(F=>{let U=no[F]??[],ve=(b[F]??[]).filter(X=>U.includes(X)),N=Object.prototype.hasOwnProperty.call(b,F);E[F]=N?ve:U;}),Mu(b,E)?b:E});},[Gt,no]),ht.useEffect(()=>{Ct(b=>Ec(L,$,b));},[$,L,Ct]),ht.useEffect(()=>{It(b=>Hs(_,b));},[It,_]),ht.useEffect(()=>{bo(b=>Fc(_,W,b));},[W,bo,_]);let Vt=ht.useMemo(()=>t.filter(b=>Gt.every(E=>{let F=ke[E]??[],U=no[E]??[];if(F.length===U.length)return true;if(F.length===0)return false;let re=ga(b[E]);return F.includes(re)})),[Gt,no,ke,t]),We=ht.useMemo(()=>{if(_.length===0)return null;let b=new Map;if(Vt.forEach(N=>{let X=$.length>0?$.map(Je=>ga(N[Je])):[p("pivot.valueLabel")],Z=hr(X);b.set(Z,X);}),b.size===0){let N=$.length>0?$.map(()=>Is):[p("pivot.valueLabel")];b.set(hr(N),N);}let E=Array.from(b.entries()).sort((N,X)=>Du(N[1],X[1])),F=E.flatMap(([N,X])=>_.map(Z=>{let Je=A.get(Z.fieldId),O=`${R(Z.aggregation)} ${Je?.label??Z.fieldId}`,ae=$.length===0||_.length>1?`${X.join(" / ")} \u2022 ${O}`:X.join(" / ");return {id:`${N}::${Z.tokenId}`,colKey:N,valueItem:Z,label:ae}})),U=[];$.length>0&&E.forEach(([N,X])=>{let Z=F.filter(ae=>ae.colKey===N),Je=U,O=[];X.forEach((ae,q)=>{O.push(`d${q}:${ae}`);let de=`col::${hr(O)}`,$e=Je.find(Ko=>Ko.key===de);$e||($e={key:de,label:ae,children:[],leafColumnIds:[],path:X.slice(0,q+1),depth:q},Je.push($e)),Z.forEach(Ko=>{$e.leafColumnIds.includes(Ko.id)||$e.leafColumnIds.push(Ko.id);}),Je=$e.children;});});let re=N=>{let X={};return F.forEach(Z=>{let Je=N.filter(O=>{let ae=$.length>0?$.map(q=>ga(O[q])):[p("pivot.valueLabel")];return hr(ae)===Z.colKey});X[Z.id]=on(Je,Z.valueItem.fieldId,Z.valueItem.aggregation);}),X},ve=[];if(L.length===0)ve.push({key:"root",value:p("pivot.resultLabel")||ku,children:[],isLeaf:true,aggregatedValues:re(Vt),path:[],depth:0});else {let N=(X,Z,Je)=>{if(Z>=L.length)return [];let O=L[Z],ae=new Map;return X.forEach(q=>{let de=ga(q[O]);ae.has(de)||ae.set(de,[]),ae.get(de).push(q);}),Array.from(ae.keys()).sort().map(q=>{let de=ae.get(q),$e=[...Je,q];return {key:hr($e),value:q,fieldId:O,aggregatedValues:re(de),children:N(de,Z+1,$e),isLeaf:Z===L.length-1,path:$e,depth:Z}})};ve.push(...N(Vt,0,[]));}return {dataColumns:F,columnTree:U,rowTree:ve}},[$,A,Vt,R,L,p,_]),Jo=ht.useCallback((b,E)=>(m.current+=1,{tokenId:`v${m.current}`,fieldId:b,aggregation:qt(E,A.get(b))}),[A]),$o=ht.useCallback(b=>{if(b==="rows")return he([]);if(b==="columns")return ze([]);if(b==="filters")return Be([]);we([]);},[]),ea=ht.useCallback((b,E)=>{if(b==="rows")return he(F=>F.filter(U=>U!==E));if(b==="columns")return ze(F=>F.filter(U=>U!==E));if(b==="filters")return Be(F=>F.filter(U=>U!==E));we(F=>F.filter(U=>U.tokenId!==E));},[]),Xa=ht.useCallback((b,E)=>{we(F=>F.map(U=>U.tokenId===b?{...U,aggregation:qt(E,A.get(U.fieldId))}:U));},[A]),Ho=ht.useCallback(b=>{Ht(String(b.active.id));},[]),Qa=ht.useCallback(b=>{if(Ht(null),!b.over)return;let E=Ps(String(b.active.id)),F=Ps(String(b.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=L.indexOf(E.key),de=L.indexOf(F.key??"");q!==-1&&de!==-1&&q!==de&&he($e=>sortable.arrayMove($e,q,de));return}if(E.zone==="columns"){let q=$.indexOf(E.key),de=$.indexOf(F.key??"");q!==-1&&de!==-1&&q!==de&&ze($e=>sortable.arrayMove($e,q,de));return}if(E.zone==="filters"){let q=j.indexOf(E.key),de=j.indexOf(F.key??"");q!==-1&&de!==-1&&q!==de&&Be($e=>sortable.arrayMove($e,q,de));return}if(E.zone==="values"){let q=_.findIndex($e=>$e.tokenId===E.key),de=_.findIndex($e=>$e.tokenId===(F.key??""));q!==-1&&de!==-1&&q!==de&&we($e=>sortable.arrayMove($e,q,de));}return}let U=F.zone,re=[...L],ve=[...$],N=[...j],X=[..._],Z="",Je=null;if(E.zone==="palette")Z=E.key;else if(E.zone==="values"){let q=X.find(de=>de.tokenId===E.key);if(!q)return;Z=q.fieldId,Je=q,X=X.filter(de=>de.tokenId!==E.key);}else E.zone==="rows"?(Z=E.key,re=re.filter(q=>q!==Z)):E.zone==="columns"?(Z=E.key,ve=ve.filter(q=>q!==Z)):E.zone==="filters"&&(Z=E.key,N=N.filter(q=>q!==Z));if(!Z)return;let O=()=>{re=re.filter(q=>q!==Z),ve=ve.filter(q=>q!==Z),N=N.filter(q=>q!==Z);},ae=q=>{if(F.kind!=="item"||!F.key)return q==="rows"?re.length:q==="columns"?ve.length:q==="filters"?N.length:q==="values"?X.length:0;if(q==="rows"){let de=re.indexOf(F.key);return de>=0?de:re.length}if(q==="columns"){let de=ve.indexOf(F.key);return de>=0?de:ve.length}if(q==="filters"){let de=N.indexOf(F.key);return de>=0?de:N.length}if(q==="values"){let de=X.findIndex($e=>$e.tokenId===F.key);return de>=0?de:X.length}return 0};if(U==="palette"){he(re),ze(ve),Be(N),we(X);return}if(U==="values"){let q=ae("values"),de=Je??Jo(Z);X.splice(q,0,de),he(re),ze(ve),Be(N),we(X);return}if(Ru(U)){O();let q=ae(U);U==="rows"?re.splice(q,0,Z):U==="columns"?ve.splice(q,0,Z):N.splice(q,0,Z),he(re),ze(ve),Be(N),we(X);}},[$,Jo,j,L,_]),Ya=ht.useCallback((b,E)=>{Me(F=>({...F,[b]:E}));},[]),Go=ht.useCallback(b=>{Xt(E=>{let F=new Set(E);return F.has(b)?F.delete(b):F.add(b),F});},[]),ta=ht.useCallback(b=>{Yt(E=>{let F=new Set(E);return F.has(b)?F.delete(b):F.add(b),F});},[]),Sa=ht.useCallback(b=>{let E=A.get(b.fieldId),F=vc(E);return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:98},children:jsxRuntime.jsx(material.Select,{value:b.aggregation,onChange:U=>Xa(b.tokenId,U.target.value),onClick:U=>U.stopPropagation(),onMouseDown:U=>U.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:F.map(U=>jsxRuntime.jsx(material.MenuItem,{value:U,sx:{fontSize:"0.75rem"},children:R(U)},U))})})},[A,R,Xa]),Ut=ht.useCallback(b=>{let E=no[b]??[],F=ke[b]??E;return E.length===0?p("pivot.filter.noValues"):F.length===0?p("pivot.filter.noneSelected"):F.length===E.length?p("pivot.filter.allValues"):p("pivot.filter.selectedCount",{selected:F.length,total:E.length})},[no,ke,p]),Ro=ht.useCallback(b=>{let E=no[b]??[],F=ke[b]??E;return jsxRuntime.jsx(Eu,{options:E,selectedValues:F,onChange:U=>Ya(b,U)})},[no,ke,Ya]),oa=ht.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),xo=ht.useCallback(()=>{let b={};return new Set([...Gt,...Object.keys(ke)]).forEach(F=>{if(!w.has(F))return;let U=ke[F]??[];b[F]=[...U];}),{layout:{rows:[...L],columns:[...$],filters:[...j],values:_.map(F=>({fieldId:F.fieldId,aggregation:F.aggregation}))},filterSelections:b,showGrandTotal:Ee,chart:{dimensionFieldId:z,primaryValueFieldId:W,secondaryValueFieldId:G,chartType:ue}}},[Gt,z,W,G,ue,$,j,ke,L,Ee,w,_]),Uo=ht.useCallback(b=>{let E=St(b.layout.rows,w),F=St(b.layout.columns,w),U=St(b.layout.filters,w),re=new Set,ve=(b.layout.values??[]).filter(Z=>!w.has(Z.fieldId)||re.has(Z.fieldId)?false:(re.add(Z.fieldId),true)).map(Z=>Jo(Z.fieldId,Z.aggregation)),N={};Object.entries(b.filterSelections??{}).forEach(([Z,Je])=>{!w.has(Z)||!Array.isArray(Je)||(N[Z]=Array.from(new Set(Je.map(O=>String(O)))));}),he(E),ze(F),Be(U),we(ve),Me(N),typeof b.showGrandTotal=="boolean"&&Tt(b.showGrandTotal),Ct(Ec(E,F,b.chart?.dimensionFieldId));let X=Hs(ve,b.chart?.primaryValueFieldId);It(X),bo(Fc(ve,X,b.chart?.secondaryValueFieldId)),ka(b.chart?.chartType??"bar-vertical"),K(b.id),v?.(b);},[Jo,v,Ct,It,bo,ka,ze,Be,Me,he,Tt,we,w]),Ja=ht.useCallback(b=>{if(!b){K("");return}let E=ge.find(F=>F.id===b);if(!E){K("");return}Uo(E);},[Uo,ge]),Dr=ht.useCallback(()=>{let b=p("pivot.preset.defaultName",{index:ge.length+1});Ne(b),fe(true);},[ge.length,p]),wa=ht.useCallback(()=>{let b=be.trim();if(!b)return;let E={id:oa(),name:b,...xo()};ro(F=>[...F,E]),K(E.id),fe(false);},[xo,oa,be,ro]),er=ht.useCallback(()=>{_e&&(ro(b=>b.filter(E=>E.id!==_e)),K(""));},[_e,ro]);ht.useEffect(()=>{if(!h||y.current)return;let b=ge.find(E=>E.id===h);b&&(y.current=true,Uo(b));},[Uo,h,ge]),ht.useEffect(()=>{_e&&(ge.some(b=>b.id===_e)||K(""));},[_e,ge]);let aa=ht.useMemo(()=>{if(!Ee||!We||!L.length)return null;let b={};return We.dataColumns.forEach(E=>{let F=Vt.filter(U=>{let re=$.length>0?$.map(ve=>ga(U[ve])):[p("pivot.valueLabel")];return hr(re)===E.colKey});b[E.id]=on(F,E.valueItem.fieldId,E.valueItem.aggregation);}),{key:"__grand_total__",value:p("pivot.grandTotal")||Su,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:b,path:[],depth:-1}},[Ee,We,Vt,$,L.length,p]),Jt=ht.useMemo(()=>om(We?.rowTree??[]),[We]),Do=ht.useMemo(()=>om(We?.columnTree??[]),[We]);ht.useEffect(()=>{Xt(b=>{let E=new Set;return b.has("__grand_total__")&&E.add("__grand_total__"),Jt.forEach(F=>{b.has(F)&&E.add(F);}),E});},[Jt]),ht.useEffect(()=>{Yt(b=>{let E=new Set;return Do.forEach(F=>{b.has(F)&&E.add(F);}),E});},[Do]);let Mr=ht.useCallback(()=>{Xt(b=>{let E=new Set(b);return Jt.forEach(F=>E.add(F)),E});},[Jt]),tr=ht.useCallback(()=>{Xt(b=>{let E=new Set;return b.has("__grand_total__")&&E.add("__grand_total__"),E});},[]),Ar=ht.useCallback(()=>{Yt(new Set(Do));},[Do]),Br=ht.useCallback(()=>{Yt(new Set);},[]),Er=ht.useMemo(()=>!We||$.length===0?[]:oC(We.columnTree,Qt),[$.length,Qt,We]),io=ht.useMemo(()=>{if(!We)return [];if($.length===0)return We.dataColumns.map(E=>({id:E.id,label:E.label,leafColumnIds:[E.id],valueItem:E.valueItem}));let b=new Map(We.dataColumns.map(E=>[E.id,E]));return Er.flatMap(E=>{let F=new Map;return E.leafColumnIds.forEach(U=>{let re=b.get(U);if(!re)return;let ve=re.valueItem.tokenId,N=`${R(re.valueItem.aggregation)} ${A.get(re.valueItem.fieldId)?.label??re.valueItem.fieldId}`,X=F.get(ve);if(X){X.leafColumnIds.push(U);return}F.set(ve,{id:`${E.key}::${ve}`,label:_.length>1?N:E.label,leafColumnIds:[U],valueItem:re.valueItem});}),Array.from(F.values())})},[$.length,A,R,We,_.length,Er]),Fr=ht.useMemo(()=>new Map(io.map(b=>[b.id,b])),[io]),Lr=ht.useMemo(()=>io.map(b=>({id:b.id,colKey:b.id,valueItem:b.valueItem,label:b.label})),[io]),or=ht.useMemo(()=>{if(!We||$.length===0)return [];let b=[],E=rm(We.columnTree,Qt),F=E+(_.length>1?1:0),U=(re,ve)=>{b[ve]??(b[ve]=[]),re.forEach(N=>{let X=N.children.length>0&&Qt.has(N.key),Z=io.filter(O=>N.leafColumnIds.some(ae=>O.leafColumnIds.includes(ae))).length,Je=X||_.length>1?1:F-ve;b[ve].push({key:N.key,label:N.label,colSpan:Z,rowSpan:Je,expandable:N.children.length>0,expanded:X}),X&&U(N.children,ve+1);});};return U(We.columnTree,0),_.length>1&&(b[E]=io.map(re=>({key:re.id,label:re.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),b},[$.length,Qt,We,_.length,io]),ra=ht.useCallback((b,E)=>E.leafColumnIds.reduce((F,U)=>F+(b.aggregatedValues[U]??0),0),[]),Ta=ht.useMemo(()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Mr,disabled:Jt.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.expandRowsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:tr,disabled:Jt.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.collapseRowsAll")}),jsxRuntime.jsx(material.Divider,{orientation:"vertical",flexItem:true}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Ar,disabled:Do.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.expandColumnsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Br,disabled:$.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.collapseColumnsAll")})]}),[$.length,Do.size,Jt.size,Br,tr,Ar,Mr,p]),Ia=()=>{if(!Ve)return null;let b=Ps(Ve);if(!b||b.kind!=="item"||!b.key)return null;if(b.zone==="palette"){let re=A.get(b.key);return re?jsxRuntime.jsx(kc,{label:re.label,subtitle:re.type}):null}if(b.zone==="values"){let re=_.find(Z=>Z.tokenId===b.key);if(!re)return null;let N=A.get(re.fieldId)?.label??re.fieldId,X=`${R(re.aggregation)}(${N})`;return jsxRuntime.jsx(Es,{label:N,caption:X})}let F=A.get(b.key)?.label??b.key,U=Ut(b.key);return jsxRuntime.jsx(Es,{label:F,caption:U})};return jsxRuntime.jsxs(material.Paper,{sx:b=>({p:{xs:1.2,md:2},borderRadius:4,border:`1px solid ${b.palette.divider}`,bgcolor:"background.paper",boxShadow:b.palette.mode==="dark"?"none":"0 12px 28px rgba(15, 23, 42, 0.08)",display:"flex",flexDirection:"column",gap:2}),children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800},children:x}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:p("pivot.subtitle.default")})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[Pe&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:200},children:jsxRuntime.jsxs(material.Select,{value:_e,displayEmpty:true,onChange:b=>Ja(String(b.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:p("pivot.preset.selectPlaceholder")}),ge.map(b=>jsxRuntime.jsx(material.MenuItem,{value:b.id,sx:{fontSize:"0.75rem"},children:b.name},b.id))]})}),jsxRuntime.jsx(material.Tooltip,{title:p("pivot.preset.save"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:Dr,"aria-label":p("pivot.preset.save"),children:jsxRuntime.jsx(Rp__default.default,{sx:{fontSize:18}})})}),jsxRuntime.jsx(material.Tooltip,{title:p("pivot.preset.delete"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:er,disabled:!_e,"aria-label":p("pivot.preset.delete"),children:jsxRuntime.jsx(_v__default.default,{sx:{fontSize:18}})})})}),jsxRuntime.jsx(material.Divider,{flexItem:true,orientation:"vertical"})]}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary"},children:[p("pivot.records"),": ",jsxRuntime.jsx("strong",{children:t.length.toLocaleString()})," / ",p("pivot.afterFilter"),":"," ",jsxRuntime.jsx("strong",{children:Vt.length.toLocaleString()})]}),jsxRuntime.jsx(material.Divider,{flexItem:true,orientation:"vertical"}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.6},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem"},children:p("pivot.grandTotal")}),jsxRuntime.jsx(material.Switch,{size:"small",checked:Ee,onChange:b=>Tt(b.target.checked)})]})]})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(core.DndContext,{sensors:C,collisionDetection:core.closestCenter,onDragStart:Ho,onDragEnd:Qa,children:[jsxRuntime.jsx($u,{isConfiguratorCollapsed:Ye,onToggleCollapse:()=>Io(b=>!b),availableFields:Yo,fieldMap:A,filterFields:j,columnFields:$,rowFields:L,valueFields:_,clearZone:$o,removeFieldFromZone:ea,getFilterSelectionSummary:Ut,renderDimensionFilterSelect:Ro,renderAggregationSelect:Sa,getAggregationLabel:R}),jsxRuntime.jsx(material.Portal,{children:jsxRuntime.jsx(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Ia()})})]}),jsxRuntime.jsx(Zu,{rows:Vt,fieldMap:A,rowFields:L,columnFields:$,valueFields:_,chartDimensionFieldId:z,chartPrimaryValueFieldId:W,chartSecondaryValueFieldId:G,chartType:ue,isCollapsed:oe,onChartDimensionFieldIdChange:b=>Ct(b),onChartPrimaryValueFieldIdChange:b=>It(b),onChartSecondaryValueFieldIdChange:b=>bo(b),onChartTypeChange:b=>ka(b),onToggleCollapse:()=>Rr(b=>!b),getAggregationLabel:R}),jsxRuntime.jsx(ln,{title:p("pivot.table.sectionTitle"),subtitle:L.length>0?L.map(b=>A.get(b)?.label??b).join(" > "):p("pivot.table.dimensions"),collapsed:Se,onToggleCollapse:()=>Po(b=>!b),expandAriaLabel:p("pivot.table.collapse.ariaExpand"),collapseAriaLabel:p("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:Ta,children:We===null?jsxRuntime.jsx(material.Box,{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:S})}):jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:i},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:(or.length>0?or:[[]]).map((b,E)=>jsxRuntime.jsxs(material.TableRow,{children:[E===0&&jsxRuntime.jsx(material.TableCell,{rowSpan:Math.max(or.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:L.length>0?L.map(F=>A.get(F)?.label).join(" > "):p("pivot.table.dimensions")}),(b.length>0?b:io.map(F=>({key:F.id,label:F.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(F=>jsxRuntime.jsx(material.TableCell,{align:"center",colSpan:F.colSpan,rowSpan:F.rowSpan,sx:U=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:U.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${U.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:jsxRuntime.jsxs(material.Box,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[F.expandable&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>ta(F.key),sx:{p:.1,ml:-0.3},children:F.expanded?jsxRuntime.jsx(ch__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(qf__default.default,{sx:{fontSize:16}})}),jsxRuntime.jsx(material.Box,{component:"span",children:F.label})]})},F.key))]},`pivot-header-row-${E}`))}),jsxRuntime.jsxs(material.TableBody,{children:[We.rowTree.map(b=>jsxRuntime.jsx(Os,{node:b,dataColumns:Lr,fieldMap:A,level:0,expandedKeys:Nt,onToggle:Go,getValue:(E,F)=>{let U=Fr.get(F);return U?ra(E,U):0}},b.key)),aa&&jsxRuntime.jsx(Os,{node:aa,dataColumns:Lr,fieldMap:A,level:0,expandedKeys:Nt,onToggle:Go,getValue:(b,E)=>{let F=Fr.get(E);return F?ra(b,F):0}})]})]})})}),jsxRuntime.jsxs(material.Dialog,{open:Ce,onClose:()=>fe(false),maxWidth:"xs",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:p("pivot.preset.saveDialogTitle")}),jsxRuntime.jsx(material.DialogContent,{children:jsxRuntime.jsx(material.TextField,{autoFocus:true,fullWidth:true,margin:"dense",label:p("pivot.preset.nameLabel"),value:be,onChange:b=>Ne(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),wa());}})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>fe(false),children:p("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:wa,disabled:!be.trim(),children:p("common.save")})]})]})]})};var nm=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},zc=(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??"",k5=({fields:e,initialLayout:t,initialFilterSelections:o={},initialShowGrandTotal:a=true,initialConfiguratorCollapsed:r=false,initialChart:n,initialChartCollapsed:i=false,initialTableCollapsed:c=false})=>{let d=ht.useRef(0),l=ht.useMemo(()=>new Set(e.map(K=>K.id)),[e]),s=ht.useMemo(()=>new Map(e.map(K=>[K.id,K])),[e]),[g,f]=ht.useState(()=>St(t?.rows,l)),[u,h]=ht.useState(()=>St(t?.columns,l)),[v,p]=ht.useState(()=>St(t?.filters,l)),[C,m]=ht.useState(()=>{let K=t?.values??[],Ce=new Set,fe=[];return K.forEach(be=>{!l.has(be.fieldId)||Ce.has(be.fieldId)||(Ce.add(be.fieldId),d.current+=1,fe.push({tokenId:`v${d.current}`,fieldId:be.fieldId,aggregation:qt(be.aggregation,s.get(be.fieldId))}));}),fe}),[y,x]=ht.useState(o),[S,B]=ht.useState(a),[R,w]=ht.useState(r),[A,P]=ht.useState(()=>nm(St(t?.rows,l),St(t?.columns,l),n?.dimensionFieldId)),[k,D]=ht.useState(()=>{let K=(()=>{let Ce=t?.values??[],fe=new Set,be=[];return Ce.forEach(Ne=>{!l.has(Ne.fieldId)||fe.has(Ne.fieldId)||(fe.add(Ne.fieldId),be.push({tokenId:Ne.fieldId,fieldId:Ne.fieldId,aggregation:qt(Ne.aggregation,s.get(Ne.fieldId))}));}),be})();return zc(K,n?.primaryValueFieldId)}),[T,I]=ht.useState(()=>{let K=(()=>{let fe=t?.values??[],be=new Set,Ne=[];return fe.forEach(Ve=>{!l.has(Ve.fieldId)||be.has(Ve.fieldId)||(be.add(Ve.fieldId),Ne.push({tokenId:Ve.fieldId,fieldId:Ve.fieldId,aggregation:qt(Ve.aggregation,s.get(Ve.fieldId))}));}),Ne})(),Ce=zc(K,n?.primaryValueFieldId);return im(K,Ce,n?.secondaryValueFieldId)}),[M,H]=ht.useState(n?.chartType??"bar-vertical"),[V,J]=ht.useState(i),[ce,te]=ht.useState(c);ht.useEffect(()=>{f(K=>{let Ce=K.filter(fe=>l.has(fe));return fa(K,Ce)?K:Ce}),h(K=>{let Ce=K.filter(fe=>l.has(fe));return fa(K,Ce)?K:Ce}),p(K=>{let Ce=K.filter(fe=>l.has(fe));return fa(K,Ce)?K:Ce}),m(K=>{let Ce=K.filter(fe=>l.has(fe.fieldId)).map(fe=>({...fe,aggregation:qt(fe.aggregation,s.get(fe.fieldId))}));return Rs(K,Ce)?K:Ce});},[s,l]),ht.useEffect(()=>{P(K=>nm(g,u,K));},[u,g]),ht.useEffect(()=>{D(K=>zc(C,K));},[C]),ht.useEffect(()=>{I(K=>im(C,k,K));},[k,C]);let ne=ht.useCallback(K=>{f(St(K,l));},[l]),ee=ht.useCallback(K=>{h(St(K,l));},[l]),Y=ht.useCallback(K=>{p(St(K,l));},[l]),Ze=ht.useCallback(K=>{m(Ce=>{let fe=K??[],be=new Set,Ne=[];return fe.forEach(Ve=>{if(!l.has(Ve.fieldId)||be.has(Ve.fieldId))return;be.add(Ve.fieldId);let Ht=Ce.find(Nt=>Nt.fieldId===Ve.fieldId);if(Ht){Ne.push({...Ht,aggregation:qt(Ve.aggregation??Ht.aggregation,s.get(Ve.fieldId))});return}d.current+=1,Ne.push({tokenId:`v${d.current}`,fieldId:Ve.fieldId,aggregation:qt(Ve.aggregation,s.get(Ve.fieldId))});}),Ne});},[s,l]),Ue=ht.useCallback(K=>{ne(K.rows??[]),ee(K.columns??[]),Y(K.filters??[]),Ze(K.values??[]);},[ee,Y,ne,Ze]),ie=ht.useCallback(K=>{if(K==="rows")return f([]);if(K==="columns")return h([]);if(K==="filters")return p([]);m([]);},[]),Ie=ht.useCallback((K,Ce)=>{if(K==="rows")return f(fe=>fe.filter(be=>be!==Ce));if(K==="columns")return h(fe=>fe.filter(be=>be!==Ce));if(K==="filters")return p(fe=>fe.filter(be=>be!==Ce));m(fe=>fe.filter(be=>be.tokenId!==Ce));},[]),Fe=ht.useCallback((K,Ce)=>{m(fe=>fe.map(be=>be.tokenId===K?{...be,aggregation:qt(Ce,s.get(be.fieldId))}:be));},[s]),Oe=ht.useCallback((K,Ce)=>{x(fe=>({...fe,[K]:Ce}));},[]),nt=ht.useCallback(()=>{x({});},[]),Le=ht.useCallback(()=>{B(K=>!K);},[]),Xe=ht.useCallback(()=>{w(K=>!K);},[]),Zt=ht.useCallback(K=>{P(K);},[]),zt=ht.useCallback(K=>{D(K);},[]),Qe=ht.useCallback(K=>{I(K);},[]),lt=ht.useCallback(()=>{J(K=>!K);},[]),mt=ht.useCallback(()=>{te(K=>!K);},[]);return {model:ht.useMemo(()=>({rowFields:g,setRowFields:f,columnFields:u,setColumnFields:h,filterFields:v,setFilterFields:p,valueFields:C,setValueFields:m,filterSelections:y,setFilterSelections:x,showGrandTotal:S,setShowGrandTotal:B,isConfiguratorCollapsed:R,setIsConfiguratorCollapsed:w,chartDimensionFieldId:A,setChartDimensionFieldId:P,chartPrimaryValueFieldId:k,setChartPrimaryValueFieldId:D,chartSecondaryValueFieldId:T,setChartSecondaryValueFieldId:I,chartType:M,setChartType:H,isChartCollapsed:V,setIsChartCollapsed:J,isTableCollapsed:ce,setIsTableCollapsed:te}),[A,k,T,M,u,v,y,V,R,ce,g,S,C]),actions:{setRows:ne,setColumns:ee,setFilters:Y,setValues:Ze,setLayout:Ue,clearZone:ie,removeFieldFromZone:Ie,setAggregationForValue:Fe,setFilterSelection:Oe,resetFilterSelections:nt,toggleGrandTotal:Le,toggleConfigurator:Xe,setChartDimension:Zt,setChartPrimaryValue:zt,setChartSecondaryValue:Qe,setChartType:H,toggleChart:lt,toggleTable:mt}}};var P5=({orientation:e="auto",defaultNavigationOpen:t,onNavOpenChange:o}={})=>{let a=styles.useTheme(),r=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),n=material.useMediaQuery(a.breakpoints.down("md"),{noSsr:true}),i=ht.useMemo(()=>e==="auto"?r||n?"portrait":"landscape":e,[n,r,e]),[c,d]=ht.useState(t??i==="landscape");ht.useEffect(()=>{d(t??i==="landscape");},[t,i]);let l=g=>{d(g),o?.(g);};return {resolvedOrientation:i,isPortraitViewport:r,isCompactViewport:n,navigationOpen:c,setNavigationOpen:l,toggleNavigationOpen:()=>l(!c)}};var cC=e=>{let t=Number(e||0);return Number.isFinite(t)?t:0},M5=({rows:e,rowKey:t="id",numericField:o,defaultSelectedId:a})=>{let n=e[0]?.[t],[i,c]=ht.useState(a??n),d=ht.useMemo(()=>e.find(u=>u[t]===i)||e[0],[t,e,i]),[l,s]=ht.useState(()=>{let u=d?.[o];return u==null?"0":String(u)});return {selectedId:i,selectedRecord:d,editorValue:l,setEditorValue:s,selectRecord:u=>{let h=u[t];c(h);let v=u[o];s(v==null?"0":String(v));},applyEditorValue:u=>{if(i===void 0)return;let h=cC(l),v=e.map(p=>p[t]===i?{...p,[o]:h}:p);u(v);}}};var vC=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],um=(e,t,o,a)=>{t?.(e),a&&o?.();},z5=({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=vC,facingMode:n="environment",manualEntry:i=true,autoCloseOnDetect:c=true,scanIntervalMs:d=600,confirmLabel:l="Use code",cancelLabel:s="Close",manualPlaceholder:g="Enter barcode manually",onDetected:f,onError:u,sx:h})=>{let v=ht__namespace.default.useRef(null),p=ht__namespace.default.useRef(null),C=ht__namespace.default.useRef(null),m=ht__namespace.default.useRef(null),[y,x]=ht__namespace.default.useState("idle"),[S,B]=ht__namespace.default.useState(""),[R,w]=ht__namespace.default.useState(null),[A,P]=ht__namespace.default.useState(null),k=ht__namespace.default.useCallback(()=>{C.current!==null&&(window.clearInterval(C.current),C.current=null),p.current&&(p.current.getTracks().forEach(I=>I.stop()),p.current=null),v.current&&(v.current.srcObject=null);},[]),D=ht__namespace.default.useCallback(I=>{P(I),x("error"),u?.(I);},[u]);ht__namespace.default.useEffect(()=>{if(!e){k(),x("idle"),P(null),B("");return}let I=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){x("unsupported"),P("Camera access is not supported in this browser.");return}x("starting"),P(null);try{let H=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:n}}});if(I){H.getTracks().forEach(V=>V.stop());return}if(p.current=H,v.current&&(v.current.srcObject=H,await v.current.play()),!window.BarcodeDetector){x("unsupported"),P("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}m.current=new window.BarcodeDetector({formats:r}),x("ready"),C.current=window.setInterval(async()=>{if(!(!v.current||!m.current)&&!(v.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let J=(await m.current.detect(v.current)).find(te=>te.rawValue);if(!J?.rawValue)return;let ce={rawValue:J.rawValue,format:J.format};w(ce),k(),um(ce,f,t,c);}catch(V){D(V instanceof Error?V.message:"Failed to detect barcode.");}},d);}catch(H){D(H instanceof Error?H.message:"Unable to start camera.");}}})(),()=>{I=true,k();}},[c,n,r,t,f,e,D,d,k]);let T=()=>{let I=S.trim();if(!I)return;let M={rawValue:I,format:"manual"};w(M),um(M,f,t,c);};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:900},children:o}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Stack,{spacing:2,sx:h,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:a}),jsxRuntime.jsxs(material.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:[jsxRuntime.jsx("video",{ref:v,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),jsxRuntime.jsx(material.Box,{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(material.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:jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"#38bdf8",boxShadow:"0 0 18px rgba(56,189,248,0.85)"}})})}),jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(bC__default.default,{}),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?jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(xC__default.default,{}),label:`${R.format||"barcode"}: ${R.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),A?jsxRuntime.jsx(material.Alert,{severity:y==="unsupported"?"info":"warning",children:A}):null,i?jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[jsxRuntime.jsx(material.TextField,{fullWidth:true,label:"Barcode",placeholder:g,value:S,onChange:I=>B(I.target.value)}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:T,sx:{minHeight:56,px:2.5},children:l})]}):null]})}),jsxRuntime.jsx(material.DialogActions,{sx:{px:3,pb:2},children:jsxRuntime.jsx(material.Button,{onClick:t,children:s})})]})};var wC={default:"#475569",primary:"#1d4ed8",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#0369a1"},H5=({title:e,description:t,kicker:o,icon:a,badges:r=[],metrics:n=[],footer:i,children:c,selected:d=false,draggable:l=false,isDragging:s=false,swipeThreshold:g=88,startAction:f,endAction:u,dragHandleProps:h,onClick:v,onSwipe:p,sx:C})=>{let[m,y]=ht.useState(0),[x,S]=ht.useState(false),B=ht.useRef(null),R=ht.useRef(0),w=ht.useRef(0),A=!!(f||u),P=132,k=()=>{y(0),S(false),B.current=null,R.current=0,w.current=0;},D=V=>{(V==="start"?f:u)?.onTrigger?.(),p?.(V),k();},T=V=>{!A||V.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(B.current=V.pointerId,R.current=V.clientX,w.current=V.clientX,S(true),V.currentTarget.setPointerCapture(V.pointerId));},I=V=>{if(!x||B.current!==V.pointerId)return;w.current=V.clientX;let J=w.current-R.current,ce=Math.max(-P,Math.min(P,J));y(ce);},M=V=>{if(!x||B.current!==V.pointerId)return;let J=w.current-R.current;if(J>=g&&f){D("start");return}if(J<=-g&&u){D("end");return}Math.abs(J)<12&&v?.(),k();},H=(V,J)=>{if(!V)return null;let ce=V.backgroundColor||wC[V.tone||"default"];return jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:0,bottom:0,[J]:0,width:P,px:2,display:"flex",alignItems:"center",justifyContent:J==="left"?"flex-start":"flex-end",color:"#fff",background:`linear-gradient(135deg, ${ce}, rgba(15,23,42,0.92))`},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[V.icon,jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700,fontSize:"0.95rem"},children:V.label})]})})};return jsxRuntime.jsxs(material.Box,{sx:{position:"relative",overflow:"hidden",borderRadius:4,...C},children:[H(f,"left"),H(u,"right"),jsxRuntime.jsx(material.Paper,{elevation:0,onPointerDown:T,onPointerMove:I,onPointerUp:M,onPointerCancel:k,sx:V=>({position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"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:d?"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(${s?.985:1})`,transition:x?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:v?"pointer":"default",opacity:s?.9:1}),children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[a?jsxRuntime.jsx(material.Box,{sx:{mt:.25},children:a}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[o?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:o}):null,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:e}),t?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:t}):null]}),l?jsxRuntime.jsx(material.Box,{"data-no-swipe":"true",...h,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:jsxRuntime.jsx(material.IconButton,{size:"small",children:jsxRuntime.jsx(SC__default.default,{})})}):null]}),r.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:r.map((V,J)=>jsxRuntime.jsx(material.Chip,{label:V,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},J))}):null,n.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:n.map(V=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:V.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:V.value})]},V.id))}):null,c,i]})})]})};var mi=({label:e,onPress:t,emphasis:o="default"})=>jsxRuntime.jsx(material.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}),Q5=({value:e,defaultValue:t="",title:o,subtitle:a,placeholder:r="0",allowDecimal:n=false,allowNegative:i=false,maxLength:c,confirmLabel:d,clearLabel:l,backspaceLabel:s,onChange:g,onSubmit:f,onClose:u,sx:h})=>{let{t:v}=Q(),[p,C]=ht.useState(t),m=e??p,y=k=>{e===void 0&&C(k),g?.(k);},x=k=>{c&&m.length>=c||y(`${m}${k}`);},S=k=>{if(k==="00"){if(!m){y("0");return}x("00");return}x(k);},B=()=>{!n||m.includes(".")||y(m?`${m}.`:"0.");},R=()=>{if(i){if(m.startsWith("-")){y(m.slice(1));return}y(m?`-${m}`:"-");}},w=()=>{y(m.slice(0,-1));},A=()=>{y("");},P=()=>{f?.(m);};return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...h},children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[o?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800},children:o}):null,a?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:a}):null]}),u?jsxRuntime.jsx(material.IconButton,{onClick:u,size:"small",children:jsxRuntime.jsx(RC__default.default,{})}):null]}),jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsx(material.Typography,{sx:{minHeight:38,fontSize:m?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:m?"text.primary":"text.disabled"},children:m||r})}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(k=>jsxRuntime.jsx(mi,{label:k,onPress:()=>S(k)},k)),jsxRuntime.jsx(mi,{label:i?"+/-":"00",onPress:i?R:()=>S("00")}),jsxRuntime.jsx(mi,{label:"0",onPress:()=>S("0")}),jsxRuntime.jsx(mi,{label:n?".":s?String(s):"DEL",onPress:n?B:w})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:w,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsxRuntime.jsx(PC__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700},children:s||"DEL"})]})}),jsxRuntime.jsx(mi,{label:String(l||"CLR"),onPress:A,emphasis:"danger"}),jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:P,sx:k=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:k.palette.primary.main,color:"#fff",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsxRuntime.jsx(DC__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:800},children:d||v("common.ok")})]})})]})]})})};var ym=({touchMode:e="comfortable",sx:t,...o})=>{let a=e==="expanded";return jsxRuntime.jsx(material.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:jsxRuntime.jsx(ca,{...o})})};var zC=(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);}},vm=({items:e,selectedId:t,orientation:o="auto",onItemSelect:a,sx:r})=>{let n=styles.useTheme(),[i,c]=ht.useState(false);ht.useEffect(()=>{c(true);},[]);let d=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),l=material.useMediaQuery(n.breakpoints.down("md"),{noSsr:true}),s=o==="auto"?d||l?"portrait":"landscape":o,g=navigation.useRouter();return jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:!i||s==="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 jsxRuntime.jsx(material.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:jsxRuntime.jsx(material.Box,{component:"button",type:"button",disabled:f.disabled,onClick:()=>zC(g,f,a),sx:{width:"100%",p:2,minHeight:s==="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:jsxRuntime.jsxs(material.Stack,{spacing:1.5,sx:{height:"100%"},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxRuntime.jsx(material.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||jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900},children:f.title.slice(0,1).toUpperCase()})}),f.badge!==void 0?jsxRuntime.jsx(material.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]}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:f.title}),f.caption?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:f.caption}):null,f.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:f.description}):null]})]})})},f.id)})})};var wm=(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?wm(a.children,t):[];return (r||n.length>0)&&o.push({...a,children:n.length>0?n:a.children}),o},[]):e,ZC=e=>{let t=new Set,o=a=>{a.forEach(r=>{r.children?.length&&(t.add(r.id),o(r.children));});};return o(e),t},Tm=({collapsed:e=false,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light",orientation:i="auto",headerSlot:c,footerSlot:d,activeHref:l,onItemSelect:s})=>{let{t:g}=Q(),f=styles.useTheme(),u=material.useMediaQuery("(orientation: portrait)"),h=material.useMediaQuery(f.breakpoints.down("md")),v=i==="auto"?u||h?"portrait":"landscape":i,p=n==="dark",C=navigation.useRouter(),m=navigation.usePathname(),[y,x]=ht.useState(""),[S,B]=ht.useState(new Set),R=ht.useMemo(()=>wm(r,y),[r,y]),w=ht.useMemo(()=>y.trim()?ZC(R):S,[S,R,y]);ht.useEffect(()=>{e&&B(new Set);},[e]);let A=I=>I.appurl||I.href||"",P=I=>{s?.(I);let M=A(I);if(M){if(M.startsWith("http://")||M.startsWith("https://")){window.open(M,"_blank");return}C.push(M);}},k=I=>{let M=!!I.children?.length;if(e&&M){t?.();return}if(M){B(H=>{let V=new Set(H);return V.has(I.id)?V.delete(I.id):V.add(I.id),V});return}P(I);},D=I=>{let M=l||m,H=A(I);return !!(H&&M===H)},T=(I,M=0)=>{let H=!!I.children?.length,V=w.has(I.id),J=D(I);return jsxRuntime.jsx(material.Box,{sx:{pl:M===0?0:1.5},children:jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:J?"primary.main":"divider",bgcolor:J?"action.selected":"background.paper"},children:[jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>k(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:[jsxRuntime.jsx(material.Avatar,{variant:"rounded",sx:{width:40,height:40,bgcolor:J?"primary.main":"action.hover",color:J?"#fff":"text.primary"},children:I.icon||(I.title||I.label||"?").slice(0,1).toUpperCase()}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:I.title||I.label}),I.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:I.description}):null]}),H?jsxRuntime.jsx(_C__default.default,{sx:{transform:V?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):jsxRuntime.jsx(jC__default.default,{color:"action"})]}),H?jsxRuntime.jsx(material.Collapse,{in:V,children:jsxRuntime.jsx(material.Box,{sx:{px:1.25,pb:1.25},children:I.children?.map(ce=>T(ce,M+1))})}):null]})},I.id)};return e?jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:v==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:p?"#101828":"rgba(255,255,255,0.88)",maxHeight:a?`${a}px`:void 0,overflowY:"auto"},children:jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:g("navigation.expand"),children:jsxRuntime.jsx(qC__default.default,{})}),r.map(I=>jsxRuntime.jsx(material.IconButton,{onClick:()=>k(I),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:D(I)?"primary.main":"action.hover",color:D(I)?"#fff":"text.primary"},children:I.icon||(I.title||I.label||"?").slice(0,1).toUpperCase()},I.id))]})}):jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:v==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:p?"#101828":"rgba(255,255,255,0.88)",maxHeight:a?`${a}px`:void 0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsxs(material.Stack,{spacing:1.25,sx:{flex:1,minHeight:0},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[jsxRuntime.jsx(material.TextField,{value:y,onChange:I=>x(I.target.value),placeholder:g("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(UC__default.default,{fontSize:"small",color:"action"})}}),v==="landscape"&&!e?jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(KC__default.default,{})}):null]}),c,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:R.length>0?R.map(I=>T(I)):jsxRuntime.jsx(material.Typography,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:g("navigation.noMatch")})}),d]})})};var Em=(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)},tk=e=>ht__namespace.default.isValidElement(e)?jsxRuntime.jsx(material.Box,{sx:{display:"inline-flex",alignItems:"center"},children:e}):jsxRuntime.jsx(material.Typography,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:e}),ok=(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)},ak=({summaryRow:e,visibleColumns:t,columns:o})=>{let a=o.filter(r=>t.includes(r.id)&&e[r.id]!=="");return a.length===0?null:jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:a.map(r=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:r.label}),jsxRuntime.jsx(material.Typography,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:e[r.id]})]},`summary-${r.id}`))})]})})},rk=e=>{let{t}=Q(),o=styles.useTheme(),{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:l,fitContainer:s=false,fullWidth:g=false,maxHeight:f,loading:u=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:v,filterConfig:p,rowKey:C,tableKey:m="default",graphReport:y,quickCreate:x,quickEdit:S,quickDelete:B,serviceUrl:R,orientation:w="auto",cardTitleField:A,cardSubtitleFields:P,toolbarSlot:k,emptyState:D,rowHeight:T="comfortable",cardActionSlot:I,renderCardFooter:M,onRowClick:H}=e,V=a||t("table.title.default"),J=material.useMediaQuery("(orientation: portrait)"),ce=material.useMediaQuery(o.breakpoints.down("md")),te=w==="auto"?J||ce?"portrait":"landscape":w,{columns:ne,filterText:ee,setFilterText:Y,visibleColumns:Ze,showSummary:Ue,setShowSummary:ie,summaryColumns:Ie,grouping:Fe,setGrouping:Oe,expandedGroups:nt,groupAnchorEl:Le,setGroupAnchorEl:Xe,summaryAnchorEl:Zt,setSummaryAnchorEl:zt,anchorEl:Qe,setAnchorEl:lt,contextMenu:mt,sortedAndFilteredRows:_e,summaryRow:K,visibleRows:Ce,page:fe,setPage:be,rowsPerPage:Ne,setRowsPerPage:Ve,totalDisplayCount:Ht,setSelected:Nt,handleClick:Xt,toggleSummaryColumn:Qt,handleExport:Yt,handleCloseContextMenu:L,toggleColumnVisibility:$,toggleGroupExpand:j,toggleGroupField:_,handleExpandGroupRecursively:ke,handleCollapseGroupRecursively:Ee,handleLayoutLoad:Ye,handleVariantLoad:z,handleLayoutSave:W,effectiveAppId:G,currentLayoutData:ue,currentLayoutId:oe,layoutIdToLoad:Se,graphReportOpen:ge,handleOpenGraphReport:Pe,handleCloseGraphReport:he}=Yr(e),ze=y?.enabled??false,Be=ze&&(y?.interaction?.enabled??true),we=ji(),Me=C||"id",Tt=ht__namespace.default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:styles.alpha(o.palette.divider,o.palette.mode==="dark"?.55:.3),bgcolor:o.palette.mode==="dark"?styles.alpha(o.palette.common.white,.06):styles.alpha(o.palette.background.paper,.92),color:o.palette.text.primary,"& .MuiChip-label":{px:1.05}}),[o]),Io=ht__namespace.default.useMemo(()=>({...Tt,borderColor:styles.alpha(o.palette.primary.main,o.palette.mode==="dark"?.42:.24),bgcolor:o.palette.mode==="dark"?styles.alpha(o.palette.primary.main,.16):styles.alpha(o.palette.primary.main,.08)}),[Tt,o]),Ct=ht__namespace.default.useMemo(()=>{let O=new Set(i);return _e.filter(ae=>O.has(ae?.[Me]))},[Me,i,_e]),It=Ct.length===1?Ct[0]:null,bo=!!x?.enabled,ka=!!S?.enabled,Rr=!!B?.enabled,Po=x?.fields,ro=x?.excludeFields||[],Za=x?.initialValues||{},Yo=S?.fields,Gt=S?.excludeFields||[],no=S?.editableFields||[],Vt=S?.nonEditableFields||[],We=S?.primaryKeys?.length?S.primaryKeys:[Me],[Jo,$o]=ht__namespace.default.useState(false),[ea,Xa]=ht__namespace.default.useState(false),[Ho,Qa]=ht__namespace.default.useState({}),[Ya,Go]=ht__namespace.default.useState(false),[ta,Sa]=ht__namespace.default.useState(false),[Ut,Ro]=ht__namespace.default.useState({}),[oa,xo]=ht__namespace.default.useState(false),[Uo,Ja]=ht__namespace.default.useState(false),Dr=u||ea||ta||Uo,wa=ht__namespace.default.useMemo(()=>{let O=[...ne];if(Array.isArray(Po)&&Po.length>0){let ae=new Set(Po);O=O.filter(q=>ae.has(q.id));}if(ro.length>0){let ae=new Set(ro);O=O.filter(q=>!ae.has(q.id));}return O.filter(ae=>!!ae?.id)},[ne,ro,Po]),er=ht__namespace.default.useMemo(()=>{let O=[...ne];if(Array.isArray(Yo)&&Yo.length>0){let ae=new Set(Yo);O=O.filter(q=>ae.has(q.id));}if(Gt.length>0){let ae=new Set(Gt);O=O.filter(q=>!ae.has(q.id));}return O.filter(ae=>!!ae?.id)},[ne,Gt,Yo]),aa=ht__namespace.default.useMemo(()=>new Set(We),[We]),Jt=ht__namespace.default.useMemo(()=>new Set(no),[no]),Do=ht__namespace.default.useMemo(()=>new Set(Vt),[Vt]),Mr=ht__namespace.default.useCallback(O=>Jt.size>0?Jt.has(O):!(Do.has(O)||aa.has(O)),[Jt,Do,aa]);ht__namespace.default.useEffect(()=>{!ge&&we.hasActiveFilters&&we.clearAll();},[we,ge]);let tr=()=>{let O={};wa.forEach(ae=>{O[ae.id]=Za[ae.id]??"";}),Qa(O),$o(true);},Ar=(O,ae)=>{Qa(q=>({...q,[O]:ae}));},Br=async()=>{if(!x?.onSubmit){$o(false);return}try{Xa(!0),await x.onSubmit(Ho),$o(!1);}finally{Xa(false);}},Er=()=>{if(!It)return;let O={};er.forEach(q=>{O[q.id]=It[q.id]??"";});let ae=S?.getInitialValues?{...O,...S.getInitialValues(It)}:O;Ro(ae),Go(true);},io=(O,ae)=>{Ro(q=>({...q,[O]:ae}));},Fr=async()=>{if(It){if(!S?.onSubmit){Go(false);return}try{Sa(!0),await S.onSubmit(Ut,It),Go(!1);}finally{Sa(false);}}},Lr=()=>{Ct.length!==0&&xo(true);},or=async()=>{if(Ct.length===0){xo(false);return}if(!B?.onConfirm){xo(false),Nt([]),c?.([]);return}try{Ja(!0),await B.onConfirm(Ct),xo(!1),Nt([]),c?.([]);}finally{Ja(false);}},ra=_e,{fieldMapping:Ta}=jr({rows:ra,config:{...y,title:y?.title||`${V} ${t("graph.reportTitle")}`}}),Ia=ht__namespace.default.useMemo(()=>Be?we.applyRows(ra,Ta):ra,[Ta,we,Be,ra]),{model:b}=jr({rows:Ia,config:{...y,title:y?.title||`${V} ${t("graph.reportTitle")}`,fieldMapping:Ta}}),E=b.table.columns.map(O=>({id:O.id,label:O.label,align:O.align||"left",minWidth:120,numeric:O.align==="right"})),F=G?jsxRuntime.jsx(rs,{appId:G,tableKey:m,currentLayoutData:ue,onLayoutLoad:Ye,targetLayoutId:Se,activeLayoutId:oe,serviceUrl:R??p?.serviceUrl}):null,U=ne.filter(O=>Ze.includes(O.id)),re=U.find(O=>O.id===A)||U[0],ve=P?.map(O=>U.find(ae=>ae.id===O)).filter(Boolean)||U.filter(O=>O.id!==re?.id).slice(0,te==="portrait"?2:3),N=U.filter(O=>O.id!==re?.id&&!ve.some(ae=>ae.id===O.id)),X=[k,l].filter(Boolean),Z=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Nr,{groupAnchorEl:Le,setGroupAnchorEl:Xe,grouping:Fe,setGrouping:Oe,columns:ne,toggleGroupField:_}),jsxRuntime.jsx(Vr,{anchorEl:Qe,setAnchorEl:lt,columns:ne,visibleColumns:Ze,toggleColumnVisibility:$}),jsxRuntime.jsx(Di,{anchorEl:Zt,setAnchorEl:zt,showSummary:Ue,setShowSummary:ie,columns:ne,summaryColumns:Ie,toggleSummaryColumn:Qt}),jsxRuntime.jsx(Mi,{contextMenu:mt,handleCloseContextMenu:L,columns:ne,visibleColumns:Ze,toggleColumnVisibility:$})]}),Je=(O,ae,q)=>{let de=i.includes(ae),$e=te==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",Ko=q%2===0?styles.alpha(o.palette.primary.main,o.palette.mode==="dark"?.09:.04):styles.alpha(o.palette.primary.main,o.palette.mode==="dark"?.05:.022),Ng=styles.alpha(o.palette.divider,.22);return jsxRuntime.jsx(material.Paper,{elevation:0,onClick:()=>{Xt({},O),H?.(O);},sx:{p:T==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:de?styles.alpha(o.palette.primary.main,.38):Ng,background:de?`linear-gradient(135deg, ${styles.alpha(o.palette.primary.main,.13)}, ${styles.alpha(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${Ko}, ${styles.alpha(o.palette.primary.main,.015)})`,boxShadow:de?`0 12px 30px ${styles.alpha(o.palette.primary.main,.2)}`:`0 3px 10px ${styles.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:de?o.palette.primary.main:q%2===0?styles.alpha(o.palette.primary.main,.26):styles.alpha(o.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${styles.alpha(o.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[n?jsxRuntime.jsx(material.Checkbox,{checked:de,onClick:so=>so.stopPropagation(),onChange:()=>Xt({},O),sx:{mt:-0.6,ml:-0.6}}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[re?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:Em(re,O)}):null,ve.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:ve.map(so=>jsxRuntime.jsx(material.Chip,{label:`${so.label}: ${ok(so,O)}`,size:"small",variant:"outlined",sx:Tt},`${ae}-${so.id}`))}):null]}),I?jsxRuntime.jsx(material.Box,{onClick:so=>so.stopPropagation(),children:I(O)}):null]}),N.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:$e,gap:1},children:N.map(so=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:o.palette.mode==="dark"?styles.alpha(o.palette.background.default,.7):styles.alpha(o.palette.background.paper,.92),border:"0.1px solid",borderColor:styles.alpha(o.palette.divider,.24)},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:so.label}),tk(Em(so,O))]},`${ae}-${so.id}-detail`))}):null,M?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{onClick:so=>so.stopPropagation(),children:M(O)})]}):null]})},ae)};return jsxRuntime.jsxs(material.Box,{sx:{width:g?"100%":"auto",mb:s?0:2,...s?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[p?jsxRuntime.jsx(material.Box,{sx:{mb:2},children:jsxRuntime.jsx(ym,{...p,onVariantLoad:O=>{z(O),p.onVariantLoad?.(O);},appId:p.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:ue}],currentLayoutId:oe,layoutRefs:[{tableKey:m,layoutId:oe}],variantService:p.variantService,serviceUrl:R??p.serviceUrl,touchMode:te==="portrait"?"expanded":"comfortable"})}):null,jsxRuntime.jsxs(material.Paper,{sx:{width:g?"100%":"auto",mb:s?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":Dr?{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}:s?{flex:1,minHeight:0,height:"100%"}:{}},children:[r?jsxRuntime.jsx(material.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:jsxRuntime.jsx(wi,{filterText:ee,setFilterText:Y,onRowsPerPageChange:Ve,rowsPerPage:Ne,rowsPerPageOptions:h,page:fe,count:Ht,onPageChange:be,actions:d,extraTools:X,grouping:Fe,setGroupAnchorEl:Xe,showSummary:Ue,setShowSummary:ie,setAnchorEl:lt,setSummaryAnchorEl:zt,handleExport:Yt,showCreateButton:bo,onOpenCreateDialog:tr,showEditButton:ka,onOpenEditDialog:Er,editDisabled:Ct.length!==1,showDeleteButton:Rr,onOpenDeleteConfirm:Lr,deleteDisabled:Ct.length===0,onLayoutSave:v||p?.variantService&&p?.appId?W:void 0,loading:u,layoutManager:F,onOpenGraphReport:ze?Pe:void 0})}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[Ce.length===0&&!u?D||jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:t("common.noData")})}):null,Ce.map((O,ae)=>{if(O.type==="group"){let $e=nt.has(O.id);return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>j(O.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:[$e?jsxRuntime.jsx(_C__default.default,{}):jsxRuntime.jsx(jC__default.default,{}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.94rem",fontWeight:800},children:[O.field,": ",O.value]}),jsxRuntime.jsxs(material.Typography,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[O.count," records"]})]}),Fe.length>1&&O.level<Fe.length-1?jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.5,children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.expandAll"),onClick:Ko=>{Ko.stopPropagation(),ke(O.id);},sx:Io}),jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.collapseAll"),onClick:Ko=>{Ko.stopPropagation(),Ee(O.id);},sx:Io})]}):null]})},O.id)}let q=O.data||O,de=O.id||q[Me]||ae;return Je(q,de,ae)}),Ue?jsxRuntime.jsx(ak,{summaryRow:K,visibleColumns:Ze,columns:ne}):null,u?jsxRuntime.jsx(material.Typography,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:t("common.loading")}):null]})})]}),bo?jsxRuntime.jsxs(material.Dialog,{open:Jo,onClose:()=>!ea&&$o(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:x?.title||t("quickCreate.createWithTitle",{title:V})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[wa.map(O=>{let ae=O.type==="number"||O.numeric?"number":O.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:O.label||O.id,value:Ho[O.id]??"",onChange:q=>Ar(O.id,q.target.value),type:ae,fullWidth:true,InputLabelProps:{shrink:ae==="date"?true:void 0}},`quick-create-${O.id}`)}),x?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:x.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>$o(false),disabled:ea,children:x?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:Br,variant:"contained",disabled:ea,children:x?.submitLabel||t("common.save")})]})]}):null,ka?jsxRuntime.jsxs(material.Dialog,{open:Ya,onClose:()=>!ta&&Go(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:S?.title||t("quickEdit.editWithTitle",{title:V})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[er.map(O=>{let ae=O.type==="number"||O.numeric?"number":O.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:O.label||O.id,value:Ut[O.id]??"",onChange:q=>io(O.id,q.target.value),type:ae,disabled:!Mr(O.id),fullWidth:true,InputLabelProps:{shrink:ae==="date"?true:void 0}},`quick-edit-${O.id}`)}),S?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:S.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>Go(false),disabled:ta,children:S?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:Fr,variant:"contained",disabled:ta||!It,children:S?.submitLabel||t("common.save")})]})]}):null,Rr?jsxRuntime.jsx(Rn,{open:oa,type:"warning",title:B?.title||t("quickDelete.confirmTitle"),message:B?.message||(Ct.length>1?t("quickDelete.confirmMessageMultiple",{count:Ct.length}):t("quickDelete.confirmMessageSingle")),confirmText:B?.confirmText||t("common.delete"),cancelText:B?.cancelText||t("common.cancel"),onClose:()=>!Uo&&xo(false),onConfirm:or}):null,Z,ze?jsxRuntime.jsx(qi,{open:ge,onClose:he,model:b,aiAssistant:y?.aiAssistant,interaction:Be?{enabled:true,filters:we.filters,fieldMapping:Ta,onPrimaryDimensionClick:O=>we.setFilter("primaryDimension",O),onSecondaryDimensionClick:O=>we.setFilter("secondaryDimension",O),onStatusClick:O=>we.setFilter("status",O),onClearFilter:we.clearFilter,onClearAll:we.clearAll}:void 0,tableContent:jsxRuntime.jsx(rk,{appId:G||"graph-report-internal",title:t("graph.dataBody"),columns:E,rows:b.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var _E=({appTitle:e,children:t,menuData:o=[],workloadItems:a=[],workloadSelectedId:r,showNavigation:n=true,showWorkloadNav:i=true,orientation:c="auto",logo:d,headerSlot:l,actionSlot:s,portraitBottomSlot:g,contentSx:f,containerSx:u,user:h,onSearch:v,defaultNavigationOpen:p,navOpen:C,onNavOpenChange:m,onWorkloadSelect:y,locale:x="en",localeLabel:S,localeOptions:B,onLocaleChange:R,onUserSetting:w,onUserLogout:A,userMenuItems:P,leftHeaderSlot:k,rightHeaderSlot:D})=>{let T="orbcafe:page-layout-mode",[I,M]=ht.useState("system"),[H,V]=ht.useState("light"),[J,ce]=ht.useState(false),[te,ne]=ht.useState(false),ee=I==="system"?te?H:"light":I;ht.useEffect(()=>{ce(true);},[]),ht.useEffect(()=>{try{let mt=window.localStorage.getItem(T);(mt==="light"||mt==="dark"||mt==="system")&&M(mt);}catch{}ne(true);let Qe=window.matchMedia("(prefers-color-scheme: dark)"),lt=()=>{V(Qe.matches?"dark":"light");};return lt(),Qe.addEventListener("change",lt),()=>Qe.removeEventListener("change",lt)},[]),ht.useEffect(()=>{if(te)try{window.localStorage.setItem(T,I);}catch{}},[te,I]),ht.useEffect(()=>{ee==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[ee]);let Y=ht.useMemo(()=>styles.createTheme({palette:ee==="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:ee==="dark"?"#060913":"#eef3f8"}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"}}}}}),[ee]),Ze=material.useMediaQuery("(orientation: portrait)"),Ue=material.useMediaQuery(Y.breakpoints.down("md")),ie=c==="auto"?!J||Ze||Ue?"portrait":"landscape":c,[Ie,Fe]=ht.useState({landscape:p??true,portrait:false}),Oe=Ie[ie],nt=C??Oe,Le=Qe=>{C===void 0&&Fe(lt=>({...lt,[ie]:Qe})),m?.(Qe);},Xe=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[!J||n&&ie==="portrait"?jsxRuntime.jsx(material.IconButton,{onClick:()=>Le(!nt),sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(qC__default.default,{})}):null,k]}),Zt=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[s,D]}),zt=jsxRuntime.jsx(Tm,{collapsed:ie==="landscape"?!nt:false,onToggle:()=>Le(!nt),menuData:o,orientation:ie,colorMode:ee,maxHeight:ie==="landscape"?900:void 0});return jsxRuntime.jsx(styles.ThemeProvider,{theme:Y,children:jsxRuntime.jsx(Si,{locale:x,children:jsxRuntime.jsxs(material.Box,{sx:[Qe=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:Qe.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":Qe.palette.background.default}),...Array.isArray(u)?u:[u]],children:[jsxRuntime.jsx(ws,{appTitle:e,logo:d===void 0?null:d,mode:I,onToggleMode:()=>M(Qe=>Qe==="system"?"dark":Qe==="dark"?"light":"system"),locale:x,localeLabel:S,localeOptions:B,onLocaleChange:R,user:h,onUserSetting:w,onUserLogout:A,userMenuItems:P,onSearch:v,leftSlot:Xe,rightSlot:Zt}),l?jsxRuntime.jsx(material.Box,{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:l}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[J&&n&&ie==="landscape"?jsxRuntime.jsx(material.Box,{sx:{p:1.5,pr:0,flexShrink:0},children:zt}):null,!J||n&&ie==="portrait"?jsxRuntime.jsx(material.Drawer,{open:nt,onClose:()=>Le(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:zt}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...f},children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[i&&a.length>0?jsxRuntime.jsx(vm,{items:a,selectedId:r,orientation:ie,onItemSelect:y}):null,jsxRuntime.jsx(material.Paper,{elevation:0,sx:{flex:1,minHeight:ie==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:Y.palette.mode==="dark"?"rgba(15,23,42,0.72)":"rgba(255,255,255,0.72)",backdropFilter:"blur(12px)",color:"text.primary"},children:t})]})})]}),ie==="portrait"&&g?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{sx:{p:1.5},children:g})]}):null]})})})};var Om=Sk__default.default(()=>Promise.resolve().then(()=>(Vm(),Nm)).then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsxRuntime.jsx("div",{className:"h-full w-full bg-transparent"})});function Kc({isRecording:e}){return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:e&&jsxRuntime.jsx(framerMotion.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:jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0",children:jsxRuntime.jsx(Om,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),jsxRuntime.jsx("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:jsxRuntime.jsx(Om,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var tF=Kc;function Xs({onTextUpdate:e,onComplete:t,onError:o,wsUrl:a="ws://localhost:8765",silenceThresholdMs:r=2e3,minVolumeRms:n=.015}){let[i,c]=ht.useState(false),d=ht.useRef(null),l=ht.useRef(null),s=ht.useRef(null),g=ht.useRef(null),f=ht.useRef(null),u=ht.useRef(0),h=ht.useRef(false),v=ht.useRef(false),p=ht.useCallback(()=>{d.current&&(d.current.close(),d.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),s.current&&(s.current.close(),s.current=null),v.current=false,c(false);},[]),C=ht.useCallback(()=>{h.current||(h.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(p,500));},[p]),m=ht.useCallback(async()=>{if(!(i||v.current)){v.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 x=new WebSocket(a);d.current=x,x.onopen=()=>{c(!0),v.current=!1;},x.onmessage=A=>{try{let P=JSON.parse(A.data);if(P.type==="recognition")P.is_final?t(P.text):e?.(P.text);else if(P.type==="error"){let k=P.message||"Voice recognition error";o?.(k),C();}}catch{o?.("Failed to parse voice message");}},x.onerror=()=>{o?.("Voice service connection failed"),p();},x.onclose=()=>{p();};let S=window.AudioContext||window.webkitAudioContext;if(!S)throw new Error("AudioContext is not supported in this browser");let B=new S({sampleRate:16e3});s.current=B;let R=B.createMediaStreamSource(y);f.current=R;let w=B.createScriptProcessor(4096,1,1);g.current=w,w.onaudioprocess=A=>{if(d.current?.readyState!==WebSocket.OPEN)return;let P=A.inputBuffer.getChannelData(0),k=0;for(let I=0;I<P.length;I+=1)k+=P[I]*P[I];if(Math.sqrt(k/P.length)>n)u.current=Date.now();else if(Date.now()-u.current>r&&!h.current){C();return}let T=new Int16Array(P.length);for(let I=0;I<P.length;I+=1){let M=Math.max(-1,Math.min(1,P[I]));T[I]=M<0?M*32768:M*32767;}d.current.send(T.buffer);},R.connect(w),w.connect(B.destination);}catch{o?.("Cannot access microphone"),p();}}},[p,i,n,t,o,e,r,C,a]);return ht.useEffect(()=>p,[p]),{isRecording:i,startRecording:m,stopRecording:C}}var $m=ht.createContext(null);function Ek(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 Fk({children:e,onVoiceSubmit:t,onVoicePartial:o,onVoiceError:a,longPressMs:r=200,disableSpaceTrigger:n=false,ignoreWhenFocusedInput:i=true,renderOverlay:c=true,wsUrl:d,silenceThresholdMs:l,minVolumeRms:s}){let[g,f]=ht.useState(false),[u,h]=ht.useState(false),v=ht.useRef(null),p=ht.useRef(false),C=ht.useRef(false),m=ht.useCallback(()=>{C.current=false,f(false);},[]),{isRecording:y,startRecording:x,stopRecording:S}=Xs({wsUrl:d,silenceThresholdMs:l,minVolumeRms:s,onTextUpdate:A=>{o?.(A);},onComplete:async A=>{try{A.trim()&&(h(!0),await t(A.trim()));}catch(P){let k=P instanceof Error?P.message:"Failed to process voice command";a?.(k);}finally{h(!1),m();}},onError:A=>{a?.(A),h(!1),p.current||m();}}),B=ht.useCallback(async()=>{C.current=false,await x();},[x]),R=ht.useCallback(()=>{S();},[S]);ht.useEffect(()=>{if(n)return;let A=k=>{k.isComposing||(k.code==="Space"||k.key===" ")&&(p.current||k.repeat||i&&Ek(document.activeElement)||(p.current=true,k.preventDefault(),v.current=setTimeout(()=>{C.current=true,f(true),x();},r)));},P=k=>{(k.code==="Space"||k.key===" ")&&(v.current&&(clearTimeout(v.current),v.current=null),p.current=false,C.current&&(k.preventDefault(),f(false),S()));};return window.addEventListener("keydown",A),window.addEventListener("keyup",P),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",P),v.current&&(clearTimeout(v.current),v.current=null);}},[n,i,r,x,S]);let w=ht.useMemo(()=>({isRecording:y,isHotkeyRecording:g,isSubmitting:u,startRecording:B,stopRecording:R}),[g,y,u,B,R]);return jsxRuntime.jsxs($m.Provider,{value:w,children:[c?jsxRuntime.jsx(Kc,{isRecording:g}):null,e]})}function Lk(){let e=ht.useContext($m);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var cF=Fk,dF=Lk;function De(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var Hk=({content:e,theme:t="light",size:o="base",defaultExpanded:a=false})=>{let[r,n]=ht.useState(a),i=ht.useMemo(()=>`${(o==="sm"?14:o==="lg"?18:16)-2}px`,[o]);return jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.jsx("span",{className:"mr-2",children:"\u{1F914}"}),jsxRuntime.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"})]}),jsxRuntime.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:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),r&&jsxRuntime.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})]})},Hm=Hk;var Xk=({content:e,language:t="text",isStreaming:o=false,className:a=""})=>{let{theme:r}=nextThemes.useTheme(),[n,i]=ht.useState(false),c=async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3);}catch(l){console.error("\u590D\u5236\u5931\u8D25:",l);}},d=r==="dark"?prism.oneDark:prism.oneLight;return jsxRuntime.jsxs("div",{className:De("rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 my-4",a),children:[jsxRuntime.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:[jsxRuntime.jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-300 uppercase",children:t}),jsxRuntime.jsx("button",{onClick:c,className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",disabled:o,title:n?"Copied":"Copy code",children:n?jsxRuntime.jsx(lucideReact.Check,{size:14,className:"text-green-500"}):jsxRuntime.jsx(lucideReact.Clipboard,{size:14,className:"text-gray-500 dark:text-gray-400"})})]}),jsxRuntime.jsx("div",{className:"text-sm",children:jsxRuntime.jsx(reactSyntaxHighlighter.Prism,{language:t,style:d,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:r==="dark"?"#1f2937":"#ffffff"},wrapLongLines:true,children:e})})]})},Um=Xk;var eS=({content:e,isLoading:t,className:o="",style:a})=>{let r=ht.useRef(null),[n,i]=ht.useState(false),[c,d]=ht.useState(null),{theme:l}=nextThemes.useTheme();return ht.useEffect(()=>{let s=async()=>{if(!(!e.trim()||!r.current)){i(true),d(null);try{qm__default.default.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 qm__default.default.render(f,u);r.current&&(r.current.innerHTML=h);}catch(f){console.error("Mermaid render failed:",f),d(f instanceof Error?f.message:"Render failed"),r.current&&(r.current.innerText=e);}finally{i(false);}}},g=setTimeout(()=>{s();},100);return ()=>clearTimeout(g)},[e,l]),t||n?jsxRuntime.jsx("div",{className:`mermaid-block loading ${o}`,style:a,children:jsxRuntime.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:[jsxRuntime.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500 mr-2"}),jsxRuntime.jsx("span",{className:"text-sm text-gray-500",children:"Generating Diagram..."})]})}):c?jsxRuntime.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:[jsxRuntime.jsx("p",{className:"font-semibold mb-2",children:"Mermaid Error:"}),jsxRuntime.jsx("pre",{children:c}),jsxRuntime.jsx("pre",{className:"mt-4 text-xs text-gray-500",children:e})]}):jsxRuntime.jsx("div",{className:`mermaid-block overflow-x-auto ${o}`,style:a,ref:r})},jm=eS;var iS=({title:e="\u53D1\u751F\u9519\u8BEF",content:t,errorCode:o,stack:a,icon:r,closable:n=true,onClose:i,onRetry:c,className:d="",...l})=>{let[s,g]=ht.useState(false),[f,u]=ht.useState(false),h=async()=>{if(c){u(true);try{await c();}catch(v){console.error("\u91CD\u8BD5\u5931\u8D25:",v);}finally{u(false);}}};return jsxRuntime.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:[jsxRuntime.jsxs("div",{className:"flex p-4 border-l-4 border-l-red-500 bg-red-50 dark:bg-red-900/10",children:[jsxRuntime.jsx("div",{className:"flex-shrink-0 mr-3 text-red-500 mt-0.5",children:r||jsxRuntime.jsx(lucideReact.AlertCircle,{className:"w-5 h-5"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[jsxRuntime.jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsxRuntime.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&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3 leading-relaxed",children:typeof t=="string"?jsxRuntime.jsx("p",{className:"whitespace-pre-wrap",children:t}):t}),(c||a)&&jsxRuntime.jsxs("div",{className:"flex items-center space-x-4 mt-2",children:[c&&jsxRuntime.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:[jsxRuntime.jsx(lucideReact.RotateCw,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),a&&jsxRuntime.jsxs("button",{onClick:()=>g(!s),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:[s?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),s?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),n&&i&&jsxRuntime.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:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),a&&s&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 border-t border-gray-100 dark:border-gray-800",children:jsxRuntime.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})})]})},Qs=iS;var uS=({title:e="\u8B66\u544A",content:t,warningType:o,severity:a="warning",warnings:r=[],icon:n,closable:i=true,onClose:c,onConfirm:d,actionText:l,className:s="",...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 jsxRuntime.jsx(lucideReact.Info,{className:"w-5 h-5"});case "error":return jsxRuntime.jsx(lucideReact.XCircle,{className:"w-5 h-5"});case "success":return jsxRuntime.jsx(lucideReact.CheckCircle,{className:"w-5 h-5"});default:return jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"w-5 h-5"})}},h=f();return jsxRuntime.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 ${s}`,...g,children:[jsxRuntime.jsxs("div",{className:`flex p-4 border-l-4 ${h.borderLeftColor} ${h.bgColor}`,children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 mr-3 ${h.iconColor}`,children:n||u()}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsxRuntime.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&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:t}),r&&r.length>0&&jsxRuntime.jsx("ul",{className:"mt-2 space-y-1",children:r.map((v,p)=>jsxRuntime.jsxs("li",{className:"flex items-start text-sm text-gray-600 dark:text-gray-300",children:[jsxRuntime.jsx("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-gray-400 dark:bg-gray-500 flex-shrink-0"}),jsxRuntime.jsx("span",{children:v})]},p))})]}),i&&c&&jsxRuntime.jsx("button",{onClick:c,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),d&&jsxRuntime.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:jsxRuntime.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"})})]})},Ys=uS;var hS=({title:e="\u76F8\u5173\u63A8\u8350",content:t,suggestions:o,onSuggestionClick:a,maxDisplay:r=5,icon:n,closable:i=false,onClose:c,className:d="",...l})=>{let[s,g]=ht.useState(false),[f,u]=ht.useState(""),[h,v]=ht.useState(false),p=ht.useMemo(()=>f.trim()?o.filter(y=>y.toLowerCase().includes(f.toLowerCase())):o,[o,f]),C=ht.useMemo(()=>s?p:p.slice(0,r),[p,s,r]),m=y=>{a?.(y);};return !o||o.length===0?null:jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2.5",children:[jsxRuntime.jsx("div",{className:"text-blue-500 flex-shrink-0",children:n||jsxRuntime.jsx(lucideReact.Lightbulb,{className:"w-5 h-5"})}),jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 leading-tight",children:e}),t&&jsxRuntime.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[o.length>3&&jsxRuntime.jsx("button",{onClick:()=>v(!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:jsxRuntime.jsx(lucideReact.Search,{className:"w-4 h-4"})}),i&&c&&jsxRuntime.jsx("button",{onClick:c,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:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]})]}),h&&jsxRuntime.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:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.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}),jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-gray-400"})]})}),jsxRuntime.jsxs("div",{className:"p-2",children:[jsxRuntime.jsx("ul",{className:"space-y-1",children:C.map((y,x)=>jsxRuntime.jsx("li",{children:jsxRuntime.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:[jsxRuntime.jsx("span",{children:y}),jsxRuntime.jsx(lucideReact.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"})]})},x))}),p.length>r&&jsxRuntime.jsx("button",{onClick:()=>g(!s),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:s?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${p.length})`}),p.length===0&&f&&jsxRuntime.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"})]})]})},Js=hS;var SS=({title:e,content:t,toolName:o,parameters:a,result:r,status:n,duration:i,icon:c,closable:d=false,onClose:l,onAction:s,actionText:g,className:f="",...u})=>{let[h,v]=ht.useState(false),[p,C]=ht.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 jsxRuntime.jsx(lucideReact.Loader2,{className:"w-5 h-5 animate-spin"});case "error":return jsxRuntime.jsx(lucideReact.XCircle,{className:"w-5 h-5"});default:return jsxRuntime.jsx(lucideReact.CheckCircle,{className:"w-5 h-5"})}},x=R=>R?R<1e3?`${R}ms`:`${(R/1e3).toFixed(2)}s`:"",S=m(),B=e||o||"\u5DE5\u5177\u8C03\u7528";return jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-3",children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 ${S.iconColor}`,children:c||y()}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:B}),jsxRuntime.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${S.badgeBg} ${S.badgeText}`,children:S.label})]}),o&&e&&jsxRuntime.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 flex items-center mt-0.5",children:[jsxRuntime.jsx(lucideReact.Terminal,{className:"w-3 h-3 mr-1"}),o]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500 dark:text-gray-400",children:[i&&jsxRuntime.jsxs("div",{className:"flex items-center bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded",children:[jsxRuntime.jsx(lucideReact.Clock,{className:"w-3 h-3 mr-1"}),x(i)]}),d&&l&&jsxRuntime.jsx("button",{onClick:l,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors p-1 rounded",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[t&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-4 leading-relaxed",children:t}),a&&jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsxs("button",{onClick:()=>v(!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?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsxRuntime.jsx(lucideReact.Box,{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),h&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsxRuntime.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&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("button",{onClick:()=>C(!p),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:[p?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsxRuntime.jsx(lucideReact.Terminal,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),p&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsxRuntime.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)})})]}),s&&jsxRuntime.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 dark:border-gray-800 flex justify-end",children:jsxRuntime.jsx("button",{onClick:s,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"})})]})]})},el=SS;var TS=({data:e})=>{if(!e)return null;let t=ht.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?jsxRuntime.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"}):jsxRuntime.jsx("div",{className:"w-full my-4",children:jsxRuntime.jsx(La,{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]})})},tl=TS;var FS=({title:e,subtitle:t,data:o,type:a,config:r={}})=>{let n=()=>{switch(a){case "bar-chart-card":return jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4 text-blue-500"});case "line-chart-card":return jsxRuntime.jsx(lucideReact.LineChart,{className:"w-4 h-4 text-green-500"});case "pie-chart-card":return jsxRuntime.jsx(lucideReact.PieChart,{className:"w-4 h-4 text-purple-500"});case "combo-chart-card":return jsxRuntime.jsx(lucideReact.Activity,{className:"w-4 h-4 text-orange-500"});case "heatmap-chart-card":return jsxRuntime.jsx(lucideReact.Grid,{className:"w-4 h-4 text-red-500"});case "fishbone-chart-card":return jsxRuntime.jsx(lucideReact.GitBranch,{className:"w-4 h-4 text-indigo-500"});case "waterfall-chart-card":return jsxRuntime.jsx(lucideReact.TrendingDown,{className:"w-4 h-4 text-teal-500"});case "google-map-card":return jsxRuntime.jsx(lucideReact.Globe,{className:"w-4 h-4 text-blue-600"});case "amap-card":return jsxRuntime.jsx(lucideReact.MapPin,{className:"w-4 h-4 text-blue-600"});default:return jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"})}},i=()=>{if(!o&&a!=="google-map-card"&&a!=="amap-card")return jsxRuntime.jsx("div",{className:"text-gray-500 text-sm p-4 text-center",children:"No data available"});try{switch(a){case "bar-chart-card":return jsxRuntime.jsx(En,{data:o,orientation:r.orientation||"horizontal",valueSuffix:r.valueSuffix||"",minHeight:r.minHeight});case "line-chart-card":return jsxRuntime.jsx($d,{data:o,color:r.color,valueSuffix:r.valueSuffix||"",height:r.height});case "pie-chart-card":let c=o.reduce((l,s)=>l+(Number(s.value)||0),0),d=o.map(l=>({name:l.name,value:Number(l.value)||0,percent:typeof l.percent=="number"?l.percent:c>0?(Number(l.value)||0)/c*100:0}));return jsxRuntime.jsx(Vi,{data:d,variant:r.variant||"donut",size:r.size,colors:r.colors});case "combo-chart-card":return jsxRuntime.jsx(Hd,{data:o,barColor:r.barColor,lineColor:r.lineColor});case "heatmap-chart-card":return jsxRuntime.jsx(Ud,{data:o});case "fishbone-chart-card":return jsxRuntime.jsx(qd,{branches:o,effect:r.effect||e||"Problem"});case "waterfall-chart-card":return jsxRuntime.jsx(jd,{data:o,height:r.height});case "google-map-card":return jsxRuntime.jsx(Qd,{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 jsxRuntime.jsx(tp,{embedUrl:r.embedUrl||o&&o[0]?.embedUrl,keyword:r.keyword||o&&o[0]?.keyword||e,height:r.height});default:return jsxRuntime.jsxs("div",{className:"text-gray-500 text-sm p-4 text-center",children:["Unsupported chart type: ",a]})}}catch(c){return console.error("Error rendering chart:",c),jsxRuntime.jsx("div",{className:"text-red-500 text-sm p-4 text-center",children:"Error rendering chart"})}};return jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsx("div",{className:"mr-2 flex-shrink-0",children:n()}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",children:e}),t&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 truncate",children:t})]})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("div",{className:"overflow-x-auto",children:i()}),jsxRuntime.jsx("div",{className:"mt-3",children:jsxRuntime.jsxs("details",{className:"text-xs text-gray-500 dark:text-gray-400",children:[jsxRuntime.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"}),jsxRuntime.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)})]})})]})]})},ol=FS;var zS=({type:e,manifest:t})=>jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsx(lucideReact.Box,{className:"w-4 h-4 mr-2 text-blue-600 dark:text-blue-400"}),jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:["SAP Card: ",e]})]}),jsxRuntime.jsx("div",{className:"p-4",children:jsxRuntime.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:jsxRuntime.jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 whitespace-pre-wrap",children:JSON.stringify(t,null,2)})})})]}),rl=zS;var nl=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 HS=({content:e,theme:t,size:o="base",className:a,enableCodeHighlight:r=true,enableMermaid:n=true,messageId:i,cardHooks:c})=>{let d=ht.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,v,p)=>{c?.onCardEvent?.({messageId:i,cardType:f,action:u,title:h,payload:v,rawData:p});},s=(f,u,h,v,p,C)=>{if(!(!p&&!c?.onCardEvent))return (...m)=>{let y=p?.(...m),x=C?C(...m):void 0;return l(f,u,h,x,v),y}},g=ht.useMemo(()=>({div(f){let{"data-component":u,"data-think-content":h,...v}=f;return u==="thinkbox"&&h?jsxRuntime.jsx(Hm,{content:decodeURIComponent(h),theme:t,size:o,defaultExpanded:false}):jsxRuntime.jsx("div",{...v})},table({children:f}){return jsxRuntime.jsx("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-gray-200 dark:border-gray-800",children:jsxRuntime.jsx("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:f})})},thead({children:f}){return jsxRuntime.jsx("thead",{className:"bg-gray-50 dark:bg-gray-900/60",children:f})},tbody({children:f}){return jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-950",children:f})},tr({children:f}){return jsxRuntime.jsx("tr",{className:"border-b border-gray-200 dark:border-gray-800 last:border-b-0",children:f})},th({children:f,align:u}){return jsxRuntime.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 jsxRuntime.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,...v}){let p=/language-([\w-]+)/.exec(u||""),C=p?p[1]:"";if(f)return jsxRuntime.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",...v,children:h});let m=String(h).replace(/\n$/,"");if(n&&C==="mermaid")return jsxRuntime.jsx(jm,{content:m});if(C==="json"){let y=nl(m);if(y)switch(y.type){case "table":return jsxRuntime.jsx(tl,{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 jsxRuntime.jsx(ol,{...y});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(rl,{...y});case "error-card":{let x=y;return jsxRuntime.jsx(Qs,{...x,onClose:s("error-card","close",x.title,x,x.onClose),onRetry:s("error-card","retry",x.title,x,x.onRetry)})}case "warning-card":{let x=y,S=x.onConfirm?s("warning-card","confirm",x.title,x,x.onConfirm):x.actionText&&c?.onCardEvent?s("warning-card","confirm",x.title,x):void 0;return jsxRuntime.jsx(Ys,{...x,onClose:s("warning-card","close",x.title,x,x.onClose),onConfirm:S})}case "suggestions-card":{let x=y;return jsxRuntime.jsx(Js,{...x,onClose:s("suggestions-card","close",x.title,x,x.onClose),onSuggestionClick:s("suggestions-card","suggestion-click",x.title,x,x.onSuggestionClick,S=>({suggestion:S}))})}case "tool-result-card":{let x=y;return jsxRuntime.jsx(el,{...x,onClose:s("tool-result-card","close",x.title,x,x.onClose),onAction:s("tool-result-card","action",x.title,x,x.onAction)})}}}return r?jsxRuntime.jsx(Um,{content:m,language:C,className:"not-prose"}):jsxRuntime.jsx("code",{className:u,...v,children:h})}}),[t,o,n,r,c,i]);return jsxRuntime.jsx("div",{className:De("markdown-body prose dark:prose-invert max-w-none",a),children:jsxRuntime.jsx(NS__default.default,{remarkPlugins:[VS__default.default,OS__default.default],rehypePlugins:[WS__default.default,$S__default.default],components:g,children:d})})},il=HS;var GS=({content:e,messageId:t,cardHooks:o})=>{let a=(i,c,d,l,s)=>{o?.onCardEvent?.({messageId:t,cardType:i,action:c,title:d,payload:l,rawData:s});},r=(i,c,d,l,s,g)=>{if(!(!s&&!o?.onCardEvent))return (...f)=>{let u=s?.(...f),h=g?g(...f):void 0;return a(i,c,d,h,l),u}},n=nl(e);if(n)switch(n.type){case "table":return jsxRuntime.jsx(tl,{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 jsxRuntime.jsx(ol,{...n});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(rl,{...n});case "error-card":{let i=n;return jsxRuntime.jsx(Qs,{...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,c=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 jsxRuntime.jsx(Ys,{...i,onClose:r("warning-card","close",i.title,i,i.onClose),onConfirm:c})}case "suggestions-card":{let i=n;return jsxRuntime.jsx(Js,{...i,onClose:r("suggestions-card","close",i.title,i,i.onClose),onSuggestionClick:r("suggestions-card","suggestion-click",i.title,i,i.onSuggestionClick,c=>({suggestion:c}))})}case "tool-result-card":{let i=n;return jsxRuntime.jsx(el,{...i,onClose:r("tool-result-card","close",i.title,i,i.onClose),onAction:r("tool-result-card","action",i.title,i,i.onAction)})}}return jsxRuntime.jsx("div",{className:"dynamic-card-fallback",children:jsxRuntime.jsx(il,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:o})})},rg=GS;var ed=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"}}},KS=({content:e,className:t="",messageId:o,cardHooks:a})=>{let r=ht__namespace.default.useMemo(()=>ed.analyze(e),[e]);return jsxRuntime.jsx("div",{className:`universal-content-renderer ${t}`,children:r.blocks.map((n,i)=>n.type==="mixed"||n.type==="json-card"?jsxRuntime.jsx(rg,{content:n.content,messageId:o,cardHooks:a},`block-${i}`):jsxRuntime.jsx(il,{content:n.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:a},`block-${i}`))})},ng=KS;var qS=({content:e,isStreaming:t=true,onComplete:o,className:a="",streamIntervalMs:r=24,streamChunkSize:n=3,messageId:i,cardHooks:c})=>{let[d,l]=ht.useState(t?0:e.length),[s,g]=ht.useState(!t);ht.useEffect(()=>{if(t){l(0),g(false);return}l(e.length),g(true);},[e,t]),ht.useEffect(()=>{if(!t||s)return;if(d>=e.length){g(true),o?.();return}let p=window.setTimeout(()=>{l(C=>Math.min(C+n,e.length));},r);return ()=>{window.clearTimeout(p);}},[e.length,s,t,o,n,r,d]);let f=()=>{t&&!s&&(l(e.length),g(true),o?.());},u=t?e.slice(0,d):e,h=t&&!s,v=t&&!s;return jsxRuntime.jsxs("div",{className:`streaming-markdown ${a}`,onClick:f,style:{cursor:t?"pointer":"default"},children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(ng,{content:u,messageId:i,cardHooks:c}),h&&jsxRuntime.jsx("span",{className:"inline-block w-0.5 h-5 bg-blue-500 ml-1 animate-pulse",style:{verticalAlign:"text-bottom"}})]}),v&&jsxRuntime.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"})]})},cg=qS;var dg=({buttons:e,className:t})=>{let o=a=>{switch(a){case "copy":return jsxRuntime.jsx(lucideReact.Copy,{size:14});case "refresh":return jsxRuntime.jsx(lucideReact.RefreshCw,{size:14});case "volume":return jsxRuntime.jsx(lucideReact.Volume2,{size:14});case "like":return jsxRuntime.jsx(lucideReact.ThumbsUp,{size:14});case "dislike":return jsxRuntime.jsx(lucideReact.ThumbsDown,{size:14});default:return null}};return jsxRuntime.jsx("div",{className:De("flex items-center gap-1",t),children:e.map((a,r)=>jsxRuntime.jsx("button",{onClick:a.onClick,disabled:a.disabled,className:De("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 sl=({message:e,onStreamingComplete:t,assistantActions:o,streamIntervalMs:a,streamChunkSize:r,cardHooks:n})=>e.type==="assistant"?jsxRuntime.jsx("div",{className:"flex justify-start mb-4",children:jsxRuntime.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:[jsxRuntime.jsx(cg,{content:e.content,isStreaming:e.isStreaming??false,onComplete:t,streamIntervalMs:a,streamChunkSize:r,messageId:e.id,cardHooks:n}),e.content&&o?.isLatestAssistant&&jsxRuntime.jsx("div",{className:"flex flex-row justify-start gap-2 mt-3 pt-2 border-t border-gray-100 dark:border-gray-700",children:jsxRuntime.jsx(dg,{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"})}),jsxRuntime.jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})}):jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.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:[jsxRuntime.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}),jsxRuntime.jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})});var ug=({onTextUpdate:e,onComplete:t,onCancel:o,disabled:a,className:r})=>{let{isRecording:n,startRecording:i,stopRecording:c}=Xs({onTextUpdate:e,onComplete:l=>{t?.(l);},onError:l=>{console.error("Voice input error:",l),o?.();}});return jsxRuntime.jsx("button",{onClick:async()=>{n?c():await i();},disabled:a,className:De("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?jsxRuntime.jsx(JS__default.default,{sx:{fontSize:24}}):jsxRuntime.jsx(YS__default.default,{sx:{fontSize:24}})})};var yt={container:"w-full max-w-4xl mx-auto",inputContainer:De("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:De("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:De("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:De("bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400","cursor-pointer active:scale-95"),sendButton:De("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:De("cursor-not-allowed opacity-40 bg-transparent text-gray-400"),stopButton:De("cursor-pointer bg-red-500 hover:bg-red-600 text-white shadow-sm active:scale-95")},sw={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},lw=({enabled:e,onClick:t})=>jsxRuntime.jsx("button",{className:De(yt.buttonBase,yt.buttonSmall,yt.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsxRuntime.jsx(nw__default.default,{sx:{fontSize:24}})}),cw=()=>jsxRuntime.jsxs("button",{className:De(yt.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",yt.buttonNormal),"aria-label":"Tools",type:"button",children:[jsxRuntime.jsx(iw__default.default,{sx:{fontSize:20}}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),dw=({canSend:e,isResponding:t,onSend:o,onStop:a})=>t?jsxRuntime.jsx("button",{className:De(yt.buttonBase,yt.buttonSmall,yt.stopButton),onClick:a,"aria-label":"Stop generating",type:"button",children:jsxRuntime.jsx(iconsMaterial.Stop,{sx:{fontSize:20}})}):jsxRuntime.jsx("button",{className:De(yt.buttonBase,yt.buttonSmall,e?yt.sendButton:yt.sendButtonDisabled),onClick:o,disabled:!e,"aria-label":"Send message",type:"button",children:jsxRuntime.jsx(rw__default.default,{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]=ht.useState(""),[c,d]=ht.useState([]),[l,s]=ht.useState(false),[g,f]=ht.useState(false),u=ht.useRef(null),h=a||(r?r("00019","Type a message..."):"Type a message..."),v=(n.trim().length>0||c.length>0)&&!o,p={enabled:true},C=ht.useCallback(M=>{i(M.target.value),M.target.style.height="auto",M.target.style.height=`${Math.min(M.target.scrollHeight,200)}px`;},[]),m=ht.useCallback(M=>{if(M.target.files&&M.target.files.length>0){let H=Array.from(M.target.files);d(V=>{let J=H.filter(te=>V.some(ne=>ne.name===te.name&&ne.size===te.size));J.length>0&&console.warn("Duplicate files ignored:",J.map(te=>te.name));let ce=H.filter(te=>!V.some(ne=>ne.name===te.name&&ne.size===te.size));return [...V,...ce]}),u.current&&(u.current.value="");}},[]),y=ht.useCallback(M=>{d(H=>H.filter((V,J)=>J!==M));},[]),x=ht.useCallback(()=>{u.current?.click();},[]),S=ht.useCallback(async()=>{if(!v)return;let M=n,H=[...c];i(""),d([]),u.current&&(u.current.value="");try{await e(M,H);}catch(V){console.error("Failed to send message:",V),i(M),d(H);}},[n,v,e,c]),B=ht.useCallback(M=>{M.key==="Enter"&&!M.shiftKey&&!l&&(M.preventDefault(),S());},[S,l]),R=ht.useCallback(()=>{s(true);},[]),w=ht.useCallback(()=>{s(false);},[]),A=ht.useCallback(M=>{i(M);},[]),P=ht.useCallback(M=>{i(M);},[]),k=ht.useCallback(()=>{},[]),D=ht.useCallback(M=>{M.preventDefault(),f(true);},[]),T=ht.useCallback(M=>{M.preventDefault(),f(false);},[]),I=ht.useCallback(M=>{if(M.preventDefault(),f(false),M.dataTransfer.files&&M.dataTransfer.files.length>0){let H=Array.from(M.dataTransfer.files);d(V=>[...V,...H]);}},[]);return jsxRuntime.jsx("div",{className:yt.container,children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"file",multiple:true,className:"hidden",ref:u,onChange:m}),jsxRuntime.jsxs("div",{className:De(yt.inputContainer,g&&yt.dragActive),style:{borderRadius:"32px"},onDragOver:D,onDragLeave:T,onDrop:I,children:[c.length>0&&jsxRuntime.jsx("div",{className:yt.filePreviewArea,children:c.map((M,H)=>jsxRuntime.jsxs("div",{className:yt.fileTag,children:[jsxRuntime.jsx(iconsMaterial.InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsxRuntime.jsx("span",{className:"truncate max-w-[150px]",children:M.name}),jsxRuntime.jsx("button",{onClick:()=>y(H),className:"ml-1 hover:text-red-500 focus:outline-none",type:"button",children:jsxRuntime.jsx(iconsMaterial.Close,{sx:{fontSize:16}})})]},`${M.name}-${H}`))}),jsxRuntime.jsxs("div",{className:"flex flex-col w-full p-2",children:[jsxRuntime.jsx("div",{className:De(yt.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsxRuntime.jsx("textarea",{className:De(yt.textarea,"min-h-[24px] py-0 px-0"),placeholder:h,value:n,onChange:C,onKeyDown:B,onCompositionStart:R,onCompositionEnd:w,style:sw,"aria-label":"Message input",spellCheck:false,rows:1})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-1 pb-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:[jsxRuntime.jsx(lw,{enabled:p.enabled,onClick:x}),jsxRuntime.jsx(cw,{})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(ug,{onTextUpdate:A,onComplete:P,onCancel:k,disabled:o,className:yt.buttonSmall}),jsxRuntime.jsx(dw,{canSend:v,isResponding:o,onSend:S,onStop:t})]})]})]})]})]})})};var hg=({messages:e,onSend:t,onStop:o,onRegenerate:a,isResponding:r=false,className:n,placeholder:i,streamIntervalMs:c,streamChunkSize:d,onMessageStreamingComplete:l,cardHooks:s,showInput:g=true})=>{let f=ht.useRef(null),u=ht.useRef(e.length);return ht.useEffect(()=>{e.length>u.current&&f.current?.scrollIntoView({behavior:"smooth"}),u.current=e.length;},[e]),jsxRuntime.jsxs("div",{className:De("flex flex-col h-full w-full relative",n),children:[jsxRuntime.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,v)=>{let p=h.type==="assistant"&&v===e.length-1,C=h.type==="assistant"?{isLatestAssistant:p,onRegenerate:a?()=>a(h.id):void 0}:void 0;return jsxRuntime.jsx(sl,{message:h,assistantActions:C,onStreamingComplete:()=>l?.(h.id),streamIntervalMs:c,streamChunkSize:d,cardHooks:s},h.id)}),jsxRuntime.jsx("div",{ref:f})]}),g&&jsxRuntime.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:jsxRuntime.jsx(mg,{onSend:t||(async()=>{}),onStop:o||(()=>{}),isResponding:r,placeholder:i})})]})};var ho={};var mw={idle:"Idle",running:"Running",success:"Success",error:"Error",pending:"Pending"},Lz=({title:e="AI Agent",description:t,headerActions:o,className:a,agentStatus:r,showInput:n=false,...i})=>{let c=r??(i.isResponding?"running":"idle");return jsxRuntime.jsxs("div",{className:De("relative flex h-full w-full",ho.agentPanel,a),"data-status":c,children:[jsxRuntime.jsx("div",{className:ho.colorHalo,"data-status":c,"aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:ho.marqueeBorder,"data-status":c,"aria-hidden":"true",children:[jsxRuntime.jsx("span",{className:De(ho.edge,ho.top)}),jsxRuntime.jsx("span",{className:De(ho.edge,ho.right)}),jsxRuntime.jsx("span",{className:De(ho.edge,ho.bottom)}),jsxRuntime.jsx("span",{className:De(ho.edge,ho.left)})]}),jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e}),t&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.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:[jsxRuntime.jsx("span",{className:ho.statusDot,"data-status":c}),jsxRuntime.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-gray-600 dark:text-gray-300",children:mw[c]})]}),o]})]}),jsxRuntime.jsx("div",{className:"flex-1 min-h-0 relative z-10",children:jsxRuntime.jsx(hg,{...i,showInput:n})})]})]})};var bw={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},Gz=({messages:e,onSend:t,onRegenerate:o,isResponding:a=false,className:r,placeholder:n,title:i="Copilot",corner:c="bottom-right",onCollapse:d,onHeaderPointerDown:l,onPlusClick:s,onMicClick:g,streamIntervalMs:f,streamChunkSize:u,onMessageStreamingComplete:h,cardHooks:v})=>{let[p,C]=ht.useState(""),[m,y]=ht.useState(false),x=ht.useRef(null),S=bw[c];ht.useEffect(()=>{x.current?.scrollIntoView({behavior:"smooth"});},[e,a]);let B=ht.useCallback(async()=>{let w=p.trim();!w||a||(C(""),await t(w));},[a,t,p]),R=ht.useCallback(async w=>{w.key==="Enter"&&!m&&(w.preventDefault(),await B());},[B,m]);return jsxRuntime.jsxs("div",{className:De("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:[d&&jsxRuntime.jsx("button",{onClick:d,className:De("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",S==="top-left"&&"-left-2 -top-2",S==="top-right"&&"-right-2 -top-2",S==="bottom-left"&&"-bottom-2 -left-2",S==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:jsxRuntime.jsx("span",{className:De("block h-4 w-4 border-[#21BCFF]",S==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",S==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",S==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",S==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 px-4 py-3 dark:border-gray-800",onPointerDown:l,children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsx("h3",{className:"text-base font-semibold tracking-tight text-gray-900 dark:text-gray-100",children:i})}),jsxRuntime.jsx("div",{})]}),jsxRuntime.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((w,A)=>{let P=w.type==="assistant"&&A===e.length-1,k=w.type==="assistant"?{isLatestAssistant:P,onRegenerate:o?()=>o(w.id):void 0}:void 0;return jsxRuntime.jsx(sl,{message:w,assistantActions:k,onStreamingComplete:()=>h?.(w.id),streamIntervalMs:f,streamChunkSize:u,cardHooks:v},w.id)}),jsxRuntime.jsx("div",{ref:x})]}),jsxRuntime.jsx("div",{className:"border-t border-gray-100 px-3 py-3 dark:border-gray-800",children:jsxRuntime.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:[jsxRuntime.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:s,type:"button","aria-label":"Add",children:jsxRuntime.jsx(lucideReact.Plus,{className:"h-4 w-4"})}),jsxRuntime.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:p,onChange:w=>C(w.target.value),onCompositionStart:()=>y(true),onCompositionEnd:()=>y(false),onKeyDown:R,"aria-label":"Copilot input",spellCheck:false}),jsxRuntime.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:jsxRuntime.jsx(lucideReact.Mic,{className:"h-4 w-4"})})]})})]})};var _z=({defaultMode:e="login",onLogin:t,onRegister:o,onForgotPassword:a}={})=>{let[r,n]=ht.useState(e),[i,c]=ht.useState(false),d=ht.useCallback(async u=>{c(true);try{await u?.();}finally{c(false);}},[]),l=ht.useCallback(u=>d(()=>t?.(u)),[t,d]),s=ht.useCallback(u=>d(()=>o?.(u)),[o,d]),g=ht.useCallback(u=>d(()=>a?.(u)),[a,d]),f=ht.useMemo(()=>({mode:r,loading:i,onModeChange:n,onLogin:l,onRegister:s,onForgotPassword:g}),[g,l,s,i,r]);return {mode:r,loading:i,setMode:n,authPageProps:f}};var ad=({label:e,...t})=>jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{...t}),label:e});var xi=ht.forwardRef((e,t)=>jsxRuntime.jsx(material.Paper,{ref:t,...e,elevation:e.elevation||1,sx:{p:2,mb:2,...e.sx}}));xi.displayName="CPaper";var Aw={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."},mN=({mode:e,defaultMode:t="login",onModeChange:o,onLogin:a,onRegister:r,onForgotPassword:n,loading:i=false,logo:c,copy:d,sx:l})=>{let s=material.useTheme(),g=e!==void 0,[f,u]=ht.useState(t),h=e??f,v=ht.useMemo(()=>({...Aw,...d}),[d]),[p,C]=ht.useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[m,y]=ht.useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[x,S]=ht.useState({email:""}),[B,R]=ht.useState(""),w=I=>{g||u(I),R(""),o?.(I);},A=async I=>{I.preventDefault(),await a?.(p),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.");},k=async I=>{I.preventDefault(),await n?.(x),R("Demo reset link request created. No email was sent.");},D=h==="login"?v.loginTitle:h==="register"?v.registerTitle:v.forgotTitle,T=h==="login"?v.loginSubtitle:h==="register"?v.registerSubtitle:v.forgotSubtitle;return jsxRuntime.jsxs(material.Box,{sx:{minHeight:"100vh",display:"grid",gridTemplateColumns:{xs:"1fr",md:"minmax(320px, 0.9fr) minmax(420px, 1.1fr)"},background:s.palette.mode==="dark"?"linear-gradient(135deg, #071018 0%, #151515 48%, #101827 100%)":"linear-gradient(135deg, #eef3f8 0%, #ffffff 52%, #e8f2f0 100%)",...l},children:[jsxRuntime.jsxs(material.Box,{sx:{display:{xs:"none",md:"flex"},flexDirection:"column",justifyContent:"space-between",p:{md:6,lg:8},borderRight:`1px solid ${s.palette.divider}`},children:[jsxRuntime.jsxs(material.Stack,{spacing:4,children:[jsxRuntime.jsx(material.Box,{children:c}),jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:14,fontWeight:700,color:"primary.main",textTransform:"uppercase"},children:v.productName}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:{md:34,lg:42},lineHeight:1.06,fontWeight:800},children:v.headline}),jsxRuntime.jsx(material.Typography,{sx:{maxWidth:460,color:"text.secondary",fontSize:16,lineHeight:1.7},children:v.subheadline})]})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:2,sx:{color:"text.secondary",fontSize:13},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",children:"Reports"}),jsxRuntime.jsx(material.Typography,{variant:"caption",children:"Planning"}),jsxRuntime.jsx(material.Typography,{variant:"caption",children:"Agent UI"})]})]}),jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",p:{xs:2,sm:4,md:6}},children:jsxRuntime.jsx(xi,{elevation:0,sx:{width:"100%",maxWidth:460,m:0,p:{xs:2.5,sm:4},borderRadius:3,border:`1px solid ${s.palette.divider}`,backgroundColor:s.palette.mode==="dark"?"rgba(15, 23, 42, 0.86)":"rgba(255, 255, 255, 0.88)",backdropFilter:"blur(18px)",boxShadow:s.palette.mode==="dark"?"0 24px 80px rgba(0,0,0,0.34)":"0 24px 80px rgba(15,23,42,0.10)"},children:jsxRuntime.jsxs(material.Stack,{spacing:3,children:[jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.Box,{sx:{display:{xs:"block",md:"none"},mb:1},children:c}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:28,fontWeight:800},children:D}),jsxRuntime.jsx(material.Typography,{sx:{color:"text.secondary"},children:T})]}),B&&jsxRuntime.jsx(material.Alert,{severity:"success",children:B}),h==="login"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:A,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(Kt,{label:"Email or user ID",value:p.username,onChange:I=>C(M=>({...M,username:I.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(kg__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Kt,{label:"Password",type:"password",value:p.password,onChange:I=>C(M=>({...M,password:I.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Dw__default.default,{fontSize:"small"})})}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[jsxRuntime.jsx(ad,{label:"Remember me",checked:p.remember,onChange:I=>C(M=>({...M,remember:I.target.checked}))}),jsxRuntime.jsx(Mo,{type:"button",variant:"text",size:"small",onClick:()=>w("forgot"),children:"Forgot?"})]}),jsxRuntime.jsx(Mo,{type:"submit",size:"large",disabled:i,children:"Sign in"}),jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["New user?"," ",jsxRuntime.jsx(Mo,{type:"button",variant:"text",size:"small",onClick:()=>w("register"),sx:{minWidth:0,p:0},children:"Register"})]})]})}),h==="register"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:P,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(Kt,{label:"Full name",value:m.name,onChange:I=>y(M=>({...M,name:I.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(kg__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Kt,{label:"Work email",type:"email",value:m.email,onChange:I=>y(M=>({...M,email:I.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Cg__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Kt,{label:"Password",type:"password",value:m.password,onChange:I=>y(M=>({...M,password:I.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Mw__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Kt,{label:"Confirm password",type:"password",value:m.confirmPassword,onChange:I=>y(M=>({...M,confirmPassword:I.target.value}))}),jsxRuntime.jsx(ad,{label:"I accept the demo workspace terms",checked:m.acceptedTerms,onChange:I=>y(M=>({...M,acceptedTerms:I.target.checked}))}),jsxRuntime.jsx(Mo,{type:"submit",size:"large",disabled:i,children:"Create demo account"}),jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["Already have an account?"," ",jsxRuntime.jsx(Mo,{type:"button",variant:"text",size:"small",onClick:()=>w("login"),sx:{minWidth:0,p:0},children:"Sign in"})]})]})}),h==="forgot"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:k,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(Kt,{label:"Work email",type:"email",value:x.email,onChange:I=>S({email:I.target.value}),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Cg__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Mo,{type:"submit",size:"large",disabled:i,children:"Send reset request"}),jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["Remember your password?"," ",jsxRuntime.jsx(Mo,{type:"button",variant:"text",size:"small",onClick:()=>w("login"),sx:{minWidth:0,p:0},children:"Back to sign in"})]})]})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{color:"text.secondary"},children:"Demo credentials: demo@orbcafe.local / orbcafe-demo"})]})})})]})};var Fw={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},Lw=[{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"}],Sg=({tasks:e,defaultScale:t="week",defaultSelectedTaskId:o,initialFilters:a,filterFields:r,filterAppId:n="planning-gantt-filter",filterTableKey:i="planning",onFilterSearch:c,onFilterVariantLoad:d,enableRowReorder:l,onTaskReorder:s})=>{let[g,f]=ht.useState(t),[u,h]=ht.useState(o??e[0]?.id??""),[v,p]=ht.useState({...Fw,...a}),C=ht.useMemo(()=>{let S=String(v.keyword?.value??"").trim().toLowerCase(),B=String(v.status?.value??"").trim(),R=String(v.owner?.value??"").trim().toLowerCase(),w=String(v.workCenter?.value??"").trim().toLowerCase(),A=v.dateRange?.value,P=A?.[0]?_a__default.default(A[0]):null,k=A?.[1]?_a__default.default(A[1]):null;return e.filter(D=>{if(S&&![D.id,D.code,D.title,D.project,D.workCenter,D.owner?.name].join(" ").toLowerCase().includes(S)||B&&D.status!==B||R&&!String(D.owner?.name??"").toLowerCase().includes(R)||w&&!String(D.workCenter??"").toLowerCase().includes(w))return false;if(P||k){let T=_a__default.default(D.startDate),I=_a__default.default(D.endDate),M=P?I.isAfter(P)||I.isSame(P,"day"):true,H=k?T.isBefore(k)||T.isSame(k,"day"):true;if(!M||!H)return false}return true})},[v,e]);ht.useEffect(()=>{C.length!==0&&(C.some(S=>S.id===u)||h(C[0].id));},[C,u]);let m=ht.useCallback(S=>{h(S.id);},[]),y=ht.useMemo(()=>({appId:n,tableKey:i,fields:r??Lw,filters:v,onFilterChange:p,onVariantLoad:d??(()=>{}),onSearch:c??(()=>{})}),[n,r,i,v,c,d]),x=ht.useMemo(()=>({tasks:C,scale:g,onScaleChange:f,selectedTaskId:u,onTaskSelect:m,enableRowReorder:l,onTaskReorder:s}),[l,C,s,m,g,u]);return {scale:g,setScale:f,selectedTaskId:u,setSelectedTaskId:h,filters:v,setFilters:p,filteredTasks:C,smartFilterProps:y,planningGanttProps:x}};var CN=e=>{let t=Sg(e),o=ht.useMemo(()=>({filterProps:t.smartFilterProps,ganttProps:t.planningGanttProps}),[t.planningGanttProps,t.smartFilterProps]);return {...t,layoutProps:o}};var wg=e=>jsxRuntime.jsx(material.Chip,{...e,size:e.size||"small",variant:e.variant||"outlined"});var Ka=ht.forwardRef(({tooltip:e,...t},o)=>{let a=jsxRuntime.jsx(material.IconButton,{ref:o,...t,size:t.size||"small"});return e?jsxRuntime.jsx(material.Tooltip,{title:e,children:a}):a});Ka.displayName="CIconButton";var Ig=({label:e,options:t,minWidth:o=120,...a})=>jsxRuntime.jsxs(material.FormControl,{fullWidth:true,size:"small",sx:{minWidth:o},children:[e&&jsxRuntime.jsx(material.InputLabel,{children:e}),jsxRuntime.jsx(material.Select,{label:e,...a,children:t.map(r=>jsxRuntime.jsx(material.MenuItem,{value:r.value,children:r.label},r.value))})]});var sd=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],ld=56,Pr=58,cd=8,dd=260,d1=320,ja="220ms cubic-bezier(0.2, 0, 0, 1)",Mg={"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"}},p1=e=>e?Mg[e]?.label??e:"Planned",u1=e=>e?Mg[e]?.color??"default":"info",Ag=e=>Math.min(100,Math.max(0,e??0)),Bg=(e,t=0)=>e.flatMap(o=>[{...o,level:t},...Bg(o.children??[],t+1)]),m1=e=>({id:e.id,code:e.code??e.id,title:e.title,titleSub:e.project??e.workCenter??"General",owner:e.owner?.name??"Unassigned",status:p1(e.status),statusTone:e.status??"planned",progress:Ag(e.progress),startDate:e.startDate,endDate:e.endDate,color:e.color,reorderable:e.reorderable!==false}),Eg=(e,t)=>t==="month"?e.startOf("month"):t==="week"?e.startOf("week"):t==="day"?e.startOf("day"):e.startOf("hour"),Fg=(e,t)=>t==="month"?e.endOf("month"):t==="week"?e.endOf("week"):t==="day"?e.endOf("day"):e.endOf("hour"),g1=(e,t,o)=>{let a=[],r=Eg(e,o),n=Fg(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"),start:r,end:i}),r=i;}return a},Dg=(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},Lg=({title:e="Project Plan",subtitle:t="Task table and timeline view",extraTools:o,bodyHeight:a=560,tasks:r,scale:n="week",onScaleChange:i,timelineStart:c,timelineEnd:d,selectedTaskId:l,onTaskSelect:s,enableRowReorder:g=true,onTaskReorder:f,emptyLabel:u="No planning tasks available.",sx:h})=>{let v=material.useTheme(),p=ht.useRef(null),C=ht.useRef(null),m=ht.useRef(null),y=ht.useRef(false),[x,S]=ht.useState(null),[B,R]=ht.useState(null),[w,A]=ht.useState({}),[P,k]=ht.useState(ld),[D,T]=ht.useState([]),[I,M]=ht.useState({activeId:null,overId:null}),H=ht.useRef(null),V=ht.useMemo(()=>Bg(r),[r]),J=ht.useMemo(()=>{if(D.length===0)return V;let L=new Map(V.map(_=>[_.id,_])),$=D.map(_=>L.get(_)).filter(_=>!!_),j=new Set($.map(_=>_.id));return [...$,...V.filter(_=>!j.has(_.id))]},[V,D]),ce=ht.useMemo(()=>new Map(J.map(L=>[L.id,L])),[J]),te=ht.useMemo(()=>J.map(L=>m1(L)),[J]),ne=ht.useMemo(()=>new Map(te.map(L=>[L.id,L])),[te]),ee=ht.useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(L,$)=>jsxRuntime.jsxs(material.Stack,{spacing:.2,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:$.title}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:13,color:"text.secondary"},children:$.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(L,$)=>jsxRuntime.jsx(wg,{label:$.status,color:u1($.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:L=>jsxRuntime.jsxs(material.Stack,{spacing:.6,children:[jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{color:"text.secondary"},children:[L,"%"]}),jsxRuntime.jsx(material.LinearProgress,{variant:"determinate",value:L,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),Y=Yr({appId:"planning-gantt",title:e,columns:ee,rows:te,rowKey:"id",rowsPerPage:-1,rowsPerPageOptions:[-1],count:te.length,showSummary:false}),Ze=Y.visibleRows;ht.useEffect(()=>{let L=V.map($=>$.id);T($=>{let j=new Set(L),_=$.filter(z=>j.has(z)),ke=new Set(_),Ee=L.filter(z=>!ke.has(z)),Ye=[..._,...Ee];return Ye.length===$.length&&Ye.every((z,W)=>z===$[W])?$:Ye});},[V]);let Ue=L=>L.type==="group"?`group-${L.id}`:`row-${(L.data||L)?.id}`,ie=ht.useMemo(()=>{let L=te.map(W=>_a__default.default(W.startDate)),$=te.map(W=>_a__default.default(W.endDate)),j=c?_a__default.default(c):L.reduce((W,G)=>G.isBefore(W)?G:W,L[0]??_a__default.default()),_=d?_a__default.default(d):$.reduce((W,G)=>G.isAfter(W)?G:W,$[0]??_a__default.default().add(30,"day")),ke=n==="month"?"month":n==="week"?"week":n==="day"?"day":"hour",Ee=n==="month"?"month":n==="week"?"week":n==="day"?"day":"hour",Ye=n==="hour"?12:1,z=n==="hour"?12:1;return {start:Eg(j.subtract(Ye,ke),n),end:Fg(_.add(z,Ee),n)}},[te,n,d,c]),Ie=sd.find(L=>L.value===n)??sd[1],Fe=Array.isArray(o)?o:o?[o]:[],Oe=ht.useMemo(()=>g1(ie.start,ie.end,n),[ie.end,ie.start,n]),nt=Oe.length*Ie.width,Le=(Y.columns||[]).filter(L=>Y.visibleColumns.includes(L.id)).reduce((L,$)=>L+(Y.columnWidths?.[$.id]||$.minWidth||100),0),Xe=x??Le,Zt=B==="table",zt=B==="timeline",Qe=zt?0:Zt?"100%":Xe,lt=B==="timeline",mt=B==="table",_e=!lt&&!mt,K=Zt?"minmax(0, 1fr) 0px 0px":zt?"0px 0px minmax(0, 1fr)":`${Xe}px ${cd}px minmax(0, 1fr)`;ht.useEffect(()=>{S(L=>L===null?null:Math.min(Math.max(L,dd),Le));},[Le]);let Ce=L=>{L.preventDefault(),L.currentTarget.setPointerCapture(L.pointerId),R(null),H.current={startX:L.clientX,startWidth:Xe};let $=_=>{let ke=H.current;if(!ke)return;let Ee=p.current?.clientWidth??0,Ye=Ee>0?Math.max(dd,Ee-cd-d1):Le,z=Math.min(Math.max(ke.startWidth+_.clientX-ke.startX,dd),Ye);S(z);},j=()=>{H.current=null,window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",j),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",$),window.addEventListener("pointerup",j);},fe=()=>{R(null),S(null);},be=L=>!g||!L?false:ne.get(L)?.reorderable!==false,Ne=(L,$)=>{if(!L||!$||L===$||!be(L)||!be($))return false;if(Y.grouping.length===0)return true;let j=ne.get(L),_=ne.get($);return !j||!_?false:Y.grouping.every(ke=>j[ke]===_[ke])},Ve=(L,$)=>{if(!Ne(L,$))return;let j=Ze.filter(oe=>oe.type!=="group").map(oe=>String((oe.data||oe)?.id)),_=j.indexOf(L),ke=j.indexOf($);if(_<0||ke<0)return;let Ee=[...j];[Ee[_],Ee[ke]]=[Ee[ke],Ee[_]];let Ye=new Set(j),z=J.map(oe=>oe.id),W=[...Ee,...z.filter(oe=>!Ye.has(oe))],G=ce.get(L),ue=ce.get($);if(Y.setOrder("asc"),Y.setOrderBy(""),T(W),G&&ue){let{level:oe,...Se}=G,{level:ge,...Pe}=ue,he=W.reduce((ze,Be)=>{let we=ce.get(Be);if(we){let{level:Me,...Tt}=we;ze.push(Tt);}return ze},[]);f?.(he,{activeTask:Se,targetTask:Pe});}},Ht=(L,$)=>{if(!be($.id)){L.preventDefault();return}L.stopPropagation(),L.dataTransfer.effectAllowed="move",L.dataTransfer.setData("text/plain",$.id),M({activeId:$.id,overId:null}),s?.(ce.get($.id)||$);},Nt=(L,$)=>{if(!Ne(I.activeId,$)){M(j=>j.overId===null?j:{...j,overId:null});return}L.preventDefault(),L.stopPropagation(),L.dataTransfer.dropEffect="move",M(j=>j.overId===$?j:{...j,overId:$});},Xt=(L,$)=>{let j=I.activeId||L.dataTransfer.getData("text/plain");if(!Ne(j,$)){M({activeId:null,overId:null});return}L.preventDefault(),L.stopPropagation(),Ve(j,$),M({activeId:null,overId:null});},Qt=()=>{M({activeId:null,overId:null});},Yt=L=>{if(y.current)return;let $=L==="table"?C.current:m.current,j=L==="table"?m.current:C.current;!$||!j||(y.current=true,j.scrollTop=$.scrollTop,window.requestAnimationFrame(()=>{y.current=false;}));};return ht.useLayoutEffect(()=>{let L=C.current;if(!L)return;let $=0,j=()=>{let z=L.querySelector("thead"),W=Array.from(L.querySelectorAll("tbody tr[data-planning-row-key]"));if(W.length===0)return;let G=z?.getBoundingClientRect().height||ld,ue={};W.forEach(oe=>{let Se=oe.dataset.planningRowKey;Se&&(ue[Se]=oe.getBoundingClientRect().height);}),k(oe=>Math.abs(oe-G)<.01?oe:G),A(oe=>{let Se=Object.keys(oe),ge=Object.keys(ue);return Se.length===ge.length&&ge.every(Pe=>Math.abs((oe[Pe]??0)-ue[Pe])<.01)?oe:ue});},_=()=>{window.cancelAnimationFrame($),$=window.requestAnimationFrame(j);};if(j(),typeof ResizeObserver>"u")return window.addEventListener("resize",_),()=>{window.cancelAnimationFrame($),window.removeEventListener("resize",_);};let ke=new ResizeObserver(_),Ee=L.querySelector("table"),Ye=L.querySelector("thead");return Ee&&ke.observe(Ee),Ye&&ke.observe(Ye),L.querySelectorAll("tbody tr[data-planning-row-key]").forEach(z=>ke.observe(z)),window.addEventListener("resize",_),()=>{window.cancelAnimationFrame($),ke.disconnect(),window.removeEventListener("resize",_);}},[Ze,Y.visibleColumns,Y.grouping,Y.columnWidths]),jsxRuntime.jsxs(xi,{elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:3,border:`1px solid ${v.palette.divider}`,backgroundColor:v.palette.background.paper,...h},children:[jsxRuntime.jsxs(material.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 ${v.palette.divider}`},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[jsxRuntime.jsx(material.Box,{sx:{width:38,height:38,borderRadius:2,display:"grid",placeItems:"center",backgroundColor:"primary.main",color:"primary.contrastText"},children:jsxRuntime.jsx(t1__default.default,{fontSize:"small"})}),jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:18,fontWeight:800},children:e}),jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{color:"text.secondary"},children:t})]})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{flexWrap:"wrap"},children:[Fe.length>0&&jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,alignItems:"center",children:Fe.map((L,$)=>jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center"},children:L},`planning-extra-tool-${$}`))}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(Ka,{tooltip:"Column visibility",onClick:L=>Y.setAnchorEl(L.currentTarget),color:"default",children:jsxRuntime.jsx(zf__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Ka,{tooltip:"Group by",onClick:L=>Y.setGroupAnchorEl(L.currentTarget),color:"default",children:jsxRuntime.jsx(Of__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Ka,{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:jsxRuntime.jsx(l1__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(Ka,{tooltip:"Expand task table",onClick:()=>R("table"),color:B==="table"?"primary":"default",children:jsxRuntime.jsx(i1__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Ka,{tooltip:"Reset split",onClick:fe,color:B===null?"primary":"default",children:jsxRuntime.jsx(s1__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Ka,{tooltip:"Expand timeline",onClick:()=>R("timeline"),color:B==="timeline"?"primary":"default",children:jsxRuntime.jsx(n1__default.default,{fontSize:"small"})})]}),jsxRuntime.jsx(material.Box,{sx:{minWidth:120},children:jsxRuntime.jsx(Ig,{label:"",value:n,options:sd.map(L=>({value:L.value,label:L.label})),onChange:L=>i?.(L.target.value),sx:{"& .MuiSelect-select":{fontSize:"0.92rem",py:.65},"& .MuiSvgIcon-root":{fontSize:20}}})})]})]}),te.length===0?jsxRuntime.jsx(material.Box,{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:u}):jsxRuntime.jsx(material.Box,{sx:{overflow:"hidden",flex:1,minHeight:0},children:jsxRuntime.jsxs(material.Box,{ref:p,sx:{height:"100%",display:"grid",gridTemplateColumns:K,transition:`grid-template-columns ${ja}`},children:[jsxRuntime.jsx(material.TableContainer,{"data-planning-scroll-pane":"table",ref:C,onScroll:()=>Yt("table"),sx:{width:Qe,height:a,overflowX:"auto",overflowY:"auto",opacity:lt?0:1,transform:lt?"translateX(-10px)":"translateX(0)",pointerEvents:lt?"none":"auto",transition:`opacity ${ja}, transform ${ja}, width ${ja}`},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,sx:{tableLayout:"fixed",width:Le,"& thead .MuiTableCell-root":{height:ld,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[jsxRuntime.jsx(Ti,{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}),jsxRuntime.jsx(material.TableBody,{children:Ze.map(L=>{let $=Ue(L);if(L.type==="group")return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":$,sx:{height:Pr,backgroundColor:v.palette.action.hover},children:[Y.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{width:44,height:Pr,py:0,borderBottom:`1px solid ${v.palette.divider}`},children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>Y.toggleGroupExpand(L.id),children:L.isExpanded?jsxRuntime.jsx(ch__default.default,{fontSize:"small"}):jsxRuntime.jsx(qf__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.TableCell,{colSpan:Y.visibleColumns.length,sx:{height:Pr,py:0,borderBottom:`1px solid ${v.palette.divider}`},children:jsxRuntime.jsxs(material.Typography,{sx:{fontSize:13,fontWeight:700},children:[L.field,": ",L.value," (",L.count,")"]})})]},L.id);let j=L.data||L,_=j.id===l,ke=be(j.id),Ee=I.activeId===j.id,Ye=I.overId===j.id&&Ne(I.activeId,j.id);return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":$,draggable:ke,hover:true,selected:_,onDragStart:z=>Ht(z,j),onDragOver:z=>Nt(z,j.id),onDragEnter:z=>Nt(z,j.id),onDrop:z=>Xt(z,j.id),onDragEnd:Qt,onClick:()=>s?.(ce.get(j.id)||j),sx:{cursor:Ee?"grabbing":ke?"grab":s?"pointer":"default",height:Pr,opacity:Ee?.56:1,boxShadow:Ye?`inset 0 0 0 2px ${v.palette.primary.main}`:"none",transition:"background-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease"},children:[Y.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{width:44,height:Pr,py:0,borderBottom:`1px solid ${v.palette.divider}`}}),(Y.columns||[]).filter(z=>Y.visibleColumns.includes(z.id)).map(z=>jsxRuntime.jsx(material.TableCell,{sx:{width:Y.columnWidths?.[z.id]||z.minWidth||100,height:Pr,py:0,overflow:"hidden",borderBottom:`1px solid ${v.palette.divider}`},children:z.render?z.render(j[z.id],j):String(j[z.id]??"-")},`${j.id}-${z.id}`))]},j.id)})})]})}),jsxRuntime.jsx(material.Box,{onPointerDown:_e?Ce:void 0,role:"separator","aria-orientation":"vertical",sx:{width:_e?cd:0,cursor:_e?"col-resize":"default",opacity:_e?1:0,pointerEvents:_e?"auto":"none",borderLeft:_e?`1px solid ${v.palette.divider}`:"0 solid transparent",borderRight:_e?`1px solid ${v.palette.divider}`:"0 solid transparent",backgroundColor:v.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:v.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:_e?"col-resize":"default"}}}),jsxRuntime.jsx(material.Box,{sx:{minWidth:0,overflow:"hidden",opacity:mt?0:1,transform:mt?"translateX(10px)":"translateX(0)",pointerEvents:mt?"none":"auto",transition:`opacity ${ja}, transform ${ja}`},children:jsxRuntime.jsx(material.Box,{"data-planning-scroll-pane":"timeline",ref:m,onScroll:()=>Yt("timeline"),sx:{width:"100%",height:a,overflowX:"auto",overflowY:"auto"},children:jsxRuntime.jsxs(material.Box,{sx:{width:nt},children:[jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Oe.length}, ${Ie.width}px)`,height:P,boxSizing:"border-box",borderBottom:`1px solid ${v.palette.divider}`,position:"sticky",top:0,zIndex:2,backgroundColor:v.palette.background.paper},children:Oe.map(L=>jsxRuntime.jsx(material.Box,{sx:{px:.75,display:"flex",alignItems:"center",borderRight:`1px solid ${v.palette.divider}`,color:"text.secondary",fontSize:12,fontWeight:700},children:L.label},L.key))}),jsxRuntime.jsx(material.Stack,{sx:{position:"relative"},children:Ze.map(L=>{let $=Ue(L),j=w[$]??Pr;if(L.type==="group")return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":$,sx:{position:"relative",height:j,boxSizing:"border-box",borderBottom:`1px solid ${v.palette.divider}`,backgroundColor:v.palette.action.hover}},L.id);let _=L.data||L,ke=_a__default.default(_.startDate),Ee=_a__default.default(_.endDate),Ye=Dg(ke,Oe,Ie.width),z=Dg(Ee,Oe,Ie.width),W=Math.max(18,z-Ye),G=Ag(_.progress),ue=_.id===l,oe=be(_.id),Se=I.activeId===_.id,ge=I.overId===_.id&&Ne(I.activeId,_.id),Pe=_.color??(_.statusTone==="blocked"?v.palette.error.main:v.palette.primary.main);return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":$,draggable:oe,onDragStart:he=>Ht(he,_),onDragOver:he=>Nt(he,_.id),onDragEnter:he=>Nt(he,_.id),onDrop:he=>Xt(he,_.id),onDragEnd:Qt,onClick:()=>s?.(ce.get(_.id)||_),sx:{position:"relative",height:j,boxSizing:"border-box",borderBottom:`1px solid ${v.palette.divider}`,opacity:Se?.56:1,boxShadow:ge?`inset 0 0 0 2px ${v.palette.primary.main}`:"none",backgroundImage:v.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:`${Ie.width}px 100%`,cursor:Se?"grabbing":oe?"grab":s?"pointer":"default",transition:"box-shadow 120ms ease, opacity 120ms ease"},children:jsxRuntime.jsx(material.Tooltip,{title:`${_.title}: ${ke.format("MMM D HH:mm")} - ${Ee.format("MMM D HH:mm")}`,children:jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",left:Ye,top:Math.max(8,(j-24)/2),width:W,height:24,borderRadius:999,overflow:"hidden",backgroundColor:v.palette.mode==="dark"?"rgba(148,163,184,0.18)":"rgba(15,23,42,0.10)",outline:ue?`2px solid ${v.palette.warning.main}`:"none",outlineOffset:2},children:[jsxRuntime.jsx(material.Box,{sx:{height:"100%",width:`${G}%`,backgroundColor:Pe}}),jsxRuntime.jsx(material.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:_.code})]})})},_.id)})})]})})})]})}),jsxRuntime.jsx(Nr,{groupAnchorEl:Y.groupAnchorEl,setGroupAnchorEl:Y.setGroupAnchorEl,grouping:Y.grouping,setGrouping:Y.setGrouping,columns:Y.columns,toggleGroupField:Y.toggleGroupField}),jsxRuntime.jsx(Vr,{anchorEl:Y.anchorEl,setAnchorEl:Y.setAnchorEl,columns:Y.columns,visibleColumns:Y.visibleColumns,toggleColumnVisibility:Y.toggleColumnVisibility})]})};var rV=({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 jsxRuntime.jsxs(material.Stack,{spacing:o,sx:n,children:[jsxRuntime.jsx(material.Box,{sx:{flexShrink:0},children:jsxRuntime.jsx(ca,{...e})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:jsxRuntime.jsx(Lg,{...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)"}}},cV=({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:c})=>{let d=material.useMediaQuery("(prefers-reduced-motion: reduce)"),[l,s]=ht.useState("to"),g=!i&&!d&&o!=="none";ht.useEffect(()=>{if(!g){s("to");return}s("from");let h=requestAnimationFrame(()=>{h=requestAnimationFrame(()=>{s("to");});});return ()=>cancelAnimationFrame(h)},[t,g]);let f=k1[o],u=ht.useMemo(()=>g?l==="from"?f.from:f.to:{opacity:1,transform:"none"},[g,l,f.from,f.to]);return jsxRuntime.jsx(material.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,...c},children:e})},dV={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};
199
+ exports.AgentPanel=Lz;exports.Button=hl;exports.CAINavProvider=Fk;exports.CAmapChart=tp;exports.CAppHeader=ws;exports.CAppPageLayout=DA;exports.CAuthPage=mN;exports.CBarChart=En;exports.CChartCard=Ai;exports.CComboChart=Hd;exports.CCustomizeAgent=np;exports.CDetailInfoPage=E2;exports.CDetailSearchAiBar=tu;exports.CDetailSectionCard=gs;exports.CFishboneChart=qd;exports.CGoogleMapChart=Qd;exports.CGraphCharts=op;exports.CGraphKpiCards=Vd;exports.CGraphReport=qi;exports.CHeatmapChart=Ud;exports.CKanbanBoard=eA;exports.CKanbanBucket=su;exports.CKanbanCard=mc;exports.CLayoutManagement=Dp;exports.CLayoutManager=rs;exports.CLineChart=$d;exports.CMessageBox=Rn;exports.COrbCanvas=vk;exports.CPageLayout=Id;exports.CPageTransition=cV;exports.CPieChart=Vi;exports.CPivotTable=y5;exports.CPlanningGantt=Lg;exports.CPlanningLayout=rV;exports.CSmartFilter=ca;exports.CSmartTable=YD;exports.CStandardPage=nM;exports.CTable=La;exports.CTableBody=_D;exports.CTableCell=jD;exports.CTableContainer=ZD;exports.CTableHead=XD;exports.CTableRow=QD;exports.CVariantManagement=Xi;exports.CVariantManager=fp;exports.CVoiceWaveOverlay=Kc;exports.CWaterfallChart=jd;exports.CodeBlock=Kn;exports.CopilotChat=Gz;exports.GlobalMessage=PT;exports.MarkdownRenderer=Xn;exports.MathBlock=qn;exports.MermaidBlock=Jl;exports.NavigationIsland=kd;exports.ORBCAFE_I18N_MESSAGES=Pn;exports.OrbcafeI18nProvider=Si;exports.PAGE_TRANSITION_PRESETS=dV;exports.PAppPageLayout=_E;exports.PBarcodeScanner=z5;exports.PNavIsland=Tm;exports.PNumericKeypad=Q5;exports.PSmartFilter=ym;exports.PTable=rk;exports.PTouchCard=H5;exports.PWorkloadNav=vm;exports.PivotChartPanel=Zu;exports.StdChat=hg;exports.TableBlock=tc;exports.ThinkBlock=us;exports.TreeMenu=bl;exports.VoiceNavigatorProvider=cF;exports.VoiceWaveOverlay=tF;exports.buildAmapEmbedUrl=$i;exports.buildGoogleMapEmbedUrl=zn;exports.buildGoogleMapIframe=iP;exports.buttonVariants=Kg;exports.createKanbanBoardModel=du;exports.findKanbanCard=No;exports.message=dT;exports.messageManager=na;exports.moveKanbanCard=xs;exports.parseMarkdownTable=ds;exports.renderMarkdown=o2;exports.resolveVariantFilters=Ap;exports.resolveVariantLayout=ns;exports.useAINav=Lk;exports.useAmapEmbedUrl=vM;exports.useAuthPage=_z;exports.useDetailInfo=au;exports.useGoogleMapEmbedUrl=xM;exports.useGraphChartData=gM;exports.useGraphInteraction=ji;exports.useGraphReport=jr;exports.useKanbanBoard=nA;exports.useNavigationIsland=wd;exports.useOrbcafeI18n=Q;exports.usePadLayout=P5;exports.usePadRecordEditor=M5;exports.usePageLayout=vu;exports.usePivotTable=k5;exports.usePlanningGantt=Sg;exports.usePlanningLayout=CN;exports.useStandardReport=pM;exports.useVoiceInput=Xs;exports.useVoiceNavigator=dF;