orbcafe-ui 1.2.1 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var ogl=require('ogl'),ut=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'),Qd=require('@mui/material/Dialog'),Yd=require('@mui/material/DialogTitle'),Jd=require('@mui/material/DialogContent'),xg=require('@mui/material/DialogContentText'),ep=require('@mui/material/DialogActions'),vn=require('@mui/material/Box'),kg=require('@mui/icons-material/CheckCircle'),Sg=require('@mui/icons-material/Warning'),wg=require('@mui/icons-material/Error'),Ig=require('@mui/icons-material/Info'),material=require('@mui/material'),Py=require('@mui/material/Paper'),Ry=require('@mui/material/Table'),Dy=require('@mui/material/TableBody'),js=require('@mui/material/TableCell'),ap=require('@mui/material/TableContainer'),Qg=require('@mui/material/TableHead'),Yg=require('@mui/material/TableRow'),tp=require('@mui/material/TextField'),Li=require('@mui/material/Button'),op=require('@mui/material/Alert'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),Vd=require('@mui/icons-material/Search'),Ng=require('@mui/icons-material/ViewColumn'),qd=require('@mui/icons-material/Save'),Og=require('@mui/icons-material/Download'),Wg=require('@mui/icons-material/AccountTree'),$g=require('@mui/icons-material/Functions'),Hg=require('@mui/icons-material/Insights'),Gg=require('@mui/icons-material/Add'),Ug=require('@mui/icons-material/Edit'),Kg=require('@mui/icons-material/Delete'),qg=require('@mui/icons-material/KeyboardArrowLeft'),_g=require('@mui/icons-material/KeyboardArrowRight'),Jg=require('@mui/material/Checkbox'),ef=require('@mui/material/TableSortLabel'),tf=require('@mui/material/IconButton'),of=require('@mui/material/Tooltip'),af=require('@mui/icons-material/UnfoldMore'),rf=require('@mui/icons-material/UnfoldLess'),pf=require('@mui/icons-material/KeyboardArrowDown'),If=require('@mui/icons-material/Check'),Tf=require('@mui/icons-material/ClearAll'),Jf=require('@mui/icons-material/Close'),sh=require('@mui/icons-material/MicNoneOutlined'),lh=require('@mui/icons-material/SettingsOutlined'),ch=require('@mui/icons-material/SendOutlined'),ny=require('@mui/icons-material/Settings'),iy=require('@mui/icons-material/KeyboardArrowUp'),ly=require('@mui/icons-material/ArrowRightAlt'),Mh=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'),Kh=require('@mui/icons-material/CalendarMonth'),qh=require('@mui/icons-material/Clear'),_h=require('@mui/icons-material/ArrowForward'),Za=require('dayjs'),Zh=require('dayjs/plugin/isBetween'),jh=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 ky=require('@mui/icons-material/StarBorder'),Sy=require('@mui/icons-material/ViewQuilt'),Kb=require('@mui/icons-material/CloseOutlined'),Ky=require('@mui/icons-material/ContentCopyOutlined'),qy=require('@mui/icons-material/CheckOutlined'),Cb=require('@mui/icons-material/ExpandMore'),sortable=require('@dnd-kit/sortable'),styles=require('@mui/material/styles'),Lp=require('@mui/icons-material/Language'),Mx=require('@mui/icons-material/DesktopWindows'),Ax=require('@mui/icons-material/DarkMode'),Bx=require('@mui/icons-material/LightMode'),Ex=require('@mui/icons-material/Logout'),j0=require('@mui/icons-material/DeleteOutline'),a0=require('@mui/icons-material/DragIndicator'),C0=require('@mui/icons-material/FilterList'),k0=require('@mui/icons-material/TableRows'),l0=require('@mui/icons-material/LayersClear'),vv=require('@mui/icons-material/CameraAltRounded'),Cv=require('@mui/icons-material/QrCodeScannerRounded'),Iv=require('@mui/icons-material/DragIndicatorRounded'),Dv=require('@mui/icons-material/BackspaceRounded'),Mv=require('@mui/icons-material/CloseRounded'),Av=require('@mui/icons-material/CheckRounded'),Uv=require('@mui/icons-material/SearchRounded'),Kv=require('@mui/icons-material/MenuOpenRounded'),qv=require('@mui/icons-material/MenuRounded'),_v=require('@mui/icons-material/ExpandMoreRounded'),Zv=require('@mui/icons-material/ChevronRightRounded'),SC=require('next/dynamic'),framerMotion=require('framer-motion'),Nk=require('react-markdown'),Vk=require('remark-gfm'),Ok=require('remark-math'),Wk=require('rehype-katex'),$k=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),nextThemes=require('next-themes'),gm=require('mermaid'),Yk=require('@mui/icons-material/MicRounded'),Jk=require('@mui/icons-material/MicOffRounded'),iconsMaterial=require('@mui/icons-material'),rS=require('@mui/icons-material/SendRounded'),nS=require('@mui/icons-material/AddRounded'),iS=require('@mui/icons-material/HardwareRounded');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 ut__namespace=/*#__PURE__*/_interopNamespace(ut);var Qd__default=/*#__PURE__*/_interopDefault(Qd);var Yd__default=/*#__PURE__*/_interopDefault(Yd);var Jd__default=/*#__PURE__*/_interopDefault(Jd);var xg__default=/*#__PURE__*/_interopDefault(xg);var ep__default=/*#__PURE__*/_interopDefault(ep);var vn__default=/*#__PURE__*/_interopDefault(vn);var kg__default=/*#__PURE__*/_interopDefault(kg);var Sg__default=/*#__PURE__*/_interopDefault(Sg);var wg__default=/*#__PURE__*/_interopDefault(wg);var Ig__default=/*#__PURE__*/_interopDefault(Ig);var Py__default=/*#__PURE__*/_interopDefault(Py);var Ry__default=/*#__PURE__*/_interopDefault(Ry);var Dy__default=/*#__PURE__*/_interopDefault(Dy);var js__default=/*#__PURE__*/_interopDefault(js);var ap__default=/*#__PURE__*/_interopDefault(ap);var Qg__default=/*#__PURE__*/_interopDefault(Qg);var Yg__default=/*#__PURE__*/_interopDefault(Yg);var tp__default=/*#__PURE__*/_interopDefault(tp);var Li__default=/*#__PURE__*/_interopDefault(Li);var op__default=/*#__PURE__*/_interopDefault(op);var Vd__default=/*#__PURE__*/_interopDefault(Vd);var Ng__default=/*#__PURE__*/_interopDefault(Ng);var qd__default=/*#__PURE__*/_interopDefault(qd);var Og__default=/*#__PURE__*/_interopDefault(Og);var Wg__default=/*#__PURE__*/_interopDefault(Wg);var $g__default=/*#__PURE__*/_interopDefault($g);var Hg__default=/*#__PURE__*/_interopDefault(Hg);var Gg__default=/*#__PURE__*/_interopDefault(Gg);var Ug__default=/*#__PURE__*/_interopDefault(Ug);var Kg__default=/*#__PURE__*/_interopDefault(Kg);var qg__default=/*#__PURE__*/_interopDefault(qg);var _g__default=/*#__PURE__*/_interopDefault(_g);var Jg__default=/*#__PURE__*/_interopDefault(Jg);var ef__default=/*#__PURE__*/_interopDefault(ef);var tf__default=/*#__PURE__*/_interopDefault(tf);var of__default=/*#__PURE__*/_interopDefault(of);var af__default=/*#__PURE__*/_interopDefault(af);var rf__default=/*#__PURE__*/_interopDefault(rf);var pf__default=/*#__PURE__*/_interopDefault(pf);var If__default=/*#__PURE__*/_interopDefault(If);var Tf__default=/*#__PURE__*/_interopDefault(Tf);var Jf__default=/*#__PURE__*/_interopDefault(Jf);var sh__default=/*#__PURE__*/_interopDefault(sh);var lh__default=/*#__PURE__*/_interopDefault(lh);var ch__default=/*#__PURE__*/_interopDefault(ch);var ny__default=/*#__PURE__*/_interopDefault(ny);var iy__default=/*#__PURE__*/_interopDefault(iy);var ly__default=/*#__PURE__*/_interopDefault(ly);var Mh__default=/*#__PURE__*/_interopDefault(Mh);var Kh__default=/*#__PURE__*/_interopDefault(Kh);var qh__default=/*#__PURE__*/_interopDefault(qh);var _h__default=/*#__PURE__*/_interopDefault(_h);var Za__default=/*#__PURE__*/_interopDefault(Za);var Zh__default=/*#__PURE__*/_interopDefault(Zh);var jh__default=/*#__PURE__*/_interopDefault(jh);var ky__default=/*#__PURE__*/_interopDefault(ky);var Sy__default=/*#__PURE__*/_interopDefault(Sy);var Kb__default=/*#__PURE__*/_interopDefault(Kb);var Ky__default=/*#__PURE__*/_interopDefault(Ky);var qy__default=/*#__PURE__*/_interopDefault(qy);var Cb__default=/*#__PURE__*/_interopDefault(Cb);var Lp__default=/*#__PURE__*/_interopDefault(Lp);var Mx__default=/*#__PURE__*/_interopDefault(Mx);var Ax__default=/*#__PURE__*/_interopDefault(Ax);var Bx__default=/*#__PURE__*/_interopDefault(Bx);var Ex__default=/*#__PURE__*/_interopDefault(Ex);var j0__default=/*#__PURE__*/_interopDefault(j0);var a0__default=/*#__PURE__*/_interopDefault(a0);var C0__default=/*#__PURE__*/_interopDefault(C0);var k0__default=/*#__PURE__*/_interopDefault(k0);var l0__default=/*#__PURE__*/_interopDefault(l0);var vv__default=/*#__PURE__*/_interopDefault(vv);var Cv__default=/*#__PURE__*/_interopDefault(Cv);var Iv__default=/*#__PURE__*/_interopDefault(Iv);var Dv__default=/*#__PURE__*/_interopDefault(Dv);var Mv__default=/*#__PURE__*/_interopDefault(Mv);var Av__default=/*#__PURE__*/_interopDefault(Av);var Uv__default=/*#__PURE__*/_interopDefault(Uv);var Kv__default=/*#__PURE__*/_interopDefault(Kv);var qv__default=/*#__PURE__*/_interopDefault(qv);var _v__default=/*#__PURE__*/_interopDefault(_v);var Zv__default=/*#__PURE__*/_interopDefault(Zv);var SC__default=/*#__PURE__*/_interopDefault(SC);var Nk__default=/*#__PURE__*/_interopDefault(Nk);var Vk__default=/*#__PURE__*/_interopDefault(Vk);var Ok__default=/*#__PURE__*/_interopDefault(Ok);var Wk__default=/*#__PURE__*/_interopDefault(Wk);var $k__default=/*#__PURE__*/_interopDefault($k);var gm__default=/*#__PURE__*/_interopDefault(gm);var Yk__default=/*#__PURE__*/_interopDefault(Yk);var Jk__default=/*#__PURE__*/_interopDefault(Jk);var rS__default=/*#__PURE__*/_interopDefault(rS);var nS__default=/*#__PURE__*/_interopDefault(nS);var iS__default=/*#__PURE__*/_interopDefault(iS);var Pc=Object.defineProperty;var Wm=(e,t,a)=>t in e?Pc(e,t,{enumerable:true,configurable:true,writable:true,value:a}):e[t]=a;var $m=(e,t)=>()=>(e&&(t=e(e=0)),t);var Hm=(e,t)=>{for(var a in t)Pc(e,a,{get:t[a],enumerable:true});};var Rc=(e,t,a)=>Wm(e,t+"",a);var nm={};Hm(nm,{COrbCanvas:()=>vC});function vC({hue:e=0,hoverIntensity:t=.2,rotateOnHover:a=true,forceHoverState:o=false,backgroundColor:r="transparent"}){let n=ut.useRef(null),i=`
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'),Yd=require('@mui/material/Dialog'),Jd=require('@mui/material/DialogTitle'),ep=require('@mui/material/DialogContent'),vg=require('@mui/material/DialogContentText'),tp=require('@mui/material/DialogActions'),kn=require('@mui/material/Box'),Sg=require('@mui/icons-material/CheckCircle'),wg=require('@mui/icons-material/Warning'),Ig=require('@mui/icons-material/Error'),Tg=require('@mui/icons-material/Info'),material=require('@mui/material'),Ry=require('@mui/material/Paper'),Dy=require('@mui/material/Table'),My=require('@mui/material/TableBody'),Xs=require('@mui/material/TableCell'),rp=require('@mui/material/TableContainer'),Yg=require('@mui/material/TableHead'),Jg=require('@mui/material/TableRow'),op=require('@mui/material/TextField'),zi=require('@mui/material/Button'),ap=require('@mui/material/Alert'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),Od=require('@mui/icons-material/Search'),Vg=require('@mui/icons-material/ViewColumn'),_d=require('@mui/icons-material/Save'),Wg=require('@mui/icons-material/Download'),$g=require('@mui/icons-material/AccountTree'),Hg=require('@mui/icons-material/Functions'),Gg=require('@mui/icons-material/Insights'),Ug=require('@mui/icons-material/Add'),Kg=require('@mui/icons-material/Edit'),qg=require('@mui/icons-material/Delete'),_g=require('@mui/icons-material/KeyboardArrowLeft'),Zg=require('@mui/icons-material/KeyboardArrowRight'),ef=require('@mui/material/Checkbox'),tf=require('@mui/material/TableSortLabel'),of=require('@mui/material/IconButton'),af=require('@mui/material/Tooltip'),rf=require('@mui/icons-material/UnfoldMore'),nf=require('@mui/icons-material/UnfoldLess'),uf=require('@mui/icons-material/KeyboardArrowDown'),Tf=require('@mui/icons-material/Check'),Pf=require('@mui/icons-material/ClearAll'),eh=require('@mui/icons-material/Close'),lh=require('@mui/icons-material/MicNoneOutlined'),ch=require('@mui/icons-material/SettingsOutlined'),dh=require('@mui/icons-material/SendOutlined'),iy=require('@mui/icons-material/Settings'),sy=require('@mui/icons-material/KeyboardArrowUp'),cy=require('@mui/icons-material/ArrowRightAlt'),Ah=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'),qh=require('@mui/icons-material/CalendarMonth'),_h=require('@mui/icons-material/Clear'),Zh=require('@mui/icons-material/ArrowForward'),Xa=require('dayjs'),jh=require('dayjs/plugin/isBetween'),Xh=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 Sy=require('@mui/icons-material/StarBorder'),wy=require('@mui/icons-material/ViewQuilt'),qb=require('@mui/icons-material/CloseOutlined'),qy=require('@mui/icons-material/ContentCopyOutlined'),_y=require('@mui/icons-material/CheckOutlined'),kb=require('@mui/icons-material/ExpandMore'),sortable=require('@dnd-kit/sortable'),styles=require('@mui/material/styles'),zp=require('@mui/icons-material/Language'),Ax=require('@mui/icons-material/DesktopWindows'),Bx=require('@mui/icons-material/DarkMode'),Fx=require('@mui/icons-material/LightMode'),Lx=require('@mui/icons-material/Logout'),X0=require('@mui/icons-material/DeleteOutline'),r0=require('@mui/icons-material/DragIndicator'),k0=require('@mui/icons-material/FilterList'),S0=require('@mui/icons-material/TableRows'),c0=require('@mui/icons-material/LayersClear'),Cv=require('@mui/icons-material/CameraAltRounded'),kv=require('@mui/icons-material/QrCodeScannerRounded'),Tv=require('@mui/icons-material/DragIndicatorRounded'),Mv=require('@mui/icons-material/BackspaceRounded'),Av=require('@mui/icons-material/CloseRounded'),Bv=require('@mui/icons-material/CheckRounded'),Kv=require('@mui/icons-material/SearchRounded'),qv=require('@mui/icons-material/MenuOpenRounded'),_v=require('@mui/icons-material/MenuRounded'),Zv=require('@mui/icons-material/ExpandMoreRounded'),jv=require('@mui/icons-material/ChevronRightRounded'),wC=require('next/dynamic'),framerMotion=require('framer-motion'),Vk=require('react-markdown'),Ok=require('remark-gfm'),Wk=require('remark-math'),$k=require('rehype-katex'),Hk=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),nextThemes=require('next-themes'),fm=require('mermaid'),Jk=require('@mui/icons-material/MicRounded'),eS=require('@mui/icons-material/MicOffRounded'),iconsMaterial=require('@mui/icons-material'),nS=require('@mui/icons-material/SendRounded'),iS=require('@mui/icons-material/AddRounded'),sS=require('@mui/icons-material/HardwareRounded');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 Yd__default=/*#__PURE__*/_interopDefault(Yd);var Jd__default=/*#__PURE__*/_interopDefault(Jd);var ep__default=/*#__PURE__*/_interopDefault(ep);var vg__default=/*#__PURE__*/_interopDefault(vg);var tp__default=/*#__PURE__*/_interopDefault(tp);var kn__default=/*#__PURE__*/_interopDefault(kn);var Sg__default=/*#__PURE__*/_interopDefault(Sg);var wg__default=/*#__PURE__*/_interopDefault(wg);var Ig__default=/*#__PURE__*/_interopDefault(Ig);var Tg__default=/*#__PURE__*/_interopDefault(Tg);var Ry__default=/*#__PURE__*/_interopDefault(Ry);var Dy__default=/*#__PURE__*/_interopDefault(Dy);var My__default=/*#__PURE__*/_interopDefault(My);var Xs__default=/*#__PURE__*/_interopDefault(Xs);var rp__default=/*#__PURE__*/_interopDefault(rp);var Yg__default=/*#__PURE__*/_interopDefault(Yg);var Jg__default=/*#__PURE__*/_interopDefault(Jg);var op__default=/*#__PURE__*/_interopDefault(op);var zi__default=/*#__PURE__*/_interopDefault(zi);var ap__default=/*#__PURE__*/_interopDefault(ap);var Od__default=/*#__PURE__*/_interopDefault(Od);var Vg__default=/*#__PURE__*/_interopDefault(Vg);var _d__default=/*#__PURE__*/_interopDefault(_d);var Wg__default=/*#__PURE__*/_interopDefault(Wg);var $g__default=/*#__PURE__*/_interopDefault($g);var Hg__default=/*#__PURE__*/_interopDefault(Hg);var Gg__default=/*#__PURE__*/_interopDefault(Gg);var Ug__default=/*#__PURE__*/_interopDefault(Ug);var Kg__default=/*#__PURE__*/_interopDefault(Kg);var qg__default=/*#__PURE__*/_interopDefault(qg);var _g__default=/*#__PURE__*/_interopDefault(_g);var Zg__default=/*#__PURE__*/_interopDefault(Zg);var ef__default=/*#__PURE__*/_interopDefault(ef);var tf__default=/*#__PURE__*/_interopDefault(tf);var of__default=/*#__PURE__*/_interopDefault(of);var af__default=/*#__PURE__*/_interopDefault(af);var rf__default=/*#__PURE__*/_interopDefault(rf);var nf__default=/*#__PURE__*/_interopDefault(nf);var uf__default=/*#__PURE__*/_interopDefault(uf);var Tf__default=/*#__PURE__*/_interopDefault(Tf);var Pf__default=/*#__PURE__*/_interopDefault(Pf);var eh__default=/*#__PURE__*/_interopDefault(eh);var lh__default=/*#__PURE__*/_interopDefault(lh);var ch__default=/*#__PURE__*/_interopDefault(ch);var dh__default=/*#__PURE__*/_interopDefault(dh);var iy__default=/*#__PURE__*/_interopDefault(iy);var sy__default=/*#__PURE__*/_interopDefault(sy);var cy__default=/*#__PURE__*/_interopDefault(cy);var Ah__default=/*#__PURE__*/_interopDefault(Ah);var qh__default=/*#__PURE__*/_interopDefault(qh);var _h__default=/*#__PURE__*/_interopDefault(_h);var Zh__default=/*#__PURE__*/_interopDefault(Zh);var Xa__default=/*#__PURE__*/_interopDefault(Xa);var jh__default=/*#__PURE__*/_interopDefault(jh);var Xh__default=/*#__PURE__*/_interopDefault(Xh);var Sy__default=/*#__PURE__*/_interopDefault(Sy);var wy__default=/*#__PURE__*/_interopDefault(wy);var qb__default=/*#__PURE__*/_interopDefault(qb);var qy__default=/*#__PURE__*/_interopDefault(qy);var _y__default=/*#__PURE__*/_interopDefault(_y);var kb__default=/*#__PURE__*/_interopDefault(kb);var zp__default=/*#__PURE__*/_interopDefault(zp);var Ax__default=/*#__PURE__*/_interopDefault(Ax);var Bx__default=/*#__PURE__*/_interopDefault(Bx);var Fx__default=/*#__PURE__*/_interopDefault(Fx);var Lx__default=/*#__PURE__*/_interopDefault(Lx);var X0__default=/*#__PURE__*/_interopDefault(X0);var r0__default=/*#__PURE__*/_interopDefault(r0);var k0__default=/*#__PURE__*/_interopDefault(k0);var S0__default=/*#__PURE__*/_interopDefault(S0);var c0__default=/*#__PURE__*/_interopDefault(c0);var Cv__default=/*#__PURE__*/_interopDefault(Cv);var kv__default=/*#__PURE__*/_interopDefault(kv);var Tv__default=/*#__PURE__*/_interopDefault(Tv);var Mv__default=/*#__PURE__*/_interopDefault(Mv);var Av__default=/*#__PURE__*/_interopDefault(Av);var Bv__default=/*#__PURE__*/_interopDefault(Bv);var Kv__default=/*#__PURE__*/_interopDefault(Kv);var qv__default=/*#__PURE__*/_interopDefault(qv);var _v__default=/*#__PURE__*/_interopDefault(_v);var Zv__default=/*#__PURE__*/_interopDefault(Zv);var jv__default=/*#__PURE__*/_interopDefault(jv);var wC__default=/*#__PURE__*/_interopDefault(wC);var Vk__default=/*#__PURE__*/_interopDefault(Vk);var Ok__default=/*#__PURE__*/_interopDefault(Ok);var Wk__default=/*#__PURE__*/_interopDefault(Wk);var $k__default=/*#__PURE__*/_interopDefault($k);var Hk__default=/*#__PURE__*/_interopDefault(Hk);var fm__default=/*#__PURE__*/_interopDefault(fm);var Jk__default=/*#__PURE__*/_interopDefault(Jk);var eS__default=/*#__PURE__*/_interopDefault(eS);var nS__default=/*#__PURE__*/_interopDefault(nS);var iS__default=/*#__PURE__*/_interopDefault(iS);var sS__default=/*#__PURE__*/_interopDefault(sS);var Rc=Object.defineProperty;var $m=(e,t,o)=>t in e?Rc(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var Hm=(e,t)=>()=>(e&&(t=e(e=0)),t);var Gm=(e,t)=>{for(var o in t)Rc(e,o,{get:t[o],enumerable:true});};var Dc=(e,t,o)=>$m(e,t+"",o);var im={};Gm(im,{COrbCanvas:()=>CC});function CC({hue:e=0,hoverIntensity:t=.2,rotateOnHover:o=true,forceHoverState:a=false,backgroundColor:r="transparent"}){let n=mt.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 ut.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 u=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:rm(r)}}}),m=new ogl.Mesh(s,{geometry:u,program:f});function h(){if(!d)return;let P=window.devicePixelRatio||1,S=d.clientWidth,B=d.clientHeight;l.setSize(S*P,B*P),s.canvas.style.width=S+"px",s.canvas.style.height=B+"px",f.uniforms.iResolution.value.set(s.canvas.width,s.canvas.height,s.canvas.width/s.canvas.height);}window.addEventListener("resize",h),h();let I=0,p=0,C=0,g=.3,y=P=>{let S=d.getBoundingClientRect(),B=P.clientX-S.left,T=P.clientY-S.top,v=S.width,M=S.height,w=Math.min(v,M),D=v/2,F=M/2,$=(B-D)/w*2,V=(T-F)/w*2;Math.sqrt($*$+V*V)<.8?I=1:I=0;},x=()=>{I=0;};d.addEventListener("mousemove",y),d.addEventListener("mouseleave",x);let k,L=P=>{k=requestAnimationFrame(L);let S=(P-p)*.001;p=P,f.uniforms.iTime.value=P*.001,f.uniforms.hue.value=e,f.uniforms.hoverIntensity.value=t,f.uniforms.backgroundColor.value=rm(r);let B=o?1:I;f.uniforms.hover.value+=(B-f.uniforms.hover.value)*.1,a&&B>.5&&(C+=S*g),f.uniforms.rot.value=C,l.render({scene:m});};return k=requestAnimationFrame(L),()=>{cancelAnimationFrame(k),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,a,o,r]),jsxRuntime.jsx("div",{ref:n,className:"w-full h-full"})}function CC(e,t,a){let o,r,n;if(t===0)o=r=n=a;else {let i=(l,s,u)=>(u<0&&(u+=1),u>1&&(u-=1),u<.16666666666666666?l+(s-l)*6*u:u<.5?s:u<.6666666666666666?l+(s-l)*(.6666666666666666-u)*6:l),c=a<.5?a*(1+t):a+t-a*t,d=2*a-c;o=i(d,c,e+1/3),r=i(d,c,e),n=i(d,c,e-1/3);}return new ogl.Vec3(o,r,n)}function rm(e){if(e==="transparent")return new ogl.Vec3(0,0,0);if(e.startsWith("#")){let o=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(o,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 a=e.match(/hsla?\((\d+),\s*(\d+)%,\s*(\d+)%/);if(a){let o=parseInt(a[1])/360,r=parseInt(a[2])/100,n=parseInt(a[3])/100;return CC(o,r,n)}return new ogl.Vec3(0,0,0)}var im=$m(()=>{"use client";});function to(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var Vs={primary:"#000000",primaryHover:"#333333"},jn={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"},Dc=()=>"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 _m=classVarianceAuthority.cva(Dc(),{variants:{variant:{default:`${jn.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:`${jn.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:jn.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-[${Vs.primary}] hover:bg-[${Vs.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"}}),Os=ut__namespace.forwardRef(({className:e,variant:t,size:a,asChild:o=false,...r},n)=>jsxRuntime.jsx(o?reactSlot.Slot:"button",{className:to(_m({variant:t,size:a,className:e})),ref:n,...r}));Os.displayName="Button";var jm={"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"},Xm={"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"},Qm={"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"},Ym={"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"},Jm={"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"},eg={"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"},on={en:jm,zh:Xm,fr:Qm,de:Ym,ja:Jm,ko:eg};var Ac=(e,t)=>t?e.replace(/\{(\w+)\}/g,(a,o)=>{let r=t[o];return r==null?"":String(r)}):e,rg={locale:"en",t:(e,t)=>Ac(on.en[e]||e,t)},Bc=ut.createContext(rg),Fc=({locale:e="en",messages:t,children:a})=>{let o=ut.useMemo(()=>{let r=on[e]||on.en,n=t?.[e]||{},i={...on.en,...r,...n};return {locale:e,t:(c,d)=>Ac(i[c]||c,d)}},[e,t]);return jsxRuntime.jsx(Bc.Provider,{value:o,children:a})},q=()=>ut.useContext(Bc);function $s({items:e,onItemClick:t,className:a="",level:o=0,expandedIds:r,onToggleExpand:n,colorMode:i="light"}){let{t:c}=q(),d=i==="dark",l=navigation.usePathname(),[s,u]=ut.useState(false),[f,m]=ut.useState(new Set),h=r!==void 0&&n!==void 0,I=h?r:f;ut.useEffect(()=>{u(true);},[]);let p=g=>{if(h)n(g);else {let y=new Set(f);y.has(g)?y.delete(g):y.add(g),m(y);}},C=g=>{g.children&&g.children.length>0&&p(g.id),t&&t(g);};return !e||!Array.isArray(e)?jsxRuntime.jsx("div",{className:to("tree-menu",a),children:jsxRuntime.jsx("div",{className:"text-sm text-gray-500 p-2",children:c("navigation.noItems")})}):jsxRuntime.jsx("div",{className:to("tree-menu",a),children:e.map(g=>{let y=I.has(g.id)||g.isExpanded,x=g.children&&g.children.length>0,k=g.appurl||g.href,L=s&&k?l===k:false;return jsxRuntime.jsxs("div",{className:"tree-menu-item relative",children:[L&&jsxRuntime.jsx("div",{className:to("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",d?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxRuntime.jsxs(Os,{variant:"ghost",className:to("w-full justify-start gap-2 h-auto py-2 relative overflow-hidden group",`ml-${o*4}`,L?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:[x&&jsxRuntime.jsx("div",{className:to("flex-shrink-0 transition-transform duration-200",y&&"rotate-90",L?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"}),g.icon&&jsxRuntime.jsx("div",{className:to("flex-shrink-0 transition-colors duration-200",L?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:to("text-sm truncate transition-colors duration-200",L?"font-semibold":"font-medium"),children:g.title||g.label}),g.description&&jsxRuntime.jsx("div",{className:to("text-xs truncate transition-colors duration-200",L?d?"text-[#90caf9]/70":"text-[#1976d2]/75":d?"text-gray-400":"text-gray-500"),title:g.description,children:g.description})]})]}),x&&jsxRuntime.jsx("div",{className:to("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($s,{items:g.children,onItemClick:t,level:o+1,expandedIds:r,onToggleExpand:n,colorMode:i})})})]},g.id)})})}var Oc=({collapsed:e,onToggle:t,className:a="",maxHeight:o,menuData:r=[],colorMode:n="light"})=>{let{t:i}=q(),c=n==="dark",d=navigation.useRouter(),[l,s]=ut.useState(""),[u,f]=ut.useState(new Set);ut.useEffect(()=>{e&&f(new Set);},[e]);let m=ut.useCallback(C=>{let g=[],y=x=>{x.forEach(k=>{g.push(k.id),k.children&&y(k.children);});};return y(C),g},[]),h=ut.useMemo(()=>{if(!l.trim())return r;let C=g=>g.reduce((y,x)=>{let k=x.title?.toLowerCase().includes(l.toLowerCase())||x.description?.toLowerCase().includes(l.toLowerCase()),L=x.children?C(x.children):[];return (k||L.length>0)&&y.push({...x,children:L.length>0?L:x.children}),y},[]);return C(r)},[l,r]),I=ut.useMemo(()=>l.trim()?new Set(m(r)):u,[l,r,u,m]),p=ut.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 ${a} ${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:o?`${o}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($s,{items:h,onItemClick:p,className:"space-y-1",expandedIds:I,colorMode:n,onToggleExpand:C=>{let g=new Set(u);h.some(x=>x.id===C)?g.has(C)?g.delete(C):(h.forEach(x=>{x.id!==C&&g.has(x.id)&&g.delete(x.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 $c=(e={})=>{let{initialCollapsed:t=false,content:a=[]}=e,[o,r]=ut.useState(t),[n,i]=ut.useState(a),c=ut.useCallback(()=>{r(l=>!l);},[]),d=ut.useMemo(()=>({collapsed:o,onToggle:c,menuData:n}),[o,c,n]);return {collapsed:o,setCollapsed:r,toggleCollapsed:c,menuData:n,setMenuData:i,navigationIslandProps:d}};var Gs=e=>jsxRuntime.jsx(material.Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var Us=class{constructor(){Rc(this,"listener",null);}register(t){this.listener=t;}unregister(){this.listener=null;}show(t,a,o){this.listener&&this.listener({type:t,content:a,options:o});}hide(){this.listener&&this.listener(null);}},_o=new Us,mw={success:(e,t)=>_o.show("success",e,t),error:(e,t)=>_o.show("error",e,t),warning:(e,t)=>_o.show("warning",e,t),info:(e,t)=>_o.show("info",e,t),show:(e,t,a)=>_o.show(e,t,a),hide:()=>_o.hide()};var Tg={success:{icon:jsxRuntime.jsx(kg__default.default,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsxRuntime.jsx(Sg__default.default,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsxRuntime.jsx(wg__default.default,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsxRuntime.jsx(Ig__default.default,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},an=({open:e,title:t,message:a,onClose:o,onConfirm:r,confirmText:n,cancelText:i,showCancel:c=true,maxWidth:d="xs",type:l="default"})=>{let{t:s}=q(),u=n||s("messageBox.confirm"),f=i||s("messageBox.cancel"),m=()=>{r?r():o();},h=Tg[l],I=l!=="default";return jsxRuntime.jsxs(Qd__default.default,{open:e,onClose:o,maxWidth:d,fullWidth:true,PaperProps:{sx:{borderRadius:3,...I&&{borderTop:`6px solid ${h.iconColor}`}}},children:[I&&jsxRuntime.jsx(vn__default.default,{sx:{display:"flex",justifyContent:"center",pt:3,color:h.iconColor},children:h.icon}),t&&jsxRuntime.jsx(Yd__default.default,{sx:{textAlign:I?"center":"left",pt:I?1:2},children:t}),jsxRuntime.jsx(Jd__default.default,{sx:{textAlign:I?"center":"left"},children:typeof a=="string"?jsxRuntime.jsx(xg__default.default,{children:a}):a}),jsxRuntime.jsxs(ep__default.default,{sx:{justifyContent:I?"center":"flex-end",pb:3,px:3},children:[c&&jsxRuntime.jsx(Gs,{onClick:o,variant:"text",color:"inherit",children:f}),jsxRuntime.jsx(Gs,{onClick:m,variant:"contained",sx:{bgcolor:I?h.iconColor:void 0,"&:hover":{bgcolor:I?h.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:u})]})]})},Mw=()=>{let[e,t]=ut__namespace.default.useState(null),[a,o]=ut__namespace.default.useState(false);ut__namespace.default.useEffect(()=>{let i=c=>{c?(t(c),o(true)):(o(false),t(null));};return _o.register(i),()=>_o.unregister()},[]);let r=()=>{o(false),e?.options?.onClose&&e.options.onClose(),t(null);},n=()=>{e?.options?.onConfirm&&e.options.onConfirm(),o(false),t(null);};return e?jsxRuntime.jsx(an,{open:a,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 Gc=({title:e,hideHeader:t,children:a})=>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:a})]});var Xn=e=>{let{t}=q(),a="0.85rem",o=Array.isArray(e.actions)?e.actions:e.actions?[e.actions]:[],r=Array.isArray(e.extraTools)?e.extraTools:e.extraTools?[e.extraTools]:[],n=[...o,...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)),u=Math.min(l+1,s),f=l>0,m=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:a,"& .MuiInputBase-input":{fontSize:a},"& .MuiInputBase-input::placeholder":{fontSize:a,opacity:1}},startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Vd__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:a,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:a,fontWeight:600,minWidth:64,"& .MuiSelect-select":{py:.25,pr:"16px !important"}},children:c.map(h=>jsxRuntime.jsx(material.MenuItem,{value:h,sx:{fontSize:a},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},children:jsxRuntime.jsx(qg__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:a,fontWeight:600,minWidth:88,textAlign:"center"},children:t("table.toolbar.pageOf",{current:u,total:s})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.min(l+1,s-1)),disabled:!m,sx:{p:.35},children:jsxRuntime.jsx(_g__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,I)=>jsxRuntime.jsx(ut__namespace.default.Fragment,{children:h},`toolbar-custom-${I}`))}),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,{onClick:h=>e.setGroupAnchorEl(h.currentTarget),children:jsxRuntime.jsx(material.Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsxRuntime.jsx(Wg__default.default,{})})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.summary"),children:jsxRuntime.jsx(material.IconButton,{onClick:h=>e.setSummaryAnchorEl(h.currentTarget),color:e.showSummary?"primary":"default",children:jsxRuntime.jsx($g__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.columns"),children:jsxRuntime.jsx(material.IconButton,{onClick:h=>e.setAnchorEl(h.currentTarget),children:jsxRuntime.jsx(Ng__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.export"),children:jsxRuntime.jsx(material.IconButton,{onClick:e.handleExport,children:jsxRuntime.jsx(Og__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(Gg__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(Ug__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(Kg__default.default,{})})})}),e.onOpenGraphReport&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.graphicReport"),children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenGraphReport,children:jsxRuntime.jsx(Hg__default.default,{})})}),e.onLayoutSave&&!e.layoutManager&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.saveLayout"),children:jsxRuntime.jsx(material.IconButton,{onClick:h=>e.onLayoutSave(h),children:jsxRuntime.jsx(qd__default.default,{})})}),e.layoutManager]})]})};var _c=e=>{let{t}=q(),{onSelectAllClick:a,order:o,orderBy:r,numSelected:n=0,rowCount:i=0,onRequestSort:c,columns:d,visibleColumns:l,selectionMode:s,grouping:u=[],isAllExpanded:f=false,handleToggleAll:m,onColumnResize:h,columnWidths:I}=e,[p,C]=ut.useState(null),g=ut.useRef(null),y=v=>M=>{p||c(v);},x=(v,M,w)=>{v.preventDefault(),v.stopPropagation(),C(M),g.current={startX:v.clientX,startWidth:w,colId:M},document.addEventListener("mousemove",k),document.addEventListener("mouseup",L),document.body.style.cursor="col-resize";},k=v=>{if(!g.current)return;let{startX:M,startWidth:w,colId:D}=g.current,F=v.clientX-M,$=Math.max(50,w+F);h&&h(D,$);},L=()=>{C(null),g.current=null,document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",L),document.body.style.cursor="";};ut.useEffect(()=>()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",L);},[]);let P=s==="multiple"||s==="single",S=u.length>0&&!!m,B=t(f?"table.group.collapseAll":"table.group.expandAll"),T=d.filter(v=>l.includes(v.id));return jsxRuntime.jsx(Qg__default.default,{children:jsxRuntime.jsxs(Yg__default.default,{children:[P&&jsxRuntime.jsx(js__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(Jg__default.default,{color:"primary",indeterminate:n>0&&n<i,checked:i>0&&n===i,onChange:a,disabled:s==="single"})}),S&&jsxRuntime.jsx(js__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(of__default.default,{title:B,children:jsxRuntime.jsx(tf__default.default,{size:"small",onClick:v=>{v.stopPropagation(),m?.(!f);},sx:{p:.2},children:f?jsxRuntime.jsx(rf__default.default,{fontSize:"small"}):jsxRuntime.jsx(af__default.default,{fontSize:"small"})})})}),T.map(v=>{let M=I?.[v.id]||v.minWidth||100;return jsxRuntime.jsxs(js__default.default,{align:"left",padding:v.disablePadding?"none":"normal",sortDirection:r===v.id?o:false,style:{width:M,minWidth:M,maxWidth:M},sx:w=>({position:"sticky",top:0,zIndex:4,backgroundColor:w.palette.mode==="dark"?"#000000":"#f5f5f5",color:w.palette.mode==="dark"?"#ffffff":w.palette.text.primary,fontWeight:"bold",userSelect:"none"}),children:[jsxRuntime.jsx(ef__default.default,{active:r===v.id,direction:r===v.id?o:"asc",onClick:y(v.id),sx:w=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:w.palette.mode==="dark"?"#ffffff":w.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:w.palette.mode==="dark"?"#ffffff":w.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:w.palette.mode==="dark"?"#ffffff":w.palette.text.primary}),children:jsxRuntime.jsx(vn__default.default,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1},children:v.label})}),jsxRuntime.jsx(vn__default.default,{onMouseDown:w=>x(w,v.id,typeof M=="number"?M:100),onClick:w=>w.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 Xc=e=>{let{t}=q(),{visibleRows:a,visibleColumns:o,selected:r=[],handleClick:n,columns:i,toggleGroupExpand:c,expandedGroups:d=new Set,selectionMode:l,grouping:s=[],isGroupFullyExpanded:u,handleExpandGroupRecursively:f,handleCollapseGroupRecursively:m}=e,h=g=>r.indexOf(g)!==-1,I=l==="multiple"||l==="single",p=s.length>0,C=o.length+(I?1:0)+(p?1:0);return jsxRuntime.jsxs(material.TableBody,{children:[a.map((g,y)=>{if(g.type==="group"){let x=d.has(g.id),k=g.childIds||[],L=k.filter(T=>h(T)).length,P=k.length>0&&L===k.length,S=L>0&&L<k.length;return jsxRuntime.jsxs(material.TableRow,{sx:T=>({backgroundColor:T.palette.mode==="dark"?"#111111":"#f5f5f5","& .MuiTableCell-root":{color:T.palette.text.primary,borderBottomColor:T.palette.divider},"& .MuiIconButton-root":{color:T.palette.text.primary},"& .MuiCheckbox-root":{color:T.palette.text.secondary},"& .MuiCheckbox-root.Mui-checked, & .MuiCheckbox-root.MuiCheckbox-indeterminate":{color:T.palette.primary.main}}),children:[I&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:P,indeterminate:S,onChange:T=>{if(T.stopPropagation(),!!e.onSelectionChange)if(P){let v=r.filter(M=>!k.includes(M));e.onSelectionChange(v);}else {let v=Array.from(new Set([...r,...k]));e.onSelectionChange(v);}},onClick:T=>T.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&&g.level<s.length-1&&jsxRuntime.jsx(material.Tooltip,{title:u?.(g.id)?t("table.group.collapseAll"):t("table.group.expandAll"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>{u?.(g.id)?m?.(g.id):f?.(g.id);},sx:{p:.25},children:u?.(g.id)?jsxRuntime.jsx(rf__default.default,{fontSize:"small"}):jsxRuntime.jsx(af__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>c&&c(g.id),sx:{p:.25},children:x?jsxRuntime.jsx(pf__default.default,{}):jsxRuntime.jsx(_g__default.default,{})})]})}),jsxRuntime.jsx(material.TableCell,{colSpan:o.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 x=g.data||g,k=g.id||x.id||y,L=h(k),P=`enhanced-table-checkbox-${y}`,B=(g.level!==void 0?g.level:0)*4;return jsxRuntime.jsxs(material.TableRow,{hover:true,onClick:T=>n&&n(T,x),role:"checkbox","aria-checked":L,tabIndex:-1,selected:L,sx:{cursor:"pointer"},children:[I&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{pl:B>0?B+1:void 0},children:jsxRuntime.jsx(material.Checkbox,{color:"primary",checked:L,inputProps:{"aria-labelledby":P}})}),p&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{width:44}}),i.filter(T=>o.includes(T.id)).map((T,v)=>{let w=!I&&v===0&&B>0?{pl:B+2}:{};return jsxRuntime.jsx(material.TableCell,{align:"left",sx:w,children:T.render?T.render(x[T.id],x):(function(){let F=x[T.id];if(T.numeric){if(typeof F=="number")return F.toLocaleString();if(typeof F=="string"&&F.trim()!==""&&!isNaN(Number(F)))return Number(F).toLocaleString()}return F})()},T.id)})]},k)}}),a.length===0&&jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:C,align:"center",children:t("common.noData")})})]})};var Qc=e=>{let{visibleColumns:t,summaryRow:a,selectionMode:o,grouping:r=[]}=e;if(!e.showSummary)return null;let n=o==="multiple"||o==="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=a[c];return l==null||l===""?"":typeof l=="number"?l.toLocaleString():typeof l=="string"&&l.trim()!==""&&!isNaN(Number(l))?Number(l).toLocaleString():l})()},c))]})})};var Jc=e=>{let{t}=q();return jsxRuntime.jsx(material.Box,{sx:{p:2},children:jsxRuntime.jsx(material.Typography,{children:t("table.mobile.notImplemented")})})};var ei=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:a,setGrouping:o,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")}),a.length>0&&jsxRuntime.jsx(material.Button,{size:"small",color:"error",onClick:()=>o([]),startIcon:jsxRuntime.jsx(Tf__default.default,{}),children:i("table.menu.clearAll")})]}),jsxRuntime.jsx(material.Divider,{}),r.map(c=>{let d=a.includes(c.id),l=a.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)})]})},ti=({anchorEl:e,setAnchorEl:t,columns:a,visibleColumns:o,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,{}),a.map(i=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>r(i.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:o.includes(i.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:i.label})]},i.id))]})},oi=({anchorEl:e,setAnchorEl:t,showSummary:a,setShowSummary:o,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:a,onChange:d=>o(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:!a,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")})})]})},ai=({contextMenu:e,handleCloseContextMenu:t,columns:a,visibleColumns:o,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")}),a.map(i=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>r(i.id),children:[jsxRuntime.jsx(material.ListItemIcon,{children:o.includes(i.id)&&jsxRuntime.jsx(If__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i.label})]},i.id))]})};var sn=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),od=({kpis:e})=>{let{t}=q(),a=[{label:t("graph.kpi.totalRecords"),value:sn(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:sn(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:sn(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:sn(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:sn(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:a.map(o=>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:o.label}),jsxRuntime.jsx(material.Typography,{variant:"h4",fontWeight:800,sx:{color:o.color},children:o.value})]},o.label))})};var ri=({title:e,subtitle:t,children:a})=>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}),a]});var cn=({data:e,orientation:t="horizontal",valueSuffix:a="",minHeight:o=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:o},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),a]})]},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),a]})]},c.name))})};var nd=({data:e,color:t="#42A5F5",valueSuffix:a="",height:o=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,m)=>{let h=n+m*(r-n*2)/Math.max(e.length-1,1),I=o-n-(f.value-c)/l*(o-n*2);return {x:h,y:I,...f}}),u=s.map(f=>`${f.x},${f.y}`).join(" ");return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${r} ${o}`,sx:{width:"100%",height:o},children:[jsxRuntime.jsx("line",{x1:n,y1:o-n,x2:r-n,y2:o-n,stroke:"rgba(148,163,184,0.4)"}),jsxRuntime.jsx("polyline",{fill:"none",stroke:t,strokeWidth:3,points:u}),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),a]})]},f.name))})]})};var id=({data:e,barColor:t="#64B5F6",lineColor:a="#FFB74D",height:o=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,u)=>{let f=(r-n*2)/e.length,m=Math.max(f*.5,8),h=n+u*f+(f-m)/2,I=s.barValue/i*(o-n*2),p=o-n-I;return {x:h,y:p,barHeight:I,barWidth:m,item:s}}),l=e.map((s,u)=>{let f=(r-n*2)/e.length,m=n+u*f+f/2,h=o-n-s.lineValue/c*(o-n*2);return {x:m,y:h,item:s}});return jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${r} ${o}`,sx:{width:"100%",height:o},children:[jsxRuntime.jsx("line",{x1:n,y1:o-n,x2:r-n,y2:o-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:a,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:a},`${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 Ef=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,ld=({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))),a=Array.from(new Set(e.map(n=>n.y))),o=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)),a.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/o;return jsxRuntime.jsx(material.Box,{sx:{height:36,borderRadius:1,bgcolor:Ef(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 Lf=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],pi=({data:e,variant:t="donut",colors:a=Lf,size:o=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,`${a[l%a.length]} ${s}% ${i}%`});return jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[jsxRuntime.jsx(material.Box,{sx:{width:o,height:o,borderRadius:"50%",background:`conic-gradient(${c.join(", ")})`,position:"relative",flexShrink:0},children:t==="donut"&&jsxRuntime.jsx(material.Box,{sx:{position:"absolute",inset:Math.round(o*.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:a[l%a.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 dd=({effect:e,branches:t})=>{if(t.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let a=t.filter((r,n)=>n%2===0),o=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(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))}),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(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))})]})};var ud=({data:e,height:t=240})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let a=0,o=e.map(u=>{let f=u.type==="total"?0:a,m=u.type==="total"?u.value:a+u.value;return u.type!=="total"&&(a=m),{...u,start:f,end:m,delta:m-f}}),r=o.flatMap(u=>[u.start,u.end]),n=Math.min(...r,0),i=Math.max(...r,1),c=680,d=30,l=i-n||1,s=u=>t-d-(u-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)"}),o.map((u,f)=>{let m=(c-d*2)/o.length,h=Math.max(m*.55,8),I=d+f*m+(m-h)/2,p=s(Math.max(u.start,u.end)),C=s(Math.min(u.start,u.end)),g=u.type==="total"?"#42A5F5":u.delta>=0?"#66BB6A":"#EF5350";return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:I,y:p,width:h,height:Math.max(C-p,4),rx:6,fill:g}),jsxRuntime.jsx("text",{x:I+h/2,y:p-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:u.end.toFixed(1)})]},u.name)})]}),jsxRuntime.jsx(material.Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${o.length}, minmax(0, 1fr))`,gap:1},children:o.map(u=>jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:u.name,children:u.name},u.name))})]})};var un=({apiKey:e,query:t,zoom:a=14,mapType:o="roadmap"})=>{let r=encodeURIComponent(t);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(e)}&q=${r}&zoom=${a}&maptype=${o}`},cI=(e,t=360)=>{let a=un(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${a}"></iframe>`};var fd=({apiKey:e,query:t,embedUrl:a,zoom:o=14,mapType:r="roadmap",height:n=320})=>{let i=a||(e&&t?un({apiKey:e,query:t,zoom:o,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 gi=({keyword:e,location:t,src:a="orbcafe-ui"})=>{if(t){let o=encodeURIComponent(t.name||e||"Location");return `https://uri.amap.com/marker?position=${t.lng},${t.lat}&name=${o}&src=${encodeURIComponent(a)}&coordinate=gaode&callnative=0`}return e?`https://uri.amap.com/search?keyword=${encodeURIComponent(e)}&src=${encodeURIComponent(a)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};var xd=({keyword:e,location:t,embedUrl:a,height:o=320})=>{let r=a||gi({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:o,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 vd=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:a,interaction:o})=>{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(ri,{title:r("graph.chart.billable.title"),subtitle:r("graph.chart.billable.subtitle"),children:jsxRuntime.jsx(cn,{data:e,orientation:"horizontal",activeName:o?.filters?.primaryDimension,onItemClick:n=>o?.onPrimaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(ri,{title:r("graph.chart.efficiency.title"),subtitle:r("graph.chart.efficiency.subtitle"),children:jsxRuntime.jsx(cn,{data:t,orientation:"vertical",valueSuffix:"%",activeName:o?.filters?.secondaryDimension,onItemClick:n=>o?.onSecondaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(ri,{title:r("graph.chart.status.title"),subtitle:r("graph.chart.status.subtitle"),children:jsxRuntime.jsx(pi,{data:a,variant:"donut",activeName:o?.filters?.status,onItemClick:n=>o?.onStatusClick?.(n.name)})})]})};var qa=e=>jsxRuntime.jsx(material.TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var sl=e=>jsxRuntime.jsx(material.TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var eh=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],th=["zh","en","de","fr","ja","ko"],Sd=({open:e,onClose:t,value:a,onSaveAll:o,modelOptions:r=eh,promptLangOptions:n=th,analysisTemplateOptions:i=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:l})=>{let[s,u]=ut.useState(a),[f,m]=ut.useState(d||""),[h,I]=ut.useState(l||""),[p,C]=ut.useState(false);ut.useEffect(()=>{e&&(u(a),m(d||""),I(l||""));},[e,a,d,l]);let g=(x,k)=>{u(L=>({...L,[x]:k}));},y=async()=>{if(o)try{C(!0),await o({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(Jf__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(qa,{size:"small",value:s.baseUrl,onChange:x=>g("baseUrl",x.target.value),fullWidth:true,label:"Base URL"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(qa,{size:"small",type:"password",value:s.apiKey,onChange:x=>g("apiKey",x.target.value),fullWidth:true,label:"API Key"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(qa,{size:"small",value:s.model,onChange:x=>g("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(qa,{size:"small",value:s.promptLang,onChange:x=>g("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(qa,{size:"small",value:f,onChange:x=>m(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(sl,{multiline:true,minRows:8,value:s.analysisPrompt,onChange:x=>g("analysisPrompt",x.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxRuntime.jsxs(qa,{size:"small",value:h,onChange:x=>I(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(sl,{multiline:true,minRows:8,value:s.responsePrompt,onChange:x=>g("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:!o||p,children:"Save"})]})]})};var xi=({open:e,onClose:t,model:a,tableContent:o,extraCharts:r,interaction:n,aiAssistant:i})=>{let{t:c}=q(),[d,l]=ut.useState(i?.defaultPrompt||""),[s,u]=ut.useState(false),[f,m]=ut.useState(false),h=n?.enabled!==false&&!!n,I=i?.enabled!==false,p=n?.filters||{},C=!!(p.primaryDimension||p.secondaryDimension||p.status),g=i?.placeholder||"Ask AI to analyze data, create charts, or find insights...";ut.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 k=d.trim();if(!(!k||!i?.onSubmit))try{u(!0),await i.onSubmit(k,{filters:p,model:a});}finally{u(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:a.title}),jsxRuntime.jsx(material.Chip,{size:"small",label:c("graph.records",{count:a.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:[I&&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(sh__default.default,{sx:{fontSize:18,color:"text.secondary"}})}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:d,onChange:k=>l(k.target.value),onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),x());},placeholder:g,sx:{fontSize:"0.9rem"}}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:x,disabled:s||!d.trim(),children:jsxRuntime.jsx(ch__default.default,{sx:{fontSize:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>m(true),children:jsxRuntime.jsx(lh__default.default,{sx:{fontSize:18}})})]}),jsxRuntime.jsx(material.IconButton,{onClick:t,children:jsxRuntime.jsx(Jf__default.default,{})})]})]})}),jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,overflow:"auto",minHeight:0},children:[jsxRuntime.jsx(od,{kpis:a.kpis}),jsxRuntime.jsx(vd,{billableByPrimary:a.charts.billableByPrimary,efficiencyBySecondary:a.charts.efficiencyBySecondary,statusDistribution:a.charts.statusDistribution,interaction:h?{filters:p,onPrimaryDimensionClick:k=>n?.onPrimaryDimensionClick(k),onSecondaryDimensionClick:k=>n?.onSecondaryDimensionClick(k),onStatusClick:k=>n?.onStatusClick(k)}:void 0}),r,o]}),jsxRuntime.jsx(Sd,{open:f,onClose:()=>m(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 fa={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"]},ph=5,wd=e=>e.toLowerCase().replace(/[\s_-]/g,""),ha=(e,t,a,o)=>{if(t)return t;if(e.length===0)return o;let r=Object.keys(e[0]),n=new Map(r.map(i=>[wd(i),i]));for(let i of a){let c=n.get(wd(i));if(c)return c}return r[0]||o},Gt=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},kt=(e,t)=>e==null||e===""?t:String(e),uh=(e,t,a,o,r)=>{let n=new Map;return e.forEach(i=>{let c=kt(i[t],r);n.set(c,(n.get(c)||0)+Gt(i[a]));}),Array.from(n.entries()).map(([i,c])=>({name:i,value:c})).sort((i,c)=>c.value-i.value).slice(0,o)},mh=(e,t,a,o,r,n)=>{let i=new Map;return e.forEach(c=>{let d=kt(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=Gt(c[a]),l.billable+=Gt(c[o]),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)},gh=(e,t,a)=>{let o=e.length;if(o===0)return [];let r=new Map;return e.forEach(n=>{let i=kt(n[t],a);r.set(i,(r.get(i)||0)+1);}),Array.from(r.entries()).map(([n,i])=>({name:n,value:i,percent:i/o*100}))},Id=(e,t,a)=>{let o=new Map;return e.forEach(r=>{let n=kt(r[t],"N/A");o.set(n,(o.get(n)||0)+Gt(r[a]));}),Array.from(o.entries()).sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>({name:r,value:n}))},fh=(e,t,a,o,r,n)=>{let i=new Map;return e.forEach(c=>{let d=kt(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=Gt(c[a]),l.billable+=Gt(c[o]),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)},hh=(e,t,a,o,r)=>{let n=new Map;return e.forEach(i=>{let c=kt(i[t],r),d=kt(i[a],r),l=`${c}__${d}`;n.set(l,(n.get(l)||0)+Gt(i[o]));}),Array.from(n.entries()).map(([i,c])=>{let[d,l]=i.split("__");return {x:d,y:l,value:c}})},yh=(e,t,a)=>{let o=Id(e,t,a),r=o.map(i=>({name:i.name,value:i.value,type:"delta"})),n=o.reduce((i,c)=>i+c.value,0);return [...r,{name:"Total",value:n,type:"total"}]},bh=(e,t,a,o,r,n)=>{let i=new Map;return e.forEach(c=>{let d=kt(c[t],n),l=`${kt(c[a],n)} / ${kt(c[o],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)},Dr=({rows:e,config:t})=>{let{t:a}=q(),o=a("graph.unassigned"),r=ut.useMemo(()=>{let s=t?.fieldMapping;return {primaryDimension:ha(e,s?.primaryDimension,fa.primaryDimension,"Category"),secondaryDimension:ha(e,s?.secondaryDimension,fa.secondaryDimension,"Owner"),status:ha(e,s?.status,fa.status,"Status"),date:ha(e,s?.date,fa.date,"Date"),description:ha(e,s?.description,fa.description,"Description"),reportHours:ha(e,s?.reportHours,fa.reportHours,"ReportHours"),billableHours:ha(e,s?.billableHours,fa.billableHours,"BillableHours"),amount:ha(e,s?.amount,fa.amount,"Amount")}},[e,t?.fieldMapping]),n=ut.useMemo(()=>e.map((s,u)=>{let f=Gt(s[r.reportHours]),m=Gt(s[r.billableHours]),h=Gt(s[r.amount]),I=f>0?m/f*100:0;return {id:`graph-row-${u}`,Date:kt(s[r.date],""),Primary:kt(s[r.primaryDimension],o),Secondary:kt(s[r.secondaryDimension],o),Description:kt(s[r.description],""),ReportHours:f,BillableHours:m,Amount:h,Efficiency:I,Status:kt(s[r.status],o)}}),[e,r,o]),i=ut.useMemo(()=>{let s=n.length,u=n.reduce((C,g)=>C+Gt(g.ReportHours),0),f=n.reduce((C,g)=>C+Gt(g.BillableHours),0),m=n.reduce((C,g)=>C+Gt(g.Amount),0),h=u>0?f/u*100:0,I=t?.statusFlagValues||["flag","flagged","warning","risk"],p=n.filter(C=>I.includes(kt(C.Status,"").toLowerCase())).length;return {totalRecords:s,totalReportHours:u,totalBillableHours:f,efficiency:h,totalAmount:m,flaggedCount:p}},[n,t?.statusFlagValues]),c=t?.topN||ph,d=ut.useMemo(()=>({billableByPrimary:uh(n,"Primary","BillableHours",c,o),efficiencyBySecondary:mh(n,"Secondary","ReportHours","BillableHours",c,o),statusDistribution:gh(n,"Status",o),lineByDate:Id(n,"Date","BillableHours"),comboByPrimary:fh(n,"Primary","ReportHours","BillableHours",c,o),heatmapPrimarySecondary:hh(n,"Primary","Secondary","BillableHours",o),waterfallBillable:yh(n,"Date","BillableHours"),fishboneStatusCauses:bh(n,"Status","Primary","Secondary",3,o)}),[n,c,o]),l=ut.useMemo(()=>({title:t?.title||a("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:a("graph.column.reportHours"),align:"right"},{id:"BillableHours",label:a("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,a]);return {fieldMapping:r,model:l}};var Mr=e=>String(e??"").trim(),Ci=(e={})=>{let[t,a]=ut.useState(e),o=ut.useCallback((d,l)=>{a(s=>{let u=l?.trim();if(!u){let f={...s};return delete f[d],f}if(s[d]===u){let f={...s};return delete f[d],f}return {...s,[d]:u}});},[]),r=ut.useCallback(d=>{a(l=>{if(!l[d])return l;let s={...l};return delete s[d],s});},[]),n=ut.useCallback(()=>{a({});},[]),i=ut.useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),c=ut.useCallback((d,l)=>d.filter(s=>!(t.primaryDimension&&Mr(s[l.primaryDimension])!==Mr(t.primaryDimension)||t.secondaryDimension&&Mr(s[l.secondaryDimension])!==Mr(t.secondaryDimension)||t.status&&Mr(s[l.status])!==Mr(t.status))),[t]);return {filters:t,setFilter:o,clearFilter:r,clearAll:n,hasActiveFilters:i,applyRows:c}};var Si=({variants:e,currentVariantId:t,onLoad:a,onSave:o,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)"},[u,f]=ut.useState(false),[m,h]=ut.useState(""),[I,p]=ut.useState(false),[C,g]=ut.useState(false),y=e.find(L=>L.id===t),x=()=>{h(y?.name||i("variant.newVariant")),p(y?.isDefault||false),g(y?.isPublic||false),f(true);},k=()=>{o({name:m,isDefault:I,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:L=>L.name+(L.isDefault?` (${i("variant.defaultSuffix")})`:""),value:y||null,onChange:(L,P)=>{P&&a(P);},renderInput:L=>jsxRuntime.jsx(material.TextField,{...L,variant:"outlined",size:"small",InputProps:{...L.InputProps,sx:{fontSize:l,color:d?"#E3F2FD":"#0D47A1"}},placeholder:i("variant.selectVariant")}),renderOption:(L,P)=>jsxRuntime.jsx("li",{...L,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{flex:1,fontSize:l},children:P.name}),P.isDefault&&jsxRuntime.jsx(Mh__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(qd__default.default,{fontSize:"small"})})}),jsxRuntime.jsxs(material.Dialog,{open:u,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:m,onChange:L=>h(L.target.value)}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:I,onChange:L=>p(L.target.checked)}),label:i("variant.setDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:C,onChange:L=>g(L.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:k,variant:"contained",children:i("common.save")})]})]})]})};var Fd=({appId:e,tableKey:t="default",currentFilters:a,currentLayoutId:o,layoutRefs:r,onLoad:n,variantService:i,serviceUrl:c,onError:d,onSuccess:l,currentVariantId:s,onVariantChange:u})=>{let{t:f}=q(),[m,h]=ut.useState([]),[I,p]=ut.useState(""),C=`orbcafe.variants.${e}.${t}`,g=s!==void 0?s:I,y=M=>{s===void 0&&p(M),u&&u(M);},x=ut.useCallback(()=>{try{let M=localStorage.getItem(C);if(!M)return [];let w=JSON.parse(M);return Array.isArray(w)?w:[]}catch{return []}},[C]),k=ut.useCallback(M=>{try{localStorage.setItem(C,JSON.stringify(M));}catch{}},[C]),L=ut.useCallback(M=>{h(M);let w=M.find(D=>D.isDefault);w&&!g&&(y(w.id),n(w));},[g,n,y]),P=ut.useCallback(async()=>{if(!e)return [];try{let M=[];if(i)M=await i.getVariants(e,t);else if(c){let w=await fetch(`${c}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!w.ok)throw new Error(f("variant.toast.fetchFailed"));M=await w.json();}else M=x();return L(M),M}catch(M){console.error("Error fetching variants",M);let w=x();return L(w),d&&d(f("variant.toast.fetchFailed")),w}},[e,t,i,c,x,L,d,f]);return ut.useEffect(()=>{P();},[e,t]),jsxRuntime.jsx(Si,{variants:m,currentVariantId:g,onLoad:M=>{y(M.id),n(M);},onSave:async M=>{let w=Date.now().toString(),D;try{let F=m.find(Y=>Y.name===M.name);w=F?F.id:Date.now().toString();let $=[];if(F&&(Array.isArray(F.filters)?$=[...F.filters]:F.filters&&($=[{scope:"default",filters:F.filters}])),M.scope==="Search"||M.scope==="Both"){let Y=(Array.isArray(a),a);if(Y)if(Array.isArray(Y)&&Y.length>0&&Y[0].scope)Y.forEach(ee=>{let te=$.findIndex(ae=>ae.scope===ee.scope);te>=0?$[te]=ee:$.push(ee);});else {let ee={scope:t,filters:Y},te=$.findIndex(ae=>ae.scope===t);te>=0?$[te]=ee:$.push(ee);}}let V=F?.layout||{},_=[];if(F&&Array.isArray(F.layoutRefs)&&(_=[...F.layoutRefs]),M.scope==="Layout"||M.scope==="Both")if(r&&r.length>0)r.forEach(Y=>{let ee=_.findIndex(te=>te.tableKey===Y.tableKey);ee>=0?_[ee]=Y:_.push(Y);});else {let Y={tableKey:t,layoutId:o||null},ee=_.findIndex(te=>te.tableKey===t);ee>=0?_[ee]=Y:_.push(Y);}if(D={appId:e,tableKey:t,...M,id:w,createdAt:new Date().toISOString(),filters:$,layout:V,layoutRefs:_},i)await i.saveVariant(D,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)})).ok)throw new Error(f("variant.toast.saveFailed"))}else {let ee=m.some(te=>te.id===w)?m.map(te=>te.id===w?D:te):[...m,D];h(ee),k(ee);}l&&l(f("variant.toast.saveSuccess")),(i||c)&&await P(),y(w),n(D);}catch(F){console.error("Error saving variant",F);let V=m.some(_=>_.id===w)?m.map(_=>_.id===w?D:_):[...m,D];h(V),k(V),y(w),n(D),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 w=m.filter(D=>D.id!==M);h(w),k(w);}g===M&&y(""),(i||c)&&P(),l&&l(f("variant.toast.deleteSuccess"));}catch(w){console.error("Error deleting variant",w);let D=m.filter(F=>F.id!==M);h(D),k(D),g===M&&y(""),d&&d(f("variant.toast.deleteFailed"));}},onSetDefault:async M=>{try{let w=m.find(F=>F.id===M);if(!w)return;let D={appId:e,tableKey:t,...w,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(D)})).ok)throw new Error(f("variant.toast.defaultFailed"))}else {let F=m.map($=>({...$,isDefault:$.id===M}));h(F),k(F);}(i||c)&&await P(),l&&l(f("variant.toast.defaultSuccess"));}catch(w){console.error("Error setting default variant",w);let D=m.map(F=>({...F,isDefault:F.id===M}));h(D),k(D),d&&d(f("variant.toast.defaultFailed"));}}})};Za__default.default.extend(Zh__default.default);Za__default.default.extend(jh__default.default);var Xh=[null,null],ul="0.85rem",Qh={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},Yh=material.styled(PickersDay.PickersDay,{shouldForwardProp:e=>e!=="isInRange"&&e!=="isStart"&&e!=="isEnd"&&e!=="isHovered"})(({theme:e,isInRange:t,isStart:a,isEnd:o,isHovered:r})=>({...t&&{borderRadius:0,backgroundColor:e.palette.primary.light,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.main}},...r&&!t&&!a&&!o&&{borderRadius:0,backgroundColor:e.palette.action.hover,border:`1px dashed ${e.palette.primary.main}`},...a&&{borderRadius:"50% 0 0 50%",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...o&&{borderRadius:"0 50% 50% 0",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...a&&o&&{borderRadius:"50%"}})),zd=({label:e,value:t=Xh,onChange:a})=>{let{t:o,locale:r}=q(),n=Qh[r]||"en",i=e||o("dateRange.label"),[c,d]=ut.useState(null),[l,s]=ut.useState(t),[u,f]=ut.useState("start"),[m,h]=ut.useState(null),[I,p]=ut.useState((t[0]||Za__default.default()).locale(n)),C=ut__namespace.default.useRef(t);ut.useEffect(()=>{let[w,D]=t,[F,$]=C.current,V=ee=>ee&&typeof ee.isSame=="function",_=!(w===null&&F===null||V(w)&&V(F)&&w.isSame(F,"day")),Y=!(D===null&&$===null||V(D)&&V($)&&D.isSame($,"day"));(_||Y)&&(s(t),t[0]&&V(t[0])&&p(t[0].locale(n))),C.current=t;},[t,n]);let g=w=>{d(w.currentTarget);},y=()=>{d(null),f("start"),h(null);},x=!!c,k=w=>{if(!w)return;let D=[...l];if(u==="start")D=[w,null],f("end");else {let F=D[0];F&&w.isBefore(F)?(D=[w,null],f("end")):(D=[F,w],f("start"));}s(D);},L=w=>{let D=Za__default.default().locale(n),F=[null,null];switch(w){case "today":F=[D,D];break;case "week":F=[D.startOf("week"),D.endOf("week")];break;case "month":F=[D.startOf("month"),D.endOf("month")];break}s(F),f("start"),p(D);},P=()=>{s([null,null]),f("start"),p(Za__default.default().locale(n));},S=()=>{a&&a(l),y();},B=()=>{s(t),f("start"),y();},T=ut.useCallback(w=>{let{day:D,...F}=w,[$,V]=l,_=$?D.isSame($,"day"):false,Y=V?D.isSame(V,"day"):false,ee=$&&V?D.isBetween($,V,"day","()"):false,te=false;return u==="end"&&$&&!V&&m&&D.isAfter($,"day")&&D.isBefore(m.add(1,"day"),"day")&&(te=true),jsxRuntime.jsx(Yh,{...F,day:D,disableMargin:true,isStart:_,isEnd:Y,isInRange:ee||te,onMouseEnter:()=>h(D)})},[l,u,m]),v=w=>w?w.locale(n).format("YYYY-MM-DD"):"",M=w=>w?w.locale(n).format("ll"):"";return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.TextField,{label:i,value:l[0]?`${v(l[0])} - ${v(l[1])}`:"",onClick:g,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:ul}},InputProps:{readOnly:true,sx:{fontSize:ul,"& .MuiOutlinedInput-input":{fontSize:ul},paddingRight:"4px"},endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",sx:{ml:0},children:[(l[0]||l[1])&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:w=>{w.stopPropagation(),P();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsxRuntime.jsx(qh__default.default,{sx:{fontSize:"1rem"}})}),jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end",onClick:g,sx:{padding:"2px"},children:jsxRuntime.jsx(Kh__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:u==="start"?"primary.main":"divider",borderRadius:1,bgcolor:u==="start"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>f("start"),children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",display:"block",children:o("dateRange.startDate")}),jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:500,children:l[0]?M(l[0]):o("dateRange.select")})]}),jsxRuntime.jsx(_h__default.default,{color:"action",fontSize:"small"}),jsxRuntime.jsxs(material.Box,{sx:{p:1,border:1,borderColor:u==="end"?"primary.main":"divider",borderRadius:1,bgcolor:u==="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:o("dateRange.endDate")}),jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:500,children:l[1]?M(l[1]):o("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:o("dateRange.today"),onClick:()=>L("today"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:o("dateRange.thisWeek"),onClick:()=>L("week"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:o("dateRange.thisMonth"),onClick:()=>L("month"),clickable:true,size:"small",variant:"outlined"})]})}),jsxRuntime.jsx(LocalizationProvider.LocalizationProvider,{dateAdapter:AdapterDayjs.AdapterDayjs,adapterLocale:n,children:jsxRuntime.jsx(DateCalendar.DateCalendar,{value:null,referenceDate:I,onMonthChange:p,onYearChange:p,onChange:k,slots:{day:T},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:B,color:"inherit",children:o("common.cancel")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"contained",onClick:S,children:o("common.done")})]})]})]})};var Pi={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},cy={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"},dy=["equals","contains","notContains","wildcard"],Od=["=","!=",">","<",">=","<=","between"],Qe="0.85rem",py=({field:e,value:t,onChange:a})=>{let{t:o}=q(),[r,n]=ut.useState(null),[i,c]=ut.useState(null),[d,l]=ut.useState(""),[s,u]=ut.useState(""),[f,m]=ut.useState(false),[h,I]=ut.useState(""),[p,C]=ut.useState("");ut.useEffect(()=>{let v=setTimeout(()=>{C(h);},1e3);return ()=>clearTimeout(v)},[h]);let g=t?.operator||(e.type==="number"?"=":"equals"),y=t?.value,x=v=>{let M=cy[v];return M?o(M):v},k=v=>{n(v.currentTarget);},L=v=>{a({...t,operator:v,value:y}),n(null);},P={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:Qe}},InputProps:{sx:{fontSize:Qe}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Qe,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},S=e.type||"text";if(S==="date"){let M=(w=>{if(!w)return [null,null];if(Array.isArray(w)&&w.length===2){let D=w[0]?Za__default.default.isDayjs(w[0])?w[0]:Za__default.default(w[0]):null,F=w[1]?Za__default.default.isDayjs(w[1])?w[1]:Za__default.default(w[1]):null;return [D,F]}return Za__default.default.isDayjs(w)||typeof w=="string"?[Za__default.default.isDayjs(w)?w:Za__default.default(w),null]:[null,null]})(y);return jsxRuntime.jsx(zd,{label:e.label,value:M,onChange:w=>a({value:w,operator:"between"})})}if(S==="number"&&g==="between"){let v=()=>{a({value:[d,s],operator:"between"}),c(null);},M=Array.isArray(y)?`${y[0]||""} - ${y[1]||""}`:"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...P,label:e.label,value:M,placeholder:o("smartFilter.minMaxPlaceholder"),InputProps:{...P.InputProps,startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:x("between"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:k,sx:{width:24,height:24,fontSize:Qe},children:Pi.between})})}),readOnly:true},onClick:w=>c(w.currentTarget)}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Qe,minHeight:"auto",py:.5}}},children:Od.map(w=>jsxRuntime.jsxs(material.MenuItem,{selected:w===g,onClick:()=>L(w),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Pi[w]}),jsxRuntime.jsx(material.ListItemText,{primary:x(w),primaryTypographyProps:{fontSize:Qe}})]},w))}),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:o("smartFilter.min"),type:"number",value:d,onChange:w=>l(w.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Qe}},InputProps:{sx:{fontSize:Qe}}}),jsxRuntime.jsx(ly__default.default,{color:"action"}),jsxRuntime.jsx(material.TextField,{size:"small",label:o("smartFilter.max"),type:"number",value:s,onChange:w=>u(w.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Qe}},InputProps:{sx:{fontSize:Qe}}}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:v,children:o("common.ok")})]})})]})}if(S==="select")return jsxRuntime.jsxs(material.TextField,{...P,select:true,label:e.label,value:y||"",onChange:v=>a({...t,value:v.target.value,operator:"equals"}),children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:jsxRuntime.jsx("em",{children:o("common.none")})}),e.options?.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v.value,children:v.label},v.value))]});if(S==="multi-select"){let v=Array.isArray(y)?y:[],M=e.options?.filter(w=>w.label.toLowerCase().includes(p.toLowerCase()))||[];return jsxRuntime.jsxs(material.TextField,{...P,select:true,label:e.label,value:v,onChange:w=>a({...t,value:w.target.value,operator:"anyOf"}),SelectProps:{...P.SelectProps,multiple:true,onClose:()=>{I(""),C("");},renderValue:w=>{if(!Array.isArray(w)||w.length===0)return jsxRuntime.jsx("em",{children:o("common.none")});let D=$=>e.options?.find(V=>V.value===$)?.label||$,F=w.map(D);return F.length>2?`${F.slice(0,2).join(", ")} +${F.length-2}`:F.join(", ")}},children:[jsxRuntime.jsx(material.ListSubheader,{children:jsxRuntime.jsx(material.TextField,{size:"small",autoFocus:true,placeholder:o("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Vd__default.default,{fontSize:"small"})}),sx:{fontSize:Qe}},value:h,onChange:w=>I(w.target.value),onKeyDown:w=>{w.key!=="Escape"&&w.stopPropagation();},onClick:w=>w.stopPropagation()})}),M.length>0?M.map(w=>jsxRuntime.jsxs(material.MenuItem,{value:w.value,children:[jsxRuntime.jsx(material.Checkbox,{checked:v.indexOf(w.value)>-1,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:w.label,primaryTypographyProps:{fontSize:Qe}})]},w.value)):jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:o("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:Qe}})})]})}let B=S==="number"?Od:dy,T=f||y!==void 0&&y!==""&&y!==null||!!r;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...P,label:e.label,sx:{minWidth:"120px"},value:y||"",type:S==="number"?"number":"text",onChange:v=>a({...t,value:v.target.value,operator:g}),onFocus:()=>m(true),onBlur:()=>m(false),InputProps:{...P.InputProps,startAdornment:T?jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:x(g),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:k,onMouseDown:v=>v.preventDefault(),sx:{width:24,height:24,fontSize:Qe,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Pi[g]})})}):null,endAdornment:e.hasSearchIcon?jsxRuntime.jsx(material.InputAdornment,{position:"end",children:jsxRuntime.jsx(Vd__default.default,{color:"action"})}):void 0}}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Qe,minHeight:"auto",py:.5}}},children:B.map(v=>jsxRuntime.jsxs(material.MenuItem,{selected:v===g,onClick:()=>L(v),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Pi[v]}),jsxRuntime.jsx(material.ListItemText,{primary:x(v),primaryTypographyProps:{fontSize:Qe}})]},v))})]})},Xa=({fields:e,filters:t,onFilterChange:a,variants:o=[],currentVariantId:r,onVariantLoad:n,onVariantSave:i,onVariantDelete:c,onVariantSetDefault:d,onSearch:l,loading:s=false,appId:u,tableKey:f,currentLayout:m,currentLayoutId:h,layoutRefs:I,variantService:p,serviceUrl:C})=>{let{t:g}=q(),[y,x]=ut.useState(true),[k,L]=ut.useState(null),[P,S]=ut.useState(e.filter(M=>!M.hidden).map(M=>M.id)),B=(M,w)=>{a({...t,[M]:w});},T=M=>{P.includes(M)?S(P.filter(w=>w!==M)):S([...P,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:[u?jsxRuntime.jsx(Fd,{appId:u,tableKey:f,currentFilters:{values:t,visibleFields:P},currentLayout:m,currentLayoutId:h,layoutRefs:I,onLoad:M=>{if(!M.filters)return;let w=null;if(Array.isArray(M.filters)){let D=f||"default",F=M.filters.find($=>$.scope===D);w=F?F.filters:null;}else w=M.filters;w&&(w.values||w.visibleFields?(w.visibleFields&&Array.isArray(w.visibleFields)&&S(w.visibleFields),w.values&&a(w.values)):a(w)),n&&n(M);},variantService:p,serviceUrl:C,currentVariantId:r}):jsxRuntime.jsx(Si,{variants:o,currentVariantId:r,onLoad:n,onSave:M=>{i&&i({...M,filters:{values:t,visibleFields:P}});},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=>L(M.currentTarget),size:"small",color:"primary",startIcon:jsxRuntime.jsx(ny__default.default,{fontSize:"small"}),sx:{textTransform:"none",fontSize:Qe,whiteSpace:"nowrap",minWidth:"fit-content"},children:g("smartFilter.adaptFilters")})}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:l,disabled:s,sx:{minWidth:"52px",fontWeight:"bold",fontSize:Qe},children:g(s?"common.loading":"smartFilter.go")}),jsxRuntime.jsxs(material.Menu,{anchorEl:k,open:!!k,onClose:()=>L(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:Qe,minHeight:32}}}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:g("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:Qe}})}),jsxRuntime.jsx(material.Divider,{}),e.map(M=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>T(M.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:P.includes(M.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:M.label,primaryTypographyProps:{fontSize:Qe}})]},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=>P.includes(M.id)).map(M=>jsxRuntime.jsx(material.Grid,{size:1,children:jsxRuntime.jsx(py,{field:M,value:t[M.id]||{value:"",operator:M.type==="number"?"=":"equals"},onChange:w=>B(M.id,w)})},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:()=>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(iy__default.default,{sx:{fontSize:16},color:"action"}):jsxRuntime.jsx(pf__default.default,{sx:{fontSize:16},color:"action"})})})]})};var _d=({layouts:e,currentLayoutId:t,onLoad:a,onSave:o,onDelete:r,onSetDefault:n})=>{let{t:i}=q(),[c,d]=ut.useState(null),[l,s]=ut.useState(false),[u,f]=ut.useState(""),[m,h]=ut.useState(""),[I,p]=ut.useState({isDefault:false,isPublic:false}),C=e.find(P=>P.id===t),g=P=>{d(P.currentTarget);},y=()=>{d(null);},x=P=>{a(P),y();},k=()=>{f(""),h(""),p({isDefault:false,isPublic:false}),s(true),y();},L=()=>{u.trim()&&(o({name:u,description:m,...I}),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:k,color:"primary",size:"small",children:jsxRuntime.jsx(qd__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:i("layout.layoutOptions"),children:jsxRuntime.jsx(material.IconButton,{onClick:g,color:C?"primary":"default",children:jsxRuntime.jsx(Sy__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:k,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(qd__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((P,S)=>jsxRuntime.jsx(material.MenuItem,{onClick:()=>x(P),selected:P.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:P.id===t?"bold":"normal",noWrap:true,children:P.name})}),P.description&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,children:P.description})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center"},onClick:B=>B.stopPropagation(),children:[jsxRuntime.jsx(material.Tooltip,{title:P.isDefault?i("layout.removeDefault"):i("layout.setAsDefault"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:B=>{B.stopPropagation(),n(P.id);},children:P.isDefault?jsxRuntime.jsx(Mh__default.default,{fontSize:"small",color:"warning"}):jsxRuntime.jsx(ky__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.Tooltip,{title:i("common.delete"),children:jsxRuntime.jsx(material.IconButton,{size:"small",color:"error",onClick:B=>{B.stopPropagation(),r(P.id);},children:jsxRuntime.jsx(Kg__default.default,{fontSize:"small"})})})]})]})},P.id||S))]}),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:u,onChange:P=>f(P.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:i("layout.layoutNameHelper")}),e.some(P=>P.name===u)&&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:m,onChange:P=>h(P.target.value),fullWidth:true,size:"small"}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:I.isDefault,onChange:P=>p({...I,isDefault:P.target.checked})}),label:i("layout.useAsDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:I.isPublic,onChange:P=>p({...I,isPublic:P.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:L,variant:"contained",disabled:!u,children:i("common.save")})]})]})]})};var Ai=({appId:e,tableKey:t="default",currentLayoutData:a,onLayoutLoad:o,targetLayoutId:r,activeLayoutId:n,serviceUrl:i,onError:c,onSuccess:d})=>{let{t:l}=q(),[s,u]=ut.useState([]),[f,m]=ut.useState(""),h=`orbcafe.layouts.${e}.${t}`,I=S=>({id:S.layoutId,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt??new Date().toISOString(),layoutData:S.layout??{}}),p=S=>({appId:e,tableKey:t,layoutId:S.id,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt,layout:S.layoutData}),C=ut.useCallback(()=>{try{let S=localStorage.getItem(h);if(!S)return [];let B=JSON.parse(S);return Array.isArray(B)?B:[]}catch{return []}},[h]),g=ut.useCallback(S=>{try{localStorage.setItem(h,JSON.stringify(S));}catch{}},[h]);ut.useEffect(()=>{n!==void 0&&m(n);},[n]),ut.useEffect(()=>{if(r&&s.length>0){let S=s.find(B=>B.id===r);S&&(m(S.id),o(S));}},[r,s,o]);let y=ut.useCallback(async()=>{if(e){if(!i){let S=C();u(S);let B=S.find(T=>T.isDefault);B&&!f&&!r&&(m(B.id),o(B));return}try{let S=await fetch(`${i}/api/layouts?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!S.ok)throw new Error("LAYOUT_FETCH_FAILED");let T=(await S.json()).map(I);u(T);let v=T.find(M=>M.isDefault);v&&!f&&!r&&(m(v.id),o(v));}catch(S){console.error("Error fetching layouts",S);let B=C();u(B);let T=B.find(v=>v.isDefault);T&&!f&&!r&&(m(T.id),o(T)),c&&c(l("layout.toast.loadFallback"));}}},[e,t,i,c,f,o,r,C,l]);return ut.useEffect(()=>{y();},[e,t]),jsxRuntime.jsx(_d,{layouts:s,currentLayoutId:f,onLoad:S=>{m(S.id),o(S);},onSave:async S=>{let B=s.find(M=>M.name===S.name),T=B?B.id:Date.now().toString(),v={id:T,...S,createdAt:new Date().toISOString(),layoutData:a,isDefault:S.isDefault??false,isPublic:S.isPublic??false};if(!i){let w=s.some(D=>D.id===T)?s.map(D=>D.id===T?v:D):[...s,v];u(w),g(w),m(T),o(v),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(v))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(l("layout.toast.saveSuccess")),await y(),m(T),o(v);}catch(M){console.error("Error saving layout",M);let D=s.some(F=>F.id===T)?s.map(F=>F.id===T?v:F):[...s,v];u(D),g(D),m(T),o(v),d&&d(l("layout.toast.saveLocalSuccess")),c&&c(l("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async S=>{if(!i){let B=s.filter(T=>T.id!==S);u(B),g(B),f===S&&m(""),d&&d(l("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts/${encodeURIComponent(S)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f===S&&m(""),d&&d(l("layout.toast.deleteSuccess")),await y();}catch(B){console.error("Error deleting layout",B);let T=s.filter(v=>v.id!==S);u(T),g(T),f===S&&m(""),d&&d(l("layout.toast.deleteLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async S=>{if(!i){let B=s.map(T=>({...T,isDefault:T.id===S}));u(B),g(B),d&&d(l("layout.toast.defaultLocalSuccess"));return}try{let B=s.find(v=>v.id===S);if(!B)return;if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p({...B,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(l("layout.toast.defaultSuccess")),await y();}catch(B){console.error("Error setting default",B);let T=s.map(v=>({...v,isDefault:v.id===S}));u(T),g(T),d&&d(l("layout.toast.defaultLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDefaultLocal"));}}})};var jd=(e,t)=>{if(!e||!e.filters)return null;if(Array.isArray(e.filters)){let a=e.filters.find(r=>r.scope===t);if(a)return a.filters;let o=e.filters.find(r=>r.scope==="default");return o?o.filters:null}return typeof e.filters=="object"?e.filters:null},Bi=(e,t)=>{if(!e)return {layout:null,layoutId:null};let a=null,o=null;if(Array.isArray(e.layoutRefs)){let r=e.layoutRefs.find(n=>n.tableKey===t);r&&(a=r.layoutId);}return !a&&e.layoutId&&(a=e.layoutId),e.layout&&typeof e.layout=="object"&&!Array.isArray(e.layout)&&(o=e.layout),{layoutId:a,layout:o}};function Xd(e,t,a){return t[a]<e[a]?-1:t[a]>e[a]?1:0}function Iy(e,t){return e==="desc"?(a,o)=>Xd(a,o,t):(a,o)=>-Xd(a,o,t)}function Ty(e,t){let a=e.map((o,r)=>[o,r]);return a.sort((o,r)=>{let n=t(o[0],r[0]);return n!==0?n:o[1]-r[1]}),a.map(o=>o[0])}var Ei=e=>{let t=ut.useCallback(N=>{let G=String(N?.label??N?.id??"").length*9+64,ue=typeof N?.minWidth=="number"?N.minWidth:0;return Math.max(100,ue,G)},[]),a=ut.useCallback(()=>(e.columns||[]).filter(N=>!!N?.numeric).map(N=>N.id),[e.columns]),[o,r]=ut.useState(""),[n,i]=ut.useState(e.order||"asc"),[c,d]=ut.useState(e.orderBy||""),[l,s]=ut.useState(e.page||0),[u,f]=ut.useState(e.rowsPerPage||20),[m,h]=ut.useState(e.selected||[]),[I,p]=ut.useState(e.columns?e.columns.map(N=>N.id):[]),[C,g]=ut.useState(e.showSummary||false),[y,x]=ut.useState(()=>a()),[k,L]=ut.useState([]),[P,S]=ut.useState(new Set),[B,T]=ut.useState(()=>{let N={};return (e.columns||[]).forEach(O=>{N[O.id]=t(O);}),N}),[v,M]=ut.useState(null),[w,D]=ut.useState(null),[F,$]=ut.useState(null),[V,_]=ut.useState(null),[Y,ee]=ut.useState(false),[te,ae]=ut.useState(""),[Bt,lt]=ut.useState("");ut.useEffect(()=>{e.layout&&ke(e.layout);},[e.layout]),ut.useEffect(()=>{e.order!==void 0&&i(e.order),e.orderBy!==void 0&&d(e.orderBy);},[e.order,e.orderBy]),ut.useEffect(()=>{e.selected!==void 0&&h(e.selected);},[e.selected]),ut.useEffect(()=>{e.page!==void 0&&s(e.page);},[e.page]),ut.useEffect(()=>{e.rowsPerPage!==void 0&&f(e.rowsPerPage);},[e.rowsPerPage]),ut.useEffect(()=>{let N=a();x(O=>O.filter(ue=>N.includes(ue)));},[a]),ut.useEffect(()=>{T(N=>{let O={...N};return (e.columns||[]).forEach(G=>{O[G.id]===void 0&&(O[G.id]=t(G));}),O});},[e.columns,t]);let Ke=ut.useMemo(()=>{let N=e.rows||[];return o&&(N=N.filter(O=>Object.keys(O).some(G=>String(O[G]).toLowerCase().includes(o.toLowerCase())))),N},[e.rows,o]),ge=ut.useMemo(()=>e.onSortChange||!c?Ke:Ty(Ke,Iy(n,c)),[Ke,n,c,e.onSortChange]),De=ut.useCallback(N=>{if(k.length===0)return N.map(we=>({type:"row",data:we,id:we[e.rowKey||"id"]}));let O=[...N].sort((we,se)=>{for(let Pe of k){if(we[Pe]<se[Pe])return -1;if(we[Pe]>se[Pe])return 1}return 0}),G=(we,se=0)=>{if(se>=k.length)return we;let Pe=k[se],ye={},Re=[];return we.forEach(Se=>{let he=Se[Pe],Ce=`${Pe}:${he}`;ye[Ce]||(ye[Ce]={key:Ce,field:Pe,value:he,children:[],count:0,level:se},Re.push(ye[Ce])),ye[Ce].children.push(Se),ye[Ce].count++;}),Re.forEach(Se=>{Se.children&&(Se.children=G(Se.children,se+1));}),Re},ue=G(O),fe=(we,se="")=>{let Pe=[];return we.forEach(ye=>{if(ye.children){let Re=se?`${se}>${ye.key}`:ye.key,Se=P.has(Re);Pe.push({type:"group",id:Re,field:ye.field,value:ye.value,level:ye.level,count:ye.count,isExpanded:Se,childIds:(function he(Ce){let je=[];return Ce.children.forEach(Pt=>{Pt.children?je=je.concat(he(Pt)):je.push(Pt[e.rowKey||"id"]);}),je})(ye)}),Se&&(Pe=Pe.concat(fe(ye.children,Re)));}else Pe.push({type:"row",data:ye,id:ye[e.rowKey||"id"],level:k.length});}),Pe};return fe(ue)},[k,P,e.rowKey]),Fe=ut.useCallback(N=>{if(k.length===0)return [];let O=[...N].sort((fe,we)=>{for(let se of k){if(fe[se]<we[se])return -1;if(fe[se]>we[se])return 1}return 0}),G=[],ue=(fe,we,se)=>{if(we>=k.length)return;let Pe=k[we],ye=new Map;fe.forEach(Re=>{let Se=Re[Pe],he=ye.get(Se);he?he.push(Re):ye.set(Se,[Re]);}),ye.forEach((Re,Se)=>{let he=`${Pe}:${Se}`,Ce=se?`${se}>${he}`:he;G.push(Ce),ue(Re,we+1,Ce);});};return ue(O,0,""),G},[k]),Je=ut.useMemo(()=>De(ge),[ge,De]),It=ut.useMemo(()=>Fe(ge),[ge,Fe]),qe=ut.useMemo(()=>{let N=(e.rows||[]).length;return typeof e.count=="number"&&e.count>N},[e.count,e.rows]),rt=ut.useMemo(()=>qe?Je:u>0?Je.slice(l*u,l*u+u):Je,[Je,l,u,qe]),Wo=ut.useMemo(()=>qe&&typeof e.count=="number"?e.count:Je.length,[Je.length,qe,e.count]),So=N=>{S(O=>{let G=new Set(O);return G.has(N)?G.delete(N):G.add(N),G});},wo=N=>{let O=It.filter(G=>G===N||G.startsWith(`${N}>`));S(G=>{let ue=new Set(G);return O.forEach(fe=>ue.add(fe)),ue});},Io=N=>{S(O=>{let G=new Set(O);return Array.from(G).forEach(ue=>{(ue===N||ue.startsWith(`${N}>`))&&G.delete(ue);}),G});},To=N=>{if(!N){S(new Set);return}S(new Set(It));},mt=N=>{let O=It.filter(G=>G.startsWith(`${N}>`));return O.length===0?P.has(N):P.has(N)&&O.every(G=>P.has(G))},H=N=>{let O=c===N&&n==="asc",G=c===N&&n==="desc";if(e.onSortChange){O?e.onSortChange(N,"desc"):G?e.onSortChange("","asc"):e.onSortChange(N,"asc");return}O?(i("desc"),d(N)):G?(i("asc"),d("")):(i("asc"),d(N));},de=(N,O)=>{T(G=>({...G,[N]:O}));},ne=N=>{if(N.target.checked){let O=Ke.map(G=>G[e.rowKey||"id"]);h(O),e.onSelectionChange&&e.onSelectionChange(O);return}h([]),e.onSelectionChange&&e.onSelectionChange([]);},pe=(N,O)=>{let G=O[e.rowKey||"id"],ue=m.indexOf(G),fe=[];ue===-1?fe=fe.concat(m,G):ue===0?fe=fe.concat(m.slice(1)):ue===m.length-1?fe=fe.concat(m.slice(0,-1)):ue>0&&(fe=fe.concat(m.slice(0,ue),m.slice(ue+1))),h(fe),e.onSelectionChange&&e.onSelectionChange(fe);},Oe=N=>{s(N),e.onPageChange&&e.onPageChange(N);},Me=N=>{f(N),s(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(N);},Qt=N=>{let O=I.indexOf(N),G=[...I];O===-1?G.push(N):G.splice(O,1),p(G);},io=N=>{let O=k.indexOf(N),G=[...k];O===-1?G.push(N):G.splice(O,1),L(G);},so=N=>{a().includes(N)&&x(G=>G.includes(N)?G.filter(ue=>ue!==N):[...G,N]);},lo=N=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:I,order:n,orderBy:c,grouping:k,columnWidths:B,showSummary:C,summaryColumns:y});},co=N=>{let{layout:O,layoutId:G}=Bi(N,e.tableKey||"default");G?(lt(G),ae(G)):(lt(""),ae("")),O&&(O.visibleColumns&&p(O.visibleColumns),O.order&&i(O.order),O.orderBy&&d(O.orderBy),O.grouping&&L(O.grouping),O.columnWidths&&T(O.columnWidths),O.showSummary!==void 0&&g(!!O.showSummary),Array.isArray(O.summaryColumns)&&x(O.summaryColumns));},ke=N=>{let O=N?.layoutData||N?.layout||N||{};O.visibleColumns&&p(O.visibleColumns),O.order&&i(O.order),O.orderBy!==void 0&&d(O.orderBy),O.grouping&&L(O.grouping),O.columnWidths&&T(O.columnWidths),O.showSummary!==void 0&&g(!!O.showSummary),Array.isArray(O.summaryColumns)&&x(O.summaryColumns),S(new Set),s(0),N?.id&&ae(N.id),lt("");};ut.useEffect(()=>{e.layout&&co({layout:e.layout});},[e.layout]);let ce=N=>{N.preventDefault(),_(V===null?{mouseX:N.clientX+2,mouseY:N.clientY-6}:null);},gt=()=>{_(null);},Te=ut.useMemo(()=>{if(!C)return {};let N={};e.columns.forEach(G=>{if(G.numeric&&y.includes(G.id)){let ue=Ke.reduce((fe,we)=>{let se=parseFloat(we[G.id]);return fe+(isNaN(se)?0:se)},0);N[G.id]=ue.toFixed(2);}else N[G.id]="";});let O=e.columns.find(G=>I.includes(G.id));return O&&!O.numeric&&(N[O.id]="Total"),N},[Ke,e.columns,C,y,I]),Tt=()=>{if(!e.columns||!Ke)return;let N=e.columns.map(we=>we.label).join(","),O=Ke.map(we=>e.columns.map(se=>{let Pe=we[se.id];return `"${(Pe==null?"":String(Pe)).replace(/"/g,'""')}"`}).join(",")).join(`
183
+ `;return mt.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 u=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:nm(r)}}}),m=new ogl.Mesh(s,{geometry:u,program:f});function h(){if(!d)return;let P=window.devicePixelRatio||1,S=d.clientWidth,B=d.clientHeight;l.setSize(S*P,B*P),s.canvas.style.width=S+"px",s.canvas.style.height=B+"px",f.uniforms.iResolution.value.set(s.canvas.width,s.canvas.height,s.canvas.width/s.canvas.height);}window.addEventListener("resize",h),h();let I=0,p=0,C=0,g=.3,y=P=>{let S=d.getBoundingClientRect(),B=P.clientX-S.left,T=P.clientY-S.top,v=S.width,M=S.height,w=Math.min(v,M),D=v/2,F=M/2,$=(B-D)/w*2,V=(T-F)/w*2;Math.sqrt($*$+V*V)<.8?I=1:I=0;},x=()=>{I=0;};d.addEventListener("mousemove",y),d.addEventListener("mouseleave",x);let k,L=P=>{k=requestAnimationFrame(L);let S=(P-p)*.001;p=P,f.uniforms.iTime.value=P*.001,f.uniforms.hue.value=e,f.uniforms.hoverIntensity.value=t,f.uniforms.backgroundColor.value=nm(r);let B=a?1:I;f.uniforms.hover.value+=(B-f.uniforms.hover.value)*.1,o&&B>.5&&(C+=S*g),f.uniforms.rot.value=C,l.render({scene:m});};return k=requestAnimationFrame(L),()=>{cancelAnimationFrame(k),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 kC(e,t,o){let a,r,n;if(t===0)a=r=n=o;else {let i=(l,s,u)=>(u<0&&(u+=1),u>1&&(u-=1),u<.16666666666666666?l+(s-l)*6*u:u<.5?s:u<.6666666666666666?l+(s-l)*(.6666666666666666-u)*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 nm(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 kC(a,r,n)}return new ogl.Vec3(0,0,0)}var sm=Hm(()=>{"use client";});function ao(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var Os={primary:"#000000",primaryHover:"#333333"},Xn={primary:"bg-primary text-primary-foreground hover:bg-primary/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground"},an={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},Mc=()=>"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 Zm=classVarianceAuthority.cva(Mc(),{variants:{variant:{default:`${Xn.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:`${Xn.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:Xn.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-[${Os.primary}] hover:bg-[${Os.primaryHover}] text-white border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 transition-all duration-200`,"chat-stop":"bg-red-500 hover:bg-red-600 border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 text-white transition-all duration-200","chat-disabled":"cursor-not-allowed opacity-50 bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-muted)]"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3",lg:"h-11 px-8",icon:"h-10 w-10","chat-sm":"h-8 w-8 rounded-full","chat-md":"h-10 w-10 rounded-full","chat-lg":"h-12 w-12 rounded-full"},rounded:{none:an.none,sm:an.sm,md:an.md,full:an.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),Ws=mt__namespace.forwardRef(({className:e,variant:t,size:o,asChild:a=false,...r},n)=>jsxRuntime.jsx(a?reactSlot.Slot:"button",{className:ao(Zm({variant:t,size:o,className:e})),ref:n,...r}));Ws.displayName="Button";var Xm={"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"},Qm={"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"},Ym={"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"},Jm={"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"},eg={"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"},tg={"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"},rn={en:Xm,zh:Qm,fr:Ym,de:Jm,ja:eg,ko:tg};var Bc=(e,t)=>t?e.replace(/\{(\w+)\}/g,(o,a)=>{let r=t[a];return r==null?"":String(r)}):e,ng={locale:"en",t:(e,t)=>Bc(rn.en[e]||e,t)},Fc=mt.createContext(ng),Ec=({locale:e="en",messages:t,children:o})=>{let a=mt.useMemo(()=>{let r=rn[e]||rn.en,n=t?.[e]||{},i={...rn.en,...r,...n};return {locale:e,t:(c,d)=>Bc(i[c]||c,d)}},[e,t]);return jsxRuntime.jsx(Fc.Provider,{value:a,children:o})},K=()=>mt.useContext(Fc);function Hs({items:e,onItemClick:t,className:o="",level:a=0,expandedIds:r,onToggleExpand:n,colorMode:i="light"}){let{t:c}=K(),d=i==="dark",l=navigation.usePathname(),[s,u]=mt.useState(false),[f,m]=mt.useState(new Set),h=r!==void 0&&n!==void 0,I=h?r:f;mt.useEffect(()=>{u(true);},[]);let p=g=>{if(h)n(g);else {let y=new Set(f);y.has(g)?y.delete(g):y.add(g),m(y);}},C=g=>{g.children&&g.children.length>0&&p(g.id),t&&t(g);};return !e||!Array.isArray(e)?jsxRuntime.jsx("div",{className:ao("tree-menu",o),children:jsxRuntime.jsx("div",{className:"text-sm text-gray-500 p-2",children:c("navigation.noItems")})}):jsxRuntime.jsx("div",{className:ao("tree-menu",o),children:e.map(g=>{let y=I.has(g.id)||g.isExpanded,x=g.children&&g.children.length>0,k=g.appurl||g.href,L=s&&k?l===k:false;return jsxRuntime.jsxs("div",{className:"tree-menu-item relative",children:[L&&jsxRuntime.jsx("div",{className:ao("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",d?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxRuntime.jsxs(Ws,{variant:"ghost",className:ao("w-full justify-start gap-2 h-auto py-2 relative overflow-hidden group",`ml-${a*4}`,L?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:[x&&jsxRuntime.jsx("div",{className:ao("flex-shrink-0 transition-transform duration-200",y&&"rotate-90",L?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"}),g.icon&&jsxRuntime.jsx("div",{className:ao("flex-shrink-0 transition-colors duration-200",L?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:ao("text-sm truncate transition-colors duration-200",L?"font-semibold":"font-medium"),children:g.title||g.label}),g.description&&jsxRuntime.jsx("div",{className:ao("text-xs truncate transition-colors duration-200",L?d?"text-[#90caf9]/70":"text-[#1976d2]/75":d?"text-gray-400":"text-gray-500"),title:g.description,children:g.description})]})]}),x&&jsxRuntime.jsx("div",{className:ao("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(Hs,{items:g.children,onItemClick:t,level:a+1,expandedIds:r,onToggleExpand:n,colorMode:i})})})]},g.id)})})}var Wc=({collapsed:e,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light"})=>{let{t:i}=K(),c=n==="dark",d=navigation.useRouter(),[l,s]=mt.useState(""),[u,f]=mt.useState(new Set);mt.useEffect(()=>{e&&f(new Set);},[e]);let m=mt.useCallback(C=>{let g=[],y=x=>{x.forEach(k=>{g.push(k.id),k.children&&y(k.children);});};return y(C),g},[]),h=mt.useMemo(()=>{if(!l.trim())return r;let C=g=>g.reduce((y,x)=>{let k=x.title?.toLowerCase().includes(l.toLowerCase())||x.description?.toLowerCase().includes(l.toLowerCase()),L=x.children?C(x.children):[];return (k||L.length>0)&&y.push({...x,children:L.length>0?L:x.children}),y},[]);return C(r)},[l,r]),I=mt.useMemo(()=>l.trim()?new Set(m(r)):u,[l,r,u,m]),p=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: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(Hs,{items:h,onItemClick:p,className:"space-y-1",expandedIds:I,colorMode:n,onToggleExpand:C=>{let g=new Set(u);h.some(x=>x.id===C)?g.has(C)?g.delete(C):(h.forEach(x=>{x.id!==C&&g.has(x.id)&&g.delete(x.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 Hc=(e={})=>{let{initialCollapsed:t=false,content:o=[]}=e,[a,r]=mt.useState(t),[n,i]=mt.useState(o),c=mt.useCallback(()=>{r(l=>!l);},[]),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 Us=e=>jsxRuntime.jsx(material.Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var Ks=class{constructor(){Dc(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);}},jo=new Ks,gw={success:(e,t)=>jo.show("success",e,t),error:(e,t)=>jo.show("error",e,t),warning:(e,t)=>jo.show("warning",e,t),info:(e,t)=>jo.show("info",e,t),show:(e,t,o)=>jo.show(e,t,o),hide:()=>jo.hide()};var Pg={success:{icon:jsxRuntime.jsx(Sg__default.default,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsxRuntime.jsx(wg__default.default,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsxRuntime.jsx(Ig__default.default,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsxRuntime.jsx(Tg__default.default,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},nn=({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}=K(),u=n||s("messageBox.confirm"),f=i||s("messageBox.cancel"),m=()=>{r?r():a();},h=Pg[l],I=l!=="default";return jsxRuntime.jsxs(Yd__default.default,{open:e,onClose:a,maxWidth:d,fullWidth:true,PaperProps:{sx:{borderRadius:3,...I&&{borderTop:`6px solid ${h.iconColor}`}}},children:[I&&jsxRuntime.jsx(kn__default.default,{sx:{display:"flex",justifyContent:"center",pt:3,color:h.iconColor},children:h.icon}),t&&jsxRuntime.jsx(Jd__default.default,{sx:{textAlign:I?"center":"left",pt:I?1:2},children:t}),jsxRuntime.jsx(ep__default.default,{sx:{textAlign:I?"center":"left"},children:typeof o=="string"?jsxRuntime.jsx(vg__default.default,{children:o}):o}),jsxRuntime.jsxs(tp__default.default,{sx:{justifyContent:I?"center":"flex-end",pb:3,px:3},children:[c&&jsxRuntime.jsx(Us,{onClick:a,variant:"text",color:"inherit",children:f}),jsxRuntime.jsx(Us,{onClick:m,variant:"contained",sx:{bgcolor:I?h.iconColor:void 0,"&:hover":{bgcolor:I?h.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:u})]})]})},Aw=()=>{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 jo.register(i),()=>jo.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(nn,{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 Uc=({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 Qn=e=>{let{t}=K(),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)),u=Math.min(l+1,s),f=l>0,m=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},"& .MuiInputBase-input::placeholder":{fontSize:o,opacity:1}},startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Od__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,minWidth:64,"& .MuiSelect-select":{py:.25,pr:"16px !important"}},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},children:jsxRuntime.jsx(_g__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:o,fontWeight:600,minWidth:88,textAlign:"center"},children:t("table.toolbar.pageOf",{current:u,total:s})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.min(l+1,s-1)),disabled:!m,sx:{p:.35},children:jsxRuntime.jsx(Zg__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,I)=>jsxRuntime.jsx(mt__namespace.default.Fragment,{children:h},`toolbar-custom-${I}`))}),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,{onClick:h=>e.setGroupAnchorEl(h.currentTarget),children:jsxRuntime.jsx(material.Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsxRuntime.jsx($g__default.default,{})})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.summary"),children:jsxRuntime.jsx(material.IconButton,{onClick:h=>e.setSummaryAnchorEl(h.currentTarget),color:e.showSummary?"primary":"default",children:jsxRuntime.jsx(Hg__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.columns"),children:jsxRuntime.jsx(material.IconButton,{onClick:h=>e.setAnchorEl(h.currentTarget),children:jsxRuntime.jsx(Vg__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.export"),children:jsxRuntime.jsx(material.IconButton,{onClick:e.handleExport,children:jsxRuntime.jsx(Wg__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(Ug__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(Kg__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(qg__default.default,{})})})}),e.onOpenGraphReport&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.graphicReport"),children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenGraphReport,children:jsxRuntime.jsx(Gg__default.default,{})})}),e.onLayoutSave&&!e.layoutManager&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.saveLayout"),children:jsxRuntime.jsx(material.IconButton,{onClick:h=>e.onLayoutSave(h),children:jsxRuntime.jsx(_d__default.default,{})})}),e.layoutManager]})]})};var Zc=e=>{let{t}=K(),{onSelectAllClick:o,order:a,orderBy:r,numSelected:n=0,rowCount:i=0,onRequestSort:c,columns:d,visibleColumns:l,selectionMode:s,grouping:u=[],isAllExpanded:f=false,handleToggleAll:m,onColumnResize:h,columnWidths:I}=e,[p,C]=mt.useState(null),g=mt.useRef(null),y=v=>M=>{p||c(v);},x=(v,M,w)=>{v.preventDefault(),v.stopPropagation(),C(M),g.current={startX:v.clientX,startWidth:w,colId:M},document.addEventListener("mousemove",k),document.addEventListener("mouseup",L),document.body.style.cursor="col-resize";},k=v=>{if(!g.current)return;let{startX:M,startWidth:w,colId:D}=g.current,F=v.clientX-M,$=Math.max(50,w+F);h&&h(D,$);},L=()=>{C(null),g.current=null,document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",L),document.body.style.cursor="";};mt.useEffect(()=>()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",L);},[]);let P=s==="multiple"||s==="single",S=u.length>0&&!!m,B=t(f?"table.group.collapseAll":"table.group.expandAll"),T=d.filter(v=>l.includes(v.id));return jsxRuntime.jsx(Yg__default.default,{children:jsxRuntime.jsxs(Jg__default.default,{children:[P&&jsxRuntime.jsx(Xs__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(ef__default.default,{color:"primary",indeterminate:n>0&&n<i,checked:i>0&&n===i,onChange:o,disabled:s==="single"})}),S&&jsxRuntime.jsx(Xs__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(af__default.default,{title:B,children:jsxRuntime.jsx(of__default.default,{size:"small",onClick:v=>{v.stopPropagation(),m?.(!f);},sx:{p:.2},children:f?jsxRuntime.jsx(nf__default.default,{fontSize:"small"}):jsxRuntime.jsx(rf__default.default,{fontSize:"small"})})})}),T.map(v=>{let M=I?.[v.id]||v.minWidth||100;return jsxRuntime.jsxs(Xs__default.default,{align:"left",padding:v.disablePadding?"none":"normal",sortDirection:r===v.id?a:false,style:{width:M,minWidth:M,maxWidth:M},sx:w=>({position:"sticky",top:0,zIndex:4,backgroundColor:w.palette.mode==="dark"?"#000000":"#f5f5f5",color:w.palette.mode==="dark"?"#ffffff":w.palette.text.primary,fontWeight:"bold",userSelect:"none"}),children:[jsxRuntime.jsx(tf__default.default,{active:r===v.id,direction:r===v.id?a:"asc",onClick:y(v.id),sx:w=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:w.palette.mode==="dark"?"#ffffff":w.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:w.palette.mode==="dark"?"#ffffff":w.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:w.palette.mode==="dark"?"#ffffff":w.palette.text.primary}),children:jsxRuntime.jsx(kn__default.default,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1},children:v.label})}),jsxRuntime.jsx(kn__default.default,{onMouseDown:w=>x(w,v.id,typeof M=="number"?M:100),onClick:w=>w.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 Qc=e=>{let{t}=K(),{visibleRows:o,visibleColumns:a,selected:r=[],handleClick:n,columns:i,toggleGroupExpand:c,expandedGroups:d=new Set,selectionMode:l,grouping:s=[],isGroupFullyExpanded:u,handleExpandGroupRecursively:f,handleCollapseGroupRecursively:m}=e,h=g=>r.indexOf(g)!==-1,I=l==="multiple"||l==="single",p=s.length>0,C=a.length+(I?1:0)+(p?1:0);return jsxRuntime.jsxs(material.TableBody,{children:[o.map((g,y)=>{if(g.type==="group"){let x=d.has(g.id),k=g.childIds||[],L=k.filter(T=>h(T)).length,P=k.length>0&&L===k.length,S=L>0&&L<k.length;return jsxRuntime.jsxs(material.TableRow,{sx:T=>({backgroundColor:T.palette.mode==="dark"?"#111111":"#f5f5f5","& .MuiTableCell-root":{color:T.palette.text.primary,borderBottomColor:T.palette.divider},"& .MuiIconButton-root":{color:T.palette.text.primary},"& .MuiCheckbox-root":{color:T.palette.text.secondary},"& .MuiCheckbox-root.Mui-checked, & .MuiCheckbox-root.MuiCheckbox-indeterminate":{color:T.palette.primary.main}}),children:[I&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:P,indeterminate:S,onChange:T=>{if(T.stopPropagation(),!!e.onSelectionChange)if(P){let v=r.filter(M=>!k.includes(M));e.onSelectionChange(v);}else {let v=Array.from(new Set([...r,...k]));e.onSelectionChange(v);}},onClick:T=>T.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&&g.level<s.length-1&&jsxRuntime.jsx(material.Tooltip,{title:u?.(g.id)?t("table.group.collapseAll"):t("table.group.expandAll"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>{u?.(g.id)?m?.(g.id):f?.(g.id);},sx:{p:.25},children:u?.(g.id)?jsxRuntime.jsx(nf__default.default,{fontSize:"small"}):jsxRuntime.jsx(rf__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>c&&c(g.id),sx:{p:.25},children:x?jsxRuntime.jsx(uf__default.default,{}):jsxRuntime.jsx(Zg__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 x=g.data||g,k=g.id||x.id||y,L=h(k),P=`enhanced-table-checkbox-${y}`,B=(g.level!==void 0?g.level:0)*4;return jsxRuntime.jsxs(material.TableRow,{hover:true,onClick:T=>n&&n(T,x),role:"checkbox","aria-checked":L,tabIndex:-1,selected:L,sx:{cursor:"pointer"},children:[I&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{pl:B>0?B+1:void 0},children:jsxRuntime.jsx(material.Checkbox,{color:"primary",checked:L,inputProps:{"aria-labelledby":P}})}),p&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{width:44}}),i.filter(T=>a.includes(T.id)).map((T,v)=>{let w=!I&&v===0&&B>0?{pl:B+2}:{};return jsxRuntime.jsx(material.TableCell,{align:"left",sx:w,children:T.render?T.render(x[T.id],x):(function(){let F=x[T.id];if(T.numeric){if(typeof F=="number")return F.toLocaleString();if(typeof F=="string"&&F.trim()!==""&&!isNaN(Number(F)))return Number(F).toLocaleString()}return F})()},T.id)})]},k)}}),o.length===0&&jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:C,align:"center",children:t("common.noData")})})]})};var Yc=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 ed=e=>{let{t}=K();return jsxRuntime.jsx(material.Box,{sx:{p:2},children:jsxRuntime.jsx(material.Typography,{children:t("table.mobile.notImplemented")})})};var ti=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:o,setGrouping:a,columns:r,toggleGroupField:n})=>{let{t:i}=K();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(Pf__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)})]})},oi=({anchorEl:e,setAnchorEl:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=K();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))]})},ai=({anchorEl:e,setAnchorEl:t,showSummary:o,setShowSummary:a,columns:r,summaryColumns:n,toggleSummaryColumn:i})=>{let{t:c}=K();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")})})]})},ri=({contextMenu:e,handleCloseContextMenu:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=K();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(Tf__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i.label})]},i.id))]})};var cn=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),ad=({kpis:e})=>{let{t}=K(),o=[{label:t("graph.kpi.totalRecords"),value:cn(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:cn(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:cn(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:cn(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:cn(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 ni=({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 pn=({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 id=({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,m)=>{let h=n+m*(r-n*2)/Math.max(e.length-1,1),I=a-n-(f.value-c)/l*(a-n*2);return {x:h,y:I,...f}}),u=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:u}),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 sd=({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,u)=>{let f=(r-n*2)/e.length,m=Math.max(f*.5,8),h=n+u*f+(f-m)/2,I=s.barValue/i*(a-n*2),p=a-n-I;return {x:h,y:p,barHeight:I,barWidth:m,item:s}}),l=e.map((s,u)=>{let f=(r-n*2)/e.length,m=n+u*f+f/2,h=a-n-s.lineValue/c*(a-n*2);return {x:m,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 Lf=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,cd=({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:Lf(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 zf=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],ui=({data:e,variant:t="donut",colors:o=zf,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 pd=({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 md=({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(u=>{let f=u.type==="total"?0:o,m=u.type==="total"?u.value:o+u.value;return u.type!=="total"&&(o=m),{...u,start:f,end:m,delta:m-f}}),r=a.flatMap(u=>[u.start,u.end]),n=Math.min(...r,0),i=Math.max(...r,1),c=680,d=30,l=i-n||1,s=u=>t-d-(u-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((u,f)=>{let m=(c-d*2)/a.length,h=Math.max(m*.55,8),I=d+f*m+(m-h)/2,p=s(Math.max(u.start,u.end)),C=s(Math.min(u.start,u.end)),g=u.type==="total"?"#42A5F5":u.delta>=0?"#66BB6A":"#EF5350";return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:I,y:p,width:h,height:Math.max(C-p,4),rx:6,fill:g}),jsxRuntime.jsx("text",{x:I+h/2,y:p-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:u.end.toFixed(1)})]},u.name)})]}),jsxRuntime.jsx(material.Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${a.length}, minmax(0, 1fr))`,gap:1},children:a.map(u=>jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:u.name,children:u.name},u.name))})]})};var gn=({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}`},dI=(e,t=360)=>{let o=gn(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};var hd=({apiKey:e,query:t,embedUrl:o,zoom:a=14,mapType:r="roadmap",height:n=320})=>{let i=o||(e&&t?gn({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 fi=({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 vd=({keyword:e,location:t,embedUrl:o,height:a=320})=>{let r=o||fi({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 Cd=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:o,interaction:a})=>{let{t:r}=K();return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsxRuntime.jsx(ni,{title:r("graph.chart.billable.title"),subtitle:r("graph.chart.billable.subtitle"),children:jsxRuntime.jsx(pn,{data:e,orientation:"horizontal",activeName:a?.filters?.primaryDimension,onItemClick:n=>a?.onPrimaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(ni,{title:r("graph.chart.efficiency.title"),subtitle:r("graph.chart.efficiency.subtitle"),children:jsxRuntime.jsx(pn,{data:t,orientation:"vertical",valueSuffix:"%",activeName:a?.filters?.secondaryDimension,onItemClick:n=>a?.onSecondaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(ni,{title:r("graph.chart.status.title"),subtitle:r("graph.chart.status.subtitle"),children:jsxRuntime.jsx(ui,{data:o,variant:"donut",activeName:a?.filters?.status,onItemClick:n=>a?.onStatusClick?.(n.name)})})]})};var Za=e=>jsxRuntime.jsx(material.TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var ll=e=>jsxRuntime.jsx(material.TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var th=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],oh=["zh","en","de","fr","ja","ko"],wd=({open:e,onClose:t,value:o,onSaveAll:a,modelOptions:r=th,promptLangOptions:n=oh,analysisTemplateOptions:i=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:l})=>{let[s,u]=mt.useState(o),[f,m]=mt.useState(d||""),[h,I]=mt.useState(l||""),[p,C]=mt.useState(false);mt.useEffect(()=>{e&&(u(o),m(d||""),I(l||""));},[e,o,d,l]);let g=(x,k)=>{u(L=>({...L,[x]:k}));},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(eh__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(Za,{size:"small",value:s.baseUrl,onChange:x=>g("baseUrl",x.target.value),fullWidth:true,label:"Base URL"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Za,{size:"small",type:"password",value:s.apiKey,onChange:x=>g("apiKey",x.target.value),fullWidth:true,label:"API Key"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Za,{size:"small",value:s.model,onChange:x=>g("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(Za,{size:"small",value:s.promptLang,onChange:x=>g("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(Za,{size:"small",value:f,onChange:x=>m(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(ll,{multiline:true,minRows:8,value:s.analysisPrompt,onChange:x=>g("analysisPrompt",x.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxRuntime.jsxs(Za,{size:"small",value:h,onChange:x=>I(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(ll,{multiline:true,minRows:8,value:s.responsePrompt,onChange:x=>g("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 vi=({open:e,onClose:t,model:o,tableContent:a,extraCharts:r,interaction:n,aiAssistant:i})=>{let{t:c}=K(),[d,l]=mt.useState(i?.defaultPrompt||""),[s,u]=mt.useState(false),[f,m]=mt.useState(false),h=n?.enabled!==false&&!!n,I=i?.enabled!==false,p=n?.filters||{},C=!!(p.primaryDimension||p.secondaryDimension||p.status),g=i?.placeholder||"Ask AI to analyze data, create charts, or find insights...";mt.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 k=d.trim();if(!(!k||!i?.onSubmit))try{u(!0),await i.onSubmit(k,{filters:p,model:o});}finally{u(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:[I&&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(lh__default.default,{sx:{fontSize:18,color:"text.secondary"}})}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:d,onChange:k=>l(k.target.value),onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),x());},placeholder:g,sx:{fontSize:"0.9rem"}}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:x,disabled:s||!d.trim(),children:jsxRuntime.jsx(dh__default.default,{sx:{fontSize:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>m(true),children:jsxRuntime.jsx(ch__default.default,{sx:{fontSize:18}})})]}),jsxRuntime.jsx(material.IconButton,{onClick:t,children:jsxRuntime.jsx(eh__default.default,{})})]})]})}),jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,overflow:"auto",minHeight:0},children:[jsxRuntime.jsx(ad,{kpis:o.kpis}),jsxRuntime.jsx(Cd,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:h?{filters:p,onPrimaryDimensionClick:k=>n?.onPrimaryDimensionClick(k),onSecondaryDimensionClick:k=>n?.onSecondaryDimensionClick(k),onStatusClick:k=>n?.onStatusClick(k)}:void 0}),r,a]}),jsxRuntime.jsx(wd,{open:f,onClose:()=>m(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 ya={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"]},uh=5,Id=e=>e.toLowerCase().replace(/[\s_-]/g,""),ba=(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=>[Id(i),i]));for(let i of o){let c=n.get(Id(i));if(c)return c}return r[0]||a},Kt=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},St=(e,t)=>e==null||e===""?t:String(e),mh=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=St(i[t],r);n.set(c,(n.get(c)||0)+Kt(i[o]));}),Array.from(n.entries()).map(([i,c])=>({name:i,value:c})).sort((i,c)=>c.value-i.value).slice(0,a)},gh=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=St(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=Kt(c[o]),l.billable+=Kt(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)},fh=(e,t,o)=>{let a=e.length;if(a===0)return [];let r=new Map;return e.forEach(n=>{let i=St(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}))},Td=(e,t,o)=>{let a=new Map;return e.forEach(r=>{let n=St(r[t],"N/A");a.set(n,(a.get(n)||0)+Kt(r[o]));}),Array.from(a.entries()).sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>({name:r,value:n}))},hh=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=St(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=Kt(c[o]),l.billable+=Kt(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)},yh=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=St(i[t],r),d=St(i[o],r),l=`${c}__${d}`;n.set(l,(n.get(l)||0)+Kt(i[a]));}),Array.from(n.entries()).map(([i,c])=>{let[d,l]=i.split("__");return {x:d,y:l,value:c}})},bh=(e,t,o)=>{let a=Td(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"}]},xh=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=St(c[t],n),l=`${St(c[o],n)} / ${St(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)},Ar=({rows:e,config:t})=>{let{t:o}=K(),a=o("graph.unassigned"),r=mt.useMemo(()=>{let s=t?.fieldMapping;return {primaryDimension:ba(e,s?.primaryDimension,ya.primaryDimension,"Category"),secondaryDimension:ba(e,s?.secondaryDimension,ya.secondaryDimension,"Owner"),status:ba(e,s?.status,ya.status,"Status"),date:ba(e,s?.date,ya.date,"Date"),description:ba(e,s?.description,ya.description,"Description"),reportHours:ba(e,s?.reportHours,ya.reportHours,"ReportHours"),billableHours:ba(e,s?.billableHours,ya.billableHours,"BillableHours"),amount:ba(e,s?.amount,ya.amount,"Amount")}},[e,t?.fieldMapping]),n=mt.useMemo(()=>e.map((s,u)=>{let f=Kt(s[r.reportHours]),m=Kt(s[r.billableHours]),h=Kt(s[r.amount]),I=f>0?m/f*100:0;return {id:`graph-row-${u}`,Date:St(s[r.date],""),Primary:St(s[r.primaryDimension],a),Secondary:St(s[r.secondaryDimension],a),Description:St(s[r.description],""),ReportHours:f,BillableHours:m,Amount:h,Efficiency:I,Status:St(s[r.status],a)}}),[e,r,a]),i=mt.useMemo(()=>{let s=n.length,u=n.reduce((C,g)=>C+Kt(g.ReportHours),0),f=n.reduce((C,g)=>C+Kt(g.BillableHours),0),m=n.reduce((C,g)=>C+Kt(g.Amount),0),h=u>0?f/u*100:0,I=t?.statusFlagValues||["flag","flagged","warning","risk"],p=n.filter(C=>I.includes(St(C.Status,"").toLowerCase())).length;return {totalRecords:s,totalReportHours:u,totalBillableHours:f,efficiency:h,totalAmount:m,flaggedCount:p}},[n,t?.statusFlagValues]),c=t?.topN||uh,d=mt.useMemo(()=>({billableByPrimary:mh(n,"Primary","BillableHours",c,a),efficiencyBySecondary:gh(n,"Secondary","ReportHours","BillableHours",c,a),statusDistribution:fh(n,"Status",a),lineByDate:Td(n,"Date","BillableHours"),comboByPrimary:hh(n,"Primary","ReportHours","BillableHours",c,a),heatmapPrimarySecondary:yh(n,"Primary","Secondary","BillableHours",a),waterfallBillable:bh(n,"Date","BillableHours"),fishboneStatusCauses:xh(n,"Status","Primary","Secondary",3,a)}),[n,c,a]),l=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:l}};var Br=e=>String(e??"").trim(),ki=(e={})=>{let[t,o]=mt.useState(e),a=mt.useCallback((d,l)=>{o(s=>{let u=l?.trim();if(!u){let f={...s};return delete f[d],f}if(s[d]===u){let f={...s};return delete f[d],f}return {...s,[d]:u}});},[]),r=mt.useCallback(d=>{o(l=>{if(!l[d])return l;let s={...l};return delete s[d],s});},[]),n=mt.useCallback(()=>{o({});},[]),i=mt.useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),c=mt.useCallback((d,l)=>d.filter(s=>!(t.primaryDimension&&Br(s[l.primaryDimension])!==Br(t.primaryDimension)||t.secondaryDimension&&Br(s[l.secondaryDimension])!==Br(t.secondaryDimension)||t.status&&Br(s[l.status])!==Br(t.status))),[t]);return {filters:t,setFilter:a,clearFilter:r,clearAll:n,hasActiveFilters:i,applyRows:c}};var wi=({variants:e,currentVariantId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=K(),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)"},[u,f]=mt.useState(false),[m,h]=mt.useState(""),[I,p]=mt.useState(false),[C,g]=mt.useState(false),y=e.find(L=>L.id===t),x=()=>{h(y?.name||i("variant.newVariant")),p(y?.isDefault||false),g(y?.isPublic||false),f(true);},k=()=>{a({name:m,isDefault:I,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:L=>L.name+(L.isDefault?` (${i("variant.defaultSuffix")})`:""),value:y||null,onChange:(L,P)=>{P&&o(P);},renderInput:L=>jsxRuntime.jsx(material.TextField,{...L,variant:"outlined",size:"small",InputProps:{...L.InputProps,sx:{fontSize:l,color:d?"#E3F2FD":"#0D47A1"}},placeholder:i("variant.selectVariant")}),renderOption:(L,P)=>jsxRuntime.jsx("li",{...L,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{flex:1,fontSize:l},children:P.name}),P.isDefault&&jsxRuntime.jsx(Ah__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(_d__default.default,{fontSize:"small"})})}),jsxRuntime.jsxs(material.Dialog,{open:u,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:m,onChange:L=>h(L.target.value)}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:I,onChange:L=>p(L.target.checked)}),label:i("variant.setDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:C,onChange:L=>g(L.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:k,variant:"contained",children:i("common.save")})]})]})]})};var Ed=({appId:e,tableKey:t="default",currentFilters:o,currentLayoutId:a,layoutRefs:r,onLoad:n,variantService:i,serviceUrl:c,onError:d,onSuccess:l,currentVariantId:s,onVariantChange:u})=>{let{t:f}=K(),[m,h]=mt.useState([]),[I,p]=mt.useState(""),C=`orbcafe.variants.${e}.${t}`,g=s!==void 0?s:I,y=M=>{s===void 0&&p(M),u&&u(M);},x=mt.useCallback(()=>{try{let M=localStorage.getItem(C);if(!M)return [];let w=JSON.parse(M);return Array.isArray(w)?w:[]}catch{return []}},[C]),k=mt.useCallback(M=>{try{localStorage.setItem(C,JSON.stringify(M));}catch{}},[C]),L=mt.useCallback(M=>{h(M);let w=M.find(D=>D.isDefault);w&&!g&&(y(w.id),n(w));},[g,n,y]),P=mt.useCallback(async()=>{if(!e)return [];try{let M=[];if(i)M=await i.getVariants(e,t);else if(c){let w=await fetch(`${c}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!w.ok)throw new Error(f("variant.toast.fetchFailed"));M=await w.json();}else M=x();return L(M),M}catch(M){console.error("Error fetching variants",M);let w=x();return L(w),d&&d(f("variant.toast.fetchFailed")),w}},[e,t,i,c,x,L,d,f]);return mt.useEffect(()=>{P();},[e,t]),jsxRuntime.jsx(wi,{variants:m,currentVariantId:g,onLoad:M=>{y(M.id),n(M);},onSave:async M=>{let w=Date.now().toString(),D;try{let F=m.find(Y=>Y.name===M.name);w=F?F.id:Date.now().toString();let $=[];if(F&&(Array.isArray(F.filters)?$=[...F.filters]:F.filters&&($=[{scope:"default",filters:F.filters}])),M.scope==="Search"||M.scope==="Both"){let Y=(Array.isArray(o),o);if(Y)if(Array.isArray(Y)&&Y.length>0&&Y[0].scope)Y.forEach(te=>{let oe=$.findIndex(ae=>ae.scope===te.scope);oe>=0?$[oe]=te:$.push(te);});else {let te={scope:t,filters:Y},oe=$.findIndex(ae=>ae.scope===t);oe>=0?$[oe]=te:$.push(te);}}let V=F?.layout||{},q=[];if(F&&Array.isArray(F.layoutRefs)&&(q=[...F.layoutRefs]),M.scope==="Layout"||M.scope==="Both")if(r&&r.length>0)r.forEach(Y=>{let te=q.findIndex(oe=>oe.tableKey===Y.tableKey);te>=0?q[te]=Y:q.push(Y);});else {let Y={tableKey:t,layoutId:a||null},te=q.findIndex(oe=>oe.tableKey===t);te>=0?q[te]=Y:q.push(Y);}if(D={appId:e,tableKey:t,...M,id:w,createdAt:new Date().toISOString(),filters:$,layout:V,layoutRefs:q},i)await i.saveVariant(D,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)})).ok)throw new Error(f("variant.toast.saveFailed"))}else {let te=m.some(oe=>oe.id===w)?m.map(oe=>oe.id===w?D:oe):[...m,D];h(te),k(te);}l&&l(f("variant.toast.saveSuccess")),(i||c)&&await P(),y(w),n(D);}catch(F){console.error("Error saving variant",F);let V=m.some(q=>q.id===w)?m.map(q=>q.id===w?D:q):[...m,D];h(V),k(V),y(w),n(D),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 w=m.filter(D=>D.id!==M);h(w),k(w);}g===M&&y(""),(i||c)&&P(),l&&l(f("variant.toast.deleteSuccess"));}catch(w){console.error("Error deleting variant",w);let D=m.filter(F=>F.id!==M);h(D),k(D),g===M&&y(""),d&&d(f("variant.toast.deleteFailed"));}},onSetDefault:async M=>{try{let w=m.find(F=>F.id===M);if(!w)return;let D={appId:e,tableKey:t,...w,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(D)})).ok)throw new Error(f("variant.toast.defaultFailed"))}else {let F=m.map($=>({...$,isDefault:$.id===M}));h(F),k(F);}(i||c)&&await P(),l&&l(f("variant.toast.defaultSuccess"));}catch(w){console.error("Error setting default variant",w);let D=m.map(F=>({...F,isDefault:F.id===M}));h(D),k(D),d&&d(f("variant.toast.defaultFailed"));}}})};Xa__default.default.extend(jh__default.default);Xa__default.default.extend(Xh__default.default);var Qh=[null,null],ml="0.85rem",Yh={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},Jh=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%"}})),Nd=({label:e,value:t=Qh,onChange:o})=>{let{t:a,locale:r}=K(),n=Yh[r]||"en",i=e||a("dateRange.label"),[c,d]=mt.useState(null),[l,s]=mt.useState(t),[u,f]=mt.useState("start"),[m,h]=mt.useState(null),[I,p]=mt.useState((t[0]||Xa__default.default()).locale(n)),C=mt__namespace.default.useRef(t);mt.useEffect(()=>{let[w,D]=t,[F,$]=C.current,V=te=>te&&typeof te.isSame=="function",q=!(w===null&&F===null||V(w)&&V(F)&&w.isSame(F,"day")),Y=!(D===null&&$===null||V(D)&&V($)&&D.isSame($,"day"));(q||Y)&&(s(t),t[0]&&V(t[0])&&p(t[0].locale(n))),C.current=t;},[t,n]);let g=w=>{d(w.currentTarget);},y=()=>{d(null),f("start"),h(null);},x=!!c,k=w=>{if(!w)return;let D=[...l];if(u==="start")D=[w,null],f("end");else {let F=D[0];F&&w.isBefore(F)?(D=[w,null],f("end")):(D=[F,w],f("start"));}s(D);},L=w=>{let D=Xa__default.default().locale(n),F=[null,null];switch(w){case "today":F=[D,D];break;case "week":F=[D.startOf("week"),D.endOf("week")];break;case "month":F=[D.startOf("month"),D.endOf("month")];break}s(F),f("start"),p(D);},P=()=>{s([null,null]),f("start"),p(Xa__default.default().locale(n));},S=()=>{o&&o(l),y();},B=()=>{s(t),f("start"),y();},T=mt.useCallback(w=>{let{day:D,...F}=w,[$,V]=l,q=$?D.isSame($,"day"):false,Y=V?D.isSame(V,"day"):false,te=$&&V?D.isBetween($,V,"day","()"):false,oe=false;return u==="end"&&$&&!V&&m&&D.isAfter($,"day")&&D.isBefore(m.add(1,"day"),"day")&&(oe=true),jsxRuntime.jsx(Jh,{...F,day:D,disableMargin:true,isStart:q,isEnd:Y,isInRange:te||oe,onMouseEnter:()=>h(D)})},[l,u,m]),v=w=>w?w.locale(n).format("YYYY-MM-DD"):"",M=w=>w?w.locale(n).format("ll"):"";return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.TextField,{label:i,value:l[0]?`${v(l[0])} - ${v(l[1])}`:"",onClick:g,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:ml}},InputProps:{readOnly:true,sx:{fontSize:ml,"& .MuiOutlinedInput-input":{fontSize:ml},paddingRight:"4px"},endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",sx:{ml:0},children:[(l[0]||l[1])&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:w=>{w.stopPropagation(),P();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsxRuntime.jsx(_h__default.default,{sx:{fontSize:"1rem"}})}),jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end",onClick:g,sx:{padding:"2px"},children:jsxRuntime.jsx(qh__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:u==="start"?"primary.main":"divider",borderRadius:1,bgcolor:u==="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]?M(l[0]):a("dateRange.select")})]}),jsxRuntime.jsx(Zh__default.default,{color:"action",fontSize:"small"}),jsxRuntime.jsxs(material.Box,{sx:{p:1,border:1,borderColor:u==="end"?"primary.main":"divider",borderRadius:1,bgcolor:u==="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]?M(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:()=>L("today"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:a("dateRange.thisWeek"),onClick:()=>L("week"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:a("dateRange.thisMonth"),onClick:()=>L("month"),clickable:true,size:"small",variant:"outlined"})]})}),jsxRuntime.jsx(LocalizationProvider.LocalizationProvider,{dateAdapter:AdapterDayjs.AdapterDayjs,adapterLocale:n,children:jsxRuntime.jsx(DateCalendar.DateCalendar,{value:null,referenceDate:I,onMonthChange:p,onYearChange:p,onChange:k,slots:{day:T},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:B,color:"inherit",children:a("common.cancel")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"contained",onClick:S,children:a("common.done")})]})]})]})};var Ri={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},dy={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"},py=["equals","contains","notContains","wildcard"],Wd=["=","!=",">","<",">=","<=","between"],Qe="0.85rem",uy=({field:e,value:t,onChange:o})=>{let{t:a}=K(),[r,n]=mt.useState(null),[i,c]=mt.useState(null),[d,l]=mt.useState(""),[s,u]=mt.useState(""),[f,m]=mt.useState(false),[h,I]=mt.useState(""),[p,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,x=v=>{let M=dy[v];return M?a(M):v},k=v=>{n(v.currentTarget);},L=v=>{o({...t,operator:v,value:y}),n(null);},P={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:Qe}},InputProps:{sx:{fontSize:Qe}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Qe,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},S=e.type||"text";if(S==="date"){let M=(w=>{if(!w)return [null,null];if(Array.isArray(w)&&w.length===2){let D=w[0]?Xa__default.default.isDayjs(w[0])?w[0]:Xa__default.default(w[0]):null,F=w[1]?Xa__default.default.isDayjs(w[1])?w[1]:Xa__default.default(w[1]):null;return [D,F]}return Xa__default.default.isDayjs(w)||typeof w=="string"?[Xa__default.default.isDayjs(w)?w:Xa__default.default(w),null]:[null,null]})(y);return jsxRuntime.jsx(Nd,{label:e.label,value:M,onChange:w=>o({value:w,operator:"between"})})}if(S==="number"&&g==="between"){let v=()=>{o({value:[d,s],operator:"between"}),c(null);},M=Array.isArray(y)?`${y[0]||""} - ${y[1]||""}`:"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...P,label:e.label,value:M,placeholder:a("smartFilter.minMaxPlaceholder"),InputProps:{...P.InputProps,startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:x("between"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:k,sx:{width:24,height:24,fontSize:Qe},children:Ri.between})})}),readOnly:true},onClick:w=>c(w.currentTarget)}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Qe,minHeight:"auto",py:.5}}},children:Wd.map(w=>jsxRuntime.jsxs(material.MenuItem,{selected:w===g,onClick:()=>L(w),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Ri[w]}),jsxRuntime.jsx(material.ListItemText,{primary:x(w),primaryTypographyProps:{fontSize:Qe}})]},w))}),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:w=>l(w.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Qe}},InputProps:{sx:{fontSize:Qe}}}),jsxRuntime.jsx(cy__default.default,{color:"action"}),jsxRuntime.jsx(material.TextField,{size:"small",label:a("smartFilter.max"),type:"number",value:s,onChange:w=>u(w.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Qe}},InputProps:{sx:{fontSize:Qe}}}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:v,children:a("common.ok")})]})})]})}if(S==="select")return jsxRuntime.jsxs(material.TextField,{...P,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(S==="multi-select"){let v=Array.isArray(y)?y:[],M=e.options?.filter(w=>w.label.toLowerCase().includes(p.toLowerCase()))||[];return jsxRuntime.jsxs(material.TextField,{...P,select:true,label:e.label,value:v,onChange:w=>o({...t,value:w.target.value,operator:"anyOf"}),SelectProps:{...P.SelectProps,multiple:true,onClose:()=>{I(""),C("");},renderValue:w=>{if(!Array.isArray(w)||w.length===0)return jsxRuntime.jsx("em",{children:a("common.none")});let D=$=>e.options?.find(V=>V.value===$)?.label||$,F=w.map(D);return F.length>2?`${F.slice(0,2).join(", ")} +${F.length-2}`:F.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(Od__default.default,{fontSize:"small"})}),sx:{fontSize:Qe}},value:h,onChange:w=>I(w.target.value),onKeyDown:w=>{w.key!=="Escape"&&w.stopPropagation();},onClick:w=>w.stopPropagation()})}),M.length>0?M.map(w=>jsxRuntime.jsxs(material.MenuItem,{value:w.value,children:[jsxRuntime.jsx(material.Checkbox,{checked:v.indexOf(w.value)>-1,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:w.label,primaryTypographyProps:{fontSize:Qe}})]},w.value)):jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:a("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:Qe}})})]})}let B=S==="number"?Wd:py,T=f||y!==void 0&&y!==""&&y!==null||!!r;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...P,label:e.label,sx:{minWidth:"120px"},value:y||"",type:S==="number"?"number":"text",onChange:v=>o({...t,value:v.target.value,operator:g}),onFocus:()=>m(true),onBlur:()=>m(false),InputProps:{...P.InputProps,startAdornment:T?jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:x(g),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:k,onMouseDown:v=>v.preventDefault(),sx:{width:24,height:24,fontSize:Qe,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Ri[g]})})}):null,endAdornment:e.hasSearchIcon?jsxRuntime.jsx(material.InputAdornment,{position:"end",children:jsxRuntime.jsx(Od__default.default,{color:"action"})}):void 0}}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Qe,minHeight:"auto",py:.5}}},children:B.map(v=>jsxRuntime.jsxs(material.MenuItem,{selected:v===g,onClick:()=>L(v),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Ri[v]}),jsxRuntime.jsx(material.ListItemText,{primary:x(v),primaryTypographyProps:{fontSize:Qe}})]},v))})]})},Ya=({fields:e,filters:t,onFilterChange:o,variants:a=[],currentVariantId:r,onVariantLoad:n,onVariantSave:i,onVariantDelete:c,onVariantSetDefault:d,onSearch:l,loading:s=false,appId:u,tableKey:f,currentLayout:m,currentLayoutId:h,layoutRefs:I,variantService:p,serviceUrl:C})=>{let{t:g}=K(),[y,x]=mt.useState(true),[k,L]=mt.useState(null),[P,S]=mt.useState(e.filter(M=>!M.hidden).map(M=>M.id)),B=(M,w)=>{o({...t,[M]:w});},T=M=>{P.includes(M)?S(P.filter(w=>w!==M)):S([...P,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:[u?jsxRuntime.jsx(Ed,{appId:u,tableKey:f,currentFilters:{values:t,visibleFields:P},currentLayout:m,currentLayoutId:h,layoutRefs:I,onLoad:M=>{if(!M.filters)return;let w=null;if(Array.isArray(M.filters)){let D=f||"default",F=M.filters.find($=>$.scope===D);w=F?F.filters:null;}else w=M.filters;w&&(w.values||w.visibleFields?(w.visibleFields&&Array.isArray(w.visibleFields)&&S(w.visibleFields),w.values&&o(w.values)):o(w)),n&&n(M);},variantService:p,serviceUrl:C,currentVariantId:r}):jsxRuntime.jsx(wi,{variants:a,currentVariantId:r,onLoad:n,onSave:M=>{i&&i({...M,filters:{values:t,visibleFields:P}});},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=>L(M.currentTarget),size:"small",color:"primary",startIcon:jsxRuntime.jsx(iy__default.default,{fontSize:"small"}),sx:{textTransform:"none",fontSize:Qe,whiteSpace:"nowrap",minWidth:"fit-content"},children:g("smartFilter.adaptFilters")})}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:l,disabled:s,sx:{minWidth:"52px",fontWeight:"bold",fontSize:Qe},children:g(s?"common.loading":"smartFilter.go")}),jsxRuntime.jsxs(material.Menu,{anchorEl:k,open:!!k,onClose:()=>L(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:Qe,minHeight:32}}}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:g("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:Qe}})}),jsxRuntime.jsx(material.Divider,{}),e.map(M=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>T(M.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:P.includes(M.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:M.label,primaryTypographyProps:{fontSize:Qe}})]},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=>P.includes(M.id)).map(M=>jsxRuntime.jsx(material.Grid,{size:1,children:jsxRuntime.jsx(uy,{field:M,value:t[M.id]||{value:"",operator:M.type==="number"?"=":"equals"},onChange:w=>B(M.id,w)})},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:()=>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(sy__default.default,{sx:{fontSize:16},color:"action"}):jsxRuntime.jsx(uf__default.default,{sx:{fontSize:16},color:"action"})})})]})};var Zd=({layouts:e,currentLayoutId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=K(),[c,d]=mt.useState(null),[l,s]=mt.useState(false),[u,f]=mt.useState(""),[m,h]=mt.useState(""),[I,p]=mt.useState({isDefault:false,isPublic:false}),C=e.find(P=>P.id===t),g=P=>{d(P.currentTarget);},y=()=>{d(null);},x=P=>{o(P),y();},k=()=>{f(""),h(""),p({isDefault:false,isPublic:false}),s(true),y();},L=()=>{u.trim()&&(a({name:u,description:m,...I}),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:k,color:"primary",size:"small",children:jsxRuntime.jsx(_d__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:i("layout.layoutOptions"),children:jsxRuntime.jsx(material.IconButton,{onClick:g,color:C?"primary":"default",children:jsxRuntime.jsx(wy__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:k,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(_d__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((P,S)=>jsxRuntime.jsx(material.MenuItem,{onClick:()=>x(P),selected:P.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:P.id===t?"bold":"normal",noWrap:true,children:P.name})}),P.description&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,children:P.description})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center"},onClick:B=>B.stopPropagation(),children:[jsxRuntime.jsx(material.Tooltip,{title:P.isDefault?i("layout.removeDefault"):i("layout.setAsDefault"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:B=>{B.stopPropagation(),n(P.id);},children:P.isDefault?jsxRuntime.jsx(Ah__default.default,{fontSize:"small",color:"warning"}):jsxRuntime.jsx(Sy__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.Tooltip,{title:i("common.delete"),children:jsxRuntime.jsx(material.IconButton,{size:"small",color:"error",onClick:B=>{B.stopPropagation(),r(P.id);},children:jsxRuntime.jsx(qg__default.default,{fontSize:"small"})})})]})]})},P.id||S))]}),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:u,onChange:P=>f(P.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:i("layout.layoutNameHelper")}),e.some(P=>P.name===u)&&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:m,onChange:P=>h(P.target.value),fullWidth:true,size:"small"}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:I.isDefault,onChange:P=>p({...I,isDefault:P.target.checked})}),label:i("layout.useAsDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:I.isPublic,onChange:P=>p({...I,isPublic:P.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:L,variant:"contained",disabled:!u,children:i("common.save")})]})]})]})};var Bi=({appId:e,tableKey:t="default",currentLayoutData:o,onLayoutLoad:a,targetLayoutId:r,activeLayoutId:n,serviceUrl:i,onError:c,onSuccess:d})=>{let{t:l}=K(),[s,u]=mt.useState([]),[f,m]=mt.useState(""),h=`orbcafe.layouts.${e}.${t}`,I=S=>({id:S.layoutId,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt??new Date().toISOString(),layoutData:S.layout??{}}),p=S=>({appId:e,tableKey:t,layoutId:S.id,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt,layout:S.layoutData}),C=mt.useCallback(()=>{try{let S=localStorage.getItem(h);if(!S)return [];let B=JSON.parse(S);return Array.isArray(B)?B:[]}catch{return []}},[h]),g=mt.useCallback(S=>{try{localStorage.setItem(h,JSON.stringify(S));}catch{}},[h]);mt.useEffect(()=>{n!==void 0&&m(n);},[n]),mt.useEffect(()=>{if(r&&s.length>0){let S=s.find(B=>B.id===r);S&&(m(S.id),a(S));}},[r,s,a]);let y=mt.useCallback(async()=>{if(e){if(!i){let S=C();u(S);let B=S.find(T=>T.isDefault);B&&!f&&!r&&(m(B.id),a(B));return}try{let S=await fetch(`${i}/api/layouts?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!S.ok)throw new Error("LAYOUT_FETCH_FAILED");let T=(await S.json()).map(I);u(T);let v=T.find(M=>M.isDefault);v&&!f&&!r&&(m(v.id),a(v));}catch(S){console.error("Error fetching layouts",S);let B=C();u(B);let T=B.find(v=>v.isDefault);T&&!f&&!r&&(m(T.id),a(T)),c&&c(l("layout.toast.loadFallback"));}}},[e,t,i,c,f,a,r,C,l]);return mt.useEffect(()=>{y();},[e,t]),jsxRuntime.jsx(Zd,{layouts:s,currentLayoutId:f,onLoad:S=>{m(S.id),a(S);},onSave:async S=>{let B=s.find(M=>M.name===S.name),T=B?B.id:Date.now().toString(),v={id:T,...S,createdAt:new Date().toISOString(),layoutData:o,isDefault:S.isDefault??false,isPublic:S.isPublic??false};if(!i){let w=s.some(D=>D.id===T)?s.map(D=>D.id===T?v:D):[...s,v];u(w),g(w),m(T),a(v),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(v))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(l("layout.toast.saveSuccess")),await y(),m(T),a(v);}catch(M){console.error("Error saving layout",M);let D=s.some(F=>F.id===T)?s.map(F=>F.id===T?v:F):[...s,v];u(D),g(D),m(T),a(v),d&&d(l("layout.toast.saveLocalSuccess")),c&&c(l("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async S=>{if(!i){let B=s.filter(T=>T.id!==S);u(B),g(B),f===S&&m(""),d&&d(l("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts/${encodeURIComponent(S)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f===S&&m(""),d&&d(l("layout.toast.deleteSuccess")),await y();}catch(B){console.error("Error deleting layout",B);let T=s.filter(v=>v.id!==S);u(T),g(T),f===S&&m(""),d&&d(l("layout.toast.deleteLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async S=>{if(!i){let B=s.map(T=>({...T,isDefault:T.id===S}));u(B),g(B),d&&d(l("layout.toast.defaultLocalSuccess"));return}try{let B=s.find(v=>v.id===S);if(!B)return;if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p({...B,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(l("layout.toast.defaultSuccess")),await y();}catch(B){console.error("Error setting default",B);let T=s.map(v=>({...v,isDefault:v.id===S}));u(T),g(T),d&&d(l("layout.toast.defaultLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDefaultLocal"));}}})};var Xd=(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},Fi=(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 Qd(e,t,o){return t[o]<e[o]?-1:t[o]>e[o]?1:0}function Ty(e,t){return e==="desc"?(o,a)=>Qd(o,a,t):(o,a)=>-Qd(o,a,t)}function Py(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 Li=e=>{let t=mt.useCallback(N=>{let G=String(N?.label??N?.id??"").length*9+64,ue=typeof N?.minWidth=="number"?N.minWidth:0;return Math.max(100,ue,G)},[]),o=mt.useCallback(()=>(e.columns||[]).filter(N=>!!N?.numeric).map(N=>N.id),[e.columns]),[a,r]=mt.useState(""),[n,i]=mt.useState(e.order||"asc"),[c,d]=mt.useState(e.orderBy||""),[l,s]=mt.useState(e.page||0),[u,f]=mt.useState(e.rowsPerPage||20),[m,h]=mt.useState(e.selected||[]),[I,p]=mt.useState(e.columns?e.columns.map(N=>N.id):[]),[C,g]=mt.useState(e.showSummary||false),[y,x]=mt.useState(()=>o()),[k,L]=mt.useState([]),[P,S]=mt.useState(new Set),[B,T]=mt.useState(()=>{let N={};return (e.columns||[]).forEach(O=>{N[O.id]=t(O);}),N}),[v,M]=mt.useState(null),[w,D]=mt.useState(null),[F,$]=mt.useState(null),[V,q]=mt.useState(null),[Y,te]=mt.useState(false),[oe,ae]=mt.useState(""),[Ft,lt]=mt.useState("");mt.useEffect(()=>{e.layout&&ke(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&&s(e.page);},[e.page]),mt.useEffect(()=>{e.rowsPerPage!==void 0&&f(e.rowsPerPage);},[e.rowsPerPage]),mt.useEffect(()=>{let N=o();x(O=>O.filter(ue=>N.includes(ue)));},[o]),mt.useEffect(()=>{T(N=>{let O={...N};return (e.columns||[]).forEach(G=>{O[G.id]===void 0&&(O[G.id]=t(G));}),O});},[e.columns,t]);let Ke=mt.useMemo(()=>{let N=e.rows||[];return a&&(N=N.filter(O=>Object.keys(O).some(G=>String(O[G]).toLowerCase().includes(a.toLowerCase())))),N},[e.rows,a]),ge=mt.useMemo(()=>e.onSortChange||!c?Ke:Py(Ke,Ty(n,c)),[Ke,n,c,e.onSortChange]),De=mt.useCallback(N=>{if(k.length===0)return N.map(we=>({type:"row",data:we,id:we[e.rowKey||"id"]}));let O=[...N].sort((we,ie)=>{for(let Pe of k){if(we[Pe]<ie[Pe])return -1;if(we[Pe]>ie[Pe])return 1}return 0}),G=(we,ie=0)=>{if(ie>=k.length)return we;let Pe=k[ie],ye={},Re=[];return we.forEach(Se=>{let he=Se[Pe],Ce=`${Pe}:${he}`;ye[Ce]||(ye[Ce]={key:Ce,field:Pe,value:he,children:[],count:0,level:ie},Re.push(ye[Ce])),ye[Ce].children.push(Se),ye[Ce].count++;}),Re.forEach(Se=>{Se.children&&(Se.children=G(Se.children,ie+1));}),Re},ue=G(O),fe=(we,ie="")=>{let Pe=[];return we.forEach(ye=>{if(ye.children){let Re=ie?`${ie}>${ye.key}`:ye.key,Se=P.has(Re);Pe.push({type:"group",id:Re,field:ye.field,value:ye.value,level:ye.level,count:ye.count,isExpanded:Se,childIds:(function he(Ce){let je=[];return Ce.children.forEach(Rt=>{Rt.children?je=je.concat(he(Rt)):je.push(Rt[e.rowKey||"id"]);}),je})(ye)}),Se&&(Pe=Pe.concat(fe(ye.children,Re)));}else Pe.push({type:"row",data:ye,id:ye[e.rowKey||"id"],level:k.length});}),Pe};return fe(ue)},[k,P,e.rowKey]),Fe=mt.useCallback(N=>{if(k.length===0)return [];let O=[...N].sort((fe,we)=>{for(let ie of k){if(fe[ie]<we[ie])return -1;if(fe[ie]>we[ie])return 1}return 0}),G=[],ue=(fe,we,ie)=>{if(we>=k.length)return;let Pe=k[we],ye=new Map;fe.forEach(Re=>{let Se=Re[Pe],he=ye.get(Se);he?he.push(Re):ye.set(Se,[Re]);}),ye.forEach((Re,Se)=>{let he=`${Pe}:${Se}`,Ce=ie?`${ie}>${he}`:he;G.push(Ce),ue(Re,we+1,Ce);});};return ue(O,0,""),G},[k]),Je=mt.useMemo(()=>De(ge),[ge,De]),Tt=mt.useMemo(()=>Fe(ge),[ge,Fe]),qe=mt.useMemo(()=>{let N=(e.rows||[]).length;return typeof e.count=="number"&&e.count>N},[e.count,e.rows]),rt=mt.useMemo(()=>qe?Je:u>0?Je.slice(l*u,l*u+u):Je,[Je,l,u,qe]),Ho=mt.useMemo(()=>qe&&typeof e.count=="number"?e.count:Je.length,[Je.length,qe,e.count]),Io=N=>{S(O=>{let G=new Set(O);return G.has(N)?G.delete(N):G.add(N),G});},To=N=>{let O=Tt.filter(G=>G===N||G.startsWith(`${N}>`));S(G=>{let ue=new Set(G);return O.forEach(fe=>ue.add(fe)),ue});},Po=N=>{S(O=>{let G=new Set(O);return Array.from(G).forEach(ue=>{(ue===N||ue.startsWith(`${N}>`))&&G.delete(ue);}),G});},Ro=N=>{if(!N){S(new Set);return}S(new Set(Tt));},gt=N=>{let O=Tt.filter(G=>G.startsWith(`${N}>`));return O.length===0?P.has(N):P.has(N)&&O.every(G=>P.has(G))},H=N=>{let O=c===N&&n==="asc",G=c===N&&n==="desc";if(e.onSortChange){O?e.onSortChange(N,"desc"):G?e.onSortChange("","asc"):e.onSortChange(N,"asc");return}O?(i("desc"),d(N)):G?(i("asc"),d("")):(i("asc"),d(N));},de=(N,O)=>{T(G=>({...G,[N]:O}));},ne=N=>{if(N.target.checked){let O=Ke.map(G=>G[e.rowKey||"id"]);h(O),e.onSelectionChange&&e.onSelectionChange(O);return}h([]),e.onSelectionChange&&e.onSelectionChange([]);},pe=(N,O)=>{let G=O[e.rowKey||"id"],ue=m.indexOf(G),fe=[];ue===-1?fe=fe.concat(m,G):ue===0?fe=fe.concat(m.slice(1)):ue===m.length-1?fe=fe.concat(m.slice(0,-1)):ue>0&&(fe=fe.concat(m.slice(0,ue),m.slice(ue+1))),h(fe),e.onSelectionChange&&e.onSelectionChange(fe);},$e=N=>{s(N),e.onPageChange&&e.onPageChange(N);},Me=N=>{f(N),s(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(N);},Jt=N=>{let O=I.indexOf(N),G=[...I];O===-1?G.push(N):G.splice(O,1),p(G);},lo=N=>{let O=k.indexOf(N),G=[...k];O===-1?G.push(N):G.splice(O,1),L(G);},co=N=>{o().includes(N)&&x(G=>G.includes(N)?G.filter(ue=>ue!==N):[...G,N]);},po=N=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:I,order:n,orderBy:c,grouping:k,columnWidths:B,showSummary:C,summaryColumns:y});},uo=N=>{let{layout:O,layoutId:G}=Fi(N,e.tableKey||"default");G?(lt(G),ae(G)):(lt(""),ae("")),O&&(O.visibleColumns&&p(O.visibleColumns),O.order&&i(O.order),O.orderBy&&d(O.orderBy),O.grouping&&L(O.grouping),O.columnWidths&&T(O.columnWidths),O.showSummary!==void 0&&g(!!O.showSummary),Array.isArray(O.summaryColumns)&&x(O.summaryColumns));},ke=N=>{let O=N?.layoutData||N?.layout||N||{};O.visibleColumns&&p(O.visibleColumns),O.order&&i(O.order),O.orderBy!==void 0&&d(O.orderBy),O.grouping&&L(O.grouping),O.columnWidths&&T(O.columnWidths),O.showSummary!==void 0&&g(!!O.showSummary),Array.isArray(O.summaryColumns)&&x(O.summaryColumns),S(new Set),s(0),N?.id&&ae(N.id),lt("");};mt.useEffect(()=>{e.layout&&uo({layout:e.layout});},[e.layout]);let ce=N=>{N.preventDefault(),q(V===null?{mouseX:N.clientX+2,mouseY:N.clientY-6}:null);},ft=()=>{q(null);},Te=mt.useMemo(()=>{if(!C)return {};let N={};e.columns.forEach(G=>{if(G.numeric&&y.includes(G.id)){let ue=Ke.reduce((fe,we)=>{let ie=parseFloat(we[G.id]);return fe+(isNaN(ie)?0:ie)},0);N[G.id]=ue.toFixed(2);}else N[G.id]="";});let O=e.columns.find(G=>I.includes(G.id));return O&&!O.numeric&&(N[O.id]="Total"),N},[Ke,e.columns,C,y,I]),Pt=()=>{if(!e.columns||!Ke)return;let N=e.columns.map(we=>we.label).join(","),O=Ke.map(we=>e.columns.map(ie=>{let Pe=we[ie.id];return `"${(Pe==null?"":String(Pe)).replace(/"/g,'""')}"`}).join(",")).join(`
184
184
  `),G=`data:text/csv;charset=utf-8,${N}
185
- ${O}`,ue=encodeURI(G),fe=document.createElement("a");fe.setAttribute("href",ue),fe.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(fe),fe.click(),document.body.removeChild(fe);},po=()=>{ee(true);},Ma=()=>{ee(false);};return {isMobile:false,columns:e.columns,order:n,orderBy:c,filterText:o,setFilterText:r,visibleColumns:I,setVisibleColumns:p,showSummary:C,setShowSummary:g,summaryColumns:y,grouping:k,setGrouping:L,expandedGroups:P,setExpandedGroups:S,groupAnchorEl:w,setGroupAnchorEl:D,summaryAnchorEl:F,setSummaryAnchorEl:$,columnWidths:B,setColumnWidths:T,anchorEl:v,setAnchorEl:M,contextMenu:V,setContextMenu:_,sensors:void 0,sortedAndFilteredRows:ge,visibleRows:rt,summaryRow:Te,page:l,setPage:Oe,rowsPerPage:u,setRowsPerPage:Me,totalDisplayCount:Wo,selected:m,setSelected:h,isAllExpanded:It.length>0&&It.every(N=>P.has(N)),handleColumnResize:de,handleRequestSort:H,handleSelectAllClick:ne,handleClick:pe,toggleSummaryColumn:so,handleDragEnd:()=>{},handleExport:Tt,handleContextMenu:ce,handleCloseContextMenu:gt,toggleColumnVisibility:Qt,toggleGroupExpand:So,toggleGroupField:io,handleToggleAll:To,handleExpandGroupRecursively:wo,handleCollapseGroupRecursively:Io,isGroupFullyExpanded:mt,handleLayoutLoad:ke,handleVariantLoad:co,handleLayoutSave:lo,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:I,order:n,orderBy:c,grouping:k,columnWidths:B,showSummary:C,summaryColumns:y},currentLayoutId:te,layoutIdToLoad:Bt,onPageChange:Oe,onRowsPerPageChange:Me,graphReportOpen:Y,handleOpenGraphReport:po,handleCloseGraphReport:Ma}};var XP=e=>jsxRuntime.jsx(Dy__default.default,{...e}),QP=e=>jsxRuntime.jsx(js__default.default,{...e}),YP=e=>jsxRuntime.jsx(ap__default.default,{...e}),JP=e=>jsxRuntime.jsx(Qg__default.default,{...e}),eR=e=>jsxRuntime.jsx(Yg__default.default,{...e}),Ca=e=>{let{t}=q(),a="0.85rem",{title:o,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:l,fitContainer:s=false,fullWidth:u=false,maxHeight:f,loading:m=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:I,filterConfig:p,rowKey:C,tableKey:g="default",graphReport:y,quickCreate:x,quickEdit:k,quickDelete:L,serviceUrl:P}=e,S=o||t("table.title.default"),{isMobile:B,columns:T,order:v,orderBy:M,filterText:w,setFilterText:D,visibleColumns:F,showSummary:$,setShowSummary:V,summaryColumns:_,grouping:Y,setGrouping:ee,expandedGroups:te,groupAnchorEl:ae,setGroupAnchorEl:Bt,summaryAnchorEl:lt,setSummaryAnchorEl:Ke,columnWidths:ge,anchorEl:De,setAnchorEl:Fe,contextMenu:Je,sensors:It,sortedAndFilteredRows:qe,summaryRow:rt,visibleRows:Wo,isAllExpanded:So,page:wo,setPage:Io,rowsPerPage:To,setRowsPerPage:mt,totalDisplayCount:H,setSelected:de,handleColumnResize:ne,handleRequestSort:pe,handleSelectAllClick:Oe,handleClick:Me,toggleSummaryColumn:Qt,handleDragEnd:io,handleExport:so,handleContextMenu:lo,handleCloseContextMenu:co,toggleColumnVisibility:ke,toggleGroupExpand:ce,toggleGroupField:gt,handleToggleAll:Te,handleExpandGroupRecursively:Tt,handleCollapseGroupRecursively:po,isGroupFullyExpanded:Ma,handleLayoutLoad:N,handleVariantLoad:O,handleLayoutSave:G,effectiveAppId:ue,currentLayoutData:fe,currentLayoutId:we,layoutIdToLoad:se,graphReportOpen:Pe,handleOpenGraphReport:ye,handleCloseGraphReport:Re}=Ei(e),Se=y?.enabled??false,he=Se&&(y?.interaction?.enabled??true),Ce=Ci(),je=!!x?.enabled,Pt=!!k?.enabled,uo=!!L?.enabled,Ot=x?.fields,Yt=x?.excludeFields||[],Po=x?.initialValues||{},[Aa,la]=ut__namespace.default.useState(false),[Ft,$o]=ut__namespace.default.useState(false),[Ba,Et]=ut__namespace.default.useState({}),[Wt,Rt]=ut__namespace.default.useState(false),[Ie,Jt]=ut__namespace.default.useState(false),[Fa,Ea]=ut__namespace.default.useState({}),[La,Ho]=ut__namespace.default.useState(false),[Ro,Do]=ut__namespace.default.useState(false),za=m||Ft||Ie||Ro,Na=ut__namespace.default.useMemo(()=>{let z=[...T];if(Array.isArray(Ot)&&Ot.length>0){let K=new Set(Ot);z=z.filter(R=>K.has(R.id));}if(Yt.length>0){let K=new Set(Yt);z=z.filter(R=>!K.has(R.id));}return z.filter(K=>!!K?.id)},[T,Yt,Ot]),ca=C||"id",Lt=ut__namespace.default.useMemo(()=>{let z=new Set(i);return qe.filter(K=>z.has(K?.[ca]))},[i,qe,ca]),zt=Lt.length===1?Lt[0]:null,Mo=k?.fields,Go=k?.excludeFields||[],Uo=k?.editableFields||[],Va=k?.nonEditableFields||[],Oa=k?.primaryKeys?.length?k.primaryKeys:[ca],da=ut__namespace.default.useMemo(()=>{let z=[...T];if(Array.isArray(Mo)&&Mo.length>0){let K=new Set(Mo);z=z.filter(R=>K.has(R.id));}if(Go.length>0){let K=new Set(Go);z=z.filter(R=>!K.has(R.id));}return z.filter(K=>!!K?.id)},[T,Go,Mo]),pa=ut__namespace.default.useMemo(()=>new Set(Oa),[Oa]),Ko=ut__namespace.default.useMemo(()=>new Set(Uo),[Uo]),eo=ut__namespace.default.useMemo(()=>new Set(Va),[Va]),Ao=ut__namespace.default.useCallback(z=>Ko.size>0?Ko.has(z):!(eo.has(z)||pa.has(z)),[Ko,eo,pa]);ut__namespace.default.useEffect(()=>{!Pe&&Ce.hasActiveFilters&&Ce.clearAll();},[Pe,Ce.hasActiveFilters,Ce.clearAll]);let mr=()=>{let z={};Na.forEach(K=>{z[K.id]=Po[K.id]??"";}),Et(z),la(true);},Wa=()=>{Ft||la(false);},gr=(z,K)=>{Et(R=>({...R,[z]:K}));},fr=async()=>{if(!x?.onSubmit){la(false);return}try{$o(!0),await x.onSubmit(Ba),la(!1);}finally{$o(false);}},hr=()=>{if(!zt)return;let z={};da.forEach(R=>{z[R.id]=zt[R.id]??"";});let K=k?.getInitialValues?{...z,...k.getInitialValues(zt)}:z;Ea(K),Rt(true);},$t=()=>{Ie||Rt(false);},yr=(z,K)=>{Ea(R=>({...R,[z]:K}));},qo=async()=>{if(zt){if(!k?.onSubmit){Rt(false);return}try{Jt(!0),await k.onSubmit(Fa,zt),Rt(!1);}finally{Jt(false);}}},Bo=()=>{Lt.length!==0&&Ho(true);},br=()=>{Ro||Ho(false);},$a=async()=>{if(Lt.length===0){Ho(false);return}if(!L?.onConfirm){Ho(false),de([]),c?.([]);return}try{Do(!0),await L.onConfirm(Lt),Ho(!1),de([]),c?.([]);}finally{Do(false);}},ua=qe,{fieldMapping:b}=Dr({rows:ua,config:{...y,title:y?.title||`${S} ${t("graph.reportTitle")}`}}),A=ut__namespace.default.useMemo(()=>he?Ce.applyRows(ua,b):ua,[he,Ce.applyRows,ua,b]),{model:E}=Dr({rows:A,config:{...y,title:y?.title||`${S} ${t("graph.reportTitle")}`,fieldMapping:b}}),W=E.table.columns.map(z=>({id:z.id,label:z.label,align:z.align||"left",minWidth:120,numeric:z.align==="right"})),j=ue?jsxRuntime.jsx(Ai,{appId:ue,tableKey:g,currentLayoutData:fe,onLayoutLoad:N,targetLayoutId:se,activeLayoutId:we,serviceUrl:P??p?.serviceUrl}):null,le=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ei,{groupAnchorEl:ae,setGroupAnchorEl:Bt,grouping:Y,setGrouping:ee,columns:T,toggleGroupField:gt}),jsxRuntime.jsx(ti,{anchorEl:De,setAnchorEl:Fe,columns:T,visibleColumns:F,toggleColumnVisibility:ke}),jsxRuntime.jsx(oi,{anchorEl:lt,setAnchorEl:Ke,showSummary:$,setShowSummary:V,columns:T,summaryColumns:_,toggleSummaryColumn:Qt}),jsxRuntime.jsx(ai,{contextMenu:Je,handleCloseContextMenu:co,columns:T,visibleColumns:F,toggleColumnVisibility:ke})]});return B?jsxRuntime.jsxs(vn__default.default,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[p&&jsxRuntime.jsx(Xa,{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:g,currentLayout:[{tableKey:g,layoutData:fe}],variantService:p.variantService,serviceUrl:P??p.serviceUrl}),jsxRuntime.jsx(Jc,{title:S,loading:m,showSummary:$,setShowSummary:V,setAnchorEl:Fe,setSummaryAnchorEl:Ke,filterText:w,setFilterText:D,sortedAndFilteredRows:qe,selected:i,columns:T,visibleColumns:F,summaryRow:rt,handleClick:Me,selectionMode:n}),le]}):jsxRuntime.jsxs(vn__default.default,{sx:{width:u?"100%":"auto",mb:s?0:2,...s?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[p&&jsxRuntime.jsx(vn__default.default,{sx:{mb:2},children:jsxRuntime.jsx(Xa,{fields:p.fields,filters:p.filters,onFilterChange:p.onFilterChange,onSearch:p.onSearch,variants:p.variants||[],currentVariantId:p.currentVariantId,onVariantLoad:z=>{O(z),p.onVariantLoad&&p.onVariantLoad(z);},onVariantSave:p.onVariantSave,onVariantDelete:p.onVariantDelete,onVariantSetDefault:p.onVariantSetDefault,loading:m,appId:p.appId,tableKey:g,currentLayout:[{tableKey:g,layoutData:fe}],currentLayoutId:we,layoutRefs:[{tableKey:g,layoutId:we}],variantService:p.variantService,serviceUrl:P??p.serviceUrl})}),jsxRuntime.jsxs(Py__default.default,{sx:{width:u?"100%":"auto",mb:s?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":za?{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(Xn,{filterText:w,setFilterText:D,onRowsPerPageChange:mt,rowsPerPage:To,rowsPerPageOptions:h,page:wo,count:H,onPageChange:Io,actions:d,extraTools:l,grouping:Y,setGroupAnchorEl:Bt,showSummary:$,setShowSummary:V,setAnchorEl:Fe,setSummaryAnchorEl:Ke,handleExport:so,showCreateButton:je,onOpenCreateDialog:mr,showEditButton:Pt,onOpenEditDialog:hr,editDisabled:Lt.length!==1,showDeleteButton:uo,onOpenDeleteConfirm:Bo,deleteDisabled:Lt.length===0,onLayoutSave:I||p?.variantService&&p?.appId?G:void 0,loading:m,layoutManager:j,onOpenGraphReport:Se?ye:void 0}),jsxRuntime.jsx(ap__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:It,collisionDetection:core.closestCenter,onDragEnd:io,modifiers:[modifiers.restrictToHorizontalAxis],children:jsxRuntime.jsxs(Ry__default.default,{sx:{minWidth:u?750:"auto",width:u?"100%":"auto",tableLayout:Object.keys(ge).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,"& .MuiTableCell-root":{fontSize:a}},"aria-labelledby":"tableTitle",size:"small",stickyHeader:true,children:[jsxRuntime.jsx(_c,{columns:T,visibleColumns:F,order:v,orderBy:M,onRequestSort:pe,onContextMenu:lo,selectionMode:n,grouping:Y,isAllExpanded:So,handleToggleAll:Te,rowCount:qe.length,numSelected:i.length,onSelectAllClick:Oe,columnWidths:ge,onColumnResize:ne}),jsxRuntime.jsx(Xc,{visibleRows:Wo,columns:T,visibleColumns:F,selectionMode:n,selected:i,orderBy:M,loading:m,expandedGroups:te,toggleGroupExpand:ce,handleExpandGroupRecursively:Tt,handleCollapseGroupRecursively:po,isGroupFullyExpanded:Ma,handleClick:Me,onSelectionChange:c,grouping:Y,rowKeyProp:C,page:wo,rowsPerPage:To}),$&&jsxRuntime.jsx(Qc,{showSummary:$,columns:T,visibleColumns:F,summaryRow:rt,selectionMode:n?.toString(),grouping:Y,orderBy:M,zIndex:3})]})})})]}),je&&jsxRuntime.jsxs(Qd__default.default,{open:Aa,onClose:Wa,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:z=>`1px solid ${z.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(Yd__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:x?.title||t("quickCreate.createWithTitle",{title:S})}),jsxRuntime.jsx(Jd__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(vn__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Na.map(z=>{let K=z.type==="number"||z.numeric?"number":z.type==="date"?"date":"text",R=z.label||z.id;return jsxRuntime.jsx(tp__default.default,{label:R,value:Ba[z.id]??"",onChange:Z=>gr(z.id,Z.target.value),type:K,size:"small",fullWidth:true,InputLabelProps:{shrink:K==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${z.id}`)}),x?.description&&jsxRuntime.jsx(op__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:x.description})]})}),jsxRuntime.jsxs(ep__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(Li__default.default,{onClick:Wa,sx:{fontSize:"0.85rem"},disabled:Ft,children:x?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(Li__default.default,{onClick:fr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Ft,children:x?.submitLabel||t("common.save")})]})]}),Pt&&jsxRuntime.jsxs(Qd__default.default,{open:Wt,onClose:$t,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:z=>`1px solid ${z.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(Yd__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:k?.title||t("quickEdit.editWithTitle",{title:S})}),jsxRuntime.jsx(Jd__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(vn__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[da.map(z=>{let K=z.type==="number"||z.numeric?"number":z.type==="date"?"date":"text",R=z.label||z.id,Z=Ao(z.id);return jsxRuntime.jsx(tp__default.default,{label:R,value:Fa[z.id]??"",onChange:ie=>yr(z.id,ie.target.value),type:K,size:"small",fullWidth:true,disabled:!Z,InputLabelProps:{shrink:K==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${z.id}`)}),k?.description&&jsxRuntime.jsx(op__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:k.description})]})}),jsxRuntime.jsxs(ep__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(Li__default.default,{onClick:$t,sx:{fontSize:"0.85rem"},disabled:Ie,children:k?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(Li__default.default,{onClick:qo,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Ie||!zt,children:k?.submitLabel||t("common.save")})]})]}),uo&&jsxRuntime.jsx(an,{open:La,type:"warning",title:L?.title||t("quickDelete.confirmTitle"),message:L?.message||(Lt.length>1?t("quickDelete.confirmMessageMultiple",{count:Lt.length}):t("quickDelete.confirmMessageSingle")),confirmText:L?.confirmText||t("common.delete"),cancelText:L?.cancelText||t("common.cancel"),onClose:br,onConfirm:$a}),le,Se&&jsxRuntime.jsx(xi,{open:Pe,onClose:Re,model:E,aiAssistant:y?.aiAssistant,interaction:he?{enabled:true,filters:Ce.filters,fieldMapping:b,onPrimaryDimensionClick:z=>Ce.setFilter("primaryDimension",z),onSecondaryDimensionClick:z=>Ce.setFilter("secondaryDimension",z),onStatusClick:z=>Ce.setFilter("status",z),onClearFilter:Ce.clearFilter,onClearAll:Ce.clearAll}:void 0,tableContent:jsxRuntime.jsx(Ca,{appId:ue||"graph-report-internal",title:t("graph.dataBody"),columns:W,rows:E.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},tR=Ca;var lR=({id:e,title:t,hideHeader:a=true,filterConfig:o,tableProps:r,children:n,spacing:i=1,mode:c="separated"})=>{let d=o?{...o,appId:o.appId||e}:void 0,l={...r,appId:r.appId||e};return jsxRuntime.jsxs(Gc,{title:t,hideHeader:a,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(Xa,{...d})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsx(Ca,{...l,fitContainer:true,filterConfig:c==="integrated"?d:void 0})})]}),n]})};var gR=({metadata:e,fetchData:t,initialRowsPerPage:a=20,rowsPerPageOptions:o=[20,50,100,-1],tableKey:r="default",mode:n="integrated",serviceUrl:i,variantService:c})=>{let{t:d}=q(),[l,s]=ut.useState(false),[u,f]=ut.useState([]),[m,h]=ut.useState({}),[I,p]=ut.useState(e.variants||[]),[C,g]=ut.useState(e.layout||null),[y,x]=ut.useState(""),[k,L]=ut.useState(0),[P,S]=ut.useState(0),[B,T]=ut.useState(a),[v,M]=ut.useState([]),[w,D]=ut.useState("asc"),[F,$]=ut.useState("");ut.useEffect(()=>{let ge={};e.filters.forEach(De=>{De.defaultValue!==void 0&&(ge[De.id]=De.defaultValue);}),h(ge);},[e.filters]);let V=ut.useCallback(async(ge,De,Fe,Je,It)=>{s(true);try{let qe={...ge,page:De+1,limit:Fe,sort:It,order:Je},rt;t?rt=await t(qe):typeof e.api=="function"?rt=await e.api(qe):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,qe),rt={rows:[],total:0}):(console.warn("No API configured for report"),rt={rows:[],total:0}),rt&&(f(rt.rows||[]),L(rt.total||0));}catch(qe){console.error("Failed to fetch report data",qe);}finally{s(false);}},[e.api,t]);ut.useEffect(()=>{V(m,P,B,w,F);},[V,P,B,w,F]);let _=()=>{S(0),V(m,0,B,w,F);},Y=ge=>{S(0),T(ge);},ee=(ge,De)=>{D(De),$(ge);},te=ge=>{h(ge);},ae=ge=>{x(ge?.id||"");let De=jd(ge,r);if(De){let Je=De.values??De;h(Je),V(Je,0,B,w,F),S(0);}let{layout:Fe}=Bi(ge,r);Fe&&g(Fe);},Bt=ge=>{let De={...ge,id:Date.now().toString(),createdAt:new Date().toISOString()};p(Fe=>[...Fe,De]);},lt=ge=>{g(ge);};return {pageProps:{id:e.id,title:e.title,mode:n,filterConfig:{appId:e.id,tableKey:r,fields:e.filters,filters:m,onFilterChange:te,onSearch:_,onVariantLoad:ae,onVariantSave:Bt,onVariantDelete:ge=>p(De=>De.filter(Fe=>Fe.id!==ge)),onVariantSetDefault:ge=>{p(De=>De.map(Fe=>({...Fe,isDefault:Fe.id===ge})));},variants:I,currentVariantId:y,variantService:c,serviceUrl:i},tableProps:{appId:e.id,tableKey:r,columns:e.columns,rows:u,loading:l,rowKey:"id",count:k,page:P,rowsPerPage:B,rowsPerPageOptions:o,onPageChange:S,onRowsPerPageChange:Y,selectionMode:"multiple",selected:v,onSelectionChange:M,onLayoutSave:lt,layout:C,title:e.title,showSummary:true,order:w,orderBy:F,serviceUrl:i,onSortChange:ee,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${d("graph.reportTitle")}`}}},filters:m,rows:u,loading:l,refresh:_}};var Oy=e=>[...e].sort((t,a)=>a.value-t.value),yR=({bars:e=[],lines:t=[],combos:a=[],heatmap:o=[],pies:r=[],waterfalls:n=[]})=>{let i=ut.useMemo(()=>Oy(e),[e]),c=ut.useMemo(()=>[...t],[t]),d=ut.useMemo(()=>[...a],[a]),l=ut.useMemo(()=>[...o],[o]),s=ut.useMemo(()=>{let f=r.reduce((m,h)=>m+h.value,0);return r.map(m=>({...m,percent:f>0?m.value/f*100:m.percent}))},[r]),u=ut.useMemo(()=>[...n],[n]);return {bars:i,lines:c,combos:d,heatmap:l,pies:s,waterfalls:u}};var kR=({apiKey:e,query:t,zoom:a=14,mapType:o="roadmap"})=>ut.useMemo(()=>!e||!t?"":un({apiKey:e,query:t,zoom:a,mapType:o}),[e,t,a,o]),SR=({keyword:e,location:t})=>ut.useMemo(()=>gi({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var Cn=({code:e,language:t="text",copyable:a=true,showLineNumbers:o=false,wrapLongLines:r=false,maxHeight:n})=>{let[i,c]=ut.useState(false),d=ut.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}),a&&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(qy__default.default,{fontSize:"inherit"}):jsxRuntime.jsx(Ky__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:o?d.map((s,u)=>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:u+1}),jsxRuntime.jsx(material.Box,{component:"span",sx:{whiteSpace:r?"pre-wrap":"pre",wordBreak:r?"break-word":"normal"},children:s})]},`${u}-${s}`)):jsxRuntime.jsx(material.Box,{component:"code",sx:{display:"block",whiteSpace:r?"pre-wrap":"pre",wordBreak:r?"break-word":"normal"},children:e})})]})};var Qy=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},Yy=async e=>new Function("m","return import(m)")(e),kn=({expression:e,inline:t=false,allowKatex:a=false})=>{let o=ut.useMemo(()=>Qy(e),[e]),[r,n]=ut.useState("");return ut.useEffect(()=>{let i=true;return (async()=>{if(!a||!o){n("");return}try{let d=await Yy("katex"),s=(d?.default||d)?.renderToString?.(o,{displayMode:!t,throwOnError:!1,strict:"warn"});i&&typeof s=="string"&&n(s);}catch{i&&n("");}})(),()=>{i=false;}},[a,o,t]),o?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:o}):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:o})}):null};var nb=async e=>new Function("m","return import(m)")(e),Sl=({code:e,title:t="Mermaid Diagram",height:a=320,enabled:o=true})=>{let[r,n]=ut.useState(""),[i,c]=ut.useState(""),[d,l]=ut.useState(false),s=ut.useMemo(()=>e.trim(),[e]);return ut.useEffect(()=>{let u=true;return (async()=>{if(!o||!s){n(""),c("");return}l(true),c(""),n("");try{let m=await nb("mermaid"),h=m?.default||m;if(!h||typeof h.render!="function")throw new Error("Mermaid runtime is not available");h.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let I=await h.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,s),p=typeof I=="string"?I:I?.svg;u&&typeof p=="string"&&n(p);}catch(m){if(u){let h=m instanceof Error?m.message:"Failed to render Mermaid diagram";c(h);}}finally{u&&l(false);}})(),()=>{u=false;}},[o,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:a,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(Cn,{code:s,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var wl=e=>e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(a=>a.trim()),mb=e=>/^:?-{3,}:?$/.test(e.trim()),gb=e=>{let t=e.trim(),a=t.startsWith(":"),o=t.endsWith(":");return a&&o?"center":o?"right":"left"},Vi=e=>{let t=e.split(`
187
- `).map(i=>i.trim()).filter(Boolean);if(t.length<2)return null;let a=wl(t[0]),o=wl(t[1]);if(a.length===0||o.length!==a.length||!o.every(mb))return null;let r=o.map(gb),n=t.slice(2).filter(i=>i.includes("|")).map(i=>{let c=wl(i);return c.length<a.length?[...c,...Array.from({length:a.length-c.length},()=>"")]:c.slice(0,a.length)});return {headers:a,aligns:r,rows:n}},Il=({markdown:e,table:t,maxHeight:a=360})=>{let o=ut.useMemo(()=>t||(e?Vi(e):null),[t,e]);return !o||o.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:a},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsx(material.TableRow,{children:o.headers.map((r,n)=>jsxRuntime.jsx(material.TableCell,{align:o.aligns[n],sx:{fontWeight:700,bgcolor:"background.paper"},children:r},`${r}-${n}`))})}),jsxRuntime.jsx(material.TableBody,{children:o.rows.map((r,n)=>jsxRuntime.jsx(material.TableRow,{hover:true,children:r.map((i,c)=>jsxRuntime.jsx(material.TableCell,{align:o.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 Wi=({content:e,title:t="Thinking",defaultExpanded:a=false,isStreaming:o=false})=>{let[r,n]=ut.useState(a);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(Cb__default.default,{fontSize:"inherit"})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[t,o?" ...":""]})]}),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 Pl=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,$i=e=>e.trim().startsWith("```"),mp=e=>/^#{1,6}\s+/.test(e.trim()),Rl=e=>/^[-*+]\s+/.test(e.trim()),Dl=e=>/^\d+\.\s+/.test(e.trim()),gp=e=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(e.trim()),Ml=e=>e.trim().startsWith(">"),fp=(e,t)=>{if(t+1>=e.length)return false;let a=e[t],o=e[t+1];return !a.includes("|")||!o.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(o.trim())},hp=e=>e.trim().startsWith("<think>")||e.trim()===":::think",In=(e,t,a)=>{let o=[],r=0,n=0;Pl.lastIndex=0;let i=Pl.exec(e);for(;i;){i.index>r&&o.push(e.slice(r,i.index));let c=i[0],d=`${a}-${n}`;if(c.startsWith("**")&&c.endsWith("**"))o.push(jsxRuntime.jsx("strong",{children:c.slice(2,-2)},d));else if(c.startsWith("*")&&c.endsWith("*"))o.push(jsxRuntime.jsx("em",{children:c.slice(1,-1)},d));else if(c.startsWith("`")&&c.endsWith("`"))o.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?o.push(jsxRuntime.jsx(material.Link,{href:l[2],target:"_blank",rel:"noreferrer",underline:"hover",children:l[1]},d)):o.push(c);}else c.startsWith("$")&&c.endsWith("$")&&t.enableMath?o.push(jsxRuntime.jsx(kn,{expression:c,inline:true,allowKatex:true},d)):o.push(c);r=i.index+c.length,n+=1,i=Pl.exec(e);}return r<e.length&&o.push(e.slice(r)),o.length>0?o:[e]},Tn=({markdown:e,content:t,className:a,enableMath:o=true,enableMermaid:r=true,enableThinkBlock:n=true,codeCopyable:i=true,codeLineNumbers:c=false})=>{let d=e??t??"",l=ut.useMemo(()=>{let s=[],u=d.replace(/\r\n/g,`
185
+ ${O}`,ue=encodeURI(G),fe=document.createElement("a");fe.setAttribute("href",ue),fe.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(fe),fe.click(),document.body.removeChild(fe);},mo=()=>{te(true);},Ba=()=>{te(false);};return {isMobile:false,columns:e.columns,order:n,orderBy:c,filterText:a,setFilterText:r,visibleColumns:I,setVisibleColumns:p,showSummary:C,setShowSummary:g,summaryColumns:y,grouping:k,setGrouping:L,expandedGroups:P,setExpandedGroups:S,groupAnchorEl:w,setGroupAnchorEl:D,summaryAnchorEl:F,setSummaryAnchorEl:$,columnWidths:B,setColumnWidths:T,anchorEl:v,setAnchorEl:M,contextMenu:V,setContextMenu:q,sensors:void 0,sortedAndFilteredRows:ge,visibleRows:rt,summaryRow:Te,page:l,setPage:$e,rowsPerPage:u,setRowsPerPage:Me,totalDisplayCount:Ho,selected:m,setSelected:h,isAllExpanded:Tt.length>0&&Tt.every(N=>P.has(N)),handleColumnResize:de,handleRequestSort:H,handleSelectAllClick:ne,handleClick:pe,toggleSummaryColumn:co,handleDragEnd:()=>{},handleExport:Pt,handleContextMenu:ce,handleCloseContextMenu:ft,toggleColumnVisibility:Jt,toggleGroupExpand:Io,toggleGroupField:lo,handleToggleAll:Ro,handleExpandGroupRecursively:To,handleCollapseGroupRecursively:Po,isGroupFullyExpanded:gt,handleLayoutLoad:ke,handleVariantLoad:uo,handleLayoutSave:po,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:I,order:n,orderBy:c,grouping:k,columnWidths:B,showSummary:C,summaryColumns:y},currentLayoutId:oe,layoutIdToLoad:Ft,onPageChange:$e,onRowsPerPageChange:Me,graphReportOpen:Y,handleOpenGraphReport:mo,handleCloseGraphReport:Ba}};var QP=e=>jsxRuntime.jsx(My__default.default,{...e}),YP=e=>jsxRuntime.jsx(Xs__default.default,{...e}),JP=e=>jsxRuntime.jsx(rp__default.default,{...e}),eR=e=>jsxRuntime.jsx(Yg__default.default,{...e}),tR=e=>jsxRuntime.jsx(Jg__default.default,{...e}),Sa=e=>{let{t}=K(),o="0.85rem",{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:l,fitContainer:s=false,fullWidth:u=false,maxHeight:f,loading:m=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:I,filterConfig:p,rowKey:C,tableKey:g="default",graphReport:y,quickCreate:x,quickEdit:k,quickDelete:L,serviceUrl:P}=e,S=a||t("table.title.default"),{isMobile:B,columns:T,order:v,orderBy:M,filterText:w,setFilterText:D,visibleColumns:F,showSummary:$,setShowSummary:V,summaryColumns:q,grouping:Y,setGrouping:te,expandedGroups:oe,groupAnchorEl:ae,setGroupAnchorEl:Ft,summaryAnchorEl:lt,setSummaryAnchorEl:Ke,columnWidths:ge,anchorEl:De,setAnchorEl:Fe,contextMenu:Je,sensors:Tt,sortedAndFilteredRows:qe,summaryRow:rt,visibleRows:Ho,isAllExpanded:Io,page:To,setPage:Po,rowsPerPage:Ro,setRowsPerPage:gt,totalDisplayCount:H,setSelected:de,handleColumnResize:ne,handleRequestSort:pe,handleSelectAllClick:$e,handleClick:Me,toggleSummaryColumn:Jt,handleDragEnd:lo,handleExport:co,handleContextMenu:po,handleCloseContextMenu:uo,toggleColumnVisibility:ke,toggleGroupExpand:ce,toggleGroupField:ft,handleToggleAll:Te,handleExpandGroupRecursively:Pt,handleCollapseGroupRecursively:mo,isGroupFullyExpanded:Ba,handleLayoutLoad:N,handleVariantLoad:O,handleLayoutSave:G,effectiveAppId:ue,currentLayoutData:fe,currentLayoutId:we,layoutIdToLoad:ie,graphReportOpen:Pe,handleOpenGraphReport:ye,handleCloseGraphReport:Re}=Li(e),Se=y?.enabled??false,he=Se&&(y?.interaction?.enabled??true),Ce=ki(),je=!!x?.enabled,Rt=!!k?.enabled,go=!!L?.enabled,$t=x?.fields,eo=x?.excludeFields||[],Do=x?.initialValues||{},[Fa,da]=mt__namespace.default.useState(false),[Et,Go]=mt__namespace.default.useState(false),[Ea,Lt]=mt__namespace.default.useState({}),[Ht,Dt]=mt__namespace.default.useState(false),[Ie,to]=mt__namespace.default.useState(false),[La,za]=mt__namespace.default.useState({}),[Na,Uo]=mt__namespace.default.useState(false),[Mo,Ao]=mt__namespace.default.useState(false),Va=m||Et||Ie||Mo,Oa=mt__namespace.default.useMemo(()=>{let z=[...T];if(Array.isArray($t)&&$t.length>0){let U=new Set($t);z=z.filter(R=>U.has(R.id));}if(eo.length>0){let U=new Set(eo);z=z.filter(R=>!U.has(R.id));}return z.filter(U=>!!U?.id)},[T,eo,$t]),pa=C||"id",zt=mt__namespace.default.useMemo(()=>{let z=new Set(i);return qe.filter(U=>z.has(U?.[pa]))},[i,qe,pa]),Nt=zt.length===1?zt[0]:null,Bo=k?.fields,Ko=k?.excludeFields||[],qo=k?.editableFields||[],Wa=k?.nonEditableFields||[],$a=k?.primaryKeys?.length?k.primaryKeys:[pa],ua=mt__namespace.default.useMemo(()=>{let z=[...T];if(Array.isArray(Bo)&&Bo.length>0){let U=new Set(Bo);z=z.filter(R=>U.has(R.id));}if(Ko.length>0){let U=new Set(Ko);z=z.filter(R=>!U.has(R.id));}return z.filter(U=>!!U?.id)},[T,Ko,Bo]),ma=mt__namespace.default.useMemo(()=>new Set($a),[$a]),_o=mt__namespace.default.useMemo(()=>new Set(qo),[qo]),oo=mt__namespace.default.useMemo(()=>new Set(Wa),[Wa]),Fo=mt__namespace.default.useCallback(z=>_o.size>0?_o.has(z):!(oo.has(z)||ma.has(z)),[_o,oo,ma]);mt__namespace.default.useEffect(()=>{!Pe&&Ce.hasActiveFilters&&Ce.clearAll();},[Pe,Ce.hasActiveFilters,Ce.clearAll]);let fr=()=>{let z={};Oa.forEach(U=>{z[U.id]=Do[U.id]??"";}),Lt(z),da(true);},Ha=()=>{Et||da(false);},hr=(z,U)=>{Lt(R=>({...R,[z]:U}));},yr=async()=>{if(!x?.onSubmit){da(false);return}try{Go(!0),await x.onSubmit(Ea),da(!1);}finally{Go(false);}},br=()=>{if(!Nt)return;let z={};ua.forEach(R=>{z[R.id]=Nt[R.id]??"";});let U=k?.getInitialValues?{...z,...k.getInitialValues(Nt)}:z;za(U),Dt(true);},Gt=()=>{Ie||Dt(false);},xr=(z,U)=>{za(R=>({...R,[z]:U}));},Zo=async()=>{if(Nt){if(!k?.onSubmit){Dt(false);return}try{to(!0),await k.onSubmit(La,Nt),Dt(!1);}finally{to(false);}}},Eo=()=>{zt.length!==0&&Uo(true);},vr=()=>{Mo||Uo(false);},Ga=async()=>{if(zt.length===0){Uo(false);return}if(!L?.onConfirm){Uo(false),de([]),c?.([]);return}try{Ao(!0),await L.onConfirm(zt),Uo(!1),de([]),c?.([]);}finally{Ao(false);}},ga=qe,{fieldMapping:b}=Ar({rows:ga,config:{...y,title:y?.title||`${S} ${t("graph.reportTitle")}`}}),A=mt__namespace.default.useMemo(()=>he?Ce.applyRows(ga,b):ga,[he,Ce.applyRows,ga,b]),{model:E}=Ar({rows:A,config:{...y,title:y?.title||`${S} ${t("graph.reportTitle")}`,fieldMapping:b}}),W=E.table.columns.map(z=>({id:z.id,label:z.label,align:z.align||"left",minWidth:120,numeric:z.align==="right"})),j=ue?jsxRuntime.jsx(Bi,{appId:ue,tableKey:g,currentLayoutData:fe,onLayoutLoad:N,targetLayoutId:ie,activeLayoutId:we,serviceUrl:P??p?.serviceUrl}):null,se=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ti,{groupAnchorEl:ae,setGroupAnchorEl:Ft,grouping:Y,setGrouping:te,columns:T,toggleGroupField:ft}),jsxRuntime.jsx(oi,{anchorEl:De,setAnchorEl:Fe,columns:T,visibleColumns:F,toggleColumnVisibility:ke}),jsxRuntime.jsx(ai,{anchorEl:lt,setAnchorEl:Ke,showSummary:$,setShowSummary:V,columns:T,summaryColumns:q,toggleSummaryColumn:Jt}),jsxRuntime.jsx(ri,{contextMenu:Je,handleCloseContextMenu:uo,columns:T,visibleColumns:F,toggleColumnVisibility:ke})]});return B?jsxRuntime.jsxs(kn__default.default,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[p&&jsxRuntime.jsx(Ya,{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:g,currentLayout:[{tableKey:g,layoutData:fe}],variantService:p.variantService,serviceUrl:P??p.serviceUrl}),jsxRuntime.jsx(ed,{title:S,loading:m,showSummary:$,setShowSummary:V,setAnchorEl:Fe,setSummaryAnchorEl:Ke,filterText:w,setFilterText:D,sortedAndFilteredRows:qe,selected:i,columns:T,visibleColumns:F,summaryRow:rt,handleClick:Me,selectionMode:n}),se]}):jsxRuntime.jsxs(kn__default.default,{sx:{width:u?"100%":"auto",mb:s?0:2,...s?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[p&&jsxRuntime.jsx(kn__default.default,{sx:{mb:2},children:jsxRuntime.jsx(Ya,{fields:p.fields,filters:p.filters,onFilterChange:p.onFilterChange,onSearch:p.onSearch,variants:p.variants||[],currentVariantId:p.currentVariantId,onVariantLoad:z=>{O(z),p.onVariantLoad&&p.onVariantLoad(z);},onVariantSave:p.onVariantSave,onVariantDelete:p.onVariantDelete,onVariantSetDefault:p.onVariantSetDefault,loading:m,appId:p.appId,tableKey:g,currentLayout:[{tableKey:g,layoutData:fe}],currentLayoutId:we,layoutRefs:[{tableKey:g,layoutId:we}],variantService:p.variantService,serviceUrl:P??p.serviceUrl})}),jsxRuntime.jsxs(Ry__default.default,{sx:{width:u?"100%":"auto",mb:s?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":Va?{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(Qn,{filterText:w,setFilterText:D,onRowsPerPageChange:gt,rowsPerPage:Ro,rowsPerPageOptions:h,page:To,count:H,onPageChange:Po,actions:d,extraTools:l,grouping:Y,setGroupAnchorEl:Ft,showSummary:$,setShowSummary:V,setAnchorEl:Fe,setSummaryAnchorEl:Ke,handleExport:co,showCreateButton:je,onOpenCreateDialog:fr,showEditButton:Rt,onOpenEditDialog:br,editDisabled:zt.length!==1,showDeleteButton:go,onOpenDeleteConfirm:Eo,deleteDisabled:zt.length===0,onLayoutSave:I||p?.variantService&&p?.appId?G:void 0,loading:m,layoutManager:j,onOpenGraphReport:Se?ye:void 0}),jsxRuntime.jsx(rp__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:Tt,collisionDetection:core.closestCenter,onDragEnd:lo,modifiers:[modifiers.restrictToHorizontalAxis],children:jsxRuntime.jsxs(Dy__default.default,{sx:{minWidth:u?750:"auto",width:u?"100%":"auto",tableLayout:Object.keys(ge).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,"& .MuiTableCell-root":{fontSize:o}},"aria-labelledby":"tableTitle",size:"small",stickyHeader:true,children:[jsxRuntime.jsx(Zc,{columns:T,visibleColumns:F,order:v,orderBy:M,onRequestSort:pe,onContextMenu:po,selectionMode:n,grouping:Y,isAllExpanded:Io,handleToggleAll:Te,rowCount:qe.length,numSelected:i.length,onSelectAllClick:$e,columnWidths:ge,onColumnResize:ne}),jsxRuntime.jsx(Qc,{visibleRows:Ho,columns:T,visibleColumns:F,selectionMode:n,selected:i,orderBy:M,loading:m,expandedGroups:oe,toggleGroupExpand:ce,handleExpandGroupRecursively:Pt,handleCollapseGroupRecursively:mo,isGroupFullyExpanded:Ba,handleClick:Me,onSelectionChange:c,grouping:Y,rowKeyProp:C,page:To,rowsPerPage:Ro}),$&&jsxRuntime.jsx(Yc,{showSummary:$,columns:T,visibleColumns:F,summaryRow:rt,selectionMode:n?.toString(),grouping:Y,orderBy:M,zIndex:3})]})})})]}),je&&jsxRuntime.jsxs(Yd__default.default,{open:Fa,onClose:Ha,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:z=>`1px solid ${z.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(Jd__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:x?.title||t("quickCreate.createWithTitle",{title:S})}),jsxRuntime.jsx(ep__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(kn__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Oa.map(z=>{let U=z.type==="number"||z.numeric?"number":z.type==="date"?"date":"text",R=z.label||z.id;return jsxRuntime.jsx(op__default.default,{label:R,value:Ea[z.id]??"",onChange:_=>hr(z.id,_.target.value),type:U,size:"small",fullWidth:true,InputLabelProps:{shrink:U==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${z.id}`)}),x?.description&&jsxRuntime.jsx(ap__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:x.description})]})}),jsxRuntime.jsxs(tp__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(zi__default.default,{onClick:Ha,sx:{fontSize:"0.85rem"},disabled:Et,children:x?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(zi__default.default,{onClick:yr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Et,children:x?.submitLabel||t("common.save")})]})]}),Rt&&jsxRuntime.jsxs(Yd__default.default,{open:Ht,onClose:Gt,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:z=>`1px solid ${z.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(Jd__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:k?.title||t("quickEdit.editWithTitle",{title:S})}),jsxRuntime.jsx(ep__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(kn__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[ua.map(z=>{let U=z.type==="number"||z.numeric?"number":z.type==="date"?"date":"text",R=z.label||z.id,_=Fo(z.id);return jsxRuntime.jsx(op__default.default,{label:R,value:La[z.id]??"",onChange:le=>xr(z.id,le.target.value),type:U,size:"small",fullWidth:true,disabled:!_,InputLabelProps:{shrink:U==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${z.id}`)}),k?.description&&jsxRuntime.jsx(ap__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:k.description})]})}),jsxRuntime.jsxs(tp__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(zi__default.default,{onClick:Gt,sx:{fontSize:"0.85rem"},disabled:Ie,children:k?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(zi__default.default,{onClick:Zo,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Ie||!Nt,children:k?.submitLabel||t("common.save")})]})]}),go&&jsxRuntime.jsx(nn,{open:Na,type:"warning",title:L?.title||t("quickDelete.confirmTitle"),message:L?.message||(zt.length>1?t("quickDelete.confirmMessageMultiple",{count:zt.length}):t("quickDelete.confirmMessageSingle")),confirmText:L?.confirmText||t("common.delete"),cancelText:L?.cancelText||t("common.cancel"),onClose:vr,onConfirm:Ga}),se,Se&&jsxRuntime.jsx(vi,{open:Pe,onClose:Re,model:E,aiAssistant:y?.aiAssistant,interaction:he?{enabled:true,filters:Ce.filters,fieldMapping:b,onPrimaryDimensionClick:z=>Ce.setFilter("primaryDimension",z),onSecondaryDimensionClick:z=>Ce.setFilter("secondaryDimension",z),onStatusClick:z=>Ce.setFilter("status",z),onClearFilter:Ce.clearFilter,onClearAll:Ce.clearAll}:void 0,tableContent:jsxRuntime.jsx(Sa,{appId:ue||"graph-report-internal",title:t("graph.dataBody"),columns:W,rows:E.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},oR=Sa;var cR=({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(Uc,{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(Ya,{...d})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsx(Sa,{...l,fitContainer:true,filterConfig:c==="integrated"?d:void 0})})]}),n]})};var fR=({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}=K(),[l,s]=mt.useState(false),[u,f]=mt.useState([]),[m,h]=mt.useState({}),[I,p]=mt.useState(e.variants||[]),[C,g]=mt.useState(e.layout||null),[y,x]=mt.useState(""),[k,L]=mt.useState(0),[P,S]=mt.useState(0),[B,T]=mt.useState(o),[v,M]=mt.useState([]),[w,D]=mt.useState("asc"),[F,$]=mt.useState("");mt.useEffect(()=>{let ge={};e.filters.forEach(De=>{De.defaultValue!==void 0&&(ge[De.id]=De.defaultValue);}),h(ge);},[e.filters]);let V=mt.useCallback(async(ge,De,Fe,Je,Tt)=>{s(true);try{let qe={...ge,page:De+1,limit:Fe,sort:Tt,order:Je},rt;t?rt=await t(qe):typeof e.api=="function"?rt=await e.api(qe):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,qe),rt={rows:[],total:0}):(console.warn("No API configured for report"),rt={rows:[],total:0}),rt&&(f(rt.rows||[]),L(rt.total||0));}catch(qe){console.error("Failed to fetch report data",qe);}finally{s(false);}},[e.api,t]);mt.useEffect(()=>{V(m,P,B,w,F);},[V,P,B,w,F]);let q=()=>{S(0),V(m,0,B,w,F);},Y=ge=>{S(0),T(ge);},te=(ge,De)=>{D(De),$(ge);},oe=ge=>{h(ge);},ae=ge=>{x(ge?.id||"");let De=Xd(ge,r);if(De){let Je=De.values??De;h(Je),V(Je,0,B,w,F),S(0);}let{layout:Fe}=Fi(ge,r);Fe&&g(Fe);},Ft=ge=>{let De={...ge,id:Date.now().toString(),createdAt:new Date().toISOString()};p(Fe=>[...Fe,De]);},lt=ge=>{g(ge);};return {pageProps:{id:e.id,title:e.title,mode:n,filterConfig:{appId:e.id,tableKey:r,fields:e.filters,filters:m,onFilterChange:oe,onSearch:q,onVariantLoad:ae,onVariantSave:Ft,onVariantDelete:ge=>p(De=>De.filter(Fe=>Fe.id!==ge)),onVariantSetDefault:ge=>{p(De=>De.map(Fe=>({...Fe,isDefault:Fe.id===ge})));},variants:I,currentVariantId:y,variantService:c,serviceUrl:i},tableProps:{appId:e.id,tableKey:r,columns:e.columns,rows:u,loading:l,rowKey:"id",count:k,page:P,rowsPerPage:B,rowsPerPageOptions:a,onPageChange:S,onRowsPerPageChange:Y,selectionMode:"multiple",selected:v,onSelectionChange:M,onLayoutSave:lt,layout:C,title:e.title,showSummary:true,order:w,orderBy:F,serviceUrl:i,onSortChange:te,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${d("graph.reportTitle")}`}}},filters:m,rows:u,loading:l,refresh:q}};var Wy=e=>[...e].sort((t,o)=>o.value-t.value),bR=({bars:e=[],lines:t=[],combos:o=[],heatmap:a=[],pies:r=[],waterfalls:n=[]})=>{let i=mt.useMemo(()=>Wy(e),[e]),c=mt.useMemo(()=>[...t],[t]),d=mt.useMemo(()=>[...o],[o]),l=mt.useMemo(()=>[...a],[a]),s=mt.useMemo(()=>{let f=r.reduce((m,h)=>m+h.value,0);return r.map(m=>({...m,percent:f>0?m.value/f*100:m.percent}))},[r]),u=mt.useMemo(()=>[...n],[n]);return {bars:i,lines:c,combos:d,heatmap:l,pies:s,waterfalls:u}};var SR=({apiKey:e,query:t,zoom:o=14,mapType:a="roadmap"})=>mt.useMemo(()=>!e||!t?"":gn({apiKey:e,query:t,zoom:o,mapType:a}),[e,t,o,a]),wR=({keyword:e,location:t})=>mt.useMemo(()=>fi({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var Sn=({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(_y__default.default,{fontSize:"inherit"}):jsxRuntime.jsx(qy__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,u)=>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:u+1}),jsxRuntime.jsx(material.Box,{component:"span",sx:{whiteSpace:r?"pre-wrap":"pre",wordBreak:r?"break-word":"normal"},children:s})]},`${u}-${s}`)):jsxRuntime.jsx(material.Box,{component:"code",sx:{display:"block",whiteSpace:r?"pre-wrap":"pre",wordBreak:r?"break-word":"normal"},children:e})})]})};var Yy=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},Jy=async e=>new Function("m","return import(m)")(e),wn=({expression:e,inline:t=false,allowKatex:o=false})=>{let a=mt.useMemo(()=>Yy(e),[e]),[r,n]=mt.useState("");return mt.useEffect(()=>{let i=true;return (async()=>{if(!o||!a){n("");return}try{let d=await Jy("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 ib=async e=>new Function("m","return import(m)")(e),wl=({code:e,title:t="Mermaid Diagram",height:o=320,enabled:a=true})=>{let[r,n]=mt.useState(""),[i,c]=mt.useState(""),[d,l]=mt.useState(false),s=mt.useMemo(()=>e.trim(),[e]);return mt.useEffect(()=>{let u=true;return (async()=>{if(!a||!s){n(""),c("");return}l(true),c(""),n("");try{let m=await ib("mermaid"),h=m?.default||m;if(!h||typeof h.render!="function")throw new Error("Mermaid runtime is not available");h.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let I=await h.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,s),p=typeof I=="string"?I:I?.svg;u&&typeof p=="string"&&n(p);}catch(m){if(u){let h=m instanceof Error?m.message:"Failed to render Mermaid diagram";c(h);}}finally{u&&l(false);}})(),()=>{u=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(Sn,{code:s,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var Il=e=>e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),gb=e=>/^:?-{3,}:?$/.test(e.trim()),fb=e=>{let t=e.trim(),o=t.startsWith(":"),a=t.endsWith(":");return o&&a?"center":a?"right":"left"},Oi=e=>{let t=e.split(`
187
+ `).map(i=>i.trim()).filter(Boolean);if(t.length<2)return null;let o=Il(t[0]),a=Il(t[1]);if(o.length===0||a.length!==o.length||!a.every(gb))return null;let r=a.map(fb),n=t.slice(2).filter(i=>i.includes("|")).map(i=>{let c=Il(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}},Tl=({markdown:e,table:t,maxHeight:o=360})=>{let a=mt.useMemo(()=>t||(e?Oi(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 $i=({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(kb__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 Rl=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,Hi=e=>e.trim().startsWith("```"),gp=e=>/^#{1,6}\s+/.test(e.trim()),Dl=e=>/^[-*+]\s+/.test(e.trim()),Ml=e=>/^\d+\.\s+/.test(e.trim()),fp=e=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(e.trim()),Al=e=>e.trim().startsWith(">"),hp=(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",Pn=(e,t,o)=>{let a=[],r=0,n=0;Rl.lastIndex=0;let i=Rl.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(wn,{expression:c,inline:true,allowKatex:true},d)):a.push(c);r=i.index+c.length,n+=1,i=Rl.exec(e);}return r<e.length&&a.push(e.slice(r)),a.length>0?a:[e]},Rn=({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=mt.useMemo(()=>{let s=[],u=d.replace(/\r\n/g,`
188
188
  `).split(`
189
- `),f={enableMath:o},m=0;for(;m<u.length;){let h=u[m],I=h.trim();if(!I){m+=1;continue}if(n&&hp(h)){if(I.startsWith("<think>")){let g=[],y=h;for(;;){let x=y.indexOf("<think>"),k=x>=0?y.slice(x+7):y,L=k.indexOf("</think>");if(L>=0){g.push(k.slice(0,L)),m+=1;break}if(g.push(k),m+=1,m>=u.length)break;y=u[m];}s.push(jsxRuntime.jsx(Wi,{content:g.join(`
190
- `).trim()},`think-tag-${m}`));continue}m+=1;let C=[];for(;m<u.length&&u[m].trim()!==":::";)C.push(u[m]),m+=1;m<u.length&&u[m].trim()===":::"&&(m+=1),s.push(jsxRuntime.jsx(Wi,{content:C.join(`
191
- `).trim()},`think-fence-${m}`));continue}if($i(h)){let C=I.slice(3).trim().toLowerCase(),g=[];for(m+=1;m<u.length&&!$i(u[m]);)g.push(u[m]),m+=1;m<u.length&&$i(u[m])&&(m+=1);let y=g.join(`
192
- `);if(r&&C==="mermaid"){s.push(jsxRuntime.jsx(Sl,{code:y},`mermaid-${m}`));continue}if(o&&["math","latex","katex"].includes(C)){s.push(jsxRuntime.jsx(kn,{expression:y,allowKatex:true},`math-fence-${m}`));continue}s.push(jsxRuntime.jsx(Cn,{code:y,language:C||"text",copyable:i,showLineNumbers:c,wrapLongLines:true},`code-${m}`));continue}if(o&&I.startsWith("$$")){let C=[];if(I.endsWith("$$")&&I!=="$$")C.push(I.slice(2,-2)),m+=1;else {let y=h.slice(h.indexOf("$$")+2);for(y.trim()&&C.push(y),m+=1;m<u.length;){let x=u[m],k=x.indexOf("$$");if(k>=0){C.push(x.slice(0,k)),m+=1;break}C.push(x),m+=1;}}s.push(jsxRuntime.jsx(kn,{expression:C.join(`
193
- `).trim(),allowKatex:true},`math-${m}`));continue}if(mp(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";s.push(jsxRuntime.jsx(material.Typography,{variant:y,sx:{mt:C===1?1.2:.8,mb:.5,fontWeight:700},children:In(g,f,`h-${m}`)},`heading-${m}`)),m+=1;continue}if(gp(h)){s.push(jsxRuntime.jsx(material.Divider,{sx:{my:1.2}},`hr-${m}`)),m+=1;continue}if(fp(u,m)){let C=m+2;for(;C<u.length&&u[C].trim()&&u[C].includes("|");)C+=1;let g=u.slice(m,C).join(`
194
- `),y=Vi(g);if(y){s.push(jsxRuntime.jsx(Il,{table:y},`table-${m}`)),m=C;continue}}if(Ml(h)){let C=[];for(;m<u.length&&Ml(u[m]);)C.push(u[m].replace(/^\s*>\s?/,"")),m+=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((g,y)=>jsxRuntime.jsxs(ut.Fragment,{children:[y>0&&jsxRuntime.jsx("br",{}),In(g,f,`q-${m}-${y}`)]},`quote-line-${y}`))})},`quote-${m}`));continue}if(Rl(h)){let C=[];for(;m<u.length&&Rl(u[m]);)C.push(u[m].trim().replace(/^[-*+]\s+/,"")),m+=1;s.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:In(g,f,`ul-${m}-${y}`)})},`ul-item-${y}`))},`ul-${m}`));continue}if(Dl(h)){let C=[];for(;m<u.length&&Dl(u[m]);)C.push(u[m].trim().replace(/^\d+\.\s+/,"")),m+=1;s.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:In(g,f,`ol-${m}-${y}`)})},`ol-item-${y}`))},`ol-${m}`));continue}let p=[];for(;m<u.length;){let C=u[m],g=C.trim();if(!g||$i(C)||mp(C)||gp(C)||Rl(C)||Dl(C)||Ml(C)||fp(u,m)||n&&hp(C)||o&&g.startsWith("$$"))break;p.push(C),m+=1;}p.length>0?s.push(jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:p.map((C,g)=>jsxRuntime.jsxs(ut.Fragment,{children:[g>0&&jsxRuntime.jsx("br",{}),In(C,f,`p-${m}-${g}`)]},`p-line-${g}`))},`p-${m}`)):m+=1;}return s},[d,o,r,n,i,c]);return jsxRuntime.jsx(material.Box,{className:a,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:l})};var nD=(e,t)=>jsxRuntime.jsx(Tn,{markdown:e,...t});var xp=({value:e,onChange:t,onSubmit:a,onVoiceInput:o,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(Vd__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(),a());},placeholder:n,sx:{fontSize:d?"0.84rem":"0.9rem"}}),e&&r&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:r,children:jsxRuntime.jsx(Jf__default.default,{sx:{fontSize:d?16:18}})}),o&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:o,children:jsxRuntime.jsx(sh__default.default,{sx:{fontSize:d?16:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:a,disabled:c||!e.trim(),children:jsxRuntime.jsx(ch__default.default,{sx:{fontSize:d?16:18}})})]}),l&&i&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:i})]});var vp=(e,t)=>{let a=t.trim();if(!a)return e;let o=e.toLowerCase(),r=a.toLowerCase(),n=o.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+a.length)}),e.slice(n+a.length)]})},Hi=({section:e,highlightQuery:t=""})=>{let a=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:a===3?"repeat(3, minmax(0, 1fr))":a===1?"1fr":"repeat(2, minmax(0, 1fr))"}},children:e.fields.map(o=>{let r=typeof o.value=="string"||typeof o.value=="number"?String(o.value):null;return jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:vp(o.label,t)}),jsxRuntime.jsx(material.Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:r?vp(r,t):o.value})]},o.id)})})]})};var Ll=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",Ui=e=>e.trim().toLowerCase(),Ob=(e,t)=>{let a=[];return e.forEach(o=>{o.fields.forEach(r=>{let n=r.searchableText||Ll(r.value),i={source:"section",sourceId:o.id,sourceSectionId:o.id,sourceTitle:o.title,fieldId:r.id,fieldLabel:r.label,fieldValue:n};a.push({hit:i,text:Ui(`${o.title} ${r.label} ${n}`)});});}),t.forEach(o=>{(o.fields||[]).forEach(r=>{let n=r.searchableText||Ll(r.value),i={source:"tab",sourceId:o.id,sourceTitle:o.label,fieldId:r.id,fieldLabel:r.label,fieldValue:n};a.push({hit:i,text:Ui(`${o.label} ${r.label} ${n}`)});}),(o.sections||[]).forEach(r=>{r.fields.forEach(n=>{let i=n.searchableText||Ll(n.value),c={source:"tab",sourceId:o.id,sourceSectionId:r.id,sourceTitle:`${o.label} / ${r.title}`,fieldId:n.id,fieldLabel:n.label,fieldValue:i};a.push({hit:c,text:Ui(`${o.label} ${r.title} ${n.label} ${i}`)});});});}),a},Cp=({sections:e,tabs:t=[],defaultTabId:a,ai:o})=>{let{t:r}=q(),[n,i]=ut.useState(""),[c,d]=ut.useState(a||t[0]?.id),[l,s]=ut.useState("idle"),[u,f]=ut.useState([]),[m,h]=ut.useState(""),[I,p]=ut.useState(""),[C,g]=ut.useState(false),y=ut.useMemo(()=>Ob(e,t),[e,t]);ut.useEffect(()=>{if(t.length===0){d(void 0);return}t.some(B=>B.id===c)||d(a||t[0]?.id);},[t,c,a]);let x=ut.useCallback(()=>{s("idle"),f([]),h(""),p("");},[]),k=ut.useCallback(S=>{i(S),S.trim()||(s("idle"),f([]),h(""),p(""));},[]),L=ut.useCallback(S=>{let B=Ui(S);return B?y.filter(T=>T.text.includes(B)).map(T=>T.hit):[]},[y]),P=ut.useCallback(async()=>{let S=n.trim();if(!S)return;g(true);let B=L(S);if(f(B),B.length>0){s("search"),p(""),h(r("detail.searchAi.matches",{count:B.length})),g(false);return}if(o?.enabled!==false&&o?.onSubmit){s("ai"),h(r("detail.searchAi.autoAiFallback"));try{let v=await o.onSubmit(S,{query:S,hits:B,activeTabId:c,sections:e,tabs:t});p(typeof v=="string"?v:"");}finally{g(false);}return}s("search"),p(""),h(r("detail.searchAi.noMatch")),g(false);},[n,L,r,o,c,e,t]);return {query:n,setQuery:k,activeTabId:c,setActiveTabId:d,searchMode:l,hits:u,statusText:m,aiResponse:I,searching:C,handleSubmit:P,clearResult:x}};var zD=({title:e,subtitle:t,sections:a,tabs:o=[],defaultTabId:r,table:n,ai:i,rightHeaderSlot:c,searchBarWidth:d=460,onClose:l,closeLabel:s="Close"})=>{let{t:u}=q(),{query:f,setQuery:m,activeTabId:h,setActiveTabId:I,searchMode:p,hits:C,statusText:g,aiResponse:y,searching:x,handleSubmit:k,clearResult:L}=Cp({sections:a,tabs:o,defaultTabId:r,ai:i}),P=ut.useMemo(()=>o.find(T=>T.id===h)||o[0],[o,h]),S=ut.useCallback(T=>{let v=M=>{let w=document.getElementById(T);if(w){w.scrollIntoView({behavior:"smooth",block:"center"});return}M<4&&setTimeout(()=>v(M+1),60);};requestAnimationFrame(()=>v(0));},[]),B=ut.useCallback((T,v)=>{if(o.some(M=>M.id===T)){I(T),S(v?`detail-tab-${T}-section-${v}`:`detail-tab-${T}`);return}S(`detail-section-${T}`);},[o,I,S]);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(xp,{value:f,onChange:m,onSubmit:k,onVoiceInput:i?.onVoiceInput,onClear:()=>{m(""),L();},placeholder:i?.placeholder||u("detail.searchAi.placeholder"),statusText:g,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(Kb__default.default,{fontSize:"small"})})}),c]})]}),g&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:g}),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:u("detail.searchAi.matches",{count:C.length})}),jsxRuntime.jsx(material.Stack,{spacing:.35,children:C.slice(0,8).map(T=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:()=>B(T.sourceId,T.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:T.sourceTitle})," \xB7 ",jsxRuntime.jsx(material.Box,{component:"span",sx:{fontWeight:700},children:T.fieldLabel})," = ",jsxRuntime.jsx(material.Box,{component:"span",children:T.fieldValue||"-"})]})},`${T.source}|${T.sourceId}|${T.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:u("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(Tn,{markdown:y})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:a.map(T=>jsxRuntime.jsx(material.Box,{id:`detail-section-${T.id}`,children:jsxRuntime.jsx(Hi,{section:T,highlightQuery:f})},T.id))}),o.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsxRuntime.jsx(material.Tabs,{value:P?.id||false,onChange:(T,v)=>I(v),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:o.map(T=>jsxRuntime.jsx(material.Tab,{value:T.id,label:T.label,sx:{textTransform:"none"}},T.id))}),jsxRuntime.jsxs(material.Box,{sx:{p:1.5},children:[jsxRuntime.jsx(material.Box,{id:`detail-tab-${P?.id||""}`}),P?.description&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:P.description}),P?.content?P.content:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[(P?.sections||[]).map(T=>jsxRuntime.jsx(material.Box,{id:`detail-tab-${P?.id}-section-${T.id}`,children:jsxRuntime.jsx(Hi,{section:T,highlightQuery:f})},T.id)),P?.fields&&P.fields.length>0&&jsxRuntime.jsx(Hi,{section:{id:`${P.id}-fields`,title:P.label,fields:P.fields,columns:2},highlightQuery:f})]})]})]}),n&&jsxRuntime.jsx(Ca,{title:n.title||u("detail.table.title"),...n.tableProps,filterConfig:void 0,fitContainer:false})]})};var Ip=({bucket:e,cardCount:t,highlighted:a=false,children:o,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,a?.58:d.palette.mode==="dark"?.28:.18)}`,bgcolor:styles.alpha(d.palette.background.paper,d.palette.mode==="dark"?.92:.97),boxShadow:a?`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"})]})]}),a&&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?o: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 Xb={success:"success",warning:"warning",info:"info",error:"error"},Qb={critical:"error",high:"warning",medium:"info",low:"success"},Yb=(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}},Jb=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",Nl=({card:e,bucket:t,dragging:a=false,overlay:o=false,onClick:r,sx:n})=>{let{t:i}=q(),c=!!(r&&t),d=e.tone??(e.priority?Qb[e.priority]:"default"),l=d==="default"?"primary":Xb[d],s=t?{card:e,bucket:t}:void 0;return jsxRuntime.jsx(material.Paper,{onClick:c?()=>s&&r?.(s):void 0,onKeyDown:c?u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),s&&r?.(s));}:void 0,role:c?"button":void 0,tabIndex:c?0:void 0,sx:[u=>{let f=d==="default"?u.palette.primary.main:u.palette[l].main;return {position:"relative",overflow:"hidden",p:1.4,borderRadius:3,border:`1px solid ${styles.alpha(f,u.palette.mode==="dark"?.42:.2)}`,bgcolor:styles.alpha(u.palette.background.paper,u.palette.mode==="dark"?.96:.98),boxShadow:o?`0 20px 45px ${styles.alpha(u.palette.common.black,.24)}`:a?"none":`0 8px 24px ${styles.alpha(u.palette.common.black,u.palette.mode==="dark"?.18:.08)}`,transform:o?"rotate(1deg) scale(1.01)":"none",transition:"transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease",cursor:c?"pointer":"default",opacity:a?.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(u.palette.common.black,u.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:Yb(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(u=>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:u.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",fontWeight:700},children:u.value})]},u.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(u=>jsxRuntime.jsx(material.Chip,{size:"small",label:u.label,color:u.color??"default",variant:"outlined"},u.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??Jb(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 tx=(e,t)=>Number.isNaN(e)||e<0?0:e>t?t:e,Rp=({buckets:e,cards:t})=>{let a=new Map;return t.forEach((o,r)=>{let n=a.get(o.bucketId)??[];n.push({card:o,sourceIndex:r}),a.set(o.bucketId,n);}),{buckets:e.map(o=>{let r=[...a.get(o.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:o.id,position:i}));return {...o,cards:r}})}},xo=(e,t)=>{for(let a=0;a<e.buckets.length;a+=1){let o=e.buckets[a],r=o.cards.findIndex(n=>n.id===t);if(r>=0)return {card:o.cards[r],bucket:o,bucketIndex:a,cardIndex:r}}},_i=(e,t)=>{let a=xo(e,t.cardId);if(!a)return e;let o=e.buckets.findIndex(l=>l.id===t.toBucketId);if(o<0)return e;let r=e.buckets.map(l=>({...l,cards:l.cards.map(s=>({...s}))})),n=r[a.bucketIndex],[i]=n.cards.splice(a.cardIndex,1);if(!i)return e;let c=r[o],d=tx(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,u)=>({...s,bucketId:l.id,position:u}))}))}};var Vl="kanban-card|",Ol="kanban-bucket|",Bp=e=>`${Vl}${e}`,gx=e=>`${Ol}${e}`,Zi=e=>e?.startsWith(Vl)?e.slice(Vl.length):void 0,Ap=e=>e?.startsWith(Ol)?e.slice(Ol.length):void 0,fx=({card:e,bucket:t,onCardClick:a})=>{let{setNodeRef:o,attributes:r,listeners:n,transform:i,transition:c,isDragging:d}=sortable.useSortable({id:Bp(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:o,style:l,...r,...n,children:jsxRuntime.jsx(Nl,{card:e,bucket:t,dragging:d,onClick:a})})},hx=({bucket:e,highlighted:t,bucketMaxHeight:a,emptyBucketLabel:o,onCardClick:r})=>{let{isOver:n,setNodeRef:i}=core.useDroppable({id:gx(e.id)});return jsxRuntime.jsx(material.Box,{ref:i,sx:{minWidth:0},children:jsxRuntime.jsx(Ip,{bucket:e,cardCount:e.cards.length,highlighted:t||n,emptyLabel:o,maxHeight:a,children:jsxRuntime.jsx(sortable.SortableContext,{items:e.cards.map(c=>Bp(c.id)),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:1,children:e.cards.map(c=>jsxRuntime.jsx(fx,{card:c,bucket:e,onCardClick:r},c.id))})})})})},a2=({model:e,onCardMove:t,onCardClick:a,minBucketWidth:o=320,bucketMaxHeight:r,emptyBucketLabel:n,sx:i})=>{let[c,d]=ut.useState(null),[l,s]=ut.useState(),u=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),f=ut.useMemo(()=>c?xo(e,c):void 0,[c,e]),m=ut.useCallback(()=>{d(null),s(void 0);},[]),h=ut.useCallback(g=>{if(!g)return;let y=Zi(g);return y?xo(e,y)?.bucket.id:Ap(g)},[e]),I=ut.useCallback(g=>{d(Zi(String(g.active.id))??null);},[]),p=ut.useCallback(g=>{s(h(g.over?String(g.over.id):void 0));},[h]),C=ut.useCallback(g=>{let y=Zi(String(g.active.id)),x=g.over?String(g.over.id):void 0;if(!y||!x){m();return}let k=xo(e,y);if(!k){m();return}let L=k.bucket.id,P=k.cardIndex,S=Zi(x);if(S){let v=xo(e,S);if(!v){m();return}L=v.bucket.id,P=v.cardIndex;}else {let v=Ap(x),M=e.buckets.find(w=>w.id===v);if(!v||!M){m();return}L=v,P=M.cards.length;}if(k.bucket.id===L&&k.cardIndex===P){m();return}let B=_i(e,{cardId:y,fromBucketId:k.bucket.id,toBucketId:L,targetIndex:P}),T=xo(B,y);T&&!(T.bucket.id===k.bucket.id&&T.cardIndex===k.cardIndex)&&t?.({cardId:y,fromBucketId:k.bucket.id,toBucketId:T.bucket.id,targetIndex:T.cardIndex,card:T.card,model:B}),m();},[e,t,m]);return jsxRuntime.jsxs(core.DndContext,{sensors:u,collisionDetection:core.closestCorners,onDragStart:I,onDragOver:p,onDragEnd:C,onDragCancel:m,children:[jsxRuntime.jsx(material.Box,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${o}px, 1fr)`,gap:2,alignItems:"start",overflowX:"auto",pb:.5},...Array.isArray(i)?i:i?[i]:[]],children:e.buckets.map(g=>jsxRuntime.jsx(hx,{bucket:g,highlighted:g.id===l,bucketMaxHeight:r,emptyBucketLabel:n,onCardClick:a},g.id))}),jsxRuntime.jsx(core.DragOverlay,{children:f?jsxRuntime.jsx(material.Box,{sx:{width:Math.max(o-24,260)},children:jsxRuntime.jsx(Nl,{card:f.card,bucket:f.bucket,overlay:true})}):null})]})};var vx=({initialModel:e,initialBuckets:t,initialCards:a})=>e||Rp({buckets:t??[],cards:a??[]}),l2=e=>{let{onCardMove:t,onCardClick:a}=e,[o,r]=ut.useState(()=>vx(e)),n=ut.useCallback(s=>{r(u=>typeof s=="function"?s(u):s);},[]),i=ut.useCallback(s=>xo(o,s),[o]),c=ut.useCallback((s,u,f)=>{let m=xo(o,s);if(!m)return;let h=_i(o,{cardId:s,fromBucketId:m.bucket.id,toBucketId:u,targetIndex:f}),I=xo(h,s);if(!I||I.bucket.id===m.bucket.id&&I.cardIndex===m.cardIndex)return;r(h);let p={cardId:s,fromBucketId:m.bucket.id,toBucketId:I.bucket.id,targetIndex:I.cardIndex,card:I.card,model:h};return t?.(p),p},[o,t]),d=ut.useCallback((s,u)=>{r(f=>({buckets:f.buckets.map(m=>({...m,cards:m.cards.map(h=>h.id!==s?h:typeof u=="function"?u(h):{...h,...u})}))}));},[]),l=ut.useMemo(()=>({model:o,onCardMove:s=>{c(s.cardId,s.toBucketId,s.targetIndex);},onCardClick:a}),[o,c,a]);return {model:o,actions:{replaceModel:n,moveCard:c,updateCard:d,getCard:i},boardProps:l}};var zp=64,Lx="#E9EDF2",zx="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",Nx=["en","zh","fr","de","ja","ko"],Np={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},Vp=({appTitle:e,logo:t,mode:a="dark",onToggleMode:o,locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,searchPlaceholder:d,onSearch:l,user:s,onUserSetting:u,onUserLogout:f,userMenuItems:m,leftSlot:h,rightSlot:I})=>{let{t:p,locale:C}=q(),y=material.useTheme().palette.mode==="dark",[x,k]=ut.useState(""),[L,P]=ut.useState(null),[S,B]=ut.useState(null),T=ae=>{ae.preventDefault(),l&&l(x.trim());},v=a==="system"?jsxRuntime.jsx(Mx__default.default,{fontSize:"small"}):a==="dark"?jsxRuntime.jsx(Ax__default.default,{fontSize:"small"}):jsxRuntime.jsx(Bx__default.default,{fontSize:"small"}),M=p(a==="system"?"header.theme.system":a==="dark"?"header.theme.dark":"header.theme.light"),w=r||C,D=i&&i.length>0?i:Nx,F=n||Np[w]||w.toUpperCase(),$=!!L,V=d||p("header.searchPlaceholder"),_=!!S,Y=[{key:"setting",label:p("header.menu.setting"),icon:jsxRuntime.jsx(ny__default.default,{sx:{fontSize:18}}),onClick:u},{key:"logout",label:p("header.menu.logout"),icon:jsxRuntime.jsx(Ex__default.default,{sx:{fontSize:18}}),onClick:f}],ee=m&&m.length>0?m:Y,te=ae=>{B(null),ae?.();};return jsxRuntime.jsxs(material.AppBar,{position:"sticky",elevation:0,sx:ae=>({top:0,zIndex:ae.zIndex.drawer+10,height:zp,backgroundColor:ae.palette.mode==="dark"?"#0D0D0D":Lx,backgroundImage:ae.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%)",zx,"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:ae.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)"}),children:[jsxRuntime.jsxs(material.Toolbar,{sx:{minHeight:`${zp}px !important`,px:2,gap:2},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[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}),h]}),jsxRuntime.jsx(material.Box,{sx:{flex:1,display:"flex",justifyContent:"center",minWidth:0},children:jsxRuntime.jsx(material.Box,{component:"form",onSubmit:T,sx:{width:"100%",maxWidth:540},children:jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:x,onChange:ae=>k(ae.target.value),placeholder:V,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Vd__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:ae=>P(ae.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(Lp__default.default,{sx:{fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{fontWeight:500},children:F})]})}),jsxRuntime.jsx(material.Menu,{anchorEl:L,open:$,onClose:()=>P(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:D.map(ae=>jsxRuntime.jsx(material.MenuItem,{selected:ae===w,onClick:()=>{c(ae),P(null);},sx:{fontSize:"0.82rem"},children:Np[ae]},ae))})]}):jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsxRuntime.jsx(Lp__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:F})]}),jsxRuntime.jsx(material.IconButton,{size:"small",sx:{color:y?"common.white":"#111827"},onClick:o,title:M,children:v}),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:ae=>B(ae.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()})})]}),I]})]}),s&&jsxRuntime.jsx(material.Menu,{anchorEl:S,open:_,onClose:()=>B(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{minWidth:160,"& .MuiMenuItem-root":{minHeight:34,py:.5,px:1.25}}}},children:ee.map(ae=>jsxRuntime.jsxs(material.MenuItem,{disabled:ae.disabled,onClick:()=>te(ae.onClick),children:[ae.icon&&jsxRuntime.jsx(material.ListItemIcon,{children:ae.icon}),jsxRuntime.jsx(material.ListItemText,{primary:ae.label,slotProps:{primary:{sx:{fontSize:"0.86rem",fontWeight:500}}}})]},ae.key))})]})};var Op=({menuData:e=[],initialNavigationCollapsed:t=false}={})=>{let{navigationIslandProps:a}=$c({initialCollapsed:t,content:e}),[o,r]=ut.useState(900);ut.useEffect(()=>{let i=()=>r(window.innerHeight);return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);let n=ut.useMemo(()=>Math.max(280,o-100),[o]);return {navigationIslandProps:a,navigationMaxHeight:n}};var B2=({appTitle:e,menuData:t=[],children:a,showNavigation:o=true,locale:r="en",localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:l,onUserLogout:s,userMenuItems:u,logo:f,onSearch:m,rightHeaderSlot:h,leftHeaderSlot:I,contentSx:p})=>{let C="orbcafe:page-layout-mode",[g,y]=ut.useState("system"),[x,k]=ut.useState("light"),[L,P]=ut.useState(false),S=g==="system"?L?x:"light":g;ut.useEffect(()=>{try{let D=window.localStorage.getItem(C);(D==="light"||D==="dark"||D==="system")&&y(D);}catch{}P(true);let M=window.matchMedia("(prefers-color-scheme: dark)"),w=()=>{k(M.matches?"dark":"light");};return w(),M.addEventListener("change",w),()=>M.removeEventListener("change",w)},[]),ut.useEffect(()=>{if(L)try{window.localStorage.setItem(C,g);}catch{}},[L,g]);let B=ut.useMemo(()=>material.createTheme({palette:{mode:S}}),[S]),{navigationIslandProps:T,navigationMaxHeight:v}=Op({menuData:t,initialNavigationCollapsed:false});return jsxRuntime.jsx(material.ThemeProvider,{theme:B,children:jsxRuntime.jsx(Fc,{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(Vp,{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:l,onUserLogout:s,userMenuItems:u,onSearch:m,leftSlot:I,rightSlot:h}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,display:"flex"},children:[o&&jsxRuntime.jsx(material.Box,{sx:{p:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsxRuntime.jsx(Oc,{...T,maxHeight:v,colorMode:S})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...p},children:a})]})]})})})};var Ji="(blank)",Hp="Result",Gp="Grand Total",Up={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Kp=["sum","count","avg","min","max"];var qp=["palette","rows","columns","filters","values"];var _p=e=>qp.includes(e),Zp=e=>e==="rows"||e==="columns"||e==="filters",es=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&_p(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&_p(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},ta=e=>e==null||e===""?Ji:e instanceof Date?e.toISOString().slice(0,10):String(e),ar=e=>JSON.stringify(e),jp=(e,t)=>{let a=e.join(""),o=t.join("");return a.localeCompare(o,void 0,{sensitivity:"base"})},Kx=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},zr=(e,t,a)=>{if(a==="count")return e.length;let o=e.map(r=>Kx(r[t])).filter(r=>r!==null);return o.length===0?0:a==="sum"?o.reduce((r,n)=>r+n,0):a==="avg"?o.reduce((r,n)=>r+n,0)/o.length:a==="min"?Math.min(...o):Math.max(...o)},dt=(e,t)=>{if(!e||e.length===0)return [];let a=new Set,o=[];return e.forEach(r=>{!t.has(r)||a.has(r)||(a.add(r),o.push(r));}),o},oa=(e,t)=>e.length!==t.length?false:e.every((a,o)=>a===t[o]),Xp=(e,t)=>{let a=Object.keys(e),o=Object.keys(t);return a.length!==o.length?false:a.every(r=>{let n=e[r]??[],i=t[r]??[];return oa(n,i)})},ts=(e,t)=>e.length!==t.length?false:e.every((a,o)=>{let r=t[o];return a.tokenId===r.tokenId&&a.fieldId===r.fieldId&&a.aggregation===r.aggregation}),Gl=e=>!e?.aggregations||e.aggregations.length===0?Kp:e.aggregations,Dt=(e,t)=>{let a=Gl(t);return e&&a.includes(e)?e:t?.type==="number"&&a.includes("sum")?"sum":a.includes("count")?"count":a[0]},Fn=(e,t,a)=>{let o=a.get(t.fieldId);return o?.formatValue?o.formatValue(e):t.aggregation==="count"?Math.round(e).toLocaleString():e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var Jp=({options:e,selectedValues:t,onChange:a,minWidth:o=96})=>{let{t:r}=q(),[n,i]=ut.useState(""),c=ut.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:o},children:jsxRuntime.jsxs(material.Select,{multiple:true,value:t,onChange:l=>{let s=l.target.value,u=typeof s=="string"?s.split(","):s;a(u);},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(),a(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 Kl=({label:e,subtitle:t,isDragging:a,dragRef:o,listeners:r,attributes:n,style:i})=>jsxRuntime.jsx(material.Paper,{ref:o,...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:a?.3:1,cursor:a?"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(a0__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})]})]})}),ou=({id:e,label:t,subtitle:a})=>{let{setNodeRef:o,listeners:r,attributes:n,isDragging:i}=core.useDraggable({id:e});return jsxRuntime.jsx(Kl,{label:t,subtitle:a,isDragging:i,dragRef:o,listeners:r,attributes:n})};var Or=({zone:e,title:t,hint:a,icon:o,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:u=>({p:1.1,borderRadius:3,border:"1px dashed",borderColor:d?"primary.main":u.palette.divider,bgcolor:d?u.palette.mode==="dark"?"rgba(25, 118, 210, 0.16)":"rgba(47, 91, 255, 0.06)":u.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:[o,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(l0__default.default,{sx:{fontSize:16}})})})]}),jsxRuntime.jsx(material.Typography,{sx:{mt:.5,mb:.9,fontSize:"0.7rem",color:"text.secondary"},children:a}),jsxRuntime.jsx(material.Box,{sx:{flex:1},children:r})]})};var ru={xs:1.2,md:1.6},$r=({title:e,subtitle:t,collapsed:a,onToggleCollapse:o,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:ru,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,borderBottom:a?"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":a?r:n,onClick:o,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(iy__default.default,{sx:{fontSize:16,transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:a?"rotate(180deg)":"rotate(0deg)"}})})]})]}),jsxRuntime.jsx(material.Collapse,{in:!a,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:jsxRuntime.jsx(material.Box,{sx:[{px:ru,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:i})})]});var is=({label:e,caption:t,onRemove:a,trailing:o,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(a0__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})]}),o,a&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:l=>{l.stopPropagation(),a();},sx:{p:.2},children:jsxRuntime.jsx(Jf__default.default,{sx:{fontSize:16}})})]})}),En=({id:e,label:t,caption:a,onRemove:o,trailing:r})=>{let{setNodeRef:n,attributes:i,listeners:c,transform:d,transition:l,isDragging:s}=sortable.useSortable({id:e}),u={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:l,zIndex:s?999:"auto"};return jsxRuntime.jsx(is,{label:t,caption:a,onRemove:o,trailing:r,isDragging:s,dragRef:n,listeners:c,attributes:i,style:u})};var cs={rows:jsxRuntime.jsx(k0__default.default,{fontSize:"small"}),columns:jsxRuntime.jsx(Ng__default.default,{fontSize:"small"}),filters:jsxRuntime.jsx(C0__default.default,{fontSize:"small"}),values:jsxRuntime.jsx($g__default.default,{fontSize:"small"})},su=({isConfiguratorCollapsed:e,onToggleCollapse:t,availableFields:a,fieldMap:o,filterFields:r,columnFields:n,rowFields:i,valueFields:c,clearZone:d,removeFieldFromZone:l,getFilterSelectionSummary:s,renderDimensionFilterSelect:u,renderAggregationSelect:f,getAggregationLabel:m})=>{let{t:h}=q(),I=[`${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($r,{title:h("pivot.config.title"),subtitle:I,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(Or,{zone:"palette",title:h("pivot.fieldList"),hint:h("pivot.availableDimensions"),itemCount:a.length,icon:jsxRuntime.jsx(a0__default.default,{sx:{fontSize:16,color:"text.secondary"}}),children:jsxRuntime.jsxs(material.Stack,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[a.length===0&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",py:1},children:h("pivot.allFieldsInUse")}),a.map(p=>jsxRuntime.jsx(ou,{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(Or,{zone:"filters",title:h("pivot.zone.filters"),hint:h("pivot.hint.filters"),icon:cs.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(En,{id:`item|filters|${p}`,label:o.get(p)?.label??p,caption:s(p),trailing:u(p),onRemove:()=>l("filters",p)},p))})})}),jsxRuntime.jsx(Or,{zone:"columns",title:h("pivot.zone.columns"),hint:h("pivot.hint.columns"),icon:cs.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(En,{id:`item|columns|${p}`,label:o.get(p)?.label??p,caption:`${o.get(p)?.type??"dimension"} \u2022 ${s(p)}`,trailing:u(p),onRemove:()=>l("columns",p)},p))})})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(Or,{zone:"rows",title:h("pivot.zone.rows"),hint:h("pivot.hint.rows"),icon:cs.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(En,{id:`item|rows|${p}`,label:o.get(p)?.label??p,caption:`${o.get(p)?.type??"dimension"} \u2022 ${s(p)}`,trailing:u(p),onRemove:()=>l("rows",p)},p))})})}),jsxRuntime.jsx(Or,{zone:"values",title:h("pivot.zone.values"),hint:h("pivot.hint.values"),icon:cs.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=o.get(p.fieldId)?.label??p.fieldId,g=`${m(p.aggregation)}(${C})`;return jsxRuntime.jsx(En,{id:`item|values|${p.tokenId}`,label:C,caption:g,trailing:f(p),onRemove:()=>l("values",p.tokenId)},p.tokenId)})})})})]})]})]})})};var lu=e=>e.toLocaleString(void 0,{maximumFractionDigits:1}),cu=({data:e,primaryLabel:t,secondaryLabel:a,formatPrimaryValue:o,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=a?e.map(p=>p.primaryValue):e.map((p,C)=>C+1),s=a?e.map(p=>p.secondaryValue??0):e.map(p=>p.primaryValue),u=Math.max(...l,1),f=Math.max(...s,1),m=i-d.left-d.right,h=c-d.top-d.bottom,I=e.map((p,C)=>{let g=a?p.primaryValue:C+1,y=a?p.secondaryValue??0:p.primaryValue,x=d.left+g/u*m,k=c-d.bottom-y/f*h;return {...p,x,y:k,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)}),I.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
- `,a?`${t}: ${o(p.primaryValue)}`:`${t}: ${o(p.primaryValue)}`,a?`
196
- ${a}: ${(r??o)(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:a?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:a??t}),jsxRuntime.jsx("text",{x:d.left,y:d.top-4,fontSize:"10",fill:n.palette.text.secondary,children:lu(f)}),jsxRuntime.jsx("text",{x:i-d.right,y:c-d.bottom+16,textAnchor:"end",fontSize:"10",fill:n.palette.text.secondary,children:lu(u)})]})}),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,": ",o(p.primaryValue)]}),a&&jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[a,": ",(r??o)(p.secondaryValue??0)]})]},p.name))})]})};var Ql=e=>Math.max(...e,1),pu=({data:e,chartType:t,primaryLabel:a,secondaryLabel:o,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=Ql(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}})}),o&&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)}),o&&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=Ql(e.flatMap(x=>[x.primaryValue,x.secondaryValue??0])),y=o?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:o?16:26,minHeight:8,height:`${Math.max(x.primaryValue/g*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:c},title:`${a}: ${r(x.primaryValue)}`}),o&&jsxRuntime.jsx(material.Box,{sx:{width:16,minHeight:8,height:`${Math.max((x.secondaryValue??0)/g*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${o}: ${(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)}),o&&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,u={top:20,right:18,bottom:36,left:18},f=Ql(e.flatMap(g=>[g.primaryValue,g.secondaryValue??0])),m=l-u.left-u.right,h=s-u.top-u.bottom,I=g=>e.map((y,x)=>{let k=u.left+x*m/Math.max(e.length-1,1),L=s-u.bottom-g(y)/f*h;return {x:k,y:L,item:y}}),p=I(g=>g.primaryValue),C=o?I(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 ${l} ${s}`,sx:{width:"100%",minWidth:l,height:s},children:[jsxRuntime.jsx("line",{x1:u.left,y1:s-u.bottom,x2:l-u.right,y2:s-u.bottom,stroke:styles.alpha(i.palette.text.secondary,.35)}),jsxRuntime.jsx("polyline",{fill:"none",stroke:c,strokeWidth:3,points:p.map(g=>`${g.x},${g.y}`).join(" ")}),p.map(g=>jsxRuntime.jsx("circle",{cx:g.x,cy:g.y,r:4,fill:c,children:jsxRuntime.jsxs("title",{children:[g.item.name,`
197
- `,a,": ",r(g.item.primaryValue)]})},`primary-${g.item.name}`)),o&&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
- `,o,": ",(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)}),o&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:(n??r)(g.secondaryValue??0)})]},g.name))})]})};var uu=(e,t,a)=>{let o=new Set,r=[];return e.forEach(n=>{o.has(n)||(o.add(n),r.push({fieldId:n,label:a.get(n)?.label??n,zone:"rows"}));}),t.forEach(n=>{o.has(n)||(o.add(n),r.push({fieldId:n,label:a.get(n)?.label??n,zone:"columns"}));}),r},mu=(e,t,a)=>e.map(o=>{let r=t.get(o.fieldId),n=r?.label??o.fieldId;return {fieldId:o.fieldId,label:`${a(o.aggregation)} \xB7 ${n}`,item:o,field:r}}),gu=({rows:e,dimensionFieldId:t,primaryValue:a,secondaryValue:o})=>{if(!t)return [];let r=new Map;return e.forEach(n=>{let i=ta(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:zr(i,a.fieldId,a.aggregation),secondaryValue:o?zr(i,o.fieldId,o.aggregation):void 0}))};var fu=({rows:e,fieldMap:t,rowFields:a,columnFields:o,valueFields:r,chartDimensionFieldId:n,chartPrimaryValueFieldId:i,chartSecondaryValueFieldId:c,chartType:d,isCollapsed:l,onChartDimensionFieldIdChange:s,onChartPrimaryValueFieldIdChange:u,onChartSecondaryValueFieldIdChange:f,onChartTypeChange:m,onToggleCollapse:h,getAggregationLabel:I})=>{let{t:p}=q(),C=ut.useMemo(()=>uu(a,o,t),[o,t,a]),g=ut.useMemo(()=>mu(r,t,I),[t,I,r]),y=g.find(v=>v.fieldId===i)??g[0],x=g.find(v=>v.fieldId===c&&v.fieldId!==y?.fieldId)??null,k=C.find(v=>v.fieldId===n)??C[0],L=k&&y?p("pivot.chart.subtitleReady",{dimension:k.label,measure:x?`${y.label} / ${x.label}`:y.label}):p("pivot.chart.subtitle"),P=ut.useMemo(()=>!k||!y?[]:gu({rows:e,dimensionFieldId:k.fieldId,primaryValue:y.item,secondaryValue:x?.item}),[y,e,x,k]),S=v=>y?Fn(v,y.item,t):v.toLocaleString(),B=v=>x?Fn(v,x.item,t):v.toLocaleString(),T=C.length>1||g.length>1;return jsxRuntime.jsxs($r,{title:p("pivot.chart.title"),subtitle:L,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:[T&&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:k?.fieldId??"",onChange:v=>s(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:p("pivot.chart.primaryMeasure")}),jsxRuntime.jsx(material.Select,{value:y?.fieldId??"",onChange:v=>u(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:p("pivot.chart.secondaryMeasure")}),jsxRuntime.jsxs(material.Select,{value:x?.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:p("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:p("pivot.chart.chartType")}),jsxRuntime.jsxs(material.Select,{value:d,onChange:v=>m(v.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:k?y?P.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(cu,{data:P,primaryLabel:y.label,secondaryLabel:x?.label,formatPrimaryValue:S,formatSecondaryValue:B}):jsxRuntime.jsx(pu,{data:P,chartType:d,primaryLabel:y.label,secondaryLabel:x?.label,formatPrimaryValue:S,formatSecondaryValue:B}):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 us=({node:e,dataColumns:t,fieldMap:a,level:o,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:o*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(pf__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(_g__default.default,{sx:{fontSize:16}})}),!d&&!l&&o>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:u=>`1px solid ${u.palette.divider}`,whiteSpace:"nowrap"},children:Fn(i?i(e,s.id):e.aggregatedValues[s.id]??0,s.valueItem,a)},`${e.key}-${s.id}`))]}),c&&e.children.map(s=>jsxRuntime.jsx(us,{node:s,dataColumns:t,fieldMap:a,level:o+1,expandedKeys:r,onToggle:n,getValue:i},s.key))]})};var oc=(e,t,a)=>{let o=[...e,...t];return a&&o.includes(a)?a:o[0]??""},fs=(e,t)=>t&&e.some(a=>a.fieldId===t)?t:e[0]?.fieldId??"",ac=(e,t,a)=>a===""?"":a&&a!==t&&e.some(o=>o.fieldId===a)?a:e.find(o=>o.fieldId!==t)?.fieldId??"",ku=e=>{let t=new Set,a=o=>{o.forEach(r=>{r.children.length>0&&(t.add(r.key),a(r.children));});};return a(e),t},wu=(e,t,a=0)=>e.length===0?a:e.reduce((o,r)=>r.children.length===0||!t.has(r.key)?Math.max(o,a+1):Math.max(o,wu(r.children,t,a+1)),a),rv=(e,t)=>{let a=[],o=r=>{r.forEach(n=>{if(n.children.length>0&&t.has(n.key)){o(n.children);return}a.push(n);});};return o(e),a},vA=({title:e,rows:t,fields:a,initialLayout:o,initialChart:r,emptyText:n,maxPreviewHeight:i=520,initialChartCollapsed:c=false,initialTableCollapsed:d=false,model:l,enablePresetManagement:s=false,presets:u,defaultPresets:f,onPresetsChange:m,initialPresetId:h,onPresetApplied:I})=>{let{t:p}=q(),C=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),g=ut.useRef(0),y=ut.useRef(false),x=e??p("pivot.title.default"),k=n??p("pivot.empty"),L=ut.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]),P=ut.useCallback(b=>L[b]??Up[b],[L]),S=ut.useMemo(()=>new Set(a.map(b=>b.id)),[a]),B=ut.useMemo(()=>new Map(a.map(b=>[b.id,b])),[a]),[T,v]=ut.useState(()=>dt(o?.rows,S)),[M,w]=ut.useState(()=>dt(o?.columns,S)),[D,F]=ut.useState(()=>dt(o?.filters,S)),[$,V]=ut.useState(()=>{let b=o?.values??[],A=new Set,E=[];return b.forEach(W=>{if(!S.has(W.fieldId)||A.has(W.fieldId))return;A.add(W.fieldId),g.current+=1;let j=B.get(W.fieldId);E.push({tokenId:`v${g.current}`,fieldId:W.fieldId,aggregation:Dt(W.aggregation,j)});}),E}),[_,Y]=ut.useState({}),[ee,te]=ut.useState(true),[ae,Bt]=ut.useState(false),[lt,Ke]=ut.useState(()=>oc(dt(o?.rows,S),dt(o?.columns,S),r?.dimensionFieldId)),[ge,De]=ut.useState(()=>{let b=(o?.values??[]).filter((A,E,W)=>S.has(A.fieldId)&&W.findIndex(j=>j.fieldId===A.fieldId)===E).map(A=>({tokenId:A.fieldId,fieldId:A.fieldId,aggregation:Dt(A.aggregation,B.get(A.fieldId))}));return fs(b,r?.primaryValueFieldId)}),[Fe,Je]=ut.useState(()=>{let b=(o?.values??[]).filter((E,W,j)=>S.has(E.fieldId)&&j.findIndex(le=>le.fieldId===E.fieldId)===W).map(E=>({tokenId:E.fieldId,fieldId:E.fieldId,aggregation:Dt(E.aggregation,B.get(E.fieldId))})),A=fs(b,r?.primaryValueFieldId);return ac(b,A,r?.secondaryValueFieldId)}),[It,qe]=ut.useState(r?.chartType??"bar-vertical"),[rt,Wo]=ut.useState(c),[So,wo]=ut.useState(d),[Io,To]=ut.useState(()=>f??[]),[mt,H]=ut.useState(""),[de,ne]=ut.useState(false),[pe,Oe]=ut.useState(""),[Me,Qt]=ut.useState(null),[io,so]=ut.useState(new Set(["__grand_total__"])),[lo,co]=ut.useState(new Set),ke=l?.rowFields??T,ce=l?.columnFields??M,gt=l?.filterFields??D,Te=l?.valueFields??$,Tt=l?.filterSelections??_,po=l?.showGrandTotal??ee,Ma=l?.isConfiguratorCollapsed??ae,N=l?.chartDimensionFieldId??lt,O=l?.chartPrimaryValueFieldId??ge,G=l?.chartSecondaryValueFieldId??Fe,ue=l?.chartType??It,fe=l?.isChartCollapsed??rt,we=l?.isTableCollapsed??So,se=u??Io,Pe=s||se.length>0||!!m,ye=ut.useCallback(b=>{if(l?.setRowFields){l.setRowFields(b);return}v(b);},[l]),Re=ut.useCallback(b=>{if(l?.setColumnFields){l.setColumnFields(b);return}w(b);},[l]),Se=ut.useCallback(b=>{if(l?.setFilterFields){l.setFilterFields(b);return}F(b);},[l]),he=ut.useCallback(b=>{if(l?.setValueFields){l.setValueFields(b);return}V(b);},[l]),Ce=ut.useCallback(b=>{if(l?.setFilterSelections){l.setFilterSelections(b);return}Y(b);},[l]),je=ut.useCallback(b=>{if(l?.setShowGrandTotal){l.setShowGrandTotal(b);return}te(b);},[l]),Pt=ut.useCallback(b=>{if(l?.setIsConfiguratorCollapsed){l.setIsConfiguratorCollapsed(b);return}Bt(b);},[l]),uo=ut.useCallback(b=>{if(l?.setChartDimensionFieldId){l.setChartDimensionFieldId(b);return}Ke(b);},[l]),Ot=ut.useCallback(b=>{if(l?.setChartPrimaryValueFieldId){l.setChartPrimaryValueFieldId(b);return}De(b);},[l]),Yt=ut.useCallback(b=>{if(l?.setChartSecondaryValueFieldId){l.setChartSecondaryValueFieldId(b);return}Je(b);},[l]),Po=ut.useCallback(b=>{if(l?.setChartType){l.setChartType(b);return}qe(b);},[l]),Aa=ut.useCallback(b=>{if(l?.setIsChartCollapsed){l.setIsChartCollapsed(b);return}Wo(b);},[l]),la=ut.useCallback(b=>{if(l?.setIsTableCollapsed){l.setIsTableCollapsed(b);return}wo(b);},[l]),Ft=ut.useCallback(b=>{let A=typeof b=="function"?b(se):b;u||To(A),m?.(A);},[m,se,u]),$o=ut.useMemo(()=>new Set([...ke,...ce,...gt]),[ke,ce,gt]),Ba=ut.useMemo(()=>a.filter(b=>!$o.has(b.id)),[a,$o]),Et=ut.useMemo(()=>{let b=[...ke,...ce,...gt],A=new Set,E=[];return b.forEach(W=>{A.has(W)||(A.add(W),E.push(W));}),E},[ce,gt,ke]);ut.useEffect(()=>{ye(b=>{let A=b.filter(E=>S.has(E));return oa(b,A)?b:A}),Re(b=>{let A=b.filter(E=>S.has(E));return oa(b,A)?b:A}),Se(b=>{let A=b.filter(E=>S.has(E));return oa(b,A)?b:A}),he(b=>{let A=b.filter(E=>S.has(E.fieldId)).map(E=>({...E,aggregation:Dt(E.aggregation,B.get(E.fieldId))}));return ts(b,A)?b:A});},[B,S]);let Wt=ut.useMemo(()=>{let b={};return Et.forEach(A=>{let E=new Set;t.forEach(W=>{E.add(ta(W[A]));}),b[A]=Array.from(E).sort((W,j)=>W.localeCompare(j));}),b},[Et,t]);ut.useEffect(()=>{Ce(b=>{let A={};return Et.forEach(E=>{let W=Wt[E]??[],le=(b[E]??[]).filter(K=>W.includes(K)),z=Object.prototype.hasOwnProperty.call(b,E);A[E]=z?le:W;}),Xp(b,A)?b:A});},[Et,Wt]),ut.useEffect(()=>{uo(b=>oc(ke,ce,b));},[ce,ke,uo]),ut.useEffect(()=>{Ot(b=>fs(Te,b));},[Ot,Te]),ut.useEffect(()=>{Yt(b=>ac(Te,O,b));},[O,Yt,Te]);let Rt=ut.useMemo(()=>t.filter(b=>Et.every(A=>{let E=Tt[A]??[],W=Wt[A]??[];if(E.length===W.length)return true;if(E.length===0)return false;let j=ta(b[A]);return E.includes(j)})),[Et,Wt,Tt,t]),Ie=ut.useMemo(()=>{if(Te.length===0)return null;let b=new Map;if(Rt.forEach(z=>{let K=ce.length>0?ce.map(Z=>ta(z[Z])):[p("pivot.valueLabel")],R=ar(K);b.set(R,K);}),b.size===0){let z=ce.length>0?ce.map(()=>Ji):[p("pivot.valueLabel")];b.set(ar(z),z);}let A=Array.from(b.entries()).sort((z,K)=>jp(z[1],K[1])),E=A.flatMap(([z,K])=>Te.map(R=>{let Z=B.get(R.fieldId),ie=`${P(R.aggregation)} ${Z?.label??R.fieldId}`,$e=ce.length===0||Te.length>1?`${K.join(" / ")} \u2022 ${ie}`:K.join(" / ");return {id:`${z}::${R.tokenId}`,colKey:z,valueItem:R,label:$e}})),W=[];ce.length>0&&A.forEach(([z,K])=>{let R=E.filter($e=>$e.colKey===z),Z=W,ie=[];K.forEach(($e,U)=>{ie.push(`d${U}:${$e}`);let oe=`col::${ar(ie)}`,We=Z.find(Zn=>Zn.key===oe);We||(We={key:oe,label:$e,children:[],leafColumnIds:[],path:K.slice(0,U+1),depth:U},Z.push(We)),R.forEach(Zn=>{We.leafColumnIds.includes(Zn.id)||We.leafColumnIds.push(Zn.id);}),Z=We.children;});});let j=z=>{let K={};return E.forEach(R=>{let Z=z.filter(ie=>{let $e=ce.length>0?ce.map(U=>ta(ie[U])):[p("pivot.valueLabel")];return ar($e)===R.colKey});K[R.id]=zr(Z,R.valueItem.fieldId,R.valueItem.aggregation);}),K},le=[];if(ke.length===0)le.push({key:"root",value:p("pivot.resultLabel")||Hp,children:[],isLeaf:true,aggregatedValues:j(Rt),path:[],depth:0});else {let z=(K,R,Z)=>{if(R>=ke.length)return [];let ie=ke[R],$e=new Map;return K.forEach(U=>{let oe=ta(U[ie]);$e.has(oe)||$e.set(oe,[]),$e.get(oe).push(U);}),Array.from($e.keys()).sort().map(U=>{let oe=$e.get(U),We=[...Z,U];return {key:ar(We),value:U,fieldId:ie,aggregatedValues:j(oe),children:z(oe,R+1,We),isLeaf:R===ke.length-1,path:We,depth:R}})};le.push(...z(Rt,0,[]));}return {dataColumns:E,columnTree:W,rowTree:le}},[ce,B,Rt,P,ke,p,Te]),Jt=ut.useCallback((b,A)=>(g.current+=1,{tokenId:`v${g.current}`,fieldId:b,aggregation:Dt(A,B.get(b))}),[B]),Fa=ut.useCallback(b=>{if(b==="rows")return ye([]);if(b==="columns")return Re([]);if(b==="filters")return Se([]);he([]);},[]),Ea=ut.useCallback((b,A)=>{if(b==="rows")return ye(E=>E.filter(W=>W!==A));if(b==="columns")return Re(E=>E.filter(W=>W!==A));if(b==="filters")return Se(E=>E.filter(W=>W!==A));he(E=>E.filter(W=>W.tokenId!==A));},[]),La=ut.useCallback((b,A)=>{he(E=>E.map(W=>W.tokenId===b?{...W,aggregation:Dt(A,B.get(W.fieldId))}:W));},[B]),Ho=ut.useCallback(b=>{Qt(String(b.active.id));},[]),Ro=ut.useCallback(b=>{if(Qt(null),!b.over)return;let A=es(String(b.active.id)),E=es(String(b.over.id));if(!A||!E||A.kind!=="item"||!A.key)return;if(A.zone===E.zone&&E.kind==="item"){if(A.zone==="rows"){let U=ke.indexOf(A.key),oe=ke.indexOf(E.key??"");U!==-1&&oe!==-1&&U!==oe&&ye(We=>sortable.arrayMove(We,U,oe));return}if(A.zone==="columns"){let U=ce.indexOf(A.key),oe=ce.indexOf(E.key??"");U!==-1&&oe!==-1&&U!==oe&&Re(We=>sortable.arrayMove(We,U,oe));return}if(A.zone==="filters"){let U=gt.indexOf(A.key),oe=gt.indexOf(E.key??"");U!==-1&&oe!==-1&&U!==oe&&Se(We=>sortable.arrayMove(We,U,oe));return}if(A.zone==="values"){let U=Te.findIndex(We=>We.tokenId===A.key),oe=Te.findIndex(We=>We.tokenId===(E.key??""));U!==-1&&oe!==-1&&U!==oe&&he(We=>sortable.arrayMove(We,U,oe));}return}let W=E.zone,j=[...ke],le=[...ce],z=[...gt],K=[...Te],R="",Z=null;if(A.zone==="palette")R=A.key;else if(A.zone==="values"){let U=K.find(oe=>oe.tokenId===A.key);if(!U)return;R=U.fieldId,Z=U,K=K.filter(oe=>oe.tokenId!==A.key);}else A.zone==="rows"?(R=A.key,j=j.filter(U=>U!==R)):A.zone==="columns"?(R=A.key,le=le.filter(U=>U!==R)):A.zone==="filters"&&(R=A.key,z=z.filter(U=>U!==R));if(!R)return;let ie=()=>{j=j.filter(U=>U!==R),le=le.filter(U=>U!==R),z=z.filter(U=>U!==R);},$e=U=>{if(E.kind!=="item"||!E.key)return U==="rows"?j.length:U==="columns"?le.length:U==="filters"?z.length:U==="values"?K.length:0;if(U==="rows"){let oe=j.indexOf(E.key);return oe>=0?oe:j.length}if(U==="columns"){let oe=le.indexOf(E.key);return oe>=0?oe:le.length}if(U==="filters"){let oe=z.indexOf(E.key);return oe>=0?oe:z.length}if(U==="values"){let oe=K.findIndex(We=>We.tokenId===E.key);return oe>=0?oe:K.length}return 0};if(W==="palette"){ye(j),Re(le),Se(z),he(K);return}if(W==="values"){let U=$e("values"),oe=Z??Jt(R);K.splice(U,0,oe),ye(j),Re(le),Se(z),he(K);return}if(Zp(W)){ie();let U=$e(W);W==="rows"?j.splice(U,0,R):W==="columns"?le.splice(U,0,R):z.splice(U,0,R),ye(j),Re(le),Se(z),he(K);}},[ce,Jt,gt,ke,Te]),Do=ut.useCallback((b,A)=>{Ce(E=>({...E,[b]:A}));},[]),za=ut.useCallback(b=>{so(A=>{let E=new Set(A);return E.has(b)?E.delete(b):E.add(b),E});},[]),Na=ut.useCallback(b=>{co(A=>{let E=new Set(A);return E.has(b)?E.delete(b):E.add(b),E});},[]),ca=ut.useCallback(b=>{let A=B.get(b.fieldId),E=Gl(A);return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:98},children:jsxRuntime.jsx(material.Select,{value:b.aggregation,onChange:W=>La(b.tokenId,W.target.value),onClick:W=>W.stopPropagation(),onMouseDown:W=>W.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:E.map(W=>jsxRuntime.jsx(material.MenuItem,{value:W,sx:{fontSize:"0.75rem"},children:P(W)},W))})})},[B,P,La]),Lt=ut.useCallback(b=>{let A=Wt[b]??[],E=Tt[b]??A;return A.length===0?p("pivot.filter.noValues"):E.length===0?p("pivot.filter.noneSelected"):E.length===A.length?p("pivot.filter.allValues"):p("pivot.filter.selectedCount",{selected:E.length,total:A.length})},[Wt,Tt,p]),zt=ut.useCallback(b=>{let A=Wt[b]??[],E=Tt[b]??A;return jsxRuntime.jsx(Jp,{options:A,selectedValues:E,onChange:W=>Do(b,W)})},[Wt,Tt,Do]),Mo=ut.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),Go=ut.useCallback(()=>{let b={};return new Set([...Et,...Object.keys(Tt)]).forEach(E=>{if(!S.has(E))return;let W=Tt[E]??[];b[E]=[...W];}),{layout:{rows:[...ke],columns:[...ce],filters:[...gt],values:Te.map(E=>({fieldId:E.fieldId,aggregation:E.aggregation}))},filterSelections:b,showGrandTotal:po,chart:{dimensionFieldId:N,primaryValueFieldId:O,secondaryValueFieldId:G,chartType:ue}}},[Et,N,O,G,ue,ce,gt,Tt,ke,po,S,Te]),Uo=ut.useCallback(b=>{let A=dt(b.layout.rows,S),E=dt(b.layout.columns,S),W=dt(b.layout.filters,S),j=new Set,le=(b.layout.values??[]).filter(R=>!S.has(R.fieldId)||j.has(R.fieldId)?false:(j.add(R.fieldId),true)).map(R=>Jt(R.fieldId,R.aggregation)),z={};Object.entries(b.filterSelections??{}).forEach(([R,Z])=>{!S.has(R)||!Array.isArray(Z)||(z[R]=Array.from(new Set(Z.map(ie=>String(ie)))));}),ye(A),Re(E),Se(W),he(le),Ce(z),typeof b.showGrandTotal=="boolean"&&je(b.showGrandTotal),uo(oc(A,E,b.chart?.dimensionFieldId));let K=fs(le,b.chart?.primaryValueFieldId);Ot(K),Yt(ac(le,K,b.chart?.secondaryValueFieldId)),Po(b.chart?.chartType??"bar-vertical"),H(b.id),I?.(b);},[Jt,I,uo,Ot,Yt,Po,Re,Se,Ce,ye,je,he,S]),Va=ut.useCallback(b=>{if(!b){H("");return}let A=se.find(E=>E.id===b);if(!A){H("");return}Uo(A);},[Uo,se]),Oa=ut.useCallback(()=>{let b=p("pivot.preset.defaultName",{index:se.length+1});Oe(b),ne(true);},[se.length,p]),da=ut.useCallback(()=>{let b=pe.trim();if(!b)return;let A={id:Mo(),name:b,...Go()};Ft(E=>[...E,A]),H(A.id),ne(false);},[Go,Mo,pe,Ft]),pa=ut.useCallback(()=>{mt&&(Ft(b=>b.filter(A=>A.id!==mt)),H(""));},[mt,Ft]);ut.useEffect(()=>{if(!h||y.current)return;let b=se.find(A=>A.id===h);b&&(y.current=true,Uo(b));},[Uo,h,se]),ut.useEffect(()=>{mt&&(se.some(b=>b.id===mt)||H(""));},[mt,se]);let Ko=ut.useMemo(()=>{if(!po||!Ie||!ke.length)return null;let b={};return Ie.dataColumns.forEach(A=>{let E=Rt.filter(W=>{let j=ce.length>0?ce.map(le=>ta(W[le])):[p("pivot.valueLabel")];return ar(j)===A.colKey});b[A.id]=zr(E,A.valueItem.fieldId,A.valueItem.aggregation);}),{key:"__grand_total__",value:p("pivot.grandTotal")||Gp,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:b,path:[],depth:-1}},[po,Ie,Rt,ce,ke.length,p]),eo=ut.useMemo(()=>ku(Ie?.rowTree??[]),[Ie]),Ao=ut.useMemo(()=>ku(Ie?.columnTree??[]),[Ie]);ut.useEffect(()=>{so(b=>{let A=new Set;return b.has("__grand_total__")&&A.add("__grand_total__"),eo.forEach(E=>{b.has(E)&&A.add(E);}),A});},[eo]),ut.useEffect(()=>{co(b=>{let A=new Set;return Ao.forEach(E=>{b.has(E)&&A.add(E);}),A});},[Ao]);let mr=ut.useCallback(()=>{so(b=>{let A=new Set(b);return eo.forEach(E=>A.add(E)),A});},[eo]),Wa=ut.useCallback(()=>{so(b=>{let A=new Set;return b.has("__grand_total__")&&A.add("__grand_total__"),A});},[]),gr=ut.useCallback(()=>{co(new Set(Ao));},[Ao]),fr=ut.useCallback(()=>{co(new Set);},[]),hr=ut.useMemo(()=>!Ie||ce.length===0?[]:rv(Ie.columnTree,lo),[ce.length,lo,Ie]),$t=ut.useMemo(()=>{if(!Ie)return [];if(ce.length===0)return Ie.dataColumns.map(A=>({id:A.id,label:A.label,leafColumnIds:[A.id],valueItem:A.valueItem}));let b=new Map(Ie.dataColumns.map(A=>[A.id,A]));return hr.flatMap(A=>{let E=new Map;return A.leafColumnIds.forEach(W=>{let j=b.get(W);if(!j)return;let le=j.valueItem.tokenId,z=`${P(j.valueItem.aggregation)} ${B.get(j.valueItem.fieldId)?.label??j.valueItem.fieldId}`,K=E.get(le);if(K){K.leafColumnIds.push(W);return}E.set(le,{id:`${A.key}::${le}`,label:Te.length>1?z:A.label,leafColumnIds:[W],valueItem:j.valueItem});}),Array.from(E.values())})},[ce.length,B,P,Ie,Te.length,hr]),yr=ut.useMemo(()=>new Map($t.map(b=>[b.id,b])),[$t]),qo=ut.useMemo(()=>$t.map(b=>({id:b.id,colKey:b.id,valueItem:b.valueItem,label:b.label})),[$t]),Bo=ut.useMemo(()=>{if(!Ie||ce.length===0)return [];let b=[],A=wu(Ie.columnTree,lo),E=A+(Te.length>1?1:0),W=(j,le)=>{b[le]??(b[le]=[]),j.forEach(z=>{let K=z.children.length>0&&lo.has(z.key),R=$t.filter(ie=>z.leafColumnIds.some($e=>ie.leafColumnIds.includes($e))).length,Z=K||Te.length>1?1:E-le;b[le].push({key:z.key,label:z.label,colSpan:R,rowSpan:Z,expandable:z.children.length>0,expanded:K}),K&&W(z.children,le+1);});};return W(Ie.columnTree,0),Te.length>1&&(b[A]=$t.map(j=>({key:j.id,label:j.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),b},[ce.length,lo,Ie,Te.length,$t]),br=ut.useCallback((b,A)=>A.leafColumnIds.reduce((E,W)=>E+(b.aggregatedValues[W]??0),0),[]),$a=ut.useMemo(()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:mr,disabled:eo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.expandRowsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Wa,disabled:eo.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:gr,disabled:Ao.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.expandColumnsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:fr,disabled:ce.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.collapseColumnsAll")})]}),[ce.length,Ao.size,eo.size,fr,Wa,gr,mr,p]),ua=()=>{if(!Me)return null;let b=es(Me);if(!b||b.kind!=="item"||!b.key)return null;if(b.zone==="palette"){let j=B.get(b.key);return j?jsxRuntime.jsx(Kl,{label:j.label,subtitle:j.type}):null}if(b.zone==="values"){let j=Te.find(R=>R.tokenId===b.key);if(!j)return null;let z=B.get(j.fieldId)?.label??j.fieldId,K=`${P(j.aggregation)}(${z})`;return jsxRuntime.jsx(is,{label:z,caption:K})}let E=B.get(b.key)?.label??b.key,W=Lt(b.key);return jsxRuntime.jsx(is,{label:E,caption:W})};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:mt,displayEmpty:true,onChange:b=>Va(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")}),se.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:Oa,"aria-label":p("pivot.preset.save"),children:jsxRuntime.jsx(qd__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:pa,disabled:!mt,"aria-label":p("pivot.preset.delete"),children:jsxRuntime.jsx(j0__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:Rt.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:po,onChange:b=>je(b.target.checked)})]})]})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(core.DndContext,{sensors:C,collisionDetection:core.closestCenter,onDragStart:Ho,onDragEnd:Ro,children:[jsxRuntime.jsx(su,{isConfiguratorCollapsed:Ma,onToggleCollapse:()=>Pt(b=>!b),availableFields:Ba,fieldMap:B,filterFields:gt,columnFields:ce,rowFields:ke,valueFields:Te,clearZone:Fa,removeFieldFromZone:Ea,getFilterSelectionSummary:Lt,renderDimensionFilterSelect:zt,renderAggregationSelect:ca,getAggregationLabel:P}),jsxRuntime.jsx(material.Portal,{children:jsxRuntime.jsx(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:ua()})})]}),jsxRuntime.jsx(fu,{rows:Rt,fieldMap:B,rowFields:ke,columnFields:ce,valueFields:Te,chartDimensionFieldId:N,chartPrimaryValueFieldId:O,chartSecondaryValueFieldId:G,chartType:ue,isCollapsed:fe,onChartDimensionFieldIdChange:b=>uo(b),onChartPrimaryValueFieldIdChange:b=>Ot(b),onChartSecondaryValueFieldIdChange:b=>Yt(b),onChartTypeChange:b=>Po(b),onToggleCollapse:()=>Aa(b=>!b),getAggregationLabel:P}),jsxRuntime.jsx($r,{title:p("pivot.table.sectionTitle"),subtitle:ke.length>0?ke.map(b=>B.get(b)?.label??b).join(" > "):p("pivot.table.dimensions"),collapsed:we,onToggleCollapse:()=>la(b=>!b),expandAriaLabel:p("pivot.table.collapse.ariaExpand"),collapseAriaLabel:p("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:$a,children:Ie===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:k})}):jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:i},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:(Bo.length>0?Bo:[[]]).map((b,A)=>jsxRuntime.jsxs(material.TableRow,{children:[A===0&&jsxRuntime.jsx(material.TableCell,{rowSpan:Math.max(Bo.length,1),sx:E=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:E.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${E.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:ke.length>0?ke.map(E=>B.get(E)?.label).join(" > "):p("pivot.table.dimensions")}),(b.length>0?b:$t.map(E=>({key:E.id,label:E.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(E=>jsxRuntime.jsx(material.TableCell,{align:"center",colSpan:E.colSpan,rowSpan:E.rowSpan,sx:W=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:W.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${W.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:jsxRuntime.jsxs(material.Box,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[E.expandable&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>Na(E.key),sx:{p:.1,ml:-0.3},children:E.expanded?jsxRuntime.jsx(pf__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(_g__default.default,{sx:{fontSize:16}})}),jsxRuntime.jsx(material.Box,{component:"span",children:E.label})]})},E.key))]},`pivot-header-row-${A}`))}),jsxRuntime.jsxs(material.TableBody,{children:[Ie.rowTree.map(b=>jsxRuntime.jsx(us,{node:b,dataColumns:qo,fieldMap:B,level:0,expandedKeys:io,onToggle:za,getValue:(A,E)=>{let W=yr.get(E);return W?br(A,W):0}},b.key)),Ko&&jsxRuntime.jsx(us,{node:Ko,dataColumns:qo,fieldMap:B,level:0,expandedKeys:io,onToggle:za,getValue:(b,A)=>{let E=yr.get(A);return E?br(b,E):0}})]})]})})}),jsxRuntime.jsxs(material.Dialog,{open:de,onClose:()=>ne(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:pe,onChange:b=>Oe(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),da());}})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>ne(false),children:p("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:da,disabled:!pe.trim(),children:p("common.save")})]})]})]})};var Iu=(e,t,a)=>{let o=[...e,...t];return a&&o.includes(a)?a:o[0]??""},nc=(e,t)=>t&&e.some(a=>a.fieldId===t)?t:e[0]?.fieldId??"",Tu=(e,t,a)=>a===""?"":a&&a!==t&&e.some(o=>o.fieldId===a)?a:e.find(o=>o.fieldId!==t)?.fieldId??"",IA=({fields:e,initialLayout:t,initialFilterSelections:a={},initialShowGrandTotal:o=true,initialConfiguratorCollapsed:r=false,initialChart:n,initialChartCollapsed:i=false,initialTableCollapsed:c=false})=>{let d=ut.useRef(0),l=ut.useMemo(()=>new Set(e.map(H=>H.id)),[e]),s=ut.useMemo(()=>new Map(e.map(H=>[H.id,H])),[e]),[u,f]=ut.useState(()=>dt(t?.rows,l)),[m,h]=ut.useState(()=>dt(t?.columns,l)),[I,p]=ut.useState(()=>dt(t?.filters,l)),[C,g]=ut.useState(()=>{let H=t?.values??[],de=new Set,ne=[];return H.forEach(pe=>{!l.has(pe.fieldId)||de.has(pe.fieldId)||(de.add(pe.fieldId),d.current+=1,ne.push({tokenId:`v${d.current}`,fieldId:pe.fieldId,aggregation:Dt(pe.aggregation,s.get(pe.fieldId))}));}),ne}),[y,x]=ut.useState(a),[k,L]=ut.useState(o),[P,S]=ut.useState(r),[B,T]=ut.useState(()=>Iu(dt(t?.rows,l),dt(t?.columns,l),n?.dimensionFieldId)),[v,M]=ut.useState(()=>{let H=(()=>{let de=t?.values??[],ne=new Set,pe=[];return de.forEach(Oe=>{!l.has(Oe.fieldId)||ne.has(Oe.fieldId)||(ne.add(Oe.fieldId),pe.push({tokenId:Oe.fieldId,fieldId:Oe.fieldId,aggregation:Dt(Oe.aggregation,s.get(Oe.fieldId))}));}),pe})();return nc(H,n?.primaryValueFieldId)}),[w,D]=ut.useState(()=>{let H=(()=>{let ne=t?.values??[],pe=new Set,Oe=[];return ne.forEach(Me=>{!l.has(Me.fieldId)||pe.has(Me.fieldId)||(pe.add(Me.fieldId),Oe.push({tokenId:Me.fieldId,fieldId:Me.fieldId,aggregation:Dt(Me.aggregation,s.get(Me.fieldId))}));}),Oe})(),de=nc(H,n?.primaryValueFieldId);return Tu(H,de,n?.secondaryValueFieldId)}),[F,$]=ut.useState(n?.chartType??"bar-vertical"),[V,_]=ut.useState(i),[Y,ee]=ut.useState(c);ut.useEffect(()=>{f(H=>{let de=H.filter(ne=>l.has(ne));return oa(H,de)?H:de}),h(H=>{let de=H.filter(ne=>l.has(ne));return oa(H,de)?H:de}),p(H=>{let de=H.filter(ne=>l.has(ne));return oa(H,de)?H:de}),g(H=>{let de=H.filter(ne=>l.has(ne.fieldId)).map(ne=>({...ne,aggregation:Dt(ne.aggregation,s.get(ne.fieldId))}));return ts(H,de)?H:de});},[s,l]),ut.useEffect(()=>{T(H=>Iu(u,m,H));},[m,u]),ut.useEffect(()=>{M(H=>nc(C,H));},[C]),ut.useEffect(()=>{D(H=>Tu(C,v,H));},[v,C]);let te=ut.useCallback(H=>{f(dt(H,l));},[l]),ae=ut.useCallback(H=>{h(dt(H,l));},[l]),Bt=ut.useCallback(H=>{p(dt(H,l));},[l]),lt=ut.useCallback(H=>{g(de=>{let ne=H??[],pe=new Set,Oe=[];return ne.forEach(Me=>{if(!l.has(Me.fieldId)||pe.has(Me.fieldId))return;pe.add(Me.fieldId);let Qt=de.find(io=>io.fieldId===Me.fieldId);if(Qt){Oe.push({...Qt,aggregation:Dt(Me.aggregation??Qt.aggregation,s.get(Me.fieldId))});return}d.current+=1,Oe.push({tokenId:`v${d.current}`,fieldId:Me.fieldId,aggregation:Dt(Me.aggregation,s.get(Me.fieldId))});}),Oe});},[s,l]),Ke=ut.useCallback(H=>{te(H.rows??[]),ae(H.columns??[]),Bt(H.filters??[]),lt(H.values??[]);},[ae,Bt,te,lt]),ge=ut.useCallback(H=>{if(H==="rows")return f([]);if(H==="columns")return h([]);if(H==="filters")return p([]);g([]);},[]),De=ut.useCallback((H,de)=>{if(H==="rows")return f(ne=>ne.filter(pe=>pe!==de));if(H==="columns")return h(ne=>ne.filter(pe=>pe!==de));if(H==="filters")return p(ne=>ne.filter(pe=>pe!==de));g(ne=>ne.filter(pe=>pe.tokenId!==de));},[]),Fe=ut.useCallback((H,de)=>{g(ne=>ne.map(pe=>pe.tokenId===H?{...pe,aggregation:Dt(de,s.get(pe.fieldId))}:pe));},[s]),Je=ut.useCallback((H,de)=>{x(ne=>({...ne,[H]:de}));},[]),It=ut.useCallback(()=>{x({});},[]),qe=ut.useCallback(()=>{L(H=>!H);},[]),rt=ut.useCallback(()=>{S(H=>!H);},[]),Wo=ut.useCallback(H=>{T(H);},[]),So=ut.useCallback(H=>{M(H);},[]),wo=ut.useCallback(H=>{D(H);},[]),Io=ut.useCallback(()=>{_(H=>!H);},[]),To=ut.useCallback(()=>{ee(H=>!H);},[]);return {model:ut.useMemo(()=>({rowFields:u,setRowFields:f,columnFields:m,setColumnFields:h,filterFields:I,setFilterFields:p,valueFields:C,setValueFields:g,filterSelections:y,setFilterSelections:x,showGrandTotal:k,setShowGrandTotal:L,isConfiguratorCollapsed:P,setIsConfiguratorCollapsed:S,chartDimensionFieldId:B,setChartDimensionFieldId:T,chartPrimaryValueFieldId:v,setChartPrimaryValueFieldId:M,chartSecondaryValueFieldId:w,setChartSecondaryValueFieldId:D,chartType:F,setChartType:$,isChartCollapsed:V,setIsChartCollapsed:_,isTableCollapsed:Y,setIsTableCollapsed:ee}),[B,v,w,F,m,I,y,V,P,Y,u,k,C]),actions:{setRows:te,setColumns:ae,setFilters:Bt,setValues:lt,setLayout:Ke,clearZone:ge,removeFieldFromZone:De,setAggregationForValue:Fe,setFilterSelection:Je,resetFilterSelections:It,toggleGrandTotal:qe,toggleConfigurator:rt,setChartDimension:Wo,setChartPrimaryValue:So,setChartSecondaryValue:wo,setChartType:$,toggleChart:Io,toggleTable:To}}};var MA=({orientation:e="auto",defaultNavigationOpen:t,onNavOpenChange:a}={})=>{let o=styles.useTheme(),r=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),n=material.useMediaQuery(o.breakpoints.down("md"),{noSsr:true}),i=ut.useMemo(()=>e==="auto"?r||n?"portrait":"landscape":e,[n,r,e]),[c,d]=ut.useState(t??i==="landscape");ut.useEffect(()=>{d(t??i==="landscape");},[t,i]);let l=u=>{d(u),a?.(u);};return {resolvedOrientation:i,isPortraitViewport:r,isCompactViewport:n,navigationOpen:c,setNavigationOpen:l,toggleNavigationOpen:()=>l(!c)}};var pv=e=>{let t=Number(e||0);return Number.isFinite(t)?t:0},FA=({rows:e,rowKey:t="id",numericField:a,defaultSelectedId:o})=>{let n=e[0]?.[t],[i,c]=ut.useState(o??n),d=ut.useMemo(()=>e.find(m=>m[t]===i)||e[0],[t,e,i]),[l,s]=ut.useState(()=>{let m=d?.[a];return m==null?"0":String(m)});return {selectedId:i,selectedRecord:d,editorValue:l,setEditorValue:s,selectRecord:m=>{let h=m[t];c(h);let I=m[a];s(I==null?"0":String(I));},applyEditorValue:m=>{if(i===void 0)return;let h=pv(l),I=e.map(p=>p[t]===i?{...p,[a]:h}:p);m(I);}}};var kv=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],Bu=(e,t,a,o)=>{t?.(e),o&&a?.();},OA=({open:e,onClose:t,title:a="Scan barcode",subtitle:o="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:r=kv,facingMode:n="environment",manualEntry:i=true,autoCloseOnDetect:c=true,scanIntervalMs:d=600,confirmLabel:l="Use code",cancelLabel:s="Close",manualPlaceholder:u="Enter barcode manually",onDetected:f,onError:m,sx:h})=>{let I=ut__namespace.default.useRef(null),p=ut__namespace.default.useRef(null),C=ut__namespace.default.useRef(null),g=ut__namespace.default.useRef(null),[y,x]=ut__namespace.default.useState("idle"),[k,L]=ut__namespace.default.useState(""),[P,S]=ut__namespace.default.useState(null),[B,T]=ut__namespace.default.useState(null),v=ut__namespace.default.useCallback(()=>{C.current!==null&&(window.clearInterval(C.current),C.current=null),p.current&&(p.current.getTracks().forEach(D=>D.stop()),p.current=null),I.current&&(I.current.srcObject=null);},[]),M=ut__namespace.default.useCallback(D=>{T(D),x("error"),m?.(D);},[m]);ut__namespace.default.useEffect(()=>{if(!e){v(),x("idle"),T(null),L("");return}let D=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){x("unsupported"),T("Camera access is not supported in this browser.");return}x("starting"),T(null);try{let $=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:n}}});if(D){$.getTracks().forEach(V=>V.stop());return}if(p.current=$,I.current&&(I.current.srcObject=$,await I.current.play()),!window.BarcodeDetector){x("unsupported"),T("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}g.current=new window.BarcodeDetector({formats:r}),x("ready"),C.current=window.setInterval(async()=>{if(!(!I.current||!g.current)&&!(I.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let _=(await g.current.detect(I.current)).find(ee=>ee.rawValue);if(!_?.rawValue)return;let Y={rawValue:_.rawValue,format:_.format};S(Y),v(),Bu(Y,f,t,c);}catch(V){M(V instanceof Error?V.message:"Failed to detect barcode.");}},d);}catch($){M($ instanceof Error?$.message:"Unable to start camera.");}}})(),()=>{D=true,v();}},[c,n,r,t,f,e,M,d,v]);let w=()=>{let D=k.trim();if(!D)return;let F={rawValue:D,format:"manual"};S(F),Bu(F,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:a}),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:o}),jsxRuntime.jsxs(material.Paper,{elevation:0,sx:D=>({position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:D.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:I,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(vv__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"}),P?jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(Cv__default.default,{}),label:`${P.format||"barcode"}: ${P.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),B?jsxRuntime.jsx(material.Alert,{severity:y==="unsupported"?"info":"warning",children:B}):null,i?jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[jsxRuntime.jsx(material.TextField,{fullWidth:true,label:"Barcode",placeholder:u,value:k,onChange:D=>L(D.target.value)}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:w,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 Tv={default:"#475569",primary:"#1d4ed8",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#0369a1"},KA=({title:e,description:t,kicker:a,icon:o,badges:r=[],metrics:n=[],footer:i,children:c,selected:d=false,draggable:l=false,isDragging:s=false,swipeThreshold:u=88,startAction:f,endAction:m,dragHandleProps:h,onClick:I,onSwipe:p,sx:C})=>{let[g,y]=ut.useState(0),[x,k]=ut.useState(false),L=ut.useRef(null),P=ut.useRef(0),S=ut.useRef(0),B=!!(f||m),T=132,v=()=>{y(0),k(false),L.current=null,P.current=0,S.current=0;},M=V=>{(V==="start"?f:m)?.onTrigger?.(),p?.(V),v();},w=V=>{!B||V.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(L.current=V.pointerId,P.current=V.clientX,S.current=V.clientX,k(true),V.currentTarget.setPointerCapture(V.pointerId));},D=V=>{if(!x||L.current!==V.pointerId)return;S.current=V.clientX;let _=S.current-P.current,Y=Math.max(-T,Math.min(T,_));y(Y);},F=V=>{if(!x||L.current!==V.pointerId)return;let _=S.current-P.current;if(_>=u&&f){M("start");return}if(_<=-u&&m){M("end");return}Math.abs(_)<12&&I?.(),v();},$=(V,_)=>{if(!V)return null;let Y=V.backgroundColor||Tv[V.tone||"default"];return jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:0,bottom:0,[_]:0,width:T,px:2,display:"flex",alignItems:"center",justifyContent:_==="left"?"flex-start":"flex-end",color:"#fff",background:`linear-gradient(135deg, ${Y}, 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:[$(f,"left"),$(m,"right"),jsxRuntime.jsx(material.Paper,{elevation:0,onPointerDown:w,onPointerMove:D,onPointerUp:F,onPointerCancel:v,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(17,24,39,0.96), rgba(15,23,42,0.92))":"linear-gradient(180deg, #ffffff, #f8fafc)",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(${s?.985:1})`,transition:x?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:I?"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:[o?jsxRuntime.jsx(material.Box,{sx:{mt:.25},children:o}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[a?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:a}):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(Iv__default.default,{})})}):null]}),r.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:r.map((V,_)=>jsxRuntime.jsx(material.Chip,{label:V,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover"}},_))}):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"},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 Gn=({label:e,onPress:t,emphasis:a="default"})=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:t,sx:o=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:a==="primary"?"primary.main":"divider",background:a==="primary"?o.palette.primary.main:a==="danger"?o.palette.mode==="dark"?"rgba(239,68,68,0.18)":"rgba(239,68,68,0.10)":o.palette.mode==="dark"?"rgba(255,255,255,0.04)":"#fff",color:a==="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}),eB=({value:e,defaultValue:t="",title:a,subtitle:o,placeholder:r="0",allowDecimal:n=false,allowNegative:i=false,maxLength:c,confirmLabel:d,clearLabel:l,backspaceLabel:s,onChange:u,onSubmit:f,onClose:m,sx:h})=>{let{t:I}=q(),[p,C]=ut.useState(t),g=e??p,y=v=>{e===void 0&&C(v),u?.(v);},x=v=>{c&&g.length>=c||y(`${g}${v}`);},k=v=>{if(v==="00"){if(!g){y("0");return}x("00");return}x(v);},L=()=>{!n||g.includes(".")||y(g?`${g}.`:"0.");},P=()=>{if(i){if(g.startsWith("-")){y(g.slice(1));return}y(g?`-${g}`:"-");}},S=()=>{y(g.slice(0,-1));},B=()=>{y("");},T=()=>{f?.(g);};return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",background:"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:[a?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800},children:a}):null,o?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:o}):null]}),m?jsxRuntime.jsx(material.IconButton,{onClick:m,size:"small",children:jsxRuntime.jsx(Mv__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(Gn,{label:v,onPress:()=>k(v)},v)),jsxRuntime.jsx(Gn,{label:i?"+/-":"00",onPress:i?P:()=>k("00")}),jsxRuntime.jsx(Gn,{label:"0",onPress:()=>k("0")}),jsxRuntime.jsx(Gn,{label:n?".":s?String(s):"DEL",onPress:n?L:S})]}),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:S,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",background:"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(Dv__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700},children:s||"DEL"})]})}),jsxRuntime.jsx(Gn,{label:String(l||"CLR"),onPress:B,emphasis:"danger"}),jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:T,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(Av__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:800},children:d||I("common.ok")})]})})]})]})})};var Nu=({touchMode:e="comfortable",sx:t,...a})=>{let o=e==="expanded";return jsxRuntime.jsx(material.Box,{sx:{"& .MuiPaper-root":{borderRadius:4},"& .MuiAutocomplete-root":{minWidth:{xs:"100%",md:260}},"& .MuiInputBase-root":{minHeight:o?56:50,borderRadius:3,fontSize:o?"0.98rem":"0.92rem"},"& .MuiInputBase-input":{py:o?1.6:1.25,fontSize:o?"0.98rem":"0.92rem"},"& .MuiInputLabel-root":{fontSize:o?"0.95rem":"0.88rem"},"& .MuiButton-root":{minHeight:o?48:44,px:o?2.25:1.75,borderRadius:3,fontSize:o?"0.95rem":"0.88rem",fontWeight:700},"& .MuiIconButton-root":{width:o?40:36,height:o?40:36},"& .MuiMenuItem-root":{minHeight:o?44:38,fontSize:o?"0.95rem":"0.88rem"},"& .MuiListSubheader-root":{py:1},"& .MuiCheckbox-root":{p:o?1:.75},"& .MuiFormControlLabel-label":{fontSize:o?"0.95rem":"0.88rem"},"& .MuiDialog-paper":{borderRadius:4},"& .MuiDialogTitle-root":{fontSize:o?"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(Xa,{...a})})};var zv=(e,t,a)=>{if(a?.(t),!!t.href){if(t.href.startsWith("http://")||t.href.startsWith("https://")){window.open(t.href,"_blank");return}e.push(t.href);}},Wu=({items:e,selectedId:t,orientation:a="auto",onItemSelect:o,sx:r})=>{let n=styles.useTheme(),i=material.useMediaQuery("(orientation: portrait)"),c=material.useMediaQuery(n.breakpoints.down("md")),d=a==="auto"?i||c?"portrait":"landscape":a,l=navigation.useRouter();return jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:d==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...r},children:e.map(s=>{let u=s.id===t,f=s.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"},children:jsxRuntime.jsx(material.Box,{component:"button",type:"button",disabled:s.disabled,onClick:()=>zv(l,s,o),sx:{width:"100%",p:2,minHeight:d==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:s.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},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?f:"action.hover"},children:s.icon||jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900},children:s.title.slice(0,1).toUpperCase()})}),s.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:s.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:s.title}),s.caption?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:s.caption}):null,s.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:s.description}):null]})]})})},s.id)})})};var Uu=(e,t)=>t.trim()?e.reduce((a,o)=>{let r=o.title?.toLowerCase().includes(t.toLowerCase())||o.label?.toLowerCase().includes(t.toLowerCase())||o.description?.toLowerCase().includes(t.toLowerCase()),n=o.children?Uu(o.children,t):[];return (r||n.length>0)&&a.push({...o,children:n.length>0?n:o.children}),a},[]):e,jv=e=>{let t=new Set,a=o=>{o.forEach(r=>{r.children?.length&&(t.add(r.id),a(r.children));});};return a(e),t},Ku=({collapsed:e=false,onToggle:t,className:a="",maxHeight:o,menuData:r=[],colorMode:n="light",orientation:i="auto",headerSlot:c,footerSlot:d,activeHref:l,onItemSelect:s})=>{let{t:u}=q(),f=styles.useTheme(),m=material.useMediaQuery("(orientation: portrait)"),h=material.useMediaQuery(f.breakpoints.down("md")),I=i==="auto"?m||h?"portrait":"landscape":i,p=n==="dark",C=navigation.useRouter(),g=navigation.usePathname(),[y,x]=ut.useState(""),[k,L]=ut.useState(new Set),P=ut.useMemo(()=>Uu(r,y),[r,y]),S=ut.useMemo(()=>y.trim()?jv(P):k,[k,P,y]);ut.useEffect(()=>{e&&L(new Set);},[e]);let B=D=>D.appurl||D.href||"",T=D=>{s?.(D);let F=B(D);if(F){if(F.startsWith("http://")||F.startsWith("https://")){window.open(F,"_blank");return}C.push(F);}},v=D=>{let F=!!D.children?.length;if(e&&F){t?.();return}if(F){L($=>{let V=new Set($);return V.has(D.id)?V.delete(D.id):V.add(D.id),V});return}T(D);},M=D=>{let F=l||g,$=B(D);return !!($&&F===$)},w=(D,F=0)=>{let $=!!D.children?.length,V=S.has(D.id),_=M(D);return jsxRuntime.jsx(material.Box,{sx:{pl:F===0?0:1.5},children:jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:_?"primary.main":"divider",bgcolor:_?"action.selected":"background.paper"},children:[jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>v(D),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:_?"primary.main":"action.hover",color:_?"#fff":"text.primary"},children:D.icon||(D.title||D.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:D.title||D.label}),D.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:D.description}):null]}),$?jsxRuntime.jsx(_v__default.default,{sx:{transform:V?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):jsxRuntime.jsx(Zv__default.default,{color:"action"})]}),$?jsxRuntime.jsx(material.Collapse,{in:V,children:jsxRuntime.jsx(material.Box,{sx:{px:1.25,pb:1.25},children:D.children?.map(Y=>w(Y,F+1))})}):null]})},D.id)};return e?jsxRuntime.jsx(material.Paper,{elevation:0,className:a,sx:{width:I==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:p?"#101828":"rgba(255,255,255,0.88)",maxHeight:o?`${o}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:u("navigation.expand"),children:jsxRuntime.jsx(qv__default.default,{})}),r.map(D=>jsxRuntime.jsx(material.IconButton,{onClick:()=>v(D),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:M(D)?"primary.main":"action.hover",color:M(D)?"#fff":"text.primary"},children:D.icon||(D.title||D.label||"?").slice(0,1).toUpperCase()},D.id))]})}):jsxRuntime.jsx(material.Paper,{elevation:0,className:a,sx:{width:I==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:p?"#101828":"rgba(255,255,255,0.88)",maxHeight:o?`${o}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:D=>x(D.target.value),placeholder:u("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(Uv__default.default,{fontSize:"small",color:"action"})}}),I==="landscape"?jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(Kv__default.default,{})}):null]}),c,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:P.length>0?P.map(D=>w(D)):jsxRuntime.jsx(material.Typography,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:u("navigation.noMatch")})}),d]})})};var Ju=(e,t)=>{let a=t[e.id];if(e.render)return e.render(a,t);if(a==null||a==="")return "--";if(e.numeric){if(typeof a=="number")return a.toLocaleString();if(typeof a=="string"&&a.trim()!==""&&!Number.isNaN(Number(a)))return Number(a).toLocaleString()}return String(a)},tC=e=>ut__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}),oC=(e,t)=>{let a=t[e.id];if(a==null||a==="")return "--";if(e.numeric){if(typeof a=="number")return a.toLocaleString();if(typeof a=="string"&&a.trim()!==""&&!Number.isNaN(Number(a)))return Number(a).toLocaleString()}return String(a)},aC=({summaryRow:e,visibleColumns:t,columns:a})=>{let o=a.filter(r=>t.includes(r.id)&&e[r.id]!=="");return o.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:o.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}`))})]})})},rC=e=>{let{t}=q(),a=styles.useTheme(),{title:o,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:l,fitContainer:s=false,fullWidth:u=false,maxHeight:f,loading:m=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:I,filterConfig:p,rowKey:C,tableKey:g="default",graphReport:y,quickCreate:x,quickEdit:k,quickDelete:L,serviceUrl:P,orientation:S="auto",cardTitleField:B,cardSubtitleFields:T,toolbarSlot:v,emptyState:M,rowHeight:w="comfortable",cardActionSlot:D,renderCardFooter:F,onRowClick:$}=e,V=o||t("table.title.default"),_=material.useMediaQuery("(orientation: portrait)"),Y=material.useMediaQuery(a.breakpoints.down("md")),ee=S==="auto"?_||Y?"portrait":"landscape":S,{columns:te,filterText:ae,setFilterText:Bt,visibleColumns:lt,showSummary:Ke,setShowSummary:ge,summaryColumns:De,grouping:Fe,setGrouping:Je,expandedGroups:It,groupAnchorEl:qe,setGroupAnchorEl:rt,summaryAnchorEl:Wo,setSummaryAnchorEl:So,anchorEl:wo,setAnchorEl:Io,contextMenu:To,sortedAndFilteredRows:mt,summaryRow:H,visibleRows:de,page:ne,setPage:pe,rowsPerPage:Oe,setRowsPerPage:Me,totalDisplayCount:Qt,setSelected:io,handleClick:so,toggleSummaryColumn:lo,handleExport:co,handleCloseContextMenu:ke,toggleColumnVisibility:ce,toggleGroupExpand:gt,toggleGroupField:Te,handleExpandGroupRecursively:Tt,handleCollapseGroupRecursively:po,handleLayoutLoad:Ma,handleVariantLoad:N,handleLayoutSave:O,effectiveAppId:G,currentLayoutData:ue,currentLayoutId:fe,layoutIdToLoad:we,graphReportOpen:se,handleOpenGraphReport:Pe,handleCloseGraphReport:ye}=Ei(e),Re=y?.enabled??false,Se=Re&&(y?.interaction?.enabled??true),he=Ci(),Ce=C||"id",je=ut__namespace.default.useMemo(()=>{let R=new Set(i);return mt.filter(Z=>R.has(Z?.[Ce]))},[Ce,i,mt]),Pt=je.length===1?je[0]:null,uo=!!x?.enabled,Ot=!!k?.enabled,Yt=!!L?.enabled,Po=x?.fields,Aa=x?.excludeFields||[],la=x?.initialValues||{},Ft=k?.fields,$o=k?.excludeFields||[],Ba=k?.editableFields||[],Et=k?.nonEditableFields||[],Wt=k?.primaryKeys?.length?k.primaryKeys:[Ce],[Rt,Ie]=ut__namespace.default.useState(false),[Jt,Fa]=ut__namespace.default.useState(false),[Ea,La]=ut__namespace.default.useState({}),[Ho,Ro]=ut__namespace.default.useState(false),[Do,za]=ut__namespace.default.useState(false),[Na,ca]=ut__namespace.default.useState({}),[Lt,zt]=ut__namespace.default.useState(false),[Mo,Go]=ut__namespace.default.useState(false),Uo=m||Jt||Do||Mo,Va=ut__namespace.default.useMemo(()=>{let R=[...te];if(Array.isArray(Po)&&Po.length>0){let Z=new Set(Po);R=R.filter(ie=>Z.has(ie.id));}if(Aa.length>0){let Z=new Set(Aa);R=R.filter(ie=>!Z.has(ie.id));}return R.filter(Z=>!!Z?.id)},[te,Aa,Po]),Oa=ut__namespace.default.useMemo(()=>{let R=[...te];if(Array.isArray(Ft)&&Ft.length>0){let Z=new Set(Ft);R=R.filter(ie=>Z.has(ie.id));}if($o.length>0){let Z=new Set($o);R=R.filter(ie=>!Z.has(ie.id));}return R.filter(Z=>!!Z?.id)},[te,$o,Ft]),da=ut__namespace.default.useMemo(()=>new Set(Wt),[Wt]),pa=ut__namespace.default.useMemo(()=>new Set(Ba),[Ba]),Ko=ut__namespace.default.useMemo(()=>new Set(Et),[Et]),eo=ut__namespace.default.useCallback(R=>pa.size>0?pa.has(R):!(Ko.has(R)||da.has(R)),[pa,Ko,da]);ut__namespace.default.useEffect(()=>{!se&&he.hasActiveFilters&&he.clearAll();},[he,se]);let Ao=()=>{let R={};Va.forEach(Z=>{R[Z.id]=la[Z.id]??"";}),La(R),Ie(true);},mr=(R,Z)=>{La(ie=>({...ie,[R]:Z}));},Wa=async()=>{if(!x?.onSubmit){Ie(false);return}try{Fa(!0),await x.onSubmit(Ea),Ie(!1);}finally{Fa(false);}},gr=()=>{if(!Pt)return;let R={};Oa.forEach(ie=>{R[ie.id]=Pt[ie.id]??"";});let Z=k?.getInitialValues?{...R,...k.getInitialValues(Pt)}:R;ca(Z),Ro(true);},fr=(R,Z)=>{ca(ie=>({...ie,[R]:Z}));},hr=async()=>{if(Pt){if(!k?.onSubmit){Ro(false);return}try{za(!0),await k.onSubmit(Na,Pt),Ro(!1);}finally{za(false);}}},$t=()=>{je.length!==0&&zt(true);},yr=async()=>{if(je.length===0){zt(false);return}if(!L?.onConfirm){zt(false),io([]),c?.([]);return}try{Go(!0),await L.onConfirm(je),zt(!1),io([]),c?.([]);}finally{Go(false);}},qo=mt,{fieldMapping:Bo}=Dr({rows:qo,config:{...y,title:y?.title||`${V} ${t("graph.reportTitle")}`}}),br=ut__namespace.default.useMemo(()=>Se?he.applyRows(qo,Bo):qo,[Bo,he,Se,qo]),{model:$a}=Dr({rows:br,config:{...y,title:y?.title||`${V} ${t("graph.reportTitle")}`,fieldMapping:Bo}}),ua=$a.table.columns.map(R=>({id:R.id,label:R.label,align:R.align||"left",minWidth:120,numeric:R.align==="right"})),b=G?jsxRuntime.jsx(Ai,{appId:G,tableKey:g,currentLayoutData:ue,onLayoutLoad:Ma,targetLayoutId:we,activeLayoutId:fe,serviceUrl:P??p?.serviceUrl}):null,A=te.filter(R=>lt.includes(R.id)),E=A.find(R=>R.id===B)||A[0],W=T?.map(R=>A.find(Z=>Z.id===R)).filter(Boolean)||A.filter(R=>R.id!==E?.id).slice(0,ee==="portrait"?2:3),j=A.filter(R=>R.id!==E?.id&&!W.some(Z=>Z.id===R.id)),le=[v,l].filter(Boolean),z=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ei,{groupAnchorEl:qe,setGroupAnchorEl:rt,grouping:Fe,setGrouping:Je,columns:te,toggleGroupField:Te}),jsxRuntime.jsx(ti,{anchorEl:wo,setAnchorEl:Io,columns:te,visibleColumns:lt,toggleColumnVisibility:ce}),jsxRuntime.jsx(oi,{anchorEl:Wo,setAnchorEl:So,showSummary:Ke,setShowSummary:ge,columns:te,summaryColumns:De,toggleSummaryColumn:lo}),jsxRuntime.jsx(ai,{contextMenu:To,handleCloseContextMenu:ke,columns:te,visibleColumns:lt,toggleColumnVisibility:ce})]}),K=(R,Z)=>{let ie=i.includes(Z),$e=ee==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))";return jsxRuntime.jsx(material.Paper,{elevation:0,onClick:()=>{so({},R),$?.(R);},sx:{p:w==="compact"?1.25:1.5,borderRadius:4,border:"1px solid",borderColor:ie?"primary.main":"divider",boxShadow:ie?"0 12px 36px rgba(37, 99, 235, 0.14)":"none",cursor:"pointer",transition:"border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease","&: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:ie,onClick:U=>U.stopPropagation(),onChange:()=>so({},R),sx:{mt:-0.6,ml:-0.6}}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[E?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:Ju(E,R)}):null,W.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:W.map(U=>jsxRuntime.jsx(material.Chip,{label:`${U.label}: ${oC(U,R)}`,size:"small",variant:"outlined",sx:{borderRadius:999,fontWeight:600}},`${Z}-${U.id}`))}):null]}),D?jsxRuntime.jsx(material.Box,{onClick:U=>U.stopPropagation(),children:D(R)}):null]}),j.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:$e,gap:1},children:j.map(U=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:U.label}),tC(Ju(U,R))]},`${Z}-${U.id}-detail`))}):null,F?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{onClick:U=>U.stopPropagation(),children:F(R)})]}):null]})},Z)};return jsxRuntime.jsxs(material.Box,{sx:{width:u?"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(Nu,{...p,onVariantLoad:R=>{N(R),p.onVariantLoad?.(R);},appId:p.appId,tableKey:g,currentLayout:[{tableKey:g,layoutData:ue}],currentLayoutId:fe,layoutRefs:[{tableKey:g,layoutId:fe}],variantService:p.variantService,serviceUrl:P??p.serviceUrl,touchMode:ee==="portrait"?"expanded":"comfortable"})}):null,jsxRuntime.jsxs(material.Paper,{sx:{width:u?"100%":"auto",mb:s?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":Uo?{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(Xn,{filterText:ae,setFilterText:Bt,onRowsPerPageChange:Me,rowsPerPage:Oe,rowsPerPageOptions:h,page:ne,count:Qt,onPageChange:pe,actions:d,extraTools:le,grouping:Fe,setGroupAnchorEl:rt,showSummary:Ke,setShowSummary:ge,setAnchorEl:Io,setSummaryAnchorEl:So,handleExport:co,showCreateButton:uo,onOpenCreateDialog:Ao,showEditButton:Ot,onOpenEditDialog:gr,editDisabled:je.length!==1,showDeleteButton:Yt,onOpenDeleteConfirm:$t,deleteDisabled:je.length===0,onLayoutSave:I||p?.variantService&&p?.appId?O:void 0,loading:m,layoutManager:b,onOpenGraphReport:Re?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:[de.length===0&&!m?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,de.map((R,Z)=>{if(R.type==="group"){let U=It.has(R.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:()=>gt(R.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"},children:[U?jsxRuntime.jsx(_v__default.default,{}):jsxRuntime.jsx(Zv__default.default,{}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.94rem",fontWeight:800},children:[R.field,": ",R.value]}),jsxRuntime.jsxs(material.Typography,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[R.count," records"]})]}),Fe.length>1&&R.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:oe=>{oe.stopPropagation(),Tt(R.id);}}),jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.collapseAll"),onClick:oe=>{oe.stopPropagation(),po(R.id);}})]}):null]})},R.id)}let ie=R.data||R,$e=R.id||ie[Ce]||Z;return K(ie,$e)}),Ke?jsxRuntime.jsx(aC,{summaryRow:H,visibleColumns:lt,columns:te}):null,m?jsxRuntime.jsx(material.Typography,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:t("common.loading")}):null]})})]}),uo?jsxRuntime.jsxs(material.Dialog,{open:Rt,onClose:()=>!Jt&&Ie(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:[Va.map(R=>{let Z=R.type==="number"||R.numeric?"number":R.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:R.label||R.id,value:Ea[R.id]??"",onChange:ie=>mr(R.id,ie.target.value),type:Z,fullWidth:true,InputLabelProps:{shrink:Z==="date"?true:void 0}},`quick-create-${R.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:()=>Ie(false),disabled:Jt,children:x?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:Wa,variant:"contained",disabled:Jt,children:x?.submitLabel||t("common.save")})]})]}):null,Ot?jsxRuntime.jsxs(material.Dialog,{open:Ho,onClose:()=>!Do&&Ro(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:k?.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:[Oa.map(R=>{let Z=R.type==="number"||R.numeric?"number":R.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:R.label||R.id,value:Na[R.id]??"",onChange:ie=>fr(R.id,ie.target.value),type:Z,disabled:!eo(R.id),fullWidth:true,InputLabelProps:{shrink:Z==="date"?true:void 0}},`quick-edit-${R.id}`)}),k?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:k.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>Ro(false),disabled:Do,children:k?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:hr,variant:"contained",disabled:Do||!Pt,children:k?.submitLabel||t("common.save")})]})]}):null,Yt?jsxRuntime.jsx(an,{open:Lt,type:"warning",title:L?.title||t("quickDelete.confirmTitle"),message:L?.message||(je.length>1?t("quickDelete.confirmMessageMultiple",{count:je.length}):t("quickDelete.confirmMessageSingle")),confirmText:L?.confirmText||t("common.delete"),cancelText:L?.cancelText||t("common.cancel"),onClose:()=>!Mo&&zt(false),onConfirm:yr}):null,z,Re?jsxRuntime.jsx(xi,{open:se,onClose:ye,model:$a,aiAssistant:y?.aiAssistant,interaction:Se?{enabled:true,filters:he.filters,fieldMapping:Bo,onPrimaryDimensionClick:R=>he.setFilter("primaryDimension",R),onSecondaryDimensionClick:R=>he.setFilter("secondaryDimension",R),onStatusClick:R=>he.setFilter("status",R),onClearFilter:he.clearFilter,onClearAll:he.clearAll}:void 0,tableContent:jsxRuntime.jsx(rC,{appId:G||"graph-report-internal",title:t("graph.dataBody"),columns:ua,rows:$a.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var ZB=({appTitle:e,children:t,menuData:a=[],workloadItems:o=[],workloadSelectedId:r,showNavigation:n=true,showWorkloadNav:i=true,orientation:c="auto",logo:d,headerSlot:l,actionSlot:s,portraitBottomSlot:u,contentSx:f,containerSx:m,user:h,onSearch:I,defaultNavigationOpen:p,navOpen:C,onNavOpenChange:g,onWorkloadSelect:y})=>{let x=styles.useTheme(),k=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),L=material.useMediaQuery(x.breakpoints.down("md"),{noSsr:true}),P=c==="auto"?k||L?"portrait":"landscape":c,[S,B]=ut.useState(p??false),[T,v]=ut.useState(""),[M,w]=ut.useState(false),D=C??S;ut.useEffect(()=>{w(true);},[]),ut.useEffect(()=>{C===void 0&&B(P==="landscape");},[C,P]);let F=_=>{C===void 0&&B(_),g?.(_);},$=jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{px:2,py:1.25,borderRadius:0,borderBottom:"1px solid",borderColor:"divider",background:x.palette.mode==="dark"?"linear-gradient(180deg, rgba(15,23,42,0.96), rgba(17,24,39,0.92))":"linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.94))"},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[n?jsxRuntime.jsx(material.IconButton,{onClick:()=>F(!D),sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(qv__default.default,{})}):null,d?jsxRuntime.jsx(material.Box,{sx:{display:"grid",placeItems:"center"},children:d}):null,jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:900},children:e}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:M?P==="portrait"?"Pad portrait workspace":"Pad landscape workspace":"Pad workspace"})]}),jsxRuntime.jsx(material.Box,{sx:{flex:1}}),I?jsxRuntime.jsx(material.TextField,{value:T,onChange:_=>v(_.target.value),onKeyDown:_=>{_.key==="Enter"&&I(T);},size:"small",placeholder:"Search...",sx:{minWidth:{md:240},display:{xs:"none",sm:"block"}},InputProps:{startAdornment:jsxRuntime.jsx(Uv__default.default,{fontSize:"small",color:"action"})}}):null,s,h?jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[jsxRuntime.jsx(material.Avatar,{src:h.avatarSrc,sx:{width:38,height:38},children:h.avatarText||h.name.slice(0,1).toUpperCase()}),jsxRuntime.jsxs(material.Box,{sx:{display:{xs:"none",md:"block"}},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",fontWeight:800},children:h.name}),h.subtitle?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:h.subtitle}):null]})]}):null]}),l?jsxRuntime.jsx(material.Box,{sx:{mt:1.25},children:l}):null]}),V=jsxRuntime.jsx(Ku,{collapsed:P==="landscape"?!D:false,onToggle:()=>F(!D),menuData:a,orientation:P,colorMode:x.palette.mode,maxHeight:P==="landscape"?900:void 0});return jsxRuntime.jsxs(material.Box,{sx:{minHeight:"100vh",display:"flex",flexDirection:"column",background:x.palette.mode==="dark"?"linear-gradient(180deg, #020617 0%, #0f172a 58%, #111827 100%)":"linear-gradient(180deg, #f8fafc 0%, #eef2ff 58%, #e2e8f0 100%)",...m},children:[$,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,display:"flex"},children:[n&&P==="landscape"?jsxRuntime.jsx(material.Box,{sx:{p:1.5,pr:0,flexShrink:0},children:V}):null,n&&P==="portrait"?jsxRuntime.jsx(material.Drawer,{open:D,onClose:()=>F(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:V}):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&&o.length>0?jsxRuntime.jsx(Wu,{items:o,selectedId:r,orientation:P,onItemSelect:y}):null,jsxRuntime.jsx(material.Paper,{elevation:0,sx:{flex:1,minHeight:P==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:x.palette.mode==="dark"?"rgba(15,23,42,0.72)":"rgba(255,255,255,0.72)",backdropFilter:"blur(12px)"},children:t})]})})]}),P==="portrait"&&u?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{sx:{p:1.5},children:u})]}):null]})};var sm=SC__default.default(()=>Promise.resolve().then(()=>(im(),nm)).then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsxRuntime.jsx("div",{className:"h-full w-full bg-transparent"})});function fc({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(sm,{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(sm,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var o5=fc;function Ss({onTextUpdate:e,onComplete:t,onError:a,wsUrl:o="ws://localhost:8765",silenceThresholdMs:r=2e3,minVolumeRms:n=.015}){let[i,c]=ut.useState(false),d=ut.useRef(null),l=ut.useRef(null),s=ut.useRef(null),u=ut.useRef(null),f=ut.useRef(null),m=ut.useRef(0),h=ut.useRef(false),I=ut.useRef(false),p=ut.useCallback(()=>{d.current&&(d.current.close(),d.current=null),u.current&&(u.current.disconnect(),u.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),I.current=false,c(false);},[]),C=ut.useCallback(()=>{h.current||(h.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(p,500));},[p]),g=ut.useCallback(async()=>{if(!(i||I.current)){I.current=true,h.current=false,m.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(o);d.current=x,x.onopen=()=>{c(!0),I.current=!1;},x.onmessage=B=>{try{let T=JSON.parse(B.data);if(T.type==="recognition")T.is_final?t(T.text):e?.(T.text);else if(T.type==="error"){let v=T.message||"Voice recognition error";a?.(v),C();}}catch{a?.("Failed to parse voice message");}},x.onerror=()=>{a?.("Voice service connection failed"),p();},x.onclose=()=>{p();};let k=window.AudioContext||window.webkitAudioContext;if(!k)throw new Error("AudioContext is not supported in this browser");let L=new k({sampleRate:16e3});s.current=L;let P=L.createMediaStreamSource(y);f.current=P;let S=L.createScriptProcessor(4096,1,1);u.current=S,S.onaudioprocess=B=>{if(d.current?.readyState!==WebSocket.OPEN)return;let T=B.inputBuffer.getChannelData(0),v=0;for(let D=0;D<T.length;D+=1)v+=T[D]*T[D];if(Math.sqrt(v/T.length)>n)m.current=Date.now();else if(Date.now()-m.current>r&&!h.current){C();return}let w=new Int16Array(T.length);for(let D=0;D<T.length;D+=1){let F=Math.max(-1,Math.min(1,T[D]));w[D]=F<0?F*32768:F*32767;}d.current.send(w.buffer);},P.connect(S),S.connect(L.destination);}catch{a?.("Cannot access microphone"),p();}}},[p,i,n,t,a,e,r,C,o]);return ut.useEffect(()=>p,[p]),{isRecording:i,startRecording:g,stopRecording:C}}var cm=ut.createContext(null);function FC(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 EC({children:e,onVoiceSubmit:t,onVoicePartial:a,onVoiceError:o,longPressMs:r=200,disableSpaceTrigger:n=false,ignoreWhenFocusedInput:i=true,renderOverlay:c=true,wsUrl:d,silenceThresholdMs:l,minVolumeRms:s}){let[u,f]=ut.useState(false),[m,h]=ut.useState(false),I=ut.useRef(null),p=ut.useRef(false),C=ut.useRef(false),g=ut.useCallback(()=>{C.current=false,f(false);},[]),{isRecording:y,startRecording:x,stopRecording:k}=Ss({wsUrl:d,silenceThresholdMs:l,minVolumeRms:s,onTextUpdate:B=>{a?.(B);},onComplete:async B=>{try{B.trim()&&(h(!0),await t(B.trim()));}catch(T){let v=T instanceof Error?T.message:"Failed to process voice command";o?.(v);}finally{h(!1),g();}},onError:B=>{o?.(B),h(!1),p.current||g();}}),L=ut.useCallback(async()=>{C.current=false,await x();},[x]),P=ut.useCallback(()=>{k();},[k]);ut.useEffect(()=>{if(n)return;let B=v=>{v.isComposing||(v.code==="Space"||v.key===" ")&&(p.current||v.repeat||i&&FC(document.activeElement)||(p.current=true,v.preventDefault(),I.current=setTimeout(()=>{C.current=true,f(true),x();},r)));},T=v=>{(v.code==="Space"||v.key===" ")&&(I.current&&(clearTimeout(I.current),I.current=null),p.current=false,C.current&&(v.preventDefault(),f(false),k()));};return window.addEventListener("keydown",B),window.addEventListener("keyup",T),()=>{window.removeEventListener("keydown",B),window.removeEventListener("keyup",T),I.current&&(clearTimeout(I.current),I.current=null);}},[n,i,r,x,k]);let S=ut.useMemo(()=>({isRecording:y,isHotkeyRecording:u,isSubmitting:m,startRecording:L,stopRecording:P}),[u,y,m,L,P]);return jsxRuntime.jsxs(cm.Provider,{value:S,children:[c?jsxRuntime.jsx(fc,{isRecording:u}):null,e]})}function LC(){let e=ut.useContext(cm);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var d5=EC,p5=LC;function xe(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var HC=({content:e,theme:t="light",size:a="base",defaultExpanded:o=false})=>{let[r,n]=ut.useState(o),i=ut.useMemo(()=>`${(a==="sm"?14:a==="lg"?18:16)-2}px`,[a]);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:a==="sm"?"14px":a==="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})]})},dm=HC;var XC=({content:e,language:t="text",isStreaming:a=false,className:o=""})=>{let{theme:r}=nextThemes.useTheme(),[n,i]=ut.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:xe("rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 my-4",o),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:a,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=XC;var ek=({content:e,isLoading:t,className:a="",style:o})=>{let r=ut.useRef(null),[n,i]=ut.useState(false),[c,d]=ut.useState(null),{theme:l}=nextThemes.useTheme();return ut.useEffect(()=>{let s=async()=>{if(!(!e.trim()||!r.current)){i(true),d(null);try{gm__default.default.initialize({startOnLoad:!1,theme:l==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit"});let f=`mermaid-${Math.random().toString(36).substr(2,9)}`,m=e.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:h}=await gm__default.default.render(f,m);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);}}},u=setTimeout(()=>{s();},100);return ()=>clearTimeout(u)},[e,l]),t||n?jsxRuntime.jsx("div",{className:`mermaid-block loading ${a}`,style:o,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 ${a}`,style:o,ref:r})},hm=ek;var ik=({title:e="\u53D1\u751F\u9519\u8BEF",content:t,errorCode:a,stack:o,icon:r,closable:n=true,onClose:i,onRetry:c,className:d="",...l})=>{let[s,u]=ut.useState(false),[f,m]=ut.useState(false),h=async()=>{if(c){m(true);try{await c();}catch(I){console.error("\u91CD\u8BD5\u5931\u8D25:",I);}finally{m(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}),a&&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:a})]}),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||o)&&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"]}),o&&jsxRuntime.jsxs("button",{onClick:()=>u(!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"})})]}),o&&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:o})})]})},ws=ik;var uk=({title:e="\u8B66\u544A",content:t,warningType:a,severity:o="warning",warnings:r=[],icon:n,closable:i=true,onClose:c,onConfirm:d,actionText:l,className:s="",...u})=>{let f=()=>{switch(o){case "info":return {borderLeftColor:"border-l-blue-500",iconColor:"text-blue-500",bgColor:"bg-blue-50 dark:bg-blue-900/10"};case "error":return {borderLeftColor:"border-l-red-500",iconColor:"text-red-500",bgColor:"bg-red-50 dark:bg-red-900/10"};case "success":return {borderLeftColor:"border-l-green-500",iconColor:"text-green-500",bgColor:"bg-green-50 dark:bg-green-900/10"};default:return {borderLeftColor:"border-l-yellow-500",iconColor:"text-yellow-500",bgColor:"bg-yellow-50 dark:bg-yellow-900/10"}}},m=()=>{switch(o){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}`,...u,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||m()}),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}),a&&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:a})]}),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((I,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:I})]},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"})})]})},Is=uk;var hk=({title:e="\u76F8\u5173\u63A8\u8350",content:t,suggestions:a,onSuggestionClick:o,maxDisplay:r=5,icon:n,closable:i=false,onClose:c,className:d="",...l})=>{let[s,u]=ut.useState(false),[f,m]=ut.useState(""),[h,I]=ut.useState(false),p=ut.useMemo(()=>f.trim()?a.filter(y=>y.toLowerCase().includes(f.toLowerCase())):a,[a,f]),C=ut.useMemo(()=>s?p:p.slice(0,r),[p,s,r]),g=y=>{o?.(y);};return !a||a.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:[a.length>3&&jsxRuntime.jsx("button",{onClick:()=>I(!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=>m(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:()=>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"})]})},x))}),p.length>r&&jsxRuntime.jsx("button",{onClick:()=>u(!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"})]})]})},Ts=hk;var Sk=({title:e,content:t,toolName:a,parameters:o,result:r,status:n,duration:i,icon:c,closable:d=false,onClose:l,onAction:s,actionText:u,className:f="",...m})=>{let[h,I]=ut.useState(false),[p,C]=ut.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"})}},x=P=>P?P<1e3?`${P}ms`:`${(P/1e3).toFixed(2)}s`:"",k=g(),L=e||a||"\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}`,...m,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 ${k.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:L}),jsxRuntime.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${k.badgeBg} ${k.badgeText}`,children:k.label})]}),a&&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"}),a]})]})]}),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}),o&&jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsxs("button",{onClick:()=>I(!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(o,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:u||"\u6267\u884C\u64CD\u4F5C"})})]})]})},Ps=Sk;var Ik=({data:e})=>{if(!e)return null;let t=ut.useMemo(()=>{let a=[],o=[],r="\u6570\u636E\u8868\u683C";return Array.isArray(e)?(a=e,a.length>0&&(o=Object.keys(a[0]).map(n=>({id:n,label:n.charAt(0).toUpperCase()+n.slice(1),numeric:typeof a[0][n]=="number"})))):typeof e=="object"&&(r=e.title||r,a=Array.isArray(e.rows)?e.rows:Array.isArray(e.data)?e.data:[],Array.isArray(e.columns)?o=e.columns.map(i=>({id:i.key||i.id,label:i.title||i.label,numeric:i.dataType==="number"||i.numeric})):a.length>0&&(o=Object.keys(a[0]).map(i=>({id:i,label:i,numeric:typeof a[0][i]=="number"})))),a=a.map((n,i)=>({...n,id:n.id||`row_${i}`})),{title:r,columns:o,rows:a}},[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(Ca,{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]})})},Rs=Ik;var Ek=({title:e,subtitle:t,data:a,type:o,config:r={}})=>{let n=()=>{switch(o){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(!a&&o!=="google-map-card"&&o!=="amap-card")return jsxRuntime.jsx("div",{className:"text-gray-500 text-sm p-4 text-center",children:"No data available"});try{switch(o){case "bar-chart-card":return jsxRuntime.jsx(cn,{data:a,orientation:r.orientation||"horizontal",valueSuffix:r.valueSuffix||"",minHeight:r.minHeight});case "line-chart-card":return jsxRuntime.jsx(nd,{data:a,color:r.color,valueSuffix:r.valueSuffix||"",height:r.height});case "pie-chart-card":let c=a.reduce((l,s)=>l+(Number(s.value)||0),0),d=a.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(pi,{data:d,variant:r.variant||"donut",size:r.size,colors:r.colors});case "combo-chart-card":return jsxRuntime.jsx(id,{data:a,barColor:r.barColor,lineColor:r.lineColor});case "heatmap-chart-card":return jsxRuntime.jsx(ld,{data:a});case "fishbone-chart-card":return jsxRuntime.jsx(dd,{branches:a,effect:r.effect||e||"Problem"});case "waterfall-chart-card":return jsxRuntime.jsx(ud,{data:a,height:r.height});case "google-map-card":return jsxRuntime.jsx(fd,{embedUrl:r.embedUrl||a&&a[0]?.embedUrl,apiKey:r.apiKey,query:r.query||a&&a[0]?.query||e,height:r.height});case "amap-card":return jsxRuntime.jsx(xd,{embedUrl:r.embedUrl||a&&a[0]?.embedUrl,keyword:r.keyword||a&&a[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: ",o]})}}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(a,null,2)})]})})]})]})},Ds=Ek;var zk=({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)})})})]}),As=zk;var Bs=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 Hk=({content:e,theme:t,size:a="base",className:o,enableCodeHighlight:r=true,enableMermaid:n=true,messageId:i,cardHooks:c})=>{let d=ut.useMemo(()=>e?e.replace(/<think>([\s\S]*?)<\/think>/g,(f,m)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(m.trim())}"></div>`):"",[e]),l=(f,m,h,I,p)=>{c?.onCardEvent?.({messageId:i,cardType:f,action:m,title:h,payload:I,rawData:p});},s=(f,m,h,I,p,C)=>{if(!(!p&&!c?.onCardEvent))return (...g)=>{let y=p?.(...g),x=C?C(...g):void 0;return l(f,m,h,x,I),y}},u=ut.useMemo(()=>({div(f){let{"data-component":m,"data-think-content":h,...I}=f;return m==="thinkbox"&&h?jsxRuntime.jsx(dm,{content:decodeURIComponent(h),theme:t,size:a,defaultExpanded:false}):jsxRuntime.jsx("div",{...I})},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:m}){return jsxRuntime.jsx("th",{className:`px-3 py-2 font-semibold text-gray-800 dark:text-gray-100 ${m==="center"?"text-center":m==="right"?"text-right":"text-left"}`,children:f})},td({children:f,align:m}){return jsxRuntime.jsx("td",{className:`px-3 py-2 text-gray-700 dark:text-gray-200 align-top ${m==="center"?"text-center":m==="right"?"text-right":"text-left"}`,children:f})},code({inline:f,className:m,children:h,...I}){let p=/language-([\w-]+)/.exec(m||""),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",...I,children:h});let g=String(h).replace(/\n$/,"");if(n&&C==="mermaid")return jsxRuntime.jsx(hm,{content:g});if(C==="json"){let y=Bs(g);if(y)switch(y.type){case "table":return jsxRuntime.jsx(Rs,{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(Ds,{...y});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(As,{...y});case "error-card":{let x=y;return jsxRuntime.jsx(ws,{...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,k=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(Is,{...x,onClose:s("warning-card","close",x.title,x,x.onClose),onConfirm:k})}case "suggestions-card":{let x=y;return jsxRuntime.jsx(Ts,{...x,onClose:s("suggestions-card","close",x.title,x,x.onClose),onSuggestionClick:s("suggestions-card","suggestion-click",x.title,x,x.onSuggestionClick,k=>({suggestion:k}))})}case "tool-result-card":{let x=y;return jsxRuntime.jsx(Ps,{...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:g,language:C,className:"not-prose"}):jsxRuntime.jsx("code",{className:m,...I,children:h})}}),[t,a,n,r,c,i]);return jsxRuntime.jsx("div",{className:xe("markdown-body prose dark:prose-invert max-w-none",o),children:jsxRuntime.jsx(Nk__default.default,{remarkPlugins:[Vk__default.default,Ok__default.default],rehypePlugins:[Wk__default.default,$k__default.default],components:u,children:d})})},Fs=Hk;var Gk=({content:e,messageId:t,cardHooks:a})=>{let o=(i,c,d,l,s)=>{a?.onCardEvent?.({messageId:t,cardType:i,action:c,title:d,payload:l,rawData:s});},r=(i,c,d,l,s,u)=>{if(!(!s&&!a?.onCardEvent))return (...f)=>{let m=s?.(...f),h=u?u(...f):void 0;return o(i,c,d,h,l),m}},n=Bs(e);if(n)switch(n.type){case "table":return jsxRuntime.jsx(Rs,{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(Ds,{...n});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(As,{...n});case "error-card":{let i=n;return jsxRuntime.jsx(ws,{...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&&a?.onCardEvent?r("warning-card","confirm",i.title,i):void 0;return jsxRuntime.jsx(Is,{...i,onClose:r("warning-card","close",i.title,i,i.onClose),onConfirm:c})}case "suggestions-card":{let i=n;return jsxRuntime.jsx(Ts,{...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(Ps,{...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(Fs,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:a})})},Tm=Gk;var wc=class{static analyze(t){if(!t.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let o=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(t),r=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(t),n=t.includes("NQ#")||t.includes("data-component");return o||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"}}},Kk=({content:e,className:t="",messageId:a,cardHooks:o})=>{let r=ut__namespace.default.useMemo(()=>wc.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(Tm,{content:n.content,messageId:a,cardHooks:o},`block-${i}`):jsxRuntime.jsx(Fs,{content:n.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:a,cardHooks:o},`block-${i}`))})},Pm=Kk;var qk=({content:e,isStreaming:t=true,onComplete:a,className:o="",streamIntervalMs:r=24,streamChunkSize:n=3,messageId:i,cardHooks:c})=>{let[d,l]=ut.useState(t?0:e.length),[s,u]=ut.useState(!t);ut.useEffect(()=>{if(t){l(0),u(false);return}l(e.length),u(true);},[e,t]),ut.useEffect(()=>{if(!t||s)return;if(d>=e.length){u(true),a?.();return}let p=window.setTimeout(()=>{l(C=>Math.min(C+n,e.length));},r);return ()=>{window.clearTimeout(p);}},[e.length,s,t,a,n,r,d]);let f=()=>{t&&!s&&(l(e.length),u(true),a?.());},m=t?e.slice(0,d):e,h=t&&!s,I=t&&!s;return jsxRuntime.jsxs("div",{className:`streaming-markdown ${o}`,onClick:f,style:{cursor:t?"pointer":"default"},children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(Pm,{content:m,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"}})]}),I&&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"})]})},Am=qk;var Bm=({buttons:e,className:t})=>{let a=o=>{switch(o){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:xe("flex items-center gap-1",t),children:e.map((o,r)=>jsxRuntime.jsx("button",{onClick:o.onClick,disabled:o.disabled,className:xe("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",o.active&&"text-blue-600 bg-blue-50 dark:text-blue-400 dark:bg-blue-900/20",o.type==="refresh"&&o.disabled&&"animate-spin"),title:o.type,type:"button",children:a(o.type)},`${o.type}-${r}`))})};var Es=({message:e,onStreamingComplete:t,assistantActions:a,streamIntervalMs:o,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(Am,{content:e.content,isStreaming:e.isStreaming??false,onComplete:t,streamIntervalMs:o,streamChunkSize:r,messageId:e.id,cardHooks:n}),e.content&&a?.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(Bm,{buttons:[{type:"refresh",onClick:()=>a?.onRegenerate?.(),disabled:!a?.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 Em=({onTextUpdate:e,onComplete:t,onCancel:a,disabled:o,className:r})=>{let{isRecording:n,startRecording:i,stopRecording:c}=Ss({onTextUpdate:e,onComplete:l=>{t?.(l);},onError:l=>{console.error("Voice input error:",l),a?.();}});return jsxRuntime.jsx("button",{onClick:async()=>{n?c():await i();},disabled:o,className:xe("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",o&&"opacity-50 cursor-not-allowed",r),title:n?"Stop recording":"Start recording",type:"button",children:n?jsxRuntime.jsx(Jk__default.default,{sx:{fontSize:24}}):jsxRuntime.jsx(Yk__default.default,{sx:{fontSize:24}})})};var at={container:"w-full max-w-4xl mx-auto",inputContainer:xe("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:xe("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:xe("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:xe("bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400","cursor-pointer active:scale-95"),sendButton:xe("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:xe("cursor-not-allowed opacity-40 bg-transparent text-gray-400"),stopButton:xe("cursor-pointer bg-red-500 hover:bg-red-600 text-white shadow-sm active:scale-95")},sS={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},lS=({enabled:e,onClick:t})=>jsxRuntime.jsx("button",{className:xe(at.buttonBase,at.buttonSmall,at.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsxRuntime.jsx(nS__default.default,{sx:{fontSize:24}})}),cS=()=>jsxRuntime.jsxs("button",{className:xe(at.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",at.buttonNormal),"aria-label":"Tools",type:"button",children:[jsxRuntime.jsx(iS__default.default,{sx:{fontSize:20}}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),dS=({canSend:e,isResponding:t,onSend:a,onStop:o})=>t?jsxRuntime.jsx("button",{className:xe(at.buttonBase,at.buttonSmall,at.stopButton),onClick:o,"aria-label":"Stop generating",type:"button",children:jsxRuntime.jsx(iconsMaterial.Stop,{sx:{fontSize:20}})}):jsxRuntime.jsx("button",{className:xe(at.buttonBase,at.buttonSmall,e?at.sendButton:at.sendButtonDisabled),onClick:a,disabled:!e,"aria-label":"Send message",type:"button",children:jsxRuntime.jsx(rS__default.default,{sx:{fontSize:24},className:e?"text-gray-500 dark:text-gray-400":"text-gray-300 dark:text-gray-600"})}),Lm=({onSend:e,onStop:t,isResponding:a=false,placeholder:o,getText:r})=>{let[n,i]=ut.useState(""),[c,d]=ut.useState([]),[l,s]=ut.useState(false),[u,f]=ut.useState(false),m=ut.useRef(null),h=o||(r?r("00019","Type a message..."):"Type a message..."),I=(n.trim().length>0||c.length>0)&&!a,p={enabled:true},C=ut.useCallback(F=>{i(F.target.value),F.target.style.height="auto",F.target.style.height=`${Math.min(F.target.scrollHeight,200)}px`;},[]),g=ut.useCallback(F=>{if(F.target.files&&F.target.files.length>0){let $=Array.from(F.target.files);d(V=>{let _=$.filter(ee=>V.some(te=>te.name===ee.name&&te.size===ee.size));_.length>0&&console.warn("Duplicate files ignored:",_.map(ee=>ee.name));let Y=$.filter(ee=>!V.some(te=>te.name===ee.name&&te.size===ee.size));return [...V,...Y]}),m.current&&(m.current.value="");}},[]),y=ut.useCallback(F=>{d($=>$.filter((V,_)=>_!==F));},[]),x=ut.useCallback(()=>{m.current?.click();},[]),k=ut.useCallback(async()=>{if(!I)return;let F=n,$=[...c];i(""),d([]),m.current&&(m.current.value="");try{await e(F,$);}catch(V){console.error("Failed to send message:",V),i(F),d($);}},[n,I,e,c]),L=ut.useCallback(F=>{F.key==="Enter"&&!F.shiftKey&&!l&&(F.preventDefault(),k());},[k,l]),P=ut.useCallback(()=>{s(true);},[]),S=ut.useCallback(()=>{s(false);},[]),B=ut.useCallback(F=>{i(F);},[]),T=ut.useCallback(F=>{i(F);},[]),v=ut.useCallback(()=>{},[]),M=ut.useCallback(F=>{F.preventDefault(),f(true);},[]),w=ut.useCallback(F=>{F.preventDefault(),f(false);},[]),D=ut.useCallback(F=>{if(F.preventDefault(),f(false),F.dataTransfer.files&&F.dataTransfer.files.length>0){let $=Array.from(F.dataTransfer.files);d(V=>[...V,...$]);}},[]);return jsxRuntime.jsx("div",{className:at.container,children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"file",multiple:true,className:"hidden",ref:m,onChange:g}),jsxRuntime.jsxs("div",{className:xe(at.inputContainer,u&&at.dragActive),style:{borderRadius:"32px"},onDragOver:M,onDragLeave:w,onDrop:D,children:[c.length>0&&jsxRuntime.jsx("div",{className:at.filePreviewArea,children:c.map((F,$)=>jsxRuntime.jsxs("div",{className:at.fileTag,children:[jsxRuntime.jsx(iconsMaterial.InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsxRuntime.jsx("span",{className:"truncate max-w-[150px]",children:F.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}})})]},`${F.name}-${$}`))}),jsxRuntime.jsxs("div",{className:"flex flex-col w-full p-2",children:[jsxRuntime.jsx("div",{className:xe(at.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsxRuntime.jsx("textarea",{className:xe(at.textarea,"min-h-[24px] py-0 px-0"),placeholder:h,value:n,onChange:C,onKeyDown:L,onCompositionStart:P,onCompositionEnd:S,style:sS,"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(lS,{enabled:p.enabled,onClick:x}),jsxRuntime.jsx(cS,{})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Em,{onTextUpdate:B,onComplete:T,onCancel:v,disabled:a,className:at.buttonSmall}),jsxRuntime.jsx(dS,{canSend:I,isResponding:a,onSend:k,onStop:t})]})]})]})]})]})})};var Nm=({messages:e,onSend:t,onStop:a,onRegenerate:o,isResponding:r=false,className:n,placeholder:i,streamIntervalMs:c,streamChunkSize:d,onMessageStreamingComplete:l,cardHooks:s,showInput:u=true})=>{let f=ut.useRef(null);return ut.useEffect(()=>{f.current?.scrollIntoView({behavior:"smooth"});},[e,r]),jsxRuntime.jsxs("div",{className:xe("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((m,h)=>{let I=m.type==="assistant"&&h===e.length-1,p=m.type==="assistant"?{isLatestAssistant:I,onRegenerate:o?()=>o(m.id):void 0}:void 0;return jsxRuntime.jsx(Es,{message:m,assistantActions:p,onStreamingComplete:()=>l?.(m.id),streamIntervalMs:c,streamChunkSize:d,cardHooks:s},m.id)}),jsxRuntime.jsx("div",{ref:f})]}),u&&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(Lm,{onSend:t||(async()=>{}),onStop:a||(()=>{}),isResponding:r,placeholder:i})})]})};var jt={};var gS={idle:"Idle",running:"Running",success:"Success",error:"Error",pending:"Pending"},zE=({title:e="AI Agent",description:t,headerActions:a,className:o,agentStatus:r,showInput:n=false,...i})=>{let c=r??(i.isResponding?"running":"idle");return jsxRuntime.jsxs("div",{className:xe("relative flex h-full w-full",jt.agentPanel,o),"data-status":c,children:[jsxRuntime.jsx("div",{className:jt.colorHalo,"data-status":c,"aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:jt.marqueeBorder,"data-status":c,"aria-hidden":"true",children:[jsxRuntime.jsx("span",{className:xe(jt.edge,jt.top)}),jsxRuntime.jsx("span",{className:xe(jt.edge,jt.right)}),jsxRuntime.jsx("span",{className:xe(jt.edge,jt.bottom)}),jsxRuntime.jsx("span",{className:xe(jt.edge,jt.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:jt.statusDot,"data-status":c}),jsxRuntime.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-gray-600 dark:text-gray-300",children:gS[c]})]}),a]})]}),jsxRuntime.jsx("div",{className:"flex-1 min-h-0 relative z-10",children:jsxRuntime.jsx(Nm,{...i,showInput:n})})]})]})};var xS={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},UE=({messages:e,onSend:t,onRegenerate:a,isResponding:o=false,className:r,placeholder:n,title:i="Copilot",corner:c="bottom-right",onCollapse:d,onHeaderPointerDown:l,onPlusClick:s,onMicClick:u,streamIntervalMs:f,streamChunkSize:m,onMessageStreamingComplete:h,cardHooks:I})=>{let[p,C]=ut.useState(""),[g,y]=ut.useState(false),x=ut.useRef(null),k=xS[c];ut.useEffect(()=>{x.current?.scrollIntoView({behavior:"smooth"});},[e,o]);let L=ut.useCallback(async()=>{let S=p.trim();!S||o||(C(""),await t(S));},[o,t,p]),P=ut.useCallback(async S=>{S.key==="Enter"&&!g&&(S.preventDefault(),await L());},[L,g]);return jsxRuntime.jsxs("div",{className:xe("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:xe("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",k==="top-left"&&"-left-2 -top-2",k==="top-right"&&"-right-2 -top-2",k==="bottom-left"&&"-bottom-2 -left-2",k==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:jsxRuntime.jsx("span",{className:xe("block h-4 w-4 border-[#21BCFF]",k==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",k==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",k==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",k==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),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((S,B)=>{let T=S.type==="assistant"&&B===e.length-1,v=S.type==="assistant"?{isLatestAssistant:T,onRegenerate:a?()=>a(S.id):void 0}:void 0;return jsxRuntime.jsx(Es,{message:S,assistantActions:v,onStreamingComplete:()=>h?.(S.id),streamIntervalMs:f,streamChunkSize:m,cardHooks:I},S.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:S=>C(S.target.value),onCompositionStart:()=>y(true),onCompositionEnd:()=>y(false),onKeyDown:P,"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:u,type:"button","aria-label":"Microphone",children:jsxRuntime.jsx(lucideReact.Mic,{className:"h-4 w-4"})})]})})]})};var IS={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)"}}},jE=({children:e,transitionKey:t,variant:a="fade",durationMs:o=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]=ut.useState("to"),u=!i&&!d&&a!=="none";ut.useEffect(()=>{if(!u){s("to");return}s("from");let h=requestAnimationFrame(()=>{h=requestAnimationFrame(()=>{s("to");});});return ()=>cancelAnimationFrame(h)},[t,u]);let f=IS[a],m=ut.useMemo(()=>u?l==="from"?f.from:f.to:{opacity:1,transform:"none"},[u,l,f.from,f.to]);return jsxRuntime.jsx(material.Box,{sx:{willChange:u?"opacity, transform":"auto",transition:u?`opacity ${o}ms ${n} ${r}ms, transform ${o}ms ${n} ${r}ms`:"none",backfaceVisibility:"hidden",...m,...c},children:e})},XE={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};
199
- exports.AgentPanel=zE;exports.Button=Os;exports.CAINavProvider=EC;exports.CAmapChart=xd;exports.CAppHeader=Vp;exports.CAppPageLayout=B2;exports.CBarChart=cn;exports.CChartCard=ri;exports.CComboChart=id;exports.CCustomizeAgent=Sd;exports.CDetailInfoPage=zD;exports.CDetailSearchAiBar=xp;exports.CDetailSectionCard=Hi;exports.CFishboneChart=dd;exports.CGoogleMapChart=fd;exports.CGraphCharts=vd;exports.CGraphKpiCards=od;exports.CGraphReport=xi;exports.CHeatmapChart=ld;exports.CKanbanBoard=a2;exports.CKanbanBucket=Ip;exports.CKanbanCard=Nl;exports.CLayoutManagement=_d;exports.CLayoutManager=Ai;exports.CLineChart=nd;exports.CMessageBox=an;exports.COrbCanvas=vC;exports.CPageLayout=Gc;exports.CPageTransition=jE;exports.CPieChart=pi;exports.CPivotTable=vA;exports.CSmartFilter=Xa;exports.CSmartTable=tR;exports.CStandardPage=lR;exports.CTable=Ca;exports.CTableBody=XP;exports.CTableCell=QP;exports.CTableContainer=YP;exports.CTableHead=JP;exports.CTableRow=eR;exports.CVariantManagement=Si;exports.CVariantManager=Fd;exports.CVoiceWaveOverlay=fc;exports.CWaterfallChart=ud;exports.CodeBlock=Cn;exports.CopilotChat=UE;exports.GlobalMessage=Mw;exports.MarkdownRenderer=Tn;exports.MathBlock=kn;exports.MermaidBlock=Sl;exports.NavigationIsland=Oc;exports.ORBCAFE_I18N_MESSAGES=on;exports.OrbcafeI18nProvider=Fc;exports.PAGE_TRANSITION_PRESETS=XE;exports.PAppPageLayout=ZB;exports.PBarcodeScanner=OA;exports.PNavIsland=Ku;exports.PNumericKeypad=eB;exports.PSmartFilter=Nu;exports.PTable=rC;exports.PTouchCard=KA;exports.PWorkloadNav=Wu;exports.PivotChartPanel=fu;exports.StdChat=Nm;exports.TableBlock=Il;exports.ThinkBlock=Wi;exports.TreeMenu=$s;exports.VoiceNavigatorProvider=d5;exports.VoiceWaveOverlay=o5;exports.buildAmapEmbedUrl=gi;exports.buildGoogleMapEmbedUrl=un;exports.buildGoogleMapIframe=cI;exports.buttonVariants=_m;exports.createKanbanBoardModel=Rp;exports.findKanbanCard=xo;exports.message=mw;exports.messageManager=_o;exports.moveKanbanCard=_i;exports.parseMarkdownTable=Vi;exports.renderMarkdown=nD;exports.resolveVariantFilters=jd;exports.resolveVariantLayout=Bi;exports.useAINav=LC;exports.useAmapEmbedUrl=SR;exports.useDetailInfo=Cp;exports.useGoogleMapEmbedUrl=kR;exports.useGraphChartData=yR;exports.useGraphInteraction=Ci;exports.useGraphReport=Dr;exports.useKanbanBoard=l2;exports.useNavigationIsland=$c;exports.useOrbcafeI18n=q;exports.usePadLayout=MA;exports.usePadRecordEditor=FA;exports.usePageLayout=Op;exports.usePivotTable=IA;exports.useStandardReport=gR;exports.useVoiceInput=Ss;exports.useVoiceNavigator=p5;
189
+ `),f={enableMath:a},m=0;for(;m<u.length;){let h=u[m],I=h.trim();if(!I){m+=1;continue}if(n&&yp(h)){if(I.startsWith("<think>")){let g=[],y=h;for(;;){let x=y.indexOf("<think>"),k=x>=0?y.slice(x+7):y,L=k.indexOf("</think>");if(L>=0){g.push(k.slice(0,L)),m+=1;break}if(g.push(k),m+=1,m>=u.length)break;y=u[m];}s.push(jsxRuntime.jsx($i,{content:g.join(`
190
+ `).trim()},`think-tag-${m}`));continue}m+=1;let C=[];for(;m<u.length&&u[m].trim()!==":::";)C.push(u[m]),m+=1;m<u.length&&u[m].trim()===":::"&&(m+=1),s.push(jsxRuntime.jsx($i,{content:C.join(`
191
+ `).trim()},`think-fence-${m}`));continue}if(Hi(h)){let C=I.slice(3).trim().toLowerCase(),g=[];for(m+=1;m<u.length&&!Hi(u[m]);)g.push(u[m]),m+=1;m<u.length&&Hi(u[m])&&(m+=1);let y=g.join(`
192
+ `);if(r&&C==="mermaid"){s.push(jsxRuntime.jsx(wl,{code:y},`mermaid-${m}`));continue}if(a&&["math","latex","katex"].includes(C)){s.push(jsxRuntime.jsx(wn,{expression:y,allowKatex:true},`math-fence-${m}`));continue}s.push(jsxRuntime.jsx(Sn,{code:y,language:C||"text",copyable:i,showLineNumbers:c,wrapLongLines:true},`code-${m}`));continue}if(a&&I.startsWith("$$")){let C=[];if(I.endsWith("$$")&&I!=="$$")C.push(I.slice(2,-2)),m+=1;else {let y=h.slice(h.indexOf("$$")+2);for(y.trim()&&C.push(y),m+=1;m<u.length;){let x=u[m],k=x.indexOf("$$");if(k>=0){C.push(x.slice(0,k)),m+=1;break}C.push(x),m+=1;}}s.push(jsxRuntime.jsx(wn,{expression:C.join(`
193
+ `).trim(),allowKatex:true},`math-${m}`));continue}if(gp(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";s.push(jsxRuntime.jsx(material.Typography,{variant:y,sx:{mt:C===1?1.2:.8,mb:.5,fontWeight:700},children:Pn(g,f,`h-${m}`)},`heading-${m}`)),m+=1;continue}if(fp(h)){s.push(jsxRuntime.jsx(material.Divider,{sx:{my:1.2}},`hr-${m}`)),m+=1;continue}if(hp(u,m)){let C=m+2;for(;C<u.length&&u[C].trim()&&u[C].includes("|");)C+=1;let g=u.slice(m,C).join(`
194
+ `),y=Oi(g);if(y){s.push(jsxRuntime.jsx(Tl,{table:y},`table-${m}`)),m=C;continue}}if(Al(h)){let C=[];for(;m<u.length&&Al(u[m]);)C.push(u[m].replace(/^\s*>\s?/,"")),m+=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((g,y)=>jsxRuntime.jsxs(mt.Fragment,{children:[y>0&&jsxRuntime.jsx("br",{}),Pn(g,f,`q-${m}-${y}`)]},`quote-line-${y}`))})},`quote-${m}`));continue}if(Dl(h)){let C=[];for(;m<u.length&&Dl(u[m]);)C.push(u[m].trim().replace(/^[-*+]\s+/,"")),m+=1;s.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:Pn(g,f,`ul-${m}-${y}`)})},`ul-item-${y}`))},`ul-${m}`));continue}if(Ml(h)){let C=[];for(;m<u.length&&Ml(u[m]);)C.push(u[m].trim().replace(/^\d+\.\s+/,"")),m+=1;s.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:Pn(g,f,`ol-${m}-${y}`)})},`ol-item-${y}`))},`ol-${m}`));continue}let p=[];for(;m<u.length;){let C=u[m],g=C.trim();if(!g||Hi(C)||gp(C)||fp(C)||Dl(C)||Ml(C)||Al(C)||hp(u,m)||n&&yp(C)||a&&g.startsWith("$$"))break;p.push(C),m+=1;}p.length>0?s.push(jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:p.map((C,g)=>jsxRuntime.jsxs(mt.Fragment,{children:[g>0&&jsxRuntime.jsx("br",{}),Pn(C,f,`p-${m}-${g}`)]},`p-line-${g}`))},`p-${m}`)):m+=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 iD=(e,t)=>jsxRuntime.jsx(Rn,{markdown:e,...t});var vp=({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(Od__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(eh__default.default,{sx:{fontSize:d?16:18}})}),a&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:a,children:jsxRuntime.jsx(lh__default.default,{sx:{fontSize:d?16:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:o,disabled:c||!e.trim(),children:jsxRuntime.jsx(dh__default.default,{sx:{fontSize:d?16:18}})})]}),l&&i&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:i})]});var Cp=(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)]})},Gi=({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:Cp(a.label,t)}),jsxRuntime.jsx(material.Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:r?Cp(r,t):a.value})]},a.id)})})]})};var zl=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",Ki=e=>e.trim().toLowerCase(),Wb=(e,t)=>{let o=[];return e.forEach(a=>{a.fields.forEach(r=>{let n=r.searchableText||zl(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:Ki(`${a.title} ${r.label} ${n}`)});});}),t.forEach(a=>{(a.fields||[]).forEach(r=>{let n=r.searchableText||zl(r.value),i={source:"tab",sourceId:a.id,sourceTitle:a.label,fieldId:r.id,fieldLabel:r.label,fieldValue:n};o.push({hit:i,text:Ki(`${a.label} ${r.label} ${n}`)});}),(a.sections||[]).forEach(r=>{r.fields.forEach(n=>{let i=n.searchableText||zl(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:Ki(`${a.label} ${r.title} ${n.label} ${i}`)});});});}),o},kp=({sections:e,tabs:t=[],defaultTabId:o,ai:a})=>{let{t:r}=K(),[n,i]=mt.useState(""),[c,d]=mt.useState(o||t[0]?.id),[l,s]=mt.useState("idle"),[u,f]=mt.useState([]),[m,h]=mt.useState(""),[I,p]=mt.useState(""),[C,g]=mt.useState(false),y=mt.useMemo(()=>Wb(e,t),[e,t]);mt.useEffect(()=>{if(t.length===0){d(void 0);return}t.some(B=>B.id===c)||d(o||t[0]?.id);},[t,c,o]);let x=mt.useCallback(()=>{s("idle"),f([]),h(""),p("");},[]),k=mt.useCallback(S=>{i(S),S.trim()||(s("idle"),f([]),h(""),p(""));},[]),L=mt.useCallback(S=>{let B=Ki(S);return B?y.filter(T=>T.text.includes(B)).map(T=>T.hit):[]},[y]),P=mt.useCallback(async()=>{let S=n.trim();if(!S)return;g(true);let B=L(S);if(f(B),B.length>0){s("search"),p(""),h(r("detail.searchAi.matches",{count:B.length})),g(false);return}if(a?.enabled!==false&&a?.onSubmit){s("ai"),h(r("detail.searchAi.autoAiFallback"));try{let v=await a.onSubmit(S,{query:S,hits:B,activeTabId:c,sections:e,tabs:t});p(typeof v=="string"?v:"");}finally{g(false);}return}s("search"),p(""),h(r("detail.searchAi.noMatch")),g(false);},[n,L,r,a,c,e,t]);return {query:n,setQuery:k,activeTabId:c,setActiveTabId:d,searchMode:l,hits:u,statusText:m,aiResponse:I,searching:C,handleSubmit:P,clearResult:x}};var ND=({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:u}=K(),{query:f,setQuery:m,activeTabId:h,setActiveTabId:I,searchMode:p,hits:C,statusText:g,aiResponse:y,searching:x,handleSubmit:k,clearResult:L}=kp({sections:o,tabs:a,defaultTabId:r,ai:i}),P=mt.useMemo(()=>a.find(T=>T.id===h)||a[0],[a,h]),S=mt.useCallback(T=>{let v=M=>{let w=document.getElementById(T);if(w){w.scrollIntoView({behavior:"smooth",block:"center"});return}M<4&&setTimeout(()=>v(M+1),60);};requestAnimationFrame(()=>v(0));},[]),B=mt.useCallback((T,v)=>{if(a.some(M=>M.id===T)){I(T),S(v?`detail-tab-${T}-section-${v}`:`detail-tab-${T}`);return}S(`detail-section-${T}`);},[a,I,S]);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(vp,{value:f,onChange:m,onSubmit:k,onVoiceInput:i?.onVoiceInput,onClear:()=>{m(""),L();},placeholder:i?.placeholder||u("detail.searchAi.placeholder"),statusText:g,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(qb__default.default,{fontSize:"small"})})}),c]})]}),g&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:g}),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:u("detail.searchAi.matches",{count:C.length})}),jsxRuntime.jsx(material.Stack,{spacing:.35,children:C.slice(0,8).map(T=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:()=>B(T.sourceId,T.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:T.sourceTitle})," \xB7 ",jsxRuntime.jsx(material.Box,{component:"span",sx:{fontWeight:700},children:T.fieldLabel})," = ",jsxRuntime.jsx(material.Box,{component:"span",children:T.fieldValue||"-"})]})},`${T.source}|${T.sourceId}|${T.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:u("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(Rn,{markdown:y})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(T=>jsxRuntime.jsx(material.Box,{id:`detail-section-${T.id}`,children:jsxRuntime.jsx(Gi,{section:T,highlightQuery:f})},T.id))}),a.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsxRuntime.jsx(material.Tabs,{value:P?.id||false,onChange:(T,v)=>I(v),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:a.map(T=>jsxRuntime.jsx(material.Tab,{value:T.id,label:T.label,sx:{textTransform:"none"}},T.id))}),jsxRuntime.jsxs(material.Box,{sx:{p:1.5},children:[jsxRuntime.jsx(material.Box,{id:`detail-tab-${P?.id||""}`}),P?.description&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:P.description}),P?.content?P.content:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[(P?.sections||[]).map(T=>jsxRuntime.jsx(material.Box,{id:`detail-tab-${P?.id}-section-${T.id}`,children:jsxRuntime.jsx(Gi,{section:T,highlightQuery:f})},T.id)),P?.fields&&P.fields.length>0&&jsxRuntime.jsx(Gi,{section:{id:`${P.id}-fields`,title:P.label,fields:P.fields,columns:2},highlightQuery:f})]})]})]}),n&&jsxRuntime.jsx(Sa,{title:n.title||u("detail.table.title"),...n.tableProps,filterConfig:void 0,fitContainer:false})]})};var Tp=({bucket:e,cardCount:t,highlighted:o=false,children:a,emptyLabel:r,maxHeight:n,sx:i})=>{let{t:c}=K();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 Qb={success:"success",warning:"warning",info:"info",error:"error"},Yb={critical:"error",high:"warning",medium:"info",low:"success"},Jb=(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}},ex=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",Vl=({card:e,bucket:t,dragging:o=false,overlay:a=false,onClick:r,sx:n})=>{let{t:i}=K(),c=!!(r&&t),d=e.tone??(e.priority?Yb[e.priority]:"default"),l=d==="default"?"primary":Qb[d],s=t?{card:e,bucket:t}:void 0;return jsxRuntime.jsx(material.Paper,{onClick:c?()=>s&&r?.(s):void 0,onKeyDown:c?u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),s&&r?.(s));}:void 0,role:c?"button":void 0,tabIndex:c?0:void 0,sx:[u=>{let f=d==="default"?u.palette.primary.main:u.palette[l].main;return {position:"relative",overflow:"hidden",p:1.4,borderRadius:3,border:`1px solid ${styles.alpha(f,u.palette.mode==="dark"?.42:.2)}`,bgcolor:styles.alpha(u.palette.background.paper,u.palette.mode==="dark"?.96:.98),boxShadow:a?`0 20px 45px ${styles.alpha(u.palette.common.black,.24)}`:o?"none":`0 8px 24px ${styles.alpha(u.palette.common.black,u.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(u.palette.common.black,u.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:Jb(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(u=>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:u.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",fontWeight:700},children:u.value})]},u.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(u=>jsxRuntime.jsx(material.Chip,{size:"small",label:u.label,color:u.color??"default",variant:"outlined"},u.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??ex(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 ox=(e,t)=>Number.isNaN(e)||e<0?0:e>t?t:e,Dp=({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}})}},Co=(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}}},Zi=(e,t)=>{let o=Co(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=ox(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,u)=>({...s,bucketId:l.id,position:u}))}))}};var Ol="kanban-card|",Wl="kanban-bucket|",Fp=e=>`${Ol}${e}`,fx=e=>`${Wl}${e}`,ji=e=>e?.startsWith(Ol)?e.slice(Ol.length):void 0,Bp=e=>e?.startsWith(Wl)?e.slice(Wl.length):void 0,hx=({card:e,bucket:t,onCardClick:o})=>{let{setNodeRef:a,attributes:r,listeners:n,transform:i,transition:c,isDragging:d}=sortable.useSortable({id:Fp(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(Vl,{card:e,bucket:t,dragging:d,onClick:o})})},yx=({bucket:e,highlighted:t,bucketMaxHeight:o,emptyBucketLabel:a,onCardClick:r})=>{let{isOver:n,setNodeRef:i}=core.useDroppable({id:fx(e.id)});return jsxRuntime.jsx(material.Box,{ref:i,sx:{minWidth:0},children:jsxRuntime.jsx(Tp,{bucket:e,cardCount:e.cards.length,highlighted:t||n,emptyLabel:a,maxHeight:o,children:jsxRuntime.jsx(sortable.SortableContext,{items:e.cards.map(c=>Fp(c.id)),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:1,children:e.cards.map(c=>jsxRuntime.jsx(hx,{card:c,bucket:e,onCardClick:r},c.id))})})})})},r2=({model:e,onCardMove:t,onCardClick:o,minBucketWidth:a=320,bucketMaxHeight:r,emptyBucketLabel:n,sx:i})=>{let[c,d]=mt.useState(null),[l,s]=mt.useState(),u=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),f=mt.useMemo(()=>c?Co(e,c):void 0,[c,e]),m=mt.useCallback(()=>{d(null),s(void 0);},[]),h=mt.useCallback(g=>{if(!g)return;let y=ji(g);return y?Co(e,y)?.bucket.id:Bp(g)},[e]),I=mt.useCallback(g=>{d(ji(String(g.active.id))??null);},[]),p=mt.useCallback(g=>{s(h(g.over?String(g.over.id):void 0));},[h]),C=mt.useCallback(g=>{let y=ji(String(g.active.id)),x=g.over?String(g.over.id):void 0;if(!y||!x){m();return}let k=Co(e,y);if(!k){m();return}let L=k.bucket.id,P=k.cardIndex,S=ji(x);if(S){let v=Co(e,S);if(!v){m();return}L=v.bucket.id,P=v.cardIndex;}else {let v=Bp(x),M=e.buckets.find(w=>w.id===v);if(!v||!M){m();return}L=v,P=M.cards.length;}if(k.bucket.id===L&&k.cardIndex===P){m();return}let B=Zi(e,{cardId:y,fromBucketId:k.bucket.id,toBucketId:L,targetIndex:P}),T=Co(B,y);T&&!(T.bucket.id===k.bucket.id&&T.cardIndex===k.cardIndex)&&t?.({cardId:y,fromBucketId:k.bucket.id,toBucketId:T.bucket.id,targetIndex:T.cardIndex,card:T.card,model:B}),m();},[e,t,m]);return jsxRuntime.jsxs(core.DndContext,{sensors:u,collisionDetection:core.closestCorners,onDragStart:I,onDragOver:p,onDragEnd:C,onDragCancel:m,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(yx,{bucket:g,highlighted:g.id===l,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(Vl,{card:f.card,bucket:f.bucket,overlay:true})}):null})]})};var Cx=({initialModel:e,initialBuckets:t,initialCards:o})=>e||Dp({buckets:t??[],cards:o??[]}),c2=e=>{let{onCardMove:t,onCardClick:o}=e,[a,r]=mt.useState(()=>Cx(e)),n=mt.useCallback(s=>{r(u=>typeof s=="function"?s(u):s);},[]),i=mt.useCallback(s=>Co(a,s),[a]),c=mt.useCallback((s,u,f)=>{let m=Co(a,s);if(!m)return;let h=Zi(a,{cardId:s,fromBucketId:m.bucket.id,toBucketId:u,targetIndex:f}),I=Co(h,s);if(!I||I.bucket.id===m.bucket.id&&I.cardIndex===m.cardIndex)return;r(h);let p={cardId:s,fromBucketId:m.bucket.id,toBucketId:I.bucket.id,targetIndex:I.cardIndex,card:I.card,model:h};return t?.(p),p},[a,t]),d=mt.useCallback((s,u)=>{r(f=>({buckets:f.buckets.map(m=>({...m,cards:m.cards.map(h=>h.id!==s?h:typeof u=="function"?u(h):{...h,...u})}))}));},[]),l=mt.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 Np=64,zx="#E9EDF2",Nx="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",Vx=["en","zh","fr","de","ja","ko"],Vp={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},Op=({appTitle:e,logo:t,mode:o="dark",onToggleMode:a,locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,searchPlaceholder:d,onSearch:l,user:s,onUserSetting:u,onUserLogout:f,userMenuItems:m,leftSlot:h,rightSlot:I})=>{let{t:p,locale:C}=K(),y=material.useTheme().palette.mode==="dark",[x,k]=mt.useState(""),[L,P]=mt.useState(null),[S,B]=mt.useState(null),T=ae=>{ae.preventDefault(),l&&l(x.trim());},v=o==="system"?jsxRuntime.jsx(Ax__default.default,{fontSize:"small"}):o==="dark"?jsxRuntime.jsx(Bx__default.default,{fontSize:"small"}):jsxRuntime.jsx(Fx__default.default,{fontSize:"small"}),M=p(o==="system"?"header.theme.system":o==="dark"?"header.theme.dark":"header.theme.light"),w=r||C,D=i&&i.length>0?i:Vx,F=n||Vp[w]||w.toUpperCase(),$=!!L,V=d||p("header.searchPlaceholder"),q=!!S,Y=[{key:"setting",label:p("header.menu.setting"),icon:jsxRuntime.jsx(iy__default.default,{sx:{fontSize:18}}),onClick:u},{key:"logout",label:p("header.menu.logout"),icon:jsxRuntime.jsx(Lx__default.default,{sx:{fontSize:18}}),onClick:f}],te=m&&m.length>0?m:Y,oe=ae=>{B(null),ae?.();};return jsxRuntime.jsxs(material.AppBar,{position:"sticky",elevation:0,sx:ae=>({top:0,zIndex:ae.zIndex.drawer+10,height:Np,backgroundColor:ae.palette.mode==="dark"?"#0D0D0D":zx,backgroundImage:ae.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%)",Nx,"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:ae.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)"}),children:[jsxRuntime.jsxs(material.Toolbar,{sx:{minHeight:`${Np}px !important`,px:2,gap:2},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[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}),h]}),jsxRuntime.jsx(material.Box,{sx:{flex:1,display:"flex",justifyContent:"center",minWidth:0},children:jsxRuntime.jsx(material.Box,{component:"form",onSubmit:T,sx:{width:"100%",maxWidth:540},children:jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:x,onChange:ae=>k(ae.target.value),placeholder:V,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Od__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:ae=>P(ae.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(zp__default.default,{sx:{fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{fontWeight:500},children:F})]})}),jsxRuntime.jsx(material.Menu,{anchorEl:L,open:$,onClose:()=>P(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:D.map(ae=>jsxRuntime.jsx(material.MenuItem,{selected:ae===w,onClick:()=>{c(ae),P(null);},sx:{fontSize:"0.82rem"},children:Vp[ae]},ae))})]}):jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsxRuntime.jsx(zp__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:F})]}),jsxRuntime.jsx(material.IconButton,{size:"small",sx:{color:y?"common.white":"#111827"},onClick:a,title:M,children:v}),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:ae=>B(ae.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()})})]}),I]})]}),s&&jsxRuntime.jsx(material.Menu,{anchorEl:S,open:q,onClose:()=>B(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{minWidth:160,"& .MuiMenuItem-root":{minHeight:34,py:.5,px:1.25}}}},children:te.map(ae=>jsxRuntime.jsxs(material.MenuItem,{disabled:ae.disabled,onClick:()=>oe(ae.onClick),children:[ae.icon&&jsxRuntime.jsx(material.ListItemIcon,{children:ae.icon}),jsxRuntime.jsx(material.ListItemText,{primary:ae.label,slotProps:{primary:{sx:{fontSize:"0.86rem",fontWeight:500}}}})]},ae.key))})]})};var Wp=({menuData:e=[],initialNavigationCollapsed:t=false}={})=>{let{navigationIslandProps:o}=Hc({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 F2=({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:u,logo:f,onSearch:m,rightHeaderSlot:h,leftHeaderSlot:I,contentSx:p})=>{let C="orbcafe:page-layout-mode",[g,y]=mt.useState("system"),[x,k]=mt.useState("light"),[L,P]=mt.useState(false),S=g==="system"?L?x:"light":g;mt.useEffect(()=>{try{let D=window.localStorage.getItem(C);(D==="light"||D==="dark"||D==="system")&&y(D);}catch{}P(true);let M=window.matchMedia("(prefers-color-scheme: dark)"),w=()=>{k(M.matches?"dark":"light");};return w(),M.addEventListener("change",w),()=>M.removeEventListener("change",w)},[]),mt.useEffect(()=>{if(L)try{window.localStorage.setItem(C,g);}catch{}},[L,g]);let B=mt.useMemo(()=>material.createTheme({palette:{mode:S}}),[S]),{navigationIslandProps:T,navigationMaxHeight:v}=Wp({menuData:t,initialNavigationCollapsed:false});return jsxRuntime.jsx(material.ThemeProvider,{theme:B,children:jsxRuntime.jsx(Ec,{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(Op,{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:l,onUserLogout:s,userMenuItems:u,onSearch:m,leftSlot:I,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(Wc,{...T,maxHeight:v,colorMode:S})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...p},children:o})]})]})})})};var es="(blank)",Gp="Result",Up="Grand Total",Kp={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},qp=["sum","count","avg","min","max"];var _p=["palette","rows","columns","filters","values"];var Zp=e=>_p.includes(e),jp=e=>e==="rows"||e==="columns"||e==="filters",ts=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&Zp(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&Zp(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},aa=e=>e==null||e===""?es:e instanceof Date?e.toISOString().slice(0,10):String(e),nr=e=>JSON.stringify(e),Xp=(e,t)=>{let o=e.join(""),a=t.join("");return o.localeCompare(a,void 0,{sensitivity:"base"})},qx=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},Vr=(e,t,o)=>{if(o==="count")return e.length;let a=e.map(r=>qx(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)},pt=(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},ra=(e,t)=>e.length!==t.length?false:e.every((o,a)=>o===t[a]),Qp=(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 ra(n,i)})},os=(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}),Ul=e=>!e?.aggregations||e.aggregations.length===0?qp:e.aggregations,Mt=(e,t)=>{let o=Ul(t);return e&&o.includes(e)?e:t?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},Ln=(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}=K(),[n,i]=mt.useState(""),c=mt.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,u=typeof s=="string"?s.split(","):s;o(u);},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 ql=({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(r0__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})]})]})}),au=({id:e,label:t,subtitle:o})=>{let{setNodeRef:a,listeners:r,attributes:n,isDragging:i}=core.useDraggable({id:e});return jsxRuntime.jsx(ql,{label:t,subtitle:o,isDragging:i,dragRef:a,listeners:r,attributes:n})};var $r=({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}=K();return jsxRuntime.jsxs(material.Paper,{ref:l,sx:u=>({p:1.1,borderRadius:3,border:"1px dashed",borderColor:d?"primary.main":u.palette.divider,bgcolor:d?u.palette.mode==="dark"?"rgba(25, 118, 210, 0.16)":"rgba(47, 91, 255, 0.06)":u.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(c0__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 nu={xs:1.2,md:1.6},Gr=({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:nu,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(sy__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:nu,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:i})})]});var ss=({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(r0__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(eh__default.default,{sx:{fontSize:16}})})]})}),zn=({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}),u={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:l,zIndex:s?999:"auto"};return jsxRuntime.jsx(ss,{label:t,caption:o,onRemove:a,trailing:r,isDragging:s,dragRef:n,listeners:c,attributes:i,style:u})};var ds={rows:jsxRuntime.jsx(S0__default.default,{fontSize:"small"}),columns:jsxRuntime.jsx(Vg__default.default,{fontSize:"small"}),filters:jsxRuntime.jsx(k0__default.default,{fontSize:"small"}),values:jsxRuntime.jsx(Hg__default.default,{fontSize:"small"})},lu=({isConfiguratorCollapsed:e,onToggleCollapse:t,availableFields:o,fieldMap:a,filterFields:r,columnFields:n,rowFields:i,valueFields:c,clearZone:d,removeFieldFromZone:l,getFilterSelectionSummary:s,renderDimensionFilterSelect:u,renderAggregationSelect:f,getAggregationLabel:m})=>{let{t:h}=K(),I=[`${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(Gr,{title:h("pivot.config.title"),subtitle:I,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($r,{zone:"palette",title:h("pivot.fieldList"),hint:h("pivot.availableDimensions"),itemCount:o.length,icon:jsxRuntime.jsx(r0__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(au,{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($r,{zone:"filters",title:h("pivot.zone.filters"),hint:h("pivot.hint.filters"),icon:ds.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(zn,{id:`item|filters|${p}`,label:a.get(p)?.label??p,caption:s(p),trailing:u(p),onRemove:()=>l("filters",p)},p))})})}),jsxRuntime.jsx($r,{zone:"columns",title:h("pivot.zone.columns"),hint:h("pivot.hint.columns"),icon:ds.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(zn,{id:`item|columns|${p}`,label:a.get(p)?.label??p,caption:`${a.get(p)?.type??"dimension"} \u2022 ${s(p)}`,trailing:u(p),onRemove:()=>l("columns",p)},p))})})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx($r,{zone:"rows",title:h("pivot.zone.rows"),hint:h("pivot.hint.rows"),icon:ds.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(zn,{id:`item|rows|${p}`,label:a.get(p)?.label??p,caption:`${a.get(p)?.type??"dimension"} \u2022 ${s(p)}`,trailing:u(p),onRemove:()=>l("rows",p)},p))})})}),jsxRuntime.jsx($r,{zone:"values",title:h("pivot.zone.values"),hint:h("pivot.hint.values"),icon:ds.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,g=`${m(p.aggregation)}(${C})`;return jsxRuntime.jsx(zn,{id:`item|values|${p.tokenId}`,label:C,caption:g,trailing:f(p),onRemove:()=>l("values",p.tokenId)},p.tokenId)})})})})]})]})]})})};var cu=e=>e.toLocaleString(void 0,{maximumFractionDigits:1}),du=({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),u=Math.max(...l,1),f=Math.max(...s,1),m=i-d.left-d.right,h=c-d.top-d.bottom,I=e.map((p,C)=>{let g=o?p.primaryValue:C+1,y=o?p.secondaryValue??0:p.primaryValue,x=d.left+g/u*m,k=c-d.bottom-y/f*h;return {...p,x,y:k,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)}),I.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:cu(f)}),jsxRuntime.jsx("text",{x:i-d.right,y:c-d.bottom+16,textAnchor:"end",fontSize:"10",fill:n.palette.text.secondary,children:cu(u)})]})}),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 Yl=e=>Math.max(...e,1),uu=({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=Yl(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=Yl(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/g*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)/g*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,u={top:20,right:18,bottom:36,left:18},f=Yl(e.flatMap(g=>[g.primaryValue,g.secondaryValue??0])),m=l-u.left-u.right,h=s-u.top-u.bottom,I=g=>e.map((y,x)=>{let k=u.left+x*m/Math.max(e.length-1,1),L=s-u.bottom-g(y)/f*h;return {x:k,y:L,item:y}}),p=I(g=>g.primaryValue),C=a?I(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 ${l} ${s}`,sx:{width:"100%",minWidth:l,height:s},children:[jsxRuntime.jsx("line",{x1:u.left,y1:s-u.bottom,x2:l-u.right,y2:s-u.bottom,stroke:styles.alpha(i.palette.text.secondary,.35)}),jsxRuntime.jsx("polyline",{fill:"none",stroke:c,strokeWidth:3,points:p.map(g=>`${g.x},${g.y}`).join(" ")}),p.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 mu=(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},gu=(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}}),fu=({rows:e,dimensionFieldId:t,primaryValue:o,secondaryValue:a})=>{if(!t)return [];let r=new Map;return e.forEach(n=>{let i=aa(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:Vr(i,o.fieldId,o.aggregation),secondaryValue:a?Vr(i,a.fieldId,a.aggregation):void 0}))};var hu=({rows:e,fieldMap:t,rowFields:o,columnFields:a,valueFields:r,chartDimensionFieldId:n,chartPrimaryValueFieldId:i,chartSecondaryValueFieldId:c,chartType:d,isCollapsed:l,onChartDimensionFieldIdChange:s,onChartPrimaryValueFieldIdChange:u,onChartSecondaryValueFieldIdChange:f,onChartTypeChange:m,onToggleCollapse:h,getAggregationLabel:I})=>{let{t:p}=K(),C=mt.useMemo(()=>mu(o,a,t),[a,t,o]),g=mt.useMemo(()=>gu(r,t,I),[t,I,r]),y=g.find(v=>v.fieldId===i)??g[0],x=g.find(v=>v.fieldId===c&&v.fieldId!==y?.fieldId)??null,k=C.find(v=>v.fieldId===n)??C[0],L=k&&y?p("pivot.chart.subtitleReady",{dimension:k.label,measure:x?`${y.label} / ${x.label}`:y.label}):p("pivot.chart.subtitle"),P=mt.useMemo(()=>!k||!y?[]:fu({rows:e,dimensionFieldId:k.fieldId,primaryValue:y.item,secondaryValue:x?.item}),[y,e,x,k]),S=v=>y?Ln(v,y.item,t):v.toLocaleString(),B=v=>x?Ln(v,x.item,t):v.toLocaleString(),T=C.length>1||g.length>1;return jsxRuntime.jsxs(Gr,{title:p("pivot.chart.title"),subtitle:L,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:[T&&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:k?.fieldId??"",onChange:v=>s(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:p("pivot.chart.primaryMeasure")}),jsxRuntime.jsx(material.Select,{value:y?.fieldId??"",onChange:v=>u(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:p("pivot.chart.secondaryMeasure")}),jsxRuntime.jsxs(material.Select,{value:x?.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:p("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:p("pivot.chart.chartType")}),jsxRuntime.jsxs(material.Select,{value:d,onChange:v=>m(v.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:k?y?P.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(du,{data:P,primaryLabel:y.label,secondaryLabel:x?.label,formatPrimaryValue:S,formatSecondaryValue:B}):jsxRuntime.jsx(uu,{data:P,chartType:d,primaryLabel:y.label,secondaryLabel:x?.label,formatPrimaryValue:S,formatSecondaryValue:B}):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 ms=({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(uf__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(Zg__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:u=>`1px solid ${u.palette.divider}`,whiteSpace:"nowrap"},children:Ln(i?i(e,s.id):e.aggregatedValues[s.id]??0,s.valueItem,o)},`${e.key}-${s.id}`))]}),c&&e.children.map(s=>jsxRuntime.jsx(ms,{node:s,dataColumns:t,fieldMap:o,level:a+1,expandedKeys:r,onToggle:n,getValue:i},s.key))]})};var ac=(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??"",rc=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",Su=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},Iu=(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,Iu(r.children,t,o+1)),o),nv=(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},CA=({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:u,defaultPresets:f,onPresetsChange:m,initialPresetId:h,onPresetApplied:I})=>{let{t:p}=K(),C=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),g=mt.useRef(0),y=mt.useRef(false),x=e??p("pivot.title.default"),k=n??p("pivot.empty"),L=mt.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]),P=mt.useCallback(b=>L[b]??Kp[b],[L]),S=mt.useMemo(()=>new Set(o.map(b=>b.id)),[o]),B=mt.useMemo(()=>new Map(o.map(b=>[b.id,b])),[o]),[T,v]=mt.useState(()=>pt(a?.rows,S)),[M,w]=mt.useState(()=>pt(a?.columns,S)),[D,F]=mt.useState(()=>pt(a?.filters,S)),[$,V]=mt.useState(()=>{let b=a?.values??[],A=new Set,E=[];return b.forEach(W=>{if(!S.has(W.fieldId)||A.has(W.fieldId))return;A.add(W.fieldId),g.current+=1;let j=B.get(W.fieldId);E.push({tokenId:`v${g.current}`,fieldId:W.fieldId,aggregation:Mt(W.aggregation,j)});}),E}),[q,Y]=mt.useState({}),[te,oe]=mt.useState(true),[ae,Ft]=mt.useState(false),[lt,Ke]=mt.useState(()=>ac(pt(a?.rows,S),pt(a?.columns,S),r?.dimensionFieldId)),[ge,De]=mt.useState(()=>{let b=(a?.values??[]).filter((A,E,W)=>S.has(A.fieldId)&&W.findIndex(j=>j.fieldId===A.fieldId)===E).map(A=>({tokenId:A.fieldId,fieldId:A.fieldId,aggregation:Mt(A.aggregation,B.get(A.fieldId))}));return hs(b,r?.primaryValueFieldId)}),[Fe,Je]=mt.useState(()=>{let b=(a?.values??[]).filter((E,W,j)=>S.has(E.fieldId)&&j.findIndex(se=>se.fieldId===E.fieldId)===W).map(E=>({tokenId:E.fieldId,fieldId:E.fieldId,aggregation:Mt(E.aggregation,B.get(E.fieldId))})),A=hs(b,r?.primaryValueFieldId);return rc(b,A,r?.secondaryValueFieldId)}),[Tt,qe]=mt.useState(r?.chartType??"bar-vertical"),[rt,Ho]=mt.useState(c),[Io,To]=mt.useState(d),[Po,Ro]=mt.useState(()=>f??[]),[gt,H]=mt.useState(""),[de,ne]=mt.useState(false),[pe,$e]=mt.useState(""),[Me,Jt]=mt.useState(null),[lo,co]=mt.useState(new Set(["__grand_total__"])),[po,uo]=mt.useState(new Set),ke=l?.rowFields??T,ce=l?.columnFields??M,ft=l?.filterFields??D,Te=l?.valueFields??$,Pt=l?.filterSelections??q,mo=l?.showGrandTotal??te,Ba=l?.isConfiguratorCollapsed??ae,N=l?.chartDimensionFieldId??lt,O=l?.chartPrimaryValueFieldId??ge,G=l?.chartSecondaryValueFieldId??Fe,ue=l?.chartType??Tt,fe=l?.isChartCollapsed??rt,we=l?.isTableCollapsed??Io,ie=u??Po,Pe=s||ie.length>0||!!m,ye=mt.useCallback(b=>{if(l?.setRowFields){l.setRowFields(b);return}v(b);},[l]),Re=mt.useCallback(b=>{if(l?.setColumnFields){l.setColumnFields(b);return}w(b);},[l]),Se=mt.useCallback(b=>{if(l?.setFilterFields){l.setFilterFields(b);return}F(b);},[l]),he=mt.useCallback(b=>{if(l?.setValueFields){l.setValueFields(b);return}V(b);},[l]),Ce=mt.useCallback(b=>{if(l?.setFilterSelections){l.setFilterSelections(b);return}Y(b);},[l]),je=mt.useCallback(b=>{if(l?.setShowGrandTotal){l.setShowGrandTotal(b);return}oe(b);},[l]),Rt=mt.useCallback(b=>{if(l?.setIsConfiguratorCollapsed){l.setIsConfiguratorCollapsed(b);return}Ft(b);},[l]),go=mt.useCallback(b=>{if(l?.setChartDimensionFieldId){l.setChartDimensionFieldId(b);return}Ke(b);},[l]),$t=mt.useCallback(b=>{if(l?.setChartPrimaryValueFieldId){l.setChartPrimaryValueFieldId(b);return}De(b);},[l]),eo=mt.useCallback(b=>{if(l?.setChartSecondaryValueFieldId){l.setChartSecondaryValueFieldId(b);return}Je(b);},[l]),Do=mt.useCallback(b=>{if(l?.setChartType){l.setChartType(b);return}qe(b);},[l]),Fa=mt.useCallback(b=>{if(l?.setIsChartCollapsed){l.setIsChartCollapsed(b);return}Ho(b);},[l]),da=mt.useCallback(b=>{if(l?.setIsTableCollapsed){l.setIsTableCollapsed(b);return}To(b);},[l]),Et=mt.useCallback(b=>{let A=typeof b=="function"?b(ie):b;u||Ro(A),m?.(A);},[m,ie,u]),Go=mt.useMemo(()=>new Set([...ke,...ce,...ft]),[ke,ce,ft]),Ea=mt.useMemo(()=>o.filter(b=>!Go.has(b.id)),[o,Go]),Lt=mt.useMemo(()=>{let b=[...ke,...ce,...ft],A=new Set,E=[];return b.forEach(W=>{A.has(W)||(A.add(W),E.push(W));}),E},[ce,ft,ke]);mt.useEffect(()=>{ye(b=>{let A=b.filter(E=>S.has(E));return ra(b,A)?b:A}),Re(b=>{let A=b.filter(E=>S.has(E));return ra(b,A)?b:A}),Se(b=>{let A=b.filter(E=>S.has(E));return ra(b,A)?b:A}),he(b=>{let A=b.filter(E=>S.has(E.fieldId)).map(E=>({...E,aggregation:Mt(E.aggregation,B.get(E.fieldId))}));return os(b,A)?b:A});},[B,S]);let Ht=mt.useMemo(()=>{let b={};return Lt.forEach(A=>{let E=new Set;t.forEach(W=>{E.add(aa(W[A]));}),b[A]=Array.from(E).sort((W,j)=>W.localeCompare(j));}),b},[Lt,t]);mt.useEffect(()=>{Ce(b=>{let A={};return Lt.forEach(E=>{let W=Ht[E]??[],se=(b[E]??[]).filter(U=>W.includes(U)),z=Object.prototype.hasOwnProperty.call(b,E);A[E]=z?se:W;}),Qp(b,A)?b:A});},[Lt,Ht]),mt.useEffect(()=>{go(b=>ac(ke,ce,b));},[ce,ke,go]),mt.useEffect(()=>{$t(b=>hs(Te,b));},[$t,Te]),mt.useEffect(()=>{eo(b=>rc(Te,O,b));},[O,eo,Te]);let Dt=mt.useMemo(()=>t.filter(b=>Lt.every(A=>{let E=Pt[A]??[],W=Ht[A]??[];if(E.length===W.length)return true;if(E.length===0)return false;let j=aa(b[A]);return E.includes(j)})),[Lt,Ht,Pt,t]),Ie=mt.useMemo(()=>{if(Te.length===0)return null;let b=new Map;if(Dt.forEach(z=>{let U=ce.length>0?ce.map(_=>aa(z[_])):[p("pivot.valueLabel")],R=nr(U);b.set(R,U);}),b.size===0){let z=ce.length>0?ce.map(()=>es):[p("pivot.valueLabel")];b.set(nr(z),z);}let A=Array.from(b.entries()).sort((z,U)=>Xp(z[1],U[1])),E=A.flatMap(([z,U])=>Te.map(R=>{let _=B.get(R.fieldId),le=`${P(R.aggregation)} ${_?.label??R.fieldId}`,Ee=ce.length===0||Te.length>1?`${U.join(" / ")} \u2022 ${le}`:U.join(" / ");return {id:`${z}::${R.tokenId}`,colKey:z,valueItem:R,label:Ee}})),W=[];ce.length>0&&A.forEach(([z,U])=>{let R=E.filter(Ee=>Ee.colKey===z),_=W,le=[];U.forEach((Ee,Z)=>{le.push(`d${Z}:${Ee}`);let ee=`col::${nr(le)}`,Ne=_.find(ct=>ct.key===ee);Ne||(Ne={key:ee,label:Ee,children:[],leafColumnIds:[],path:U.slice(0,Z+1),depth:Z},_.push(Ne)),R.forEach(ct=>{Ne.leafColumnIds.includes(ct.id)||Ne.leafColumnIds.push(ct.id);}),_=Ne.children;});});let j=z=>{let U={};return E.forEach(R=>{let _=z.filter(le=>{let Ee=ce.length>0?ce.map(Z=>aa(le[Z])):[p("pivot.valueLabel")];return nr(Ee)===R.colKey});U[R.id]=Vr(_,R.valueItem.fieldId,R.valueItem.aggregation);}),U},se=[];if(ke.length===0)se.push({key:"root",value:p("pivot.resultLabel")||Gp,children:[],isLeaf:true,aggregatedValues:j(Dt),path:[],depth:0});else {let z=(U,R,_)=>{if(R>=ke.length)return [];let le=ke[R],Ee=new Map;return U.forEach(Z=>{let ee=aa(Z[le]);Ee.has(ee)||Ee.set(ee,[]),Ee.get(ee).push(Z);}),Array.from(Ee.keys()).sort().map(Z=>{let ee=Ee.get(Z),Ne=[..._,Z];return {key:nr(Ne),value:Z,fieldId:le,aggregatedValues:j(ee),children:z(ee,R+1,Ne),isLeaf:R===ke.length-1,path:Ne,depth:R}})};se.push(...z(Dt,0,[]));}return {dataColumns:E,columnTree:W,rowTree:se}},[ce,B,Dt,P,ke,p,Te]),to=mt.useCallback((b,A)=>(g.current+=1,{tokenId:`v${g.current}`,fieldId:b,aggregation:Mt(A,B.get(b))}),[B]),La=mt.useCallback(b=>{if(b==="rows")return ye([]);if(b==="columns")return Re([]);if(b==="filters")return Se([]);he([]);},[]),za=mt.useCallback((b,A)=>{if(b==="rows")return ye(E=>E.filter(W=>W!==A));if(b==="columns")return Re(E=>E.filter(W=>W!==A));if(b==="filters")return Se(E=>E.filter(W=>W!==A));he(E=>E.filter(W=>W.tokenId!==A));},[]),Na=mt.useCallback((b,A)=>{he(E=>E.map(W=>W.tokenId===b?{...W,aggregation:Mt(A,B.get(W.fieldId))}:W));},[B]),Uo=mt.useCallback(b=>{Jt(String(b.active.id));},[]),Mo=mt.useCallback(b=>{if(Jt(null),!b.over)return;let A=ts(String(b.active.id)),E=ts(String(b.over.id));if(!A||!E||A.kind!=="item"||!A.key)return;if(A.zone===E.zone&&E.kind==="item"){if(A.zone==="rows"){let Z=ke.indexOf(A.key),ee=ke.indexOf(E.key??"");Z!==-1&&ee!==-1&&Z!==ee&&ye(Ne=>sortable.arrayMove(Ne,Z,ee));return}if(A.zone==="columns"){let Z=ce.indexOf(A.key),ee=ce.indexOf(E.key??"");Z!==-1&&ee!==-1&&Z!==ee&&Re(Ne=>sortable.arrayMove(Ne,Z,ee));return}if(A.zone==="filters"){let Z=ft.indexOf(A.key),ee=ft.indexOf(E.key??"");Z!==-1&&ee!==-1&&Z!==ee&&Se(Ne=>sortable.arrayMove(Ne,Z,ee));return}if(A.zone==="values"){let Z=Te.findIndex(Ne=>Ne.tokenId===A.key),ee=Te.findIndex(Ne=>Ne.tokenId===(E.key??""));Z!==-1&&ee!==-1&&Z!==ee&&he(Ne=>sortable.arrayMove(Ne,Z,ee));}return}let W=E.zone,j=[...ke],se=[...ce],z=[...ft],U=[...Te],R="",_=null;if(A.zone==="palette")R=A.key;else if(A.zone==="values"){let Z=U.find(ee=>ee.tokenId===A.key);if(!Z)return;R=Z.fieldId,_=Z,U=U.filter(ee=>ee.tokenId!==A.key);}else A.zone==="rows"?(R=A.key,j=j.filter(Z=>Z!==R)):A.zone==="columns"?(R=A.key,se=se.filter(Z=>Z!==R)):A.zone==="filters"&&(R=A.key,z=z.filter(Z=>Z!==R));if(!R)return;let le=()=>{j=j.filter(Z=>Z!==R),se=se.filter(Z=>Z!==R),z=z.filter(Z=>Z!==R);},Ee=Z=>{if(E.kind!=="item"||!E.key)return Z==="rows"?j.length:Z==="columns"?se.length:Z==="filters"?z.length:Z==="values"?U.length:0;if(Z==="rows"){let ee=j.indexOf(E.key);return ee>=0?ee:j.length}if(Z==="columns"){let ee=se.indexOf(E.key);return ee>=0?ee:se.length}if(Z==="filters"){let ee=z.indexOf(E.key);return ee>=0?ee:z.length}if(Z==="values"){let ee=U.findIndex(Ne=>Ne.tokenId===E.key);return ee>=0?ee:U.length}return 0};if(W==="palette"){ye(j),Re(se),Se(z),he(U);return}if(W==="values"){let Z=Ee("values"),ee=_??to(R);U.splice(Z,0,ee),ye(j),Re(se),Se(z),he(U);return}if(jp(W)){le();let Z=Ee(W);W==="rows"?j.splice(Z,0,R):W==="columns"?se.splice(Z,0,R):z.splice(Z,0,R),ye(j),Re(se),Se(z),he(U);}},[ce,to,ft,ke,Te]),Ao=mt.useCallback((b,A)=>{Ce(E=>({...E,[b]:A}));},[]),Va=mt.useCallback(b=>{co(A=>{let E=new Set(A);return E.has(b)?E.delete(b):E.add(b),E});},[]),Oa=mt.useCallback(b=>{uo(A=>{let E=new Set(A);return E.has(b)?E.delete(b):E.add(b),E});},[]),pa=mt.useCallback(b=>{let A=B.get(b.fieldId),E=Ul(A);return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:98},children:jsxRuntime.jsx(material.Select,{value:b.aggregation,onChange:W=>Na(b.tokenId,W.target.value),onClick:W=>W.stopPropagation(),onMouseDown:W=>W.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:E.map(W=>jsxRuntime.jsx(material.MenuItem,{value:W,sx:{fontSize:"0.75rem"},children:P(W)},W))})})},[B,P,Na]),zt=mt.useCallback(b=>{let A=Ht[b]??[],E=Pt[b]??A;return A.length===0?p("pivot.filter.noValues"):E.length===0?p("pivot.filter.noneSelected"):E.length===A.length?p("pivot.filter.allValues"):p("pivot.filter.selectedCount",{selected:E.length,total:A.length})},[Ht,Pt,p]),Nt=mt.useCallback(b=>{let A=Ht[b]??[],E=Pt[b]??A;return jsxRuntime.jsx(eu,{options:A,selectedValues:E,onChange:W=>Ao(b,W)})},[Ht,Pt,Ao]),Bo=mt.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),Ko=mt.useCallback(()=>{let b={};return new Set([...Lt,...Object.keys(Pt)]).forEach(E=>{if(!S.has(E))return;let W=Pt[E]??[];b[E]=[...W];}),{layout:{rows:[...ke],columns:[...ce],filters:[...ft],values:Te.map(E=>({fieldId:E.fieldId,aggregation:E.aggregation}))},filterSelections:b,showGrandTotal:mo,chart:{dimensionFieldId:N,primaryValueFieldId:O,secondaryValueFieldId:G,chartType:ue}}},[Lt,N,O,G,ue,ce,ft,Pt,ke,mo,S,Te]),qo=mt.useCallback(b=>{let A=pt(b.layout.rows,S),E=pt(b.layout.columns,S),W=pt(b.layout.filters,S),j=new Set,se=(b.layout.values??[]).filter(R=>!S.has(R.fieldId)||j.has(R.fieldId)?false:(j.add(R.fieldId),true)).map(R=>to(R.fieldId,R.aggregation)),z={};Object.entries(b.filterSelections??{}).forEach(([R,_])=>{!S.has(R)||!Array.isArray(_)||(z[R]=Array.from(new Set(_.map(le=>String(le)))));}),ye(A),Re(E),Se(W),he(se),Ce(z),typeof b.showGrandTotal=="boolean"&&je(b.showGrandTotal),go(ac(A,E,b.chart?.dimensionFieldId));let U=hs(se,b.chart?.primaryValueFieldId);$t(U),eo(rc(se,U,b.chart?.secondaryValueFieldId)),Do(b.chart?.chartType??"bar-vertical"),H(b.id),I?.(b);},[to,I,go,$t,eo,Do,Re,Se,Ce,ye,je,he,S]),Wa=mt.useCallback(b=>{if(!b){H("");return}let A=ie.find(E=>E.id===b);if(!A){H("");return}qo(A);},[qo,ie]),$a=mt.useCallback(()=>{let b=p("pivot.preset.defaultName",{index:ie.length+1});$e(b),ne(true);},[ie.length,p]),ua=mt.useCallback(()=>{let b=pe.trim();if(!b)return;let A={id:Bo(),name:b,...Ko()};Et(E=>[...E,A]),H(A.id),ne(false);},[Ko,Bo,pe,Et]),ma=mt.useCallback(()=>{gt&&(Et(b=>b.filter(A=>A.id!==gt)),H(""));},[gt,Et]);mt.useEffect(()=>{if(!h||y.current)return;let b=ie.find(A=>A.id===h);b&&(y.current=true,qo(b));},[qo,h,ie]),mt.useEffect(()=>{gt&&(ie.some(b=>b.id===gt)||H(""));},[gt,ie]);let _o=mt.useMemo(()=>{if(!mo||!Ie||!ke.length)return null;let b={};return Ie.dataColumns.forEach(A=>{let E=Dt.filter(W=>{let j=ce.length>0?ce.map(se=>aa(W[se])):[p("pivot.valueLabel")];return nr(j)===A.colKey});b[A.id]=Vr(E,A.valueItem.fieldId,A.valueItem.aggregation);}),{key:"__grand_total__",value:p("pivot.grandTotal")||Up,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:b,path:[],depth:-1}},[mo,Ie,Dt,ce,ke.length,p]),oo=mt.useMemo(()=>Su(Ie?.rowTree??[]),[Ie]),Fo=mt.useMemo(()=>Su(Ie?.columnTree??[]),[Ie]);mt.useEffect(()=>{co(b=>{let A=new Set;return b.has("__grand_total__")&&A.add("__grand_total__"),oo.forEach(E=>{b.has(E)&&A.add(E);}),A});},[oo]),mt.useEffect(()=>{uo(b=>{let A=new Set;return Fo.forEach(E=>{b.has(E)&&A.add(E);}),A});},[Fo]);let fr=mt.useCallback(()=>{co(b=>{let A=new Set(b);return oo.forEach(E=>A.add(E)),A});},[oo]),Ha=mt.useCallback(()=>{co(b=>{let A=new Set;return b.has("__grand_total__")&&A.add("__grand_total__"),A});},[]),hr=mt.useCallback(()=>{uo(new Set(Fo));},[Fo]),yr=mt.useCallback(()=>{uo(new Set);},[]),br=mt.useMemo(()=>!Ie||ce.length===0?[]:nv(Ie.columnTree,po),[ce.length,po,Ie]),Gt=mt.useMemo(()=>{if(!Ie)return [];if(ce.length===0)return Ie.dataColumns.map(A=>({id:A.id,label:A.label,leafColumnIds:[A.id],valueItem:A.valueItem}));let b=new Map(Ie.dataColumns.map(A=>[A.id,A]));return br.flatMap(A=>{let E=new Map;return A.leafColumnIds.forEach(W=>{let j=b.get(W);if(!j)return;let se=j.valueItem.tokenId,z=`${P(j.valueItem.aggregation)} ${B.get(j.valueItem.fieldId)?.label??j.valueItem.fieldId}`,U=E.get(se);if(U){U.leafColumnIds.push(W);return}E.set(se,{id:`${A.key}::${se}`,label:Te.length>1?z:A.label,leafColumnIds:[W],valueItem:j.valueItem});}),Array.from(E.values())})},[ce.length,B,P,Ie,Te.length,br]),xr=mt.useMemo(()=>new Map(Gt.map(b=>[b.id,b])),[Gt]),Zo=mt.useMemo(()=>Gt.map(b=>({id:b.id,colKey:b.id,valueItem:b.valueItem,label:b.label})),[Gt]),Eo=mt.useMemo(()=>{if(!Ie||ce.length===0)return [];let b=[],A=Iu(Ie.columnTree,po),E=A+(Te.length>1?1:0),W=(j,se)=>{b[se]??(b[se]=[]),j.forEach(z=>{let U=z.children.length>0&&po.has(z.key),R=Gt.filter(le=>z.leafColumnIds.some(Ee=>le.leafColumnIds.includes(Ee))).length,_=U||Te.length>1?1:E-se;b[se].push({key:z.key,label:z.label,colSpan:R,rowSpan:_,expandable:z.children.length>0,expanded:U}),U&&W(z.children,se+1);});};return W(Ie.columnTree,0),Te.length>1&&(b[A]=Gt.map(j=>({key:j.id,label:j.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),b},[ce.length,po,Ie,Te.length,Gt]),vr=mt.useCallback((b,A)=>A.leafColumnIds.reduce((E,W)=>E+(b.aggregatedValues[W]??0),0),[]),Ga=mt.useMemo(()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:fr,disabled:oo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.expandRowsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Ha,disabled:oo.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:hr,disabled:Fo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.expandColumnsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:yr,disabled:ce.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.collapseColumnsAll")})]}),[ce.length,Fo.size,oo.size,yr,Ha,hr,fr,p]),ga=()=>{if(!Me)return null;let b=ts(Me);if(!b||b.kind!=="item"||!b.key)return null;if(b.zone==="palette"){let j=B.get(b.key);return j?jsxRuntime.jsx(ql,{label:j.label,subtitle:j.type}):null}if(b.zone==="values"){let j=Te.find(R=>R.tokenId===b.key);if(!j)return null;let z=B.get(j.fieldId)?.label??j.fieldId,U=`${P(j.aggregation)}(${z})`;return jsxRuntime.jsx(ss,{label:z,caption:U})}let E=B.get(b.key)?.label??b.key,W=zt(b.key);return jsxRuntime.jsx(ss,{label:E,caption:W})};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:gt,displayEmpty:true,onChange:b=>Wa(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")}),ie.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:$a,"aria-label":p("pivot.preset.save"),children:jsxRuntime.jsx(_d__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:ma,disabled:!gt,"aria-label":p("pivot.preset.delete"),children:jsxRuntime.jsx(X0__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:Dt.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:mo,onChange:b=>je(b.target.checked)})]})]})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(core.DndContext,{sensors:C,collisionDetection:core.closestCenter,onDragStart:Uo,onDragEnd:Mo,children:[jsxRuntime.jsx(lu,{isConfiguratorCollapsed:Ba,onToggleCollapse:()=>Rt(b=>!b),availableFields:Ea,fieldMap:B,filterFields:ft,columnFields:ce,rowFields:ke,valueFields:Te,clearZone:La,removeFieldFromZone:za,getFilterSelectionSummary:zt,renderDimensionFilterSelect:Nt,renderAggregationSelect:pa,getAggregationLabel:P}),jsxRuntime.jsx(material.Portal,{children:jsxRuntime.jsx(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:ga()})})]}),jsxRuntime.jsx(hu,{rows:Dt,fieldMap:B,rowFields:ke,columnFields:ce,valueFields:Te,chartDimensionFieldId:N,chartPrimaryValueFieldId:O,chartSecondaryValueFieldId:G,chartType:ue,isCollapsed:fe,onChartDimensionFieldIdChange:b=>go(b),onChartPrimaryValueFieldIdChange:b=>$t(b),onChartSecondaryValueFieldIdChange:b=>eo(b),onChartTypeChange:b=>Do(b),onToggleCollapse:()=>Fa(b=>!b),getAggregationLabel:P}),jsxRuntime.jsx(Gr,{title:p("pivot.table.sectionTitle"),subtitle:ke.length>0?ke.map(b=>B.get(b)?.label??b).join(" > "):p("pivot.table.dimensions"),collapsed:we,onToggleCollapse:()=>da(b=>!b),expandAriaLabel:p("pivot.table.collapse.ariaExpand"),collapseAriaLabel:p("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:Ga,children:Ie===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:k})}):jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:i},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:(Eo.length>0?Eo:[[]]).map((b,A)=>jsxRuntime.jsxs(material.TableRow,{children:[A===0&&jsxRuntime.jsx(material.TableCell,{rowSpan:Math.max(Eo.length,1),sx:E=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:E.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${E.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:ke.length>0?ke.map(E=>B.get(E)?.label).join(" > "):p("pivot.table.dimensions")}),(b.length>0?b:Gt.map(E=>({key:E.id,label:E.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(E=>jsxRuntime.jsx(material.TableCell,{align:"center",colSpan:E.colSpan,rowSpan:E.rowSpan,sx:W=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:W.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${W.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:jsxRuntime.jsxs(material.Box,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[E.expandable&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>Oa(E.key),sx:{p:.1,ml:-0.3},children:E.expanded?jsxRuntime.jsx(uf__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(Zg__default.default,{sx:{fontSize:16}})}),jsxRuntime.jsx(material.Box,{component:"span",children:E.label})]})},E.key))]},`pivot-header-row-${A}`))}),jsxRuntime.jsxs(material.TableBody,{children:[Ie.rowTree.map(b=>jsxRuntime.jsx(ms,{node:b,dataColumns:Zo,fieldMap:B,level:0,expandedKeys:lo,onToggle:Va,getValue:(A,E)=>{let W=xr.get(E);return W?vr(A,W):0}},b.key)),_o&&jsxRuntime.jsx(ms,{node:_o,dataColumns:Zo,fieldMap:B,level:0,expandedKeys:lo,onToggle:Va,getValue:(b,A)=>{let E=xr.get(A);return E?vr(b,E):0}})]})]})})}),jsxRuntime.jsxs(material.Dialog,{open:de,onClose:()=>ne(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:pe,onChange:b=>$e(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),ua());}})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>ne(false),children:p("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:ua,disabled:!pe.trim(),children:p("common.save")})]})]})]})};var Tu=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},ic=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",Pu=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",TA=({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),l=mt.useMemo(()=>new Set(e.map(H=>H.id)),[e]),s=mt.useMemo(()=>new Map(e.map(H=>[H.id,H])),[e]),[u,f]=mt.useState(()=>pt(t?.rows,l)),[m,h]=mt.useState(()=>pt(t?.columns,l)),[I,p]=mt.useState(()=>pt(t?.filters,l)),[C,g]=mt.useState(()=>{let H=t?.values??[],de=new Set,ne=[];return H.forEach(pe=>{!l.has(pe.fieldId)||de.has(pe.fieldId)||(de.add(pe.fieldId),d.current+=1,ne.push({tokenId:`v${d.current}`,fieldId:pe.fieldId,aggregation:Mt(pe.aggregation,s.get(pe.fieldId))}));}),ne}),[y,x]=mt.useState(o),[k,L]=mt.useState(a),[P,S]=mt.useState(r),[B,T]=mt.useState(()=>Tu(pt(t?.rows,l),pt(t?.columns,l),n?.dimensionFieldId)),[v,M]=mt.useState(()=>{let H=(()=>{let de=t?.values??[],ne=new Set,pe=[];return de.forEach($e=>{!l.has($e.fieldId)||ne.has($e.fieldId)||(ne.add($e.fieldId),pe.push({tokenId:$e.fieldId,fieldId:$e.fieldId,aggregation:Mt($e.aggregation,s.get($e.fieldId))}));}),pe})();return ic(H,n?.primaryValueFieldId)}),[w,D]=mt.useState(()=>{let H=(()=>{let ne=t?.values??[],pe=new Set,$e=[];return ne.forEach(Me=>{!l.has(Me.fieldId)||pe.has(Me.fieldId)||(pe.add(Me.fieldId),$e.push({tokenId:Me.fieldId,fieldId:Me.fieldId,aggregation:Mt(Me.aggregation,s.get(Me.fieldId))}));}),$e})(),de=ic(H,n?.primaryValueFieldId);return Pu(H,de,n?.secondaryValueFieldId)}),[F,$]=mt.useState(n?.chartType??"bar-vertical"),[V,q]=mt.useState(i),[Y,te]=mt.useState(c);mt.useEffect(()=>{f(H=>{let de=H.filter(ne=>l.has(ne));return ra(H,de)?H:de}),h(H=>{let de=H.filter(ne=>l.has(ne));return ra(H,de)?H:de}),p(H=>{let de=H.filter(ne=>l.has(ne));return ra(H,de)?H:de}),g(H=>{let de=H.filter(ne=>l.has(ne.fieldId)).map(ne=>({...ne,aggregation:Mt(ne.aggregation,s.get(ne.fieldId))}));return os(H,de)?H:de});},[s,l]),mt.useEffect(()=>{T(H=>Tu(u,m,H));},[m,u]),mt.useEffect(()=>{M(H=>ic(C,H));},[C]),mt.useEffect(()=>{D(H=>Pu(C,v,H));},[v,C]);let oe=mt.useCallback(H=>{f(pt(H,l));},[l]),ae=mt.useCallback(H=>{h(pt(H,l));},[l]),Ft=mt.useCallback(H=>{p(pt(H,l));},[l]),lt=mt.useCallback(H=>{g(de=>{let ne=H??[],pe=new Set,$e=[];return ne.forEach(Me=>{if(!l.has(Me.fieldId)||pe.has(Me.fieldId))return;pe.add(Me.fieldId);let Jt=de.find(lo=>lo.fieldId===Me.fieldId);if(Jt){$e.push({...Jt,aggregation:Mt(Me.aggregation??Jt.aggregation,s.get(Me.fieldId))});return}d.current+=1,$e.push({tokenId:`v${d.current}`,fieldId:Me.fieldId,aggregation:Mt(Me.aggregation,s.get(Me.fieldId))});}),$e});},[s,l]),Ke=mt.useCallback(H=>{oe(H.rows??[]),ae(H.columns??[]),Ft(H.filters??[]),lt(H.values??[]);},[ae,Ft,oe,lt]),ge=mt.useCallback(H=>{if(H==="rows")return f([]);if(H==="columns")return h([]);if(H==="filters")return p([]);g([]);},[]),De=mt.useCallback((H,de)=>{if(H==="rows")return f(ne=>ne.filter(pe=>pe!==de));if(H==="columns")return h(ne=>ne.filter(pe=>pe!==de));if(H==="filters")return p(ne=>ne.filter(pe=>pe!==de));g(ne=>ne.filter(pe=>pe.tokenId!==de));},[]),Fe=mt.useCallback((H,de)=>{g(ne=>ne.map(pe=>pe.tokenId===H?{...pe,aggregation:Mt(de,s.get(pe.fieldId))}:pe));},[s]),Je=mt.useCallback((H,de)=>{x(ne=>({...ne,[H]:de}));},[]),Tt=mt.useCallback(()=>{x({});},[]),qe=mt.useCallback(()=>{L(H=>!H);},[]),rt=mt.useCallback(()=>{S(H=>!H);},[]),Ho=mt.useCallback(H=>{T(H);},[]),Io=mt.useCallback(H=>{M(H);},[]),To=mt.useCallback(H=>{D(H);},[]),Po=mt.useCallback(()=>{q(H=>!H);},[]),Ro=mt.useCallback(()=>{te(H=>!H);},[]);return {model:mt.useMemo(()=>({rowFields:u,setRowFields:f,columnFields:m,setColumnFields:h,filterFields:I,setFilterFields:p,valueFields:C,setValueFields:g,filterSelections:y,setFilterSelections:x,showGrandTotal:k,setShowGrandTotal:L,isConfiguratorCollapsed:P,setIsConfiguratorCollapsed:S,chartDimensionFieldId:B,setChartDimensionFieldId:T,chartPrimaryValueFieldId:v,setChartPrimaryValueFieldId:M,chartSecondaryValueFieldId:w,setChartSecondaryValueFieldId:D,chartType:F,setChartType:$,isChartCollapsed:V,setIsChartCollapsed:q,isTableCollapsed:Y,setIsTableCollapsed:te}),[B,v,w,F,m,I,y,V,P,Y,u,k,C]),actions:{setRows:oe,setColumns:ae,setFilters:Ft,setValues:lt,setLayout:Ke,clearZone:ge,removeFieldFromZone:De,setAggregationForValue:Fe,setFilterSelection:Je,resetFilterSelections:Tt,toggleGrandTotal:qe,toggleConfigurator:rt,setChartDimension:Ho,setChartPrimaryValue:Io,setChartSecondaryValue:To,setChartType:$,toggleChart:Po,toggleTable:Ro}}};var AA=({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 l=u=>{d(u),o?.(u);};return {resolvedOrientation:i,isPortraitViewport:r,isCompactViewport:n,navigationOpen:c,setNavigationOpen:l,toggleNavigationOpen:()=>l(!c)}};var uv=e=>{let t=Number(e||0);return Number.isFinite(t)?t:0},EA=({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(m=>m[t]===i)||e[0],[t,e,i]),[l,s]=mt.useState(()=>{let m=d?.[o];return m==null?"0":String(m)});return {selectedId:i,selectedRecord:d,editorValue:l,setEditorValue:s,selectRecord:m=>{let h=m[t];c(h);let I=m[o];s(I==null?"0":String(I));},applyEditorValue:m=>{if(i===void 0)return;let h=uv(l),I=e.map(p=>p[t]===i?{...p,[o]:h}:p);m(I);}}};var Sv=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],Fu=(e,t,o,a)=>{t?.(e),a&&o?.();},WA=({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=Sv,facingMode:n="environment",manualEntry:i=true,autoCloseOnDetect:c=true,scanIntervalMs:d=600,confirmLabel:l="Use code",cancelLabel:s="Close",manualPlaceholder:u="Enter barcode manually",onDetected:f,onError:m,sx:h})=>{let I=mt__namespace.default.useRef(null),p=mt__namespace.default.useRef(null),C=mt__namespace.default.useRef(null),g=mt__namespace.default.useRef(null),[y,x]=mt__namespace.default.useState("idle"),[k,L]=mt__namespace.default.useState(""),[P,S]=mt__namespace.default.useState(null),[B,T]=mt__namespace.default.useState(null),v=mt__namespace.default.useCallback(()=>{C.current!==null&&(window.clearInterval(C.current),C.current=null),p.current&&(p.current.getTracks().forEach(D=>D.stop()),p.current=null),I.current&&(I.current.srcObject=null);},[]),M=mt__namespace.default.useCallback(D=>{T(D),x("error"),m?.(D);},[m]);mt__namespace.default.useEffect(()=>{if(!e){v(),x("idle"),T(null),L("");return}let D=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){x("unsupported"),T("Camera access is not supported in this browser.");return}x("starting"),T(null);try{let $=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:n}}});if(D){$.getTracks().forEach(V=>V.stop());return}if(p.current=$,I.current&&(I.current.srcObject=$,await I.current.play()),!window.BarcodeDetector){x("unsupported"),T("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}g.current=new window.BarcodeDetector({formats:r}),x("ready"),C.current=window.setInterval(async()=>{if(!(!I.current||!g.current)&&!(I.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let q=(await g.current.detect(I.current)).find(te=>te.rawValue);if(!q?.rawValue)return;let Y={rawValue:q.rawValue,format:q.format};S(Y),v(),Fu(Y,f,t,c);}catch(V){M(V instanceof Error?V.message:"Failed to detect barcode.");}},d);}catch($){M($ instanceof Error?$.message:"Unable to start camera.");}}})(),()=>{D=true,v();}},[c,n,r,t,f,e,M,d,v]);let w=()=>{let D=k.trim();if(!D)return;let F={rawValue:D,format:"manual"};S(F),Fu(F,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:D=>({position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:D.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:I,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(Cv__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"}),P?jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(kv__default.default,{}),label:`${P.format||"barcode"}: ${P.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),B?jsxRuntime.jsx(material.Alert,{severity:y==="unsupported"?"info":"warning",children:B}):null,i?jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[jsxRuntime.jsx(material.TextField,{fullWidth:true,label:"Barcode",placeholder:u,value:k,onChange:D=>L(D.target.value)}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:w,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 Pv={default:"#475569",primary:"#1d4ed8",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#0369a1"},qA=({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:u=88,startAction:f,endAction:m,dragHandleProps:h,onClick:I,onSwipe:p,sx:C})=>{let[g,y]=mt.useState(0),[x,k]=mt.useState(false),L=mt.useRef(null),P=mt.useRef(0),S=mt.useRef(0),B=!!(f||m),T=132,v=()=>{y(0),k(false),L.current=null,P.current=0,S.current=0;},M=V=>{(V==="start"?f:m)?.onTrigger?.(),p?.(V),v();},w=V=>{!B||V.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(L.current=V.pointerId,P.current=V.clientX,S.current=V.clientX,k(true),V.currentTarget.setPointerCapture(V.pointerId));},D=V=>{if(!x||L.current!==V.pointerId)return;S.current=V.clientX;let q=S.current-P.current,Y=Math.max(-T,Math.min(T,q));y(Y);},F=V=>{if(!x||L.current!==V.pointerId)return;let q=S.current-P.current;if(q>=u&&f){M("start");return}if(q<=-u&&m){M("end");return}Math.abs(q)<12&&I?.(),v();},$=(V,q)=>{if(!V)return null;let Y=V.backgroundColor||Pv[V.tone||"default"];return jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:0,bottom:0,[q]:0,width:T,px:2,display:"flex",alignItems:"center",justifyContent:q==="left"?"flex-start":"flex-end",color:"#fff",background:`linear-gradient(135deg, ${Y}, 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:[$(f,"left"),$(m,"right"),jsxRuntime.jsx(material.Paper,{elevation:0,onPointerDown:w,onPointerMove:D,onPointerUp:F,onPointerCancel:v,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(17,24,39,0.96), rgba(15,23,42,0.92))":"linear-gradient(180deg, #ffffff, #f8fafc)",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(${s?.985:1})`,transition:x?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:I?"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(Tv__default.default,{})})}):null]}),r.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:r.map((V,q)=>jsxRuntime.jsx(material.Chip,{label:V,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover"}},q))}):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"},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 Kn=({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}),tB=({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:u,onSubmit:f,onClose:m,sx:h})=>{let{t:I}=K(),[p,C]=mt.useState(t),g=e??p,y=v=>{e===void 0&&C(v),u?.(v);},x=v=>{c&&g.length>=c||y(`${g}${v}`);},k=v=>{if(v==="00"){if(!g){y("0");return}x("00");return}x(v);},L=()=>{!n||g.includes(".")||y(g?`${g}.`:"0.");},P=()=>{if(i){if(g.startsWith("-")){y(g.slice(1));return}y(g?`-${g}`:"-");}},S=()=>{y(g.slice(0,-1));},B=()=>{y("");},T=()=>{f?.(g);};return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",background:"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]}),m?jsxRuntime.jsx(material.IconButton,{onClick:m,size:"small",children:jsxRuntime.jsx(Av__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(Kn,{label:v,onPress:()=>k(v)},v)),jsxRuntime.jsx(Kn,{label:i?"+/-":"00",onPress:i?P:()=>k("00")}),jsxRuntime.jsx(Kn,{label:"0",onPress:()=>k("0")}),jsxRuntime.jsx(Kn,{label:n?".":s?String(s):"DEL",onPress:n?L:S})]}),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:S,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",background:"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(Mv__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700},children:s||"DEL"})]})}),jsxRuntime.jsx(Kn,{label:String(l||"CLR"),onPress:B,emphasis:"danger"}),jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:T,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(Bv__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:800},children:d||I("common.ok")})]})})]})]})})};var Vu=({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(Ya,{...o})})};var Nv=(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);}},$u=({items:e,selectedId:t,orientation:o="auto",onItemSelect:a,sx:r})=>{let n=styles.useTheme(),i=material.useMediaQuery("(orientation: portrait)"),c=material.useMediaQuery(n.breakpoints.down("md")),d=o==="auto"?i||c?"portrait":"landscape":o,l=navigation.useRouter();return jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:d==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...r},children:e.map(s=>{let u=s.id===t,f=s.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"},children:jsxRuntime.jsx(material.Box,{component:"button",type:"button",disabled:s.disabled,onClick:()=>Nv(l,s,a),sx:{width:"100%",p:2,minHeight:d==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:s.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},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?f:"action.hover"},children:s.icon||jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900},children:s.title.slice(0,1).toUpperCase()})}),s.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:s.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:s.title}),s.caption?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:s.caption}):null,s.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:s.description}):null]})]})})},s.id)})})};var Ku=(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?Ku(a.children,t):[];return (r||n.length>0)&&o.push({...a,children:n.length>0?n:a.children}),o},[]):e,Xv=e=>{let t=new Set,o=a=>{a.forEach(r=>{r.children?.length&&(t.add(r.id),o(r.children));});};return o(e),t},qu=({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:u}=K(),f=styles.useTheme(),m=material.useMediaQuery("(orientation: portrait)"),h=material.useMediaQuery(f.breakpoints.down("md")),I=i==="auto"?m||h?"portrait":"landscape":i,p=n==="dark",C=navigation.useRouter(),g=navigation.usePathname(),[y,x]=mt.useState(""),[k,L]=mt.useState(new Set),P=mt.useMemo(()=>Ku(r,y),[r,y]),S=mt.useMemo(()=>y.trim()?Xv(P):k,[k,P,y]);mt.useEffect(()=>{e&&L(new Set);},[e]);let B=D=>D.appurl||D.href||"",T=D=>{s?.(D);let F=B(D);if(F){if(F.startsWith("http://")||F.startsWith("https://")){window.open(F,"_blank");return}C.push(F);}},v=D=>{let F=!!D.children?.length;if(e&&F){t?.();return}if(F){L($=>{let V=new Set($);return V.has(D.id)?V.delete(D.id):V.add(D.id),V});return}T(D);},M=D=>{let F=l||g,$=B(D);return !!($&&F===$)},w=(D,F=0)=>{let $=!!D.children?.length,V=S.has(D.id),q=M(D);return jsxRuntime.jsx(material.Box,{sx:{pl:F===0?0:1.5},children:jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:q?"primary.main":"divider",bgcolor:q?"action.selected":"background.paper"},children:[jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>v(D),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:q?"primary.main":"action.hover",color:q?"#fff":"text.primary"},children:D.icon||(D.title||D.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:D.title||D.label}),D.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:D.description}):null]}),$?jsxRuntime.jsx(Zv__default.default,{sx:{transform:V?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):jsxRuntime.jsx(jv__default.default,{color:"action"})]}),$?jsxRuntime.jsx(material.Collapse,{in:V,children:jsxRuntime.jsx(material.Box,{sx:{px:1.25,pb:1.25},children:D.children?.map(Y=>w(Y,F+1))})}):null]})},D.id)};return e?jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:I==="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:u("navigation.expand"),children:jsxRuntime.jsx(_v__default.default,{})}),r.map(D=>jsxRuntime.jsx(material.IconButton,{onClick:()=>v(D),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:M(D)?"primary.main":"action.hover",color:M(D)?"#fff":"text.primary"},children:D.icon||(D.title||D.label||"?").slice(0,1).toUpperCase()},D.id))]})}):jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:I==="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:D=>x(D.target.value),placeholder:u("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(Kv__default.default,{fontSize:"small",color:"action"})}}),I==="landscape"?jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(qv__default.default,{})}):null]}),c,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:P.length>0?P.map(D=>w(D)):jsxRuntime.jsx(material.Typography,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:u("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)},oC=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}),aC=(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)},rC=({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}`))})]})})},nC=e=>{let{t}=K(),o=styles.useTheme(),{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:l,fitContainer:s=false,fullWidth:u=false,maxHeight:f,loading:m=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:I,filterConfig:p,rowKey:C,tableKey:g="default",graphReport:y,quickCreate:x,quickEdit:k,quickDelete:L,serviceUrl:P,orientation:S="auto",cardTitleField:B,cardSubtitleFields:T,toolbarSlot:v,emptyState:M,rowHeight:w="comfortable",cardActionSlot:D,renderCardFooter:F,onRowClick:$}=e,V=a||t("table.title.default"),q=material.useMediaQuery("(orientation: portrait)"),Y=material.useMediaQuery(o.breakpoints.down("md")),te=S==="auto"?q||Y?"portrait":"landscape":S,{columns:oe,filterText:ae,setFilterText:Ft,visibleColumns:lt,showSummary:Ke,setShowSummary:ge,summaryColumns:De,grouping:Fe,setGrouping:Je,expandedGroups:Tt,groupAnchorEl:qe,setGroupAnchorEl:rt,summaryAnchorEl:Ho,setSummaryAnchorEl:Io,anchorEl:To,setAnchorEl:Po,contextMenu:Ro,sortedAndFilteredRows:gt,summaryRow:H,visibleRows:de,page:ne,setPage:pe,rowsPerPage:$e,setRowsPerPage:Me,totalDisplayCount:Jt,setSelected:lo,handleClick:co,toggleSummaryColumn:po,handleExport:uo,handleCloseContextMenu:ke,toggleColumnVisibility:ce,toggleGroupExpand:ft,toggleGroupField:Te,handleExpandGroupRecursively:Pt,handleCollapseGroupRecursively:mo,handleLayoutLoad:Ba,handleVariantLoad:N,handleLayoutSave:O,effectiveAppId:G,currentLayoutData:ue,currentLayoutId:fe,layoutIdToLoad:we,graphReportOpen:ie,handleOpenGraphReport:Pe,handleCloseGraphReport:ye}=Li(e),Re=y?.enabled??false,Se=Re&&(y?.interaction?.enabled??true),he=ki(),Ce=C||"id",je=mt__namespace.default.useMemo(()=>{let R=new Set(i);return gt.filter(_=>R.has(_?.[Ce]))},[Ce,i,gt]),Rt=je.length===1?je[0]:null,go=!!x?.enabled,$t=!!k?.enabled,eo=!!L?.enabled,Do=x?.fields,Fa=x?.excludeFields||[],da=x?.initialValues||{},Et=k?.fields,Go=k?.excludeFields||[],Ea=k?.editableFields||[],Lt=k?.nonEditableFields||[],Ht=k?.primaryKeys?.length?k.primaryKeys:[Ce],[Dt,Ie]=mt__namespace.default.useState(false),[to,La]=mt__namespace.default.useState(false),[za,Na]=mt__namespace.default.useState({}),[Uo,Mo]=mt__namespace.default.useState(false),[Ao,Va]=mt__namespace.default.useState(false),[Oa,pa]=mt__namespace.default.useState({}),[zt,Nt]=mt__namespace.default.useState(false),[Bo,Ko]=mt__namespace.default.useState(false),qo=m||to||Ao||Bo,Wa=mt__namespace.default.useMemo(()=>{let R=[...oe];if(Array.isArray(Do)&&Do.length>0){let _=new Set(Do);R=R.filter(le=>_.has(le.id));}if(Fa.length>0){let _=new Set(Fa);R=R.filter(le=>!_.has(le.id));}return R.filter(_=>!!_?.id)},[oe,Fa,Do]),$a=mt__namespace.default.useMemo(()=>{let R=[...oe];if(Array.isArray(Et)&&Et.length>0){let _=new Set(Et);R=R.filter(le=>_.has(le.id));}if(Go.length>0){let _=new Set(Go);R=R.filter(le=>!_.has(le.id));}return R.filter(_=>!!_?.id)},[oe,Go,Et]),ua=mt__namespace.default.useMemo(()=>new Set(Ht),[Ht]),ma=mt__namespace.default.useMemo(()=>new Set(Ea),[Ea]),_o=mt__namespace.default.useMemo(()=>new Set(Lt),[Lt]),oo=mt__namespace.default.useCallback(R=>ma.size>0?ma.has(R):!(_o.has(R)||ua.has(R)),[ma,_o,ua]);mt__namespace.default.useEffect(()=>{!ie&&he.hasActiveFilters&&he.clearAll();},[he,ie]);let Fo=()=>{let R={};Wa.forEach(_=>{R[_.id]=da[_.id]??"";}),Na(R),Ie(true);},fr=(R,_)=>{Na(le=>({...le,[R]:_}));},Ha=async()=>{if(!x?.onSubmit){Ie(false);return}try{La(!0),await x.onSubmit(za),Ie(!1);}finally{La(false);}},hr=()=>{if(!Rt)return;let R={};$a.forEach(le=>{R[le.id]=Rt[le.id]??"";});let _=k?.getInitialValues?{...R,...k.getInitialValues(Rt)}:R;pa(_),Mo(true);},yr=(R,_)=>{pa(le=>({...le,[R]:_}));},br=async()=>{if(Rt){if(!k?.onSubmit){Mo(false);return}try{Va(!0),await k.onSubmit(Oa,Rt),Mo(!1);}finally{Va(false);}}},Gt=()=>{je.length!==0&&Nt(true);},xr=async()=>{if(je.length===0){Nt(false);return}if(!L?.onConfirm){Nt(false),lo([]),c?.([]);return}try{Ko(!0),await L.onConfirm(je),Nt(!1),lo([]),c?.([]);}finally{Ko(false);}},Zo=gt,{fieldMapping:Eo}=Ar({rows:Zo,config:{...y,title:y?.title||`${V} ${t("graph.reportTitle")}`}}),vr=mt__namespace.default.useMemo(()=>Se?he.applyRows(Zo,Eo):Zo,[Eo,he,Se,Zo]),{model:Ga}=Ar({rows:vr,config:{...y,title:y?.title||`${V} ${t("graph.reportTitle")}`,fieldMapping:Eo}}),ga=Ga.table.columns.map(R=>({id:R.id,label:R.label,align:R.align||"left",minWidth:120,numeric:R.align==="right"})),b=G?jsxRuntime.jsx(Bi,{appId:G,tableKey:g,currentLayoutData:ue,onLayoutLoad:Ba,targetLayoutId:we,activeLayoutId:fe,serviceUrl:P??p?.serviceUrl}):null,A=oe.filter(R=>lt.includes(R.id)),E=A.find(R=>R.id===B)||A[0],W=T?.map(R=>A.find(_=>_.id===R)).filter(Boolean)||A.filter(R=>R.id!==E?.id).slice(0,te==="portrait"?2:3),j=A.filter(R=>R.id!==E?.id&&!W.some(_=>_.id===R.id)),se=[v,l].filter(Boolean),z=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ti,{groupAnchorEl:qe,setGroupAnchorEl:rt,grouping:Fe,setGrouping:Je,columns:oe,toggleGroupField:Te}),jsxRuntime.jsx(oi,{anchorEl:To,setAnchorEl:Po,columns:oe,visibleColumns:lt,toggleColumnVisibility:ce}),jsxRuntime.jsx(ai,{anchorEl:Ho,setAnchorEl:Io,showSummary:Ke,setShowSummary:ge,columns:oe,summaryColumns:De,toggleSummaryColumn:po}),jsxRuntime.jsx(ri,{contextMenu:Ro,handleCloseContextMenu:ke,columns:oe,visibleColumns:lt,toggleColumnVisibility:ce})]}),U=(R,_,le)=>{let Ee=i.includes(_),Z=te==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",ee=le%2===0?styles.alpha(o.palette.primary.main,.04):styles.alpha(o.palette.primary.main,.022),Ne=styles.alpha(o.palette.divider,.22);return jsxRuntime.jsx(material.Paper,{elevation:0,onClick:()=>{co({},R),$?.(R);},sx:{p:w==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Ee?styles.alpha(o.palette.primary.main,.38):Ne,background:Ee?`linear-gradient(135deg, ${styles.alpha(o.palette.primary.main,.13)}, ${styles.alpha(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${ee}, ${styles.alpha(o.palette.primary.main,.015)})`,boxShadow:Ee?`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:Ee?o.palette.primary.main:le%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:Ee,onClick:ct=>ct.stopPropagation(),onChange:()=>co({},R),sx:{mt:-0.6,ml:-0.6}}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[E?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:em(E,R)}):null,W.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:W.map(ct=>jsxRuntime.jsx(material.Chip,{label:`${ct.label}: ${aC(ct,R)}`,size:"small",variant:"outlined",sx:{borderRadius:999,fontWeight:600}},`${_}-${ct.id}`))}):null]}),D?jsxRuntime.jsx(material.Box,{onClick:ct=>ct.stopPropagation(),children:D(R)}):null]}),j.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:Z,gap:1},children:j.map(ct=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:styles.alpha(o.palette.background.paper,.8),border:"0.1px solid",borderColor:styles.alpha(o.palette.divider,.24)},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:ct.label}),oC(em(ct,R))]},`${_}-${ct.id}-detail`))}):null,F?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{onClick:ct=>ct.stopPropagation(),children:F(R)})]}):null]})},_)};return jsxRuntime.jsxs(material.Box,{sx:{width:u?"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(Vu,{...p,onVariantLoad:R=>{N(R),p.onVariantLoad?.(R);},appId:p.appId,tableKey:g,currentLayout:[{tableKey:g,layoutData:ue}],currentLayoutId:fe,layoutRefs:[{tableKey:g,layoutId:fe}],variantService:p.variantService,serviceUrl:P??p.serviceUrl,touchMode:te==="portrait"?"expanded":"comfortable"})}):null,jsxRuntime.jsxs(material.Paper,{sx:{width:u?"100%":"auto",mb:s?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":qo?{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(Qn,{filterText:ae,setFilterText:Ft,onRowsPerPageChange:Me,rowsPerPage:$e,rowsPerPageOptions:h,page:ne,count:Jt,onPageChange:pe,actions:d,extraTools:se,grouping:Fe,setGroupAnchorEl:rt,showSummary:Ke,setShowSummary:ge,setAnchorEl:Po,setSummaryAnchorEl:Io,handleExport:uo,showCreateButton:go,onOpenCreateDialog:Fo,showEditButton:$t,onOpenEditDialog:hr,editDisabled:je.length!==1,showDeleteButton:eo,onOpenDeleteConfirm:Gt,deleteDisabled:je.length===0,onLayoutSave:I||p?.variantService&&p?.appId?O:void 0,loading:m,layoutManager:b,onOpenGraphReport:Re?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:[de.length===0&&!m?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,de.map((R,_)=>{if(R.type==="group"){let Z=Tt.has(R.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:()=>ft(R.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"},children:[Z?jsxRuntime.jsx(Zv__default.default,{}):jsxRuntime.jsx(jv__default.default,{}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.94rem",fontWeight:800},children:[R.field,": ",R.value]}),jsxRuntime.jsxs(material.Typography,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[R.count," records"]})]}),Fe.length>1&&R.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:ee=>{ee.stopPropagation(),Pt(R.id);}}),jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.collapseAll"),onClick:ee=>{ee.stopPropagation(),mo(R.id);}})]}):null]})},R.id)}let le=R.data||R,Ee=R.id||le[Ce]||_;return U(le,Ee,_)}),Ke?jsxRuntime.jsx(rC,{summaryRow:H,visibleColumns:lt,columns:oe}):null,m?jsxRuntime.jsx(material.Typography,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:t("common.loading")}):null]})})]}),go?jsxRuntime.jsxs(material.Dialog,{open:Dt,onClose:()=>!to&&Ie(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(R=>{let _=R.type==="number"||R.numeric?"number":R.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:R.label||R.id,value:za[R.id]??"",onChange:le=>fr(R.id,le.target.value),type:_,fullWidth:true,InputLabelProps:{shrink:_==="date"?true:void 0}},`quick-create-${R.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:()=>Ie(false),disabled:to,children:x?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:Ha,variant:"contained",disabled:to,children:x?.submitLabel||t("common.save")})]})]}):null,$t?jsxRuntime.jsxs(material.Dialog,{open:Uo,onClose:()=>!Ao&&Mo(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:k?.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:[$a.map(R=>{let _=R.type==="number"||R.numeric?"number":R.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:R.label||R.id,value:Oa[R.id]??"",onChange:le=>yr(R.id,le.target.value),type:_,disabled:!oo(R.id),fullWidth:true,InputLabelProps:{shrink:_==="date"?true:void 0}},`quick-edit-${R.id}`)}),k?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:k.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>Mo(false),disabled:Ao,children:k?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:br,variant:"contained",disabled:Ao||!Rt,children:k?.submitLabel||t("common.save")})]})]}):null,eo?jsxRuntime.jsx(nn,{open:zt,type:"warning",title:L?.title||t("quickDelete.confirmTitle"),message:L?.message||(je.length>1?t("quickDelete.confirmMessageMultiple",{count:je.length}):t("quickDelete.confirmMessageSingle")),confirmText:L?.confirmText||t("common.delete"),cancelText:L?.cancelText||t("common.cancel"),onClose:()=>!Bo&&Nt(false),onConfirm:xr}):null,z,Re?jsxRuntime.jsx(vi,{open:ie,onClose:ye,model:Ga,aiAssistant:y?.aiAssistant,interaction:Se?{enabled:true,filters:he.filters,fieldMapping:Eo,onPrimaryDimensionClick:R=>he.setFilter("primaryDimension",R),onSecondaryDimensionClick:R=>he.setFilter("secondaryDimension",R),onStatusClick:R=>he.setFilter("status",R),onClearFilter:he.clearFilter,onClearAll:he.clearAll}:void 0,tableContent:jsxRuntime.jsx(nC,{appId:G||"graph-report-internal",title:t("graph.dataBody"),columns:ga,rows:Ga.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var jB=({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:u,contentSx:f,containerSx:m,user:h,onSearch:I,defaultNavigationOpen:p,navOpen:C,onNavOpenChange:g,onWorkloadSelect:y})=>{let x=styles.useTheme(),k=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),L=material.useMediaQuery(x.breakpoints.down("md"),{noSsr:true}),P=c==="auto"?k||L?"portrait":"landscape":c,[S,B]=mt.useState(p??false),[T,v]=mt.useState(""),[M,w]=mt.useState(false),D=C??S;mt.useEffect(()=>{w(true);},[]),mt.useEffect(()=>{C===void 0&&B(P==="landscape");},[C,P]);let F=q=>{C===void 0&&B(q),g?.(q);},$=jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{px:2,py:1.25,borderRadius:0,borderBottom:"1px solid",borderColor:"divider",background:x.palette.mode==="dark"?"linear-gradient(180deg, rgba(15,23,42,0.96), rgba(17,24,39,0.92))":"linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.94))"},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[n?jsxRuntime.jsx(material.IconButton,{onClick:()=>F(!D),sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(_v__default.default,{})}):null,d?jsxRuntime.jsx(material.Box,{sx:{display:"grid",placeItems:"center"},children:d}):null,jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:900},children:e}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:M?P==="portrait"?"Pad portrait workspace":"Pad landscape workspace":"Pad workspace"})]}),jsxRuntime.jsx(material.Box,{sx:{flex:1}}),I?jsxRuntime.jsx(material.TextField,{value:T,onChange:q=>v(q.target.value),onKeyDown:q=>{q.key==="Enter"&&I(T);},size:"small",placeholder:"Search...",sx:{minWidth:{md:240},display:{xs:"none",sm:"block"}},InputProps:{startAdornment:jsxRuntime.jsx(Kv__default.default,{fontSize:"small",color:"action"})}}):null,s,h?jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[jsxRuntime.jsx(material.Avatar,{src:h.avatarSrc,sx:{width:38,height:38},children:h.avatarText||h.name.slice(0,1).toUpperCase()}),jsxRuntime.jsxs(material.Box,{sx:{display:{xs:"none",md:"block"}},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",fontWeight:800},children:h.name}),h.subtitle?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:h.subtitle}):null]})]}):null]}),l?jsxRuntime.jsx(material.Box,{sx:{mt:1.25},children:l}):null]}),V=jsxRuntime.jsx(qu,{collapsed:P==="landscape"?!D:false,onToggle:()=>F(!D),menuData:o,orientation:P,colorMode:x.palette.mode,maxHeight:P==="landscape"?900:void 0});return jsxRuntime.jsxs(material.Box,{sx:{minHeight:"100vh",display:"flex",flexDirection:"column",background:x.palette.mode==="dark"?"linear-gradient(180deg, #020617 0%, #0f172a 58%, #111827 100%)":"linear-gradient(180deg, #f8fafc 0%, #eef2ff 58%, #e2e8f0 100%)",...m},children:[$,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,display:"flex"},children:[n&&P==="landscape"?jsxRuntime.jsx(material.Box,{sx:{p:1.5,pr:0,flexShrink:0},children:V}):null,n&&P==="portrait"?jsxRuntime.jsx(material.Drawer,{open:D,onClose:()=>F(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:V}):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($u,{items:a,selectedId:r,orientation:P,onItemSelect:y}):null,jsxRuntime.jsx(material.Paper,{elevation:0,sx:{flex:1,minHeight:P==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:x.palette.mode==="dark"?"rgba(15,23,42,0.72)":"rgba(255,255,255,0.72)",backdropFilter:"blur(12px)"},children:t})]})})]}),P==="portrait"&&u?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{sx:{p:1.5},children:u})]}):null]})};var lm=wC__default.default(()=>Promise.resolve().then(()=>(sm(),im)).then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsxRuntime.jsx("div",{className:"h-full w-full bg-transparent"})});function hc({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(lm,{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(lm,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var a5=hc;function ws({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),l=mt.useRef(null),s=mt.useRef(null),u=mt.useRef(null),f=mt.useRef(null),m=mt.useRef(0),h=mt.useRef(false),I=mt.useRef(false),p=mt.useCallback(()=>{d.current&&(d.current.close(),d.current=null),u.current&&(u.current.disconnect(),u.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),I.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(p,500));},[p]),g=mt.useCallback(async()=>{if(!(i||I.current)){I.current=true,h.current=false,m.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),I.current=!1;},x.onmessage=B=>{try{let T=JSON.parse(B.data);if(T.type==="recognition")T.is_final?t(T.text):e?.(T.text);else if(T.type==="error"){let v=T.message||"Voice recognition error";o?.(v),C();}}catch{o?.("Failed to parse voice message");}},x.onerror=()=>{o?.("Voice service connection failed"),p();},x.onclose=()=>{p();};let k=window.AudioContext||window.webkitAudioContext;if(!k)throw new Error("AudioContext is not supported in this browser");let L=new k({sampleRate:16e3});s.current=L;let P=L.createMediaStreamSource(y);f.current=P;let S=L.createScriptProcessor(4096,1,1);u.current=S,S.onaudioprocess=B=>{if(d.current?.readyState!==WebSocket.OPEN)return;let T=B.inputBuffer.getChannelData(0),v=0;for(let D=0;D<T.length;D+=1)v+=T[D]*T[D];if(Math.sqrt(v/T.length)>n)m.current=Date.now();else if(Date.now()-m.current>r&&!h.current){C();return}let w=new Int16Array(T.length);for(let D=0;D<T.length;D+=1){let F=Math.max(-1,Math.min(1,T[D]));w[D]=F<0?F*32768:F*32767;}d.current.send(w.buffer);},P.connect(S),S.connect(L.destination);}catch{o?.("Cannot access microphone"),p();}}},[p,i,n,t,o,e,r,C,a]);return mt.useEffect(()=>p,[p]),{isRecording:i,startRecording:g,stopRecording:C}}var dm=mt.createContext(null);function EC(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 LC({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[u,f]=mt.useState(false),[m,h]=mt.useState(false),I=mt.useRef(null),p=mt.useRef(false),C=mt.useRef(false),g=mt.useCallback(()=>{C.current=false,f(false);},[]),{isRecording:y,startRecording:x,stopRecording:k}=ws({wsUrl:d,silenceThresholdMs:l,minVolumeRms:s,onTextUpdate:B=>{o?.(B);},onComplete:async B=>{try{B.trim()&&(h(!0),await t(B.trim()));}catch(T){let v=T instanceof Error?T.message:"Failed to process voice command";a?.(v);}finally{h(!1),g();}},onError:B=>{a?.(B),h(!1),p.current||g();}}),L=mt.useCallback(async()=>{C.current=false,await x();},[x]),P=mt.useCallback(()=>{k();},[k]);mt.useEffect(()=>{if(n)return;let B=v=>{v.isComposing||(v.code==="Space"||v.key===" ")&&(p.current||v.repeat||i&&EC(document.activeElement)||(p.current=true,v.preventDefault(),I.current=setTimeout(()=>{C.current=true,f(true),x();},r)));},T=v=>{(v.code==="Space"||v.key===" ")&&(I.current&&(clearTimeout(I.current),I.current=null),p.current=false,C.current&&(v.preventDefault(),f(false),k()));};return window.addEventListener("keydown",B),window.addEventListener("keyup",T),()=>{window.removeEventListener("keydown",B),window.removeEventListener("keyup",T),I.current&&(clearTimeout(I.current),I.current=null);}},[n,i,r,x,k]);let S=mt.useMemo(()=>({isRecording:y,isHotkeyRecording:u,isSubmitting:m,startRecording:L,stopRecording:P}),[u,y,m,L,P]);return jsxRuntime.jsxs(dm.Provider,{value:S,children:[c?jsxRuntime.jsx(hc,{isRecording:u}):null,e]})}function zC(){let e=mt.useContext(dm);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var p5=LC,u5=zC;function xe(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var GC=({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})]})},pm=GC;var QC=({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(l){console.error("\u590D\u5236\u5931\u8D25:",l);}},d=r==="dark"?prism.oneDark:prism.oneLight;return jsxRuntime.jsxs("div",{className:xe("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})})]})},mm=QC;var tk=({content:e,isLoading:t,className:o="",style:a})=>{let r=mt.useRef(null),[n,i]=mt.useState(false),[c,d]=mt.useState(null),{theme:l}=nextThemes.useTheme();return mt.useEffect(()=>{let s=async()=>{if(!(!e.trim()||!r.current)){i(true),d(null);try{fm__default.default.initialize({startOnLoad:!1,theme:l==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit"});let f=`mermaid-${Math.random().toString(36).substr(2,9)}`,m=e.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:h}=await fm__default.default.render(f,m);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);}}},u=setTimeout(()=>{s();},100);return ()=>clearTimeout(u)},[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})},ym=tk;var sk=({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,u]=mt.useState(false),[f,m]=mt.useState(false),h=async()=>{if(c){m(true);try{await c();}catch(I){console.error("\u91CD\u8BD5\u5931\u8D25:",I);}finally{m(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:()=>u(!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})})]})},Is=sk;var mk=({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="",...u})=>{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"}}},m=()=>{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}`,...u,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||m()}),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((I,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:I})]},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"})})]})},Ts=mk;var yk=({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,u]=mt.useState(false),[f,m]=mt.useState(""),[h,I]=mt.useState(false),p=mt.useMemo(()=>f.trim()?o.filter(y=>y.toLowerCase().includes(f.toLowerCase())):o,[o,f]),C=mt.useMemo(()=>s?p:p.slice(0,r),[p,s,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}`,...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:()=>I(!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=>m(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:()=>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"})]})},x))}),p.length>r&&jsxRuntime.jsx("button",{onClick:()=>u(!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"})]})]})},Ps=yk;var wk=({title:e,content:t,toolName:o,parameters:a,result:r,status:n,duration:i,icon:c,closable:d=false,onClose:l,onAction:s,actionText:u,className:f="",...m})=>{let[h,I]=mt.useState(false),[p,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"})}},x=P=>P?P<1e3?`${P}ms`:`${(P/1e3).toFixed(2)}s`:"",k=g(),L=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}`,...m,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 ${k.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:L}),jsxRuntime.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${k.badgeBg} ${k.badgeText}`,children:k.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:()=>I(!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:u||"\u6267\u884C\u64CD\u4F5C"})})]})]})},Rs=wk;var Tk=({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(Sa,{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]})})},Ds=Tk;var Lk=({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(pn,{data:o,orientation:r.orientation||"horizontal",valueSuffix:r.valueSuffix||"",minHeight:r.minHeight});case "line-chart-card":return jsxRuntime.jsx(id,{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(ui,{data:d,variant:r.variant||"donut",size:r.size,colors:r.colors});case "combo-chart-card":return jsxRuntime.jsx(sd,{data:o,barColor:r.barColor,lineColor:r.lineColor});case "heatmap-chart-card":return jsxRuntime.jsx(cd,{data:o});case "fishbone-chart-card":return jsxRuntime.jsx(pd,{branches:o,effect:r.effect||e||"Problem"});case "waterfall-chart-card":return jsxRuntime.jsx(md,{data:o,height:r.height});case "google-map-card":return jsxRuntime.jsx(hd,{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(vd,{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)})]})})]})]})},Ms=Lk;var Nk=({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)})})})]}),Bs=Nk;var Fs=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 Gk=({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,m)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(m.trim())}"></div>`):"",[e]),l=(f,m,h,I,p)=>{c?.onCardEvent?.({messageId:i,cardType:f,action:m,title:h,payload:I,rawData:p});},s=(f,m,h,I,p,C)=>{if(!(!p&&!c?.onCardEvent))return (...g)=>{let y=p?.(...g),x=C?C(...g):void 0;return l(f,m,h,x,I),y}},u=mt.useMemo(()=>({div(f){let{"data-component":m,"data-think-content":h,...I}=f;return m==="thinkbox"&&h?jsxRuntime.jsx(pm,{content:decodeURIComponent(h),theme:t,size:o,defaultExpanded:false}):jsxRuntime.jsx("div",{...I})},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:m}){return jsxRuntime.jsx("th",{className:`px-3 py-2 font-semibold text-gray-800 dark:text-gray-100 ${m==="center"?"text-center":m==="right"?"text-right":"text-left"}`,children:f})},td({children:f,align:m}){return jsxRuntime.jsx("td",{className:`px-3 py-2 text-gray-700 dark:text-gray-200 align-top ${m==="center"?"text-center":m==="right"?"text-right":"text-left"}`,children:f})},code({inline:f,className:m,children:h,...I}){let p=/language-([\w-]+)/.exec(m||""),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",...I,children:h});let g=String(h).replace(/\n$/,"");if(n&&C==="mermaid")return jsxRuntime.jsx(ym,{content:g});if(C==="json"){let y=Fs(g);if(y)switch(y.type){case "table":return jsxRuntime.jsx(Ds,{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(Ms,{...y});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(Bs,{...y});case "error-card":{let x=y;return jsxRuntime.jsx(Is,{...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,k=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(Ts,{...x,onClose:s("warning-card","close",x.title,x,x.onClose),onConfirm:k})}case "suggestions-card":{let x=y;return jsxRuntime.jsx(Ps,{...x,onClose:s("suggestions-card","close",x.title,x,x.onClose),onSuggestionClick:s("suggestions-card","suggestion-click",x.title,x,x.onSuggestionClick,k=>({suggestion:k}))})}case "tool-result-card":{let x=y;return jsxRuntime.jsx(Rs,{...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(mm,{content:g,language:C,className:"not-prose"}):jsxRuntime.jsx("code",{className:m,...I,children:h})}}),[t,o,n,r,c,i]);return jsxRuntime.jsx("div",{className:xe("markdown-body prose dark:prose-invert max-w-none",a),children:jsxRuntime.jsx(Vk__default.default,{remarkPlugins:[Ok__default.default,Wk__default.default],rehypePlugins:[$k__default.default,Hk__default.default],components:u,children:d})})},Es=Gk;var Uk=({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,u)=>{if(!(!s&&!o?.onCardEvent))return (...f)=>{let m=s?.(...f),h=u?u(...f):void 0;return a(i,c,d,h,l),m}},n=Fs(e);if(n)switch(n.type){case "table":return jsxRuntime.jsx(Ds,{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(Ms,{...n});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(Bs,{...n});case "error-card":{let i=n;return jsxRuntime.jsx(Is,{...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(Ts,{...i,onClose:r("warning-card","close",i.title,i,i.onClose),onConfirm:c})}case "suggestions-card":{let i=n;return jsxRuntime.jsx(Ps,{...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(Rs,{...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(Es,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:o})})},Pm=Uk;var Ic=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"}}},qk=({content:e,className:t="",messageId:o,cardHooks:a})=>{let r=mt__namespace.default.useMemo(()=>Ic.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(Pm,{content:n.content,messageId:o,cardHooks:a},`block-${i}`):jsxRuntime.jsx(Es,{content:n.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:a},`block-${i}`))})},Rm=qk;var _k=({content:e,isStreaming:t=true,onComplete:o,className:a="",streamIntervalMs:r=24,streamChunkSize:n=3,messageId:i,cardHooks:c})=>{let[d,l]=mt.useState(t?0:e.length),[s,u]=mt.useState(!t);mt.useEffect(()=>{if(t){l(0),u(false);return}l(e.length),u(true);},[e,t]),mt.useEffect(()=>{if(!t||s)return;if(d>=e.length){u(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),u(true),o?.());},m=t?e.slice(0,d):e,h=t&&!s,I=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(Rm,{content:m,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"}})]}),I&&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"})]})},Bm=_k;var Fm=({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:xe("flex items-center gap-1",t),children:e.map((a,r)=>jsxRuntime.jsx("button",{onClick:a.onClick,disabled:a.disabled,className:xe("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 Ls=({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(Bm,{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(Fm,{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 Lm=({onTextUpdate:e,onComplete:t,onCancel:o,disabled:a,className:r})=>{let{isRecording:n,startRecording:i,stopRecording:c}=ws({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:xe("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(eS__default.default,{sx:{fontSize:24}}):jsxRuntime.jsx(Jk__default.default,{sx:{fontSize:24}})})};var at={container:"w-full max-w-4xl mx-auto",inputContainer:xe("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:xe("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:xe("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:xe("bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400","cursor-pointer active:scale-95"),sendButton:xe("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:xe("cursor-not-allowed opacity-40 bg-transparent text-gray-400"),stopButton:xe("cursor-pointer bg-red-500 hover:bg-red-600 text-white shadow-sm active:scale-95")},lS={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},cS=({enabled:e,onClick:t})=>jsxRuntime.jsx("button",{className:xe(at.buttonBase,at.buttonSmall,at.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsxRuntime.jsx(iS__default.default,{sx:{fontSize:24}})}),dS=()=>jsxRuntime.jsxs("button",{className:xe(at.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",at.buttonNormal),"aria-label":"Tools",type:"button",children:[jsxRuntime.jsx(sS__default.default,{sx:{fontSize:20}}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),pS=({canSend:e,isResponding:t,onSend:o,onStop:a})=>t?jsxRuntime.jsx("button",{className:xe(at.buttonBase,at.buttonSmall,at.stopButton),onClick:a,"aria-label":"Stop generating",type:"button",children:jsxRuntime.jsx(iconsMaterial.Stop,{sx:{fontSize:20}})}):jsxRuntime.jsx("button",{className:xe(at.buttonBase,at.buttonSmall,e?at.sendButton:at.sendButtonDisabled),onClick:o,disabled:!e,"aria-label":"Send message",type:"button",children:jsxRuntime.jsx(nS__default.default,{sx:{fontSize:24},className:e?"text-gray-500 dark:text-gray-400":"text-gray-300 dark:text-gray-600"})}),zm=({onSend:e,onStop:t,isResponding:o=false,placeholder:a,getText:r})=>{let[n,i]=mt.useState(""),[c,d]=mt.useState([]),[l,s]=mt.useState(false),[u,f]=mt.useState(false),m=mt.useRef(null),h=a||(r?r("00019","Type a message..."):"Type a message..."),I=(n.trim().length>0||c.length>0)&&!o,p={enabled:true},C=mt.useCallback(F=>{i(F.target.value),F.target.style.height="auto",F.target.style.height=`${Math.min(F.target.scrollHeight,200)}px`;},[]),g=mt.useCallback(F=>{if(F.target.files&&F.target.files.length>0){let $=Array.from(F.target.files);d(V=>{let q=$.filter(te=>V.some(oe=>oe.name===te.name&&oe.size===te.size));q.length>0&&console.warn("Duplicate files ignored:",q.map(te=>te.name));let Y=$.filter(te=>!V.some(oe=>oe.name===te.name&&oe.size===te.size));return [...V,...Y]}),m.current&&(m.current.value="");}},[]),y=mt.useCallback(F=>{d($=>$.filter((V,q)=>q!==F));},[]),x=mt.useCallback(()=>{m.current?.click();},[]),k=mt.useCallback(async()=>{if(!I)return;let F=n,$=[...c];i(""),d([]),m.current&&(m.current.value="");try{await e(F,$);}catch(V){console.error("Failed to send message:",V),i(F),d($);}},[n,I,e,c]),L=mt.useCallback(F=>{F.key==="Enter"&&!F.shiftKey&&!l&&(F.preventDefault(),k());},[k,l]),P=mt.useCallback(()=>{s(true);},[]),S=mt.useCallback(()=>{s(false);},[]),B=mt.useCallback(F=>{i(F);},[]),T=mt.useCallback(F=>{i(F);},[]),v=mt.useCallback(()=>{},[]),M=mt.useCallback(F=>{F.preventDefault(),f(true);},[]),w=mt.useCallback(F=>{F.preventDefault(),f(false);},[]),D=mt.useCallback(F=>{if(F.preventDefault(),f(false),F.dataTransfer.files&&F.dataTransfer.files.length>0){let $=Array.from(F.dataTransfer.files);d(V=>[...V,...$]);}},[]);return jsxRuntime.jsx("div",{className:at.container,children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"file",multiple:true,className:"hidden",ref:m,onChange:g}),jsxRuntime.jsxs("div",{className:xe(at.inputContainer,u&&at.dragActive),style:{borderRadius:"32px"},onDragOver:M,onDragLeave:w,onDrop:D,children:[c.length>0&&jsxRuntime.jsx("div",{className:at.filePreviewArea,children:c.map((F,$)=>jsxRuntime.jsxs("div",{className:at.fileTag,children:[jsxRuntime.jsx(iconsMaterial.InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsxRuntime.jsx("span",{className:"truncate max-w-[150px]",children:F.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}})})]},`${F.name}-${$}`))}),jsxRuntime.jsxs("div",{className:"flex flex-col w-full p-2",children:[jsxRuntime.jsx("div",{className:xe(at.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsxRuntime.jsx("textarea",{className:xe(at.textarea,"min-h-[24px] py-0 px-0"),placeholder:h,value:n,onChange:C,onKeyDown:L,onCompositionStart:P,onCompositionEnd:S,style:lS,"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(cS,{enabled:p.enabled,onClick:x}),jsxRuntime.jsx(dS,{})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Lm,{onTextUpdate:B,onComplete:T,onCancel:v,disabled:o,className:at.buttonSmall}),jsxRuntime.jsx(pS,{canSend:I,isResponding:o,onSend:k,onStop:t})]})]})]})]})]})})};var Vm=({messages:e,onSend:t,onStop:o,onRegenerate:a,isResponding:r=false,className:n,placeholder:i,streamIntervalMs:c,streamChunkSize:d,onMessageStreamingComplete:l,cardHooks:s,showInput:u=true})=>{let f=mt.useRef(null);return mt.useEffect(()=>{f.current?.scrollIntoView({behavior:"smooth"});},[e,r]),jsxRuntime.jsxs("div",{className:xe("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((m,h)=>{let I=m.type==="assistant"&&h===e.length-1,p=m.type==="assistant"?{isLatestAssistant:I,onRegenerate:a?()=>a(m.id):void 0}:void 0;return jsxRuntime.jsx(Ls,{message:m,assistantActions:p,onStreamingComplete:()=>l?.(m.id),streamIntervalMs:c,streamChunkSize:d,cardHooks:s},m.id)}),jsxRuntime.jsx("div",{ref:f})]}),u&&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(zm,{onSend:t||(async()=>{}),onStop:o||(()=>{}),isResponding:r,placeholder:i})})]})};var Qt={};var fS={idle:"Idle",running:"Running",success:"Success",error:"Error",pending:"Pending"},NE=({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:xe("relative flex h-full w-full",Qt.agentPanel,a),"data-status":c,children:[jsxRuntime.jsx("div",{className:Qt.colorHalo,"data-status":c,"aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:Qt.marqueeBorder,"data-status":c,"aria-hidden":"true",children:[jsxRuntime.jsx("span",{className:xe(Qt.edge,Qt.top)}),jsxRuntime.jsx("span",{className:xe(Qt.edge,Qt.right)}),jsxRuntime.jsx("span",{className:xe(Qt.edge,Qt.bottom)}),jsxRuntime.jsx("span",{className:xe(Qt.edge,Qt.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:Qt.statusDot,"data-status":c}),jsxRuntime.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-gray-600 dark:text-gray-300",children:fS[c]})]}),o]})]}),jsxRuntime.jsx("div",{className:"flex-1 min-h-0 relative z-10",children:jsxRuntime.jsx(Vm,{...i,showInput:n})})]})]})};var vS={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},KE=({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:u,streamIntervalMs:f,streamChunkSize:m,onMessageStreamingComplete:h,cardHooks:I})=>{let[p,C]=mt.useState(""),[g,y]=mt.useState(false),x=mt.useRef(null),k=vS[c];mt.useEffect(()=>{x.current?.scrollIntoView({behavior:"smooth"});},[e,a]);let L=mt.useCallback(async()=>{let S=p.trim();!S||a||(C(""),await t(S));},[a,t,p]),P=mt.useCallback(async S=>{S.key==="Enter"&&!g&&(S.preventDefault(),await L());},[L,g]);return jsxRuntime.jsxs("div",{className:xe("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:xe("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",k==="top-left"&&"-left-2 -top-2",k==="top-right"&&"-right-2 -top-2",k==="bottom-left"&&"-bottom-2 -left-2",k==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:jsxRuntime.jsx("span",{className:xe("block h-4 w-4 border-[#21BCFF]",k==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",k==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",k==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",k==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),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((S,B)=>{let T=S.type==="assistant"&&B===e.length-1,v=S.type==="assistant"?{isLatestAssistant:T,onRegenerate:o?()=>o(S.id):void 0}:void 0;return jsxRuntime.jsx(Ls,{message:S,assistantActions:v,onStreamingComplete:()=>h?.(S.id),streamIntervalMs:f,streamChunkSize:m,cardHooks:I},S.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:S=>C(S.target.value),onCompositionStart:()=>y(true),onCompositionEnd:()=>y(false),onKeyDown:P,"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:u,type:"button","aria-label":"Microphone",children:jsxRuntime.jsx(lucideReact.Mic,{className:"h-4 w-4"})})]})})]})};var TS={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)"}}},XE=({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]=mt.useState("to"),u=!i&&!d&&o!=="none";mt.useEffect(()=>{if(!u){s("to");return}s("from");let h=requestAnimationFrame(()=>{h=requestAnimationFrame(()=>{s("to");});});return ()=>cancelAnimationFrame(h)},[t,u]);let f=TS[o],m=mt.useMemo(()=>u?l==="from"?f.from:f.to:{opacity:1,transform:"none"},[u,l,f.from,f.to]);return jsxRuntime.jsx(material.Box,{sx:{willChange:u?"opacity, transform":"auto",transition:u?`opacity ${a}ms ${n} ${r}ms, transform ${a}ms ${n} ${r}ms`:"none",backfaceVisibility:"hidden",...m,...c},children:e})},QE={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};
199
+ exports.AgentPanel=NE;exports.Button=Ws;exports.CAINavProvider=LC;exports.CAmapChart=vd;exports.CAppHeader=Op;exports.CAppPageLayout=F2;exports.CBarChart=pn;exports.CChartCard=ni;exports.CComboChart=sd;exports.CCustomizeAgent=wd;exports.CDetailInfoPage=ND;exports.CDetailSearchAiBar=vp;exports.CDetailSectionCard=Gi;exports.CFishboneChart=pd;exports.CGoogleMapChart=hd;exports.CGraphCharts=Cd;exports.CGraphKpiCards=ad;exports.CGraphReport=vi;exports.CHeatmapChart=cd;exports.CKanbanBoard=r2;exports.CKanbanBucket=Tp;exports.CKanbanCard=Vl;exports.CLayoutManagement=Zd;exports.CLayoutManager=Bi;exports.CLineChart=id;exports.CMessageBox=nn;exports.COrbCanvas=CC;exports.CPageLayout=Uc;exports.CPageTransition=XE;exports.CPieChart=ui;exports.CPivotTable=CA;exports.CSmartFilter=Ya;exports.CSmartTable=oR;exports.CStandardPage=cR;exports.CTable=Sa;exports.CTableBody=QP;exports.CTableCell=YP;exports.CTableContainer=JP;exports.CTableHead=eR;exports.CTableRow=tR;exports.CVariantManagement=wi;exports.CVariantManager=Ed;exports.CVoiceWaveOverlay=hc;exports.CWaterfallChart=md;exports.CodeBlock=Sn;exports.CopilotChat=KE;exports.GlobalMessage=Aw;exports.MarkdownRenderer=Rn;exports.MathBlock=wn;exports.MermaidBlock=wl;exports.NavigationIsland=Wc;exports.ORBCAFE_I18N_MESSAGES=rn;exports.OrbcafeI18nProvider=Ec;exports.PAGE_TRANSITION_PRESETS=QE;exports.PAppPageLayout=jB;exports.PBarcodeScanner=WA;exports.PNavIsland=qu;exports.PNumericKeypad=tB;exports.PSmartFilter=Vu;exports.PTable=nC;exports.PTouchCard=qA;exports.PWorkloadNav=$u;exports.PivotChartPanel=hu;exports.StdChat=Vm;exports.TableBlock=Tl;exports.ThinkBlock=$i;exports.TreeMenu=Hs;exports.VoiceNavigatorProvider=p5;exports.VoiceWaveOverlay=a5;exports.buildAmapEmbedUrl=fi;exports.buildGoogleMapEmbedUrl=gn;exports.buildGoogleMapIframe=dI;exports.buttonVariants=Zm;exports.createKanbanBoardModel=Dp;exports.findKanbanCard=Co;exports.message=gw;exports.messageManager=jo;exports.moveKanbanCard=Zi;exports.parseMarkdownTable=Oi;exports.renderMarkdown=iD;exports.resolveVariantFilters=Xd;exports.resolveVariantLayout=Fi;exports.useAINav=zC;exports.useAmapEmbedUrl=wR;exports.useDetailInfo=kp;exports.useGoogleMapEmbedUrl=SR;exports.useGraphChartData=bR;exports.useGraphInteraction=ki;exports.useGraphReport=Ar;exports.useKanbanBoard=c2;exports.useNavigationIsland=Hc;exports.useOrbcafeI18n=K;exports.usePadLayout=AA;exports.usePadRecordEditor=EA;exports.usePageLayout=Wp;exports.usePivotTable=TA;exports.useStandardReport=fR;exports.useVoiceInput=ws;exports.useVoiceNavigator=u5;