orbcafe-ui 3.1.4 → 3.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var jsxRuntime=require('react/jsx-runtime'),ogl=require('ogl'),er=require('react'),Nr=require('@radix-ui/react-dropdown-menu'),Yr=require('@radix-ui/react-tooltip'),reactDom=require('react-dom'),wr=require('@radix-ui/react-dialog'),yo=require('@radix-ui/react-popover'),oo=require('dayjs'),rb=require('dayjs/plugin/customParseFormat'),navigation=require('next/navigation'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),sortable=require('@dnd-kit/sortable'),bh=require('dayjs/plugin/isBetween'),hh=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 Dy=require('next/dynamic'),framerMotion=require('framer-motion'),EC=require('react-markdown'),LC=require('remark-gfm'),OC=require('remark-math'),FC=require('rehype-katex'),BC=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),wm=require('mermaid'),l0=require('dayjs/plugin/isoWeek');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 er__namespace=/*#__PURE__*/_interopNamespace(er);var Nr__namespace=/*#__PURE__*/_interopNamespace(Nr);var Yr__namespace=/*#__PURE__*/_interopNamespace(Yr);var wr__namespace=/*#__PURE__*/_interopNamespace(wr);var yo__namespace=/*#__PURE__*/_interopNamespace(yo);var oo__default=/*#__PURE__*/_interopDefault(oo);var rb__default=/*#__PURE__*/_interopDefault(rb);var bh__default=/*#__PURE__*/_interopDefault(bh);var hh__default=/*#__PURE__*/_interopDefault(hh);var Dy__default=/*#__PURE__*/_interopDefault(Dy);var EC__default=/*#__PURE__*/_interopDefault(EC);var LC__default=/*#__PURE__*/_interopDefault(LC);var OC__default=/*#__PURE__*/_interopDefault(OC);var FC__default=/*#__PURE__*/_interopDefault(FC);var BC__default=/*#__PURE__*/_interopDefault(BC);var wm__default=/*#__PURE__*/_interopDefault(wm);var l0__default=/*#__PURE__*/_interopDefault(l0);var gc=Object.defineProperty;var _g=(t,r,o)=>r in t?gc(t,r,{enumerable:true,configurable:true,writable:true,value:o}):t[r]=o;var Es=(t,r,o)=>()=>{if(o)throw o[0];try{return t&&(r=t(t=0)),r}catch(n){throw o=[n],n}};var Gg=(t,r)=>{for(var o in r)gc(t,o,{get:r[o],enumerable:true});};var fc=(t,r,o)=>_g(t,r+"",o);var ka,qg,vt,Pa,bc,Xg,Yg,hc,vc,Zg,Os,jg,yc,Qg,On,Ue,_t=Es(()=>{"use strict";ka={xs:0,sm:600,md:900,lg:1200,xl:1536},qg=t=>({palette:{mode:t,primary:{main:"var(--orb-primary)",light:"var(--orb-p300)",dark:"var(--orb-p700)",contrastText:"var(--orb-on-primary)"},secondary:{main:t==="dark"?"var(--orb-p300)":"var(--orb-fg)",contrastText:t==="dark"?"var(--orb-canvas)":"var(--orb-on-primary)"},error:{main:"var(--orb-err)",contrastText:"var(--orb-on-primary)"},warning:{main:"var(--orb-accent)",contrastText:"var(--orb-on-primary)"},info:{main:t==="dark"?"var(--orb-p300)":"var(--orb-primary)",contrastText:"var(--orb-on-primary)"},success:{main:t==="dark"?"var(--orb-p300)":"var(--orb-primary)",contrastText:"var(--orb-on-primary)"},text:{primary:"var(--orb-fg)",secondary:"var(--orb-muted)",disabled:"var(--orb-disabled-fg)"},background:{default:"var(--orb-canvas)",paper:"var(--orb-surface)"},action:{hover:"var(--orb-hover)",selected:"var(--orb-selected)",focus:"var(--orb-focus-ring)",disabled:"var(--orb-disabled-fg)",disabledBackground:"var(--orb-disabled-bg)",active:t==="dark"?"var(--orb-p300)":"var(--orb-primary)"},divider:"var(--orb-border)",common:{white:"#ffffff",black:"#01091a"},grey:{50:"var(--orb-surface)",100:"var(--orb-surface)",200:"var(--orb-border)",300:"var(--orb-border)",400:"var(--orb-muted)",500:"var(--orb-muted)",600:"var(--orb-fg)",700:"var(--orb-fg)",800:"var(--orb-surface-3)",900:"var(--orb-canvas)"}},shape:{borderRadius:10},breakpoints:{up:r=>`@media (min-width:${ka[r]}px)`,down:r=>`@media (max-width:${Math.max(0,ka[r]-.05)}px)`},spacing:(...r)=>r.map(o=>`${o*8}px`).join(" "),transitions:{create:(r="all",o={})=>(Array.isArray(r)?r:[r]).map(a=>`${a} ${o.duration??200}ms ${o.easing??"ease"}`).join(", "),duration:{shortest:150,shorter:180,short:200,standard:300}},zIndex:{modal:1300,drawer:1200,appBar:1100,tooltip:1500}}),vt=()=>typeof document>"u"?"light":document.documentElement.dataset.orbMode==="dark"||document.documentElement.classList.contains("orb-dark")?"dark":"light",Pa=()=>qg(vt()),bc={m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"],bgcolor:["backgroundColor"]},Xg=new Set(["animationIterationCount","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridArea","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","gridRow","gridRowEnd","gridRowSpan","gridRowStart","fontWeight","lineClamp","lineHeight","opacity","order","orphans","scale","tabSize","widows","zIndex","zoom"]),Yg=(t,r)=>{if(typeof r!="string")return r;let o={"background.default":"var(--orb-canvas)","background.paper":"var(--orb-surface)","text.primary":"var(--orb-fg)","text.secondary":"var(--orb-muted)","text.disabled":"var(--orb-disabled-fg)","primary.main":"var(--orb-primary)","primary.light":"var(--orb-p300)","primary.dark":"var(--orb-p700)","secondary.main":"var(--orb-muted)",divider:"var(--orb-border)","error.main":"var(--orb-err)","warning.main":"var(--orb-accent)","success.main":"var(--orb-primary)","info.main":"var(--orb-primary)","action.hover":"var(--orb-hover)","action.selected":"var(--orb-selected)","action.disabled":"var(--orb-disabled-fg)"};return o[r]?o[r]:r},hc=t=>t.startsWith("--")?t:t.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`),vc=(t,r)=>{if(r==null||r===!1)return null;let o=Yg(t,r);return typeof o=="number"&&o!==0&&!Xg.has(t)?["margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","gap","rowGap","columnGap"].includes(t)?`${o*8}px`:`${o}px`:String(o)},Zg=t=>t?(Array.isArray(t)?t:[t]).reduce((o,n)=>{if(!n)return o;let a=typeof n=="function"?n(Pa()):n;return {...o,...a}},{}):{},Os=t=>!t||typeof t!="object"?JSON.stringify(t):Array.isArray(t)?`[${t.map(Os).join(",")}]`:`{${Object.keys(t).sort().map(r=>`${JSON.stringify(r)}:${Os(t[r])}`).join(",")}}`,jg=t=>{let r=2166136261;for(let o=0;o<t.length;o+=1)r^=t.charCodeAt(o),r=Math.imul(r,16777619);return (r>>>0).toString(36)},yc=new Set,Qg=t=>{if(typeof document>"u"||yc.has(t))return;yc.add(t);let r=document.querySelector("style[data-orb-sx]");r||(r=document.createElement("style"),r.dataset.orbSx="true",document.head.appendChild(r)),r.appendChild(document.createTextNode(t));},On=(t,r)=>{let o=[],n=[];return Object.entries(r).forEach(([a,i])=>{let s=typeof i=="function"?i(Pa()):i;if(s==null||s===!1)return;if(a.startsWith("@media")&&typeof s=="object"){n.push(`${a}{${On(t,s)}}`);return}if(a.startsWith("&")&&typeof s=="object"){n.push(On(a.split("&").join(t),s));return}if((a.startsWith(":")||a.startsWith(">")||a.startsWith("["))&&typeof s=="object"){n.push(On(`${t}${a}`,s));return}if(typeof s=="object"){let d=s,u=Object.keys(d).filter(p=>p in ka);u.length>0?u.forEach(p=>{let b=(bc[a]??[a]).map(m=>{let v=vc(m,d[p]);return v===null?"":`${hc(m)}:${v};`}).join("");b&&(p==="xs"?n.push(`${t}{${b}}`):n.push(`@media (min-width:${ka[p]}px){${t}{${b}}}`));}):n.push(On(`${t} ${a}`,d));return}(bc[a]??[a]).forEach(d=>{let u=vc(d,s);u!==null&&o.push(`${hc(d)}:${u};`);});}),`${o.length?`${t}{${o.join("")}}`:""}${n.join("")}`},Ue=(t,r,o)=>{let n=Zg(t);if(Object.keys(n).length===0)return {className:r,style:o};let a=`orb-sx-${jg(Os(n))}`;return Qg(On(`.${a}`,n)),{className:[a,r].filter(Boolean).join(" "),style:o}};});var Cc,e,c,P=Es(()=>{"use strict";_t();Cc=(t,r)=>{if(!r||typeof t!="string")return [t,r];let o={...r},n=o.component??t;delete o.component;let a=o.sx;delete o.sx;let i=Ue(a,o.className,o.style);return o.className=[i.className,o.hover?"orb-hoverable":void 0,o.selected?"orb-selected":void 0,o.noWrap?"orb-nowrap":void 0,o.padding==="checkbox"?"orb-cell-checkbox":void 0].filter(Boolean).join(" ")||void 0,o.style=i.style,["hover","selected","noWrap","stickyHeader","padding","flexItem","item","container","xs","sm","md","lg","xl","sortDirection","scrollButtons","disableSticky","columns","primaryTypographyProps","secondaryTypographyProps","position"].forEach(s=>delete o[s]),[n,o]},e=(t,r,o)=>{let[n,a]=Cc(t,r);return jsxRuntime.jsx(n,a,o)},c=(t,r,o)=>{let[n,a]=Cc(t,r);return jsxRuntime.jsxs(n,a,o)};});var mm={};Gg(mm,{COrbCanvas:()=>My});function My({hue:t=0,hoverIntensity:r=.2,rotateOnHover:o=true,forceHoverState:n=false,backgroundColor:a="transparent"}){let i=er.useRef(null),s=`
1
+ 'use strict';var jsxRuntime=require('react/jsx-runtime'),ogl=require('ogl'),to=require('react'),Lo=require('@radix-ui/react-dropdown-menu'),Qo=require('@radix-ui/react-tooltip'),reactDom=require('react-dom'),Po=require('@radix-ui/react-dialog'),yr=require('@radix-ui/react-popover'),ar=require('dayjs'),Cf=require('dayjs/plugin/customParseFormat'),navigation=require('next/navigation'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),sortable=require('@dnd-kit/sortable'),Lb=require('dayjs/plugin/isBetween'),Ob=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 Xy=require('next/dynamic'),framerMotion=require('framer-motion'),ax=require('react-markdown'),ix=require('remark-gfm'),sx=require('remark-math'),lx=require('rehype-katex'),cx=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),Bm=require('mermaid'),z0=require('dayjs/plugin/isoWeek');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 to__namespace=/*#__PURE__*/_interopNamespace(to);var Lo__namespace=/*#__PURE__*/_interopNamespace(Lo);var Qo__namespace=/*#__PURE__*/_interopNamespace(Qo);var Po__namespace=/*#__PURE__*/_interopNamespace(Po);var yr__namespace=/*#__PURE__*/_interopNamespace(yr);var ar__default=/*#__PURE__*/_interopDefault(ar);var Cf__default=/*#__PURE__*/_interopDefault(Cf);var Lb__default=/*#__PURE__*/_interopDefault(Lb);var Ob__default=/*#__PURE__*/_interopDefault(Ob);var Xy__default=/*#__PURE__*/_interopDefault(Xy);var ax__default=/*#__PURE__*/_interopDefault(ax);var ix__default=/*#__PURE__*/_interopDefault(ix);var sx__default=/*#__PURE__*/_interopDefault(sx);var lx__default=/*#__PURE__*/_interopDefault(lx);var cx__default=/*#__PURE__*/_interopDefault(cx);var Bm__default=/*#__PURE__*/_interopDefault(Bm);var z0__default=/*#__PURE__*/_interopDefault(z0);var Nc=Object.defineProperty;var sh=(t,o,r)=>o in t?Nc(t,o,{enumerable:true,configurable:true,writable:true,value:r}):t[o]=r;var _s=(t,o,r)=>()=>{if(r)throw r[0];try{return t&&(o=t(t=0)),o}catch(n){throw r=[n],n}};var lh=(t,o)=>{for(var r in o)Nc(t,r,{get:o[r],enumerable:true});};var Dc=(t,o,r)=>sh(t,o+"",r);var Da,ph,vt,Aa,Ac,uh,mh,Ec,Lc,gh,Us,hh,Oc,fh,Bn,Ue,Gt=_s(()=>{"use strict";Da={xs:0,sm:600,md:900,lg:1200,xl:1536},ph=t=>({palette:{mode:t,primary:{main:"var(--orb-primary)",light:"var(--orb-p300)",dark:"var(--orb-p700)",contrastText:"var(--orb-on-primary)"},secondary:{main:t==="dark"?"var(--orb-p300)":"var(--orb-fg)",contrastText:t==="dark"?"var(--orb-canvas)":"var(--orb-on-primary)"},error:{main:"var(--orb-err)",contrastText:"var(--orb-on-primary)"},warning:{main:"var(--orb-accent)",contrastText:"var(--orb-on-primary)"},info:{main:t==="dark"?"var(--orb-p300)":"var(--orb-primary)",contrastText:"var(--orb-on-primary)"},success:{main:t==="dark"?"var(--orb-p300)":"var(--orb-primary)",contrastText:"var(--orb-on-primary)"},text:{primary:"var(--orb-fg)",secondary:"var(--orb-muted)",disabled:"var(--orb-disabled-fg)"},background:{default:"var(--orb-canvas)",paper:"var(--orb-surface)"},action:{hover:"var(--orb-hover)",selected:"var(--orb-selected)",focus:"var(--orb-focus-ring)",disabled:"var(--orb-disabled-fg)",disabledBackground:"var(--orb-disabled-bg)",active:t==="dark"?"var(--orb-p300)":"var(--orb-primary)"},divider:"var(--orb-border)",common:{white:"#ffffff",black:"#01091a"},grey:{50:"var(--orb-surface)",100:"var(--orb-surface)",200:"var(--orb-border)",300:"var(--orb-border)",400:"var(--orb-muted)",500:"var(--orb-muted)",600:"var(--orb-fg)",700:"var(--orb-fg)",800:"var(--orb-surface-3)",900:"var(--orb-canvas)"}},shape:{borderRadius:10},breakpoints:{up:o=>`@media (min-width:${Da[o]}px)`,down:o=>`@media (max-width:${Math.max(0,Da[o]-.05)}px)`},spacing:(...o)=>o.map(r=>`${r*8}px`).join(" "),transitions:{create:(o="all",r={})=>(Array.isArray(o)?o:[o]).map(a=>`${a} ${r.duration??200}ms ${r.easing??"ease"}`).join(", "),duration:{shortest:150,shorter:180,short:200,standard:300}},zIndex:{modal:1300,drawer:1200,appBar:1100,tooltip:1500}}),vt=()=>typeof document>"u"?"light":document.documentElement.dataset.orbMode==="dark"||document.documentElement.classList.contains("orb-dark")?"dark":"light",Aa=()=>ph(vt()),Ac={m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"],bgcolor:["backgroundColor"]},uh=new Set(["animationIterationCount","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridArea","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","gridRow","gridRowEnd","gridRowSpan","gridRowStart","fontWeight","lineClamp","lineHeight","opacity","order","orphans","scale","tabSize","widows","zIndex","zoom"]),mh=(t,o)=>{if(typeof o!="string")return o;let r={"background.default":"var(--orb-canvas)","background.paper":"var(--orb-surface)","text.primary":"var(--orb-fg)","text.secondary":"var(--orb-muted)","text.disabled":"var(--orb-disabled-fg)","primary.main":"var(--orb-primary)","primary.light":"var(--orb-p300)","primary.dark":"var(--orb-p700)","secondary.main":"var(--orb-muted)",divider:"var(--orb-border)","error.main":"var(--orb-err)","warning.main":"var(--orb-accent)","success.main":"var(--orb-primary)","info.main":"var(--orb-primary)","action.hover":"var(--orb-hover)","action.selected":"var(--orb-selected)","action.disabled":"var(--orb-disabled-fg)"};return r[o]?r[o]:o},Ec=t=>t.startsWith("--")?t:t.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`),Lc=(t,o)=>{if(o==null||o===!1)return null;let r=mh(t,o);return typeof r=="number"&&r!==0&&!uh.has(t)?["margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","gap","rowGap","columnGap"].includes(t)?`${r*8}px`:`${r}px`:String(r)},gh=t=>t?(Array.isArray(t)?t:[t]).reduce((r,n)=>{if(!n)return r;let a=typeof n=="function"?n(Aa()):n;return {...r,...a}},{}):{},Us=t=>!t||typeof t!="object"?JSON.stringify(t):Array.isArray(t)?`[${t.map(Us).join(",")}]`:`{${Object.keys(t).sort().map(o=>`${JSON.stringify(o)}:${Us(t[o])}`).join(",")}}`,hh=t=>{let o=2166136261;for(let r=0;r<t.length;r+=1)o^=t.charCodeAt(r),o=Math.imul(o,16777619);return (o>>>0).toString(36)},Oc=new Set,fh=t=>{if(typeof document>"u"||Oc.has(t))return;Oc.add(t);let o=document.querySelector("style[data-orb-sx]");o||(o=document.createElement("style"),o.dataset.orbSx="true",document.head.appendChild(o)),o.appendChild(document.createTextNode(t));},Bn=(t,o)=>{let r=[],n=[];return Object.entries(o).forEach(([a,i])=>{let s=typeof i=="function"?i(Aa()):i;if(s==null||s===!1)return;if(a.startsWith("@media")&&typeof s=="object"){n.push(`${a}{${Bn(t,s)}}`);return}if(a.startsWith("&")&&typeof s=="object"){n.push(Bn(a.split("&").join(t),s));return}if((a.startsWith(":")||a.startsWith(">")||a.startsWith("["))&&typeof s=="object"){n.push(Bn(`${t}${a}`,s));return}if(typeof s=="object"){let d=s,p=Object.keys(d).filter(m=>m in Da);p.length>0?p.forEach(m=>{let f=(Ac[a]??[a]).map(u=>{let b=Lc(u,d[m]);return b===null?"":`${Ec(u)}:${b};`}).join("");f&&(m==="xs"?n.push(`${t}{${f}}`):n.push(`@media (min-width:${Da[m]}px){${t}{${f}}}`));}):n.push(Bn(`${t} ${a}`,d));return}(Ac[a]??[a]).forEach(d=>{let p=Lc(d,s);p!==null&&r.push(`${Ec(d)}:${p};`);});}),`${r.length?`${t}{${r.join("")}}`:""}${n.join("")}`},Ue=(t,o,r)=>{let n=gh(t);if(Object.keys(n).length===0)return {className:o,style:r};let a=`orb-sx-${hh(Us(n))}`;return fh(Bn(`.${a}`,n)),{className:[a,o].filter(Boolean).join(" "),style:r}};});var Fc,e,c,I=_s(()=>{"use strict";Gt();Fc=(t,o)=>{if(!o||typeof t!="string")return [t,o];let r={...o},n=r.component??t;delete r.component;let a=r.sx;delete r.sx;let i=Ue(a,r.className,r.style);return r.className=[i.className,r.hover?"orb-hoverable":void 0,r.selected?"orb-selected":void 0,r.noWrap?"orb-nowrap":void 0,r.padding==="checkbox"?"orb-cell-checkbox":void 0].filter(Boolean).join(" ")||void 0,r.style=i.style,["hover","selected","noWrap","stickyHeader","padding","flexItem","item","container","xs","sm","md","lg","xl","sortDirection","scrollButtons","disableSticky","columns","primaryTypographyProps","secondaryTypographyProps","position"].forEach(s=>delete r[s]),[n,r]},e=(t,o,r)=>{let[n,a]=Fc(t,o);return jsxRuntime.jsx(n,a,r)},c=(t,o,r)=>{let[n,a]=Fc(t,o);return jsxRuntime.jsxs(n,a,r)};});var Pm={};lh(Pm,{COrbCanvas:()=>Ky});function Ky({hue:t=0,hoverIntensity:o=.2,rotateOnHover:r=true,forceHoverState:n=false,backgroundColor:a="transparent"}){let i=to.useRef(null),s=`
2
2
  precision highp float;
3
3
  attribute vec2 position;
4
4
  attribute vec2 uv;
@@ -180,26 +180,27 @@
180
180
  vec4 col = mainImage(fragCoord);
181
181
  gl_FragColor = vec4(col.rgb * col.a, col.a);
182
182
  }
183
- `;return er.useEffect(()=>{let d=i.current;if(!d)return;let u=new ogl.Renderer({alpha:true,premultipliedAlpha:false}),p=u.gl;p.clearColor(0,0,0,0),d.appendChild(p.canvas);let f=new ogl.Triangle(p),b=new ogl.Program(p,{vertex:s,fragment:l,uniforms:{iTime:{value:0},iResolution:{value:new ogl.Vec3(p.canvas.width,p.canvas.height,p.canvas.width/p.canvas.height)},hue:{value:t},hover:{value:0},rot:{value:0},hoverIntensity:{value:r},backgroundColor:{value:um(a)}}}),m=new ogl.Mesh(p,{geometry:f,program:b});function v(){if(!d)return;let I=window.devicePixelRatio||1,S=d.clientWidth,A=d.clientHeight;u.setSize(S*I,A*I),p.canvas.style.width=S+"px",p.canvas.style.height=A+"px",b.uniforms.iResolution.value.set(p.canvas.width,p.canvas.height,p.canvas.width/p.canvas.height);}window.addEventListener("resize",v),v();let y=0,g=0,x=0,h=.3,C=I=>{let S=d.getBoundingClientRect(),A=I.clientX-S.left,R=I.clientY-S.top,M=S.width,N=S.height,E=Math.min(M,N),O=M/2,F=N/2,_=(A-O)/E*2,B=(R-F)/E*2;Math.sqrt(_*_+B*B)<.8?y=1:y=0;},k=()=>{y=0;};d.addEventListener("mousemove",C),d.addEventListener("mouseleave",k);let w,T=I=>{w=requestAnimationFrame(T);let S=(I-g)*.001;g=I,b.uniforms.iTime.value=I*.001,b.uniforms.hue.value=t,b.uniforms.hoverIntensity.value=r,b.uniforms.backgroundColor.value=um(a);let A=n?1:y;b.uniforms.hover.value+=(A-b.uniforms.hover.value)*.1,o&&A>.5&&(x+=S*h),b.uniforms.rot.value=x,u.render({scene:m});};return w=requestAnimationFrame(T),()=>{cancelAnimationFrame(w),window.removeEventListener("resize",v),d.removeEventListener("mousemove",C),d.removeEventListener("mouseleave",k),p.canvas.parentNode===d&&d.removeChild(p.canvas),p.getExtension("WEBGL_lose_context")?.loseContext();}},[t,r,o,n,a]),e("div",{ref:i,className:"w-full h-full"})}function Ry(t,r,o){let n,a,i;if(r===0)n=a=i=o;else {let s=(u,p,f)=>(f<0&&(f+=1),f>1&&(f-=1),f<.16666666666666666?u+(p-u)*6*f:f<.5?p:f<.6666666666666666?u+(p-u)*(.6666666666666666-f)*6:u),l=o<.5?o*(1+r):o+r-o*r,d=2*o-l;n=s(d,l,t+1/3),a=s(d,l,t),i=s(d,l,t-1/3);}return new ogl.Vec3(n,a,i)}function um(t){if(t==="transparent")return new ogl.Vec3(0,0,0);if(t.startsWith("#")){let n=parseInt(t.slice(1,3),16)/255,a=parseInt(t.slice(3,5),16)/255,i=parseInt(t.slice(5,7),16)/255;return new ogl.Vec3(n,a,i)}let r=t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(r)return new ogl.Vec3(parseInt(r[1])/255,parseInt(r[2])/255,parseInt(r[3])/255);let o=t.match(/hsla?\((\d+),\s*(\d+)%,\s*(\d+)%/);if(o){let n=parseInt(o[1])/360,a=parseInt(o[2])/100,i=parseInt(o[3])/100;return Ry(n,a,i)}return new ogl.Vec3(0,0,0)}var gm=Es(()=>{"use strict";"use client";P();});var Ug={canvas:"#ffffff",surface:"#f5f5f5",surface2:"#f5f5f5",surface3:"#f5f5f5",fg:"#555555",muted:"#8c8c8c",border:"#dbdbdb",primary:"#154194",onPrimary:"#ffffff",link:"#154194",p50:"#f0f3f9",p100:"#dce4f1",p200:"#bac9e3",p300:"#91a8d1",p600:"#0f3276",p700:"#08255a",accent:"#fc4c02",err:"#ac3101",errBg:"#fff4f0",warnBg:"#fff2ee",hover:"rgba(21, 65, 148, 0.06)",selected:"rgba(21, 65, 148, 0.10)",focusRing:"rgba(21, 65, 148, 0.18)",focusSolid:"#154194",disabledFg:"#aeaeae",disabledBg:"#f0f0f0",chartGrid:"#dbdbdb",chartText:"#8c8c8c",track:"#f5f5f5",shadow1:"0 1px 2px rgba(1,9,26,.05),0 2px 6px rgba(1,9,26,.06)",shadow2:"0 4px 14px rgba(1,9,26,.10)",shadow3:"0 12px 32px rgba(1,9,26,.16)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#475569",statusPrimary:"#1d4ed8",statusSuccess:"#047857",statusWarning:"#b45309",statusError:"#b91c1c",statusInfo:"#0369a1",chart1:"#154194",chart2:"#91a8d1",chart3:"#8c8c8c",chart4:"#08255a",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},Kg={canvas:"#01091a",surface:"#0a1526",surface2:"#061324",surface3:"#0e1b2b",fg:"#ffffff",muted:"rgba(255,255,255,0.7)",border:"rgba(255,255,255,0.12)",primary:"#154194",onPrimary:"#ffffff",link:"#91a8d1",p50:"#021432",p100:"#021a3d",p200:"#bac9e3",p300:"#91a8d1",p600:"#375ea5",p700:"#6e8cc1",accent:"#fc4c02",err:"#d53f01",errBg:"#16163b",warnBg:"#19173f",hover:"rgba(255,255,255,0.08)",selected:"rgba(21, 65, 148, 0.45)",focusRing:"rgba(145, 168, 209, 0.45)",focusSolid:"#91a8d1",disabledFg:"rgba(255,255,255,0.38)",disabledBg:"rgba(255,255,255,0.07)",chartGrid:"rgba(255,255,255,0.12)",chartText:"rgba(255,255,255,0.7)",track:"rgba(255,255,255,0.1)",shadow1:"0 1px 2px rgba(0,0,0,.4),0 2px 8px rgba(0,0,0,.35)",shadow2:"0 4px 16px rgba(0,0,0,.5)",shadow3:"0 12px 32px rgba(0,0,0,.55)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#94a3b8",statusPrimary:"#60a5fa",statusSuccess:"#34d399",statusWarning:"#fbbf24",statusError:"#f87171",statusInfo:"#38bdf8",chart1:"#154194",chart2:"#91a8d1",chart3:"rgba(255,255,255,0.7)",chart4:"#a4b8dd",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},Ls={light:Ug,dark:Kg},I0='"Montserrat", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif',M0=t=>{let r=Ls[t];return [r.primary,r.p300,r.muted,r.p700]},R0=10,D0="0.2s ease";P();var wc=er.createContext({mode:"light",setting:"light"}),nf=t=>{if(typeof document>"u")return;let r=document.documentElement;r.classList.toggle("orb-dark",t==="dark"),r.dataset.orbMode=t,r.style.colorScheme=t;},Fn=({mode:t,defaultMode:r="light",children:o})=>{let n=t??r,[a,i]=er.useState("light"),[s,l]=er.useState(false);er.useEffect(()=>{l(true);let p=window.matchMedia("(prefers-color-scheme: dark)"),f=()=>i(p.matches?"dark":"light");return f(),p.addEventListener("change",f),()=>p.removeEventListener("change",f)},[]);let d=n==="system"?s?a:"light":n;er.useEffect(()=>{nf(d);},[d]);let u=er.useMemo(()=>({mode:d,setting:n}),[d,n]);return e(wc.Provider,{value:u,children:o})},Cr=()=>er.useContext(wc).mode,Fs=()=>Ls[Cr()];var rt=(t,r)=>{let o=Math.min(1,Math.max(0,r)),n=t.trim(),a=d=>d.split("").map(u=>u+u).join(""),i=n.startsWith("#")?n.slice(1):"",s=i.length===3?a(i):i;if(/^[0-9a-fA-F]{6}$/.test(s)){let d=parseInt(s.slice(0,2),16),u=parseInt(s.slice(2,4),16),p=parseInt(s.slice(4,6),16);return `rgba(${d}, ${u}, ${p}, ${o})`}let l=`${Math.round(o*100)}%`;return `color-mix(in oklch, ${t} ${l}, transparent)`};var Dr=t=>{let r=t.startsWith("up:")?`(min-width:${t.slice(3)}px)`:t.startsWith("down:")?`(max-width:${t.slice(5)}px)`:t,[o,n]=er.useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia(r).matches);return er.useEffect(()=>{if(typeof window.matchMedia!="function")return;let a=window.matchMedia(r),i=()=>n(a.matches);return i(),a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[r]),o};P();var lf={accept:57435,activate:57864,activity:57769,add:57432,barChart:57417,calendar:57414,camera:57413,checklist:57952,collapseAll:57988,command:57997,copy:57925,darkMode:58122,decline:57406,delete:57405,dimension:57718,document:57780,down:57827,download:57402,duplicate:57401,edit:57400,email:57399,employee:57398,error:57836,expandAll:57987,factory:57464,favorite:57445,filter:57462,fullScreen:57702,grid:57457,hide:57834,home:57456,information:57993,inventory:57693,ipad:57491,lightMode:58121,lightbulb:57380,lineChart:57740,locked:57683,log:57378,map:57377,menu:57822,message:57884,microphone:57586,move:57832,navigationLeft:57447,navigationRight:57446,overflow:57842,overview:57551,paperPlane:57548,picture:57366,pieChart:57365,play:57499,process:57543,product:57361,pushpin:57503,qrCode:57999,receipt:57541,refresh:57360,save:57498,search:57357,show:57833,shipping:57523,slimDown:57839,slimUp:57840,sort:57853,sound:57895,splitOne:57919,splitTwo:57920,stop:57861,sum:57998,synchronize:57354,table:57530,tableColumn:57983,tableRow:57982,thumbDown:57891,thumbUp:57890,time:57508,translate:57995,tree:57588,trendDown:57931,up:57828,upload:57881,warning:57492,world:57489,wrench:57346},cf=t=>typeof t=="number"?`${t}px`:t,df={"2.5":10,3:12,"3.5":14,4:16,5:20,6:24,7:28,8:32,10:40,12:48},pf=t=>{if(!t)return;let r=t.match(/(?:^|\s)(?:h|w)-(2\.5|3(?:\.5)?|4|5|6|7|8|10|12)(?:\s|$)/);return r?df[r[1]]:void 0},Tt=er.forwardRef(({name:t,size:r,title:o,className:n,style:a,strokeWidth:i,fill:s,...l},d)=>{let u=l["aria-label"]??o,p=cf(r??pf(n)??"1em"),f={fontFamily:"SAP-icons",fontSize:p,fontStyle:"normal",fontWeight:"normal",lineHeight:1,width:p,height:p,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...a};return e("span",{ref:d,role:u?"img":void 0,"aria-hidden":u?void 0:true,title:o,className:n,"data-sap-icon":t,style:f,...l,children:String.fromCodePoint(lf[t])})});Tt.displayName="SapIcon";var ne=(t,r)=>{let o=er.forwardRef((n,a)=>e(Tt,{ref:a,name:t,...n}));return o.displayName=r??`SapIcon(${t})`,o};var Pc=ne("activity","Activity"),Ta=ne("error","AlertCircle"),Tc=ne("warning","AlertTriangle"),Q0=ne("down","ArrowDown"),J0=ne("navigationRight","ArrowRight"),Ic=ne("up","ArrowUp"),Bs=ne("barChart","BarChart"),eS=ne("activate","Bot"),Hs=ne("calendar","Calendar"),tS=Hs,rS=ne("camera","Camera"),oS=ne("lineChart","ChartNoAxesCombined"),qr=ne("accept","Check"),Ia=ne("accept","CheckCircle"),Fr=ne("slimDown","ChevronDown"),Ma=ne("navigationLeft","ChevronLeft"),Br=ne("navigationRight","ChevronRight"),nS=ne("slimUp","ChevronUp"),aS=ne("expandAll","ChevronsDown"),iS=ne("collapseAll","ChevronsUp"),Ra=ne("error","CircleAlert"),Bn=ne("accept","CircleCheck"),sS=Bn,Mc=ne("stop","CircleStop"),Rc=ne("copy","Clipboard"),lS=ne("checklist","ClipboardCheck"),cS=ne("checklist","ClipboardList"),Dc=ne("time","Clock"),dS=ne("tableColumn","Columns3"),vo=ne("copy","Copy"),pS=ne("duplicate","CopyPlus"),uS=ne("delete","Delete"),Nc=ne("download","Download"),Ac=ne("edit","Edit"),Ec=ne("fullScreen","Expand"),mS=ne("show","Eye"),gS=ne("hide","EyeOff"),Da=ne("document","File"),Lc=ne("document","FileText"),fS=ne("filter","Filter"),Hn=ne("tree","FolderTree"),Oc=ne("process","GitBranch"),zn=ne("world","Globe"),Fc=ne("grid","Grid"),bS=ne("move","GripVertical"),hS=ne("wrench","Hammer"),Bc=ne("picture","Image"),Na=ne("information","Info"),vS=ne("translate","Languages"),yS=ne("dimension","Layers"),CS=ne("home","LayoutDashboard"),Aa=ne("lightbulb","Lightbulb"),Hc=ne("lineChart","LineChart"),zc=ne("synchronize","Loader2"),Ea=ne("locked","Lock"),xS=Ea,Vc=ne("log","LogOut"),zs=ne("email","Mail"),Wc=ne("map","MapPin"),$c=ne("menu","Menu"),uf=ne("message","MessageCircle"),_c=uf,La=ne("microphone","Mic"),SS=ne("microphone","MicOff"),Gc=ne("darkMode","Moon"),wS=ne("overflow","MoreHorizontal"),kS=ne("accept","PackageCheck"),PS=ne("product","PackageSearch"),Oa=ne("splitOne","PanelLeftOpen"),Fa=ne("splitTwo","PanelRight"),TS=ne("overview","PanelsTopLeft"),Uc=ne("pieChart","PieChart"),Jo=ne("pushpin","Pin"),IS=ne("play","Play"),en=ne("add","Plus"),MS=ne("qrCode","QrCode"),RS=ne("receipt","ReceiptText"),Ba=ne("refresh","RefreshCw"),DS=ne("activate","Rocket"),NS=ne("refresh","RotateCcw"),Kc=ne("refresh","RotateCw"),AS=ne("tableRow","Rows3"),ES=ne("save","Save"),LS=ne("qrCode","ScanLine"),Hr=ne("search","Search"),mf=ne("paperPlane","Send"),qc=mf,tn=ne("wrench","Settings"),OS=ne("accept","ShieldCheck"),FS=ne("sum","Sigma"),BS=ne("sort","SortAsc"),HS=ne("splitTwo","SquareSplitHorizontal"),zS=ne("favorite","Star"),Xc=ne("lightMode","Sun"),VS=ne("table","Table2"),WS=ne("ipad","TabletSmartphone"),Vn=ne("command","Terminal"),Yc=ne("thumbDown","ThumbsDown"),Zc=ne("thumbUp","ThumbsUp"),jc=ne("delete","Trash2"),$S=ne("tree","TreePine"),Qc=ne("trendDown","TrendingDown"),Ha=ne("warning","TriangleAlert"),_S=ne("shipping","Truck"),Jc=ne("upload","UploadCloud"),Vs=ne("employee","User"),ed=ne("sound","Volume2"),GS=ne("factory","Warehouse"),US=ne("process","Workflow"),jt=ne("decline","X"),za=ne("error","XCircle");_t();P();var ff={contained:"primary",outlined:"secondary",text:"ghost"},bf={small:"orb-btn-sm",medium:void 0,large:"orb-btn-lg"},we=er.forwardRef(({variant:t="primary",size:r="medium",block:o=false,loading:n=false,startIcon:a,endIcon:i,component:s,href:l,sx:d,className:u,children:p,disabled:f,type:b="button",...m},v)=>{let y=ff[t]??t,g=["orb-btn",`orb-btn-${y}`,bf[r],o?"orb-btn-block":void 0,n?"orb-is-loading":void 0,u].filter(Boolean).join(" "),x=Ue(d,g),h=s??(l?"a":"button");return c(h,{ref:v,type:h==="button"?b:void 0,href:l,className:x.className,style:x.style,disabled:h==="button"?f||n:void 0,"aria-disabled":h!=="button"&&(f||n)?true:void 0,...m,children:[n&&e("span",{className:`orb-spin ${y==="primary"?"orb-spin-light":""}`,"aria-hidden":true}),!n&&a,p,!n&&i]})});we.displayName="CButton";_t();P();var ze=er.forwardRef(({label:t,value:r,defaultValue:o,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,type:l="text",placeholder:d,disabled:u,readOnly:p,required:f,autoFocus:b,autoComplete:m,name:v,id:y,error:g,helperText:x,dense:h=false,size:C,fullWidth:k=true,select:w=false,multiline:T=false,rows:I,children:S,variant:A,margin:R,onClick:M,startAdornment:N,endAdornment:E,InputProps:O,inputProps:F,InputLabelProps:_,SelectProps:B,sx:Y,className:W},j)=>{let V=er.useId(),z=y??`orb-tf-${V}`,K=N??O?.startAdornment,q=E??O?.endAdornment,se=(typeof g=="string"?g:void 0)??x,Se={id:z,className:`orb-inp ${h||C==="small"?"orb-inp-dense":""}`,style:k?void 0:{width:"auto"},value:r,defaultValue:o,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,placeholder:d,disabled:u,required:f,autoFocus:b,autoComplete:m,name:v,onClick:M,"aria-invalid":!!g},$e=w?e("select",{...Se,ref:j,onChange:n,children:S}):T?e("textarea",{...Se,ref:j,onChange:n,rows:I,readOnly:p||O?.readOnly}):e("input",{...Se,ref:j,onChange:n,type:l,readOnly:p||O?.readOnly,...F}),ke=Ue(Y,`orb-fld ${g?"orb-is-error":""} ${W??""}`,{width:k?"100%":void 0});return c("div",{className:ke.className,style:ke.style,children:[t&&e("label",{htmlFor:z,children:t}),K||q?c("div",{className:"orb-inp-adornment-wrap",children:[K&&e("span",{className:"orb-inp-adornment",children:K}),q&&e("span",{className:"orb-inp-adornment orb-inp-adornment-end",children:q}),$e]}):$e,se&&e("span",{className:"orb-fld-msg",children:se})]})});ze.displayName="CTextField";_t();P();var Wn=er.forwardRef(({label:t,value:r,defaultValue:o,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l,minRows:d=3,multiline:u,error:p,helperText:f,fullWidth:b=true,name:m,id:v,inputProps:y,sx:g,className:x},h)=>{let C=er.useId(),k=v??`orb-ta-${C}`,T=(typeof p=="string"?p:void 0)??f,I=Ue(g,`orb-fld ${p?"orb-is-error":""} ${x??""}`,{width:b?"100%":void 0});return c("div",{className:I.className,style:I.style,children:[t&&e("label",{htmlFor:k,children:t}),e("textarea",{ref:h,id:k,className:"orb-inp",value:r,defaultValue:o,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l??d,name:m,"aria-invalid":!!p,...y}),T&&e("span",{className:"orb-fld-msg",children:T})]})});Wn.displayName="CTextArea";_t();P();var zt=er.forwardRef(({label:t,options:r,children:o,value:n,defaultValue:a,onChange:i,disabled:s,size:l,dense:d=true,fullWidth:u=true,minWidth:p,placeholder:f,displayEmpty:b,renderValue:m,multiple:v,MenuProps:y,variant:g,disableUnderline:x,onClick:h,onMouseDown:C,error:k,helperText:w,name:T,id:I,"aria-label":S,sx:A,className:R},M)=>{let N=er.useId(),E=I??`orb-sel-${N}`,F=(typeof k=="string"?k:void 0)??w,_=er.useRef(null),B=er.useRef(null),[Y,W]=er.useState(false),[j,V]=er.useState(180),[z,K]=er.useState(a??"");er.useImperativeHandle(M,()=>_.current);let q=er.useMemo(()=>er.Children.toArray(o).flatMap(Me=>{if(!er.isValidElement(Me)||Me.type!=="option")return [];let Pe=Me;return [{value:Array.isArray(Pe.props.value)?Pe.props.value[0]??"":Pe.props.value??"",label:Pe.props.children,disabled:Pe.props.disabled}]}),[o]),fe=r??q,se=n??z,ue=Array.isArray(se)?se[0]??"":se,Se=String(ue??""),$e=fe.find(Me=>String(Me.value)===Se),ke=m?m(se):$e?.label??(Se||(f??"")),le=Ue(A,`orb-fld ${k?"orb-is-error":""} ${R??""}`,{width:u?"100%":void 0,minWidth:typeof p=="number"?`${p}px`:p});if(v)return c("div",{className:le.className,style:le.style,children:[t&&e("label",{htmlFor:E,children:t}),c("select",{ref:M,id:E,className:`orb-inp ${d||l==="small"?"orb-inp-dense":""}`,value:n,defaultValue:a,onChange:i,disabled:s,name:T,multiple:true,onClick:h,onMouseDown:C,"aria-invalid":!!k,"aria-label":S,children:[f!==void 0&&e("option",{value:"",children:f}),r?r.map(Me=>e("option",{value:Me.value,disabled:Me.disabled,children:Me.label},Me.value)):o]}),F&&e("span",{className:"orb-fld-msg",children:F})]});let Ee=Me=>{n===void 0&&K(Me);let Pe=_.current;Pe&&(Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set?.call(Pe,Me),i?.({target:Pe,currentTarget:Pe}));};return c("div",{className:le.className,style:le.style,children:[t&&e("label",{htmlFor:E,children:t}),e("select",{ref:_,className:"orb-visually-hidden",tabIndex:-1,"aria-hidden":"true",name:T,value:Se,disabled:s,onChange:()=>{},children:fe.map(Me=>e("option",{value:Me.value,disabled:Me.disabled,children:Me.label},String(Me.value)))}),c(Nr__namespace.Root,{open:Y,onOpenChange:Me=>{Me&&V(B.current?.getBoundingClientRect().width??180),W(Me);},children:[e(Nr__namespace.Trigger,{asChild:true,children:c("button",{ref:B,id:E,type:"button",className:`orb-inp orb-select-trigger ${d||l==="small"?"orb-inp-dense":""}`,disabled:s,"aria-invalid":!!k,"aria-label":S,"aria-haspopup":"listbox","data-placeholder":!$e&&!Se?"":void 0,onClick:h,onMouseDown:C,children:[e("span",{className:"orb-select-value",children:ke}),e(Tt,{className:"orb-select-chevron",name:"slimDown",size:12})]})}),e(Nr__namespace.Portal,{children:e(Nr__namespace.Content,{className:"orb-pop orb-select-menu",align:"start",sideOffset:5,collisionPadding:8,style:{minWidth:j},children:e(Nr__namespace.RadioGroup,{value:Se,onValueChange:Ee,children:fe.map(Me=>c(Nr__namespace.RadioItem,{className:"orb-select-option",value:String(Me.value),disabled:Me.disabled,children:[e("span",{className:"orb-select-check","aria-hidden":"true",children:String(Me.value)===Se?e(Tt,{name:"accept",size:13}):null}),e("span",{children:Me.label})]},String(Me.value)))})})})]}),F&&e("span",{className:"orb-fld-msg",children:F})]})});zt.displayName="CSelect";_t();P();var It=er.forwardRef(({label:t,checked:r,defaultChecked:o,onChange:n,disabled:a,indeterminate:i,name:s,value:l,id:d,size:u,color:p,onClick:f,inputProps:b,sx:m,className:v},y)=>{let g=Ue([{...u==="small"?{fontSize:13}:void 0,...p?{color:p}:void 0},...Array.isArray(m)?m:m?[m]:[]],`orb-chk ${v??""}`),x=e("input",{ref:h=>{h&&(h.indeterminate=!!i),typeof y=="function"?y(h):y&&(y.current=h);},type:"checkbox",id:d,checked:r,defaultChecked:o,onChange:n,readOnly:r!==void 0&&n===void 0,disabled:a,name:s,value:l,onClick:f,...b});return t==null?e("span",{className:g.className,style:g.style,children:x}):c("label",{className:g.className,style:g.style,children:[x,e("span",{children:t})]})});It.displayName="CCheckbox";P();var Rf=({label:t,options:r,value:o,defaultValue:n,onChange:a,name:i,row:s=false,disabled:l,sx:d,className:u})=>{let p=er.useId(),f=i??`orb-rdo-${p}`;return c("div",{className:`orb-fld ${u??""}`,style:d,role:"radiogroup",children:[t&&e("span",{className:"orb-fld-label",children:t}),e("div",{style:{display:"flex",flexDirection:s?"row":"column",gap:s?24:8,flexWrap:"wrap"},children:r.map(b=>c("label",{className:"orb-rdo",children:[e("input",{type:"radio",name:f,value:b.value,checked:o!==void 0?o===b.value:void 0,defaultChecked:n!==void 0?n===b.value:void 0,onChange:a?m=>a(m,b.value):void 0,disabled:l||b.disabled}),e("span",{children:b.label})]},b.value))})]})};_t();P();var Va=er.forwardRef(({label:t,checked:r,defaultChecked:o,onChange:n,disabled:a,name:i,id:s,size:l,sx:d,className:u},p)=>{let f=Ue([{...l==="small"?{transform:"scale(.86)",transformOrigin:"center"}:void 0},...Array.isArray(d)?d:d?[d]:[]],`orb-sw ${u??""}`),b=e("input",{ref:p,type:"checkbox",role:"switch",id:s,checked:r,defaultChecked:o,onChange:n?m=>n(m,m.target.checked):void 0,disabled:a,name:i});return t==null?e("span",{className:f.className,style:f.style,children:b}):c("label",{className:f.className,style:f.style,children:[b,e("span",{children:t})]})});Va.displayName="CSwitch";_t();P();var Af={default:"gray",primary:"blue",success:"blue",info:"blue",warning:"orange",error:"orange"},xt=er.forwardRef(({label:t,children:r,tone:o,color:n="default",variant:a,size:i="medium",clickable:s,avatar:l,icon:d,onDelete:u,onClick:p,sx:f,className:b},m)=>{let v=o??(a==="outlined"&&n==="default"?"outline":Af[n]??"gray"),y=s??!!p,g=Ue([{cursor:y?"pointer":void 0,...i==="small"?{height:24,fontSize:11,px:1}:void 0},...Array.isArray(f)?f:f?[f]:[]],`orb-chip orb-chip-${v} ${b??""}`);return c("span",{ref:m,className:g.className,style:g.style,onClick:p,role:y?"button":void 0,tabIndex:y?0:void 0,onKeyDown:y?x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),p?.(x));}:void 0,children:[l??d,e("span",{className:"orb-chip-label",children:r??t}),u&&e("button",{type:"button","aria-label":"Remove",onClick:x=>{x.stopPropagation(),u(x);},style:{background:"none",border:"none",padding:0,display:"inline-flex",cursor:"pointer",color:"inherit"},children:e(jt,{size:13,strokeWidth:2})})]})});xt.displayName="CChip";_t();P();var Wa=er.forwardRef(({badgeContent:t,color:r="primary",children:o,invisible:n=false,sx:a,className:i},s)=>{let l=Ue(a,i,{display:"inline-flex",position:o?"relative":void 0}),d=!n&&t!==void 0&&t!==null&&e("span",{className:`orb-badge ${r==="error"?"orb-badge-err":r==="muted"?"orb-badge-muted":""}`,style:o?{position:"absolute",top:-6,right:-6,zIndex:1}:void 0,children:t});return o?c("span",{ref:s,className:l.className,style:l.style,children:[o,d]}):e("span",{ref:s,className:l.className,style:l.style,children:d})});Wa.displayName="CBadge";_t();P();var rn=er.forwardRef(({children:t,src:r,alt:o,size:n=28,sx:a,className:i},s)=>{let l=Ue([{width:n,height:n,fontSize:n*.4},...Array.isArray(a)?a:a?[a]:[]],`orb-avatar ${i??""}`);return e("span",{ref:s,className:l.className,style:l.style,children:r?e("img",{src:r,alt:o??"",style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):t})});rn.displayName="CAvatar";_t();P();var on=er.forwardRef(({severity:t="info",title:r,children:o,onClose:n,sx:a,className:i},s)=>{let l=Ue(a,`orb-alert orb-alert-${t} ${i??""}`);return c("div",{ref:s,role:"alert",className:l.className,style:l.style,children:[c("div",{style:{flex:1,minWidth:0},children:[r&&e("b",{children:r}),o&&e("span",{children:o})]}),n&&e("button",{type:"button","aria-label":"Close",onClick:n,style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"inherit",font:"500 14px/1 var(--orb-font)",opacity:.7},children:"\u2715"})]})});on.displayName="CAlert";_t();P();var $n=({value:t,variant:r,color:o,sx:n,className:a})=>{let i=r==="indeterminate"||t===void 0,s=Ue(n,`orb-prog ${a??""}`);return c("div",{className:s.className,role:"progressbar","aria-valuenow":i?void 0:Math.round(t),"aria-valuemin":i?void 0:0,"aria-valuemax":i?void 0:100,style:s.style,children:[e("i",{style:i?{width:"40%",animation:"orb-prog-ind 1.2s ease-in-out infinite"}:{width:`${Math.min(100,Math.max(0,t))}%`,background:o}}),i&&e("style",{children:"@keyframes orb-prog-ind { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }"})]})},Ff=({width:t,height:r=14,variant:o="rectangular",sx:n,className:a})=>e("div",{className:`orb-skel ${a??""}`,style:{width:t,height:r,borderRadius:o==="circular"?"50%":o==="text"?6:"var(--orb-r)",...n}}),Xr=({size:t=12,onPrimary:r=false,sx:o,className:n})=>e("span",{className:`orb-spin ${r?"orb-spin-light":""} ${n??""}`,style:{width:t,height:t,...o},role:"status","aria-label":"Loading"});P();var ct=({title:t,children:r,enterDelay:o=300,side:n="top",align:a="center",disabled:i})=>!t||i?e(jsxRuntime.Fragment,{children:r}):e(Yr__namespace.Provider,{delayDuration:o,skipDelayDuration:200,children:c(Yr__namespace.Root,{children:[e(Yr__namespace.Trigger,{asChild:true,children:r}),e(Yr__namespace.Portal,{children:e(Yr__namespace.Content,{className:"orb-tooltip",side:n,align:a,sideOffset:6,children:t})})]})});_t();P();var ae=er.forwardRef(({tooltip:t,size:r="small",active:o=false,edge:n,color:a,sx:i,className:s,children:l,type:d="button",...u},p)=>{let f=Ue([{color:o?"var(--orb-primary)":a,...n==="start"?{marginLeft:-8}:n==="end"?{marginRight:-8}:void 0},...Array.isArray(i)?i:i?[i]:[]],`orb-icon-btn ${r==="small"?"orb-icon-btn-sm":""} ${s??""}`),b=e("button",{ref:p,type:d,className:f.className,style:f.style,...u,children:l});return t?e(ct,{title:t,children:b}):b});ae.displayName="CIconButton";_t();P();var _n=({value:t,options:r,onValueChange:o,size:n="medium",sx:a,className:i,...s})=>{let l=er.useRef([]),d=r.findIndex(m=>!m.disabled),u=r.findIndex(m=>m.value===t),p=(m,v)=>{let y=r.map((h,C)=>h.disabled?-1:C).filter(h=>h>=0);if(y.length===0)return;let g=y.indexOf(v),x;m.key==="Home"&&(x=y[0]),m.key==="End"&&(x=y[y.length-1]),(m.key==="ArrowRight"||m.key==="ArrowDown")&&(x=y[(g+1+y.length)%y.length]),(m.key==="ArrowLeft"||m.key==="ArrowUp")&&(x=y[(g-1+y.length)%y.length]),x!==void 0&&(m.preventDefault(),l.current[x]?.focus(),o(r[x].value));},f=Ue(a,["orb-segmented-control",n==="small"?"orb-segmented-control-sm":"",i].filter(Boolean).join(" ")),b={...f.style,"--orb-segmented-count":Math.max(r.length,1),"--orb-segmented-index":Math.max(u,0)};return c("div",{role:"radiogroup",className:f.className,style:b,"data-has-selection":u>=0?"true":"false",...s,children:[e("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),r.map((m,v)=>{let y=m.value===t;return e(ae,{ref:g=>{l.current[v]=g;},className:["orb-segmented-control-item",m.icon?"":"orb-segmented-control-item-label"].filter(Boolean).join(" "),size:n,tooltip:m.label,role:"radio","aria-label":m.label,"aria-checked":y,"data-selected":y?"true":void 0,disabled:m.disabled,tabIndex:y||t==null&&v===d?0:-1,onClick:()=>o(m.value),onKeyDown:g=>p(g,v),children:m.icon??e("span",{className:"orb-segmented-control-label",children:m.label})},m.value)})]})};_t();P();var Qt=({triggerLabel:t,items:r=[],trigger:o,align:n="start",anchorEl:a,open:i,onClose:s,children:l,slotProps:d,PaperProps:u,anchorPosition:p,sx:f})=>{let b=er.useRef(null);if(er.useEffect(()=>{if(i!==true)return;let m=y=>{let g=y.composedPath();b.current&&g.includes(b.current)||a&&g.includes(a)||s?.();},v=y=>{y.key==="Escape"&&s?.();};return document.addEventListener("pointerdown",m,true),document.addEventListener("keydown",v,true),()=>{document.removeEventListener("pointerdown",m,true),document.removeEventListener("keydown",v,true);}},[a,s,i]),i!==void 0){if(!i||typeof document>"u")return null;let m=a?.getBoundingClientRect(),v=window.innerWidth,y=m?.left??16,g=m?.right??y,x=d?.paper?.sx??u?.sx,h=Ue([...Array.isArray(x)?x:x?[x]:[],...Array.isArray(f)?f:f?[f]:[]],"orb-pop orb-menu",d?.paper?.style??u?.style),C=er.Children.map(l,k=>{if(!er.isValidElement(k)||k.type!=="option")return k;let w=k.props,{children:T,disabled:I,selected:S}=w,A=Ue(w.sx,`orb-menu-item ${S?"orb-selected":""} ${w.className??""}`,w.style);return e("div",{role:"menuitem","aria-disabled":I||void 0,"aria-selected":S||void 0,tabIndex:I?-1:0,id:w.id,title:w.title,className:A.className,style:A.style,onClick:I?void 0:w.onClick,onKeyDown:R=>{!I&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),w.onClick?.(R));},children:T})});return reactDom.createPortal(e("div",{ref:b,role:"menu",className:h.className,style:{...h.style,position:"fixed",left:n==="end"&&!p?void 0:p?.left??y,right:n==="end"&&!p?Math.max(16,v-g):void 0,top:p?.top??(m?.bottom??16)+6,maxWidth:"calc(100vw - 32px)",zIndex:1301},children:C}),document.body)}return c(Nr__namespace.Root,{children:[e(Nr__namespace.Trigger,{asChild:true,children:o??e(we,{variant:"primary",children:t})}),e(Nr__namespace.Portal,{children:e(Nr__namespace.Content,{className:"orb-pop orb-menu",align:n,sideOffset:6,children:r.map((m,v)=>c(Nr__namespace.Item,{className:"orb-menu-item",disabled:m.disabled,onSelect:()=>m.onClick?.(),children:[m.icon,m.label]},v))})})]})};_t();P();var Ae=er.forwardRef(({elevation:t=1,variant:r,component:o,sx:n,style:a,className:i,children:s,...l},d)=>{let u=o??"div",p=Ue(n,`orb-card ${t>0&&r!=="outlined"?"orb-card-raised":""} ${i??""}`,a);return e(u,{ref:d,className:p.className,style:p.style,...l,children:s})});Ae.displayName="CPaper";_t();P();var Dt=er.forwardRef(({orientation:t="horizontal",flexItem:r,sx:o,className:n},a)=>{let i=Ue([{...t==="vertical"?{alignSelf:"stretch",height:"auto"}:{width:"100%"},...r?{alignSelf:"stretch"}:void 0},...Array.isArray(o)?o:o?[o]:[]],`${t==="vertical"?"orb-divider-v":"orb-divider"} ${n??""}`);return e("hr",{ref:a,"aria-orientation":t,className:i.className,style:i.style})});Dt.displayName="CDivider";_t();P();var qf={h1:"orb-h1",h2:"orb-h2",h3:"orb-h3",h4:"orb-h3",h5:"orb-subtitle",h6:"orb-subtitle",subtitle1:"orb-subtitle",subtitle2:"orb-label",body1:"orb-body",body2:"orb-body-dense",label:"orb-label",caption:"orb-meta",overline:"orb-overline"},Xf={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},L=er.forwardRef(({variant:t="body1",component:r,muted:o=false,numeric:n=false,color:a,noWrap:i=false,fontWeight:s,sx:l,className:d,children:u,...p},f)=>{let b=r??Xf[t]??"span",v=[t==="inherit"?void 0:qf[t],d].filter(Boolean).join(" "),y=Ue([{...o?{color:"var(--orb-muted)"}:void 0,...a?{color:a}:void 0,...n?{fontVariantNumeric:"tabular-nums"}:void 0,...s?{fontWeight:s}:void 0,...i?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:void 0},...Array.isArray(l)?l:l?[l]:[]],v);return e(b,{ref:f,className:y.className,style:y.style,...p,children:u})});L.displayName="CTypography";_t();P();var Zf=t=>{if(t!==void 0)return typeof t=="number"?`${t*8}px`:t},ie=er.forwardRef(({direction:t="column",spacing:r,alignItems:o,justifyContent:n,flexWrap:a,flex:i,useFlexGap:s,sx:l,className:d,children:u,...p},f)=>{let b=Ue([{display:"flex",flexDirection:t,gap:Zf(r),alignItems:o,justifyContent:n,flexWrap:a,flex:i},...Array.isArray(l)?l:l?[l]:[]],d);return e("div",{ref:f,className:b.className,style:b.style,...p,children:u})});ie.displayName="CStack";_t();P();var Lt=({open:t,onClose:r,title:o,children:n,actions:a,maxWidth:i=560,fullWidth:s=false,fullScreen:l=false,PaperProps:d,slotProps:u,disableRestoreFocus:p,keepMounted:f,hideCloseButton:b=false,sx:m,className:v})=>{let y=Ue([{width:l?"100vw":s?"min(920px, calc(100vw - 32px))":void 0,height:l?"100vh":void 0,maxWidth:l?"none":typeof i=="number"?`${i}px`:i},...Array.isArray(d?.sx??u?.paper?.sx)?d?.sx??u?.paper?.sx:d?.sx??u?.paper?.sx?[d?.sx??u?.paper?.sx]:[],...Array.isArray(m)?m:m?[m]:[]],`orb-dialog ${v??""}`);return e(wr__namespace.Root,{open:t,onOpenChange:g=>{g||r?.();},children:c(wr__namespace.Portal,{children:[e(wr__namespace.Overlay,{className:"orb-overlay"}),c(wr__namespace.Content,{className:y.className,style:y.style,children:[(o||!b)&&c("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},children:[o?e(wr__namespace.Title,{className:"orb-dialog-title",children:o}):e(wr__namespace.Title,{className:"orb-visually-hidden",children:"Dialog"}),!b&&e(wr__namespace.Close,{asChild:true,children:e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Close",style:{marginTop:-4,marginRight:-4},children:e(jt,{size:16,strokeWidth:2})})})]}),e("div",{style:{minWidth:0},children:n}),a&&e("div",{className:"orb-dialog-actions",children:a})]})]})})};P();var $s=({open:t,defaultOpen:r,onOpenChange:o,trigger:n,children:a,align:i="start",side:s="bottom",sideOffset:l=6,matchTriggerWidth:d=false,sx:u,className:p})=>c(yo__namespace.Root,{open:t,defaultOpen:r,onOpenChange:o,children:[e(yo__namespace.Trigger,{asChild:true,children:n}),e(yo__namespace.Portal,{children:e(yo__namespace.Content,{className:`orb-pop ${p??""}`,align:i,side:s,sideOffset:l,style:{minWidth:d?"var(--radix-popover-trigger-width)":void 0,...u},onOpenAutoFocus:f=>f.preventDefault(),children:a})})]});P();var Jf=({items:t,value:r,defaultValue:o,onChange:n,sx:a,className:i})=>{let s=r!==void 0,[l,d]=er.useState(o??t[0]?.value),u=s?r:l,p=er.useRef([]),f=m=>{s||d(m),n?.(m);},b=m=>{if(m.key!=="ArrowRight"&&m.key!=="ArrowLeft")return;m.preventDefault();let v=t.filter(h=>!h.disabled),y=v.findIndex(h=>h.value===u),g=m.key==="ArrowRight"?1:-1,x=v[(y+g+v.length)%v.length];if(x){f(x.value);let h=t.findIndex(C=>C.value===x.value);p.current[h]?.focus();}};return e("div",{className:`orb-tabs ${i??""}`,role:"tablist",style:a,onKeyDown:b,children:t.map((m,v)=>{let y=m.value===u;return c("button",{ref:g=>{p.current[v]=g;},type:"button",role:"tab","aria-selected":y,disabled:m.disabled,className:`orb-tab ${y?"orb-is-active":""}`,style:{display:"inline-flex",alignItems:"center",gap:6},onClick:()=>f(m.value),children:[m.icon,m.label]},m.value)})})};P();var tb=["su","mo","tu","we","th","fr","sa"],Gn=(t,r)=>!!(t&&r&&t.isSame(r,"day")),Un=({value:t,rangeStart:r,rangeEnd:o,onChange:n,month:a,defaultMonth:i,onMonthChange:s,minDate:l,maxDate:d,locale:u,renderDay:p})=>{let f=a!==void 0,[b,m]=er.useState(()=>i??t??r??oo__default.default()),v=(f?a:b).startOf("month"),y=w=>{f||m(w),s?.(w);},g=er.useMemo(()=>u?v.locale(u):v,[v,u]),x=er.useMemo(()=>{let T=v.startOf("month").startOf("week"),I=[],S=T;for(let A=0;A<6;A+=1){let R=[];for(let M=0;M<7;M+=1)R.push(S),S=S.add(1,"day");if(I.push(R),S.isAfter(v.endOf("month"))&&A>=3)break}return I},[v]),h=er.useMemo(()=>{let w=u?oo__default.default().locale(u):oo__default.default();return tb.map((T,I)=>w.startOf("week").add(I,"day").format("dd"))},[u]),C=w=>!!(l&&w.isBefore(l.startOf("day"))||d&&w.isAfter(d.startOf("day"))),k=r!==void 0||o!==void 0;return c("div",{className:"orb-cal",children:[c("div",{className:"orb-cal-head",children:[e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Previous month",onClick:()=>y(v.subtract(1,"month")),children:e(Ma,{size:16,strokeWidth:2})}),e("span",{className:"orb-cal-title","aria-live":"polite",children:g.format("MMMM YYYY")}),e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Next month",onClick:()=>y(v.add(1,"month")),children:e(Br,{size:16,strokeWidth:2})})]}),c("div",{className:"orb-cal-grid",role:"grid",children:[h.map((w,T)=>e("span",{className:"orb-cal-dow",children:w},`${w}-${T}`)),x.flat().map(w=>{let T=!w.isSame(v,"month"),I=C(w),S=k?Gn(w,r)||Gn(w,o):Gn(w,t),A=w.isSame(oo__default.default(),"day"),R=k&&r&&o&&w.isAfter(r.startOf("day"))&&w.isBefore(o.startOf("day")),M=k&&Gn(w,r)&&!!o,N=k&&Gn(w,o)&&!!r,E=["orb-cal-day",T?"orb-is-outside":void 0,A?"orb-is-today":void 0,S?"orb-is-selected":void 0,R?"orb-is-in-range":void 0,M?"orb-is-range-start":void 0,N?"orb-is-range-end":void 0].filter(Boolean).join(" ");return p?e("span",{className:"orb-cal-day-slot",children:p(w,{outsideCurrentMonth:T,selected:S,today:A,disabled:I})},w.format("YYYY-MM-DD")):e("button",{type:"button",role:"gridcell","aria-selected":S,"aria-current":A?"date":void 0,className:E,disabled:I,onClick:()=>n?.(w),children:w.date()},w.format("YYYY-MM-DD"))})]})]})};P();oo__default.default.extend(rb__default.default);var ob=({label:t,value:r,defaultValue:o,onChange:n,minDate:a,maxDate:i,disabled:s,format:l="YYYY-MM-DD",placeholder:d,locale:u,dense:p=false,error:f,helperText:b,sx:m,className:v})=>{let y=r!==void 0,[g,x]=er.useState(o??null),h=y?r:g,[C,k]=er.useState(false),[w,T]=er.useState(null),I=N=>{y||x(N),n?.(N);},S=w??(h?(u?h.locale(u):h).format(l):""),A=()=>{if(w===null)return;let N=w.trim();if(!N)I(null);else {let E=oo__default.default(N,l,true);E.isValid()&&!(a&&E.isBefore(a.startOf("day")))&&!(i&&E.isAfter(i.startOf("day")))&&I(E);}T(null);},M=(typeof f=="string"?f:void 0)??b;return c("div",{className:`orb-fld ${f?"orb-is-error":""} ${v??""}`,style:m,children:[t&&e("label",{children:t}),e($s,{open:C,onOpenChange:k,trigger:c("div",{className:"orb-inp-adornment-wrap",style:{width:"100%"},children:[e("span",{className:"orb-inp-adornment",children:e(Hs,{size:15,strokeWidth:1.8})}),e("input",{className:`orb-inp ${p?"orb-inp-dense":""}`,value:S,placeholder:d??l,disabled:s,onFocus:()=>k(true),onChange:N=>T(N.target.value),onBlur:A,onKeyDown:N=>{N.key==="Enter"&&(A(),k(false)),N.key==="Escape"&&k(false);}})]}),children:e(Un,{value:h,onChange:N=>{I(N),T(null),k(false);},minDate:a,maxDate:i,locale:u,defaultMonth:h??void 0})}),M&&e("span",{className:"orb-fld-msg",children:M})]})};P();var ab=({onFilesSelected:t,multiple:r=false,accept:o="*",maxSize:n,title:a="Drag and drop files here or click to upload",subtitle:i="Support for bulk upload",sx:s})=>{let[l,d]=er.useState(false),[u,p]=er.useState([]),f=er.useRef(null),b=h=>{h.preventDefault(),d(true);},m=h=>{h.preventDefault(),d(false);},v=h=>{h.preventDefault(),d(false),g(Array.from(h.dataTransfer.files));},y=h=>{h.target.files&&g(Array.from(h.target.files));},g=h=>{let C=n?h.filter(w=>w.size<=n):h;C.length<h.length&&console.warn(`Some files were rejected because they exceed the maximum size of ${n} bytes.`);let k=r?[...u,...C]:C;r&&(k=k.filter((w,T,I)=>T===I.findIndex(S=>S.name===w.name&&S.size===w.size&&S.lastModified===w.lastModified))),p(k),t?.(k),f.current&&(f.current.value="");},x=h=>{let C=u.filter((k,w)=>w!==h);p(C),t?.(C);};return c("div",{style:{width:"100%",...s},children:[c("div",{onClick:()=>f.current?.click(),onDragOver:b,onDragLeave:m,onDrop:v,role:"button",tabIndex:0,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f.current?.click());},style:{border:`2px dashed ${l?"var(--orb-primary)":"var(--orb-border)"}`,borderRadius:"var(--orb-r)",padding:32,textAlign:"center",cursor:"pointer",backgroundColor:l?"var(--orb-hover)":"var(--orb-canvas)",transition:"border-color var(--orb-t-fast), background-color var(--orb-t-fast)"},children:[e("input",{type:"file",ref:f,style:{display:"none"},multiple:r,accept:o,onChange:y}),c("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[e(Jc,{size:40,strokeWidth:1.5,color:l?"var(--orb-primary)":"var(--orb-muted)"}),e("span",{className:"orb-subtitle",children:a}),e("span",{className:"orb-meta",children:i})]})]}),u.length>0&&e("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:16},children:u.map((h,C)=>c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",border:"1px solid var(--orb-border)",borderRadius:"var(--orb-r)",backgroundColor:"var(--orb-surface)"},children:[c("div",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[e(Lc,{size:16,strokeWidth:1.8,color:"var(--orb-muted)"}),e("span",{className:"orb-body-dense",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h.name}),c("span",{className:"orb-meta",children:["(",(h.size/1024).toFixed(1)," KB)"]})]}),e(ae,{"aria-label":`Remove ${h.name}`,onClick:()=>x(C),children:e(jc,{size:15,strokeWidth:1.8})})]},`${h.name}-${C}`))})]})};function br(...t){return tailwindMerge.twMerge(clsx.clsx(t))}var _a={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"},Kn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},nd=()=>"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";P();var db=classVarianceAuthority.cva(nd(),{variants:{variant:{default:`${_a.primary} shadow-sm`,destructive:"bg-[var(--orb-status-error)] text-[var(--orb-on-primary)] hover:opacity-90 active:opacity-80 shadow-sm",outline:`${_a.outline} shadow-sm`,secondary:"bg-[var(--orb-surface-2)] text-[var(--orb-fg)] hover:bg-[var(--orb-hover)] active:bg-[var(--orb-selected)] shadow-sm",ghost:_a.ghost,link:"text-[var(--orb-status-primary)] underline-offset-4 hover:underline hover:text-[var(--orb-status-primary)] active:text-[var(--orb-p700)]","chat-tool":"bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-text-2)] hover:bg-[var(--orbai-surface-3)] hover:border-[var(--orbai-border-strong)] hover:text-[var(--orbai-text-1)] active:scale-95 transition-all duration-200","chat-send":"bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] text-[var(--orb-on-primary)] border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 transition-all duration-200","chat-stop":"bg-[var(--orb-status-error)] hover:opacity-90 border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 text-[var(--orb-on-primary)] transition-all duration-200","chat-disabled":"cursor-not-allowed opacity-50 bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-muted)]"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3",lg:"h-11 px-8",icon:"h-10 w-10","chat-sm":"h-8 w-8 rounded-full","chat-md":"h-10 w-10 rounded-full","chat-lg":"h-12 w-12 rounded-full"},rounded:{none:Kn.none,sm:Kn.sm,md:Kn.md,full:Kn.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),Us=er__namespace.forwardRef(({className:t,variant:r,size:o,asChild:n=false,...a},i)=>e(n?reactSlot.Slot:"button",{className:br(db({variant:r,size:o,className:t})),ref:i,...a}));Us.displayName="Button";var pb={"common.cancel":"Cancel","common.save":"Save","common.ok":"OK","common.done":"Done","common.search":"Search","common.none":"None","common.all":"All","common.noData":"No data","common.copy":"Copy","common.delete":"Delete","common.loading":"Loading...","header.searchPlaceholder":"Ask me...","header.searchAddFeature":"Add feature","header.searchStartVoice":"Start voice input","header.searchStopVoice":"Stop voice input","header.searchOpenPanel":"Open conversation","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dark","header.theme.light":"Theme: Light","header.menu.setting":"Setting","header.menu.refresh":"Refresh","header.menu.logout":"Logout","navigation.expand":"Expand navigation","navigation.collapse":"Collapse navigation","navigation.searchPlaceholder":"Search menu...","navigation.noMatch":"No matching menu items","navigation.noAccessibleApp":"No accessible applications","navigation.noItems":"No items to display","navigation.expandView":"Expand {title}","navigation.mode.switchToFixed":"Switch to fixed navigation","navigation.mode.switchToFloating":"Switch to floating navigation","navigation.pinned":"Pinned","navigation.pin.add":"Pin to top","navigation.pin.remove":"Unpin","table.toolbar.searchPlaceholder":"Search...","table.title.default":"Data Table","table.toolbar.groupBy":"Group By","table.toolbar.summary":"Summary","table.toolbar.columns":"Columns","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Items per page:","table.toolbar.pageOf":"Page {current} of {total}","table.toolbar.newItem":"New Item","table.toolbar.editItem":"Edit Item","table.toolbar.deleteItem":"Delete Item","table.toolbar.graphicReport":"Graphic Report","table.toolbar.saveLayout":"Save Layout","table.menu.groupBy":"Group By","table.menu.clearAll":"Clear All","table.menu.visibleColumns":"Visible Columns","table.menu.showSummaryRow":"Show Summary Row","table.menu.noNumericColumns":"No numeric columns","table.group.expandAll":"Expand All Groups","table.group.collapseAll":"Collapse All Groups","table.mobile.notImplemented":"Mobile View Not Implemented","table.headerMenu.sortAsc":"Sort Ascending","table.headerMenu.sortDesc":"Sort Descending","table.headerMenu.clearSort":"Clear Sort","table.headerMenu.configureSort":"Configure Sort...","table.headerMenu.group":"Group by this column","table.headerMenu.ungroup":"Remove from grouping","table.headerMenu.addSummary":"Include in Summary","table.headerMenu.removeSummary":"Remove from Summary","table.headerMenu.hideColumn":"Hide Column","table.sortDialog.title":"Sort Settings","table.sortDialog.empty":"No sort rules. Add one to start ordering rows.","table.sortDialog.addRule":"Add Sort Rule","table.sortDialog.clearAll":"Clear All","table.sortDialog.asc":"Ascending","table.sortDialog.desc":"Descending","pivot.title.default":"Pivot Table Builder","pivot.subtitle.default":"Drag fields to configure the pivot table.","pivot.empty":"Drag at least one field into Values to render the pivot result.","pivot.records":"Records","pivot.afterFilter":"After filter","pivot.grandTotal":"Grand Total","pivot.resultLabel":"Result","pivot.valueLabel":"Value","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Field List","pivot.availableDimensions":"Available dimensions","pivot.allFieldsInUse":"All fields are in use.","pivot.zone.rows":"Rows","pivot.zone.columns":"Columns","pivot.zone.filters":"Filters","pivot.zone.values":"Values","pivot.hint.rows":"Drag fields here to build row hierarchy","pivot.hint.columns":"Drag fields here to build column hierarchy","pivot.hint.filters":"Drag fields here for report filters","pivot.hint.values":"Drag numeric fields here for aggregation","pivot.clearArea":"Clear area","pivot.filter.na":"N/A","pivot.filter.noValues":"No values","pivot.filter.noneSelected":"None selected","pivot.filter.allValues":"All values","pivot.filter.selectedCount":"{selected} / {total} selected","pivot.filter.selectAll":"Select All","pivot.filter.deselectAll":"Deselect All","pivot.filter.noResults":"No results","pivot.collapse.ariaExpand":"Expand configuration area","pivot.collapse.ariaCollapse":"Collapse configuration area","pivot.agg.sum":"Sum","pivot.agg.count":"Count","pivot.agg.avg":"Average","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Select preset","pivot.preset.save":"Save preset","pivot.preset.delete":"Delete preset","pivot.preset.saveDialogTitle":"Save current preset","pivot.preset.nameLabel":"Preset name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot Result","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Expand pivot result","pivot.table.collapse.ariaCollapse":"Collapse pivot result","pivot.chart.title":"Pivot Chart","pivot.chart.subtitle":"Map one dimension and up to two measures into a compact chart.","pivot.chart.subtitleReady":"{dimension} by {measure}","pivot.chart.emptyNoDimension":"Add at least one row or column field to render the chart.","pivot.chart.emptyNoValue":"Add at least one value field to render the chart.","pivot.chart.emptyNoData":"No data available for the current chart selection.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Measure","pivot.chart.secondaryMeasure":"Compare measure","pivot.chart.chartType":"Chart type","pivot.chart.style.barVertical":"Vertical bars","pivot.chart.style.barHorizontal":"Horizontal bars","pivot.chart.style.line":"Line","pivot.chart.style.scatter":"Scatter","pivot.chart.collapse.ariaExpand":"Expand chart area","pivot.chart.collapse.ariaCollapse":"Collapse chart area","smartFilter.adaptFilters":"Adapt Filters","smartFilter.addFilters":"Add Filters","smartFilter.go":"Go","smartFilter.visibleFilters":"Visible Filters","smartFilter.searchPlaceholder":"Search...","smartFilter.noOptionsFound":"No options found","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Equals","smartFilter.operator.contains":"Contains","smartFilter.operator.notContains":"Does Not Contain","smartFilter.operator.wildcard":"Wildcard Search","smartFilter.operator.notEquals":"Not Equals","smartFilter.operator.greaterThan":"Greater Than","smartFilter.operator.lessThan":"Less Than","smartFilter.operator.greaterOrEqual":"Greater Than or Equal","smartFilter.operator.lessOrEqual":"Less Than or Equal","smartFilter.operator.between":"Between","variant.noOptions":"No options","variant.defaultSuffix":"Default","variant.selectVariant":"Select Variant","variant.saveView":"Save View","variant.newVariant":"New Variant","variant.viewName":"View Name","variant.setDefault":"Set as Default","variant.publicAllUsers":"Public (All Users)","variant.toast.fetchFailed":"Failed to load variants","variant.toast.saveFailed":"Failed to save variant","variant.toast.saveSuccess":"Variant saved successfully","variant.toast.deleteFailed":"Failed to delete variant","variant.toast.deleteSuccess":"Variant deleted successfully","variant.toast.defaultFailed":"Failed to update default variant","variant.toast.defaultSuccess":"Default variant updated","layout.saveLayout":"Save Layout","layout.layoutOptions":"Layout Options","layout.selectLayout":"Select Layout","layout.saveCurrentLayout":"Save Current Layout...","layout.noSavedLayouts":"No saved layouts","layout.removeDefault":"Remove Default","layout.setAsDefault":"Set as Default","layout.layoutName":"Layout Name","layout.layoutDescription":"Description","layout.layoutNameHelper":"e.g., 'Compact View'","layout.warningOverwrite":"Warning: Existing layout will be overwritten","layout.useAsDefault":"Use as Default Layout","layout.publicAllUsers":"Public (Visible to all users)","layout.toast.loadFallback":"Failed to load layouts from backend, fallback to local storage","layout.toast.saveSuccess":"Layout saved successfully","layout.toast.saveLocalSuccess":"Layout saved to local storage","layout.toast.backendUnavailableSavedLocal":"Backend unavailable, saved to local storage","layout.toast.deleteSuccess":"Layout deleted successfully","layout.toast.deleteLocalSuccess":"Layout deleted from local storage","layout.toast.backendUnavailableDeletedLocal":"Backend unavailable, deleted from local storage","layout.toast.defaultSuccess":"Default layout set","layout.toast.defaultLocalSuccess":"Default layout set in local storage","layout.toast.backendUnavailableDefaultLocal":"Backend unavailable, default saved to local storage","dateRange.label":"Date Range","dateRange.startDate":"Start Date","dateRange.endDate":"End Date","dateRange.select":"Select...","dateRange.today":"Today","dateRange.thisWeek":"This Week","dateRange.thisMonth":"This Month","graph.records":"{count} records","graph.kpi.totalRecords":"Total Records","graph.kpi.totalReport":"Total Report","graph.kpi.totalBillable":"Total Billable","graph.kpi.efficiency":"Efficiency","graph.kpi.amount":"Amount","graph.kpi.flagged":"Flagged","graph.chart.billable.title":"Billable by Dimension","graph.chart.billable.subtitle":"Top values by billable hours","graph.chart.efficiency.title":"Efficiency by Person","graph.chart.efficiency.subtitle":"Lowest efficiency first","graph.chart.status.title":"Status Distribution","graph.chart.status.subtitle":"Record ratio by status","graph.dataBody":"Data Body","graph.reportTitle":"Graphic Report","graph.unassigned":"Unassigned","graph.column.reportHours":"Report Hours","graph.column.billableHours":"Billable Hours","detail.searchAi.placeholder":"Search fields, or ask AI if no match...","detail.searchAi.matches":"{count} matches found","detail.searchAi.noMatch":"No matching field found.","detail.searchAi.autoAiFallback":"No direct match. Triggering AI analysis...","detail.searchAi.aiResultTitle":"AI Insight","detail.table.title":"Related Records","kanban.empty":"Drop cards here","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Release to move into this bucket","kanban.bucket.add":"Add bucket","kanban.bucket.rename":"Rename bucket","kanban.bucket.saveRename":"Save bucket name","kanban.bucket.cancelRename":"Cancel renaming","kanban.search.placeholder":"Search cards and buckets","kanban.search.clear":"Clear search","kanban.search.results":"{count} matching cards","kanban.search.noMatch":"No matching cards","kanban.card.progress":"Progress","kanban.card.openDetail":"Open Detail","kanban.priority.critical":"Critical","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","quickCreate.newItem":"New Item","quickCreate.createWithTitle":"Create {title}","quickEdit.editWithTitle":"Edit {title}","quickDelete.confirmTitle":"Confirm Delete","quickDelete.confirmMessageSingle":"Are you sure you want to delete the selected record?","quickDelete.confirmMessageMultiple":"Are you sure you want to delete {count} selected records?","cardPage.viewDetails":"View Details","cardPage.download":"Download","cardPage.close":"Close","cardPage.empty":"No items found","messageBox.confirm":"OK","messageBox.cancel":"Cancel"},ub={"common.cancel":"\u53D6\u6D88","common.save":"\u4FDD\u5B58","common.ok":"\u786E\u5B9A","common.done":"\u5B8C\u6210","common.search":"\u641C\u7D22","common.none":"\u65E0","common.all":"\u5168\u90E8","common.noData":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.delete":"\u5220\u9664","common.loading":"\u52A0\u8F7D\u4E2D...","header.searchPlaceholder":"\u95EE\u6211\u70B9\u4EC0\u4E48...","header.searchAddFeature":"\u589E\u52A0\u529F\u80FD","header.searchStartVoice":"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165","header.searchStopVoice":"\u505C\u6B62\u8BED\u97F3\u8F93\u5165","header.searchOpenPanel":"\u6253\u5F00\u5BF9\u8BDD","header.theme.system":"\u4E3B\u9898\uFF1A\u8DDF\u968F\u7CFB\u7EDF","header.theme.dark":"\u4E3B\u9898\uFF1A\u6DF1\u8272","header.theme.light":"\u4E3B\u9898\uFF1A\u6D45\u8272","header.menu.setting":"\u8BBE\u7F6E","header.menu.refresh":"\u5237\u65B0","header.menu.logout":"\u6CE8\u9500","navigation.expand":"\u5C55\u5F00\u5BFC\u822A","navigation.collapse":"\u6298\u53E0\u5BFC\u822A","navigation.searchPlaceholder":"\u641C\u7D22\u83DC\u5355...","navigation.noMatch":"\u672A\u627E\u5230\u5339\u914D\u7684\u83DC\u5355\u9879","navigation.noAccessibleApp":"\u6682\u65E0\u53EF\u8BBF\u95EE\u7684\u5E94\u7528","navigation.noItems":"\u6682\u65E0\u53EF\u663E\u793A\u9879","navigation.expandView":"\u5C55\u5F00\u67E5\u770B {title}","navigation.mode.switchToFixed":"\u5207\u6362\u4E3A\u56FA\u5B9A\u5BFC\u822A","navigation.mode.switchToFloating":"\u5207\u6362\u4E3A\u60AC\u6D6E\u5BFC\u822A","navigation.pinned":"\u5DF2\u56FA\u5B9A","navigation.pin.add":"\u56FA\u5B9A\u5230\u9876\u90E8","navigation.pin.remove":"\u53D6\u6D88\u56FA\u5B9A","table.toolbar.searchPlaceholder":"\u641C\u7D22...","table.title.default":"\u6570\u636E\u8868","table.toolbar.groupBy":"\u5206\u7EC4","table.toolbar.summary":"\u6C47\u603B","table.toolbar.columns":"\u5217","table.toolbar.export":"\u5BFC\u51FA","table.toolbar.itemsPerPage":"\u6BCF\u9875\u6761\u6570\uFF1A","table.toolbar.pageOf":"\u7B2C {current} / {total} \u9875","table.toolbar.newItem":"\u65B0\u5EFA\u6761\u76EE","table.toolbar.editItem":"\u7F16\u8F91\u6761\u76EE","table.toolbar.deleteItem":"\u5220\u9664\u6761\u76EE","table.toolbar.graphicReport":"\u56FE\u8868\u62A5\u8868","table.toolbar.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","table.menu.groupBy":"\u5206\u7EC4","table.menu.clearAll":"\u6E05\u7A7A","table.menu.visibleColumns":"\u53EF\u89C1\u5217","table.menu.showSummaryRow":"\u663E\u793A\u6C47\u603B\u884C","table.menu.noNumericColumns":"\u6CA1\u6709\u6570\u503C\u5217","table.group.expandAll":"\u5C55\u5F00\u5168\u90E8\u5206\u7EC4","table.group.collapseAll":"\u6298\u53E0\u5168\u90E8\u5206\u7EC4","table.mobile.notImplemented":"\u79FB\u52A8\u7AEF\u89C6\u56FE\u6682\u672A\u5B9E\u73B0","table.headerMenu.sortAsc":"\u5347\u5E8F\u6392\u5217","table.headerMenu.sortDesc":"\u964D\u5E8F\u6392\u5217","table.headerMenu.clearSort":"\u6E05\u9664\u6392\u5E8F","table.headerMenu.configureSort":"\u6392\u5E8F\u8BBE\u7F6E...","table.headerMenu.group":"\u6309\u6B64\u5217\u5206\u7EC4","table.headerMenu.ungroup":"\u53D6\u6D88\u5206\u7EC4","table.headerMenu.addSummary":"\u52A0\u5165\u6C47\u603B","table.headerMenu.removeSummary":"\u4ECE\u6C47\u603B\u4E2D\u79FB\u9664","table.headerMenu.hideColumn":"\u9690\u85CF\u8BE5\u5217","table.sortDialog.title":"\u6392\u5E8F\u8BBE\u7F6E","table.sortDialog.empty":"\u6682\u65E0\u6392\u5E8F\u89C4\u5219\uFF0C\u8BF7\u6DFB\u52A0\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\u3002","table.sortDialog.addRule":"\u6DFB\u52A0\u6392\u5E8F\u89C4\u5219","table.sortDialog.clearAll":"\u6E05\u7A7A\u89C4\u5219","table.sortDialog.asc":"\u5347\u5E8F","table.sortDialog.desc":"\u964D\u5E8F","pivot.title.default":"\u6570\u636E\u900F\u89C6\u8868","pivot.subtitle.default":"\u62D6\u62FD\u5B57\u6BB5\u4EE5\u914D\u7F6E\u900F\u89C6\u8868\u3002","pivot.empty":"\u8BF7\u81F3\u5C11\u62D6\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u900F\u89C6\u7ED3\u679C\u3002","pivot.records":"\u8BB0\u5F55\u6570","pivot.afterFilter":"\u7B5B\u9009\u540E","pivot.grandTotal":"\u603B\u8BA1","pivot.resultLabel":"\u7ED3\u679C","pivot.valueLabel":"\u503C","pivot.table.dimensions":"\u7EF4\u5EA6","pivot.config.title":"\u5E03\u5C40\u914D\u7F6E","pivot.fieldList":"\u5B57\u6BB5\u5217\u8868","pivot.availableDimensions":"\u53EF\u7528\u7EF4\u5EA6","pivot.allFieldsInUse":"\u6240\u6709\u5B57\u6BB5\u90FD\u5DF2\u4F7F\u7528\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u7B5B\u9009","pivot.zone.values":"\u503C","pivot.hint.rows":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u884C\u5C42\u7EA7","pivot.hint.columns":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u5217\u5C42\u7EA7","pivot.hint.filters":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u4F5C\u4E3A\u62A5\u8868\u7B5B\u9009","pivot.hint.values":"\u5C06\u6570\u503C\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u8FDB\u884C\u805A\u5408","pivot.clearArea":"\u6E05\u7A7A\u533A\u57DF","pivot.filter.na":"\u4E0D\u53EF\u7528","pivot.filter.noValues":"\u65E0\u53EF\u9009\u503C","pivot.filter.noneSelected":"\u672A\u9009\u62E9","pivot.filter.allValues":"\u5168\u90E8\u503C","pivot.filter.selectedCount":"\u5DF2\u9009 {selected} / {total}","pivot.filter.selectAll":"\u5168\u9009","pivot.filter.deselectAll":"\u53D6\u6D88\u5168\u9009","pivot.filter.noResults":"\u65E0\u5339\u914D\u7ED3\u679C","pivot.collapse.ariaExpand":"\u5C55\u5F00\u914D\u7F6E\u533A\u57DF","pivot.collapse.ariaCollapse":"\u6298\u53E0\u914D\u7F6E\u533A\u57DF","pivot.agg.sum":"\u6C42\u548C","pivot.agg.count":"\u8BA1\u6570","pivot.agg.avg":"\u5E73\u5747\u503C","pivot.agg.min":"\u6700\u5C0F\u503C","pivot.agg.max":"\u6700\u5927\u503C","pivot.preset.selectPlaceholder":"\u9009\u62E9\u65B9\u6848","pivot.preset.save":"\u4FDD\u5B58\u65B9\u6848","pivot.preset.delete":"\u5220\u9664\u65B9\u6848","pivot.preset.saveDialogTitle":"\u4FDD\u5B58\u5F53\u524D\u65B9\u6848","pivot.preset.nameLabel":"\u65B9\u6848\u540D\u79F0","pivot.preset.defaultName":"\u65B9\u6848 {index}","pivot.table.sectionTitle":"\u900F\u89C6\u7ED3\u679C","pivot.table.expandRowsAll":"\u884C\u5168\u90E8\u6253\u5F00","pivot.table.collapseRowsAll":"\u884C\u5168\u90E8\u6298\u53E0","pivot.table.expandColumnsAll":"\u5217\u5168\u90E8\u6253\u5F00","pivot.table.collapseColumnsAll":"\u5217\u5168\u90E8\u6298\u53E0","pivot.table.collapse.ariaExpand":"\u5C55\u5F00\u900F\u89C6\u7ED3\u679C","pivot.table.collapse.ariaCollapse":"\u6298\u53E0\u900F\u89C6\u7ED3\u679C","pivot.chart.title":"\u900F\u89C6\u56FE\u8868","pivot.chart.subtitle":"\u5C06\u4E00\u4E2A\u7EF4\u5EA6\u4E0E\u6700\u591A\u4E24\u4E2A\u5EA6\u91CF\u6620\u5C04\u4E3A\u7D27\u51D1\u56FE\u8868\u3002","pivot.chart.subtitleReady":"{dimension} \xB7 {measure}","pivot.chart.emptyNoDimension":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u884C\u6216\u5217\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoValue":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoData":"\u5F53\u524D\u56FE\u8868\u9009\u62E9\u4E0B\u6682\u65E0\u53EF\u5C55\u793A\u6570\u636E\u3002","pivot.chart.dimension":"\u56FE\u8868\u7EF4\u5EA6","pivot.chart.primaryMeasure":"\u4E3B\u5EA6\u91CF","pivot.chart.secondaryMeasure":"\u5BF9\u6BD4\u5EA6\u91CF","pivot.chart.chartType":"\u56FE\u8868\u7C7B\u578B","pivot.chart.style.barVertical":"\u7EB5\u5411\u67F1\u72B6\u56FE","pivot.chart.style.barHorizontal":"\u6A2A\u5411\u67F1\u72B6\u56FE","pivot.chart.style.line":"\u6298\u7EBF\u56FE","pivot.chart.style.scatter":"\u6563\u70B9\u56FE","pivot.chart.collapse.ariaExpand":"\u5C55\u5F00\u56FE\u8868\u533A\u57DF","pivot.chart.collapse.ariaCollapse":"\u6298\u53E0\u56FE\u8868\u533A\u57DF","smartFilter.adaptFilters":"\u7B5B\u9009\u8BBE\u7F6E","smartFilter.addFilters":"\u6DFB\u52A0\u7B5B\u9009","smartFilter.go":"\u6267\u884C","smartFilter.visibleFilters":"\u53EF\u89C1\u7B5B\u9009\u9879","smartFilter.searchPlaceholder":"\u641C\u7D22...","smartFilter.noOptionsFound":"\u672A\u627E\u5230\u9009\u9879","smartFilter.min":"\u6700\u5C0F\u503C","smartFilter.max":"\u6700\u5927\u503C","smartFilter.minMaxPlaceholder":"\u6700\u5C0F\u503C - \u6700\u5927\u503C","smartFilter.operator.equals":"\u7B49\u4E8E","smartFilter.operator.contains":"\u5305\u542B","smartFilter.operator.notContains":"\u4E0D\u5305\u542B","smartFilter.operator.wildcard":"\u901A\u914D\u7B26\u641C\u7D22","smartFilter.operator.notEquals":"\u4E0D\u7B49\u4E8E","smartFilter.operator.greaterThan":"\u5927\u4E8E","smartFilter.operator.lessThan":"\u5C0F\u4E8E","smartFilter.operator.greaterOrEqual":"\u5927\u4E8E\u7B49\u4E8E","smartFilter.operator.lessOrEqual":"\u5C0F\u4E8E\u7B49\u4E8E","smartFilter.operator.between":"\u533A\u95F4","variant.noOptions":"\u65E0\u9009\u9879","variant.defaultSuffix":"\u9ED8\u8BA4","variant.selectVariant":"\u9009\u62E9\u89C6\u56FE","variant.saveView":"\u4FDD\u5B58\u89C6\u56FE","variant.newVariant":"\u65B0\u89C6\u56FE","variant.viewName":"\u89C6\u56FE\u540D\u79F0","variant.setDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","variant.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\uFF09","variant.toast.fetchFailed":"\u52A0\u8F7D\u89C6\u56FE\u5931\u8D25","variant.toast.saveFailed":"\u4FDD\u5B58\u89C6\u56FE\u5931\u8D25","variant.toast.saveSuccess":"\u89C6\u56FE\u4FDD\u5B58\u6210\u529F","variant.toast.deleteFailed":"\u5220\u9664\u89C6\u56FE\u5931\u8D25","variant.toast.deleteSuccess":"\u89C6\u56FE\u5220\u9664\u6210\u529F","variant.toast.defaultFailed":"\u66F4\u65B0\u9ED8\u8BA4\u89C6\u56FE\u5931\u8D25","variant.toast.defaultSuccess":"\u9ED8\u8BA4\u89C6\u56FE\u5DF2\u66F4\u65B0","layout.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","layout.layoutOptions":"\u5E03\u5C40\u9009\u9879","layout.selectLayout":"\u9009\u62E9\u5E03\u5C40","layout.saveCurrentLayout":"\u4FDD\u5B58\u5F53\u524D\u5E03\u5C40...","layout.noSavedLayouts":"\u6682\u65E0\u5DF2\u4FDD\u5B58\u5E03\u5C40","layout.removeDefault":"\u53D6\u6D88\u9ED8\u8BA4","layout.setAsDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","layout.layoutName":"\u5E03\u5C40\u540D\u79F0","layout.layoutDescription":"\u63CF\u8FF0","layout.layoutNameHelper":"\u4F8B\u5982\uFF1A\u7D27\u51D1\u89C6\u56FE","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u5C06\u8986\u76D6\u540C\u540D\u5E03\u5C40","layout.useAsDefault":"\u7528\u4F5C\u9ED8\u8BA4\u5E03\u5C40","layout.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09","layout.toast.loadFallback":"\u540E\u7AEF\u52A0\u8F7D\u5E03\u5C40\u5931\u8D25\uFF0C\u5DF2\u56DE\u9000\u5230\u672C\u5730\u5B58\u50A8","layout.toast.saveSuccess":"\u5E03\u5C40\u4FDD\u5B58\u6210\u529F","layout.toast.saveLocalSuccess":"\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.backendUnavailableSavedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.deleteSuccess":"\u5E03\u5C40\u5220\u9664\u6210\u529F","layout.toast.deleteLocalSuccess":"\u5E03\u5C40\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.backendUnavailableDeletedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.defaultSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u8BBE\u7F6E","layout.toast.defaultLocalSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u5728\u672C\u5730\u5B58\u50A8\u8BBE\u7F6E","layout.toast.backendUnavailableDefaultLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","dateRange.label":"\u65E5\u671F\u8303\u56F4","dateRange.startDate":"\u5F00\u59CB\u65E5\u671F","dateRange.endDate":"\u7ED3\u675F\u65E5\u671F","dateRange.select":"\u8BF7\u9009\u62E9...","dateRange.today":"\u4ECA\u5929","dateRange.thisWeek":"\u672C\u5468","dateRange.thisMonth":"\u672C\u6708","graph.records":"{count} \u6761\u8BB0\u5F55","graph.kpi.totalRecords":"\u603B\u8BB0\u5F55\u6570","graph.kpi.totalReport":"\u603B\u7533\u62A5\u5DE5\u65F6","graph.kpi.totalBillable":"\u603B\u53EF\u8BA1\u8D39\u5DE5\u65F6","graph.kpi.efficiency":"\u6548\u7387","graph.kpi.amount":"\u91D1\u989D","graph.kpi.flagged":"\u6807\u8BB0","graph.chart.billable.title":"\u7EF4\u5EA6\u8BA1\u8D39\u5DE5\u65F6","graph.chart.billable.subtitle":"\u6309\u53EF\u8BA1\u8D39\u5DE5\u65F6\u6392\u5E8F\u524D\u5217","graph.chart.efficiency.title":"\u4EBA\u5458\u6548\u7387","graph.chart.efficiency.subtitle":"\u6309\u6700\u4F4E\u6548\u7387\u4F18\u5148","graph.chart.status.title":"\u72B6\u6001\u5206\u5E03","graph.chart.status.subtitle":"\u6309\u72B6\u6001\u8BB0\u5F55\u5360\u6BD4","graph.dataBody":"\u6570\u636E\u660E\u7EC6","graph.reportTitle":"\u56FE\u8868\u62A5\u8868","graph.unassigned":"\u672A\u5206\u914D","graph.column.reportHours":"\u7533\u62A5\u5DE5\u65F6","graph.column.billableHours":"\u53EF\u8BA1\u8D39\u5DE5\u65F6","detail.searchAi.placeholder":"\u641C\u7D22\u5B57\u6BB5\uFF1B\u5982\u65E0\u7ED3\u679C\u5219\u81EA\u52A8\u89E6\u53D1 AI...","detail.searchAi.matches":"{count} \u6761\u5339\u914D\u7ED3\u679C","detail.searchAi.noMatch":"\u672A\u627E\u5230\u5339\u914D\u5B57\u6BB5\u3002","detail.searchAi.autoAiFallback":"\u672A\u547D\u4E2D\u5B57\u6BB5\uFF0C\u6B63\u5728\u89E6\u53D1 AI \u5206\u6790...","detail.searchAi.aiResultTitle":"AI \u5206\u6790\u7ED3\u679C","detail.table.title":"\u5173\u8054\u8BB0\u5F55","kanban.empty":"\u5C06\u5361\u7247\u62D6\u5230\u8FD9\u91CC","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u91CA\u653E\u540E\u79FB\u52A8\u5230\u8BE5 bucket","kanban.bucket.add":"\u65B0\u589E bucket","kanban.bucket.rename":"\u91CD\u547D\u540D bucket","kanban.bucket.saveRename":"\u4FDD\u5B58 bucket \u540D\u79F0","kanban.bucket.cancelRename":"\u53D6\u6D88\u91CD\u547D\u540D","kanban.search.placeholder":"\u641C\u7D22\u5361\u7247\u548C bucket","kanban.search.clear":"\u6E05\u9664\u641C\u7D22","kanban.search.results":"{count} \u5F20\u5339\u914D\u5361\u7247","kanban.search.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u5361\u7247","kanban.card.progress":"\u8FDB\u5EA6","kanban.card.openDetail":"\u6253\u5F00\u8BE6\u60C5","kanban.priority.critical":"\u7D27\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u5EFA\u6761\u76EE","quickCreate.createWithTitle":"\u521B\u5EFA{title}","quickEdit.editWithTitle":"\u7F16\u8F91{title}","quickDelete.confirmTitle":"\u786E\u8BA4\u5220\u9664","quickDelete.confirmMessageSingle":"\u786E\u8BA4\u5220\u9664\u5F53\u524D\u9009\u4E2D\u8BB0\u5F55\u5417\uFF1F","quickDelete.confirmMessageMultiple":"\u786E\u8BA4\u5220\u9664\u5DF2\u9009\u4E2D\u7684 {count} \u6761\u8BB0\u5F55\u5417\uFF1F","cardPage.viewDetails":"\u67E5\u770B\u8BE6\u60C5","cardPage.download":"\u4E0B\u8F7D","cardPage.close":"\u5173\u95ED","cardPage.empty":"\u672A\u627E\u5230\u6761\u76EE","messageBox.confirm":"\u786E\u5B9A","messageBox.cancel":"\u53D6\u6D88"},mb={"common.cancel":"Annuler","common.save":"Enregistrer","common.ok":"OK","common.done":"Terminer","common.search":"Rechercher","common.none":"Aucun","common.all":"Tout","common.noData":"Aucune donn\xE9e","common.copy":"Copier","common.delete":"Supprimer","common.loading":"Chargement...","header.searchPlaceholder":"Demandez-moi...","header.searchAddFeature":"Ajouter une fonction","header.searchStartVoice":"D\xE9marrer la saisie vocale","header.searchStopVoice":"Arr\xEAter la saisie vocale","header.searchOpenPanel":"Ouvrir la conversation","header.theme.system":"Th\xE8me : Syst\xE8me","header.theme.dark":"Th\xE8me : Sombre","header.theme.light":"Th\xE8me : Clair","header.menu.setting":"Param\xE8tres","header.menu.refresh":"Actualiser","header.menu.logout":"Se d\xE9connecter","navigation.expand":"D\xE9velopper la navigation","navigation.collapse":"R\xE9duire la navigation","navigation.searchPlaceholder":"Rechercher dans le menu...","navigation.noMatch":"Aucun \xE9l\xE9ment correspondant","navigation.noAccessibleApp":"Aucune application accessible","navigation.noItems":"Aucun \xE9l\xE9ment \xE0 afficher","navigation.expandView":"D\xE9velopper {title}","navigation.mode.switchToFixed":"Basculer vers la navigation fixe","navigation.mode.switchToFloating":"Basculer vers la navigation flottante","navigation.pinned":"\xC9pingl\xE9s","navigation.pin.add":"\xC9pingler en haut","navigation.pin.remove":"D\xE9s\xE9pingler","table.toolbar.searchPlaceholder":"Rechercher...","table.title.default":"Tableau de donn\xE9es","table.toolbar.groupBy":"Grouper","table.toolbar.summary":"R\xE9sum\xE9","table.toolbar.columns":"Colonnes","table.toolbar.export":"Exporter","table.toolbar.itemsPerPage":"Lignes par page :","table.toolbar.pageOf":"Page {current} sur {total}","table.toolbar.newItem":"Nouvel \xE9l\xE9ment","table.toolbar.editItem":"Modifier l'\xE9l\xE9ment","table.toolbar.deleteItem":"Supprimer l'\xE9l\xE9ment","table.toolbar.graphicReport":"Rapport graphique","table.toolbar.saveLayout":"Enregistrer la vue","table.menu.groupBy":"Grouper","table.menu.clearAll":"Tout effacer","table.menu.visibleColumns":"Colonnes visibles","table.menu.showSummaryRow":"Afficher la ligne de r\xE9sum\xE9","table.menu.noNumericColumns":"Aucune colonne num\xE9rique","table.group.expandAll":"D\xE9velopper tous les groupes","table.group.collapseAll":"R\xE9duire tous les groupes","table.mobile.notImplemented":"Vue mobile non impl\xE9ment\xE9e","table.headerMenu.sortAsc":"Trier ascendant","table.headerMenu.sortDesc":"Trier descendant","table.headerMenu.clearSort":"Effacer le tri","table.headerMenu.configureSort":"Configurer le tri...","table.headerMenu.group":"Grouper par cette colonne","table.headerMenu.ungroup":"Retirer du groupement","table.headerMenu.addSummary":"Inclure dans le r\xE9sum\xE9","table.headerMenu.removeSummary":"Retirer du r\xE9sum\xE9","table.headerMenu.hideColumn":"Masquer la colonne","table.sortDialog.title":"Param\xE8tres de tri","table.sortDialog.empty":"Aucune r\xE8gle de tri. Ajoutez-en une pour commencer.","table.sortDialog.addRule":"Ajouter une r\xE8gle","table.sortDialog.clearAll":"Tout effacer","table.sortDialog.asc":"Ascendant","table.sortDialog.desc":"Descendant","pivot.title.default":"Tableau crois\xE9 dynamique","pivot.subtitle.default":"Faites glisser les champs pour configurer le tableau crois\xE9.","pivot.empty":"Ajoutez au moins un champ de valeur pour afficher le r\xE9sultat.","pivot.records":"Enregistrements","pivot.afterFilter":"Apr\xE8s filtre","pivot.grandTotal":"Total g\xE9n\xE9ral","pivot.resultLabel":"R\xE9sultat","pivot.valueLabel":"Valeur","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Liste des champs","pivot.availableDimensions":"Dimensions disponibles","pivot.allFieldsInUse":"Tous les champs sont d\xE9j\xE0 utilis\xE9s.","pivot.zone.rows":"Lignes","pivot.zone.columns":"Colonnes","pivot.zone.filters":"Filtres","pivot.zone.values":"Valeurs","pivot.hint.rows":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des lignes","pivot.hint.columns":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des colonnes","pivot.hint.filters":"D\xE9posez les champs ici pour les filtres du rapport","pivot.hint.values":"D\xE9posez les champs num\xE9riques ici pour les agr\xE9gations","pivot.clearArea":"Vider la zone","pivot.filter.na":"N/A","pivot.filter.noValues":"Aucune valeur","pivot.filter.noneSelected":"Aucune s\xE9lection","pivot.filter.allValues":"Toutes les valeurs","pivot.filter.selectedCount":"{selected} / {total} s\xE9lectionn\xE9es","pivot.filter.selectAll":"Tout s\xE9lectionner","pivot.filter.deselectAll":"Tout d\xE9s\xE9lectionner","pivot.filter.noResults":"Aucun r\xE9sultat","pivot.collapse.ariaExpand":"D\xE9velopper la zone de configuration","pivot.collapse.ariaCollapse":"R\xE9duire la zone de configuration","pivot.agg.sum":"Somme","pivot.agg.count":"Compte","pivot.agg.avg":"Moyenne","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"S\xE9lectionner un preset","pivot.preset.save":"Enregistrer le preset","pivot.preset.delete":"Supprimer le preset","pivot.preset.saveDialogTitle":"Enregistrer le preset actuel","pivot.preset.nameLabel":"Nom du preset","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"R\xE9sultat du pivot","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"D\xE9velopper le r\xE9sultat du pivot","pivot.table.collapse.ariaCollapse":"R\xE9duire le r\xE9sultat du pivot","pivot.chart.title":"Graphique pivot","pivot.chart.subtitle":"Associez une dimension et jusqu\u2019\xE0 deux mesures dans un graphique compact.","pivot.chart.subtitleReady":"{dimension} par {measure}","pivot.chart.emptyNoDimension":"Ajoutez au moins un champ de ligne ou de colonne pour afficher le graphique.","pivot.chart.emptyNoValue":"Ajoutez au moins un champ de valeur pour afficher le graphique.","pivot.chart.emptyNoData":"Aucune donn\xE9e disponible pour la s\xE9lection actuelle du graphique.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Mesure","pivot.chart.secondaryMeasure":"Mesure de comparaison","pivot.chart.chartType":"Type de graphique","pivot.chart.style.barVertical":"Barres verticales","pivot.chart.style.barHorizontal":"Barres horizontales","pivot.chart.style.line":"Ligne","pivot.chart.style.scatter":"Nuage de points","pivot.chart.collapse.ariaExpand":"D\xE9velopper la zone du graphique","pivot.chart.collapse.ariaCollapse":"R\xE9duire la zone du graphique","smartFilter.adaptFilters":"Adapter les filtres","smartFilter.addFilters":"Ajouter des filtres","smartFilter.go":"Ex\xE9cuter","smartFilter.visibleFilters":"Filtres visibles","smartFilter.searchPlaceholder":"Rechercher...","smartFilter.noOptionsFound":"Aucune option trouv\xE9e","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"\xC9gal \xE0","smartFilter.operator.contains":"Contient","smartFilter.operator.notContains":"Ne contient pas","smartFilter.operator.wildcard":"Recherche g\xE9n\xE9rique","smartFilter.operator.notEquals":"Diff\xE9rent de","smartFilter.operator.greaterThan":"Sup\xE9rieur \xE0","smartFilter.operator.lessThan":"Inf\xE9rieur \xE0","smartFilter.operator.greaterOrEqual":"Sup\xE9rieur ou \xE9gal","smartFilter.operator.lessOrEqual":"Inf\xE9rieur ou \xE9gal","smartFilter.operator.between":"Entre","variant.noOptions":"Aucune option","variant.defaultSuffix":"Par d\xE9faut","variant.selectVariant":"S\xE9lectionner une vue","variant.saveView":"Enregistrer la vue","variant.newVariant":"Nouvelle vue","variant.viewName":"Nom de la vue","variant.setDefault":"D\xE9finir par d\xE9faut","variant.publicAllUsers":"Public (tous les utilisateurs)","variant.toast.fetchFailed":"\xC9chec du chargement des vues","variant.toast.saveFailed":"\xC9chec de l'enregistrement de la vue","variant.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","variant.toast.deleteFailed":"\xC9chec de la suppression de la vue","variant.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","variant.toast.defaultFailed":"\xC9chec de la mise \xE0 jour de la vue par d\xE9faut","variant.toast.defaultSuccess":"Vue par d\xE9faut mise \xE0 jour","layout.saveLayout":"Enregistrer la vue","layout.layoutOptions":"Options de vue","layout.selectLayout":"S\xE9lectionner une vue","layout.saveCurrentLayout":"Enregistrer la vue actuelle...","layout.noSavedLayouts":"Aucune vue enregistr\xE9e","layout.removeDefault":"Retirer le d\xE9faut","layout.setAsDefault":"D\xE9finir par d\xE9faut","layout.layoutName":"Nom de la vue","layout.layoutDescription":"Description","layout.layoutNameHelper":"ex. : Vue compacte","layout.warningOverwrite":"Attention : la vue existante sera \xE9cras\xE9e","layout.useAsDefault":"Utiliser comme vue par d\xE9faut","layout.publicAllUsers":"Public (visible par tous les utilisateurs)","layout.toast.loadFallback":"\xC9chec du chargement depuis le backend, bascule vers le stockage local","layout.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","layout.toast.saveLocalSuccess":"Vue enregistr\xE9e dans le stockage local","layout.toast.backendUnavailableSavedLocal":"Backend indisponible, enregistr\xE9 en local","layout.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","layout.toast.deleteLocalSuccess":"Vue supprim\xE9e du stockage local","layout.toast.backendUnavailableDeletedLocal":"Backend indisponible, supprim\xE9 en local","layout.toast.defaultSuccess":"Vue par d\xE9faut d\xE9finie","layout.toast.defaultLocalSuccess":"Vue par d\xE9faut d\xE9finie en local","layout.toast.backendUnavailableDefaultLocal":"Backend indisponible, d\xE9faut enregistr\xE9 en local","dateRange.label":"Plage de dates","dateRange.startDate":"Date de d\xE9but","dateRange.endDate":"Date de fin","dateRange.select":"S\xE9lectionner...","dateRange.today":"Aujourd'hui","dateRange.thisWeek":"Cette semaine","dateRange.thisMonth":"Ce mois-ci","graph.records":"{count} enregistrements","graph.kpi.totalRecords":"Total des enregistrements","graph.kpi.totalReport":"Total d\xE9clar\xE9","graph.kpi.totalBillable":"Total facturable","graph.kpi.efficiency":"Efficacit\xE9","graph.kpi.amount":"Montant","graph.kpi.flagged":"Signal\xE9","graph.chart.billable.title":"Facturable par dimension","graph.chart.billable.subtitle":"Top valeurs par heures facturables","graph.chart.efficiency.title":"Efficacit\xE9 par personne","graph.chart.efficiency.subtitle":"Efficacit\xE9 la plus faible en premier","graph.chart.status.title":"R\xE9partition des statuts","graph.chart.status.subtitle":"Ratio des enregistrements par statut","graph.dataBody":"Donn\xE9es","graph.reportTitle":"Rapport graphique","graph.unassigned":"Non attribu\xE9","graph.column.reportHours":"Heures d\xE9clar\xE9es","graph.column.billableHours":"Heures facturables","detail.searchAi.placeholder":"Rechercher des champs, ou interroger l\u2019IA en cas d\u2019absence de r\xE9sultat...","detail.searchAi.matches":"{count} correspondances trouv\xE9es","detail.searchAi.noMatch":"Aucun champ correspondant trouv\xE9.","detail.searchAi.autoAiFallback":"Aucune correspondance directe. Analyse IA en cours...","detail.searchAi.aiResultTitle":"Analyse IA","detail.table.title":"Enregistrements li\xE9s","kanban.empty":"D\xE9posez les cartes ici","kanban.bucket.limit":"Limite","kanban.bucket.dropHere":"Rel\xE2chez pour d\xE9placer dans cette colonne","kanban.bucket.add":"Ajouter une colonne","kanban.bucket.rename":"Renommer la colonne","kanban.bucket.saveRename":"Enregistrer le nom","kanban.bucket.cancelRename":"Annuler le renommage","kanban.search.placeholder":"Rechercher des cartes et colonnes","kanban.search.clear":"Effacer la recherche","kanban.search.results":"{count} cartes correspondantes","kanban.search.noMatch":"Aucune carte correspondante","kanban.card.progress":"Progression","kanban.card.openDetail":"Ouvrir le d\xE9tail","kanban.priority.critical":"Critique","kanban.priority.high":"\xC9lev\xE9e","kanban.priority.medium":"Moyenne","kanban.priority.low":"Faible","quickCreate.newItem":"Nouvel \xE9l\xE9ment","quickCreate.createWithTitle":"Cr\xE9er {title}","quickEdit.editWithTitle":"Modifier {title}","quickDelete.confirmTitle":"Confirmer la suppression","quickDelete.confirmMessageSingle":"Voulez-vous vraiment supprimer l\u2019enregistrement s\xE9lectionn\xE9 ?","quickDelete.confirmMessageMultiple":"Voulez-vous vraiment supprimer les {count} enregistrements s\xE9lectionn\xE9s ?","cardPage.viewDetails":"Voir les d\xE9tails","cardPage.download":"T\xE9l\xE9charger","cardPage.close":"Fermer","cardPage.empty":"Aucun \xE9l\xE9ment trouv\xE9","messageBox.confirm":"OK","messageBox.cancel":"Annuler"},gb={"common.cancel":"Abbrechen","common.save":"Speichern","common.ok":"OK","common.done":"Fertig","common.search":"Suchen","common.none":"Keine","common.all":"Alle","common.noData":"Keine Daten","common.copy":"Kopieren","common.delete":"L\xF6schen","common.loading":"Wird geladen...","header.searchPlaceholder":"Frag mich...","header.searchAddFeature":"Funktion hinzuf\xFCgen","header.searchStartVoice":"Spracheingabe starten","header.searchStopVoice":"Spracheingabe stoppen","header.searchOpenPanel":"Unterhaltung \xF6ffnen","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dunkel","header.theme.light":"Theme: Hell","header.menu.setting":"Einstellungen","header.menu.refresh":"Aktualisieren","header.menu.logout":"Abmelden","navigation.expand":"Navigation erweitern","navigation.collapse":"Navigation einklappen","navigation.searchPlaceholder":"Men\xFC suchen...","navigation.noMatch":"Keine passenden Men\xFCeintr\xE4ge","navigation.noAccessibleApp":"Keine verf\xFCgbaren Anwendungen","navigation.noItems":"Keine Eintr\xE4ge vorhanden","navigation.expandView":"{title} aufklappen","navigation.mode.switchToFixed":"Zu fester Navigation wechseln","navigation.mode.switchToFloating":"Zu schwebender Navigation wechseln","navigation.pinned":"Angeheftet","navigation.pin.add":"Oben anheften","navigation.pin.remove":"L\xF6sen","table.toolbar.searchPlaceholder":"Suchen...","table.title.default":"Datentabelle","table.toolbar.groupBy":"Gruppieren","table.toolbar.summary":"Zusammenfassung","table.toolbar.columns":"Spalten","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Zeilen pro Seite:","table.toolbar.pageOf":"Seite {current} von {total}","table.toolbar.newItem":"Neuer Eintrag","table.toolbar.editItem":"Eintrag bearbeiten","table.toolbar.deleteItem":"Eintrag l\xF6schen","table.toolbar.graphicReport":"Grafikbericht","table.toolbar.saveLayout":"Layout speichern","table.menu.groupBy":"Gruppieren","table.menu.clearAll":"Alles l\xF6schen","table.menu.visibleColumns":"Sichtbare Spalten","table.menu.showSummaryRow":"Summenzeile anzeigen","table.menu.noNumericColumns":"Keine numerischen Spalten","table.group.expandAll":"Alle Gruppen aufklappen","table.group.collapseAll":"Alle Gruppen zuklappen","table.mobile.notImplemented":"Mobile Ansicht nicht implementiert","table.headerMenu.sortAsc":"Aufsteigend sortieren","table.headerMenu.sortDesc":"Absteigend sortieren","table.headerMenu.clearSort":"Sortierung entfernen","table.headerMenu.configureSort":"Sortierung konfigurieren...","table.headerMenu.group":"Nach dieser Spalte gruppieren","table.headerMenu.ungroup":"Aus Gruppierung entfernen","table.headerMenu.addSummary":"In Summe einbeziehen","table.headerMenu.removeSummary":"Aus Summe entfernen","table.headerMenu.hideColumn":"Spalte ausblenden","table.sortDialog.title":"Sortiereinstellungen","table.sortDialog.empty":"Keine Sortierregeln. F\xFCgen Sie eine hinzu, um zu sortieren.","table.sortDialog.addRule":"Regel hinzuf\xFCgen","table.sortDialog.clearAll":"Alle l\xF6schen","table.sortDialog.asc":"Aufsteigend","table.sortDialog.desc":"Absteigend","pivot.title.default":"Pivot-Tabelle","pivot.subtitle.default":"Ziehen Sie Felder, um die Pivot-Tabelle zu konfigurieren.","pivot.empty":"Ziehen Sie mindestens ein Wertefeld, um das Ergebnis anzuzeigen.","pivot.records":"Datens\xE4tze","pivot.afterFilter":"Nach Filter","pivot.grandTotal":"Gesamtsumme","pivot.resultLabel":"Ergebnis","pivot.valueLabel":"Wert","pivot.table.dimensions":"Dimensionen","pivot.config.title":"Konfiguration","pivot.fieldList":"Feldliste","pivot.availableDimensions":"Verf\xFCgbare Dimensionen","pivot.allFieldsInUse":"Alle Felder sind bereits verwendet.","pivot.zone.rows":"Zeilen","pivot.zone.columns":"Spalten","pivot.zone.filters":"Filter","pivot.zone.values":"Werte","pivot.hint.rows":"Felder hierhin ziehen, um die Zeilenhierarchie zu erstellen","pivot.hint.columns":"Felder hierhin ziehen, um die Spaltenhierarchie zu erstellen","pivot.hint.filters":"Felder hierhin ziehen f\xFCr Berichtsfilter","pivot.hint.values":"Numerische Felder hierhin ziehen f\xFCr Aggregation","pivot.clearArea":"Bereich leeren","pivot.filter.na":"N/V","pivot.filter.noValues":"Keine Werte","pivot.filter.noneSelected":"Nichts ausgew\xE4hlt","pivot.filter.allValues":"Alle Werte","pivot.filter.selectedCount":"{selected} / {total} ausgew\xE4hlt","pivot.filter.selectAll":"Alle ausw\xE4hlen","pivot.filter.deselectAll":"Alle abw\xE4hlen","pivot.filter.noResults":"Keine Ergebnisse","pivot.collapse.ariaExpand":"Konfigurationsbereich erweitern","pivot.collapse.ariaCollapse":"Konfigurationsbereich reduzieren","pivot.agg.sum":"Summe","pivot.agg.count":"Anzahl","pivot.agg.avg":"Durchschnitt","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Preset w\xE4hlen","pivot.preset.save":"Preset speichern","pivot.preset.delete":"Preset l\xF6schen","pivot.preset.saveDialogTitle":"Aktuelles Preset speichern","pivot.preset.nameLabel":"Preset-Name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot-Ergebnis","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Pivot-Ergebnis erweitern","pivot.table.collapse.ariaCollapse":"Pivot-Ergebnis reduzieren","pivot.chart.title":"Pivot-Diagramm","pivot.chart.subtitle":"Eine Dimension und bis zu zwei Kennzahlen in einem kompakten Diagramm abbilden.","pivot.chart.subtitleReady":"{dimension} nach {measure}","pivot.chart.emptyNoDimension":"F\xFCgen Sie mindestens ein Zeilen- oder Spaltenfeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoValue":"F\xFCgen Sie mindestens ein Wertefeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoData":"F\xFCr die aktuelle Diagrammauswahl sind keine Daten verf\xFCgbar.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Kennzahl","pivot.chart.secondaryMeasure":"Vergleichskennzahl","pivot.chart.chartType":"Diagrammtyp","pivot.chart.style.barVertical":"Vertikale Balken","pivot.chart.style.barHorizontal":"Horizontale Balken","pivot.chart.style.line":"Linie","pivot.chart.style.scatter":"Streudiagramm","pivot.chart.collapse.ariaExpand":"Diagrammbereich erweitern","pivot.chart.collapse.ariaCollapse":"Diagrammbereich reduzieren","smartFilter.adaptFilters":"Filter anpassen","smartFilter.addFilters":"Filter hinzuf\xFCgen","smartFilter.go":"Los","smartFilter.visibleFilters":"Sichtbare Filter","smartFilter.searchPlaceholder":"Suchen...","smartFilter.noOptionsFound":"Keine Optionen gefunden","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Gleich","smartFilter.operator.contains":"Enth\xE4lt","smartFilter.operator.notContains":"Enth\xE4lt nicht","smartFilter.operator.wildcard":"Wildcard-Suche","smartFilter.operator.notEquals":"Ungleich","smartFilter.operator.greaterThan":"Gr\xF6\xDFer als","smartFilter.operator.lessThan":"Kleiner als","smartFilter.operator.greaterOrEqual":"Gr\xF6\xDFer gleich","smartFilter.operator.lessOrEqual":"Kleiner gleich","smartFilter.operator.between":"Zwischen","variant.noOptions":"Keine Optionen","variant.defaultSuffix":"Standard","variant.selectVariant":"Variante w\xE4hlen","variant.saveView":"Ansicht speichern","variant.newVariant":"Neue Variante","variant.viewName":"Ansichtsname","variant.setDefault":"Als Standard setzen","variant.publicAllUsers":"\xD6ffentlich (alle Benutzer)","variant.toast.fetchFailed":"Varianten konnten nicht geladen werden","variant.toast.saveFailed":"Variante konnte nicht gespeichert werden","variant.toast.saveSuccess":"Variante erfolgreich gespeichert","variant.toast.deleteFailed":"Variante konnte nicht gel\xF6scht werden","variant.toast.deleteSuccess":"Variante erfolgreich gel\xF6scht","variant.toast.defaultFailed":"Standardvariante konnte nicht aktualisiert werden","variant.toast.defaultSuccess":"Standardvariante aktualisiert","layout.saveLayout":"Layout speichern","layout.layoutOptions":"Layout-Optionen","layout.selectLayout":"Layout w\xE4hlen","layout.saveCurrentLayout":"Aktuelles Layout speichern...","layout.noSavedLayouts":"Keine gespeicherten Layouts","layout.removeDefault":"Standard entfernen","layout.setAsDefault":"Als Standard setzen","layout.layoutName":"Layoutname","layout.layoutDescription":"Beschreibung","layout.layoutNameHelper":"z. B. Kompaktansicht","layout.warningOverwrite":"Warnung: Vorhandenes Layout wird \xFCberschrieben","layout.useAsDefault":"Als Standardlayout verwenden","layout.publicAllUsers":"\xD6ffentlich (f\xFCr alle sichtbar)","layout.toast.loadFallback":"Layouts konnten nicht vom Backend geladen werden, Wechsel zu lokalem Speicher","layout.toast.saveSuccess":"Layout erfolgreich gespeichert","layout.toast.saveLocalSuccess":"Layout im lokalen Speicher gespeichert","layout.toast.backendUnavailableSavedLocal":"Backend nicht verf\xFCgbar, lokal gespeichert","layout.toast.deleteSuccess":"Layout erfolgreich gel\xF6scht","layout.toast.deleteLocalSuccess":"Layout aus lokalem Speicher gel\xF6scht","layout.toast.backendUnavailableDeletedLocal":"Backend nicht verf\xFCgbar, lokal gel\xF6scht","layout.toast.defaultSuccess":"Standardlayout gesetzt","layout.toast.defaultLocalSuccess":"Standardlayout lokal gesetzt","layout.toast.backendUnavailableDefaultLocal":"Backend nicht verf\xFCgbar, Standard lokal gespeichert","dateRange.label":"Datumsbereich","dateRange.startDate":"Startdatum","dateRange.endDate":"Enddatum","dateRange.select":"Ausw\xE4hlen...","dateRange.today":"Heute","dateRange.thisWeek":"Diese Woche","dateRange.thisMonth":"Diesen Monat","graph.records":"{count} Datens\xE4tze","graph.kpi.totalRecords":"Gesamt Datens\xE4tze","graph.kpi.totalReport":"Gesamt Report","graph.kpi.totalBillable":"Gesamt abrechenbar","graph.kpi.efficiency":"Effizienz","graph.kpi.amount":"Betrag","graph.kpi.flagged":"Markiert","graph.chart.billable.title":"Abrechenbar nach Dimension","graph.chart.billable.subtitle":"Top-Werte nach abrechenbaren Stunden","graph.chart.efficiency.title":"Effizienz pro Person","graph.chart.efficiency.subtitle":"Niedrigste Effizienz zuerst","graph.chart.status.title":"Statusverteilung","graph.chart.status.subtitle":"Anteil je Status","graph.dataBody":"Datentabelle","graph.reportTitle":"Grafikbericht","graph.unassigned":"Nicht zugewiesen","graph.column.reportHours":"Melde-Stunden","graph.column.billableHours":"Abrechenbare Stunden","detail.searchAi.placeholder":"Felder suchen, oder bei keinem Treffer die KI fragen...","detail.searchAi.matches":"{count} Treffer gefunden","detail.searchAi.noMatch":"Kein passendes Feld gefunden.","detail.searchAi.autoAiFallback":"Keine direkte \xDCbereinstimmung. KI-Analyse wird gestartet...","detail.searchAi.aiResultTitle":"KI-Ergebnis","detail.table.title":"Verkn\xFCpfte Eintr\xE4ge","kanban.empty":"Karten hier ablegen","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Loslassen, um in diese Spalte zu verschieben","kanban.bucket.add":"Spalte hinzuf\xFCgen","kanban.bucket.rename":"Spalte umbenennen","kanban.bucket.saveRename":"Spaltennamen speichern","kanban.bucket.cancelRename":"Umbenennen abbrechen","kanban.search.placeholder":"Karten und Spalten durchsuchen","kanban.search.clear":"Suche l\xF6schen","kanban.search.results":"{count} passende Karten","kanban.search.noMatch":"Keine passenden Karten","kanban.card.progress":"Fortschritt","kanban.card.openDetail":"Detail \xF6ffnen","kanban.priority.critical":"Kritisch","kanban.priority.high":"Hoch","kanban.priority.medium":"Mittel","kanban.priority.low":"Niedrig","quickCreate.newItem":"Neuer Eintrag","quickCreate.createWithTitle":"{title} erstellen","quickEdit.editWithTitle":"{title} bearbeiten","quickDelete.confirmTitle":"L\xF6schen best\xE4tigen","quickDelete.confirmMessageSingle":"M\xF6chten Sie den ausgew\xE4hlten Datensatz wirklich l\xF6schen?","quickDelete.confirmMessageMultiple":"M\xF6chten Sie die {count} ausgew\xE4hlten Datens\xE4tze wirklich l\xF6schen?","cardPage.viewDetails":"Details anzeigen","cardPage.download":"Herunterladen","cardPage.close":"Schlie\xDFen","cardPage.empty":"Keine Eintr\xE4ge gefunden","messageBox.confirm":"OK","messageBox.cancel":"Abbrechen"},fb={"common.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","common.save":"\u4FDD\u5B58","common.ok":"OK","common.done":"\u5B8C\u4E86","common.search":"\u691C\u7D22","common.none":"\u306A\u3057","common.all":"\u3059\u3079\u3066","common.noData":"\u30C7\u30FC\u30BF\u306A\u3057","common.copy":"\u30B3\u30D4\u30FC","common.delete":"\u524A\u9664","common.loading":"\u8AAD\u307F\u8FBC\u307F\u4E2D...","header.searchPlaceholder":"\u4F55\u304B\u805E\u3044\u3066\u304F\u3060\u3055\u3044...","header.searchAddFeature":"\u6A5F\u80FD\u3092\u8FFD\u52A0","header.searchStartVoice":"\u97F3\u58F0\u5165\u529B\u3092\u958B\u59CB","header.searchStopVoice":"\u97F3\u58F0\u5165\u529B\u3092\u505C\u6B62","header.searchOpenPanel":"\u4F1A\u8A71\u3092\u958B\u304F","header.theme.system":"\u30C6\u30FC\u30DE\uFF1A\u30B7\u30B9\u30C6\u30E0","header.theme.dark":"\u30C6\u30FC\u30DE\uFF1A\u30C0\u30FC\u30AF","header.theme.light":"\u30C6\u30FC\u30DE\uFF1A\u30E9\u30A4\u30C8","header.menu.setting":"\u8A2D\u5B9A","header.menu.refresh":"\u518D\u8AAD\u307F\u8FBC\u307F","header.menu.logout":"\u30ED\u30B0\u30A2\u30A6\u30C8","navigation.expand":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u5C55\u958B","navigation.collapse":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u6298\u308A\u305F\u305F\u3080","navigation.searchPlaceholder":"\u30E1\u30CB\u30E5\u30FC\u3092\u691C\u7D22...","navigation.noMatch":"\u4E00\u81F4\u3059\u308B\u30E1\u30CB\u30E5\u30FC\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noAccessibleApp":"\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30A2\u30D7\u30EA\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noItems":"\u8868\u793A\u3067\u304D\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093","navigation.expandView":"{title} \u3092\u5C55\u958B","navigation.mode.switchToFixed":"\u56FA\u5B9A\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.mode.switchToFloating":"\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.pinned":"\u30D4\u30F3\u7559\u3081","navigation.pin.add":"\u4E0A\u90E8\u306B\u30D4\u30F3\u7559\u3081","navigation.pin.remove":"\u30D4\u30F3\u7559\u3081\u3092\u89E3\u9664","table.toolbar.searchPlaceholder":"\u691C\u7D22...","table.title.default":"\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB","table.toolbar.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.toolbar.summary":"\u96C6\u8A08","table.toolbar.columns":"\u5217","table.toolbar.export":"\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","table.toolbar.itemsPerPage":"1\u30DA\u30FC\u30B8\u306E\u4EF6\u6570\uFF1A","table.toolbar.pageOf":"{current} / {total} \u30DA\u30FC\u30B8","table.toolbar.newItem":"\u65B0\u898F\u4F5C\u6210","table.toolbar.editItem":"\u7DE8\u96C6","table.toolbar.deleteItem":"\u524A\u9664","table.toolbar.graphicReport":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","table.toolbar.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","table.menu.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.menu.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.menu.visibleColumns":"\u8868\u793A\u5217","table.menu.showSummaryRow":"\u96C6\u8A08\u884C\u3092\u8868\u793A","table.menu.noNumericColumns":"\u6570\u5024\u5217\u304C\u3042\u308A\u307E\u305B\u3093","table.group.expandAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B","table.group.collapseAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080","table.mobile.notImplemented":"\u30E2\u30D0\u30A4\u30EB\u8868\u793A\u306F\u672A\u5B9F\u88C5\u3067\u3059","table.headerMenu.sortAsc":"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.sortDesc":"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.clearSort":"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664","table.headerMenu.configureSort":"\u4E26\u3079\u66FF\u3048\u3092\u8A2D\u5B9A...","table.headerMenu.group":"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316","table.headerMenu.ungroup":"\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u5916\u3059","table.headerMenu.addSummary":"\u96C6\u8A08\u306B\u8FFD\u52A0","table.headerMenu.removeSummary":"\u96C6\u8A08\u304B\u3089\u524A\u9664","table.headerMenu.hideColumn":"\u5217\u3092\u975E\u8868\u793A","table.sortDialog.title":"\u4E26\u3079\u66FF\u3048\u8A2D\u5B9A","table.sortDialog.empty":"\u4E26\u3079\u66FF\u3048\u30EB\u30FC\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","table.sortDialog.addRule":"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0","table.sortDialog.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.sortDialog.asc":"\u6607\u9806","table.sortDialog.desc":"\u964D\u9806","pivot.title.default":"\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB","pivot.subtitle.default":"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002","pivot.empty":"\u7D50\u679C\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5024\u30A8\u30EA\u30A2\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.records":"\u30EC\u30B3\u30FC\u30C9","pivot.afterFilter":"\u30D5\u30A3\u30EB\u30BF\u30FC\u5F8C","pivot.grandTotal":"\u7DCF\u8A08","pivot.resultLabel":"\u7D50\u679C","pivot.valueLabel":"\u5024","pivot.table.dimensions":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.config.title":"\u8A2D\u5B9A","pivot.fieldList":"\u30D5\u30A3\u30FC\u30EB\u30C9\u4E00\u89A7","pivot.availableDimensions":"\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.allFieldsInUse":"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u4F7F\u7528\u4E2D\u3067\u3059\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u30D5\u30A3\u30EB\u30BF\u30FC","pivot.zone.values":"\u5024","pivot.hint.rows":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u884C\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.columns":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u5217\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.filters":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30EC\u30DD\u30FC\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8A2D\u5B9A","pivot.hint.values":"\u3053\u3053\u306B\u6570\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u96C6\u8A08","pivot.clearArea":"\u30A8\u30EA\u30A2\u3092\u30AF\u30EA\u30A2","pivot.filter.na":"N/A","pivot.filter.noValues":"\u5024\u304C\u3042\u308A\u307E\u305B\u3093","pivot.filter.noneSelected":"\u672A\u9078\u629E","pivot.filter.allValues":"\u3059\u3079\u3066\u306E\u5024","pivot.filter.selectedCount":"{selected} / {total} \u3092\u9078\u629E","pivot.filter.selectAll":"\u3059\u3079\u3066\u9078\u629E","pivot.filter.deselectAll":"\u3059\u3079\u3066\u89E3\u9664","pivot.filter.noResults":"\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093","pivot.collapse.ariaExpand":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u5C55\u958B","pivot.collapse.ariaCollapse":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u6298\u308A\u305F\u305F\u3080","pivot.agg.sum":"\u5408\u8A08","pivot.agg.count":"\u4EF6\u6570","pivot.agg.avg":"\u5E73\u5747","pivot.agg.min":"\u6700\u5C0F","pivot.agg.max":"\u6700\u5927","pivot.preset.selectPlaceholder":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u9078\u629E","pivot.preset.save":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.delete":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u524A\u9664","pivot.preset.saveDialogTitle":"\u73FE\u5728\u306E\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.nameLabel":"\u30D7\u30EA\u30BB\u30C3\u30C8\u540D","pivot.preset.defaultName":"\u30D7\u30EA\u30BB\u30C3\u30C8 {index}","pivot.table.sectionTitle":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u5C55\u958B","pivot.table.collapse.ariaCollapse":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u6298\u308A\u305F\u305F\u3080","pivot.chart.title":"\u30D4\u30DC\u30C3\u30C8\u30C1\u30E3\u30FC\u30C8","pivot.chart.subtitle":"1\u3064\u306E\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u6700\u59272\u3064\u306E\u6307\u6A19\u3092\u30B3\u30F3\u30D1\u30AF\u30C8\u306A\u30C1\u30E3\u30FC\u30C8\u306B\u307E\u3068\u3081\u307E\u3059\u3002","pivot.chart.subtitleReady":"{dimension} \u3054\u3068\u306E {measure}","pivot.chart.emptyNoDimension":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u884C\u307E\u305F\u306F\u5217\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoValue":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoData":"\u73FE\u5728\u306E\u30C1\u30E3\u30FC\u30C8\u9078\u629E\u3067\u306F\u8868\u793A\u3067\u304D\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002","pivot.chart.dimension":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.chart.primaryMeasure":"\u6307\u6A19","pivot.chart.secondaryMeasure":"\u6BD4\u8F03\u6307\u6A19","pivot.chart.chartType":"\u30C1\u30E3\u30FC\u30C8\u7A2E\u5225","pivot.chart.style.barVertical":"\u7E26\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.barHorizontal":"\u6A2A\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.line":"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5","pivot.chart.style.scatter":"\u6563\u5E03\u56F3","pivot.chart.collapse.ariaExpand":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u5C55\u958B","pivot.chart.collapse.ariaCollapse":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u6298\u308A\u305F\u305F\u3080","smartFilter.adaptFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8ABF\u6574","smartFilter.addFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8FFD\u52A0","smartFilter.go":"\u5B9F\u884C","smartFilter.visibleFilters":"\u8868\u793A\u30D5\u30A3\u30EB\u30BF\u30FC","smartFilter.searchPlaceholder":"\u691C\u7D22...","smartFilter.noOptionsFound":"\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","smartFilter.min":"\u6700\u5C0F","smartFilter.max":"\u6700\u5927","smartFilter.minMaxPlaceholder":"\u6700\u5C0F - \u6700\u5927","smartFilter.operator.equals":"\u7B49\u3057\u3044","smartFilter.operator.contains":"\u542B\u3080","smartFilter.operator.notContains":"\u542B\u307E\u306A\u3044","smartFilter.operator.wildcard":"\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u691C\u7D22","smartFilter.operator.notEquals":"\u7B49\u3057\u304F\u306A\u3044","smartFilter.operator.greaterThan":"\u3088\u308A\u5927\u304D\u3044","smartFilter.operator.lessThan":"\u3088\u308A\u5C0F\u3055\u3044","smartFilter.operator.greaterOrEqual":"\u4EE5\u4E0A","smartFilter.operator.lessOrEqual":"\u4EE5\u4E0B","smartFilter.operator.between":"\u7BC4\u56F2","variant.noOptions":"\u30AA\u30D7\u30B7\u30E7\u30F3\u306A\u3057","variant.defaultSuffix":"\u30C7\u30D5\u30A9\u30EB\u30C8","variant.selectVariant":"\u30D3\u30E5\u30FC\u3092\u9078\u629E","variant.saveView":"\u30D3\u30E5\u30FC\u4FDD\u5B58","variant.newVariant":"\u65B0\u3057\u3044\u30D3\u30E5\u30FC","variant.viewName":"\u30D3\u30E5\u30FC\u540D","variant.setDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","variant.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\uFF09","variant.toast.fetchFailed":"\u30D3\u30E5\u30FC\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveFailed":"\u30D3\u30E5\u30FC\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveSuccess":"\u30D3\u30E5\u30FC\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","variant.toast.deleteFailed":"\u30D3\u30E5\u30FC\u306E\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.deleteSuccess":"\u30D3\u30E5\u30FC\u3092\u524A\u9664\u3057\u307E\u3057\u305F","variant.toast.defaultFailed":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F","layout.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","layout.layoutOptions":"\u30EC\u30A4\u30A2\u30A6\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3","layout.selectLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u9078\u629E","layout.saveCurrentLayout":"\u73FE\u5728\u306E\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58...","layout.noSavedLayouts":"\u4FDD\u5B58\u6E08\u307F\u30EC\u30A4\u30A2\u30A6\u30C8\u306A\u3057","layout.removeDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u89E3\u9664","layout.setAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","layout.layoutName":"\u30EC\u30A4\u30A2\u30A6\u30C8\u540D","layout.layoutDescription":"\u8AAC\u660E","layout.layoutNameHelper":"\u4F8B\uFF1A\u30B3\u30F3\u30D1\u30AF\u30C8\u8868\u793A","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u65E2\u5B58\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059","layout.useAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3068\u3057\u3066\u4F7F\u7528","layout.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\uFF09","layout.toast.loadFallback":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u304B\u3089\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u3001\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u306B\u5207\u308A\u66FF\u3048\u307E\u3057\u305F","layout.toast.saveSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.saveLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableSavedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.deleteSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.deleteLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDeletedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.defaultLocalSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDefaultLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","dateRange.label":"\u65E5\u4ED8\u7BC4\u56F2","dateRange.startDate":"\u958B\u59CB\u65E5","dateRange.endDate":"\u7D42\u4E86\u65E5","dateRange.select":"\u9078\u629E...","dateRange.today":"\u4ECA\u65E5","dateRange.thisWeek":"\u4ECA\u9031","dateRange.thisMonth":"\u4ECA\u6708","graph.records":"{count} \u4EF6","graph.kpi.totalRecords":"\u7DCF\u30EC\u30B3\u30FC\u30C9","graph.kpi.totalReport":"\u7DCF\u5831\u544A\u6642\u9593","graph.kpi.totalBillable":"\u7DCF\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.kpi.efficiency":"\u52B9\u7387","graph.kpi.amount":"\u91D1\u984D","graph.kpi.flagged":"\u8981\u78BA\u8A8D","graph.chart.billable.title":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u5225\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.chart.billable.subtitle":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593\u306E\u4E0A\u4F4D","graph.chart.efficiency.title":"\u62C5\u5F53\u8005\u5225\u52B9\u7387","graph.chart.efficiency.subtitle":"\u52B9\u7387\u306E\u4F4E\u3044\u9806","graph.chart.status.title":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5206\u5E03","graph.chart.status.subtitle":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5225\u6BD4\u7387","graph.dataBody":"\u30C7\u30FC\u30BF\u672C\u4F53","graph.reportTitle":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","graph.unassigned":"\u672A\u5272\u308A\u5F53\u3066","graph.column.reportHours":"\u5831\u544A\u6642\u9593","graph.column.billableHours":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","detail.searchAi.placeholder":"\u9805\u76EE\u3092\u691C\u7D22\u3002\u898B\u3064\u304B\u3089\u306A\u3044\u5834\u5408\u306FAI\u306B\u8CEA\u554F\u3057\u307E\u3059...","detail.searchAi.matches":"{count} \u4EF6\u306E\u4E00\u81F4","detail.searchAi.noMatch":"\u4E00\u81F4\u3059\u308B\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002","detail.searchAi.autoAiFallback":"\u4E00\u81F4\u306A\u3057\u3002AI\u5206\u6790\u3092\u5B9F\u884C\u3057\u307E\u3059...","detail.searchAi.aiResultTitle":"AI\u5206\u6790\u7D50\u679C","detail.table.title":"\u95A2\u9023\u30EC\u30B3\u30FC\u30C9","kanban.empty":"\u3053\u3053\u306B\u30AB\u30FC\u30C9\u3092\u30C9\u30ED\u30C3\u30D7","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u96E2\u3059\u3068\u3053\u306E bucket \u306B\u79FB\u52D5\u3057\u307E\u3059","kanban.bucket.add":"bucket \u3092\u8FFD\u52A0","kanban.bucket.rename":"bucket \u540D\u3092\u5909\u66F4","kanban.bucket.saveRename":"bucket \u540D\u3092\u4FDD\u5B58","kanban.bucket.cancelRename":"\u540D\u524D\u5909\u66F4\u3092\u30AD\u30E3\u30F3\u30BB\u30EB","kanban.search.placeholder":"\u30AB\u30FC\u30C9\u3068 bucket \u3092\u691C\u7D22","kanban.search.clear":"\u691C\u7D22\u3092\u30AF\u30EA\u30A2","kanban.search.results":"{count} \u4EF6\u306E\u30AB\u30FC\u30C9\u304C\u4E00\u81F4","kanban.search.noMatch":"\u4E00\u81F4\u3059\u308B\u30AB\u30FC\u30C9\u306F\u3042\u308A\u307E\u305B\u3093","kanban.card.progress":"\u9032\u6357","kanban.card.openDetail":"\u8A73\u7D30\u3092\u958B\u304F","kanban.priority.critical":"\u7DCA\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u898F\u4F5C\u6210","quickCreate.createWithTitle":"{title} \u3092\u4F5C\u6210","quickEdit.editWithTitle":"{title} \u3092\u7DE8\u96C6","quickDelete.confirmTitle":"\u524A\u9664\u306E\u78BA\u8A8D","quickDelete.confirmMessageSingle":"\u9078\u629E\u3057\u305F\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","quickDelete.confirmMessageMultiple":"\u9078\u629E\u3057\u305F {count} \u4EF6\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","cardPage.viewDetails":"\u8A73\u7D30\u3092\u8868\u793A","cardPage.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","cardPage.close":"\u9589\u3058\u308B","cardPage.empty":"\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","messageBox.confirm":"OK","messageBox.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB"},bb={"common.cancel":"\uCDE8\uC18C","common.save":"\uC800\uC7A5","common.ok":"\uD655\uC778","common.done":"\uC644\uB8CC","common.search":"\uAC80\uC0C9","common.none":"\uC5C6\uC74C","common.all":"\uC804\uCCB4","common.noData":"\uB370\uC774\uD130 \uC5C6\uC74C","common.copy":"\uBCF5\uC0AC","common.delete":"\uC0AD\uC81C","common.loading":"\uB85C\uB529 \uC911...","header.searchPlaceholder":"\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...","header.searchAddFeature":"\uAE30\uB2A5 \uCD94\uAC00","header.searchStartVoice":"\uC74C\uC131 \uC785\uB825 \uC2DC\uC791","header.searchStopVoice":"\uC74C\uC131 \uC785\uB825 \uC911\uC9C0","header.searchOpenPanel":"\uB300\uD654 \uC5F4\uAE30","header.theme.system":"\uD14C\uB9C8: \uC2DC\uC2A4\uD15C","header.theme.dark":"\uD14C\uB9C8: \uB2E4\uD06C","header.theme.light":"\uD14C\uB9C8: \uB77C\uC774\uD2B8","header.menu.setting":"\uC124\uC815","header.menu.refresh":"\uC0C8\uB85C \uACE0\uCE68","header.menu.logout":"\uB85C\uADF8\uC544\uC6C3","navigation.expand":"\uD0D0\uC0C9 \uD3BC\uCE58\uAE30","navigation.collapse":"\uD0D0\uC0C9 \uC811\uAE30","navigation.searchPlaceholder":"\uBA54\uB274 \uAC80\uC0C9...","navigation.noMatch":"\uC77C\uCE58\uD558\uB294 \uBA54\uB274\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noAccessibleApp":"\uC811\uADFC \uAC00\uB2A5\uD55C \uC571\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noItems":"\uD45C\uC2DC\uD560 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.expandView":"{title} \uD3BC\uCE58\uAE30","navigation.mode.switchToFixed":"\uACE0\uC815 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.mode.switchToFloating":"\uD50C\uB85C\uD305 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.pinned":"\uACE0\uC815\uB428","navigation.pin.add":"\uC0C1\uB2E8\uC5D0 \uACE0\uC815","navigation.pin.remove":"\uACE0\uC815 \uD574\uC81C","table.toolbar.searchPlaceholder":"\uAC80\uC0C9...","table.title.default":"\uB370\uC774\uD130 \uD14C\uC774\uBE14","table.toolbar.groupBy":"\uADF8\uB8F9","table.toolbar.summary":"\uC694\uC57D","table.toolbar.columns":"\uC5F4","table.toolbar.export":"\uB0B4\uBCF4\uB0B4\uAE30","table.toolbar.itemsPerPage":"\uD398\uC774\uC9C0\uB2F9 \uD589 \uC218:","table.toolbar.pageOf":"{current} / {total} \uD398\uC774\uC9C0","table.toolbar.newItem":"\uC2E0\uADDC \uD56D\uBAA9","table.toolbar.editItem":"\uD56D\uBAA9 \uC218\uC815","table.toolbar.deleteItem":"\uD56D\uBAA9 \uC0AD\uC81C","table.toolbar.graphicReport":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","table.toolbar.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","table.menu.groupBy":"\uADF8\uB8F9","table.menu.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.menu.visibleColumns":"\uD45C\uC2DC \uC5F4","table.menu.showSummaryRow":"\uC694\uC57D \uD589 \uD45C\uC2DC","table.menu.noNumericColumns":"\uC22B\uC790 \uC5F4 \uC5C6\uC74C","table.group.expandAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uD3BC\uCE58\uAE30","table.group.collapseAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uC811\uAE30","table.mobile.notImplemented":"\uBAA8\uBC14\uC77C \uBDF0\uB294 \uC544\uC9C1 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4","table.headerMenu.sortAsc":"\uC624\uB984\uCC28\uC21C \uC815\uB82C","table.headerMenu.sortDesc":"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C","table.headerMenu.clearSort":"\uC815\uB82C \uD574\uC81C","table.headerMenu.configureSort":"\uC815\uB82C \uC124\uC815...","table.headerMenu.group":"\uC774 \uC5F4\uB85C \uADF8\uB8F9\uD654","table.headerMenu.ungroup":"\uADF8\uB8F9\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.addSummary":"\uC694\uC57D\uC5D0 \uCD94\uAC00","table.headerMenu.removeSummary":"\uC694\uC57D\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.hideColumn":"\uC5F4 \uC228\uAE30\uAE30","table.sortDialog.title":"\uC815\uB82C \uC124\uC815","table.sortDialog.empty":"\uC815\uB82C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uCD94\uAC00\uD558\uC138\uC694.","table.sortDialog.addRule":"\uADDC\uCE59 \uCD94\uAC00","table.sortDialog.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.sortDialog.asc":"\uC624\uB984\uCC28\uC21C","table.sortDialog.desc":"\uB0B4\uB9BC\uCC28\uC21C","pivot.title.default":"\uD53C\uBC97 \uD14C\uC774\uBE14","pivot.subtitle.default":"\uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD53C\uBC97 \uD14C\uC774\uBE14\uC744 \uAD6C\uC131\uD558\uC138\uC694.","pivot.empty":"\uACB0\uACFC\uB97C \uBCF4\uB824\uBA74 \uAC12 \uC601\uC5ED\uC5D0 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.records":"\uB808\uCF54\uB4DC","pivot.afterFilter":"\uD544\uD130 \uD6C4","pivot.grandTotal":"\uCD1D\uD569","pivot.resultLabel":"\uACB0\uACFC","pivot.valueLabel":"\uAC12","pivot.table.dimensions":"\uCC28\uC6D0","pivot.config.title":"\uAD6C\uC131","pivot.fieldList":"\uD544\uB4DC \uBAA9\uB85D","pivot.availableDimensions":"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCC28\uC6D0","pivot.allFieldsInUse":"\uBAA8\uB4E0 \uD544\uB4DC\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC785\uB2C8\uB2E4.","pivot.zone.rows":"\uD589","pivot.zone.columns":"\uC5F4","pivot.zone.filters":"\uD544\uD130","pivot.zone.values":"\uAC12","pivot.hint.rows":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD589 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.columns":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uC5F4 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.filters":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uBCF4\uACE0\uC11C \uD544\uD130\uB85C \uC0AC\uC6A9","pivot.hint.values":"\uC22B\uC790 \uD544\uB4DC\uB97C \uC5EC\uAE30\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC9D1\uACC4","pivot.clearArea":"\uC601\uC5ED \uBE44\uC6B0\uAE30","pivot.filter.na":"\uD574\uB2F9 \uC5C6\uC74C","pivot.filter.noValues":"\uAC12 \uC5C6\uC74C","pivot.filter.noneSelected":"\uC120\uD0DD \uC5C6\uC74C","pivot.filter.allValues":"\uBAA8\uB4E0 \uAC12","pivot.filter.selectedCount":"{selected} / {total} \uC120\uD0DD\uB428","pivot.filter.selectAll":"\uC804\uCCB4 \uC120\uD0DD","pivot.filter.deselectAll":"\uC804\uCCB4 \uD574\uC81C","pivot.filter.noResults":"\uAC80\uC0C9 \uACB0\uACFC \uC5C6\uC74C","pivot.collapse.ariaExpand":"\uAD6C\uC131 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.collapse.ariaCollapse":"\uAD6C\uC131 \uC601\uC5ED \uC811\uAE30","pivot.agg.sum":"\uD569\uACC4","pivot.agg.count":"\uAC1C\uC218","pivot.agg.avg":"\uD3C9\uADE0","pivot.agg.min":"\uCD5C\uC18C","pivot.agg.max":"\uCD5C\uB300","pivot.preset.selectPlaceholder":"\uD504\uB9AC\uC14B \uC120\uD0DD","pivot.preset.save":"\uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.delete":"\uD504\uB9AC\uC14B \uC0AD\uC81C","pivot.preset.saveDialogTitle":"\uD604\uC7AC \uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.nameLabel":"\uD504\uB9AC\uC14B \uC774\uB984","pivot.preset.defaultName":"\uD504\uB9AC\uC14B {index}","pivot.table.sectionTitle":"\uD53C\uBC97 \uACB0\uACFC","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\uD53C\uBC97 \uACB0\uACFC \uD3BC\uCE58\uAE30","pivot.table.collapse.ariaCollapse":"\uD53C\uBC97 \uACB0\uACFC \uC811\uAE30","pivot.chart.title":"\uD53C\uBC97 \uCC28\uD2B8","pivot.chart.subtitle":"\uD558\uB098\uC758 \uCC28\uC6D0\uACFC \uCD5C\uB300 \uB450 \uAC1C\uC758 \uCE21\uC815\uAC12\uC744 \uAC04\uACB0\uD55C \uCC28\uD2B8\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4.","pivot.chart.subtitleReady":"{dimension}\uBCC4 {measure}","pivot.chart.emptyNoDimension":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD589 \uB610\uB294 \uC5F4 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoValue":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uAC12 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoData":"\uD604\uC7AC \uCC28\uD2B8 \uC120\uD0DD\uC5D0 \uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.","pivot.chart.dimension":"\uCC28\uD2B8 \uCC28\uC6D0","pivot.chart.primaryMeasure":"\uC8FC \uCE21\uC815\uAC12","pivot.chart.secondaryMeasure":"\uBE44\uAD50 \uCE21\uC815\uAC12","pivot.chart.chartType":"\uCC28\uD2B8 \uC720\uD615","pivot.chart.style.barVertical":"\uC138\uB85C \uB9C9\uB300","pivot.chart.style.barHorizontal":"\uAC00\uB85C \uB9C9\uB300","pivot.chart.style.line":"\uC120\uD615 \uCC28\uD2B8","pivot.chart.style.scatter":"\uC0B0\uC810\uB3C4","pivot.chart.collapse.ariaExpand":"\uCC28\uD2B8 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.chart.collapse.ariaCollapse":"\uCC28\uD2B8 \uC601\uC5ED \uC811\uAE30","smartFilter.adaptFilters":"\uD544\uD130 \uC870\uC815","smartFilter.addFilters":"\uD544\uD130 \uCD94\uAC00","smartFilter.go":"\uC2E4\uD589","smartFilter.visibleFilters":"\uD45C\uC2DC \uD544\uD130","smartFilter.searchPlaceholder":"\uAC80\uC0C9...","smartFilter.noOptionsFound":"\uC635\uC158\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","smartFilter.min":"\uCD5C\uC18C","smartFilter.max":"\uCD5C\uB300","smartFilter.minMaxPlaceholder":"\uCD5C\uC18C - \uCD5C\uB300","smartFilter.operator.equals":"\uAC19\uC74C","smartFilter.operator.contains":"\uD3EC\uD568","smartFilter.operator.notContains":"\uBBF8\uD3EC\uD568","smartFilter.operator.wildcard":"\uC640\uC77C\uB4DC\uCE74\uB4DC \uAC80\uC0C9","smartFilter.operator.notEquals":"\uAC19\uC9C0 \uC54A\uC74C","smartFilter.operator.greaterThan":"\uBCF4\uB2E4 \uD07C","smartFilter.operator.lessThan":"\uBCF4\uB2E4 \uC791\uC74C","smartFilter.operator.greaterOrEqual":"\uC774\uC0C1","smartFilter.operator.lessOrEqual":"\uC774\uD558","smartFilter.operator.between":"\uBC94\uC704","variant.noOptions":"\uC635\uC158 \uC5C6\uC74C","variant.defaultSuffix":"\uAE30\uBCF8","variant.selectVariant":"\uBDF0 \uC120\uD0DD","variant.saveView":"\uBDF0 \uC800\uC7A5","variant.newVariant":"\uC0C8 \uBDF0","variant.viewName":"\uBDF0 \uC774\uB984","variant.setDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","variant.publicAllUsers":"\uACF5\uAC1C(\uC804\uCCB4 \uC0AC\uC6A9\uC790)","variant.toast.fetchFailed":"\uBDF0\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveFailed":"\uBDF0\uB97C \uC800\uC7A5\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveSuccess":"\uBDF0\uAC00 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.deleteFailed":"\uBDF0\uB97C \uC0AD\uC81C\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.deleteSuccess":"\uBDF0\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.defaultFailed":"\uAE30\uBCF8 \uBDF0\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.defaultSuccess":"\uAE30\uBCF8 \uBDF0\uAC00 \uC5C5\uB370\uC774\uD2B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","layout.layoutOptions":"\uB808\uC774\uC544\uC6C3 \uC635\uC158","layout.selectLayout":"\uB808\uC774\uC544\uC6C3 \uC120\uD0DD","layout.saveCurrentLayout":"\uD604\uC7AC \uB808\uC774\uC544\uC6C3 \uC800\uC7A5...","layout.noSavedLayouts":"\uC800\uC7A5\uB41C \uB808\uC774\uC544\uC6C3 \uC5C6\uC74C","layout.removeDefault":"\uAE30\uBCF8 \uD574\uC81C","layout.setAsDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","layout.layoutName":"\uB808\uC774\uC544\uC6C3 \uC774\uB984","layout.layoutDescription":"\uC124\uBA85","layout.layoutNameHelper":"\uC608: \uCEF4\uD329\uD2B8 \uBDF0","layout.warningOverwrite":"\uACBD\uACE0: \uAE30\uC874 \uB808\uC774\uC544\uC6C3\uC774 \uB36E\uC5B4\uC4F0\uAE30 \uB429\uB2C8\uB2E4","layout.useAsDefault":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC73C\uB85C \uC0AC\uC6A9","layout.publicAllUsers":"\uACF5\uAC1C(\uBAA8\uB4E0 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uD45C\uC2DC)","layout.toast.loadFallback":"\uBC31\uC5D4\uB4DC\uC5D0\uC11C \uB808\uC774\uC544\uC6C3\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD574 \uB85C\uCEEC \uC800\uC7A5\uC18C\uB85C \uC804\uD658\uD588\uC2B5\uB2C8\uB2E4","layout.toast.saveSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.saveLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableSavedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","layout.toast.deleteSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.deleteLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0\uC11C \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDeletedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0\uC11C \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4","layout.toast.defaultSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.defaultLocalSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC\uC5D0 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDefaultLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uAE30\uBCF8\uAC12\uC744 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","dateRange.label":"\uB0A0\uC9DC \uBC94\uC704","dateRange.startDate":"\uC2DC\uC791\uC77C","dateRange.endDate":"\uC885\uB8CC\uC77C","dateRange.select":"\uC120\uD0DD...","dateRange.today":"\uC624\uB298","dateRange.thisWeek":"\uC774\uBC88 \uC8FC","dateRange.thisMonth":"\uC774\uBC88 \uB2EC","graph.records":"{count}\uAC74","graph.kpi.totalRecords":"\uCD1D \uB808\uCF54\uB4DC","graph.kpi.totalReport":"\uCD1D \uBCF4\uACE0 \uC2DC\uAC04","graph.kpi.totalBillable":"\uCD1D \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.kpi.efficiency":"\uD6A8\uC728","graph.kpi.amount":"\uAE08\uC561","graph.kpi.flagged":"\uD50C\uB798\uADF8","graph.chart.billable.title":"\uCC28\uC6D0\uBCC4 \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.chart.billable.subtitle":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04 \uC0C1\uC704 \uAC12","graph.chart.efficiency.title":"\uB2F4\uB2F9\uC790\uBCC4 \uD6A8\uC728","graph.chart.efficiency.subtitle":"\uB0AE\uC740 \uD6A8\uC728 \uC6B0\uC120","graph.chart.status.title":"\uC0C1\uD0DC \uBD84\uD3EC","graph.chart.status.subtitle":"\uC0C1\uD0DC\uBCC4 \uBE44\uC728","graph.dataBody":"\uB370\uC774\uD130 \uBCF8\uBB38","graph.reportTitle":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","graph.unassigned":"\uBBF8\uC9C0\uC815","graph.column.reportHours":"\uBCF4\uACE0 \uC2DC\uAC04","graph.column.billableHours":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","detail.searchAi.placeholder":"\uD544\uB4DC\uB97C \uAC80\uC0C9\uD558\uACE0, \uACB0\uACFC\uAC00 \uC5C6\uC73C\uBA74 AI\uC5D0 \uC9C8\uBB38\uD558\uC138\uC694...","detail.searchAi.matches":"{count}\uAC1C \uC77C\uCE58 \uD56D\uBAA9","detail.searchAi.noMatch":"\uC77C\uCE58\uD558\uB294 \uD544\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","detail.searchAi.autoAiFallback":"\uC77C\uCE58 \uD56D\uBAA9\uC774 \uC5C6\uC5B4 AI \uBD84\uC11D\uC744 \uC2E4\uD589\uD569\uB2C8\uB2E4...","detail.searchAi.aiResultTitle":"AI \uBD84\uC11D \uACB0\uACFC","detail.table.title":"\uAD00\uB828 \uB808\uCF54\uB4DC","kanban.empty":"\uC5EC\uAE30\uC5D0 \uCE74\uB4DC\uB97C \uB193\uC73C\uC138\uC694","kanban.bucket.limit":"\uD55C\uB3C4","kanban.bucket.dropHere":"\uB193\uC73C\uBA74 \uC774 \uBC84\uD0B7\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4","kanban.bucket.add":"\uBC84\uD0B7 \uCD94\uAC00","kanban.bucket.rename":"\uBC84\uD0B7 \uC774\uB984 \uBCC0\uACBD","kanban.bucket.saveRename":"\uBC84\uD0B7 \uC774\uB984 \uC800\uC7A5","kanban.bucket.cancelRename":"\uC774\uB984 \uBCC0\uACBD \uCDE8\uC18C","kanban.search.placeholder":"\uCE74\uB4DC \uBC0F \uBC84\uD0B7 \uAC80\uC0C9","kanban.search.clear":"\uAC80\uC0C9 \uC9C0\uC6B0\uAE30","kanban.search.results":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC {count}\uAC1C","kanban.search.noMatch":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","kanban.card.progress":"\uC9C4\uD589\uB960","kanban.card.openDetail":"\uC0C1\uC138 \uC5F4\uAE30","kanban.priority.critical":"\uAE34\uAE09","kanban.priority.high":"\uB192\uC74C","kanban.priority.medium":"\uBCF4\uD1B5","kanban.priority.low":"\uB0AE\uC74C","quickCreate.newItem":"\uC2E0\uADDC \uD56D\uBAA9","quickCreate.createWithTitle":"{title} \uC0DD\uC131","quickEdit.editWithTitle":"{title} \uC218\uC815","quickDelete.confirmTitle":"\uC0AD\uC81C \uD655\uC778","quickDelete.confirmMessageSingle":"\uC120\uD0DD\uD55C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","quickDelete.confirmMessageMultiple":"\uC120\uD0DD\uD55C {count}\uAC1C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","cardPage.viewDetails":"\uC0C1\uC138 \uBCF4\uAE30","cardPage.download":"\uB2E4\uC6B4\uB85C\uB4DC","cardPage.close":"\uB2EB\uAE30","cardPage.empty":"\uD56D\uBAA9\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","messageBox.confirm":"\uD655\uC778","messageBox.cancel":"\uCDE8\uC18C"},qn={en:pb,zh:ub,fr:mb,de:gb,ja:fb,ko:bb};P();var id=(t,r)=>r?t.replace(/\{(\w+)\}/g,(o,n)=>{let a=r[n];return a==null?"":String(a)}):t,Cb={locale:"en",t:(t,r)=>id(qn.en[t]||t,r)},sd=er.createContext(Cb),Ga=({locale:t="en",messages:r,children:o})=>{let n=er.useMemo(()=>{let a=qn[t]||qn.en,i=r?.[t]||{},s={...qn.en,...a,...i};return {locale:t,t:(l,d)=>id(s[l]||l,d)}},[t,r]);return e(sd.Provider,{value:n,children:o})},pe=()=>er.useContext(sd);P();function Xn({items:t,onItemClick:r,className:o="",level:n=0,expandedIds:a,onToggleExpand:i,colorMode:s="light",enablePinning:l=false,pinnedIds:d,onTogglePin:u}){let{t:p}=pe(),f=s==="dark",b=navigation.usePathname(),[m,v]=er.useState(false),[y,g]=er.useState(new Set),x=a!==void 0&&i!==void 0,h=x?a:y;er.useEffect(()=>{v(true);},[]);let C=w=>{if(x)i(w);else {let T=new Set(y);T.has(w)?T.delete(w):T.add(w),g(T);}},k=w=>{w.children&&w.children.length>0&&C(w.id),r&&r(w);};return !t||!Array.isArray(t)?e("div",{className:br("tree-menu",o),children:e("div",{className:"text-sm text-[var(--orb-muted)] p-2",children:p("navigation.noItems")})}):e("div",{className:br("tree-menu",o),children:t.map(w=>{let T=h.has(w.id)||w.isExpanded,I=w.children&&w.children.length>0,A=56+Math.max(0,n-1)*8,R=n===0?12:I?A-24:A,M=w.appurl||w.href,N=m&&M?b===M:false,E=d?.has(w.id)??false,O=l&&w.pinnable!==false&&!!M&&!I;return c("div",{className:"tree-menu-item relative",children:[N&&e("div",{className:br("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10","bg-[var(--orb-nav-active-fg)]")}),c(Us,{variant:"ghost",className:br("w-full justify-start h-auto py-2 relative overflow-hidden group",n>0?"gap-1":"gap-2",I&&T&&!N?f?"bg-[color-mix(in_oklch,var(--orb-inverse-fg)_5%,transparent)] text-[var(--orb-fg)] hover:bg-[color-mix(in_oklch,var(--orb-inverse-fg)_8%,transparent)]":"bg-[color-mix(in_oklch,var(--orb-surface)_70%,transparent)] text-[var(--orb-fg)] hover:bg-[var(--orb-surface)]":"",n>=2?"min-h-9 py-1.5 rounded-md":n>0?"min-h-10 rounded-lg":"rounded-lg",N?f?"bg-transparent text-[var(--orb-nav-active-fg)] hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_35%,transparent)]":"bg-transparent text-[var(--orb-nav-active-fg)] hover:bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]":f?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)] text-[var(--orb-fg)]":"hover:bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)] text-[var(--orb-fg)]"),style:{paddingLeft:`${R}px`,paddingRight:O?"34px":"10px"},onClick:()=>k(w),children:[I&&e("div",{className:br("flex-shrink-0 transition-transform duration-200",T&&"rotate-90",N?"text-[var(--orb-nav-active-fg)]":f?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:e(Br,{className:"h-4 w-4"})}),w.icon&&e("div",{className:br("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",N?"text-[var(--orb-nav-active-fg)]":f?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:w.icon}),c("div",{className:"flex-1 text-left overflow-hidden z-10",children:[e("div",{className:br("text-sm truncate transition-colors duration-200",N?"font-semibold":"font-medium"),children:w.title||w.label}),w.description&&e("div",{className:br("text-xs truncate transition-colors duration-200",N?f?"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_70%,transparent)]":"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_75%,transparent)]":"text-[var(--orb-muted)]"),title:w.description,children:w.description})]})]}),O&&u&&e("button",{type:"button","aria-label":p(E?"navigation.pin.remove":"navigation.pin.add"),"aria-pressed":E,title:p(E?"navigation.pin.remove":"navigation.pin.add"),onClick:F=>{F.preventDefault(),F.stopPropagation(),u(w);},className:br("orb-navigation-pin-button absolute right-1 top-1/2 z-20 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md transition-colors duration-150",E&&"orb-is-pinned"),children:e(Jo,{className:br("h-3.5 w-3.5",E&&"fill-current")})}),I&&e("div",{className:br("grid transition-[grid-template-rows] duration-300 ease-in-out",T?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:e("div",{className:br("overflow-hidden",T&&"pt-1"),children:e(Xn,{items:w.children,onItemClick:r,level:n+1,expandedIds:a,onToggleExpand:i,colorMode:s,enablePinning:l,pinnedIds:d,onTogglePin:u})})})]},w.id)})})}P();var kb="orbcafe:navigation-island:pinned-items",Ks="orbcafe-navigation-pinned",Pb=t=>t.appurl||t.href,cd=t=>{let r=[];return t.forEach(o=>{let n=!!o.children?.length;o.pinnable!==false&&Pb(o)&&!n&&r.push({...o,children:void 0}),o.children?.length&&r.push(...cd(o.children));}),r},dd=({collapsed:t,onToggle:r,className:o="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:u=true,pinStorageKey:p=kb,pinnedItemIds:f,defaultPinnedItemIds:b=[],onPinnedItemIdsChange:m,pinnedSectionTitle:v})=>{let{t:y}=pe(),g=i==="dark",x=s==="floating",h=navigation.useRouter(),[C,k]=er.useState(""),[w,T]=er.useState(new Set),[I,S]=er.useState(b),[A,R]=er.useState(false),M=f!==void 0,N=er.useMemo(()=>f??I,[f,I]),E=er.useMemo(()=>new Set(N),[N]);er.useEffect(()=>{t&&T(new Set);},[t]),er.useEffect(()=>{if(!u||M){R(true);return}try{let z=window.localStorage.getItem(p);if(z){let K=JSON.parse(z);Array.isArray(K)&&S(K.filter(q=>typeof q=="string"));}}catch{}finally{R(true);}},[u,M,p]),er.useEffect(()=>{if(!(!u||M||!A))try{window.localStorage.setItem(p,JSON.stringify(N));}catch{}},[N,u,M,p,A]),er.useEffect(()=>{!u||t||N.length===0||T(z=>{if(z.has(Ks))return z;let K=new Set(z);return K.add(Ks),K});},[t,N.length,u]);let O=er.useCallback(z=>{let K=Array.from(new Set(z));M||S(K),m?.(K);},[M,m]),F=er.useCallback(z=>{let K=z.id,q=E.has(K)?N.filter(fe=>fe!==K):[...N,K];O(q);},[N,E,O]),_=er.useMemo(()=>{if(!u||N.length===0)return a;let z=new Map(cd(a).map(q=>[q.id,q])),K=N.map(q=>z.get(q)).filter(q=>!!q);return K.length===0?a:[{id:Ks,title:v||y("navigation.pinned"),icon:e(Jo,{className:"w-4 h-4"}),children:K,pinnable:false},...a]},[N,u,a,v,y]),B=er.useCallback(z=>{let K=[],q=fe=>{fe.forEach(se=>{K.push(se.id),se.children&&q(se.children);});};return q(z),K},[]),Y=er.useMemo(()=>{if(!C.trim())return _;let z=K=>K.reduce((q,fe)=>{let se=fe.title?.toLowerCase().includes(C.toLowerCase())||fe.description?.toLowerCase().includes(C.toLowerCase()),ue=fe.children?z(fe.children):[];return (se||ue.length>0)&&q.push({...fe,children:ue.length>0?ue:fe.children}),q},[]);return z(_)},[C,_]),W=er.useMemo(()=>C.trim()?new Set(B(_)):w,[C,_,w,B]),j=er.useCallback(async z=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",z),z.id==="chat"||z.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{h.push("/chat?new=true");}catch(q){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",q),h.push("/chat");}return}let K=z.appurl||z.href;K&&(K.startsWith("http://")||K.startsWith("https://")?window.open(K,"_blank"):h.push(K));},[h]),V=er.useCallback(()=>{l?.(s==="fixed"?"floating":"fixed");},[s,l]);return c("div",{className:`flex flex-col backdrop-blur-xl border ${x?"shadow-[0_28px_80px_rgba(15,23,42,0.34)]":"shadow-[0_4px_8px_0_rgba(31,38,135,0.1)]"} ${t?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${o} ${g?x?"border-white/25":"bg-[var(--orb-nav-bg)] border-white/10":x?"border-white/70":"bg-[color-mix(in_oklch,var(--orb-canvas)_70%,transparent)] border-white/30"}`,style:{backdropFilter:x?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",WebkitBackdropFilter:x?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",backgroundColor:x?g?"rgba(8, 12, 18, 0.34)":"rgba(255, 255, 255, 0.24)":void 0,backgroundImage:x?g?"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.14), rgba(255,255,255,0) 44%), linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.015) 50%, color-mix(in oklch, var(--orb-ai-accent) 5%, transparent))":"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.42), rgba(255,255,255,0) 46%), linear-gradient(145deg, rgba(255,255,255,0.22), rgba(255,255,255,0.07) 50%, color-mix(in oklch, var(--orb-ai-accent) 8%, transparent))":void 0,boxShadow:x?g?"inset 0 1px 0 rgba(255,255,255,0.20), inset 0 -1px 0 rgba(255,255,255,0.08), 0 26px 90px rgba(0,0,0,0.52), 0 0 0 1px rgba(255,255,255,0.06)":"inset 0 1px 0 rgba(255,255,255,0.88), inset 0 -1px 0 rgba(255,255,255,0.34), 0 26px 90px rgba(15,23,42,0.24), 0 0 0 1px rgba(255,255,255,0.35)":void 0,transition:"width 400ms cubic-bezier(0.4, 0.0, 0.2, 1), border-radius 0ms cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 400ms ease-out, background-color 220ms ease-out, backdrop-filter 220ms ease-out",maxHeight:n?`${n}px`:void 0},children:[e("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${t?"px-1":"px-2"}`,children:t?e("div",{className:"flex justify-center",children:e("button",{onClick:r,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${g?"text-[var(--orb-fg)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:y("navigation.expand"),children:e(Hr,{className:"h-5 w-5"})})}):c("div",{className:`relative transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:[e("input",{type:"text",placeholder:y("navigation.searchPlaceholder"),value:C,onChange:z=>k(z.target.value),className:`w-full pl-10 pr-4 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:border-transparent ${g?"border-[var(--orb-border)] bg-[var(--orb-surface-2)] text-[var(--orb-fg)] placeholder-[var(--orb-muted)]":"border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-fg)] placeholder-[var(--orb-muted)]"}`}),e("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:e(Hr,{className:"h-4 w-4 text-[var(--orb-muted)]"})})]})}),e("nav",{className:`flex-1 pb-4 transition-all duration-500 ease-in-out overflow-y-auto min-h-0 ${t?"px-1":"px-2"}`,children:Y.length===0?e("div",{className:"flex items-center justify-center py-8 text-[var(--orb-muted)] text-sm",children:t?e(Hn,{className:"h-5 w-5"}):y(C?"navigation.noMatch":"navigation.noAccessibleApp")}):c(jsxRuntime.Fragment,{children:[!t&&e("div",{className:`transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:e(Xn,{items:Y,onItemClick:j,className:"space-y-1",expandedIds:W,colorMode:i,enablePinning:u,pinnedIds:E,onTogglePin:F,onToggleExpand:z=>{let K=new Set(w);Y.some(fe=>fe.id===z)?K.has(z)?K.delete(z):(Y.forEach(fe=>{fe.id!==z&&K.has(fe.id)&&K.delete(fe.id);}),K.add(z)):K.has(z)?K.delete(z):K.add(z),T(K);}})}),t&&e("div",{className:"space-y-2",children:_.map(z=>e("div",{className:"space-y-1",children:e("button",{onClick:()=>{r();let K=new Set([z.id]);T(K);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${g?"text-[var(--orb-muted)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:y("navigation.expandView",{title:z.title||""}),children:z.icon||e("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${g?"bg-[var(--orb-nav-active-fg)] text-[#0b0b0b]":"bg-[var(--orb-primary)] text-[var(--orb-on-primary)]"}`,children:z.title?.charAt(0)||"?"})})},z.id))})]})}),!t&&e("button",{onClick:r,className:`absolute -bottom-1 -right-1 w-6 h-6 bg-transparent rounded-full flex items-center justify-center transition-all duration-300 ease-in-out z-20 ${g?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)]":"hover:bg-[color-mix(in_oklch,var(--orb-canvas)_20%,transparent)]"}`,title:y("navigation.collapse"),children:e("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:e("div",{className:g?"border-[var(--orb-status-warning)]":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid var(--orb-ai-accent)",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})}),d&&t&&e("button",{type:"button",onClick:V,className:`absolute -bottom-4 left-1/2 z-30 flex h-9 w-9 -translate-x-1/2 items-center justify-center rounded-full border shadow-md transition-colors focus:outline-none focus:ring-2 focus:ring-[color-mix(in_oklch,var(--orb-primary)_45%,transparent)] ${g?"border-[var(--orb-border)] bg-[var(--orb-surface-2)] text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]":"border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-status-fg)] hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]"}`,style:{touchAction:"manipulation"},title:y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?e(Oa,{className:"h-4 w-4"}):e(Fa,{className:"h-4 w-4"})})]})};P();var Ib="orbcafe:navigation-island:pinned-items",qs="orbcafe-navigation-pinned",pd=t=>t.appurl||t.href,ud=t=>t.flatMap(r=>{let o=!!r.children?.length,n=r.pinnable!==false&&pd(r)&&!o?[{...r,children:void 0}]:[];return r.children?.length?[...n,...ud(r.children)]:n}),md=t=>t.flatMap(r=>[r.id,...r.children?md(r.children):[]]),gd=(t,r)=>t.reduce((o,n)=>{let a=n.children?gd(n.children,r):[];return ([n.title,n.label,n.description].some(s=>s?.toLocaleLowerCase().includes(r))||a.length>0)&&o.push({...n,children:a.length>0?a:n.children}),o},[]),Xs=({collapsed:t,onToggle:r,className:o="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:u=true,pinStorageKey:p=Ib,pinnedItemIds:f,defaultPinnedItemIds:b=[],onPinnedItemIdsChange:m,pinnedSectionTitle:v})=>{let{t:y}=pe(),g=navigation.useRouter(),x=s==="floating",[h,C]=er.useState(""),[k,w]=er.useState(new Set),[T,I]=er.useState(b),[S,A]=er.useState(false),R=f!==void 0,M=f??T,N=er.useMemo(()=>new Set(M),[M]);er.useEffect(()=>{t&&w(new Set);},[t]),er.useEffect(()=>{if(!u||R){A(true);return}try{let z=window.localStorage.getItem(p);if(z){let K=JSON.parse(z);Array.isArray(K)&&I(K.filter(q=>typeof q=="string"));}}catch{}finally{A(true);}},[u,R,p]),er.useEffect(()=>{if(!(!u||R||!S))try{window.localStorage.setItem(p,JSON.stringify(M));}catch{}},[M,u,R,p,S]),er.useEffect(()=>{!u||t||M.length===0||w(z=>{if(z.has(qs))return z;let K=new Set(z);return K.add(qs),K});},[t,M.length,u]);let E=er.useCallback(z=>{let K=Array.from(new Set(z));R||I(K),m?.(K);},[R,m]),O=er.useCallback(z=>{E(N.has(z.id)?M.filter(K=>K!==z.id):[...M,z.id]);},[M,N,E]),F=er.useMemo(()=>{if(!u||M.length===0)return a;let z=new Map(ud(a).map(q=>[q.id,q])),K=M.map(q=>z.get(q)).filter(q=>!!q);return K.length===0?a:[{id:qs,title:v||y("navigation.pinned"),icon:e(Jo,{className:"h-4 w-4"}),children:K,pinnable:false},...a]},[M,u,a,v,y]),_=h.trim().toLocaleLowerCase(),B=er.useMemo(()=>_?gd(F,_):F,[F,_]),Y=er.useMemo(()=>_?new Set(md(B)):k,[k,B,_]),W=er.useCallback(z=>{w(K=>{let q=new Set(K),fe=B.some(se=>se.id===z);return q.has(z)?q.delete(z):(fe&&B.forEach(se=>q.delete(se.id)),q.add(z)),q});},[B]),j=er.useCallback(z=>{let K=pd(z);K&&(z.id==="chat"||z.appurl==="/chat"?g.push("/chat?new=true"):/^https?:\/\//.test(K)?window.open(K,"_blank","noopener,noreferrer"):g.push(K));},[g]),V=z=>{r(),w(new Set([z.id]));};return c("aside",{"data-navigation-island":"v2","data-collapsed":t||void 0,className:`orb-navigation-island-v2 relative flex flex-col border ${t?"w-14":"w-[234px]"} ${o}`,style:{maxHeight:n?`${n}px`:void 0,transition:"width 320ms cubic-bezier(0.4, 0, 0.2, 1), border-radius 220ms ease, box-shadow 220ms ease"},"aria-label":"Navigation",children:[e("div",{className:`orb-navigation-island-v2-search ${t?"px-1":"px-2"}`,children:t?e("button",{type:"button",onClick:r,className:"mx-auto flex h-10 w-10 items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y("navigation.expand"),"aria-label":y("navigation.expand"),children:e(Hr,{className:"h-5 w-5"})}):c("label",{className:"relative block",children:[e("span",{className:"orb-visually-hidden",children:y("navigation.searchPlaceholder")}),e(Hr,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--orb-muted)]"}),e("input",{type:"search",value:h,onChange:z=>C(z.target.value),placeholder:y("navigation.searchPlaceholder"),className:"w-full py-2 pl-10 pr-3 text-sm outline-none"})]})}),e("nav",{className:`min-h-0 flex-1 overflow-y-auto pb-2 ${t?"px-1":"px-2"}`,children:B.length===0?e("div",{className:"flex items-center justify-center py-8 text-sm text-[var(--orb-muted)]",children:t?e(Hn,{className:"h-5 w-5"}):y(_?"navigation.noMatch":"navigation.noAccessibleApp")}):t?e("div",{className:"space-y-1",children:F.map(z=>e("button",{type:"button",onClick:()=>V(z),className:"flex h-10 w-full items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y("navigation.expandView",{title:z.title||z.label||""}),children:z.icon||e(Hn,{className:"h-5 w-5"})},z.id))}):e(Xn,{items:B,onItemClick:j,className:"space-y-1",expandedIds:Y,onToggleExpand:W,colorMode:i,enablePinning:u,pinnedIds:N,onTogglePin:O})}),d&&t&&e("div",{className:"orb-navigation-island-v2-footer flex flex-col items-center gap-1 border-t px-1 py-2",children:e("button",{type:"button",onClick:()=>l?.(x?"fixed":"floating"),className:"flex h-9 w-9 items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?e(Oa,{className:"h-4 w-4"}):e(Fa,{className:"h-4 w-4"})})}),!t&&e("button",{type:"button",onClick:r,className:"absolute -bottom-1 -right-1 z-20 flex h-6 w-6 items-center justify-center rounded-full bg-transparent transition-all duration-300 ease-in-out",title:y("navigation.collapse"),"aria-label":y("navigation.collapse"),children:e("span",{"aria-hidden":"true",className:"absolute overflow-hidden",style:{bottom:0,right:0,width:16,height:16},children:e("span",{className:"absolute rounded-full border-[3px] border-[var(--orb-ai-accent)]",style:{width:32,height:32,top:-16,left:-16}})})})]})};Xs.displayName="NavigationIsland2";var bd=(t={})=>{let{initialCollapsed:r=false,initialDisplayMode:o="fixed",content:n=[],enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:u}=t,[p,f]=er.useState(r),[b,m]=er.useState(o),[v,y]=er.useState(n),g=er.useCallback(()=>{f(C=>!C);},[]),x=er.useCallback(()=>{m(C=>C==="fixed"?"floating":"fixed");},[]),h=er.useMemo(()=>({collapsed:p,onToggle:g,menuData:v,displayMode:b,onDisplayModeChange:m,enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:u}),[p,g,v,b,m,a,i,s,l,d,u]);return {collapsed:p,setCollapsed:f,toggleCollapsed:g,displayMode:b,setDisplayMode:m,toggleDisplayMode:x,menuData:v,setMenuData:y,navigationIslandProps:h}};var Zs=class{constructor(){fc(this,"listener",null);}register(r){this.listener=r;}unregister(){this.listener=null;}show(r,o,n){this.listener&&this.listener({type:r,content:o,options:n});}hide(){this.listener&&this.listener(null);}},io=new Zs,uT={success:(t,r)=>io.show("success",t,r),error:(t,r)=>io.show("error",t,r),warning:(t,r)=>io.show("warning",t,r),info:(t,r)=>io.show("info",t,r),show:(t,r,o)=>io.show(t,r,o),hide:()=>io.hide()};P();var Rb={success:{icon:e(Bn,{size:40}),color:"var(--orb-success-bg)",iconColor:"var(--orb-success)"},warning:{icon:e(Ha,{size:40}),color:"var(--orb-warn-bg)",iconColor:"var(--orb-warn)"},error:{icon:e(Ra,{size:40}),color:"var(--orb-err-bg)",iconColor:"var(--orb-err)"},info:{icon:e(Na,{size:40}),color:"var(--orb-info-bg)",iconColor:"var(--orb-info)"},default:{icon:null,color:"transparent",iconColor:"inherit"}},jn=({open:t,title:r,message:o,onClose:n,onConfirm:a,confirmText:i,cancelText:s,showCancel:l=true,maxWidth:d="xs",type:u="default"})=>{let{t:p}=pe(),f=i||p("messageBox.confirm"),b=s||p("messageBox.cancel"),m=()=>{a?a():n();},v=Rb[u],y=u!=="default";return c(Lt,{open:t,onClose:n,maxWidth:d,sx:y?{borderTop:`6px solid ${v.iconColor}`}:void 0,children:[y&&e("div",{style:{display:"flex",justifyContent:"center",paddingTop:24,color:v.iconColor},children:v.icon}),r&&e("div",{className:"orb-dialog-title",style:{textAlign:y?"center":"left",paddingTop:y?8:16},children:r}),e("div",{className:"orb-dialog-content",style:{textAlign:y?"center":"left"},children:typeof o=="string"?e("p",{style:{margin:0,color:"var(--orb-muted)"},children:o}):o}),c("div",{className:"orb-dialog-actions",style:{display:"flex",justifyContent:y?"center":"flex-end",gap:8,paddingBottom:24,paddingLeft:24,paddingRight:24},children:[l&&e(we,{onClick:n,variant:"text",children:b}),e(we,{onClick:m,variant:"contained",color:y&&u==="error"?"error":"primary",autoFocus:true,children:f})]})]})},CT=()=>{let[t,r]=er__namespace.default.useState(null),[o,n]=er__namespace.default.useState(false);er__namespace.default.useEffect(()=>{let s=l=>{l?(r(l),n(true)):(n(false),r(null));};return io.register(s),()=>io.unregister()},[]);let a=()=>{n(false),t?.options?.onClose&&t.options.onClose(),r(null);},i=()=>{t?.options?.onConfirm&&t.options.onConfirm(),n(false),r(null);};return t?e(jn,{open:o,type:t.type,message:t.content,title:t.options?.title,onClose:a,onConfirm:i,confirmText:t.options?.confirmText,cancelText:t.options?.cancelText,showCancel:t.options?.showCancel,maxWidth:t.options?.maxWidth}):null};P();var PT=({status:t,showIcon:r=true})=>{let o="gray",n,a=t;return t==="OK"?(o="blue",n=e(Bn,{size:14,strokeWidth:2}),a="Success"):t==="Error"?(o="orange",n=e(Ra,{size:14,strokeWidth:2}),a="Error"):t==="Warning"&&(o="orange",n=e(Ha,{size:14,strokeWidth:2}),a="Warning"),e(xt,{label:a,tone:o,icon:r&&n?n:void 0})};P();var MT=({dense:t,sx:r,className:o,children:n,...a})=>e("ul",{...a,className:o,style:{listStyle:"none",margin:0,padding:0,...r},children:n}),RT=({button:t,divider:r,sx:o,className:n,children:a,...i})=>e("li",{...i,className:n,style:{display:"flex",alignItems:"center",padding:"8px 16px",minHeight:40,borderBottom:r?"1px solid var(--orb-border)":void 0,cursor:t?"pointer":void 0,transition:"var(--orb-t-fast)",...o},onMouseEnter:t?s=>{s.currentTarget.style.background="var(--orb-hover)";}:void 0,onMouseLeave:t?s=>{s.currentTarget.style.background="";}:void 0,children:a}),DT=({sx:t,className:r,children:o,...n})=>e("button",{...n,type:"button",className:r,style:{width:"100%",display:"flex",alignItems:"center",padding:"8px 16px",border:"none",background:"transparent",textAlign:"left",cursor:"pointer",transition:"var(--orb-t-fast)",...t},children:o}),NT=({children:t,sx:r})=>e("div",{style:{marginRight:16,display:"flex",alignItems:"center",minWidth:40,...r},children:t}),AT=({primary:t,secondary:r,sx:o})=>c("div",{style:{flex:1,minWidth:0,...o},children:[e("div",{className:"orb-body",style:{fontWeight:500},children:t}),r&&e("div",{className:"orb-meta",style:{marginTop:2},children:r})]}),ET=({sx:t,className:r,children:o,...n})=>e("li",{...n,className:r,style:{padding:"8px 16px",fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--orb-muted)",...t},children:o}),LT=({children:t,sx:r})=>e("div",{style:{marginRight:12,display:"flex",alignItems:"center",...r},children:t});P();var BT=({xs:t,md:r,lg:o,sx:n,children:a,className:i,...s})=>{let l=o?`span ${o}`:r?`span ${r}`:t?`span ${t}`:"span 12";return e("div",{...s,className:i,style:{gridColumn:l,minWidth:0,...n},children:a})};_t();P();var Ar=rt,ir=(t,r)=>er.forwardRef(({component:o,sx:n,className:a,style:i,children:s,...l},d)=>{let u=o??t,p=Ue(n,[r,a].filter(Boolean).join(" "),i);return e(u,{ref:d,className:p.className,style:p.style,...l,children:s})}),Ie=ir("div"),vd=ir("a","orb-link"),Bo=Ae,yd=ie,hr=L;var Cd=ae;var xd=Dt,jr=on,Qa=rn,Ja=Wa;var ei=Va,Sd=Xr,wd=({value:t,variant:r,color:o,sx:n})=>e($n,{value:r==="determinate"?t:void 0,color:o,sx:n}),kd=ir("table","orb-tbl"),Pd=ir("tbody"),Js=ir("td"),Td=ir("div","orb-table-container"),Id=ir("thead"),el=ir("tr");ir("tfoot");ir("div","orb-dialog-title");ir("div","orb-dialog-content");ir("div","orb-dialog-actions");ir("p","orb-body-dense");var so=ir("span","orb-input-adornment"),Md=er.forwardRef(({sx:t,fullWidth:r,className:o,style:n,...a},i)=>{let s=Ue(t,["orb-input-base",o].filter(Boolean).join(" "),n);return e("input",{ref:i,className:s.className,style:{width:r?"100%":void 0,...s.style},...a})});var Co=ir("div","orb-form-control"),Qn=({control:t,label:r,...o})=>c("label",{className:"orb-form-control-label",...o,children:[t,e("span",{children:r})]}),Ob=({primary:t,secondary:r,children:o,primaryTypographyProps:n,secondaryTypographyProps:a,...i})=>c("span",{className:"orb-list-item-text",...i,children:[t??o,r?e("small",{children:r}):null]}),Fb=ir("span","orb-list-item-icon"),Gt=Ob,zr=Fb;ir("div","orb-list-subheader");var tl=({container:t,item:r,spacing:o,xs:n,sm:a,md:i,lg:s,xl:l,sx:d,...u})=>{let p={},f=b=>typeof b=="number"?`${b/12*100}%`:b?"100%":void 0;return n!==void 0&&(p.xs=f(n)),a!==void 0&&(p.sm=f(a)),i!==void 0&&(p.md=f(i)),s!==void 0&&(p.lg=f(s)),l!==void 0&&(p.xl=f(l)),e(Ie,{...u,sx:{display:t?"flex":void 0,flexWrap:t?"wrap":void 0,gap:t&&o?o:void 0,width:r?p:void 0,...d??{}}})},nn=({in:t,children:r,unmountOnExit:o,...n})=>!t&&o?null:e("div",{hidden:!t,...n,children:r}),Rd=({children:t,container:r})=>typeof document>"u"?null:reactDom.createPortal(t,r??document.body),Dd=ir("div","orb-toolbar"),Nd=({active:t,direction:r="asc",children:o,sx:n,className:a,style:i,...s})=>{let l=Ue(n,["orb-table-sort-label",t?"orb-is-active":"",a].filter(Boolean).join(" "),i);return c("button",{type:"button",className:l.className,style:l.style,"data-direction":r,...s,children:[e("span",{className:"orb-table-sort-content",children:o}),e(Tt,{className:"orb-table-sort-icon",name:r==="desc"?"down":"up",size:11})]})},ti=({open:t,anchorEl:r,onClose:o,children:n,anchorOrigin:a,transformOrigin:i,slotProps:s,PaperProps:l,sx:d,className:u,style:p,...f})=>{let b=er.useRef(null);if(er.useEffect(()=>{if(!t)return;let x=C=>{let k=C.composedPath();b.current&&k.includes(b.current)||r&&k.includes(r)||o?.();},h=C=>{C.key==="Escape"&&o?.();};return document.addEventListener("pointerdown",x,true),document.addEventListener("keydown",h,true),()=>{document.removeEventListener("pointerdown",x,true),document.removeEventListener("keydown",h,true);}},[r,o,t]),!t||typeof document>"u")return null;let m=r?.getBoundingClientRect(),v=s?.paper??l,y=[...Array.isArray(v?.sx)?v.sx:v?.sx?[v.sx]:[],...Array.isArray(d)?d:d?[d]:[]],g=Ue(y,["orb-pop",v?.className,u].filter(Boolean).join(" "),{...v?.style,...p});return reactDom.createPortal(e("div",{...f,ref:b,className:g.className,style:{position:"fixed",left:m?.left??16,top:(m?.bottom??16)+6,zIndex:1301,...g.style},children:n}),document.body)},Ad=({open:t,onClose:r,anchor:o="left",children:n,PaperProps:a})=>{if(!t||typeof document>"u")return null;let i=o==="right"?{right:0,top:0,bottom:0}:o==="top"?{left:0,right:0,top:0}:o==="bottom"?{left:0,right:0,bottom:0}:{left:0,top:0,bottom:0},s=Ue(a?.sx,"orb-drawer");return reactDom.createPortal(c(jsxRuntime.Fragment,{children:[e("button",{type:"button",className:"orb-overlay","aria-label":"Close drawer",onClick:r}),e("aside",{className:s.className,style:{position:"fixed",zIndex:1201,...i},children:n})]}),document.body)},Ed=({value:t,onChange:r,children:o,variant:n,scrollButtons:a,...i})=>e("div",{role:"tablist",className:"orb-tabs",...i,children:er.Children.map(o,s=>er.isValidElement(s)?er.cloneElement(s,{selected:s.props.value===t,onSelect:l=>r?.(null,l)}):s)}),Ld=({value:t,label:r,children:o,selected:n,onSelect:a,...i})=>e("button",{type:"button",role:"tab","aria-selected":n,className:`orb-tab ${n?"orb-is-active":""}`,onClick:()=>a?.(t),...i,children:r??o});var sr=()=>Pa(),xo=(t,r)=>Dr(t);var Od=({day:t,onDaySelect:r,selected:o,outsideCurrentMonth:n,disableMargin:a,sx:i,className:s,...l})=>{let d=Ue(i,`orb-cal-day ${o?"orb-is-selected":""} ${n?"orb-is-outside":""} ${s??""}`);return e("button",{type:"button",className:d.className,style:d.style,onClick:()=>r?.(t),...l,children:t.date()})},Fd=({value:t,referenceDate:r,onChange:o,onMonthChange:n,onYearChange:a,minDate:i,maxDate:s,slots:l,...d})=>e(Un,{value:t,month:r,onChange:u=>o?.(u),onMonthChange:u=>{n?.(u),a?.(u);},minDate:i,maxDate:s,renderDay:l?.day?(u,p)=>l.day?.({day:u,selected:p.selected,outsideCurrentMonth:p.outsideCurrentMonth,onDaySelect:f=>o?.(f)}):void 0,...d}),Bd=({children:t})=>e(jsxRuntime.Fragment,{children:t}),ja=class{};_t();P();var Bb=(t,r)=>r!==void 0?r:typeof t=="number"?t:t==="small"?18:t==="large"?30:t==="inherit"?"1em":22,xe=t=>({fontSize:o,size:n,sx:a,className:i,style:s,titleAccess:l,...d})=>{let u=Ue(a,i,s);return e(Tt,{name:t,size:Bb(o,n),className:u.className,style:u.style,"aria-label":d["aria-label"]??l,...d})},So=xe("tree"),Ho=xe("add"),Hd=xe("duplicate"),rl=xe("down"),zd=xe("navigationRight"),Vd=xe("navigationRight"),ol=xe("up"),Wd=xe("delete"),$d=xe("camera"),_d=xe("accept"),Gd=xe("accept"),ri=xe("navigationRight"),Ud=xe("dimension"),Kd=xe("decline"),wo=xe("decline"),qd=xe("decline"),Xd=xe("decline"),oi=xe("delete"),ni=xe("delete"),Yd=xe("download"),Zd=xe("move"),jd=xe("edit"),an=xe("slimDown"),Qd=xe("filter"),sn=xe("sum"),Jd=xe("lineChart"),ep=xe("document"),Vr=xe("slimDown"),tp=xe("navigationLeft"),ko=xe("navigationRight"),ai=xe("slimUp"),ii=xe("navigationLeft"),si=xe("navigationRight"),rp=xe("dimension"),op=xe("splitOne"),li=xe("menu"),np=xe("microphone"),ap=xe("microphone"),ip=xe("microphone"),sp=xe("qrCode"),Po=xe("save"),zo=xe("search"),lp=xe("search"),cp=xe("paperPlane"),dp=xe("paperPlane"),pp=xe("wrench"),up=xe("sort"),ci=xe("splitTwo"),mp=xe("favorite"),gp=xe("favorite"),fp=xe("stop"),bp=xe("tableRow"),di=xe("collapseAll"),pi=xe("expandAll"),ln=xe("tableColumn"),hp=xe("overview"),vp=xe("hide");P();var zb=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],Cp=t=>Array.isArray(t)?t:t==null||t===""?[]:[t],kr=t=>String(t),xp=(t,r)=>t[r],Sp=t=>{let r=t.value??t.id??t.key??t.code;return typeof r=="number"||typeof r=="string"?r:""},Vb=t=>{let r=t.label??t.description??t.name??t.title;return String(typeof r=="number"||typeof r=="string"?r:Sp(t))},Wb=t=>{let r=t.description??t.subtitle;return typeof r=="number"||typeof r=="string"?String(r):void 0},wp=({value:t=null,items:r=[],columns:o,mode:n="single",dialogTitle:a="Value Help",searchPlaceholder:i="Search values...",selectLabel:s="Select",clearLabel:l="Clear",cancelLabel:d="Cancel",valueHelpLabel:u="Open value help",noResultsText:p="No matching values",loading:f=false,clearable:b=true,allowManualInput:m=true,validateManualInput:v=true,manualInputErrorText:y="Enter a valid value.",selectedItems:g=[],displayValue:x,getOptionValue:h=Sp,getOptionLabel:C=Vb,getOptionDescription:k=Wb,onChange:w,onSearch:T,disabled:I,InputProps:S,onFocus:A,onBlur:R,onKeyDown:M,error:N,helperText:E,...O})=>{let F=Cr(),_=n==="multiple",[B,Y]=er.useState(false),[W,j]=er.useState(false),[V,z]=er.useState(""),[K,q]=er.useState(null),[fe,se]=er.useState(false),[ue,Se]=er.useState(()=>Cp(t)),[$e,ke]=er.useState(""),[le,Ee]=er.useState(""),Me=er.useMemo(()=>o&&o.length>0?o:zb,[o]),Pe=K??r,Ve=er.useMemo(()=>{let te=[...g,...r,...K??[]],he=new Map;return te.forEach(Ne=>{he.set(kr(h(Ne)),Ne);}),he},[h,r,K,g]),tt=er.useMemo(()=>Cp(t),[t]),nt=er.useMemo(()=>tt.map(String).join(", "),[tt]);er.useEffect(()=>{B||Se(tt);},[B,tt]),er.useEffect(()=>{!W&&!le&&ke(nt);},[W,nt,le]);let it=er.useMemo(()=>{let te=V.trim().toLowerCase();if(!te||T)return Pe;let he=Me.filter(Ne=>Ne.searchable!==false);return Pe.filter(Ne=>[h(Ne),C(Ne),k(Ne),...he.map(st=>xp(Ne,st.field))].some(st=>String(st??"").toLowerCase().includes(te)))},[Pe,k,C,h,T,V,Me]),X=er.useMemo(()=>{if(x!==void 0)return x;if(tt.length===0)return "";let te=he=>{let Ne=Ve.get(kr(he));if(!Ne)return String(he);let Je=C(Ne);return Je&&Je!==String(he)?`${he} - ${Je}`:String(he)};return _?tt.length>2?`${tt.length} selected`:tt.map(te).join(", "):te(tt[0])},[x,C,_,Ve,tt]),De=er.useCallback(async()=>{if(T){se(true);try{let te=await T(V);Array.isArray(te)&&q(te);}finally{se(false);}}},[T,V]),ye=()=>{I||(Se(tt),Y(true));},Be=()=>{Y(false);},at=()=>{w?.(_?[]:null,_?[]:null),Se([]),ke(""),Ee("");},Ze=te=>{let he=h(te);if(_){Se(Ne=>Ne.some(st=>kr(st)===kr(he))?Ne.filter(st=>kr(st)!==kr(he)):[...Ne,he]);return}Se([he]);},St=()=>{let te=ue.map(he=>Ve.get(kr(he))).filter(he=>!!he);_?w?.(ue,te):w?.(ue[0]??null,te[0]??null),Ee(""),Y(false);},Mt=te=>{if(te.key==="F4"){te.preventDefault(),ye();return}if(te.key==="Enter"&&m&&!At($e,true)){te.preventDefault();return}M?.(te);},Ot=te=>v?te.every(he=>Ve.has(kr(he))):true,At=(te,he)=>{if(_){let Je=te.split(/[,;\n]/).map(pt=>pt.trim()).filter(Boolean);if(Je.length===0)return Ee(""),w?.([],[]),true;if(!Ot(Je))return he&&Ee(y),false;Ee("");let st=Je.map(pt=>Ve.get(kr(pt))).filter(pt=>!!pt);return w?.(Je,st),true}let Ne=te.trim();return Ne?Ot([Ne])?(Ee(""),w?.(Ne,Ve.get(kr(Ne))??null),true):(he&&Ee(y),false):(Ee(""),w?.(null,null),true)},re=te=>{if(!m)return;let he=te.target.value;ke(he),Ee(""),At(he,false);},Ke=f||fe,Fe=tt.length>0,ve=m&&(W||!!le)?$e:X;return c(jsxRuntime.Fragment,{children:[e(ze,{...O,className:["orb-value-help-field",b&&Fe&&!I?"orb-value-help-has-clear":"",O.className??""].filter(Boolean).join(" "),disabled:I,value:ve,error:!!le||N,helperText:le||E,onChange:re,onFocus:te=>{j(true),ke(nt),A?.(te);},onBlur:te=>{m&&At($e,true),j(false),R?.(te);},onKeyDown:Mt,InputProps:{...S,readOnly:!m,endAdornment:c("span",{className:"orb-value-help-actions",children:[Ke?e(Xr,{size:18}):null,b&&Fe&&!I?e(ae,{className:"orb-value-help-clear-trigger",size:"small",tooltip:l,"aria-label":l,onMouseDown:te=>te.preventDefault(),onClick:te=>{te.stopPropagation(),at();},children:e(Tt,{name:"decline",size:14})}):null,e(ae,{className:"orb-value-help-search-trigger",size:"small",tooltip:u,"aria-label":u,onMouseDown:te=>te.preventDefault(),onClick:te=>{te.stopPropagation(),ye();},disabled:I,children:e(Tt,{name:"search",size:16})})]})}}),c(Lt,{open:B,onClose:Be,fullWidth:true,maxWidth:820,hideCloseButton:true,PaperProps:{sx:te=>({borderRadius:2,overflow:"hidden",border:`1px solid ${te.palette.divider}`,boxShadow:F==="dark"?`0 24px 80px ${rt(te.palette.common.black,.72)}`:`0 24px 80px ${rt(te.palette.common.black,.18)}`})},children:[c("div",{className:"orb-dialog-title",sx:te=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${te.palette.divider}`,bgcolor:te.palette.background.paper}),children:[c("div",{children:[e(L,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),_?e(L,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${ue.length} selected`}):null]}),e(ae,{"aria-label":"Close",onClick:Be,size:"small",children:e(wo,{fontSize:"small"})})]}),c("div",{className:"orb-dialog-content",sx:{p:0},children:[c(ie,{direction:{xs:"column",sm:"row"},spacing:1,sx:te=>({px:2.5,py:1.5,borderBottom:`1px solid ${te.palette.divider}`,bgcolor:F==="dark"?rt(te.palette.common.white,.025):rt(te.palette.primary.main,.035)}),children:[e(ze,{size:"small",fullWidth:true,autoFocus:true,value:V,placeholder:i,onChange:te=>z(te.target.value),onKeyDown:te=>{te.key==="Enter"&&(te.preventDefault(),De());},InputProps:{startAdornment:e(so,{position:"start",children:e(Tt,{name:"search",size:16})}),sx:te=>({borderRadius:1,bgcolor:te.palette.background.paper,"& fieldset":{borderColor:rt(te.palette.text.primary,F==="dark"?.2:.16)},"&:hover fieldset":{borderColor:rt(te.palette.primary.main,.52)},"&:focus-within fieldset":{borderColor:te.palette.primary.main}})}}),T?e(we,{variant:"outlined",onClick:()=>{De();},disabled:Ke,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:Ke?e(Xr,{size:18}):"Search"}):null]}),e("div",{sx:{maxHeight:420},children:c("table",{className:"orb-tbl",stickyHeader:true,size:"small",children:[e("thead",{children:c("tr",{children:[e("td",{padding:"checkbox",sx:te=>({bgcolor:F==="dark"?"var(--orb-canvas)":te.palette.background.paper,borderBottom:`1px solid ${te.palette.divider}`})}),Me.map(te=>e("td",{align:te.align==="inherit"?void 0:te.align,sx:he=>({minWidth:te.minWidth,width:te.width,fontSize:"0.78rem",fontWeight:800,bgcolor:F==="dark"?"var(--orb-canvas)":he.palette.background.paper,borderBottom:`1px solid ${he.palette.divider}`}),children:te.label},String(te.field)))]})}),c("tbody",{children:[it.map(te=>{let he=h(te),Ne=ue.some(Je=>kr(Je)===kr(he));return c("tr",{hover:true,selected:Ne,onClick:()=>Ze(te),onDoubleClick:()=>{_||(Se([he]),w?.(he,te),Y(false));},sx:Je=>({cursor:"pointer","&.orb-selected":{bgcolor:rt(Je.palette.primary.main,F==="dark"?.22:.12)},"&.orb-selected:hover":{bgcolor:rt(Je.palette.primary.main,F==="dark"?.28:.18)}}),children:[e("td",{padding:"checkbox",children:e(It,{size:"small",checked:Ne})}),Me.map(Je=>{let st=xp(te,Je.field);return e("td",{align:Je.align==="inherit"?void 0:Je.align,sx:{fontSize:"0.82rem",py:1},children:Je.render?Je.render(st,te):String(st??"")},String(Je.field))})]},kr(he))}),it.length===0?e("tr",{children:e("td",{colSpan:Me.length+1,children:e("div",{sx:{py:5,textAlign:"center",color:"text.secondary"},children:p})})}):null]})]})})]}),c("div",{className:"orb-dialog-actions",sx:te=>({px:2.5,py:1.5,borderTop:`1px solid ${te.palette.divider}`,bgcolor:te.palette.background.paper,"& .orb-btn":{textTransform:"none",fontWeight:700}}),children:[b&&(Fe||ue.length>0)?e(we,{onClick:at,children:l}):null,e("div",{sx:{flex:1}}),e(we,{onClick:Be,children:d}),e(we,{variant:"contained",onClick:St,disabled:!_&&ue.length===0,children:s})]})]})]})};P();var ui=({title:t,hideHeader:r,children:o})=>c("div",{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!r&&e("div",{sx:{mb:2},children:e(L,{variant:"h4",children:t})}),e("div",{sx:{flex:1,overflow:"hidden"},children:o})]});var nl={width:56,minWidth:56,maxWidth:56,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},al={width:72,minWidth:72,maxWidth:72,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},Jn={width:30,height:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},ea={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},kp={display:"flex",alignItems:"center",justifyContent:"center",gap:.25,width:"100%",minWidth:0},pr={width:32,height:32,minWidth:32,minHeight:32,p:0,flex:"0 0 auto",borderRadius:1,color:"text.secondary","& svg, & [data-sap-icon]":{width:16,height:16,fontSize:16,strokeWidth:1.8}};P();var $b={fontSize:"0.85rem",width:62,minWidth:62,"& .orb-select-trigger":{minHeight:"32px !important",height:"32px !important",padding:"0 8px !important"},"& .orb-select-chevron":{width:"11px !important",height:"11px !important",fontSize:"11px !important"}},mi=({rowsPerPage:t=20,rowsPerPageOptions:r=[20,50,100,-1],page:o=0,count:n=0,onRowsPerPageChange:a,onPageChange:i})=>{let{t:s}=pe(),l=r.length>0?r:[20,50,100,-1],d=Math.max(0,o),u=t===-1?1:Math.max(1,Math.ceil(n/t)),p=Math.min(d+1,u),f=d>0,b=d<u-1&&t!==-1;return c("div",{className:"orb-table-pager",children:[e(L,{className:"orb-table-pager-label",children:s("table.toolbar.itemsPerPage")}),e(ct,{title:s("table.toolbar.itemsPerPage"),children:e(zt,{size:"small",variant:"standard",value:t,"aria-label":s("table.toolbar.itemsPerPage"),fullWidth:false,disableUnderline:true,onChange:m=>a?.(Number(m.target.value)),sx:$b,children:l.map(m=>e("option",{value:m,children:m===-1?s("common.all"):m},`rows-per-page-${m}`))})}),e("span",{className:"orb-table-pager-divider"}),e(ae,{className:"orb-table-pager-button","aria-label":"Previous page",size:"small",onClick:()=>i?.(Math.max(d-1,0)),disabled:!f,sx:pr,children:e(tp,{})}),c(L,{className:"orb-table-pager-page",title:s("table.toolbar.pageOf",{current:p,total:u}),children:[p," / ",u]}),e(ae,{className:"orb-table-pager-button","aria-label":"Next page",size:"small",onClick:()=>i?.(Math.min(d+1,u-1)),disabled:!b,sx:pr,children:e(ko,{})})]})};P();var gi=({value:t="",onChange:r})=>{let{t:o}=pe();return e("div",{className:"orb-table-toolbar-search",children:e(ze,{className:"orb-table-toolbar-search-field",size:"small",placeholder:o("table.toolbar.searchPlaceholder"),value:t,onChange:n=>r?.(n.target.value),InputProps:{startAdornment:e(so,{position:"start",children:e(zo,{size:16})})}})})};P();var fi=t=>{let{t:r}=pe(),o=Array.isArray(t.actions)?t.actions:t.actions?[t.actions]:[],n=Array.isArray(t.extraTools)?t.extraTools:t.extraTools?[t.extraTools]:[],a=[...o,...n],i=!!(t.showCreateButton||t.showEditButton||t.showDeleteButton),s=!!(t.onOpenGraphReport||t.onLayoutSave&&!t.layoutManager||t.layoutManager);return e(Dd,{className:"orb-table-toolbar",role:"toolbar","aria-label":r("table.title.default"),children:c("div",{className:"orb-table-toolbar-primary",children:[e(gi,{value:t.filterText,onChange:l=>{t.setFilterText(l),t.onPageChange?.(0);}}),e(mi,{rowsPerPage:t.rowsPerPage,rowsPerPageOptions:t.rowsPerPageOptions,page:t.page,count:t.count,onRowsPerPageChange:t.onRowsPerPageChange,onPageChange:t.onPageChange}),a.length>0?e("div",{className:"orb-table-toolbar-custom",children:a.map((l,d)=>e(er__namespace.default.Fragment,{children:l},`toolbar-custom-${d}`))}):null,e("span",{className:"orb-table-toolbar-spacer"}),c("div",{className:"orb-table-toolbar-actions",children:[c("div",{className:"orb-table-tool-group",children:[!t.disableGrouping&&e(ct,{title:r("table.toolbar.groupBy"),children:e(ae,{className:"orb-table-tool-button",sx:pr,onClick:l=>t.setGroupAnchorEl(t.groupAnchorEl?null:l.currentTarget),children:e(Ja,{badgeContent:t.grouping?.length,color:"primary",invisible:!t.grouping?.length,children:e(So,{})})})}),e(ct,{title:r("table.toolbar.summary"),children:e(ae,{className:`orb-table-tool-button ${t.showSummary?"orb-is-active":""}`,active:!!t.showSummary,sx:pr,onClick:l=>t.setSummaryAnchorEl(t.summaryAnchorEl?null:l.currentTarget),children:e(sn,{})})}),e(ct,{title:r("table.toolbar.columns"),children:e(ae,{className:"orb-table-tool-button",sx:pr,onClick:l=>t.setAnchorEl(t.anchorEl?null:l.currentTarget),children:e(ln,{})})}),e(ct,{title:r("table.toolbar.export"),children:e(ae,{className:"orb-table-tool-button",sx:pr,onClick:t.handleExport,children:e(Yd,{})})})]}),i&&c("div",{className:"orb-table-tool-group",children:[t.showCreateButton&&e(ct,{title:r("table.toolbar.newItem"),children:e(ae,{className:"orb-table-tool-button",onClick:t.onOpenCreateDialog,color:"primary.main",sx:pr,children:e(Ho,{})})}),t.showEditButton&&e(ct,{title:r("table.toolbar.editItem"),children:e("span",{children:e(ae,{className:"orb-table-tool-button",onClick:t.onOpenEditDialog,color:"primary.main",disabled:!!t.editDisabled,sx:pr,children:e(jd,{})})})}),t.showDeleteButton&&e(ct,{title:r("table.toolbar.deleteItem"),children:e("span",{children:e(ae,{className:"orb-table-tool-button",onClick:t.onOpenDeleteConfirm,disabled:!!t.deleteDisabled,sx:{...pr,color:"error.main"},children:e(oi,{})})})})]}),s&&c("div",{className:"orb-table-tool-group",children:[t.onOpenGraphReport&&e(ct,{title:r("table.toolbar.graphicReport"),children:e(ae,{className:"orb-table-tool-button",sx:pr,onClick:t.onOpenGraphReport,children:e(Jd,{})})}),t.onLayoutSave&&!t.layoutManager&&e(ct,{title:r("table.toolbar.saveLayout"),children:e(ae,{className:"orb-table-tool-button",sx:pr,onClick:l=>t.onLayoutSave(l),children:e(Po,{})})}),t.layoutManager]})]})]})})};var bi=Object.freeze({Translate:{toString(t){if(!t)return;let{x:r,y:o}=t;return "translate3d("+(r?Math.round(r):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:r,scaleY:o}=t;return "scaleX("+r+") scaleY("+o+")"}},Transform:{toString(t){if(t)return [bi.Translate.toString(t),bi.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:r,duration:o,easing:n}=t;return r+" "+o+"ms "+n}}});P();var hi=t=>{let{t:r}=pe(),{onSelectAllClick:o,order:n,orderBy:a,sortBy:i=[],numSelected:s=0,rowCount:l=0,onRequestSort:d,onContextMenu:u,columns:p,visibleColumns:f,selectionMode:b,grouping:m=[],isAllExpanded:v=false,handleToggleAll:y,onColumnResize:g,columnWidths:x,enableColumnReorder:h=false,disableSorting:C=false}=t,[k,w]=er.useState(null),T=er.useRef(null),I=W=>j=>{C||k||d(W);},S=(W,j,V)=>{W.preventDefault(),W.stopPropagation(),w(j),T.current={startX:W.clientX,startWidth:V,colId:j},document.addEventListener("mousemove",A),document.addEventListener("mouseup",R),document.body.style.cursor="col-resize";},A=W=>{if(!T.current)return;let{startX:j,startWidth:V,colId:z}=T.current,K=W.clientX-j,q=Math.max(50,V+K);g&&g(z,q);},R=()=>{w(null),T.current=null,document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",R),document.body.style.cursor="";};er.useEffect(()=>()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",R);},[]);let M=b==="multiple"||b==="single",N=m.length>0&&!!y,E=r(v?"table.group.collapseAll":"table.group.expandAll"),O=p.filter(W=>f.includes(W.id)),F=new Map(i.map((W,j)=>[W.field,{...W,priority:j+1}])),_=O.map(W=>{let j=x?.[W.id]||W.minWidth||100,V=F.get(W.id);return e(Zb,{headCell:W,width:typeof j=="number"?j:100,order:n,orderBy:a,multiSortInfo:C?void 0:V,onRequestSort:I(W.id),onContextMenu:u,onResizeMouseDown:z=>S(z,W.id,typeof j=="number"?j:100),enableColumnReorder:h,disableSorting:C},W.id)}),B=O.map(W=>W.id),Y=c("tr",{children:[M&&e("th",{className:"orb-table-control-head",style:{width:56,minWidth:56,maxWidth:56},children:e(It,{color:"primary",indeterminate:s>0&&s<l,checked:l>0&&s===l,onChange:o,disabled:b==="single",sx:Jn})}),N&&e("th",{className:"orb-table-control-head",style:{width:72,minWidth:72,maxWidth:72},children:e(ct,{title:E,children:e(ae,{size:"small",onClick:W=>{W.stopPropagation(),y?.(!v);},sx:ea,children:v?e(di,{}):e(pi,{})})})}),h?e(sortable.SortableContext,{items:B,strategy:sortable.horizontalListSortingStrategy,children:_}):_]});return e("thead",{children:Y})},Zb=({headCell:t,width:r,order:o,orderBy:n,multiSortInfo:a,onRequestSort:i,onContextMenu:s,onResizeMouseDown:l,enableColumnReorder:d,disableSorting:u})=>{let{setNodeRef:p,attributes:f,listeners:b,transform:m,transition:v,isDragging:y}=sortable.useSortable({id:t.id,disabled:!d}),g=d?{transform:bi.Transform.toString(m),transition:v,opacity:y?.6:1}:{},x=u?"asc":a?.direction??(n===t.id?o:"asc"),h=!u&&(!!a||n===t.id);return c("th",{ref:d?p:void 0,className:`orb-table-head-cell ${t.numeric?"orb-num":""} ${d?"orb-is-reorderable":""} ${y?"orb-is-dragging":""}`,"aria-sort":h?x==="asc"?"ascending":"descending":"none",onContextMenu:s?C=>s(C,t.id):void 0,style:{width:r,minWidth:r,maxWidth:r,...g},...d?f:{},...d?b:{},children:[u?e("span",{className:"orb-table-head-label",children:t.label}):e(Nd,{className:"orb-table-head-sort",active:h,direction:x,onClick:i,children:c("span",{className:"orb-table-head-label",children:[t.label,a&&e("span",{className:"orb-table-sort-priority",children:a.priority})]})}),e("div",{className:"orb-table-resize-handle",onMouseDown:l,onPointerDown:C=>C.stopPropagation(),onClick:C=>C.stopPropagation()})]})};P();var vi=t=>{let{t:r}=pe(),{visibleRows:o,visibleColumns:n,selected:a=[],handleClick:i,columns:s,toggleGroupExpand:l,expandedGroups:d=new Set,selectionMode:u,grouping:p=[],isGroupFullyExpanded:f,handleExpandGroupRecursively:b,handleCollapseGroupRecursively:m,emptyLabel:v,getRowDataKey:y,getRowProps:g,getGroupRowProps:x}=t,h=T=>a.indexOf(T)!==-1,C=u==="multiple"||u==="single",k=p.length>0,w=n.length+(C?1:0)+(k?1:0);return c("tbody",{children:[o.map((T,I)=>{if(T.type==="group"){let S=d.has(T.id),A=T.childIds||[],R=A.filter(W=>h(W)).length,M=A.length>0&&R===A.length,N=R>0&&R<A.length,E={entry:T,data:T,id:T.id,index:I,selected:M,group:true},O=x?.(E)||{},{className:F,onClick:_,...B}=O,Y=W=>{if(W.stopPropagation(),!!t.onSelectionChange)if(M){let j=a.filter(V=>!A.includes(V));t.onSelectionChange(j);}else {let j=Array.from(new Set([...a,...A]));t.onSelectionChange(j);}};return c("tr",{...B,"data-ctable-row-key":y?.(E),className:["orb-table-group-row",F].filter(Boolean).join(" "),onClick:_,sx:W=>({backgroundColor:"var(--orb-surface)","& th, & td":{color:W.palette.text.primary,borderBottomColor:W.palette.divider},"& .orb-icon-btn":{color:W.palette.text.primary},"& .orb-chk":{color:W.palette.text.secondary},"& .orb-chk:has(input:checked), & .orb-chk:has(input:indeterminate)":{color:W.palette.primary.main}}),children:[C&&e("td",{padding:"checkbox",sx:nl,children:e(It,{size:"small",checked:M,indeterminate:N,onChange:Y,onClick:W=>W.stopPropagation(),sx:Jn})}),k&&e("td",{padding:"checkbox",sx:al,children:c("div",{sx:kp,children:[p.length>1&&T.level<p.length-1&&e(ct,{title:f?.(T.id)?r("table.group.collapseAll"):r("table.group.expandAll"),children:e(ae,{size:"small",onClick:()=>{f?.(T.id)?m?.(T.id):b?.(T.id);},sx:ea,children:f?.(T.id)?e(di,{}):e(pi,{})})}),e(ae,{size:"small",onClick:()=>l&&l(T.id),sx:ea,children:S?e(Vr,{}):e(ko,{})})]})}),e("td",{colSpan:n.length,sx:{py:1,pl:T.level*3+1},children:c(L,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[T.field,": ",T.value," (",T.count,")"]})})]},T.id)}else {let S=T.data||T,A=T.id||S.id||I,R=h(A),M=`enhanced-table-checkbox-${I}`,N={entry:T,data:S,id:A,index:I,selected:R,group:false},E=g?.(N)||{},{className:O,onClick:F,..._}=E,Y=(T.level!==void 0?T.level:0)*4;return c("tr",{..._,"data-ctable-row-key":y?.(N),className:[R?"orb-is-selected":"",O].filter(Boolean).join(" "),onClick:W=>{F?.(W),W.defaultPrevented||i?.(W,S);},role:C?"checkbox":_.role,"aria-checked":C?R:_["aria-checked"],tabIndex:_.tabIndex??-1,children:[C&&e("td",{padding:"checkbox",sx:nl,children:e(It,{color:"primary",checked:R,inputProps:{"aria-labelledby":M},sx:Jn})}),k&&e("td",{padding:"checkbox",sx:al}),s.filter(W=>n.includes(W.id)).map((W,j)=>{let z=j===0&&Y>0?{pl:Y+2}:{};return e("td",{className:W.numeric?"orb-num":void 0,align:W.numeric?"right":"left",sx:z,children:W.render?W.render(S[W.id],S):(function(){let q=S[W.id];if(W.numeric){if(typeof q=="number")return q.toLocaleString();if(typeof q=="string"&&q.trim()!==""&&!isNaN(Number(q)))return Number(q).toLocaleString()}return q})()},W.id)})]},A)}}),o.length===0&&e("tr",{children:e("td",{colSpan:w,align:"center",children:v??r("common.noData")})})]})};P();var Pp=t=>{let{columns:r=[],visibleColumns:o,summaryRow:n,selectionMode:a,grouping:i=[],columnWidths:s={}}=t;if(!t.showSummary)return null;let l=a==="multiple"||a==="single",d=i.length>0,u=r.filter(p=>o.includes(p.id));return e("tfoot",{className:"orb-table-footer",style:{zIndex:t.zIndex},children:c("tr",{children:[l&&e("td",{className:"orb-table-footer-control",style:{width:56,minWidth:56,maxWidth:56}}),d&&e("td",{className:"orb-table-footer-control",style:{width:72,minWidth:72,maxWidth:72}}),u.map(p=>e("td",{className:`orb-table-footer-cell ${p.numeric?"orb-num":""}`,style:{width:s[p.id]||p.minWidth||100,minWidth:s[p.id]||p.minWidth||100,maxWidth:s[p.id]||p.minWidth||100},children:(function(){let b=n[p.id];return b==null||b===""?"":typeof b=="number"?b.toLocaleString():typeof b=="string"&&b.trim()!==""&&!isNaN(Number(b))?Number(b).toLocaleString():b})()},p.id))]})})};P();var Tp=t=>{let{t:r}=pe();return e("div",{sx:{p:2},children:e(L,{children:r("table.mobile.notImplemented")})})};P();var pn=({groupAnchorEl:t,setGroupAnchorEl:r,grouping:o,setGrouping:n,columns:a})=>{let{t:i}=pe(),[s,l]=er.useState(o);er.useEffect(()=>{t&&l(o);},[t,o]);let d=()=>{l(o),r(null);},u=f=>{l(b=>b.includes(f)?b.filter(m=>m!==f):[...b,f]);},p=()=>{n(s),r(null);};return c(Qt,{anchorEl:t,open:!!t,onClose:d,sx:{width:224,minWidth:224,maxHeight:360,overflowY:"auto"},children:[c("div",{className:"orb-table-group-menu-header",onClick:f=>f.stopPropagation(),children:[e(L,{className:"orb-table-group-menu-title",variant:"subtitle2",children:i("table.menu.groupBy")}),s.length>0&&e(we,{className:"orb-table-group-menu-clear",size:"small",color:"error",onClick:f=>{f.stopPropagation(),l([]);},children:i("table.menu.clearAll")})]}),e(Dt,{className:"orb-table-group-menu-divider"}),a.map(f=>{let b=s.includes(f.id),m=s.indexOf(f.id)+1;return e("option",{className:"orb-table-group-menu-option",selected:b,onClick:v=>{v.stopPropagation(),u(f.id);},children:c("div",{className:"orb-table-group-menu-option-content",children:[e(It,{className:"orb-table-group-menu-checkbox",checked:b,size:"small"}),e(Gt,{className:"orb-table-group-menu-label",primary:f.label}),b&&e("span",{className:"orb-table-group-menu-order","aria-label":`${i("table.menu.groupBy")} ${m}`,children:m})]})},f.id)}),c("div",{className:"orb-table-group-menu-footer",children:[e(we,{size:"small",variant:"ghost",onClick:d,children:i("common.cancel")}),e(we,{size:"small",variant:"primary",onClick:p,children:i("common.ok")})]})]})},un=({anchorEl:t,setAnchorEl:r,columns:o,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=pe();return c(Qt,{anchorEl:t,open:!!t,onClose:()=>r(null),children:[e("option",{disabled:true,children:e(Gt,{primary:i("table.menu.visibleColumns")})}),e(Dt,{}),o.map(s=>c("option",{onClick:()=>a(s.id),children:[e(It,{checked:n.includes(s.id),size:"small"}),e(Gt,{primary:s.label})]},s.id))]})},yi=({anchorEl:t,setAnchorEl:r,showSummary:o,setShowSummary:n,columns:a,summaryColumns:i,toggleSummaryColumn:s})=>{let{t:l}=pe();return c(Qt,{anchorEl:t,open:!!t,onClose:()=>r(null),children:[e("option",{children:e(Qn,{control:e(ei,{checked:o,onChange:d=>n(d.target.checked),size:"small"}),label:l("table.menu.showSummaryRow")})}),e(Dt,{}),a.filter(d=>d.numeric).map(d=>c("option",{onClick:()=>s(d.id),disabled:!o,children:[e(It,{checked:i.includes(d.id),size:"small"}),e(Gt,{primary:d.label})]},d.id)),a.filter(d=>d.numeric).length===0&&e("option",{disabled:true,children:e(Gt,{primary:l("table.menu.noNumericColumns")})})]})},Ci=({contextMenu:t,handleCloseContextMenu:r,columns:o,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=pe();return c(Qt,{open:t!==null,onClose:r,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[e("option",{onClick:r,children:i("common.copy")}),e(Dt,{}),e("option",{disabled:true,children:i("table.menu.visibleColumns")}),o.map(s=>c("option",{onClick:()=>a(s.id),children:[e(zr,{children:n.includes(s.id)&&e(_d,{fontSize:"small"})}),e(Gt,{children:s.label})]},s.id))]})},Dp=({contextMenu:t,handleClose:r,columns:o,visibleColumns:n,grouping:a,summaryColumns:i,showSummary:s,sortBy:l,orderBy:d,order:u,onSortAsc:p,onSortDesc:f,onClearSort:b,onHideColumn:m,onToggleGroup:v,onToggleSummary:y,onOpenSortDialog:g})=>{let{t:x}=pe(),h=t?.columnId??"",C=o.find(M=>M.id===h),k=a.includes(h),w=i.includes(h),T=!!C?.numeric,I=l.find(M=>M.field===h),S=I?I.direction==="asc":d===h&&u==="asc",A=I?I.direction==="desc":d===h&&u==="desc",R=S||A;return c(Qt,{open:t!==null,onClose:r,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[e("option",{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:e(Gt,{primary:C?.label??h})}),e(Dt,{}),c("option",{onClick:()=>{p(h),r();},selected:S,children:[e(zr,{children:e(ol,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.sortAsc")})]}),c("option",{onClick:()=>{f(h),r();},selected:A,children:[e(zr,{children:e(rl,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.sortDesc")})]}),R&&c("option",{onClick:()=>{b(h),r();},children:[e(zr,{children:e(Ud,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.clearSort")})]}),c("option",{onClick:()=>{g(),r();},children:[e(zr,{children:e(Ho,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.configureSort")})]}),e(Dt,{}),c("option",{onClick:()=>{v(h),r();},selected:k,children:[e(zr,{children:e(So,{fontSize:"small"})}),e(Gt,{primary:x(k?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),T&&s&&c("option",{onClick:()=>{y(h),r();},selected:w,children:[e(zr,{children:e(sn,{fontSize:"small"})}),e(Gt,{primary:x(w?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),e(Dt,{}),c("option",{onClick:()=>{m(h),r();},children:[e(zr,{children:e(vp,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.hideColumn")})]})]})},Np=({open:t,onClose:r,columns:o,initialRules:n,onApply:a,onClear:i})=>{let{t:s}=pe(),[l,d]=er.useState([]);er.useEffect(()=>{t&&d(n.length>0?n.map(y=>({...y})):[]);},[t,n]);let u=er.useMemo(()=>new Set(l.map(y=>y.field)),[l]),p=er.useMemo(()=>o.filter(y=>!u.has(y.id)),[o,u]),f=()=>{let y=p[0];y&&d(g=>[...g,{field:y.id,direction:"asc"}]);},b=y=>{d(g=>g.filter((x,h)=>h!==y));},m=(y,g)=>{d(x=>x.map((h,C)=>C===y?{...h,...g}:h));},v=(y,g)=>{d(x=>{let h=y+g;if(h<0||h>=x.length)return x;let C=[...x],[k]=C.splice(y,1);return C.splice(h,0,k),C});};return e(Lt,{open:t,onClose:r,maxWidth:620,fullWidth:true,className:"orb-table-sort-dialog",title:s("table.sortDialog.title"),actions:c(jsxRuntime.Fragment,{children:[e(we,{className:"orb-table-sort-clear",variant:"neutral",disabled:l.length===0&&n.length===0,onClick:()=>{i(),r();},children:s("table.sortDialog.clearAll")}),e("span",{className:"orb-table-sort-action-spacer"}),e(we,{variant:"neutral",onClick:r,children:s("common.cancel")}),e(we,{variant:"primary",onClick:()=>{a(l),r();},children:s("common.ok")})]}),children:c("div",{className:"orb-table-sort-dialog-content",children:[l.length===0?e(L,{className:"orb-table-sort-empty",variant:"body2",children:s("table.sortDialog.empty")}):e(ie,{className:"orb-table-sort-rules",spacing:1,children:l.map((y,g)=>{let x=new Set(l.filter((C,k)=>k!==g).map(C=>C.field)),h=o.filter(C=>!x.has(C.id));return c("div",{className:"orb-table-sort-rule",children:[e(Ja,{className:"orb-table-sort-order",badgeContent:g+1,color:"primary"}),e(zt,{size:"small",value:y.field,onChange:C=>m(g,{field:C.target.value}),options:h.map(C=>({value:C.id,label:C.label}))}),e(zt,{size:"small",value:y.direction,onChange:C=>m(g,{direction:C.target.value}),options:[{value:"asc",label:s("table.sortDialog.asc")},{value:"desc",label:s("table.sortDialog.desc")}]}),e(ae,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g,-1),disabled:g===0,children:e(ol,{fontSize:"small"})}),e(ae,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g,1),disabled:g===l.length-1,children:e(rl,{fontSize:"small"})}),e(ae,{className:"orb-table-sort-icon-button orb-table-sort-delete",size:"small",onClick:()=>b(g),children:e(ni,{fontSize:"small"})})]},`sort-rule-${g}`)})}),e(we,{size:"small",onClick:f,disabled:p.length===0,startIcon:e(Ho,{}),variant:"secondary",className:"orb-table-sort-add",children:s("table.sortDialog.addRule")})]})})};P();var ta=(t,r=2)=>t.toLocaleString(void 0,{maximumFractionDigits:r}),Ap=({kpis:t})=>{let{t:r}=pe(),o=[{label:r("graph.kpi.totalRecords"),value:ta(t.totalRecords,0),color:"var(--orb-fg)"},{label:r("graph.kpi.totalReport"),value:ta(t.totalReportHours),color:"var(--orb-fg)"},{label:r("graph.kpi.totalBillable"),value:ta(t.totalBillableHours),color:"var(--orb-primary)"},{label:r("graph.kpi.efficiency"),value:`${t.efficiency.toFixed(2)}%`,color:"var(--orb-accent)"},{label:r("graph.kpi.amount"),value:ta(t.totalAmount),color:"var(--orb-primary)"},{label:r("graph.kpi.flagged"),value:ta(t.flaggedCount,0),color:"var(--orb-err)"}];return e("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:12},children:o.map(n=>c(Ae,{elevation:0,sx:{padding:12,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[e(L,{variant:"caption",muted:true,children:n.label}),e(L,{variant:"h3",sx:{fontWeight:800,color:n.color,fontVariantNumeric:"tabular-nums"},children:n.value})]},n.label))})};P();var xi=({title:t,subtitle:r,children:o})=>c(Ae,{elevation:0,sx:{padding:16},children:[e(L,{variant:"h4",sx:{fontWeight:700},children:t}),r&&e(L,{variant:"body2",muted:true,sx:{marginBottom:16},children:r}),o]});P();var ra=({data:t,orientation:r="horizontal",valueSuffix:o="",minHeight:n=210,activeName:a,onItemClick:i})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let s=Math.max(...t.map(l=>l.value),1);return r==="vertical"?e("div",{style:{display:"flex",gap:1,alignItems:"flex-end",minHeight:n},children:t.map(l=>c("div",{style:{flex:1,minWidth:0},children:[e("div",{onClick:()=>i?.(l),sx:{height:`${Math.max(l.value/s*180,6)}px`,background:l.name===a?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:i?"pointer":"default",opacity:a&&l.name!==a?.45:1}}),e(L,{variant:"caption",title:l.name,sx:{display:"block",mt:.5},children:l.name}),c(L,{variant:"caption",muted:true,children:[l.value.toFixed(1),o]})]},l.name))}):e(ie,{spacing:1,children:t.map(l=>c("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[e(L,{variant:"caption",muted:true,title:l.name,children:l.name}),e("div",{onClick:()=>i?.(l),sx:{alignSelf:"center",background:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:i?"pointer":"default",opacity:a&&l.name!==a?.45:1},children:e("div",{style:{width:`${l.value/s*100}%`,height:"100%",background:l.name===a?"primary.dark":"primary.main"}})}),c(L,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[l.value.toFixed(1),o]})]},l.name))})};P();var Ep=({data:t,color:r="var(--orb-chart-1)",valueSuffix:o="",height:n=220})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=t.map(b=>b.value),l=Math.min(...s,0),u=Math.max(...s,1)-l||1,p=t.map((b,m)=>{let v=i+m*(a-i*2)/Math.max(t.length-1,1),y=n-i-(b.value-l)/u*(n-i*2);return {x:v,y,...b}}),f=p.map(b=>`${b.x},${b.y}`).join(" ");return c("div",{children:[c("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[e("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),e("polyline",{fill:"none",style:{stroke:r},strokeWidth:3,points:f}),p.map(b=>e("circle",{cx:b.x,cy:b.y,r:4,style:{fill:r}},b.name))]}),e("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(b=>c("div",{style:{minWidth:0},children:[e(L,{variant:"caption",title:b.name,sx:{display:"block"},children:b.name}),c(L,{variant:"caption",muted:true,children:[b.value.toFixed(1),o]})]},b.name))})]})};P();var Lp=({data:t,barColor:r="var(--orb-chart-1)",lineColor:o="var(--orb-chart-5)",height:n=220})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=Math.max(...t.map(p=>p.barValue),1),l=Math.max(...t.map(p=>p.lineValue),1),d=t.map((p,f)=>{let b=(a-i*2)/t.length,m=Math.max(b*.5,8),v=i+f*b+(b-m)/2,y=p.barValue/s*(n-i*2),g=n-i-y;return {x:v,y:g,barHeight:y,barWidth:m,item:p}}),u=t.map((p,f)=>{let b=(a-i*2)/t.length,m=i+f*b+b/2,v=n-i-p.lineValue/l*(n-i*2);return {x:m,y:v,item:p}});return c(ie,{spacing:1.25,children:[c("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[e("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),d.map(p=>e("rect",{x:p.x,y:p.y,width:p.barWidth,height:Math.max(p.barHeight,4),rx:6,style:{fill:r}},p.item.name)),e("polyline",{fill:"none",style:{stroke:o},strokeWidth:3,points:u.map(p=>`${p.x},${p.y}`).join(" ")}),u.map(p=>e("circle",{cx:p.x,cy:p.y,r:3.5,style:{fill:o}},`${p.item.name}-line`))]}),e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(p=>c("div",{style:{minWidth:0},children:[e(L,{variant:"caption",title:p.name,sx:{display:"block"},children:p.name}),c(L,{variant:"caption",muted:true,sx:{display:"block"},children:["Bar: ",p.barValue.toFixed(1)]}),c(L,{variant:"caption",muted:true,sx:{display:"block"},children:["Line: ",p.lineValue.toFixed(1)]})]},p.name))})]})};P();var jb=t=>{let o=.2+Math.max(0,Math.min(1,t))*.8;return `color-mix(in oklch, var(--orb-chart-1) ${Math.round(o*100)}%, transparent)`},Op=({data:t})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let r=Array.from(new Set(t.map(i=>i.x))),o=Array.from(new Set(t.map(i=>i.y))),n=Math.max(...t.map(i=>i.value),1),a=new Map(t.map(i=>[`${i.y}__${i.x}`,i.value]));return e("div",{style:{overflowX:"auto"},children:c("div",{style:{display:"grid",gridTemplateColumns:`120px repeat(${r.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+r.length*64},children:[e("div",{}),r.map(i=>e(L,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:i},i)),o.map(i=>c("div",{style:{display:"contents"},children:[e(L,{variant:"caption",sx:{alignSelf:"center"},children:i}),r.map(s=>{let l=a.get(`${i}__${s}`)||0,d=l/n;return e("div",{sx:{height:36,borderRadius:1,background:jb(d),border:"1px solid color-mix(in oklch, var(--orb-muted) 20%, transparent)",display:"flex",alignItems:"center",justifyContent:"center"},children:e(L,{variant:"caption",sx:{fontWeight:700},children:l.toFixed(1)})},`${i}-${s}`)})]},i))]})})};P();var Qb=["var(--orb-chart-1)","var(--orb-chart-2)","var(--orb-chart-5)","var(--orb-chart-negative)","var(--orb-chart-4)","var(--orb-chart-3)"],Si=({data:t,variant:r="donut",colors:o=Qb,size:n=180,activeName:a,onItemClick:i})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let s=0,l=t.map((d,u)=>{let p=s;return s+=d.percent,`${o[u%o.length]} ${p}% ${s}%`});return c(ie,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[e("div",{style:{width:n,height:n,borderRadius:"50%",background:`conic-gradient(${l.join(", ")})`,position:"relative",flexShrink:0},children:r==="donut"&&e("div",{style:{position:"absolute",inset:Math.round(n*.18),background:"background.paper",borderRadius:"50%"}})}),e(ie,{spacing:1,sx:{minWidth:180},children:t.map((d,u)=>c("div",{onClick:()=>i?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:i?"pointer":"default",opacity:a&&d.name!==a?.45:1},children:[e("div",{style:{width:10,height:10,borderRadius:"50%",background:o[u%o.length]}}),e(L,{variant:"caption",sx:{flex:1},children:d.name}),c(L,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};P();var Fp=({effect:t,branches:r})=>{if(r.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let o=r.filter((a,i)=>i%2===0),n=r.filter((a,i)=>i%2===1);return c(ie,{spacing:1.5,children:[e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(a=>c("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[e(L,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>e(L,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))}),c("div",{style:{position:"relative",height:32},children:[e("div",{style:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),e("div",{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,background:"primary.main",color:"primary.contrastText"},children:e(L,{variant:"caption",sx:{fontWeight:700},children:t})})]}),e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(n.length,1)}, minmax(0, 1fr))`,gap:1},children:n.map(a=>c("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[e(L,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>e(L,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))})]})};P();var Bp=({data:t,height:r=240})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let o=0,n=t.map(f=>{let b=f.type==="total"?0:o,m=f.type==="total"?f.value:o+f.value;return f.type!=="total"&&(o=m),{...f,start:b,end:m,delta:m-b}}),a=n.flatMap(f=>[f.start,f.end]),i=Math.min(...a,0),s=Math.max(...a,1),l=680,d=30,u=s-i||1,p=f=>r-d-(f-i)/u*(r-d*2);return c("div",{children:[c("div",{component:"svg",viewBox:`0 0 ${l} ${r}`,style:{width:"100%",height:r},children:[e("line",{x1:d,y1:p(0),x2:l-d,y2:p(0),style:{stroke:"var(--orb-chart-grid)"}}),n.map((f,b)=>{let m=(l-d*2)/n.length,v=Math.max(m*.55,8),y=d+b*m+(m-v)/2,g=p(Math.max(f.start,f.end)),x=p(Math.min(f.start,f.end)),h=f.type==="total"?"var(--orb-chart-1)":f.delta>=0?"var(--orb-chart-positive)":"var(--orb-chart-negative)";return c("g",{children:[e("rect",{x:y,y:g,width:v,height:Math.max(x-g,4),rx:6,style:{fill:h}}),e("text",{x:y+v/2,y:g-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:f.end.toFixed(1)})]},f.name)})]}),e("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`,gap:1},children:n.map(f=>e(L,{variant:"caption",title:f.name,children:f.name},f.name))})]})};var oa=({apiKey:t,query:r,zoom:o=14,mapType:n="roadmap"})=>{let a=encodeURIComponent(r);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(t)}&q=${a}&zoom=${o}&maptype=${n}`},uR=(t,r=360)=>{let o=oa(t);return `<iframe width="100%" height="${r}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};P();var Hp=({apiKey:t,query:r,embedUrl:o,zoom:n=14,mapType:a="roadmap",height:i=320})=>{let s=o||(t&&r?oa({apiKey:t,query:r,zoom:n,mapType:a}):"");return s?c("div",{children:[e("div",{component:"iframe",src:s,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:i,border:0,borderRadius:2}}),c(L,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",e("a",{href:s,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):e("div",{children:e(L,{variant:"body2",muted:true,children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var wi=({keyword:t,location:r,src:o="orbcafe-ui"})=>{if(r){let n=encodeURIComponent(r.name||t||"Location");return `https://uri.amap.com/marker?position=${r.lng},${r.lat}&name=${n}&src=${encodeURIComponent(o)}&coordinate=gaode&callnative=0`}return t?`https://uri.amap.com/search?keyword=${encodeURIComponent(t)}&src=${encodeURIComponent(o)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};P();var zp=({keyword:t,location:r,embedUrl:o,height:n=320})=>{let a=o||wi({keyword:t,location:r?{lng:r.lng,lat:r.lat,name:r.name}:void 0});return c("div",{children:[e("div",{component:"iframe",src:a,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),c(L,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",e("a",{href:a,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};P();var Vp=({billableByPrimary:t,efficiencyBySecondary:r,statusDistribution:o,interaction:n})=>{let{t:a}=pe();return c("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:[e(xi,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:e(ra,{data:t,orientation:"horizontal",activeName:n?.filters?.primaryDimension,onItemClick:i=>n?.onPrimaryDimensionClick?.(i.name)})}),e(xi,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:e(ra,{data:r,orientation:"vertical",valueSuffix:"%",activeName:n?.filters?.secondaryDimension,onItemClick:i=>n?.onSecondaryDimensionClick?.(i.name)})}),e(xi,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:e(Si,{data:o,variant:"donut",activeName:n?.filters?.status,onItemClick:i=>n?.onStatusClick?.(i.name)})})]})};P();var eh=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],th=["zh","en","de","fr","ja","ko"],Wp=({open:t,onClose:r,value:o,onSaveAll:n,modelOptions:a=eh,promptLangOptions:i=th,analysisTemplateOptions:s=[],responseTemplateOptions:l=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:u})=>{let[p,f]=er.useState(o),[b,m]=er.useState(d||""),[v,y]=er.useState(u||""),[g,x]=er.useState(false);er.useEffect(()=>{t&&(f(o),m(d||""),y(u||""));},[t,o,d,u]);let h=(k,w)=>{f(T=>({...T,[k]:w}));},C=async()=>{if(n)try{x(!0),await n({settings:p,analysisTemplateId:b||void 0,responseTemplateId:v||void 0});}finally{x(false);}};return c(Lt,{open:t,onClose:r,fullWidth:true,maxWidth:"lg",children:[c("div",{className:"orb-dialog-title",sx:{pr:7,pb:2.2},children:[e(L,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),e(L,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),e(ae,{onClick:r,sx:{position:"absolute",right:12,top:12},children:e(wo,{})})]}),e("div",{className:"orb-dialog-content",sx:{pt:"18px !important"},children:c(ie,{spacing:2.2,children:[c("div",{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[e("div",{children:e(ze,{size:"small",value:p.baseUrl,onChange:k=>h("baseUrl",k.target.value),fullWidth:true,label:"Base URL"})}),e("div",{children:e(ze,{size:"small",type:"password",value:p.apiKey,onChange:k=>h("apiKey",k.target.value),fullWidth:true,label:"API Key"})}),e("div",{children:e(ze,{size:"small",value:p.model,onChange:k=>h("model",k.target.value),fullWidth:true,select:true,label:"Model",children:a.map(k=>e("option",{value:k,children:k},k))})}),e("div",{children:e(ze,{size:"small",value:p.promptLang,onChange:k=>h("promptLang",k.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:i.map(k=>e("option",{value:k,children:k},k))})})]}),c("div",{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[c(ze,{size:"small",value:b,onChange:k=>m(k.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[e("option",{value:"",children:"Default"}),s.map(k=>e("option",{value:k.id,children:k.label},k.id))]}),e(Wn,{multiline:true,minRows:8,value:p.analysisPrompt,onChange:k=>h("analysisPrompt",k.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),c(ze,{size:"small",value:v,onChange:k=>y(k.target.value),fullWidth:true,select:true,label:"Response Template",children:[e("option",{value:"",children:"Default"}),l.map(k=>e("option",{value:k.id,children:k.label},k.id))]}),e(Wn,{multiline:true,minRows:8,value:p.responsePrompt,onChange:k=>h("responsePrompt",k.target.value),fullWidth:true,label:"Response Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[e(we,{variant:"outlined",onClick:r,children:"Cancel"}),e(we,{variant:"contained",onClick:C,disabled:!n||g,children:"Save"})]})]})};P();var Pi=({open:t,onClose:r,model:o,tableContent:n,extraCharts:a,interaction:i,aiAssistant:s})=>{let{t:l}=pe(),[d,u]=er.useState(s?.defaultPrompt||""),[p,f]=er.useState(false),[b,m]=er.useState(false),v=i?.enabled!==false&&!!i,y=s?.enabled!==false,g=i?.filters||{},x=!!(g.primaryDimension||g.secondaryDimension||g.status),h=s?.placeholder||"Ask AI to analyze data, create charts, or find insights...";er.useEffect(()=>{t&&u(s?.defaultPrompt||"");},[t,s?.defaultPrompt]);let C=s?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},k=async()=>{let w=d.trim();if(!(!w||!s?.onSubmit))try{f(!0),await s.onSubmit(w,{filters:g,model:o});}finally{f(false);}};return e(Lt,{open:t,onClose:r,fullWidth:true,maxWidth:1400,hideCloseButton:true,children:c("div",{style:{height:"80vh",display:"flex",flexDirection:"column",background:"var(--orb-canvas)"},children:[e("div",{style:{padding:16,borderBottom:"1px solid var(--orb-border)"},children:c(ie,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:12,children:[c(ie,{direction:"row",spacing:10,alignItems:"center",sx:{flexWrap:"wrap"},children:[e(L,{variant:"h3",sx:{fontWeight:800},children:o.title}),e(xt,{label:l("graph.records",{count:o.kpis.totalRecords})}),v&&g.primaryDimension&&e(xt,{tone:"outline",label:`${i?.fieldMapping.primaryDimension}: ${g.primaryDimension}`,onDelete:()=>i?.onClearFilter("primaryDimension")}),v&&g.secondaryDimension&&e(xt,{tone:"outline",label:`${i?.fieldMapping.secondaryDimension}: ${g.secondaryDimension}`,onDelete:()=>i?.onClearFilter("secondaryDimension")}),v&&g.status&&e(xt,{tone:"outline",label:`${i?.fieldMapping.status}: ${g.status}`,onDelete:()=>i?.onClearFilter("status")}),v&&x&&e(we,{size:"small",variant:"ghost",onClick:()=>i?.onClearAll(),children:"Clear"})]}),c(ie,{direction:"row",spacing:10,alignItems:"center",children:[y&&c("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 10px",borderRadius:999,border:"1px solid var(--orb-border)",background:"var(--orb-surface)",minWidth:320},children:[e(ae,{size:"small",onClick:s?.onVoiceInput,children:e(La,{size:16,strokeWidth:1.8})}),e("input",{className:"orb-inp orb-inp-dense",value:d,onChange:w=>u(w.target.value),onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),k());},placeholder:h,style:{fontSize:14,border:"none",background:"transparent",flex:1,minWidth:0}}),e(ae,{size:"small",onClick:k,disabled:p||!d.trim(),children:e(qc,{size:16,strokeWidth:1.8})}),e(ae,{size:"small",onClick:()=>m(true),children:e(tn,{size:16,strokeWidth:1.8})})]}),e(ae,{onClick:r,children:e(jt,{size:18,strokeWidth:2})})]})]})}),c("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12,overflow:"auto",minHeight:0},children:[e(Ap,{kpis:o.kpis}),e(Vp,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:v?{filters:g,onPrimaryDimensionClick:w=>i?.onPrimaryDimensionClick(w),onSecondaryDimensionClick:w=>i?.onSecondaryDimensionClick(w),onStatusClick:w=>i?.onStatusClick(w)}:void 0}),a,n]}),e(Wp,{open:b,onClose:()=>m(false),value:C,onSaveAll:s?.onSaveAll,modelOptions:s?.modelOptions,promptLangOptions:s?.promptLangOptions,analysisTemplateOptions:s?.analysisTemplateOptions,responseTemplateOptions:s?.responseTemplateOptions,defaultAnalysisTemplateId:s?.defaultAnalysisTemplateId,defaultResponseTemplateId:s?.defaultResponseTemplateId})]})})};var Mo={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"]},oh=5,$p=t=>t.toLowerCase().replace(/[\s_-]/g,""),Ro=(t,r,o,n)=>{if(r)return r;if(t.length===0)return n;let a=Object.keys(t[0]),i=new Map(a.map(s=>[$p(s),s]));for(let s of o){let l=i.get($p(s));if(l)return l}return a[0]||n},Pr=t=>{if(typeof t=="number")return Number.isFinite(t)?t:0;if(typeof t=="string"){let r=Number(t.replace(/,/g,"").trim());return Number.isFinite(r)?r:0}return 0},gr=(t,r)=>t==null||t===""?r:String(t),nh=(t,r,o,n,a)=>{let i=new Map;return t.forEach(s=>{let l=gr(s[r],a);i.set(l,(i.get(l)||0)+Pr(s[o]));}),Array.from(i.entries()).map(([s,l])=>({name:s,value:l})).sort((s,l)=>l.value-s.value).slice(0,n)},ah=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=gr(l[r],i),u=s.get(d)||{report:0,billable:0};u.report+=Pr(l[o]),u.billable+=Pr(l[n]),s.set(d,u);}),Array.from(s.entries()).map(([l,d])=>({name:l,value:d.report>0?d.billable/d.report*100:0})).sort((l,d)=>l.value-d.value).slice(0,a)},ih=(t,r,o)=>{let n=t.length;if(n===0)return [];let a=new Map;return t.forEach(i=>{let s=gr(i[r],o);a.set(s,(a.get(s)||0)+1);}),Array.from(a.entries()).map(([i,s])=>({name:i,value:s,percent:s/n*100}))},_p=(t,r,o)=>{let n=new Map;return t.forEach(a=>{let i=gr(a[r],"N/A");n.set(i,(n.get(i)||0)+Pr(a[o]));}),Array.from(n.entries()).sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>({name:a,value:i}))},sh=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=gr(l[r],i),u=s.get(d)||{report:0,billable:0};u.report+=Pr(l[o]),u.billable+=Pr(l[n]),s.set(d,u);}),Array.from(s.entries()).map(([l,d])=>({name:l,barValue:d.billable,lineValue:d.report>0?d.billable/d.report*100:0})).sort((l,d)=>d.barValue-l.barValue).slice(0,a)},lh=(t,r,o,n,a)=>{let i=new Map;return t.forEach(s=>{let l=gr(s[r],a),d=gr(s[o],a),u=`${l}__${d}`;i.set(u,(i.get(u)||0)+Pr(s[n]));}),Array.from(i.entries()).map(([s,l])=>{let[d,u]=s.split("__");return {x:d,y:u,value:l}})},ch=(t,r,o)=>{let n=_p(t,r,o),a=n.map(s=>({name:s.name,value:s.value,type:"delta"})),i=n.reduce((s,l)=>s+l.value,0);return [...a,{name:"Total",value:i,type:"total"}]},dh=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=gr(l[r],i),u=`${gr(l[o],i)} / ${gr(l[n],i)}`,p=s.get(d)||new Map;p.set(u,(p.get(u)||0)+1),s.set(d,p);}),Array.from(s.entries()).map(([l,d])=>({title:l,causes:Array.from(d.entries()).sort((u,p)=>p[1]-u[1]).slice(0,a).map(([u,p])=>`${u} (${p})`)})).slice(0,6)},mn=({rows:t,config:r})=>{let{t:o}=pe(),n=o("graph.unassigned"),a=er.useMemo(()=>{let p=r?.fieldMapping;return {primaryDimension:Ro(t,p?.primaryDimension,Mo.primaryDimension,"Category"),secondaryDimension:Ro(t,p?.secondaryDimension,Mo.secondaryDimension,"Owner"),status:Ro(t,p?.status,Mo.status,"Status"),date:Ro(t,p?.date,Mo.date,"Date"),description:Ro(t,p?.description,Mo.description,"Description"),reportHours:Ro(t,p?.reportHours,Mo.reportHours,"ReportHours"),billableHours:Ro(t,p?.billableHours,Mo.billableHours,"BillableHours"),amount:Ro(t,p?.amount,Mo.amount,"Amount")}},[t,r?.fieldMapping]),i=er.useMemo(()=>t.map((p,f)=>{let b=Pr(p[a.reportHours]),m=Pr(p[a.billableHours]),v=Pr(p[a.amount]),y=b>0?m/b*100:0;return {id:`graph-row-${f}`,Date:gr(p[a.date],""),Primary:gr(p[a.primaryDimension],n),Secondary:gr(p[a.secondaryDimension],n),Description:gr(p[a.description],""),ReportHours:b,BillableHours:m,Amount:v,Efficiency:y,Status:gr(p[a.status],n)}}),[t,a,n]),s=er.useMemo(()=>{let p=i.length,f=i.reduce((x,h)=>x+Pr(h.ReportHours),0),b=i.reduce((x,h)=>x+Pr(h.BillableHours),0),m=i.reduce((x,h)=>x+Pr(h.Amount),0),v=f>0?b/f*100:0,y=r?.statusFlagValues||["flag","flagged","warning","risk"],g=i.filter(x=>y.includes(gr(x.Status,"").toLowerCase())).length;return {totalRecords:p,totalReportHours:f,totalBillableHours:b,efficiency:v,totalAmount:m,flaggedCount:g}},[i,r?.statusFlagValues]),l=r?.topN||oh,d=er.useMemo(()=>({billableByPrimary:nh(i,"Primary","BillableHours",l,n),efficiencyBySecondary:ah(i,"Secondary","ReportHours","BillableHours",l,n),statusDistribution:ih(i,"Status",n),lineByDate:_p(i,"Date","BillableHours"),comboByPrimary:sh(i,"Primary","ReportHours","BillableHours",l,n),heatmapPrimarySecondary:lh(i,"Primary","Secondary","BillableHours",n),waterfallBillable:ch(i,"Date","BillableHours"),fishboneStatusCauses:dh(i,"Status","Primary","Secondary",3,n)}),[i,l,n]),u=er.useMemo(()=>({title:r?.title||o("graph.reportTitle"),kpis:s,charts:d,table:{columns:[{id:"Date",label:a.date},{id:"Primary",label:a.primaryDimension},{id:"Secondary",label:a.secondaryDimension},{id:"Description",label:a.description},{id:"ReportHours",label:o("graph.column.reportHours"),align:"right"},{id:"BillableHours",label:o("graph.column.billableHours"),align:"right"},{id:"Amount",label:"Amount",align:"right"},{id:"Efficiency",label:"Efficiency",align:"right"},{id:"Status",label:a.status}],rows:i}}),[d,r?.title,a,s,i,o]);return {fieldMapping:a,model:u}};var gn=t=>String(t??"").trim(),Ii=(t={})=>{let[r,o]=er.useState(t),n=er.useCallback((d,u)=>{o(p=>{let f=u?.trim();if(!f){let b={...p};return delete b[d],b}if(p[d]===f){let b={...p};return delete b[d],b}return {...p,[d]:f}});},[]),a=er.useCallback(d=>{o(u=>{if(!u[d])return u;let p={...u};return delete p[d],p});},[]),i=er.useCallback(()=>{o({});},[]),s=er.useMemo(()=>!!(r.primaryDimension||r.secondaryDimension||r.status),[r]),l=er.useCallback((d,u)=>d.filter(p=>!(r.primaryDimension&&gn(p[u.primaryDimension])!==gn(r.primaryDimension)||r.secondaryDimension&&gn(p[u.secondaryDimension])!==gn(r.secondaryDimension)||r.status&&gn(p[u.status])!==gn(r.status))),[r]);return {filters:r,setFilter:n,clearFilter:a,clearAll:i,hasActiveFilters:s,applyRows:l}};P();var Ri=({variants:t,currentVariantId:r,onLoad:o,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=pe(),[l,d]=er.useState(false),[u,p]=er.useState(""),[f,b]=er.useState(false),[m,v]=er.useState(false),y=t.find(h=>h.id===r),g=()=>{p(y?.name||s("variant.newVariant")),b(y?.isDefault||false),v(y?.isPublic||false),d(true);},x=()=>{n({name:u,isDefault:f,isPublic:m,description:""}),d(false);};return c("div",{className:"orb-variant-management",children:[e(zt,{size:"small",fullWidth:false,sx:{width:"min(240px, 100%)","& .orb-inp":{fontSize:"0.85rem",backgroundColor:"var(--orb-p50)",borderColor:"color-mix(in oklch, var(--orb-primary) 30%, var(--orb-border))"}},value:r||"",options:[{value:"",label:s("variant.selectVariant"),disabled:true},...t.map(h=>({value:h.id,label:h.name+(h.isDefault?` (${s("variant.defaultSuffix")})`:"")}))],onChange:h=>{let C=t.find(k=>k.id===h.target.value);C&&o(C);}}),e(ct,{title:s("variant.saveView"),children:e(ae,{className:"orb-variant-save-button",onClick:g,size:"small",color:"primary",children:e(Po,{fontSize:"small"})})}),c(Lt,{open:l,onClose:()=>d(false),children:[e("div",{className:"orb-dialog-title",children:s("variant.saveView")}),c("div",{className:"orb-dialog-content",children:[e(ze,{autoFocus:true,margin:"dense",label:s("variant.viewName"),fullWidth:true,variant:"outlined",value:u,onChange:h=>p(h.target.value)}),e(Qn,{control:e(It,{checked:f,onChange:h=>b(h.target.checked)}),label:s("variant.setDefault")}),e(Qn,{control:e(It,{checked:m,onChange:h=>v(h.target.checked)}),label:s("variant.publicAllUsers")})]}),c("div",{className:"orb-dialog-actions",children:[e(we,{onClick:()=>d(false),children:s("common.cancel")}),e(we,{onClick:x,variant:"contained",children:s("common.save")})]})]})]})};P();var Up=({appId:t,tableKey:r="default",currentFilters:o,currentLayoutId:n,layoutRefs:a,onLoad:i,variantService:s,serviceUrl:l,onError:d,onSuccess:u,currentVariantId:p,onVariantChange:f})=>{let{t:b}=pe(),[m,v]=er.useState([]),[y,g]=er.useState(""),x=`orbcafe.variants.${t}.${r}`,h=p!==void 0?p:y,C=N=>{p===void 0&&g(N),f&&f(N);},k=er.useCallback(()=>{try{let N=localStorage.getItem(x);if(!N)return [];let E=JSON.parse(N);return Array.isArray(E)?E:[]}catch{return []}},[x]),w=er.useCallback(N=>{try{localStorage.setItem(x,JSON.stringify(N));}catch{}},[x]),T=er.useCallback(N=>{v(N);let E=N.find(O=>O.isDefault);E&&!h&&(C(E.id),i(E));},[h,i,C]),I=er.useCallback(async()=>{if(!t)return [];try{let N=[];if(s)N=await s.getVariants(t,r);else if(l){let E=await fetch(`${l}/api/variants?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(r)}`);if(!E.ok)throw new Error(b("variant.toast.fetchFailed"));N=await E.json();}else N=k();return T(N),N}catch(N){console.error("Error fetching variants",N);let E=k();return T(E),d&&d(b("variant.toast.fetchFailed")),E}},[t,r,s,l,k,T,d,b]);return er.useEffect(()=>{I();},[t,r]),e(Ri,{variants:m,currentVariantId:h,onLoad:N=>{C(N.id),i(N);},onSave:async N=>{let E=Date.now().toString(),O;try{let F=N.scope||"Both",_=m.find(j=>j.name===N.name);E=_?_.id:Date.now().toString();let B=[];if(_&&(Array.isArray(_.filters)?B=[..._.filters]:_.filters&&(B=[{scope:"default",filters:_.filters}])),F==="Search"||F==="Both"){let j=(Array.isArray(o),o);if(j)if(Array.isArray(j)&&j.length>0&&j[0].scope)j.forEach(V=>{let z=B.findIndex(K=>K.scope===V.scope);z>=0?B[z]=V:B.push(V);});else {let V={scope:r,filters:j},z=B.findIndex(K=>K.scope===r);z>=0?B[z]=V:B.push(V);}}let Y=_?.layout||{},W=[];if(_&&Array.isArray(_.layoutRefs)&&(W=[..._.layoutRefs]),F==="Layout"||F==="Both")if(a&&a.length>0)a.forEach(j=>{let V=W.findIndex(z=>z.tableKey===j.tableKey);V>=0?W[V]=j:W.push(j);});else {let j={tableKey:r,layoutId:n||null},V=W.findIndex(z=>z.tableKey===r);V>=0?W[V]=j:W.push(j);}if(O={appId:t,tableKey:r,...N,scope:F,id:E,createdAt:new Date().toISOString(),filters:B,layout:Y,layoutRefs:W},s)await s.saveVariant(O,t,r);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})).ok)throw new Error(b("variant.toast.saveFailed"))}else {let V=m.some(z=>z.id===E)?m.map(z=>z.id===E?O:z):[...m,O];v(V),w(V);}u&&u(b("variant.toast.saveSuccess")),(s||l)&&await I(),C(E),i(O);}catch(F){console.error("Error saving variant",F);let B=m.some(Y=>Y.id===E)?m.map(Y=>Y.id===E?O:Y):[...m,O];v(B),w(B),C(E),i(O),d&&d(b("variant.toast.saveFailed"));}},onDelete:async N=>{try{if(s)await s.deleteVariant(N);else if(l){if(!(await fetch(`${l}/api/variants/${N}`,{method:"DELETE"})).ok)throw new Error(b("variant.toast.deleteFailed"))}else {let E=m.filter(O=>O.id!==N);v(E),w(E);}h===N&&C(""),(s||l)&&I(),u&&u(b("variant.toast.deleteSuccess"));}catch(E){console.error("Error deleting variant",E);let O=m.filter(F=>F.id!==N);v(O),w(O),h===N&&C(""),d&&d(b("variant.toast.deleteFailed"));}},onSetDefault:async N=>{try{let E=m.find(F=>F.id===N);if(!E)return;let O={appId:t,tableKey:r,...E,isDefault:!0};if(s)await s.setDefaultVariant(N,t,r);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})).ok)throw new Error(b("variant.toast.defaultFailed"))}else {let F=m.map(_=>({..._,isDefault:_.id===N}));v(F),w(F);}(s||l)&&await I(),u&&u(b("variant.toast.defaultSuccess"));}catch(E){console.error("Error setting default variant",E);let O=m.map(F=>({...F,isDefault:F.id===N}));v(O),w(O),d&&d(b("variant.toast.defaultFailed"));}}})};P();oo__default.default.extend(bh__default.default);oo__default.default.extend(hh__default.default);oo__default.default.extend(rb__default.default);var aa="YYYY-MM-DD",yh=[null,null],Vo="0.85rem",Ch={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},xh=({isInRange:t,isStart:r,isEnd:o,isHovered:n,disableMargin:a,sx:i,...s})=>{let l=sr();return e(Od,{...s,sx:[...Array.isArray(i)?i:i?[i]:[],t?{borderRadius:0,backgroundColor:l.palette.primary.light,color:l.palette.primary.contrastText}:{},n&&!t&&!r&&!o?{borderRadius:0,backgroundColor:l.palette.action.hover,border:`1px dashed ${l.palette.primary.main}`}:{},r?{borderRadius:"50% 0 0 50%",backgroundColor:l.palette.primary.main,color:l.palette.primary.contrastText}:{},o?{borderRadius:"0 50% 50% 0",backgroundColor:l.palette.primary.main,color:l.palette.primary.contrastText}:{},r&&o?{borderRadius:"50%"}:{}]})},qp=({label:t,value:r=yh,onChange:o})=>{let{t:n,locale:a}=pe(),i=Ch[a]||"en",s=t||n("dateRange.label"),[l,d]=er.useState(null),[u,p]=er.useState(r),[f,b]=er.useState("start"),[m,v]=er.useState(null),[y,g]=er.useState((r[0]||oo__default.default()).locale(i)),[x,h]=er.useState(""),[C,k]=er.useState(""),[w,T]=er.useState(false),[I,S]=er.useState(false),A=er__namespace.default.useRef(r);er.useEffect(()=>{let[j,V]=r,[z,K]=A.current,q=ue=>ue&&typeof ue.isSame=="function",fe=!(j===null&&z===null||q(j)&&q(z)&&j.isSame(z,"day")),se=!(V===null&&K===null||q(V)&&q(K)&&V.isSame(K,"day"));(fe||se)&&(p(r),r[0]&&q(r[0])&&g(r[0].locale(i))),A.current=r;},[r,i]),er.useEffect(()=>{h(u[0]?u[0].locale(i).format(aa):""),k(u[1]?u[1].locale(i).format(aa):""),T(false),S(false);},[u,i]);let R=(j,V)=>{let z=V.trim(),K=j==="start"?T:S;if(!z){let se=j==="start"?[null,u[1]]:[u[0],null];K(false),p(se);return}let q=oo__default.default(z,aa,true).locale(i);if(!q.isValid()){K(true);return}K(false);let fe=[...u];if(j==="start")fe[0]=q,fe[1]&&q.isAfter(fe[1],"day")&&(fe[1]=null),b(fe[1]?"start":"end");else {let se=fe[0];se&&q.isBefore(se,"day")?(fe=[q,null],b("end")):(fe[1]=q,b("start"));}p(fe),g(q);},M=j=>{d(j.currentTarget);},N=()=>{d(null),b("start"),v(null);},E=!!l,O=j=>{if(!j)return;let V=[...u];if(f==="start")V=[j,null],b("end");else {let z=V[0];z&&j.isBefore(z)?(V=[j,null],b("end")):(V=[z,j],b("start"));}p(V);},F=j=>{let V=oo__default.default().locale(i),z=[null,null];switch(j){case "today":z=[V,V];break;case "week":z=[V.startOf("week"),V.endOf("week")];break;case "month":z=[V.startOf("month"),V.endOf("month")];break}p(z),b("start"),g(V);},_=()=>{o&&o(u),N();},B=()=>{p(r),b("start"),N();},Y=er.useCallback(j=>{let{day:V,...z}=j,[K,q]=u,fe=K?V.isSame(K,"day"):false,se=q?V.isSame(q,"day"):false,ue=K&&q?V.isBetween(K,q,"day","()"):false,Se=false;return f==="end"&&K&&!q&&m&&V.isAfter(K,"day")&&V.isBefore(m.add(1,"day"),"day")&&(Se=true),e(xh,{...z,day:V,disableMargin:true,isStart:fe,isEnd:se,isInRange:ue||Se,onMouseEnter:()=>v(V)})},[u,f,m]),W=j=>j?j.locale(i).format("YYYY-MM-DD"):"";return c("div",{className:"orb-date-range-picker",children:[e(ze,{className:"orb-date-range-field",label:s,value:u[0]?`${W(u[0])} - ${W(u[1])}`:"",onClick:M,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Vo}},InputProps:{readOnly:true,sx:{fontSize:Vo,"& .orb-inp":{fontSize:Vo},paddingRight:"4px"},endAdornment:e(ae,{className:"orb-date-range-calendar-trigger",size:"small",onClick:M,tooltip:s,children:e(Tt,{name:"calendar",size:16})})}}),c(ti,{open:E,anchorEl:l,onClose:N,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},className:"orb-date-range-popover",children:[e("div",{className:"orb-date-range-inputs",children:c(ie,{className:"orb-date-range-input-row",direction:"row",alignItems:"center",spacing:1.5,justifyContent:"space-between",children:[e(ze,{className:"orb-date-range-manual-field",label:n("dateRange.startDate"),placeholder:aa,value:x,error:w,size:"small",onFocus:()=>b("start"),onChange:j=>{h(j.target.value),w&&T(false);},onBlur:()=>R("start",x),onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),R("start",x));},sx:{"& .orb-inp":{fontSize:Vo,py:.75},"& label":{fontSize:Vo}}}),e(zd,{color:"action",fontSize:"small"}),e(ze,{className:"orb-date-range-manual-field",label:n("dateRange.endDate"),placeholder:aa,value:C,error:I,size:"small",onFocus:()=>{u[0]&&b("end");},onChange:j=>{k(j.target.value),I&&S(false);},onBlur:()=>R("end",C),onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),R("end",C));},sx:{"& .orb-inp":{fontSize:Vo,py:.75},"& label":{fontSize:Vo}}})]})}),e("div",{className:"orb-date-range-shortcuts",children:c(ie,{direction:"row",spacing:1,justifyContent:"center",children:[e(xt,{label:n("dateRange.today"),onClick:()=>F("today"),clickable:true,size:"small",variant:"outlined"}),e(xt,{label:n("dateRange.thisWeek"),onClick:()=>F("week"),clickable:true,size:"small",variant:"outlined"}),e(xt,{label:n("dateRange.thisMonth"),onClick:()=>F("month"),clickable:true,size:"small",variant:"outlined"})]})}),e("div",{className:"orb-date-range-calendar",children:e(Bd,{dateAdapter:ja,adapterLocale:i,children:e(Fd,{value:null,referenceDate:y,onMonthChange:g,onYearChange:g,onChange:O,slots:{day:Y},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true})})}),e(Dt,{}),c(ie,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[e(we,{size:"small",onClick:B,color:"inherit",children:n("common.cancel")}),e(we,{size:"small",variant:"contained",onClick:_,children:n("common.done")})]})]})]})};P();var Ni={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},kh={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"},Ph=["contains","notContains",">",">=","<","<=","equals"],Yp=["=","!=",">","<",">=","<=","between"],or="0.85rem",Th=({field:t,value:r,onChange:o})=>{let{t:n}=pe(),[a,i]=er.useState(null),[s,l]=er.useState(null),[d,u]=er.useState(null),[p,f]=er.useState(""),[b,m]=er.useState(""),[v,y]=er.useState(""),[g,x]=er.useState("");er.useEffect(()=>{let M=setTimeout(()=>{x(v);},1e3);return ()=>clearTimeout(M)},[v]);let h=r?.operator||(t.type==="number"?"=":"equals"),C=r?.value,k=M=>{let N=kh[M];return N?n(N):M},w=M=>{i(a?null:M.currentTarget);},T=M=>{o({...r,operator:M,value:C}),i(null);},I={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:or}},InputProps:{sx:{fontSize:or}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:or,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},S=t.type||"text";if(S==="date"){let N=(E=>{if(!E)return [null,null];if(Array.isArray(E)&&E.length===2){let O=E[0]?oo__default.default.isDayjs(E[0])?E[0]:oo__default.default(E[0]):null,F=E[1]?oo__default.default.isDayjs(E[1])?E[1]:oo__default.default(E[1]):null;return [O,F]}return oo__default.default.isDayjs(E)||typeof E=="string"?[oo__default.default.isDayjs(E)?E:oo__default.default(E),null]:[null,null]})(C);return e(qp,{label:t.label,value:N,onChange:E=>o({value:E,operator:"between"})})}if(S==="number"&&h==="between"){let M=()=>{o({value:[p,b],operator:"between"}),l(null);},N=Array.isArray(C)?`${C[0]||""} - ${C[1]||""}`:"";return c(jsxRuntime.Fragment,{children:[e(ze,{...I,label:t.label,value:N,placeholder:n("smartFilter.minMaxPlaceholder"),InputProps:{...I.InputProps,startAdornment:e(so,{position:"start",children:e(ct,{title:k("between"),children:e(ae,{size:"small",onClick:w,sx:{width:24,height:24,fontSize:or},children:Ni.between})})}),readOnly:true},onClick:E=>l(s?null:E.currentTarget)}),e(Qt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:or,minHeight:"auto",py:.5}}},children:Yp.map(E=>c("option",{selected:E===h,onClick:()=>T(E),children:[e("div",{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Ni[E]}),e(Gt,{primary:k(E),primaryTypographyProps:{fontSize:or}})]},E))}),e(ti,{open:!!s,anchorEl:s,onClose:()=>l(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:c("div",{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[e(ze,{size:"small",label:n("smartFilter.min"),type:"number",value:p,onChange:E=>f(E.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:or}},InputProps:{sx:{fontSize:or}}}),e(Vd,{color:"action"}),e(ze,{size:"small",label:n("smartFilter.max"),type:"number",value:b,onChange:E=>m(E.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:or}},InputProps:{sx:{fontSize:or}}}),e(we,{variant:"contained",size:"small",onClick:M,children:n("common.ok")})]})})]})}if(t.isValueHelp||S==="value-help"){let M=t.valueHelp?.mode||"single";return e(wp,{...I,...t.valueHelp,label:t.label,placeholder:t.placeholder||t.valueHelp?.placeholder,value:C??(M==="multiple"?[]:null),mode:M,onChange:N=>o({value:N,operator:M==="multiple"?"anyOf":"equals"})})}if(S==="select")return c(zt,{size:"small",fullWidth:true,label:t.label,value:C||"",onChange:M=>o({...r,value:M.target.value,operator:"equals"}),children:[e("option",{value:"",children:n("common.none")}),t.options?.map(M=>e("option",{value:M.value,children:M.label},M.value))]});if(S==="multi-select"){let M=Array.isArray(C)?C:[],N=t.options?.filter(Y=>Y.label.toLowerCase().includes(g.toLowerCase()))||[],E=Y=>t.options?.find(W=>W.value===Y)?.label||Y,O=M.map(E),F=O.length===0?n("common.none"):O.length>2?`${O.slice(0,2).join(", ")} +${O.length-2}`:O.join(", "),_=()=>{u(null),y(""),x("");},B=Y=>{let W=M.includes(Y)?M.filter(j=>j!==Y):[...M,Y];o({...r,value:W,operator:"anyOf"});};return c("div",{className:"orb-fld",children:[e("label",{children:t.label}),c(we,{variant:"outlined",size:"small",onClick:Y=>u(d?null:Y.currentTarget),sx:{width:"100%",minHeight:36,justifyContent:"space-between",fontSize:or,fontWeight:400},children:[e("span",{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F}),e(Vr,{fontSize:"small"})]}),e(Qt,{anchorEl:d,open:!!d,onClose:_,PaperProps:{sx:{width:280,maxHeight:340,overflowY:"auto",p:.5}},children:c("div",{onClick:Y=>Y.stopPropagation(),sx:{display:"grid",gap:.35},children:[e(ze,{size:"small",autoFocus:true,placeholder:n("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:e(so,{position:"start",children:e(zo,{fontSize:"small"})}),sx:{fontSize:or}},value:v,onChange:Y=>y(Y.target.value),onKeyDown:Y=>Y.stopPropagation()}),N.length>0?N.map(Y=>{let W=M.includes(Y.value);return c("div",{role:"option","aria-selected":W,tabIndex:0,className:`orb-menu-item ${W?"orb-selected":""}`,onClick:()=>B(Y.value),onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),B(Y.value));},children:[e(It,{checked:W,size:"small",inputProps:{tabIndex:-1},sx:{pointerEvents:"none"}}),e(Gt,{primary:Y.label})]},String(Y.value))}):e("div",{className:"orb-menu-item","aria-disabled":"true",children:n("smartFilter.noOptionsFound")})]})})]})}let A=S==="number"?Yp:Ph;return c(jsxRuntime.Fragment,{children:[e(ze,{...I,className:"orb-filter-operator-field",label:t.label,sx:{minWidth:"120px"},value:C||"",type:S==="number"?"number":"text",onChange:M=>o({...r,value:M.target.value,operator:h}),InputProps:{...I.InputProps,startAdornment:e(so,{position:"start",children:e(ct,{title:k(h),children:e(ae,{className:"orb-filter-operator-trigger",size:"small",onClick:w,onMouseDown:M=>M.preventDefault(),sx:{width:24,height:24,fontSize:or,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Ni[h]})})}),endAdornment:t.hasSearchIcon?e(so,{position:"end",children:e(zo,{color:"action"})}):void 0}}),e(Qt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:or,minHeight:"auto",py:.5}}},children:A.map(M=>c("option",{selected:M===h,onClick:()=>T(M),children:[e("span",{className:"orb-filter-operator-symbol",children:Ni[M]}),e(Gt,{primary:k(M),primaryTypographyProps:{fontSize:or}})]},M))})]})},Wr=({fields:t,filters:r,onFilterChange:o,variants:n=[],currentVariantId:a,onVariantLoad:i,onVariantSave:s,onVariantDelete:l,onVariantSetDefault:d,onSearch:u,loading:p=false,appId:f,tableKey:b,currentLayout:m,currentLayoutId:v,layoutRefs:y,variantService:g,serviceUrl:x})=>{let{t:h}=pe(),[C,k]=er.useState(true),[w,T]=er.useState(null),[I,S]=er.useState(t.filter(N=>!N.hidden).map(N=>N.id)),A=(N,E)=>{o({...r,[N]:E});},R=N=>{I.includes(N)?S(I.filter(E=>E!==N)):S([...I,N]);};return c(Ae,{className:`orb-smart-filter ${C?"orb-smart-filter-expanded":"orb-smart-filter-collapsed"}`,sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[C?c(jsxRuntime.Fragment,{children:[c("div",{className:"orb-smart-filter-header",children:[f?e(Up,{appId:f,tableKey:b,currentFilters:{values:r,visibleFields:I},currentLayout:m,currentLayoutId:v,layoutRefs:y,onLoad:N=>{if(!N.filters)return;let E=null;if(Array.isArray(N.filters)){let O=b||"default",F=N.filters.find(_=>_.scope===O);E=F?F.filters:null;}else E=N.filters;E&&(E.values||E.visibleFields?(E.visibleFields&&Array.isArray(E.visibleFields)&&S(E.visibleFields),E.values&&o(E.values)):o(E)),i&&i(N);},variantService:g,serviceUrl:x,currentVariantId:a}):e(Ri,{variants:n,currentVariantId:a,onLoad:i,onSave:N=>{s&&s({...N,filters:{values:r,visibleFields:I}});},onDelete:l,onSetDefault:d}),c("div",{className:"orb-smart-filter-actions",children:[e(ct,{title:h("smartFilter.addFilters"),children:e(we,{className:"orb-smart-filter-adapt",onClick:N=>T(w?null:N.currentTarget),size:"small",color:"primary",startIcon:e(pp,{fontSize:"small"}),sx:{textTransform:"none",fontSize:or,whiteSpace:"nowrap",minWidth:"fit-content"},children:h("smartFilter.adaptFilters")})}),e(ae,{className:"orb-smart-filter-go",tooltip:h("smartFilter.go"),"aria-label":h("smartFilter.go"),onClick:u,disabled:p,children:p?e(Xr,{size:16}):e(Tt,{name:"play",size:16})}),c(Qt,{anchorEl:w,open:!!w,onClose:()=>T(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .orb-menu-item, & option":{fontSize:or,minHeight:32}}}},children:[e("option",{disabled:true,children:e(Gt,{primary:h("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:or}})}),e(Dt,{}),t.map(N=>c("option",{onClick:()=>R(N.id),children:[e(It,{checked:I.includes(N.id),size:"small"}),e(Gt,{primary:N.label,primaryTypographyProps:{fontSize:or}})]},N.id))]})]})]}),e("div",{className:"orb-smart-filter-grid",children:e(tl,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:t.filter(N=>I.includes(N.id)).map(N=>e(tl,{size:1,children:e(Th,{field:N,value:r[N.id]||{value:"",operator:N.type==="number"?"=":"equals"},onChange:E=>A(N.id,E)})},N.id))})})]}):null,e("div",{className:"orb-smart-filter-toggle",children:e(ae,{className:"orb-smart-filter-toggle-button",size:"small",onClick:()=>k(!C),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:30,height:30,minWidth:30,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:C?e(ai,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"}):e(Vr,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"})})})]})};P();var Zp=({layouts:t,currentLayoutId:r,onLoad:o,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=pe(),[l,d]=er.useState(null),[u,p]=er.useState(false),[f,b]=er.useState(""),[m,v]=er.useState(""),[y,g]=er.useState({isDefault:false,isPublic:false}),x=t.find(I=>I.id===r),h=I=>{d(I.currentTarget);},C=()=>{d(null);},k=I=>{o(I),C();},w=()=>{b(""),v(""),g({isDefault:false,isPublic:false}),p(true),C();},T=()=>{f.trim()&&(n({name:f,description:m,...y}),p(false));};return c("div",{className:"orb-layout-actions",sx:{display:"flex",alignItems:"center",gap:.25},children:[e(ct,{title:s("layout.layoutOptions"),children:e(ae,{onClick:h,color:x?"primary":"default",size:"small",children:e(hp,{fontSize:"small"})})}),c(Qt,{anchorEl:l,open:!!l,onClose:C,align:"end",PaperProps:{sx:{width:320,maxHeight:400}},children:[e("option",{disabled:true,children:e(L,{variant:"caption",children:s("layout.selectLayout")})}),c("option",{onClick:w,children:[e(zr,{children:e(Po,{fontSize:"small"})}),e(Gt,{children:s("layout.saveCurrentLayout")})]}),e(Dt,{}),t.length===0&&e("option",{disabled:true,children:e(L,{variant:"body2",color:"text.secondary",children:s("layout.noSavedLayouts")})}),t.map((I,S)=>e("option",{onClick:()=>k(I),selected:I.id===r,children:c("div",{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[c("div",{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[e("div",{sx:{display:"flex",alignItems:"center",gap:1},children:e(L,{variant:"body2",fontWeight:I.id===r?"bold":"normal",noWrap:true,children:I.name})}),I.description&&e(L,{variant:"caption",color:"text.secondary",noWrap:true,children:I.description})]}),c("div",{sx:{display:"flex",alignItems:"center"},onClick:A=>A.stopPropagation(),children:[e(ct,{title:I.isDefault?s("layout.removeDefault"):s("layout.setAsDefault"),children:e(ae,{size:"small",onClick:A=>{A.stopPropagation(),i(I.id);},children:I.isDefault?e(gp,{fontSize:"small",color:"warning"}):e(mp,{fontSize:"small"})})}),e(ct,{title:s("common.delete"),children:e(ae,{size:"small",color:"error",onClick:A=>{A.stopPropagation(),a(I.id);},children:e(oi,{fontSize:"small"})})})]})]})},I.id||S))]}),e(Lt,{open:u,onClose:()=>p(false),maxWidth:"xs",fullWidth:true,className:"orb-layout-save-dialog",title:s("layout.saveLayout"),actions:c(jsxRuntime.Fragment,{children:[e(we,{variant:"ghost",onClick:()=>p(false),children:s("common.cancel")}),e(we,{onClick:T,variant:"primary",disabled:!f.trim(),children:s("common.save")})]}),children:c("div",{className:"orb-layout-save-form",children:[e(ze,{label:s("layout.layoutName"),value:f,onChange:I=>b(I.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:s("layout.layoutNameHelper")}),t.some(I=>I.name===f)&&e(L,{className:"orb-layout-save-warning",variant:"caption",color:"warning.main",children:s("layout.warningOverwrite")}),e(ze,{label:s("layout.layoutDescription"),value:m,onChange:I=>v(I.target.value),fullWidth:true,size:"small"}),e(It,{className:"orb-layout-save-option",checked:y.isDefault,onChange:I=>g({...y,isDefault:I.target.checked}),label:s("layout.useAsDefault")}),e(It,{className:"orb-layout-save-option",checked:y.isPublic,onChange:I=>g({...y,isPublic:I.target.checked}),label:s("layout.publicAllUsers")})]})})]})};P();var bn=({appId:t,tableKey:r="default",currentLayoutData:o,onLayoutLoad:n,targetLayoutId:a,activeLayoutId:i,serviceUrl:s,onError:l,onSuccess:d})=>{let{t:u}=pe(),[p,f]=er.useState([]),[b,m]=er.useState(""),v=`orbcafe.layouts.${t}.${r}`,y=S=>({id:S.layoutId,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt??new Date().toISOString(),layoutData:S.layout??{}}),g=S=>({appId:t,tableKey:r,layoutId:S.id,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt,layout:S.layoutData}),x=er.useCallback(()=>{try{let S=localStorage.getItem(v);if(!S)return [];let A=JSON.parse(S);return Array.isArray(A)?A:[]}catch{return []}},[v]),h=er.useCallback(S=>{try{localStorage.setItem(v,JSON.stringify(S));}catch{}},[v]);er.useEffect(()=>{i!==void 0&&m(i);},[i]),er.useEffect(()=>{if(a&&p.length>0){let S=p.find(A=>A.id===a);S&&(m(S.id),n(S));}},[a,p,n]);let C=er.useCallback(async()=>{if(t){if(!s){let S=x();f(S);let A=S.find(R=>R.isDefault);A&&!b&&!a&&(m(A.id),n(A));return}try{let S=await fetch(`${s}/api/layouts?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(r)}`);if(!S.ok)throw new Error("LAYOUT_FETCH_FAILED");let R=(await S.json()).map(y);f(R);let M=R.find(N=>N.isDefault);M&&!b&&!a&&(m(M.id),n(M));}catch(S){console.error("Error fetching layouts",S);let A=x();f(A);let R=A.find(M=>M.isDefault);R&&!b&&!a&&(m(R.id),n(R)),l&&l(u("layout.toast.loadFallback"));}}},[t,r,s,l,b,n,a,x,u]);return er.useEffect(()=>{C();},[t,r]),e(Zp,{layouts:p,currentLayoutId:b,onLoad:S=>{m(S.id),n(S);},onSave:async S=>{let A=p.find(N=>N.name===S.name),R=A?A.id:Date.now().toString(),M={id:R,...S,createdAt:new Date().toISOString(),layoutData:o,isDefault:S.isDefault??false,isPublic:S.isPublic??false};if(!s){let E=p.some(O=>O.id===R)?p.map(O=>O.id===R?M:O):[...p,M];f(E),h(E),m(R),n(M),d&&d(u("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g(M))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(u("layout.toast.saveSuccess")),await C(),m(R),n(M);}catch(N){console.error("Error saving layout",N);let O=p.some(F=>F.id===R)?p.map(F=>F.id===R?M:F):[...p,M];f(O),h(O),m(R),n(M),d&&d(u("layout.toast.saveLocalSuccess")),l&&l(u("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async S=>{if(!s){let A=p.filter(R=>R.id!==S);f(A),h(A),b===S&&m(""),d&&d(u("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts/${encodeURIComponent(S)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");b===S&&m(""),d&&d(u("layout.toast.deleteSuccess")),await C();}catch(A){console.error("Error deleting layout",A);let R=p.filter(M=>M.id!==S);f(R),h(R),b===S&&m(""),d&&d(u("layout.toast.deleteLocalSuccess")),l&&l(u("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async S=>{if(!s){let A=p.map(R=>({...R,isDefault:R.id===S}));f(A),h(A),d&&d(u("layout.toast.defaultLocalSuccess"));return}try{let A=p.find(M=>M.id===S);if(!A)return;if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g({...A,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(u("layout.toast.defaultSuccess")),await C();}catch(A){console.error("Error setting default",A);let R=p.map(M=>({...M,isDefault:M.id===S}));f(R),h(R),d&&d(u("layout.toast.defaultLocalSuccess")),l&&l(u("layout.toast.backendUnavailableDefaultLocal"));}}})};var Ai=(t,r)=>{if(!t||!t.filters)return null;if(Array.isArray(t.filters)){let o=t.filters.find(a=>a.scope===r);if(o)return o.filters;let n=t.filters.find(a=>a.scope==="default");return n?n.filters:null}return typeof t.filters=="object"?t.filters:null},Ei=(t,r)=>{if(!t)return {layout:null,layoutId:null};let o=null,n=null;if(Array.isArray(t.layoutRefs)){let a=t.layoutRefs.find(i=>i.tableKey===r);a&&(o=a.layoutId);}return !o&&t.layoutId&&(o=t.layoutId),t.layout&&typeof t.layout=="object"&&!Array.isArray(t.layout)&&(n=t.layout),{layoutId:o,layout:n}};function Qp(t,r,o){return r[o]<t[o]?-1:r[o]>t[o]?1:0}function Ih(t,r){return t==="desc"?(o,n)=>Qp(o,n,r):(o,n)=>-Qp(o,n,r)}function Mh(t,r){let o=t.map((n,a)=>[n,a]);return o.sort((n,a)=>{let i=r(n[0],a[0]);return i!==0?i:n[1]-a[1]}),o.map(n=>n[0])}var hn=t=>{let r=!!t.disableGrouping,o=!!t.disableSorting,n=er.useCallback(Z=>{let Q=String(Z?.label??Z?.id??"").length*9+64,be=typeof Z?.minWidth=="number"?Z.minWidth:0;return Math.max(100,be,Q)},[]),a=er.useCallback(()=>(t.columns||[]).filter(Z=>!!Z?.numeric).map(Z=>Z.id),[t.columns]),[i,s]=er.useState(""),[l,d]=er.useState(t.order||"asc"),[u,p]=er.useState(t.orderBy||""),[f,b]=er.useState([]),[m,v]=er.useState(t.page||0),[y,g]=er.useState(t.rowsPerPage||20),[x,h]=er.useState(t.selected||[]),[C,k]=er.useState(t.columns?t.columns.map(Z=>Z.id):[]),[w,T]=er.useState(t.columns?t.columns.map(Z=>Z.id):[]),[I,S]=er.useState(t.showSummary||false),[A,R]=er.useState(()=>a()),[M,N]=er.useState([]),[E,O]=er.useState(new Set),[F,_]=er.useState(()=>{let Z={};return (t.columns||[]).forEach($=>{Z[$.id]=n($);}),Z}),[B,Y]=er.useState(null),[W,j]=er.useState(null),[V,z]=er.useState(null),[K,q]=er.useState(null),[fe,se]=er.useState(false),[ue,Se]=er.useState(""),[$e,ke]=er.useState(""),le=r?[]:M,Ee=er.useCallback(Z=>{if(r){N([]),O(new Set),j(null);return}N(Z);},[r]);er.useEffect(()=>{r&&(N([]),O(new Set),j(null));},[r]),er.useEffect(()=>{o&&(d("asc"),p(""),b([]));},[o]),er.useEffect(()=>{t.layout&&wt(t.layout);},[t.layout]),er.useEffect(()=>{if(o){d("asc"),p("");return}t.order!==void 0&&d(t.order),t.orderBy!==void 0&&p(t.orderBy);},[t.order,t.orderBy,o]),er.useEffect(()=>{t.selected!==void 0&&h(t.selected);},[t.selected]),er.useEffect(()=>{t.page!==void 0&&v(t.page);},[t.page]),er.useEffect(()=>{t.rowsPerPage!==void 0&&g(t.rowsPerPage);},[t.rowsPerPage]),er.useEffect(()=>{let Z=a();R($=>$.filter(be=>Z.includes(be)));},[a]),er.useEffect(()=>{_(Z=>{let $={...Z};return (t.columns||[]).forEach(Q=>{$[Q.id]===void 0&&($[Q.id]=n(Q));}),$});},[t.columns,n]),er.useEffect(()=>{T(Z=>{let $=(t.columns||[]).map(qe=>qe.id),Q=new Set($),be=Z.filter(qe=>Q.has(qe)),Ce=new Set(be),Le=$.filter(qe=>!Ce.has(qe)),_e=[...be,...Le];return _e.length===Z.length&&_e.every((qe,je)=>qe===Z[je])?Z:_e});},[t.columns]);let Me=er.useMemo(()=>{let Z=t.columns||[];if(w.length===0)return Z;let $=new Map(Z.map(Ce=>[Ce.id,Ce])),Q=[],be=new Set;return w.forEach(Ce=>{let Le=$.get(Ce);Le&&(Q.push(Le),be.add(Ce));}),Z.forEach(Ce=>{be.has(Ce.id)||Q.push(Ce);}),Q},[t.columns,w]),Pe=er.useMemo(()=>{let Z=t.rows||[];return i&&(Z=Z.filter($=>Object.keys($).some(Q=>String($[Q]).toLowerCase().includes(i.toLowerCase())))),Z},[t.rows,i]),Ve=er.useMemo(()=>{if(o||t.onSortChange)return Pe;if(f.length>0){let Z=[...Pe];return Z.sort(($,Q)=>{for(let be of f){let Ce=$?.[be.field],Le=Q?.[be.field];if(!(Ce==null&&Le==null)){if(Ce==null)return be.direction==="asc"?-1:1;if(Le==null)return be.direction==="asc"?1:-1;if(Ce<Le)return be.direction==="asc"?-1:1;if(Ce>Le)return be.direction==="asc"?1:-1}}return 0}),Z}return u?Mh(Pe,Ih(l,u)):Pe},[Pe,l,u,f,t.onSortChange,o]),tt=er.useCallback(Z=>{if(le.length===0)return Z.map(Le=>({type:"row",data:Le,id:Le[t.rowKey||"id"]}));let $=[...Z].sort((Le,_e)=>{for(let qe of le){if(Le[qe]<_e[qe])return -1;if(Le[qe]>_e[qe])return 1}return 0}),Q=(Le,_e=0)=>{if(_e>=le.length)return Le;let qe=le[_e],je={},mt=[];return Le.forEach(ft=>{let Rt=ft[qe],yt=`${qe}:${Rt}`;je[yt]||(je[yt]={key:yt,field:qe,value:Rt,children:[],count:0,level:_e},mt.push(je[yt])),je[yt].children.push(ft),je[yt].count++;}),mt.forEach(ft=>{ft.children&&(ft.children=Q(ft.children,_e+1));}),mt},be=Q($),Ce=(Le,_e="")=>{let qe=[];return Le.forEach(je=>{if(je.children){let mt=_e?`${_e}>${je.key}`:je.key,ft=E.has(mt);qe.push({type:"group",id:mt,field:je.field,value:je.value,level:je.level,count:je.count,isExpanded:ft,childIds:(function Rt(yt){let H=[];return yt.children.forEach(J=>{J.children?H=H.concat(Rt(J)):H.push(J[t.rowKey||"id"]);}),H})(je)}),ft&&(qe=qe.concat(Ce(je.children,mt)));}else qe.push({type:"row",data:je,id:je[t.rowKey||"id"],level:le.length});}),qe};return Ce(be)},[le,E,t.rowKey]),nt=er.useCallback(Z=>{if(le.length===0)return [];let $=[...Z].sort((Ce,Le)=>{for(let _e of le){if(Ce[_e]<Le[_e])return -1;if(Ce[_e]>Le[_e])return 1}return 0}),Q=[],be=(Ce,Le,_e)=>{if(Le>=le.length)return;let qe=le[Le],je=new Map;Ce.forEach(mt=>{let ft=mt[qe],Rt=je.get(ft);Rt?Rt.push(mt):je.set(ft,[mt]);}),je.forEach((mt,ft)=>{let Rt=`${qe}:${ft}`,yt=_e?`${_e}>${Rt}`:Rt;Q.push(yt),be(mt,Le+1,yt);});};return be($,0,""),Q},[le]),it=er.useMemo(()=>tt(Ve),[Ve,tt]),X=er.useMemo(()=>nt(Ve),[Ve,nt]),De=er.useMemo(()=>{let Z=(t.rows||[]).length;return typeof t.count=="number"&&t.count>Z},[t.count,t.rows]),ye=er.useMemo(()=>De?it:y>0?it.slice(m*y,m*y+y):it,[it,m,y,De]),Be=er.useMemo(()=>De&&typeof t.count=="number"?t.count:it.length,[it.length,De,t.count]),at=Z=>{O($=>{let Q=new Set($);return Q.has(Z)?Q.delete(Z):Q.add(Z),Q});},Ze=Z=>{let $=X.filter(Q=>Q===Z||Q.startsWith(`${Z}>`));O(Q=>{let be=new Set(Q);return $.forEach(Ce=>be.add(Ce)),be});},St=Z=>{O($=>{let Q=new Set($);return Array.from(Q).forEach(be=>{(be===Z||be.startsWith(`${Z}>`))&&Q.delete(be);}),Q});},Mt=Z=>{if(!Z){O(new Set);return}O(new Set(X));},Ot=Z=>{let $=X.filter(Q=>Q.startsWith(`${Z}>`));return $.length===0?E.has(Z):E.has(Z)&&$.every(Q=>E.has(Q))},At=Z=>{if(o)return;f.length>0&&b([]);let $=u===Z&&l==="asc",Q=u===Z&&l==="desc";if(t.onSortChange){$?t.onSortChange(Z,"desc"):Q?t.onSortChange("","asc"):t.onSortChange(Z,"asc");return}$?(d("desc"),p(Z)):Q?(d("asc"),p("")):(d("asc"),p(Z));},re=Z=>{if(o){d("asc"),p(""),b([]);return}let $=Z.filter(Q=>Q&&Q.field);b($),$.length>0&&p("");},Ke=()=>{b([]);},Fe=(Z,$)=>{_(Q=>({...Q,[Z]:$}));},ce=Z=>{if(Z.target.checked){let $=Pe.map(Q=>Q[t.rowKey||"id"]);h($),t.onSelectionChange&&t.onSelectionChange($);return}h([]),t.onSelectionChange&&t.onSelectionChange([]);},ve=(Z,$)=>{let Q=$[t.rowKey||"id"],be=x.indexOf(Q),Ce=[];be===-1?Ce=Ce.concat(x,Q):be===0?Ce=Ce.concat(x.slice(1)):be===x.length-1?Ce=Ce.concat(x.slice(0,-1)):be>0&&(Ce=Ce.concat(x.slice(0,be),x.slice(be+1))),h(Ce),t.onSelectionChange&&t.onSelectionChange(Ce);},te=Z=>{v(Z),t.onPageChange&&t.onPageChange(Z);},he=Z=>{g(Z),v(0),t.onPageChange&&t.onPageChange(0),t.onRowsPerPageChange&&t.onRowsPerPageChange(Z);},Ne=Z=>{let $=C.indexOf(Z),Q=[...C];$===-1?Q.push(Z):Q.splice($,1),k(Q);},Je=Z=>{if(r)return;let $=le.indexOf(Z),Q=[...le];$===-1?Q.push(Z):Q.splice($,1),Ee(Q);},st=Z=>{a().includes(Z)&&R(Q=>Q.includes(Z)?Q.filter(be=>be!==Z):[...Q,Z]);},pt=(Z,$)=>{!Z||!$||Z===$||T(Q=>{let be=Q.indexOf(Z),Ce=Q.indexOf($);if(be===-1||Ce===-1)return Q;let Le=[...Q];return Le.splice(be,1),Le.splice(Ce,0,Z),Le});},Bt=Z=>{let $=Z?.active?.id,Q=Z?.over?.id;typeof $=="string"&&typeof Q=="string"&&pt($,Q);},Xt=Z=>{t.onLayoutSave&&t.onLayoutSave({visibleColumns:C,columnOrder:w,order:o?"asc":l,orderBy:o?"":u,sortBy:o?[]:f,grouping:le,columnWidths:F,showSummary:I,summaryColumns:A});},Vt=Z=>{let{layout:$,layoutId:Q}=Ei(Z,t.tableKey||"default");Q?(ke(Q),Se(Q)):(ke(""),Se("")),$&&($.visibleColumns&&k($.visibleColumns),Array.isArray($.columnOrder)&&T($.columnOrder),o?(d("asc"),p(""),b([])):($.order&&d($.order),$.orderBy&&p($.orderBy),Array.isArray($.sortBy)&&b($.sortBy)),$.grouping&&Ee($.grouping),$.columnWidths&&_($.columnWidths),$.showSummary!==void 0&&S(!!$.showSummary),Array.isArray($.summaryColumns)&&R($.summaryColumns));},wt=Z=>{let $=Z?.layoutData||Z?.layout||Z||{};$.visibleColumns&&k($.visibleColumns),Array.isArray($.columnOrder)&&T($.columnOrder),o?(d("asc"),p(""),b([])):($.order&&d($.order),$.orderBy!==void 0&&p($.orderBy),Array.isArray($.sortBy)&&b($.sortBy)),$.grouping&&Ee($.grouping),$.columnWidths&&_($.columnWidths),$.showSummary!==void 0&&S(!!$.showSummary),Array.isArray($.summaryColumns)&&R($.summaryColumns),O(new Set),v(0),Z?.id&&Se(Z.id),ke("");};er.useEffect(()=>{t.layout&&Vt({layout:t.layout});},[t.layout]);let Wt=Z=>{Z.preventDefault(),q(K===null?{mouseX:Z.clientX+2,mouseY:Z.clientY-6}:null);},ht=()=>{q(null);},Nt=er.useMemo(()=>{if(!I)return {};let Z={};t.columns.forEach(Q=>{if(Q.numeric&&A.includes(Q.id)){let be=Pe.reduce((Ce,Le)=>{let _e=parseFloat(Le[Q.id]);return Ce+(isNaN(_e)?0:_e)},0);Z[Q.id]=be.toFixed(2);}else Z[Q.id]="";});let $=t.columns.find(Q=>C.includes(Q.id)&&!Q.numeric);return $&&!$.numeric&&(Z[$.id]="Total"),Z},[Pe,t.columns,I,A,C]),lt=()=>{if(!t.columns||!Pe)return;let Z=t.columns.map(Le=>Le.label).join(","),$=Pe.map(Le=>t.columns.map(_e=>{let qe=Le[_e.id];return `"${(qe==null?"":String(qe)).replace(/"/g,'""')}"`}).join(",")).join(`
184
- `),Q=`data:text/csv;charset=utf-8,${Z}
185
- ${$}`,be=encodeURI(Q),Ce=document.createElement("a");Ce.setAttribute("href",be),Ce.setAttribute("download",`${t.title||"export"}.csv`),document.body.appendChild(Ce),Ce.click(),document.body.removeChild(Ce);},Ft=()=>{se(true);},Yt=()=>{se(false);};return {isMobile:false,columns:Me,order:l,setOrder:d,orderBy:u,setOrderBy:p,sortBy:f,setSortBy:b,applyMultiSort:re,clearMultiSort:Ke,columnOrder:w,setColumnOrder:T,filterText:i,setFilterText:s,visibleColumns:C,setVisibleColumns:k,showSummary:I,setShowSummary:S,summaryColumns:A,grouping:le,setGrouping:Ee,expandedGroups:E,setExpandedGroups:O,groupAnchorEl:W,setGroupAnchorEl:j,summaryAnchorEl:V,setSummaryAnchorEl:z,columnWidths:F,setColumnWidths:_,anchorEl:B,setAnchorEl:Y,contextMenu:K,setContextMenu:q,sensors:void 0,sortedAndFilteredRows:Ve,visibleRows:ye,summaryRow:Nt,page:m,setPage:te,rowsPerPage:y,setRowsPerPage:he,totalDisplayCount:Be,selected:x,setSelected:h,isAllExpanded:X.length>0&&X.every(Z=>E.has(Z)),handleColumnResize:Fe,handleRequestSort:At,handleSelectAllClick:ce,handleClick:ve,toggleSummaryColumn:st,handleDragEnd:Bt,handleColumnReorder:pt,handleExport:lt,handleContextMenu:Wt,handleCloseContextMenu:ht,toggleColumnVisibility:Ne,toggleGroupExpand:at,toggleGroupField:Je,handleToggleAll:Mt,handleExpandGroupRecursively:Ze,handleCollapseGroupRecursively:St,isGroupFullyExpanded:Ot,handleLayoutLoad:wt,handleVariantLoad:Vt,handleLayoutSave:Xt,effectiveAppId:t.appId||"",currentLayoutData:{visibleColumns:C,order:o?"asc":l,orderBy:o?"":u,sortBy:o?[]:f,columnOrder:w,grouping:le,columnWidths:F,showSummary:I,summaryColumns:A},currentLayoutId:ue,layoutIdToLoad:$e,onPageChange:te,onRowsPerPageChange:he,graphReportOpen:fe,handleOpenGraphReport:Ft,handleCloseGraphReport:Yt}};P();var bD=t=>e("tbody",{...t}),hD=({align:t,...r})=>e("td",{align:t==="inherit"?void 0:t,...r}),vD=t=>e("div",{...t}),yD=t=>e("thead",{...t}),CD=t=>e("tr",{...t}),Jr=t=>{let{t:r}=pe(),o="0.85rem",{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:u,fitContainer:p=false,fullWidth:f=false,maxHeight:b,loading:m=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g,rowKey:x,tableKey:h="default",graphReport:C,quickCreate:k,quickEdit:w,quickDelete:T,serviceUrl:I,disableGrouping:S=false,disableSorting:A=false}=t,R=n||r("table.title.default"),{isMobile:M,columns:N,order:E,orderBy:O,filterText:F,setFilterText:_,visibleColumns:B,showSummary:Y,setShowSummary:W,summaryColumns:j,grouping:V,setGrouping:z,expandedGroups:K,groupAnchorEl:q,setGroupAnchorEl:fe,summaryAnchorEl:se,setSummaryAnchorEl:ue,columnWidths:Se,anchorEl:$e,setAnchorEl:ke,contextMenu:le,sensors:Ee,sortedAndFilteredRows:Me,summaryRow:Pe,visibleRows:Ve,isAllExpanded:tt,page:nt,setPage:it,rowsPerPage:X,setRowsPerPage:De,totalDisplayCount:ye,setSelected:Be,handleColumnResize:at,handleRequestSort:Ze,handleSelectAllClick:St,handleClick:Mt,toggleSummaryColumn:Ot,handleDragEnd:At,handleExport:re,handleContextMenu:Ke,handleCloseContextMenu:Fe,toggleColumnVisibility:ce,toggleGroupExpand:ve,handleToggleAll:te,handleExpandGroupRecursively:he,handleCollapseGroupRecursively:Ne,isGroupFullyExpanded:Je,handleLayoutLoad:st,handleVariantLoad:pt,handleLayoutSave:Bt,effectiveAppId:Xt,currentLayoutData:Vt,currentLayoutId:wt,layoutIdToLoad:Wt,graphReportOpen:ht,handleOpenGraphReport:Nt,handleCloseGraphReport:lt}=hn(t),Ft=C?.enabled??false,Yt=Ft&&(C?.interaction?.enabled??true),Z=Ii(),$=!!k?.enabled,Q=!!w?.enabled,be=!!T?.enabled,Ce=k?.fields,Le=k?.excludeFields||[],_e=k?.initialValues||{},[qe,je]=er__namespace.default.useState(false),[mt,ft]=er__namespace.default.useState(false),[Rt,yt]=er__namespace.default.useState({}),[H,J]=er__namespace.default.useState(false),[ge,Te]=er__namespace.default.useState(false),[et,Xe]=er__namespace.default.useState({}),[kt,bt]=er__namespace.default.useState(false),[gt,Ct]=er__namespace.default.useState(false),nr=m||mt||ge||gt,Et=er__namespace.default.useMemo(()=>{let oe=[...N];if(Array.isArray(Ce)&&Ce.length>0){let me=new Set(Ce);oe=oe.filter(ee=>me.has(ee.id));}if(Le.length>0){let me=new Set(Le);oe=oe.filter(ee=>!me.has(ee.id));}return oe.filter(me=>!!me?.id)},[N,Le,Ce]),Zt=x||"id",Ht=er__namespace.default.useMemo(()=>{let oe=new Set(s);return Me.filter(me=>oe.has(me?.[Zt]))},[s,Me,Zt]),Kt=Ht.length===1?Ht[0]:null,$t=w?.fields,rr=w?.excludeFields||[],ar=w?.editableFields||[],fr=w?.nonEditableFields||[],Ir=w?.primaryKeys?.length?w.primaryKeys:[Zt],Mr=er__namespace.default.useMemo(()=>{let oe=[...N];if(Array.isArray($t)&&$t.length>0){let me=new Set($t);oe=oe.filter(ee=>me.has(ee.id));}if(rr.length>0){let me=new Set(rr);oe=oe.filter(ee=>!me.has(ee.id));}return oe.filter(me=>!!me?.id)},[N,rr,$t]),no=er__namespace.default.useMemo(()=>new Set(Ir),[Ir]),yr=er__namespace.default.useMemo(()=>new Set(ar),[ar]),Or=er__namespace.default.useMemo(()=>new Set(fr),[fr]),qo=er__namespace.default.useCallback(oe=>yr.size>0?yr.has(oe):!(Or.has(oe)||no.has(oe)),[yr,Or,no]);er__namespace.default.useEffect(()=>{!ht&&Z.hasActiveFilters&&Z.clearAll();},[ht,Z.hasActiveFilters,Z.clearAll]);let Xo=()=>{let oe={};Et.forEach(me=>{oe[me.id]=_e[me.id]??"";}),yt(oe),je(true);},Lo=()=>{mt||je(false);},Yo=(oe,me)=>{yt(ee=>({...ee,[oe]:me}));},Zo=async()=>{if(!k?.onSubmit){je(false);return}try{ft(!0),await k.onSubmit(Rt),je(!1);}finally{ft(false);}},Rr=()=>{if(!Kt)return;let oe={};Mr.forEach(ee=>{oe[ee.id]=Kt[ee.id]??"";});let me=w?.getInitialValues?{...oe,...w.getInitialValues(Kt)}:oe;Xe(me),J(true);},Oo=()=>{ge||J(false);},jo=(oe,me)=>{Xe(ee=>({...ee,[oe]:me}));},Kr=async()=>{if(Kt){if(!w?.onSubmit){J(false);return}try{Te(!0),await w.onSubmit(et,Kt),J(!1);}finally{Te(false);}}},ao=()=>{Ht.length!==0&&bt(true);},Ln=()=>{gt||bt(false);},Fo=async()=>{if(Ht.length===0){bt(false);return}if(!T?.onConfirm){bt(false),Be([]),l?.([]);return}try{Ct(!0),await T.onConfirm(Ht),bt(!1),Be([]),l?.([]);}finally{Ct(false);}},D=Me,{fieldMapping:G}=mn({rows:D,config:{...C,title:C?.title||`${R} ${r("graph.reportTitle")}`}}),U=er__namespace.default.useMemo(()=>Yt?Z.applyRows(D,G):D,[Yt,Z.applyRows,D,G]),{model:de}=mn({rows:U,config:{...C,title:C?.title||`${R} ${r("graph.reportTitle")}`,fieldMapping:G}}),He=de.table.columns.map(oe=>({id:oe.id,label:oe.label,align:oe.align||"left",minWidth:120,numeric:oe.align==="right"})),ot=Xt?e(bn,{appId:Xt,tableKey:h,currentLayoutData:Vt,onLayoutLoad:st,targetLayoutId:Wt,activeLayoutId:wt,serviceUrl:I??g?.serviceUrl}):null,Ge=c(jsxRuntime.Fragment,{children:[!S&&e(pn,{groupAnchorEl:q,setGroupAnchorEl:fe,grouping:V,setGrouping:z,columns:N}),e(un,{anchorEl:$e,setAnchorEl:ke,columns:N,visibleColumns:B,toggleColumnVisibility:ce}),e(yi,{anchorEl:se,setAnchorEl:ue,showSummary:Y,setShowSummary:W,columns:N,summaryColumns:j,toggleSummaryColumn:Ot}),e(Ci,{contextMenu:le,handleCloseContextMenu:Fe,columns:N,visibleColumns:B,toggleColumnVisibility:ce})]});return M?c("div",{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[g&&e(Wr,{fields:g.fields,filters:g.filters,onFilterChange:g.onFilterChange,onSearch:g.onSearch,variants:g.variants||[],currentVariantId:g.currentVariantId,onVariantLoad:g.onVariantLoad,onVariantSave:g.onVariantSave,onVariantDelete:g.onVariantDelete,onVariantSetDefault:g.onVariantSetDefault,appId:g.appId,tableKey:h,currentLayout:[{tableKey:h,layoutData:Vt}],variantService:g.variantService,serviceUrl:I??g.serviceUrl}),e(Tp,{title:R,loading:m,showSummary:Y,setShowSummary:W,setAnchorEl:ke,setSummaryAnchorEl:ue,filterText:F,setFilterText:_,sortedAndFilteredRows:Me,selected:s,columns:N,visibleColumns:B,summaryRow:Pe,handleClick:Mt,selectionMode:i}),Ge]}):c("div",{sx:{width:f?"100%":"auto",mb:p?0:2,...p?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g&&e("div",{sx:{mb:2},children:e(Wr,{fields:g.fields,filters:g.filters,onFilterChange:g.onFilterChange,onSearch:g.onSearch,variants:g.variants||[],currentVariantId:g.currentVariantId,onVariantLoad:oe=>{pt(oe),g.onVariantLoad&&g.onVariantLoad(oe);},onVariantSave:g.onVariantSave,onVariantDelete:g.onVariantDelete,onVariantSetDefault:g.onVariantSetDefault,loading:m,appId:g.appId,tableKey:h,currentLayout:[{tableKey:h,layoutData:Vt}],currentLayoutId:wt,layoutRefs:[{tableKey:h,layoutId:wt}],variantService:g.variantService,serviceUrl:I??g.serviceUrl})}),c(Ae,{className:"orb-ctable-surface",sx:{width:f?"100%":"auto",mb:p?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":nr?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, color-mix(in oklch, var(--orb-primary) 0%, transparent) 0%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 25%, var(--orb-primary) 50%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 75%, color-mix(in oklch, var(--orb-primary) 0%, transparent) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...b?{height:b}:p?{flex:1,minHeight:0,height:"100%"}:{}},children:[a&&e(fi,{filterText:F,setFilterText:_,onRowsPerPageChange:De,rowsPerPage:X,rowsPerPageOptions:v,page:nt,count:ye,onPageChange:it,actions:d,extraTools:u,grouping:V,disableGrouping:S,groupAnchorEl:q,setGroupAnchorEl:fe,showSummary:Y,setShowSummary:W,anchorEl:$e,setAnchorEl:ke,summaryAnchorEl:se,setSummaryAnchorEl:ue,handleExport:re,showCreateButton:$,onOpenCreateDialog:Xo,showEditButton:Q,onOpenEditDialog:Rr,editDisabled:Ht.length!==1,showDeleteButton:be,onOpenDeleteConfirm:ao,deleteDisabled:Ht.length===0,onLayoutSave:y||g?.variantService&&g?.appId?Bt:void 0,loading:m,layoutManager:ot,onOpenGraphReport:Ft?Nt:void 0}),e("div",{sx:{flex:1,...b?{maxHeight:b,height:b}:p?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:e(core.DndContext,{sensors:Ee,collisionDetection:core.closestCenter,onDragEnd:At,modifiers:[modifiers.restrictToHorizontalAxis],children:c("table",{className:"orb-tbl orb-ctable",style:{minWidth:f?750:void 0,width:f?"100%":"auto",tableLayout:Object.keys(Se).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,fontSize:o},"aria-labelledby":"tableTitle",children:[e(hi,{columns:N,visibleColumns:B,order:E,orderBy:O,onRequestSort:Ze,disableSorting:A,onContextMenu:Ke,selectionMode:i,grouping:V,isAllExpanded:tt,handleToggleAll:te,rowCount:Me.length,numSelected:s.length,onSelectAllClick:St,columnWidths:Se,onColumnResize:at}),e(vi,{visibleRows:Ve,columns:N,visibleColumns:B,selectionMode:i,selected:s,orderBy:O,loading:m,expandedGroups:K,toggleGroupExpand:ve,handleExpandGroupRecursively:he,handleCollapseGroupRecursively:Ne,isGroupFullyExpanded:Je,handleClick:Mt,onSelectionChange:l,grouping:V,rowKeyProp:x,page:nt,rowsPerPage:X}),Y&&e(Pp,{showSummary:Y,columns:N,visibleColumns:B,summaryRow:Pe,selectionMode:i?.toString(),grouping:V,columnWidths:Se,orderBy:O,zIndex:3})]})})})]}),$&&c(Lt,{open:qe,onClose:Lo,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:oe=>`1px solid ${oe.palette.divider}`,bgcolor:"background.paper"}}},children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:k?.title||r("quickCreate.createWithTitle",{title:R})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Et.map(oe=>{let me=oe.type==="number"||oe.numeric?"number":oe.type==="date"?"date":"text",ee=oe.label||oe.id;return e(ze,{label:ee,value:Rt[oe.id]??"",onChange:Oe=>Yo(oe.id,Oe.target.value),type:me,size:"small",fullWidth:true,InputLabelProps:{shrink:me==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${oe.id}`)}),k?.description&&e(jr,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:k.description})]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(we,{onClick:Lo,sx:{fontSize:"0.85rem"},disabled:mt,children:k?.cancelLabel||r("common.cancel")}),e(we,{onClick:Zo,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:mt,children:k?.submitLabel||r("common.save")})]})]}),Q&&c(Lt,{open:H,onClose:Oo,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:oe=>`1px solid ${oe.palette.divider}`,bgcolor:"background.paper"}}},children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:w?.title||r("quickEdit.editWithTitle",{title:R})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Mr.map(oe=>{let me=oe.type==="number"||oe.numeric?"number":oe.type==="date"?"date":"text",ee=oe.label||oe.id,Oe=qo(oe.id);return e(ze,{label:ee,value:et[oe.id]??"",onChange:Qe=>jo(oe.id,Qe.target.value),type:me,size:"small",fullWidth:true,disabled:!Oe,InputLabelProps:{shrink:me==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${oe.id}`)}),w?.description&&e(jr,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:w.description})]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(we,{onClick:Oo,sx:{fontSize:"0.85rem"},disabled:ge,children:w?.cancelLabel||r("common.cancel")}),e(we,{onClick:Kr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ge||!Kt,children:w?.submitLabel||r("common.save")})]})]}),be&&e(jn,{open:kt,type:"warning",title:T?.title||r("quickDelete.confirmTitle"),message:T?.message||(Ht.length>1?r("quickDelete.confirmMessageMultiple",{count:Ht.length}):r("quickDelete.confirmMessageSingle")),confirmText:T?.confirmText||r("common.delete"),cancelText:T?.cancelText||r("common.cancel"),onClose:Ln,onConfirm:Fo}),Ge,Ft&&e(Pi,{open:ht,onClose:lt,model:de,aiAssistant:C?.aiAssistant,interaction:Yt?{enabled:true,filters:Z.filters,fieldMapping:G,onPrimaryDimensionClick:oe=>Z.setFilter("primaryDimension",oe),onSecondaryDimensionClick:oe=>Z.setFilter("secondaryDimension",oe),onStatusClick:oe=>Z.setFilter("status",oe),onClearFilter:Z.clearFilter,onClearAll:Z.clearAll}:void 0,tableContent:e(Jr,{appId:Xt||"graph-report-internal",title:r("graph.dataBody"),columns:He,rows:de.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},xD=Jr;P();var MD=({id:t,title:r,hideHeader:o=true,filterConfig:n,tableProps:a,children:i,spacing:s=1,mode:l="separated"})=>{let d=n?{...n,appId:n.appId||t}:void 0,u={...a,appId:a.appId||t};return c(ui,{title:r,hideHeader:o,children:[c(ie,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l==="separated"&&d&&e("div",{sx:{flexShrink:0},children:e(Wr,{...d})}),e("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:e(Jr,{...u,fitContainer:true,filterConfig:l==="integrated"?d:void 0})})]}),i]})};var LD=({metadata:t,fetchData:r,initialRowsPerPage:o=20,rowsPerPageOptions:n=[20,50,100,-1],tableKey:a="default",mode:i="integrated",serviceUrl:s,variantService:l})=>{let{t:d}=pe(),[u,p]=er.useState(false),[f,b]=er.useState([]),[m,v]=er.useState({}),[y,g]=er.useState(t.variants||[]),[x,h]=er.useState(t.layout||null),[C,k]=er.useState(""),[w,T]=er.useState(0),[I,S]=er.useState(0),[A,R]=er.useState(o),[M,N]=er.useState([]),[E,O]=er.useState("asc"),[F,_]=er.useState("");er.useEffect(()=>{let se={};t.filters.forEach(ue=>{ue.defaultValue!==void 0&&(se[ue.id]=ue.defaultValue);}),v(se);},[t.filters]);let B=er.useCallback(async(se,ue,Se,$e,ke)=>{p(true);try{let le={...se,page:ue+1,limit:Se,sort:ke,order:$e},Ee;r?Ee=await r(le):typeof t.api=="function"?Ee=await t.api(le):t.api&&typeof t.api=="object"?(console.log("Fetching from URL:",t.api.url,le),Ee={rows:[],total:0}):(console.warn("No API configured for report"),Ee={rows:[],total:0}),Ee&&(b(Ee.rows||[]),T(Ee.total||0));}catch(le){console.error("Failed to fetch report data",le);}finally{p(false);}},[t.api,r]);er.useEffect(()=>{B(m,I,A,E,F);},[B,I,A,E,F]);let Y=()=>{S(0),B(m,0,A,E,F);},W=se=>{S(0),R(se);},j=(se,ue)=>{O(ue),_(se);},V=se=>{v(se);},z=se=>{k(se?.id||"");let ue=Ai(se,a);if(ue){let $e=ue.values??ue;v($e),B($e,0,A,E,F),S(0);}let{layout:Se}=Ei(se,a);Se&&h(Se);},K=se=>{let ue={...se,id:Date.now().toString(),createdAt:new Date().toISOString()};g(Se=>[...Se,ue]);},q=se=>{h(se);};return {pageProps:{id:t.id,title:t.title,mode:i,filterConfig:{appId:t.id,tableKey:a,fields:t.filters,filters:m,onFilterChange:V,onSearch:Y,onVariantLoad:z,onVariantSave:K,onVariantDelete:se=>g(ue=>ue.filter(Se=>Se.id!==se)),onVariantSetDefault:se=>{g(ue=>ue.map(Se=>({...Se,isDefault:Se.id===se})));},variants:y,currentVariantId:C,variantService:l,serviceUrl:s},tableProps:{appId:t.id,tableKey:a,columns:t.columns,rows:f,loading:u,rowKey:"id",count:w,page:I,rowsPerPage:A,rowsPerPageOptions:n,onPageChange:S,onRowsPerPageChange:W,selectionMode:"multiple",selected:M,onSelectionChange:N,onLayoutSave:q,layout:x,title:t.title,showSummary:true,order:E,orderBy:F,serviceUrl:s,onSortChange:j,graphReport:t.graphReport||{enabled:true,title:`${t.title} ${d("graph.reportTitle")}`}}},filters:m,rows:f,loading:u,refresh:Y}};P();var Oh=new Set(["id","title","description","icon","iconNode","meta"]),Fh=t=>t.replace(/([A-Z])/g," $1").replace(/[._-]+/g," ").replace(/^\w/,r=>r.toUpperCase()).trim(),Bh=t=>Object.entries(t).filter(([r,o])=>!Oh.has(r)&&o!==null&&o!==void 0&&["string","number","boolean"].includes(typeof o)).map(([r,o])=>({key:r,label:Fh(r),value:String(o)})),eu=({item:t,open:r,onClose:o,onDownloadClick:n,renderContent:a,downloadTooltip:i,closeTooltip:s})=>{let{t:l}=pe(),u=Cr()==="dark"?"var(--orb-p300)":"var(--orb-primary)";er__namespace.default.useEffect(()=>{if(!r)return;let f=b=>{b.key==="Escape"&&o();};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[r,o]);let p=Bh(t);return typeof document>"u"?null:reactDom.createPortal(c(jsxRuntime.Fragment,{children:[e("div",{"aria-hidden":"true",onClick:o,sx:{position:"fixed",inset:0,zIndex:1299,backgroundColor:"rgba(1, 9, 26, 0.4)",opacity:r?1:0,pointerEvents:r?"auto":"none",transition:"opacity 200ms ease"}}),c("div",{role:"dialog","aria-modal":"true","aria-label":t.title,sx:{position:"fixed",top:"50%",left:"50%",zIndex:1300,width:"min(520px, 92vw)",maxHeight:"82vh",display:"flex",flexDirection:"column",bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3,boxShadow:"0 24px 64px rgba(1, 9, 26, 0.3)",transform:r?"translate(-50%, -50%) scale(1)":"translate(-50%, -47%) scale(0.96)",opacity:r?1:0,transition:"transform 200ms ease, opacity 180ms ease"},children:[c(ie,{direction:"row",spacing:1.5,alignItems:"center",sx:{p:2.5,pb:2,borderBottom:"1px solid",borderColor:"divider",flexShrink:0},children:[e("div",{sx:{width:56,height:56,flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:t.iconNode??e(Tt,{name:t.icon??"product",size:30,style:{color:u}})}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{component:"div",sx:{fontWeight:700,fontSize:"1.1rem",lineHeight:1.3,wordBreak:"break-word"},children:t.title}),t.meta?e(L,{component:"div",sx:{fontSize:"0.8rem",color:"text.secondary"},children:t.meta}):null]}),e(ae,{tooltip:s??l("cardPage.close"),"aria-label":s??l("cardPage.close"),onClick:o,children:e(Tt,{name:"decline",size:18})})]}),e("div",{sx:{flex:1,minHeight:0,overflowY:"auto",p:2.5},children:a?a(t):c(jsxRuntime.Fragment,{children:[t.description?e(L,{component:"div",sx:{fontSize:"0.9rem",lineHeight:1.6,color:"text.primary"},children:t.description}):null,p.length>0?e("div",{sx:{mt:t.description?2.5:0,display:"grid",gap:1.5},children:p.map(f=>c("div",{children:[e(L,{component:"div",sx:{fontSize:"0.72rem",fontWeight:600,color:"text.secondary",textTransform:"uppercase",letterSpacing:"0.04em"},children:f.label}),e(L,{component:"div",sx:{fontSize:"0.88rem",color:"text.primary",wordBreak:"break-word"},children:f.value})]},f.key))}):null]})}),n?e("div",{sx:{p:2.5,pt:2,borderTop:"1px solid",borderColor:"divider",flexShrink:0},children:e(we,{variant:"contained",sx:{width:"100%"},startIcon:e(Tt,{name:"download",size:16}),onClick:()=>n(t),children:i??l("cardPage.download")})}):null]})]}),document.body)};P();var Hh={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",overflow:"hidden"},zh=({item:t,onDetailClick:r,onDownloadClick:o,detailTooltip:n,downloadTooltip:a})=>{let{t:i}=pe(),l=Cr()==="dark"?"var(--orb-p300)":"var(--orb-primary)",d=t.iconNode??e(Tt,{name:t.icon??"product",size:26,style:{color:l}});return c(Ae,{elevation:0,sx:{p:2,height:"100%",display:"flex",flexDirection:"column",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",boxShadow:"0 8px 20px rgba(15, 23, 42, 0.06)",transition:"transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease","&:hover":{transform:"translateY(-2px)",borderColor:"primary.main",boxShadow:"0 14px 32px rgba(15, 23, 42, 0.12)"}},children:[c(ie,{direction:"row",spacing:1.5,alignItems:"center",children:[e("div",{sx:{width:48,height:48,flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:d}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{component:"div",noWrap:true,sx:{fontWeight:700,fontSize:"0.98rem",lineHeight:1.3},children:t.title}),t.meta?e(L,{component:"div",noWrap:true,sx:{fontSize:"0.75rem",color:"text.secondary"},children:t.meta}):null]})]}),e("div",{sx:{mt:1.5,flex:1,minHeight:0},children:e(L,{component:"div",sx:{fontSize:"0.84rem",lineHeight:1.45,color:"text.primary",...Hh},children:t.description||"\xA0"})}),c(ie,{direction:"row",spacing:.5,justifyContent:"flex-end",sx:{mt:1.5},children:[e(ae,{tooltip:n??i("cardPage.viewDetails"),"aria-label":n??i("cardPage.viewDetails"),onClick:()=>r?.(t),children:e(Tt,{name:"show",size:18})}),e(ae,{tooltip:a??i("cardPage.download"),"aria-label":a??i("cardPage.download"),onClick:()=>o?.(t),children:e(Tt,{name:"download",size:18})})]})]})},ru=({items:t,loading:r=false,onDetailClick:o,onDownloadClick:n,minCardWidth:a=260,detailTooltip:i,downloadTooltip:s,emptyText:l,detailPanel:d=true,renderDetailContent:u})=>{let{t:p}=pe(),[f,b]=er__namespace.default.useState(null),[m,v]=er__namespace.default.useState(false),y=x=>{o?.(x),d&&(b(x),requestAnimationFrame(()=>requestAnimationFrame(()=>v(true))));},g=()=>{v(false),setTimeout(()=>b(null),260);};return r?e("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:e(Xr,{})}):t.length?c(jsxRuntime.Fragment,{children:[e("div",{sx:{flex:1,minHeight:0,overflowY:"auto",display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${a}px, 1fr))`,gap:2,alignContent:"start",p:.5},children:t.map(x=>e(zh,{item:x,onDetailClick:y,onDownloadClick:n,detailTooltip:i,downloadTooltip:s},x.id))}),d&&f?e(eu,{item:f,open:m,onClose:g,onDownloadClick:n,renderContent:u,downloadTooltip:s}):null]}):e("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:e(L,{sx:{color:"text.secondary"},children:l??p("cardPage.empty")})})};P();var rN=({id:t,title:r,hideHeader:o=true,filterConfig:n,gridProps:a,children:i,spacing:s=1})=>{let l=n?{...n,appId:n.appId||t}:void 0;return c(ui,{title:r,hideHeader:o,children:[c(ie,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l&&e("div",{sx:{flexShrink:0},children:e(Wr,{...l})}),e("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:e(ru,{...a})})]}),i]})};var sN=({metadata:t,fetchData:r,tableKey:o="default",variantService:n,serviceUrl:a,onDetailClick:i,onDownloadClick:s,minCardWidth:l})=>{let[d,u]=er.useState(false),[p,f]=er.useState([]),[b,m]=er.useState(0),[v,y]=er.useState({}),[g,x]=er.useState(t.variants||[]),[h,C]=er.useState("");er.useEffect(()=>{let R={};t.filters.forEach(M=>{M.defaultValue!==void 0&&(R[M.id]=M.defaultValue);}),y(R);},[t.filters]);let k=er.useCallback(async R=>{u(true);try{let M=r?await r({...R}):{rows:[],total:0};f(M?.rows||[]),m(M?.total||0);}catch(M){console.error("Failed to fetch card page data",M);}finally{u(false);}},[r]);er.useEffect(()=>{k(v);},[k]);let w=()=>{k(v);},T=R=>{y(R);},I=R=>{C(R?.id||"");let M=Ai(R,o);if(M){let N=M.values??M;y(N),k(N);}},S=R=>{let M={...R,id:Date.now().toString(),createdAt:new Date().toISOString()};x(N=>[...N,M]);};return {pageProps:{id:t.id,title:t.title,filterConfig:{appId:t.id,tableKey:o,fields:t.filters,filters:v,onFilterChange:T,onSearch:w,onVariantLoad:I,onVariantSave:S,onVariantDelete:R=>x(M=>M.filter(N=>N.id!==R)),onVariantSetDefault:R=>{x(M=>M.map(N=>({...N,isDefault:N.id===R})));},variants:g,currentVariantId:h,variantService:n,serviceUrl:a},gridProps:{items:p,loading:d,onDetailClick:i,onDownloadClick:s,minCardWidth:l}},items:p,total:b,filters:v,loading:d,refresh:w}};var Wh=t=>[...t].sort((r,o)=>o.value-r.value),dN=({bars:t=[],lines:r=[],combos:o=[],heatmap:n=[],pies:a=[],waterfalls:i=[]})=>{let s=er.useMemo(()=>Wh(t),[t]),l=er.useMemo(()=>[...r],[r]),d=er.useMemo(()=>[...o],[o]),u=er.useMemo(()=>[...n],[n]),p=er.useMemo(()=>{let b=a.reduce((m,v)=>m+v.value,0);return a.map(m=>({...m,percent:b>0?m.value/b*100:m.percent}))},[a]),f=er.useMemo(()=>[...i],[i]);return {bars:s,lines:l,combos:d,heatmap:u,pies:p,waterfalls:f}};var fN=({apiKey:t,query:r,zoom:o=14,mapType:n="roadmap"})=>er.useMemo(()=>!t||!r?"":oa({apiKey:t,query:r,zoom:o,mapType:n}),[t,r,o,n]),bN=({keyword:t,location:r})=>er.useMemo(()=>wi({keyword:t,location:r?{lng:r.lng,lat:r.lat,name:r.name}:void 0}),[t,r]);P();var la=({code:t,language:r="text",copyable:o=true,showLineNumbers:n=false,wrapLongLines:a=false,maxHeight:i})=>{let[s,l]=er.useState(false),d=er.useMemo(()=>t.replace(/\n$/,"").split(`
186
- `),[t]);return c("div",{style:{border:"1px solid var(--orb-border)",borderRadius:12,overflow:"hidden",background:"var(--orb-canvas)"},children:[c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4.8px 8px",background:"var(--orb-hover)",borderBottom:"1px solid var(--orb-border)"},children:[e("span",{style:{fontSize:12,fontWeight:500,textTransform:"uppercase",letterSpacing:.5,color:"var(--orb-muted)",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:r}),o&&e(ae,{size:"small",tooltip:s?"Copied":"Copy",onClick:async()=>{try{await navigator.clipboard.writeText(t),l(!0),window.setTimeout(()=>l(!1),1400);}catch{l(false);}},children:s?e(qr,{size:14,strokeWidth:1.8}):e(vo,{size:14,strokeWidth:1.8})})]}),e("pre",{style:{margin:0,padding:10,fontSize:"0.82rem",lineHeight:1.55,overflow:"auto",maxHeight:i,background:"var(--orb-surface)",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:n?d.map((p,f)=>c("div",{style:{display:"flex"},children:[e("span",{style:{width:34,flexShrink:0,textAlign:"right",paddingRight:8,color:"var(--orb-disabled-fg)",userSelect:"none"},children:f+1}),e("span",{style:{whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:p})]},`${f}-${p}`)):e("code",{style:{display:"block",whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:t})})]})};P();var qh=t=>{let r=t.trim();return r.startsWith("$$")&&r.endsWith("$$")&&r.length>=4&&(r=r.slice(2,-2).trim()),r.startsWith("$")&&r.endsWith("$")&&r.length>=2&&(r=r.slice(1,-1).trim()),r},Xh=async t=>new Function("m","return import(m)")(t),ca=({expression:t,inline:r=false,allowKatex:o=false})=>{let n=er.useMemo(()=>qh(t),[t]),[a,i]=er.useState("");return er.useEffect(()=>{let s=true;return (async()=>{if(!o||!n){i("");return}try{let d=await Xh("katex"),p=(d?.default||d)?.renderToString?.(n,{displayMode:!r,throwOnError:!1,strict:"warn"});s&&typeof p=="string"&&i(p);}catch{s&&i("");}})(),()=>{s=false;}},[o,n,r]),n?a?e(Ie,{component:r?"span":"div",sx:{display:r?"inline-flex":"block",my:r?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:a}}):r?e(Ie,{component:"code",sx:{px:.4,py:.05,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:n}):e(Ie,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:e(hr,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",fontSize:"0.9rem",lineHeight:1.5,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:n})}):null};P();var jh=async t=>new Function("m","return import(m)")(t),dl=({code:t,title:r="Mermaid Diagram",height:o=320,enabled:n=true})=>{let[a,i]=er.useState(""),[s,l]=er.useState(""),[d,u]=er.useState(false),p=er.useMemo(()=>t.trim(),[t]);return er.useEffect(()=>{let f=true;return (async()=>{if(!n||!p){i(""),l("");return}u(true),l(""),i("");try{let m=await jh("mermaid"),v=m?.default||m;if(!v||typeof v.render!="function")throw new Error("Mermaid runtime is not available");v.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let y=await v.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,p),g=typeof y=="string"?y:y?.svg;f&&typeof g=="string"&&i(g);}catch(m){if(f){let v=m instanceof Error?m.message:"Failed to render Mermaid diagram";l(v);}}finally{f&&u(false);}})(),()=>{f=false;}},[n,p]),c(Bo,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[e(Ie,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:e(hr,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:r})}),c(Ie,{sx:{p:1},children:[d&&e(Ie,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:e(Sd,{size:20})}),!d&&a&&e(Ie,{sx:{maxHeight:o,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:a}}),!d&&!a&&c(Ie,{children:[s&&e(jr,{severity:"info",sx:{mb:1},children:s}),e(la,{code:p,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};P();var pl=t=>t.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),Jh=t=>/^:?-{3,}:?$/.test(t.trim()),ev=t=>{let r=t.trim(),o=r.startsWith(":"),n=r.endsWith(":");return o&&n?"center":n?"right":"left"},Li=t=>{let r=t.split(`
187
- `).map(s=>s.trim()).filter(Boolean);if(r.length<2)return null;let o=pl(r[0]),n=pl(r[1]);if(o.length===0||n.length!==o.length||!n.every(Jh))return null;let a=n.map(ev),i=r.slice(2).filter(s=>s.includes("|")).map(s=>{let l=pl(s);return l.length<o.length?[...l,...Array.from({length:o.length-l.length},()=>"")]:l.slice(0,o.length)});return {headers:o,aligns:a,rows:i}},ul=({markdown:t,table:r,maxHeight:o=360})=>{let n=er.useMemo(()=>r||(t?Li(t):null),[r,t]);return !n||n.headers.length===0?e(Bo,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:e(hr,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):e(Bo,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:e(Td,{sx:{maxHeight:o},children:c(kd,{size:"small",stickyHeader:true,children:[e(Id,{children:e(el,{children:n.headers.map((a,i)=>e(Js,{align:n.aligns[i],sx:{fontWeight:700,bgcolor:"background.paper"},children:a},`${a}-${i}`))})}),e(Pd,{children:n.rows.map((a,i)=>e(el,{hover:true,children:a.map((s,l)=>e(Js,{align:n.aligns[l],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s||e(Ie,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${i}-${l}`))},`row-${i}`))})]})})})};P();var Oi=({content:t,title:r="Thinking",defaultExpanded:o=false,isStreaming:n=false})=>{let[a,i]=er.useState(o);return c(Ie,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[c(yd,{direction:"row",alignItems:"center",spacing:.6,children:[e(Cd,{size:"small",onClick:()=>i(s=>!s),sx:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:e(an,{fontSize:"inherit"})}),c(hr,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[r,n?" ...":""]})]}),e(nn,{in:a,children:e(hr,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:t})})]})};P();var ml=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,Fi=t=>t.trim().startsWith("```"),iu=t=>/^#{1,6}\s+/.test(t.trim()),gl=t=>/^[-*+]\s+/.test(t.trim()),fl=t=>/^\d+\.\s+/.test(t.trim()),su=t=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(t.trim()),bl=t=>t.trim().startsWith(">"),lu=(t,r)=>{if(r+1>=t.length)return false;let o=t[r],n=t[r+1];return !o.includes("|")||!n.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(n.trim())},cu=t=>t.trim().startsWith("<think>")||t.trim()===":::think",da=(t,r,o)=>{let n=[],a=0,i=0;ml.lastIndex=0;let s=ml.exec(t);for(;s;){s.index>a&&n.push(t.slice(a,s.index));let l=s[0],d=`${o}-${i}`;if(l.startsWith("**")&&l.endsWith("**"))n.push(e("strong",{children:l.slice(2,-2)},d));else if(l.startsWith("*")&&l.endsWith("*"))n.push(e("em",{children:l.slice(1,-1)},d));else if(l.startsWith("`")&&l.endsWith("`"))n.push(e(Ie,{component:"code",sx:{px:.45,py:.08,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:l.slice(1,-1)},d));else if(l.startsWith("[")&&l.includes("](")&&l.endsWith(")")){let u=l.match(/^\[([^\]]+)\]\(([^)]+)\)$/);u?n.push(e(vd,{href:u[2],target:"_blank",rel:"noreferrer",children:u[1]},d)):n.push(l);}else l.startsWith("$")&&l.endsWith("$")&&r.enableMath?n.push(e(ca,{expression:l,inline:true,allowKatex:true},d)):n.push(l);a=s.index+l.length,i+=1,s=ml.exec(t);}return a<t.length&&n.push(t.slice(a)),n.length>0?n:[t]},pa=({markdown:t,content:r,className:o,enableMath:n=true,enableMermaid:a=true,enableThinkBlock:i=true,codeCopyable:s=true,codeLineNumbers:l=false})=>{let d=t??r??"",u=er.useMemo(()=>{let p=[],f=d.replace(/\r\n/g,`
183
+ `;return to.useEffect(()=>{let d=i.current;if(!d)return;let p=new ogl.Renderer({alpha:true,premultipliedAlpha:false}),m=p.gl;m.clearColor(0,0,0,0),d.appendChild(m.canvas);let h=new ogl.Triangle(m),f=new ogl.Program(m,{vertex:s,fragment:l,uniforms:{iTime:{value:0},iResolution:{value:new ogl.Vec3(m.canvas.width,m.canvas.height,m.canvas.width/m.canvas.height)},hue:{value:t},hover:{value:0},rot:{value:0},hoverIntensity:{value:o},backgroundColor:{value:km(a)}}}),u=new ogl.Mesh(m,{geometry:h,program:f});function b(){if(!d)return;let M=window.devicePixelRatio||1,w=d.clientWidth,N=d.clientHeight;p.setSize(w*M,N*M),m.canvas.style.width=w+"px",m.canvas.style.height=N+"px",f.uniforms.iResolution.value.set(m.canvas.width,m.canvas.height,m.canvas.width/m.canvas.height);}window.addEventListener("resize",b),b();let C=0,g=0,x=0,v=.3,y=M=>{let w=d.getBoundingClientRect(),N=M.clientX-w.left,A=M.clientY-w.top,T=w.width,R=w.height,E=Math.min(T,R),O=T/2,$=R/2,ee=(N-O)/E*2,F=(A-$)/E*2;Math.sqrt(ee*ee+F*F)<.8?C=1:C=0;},k=()=>{C=0;};d.addEventListener("mousemove",y),d.addEventListener("mouseleave",k);let S,P=M=>{S=requestAnimationFrame(P);let w=(M-g)*.001;g=M,f.uniforms.iTime.value=M*.001,f.uniforms.hue.value=t,f.uniforms.hoverIntensity.value=o,f.uniforms.backgroundColor.value=km(a);let N=n?1:C;f.uniforms.hover.value+=(N-f.uniforms.hover.value)*.1,r&&N>.5&&(x+=w*v),f.uniforms.rot.value=x,p.render({scene:u});};return S=requestAnimationFrame(P),()=>{cancelAnimationFrame(S),window.removeEventListener("resize",b),d.removeEventListener("mousemove",y),d.removeEventListener("mouseleave",k),m.canvas.parentNode===d&&d.removeChild(m.canvas),m.getExtension("WEBGL_lose_context")?.loseContext();}},[t,o,r,n,a]),e("div",{ref:i,className:"w-full h-full"})}function qy(t,o,r){let n,a,i;if(o===0)n=a=i=r;else {let s=(p,m,h)=>(h<0&&(h+=1),h>1&&(h-=1),h<.16666666666666666?p+(m-p)*6*h:h<.5?m:h<.6666666666666666?p+(m-p)*(.6666666666666666-h)*6:p),l=r<.5?r*(1+o):r+o-r*o,d=2*r-l;n=s(d,l,t+1/3),a=s(d,l,t),i=s(d,l,t-1/3);}return new ogl.Vec3(n,a,i)}function km(t){if(t==="transparent")return new ogl.Vec3(0,0,0);if(t.startsWith("#")){let n=parseInt(t.slice(1,3),16)/255,a=parseInt(t.slice(3,5),16)/255,i=parseInt(t.slice(5,7),16)/255;return new ogl.Vec3(n,a,i)}let o=t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(o)return new ogl.Vec3(parseInt(o[1])/255,parseInt(o[2])/255,parseInt(o[3])/255);let r=t.match(/hsla?\((\d+),\s*(\d+)%,\s*(\d+)%/);if(r){let n=parseInt(r[1])/360,a=parseInt(r[2])/100,i=parseInt(r[3])/100;return qy(n,a,i)}return new ogl.Vec3(0,0,0)}var Tm=_s(()=>{"use strict";"use client";I();});var ch={canvas:"#ffffff",surface:"#f5f5f5",surface2:"#f5f5f5",surface3:"#f5f5f5",fg:"#555555",muted:"#8c8c8c",border:"#dbdbdb",primary:"#154194",onPrimary:"#ffffff",link:"#154194",p50:"#f0f3f9",p100:"#dce4f1",p200:"#bac9e3",p300:"#91a8d1",p600:"#0f3276",p700:"#08255a",accent:"#fc4c02",err:"#ac3101",errBg:"#fff4f0",warnBg:"#fff2ee",hover:"rgba(21, 65, 148, 0.06)",selected:"rgba(21, 65, 148, 0.10)",focusRing:"rgba(21, 65, 148, 0.18)",focusSolid:"#154194",disabledFg:"#aeaeae",disabledBg:"#f0f0f0",chartGrid:"#dbdbdb",chartText:"#8c8c8c",track:"#f5f5f5",shadow1:"0 1px 2px rgba(1,9,26,.05),0 2px 6px rgba(1,9,26,.06)",shadow2:"0 4px 14px rgba(1,9,26,.10)",shadow3:"0 12px 32px rgba(1,9,26,.16)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#475569",statusPrimary:"#1d4ed8",statusSuccess:"#047857",statusWarning:"#b45309",statusError:"#b91c1c",statusInfo:"#0369a1",chart1:"#154194",chart2:"#91a8d1",chart3:"#8c8c8c",chart4:"#08255a",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},dh={canvas:"#01091a",surface:"#0a1526",surface2:"#061324",surface3:"#0e1b2b",fg:"#ffffff",muted:"rgba(255,255,255,0.7)",border:"rgba(255,255,255,0.12)",primary:"#154194",onPrimary:"#ffffff",link:"#91a8d1",p50:"#021432",p100:"#021a3d",p200:"#bac9e3",p300:"#91a8d1",p600:"#375ea5",p700:"#6e8cc1",accent:"#fc4c02",err:"#d53f01",errBg:"#16163b",warnBg:"#19173f",hover:"rgba(255,255,255,0.08)",selected:"rgba(21, 65, 148, 0.45)",focusRing:"rgba(145, 168, 209, 0.45)",focusSolid:"#91a8d1",disabledFg:"rgba(255,255,255,0.38)",disabledBg:"rgba(255,255,255,0.07)",chartGrid:"rgba(255,255,255,0.12)",chartText:"rgba(255,255,255,0.7)",track:"rgba(255,255,255,0.1)",shadow1:"0 1px 2px rgba(0,0,0,.4),0 2px 8px rgba(0,0,0,.35)",shadow2:"0 4px 16px rgba(0,0,0,.5)",shadow3:"0 12px 32px rgba(0,0,0,.55)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#94a3b8",statusPrimary:"#60a5fa",statusSuccess:"#34d399",statusWarning:"#fbbf24",statusError:"#f87171",statusInfo:"#38bdf8",chart1:"#154194",chart2:"#91a8d1",chart3:"rgba(255,255,255,0.7)",chart4:"#a4b8dd",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},Gs={light:ch,dark:dh},nw='"Montserrat", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif',aw=t=>{let o=Gs[t];return [o.primary,o.p300,o.muted,o.p700]},iw=10,sw="0.2s ease";I();var zc=to.createContext({mode:"light",setting:"light"}),wh=t=>{if(typeof document>"u")return;let o=document.documentElement;o.classList.toggle("orb-dark",t==="dark"),o.dataset.orbMode=t,o.style.colorScheme=t;},Hn=({mode:t,defaultMode:o="light",children:r})=>{let n=t??o,[a,i]=to.useState("light"),[s,l]=to.useState(false);to.useEffect(()=>{l(true);let m=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>i(m.matches?"dark":"light");return h(),m.addEventListener("change",h),()=>m.removeEventListener("change",h)},[]);let d=n==="system"?s?a:"light":n;to.useEffect(()=>{wh(d);},[d]);let p=to.useMemo(()=>({mode:d,setting:n}),[d,n]);return e(zc.Provider,{value:p,children:r})},fo=()=>to.useContext(zc).mode,Ks=()=>Gs[fo()];var ot=(t,o)=>{let r=Math.min(1,Math.max(0,o)),n=t.trim(),a=d=>d.split("").map(p=>p+p).join(""),i=n.startsWith("#")?n.slice(1):"",s=i.length===3?a(i):i;if(/^[0-9a-fA-F]{6}$/.test(s)){let d=parseInt(s.slice(0,2),16),p=parseInt(s.slice(2,4),16),m=parseInt(s.slice(4,6),16);return `rgba(${d}, ${p}, ${m}, ${r})`}let l=`${Math.round(r*100)}%`;return `color-mix(in oklch, ${t} ${l}, transparent)`};var Ao=t=>{let o=t.startsWith("up:")?`(min-width:${t.slice(3)}px)`:t.startsWith("down:")?`(max-width:${t.slice(5)}px)`:t,[r,n]=to.useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia(o).matches);return to.useEffect(()=>{if(typeof window.matchMedia!="function")return;let a=window.matchMedia(o),i=()=>n(a.matches);return i(),a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[o]),r};I();var Ph={accept:57435,activate:57864,activity:57769,add:57432,barChart:57417,calendar:57414,camera:57413,checklist:57952,collapseAll:57988,command:57997,copy:57925,darkMode:58122,decline:57406,delete:57405,dimension:57718,document:57780,down:57827,download:57402,duplicate:57401,edit:57400,email:57399,employee:57398,error:57836,expandAll:57987,factory:57464,favorite:57445,filter:57462,fullScreen:57702,grid:57457,hide:57834,home:57456,information:57993,inventory:57693,ipad:57491,lightMode:58121,lightbulb:57380,lineChart:57740,locked:57683,log:57378,map:57377,menu:57822,message:57884,microphone:57586,move:57832,navigationLeft:57447,navigationRight:57446,overflow:57842,overview:57551,paperPlane:57548,picture:57366,pieChart:57365,play:57499,process:57543,product:57361,pushpin:57503,qrCode:57999,receipt:57541,refresh:57360,save:57498,search:57357,show:57833,shipping:57523,slimDown:57839,slimUp:57840,sort:57853,sound:57895,splitOne:57919,splitTwo:57920,stop:57861,sum:57998,synchronize:57354,table:57530,tableColumn:57983,tableRow:57982,thumbDown:57891,thumbUp:57890,time:57508,translate:57995,tree:57588,trendDown:57931,up:57828,upload:57881,warning:57492,world:57489,wrench:57346},Th=t=>typeof t=="number"?`${t}px`:t,Ih={"2.5":10,3:12,"3.5":14,4:16,5:20,6:24,7:28,8:32,10:40,12:48},Mh=t=>{if(!t)return;let o=t.match(/(?:^|\s)(?:h|w)-(2\.5|3(?:\.5)?|4|5|6|7|8|10|12)(?:\s|$)/);return o?Ih[o[1]]:void 0},Tt=to.forwardRef(({name:t,size:o,title:r,className:n,style:a,strokeWidth:i,fill:s,...l},d)=>{let p=l["aria-label"]??r,m=Th(o??Mh(n)??"1em"),h={fontFamily:"SAP-icons",fontSize:m,fontStyle:"normal",fontWeight:"normal",lineHeight:1,width:m,height:m,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...a};return e("span",{ref:d,role:p?"img":void 0,"aria-hidden":p?void 0:true,title:r,className:n,"data-sap-icon":t,style:h,...l,children:String.fromCodePoint(Ph[t])})});Tt.displayName="SapIcon";var ie=(t,o)=>{let r=to.forwardRef((n,a)=>e(Tt,{ref:a,name:t,...n}));return r.displayName=o??`SapIcon(${t})`,r};var Wc=ie("activity","Activity"),Ea=ie("error","AlertCircle"),$c=ie("warning","AlertTriangle"),Rw=ie("down","ArrowDown"),Nw=ie("navigationRight","ArrowRight"),_c=ie("up","ArrowUp"),qs=ie("barChart","BarChart"),Dw=ie("activate","Bot"),Xs=ie("calendar","Calendar"),Aw=Xs,Ew=ie("camera","Camera"),Lw=ie("lineChart","ChartNoAxesCombined"),So=ie("accept","Check"),La=ie("accept","CheckCircle"),zo=ie("slimDown","ChevronDown"),Oa=ie("navigationLeft","ChevronLeft"),Vo=ie("navigationRight","ChevronRight"),Ow=ie("slimUp","ChevronUp"),Fw=ie("expandAll","ChevronsDown"),Bw=ie("collapseAll","ChevronsUp"),Fa=ie("error","CircleAlert"),zn=ie("accept","CircleCheck"),Hw=zn,Zs=ie("stop","CircleStop"),Gc=ie("copy","Clipboard"),zw=ie("checklist","ClipboardCheck"),Vw=ie("checklist","ClipboardList"),Uc=ie("time","Clock"),Ww=ie("tableColumn","Columns3"),Eo=ie("copy","Copy"),$w=ie("duplicate","CopyPlus"),_w=ie("delete","Delete"),Vn=ie("download","Download"),Kc=ie("edit","Edit"),qc=ie("fullScreen","Expand"),Gw=ie("show","Eye"),Uw=ie("hide","EyeOff"),Ba=ie("document","File"),Xc=ie("document","FileText"),Kw=ie("filter","Filter"),Wn=ie("tree","FolderTree"),Zc=ie("process","GitBranch"),$n=ie("world","Globe"),Yc=ie("grid","Grid"),qw=ie("move","GripVertical"),Xw=ie("wrench","Hammer"),jc=ie("picture","Image"),Ha=ie("information","Info"),Zw=ie("translate","Languages"),Yw=ie("dimension","Layers"),jw=ie("home","LayoutDashboard"),za=ie("lightbulb","Lightbulb"),Qc=ie("lineChart","LineChart"),Jc=ie("synchronize","Loader2"),Va=ie("locked","Lock"),Qw=Va,ed=ie("log","LogOut"),Ys=ie("email","Mail"),td=ie("map","MapPin"),od=ie("menu","Menu"),Rh=ie("message","MessageCircle"),rd=Rh,Wa=ie("microphone","Mic"),Jw=ie("microphone","MicOff"),nd=ie("darkMode","Moon"),eS=ie("overflow","MoreHorizontal"),tS=ie("accept","PackageCheck"),oS=ie("product","PackageSearch"),$a=ie("splitOne","PanelLeftOpen"),_a=ie("splitTwo","PanelRight"),rS=ie("overview","PanelsTopLeft"),ad=ie("pieChart","PieChart"),Jr=ie("pushpin","Pin"),nS=ie("play","Play"),en=ie("add","Plus"),aS=ie("qrCode","QrCode"),iS=ie("receipt","ReceiptText"),Ga=ie("refresh","RefreshCw"),sS=ie("activate","Rocket"),lS=ie("refresh","RotateCcw"),id=ie("refresh","RotateCw"),cS=ie("tableRow","Rows3"),dS=ie("save","Save"),pS=ie("qrCode","ScanLine"),Wo=ie("search","Search"),Nh=ie("paperPlane","Send"),sd=Nh,tn=ie("wrench","Settings"),uS=ie("accept","ShieldCheck"),mS=ie("sum","Sigma"),gS=ie("sort","SortAsc"),hS=ie("splitTwo","SquareSplitHorizontal"),fS=ie("favorite","Star"),ld=ie("lightMode","Sun"),bS=ie("table","Table2"),vS=ie("ipad","TabletSmartphone"),_n=ie("command","Terminal"),cd=ie("thumbDown","ThumbsDown"),dd=ie("thumbUp","ThumbsUp"),pd=ie("delete","Trash2"),yS=ie("tree","TreePine"),ud=ie("trendDown","TrendingDown"),Ua=ie("warning","TriangleAlert"),CS=ie("shipping","Truck"),md=ie("upload","UploadCloud"),js=ie("employee","User"),gd=ie("sound","Volume2"),xS=ie("factory","Warehouse"),wS=ie("process","Workflow"),Xt=ie("decline","X"),Ka=ie("error","XCircle");Gt();I();var Ah={contained:"primary",outlined:"secondary",text:"ghost"},Eh={small:"orb-btn-sm",medium:void 0,large:"orb-btn-lg"},Te=to.forwardRef(({variant:t="primary",size:o="medium",block:r=false,loading:n=false,startIcon:a,endIcon:i,component:s,href:l,sx:d,className:p,children:m,disabled:h,type:f="button",...u},b)=>{let C=Ah[t]??t,g=["orb-btn",`orb-btn-${C}`,Eh[o],r?"orb-btn-block":void 0,n?"orb-is-loading":void 0,p].filter(Boolean).join(" "),x=Ue(d,g),v=s??(l?"a":"button");return c(v,{ref:b,type:v==="button"?f:void 0,href:l,className:x.className,style:x.style,disabled:v==="button"?h||n:void 0,"aria-disabled":v!=="button"&&(h||n)?true:void 0,...u,children:[n&&e("span",{className:`orb-spin ${C==="primary"?"orb-spin-light":""}`,"aria-hidden":true}),!n&&a,m,!n&&i]})});Te.displayName="CButton";Gt();I();var ze=to.forwardRef(({label:t,value:o,defaultValue:r,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,type:l="text",placeholder:d,disabled:p,readOnly:m,required:h,autoFocus:f,autoComplete:u,name:b,id:C,error:g,helperText:x,dense:v=false,size:y,fullWidth:k=true,select:S=false,multiline:P=false,rows:M,children:w,variant:N,margin:A,onClick:T,startAdornment:R,endAdornment:E,InputProps:O,inputProps:$,InputLabelProps:ee,SelectProps:F,sx:G,className:W},Q)=>{let z=to.useId(),H=C??`orb-tf-${z}`,X=R??O?.startAdornment,Y=E??O?.endAdornment,te=(typeof g=="string"?g:void 0)??x,fe={id:H,className:`orb-inp ${v||y==="small"?"orb-inp-dense":""}`,style:k?void 0:{width:"auto"},value:o,defaultValue:r,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,placeholder:d,disabled:p,required:h,autoFocus:f,autoComplete:u,name:b,onClick:T,"aria-invalid":!!g},Ve=S?e("select",{...fe,ref:Q,onChange:n,children:w}):P?e("textarea",{...fe,ref:Q,onChange:n,rows:M,readOnly:m||O?.readOnly}):e("input",{...fe,ref:Q,onChange:n,type:l,readOnly:m||O?.readOnly,...$}),ve=Ue(G,`orb-fld ${g?"orb-is-error":""} ${W??""}`,{width:k?"100%":void 0});return c("div",{className:ve.className,style:ve.style,children:[t&&e("label",{htmlFor:H,children:t}),X||Y?c("div",{className:"orb-inp-adornment-wrap",children:[X&&e("span",{className:"orb-inp-adornment",children:X}),Y&&e("span",{className:"orb-inp-adornment orb-inp-adornment-end",children:Y}),Ve]}):Ve,te&&e("span",{className:"orb-fld-msg",children:te})]})});ze.displayName="CTextField";Gt();I();var Gn=to.forwardRef(({label:t,value:o,defaultValue:r,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l,minRows:d=3,multiline:p,error:m,helperText:h,fullWidth:f=true,name:u,id:b,inputProps:C,sx:g,className:x},v)=>{let y=to.useId(),k=b??`orb-ta-${y}`,P=(typeof m=="string"?m:void 0)??h,M=Ue(g,`orb-fld ${m?"orb-is-error":""} ${x??""}`,{width:f?"100%":void 0});return c("div",{className:M.className,style:M.style,children:[t&&e("label",{htmlFor:k,children:t}),e("textarea",{ref:v,id:k,className:"orb-inp",value:o,defaultValue:r,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l??d,name:u,"aria-invalid":!!m,...C}),P&&e("span",{className:"orb-fld-msg",children:P})]})});Gn.displayName="CTextArea";Gt();I();var Vt=to.forwardRef(({label:t,options:o,children:r,value:n,defaultValue:a,onChange:i,disabled:s,size:l,dense:d=true,fullWidth:p=true,minWidth:m,placeholder:h,displayEmpty:f,renderValue:u,multiple:b,MenuProps:C,variant:g,disableUnderline:x,onClick:v,onMouseDown:y,error:k,helperText:S,name:P,id:M,"aria-label":w,sx:N,className:A},T)=>{let R=to.useId(),E=M??`orb-sel-${R}`,$=(typeof k=="string"?k:void 0)??S,ee=to.useRef(null),F=to.useRef(null),[G,W]=to.useState(false),[Q,z]=to.useState(180),[H,X]=to.useState(a??"");to.useImperativeHandle(T,()=>ee.current);let Y=to.useMemo(()=>to.Children.toArray(r).flatMap(pe=>{if(!to.isValidElement(pe)||pe.type!=="option")return [];let ye=pe;return [{value:Array.isArray(ye.props.value)?ye.props.value[0]??"":ye.props.value??"",label:ye.props.children,disabled:ye.props.disabled}]}),[r]),j=o??Y,te=n??H,ce=Array.isArray(te)?te[0]??"":te,fe=String(ce??""),Ve=j.find(pe=>String(pe.value)===fe),ve=u?u(te):Ve?.label??(fe||(h??"")),xe=Ue(N,`orb-fld ${k?"orb-is-error":""} ${A??""}`,{width:p?"100%":void 0,minWidth:typeof m=="number"?`${m}px`:m});if(b)return c("div",{className:xe.className,style:xe.style,children:[t&&e("label",{htmlFor:E,children:t}),c("select",{ref:T,id:E,className:`orb-inp ${d||l==="small"?"orb-inp-dense":""}`,value:n,defaultValue:a,onChange:i,disabled:s,name:P,multiple:true,onClick:v,onMouseDown:y,"aria-invalid":!!k,"aria-label":w,children:[h!==void 0&&e("option",{value:"",children:h}),o?o.map(pe=>e("option",{value:pe.value,disabled:pe.disabled,children:pe.label},pe.value)):r]}),$&&e("span",{className:"orb-fld-msg",children:$})]});let He=pe=>{n===void 0&&X(pe);let ye=ee.current;ye&&(Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set?.call(ye,pe),i?.({target:ye,currentTarget:ye}));};return c("div",{className:xe.className,style:xe.style,children:[t&&e("label",{htmlFor:E,children:t}),e("select",{ref:ee,className:"orb-visually-hidden",tabIndex:-1,"aria-hidden":"true",name:P,value:fe,disabled:s,onChange:()=>{},children:j.map(pe=>e("option",{value:pe.value,disabled:pe.disabled,children:pe.label},String(pe.value)))}),c(Lo__namespace.Root,{open:G,onOpenChange:pe=>{pe&&z(F.current?.getBoundingClientRect().width??180),W(pe);},children:[e(Lo__namespace.Trigger,{asChild:true,children:c("button",{ref:F,id:E,type:"button",className:`orb-inp orb-select-trigger ${d||l==="small"?"orb-inp-dense":""}`,disabled:s,"aria-invalid":!!k,"aria-label":w,"aria-haspopup":"listbox","data-placeholder":!Ve&&!fe?"":void 0,onClick:v,onMouseDown:y,children:[e("span",{className:"orb-select-value",children:ve}),e(Tt,{className:"orb-select-chevron",name:"slimDown",size:12})]})}),e(Lo__namespace.Portal,{children:e(Lo__namespace.Content,{className:"orb-pop orb-select-menu",align:"start",sideOffset:5,collisionPadding:8,style:{minWidth:Q},children:e(Lo__namespace.RadioGroup,{value:fe,onValueChange:He,children:j.map(pe=>c(Lo__namespace.RadioItem,{className:"orb-select-option",value:String(pe.value),disabled:pe.disabled,children:[e("span",{className:"orb-select-check","aria-hidden":"true",children:String(pe.value)===fe?e(Tt,{name:"accept",size:13}):null}),e("span",{children:pe.label})]},String(pe.value)))})})})]}),$&&e("span",{className:"orb-fld-msg",children:$})]})});Vt.displayName="CSelect";Gt();I();var It=to.forwardRef(({label:t,checked:o,defaultChecked:r,onChange:n,disabled:a,indeterminate:i,name:s,value:l,id:d,size:p,color:m,onClick:h,inputProps:f,sx:u,className:b},C)=>{let g=Ue([{...p==="small"?{fontSize:13}:void 0,...m?{color:m}:void 0},...Array.isArray(u)?u:u?[u]:[]],`orb-chk ${b??""}`),x=e("input",{ref:v=>{v&&(v.indeterminate=!!i),typeof C=="function"?C(v):C&&(C.current=v);},type:"checkbox",id:d,checked:o,defaultChecked:r,onChange:n,readOnly:o!==void 0&&n===void 0,disabled:a,name:s,value:l,onClick:h,...f});return t==null?e("span",{className:g.className,style:g.style,children:x}):c("label",{className:g.className,style:g.style,children:[x,e("span",{children:t})]})});It.displayName="CCheckbox";I();var Kh=({label:t,options:o,value:r,defaultValue:n,onChange:a,name:i,row:s=false,disabled:l,sx:d,className:p})=>{let m=to.useId(),h=i??`orb-rdo-${m}`;return c("div",{className:`orb-fld ${p??""}`,style:d,role:"radiogroup",children:[t&&e("span",{className:"orb-fld-label",children:t}),e("div",{style:{display:"flex",flexDirection:s?"row":"column",gap:s?24:8,flexWrap:"wrap"},children:o.map(f=>c("label",{className:"orb-rdo",children:[e("input",{type:"radio",name:h,value:f.value,checked:r!==void 0?r===f.value:void 0,defaultChecked:n!==void 0?n===f.value:void 0,onChange:a?u=>a(u,f.value):void 0,disabled:l||f.disabled}),e("span",{children:f.label})]},f.value))})]})};Gt();I();var qa=to.forwardRef(({label:t,checked:o,defaultChecked:r,onChange:n,disabled:a,name:i,id:s,size:l,sx:d,className:p},m)=>{let h=Ue([{...l==="small"?{transform:"scale(.86)",transformOrigin:"center"}:void 0},...Array.isArray(d)?d:d?[d]:[]],`orb-sw ${p??""}`),f=e("input",{ref:m,type:"checkbox",role:"switch",id:s,checked:o,defaultChecked:r,onChange:n?u=>n(u,u.target.checked):void 0,disabled:a,name:i});return t==null?e("span",{className:h.className,style:h.style,children:f}):c("label",{className:h.className,style:h.style,children:[f,e("span",{children:t})]})});qa.displayName="CSwitch";Gt();I();var Zh={default:"gray",primary:"blue",success:"blue",info:"blue",warning:"orange",error:"orange"},xt=to.forwardRef(({label:t,children:o,tone:r,color:n="default",variant:a,size:i="medium",clickable:s,avatar:l,icon:d,onDelete:p,onClick:m,sx:h,className:f},u)=>{let b=r??(a==="outlined"&&n==="default"?"outline":Zh[n]??"gray"),C=s??!!m,g=Ue([{cursor:C?"pointer":void 0,...i==="small"?{height:24,fontSize:11,px:1}:void 0},...Array.isArray(h)?h:h?[h]:[]],`orb-chip orb-chip-${b} ${f??""}`);return c("span",{ref:u,className:g.className,style:g.style,onClick:m,role:C?"button":void 0,tabIndex:C?0:void 0,onKeyDown:C?x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),m?.(x));}:void 0,children:[l??d,e("span",{className:"orb-chip-label",children:o??t}),p&&e("button",{type:"button","aria-label":"Remove",onClick:x=>{x.stopPropagation(),p(x);},style:{background:"none",border:"none",padding:0,display:"inline-flex",cursor:"pointer",color:"inherit"},children:e(Xt,{size:13,strokeWidth:2})})]})});xt.displayName="CChip";Gt();I();var Xa=to.forwardRef(({badgeContent:t,color:o="primary",children:r,invisible:n=false,sx:a,className:i},s)=>{let l=Ue(a,i,{display:"inline-flex",position:r?"relative":void 0}),d=!n&&t!==void 0&&t!==null&&e("span",{className:`orb-badge ${o==="error"?"orb-badge-err":o==="muted"?"orb-badge-muted":""}`,style:r?{position:"absolute",top:-6,right:-6,zIndex:1}:void 0,children:t});return r?c("span",{ref:s,className:l.className,style:l.style,children:[r,d]}):e("span",{ref:s,className:l.className,style:l.style,children:d})});Xa.displayName="CBadge";Gt();I();var on=to.forwardRef(({children:t,src:o,alt:r,size:n=28,sx:a,className:i},s)=>{let l=Ue([{width:n,height:n,fontSize:n*.4},...Array.isArray(a)?a:a?[a]:[]],`orb-avatar ${i??""}`);return e("span",{ref:s,className:l.className,style:l.style,children:o?e("img",{src:o,alt:r??"",style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):t})});on.displayName="CAvatar";Gt();I();var rn=to.forwardRef(({severity:t="info",title:o,children:r,onClose:n,sx:a,className:i},s)=>{let l=Ue(a,`orb-alert orb-alert-${t} ${i??""}`);return c("div",{ref:s,role:"alert",className:l.className,style:l.style,children:[c("div",{style:{flex:1,minWidth:0},children:[o&&e("b",{children:o}),r&&e("span",{children:r})]}),n&&e("button",{type:"button","aria-label":"Close",onClick:n,style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"inherit",font:"500 14px/1 var(--orb-font)",opacity:.7},children:"\u2715"})]})});rn.displayName="CAlert";Gt();I();var Un=({value:t,variant:o,color:r,sx:n,className:a})=>{let i=o==="indeterminate"||t===void 0,s=Ue(n,`orb-prog ${a??""}`);return c("div",{className:s.className,role:"progressbar","aria-valuenow":i?void 0:Math.round(t),"aria-valuemin":i?void 0:0,"aria-valuemax":i?void 0:100,style:s.style,children:[e("i",{style:i?{width:"40%",animation:"orb-prog-ind 1.2s ease-in-out infinite"}:{width:`${Math.min(100,Math.max(0,t))}%`,background:r}}),i&&e("style",{children:"@keyframes orb-prog-ind { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }"})]})},Jh=({width:t,height:o=14,variant:r="rectangular",sx:n,className:a})=>e("div",{className:`orb-skel ${a??""}`,style:{width:t,height:o,borderRadius:r==="circular"?"50%":r==="text"?6:"var(--orb-r)",...n}}),jo=({size:t=12,onPrimary:o=false,sx:r,className:n})=>e("span",{className:`orb-spin ${o?"orb-spin-light":""} ${n??""}`,style:{width:t,height:t,...r},role:"status","aria-label":"Loading"});I();var dt=({title:t,children:o,enterDelay:r=300,side:n="top",align:a="center",disabled:i})=>!t||i?e(jsxRuntime.Fragment,{children:o}):e(Qo__namespace.Provider,{delayDuration:r,skipDelayDuration:200,children:c(Qo__namespace.Root,{children:[e(Qo__namespace.Trigger,{asChild:true,children:o}),e(Qo__namespace.Portal,{children:e(Qo__namespace.Content,{className:"orb-tooltip",side:n,align:a,sideOffset:6,children:t})})]})});Gt();I();var se=to.forwardRef(({tooltip:t,size:o="small",active:r=false,edge:n,color:a,sx:i,className:s,children:l,type:d="button",...p},m)=>{let h=Ue([{color:r?"var(--orb-primary)":a,...n==="start"?{marginLeft:-8}:n==="end"?{marginRight:-8}:void 0},...Array.isArray(i)?i:i?[i]:[]],`orb-icon-btn ${o==="small"?"orb-icon-btn-sm":""} ${s??""}`),f=e("button",{ref:m,type:d,className:h.className,style:h.style,...p,children:l});return t?e(dt,{title:t,children:f}):f});se.displayName="CIconButton";Gt();I();var Kn=({value:t,options:o,onValueChange:r,size:n="medium",sx:a,className:i,...s})=>{let l=to.useRef([]),d=o.findIndex(u=>!u.disabled),p=o.findIndex(u=>u.value===t),m=(u,b)=>{let C=o.map((v,y)=>v.disabled?-1:y).filter(v=>v>=0);if(C.length===0)return;let g=C.indexOf(b),x;u.key==="Home"&&(x=C[0]),u.key==="End"&&(x=C[C.length-1]),(u.key==="ArrowRight"||u.key==="ArrowDown")&&(x=C[(g+1+C.length)%C.length]),(u.key==="ArrowLeft"||u.key==="ArrowUp")&&(x=C[(g-1+C.length)%C.length]),x!==void 0&&(u.preventDefault(),l.current[x]?.focus(),r(o[x].value));},h=Ue(a,["orb-segmented-control",n==="small"?"orb-segmented-control-sm":"",i].filter(Boolean).join(" ")),f={...h.style,"--orb-segmented-count":Math.max(o.length,1),"--orb-segmented-index":Math.max(p,0)};return c("div",{role:"radiogroup",className:h.className,style:f,"data-has-selection":p>=0?"true":"false",...s,children:[e("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),o.map((u,b)=>{let C=u.value===t;return e(se,{ref:g=>{l.current[b]=g;},className:["orb-segmented-control-item",u.icon?"":"orb-segmented-control-item-label"].filter(Boolean).join(" "),size:n,tooltip:u.label,role:"radio","aria-label":u.label,"aria-checked":C,"data-selected":C?"true":void 0,disabled:u.disabled,tabIndex:C||t==null&&b===d?0:-1,onClick:()=>r(u.value),onKeyDown:g=>m(g,b),children:u.icon??e("span",{className:"orb-segmented-control-label",children:u.label})},u.value)})]})};Gt();I();var Jt=({triggerLabel:t,items:o=[],trigger:r,align:n="start",anchorEl:a,open:i,onClose:s,children:l,slotProps:d,PaperProps:p,anchorPosition:m,sx:h})=>{let f=to.useRef(null);if(to.useEffect(()=>{if(i!==true)return;let u=C=>{let g=C.composedPath();f.current&&g.includes(f.current)||a&&g.includes(a)||s?.();},b=C=>{C.key==="Escape"&&s?.();};return document.addEventListener("pointerdown",u,true),document.addEventListener("keydown",b,true),()=>{document.removeEventListener("pointerdown",u,true),document.removeEventListener("keydown",b,true);}},[a,s,i]),i!==void 0){if(!i||typeof document>"u")return null;let u=a?.getBoundingClientRect(),b=window.innerWidth,C=u?.left??16,g=u?.right??C,x=d?.paper?.sx??p?.sx,v=Ue([...Array.isArray(x)?x:x?[x]:[],...Array.isArray(h)?h:h?[h]:[]],"orb-pop orb-menu",d?.paper?.style??p?.style),y=to.Children.map(l,k=>{if(!to.isValidElement(k)||k.type!=="option")return k;let S=k.props,{children:P,disabled:M,selected:w}=S,N=Ue(S.sx,`orb-menu-item ${w?"orb-selected":""} ${S.className??""}`,S.style);return e("div",{role:"menuitem","aria-disabled":M||void 0,"aria-selected":w||void 0,tabIndex:M?-1:0,id:S.id,title:S.title,className:N.className,style:N.style,onClick:M?void 0:S.onClick,onKeyDown:A=>{!M&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),S.onClick?.(A));},children:P})});return reactDom.createPortal(e("div",{ref:f,role:"menu",className:v.className,style:{...v.style,position:"fixed",left:n==="end"&&!m?void 0:m?.left??C,right:n==="end"&&!m?Math.max(16,b-g):void 0,top:m?.top??(u?.bottom??16)+6,maxWidth:"calc(100vw - 32px)",zIndex:1301},children:y}),document.body)}return c(Lo__namespace.Root,{children:[e(Lo__namespace.Trigger,{asChild:true,children:r??e(Te,{variant:"primary",children:t})}),e(Lo__namespace.Portal,{children:e(Lo__namespace.Content,{className:"orb-pop orb-menu",align:n,sideOffset:6,children:o.map((u,b)=>c(Lo__namespace.Item,{className:"orb-menu-item",disabled:u.disabled,onSelect:()=>u.onClick?.(),children:[u.icon,u.label]},b))})})]})};Gt();I();var Ae=to.forwardRef(({elevation:t=1,variant:o,component:r,sx:n,style:a,className:i,children:s,...l},d)=>{let p=r??"div",m=Ue(n,`orb-card ${t>0&&o!=="outlined"?"orb-card-raised":""} ${i??""}`,a);return e(p,{ref:d,className:m.className,style:m.style,...l,children:s})});Ae.displayName="CPaper";Gt();I();var Nt=to.forwardRef(({orientation:t="horizontal",flexItem:o,sx:r,className:n},a)=>{let i=Ue([{...t==="vertical"?{alignSelf:"stretch",height:"auto"}:{width:"100%"},...o?{alignSelf:"stretch"}:void 0},...Array.isArray(r)?r:r?[r]:[]],`${t==="vertical"?"orb-divider-v":"orb-divider"} ${n??""}`);return e("hr",{ref:a,"aria-orientation":t,className:i.className,style:i.style})});Nt.displayName="CDivider";Gt();I();var pf={h1:"orb-h1",h2:"orb-h2",h3:"orb-h3",h4:"orb-h3",h5:"orb-subtitle",h6:"orb-subtitle",subtitle1:"orb-subtitle",subtitle2:"orb-label",body1:"orb-body",body2:"orb-body-dense",label:"orb-label",caption:"orb-meta",overline:"orb-overline"},uf={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},L=to.forwardRef(({variant:t="body1",component:o,muted:r=false,numeric:n=false,color:a,noWrap:i=false,fontWeight:s,sx:l,className:d,children:p,...m},h)=>{let f=o??uf[t]??"span",b=[t==="inherit"?void 0:pf[t],d].filter(Boolean).join(" "),C=Ue([{...r?{color:"var(--orb-muted)"}:void 0,...a?{color:a}:void 0,...n?{fontVariantNumeric:"tabular-nums"}:void 0,...s?{fontWeight:s}:void 0,...i?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:void 0},...Array.isArray(l)?l:l?[l]:[]],b);return e(f,{ref:h,className:C.className,style:C.style,...m,children:p})});L.displayName="CTypography";Gt();I();var gf=t=>{if(t!==void 0)return typeof t=="number"?`${t*8}px`:t},le=to.forwardRef(({direction:t="column",spacing:o,alignItems:r,justifyContent:n,flexWrap:a,flex:i,useFlexGap:s,sx:l,className:d,children:p,...m},h)=>{let f=Ue([{display:"flex",flexDirection:t,gap:gf(o),alignItems:r,justifyContent:n,flexWrap:a,flex:i},...Array.isArray(l)?l:l?[l]:[]],d);return e("div",{ref:h,className:f.className,style:f.style,...m,children:p})});le.displayName="CStack";Gt();I();var Ot=({open:t,onClose:o,title:r,children:n,actions:a,maxWidth:i=560,fullWidth:s=false,fullScreen:l=false,PaperProps:d,slotProps:p,disableRestoreFocus:m,keepMounted:h,hideCloseButton:f=false,sx:u,className:b})=>{let C=Ue([{width:l?"100vw":s?"min(920px, calc(100vw - 32px))":void 0,height:l?"100vh":void 0,maxWidth:l?"none":typeof i=="number"?`${i}px`:i},...Array.isArray(d?.sx??p?.paper?.sx)?d?.sx??p?.paper?.sx:d?.sx??p?.paper?.sx?[d?.sx??p?.paper?.sx]:[],...Array.isArray(u)?u:u?[u]:[]],`orb-dialog ${b??""}`);return e(Po__namespace.Root,{open:t,onOpenChange:g=>{g||o?.();},children:c(Po__namespace.Portal,{children:[e(Po__namespace.Overlay,{className:"orb-overlay"}),c(Po__namespace.Content,{className:C.className,style:C.style,children:[(r||!f)&&c("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},children:[r?e(Po__namespace.Title,{className:"orb-dialog-title",children:r}):e(Po__namespace.Title,{className:"orb-visually-hidden",children:"Dialog"}),!f&&e(Po__namespace.Close,{asChild:true,children:e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Close",style:{marginTop:-4,marginRight:-4},children:e(Xt,{size:16,strokeWidth:2})})})]}),e("div",{style:{minWidth:0},children:n}),a&&e("div",{className:"orb-dialog-actions",children:a})]})]})})};I();var Js=({open:t,defaultOpen:o,onOpenChange:r,trigger:n,children:a,align:i="start",side:s="bottom",sideOffset:l=6,matchTriggerWidth:d=false,sx:p,className:m})=>c(yr__namespace.Root,{open:t,defaultOpen:o,onOpenChange:r,children:[e(yr__namespace.Trigger,{asChild:true,children:n}),e(yr__namespace.Portal,{children:e(yr__namespace.Content,{className:`orb-pop ${m??""}`,align:i,side:s,sideOffset:l,style:{minWidth:d?"var(--radix-popover-trigger-width)":void 0,...p},onOpenAutoFocus:h=>h.preventDefault(),children:a})})]});I();var bf=({items:t,value:o,defaultValue:r,onChange:n,sx:a,className:i})=>{let s=o!==void 0,[l,d]=to.useState(r??t[0]?.value),p=s?o:l,m=to.useRef([]),h=u=>{s||d(u),n?.(u);},f=u=>{if(u.key!=="ArrowRight"&&u.key!=="ArrowLeft")return;u.preventDefault();let b=t.filter(v=>!v.disabled),C=b.findIndex(v=>v.value===p),g=u.key==="ArrowRight"?1:-1,x=b[(C+g+b.length)%b.length];if(x){h(x.value);let v=t.findIndex(y=>y.value===x.value);m.current[v]?.focus();}};return e("div",{className:`orb-tabs ${i??""}`,role:"tablist",style:a,onKeyDown:f,children:t.map((u,b)=>{let C=u.value===p;return c("button",{ref:g=>{m.current[b]=g;},type:"button",role:"tab","aria-selected":C,disabled:u.disabled,className:`orb-tab ${C?"orb-is-active":""}`,style:{display:"inline-flex",alignItems:"center",gap:6},onClick:()=>h(u.value),children:[u.icon,u.label]},u.value)})})};I();var yf=["su","mo","tu","we","th","fr","sa"],qn=(t,o)=>!!(t&&o&&t.isSame(o,"day")),Xn=({value:t,rangeStart:o,rangeEnd:r,onChange:n,month:a,defaultMonth:i,onMonthChange:s,minDate:l,maxDate:d,locale:p,renderDay:m})=>{let h=a!==void 0,[f,u]=to.useState(()=>i??t??o??ar__default.default()),b=(h?a:f).startOf("month"),C=S=>{h||u(S),s?.(S);},g=to.useMemo(()=>p?b.locale(p):b,[b,p]),x=to.useMemo(()=>{let P=b.startOf("month").startOf("week"),M=[],w=P;for(let N=0;N<6;N+=1){let A=[];for(let T=0;T<7;T+=1)A.push(w),w=w.add(1,"day");if(M.push(A),w.isAfter(b.endOf("month"))&&N>=3)break}return M},[b]),v=to.useMemo(()=>{let S=p?ar__default.default().locale(p):ar__default.default();return yf.map((P,M)=>S.startOf("week").add(M,"day").format("dd"))},[p]),y=S=>!!(l&&S.isBefore(l.startOf("day"))||d&&S.isAfter(d.startOf("day"))),k=o!==void 0||r!==void 0;return c("div",{className:"orb-cal",children:[c("div",{className:"orb-cal-head",children:[e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Previous month",onClick:()=>C(b.subtract(1,"month")),children:e(Oa,{size:16,strokeWidth:2})}),e("span",{className:"orb-cal-title","aria-live":"polite",children:g.format("MMMM YYYY")}),e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Next month",onClick:()=>C(b.add(1,"month")),children:e(Vo,{size:16,strokeWidth:2})})]}),c("div",{className:"orb-cal-grid",role:"grid",children:[v.map((S,P)=>e("span",{className:"orb-cal-dow",children:S},`${S}-${P}`)),x.flat().map(S=>{let P=!S.isSame(b,"month"),M=y(S),w=k?qn(S,o)||qn(S,r):qn(S,t),N=S.isSame(ar__default.default(),"day"),A=k&&o&&r&&S.isAfter(o.startOf("day"))&&S.isBefore(r.startOf("day")),T=k&&qn(S,o)&&!!r,R=k&&qn(S,r)&&!!o,E=["orb-cal-day",P?"orb-is-outside":void 0,N?"orb-is-today":void 0,w?"orb-is-selected":void 0,A?"orb-is-in-range":void 0,T?"orb-is-range-start":void 0,R?"orb-is-range-end":void 0].filter(Boolean).join(" ");return m?e("span",{className:"orb-cal-day-slot",children:m(S,{outsideCurrentMonth:P,selected:w,today:N,disabled:M})},S.format("YYYY-MM-DD")):e("button",{type:"button",role:"gridcell","aria-selected":w,"aria-current":N?"date":void 0,className:E,disabled:M,onClick:()=>n?.(S),children:S.date()},S.format("YYYY-MM-DD"))})]})]})};I();ar__default.default.extend(Cf__default.default);var xf=({label:t,value:o,defaultValue:r,onChange:n,minDate:a,maxDate:i,disabled:s,format:l="YYYY-MM-DD",placeholder:d,locale:p,dense:m=false,error:h,helperText:f,sx:u,className:b})=>{let C=o!==void 0,[g,x]=to.useState(r??null),v=C?o:g,[y,k]=to.useState(false),[S,P]=to.useState(null),M=R=>{C||x(R),n?.(R);},w=S??(v?(p?v.locale(p):v).format(l):""),N=()=>{if(S===null)return;let R=S.trim();if(!R)M(null);else {let E=ar__default.default(R,l,true);E.isValid()&&!(a&&E.isBefore(a.startOf("day")))&&!(i&&E.isAfter(i.startOf("day")))&&M(E);}P(null);},T=(typeof h=="string"?h:void 0)??f;return c("div",{className:`orb-fld ${h?"orb-is-error":""} ${b??""}`,style:u,children:[t&&e("label",{children:t}),e(Js,{open:y,onOpenChange:k,trigger:c("div",{className:"orb-inp-adornment-wrap",style:{width:"100%"},children:[e("span",{className:"orb-inp-adornment",children:e(Xs,{size:15,strokeWidth:1.8})}),e("input",{className:`orb-inp ${m?"orb-inp-dense":""}`,value:w,placeholder:d??l,disabled:s,onFocus:()=>k(true),onChange:R=>P(R.target.value),onBlur:N,onKeyDown:R=>{R.key==="Enter"&&(N(),k(false)),R.key==="Escape"&&k(false);}})]}),children:e(Xn,{value:v,onChange:R=>{M(R),P(null),k(false);},minDate:a,maxDate:i,locale:p,defaultMonth:v??void 0})}),T&&e("span",{className:"orb-fld-msg",children:T})]})};I();var Sf=({onFilesSelected:t,multiple:o=false,accept:r="*",maxSize:n,title:a="Drag and drop files here or click to upload",subtitle:i="Support for bulk upload",sx:s})=>{let[l,d]=to.useState(false),[p,m]=to.useState([]),h=to.useRef(null),f=v=>{v.preventDefault(),d(true);},u=v=>{v.preventDefault(),d(false);},b=v=>{v.preventDefault(),d(false),g(Array.from(v.dataTransfer.files));},C=v=>{v.target.files&&g(Array.from(v.target.files));},g=v=>{let y=n?v.filter(S=>S.size<=n):v;y.length<v.length&&console.warn(`Some files were rejected because they exceed the maximum size of ${n} bytes.`);let k=o?[...p,...y]:y;o&&(k=k.filter((S,P,M)=>P===M.findIndex(w=>w.name===S.name&&w.size===S.size&&w.lastModified===S.lastModified))),m(k),t?.(k),h.current&&(h.current.value="");},x=v=>{let y=p.filter((k,S)=>S!==v);m(y),t?.(y);};return c("div",{style:{width:"100%",...s},children:[c("div",{onClick:()=>h.current?.click(),onDragOver:f,onDragLeave:u,onDrop:b,role:"button",tabIndex:0,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),h.current?.click());},style:{border:`2px dashed ${l?"var(--orb-primary)":"var(--orb-border)"}`,borderRadius:"var(--orb-r)",padding:32,textAlign:"center",cursor:"pointer",backgroundColor:l?"var(--orb-hover)":"var(--orb-canvas)",transition:"border-color var(--orb-t-fast), background-color var(--orb-t-fast)"},children:[e("input",{type:"file",ref:h,style:{display:"none"},multiple:o,accept:r,onChange:C}),c("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[e(md,{size:40,strokeWidth:1.5,color:l?"var(--orb-primary)":"var(--orb-muted)"}),e("span",{className:"orb-subtitle",children:a}),e("span",{className:"orb-meta",children:i})]})]}),p.length>0&&e("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:16},children:p.map((v,y)=>c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",border:"1px solid var(--orb-border)",borderRadius:"var(--orb-r)",backgroundColor:"var(--orb-surface)"},children:[c("div",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[e(Xc,{size:16,strokeWidth:1.8,color:"var(--orb-muted)"}),e("span",{className:"orb-body-dense",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:v.name}),c("span",{className:"orb-meta",children:["(",(v.size/1024).toFixed(1)," KB)"]})]}),e(se,{"aria-label":`Remove ${v.name}`,onClick:()=>x(y),children:e(pd,{size:15,strokeWidth:1.8})})]},`${v.name}-${y}`))})]})};function yo(...t){return tailwindMerge.twMerge(clsx.clsx(t))}var Ya={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"},Zn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},vd=()=>"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";I();var Mf=classVarianceAuthority.cva(vd(),{variants:{variant:{default:`${Ya.primary} shadow-sm`,destructive:"bg-[var(--orb-status-error)] text-[var(--orb-on-primary)] hover:opacity-90 active:opacity-80 shadow-sm",outline:`${Ya.outline} shadow-sm`,secondary:"bg-[var(--orb-surface-2)] text-[var(--orb-fg)] hover:bg-[var(--orb-hover)] active:bg-[var(--orb-selected)] shadow-sm",ghost:Ya.ghost,link:"text-[var(--orb-status-primary)] underline-offset-4 hover:underline hover:text-[var(--orb-status-primary)] active:text-[var(--orb-p700)]","chat-tool":"bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-text-2)] hover:bg-[var(--orbai-surface-3)] hover:border-[var(--orbai-border-strong)] hover:text-[var(--orbai-text-1)] active:scale-95 transition-all duration-200","chat-send":"bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] text-[var(--orb-on-primary)] border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 transition-all duration-200","chat-stop":"bg-[var(--orb-status-error)] hover:opacity-90 border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 text-[var(--orb-on-primary)] transition-all duration-200","chat-disabled":"cursor-not-allowed opacity-50 bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-muted)]"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3",lg:"h-11 px-8",icon:"h-10 w-10","chat-sm":"h-8 w-8 rounded-full","chat-md":"h-10 w-10 rounded-full","chat-lg":"h-12 w-12 rounded-full"},rounded:{none:Zn.none,sm:Zn.sm,md:Zn.md,full:Zn.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),ol=to__namespace.forwardRef(({className:t,variant:o,size:r,asChild:n=false,...a},i)=>e(n?reactSlot.Slot:"button",{className:yo(Mf({variant:o,size:r,className:t})),ref:i,...a}));ol.displayName="Button";var Rf={"common.cancel":"Cancel","common.save":"Save","common.ok":"OK","common.done":"Done","common.search":"Search","common.none":"None","common.all":"All","common.noData":"No data","common.copy":"Copy","common.delete":"Delete","common.loading":"Loading...","header.searchPlaceholder":"Ask me...","header.searchAddFeature":"Add feature","header.searchStartVoice":"Start voice input","header.searchStopVoice":"Stop voice input","header.searchOpenPanel":"Open conversation","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dark","header.theme.light":"Theme: Light","header.menu.setting":"Setting","header.menu.refresh":"Refresh","header.menu.logout":"Logout","navigation.expand":"Expand navigation","navigation.collapse":"Collapse navigation","navigation.searchPlaceholder":"Search menu...","navigation.noMatch":"No matching menu items","navigation.noAccessibleApp":"No accessible applications","navigation.noItems":"No items to display","navigation.expandView":"Expand {title}","navigation.mode.switchToFixed":"Switch to fixed navigation","navigation.mode.switchToFloating":"Switch to floating navigation","navigation.pinned":"Pinned","navigation.pin.add":"Pin to top","navigation.pin.remove":"Unpin","table.toolbar.searchPlaceholder":"Search...","table.title.default":"Data Table","table.toolbar.groupBy":"Group By","table.toolbar.summary":"Summary","table.toolbar.columns":"Columns","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Items per page:","table.toolbar.pageOf":"Page {current} of {total}","table.toolbar.newItem":"New Item","table.toolbar.editItem":"Edit Item","table.toolbar.deleteItem":"Delete Item","table.toolbar.graphicReport":"Graphic Report","table.toolbar.saveLayout":"Save Layout","table.menu.groupBy":"Group By","table.menu.clearAll":"Clear All","table.menu.visibleColumns":"Visible Columns","table.menu.showSummaryRow":"Show Summary Row","table.menu.noNumericColumns":"No numeric columns","table.group.expandAll":"Expand All Groups","table.group.collapseAll":"Collapse All Groups","table.mobile.notImplemented":"Mobile View Not Implemented","table.headerMenu.sortAsc":"Sort Ascending","table.headerMenu.sortDesc":"Sort Descending","table.headerMenu.clearSort":"Clear Sort","table.headerMenu.configureSort":"Configure Sort...","table.headerMenu.group":"Group by this column","table.headerMenu.ungroup":"Remove from grouping","table.headerMenu.addSummary":"Include in Summary","table.headerMenu.removeSummary":"Remove from Summary","table.headerMenu.hideColumn":"Hide Column","table.sortDialog.title":"Sort Settings","table.sortDialog.empty":"No sort rules. Add one to start ordering rows.","table.sortDialog.addRule":"Add Sort Rule","table.sortDialog.clearAll":"Clear All","table.sortDialog.asc":"Ascending","table.sortDialog.desc":"Descending","pivot.title.default":"Pivot Table Builder","pivot.subtitle.default":"Drag fields to configure the pivot table.","pivot.empty":"Drag at least one field into Values to render the pivot result.","pivot.records":"Records","pivot.afterFilter":"After filter","pivot.grandTotal":"Grand Total","pivot.resultLabel":"Result","pivot.valueLabel":"Value","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Field List","pivot.availableDimensions":"Available dimensions","pivot.allFieldsInUse":"All fields are in use.","pivot.zone.rows":"Rows","pivot.zone.columns":"Columns","pivot.zone.filters":"Filters","pivot.zone.values":"Values","pivot.hint.rows":"Drag fields here to build row hierarchy","pivot.hint.columns":"Drag fields here to build column hierarchy","pivot.hint.filters":"Drag fields here for report filters","pivot.hint.values":"Drag numeric fields here for aggregation","pivot.clearArea":"Clear area","pivot.filter.na":"N/A","pivot.filter.noValues":"No values","pivot.filter.noneSelected":"None selected","pivot.filter.allValues":"All values","pivot.filter.selectedCount":"{selected} / {total} selected","pivot.filter.selectAll":"Select All","pivot.filter.deselectAll":"Deselect All","pivot.filter.noResults":"No results","pivot.collapse.ariaExpand":"Expand configuration area","pivot.collapse.ariaCollapse":"Collapse configuration area","pivot.agg.sum":"Sum","pivot.agg.count":"Count","pivot.agg.avg":"Average","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Select preset","pivot.preset.save":"Save preset","pivot.preset.delete":"Delete preset","pivot.preset.saveDialogTitle":"Save current preset","pivot.preset.nameLabel":"Preset name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot Result","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Expand pivot result","pivot.table.collapse.ariaCollapse":"Collapse pivot result","pivot.chart.title":"Pivot Chart","pivot.chart.subtitle":"Map one dimension and up to two measures into a compact chart.","pivot.chart.subtitleReady":"{dimension} by {measure}","pivot.chart.emptyNoDimension":"Add at least one row or column field to render the chart.","pivot.chart.emptyNoValue":"Add at least one value field to render the chart.","pivot.chart.emptyNoData":"No data available for the current chart selection.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Measure","pivot.chart.secondaryMeasure":"Compare measure","pivot.chart.chartType":"Chart type","pivot.chart.style.barVertical":"Vertical bars","pivot.chart.style.barHorizontal":"Horizontal bars","pivot.chart.style.line":"Line","pivot.chart.style.scatter":"Scatter","pivot.chart.collapse.ariaExpand":"Expand chart area","pivot.chart.collapse.ariaCollapse":"Collapse chart area","smartFilter.adaptFilters":"Adapt Filters","smartFilter.addFilters":"Add Filters","smartFilter.go":"Go","smartFilter.visibleFilters":"Visible Filters","smartFilter.searchPlaceholder":"Search...","smartFilter.noOptionsFound":"No options found","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Equals","smartFilter.operator.contains":"Contains","smartFilter.operator.notContains":"Does Not Contain","smartFilter.operator.wildcard":"Wildcard Search","smartFilter.operator.notEquals":"Not Equals","smartFilter.operator.greaterThan":"Greater Than","smartFilter.operator.lessThan":"Less Than","smartFilter.operator.greaterOrEqual":"Greater Than or Equal","smartFilter.operator.lessOrEqual":"Less Than or Equal","smartFilter.operator.between":"Between","variant.noOptions":"No options","variant.defaultSuffix":"Default","variant.selectVariant":"Select Variant","variant.saveView":"Save View","variant.newVariant":"New Variant","variant.viewName":"View Name","variant.setDefault":"Set as Default","variant.publicAllUsers":"Public (All Users)","variant.toast.fetchFailed":"Failed to load variants","variant.toast.saveFailed":"Failed to save variant","variant.toast.saveSuccess":"Variant saved successfully","variant.toast.deleteFailed":"Failed to delete variant","variant.toast.deleteSuccess":"Variant deleted successfully","variant.toast.defaultFailed":"Failed to update default variant","variant.toast.defaultSuccess":"Default variant updated","layout.saveLayout":"Save Layout","layout.layoutOptions":"Layout Options","layout.selectLayout":"Select Layout","layout.saveCurrentLayout":"Save Current Layout...","layout.noSavedLayouts":"No saved layouts","layout.removeDefault":"Remove Default","layout.setAsDefault":"Set as Default","layout.layoutName":"Layout Name","layout.layoutDescription":"Description","layout.layoutNameHelper":"e.g., 'Compact View'","layout.warningOverwrite":"Warning: Existing layout will be overwritten","layout.useAsDefault":"Use as Default Layout","layout.publicAllUsers":"Public (Visible to all users)","layout.toast.loadFallback":"Failed to load layouts from backend, fallback to local storage","layout.toast.saveSuccess":"Layout saved successfully","layout.toast.saveLocalSuccess":"Layout saved to local storage","layout.toast.backendUnavailableSavedLocal":"Backend unavailable, saved to local storage","layout.toast.deleteSuccess":"Layout deleted successfully","layout.toast.deleteLocalSuccess":"Layout deleted from local storage","layout.toast.backendUnavailableDeletedLocal":"Backend unavailable, deleted from local storage","layout.toast.defaultSuccess":"Default layout set","layout.toast.defaultLocalSuccess":"Default layout set in local storage","layout.toast.backendUnavailableDefaultLocal":"Backend unavailable, default saved to local storage","dateRange.label":"Date Range","dateRange.startDate":"Start Date","dateRange.endDate":"End Date","dateRange.select":"Select...","dateRange.today":"Today","dateRange.thisWeek":"This Week","dateRange.thisMonth":"This Month","graph.records":"{count} records","graph.kpi.totalRecords":"Total Records","graph.kpi.totalReport":"Total Report","graph.kpi.totalBillable":"Total Billable","graph.kpi.efficiency":"Efficiency","graph.kpi.amount":"Amount","graph.kpi.flagged":"Flagged","graph.chart.billable.title":"Billable by Dimension","graph.chart.billable.subtitle":"Top values by billable hours","graph.chart.efficiency.title":"Efficiency by Person","graph.chart.efficiency.subtitle":"Lowest efficiency first","graph.chart.status.title":"Status Distribution","graph.chart.status.subtitle":"Record ratio by status","graph.dataBody":"Data Body","graph.reportTitle":"Graphic Report","graph.unassigned":"Unassigned","graph.column.reportHours":"Report Hours","graph.column.billableHours":"Billable Hours","detail.searchAi.placeholder":"Search fields, or ask AI if no match...","detail.searchAi.matches":"{count} matches found","detail.searchAi.noMatch":"No matching field found.","detail.searchAi.autoAiFallback":"No direct match. Triggering AI analysis...","detail.searchAi.aiResultTitle":"AI Insight","detail.table.title":"Related Records","kanban.empty":"Drop cards here","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Release to move into this bucket","kanban.bucket.add":"Add bucket","kanban.bucket.rename":"Rename bucket","kanban.bucket.saveRename":"Save bucket name","kanban.bucket.cancelRename":"Cancel renaming","kanban.search.placeholder":"Search cards and buckets","kanban.search.clear":"Clear search","kanban.search.results":"{count} matching cards","kanban.search.noMatch":"No matching cards","kanban.card.progress":"Progress","kanban.card.openDetail":"Open Detail","kanban.priority.critical":"Critical","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","quickCreate.newItem":"New Item","quickCreate.createWithTitle":"Create {title}","quickEdit.editWithTitle":"Edit {title}","quickDelete.confirmTitle":"Confirm Delete","quickDelete.confirmMessageSingle":"Are you sure you want to delete the selected record?","quickDelete.confirmMessageMultiple":"Are you sure you want to delete {count} selected records?","cardPage.viewDetails":"View Details","cardPage.download":"Download","cardPage.close":"Close","cardPage.empty":"No items found","messageBox.confirm":"OK","messageBox.cancel":"Cancel","omph.status.idle":"Idle","omph.status.pending":"Pending","omph.status.running":"Working","omph.status.success":"Success","omph.status.error":"Error","omph.working":"Working","omph.workingFor":"Working for {duration}","omph.loadOlder":"Load earlier","omph.loadingOlder":"Loading earlier\u2026","omph.toBottom":"Back to bottom","omph.copy":"Copy","omph.copied":"Copied","omph.turnActions":"Reply actions","omph.usage":"Usage","omph.inputTokens":"Input","omph.outputTokens":"Output","omph.duration":"Duration","omph.send":"Send","omph.stop":"Stop","omph.supplement.queued":"Added to the running task","omph.turnRail":"Turns","omph.secondUnit":"s","omph.minuteUnit":"m","omph.preview.title":"File preview","omph.preview.close":"Close preview","omph.preview.back":"Back to conversation","omph.preview.expand":"Expand preview","omph.preview.collapse":"Restore preview size","omph.preview.copyContent":"Copy content","omph.preview.copyPath":"Copy path","omph.preview.download":"Download","omph.preview.openExternal":"Open externally","omph.preview.wrap":"Wrap","omph.preview.loading":"Loading file","omph.preview.missing":"File not found","omph.preview.failed":"Could not load this file","omph.preview.unsupported":"No preview for this file type","omph.preview.retry":"Try again","omph.preview.resize":"Resize preview","omph.preview.line":"Line {start}","omph.preview.lines":"Lines {start}\u2013{end}","omph.preview.truncated":"Showing the first {shown} of {total} lines","omph.preview.sheetTruncated":"Showing the first {shown} of {total} rows","omph.preview.imageFailed":"The image could not be displayed","omph.preview.zoomIn":"Zoom in","omph.preview.zoomOut":"Zoom out","omph.preview.zoomFit":"Fit to width","omph.newConversation":"New conversation","omph.conversationList":"Conversation list","omph.conversations":"Conversations","omph.noConversations":"No conversations yet","omph.approval.waiting":"Waiting for approval","omph.approval.choose":"Choose an action","omph.approval.details":"Approval details","omph.approval.choices":"Actions","omph.approval.reject":"Reject","omph.approval.allowOnce":"Allow once","omph.approval.confirm":"Continue","omph.approval.other":"Other","omph.approval.otherPlaceholder":"Describe the action to take","omph.approval.escalation":"Tool {toolName} requests privileged execution","omph.input.placeholder":"Type a message...","omph.input.upload":"Upload file","omph.input.send":"Send message","omph.input.stop":"Stop generating","omph.input.queue.ask":"Agent is running. Send this now or after the turn?","omph.input.queue.sendNow":"Send now","omph.input.queue.afterTurn":"Send after this turn","omph.input.queue.queued":"Queued \u2014 sends after this turn","omph.input.queue.cancel":"Cancel","omph.input.message":"Message input","omph.input.tools":"Input tools","agentui.html.defaultTitle":"Interactive HTML","agentui.html.open":"Open","agentui.html.preview":"Preview","agentui.html.code":"Code","agentui.html.toggle":"Switch between code and preview","agentui.html.copy":"Copy code","agentui.html.copied":"Copied","agentui.html.download":"Download","agentui.html.close":"Close"},Nf={"common.cancel":"\u53D6\u6D88","common.save":"\u4FDD\u5B58","common.ok":"\u786E\u5B9A","common.done":"\u5B8C\u6210","common.search":"\u641C\u7D22","common.none":"\u65E0","common.all":"\u5168\u90E8","common.noData":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.delete":"\u5220\u9664","common.loading":"\u52A0\u8F7D\u4E2D...","header.searchPlaceholder":"\u95EE\u6211\u70B9\u4EC0\u4E48...","header.searchAddFeature":"\u589E\u52A0\u529F\u80FD","header.searchStartVoice":"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165","header.searchStopVoice":"\u505C\u6B62\u8BED\u97F3\u8F93\u5165","header.searchOpenPanel":"\u6253\u5F00\u5BF9\u8BDD","header.theme.system":"\u4E3B\u9898\uFF1A\u8DDF\u968F\u7CFB\u7EDF","header.theme.dark":"\u4E3B\u9898\uFF1A\u6DF1\u8272","header.theme.light":"\u4E3B\u9898\uFF1A\u6D45\u8272","header.menu.setting":"\u8BBE\u7F6E","header.menu.refresh":"\u5237\u65B0","header.menu.logout":"\u6CE8\u9500","navigation.expand":"\u5C55\u5F00\u5BFC\u822A","navigation.collapse":"\u6298\u53E0\u5BFC\u822A","navigation.searchPlaceholder":"\u641C\u7D22\u83DC\u5355...","navigation.noMatch":"\u672A\u627E\u5230\u5339\u914D\u7684\u83DC\u5355\u9879","navigation.noAccessibleApp":"\u6682\u65E0\u53EF\u8BBF\u95EE\u7684\u5E94\u7528","navigation.noItems":"\u6682\u65E0\u53EF\u663E\u793A\u9879","navigation.expandView":"\u5C55\u5F00\u67E5\u770B {title}","navigation.mode.switchToFixed":"\u5207\u6362\u4E3A\u56FA\u5B9A\u5BFC\u822A","navigation.mode.switchToFloating":"\u5207\u6362\u4E3A\u60AC\u6D6E\u5BFC\u822A","navigation.pinned":"\u5DF2\u56FA\u5B9A","navigation.pin.add":"\u56FA\u5B9A\u5230\u9876\u90E8","navigation.pin.remove":"\u53D6\u6D88\u56FA\u5B9A","table.toolbar.searchPlaceholder":"\u641C\u7D22...","table.title.default":"\u6570\u636E\u8868","table.toolbar.groupBy":"\u5206\u7EC4","table.toolbar.summary":"\u6C47\u603B","table.toolbar.columns":"\u5217","table.toolbar.export":"\u5BFC\u51FA","table.toolbar.itemsPerPage":"\u6BCF\u9875\u6761\u6570\uFF1A","table.toolbar.pageOf":"\u7B2C {current} / {total} \u9875","table.toolbar.newItem":"\u65B0\u5EFA\u6761\u76EE","table.toolbar.editItem":"\u7F16\u8F91\u6761\u76EE","table.toolbar.deleteItem":"\u5220\u9664\u6761\u76EE","table.toolbar.graphicReport":"\u56FE\u8868\u62A5\u8868","table.toolbar.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","table.menu.groupBy":"\u5206\u7EC4","table.menu.clearAll":"\u6E05\u7A7A","table.menu.visibleColumns":"\u53EF\u89C1\u5217","table.menu.showSummaryRow":"\u663E\u793A\u6C47\u603B\u884C","table.menu.noNumericColumns":"\u6CA1\u6709\u6570\u503C\u5217","table.group.expandAll":"\u5C55\u5F00\u5168\u90E8\u5206\u7EC4","table.group.collapseAll":"\u6298\u53E0\u5168\u90E8\u5206\u7EC4","table.mobile.notImplemented":"\u79FB\u52A8\u7AEF\u89C6\u56FE\u6682\u672A\u5B9E\u73B0","table.headerMenu.sortAsc":"\u5347\u5E8F\u6392\u5217","table.headerMenu.sortDesc":"\u964D\u5E8F\u6392\u5217","table.headerMenu.clearSort":"\u6E05\u9664\u6392\u5E8F","table.headerMenu.configureSort":"\u6392\u5E8F\u8BBE\u7F6E...","table.headerMenu.group":"\u6309\u6B64\u5217\u5206\u7EC4","table.headerMenu.ungroup":"\u53D6\u6D88\u5206\u7EC4","table.headerMenu.addSummary":"\u52A0\u5165\u6C47\u603B","table.headerMenu.removeSummary":"\u4ECE\u6C47\u603B\u4E2D\u79FB\u9664","table.headerMenu.hideColumn":"\u9690\u85CF\u8BE5\u5217","table.sortDialog.title":"\u6392\u5E8F\u8BBE\u7F6E","table.sortDialog.empty":"\u6682\u65E0\u6392\u5E8F\u89C4\u5219\uFF0C\u8BF7\u6DFB\u52A0\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\u3002","table.sortDialog.addRule":"\u6DFB\u52A0\u6392\u5E8F\u89C4\u5219","table.sortDialog.clearAll":"\u6E05\u7A7A\u89C4\u5219","table.sortDialog.asc":"\u5347\u5E8F","table.sortDialog.desc":"\u964D\u5E8F","pivot.title.default":"\u6570\u636E\u900F\u89C6\u8868","pivot.subtitle.default":"\u62D6\u62FD\u5B57\u6BB5\u4EE5\u914D\u7F6E\u900F\u89C6\u8868\u3002","pivot.empty":"\u8BF7\u81F3\u5C11\u62D6\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u900F\u89C6\u7ED3\u679C\u3002","pivot.records":"\u8BB0\u5F55\u6570","pivot.afterFilter":"\u7B5B\u9009\u540E","pivot.grandTotal":"\u603B\u8BA1","pivot.resultLabel":"\u7ED3\u679C","pivot.valueLabel":"\u503C","pivot.table.dimensions":"\u7EF4\u5EA6","pivot.config.title":"\u5E03\u5C40\u914D\u7F6E","pivot.fieldList":"\u5B57\u6BB5\u5217\u8868","pivot.availableDimensions":"\u53EF\u7528\u7EF4\u5EA6","pivot.allFieldsInUse":"\u6240\u6709\u5B57\u6BB5\u90FD\u5DF2\u4F7F\u7528\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u7B5B\u9009","pivot.zone.values":"\u503C","pivot.hint.rows":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u884C\u5C42\u7EA7","pivot.hint.columns":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u5217\u5C42\u7EA7","pivot.hint.filters":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u4F5C\u4E3A\u62A5\u8868\u7B5B\u9009","pivot.hint.values":"\u5C06\u6570\u503C\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u8FDB\u884C\u805A\u5408","pivot.clearArea":"\u6E05\u7A7A\u533A\u57DF","pivot.filter.na":"\u4E0D\u53EF\u7528","pivot.filter.noValues":"\u65E0\u53EF\u9009\u503C","pivot.filter.noneSelected":"\u672A\u9009\u62E9","pivot.filter.allValues":"\u5168\u90E8\u503C","pivot.filter.selectedCount":"\u5DF2\u9009 {selected} / {total}","pivot.filter.selectAll":"\u5168\u9009","pivot.filter.deselectAll":"\u53D6\u6D88\u5168\u9009","pivot.filter.noResults":"\u65E0\u5339\u914D\u7ED3\u679C","pivot.collapse.ariaExpand":"\u5C55\u5F00\u914D\u7F6E\u533A\u57DF","pivot.collapse.ariaCollapse":"\u6298\u53E0\u914D\u7F6E\u533A\u57DF","pivot.agg.sum":"\u6C42\u548C","pivot.agg.count":"\u8BA1\u6570","pivot.agg.avg":"\u5E73\u5747\u503C","pivot.agg.min":"\u6700\u5C0F\u503C","pivot.agg.max":"\u6700\u5927\u503C","pivot.preset.selectPlaceholder":"\u9009\u62E9\u65B9\u6848","pivot.preset.save":"\u4FDD\u5B58\u65B9\u6848","pivot.preset.delete":"\u5220\u9664\u65B9\u6848","pivot.preset.saveDialogTitle":"\u4FDD\u5B58\u5F53\u524D\u65B9\u6848","pivot.preset.nameLabel":"\u65B9\u6848\u540D\u79F0","pivot.preset.defaultName":"\u65B9\u6848 {index}","pivot.table.sectionTitle":"\u900F\u89C6\u7ED3\u679C","pivot.table.expandRowsAll":"\u884C\u5168\u90E8\u6253\u5F00","pivot.table.collapseRowsAll":"\u884C\u5168\u90E8\u6298\u53E0","pivot.table.expandColumnsAll":"\u5217\u5168\u90E8\u6253\u5F00","pivot.table.collapseColumnsAll":"\u5217\u5168\u90E8\u6298\u53E0","pivot.table.collapse.ariaExpand":"\u5C55\u5F00\u900F\u89C6\u7ED3\u679C","pivot.table.collapse.ariaCollapse":"\u6298\u53E0\u900F\u89C6\u7ED3\u679C","pivot.chart.title":"\u900F\u89C6\u56FE\u8868","pivot.chart.subtitle":"\u5C06\u4E00\u4E2A\u7EF4\u5EA6\u4E0E\u6700\u591A\u4E24\u4E2A\u5EA6\u91CF\u6620\u5C04\u4E3A\u7D27\u51D1\u56FE\u8868\u3002","pivot.chart.subtitleReady":"{dimension} \xB7 {measure}","pivot.chart.emptyNoDimension":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u884C\u6216\u5217\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoValue":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoData":"\u5F53\u524D\u56FE\u8868\u9009\u62E9\u4E0B\u6682\u65E0\u53EF\u5C55\u793A\u6570\u636E\u3002","pivot.chart.dimension":"\u56FE\u8868\u7EF4\u5EA6","pivot.chart.primaryMeasure":"\u4E3B\u5EA6\u91CF","pivot.chart.secondaryMeasure":"\u5BF9\u6BD4\u5EA6\u91CF","pivot.chart.chartType":"\u56FE\u8868\u7C7B\u578B","pivot.chart.style.barVertical":"\u7EB5\u5411\u67F1\u72B6\u56FE","pivot.chart.style.barHorizontal":"\u6A2A\u5411\u67F1\u72B6\u56FE","pivot.chart.style.line":"\u6298\u7EBF\u56FE","pivot.chart.style.scatter":"\u6563\u70B9\u56FE","pivot.chart.collapse.ariaExpand":"\u5C55\u5F00\u56FE\u8868\u533A\u57DF","pivot.chart.collapse.ariaCollapse":"\u6298\u53E0\u56FE\u8868\u533A\u57DF","smartFilter.adaptFilters":"\u7B5B\u9009\u8BBE\u7F6E","smartFilter.addFilters":"\u6DFB\u52A0\u7B5B\u9009","smartFilter.go":"\u6267\u884C","smartFilter.visibleFilters":"\u53EF\u89C1\u7B5B\u9009\u9879","smartFilter.searchPlaceholder":"\u641C\u7D22...","smartFilter.noOptionsFound":"\u672A\u627E\u5230\u9009\u9879","smartFilter.min":"\u6700\u5C0F\u503C","smartFilter.max":"\u6700\u5927\u503C","smartFilter.minMaxPlaceholder":"\u6700\u5C0F\u503C - \u6700\u5927\u503C","smartFilter.operator.equals":"\u7B49\u4E8E","smartFilter.operator.contains":"\u5305\u542B","smartFilter.operator.notContains":"\u4E0D\u5305\u542B","smartFilter.operator.wildcard":"\u901A\u914D\u7B26\u641C\u7D22","smartFilter.operator.notEquals":"\u4E0D\u7B49\u4E8E","smartFilter.operator.greaterThan":"\u5927\u4E8E","smartFilter.operator.lessThan":"\u5C0F\u4E8E","smartFilter.operator.greaterOrEqual":"\u5927\u4E8E\u7B49\u4E8E","smartFilter.operator.lessOrEqual":"\u5C0F\u4E8E\u7B49\u4E8E","smartFilter.operator.between":"\u533A\u95F4","variant.noOptions":"\u65E0\u9009\u9879","variant.defaultSuffix":"\u9ED8\u8BA4","variant.selectVariant":"\u9009\u62E9\u89C6\u56FE","variant.saveView":"\u4FDD\u5B58\u89C6\u56FE","variant.newVariant":"\u65B0\u89C6\u56FE","variant.viewName":"\u89C6\u56FE\u540D\u79F0","variant.setDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","variant.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\uFF09","variant.toast.fetchFailed":"\u52A0\u8F7D\u89C6\u56FE\u5931\u8D25","variant.toast.saveFailed":"\u4FDD\u5B58\u89C6\u56FE\u5931\u8D25","variant.toast.saveSuccess":"\u89C6\u56FE\u4FDD\u5B58\u6210\u529F","variant.toast.deleteFailed":"\u5220\u9664\u89C6\u56FE\u5931\u8D25","variant.toast.deleteSuccess":"\u89C6\u56FE\u5220\u9664\u6210\u529F","variant.toast.defaultFailed":"\u66F4\u65B0\u9ED8\u8BA4\u89C6\u56FE\u5931\u8D25","variant.toast.defaultSuccess":"\u9ED8\u8BA4\u89C6\u56FE\u5DF2\u66F4\u65B0","layout.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","layout.layoutOptions":"\u5E03\u5C40\u9009\u9879","layout.selectLayout":"\u9009\u62E9\u5E03\u5C40","layout.saveCurrentLayout":"\u4FDD\u5B58\u5F53\u524D\u5E03\u5C40...","layout.noSavedLayouts":"\u6682\u65E0\u5DF2\u4FDD\u5B58\u5E03\u5C40","layout.removeDefault":"\u53D6\u6D88\u9ED8\u8BA4","layout.setAsDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","layout.layoutName":"\u5E03\u5C40\u540D\u79F0","layout.layoutDescription":"\u63CF\u8FF0","layout.layoutNameHelper":"\u4F8B\u5982\uFF1A\u7D27\u51D1\u89C6\u56FE","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u5C06\u8986\u76D6\u540C\u540D\u5E03\u5C40","layout.useAsDefault":"\u7528\u4F5C\u9ED8\u8BA4\u5E03\u5C40","layout.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09","layout.toast.loadFallback":"\u540E\u7AEF\u52A0\u8F7D\u5E03\u5C40\u5931\u8D25\uFF0C\u5DF2\u56DE\u9000\u5230\u672C\u5730\u5B58\u50A8","layout.toast.saveSuccess":"\u5E03\u5C40\u4FDD\u5B58\u6210\u529F","layout.toast.saveLocalSuccess":"\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.backendUnavailableSavedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.deleteSuccess":"\u5E03\u5C40\u5220\u9664\u6210\u529F","layout.toast.deleteLocalSuccess":"\u5E03\u5C40\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.backendUnavailableDeletedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.defaultSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u8BBE\u7F6E","layout.toast.defaultLocalSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u5728\u672C\u5730\u5B58\u50A8\u8BBE\u7F6E","layout.toast.backendUnavailableDefaultLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","dateRange.label":"\u65E5\u671F\u8303\u56F4","dateRange.startDate":"\u5F00\u59CB\u65E5\u671F","dateRange.endDate":"\u7ED3\u675F\u65E5\u671F","dateRange.select":"\u8BF7\u9009\u62E9...","dateRange.today":"\u4ECA\u5929","dateRange.thisWeek":"\u672C\u5468","dateRange.thisMonth":"\u672C\u6708","graph.records":"{count} \u6761\u8BB0\u5F55","graph.kpi.totalRecords":"\u603B\u8BB0\u5F55\u6570","graph.kpi.totalReport":"\u603B\u7533\u62A5\u5DE5\u65F6","graph.kpi.totalBillable":"\u603B\u53EF\u8BA1\u8D39\u5DE5\u65F6","graph.kpi.efficiency":"\u6548\u7387","graph.kpi.amount":"\u91D1\u989D","graph.kpi.flagged":"\u6807\u8BB0","graph.chart.billable.title":"\u7EF4\u5EA6\u8BA1\u8D39\u5DE5\u65F6","graph.chart.billable.subtitle":"\u6309\u53EF\u8BA1\u8D39\u5DE5\u65F6\u6392\u5E8F\u524D\u5217","graph.chart.efficiency.title":"\u4EBA\u5458\u6548\u7387","graph.chart.efficiency.subtitle":"\u6309\u6700\u4F4E\u6548\u7387\u4F18\u5148","graph.chart.status.title":"\u72B6\u6001\u5206\u5E03","graph.chart.status.subtitle":"\u6309\u72B6\u6001\u8BB0\u5F55\u5360\u6BD4","graph.dataBody":"\u6570\u636E\u660E\u7EC6","graph.reportTitle":"\u56FE\u8868\u62A5\u8868","graph.unassigned":"\u672A\u5206\u914D","graph.column.reportHours":"\u7533\u62A5\u5DE5\u65F6","graph.column.billableHours":"\u53EF\u8BA1\u8D39\u5DE5\u65F6","detail.searchAi.placeholder":"\u641C\u7D22\u5B57\u6BB5\uFF1B\u5982\u65E0\u7ED3\u679C\u5219\u81EA\u52A8\u89E6\u53D1 AI...","detail.searchAi.matches":"{count} \u6761\u5339\u914D\u7ED3\u679C","detail.searchAi.noMatch":"\u672A\u627E\u5230\u5339\u914D\u5B57\u6BB5\u3002","detail.searchAi.autoAiFallback":"\u672A\u547D\u4E2D\u5B57\u6BB5\uFF0C\u6B63\u5728\u89E6\u53D1 AI \u5206\u6790...","detail.searchAi.aiResultTitle":"AI \u5206\u6790\u7ED3\u679C","detail.table.title":"\u5173\u8054\u8BB0\u5F55","kanban.empty":"\u5C06\u5361\u7247\u62D6\u5230\u8FD9\u91CC","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u91CA\u653E\u540E\u79FB\u52A8\u5230\u8BE5 bucket","kanban.bucket.add":"\u65B0\u589E bucket","kanban.bucket.rename":"\u91CD\u547D\u540D bucket","kanban.bucket.saveRename":"\u4FDD\u5B58 bucket \u540D\u79F0","kanban.bucket.cancelRename":"\u53D6\u6D88\u91CD\u547D\u540D","kanban.search.placeholder":"\u641C\u7D22\u5361\u7247\u548C bucket","kanban.search.clear":"\u6E05\u9664\u641C\u7D22","kanban.search.results":"{count} \u5F20\u5339\u914D\u5361\u7247","kanban.search.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u5361\u7247","kanban.card.progress":"\u8FDB\u5EA6","kanban.card.openDetail":"\u6253\u5F00\u8BE6\u60C5","kanban.priority.critical":"\u7D27\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u5EFA\u6761\u76EE","quickCreate.createWithTitle":"\u521B\u5EFA{title}","quickEdit.editWithTitle":"\u7F16\u8F91{title}","quickDelete.confirmTitle":"\u786E\u8BA4\u5220\u9664","quickDelete.confirmMessageSingle":"\u786E\u8BA4\u5220\u9664\u5F53\u524D\u9009\u4E2D\u8BB0\u5F55\u5417\uFF1F","quickDelete.confirmMessageMultiple":"\u786E\u8BA4\u5220\u9664\u5DF2\u9009\u4E2D\u7684 {count} \u6761\u8BB0\u5F55\u5417\uFF1F","cardPage.viewDetails":"\u67E5\u770B\u8BE6\u60C5","cardPage.download":"\u4E0B\u8F7D","cardPage.close":"\u5173\u95ED","cardPage.empty":"\u672A\u627E\u5230\u6761\u76EE","messageBox.confirm":"\u786E\u5B9A","messageBox.cancel":"\u53D6\u6D88","omph.status.idle":"\u7A7A\u95F2","omph.status.pending":"\u7B49\u5F85\u4E2D","omph.status.running":"\u5904\u7406\u4E2D","omph.status.success":"\u5DF2\u5B8C\u6210","omph.status.error":"\u51FA\u9519","omph.working":"\u5904\u7406\u4E2D","omph.workingFor":"\u5DF2\u5904\u7406 {duration}","omph.loadOlder":"\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F","omph.loadingOlder":"\u6B63\u5728\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F\u2026","omph.toBottom":"\u56DE\u5230\u5E95\u90E8","omph.copy":"\u590D\u5236","omph.copied":"\u5DF2\u590D\u5236","omph.turnActions":"\u56DE\u590D\u64CD\u4F5C","omph.usage":"\u7528\u91CF","omph.inputTokens":"\u8F93\u5165","omph.outputTokens":"\u8F93\u51FA","omph.duration":"\u7528\u65F6","omph.send":"\u53D1\u9001","omph.stop":"\u505C\u6B62","omph.supplement.queued":"\u5DF2\u52A0\u5165\u5F53\u524D\u4EFB\u52A1","omph.turnRail":"\u8F6E\u6B21","omph.secondUnit":"\u79D2","omph.minuteUnit":"\u5206","omph.preview.title":"\u6587\u4EF6\u9884\u89C8","omph.preview.close":"\u5173\u95ED\u9884\u89C8","omph.preview.back":"\u8FD4\u56DE\u5BF9\u8BDD","omph.preview.expand":"\u5C55\u5F00\u9884\u89C8","omph.preview.collapse":"\u8FD8\u539F\u9884\u89C8\u5927\u5C0F","omph.preview.copyContent":"\u590D\u5236\u5185\u5BB9","omph.preview.copyPath":"\u590D\u5236\u8DEF\u5F84","omph.preview.download":"\u4E0B\u8F7D","omph.preview.openExternal":"\u5728\u5916\u90E8\u6253\u5F00","omph.preview.wrap":"\u81EA\u52A8\u6362\u884C","omph.preview.loading":"\u6B63\u5728\u52A0\u8F7D\u6587\u4EF6","omph.preview.missing":"\u6587\u4EF6\u4E0D\u5B58\u5728","omph.preview.failed":"\u65E0\u6CD5\u52A0\u8F7D\u6B64\u6587\u4EF6","omph.preview.unsupported":"\u6B64\u6587\u4EF6\u7C7B\u578B\u4E0D\u652F\u6301\u9884\u89C8","omph.preview.retry":"\u91CD\u8BD5","omph.preview.resize":"\u8C03\u6574\u9884\u89C8\u5927\u5C0F","omph.preview.line":"\u7B2C {start} \u884C","omph.preview.lines":"\u7B2C {start}\u2013{end} \u884C","omph.preview.truncated":"\u5171 {total} \u884C\uFF0C\u4EC5\u663E\u793A\u524D {shown} \u884C","omph.preview.sheetTruncated":"\u5171 {total} \u884C\uFF0C\u4EC5\u663E\u793A\u524D {shown} \u884C","omph.preview.imageFailed":"\u56FE\u7247\u65E0\u6CD5\u663E\u793A","omph.preview.zoomIn":"\u653E\u5927","omph.preview.zoomOut":"\u7F29\u5C0F","omph.preview.zoomFit":"\u9002\u5E94\u5BBD\u5EA6","omph.newConversation":"\u65B0\u5EFA\u4F1A\u8BDD","omph.conversationList":"\u4F1A\u8BDD\u5217\u8868","omph.conversations":"\u4F1A\u8BDD","omph.noConversations":"\u8FD8\u6CA1\u6709\u4F1A\u8BDD","omph.approval.waiting":"\u7B49\u5F85\u5BA1\u6279","omph.approval.choose":"\u8BF7\u9009\u62E9\u64CD\u4F5C","omph.approval.details":"\u5BA1\u6279\u8BE6\u60C5","omph.approval.choices":"\u53EF\u9009\u64CD\u4F5C","omph.approval.reject":"\u62D2\u7EDD","omph.approval.allowOnce":"\u4EC5\u6B64\u4E00\u6B21","omph.approval.confirm":"\u7EE7\u7EED","omph.approval.other":"\u5176\u4ED6","omph.approval.otherPlaceholder":"\u63CF\u8FF0\u8981\u6267\u884C\u7684\u64CD\u4F5C","omph.approval.escalation":"\u5DE5\u5177 {toolName} \u8BF7\u6C42\u7279\u6743\u6267\u884C","omph.input.placeholder":"\u8F93\u5165\u6D88\u606F\u2026","omph.input.upload":"\u4E0A\u4F20\u6587\u4EF6","omph.input.send":"\u53D1\u9001\u6D88\u606F","omph.input.stop":"\u505C\u6B62\u751F\u6210","omph.input.queue.ask":"Agent \u6B63\u5728\u8FD0\u884C\uFF0C\u8FD9\u6761\u6D88\u606F\u600E\u4E48\u53D1\uFF1F","omph.input.queue.sendNow":"\u7ACB\u5373\u53D1\u9001","omph.input.queue.afterTurn":"\u672C\u8F6E\u7ED3\u675F\u540E\u53D1\u9001","omph.input.queue.queued":"\u5DF2\u6392\u961F\uFF0C\u672C\u8F6E\u7ED3\u675F\u540E\u81EA\u52A8\u53D1\u9001","omph.input.queue.cancel":"\u53D6\u6D88","omph.input.message":"\u6D88\u606F\u8F93\u5165","omph.input.tools":"\u8F93\u5165\u5DE5\u5177","agentui.html.defaultTitle":"\u4EA4\u4E92\u5F0F HTML","agentui.html.open":"\u6253\u5F00","agentui.html.preview":"\u9884\u89C8","agentui.html.code":"\u4EE3\u7801","agentui.html.toggle":"\u5207\u6362\u4EE3\u7801\u4E0E\u9884\u89C8","agentui.html.copy":"\u590D\u5236\u4EE3\u7801","agentui.html.copied":"\u5DF2\u590D\u5236","agentui.html.download":"\u4E0B\u8F7D","agentui.html.close":"\u5173\u95ED"},Df={"common.cancel":"Annuler","common.save":"Enregistrer","common.ok":"OK","common.done":"Terminer","common.search":"Rechercher","common.none":"Aucun","common.all":"Tout","common.noData":"Aucune donn\xE9e","common.copy":"Copier","common.delete":"Supprimer","common.loading":"Chargement...","header.searchPlaceholder":"Demandez-moi...","header.searchAddFeature":"Ajouter une fonction","header.searchStartVoice":"D\xE9marrer la saisie vocale","header.searchStopVoice":"Arr\xEAter la saisie vocale","header.searchOpenPanel":"Ouvrir la conversation","header.theme.system":"Th\xE8me : Syst\xE8me","header.theme.dark":"Th\xE8me : Sombre","header.theme.light":"Th\xE8me : Clair","header.menu.setting":"Param\xE8tres","header.menu.refresh":"Actualiser","header.menu.logout":"Se d\xE9connecter","navigation.expand":"D\xE9velopper la navigation","navigation.collapse":"R\xE9duire la navigation","navigation.searchPlaceholder":"Rechercher dans le menu...","navigation.noMatch":"Aucun \xE9l\xE9ment correspondant","navigation.noAccessibleApp":"Aucune application accessible","navigation.noItems":"Aucun \xE9l\xE9ment \xE0 afficher","navigation.expandView":"D\xE9velopper {title}","navigation.mode.switchToFixed":"Basculer vers la navigation fixe","navigation.mode.switchToFloating":"Basculer vers la navigation flottante","navigation.pinned":"\xC9pingl\xE9s","navigation.pin.add":"\xC9pingler en haut","navigation.pin.remove":"D\xE9s\xE9pingler","table.toolbar.searchPlaceholder":"Rechercher...","table.title.default":"Tableau de donn\xE9es","table.toolbar.groupBy":"Grouper","table.toolbar.summary":"R\xE9sum\xE9","table.toolbar.columns":"Colonnes","table.toolbar.export":"Exporter","table.toolbar.itemsPerPage":"Lignes par page :","table.toolbar.pageOf":"Page {current} sur {total}","table.toolbar.newItem":"Nouvel \xE9l\xE9ment","table.toolbar.editItem":"Modifier l'\xE9l\xE9ment","table.toolbar.deleteItem":"Supprimer l'\xE9l\xE9ment","table.toolbar.graphicReport":"Rapport graphique","table.toolbar.saveLayout":"Enregistrer la vue","table.menu.groupBy":"Grouper","table.menu.clearAll":"Tout effacer","table.menu.visibleColumns":"Colonnes visibles","table.menu.showSummaryRow":"Afficher la ligne de r\xE9sum\xE9","table.menu.noNumericColumns":"Aucune colonne num\xE9rique","table.group.expandAll":"D\xE9velopper tous les groupes","table.group.collapseAll":"R\xE9duire tous les groupes","table.mobile.notImplemented":"Vue mobile non impl\xE9ment\xE9e","table.headerMenu.sortAsc":"Trier ascendant","table.headerMenu.sortDesc":"Trier descendant","table.headerMenu.clearSort":"Effacer le tri","table.headerMenu.configureSort":"Configurer le tri...","table.headerMenu.group":"Grouper par cette colonne","table.headerMenu.ungroup":"Retirer du groupement","table.headerMenu.addSummary":"Inclure dans le r\xE9sum\xE9","table.headerMenu.removeSummary":"Retirer du r\xE9sum\xE9","table.headerMenu.hideColumn":"Masquer la colonne","table.sortDialog.title":"Param\xE8tres de tri","table.sortDialog.empty":"Aucune r\xE8gle de tri. Ajoutez-en une pour commencer.","table.sortDialog.addRule":"Ajouter une r\xE8gle","table.sortDialog.clearAll":"Tout effacer","table.sortDialog.asc":"Ascendant","table.sortDialog.desc":"Descendant","pivot.title.default":"Tableau crois\xE9 dynamique","pivot.subtitle.default":"Faites glisser les champs pour configurer le tableau crois\xE9.","pivot.empty":"Ajoutez au moins un champ de valeur pour afficher le r\xE9sultat.","pivot.records":"Enregistrements","pivot.afterFilter":"Apr\xE8s filtre","pivot.grandTotal":"Total g\xE9n\xE9ral","pivot.resultLabel":"R\xE9sultat","pivot.valueLabel":"Valeur","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Liste des champs","pivot.availableDimensions":"Dimensions disponibles","pivot.allFieldsInUse":"Tous les champs sont d\xE9j\xE0 utilis\xE9s.","pivot.zone.rows":"Lignes","pivot.zone.columns":"Colonnes","pivot.zone.filters":"Filtres","pivot.zone.values":"Valeurs","pivot.hint.rows":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des lignes","pivot.hint.columns":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des colonnes","pivot.hint.filters":"D\xE9posez les champs ici pour les filtres du rapport","pivot.hint.values":"D\xE9posez les champs num\xE9riques ici pour les agr\xE9gations","pivot.clearArea":"Vider la zone","pivot.filter.na":"N/A","pivot.filter.noValues":"Aucune valeur","pivot.filter.noneSelected":"Aucune s\xE9lection","pivot.filter.allValues":"Toutes les valeurs","pivot.filter.selectedCount":"{selected} / {total} s\xE9lectionn\xE9es","pivot.filter.selectAll":"Tout s\xE9lectionner","pivot.filter.deselectAll":"Tout d\xE9s\xE9lectionner","pivot.filter.noResults":"Aucun r\xE9sultat","pivot.collapse.ariaExpand":"D\xE9velopper la zone de configuration","pivot.collapse.ariaCollapse":"R\xE9duire la zone de configuration","pivot.agg.sum":"Somme","pivot.agg.count":"Compte","pivot.agg.avg":"Moyenne","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"S\xE9lectionner un preset","pivot.preset.save":"Enregistrer le preset","pivot.preset.delete":"Supprimer le preset","pivot.preset.saveDialogTitle":"Enregistrer le preset actuel","pivot.preset.nameLabel":"Nom du preset","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"R\xE9sultat du pivot","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"D\xE9velopper le r\xE9sultat du pivot","pivot.table.collapse.ariaCollapse":"R\xE9duire le r\xE9sultat du pivot","pivot.chart.title":"Graphique pivot","pivot.chart.subtitle":"Associez une dimension et jusqu\u2019\xE0 deux mesures dans un graphique compact.","pivot.chart.subtitleReady":"{dimension} par {measure}","pivot.chart.emptyNoDimension":"Ajoutez au moins un champ de ligne ou de colonne pour afficher le graphique.","pivot.chart.emptyNoValue":"Ajoutez au moins un champ de valeur pour afficher le graphique.","pivot.chart.emptyNoData":"Aucune donn\xE9e disponible pour la s\xE9lection actuelle du graphique.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Mesure","pivot.chart.secondaryMeasure":"Mesure de comparaison","pivot.chart.chartType":"Type de graphique","pivot.chart.style.barVertical":"Barres verticales","pivot.chart.style.barHorizontal":"Barres horizontales","pivot.chart.style.line":"Ligne","pivot.chart.style.scatter":"Nuage de points","pivot.chart.collapse.ariaExpand":"D\xE9velopper la zone du graphique","pivot.chart.collapse.ariaCollapse":"R\xE9duire la zone du graphique","smartFilter.adaptFilters":"Adapter les filtres","smartFilter.addFilters":"Ajouter des filtres","smartFilter.go":"Ex\xE9cuter","smartFilter.visibleFilters":"Filtres visibles","smartFilter.searchPlaceholder":"Rechercher...","smartFilter.noOptionsFound":"Aucune option trouv\xE9e","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"\xC9gal \xE0","smartFilter.operator.contains":"Contient","smartFilter.operator.notContains":"Ne contient pas","smartFilter.operator.wildcard":"Recherche g\xE9n\xE9rique","smartFilter.operator.notEquals":"Diff\xE9rent de","smartFilter.operator.greaterThan":"Sup\xE9rieur \xE0","smartFilter.operator.lessThan":"Inf\xE9rieur \xE0","smartFilter.operator.greaterOrEqual":"Sup\xE9rieur ou \xE9gal","smartFilter.operator.lessOrEqual":"Inf\xE9rieur ou \xE9gal","smartFilter.operator.between":"Entre","variant.noOptions":"Aucune option","variant.defaultSuffix":"Par d\xE9faut","variant.selectVariant":"S\xE9lectionner une vue","variant.saveView":"Enregistrer la vue","variant.newVariant":"Nouvelle vue","variant.viewName":"Nom de la vue","variant.setDefault":"D\xE9finir par d\xE9faut","variant.publicAllUsers":"Public (tous les utilisateurs)","variant.toast.fetchFailed":"\xC9chec du chargement des vues","variant.toast.saveFailed":"\xC9chec de l'enregistrement de la vue","variant.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","variant.toast.deleteFailed":"\xC9chec de la suppression de la vue","variant.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","variant.toast.defaultFailed":"\xC9chec de la mise \xE0 jour de la vue par d\xE9faut","variant.toast.defaultSuccess":"Vue par d\xE9faut mise \xE0 jour","layout.saveLayout":"Enregistrer la vue","layout.layoutOptions":"Options de vue","layout.selectLayout":"S\xE9lectionner une vue","layout.saveCurrentLayout":"Enregistrer la vue actuelle...","layout.noSavedLayouts":"Aucune vue enregistr\xE9e","layout.removeDefault":"Retirer le d\xE9faut","layout.setAsDefault":"D\xE9finir par d\xE9faut","layout.layoutName":"Nom de la vue","layout.layoutDescription":"Description","layout.layoutNameHelper":"ex. : Vue compacte","layout.warningOverwrite":"Attention : la vue existante sera \xE9cras\xE9e","layout.useAsDefault":"Utiliser comme vue par d\xE9faut","layout.publicAllUsers":"Public (visible par tous les utilisateurs)","layout.toast.loadFallback":"\xC9chec du chargement depuis le backend, bascule vers le stockage local","layout.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","layout.toast.saveLocalSuccess":"Vue enregistr\xE9e dans le stockage local","layout.toast.backendUnavailableSavedLocal":"Backend indisponible, enregistr\xE9 en local","layout.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","layout.toast.deleteLocalSuccess":"Vue supprim\xE9e du stockage local","layout.toast.backendUnavailableDeletedLocal":"Backend indisponible, supprim\xE9 en local","layout.toast.defaultSuccess":"Vue par d\xE9faut d\xE9finie","layout.toast.defaultLocalSuccess":"Vue par d\xE9faut d\xE9finie en local","layout.toast.backendUnavailableDefaultLocal":"Backend indisponible, d\xE9faut enregistr\xE9 en local","dateRange.label":"Plage de dates","dateRange.startDate":"Date de d\xE9but","dateRange.endDate":"Date de fin","dateRange.select":"S\xE9lectionner...","dateRange.today":"Aujourd'hui","dateRange.thisWeek":"Cette semaine","dateRange.thisMonth":"Ce mois-ci","graph.records":"{count} enregistrements","graph.kpi.totalRecords":"Total des enregistrements","graph.kpi.totalReport":"Total d\xE9clar\xE9","graph.kpi.totalBillable":"Total facturable","graph.kpi.efficiency":"Efficacit\xE9","graph.kpi.amount":"Montant","graph.kpi.flagged":"Signal\xE9","graph.chart.billable.title":"Facturable par dimension","graph.chart.billable.subtitle":"Top valeurs par heures facturables","graph.chart.efficiency.title":"Efficacit\xE9 par personne","graph.chart.efficiency.subtitle":"Efficacit\xE9 la plus faible en premier","graph.chart.status.title":"R\xE9partition des statuts","graph.chart.status.subtitle":"Ratio des enregistrements par statut","graph.dataBody":"Donn\xE9es","graph.reportTitle":"Rapport graphique","graph.unassigned":"Non attribu\xE9","graph.column.reportHours":"Heures d\xE9clar\xE9es","graph.column.billableHours":"Heures facturables","detail.searchAi.placeholder":"Rechercher des champs, ou interroger l\u2019IA en cas d\u2019absence de r\xE9sultat...","detail.searchAi.matches":"{count} correspondances trouv\xE9es","detail.searchAi.noMatch":"Aucun champ correspondant trouv\xE9.","detail.searchAi.autoAiFallback":"Aucune correspondance directe. Analyse IA en cours...","detail.searchAi.aiResultTitle":"Analyse IA","detail.table.title":"Enregistrements li\xE9s","kanban.empty":"D\xE9posez les cartes ici","kanban.bucket.limit":"Limite","kanban.bucket.dropHere":"Rel\xE2chez pour d\xE9placer dans cette colonne","kanban.bucket.add":"Ajouter une colonne","kanban.bucket.rename":"Renommer la colonne","kanban.bucket.saveRename":"Enregistrer le nom","kanban.bucket.cancelRename":"Annuler le renommage","kanban.search.placeholder":"Rechercher des cartes et colonnes","kanban.search.clear":"Effacer la recherche","kanban.search.results":"{count} cartes correspondantes","kanban.search.noMatch":"Aucune carte correspondante","kanban.card.progress":"Progression","kanban.card.openDetail":"Ouvrir le d\xE9tail","kanban.priority.critical":"Critique","kanban.priority.high":"\xC9lev\xE9e","kanban.priority.medium":"Moyenne","kanban.priority.low":"Faible","quickCreate.newItem":"Nouvel \xE9l\xE9ment","quickCreate.createWithTitle":"Cr\xE9er {title}","quickEdit.editWithTitle":"Modifier {title}","quickDelete.confirmTitle":"Confirmer la suppression","quickDelete.confirmMessageSingle":"Voulez-vous vraiment supprimer l\u2019enregistrement s\xE9lectionn\xE9 ?","quickDelete.confirmMessageMultiple":"Voulez-vous vraiment supprimer les {count} enregistrements s\xE9lectionn\xE9s ?","cardPage.viewDetails":"Voir les d\xE9tails","cardPage.download":"T\xE9l\xE9charger","cardPage.close":"Fermer","cardPage.empty":"Aucun \xE9l\xE9ment trouv\xE9","messageBox.confirm":"OK","messageBox.cancel":"Annuler","omph.status.idle":"Inactif","omph.status.pending":"En attente","omph.status.running":"En cours","omph.status.success":"Termin\xE9","omph.status.error":"Erreur","omph.working":"En cours","omph.workingFor":"En cours depuis {duration}","omph.loadOlder":"Charger les messages pr\xE9c\xE9dents","omph.loadingOlder":"Chargement des messages pr\xE9c\xE9dents\u2026","omph.toBottom":"Revenir en bas","omph.copy":"Copier","omph.copied":"Copi\xE9","omph.turnActions":"Actions de r\xE9ponse","omph.usage":"Utilisation","omph.inputTokens":"Entr\xE9e","omph.outputTokens":"Sortie","omph.duration":"Dur\xE9e","omph.send":"Envoyer","omph.stop":"Arr\xEAter","omph.supplement.queued":"Ajout\xE9 \xE0 la t\xE2che en cours","omph.turnRail":"Tours","omph.secondUnit":"s","omph.minuteUnit":"min","omph.preview.title":"Aper\xE7u du fichier","omph.preview.close":"Fermer l'aper\xE7u","omph.preview.back":"Retour \xE0 la conversation","omph.preview.expand":"Agrandir l\u2019aper\xE7u","omph.preview.collapse":"R\xE9duire l\u2019aper\xE7u","omph.preview.copyContent":"Copier le contenu","omph.preview.copyPath":"Copier le chemin","omph.preview.download":"T\xE9l\xE9charger","omph.preview.openExternal":"Ouvrir \xE0 l\u2019ext\xE9rieur","omph.preview.wrap":"Retour \xE0 la ligne","omph.preview.loading":"Chargement du fichier","omph.preview.missing":"Fichier introuvable","omph.preview.failed":"Impossible de charger ce fichier","omph.preview.unsupported":"Aucun aper\xE7u pour ce type de fichier","omph.preview.retry":"R\xE9essayer","omph.preview.resize":"Redimensionner l\u2019aper\xE7u","omph.preview.line":"Ligne {start}","omph.preview.lines":"Lignes {start}\u2013{end}","omph.preview.truncated":"Affichage des {shown} premi\xE8res lignes sur {total}","omph.preview.sheetTruncated":"Affichage des {shown} premi\xE8res lignes sur {total}","omph.preview.imageFailed":"Impossible d'afficher l'image","omph.preview.zoomIn":"Zoom avant","omph.preview.zoomOut":"Zoom arri\xE8re","omph.preview.zoomFit":"Ajuster \xE0 la largeur","omph.newConversation":"Nouvelle conversation","omph.conversationList":"Liste des conversations","omph.conversations":"Conversations","omph.noConversations":"Aucune conversation","omph.approval.waiting":"En attente d'approbation","omph.approval.choose":"Choisir une action","omph.approval.details":"D\xE9tails de l'approbation","omph.approval.choices":"Actions","omph.approval.reject":"Refuser","omph.approval.allowOnce":"Autoriser une fois","omph.approval.confirm":"Continuer","omph.approval.other":"Autre","omph.approval.otherPlaceholder":"D\xE9crire l'action \xE0 effectuer","omph.approval.escalation":"L'outil {toolName} demande une ex\xE9cution privil\xE9gi\xE9e","omph.input.placeholder":"Saisir un message\u2026","omph.input.upload":"T\xE9l\xE9verser un fichier","omph.input.send":"Envoyer le message","omph.input.stop":"Arr\xEAter la g\xE9n\xE9ration","omph.input.queue.ask":"L'agent travaille. Envoyer maintenant ou apr\xE8s ce tour ?","omph.input.queue.sendNow":"Envoyer maintenant","omph.input.queue.afterTurn":"Envoyer apr\xE8s ce tour","omph.input.queue.queued":"En file d'attente \u2014 envoi apr\xE8s ce tour","omph.input.queue.cancel":"Annuler","omph.input.message":"Saisie de message","omph.input.tools":"Outils de saisie","agentui.html.defaultTitle":"HTML interactif","agentui.html.open":"Ouvrir","agentui.html.preview":"Aper\xE7u","agentui.html.code":"Code","agentui.html.toggle":"Basculer entre code et aper\xE7u","agentui.html.copy":"Copier le code","agentui.html.copied":"Copi\xE9","agentui.html.download":"T\xE9l\xE9charger","agentui.html.close":"Fermer"},Af={"common.cancel":"Abbrechen","common.save":"Speichern","common.ok":"OK","common.done":"Fertig","common.search":"Suchen","common.none":"Keine","common.all":"Alle","common.noData":"Keine Daten","common.copy":"Kopieren","common.delete":"L\xF6schen","common.loading":"Wird geladen...","header.searchPlaceholder":"Frag mich...","header.searchAddFeature":"Funktion hinzuf\xFCgen","header.searchStartVoice":"Spracheingabe starten","header.searchStopVoice":"Spracheingabe stoppen","header.searchOpenPanel":"Unterhaltung \xF6ffnen","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dunkel","header.theme.light":"Theme: Hell","header.menu.setting":"Einstellungen","header.menu.refresh":"Aktualisieren","header.menu.logout":"Abmelden","navigation.expand":"Navigation erweitern","navigation.collapse":"Navigation einklappen","navigation.searchPlaceholder":"Men\xFC suchen...","navigation.noMatch":"Keine passenden Men\xFCeintr\xE4ge","navigation.noAccessibleApp":"Keine verf\xFCgbaren Anwendungen","navigation.noItems":"Keine Eintr\xE4ge vorhanden","navigation.expandView":"{title} aufklappen","navigation.mode.switchToFixed":"Zu fester Navigation wechseln","navigation.mode.switchToFloating":"Zu schwebender Navigation wechseln","navigation.pinned":"Angeheftet","navigation.pin.add":"Oben anheften","navigation.pin.remove":"L\xF6sen","table.toolbar.searchPlaceholder":"Suchen...","table.title.default":"Datentabelle","table.toolbar.groupBy":"Gruppieren","table.toolbar.summary":"Zusammenfassung","table.toolbar.columns":"Spalten","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Zeilen pro Seite:","table.toolbar.pageOf":"Seite {current} von {total}","table.toolbar.newItem":"Neuer Eintrag","table.toolbar.editItem":"Eintrag bearbeiten","table.toolbar.deleteItem":"Eintrag l\xF6schen","table.toolbar.graphicReport":"Grafikbericht","table.toolbar.saveLayout":"Layout speichern","table.menu.groupBy":"Gruppieren","table.menu.clearAll":"Alles l\xF6schen","table.menu.visibleColumns":"Sichtbare Spalten","table.menu.showSummaryRow":"Summenzeile anzeigen","table.menu.noNumericColumns":"Keine numerischen Spalten","table.group.expandAll":"Alle Gruppen aufklappen","table.group.collapseAll":"Alle Gruppen zuklappen","table.mobile.notImplemented":"Mobile Ansicht nicht implementiert","table.headerMenu.sortAsc":"Aufsteigend sortieren","table.headerMenu.sortDesc":"Absteigend sortieren","table.headerMenu.clearSort":"Sortierung entfernen","table.headerMenu.configureSort":"Sortierung konfigurieren...","table.headerMenu.group":"Nach dieser Spalte gruppieren","table.headerMenu.ungroup":"Aus Gruppierung entfernen","table.headerMenu.addSummary":"In Summe einbeziehen","table.headerMenu.removeSummary":"Aus Summe entfernen","table.headerMenu.hideColumn":"Spalte ausblenden","table.sortDialog.title":"Sortiereinstellungen","table.sortDialog.empty":"Keine Sortierregeln. F\xFCgen Sie eine hinzu, um zu sortieren.","table.sortDialog.addRule":"Regel hinzuf\xFCgen","table.sortDialog.clearAll":"Alle l\xF6schen","table.sortDialog.asc":"Aufsteigend","table.sortDialog.desc":"Absteigend","pivot.title.default":"Pivot-Tabelle","pivot.subtitle.default":"Ziehen Sie Felder, um die Pivot-Tabelle zu konfigurieren.","pivot.empty":"Ziehen Sie mindestens ein Wertefeld, um das Ergebnis anzuzeigen.","pivot.records":"Datens\xE4tze","pivot.afterFilter":"Nach Filter","pivot.grandTotal":"Gesamtsumme","pivot.resultLabel":"Ergebnis","pivot.valueLabel":"Wert","pivot.table.dimensions":"Dimensionen","pivot.config.title":"Konfiguration","pivot.fieldList":"Feldliste","pivot.availableDimensions":"Verf\xFCgbare Dimensionen","pivot.allFieldsInUse":"Alle Felder sind bereits verwendet.","pivot.zone.rows":"Zeilen","pivot.zone.columns":"Spalten","pivot.zone.filters":"Filter","pivot.zone.values":"Werte","pivot.hint.rows":"Felder hierhin ziehen, um die Zeilenhierarchie zu erstellen","pivot.hint.columns":"Felder hierhin ziehen, um die Spaltenhierarchie zu erstellen","pivot.hint.filters":"Felder hierhin ziehen f\xFCr Berichtsfilter","pivot.hint.values":"Numerische Felder hierhin ziehen f\xFCr Aggregation","pivot.clearArea":"Bereich leeren","pivot.filter.na":"N/V","pivot.filter.noValues":"Keine Werte","pivot.filter.noneSelected":"Nichts ausgew\xE4hlt","pivot.filter.allValues":"Alle Werte","pivot.filter.selectedCount":"{selected} / {total} ausgew\xE4hlt","pivot.filter.selectAll":"Alle ausw\xE4hlen","pivot.filter.deselectAll":"Alle abw\xE4hlen","pivot.filter.noResults":"Keine Ergebnisse","pivot.collapse.ariaExpand":"Konfigurationsbereich erweitern","pivot.collapse.ariaCollapse":"Konfigurationsbereich reduzieren","pivot.agg.sum":"Summe","pivot.agg.count":"Anzahl","pivot.agg.avg":"Durchschnitt","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Preset w\xE4hlen","pivot.preset.save":"Preset speichern","pivot.preset.delete":"Preset l\xF6schen","pivot.preset.saveDialogTitle":"Aktuelles Preset speichern","pivot.preset.nameLabel":"Preset-Name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot-Ergebnis","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Pivot-Ergebnis erweitern","pivot.table.collapse.ariaCollapse":"Pivot-Ergebnis reduzieren","pivot.chart.title":"Pivot-Diagramm","pivot.chart.subtitle":"Eine Dimension und bis zu zwei Kennzahlen in einem kompakten Diagramm abbilden.","pivot.chart.subtitleReady":"{dimension} nach {measure}","pivot.chart.emptyNoDimension":"F\xFCgen Sie mindestens ein Zeilen- oder Spaltenfeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoValue":"F\xFCgen Sie mindestens ein Wertefeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoData":"F\xFCr die aktuelle Diagrammauswahl sind keine Daten verf\xFCgbar.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Kennzahl","pivot.chart.secondaryMeasure":"Vergleichskennzahl","pivot.chart.chartType":"Diagrammtyp","pivot.chart.style.barVertical":"Vertikale Balken","pivot.chart.style.barHorizontal":"Horizontale Balken","pivot.chart.style.line":"Linie","pivot.chart.style.scatter":"Streudiagramm","pivot.chart.collapse.ariaExpand":"Diagrammbereich erweitern","pivot.chart.collapse.ariaCollapse":"Diagrammbereich reduzieren","smartFilter.adaptFilters":"Filter anpassen","smartFilter.addFilters":"Filter hinzuf\xFCgen","smartFilter.go":"Los","smartFilter.visibleFilters":"Sichtbare Filter","smartFilter.searchPlaceholder":"Suchen...","smartFilter.noOptionsFound":"Keine Optionen gefunden","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Gleich","smartFilter.operator.contains":"Enth\xE4lt","smartFilter.operator.notContains":"Enth\xE4lt nicht","smartFilter.operator.wildcard":"Wildcard-Suche","smartFilter.operator.notEquals":"Ungleich","smartFilter.operator.greaterThan":"Gr\xF6\xDFer als","smartFilter.operator.lessThan":"Kleiner als","smartFilter.operator.greaterOrEqual":"Gr\xF6\xDFer gleich","smartFilter.operator.lessOrEqual":"Kleiner gleich","smartFilter.operator.between":"Zwischen","variant.noOptions":"Keine Optionen","variant.defaultSuffix":"Standard","variant.selectVariant":"Variante w\xE4hlen","variant.saveView":"Ansicht speichern","variant.newVariant":"Neue Variante","variant.viewName":"Ansichtsname","variant.setDefault":"Als Standard setzen","variant.publicAllUsers":"\xD6ffentlich (alle Benutzer)","variant.toast.fetchFailed":"Varianten konnten nicht geladen werden","variant.toast.saveFailed":"Variante konnte nicht gespeichert werden","variant.toast.saveSuccess":"Variante erfolgreich gespeichert","variant.toast.deleteFailed":"Variante konnte nicht gel\xF6scht werden","variant.toast.deleteSuccess":"Variante erfolgreich gel\xF6scht","variant.toast.defaultFailed":"Standardvariante konnte nicht aktualisiert werden","variant.toast.defaultSuccess":"Standardvariante aktualisiert","layout.saveLayout":"Layout speichern","layout.layoutOptions":"Layout-Optionen","layout.selectLayout":"Layout w\xE4hlen","layout.saveCurrentLayout":"Aktuelles Layout speichern...","layout.noSavedLayouts":"Keine gespeicherten Layouts","layout.removeDefault":"Standard entfernen","layout.setAsDefault":"Als Standard setzen","layout.layoutName":"Layoutname","layout.layoutDescription":"Beschreibung","layout.layoutNameHelper":"z. B. Kompaktansicht","layout.warningOverwrite":"Warnung: Vorhandenes Layout wird \xFCberschrieben","layout.useAsDefault":"Als Standardlayout verwenden","layout.publicAllUsers":"\xD6ffentlich (f\xFCr alle sichtbar)","layout.toast.loadFallback":"Layouts konnten nicht vom Backend geladen werden, Wechsel zu lokalem Speicher","layout.toast.saveSuccess":"Layout erfolgreich gespeichert","layout.toast.saveLocalSuccess":"Layout im lokalen Speicher gespeichert","layout.toast.backendUnavailableSavedLocal":"Backend nicht verf\xFCgbar, lokal gespeichert","layout.toast.deleteSuccess":"Layout erfolgreich gel\xF6scht","layout.toast.deleteLocalSuccess":"Layout aus lokalem Speicher gel\xF6scht","layout.toast.backendUnavailableDeletedLocal":"Backend nicht verf\xFCgbar, lokal gel\xF6scht","layout.toast.defaultSuccess":"Standardlayout gesetzt","layout.toast.defaultLocalSuccess":"Standardlayout lokal gesetzt","layout.toast.backendUnavailableDefaultLocal":"Backend nicht verf\xFCgbar, Standard lokal gespeichert","dateRange.label":"Datumsbereich","dateRange.startDate":"Startdatum","dateRange.endDate":"Enddatum","dateRange.select":"Ausw\xE4hlen...","dateRange.today":"Heute","dateRange.thisWeek":"Diese Woche","dateRange.thisMonth":"Diesen Monat","graph.records":"{count} Datens\xE4tze","graph.kpi.totalRecords":"Gesamt Datens\xE4tze","graph.kpi.totalReport":"Gesamt Report","graph.kpi.totalBillable":"Gesamt abrechenbar","graph.kpi.efficiency":"Effizienz","graph.kpi.amount":"Betrag","graph.kpi.flagged":"Markiert","graph.chart.billable.title":"Abrechenbar nach Dimension","graph.chart.billable.subtitle":"Top-Werte nach abrechenbaren Stunden","graph.chart.efficiency.title":"Effizienz pro Person","graph.chart.efficiency.subtitle":"Niedrigste Effizienz zuerst","graph.chart.status.title":"Statusverteilung","graph.chart.status.subtitle":"Anteil je Status","graph.dataBody":"Datentabelle","graph.reportTitle":"Grafikbericht","graph.unassigned":"Nicht zugewiesen","graph.column.reportHours":"Melde-Stunden","graph.column.billableHours":"Abrechenbare Stunden","detail.searchAi.placeholder":"Felder suchen, oder bei keinem Treffer die KI fragen...","detail.searchAi.matches":"{count} Treffer gefunden","detail.searchAi.noMatch":"Kein passendes Feld gefunden.","detail.searchAi.autoAiFallback":"Keine direkte \xDCbereinstimmung. KI-Analyse wird gestartet...","detail.searchAi.aiResultTitle":"KI-Ergebnis","detail.table.title":"Verkn\xFCpfte Eintr\xE4ge","kanban.empty":"Karten hier ablegen","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Loslassen, um in diese Spalte zu verschieben","kanban.bucket.add":"Spalte hinzuf\xFCgen","kanban.bucket.rename":"Spalte umbenennen","kanban.bucket.saveRename":"Spaltennamen speichern","kanban.bucket.cancelRename":"Umbenennen abbrechen","kanban.search.placeholder":"Karten und Spalten durchsuchen","kanban.search.clear":"Suche l\xF6schen","kanban.search.results":"{count} passende Karten","kanban.search.noMatch":"Keine passenden Karten","kanban.card.progress":"Fortschritt","kanban.card.openDetail":"Detail \xF6ffnen","kanban.priority.critical":"Kritisch","kanban.priority.high":"Hoch","kanban.priority.medium":"Mittel","kanban.priority.low":"Niedrig","quickCreate.newItem":"Neuer Eintrag","quickCreate.createWithTitle":"{title} erstellen","quickEdit.editWithTitle":"{title} bearbeiten","quickDelete.confirmTitle":"L\xF6schen best\xE4tigen","quickDelete.confirmMessageSingle":"M\xF6chten Sie den ausgew\xE4hlten Datensatz wirklich l\xF6schen?","quickDelete.confirmMessageMultiple":"M\xF6chten Sie die {count} ausgew\xE4hlten Datens\xE4tze wirklich l\xF6schen?","cardPage.viewDetails":"Details anzeigen","cardPage.download":"Herunterladen","cardPage.close":"Schlie\xDFen","cardPage.empty":"Keine Eintr\xE4ge gefunden","messageBox.confirm":"OK","messageBox.cancel":"Abbrechen","omph.status.idle":"Inaktiv","omph.status.pending":"Ausstehend","omph.status.running":"L\xE4uft","omph.status.success":"Erfolgt","omph.status.error":"Fehler","omph.working":"In Arbeit","omph.workingFor":"In Arbeit seit {duration}","omph.loadOlder":"Fr\xFChere Nachrichten laden","omph.loadingOlder":"Fr\xFChere Nachrichten werden geladen\u2026","omph.toBottom":"Nach unten","omph.copy":"Kopieren","omph.copied":"Kopiert","omph.turnActions":"Antwortaktionen","omph.usage":"Nutzung","omph.inputTokens":"Eingabe","omph.outputTokens":"Ausgabe","omph.duration":"Dauer","omph.send":"Senden","omph.stop":"Stoppen","omph.supplement.queued":"Zum laufenden Vorgang hinzugef\xFCgt","omph.turnRail":"Runden","omph.secondUnit":"s","omph.minuteUnit":"min","omph.preview.title":"Dateivorschau","omph.preview.close":"Vorschau schlie\xDFen","omph.preview.back":"Zur\xFCck zur Konversation","omph.preview.expand":"Vorschau vergr\xF6\xDFern","omph.preview.collapse":"Vorschau wiederherstellen","omph.preview.copyContent":"Inhalt kopieren","omph.preview.copyPath":"Pfad kopieren","omph.preview.download":"Herunterladen","omph.preview.openExternal":"Extern \xF6ffnen","omph.preview.wrap":"Zeilenumbruch","omph.preview.loading":"Datei wird geladen","omph.preview.missing":"Datei nicht gefunden","omph.preview.failed":"Datei konnte nicht geladen werden","omph.preview.unsupported":"Keine Vorschau f\xFCr diesen Dateityp","omph.preview.retry":"Erneut versuchen","omph.preview.resize":"Vorschaugr\xF6\xDFe \xE4ndern","omph.preview.line":"Zeile {start}","omph.preview.lines":"Zeilen {start}\u2013{end}","omph.preview.truncated":"Die ersten {shown} von {total} Zeilen werden angezeigt","omph.preview.sheetTruncated":"Die ersten {shown} von {total} Zeilen werden angezeigt","omph.preview.imageFailed":"Bild konnte nicht angezeigt werden","omph.preview.zoomIn":"Vergr\xF6\xDFern","omph.preview.zoomOut":"Verkleinern","omph.preview.zoomFit":"An Breite anpassen","omph.newConversation":"Neue Konversation","omph.conversationList":"Konversationsliste","omph.conversations":"Konversationen","omph.noConversations":"Noch keine Konversationen","omph.approval.waiting":"Auf Genehmigung wartend","omph.approval.choose":"Aktion w\xE4hlen","omph.approval.details":"Genehmigungsdetails","omph.approval.choices":"Aktionen","omph.approval.reject":"Ablehnen","omph.approval.allowOnce":"Einmal erlauben","omph.approval.confirm":"Fortfahren","omph.approval.other":"Sonstiges","omph.approval.otherPlaceholder":"Aktion beschreiben","omph.approval.escalation":"Tool {toolName} fordert privilegierte Ausf\xFChrung","omph.input.placeholder":"Nachricht eingeben\u2026","omph.input.upload":"Datei hochladen","omph.input.send":"Nachricht senden","omph.input.stop":"Generierung stoppen","omph.input.queue.ask":"Der Agent arbeitet. Jetzt oder nach diesem Zug senden?","omph.input.queue.sendNow":"Jetzt senden","omph.input.queue.afterTurn":"Nach diesem Zug senden","omph.input.queue.queued":"In Warteschlange \u2014 Senden nach diesem Zug","omph.input.queue.cancel":"Abbrechen","omph.input.message":"Nachrichteneingabe","omph.input.tools":"Eingabewerkzeuge","agentui.html.defaultTitle":"Interaktives HTML","agentui.html.open":"\xD6ffnen","agentui.html.preview":"Vorschau","agentui.html.code":"Code","agentui.html.toggle":"Zwischen Code und Vorschau wechseln","agentui.html.copy":"Code kopieren","agentui.html.copied":"Kopiert","agentui.html.download":"Herunterladen","agentui.html.close":"Schlie\xDFen"},Ef={"common.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","common.save":"\u4FDD\u5B58","common.ok":"OK","common.done":"\u5B8C\u4E86","common.search":"\u691C\u7D22","common.none":"\u306A\u3057","common.all":"\u3059\u3079\u3066","common.noData":"\u30C7\u30FC\u30BF\u306A\u3057","common.copy":"\u30B3\u30D4\u30FC","common.delete":"\u524A\u9664","common.loading":"\u8AAD\u307F\u8FBC\u307F\u4E2D...","header.searchPlaceholder":"\u4F55\u304B\u805E\u3044\u3066\u304F\u3060\u3055\u3044...","header.searchAddFeature":"\u6A5F\u80FD\u3092\u8FFD\u52A0","header.searchStartVoice":"\u97F3\u58F0\u5165\u529B\u3092\u958B\u59CB","header.searchStopVoice":"\u97F3\u58F0\u5165\u529B\u3092\u505C\u6B62","header.searchOpenPanel":"\u4F1A\u8A71\u3092\u958B\u304F","header.theme.system":"\u30C6\u30FC\u30DE\uFF1A\u30B7\u30B9\u30C6\u30E0","header.theme.dark":"\u30C6\u30FC\u30DE\uFF1A\u30C0\u30FC\u30AF","header.theme.light":"\u30C6\u30FC\u30DE\uFF1A\u30E9\u30A4\u30C8","header.menu.setting":"\u8A2D\u5B9A","header.menu.refresh":"\u518D\u8AAD\u307F\u8FBC\u307F","header.menu.logout":"\u30ED\u30B0\u30A2\u30A6\u30C8","navigation.expand":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u5C55\u958B","navigation.collapse":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u6298\u308A\u305F\u305F\u3080","navigation.searchPlaceholder":"\u30E1\u30CB\u30E5\u30FC\u3092\u691C\u7D22...","navigation.noMatch":"\u4E00\u81F4\u3059\u308B\u30E1\u30CB\u30E5\u30FC\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noAccessibleApp":"\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30A2\u30D7\u30EA\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noItems":"\u8868\u793A\u3067\u304D\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093","navigation.expandView":"{title} \u3092\u5C55\u958B","navigation.mode.switchToFixed":"\u56FA\u5B9A\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.mode.switchToFloating":"\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.pinned":"\u30D4\u30F3\u7559\u3081","navigation.pin.add":"\u4E0A\u90E8\u306B\u30D4\u30F3\u7559\u3081","navigation.pin.remove":"\u30D4\u30F3\u7559\u3081\u3092\u89E3\u9664","table.toolbar.searchPlaceholder":"\u691C\u7D22...","table.title.default":"\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB","table.toolbar.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.toolbar.summary":"\u96C6\u8A08","table.toolbar.columns":"\u5217","table.toolbar.export":"\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","table.toolbar.itemsPerPage":"1\u30DA\u30FC\u30B8\u306E\u4EF6\u6570\uFF1A","table.toolbar.pageOf":"{current} / {total} \u30DA\u30FC\u30B8","table.toolbar.newItem":"\u65B0\u898F\u4F5C\u6210","table.toolbar.editItem":"\u7DE8\u96C6","table.toolbar.deleteItem":"\u524A\u9664","table.toolbar.graphicReport":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","table.toolbar.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","table.menu.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.menu.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.menu.visibleColumns":"\u8868\u793A\u5217","table.menu.showSummaryRow":"\u96C6\u8A08\u884C\u3092\u8868\u793A","table.menu.noNumericColumns":"\u6570\u5024\u5217\u304C\u3042\u308A\u307E\u305B\u3093","table.group.expandAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B","table.group.collapseAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080","table.mobile.notImplemented":"\u30E2\u30D0\u30A4\u30EB\u8868\u793A\u306F\u672A\u5B9F\u88C5\u3067\u3059","table.headerMenu.sortAsc":"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.sortDesc":"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.clearSort":"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664","table.headerMenu.configureSort":"\u4E26\u3079\u66FF\u3048\u3092\u8A2D\u5B9A...","table.headerMenu.group":"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316","table.headerMenu.ungroup":"\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u5916\u3059","table.headerMenu.addSummary":"\u96C6\u8A08\u306B\u8FFD\u52A0","table.headerMenu.removeSummary":"\u96C6\u8A08\u304B\u3089\u524A\u9664","table.headerMenu.hideColumn":"\u5217\u3092\u975E\u8868\u793A","table.sortDialog.title":"\u4E26\u3079\u66FF\u3048\u8A2D\u5B9A","table.sortDialog.empty":"\u4E26\u3079\u66FF\u3048\u30EB\u30FC\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","table.sortDialog.addRule":"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0","table.sortDialog.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.sortDialog.asc":"\u6607\u9806","table.sortDialog.desc":"\u964D\u9806","pivot.title.default":"\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB","pivot.subtitle.default":"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002","pivot.empty":"\u7D50\u679C\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5024\u30A8\u30EA\u30A2\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.records":"\u30EC\u30B3\u30FC\u30C9","pivot.afterFilter":"\u30D5\u30A3\u30EB\u30BF\u30FC\u5F8C","pivot.grandTotal":"\u7DCF\u8A08","pivot.resultLabel":"\u7D50\u679C","pivot.valueLabel":"\u5024","pivot.table.dimensions":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.config.title":"\u8A2D\u5B9A","pivot.fieldList":"\u30D5\u30A3\u30FC\u30EB\u30C9\u4E00\u89A7","pivot.availableDimensions":"\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.allFieldsInUse":"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u4F7F\u7528\u4E2D\u3067\u3059\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u30D5\u30A3\u30EB\u30BF\u30FC","pivot.zone.values":"\u5024","pivot.hint.rows":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u884C\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.columns":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u5217\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.filters":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30EC\u30DD\u30FC\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8A2D\u5B9A","pivot.hint.values":"\u3053\u3053\u306B\u6570\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u96C6\u8A08","pivot.clearArea":"\u30A8\u30EA\u30A2\u3092\u30AF\u30EA\u30A2","pivot.filter.na":"N/A","pivot.filter.noValues":"\u5024\u304C\u3042\u308A\u307E\u305B\u3093","pivot.filter.noneSelected":"\u672A\u9078\u629E","pivot.filter.allValues":"\u3059\u3079\u3066\u306E\u5024","pivot.filter.selectedCount":"{selected} / {total} \u3092\u9078\u629E","pivot.filter.selectAll":"\u3059\u3079\u3066\u9078\u629E","pivot.filter.deselectAll":"\u3059\u3079\u3066\u89E3\u9664","pivot.filter.noResults":"\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093","pivot.collapse.ariaExpand":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u5C55\u958B","pivot.collapse.ariaCollapse":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u6298\u308A\u305F\u305F\u3080","pivot.agg.sum":"\u5408\u8A08","pivot.agg.count":"\u4EF6\u6570","pivot.agg.avg":"\u5E73\u5747","pivot.agg.min":"\u6700\u5C0F","pivot.agg.max":"\u6700\u5927","pivot.preset.selectPlaceholder":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u9078\u629E","pivot.preset.save":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.delete":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u524A\u9664","pivot.preset.saveDialogTitle":"\u73FE\u5728\u306E\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.nameLabel":"\u30D7\u30EA\u30BB\u30C3\u30C8\u540D","pivot.preset.defaultName":"\u30D7\u30EA\u30BB\u30C3\u30C8 {index}","pivot.table.sectionTitle":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u5C55\u958B","pivot.table.collapse.ariaCollapse":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u6298\u308A\u305F\u305F\u3080","pivot.chart.title":"\u30D4\u30DC\u30C3\u30C8\u30C1\u30E3\u30FC\u30C8","pivot.chart.subtitle":"1\u3064\u306E\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u6700\u59272\u3064\u306E\u6307\u6A19\u3092\u30B3\u30F3\u30D1\u30AF\u30C8\u306A\u30C1\u30E3\u30FC\u30C8\u306B\u307E\u3068\u3081\u307E\u3059\u3002","pivot.chart.subtitleReady":"{dimension} \u3054\u3068\u306E {measure}","pivot.chart.emptyNoDimension":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u884C\u307E\u305F\u306F\u5217\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoValue":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoData":"\u73FE\u5728\u306E\u30C1\u30E3\u30FC\u30C8\u9078\u629E\u3067\u306F\u8868\u793A\u3067\u304D\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002","pivot.chart.dimension":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.chart.primaryMeasure":"\u6307\u6A19","pivot.chart.secondaryMeasure":"\u6BD4\u8F03\u6307\u6A19","pivot.chart.chartType":"\u30C1\u30E3\u30FC\u30C8\u7A2E\u5225","pivot.chart.style.barVertical":"\u7E26\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.barHorizontal":"\u6A2A\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.line":"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5","pivot.chart.style.scatter":"\u6563\u5E03\u56F3","pivot.chart.collapse.ariaExpand":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u5C55\u958B","pivot.chart.collapse.ariaCollapse":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u6298\u308A\u305F\u305F\u3080","smartFilter.adaptFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8ABF\u6574","smartFilter.addFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8FFD\u52A0","smartFilter.go":"\u5B9F\u884C","smartFilter.visibleFilters":"\u8868\u793A\u30D5\u30A3\u30EB\u30BF\u30FC","smartFilter.searchPlaceholder":"\u691C\u7D22...","smartFilter.noOptionsFound":"\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","smartFilter.min":"\u6700\u5C0F","smartFilter.max":"\u6700\u5927","smartFilter.minMaxPlaceholder":"\u6700\u5C0F - \u6700\u5927","smartFilter.operator.equals":"\u7B49\u3057\u3044","smartFilter.operator.contains":"\u542B\u3080","smartFilter.operator.notContains":"\u542B\u307E\u306A\u3044","smartFilter.operator.wildcard":"\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u691C\u7D22","smartFilter.operator.notEquals":"\u7B49\u3057\u304F\u306A\u3044","smartFilter.operator.greaterThan":"\u3088\u308A\u5927\u304D\u3044","smartFilter.operator.lessThan":"\u3088\u308A\u5C0F\u3055\u3044","smartFilter.operator.greaterOrEqual":"\u4EE5\u4E0A","smartFilter.operator.lessOrEqual":"\u4EE5\u4E0B","smartFilter.operator.between":"\u7BC4\u56F2","variant.noOptions":"\u30AA\u30D7\u30B7\u30E7\u30F3\u306A\u3057","variant.defaultSuffix":"\u30C7\u30D5\u30A9\u30EB\u30C8","variant.selectVariant":"\u30D3\u30E5\u30FC\u3092\u9078\u629E","variant.saveView":"\u30D3\u30E5\u30FC\u4FDD\u5B58","variant.newVariant":"\u65B0\u3057\u3044\u30D3\u30E5\u30FC","variant.viewName":"\u30D3\u30E5\u30FC\u540D","variant.setDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","variant.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\uFF09","variant.toast.fetchFailed":"\u30D3\u30E5\u30FC\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveFailed":"\u30D3\u30E5\u30FC\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveSuccess":"\u30D3\u30E5\u30FC\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","variant.toast.deleteFailed":"\u30D3\u30E5\u30FC\u306E\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.deleteSuccess":"\u30D3\u30E5\u30FC\u3092\u524A\u9664\u3057\u307E\u3057\u305F","variant.toast.defaultFailed":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F","layout.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","layout.layoutOptions":"\u30EC\u30A4\u30A2\u30A6\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3","layout.selectLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u9078\u629E","layout.saveCurrentLayout":"\u73FE\u5728\u306E\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58...","layout.noSavedLayouts":"\u4FDD\u5B58\u6E08\u307F\u30EC\u30A4\u30A2\u30A6\u30C8\u306A\u3057","layout.removeDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u89E3\u9664","layout.setAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","layout.layoutName":"\u30EC\u30A4\u30A2\u30A6\u30C8\u540D","layout.layoutDescription":"\u8AAC\u660E","layout.layoutNameHelper":"\u4F8B\uFF1A\u30B3\u30F3\u30D1\u30AF\u30C8\u8868\u793A","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u65E2\u5B58\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059","layout.useAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3068\u3057\u3066\u4F7F\u7528","layout.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\uFF09","layout.toast.loadFallback":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u304B\u3089\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u3001\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u306B\u5207\u308A\u66FF\u3048\u307E\u3057\u305F","layout.toast.saveSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.saveLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableSavedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.deleteSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.deleteLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDeletedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.defaultLocalSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDefaultLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","dateRange.label":"\u65E5\u4ED8\u7BC4\u56F2","dateRange.startDate":"\u958B\u59CB\u65E5","dateRange.endDate":"\u7D42\u4E86\u65E5","dateRange.select":"\u9078\u629E...","dateRange.today":"\u4ECA\u65E5","dateRange.thisWeek":"\u4ECA\u9031","dateRange.thisMonth":"\u4ECA\u6708","graph.records":"{count} \u4EF6","graph.kpi.totalRecords":"\u7DCF\u30EC\u30B3\u30FC\u30C9","graph.kpi.totalReport":"\u7DCF\u5831\u544A\u6642\u9593","graph.kpi.totalBillable":"\u7DCF\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.kpi.efficiency":"\u52B9\u7387","graph.kpi.amount":"\u91D1\u984D","graph.kpi.flagged":"\u8981\u78BA\u8A8D","graph.chart.billable.title":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u5225\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.chart.billable.subtitle":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593\u306E\u4E0A\u4F4D","graph.chart.efficiency.title":"\u62C5\u5F53\u8005\u5225\u52B9\u7387","graph.chart.efficiency.subtitle":"\u52B9\u7387\u306E\u4F4E\u3044\u9806","graph.chart.status.title":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5206\u5E03","graph.chart.status.subtitle":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5225\u6BD4\u7387","graph.dataBody":"\u30C7\u30FC\u30BF\u672C\u4F53","graph.reportTitle":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","graph.unassigned":"\u672A\u5272\u308A\u5F53\u3066","graph.column.reportHours":"\u5831\u544A\u6642\u9593","graph.column.billableHours":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","detail.searchAi.placeholder":"\u9805\u76EE\u3092\u691C\u7D22\u3002\u898B\u3064\u304B\u3089\u306A\u3044\u5834\u5408\u306FAI\u306B\u8CEA\u554F\u3057\u307E\u3059...","detail.searchAi.matches":"{count} \u4EF6\u306E\u4E00\u81F4","detail.searchAi.noMatch":"\u4E00\u81F4\u3059\u308B\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002","detail.searchAi.autoAiFallback":"\u4E00\u81F4\u306A\u3057\u3002AI\u5206\u6790\u3092\u5B9F\u884C\u3057\u307E\u3059...","detail.searchAi.aiResultTitle":"AI\u5206\u6790\u7D50\u679C","detail.table.title":"\u95A2\u9023\u30EC\u30B3\u30FC\u30C9","kanban.empty":"\u3053\u3053\u306B\u30AB\u30FC\u30C9\u3092\u30C9\u30ED\u30C3\u30D7","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u96E2\u3059\u3068\u3053\u306E bucket \u306B\u79FB\u52D5\u3057\u307E\u3059","kanban.bucket.add":"bucket \u3092\u8FFD\u52A0","kanban.bucket.rename":"bucket \u540D\u3092\u5909\u66F4","kanban.bucket.saveRename":"bucket \u540D\u3092\u4FDD\u5B58","kanban.bucket.cancelRename":"\u540D\u524D\u5909\u66F4\u3092\u30AD\u30E3\u30F3\u30BB\u30EB","kanban.search.placeholder":"\u30AB\u30FC\u30C9\u3068 bucket \u3092\u691C\u7D22","kanban.search.clear":"\u691C\u7D22\u3092\u30AF\u30EA\u30A2","kanban.search.results":"{count} \u4EF6\u306E\u30AB\u30FC\u30C9\u304C\u4E00\u81F4","kanban.search.noMatch":"\u4E00\u81F4\u3059\u308B\u30AB\u30FC\u30C9\u306F\u3042\u308A\u307E\u305B\u3093","kanban.card.progress":"\u9032\u6357","kanban.card.openDetail":"\u8A73\u7D30\u3092\u958B\u304F","kanban.priority.critical":"\u7DCA\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u898F\u4F5C\u6210","quickCreate.createWithTitle":"{title} \u3092\u4F5C\u6210","quickEdit.editWithTitle":"{title} \u3092\u7DE8\u96C6","quickDelete.confirmTitle":"\u524A\u9664\u306E\u78BA\u8A8D","quickDelete.confirmMessageSingle":"\u9078\u629E\u3057\u305F\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","quickDelete.confirmMessageMultiple":"\u9078\u629E\u3057\u305F {count} \u4EF6\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","cardPage.viewDetails":"\u8A73\u7D30\u3092\u8868\u793A","cardPage.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","cardPage.close":"\u9589\u3058\u308B","cardPage.empty":"\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","messageBox.confirm":"OK","messageBox.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","omph.status.idle":"\u5F85\u6A5F\u4E2D","omph.status.pending":"\u51E6\u7406\u5F85\u3061","omph.status.running":"\u51E6\u7406\u4E2D","omph.status.success":"\u5B8C\u4E86","omph.status.error":"\u30A8\u30E9\u30FC","omph.working":"\u51E6\u7406\u4E2D","omph.workingFor":"\u51E6\u7406\u4E2D\uFF08{duration} \u7D4C\u904E\uFF09","omph.loadOlder":"\u904E\u53BB\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8AAD\u307F\u8FBC\u3080","omph.loadingOlder":"\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026","omph.toBottom":"\u4E00\u756A\u4E0B\u3078","omph.copy":"\u30B3\u30D4\u30FC","omph.copied":"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F","omph.turnActions":"\u8FD4\u4FE1\u30A2\u30AF\u30B7\u30E7\u30F3","omph.usage":"\u4F7F\u7528\u91CF","omph.inputTokens":"\u5165\u529B","omph.outputTokens":"\u51FA\u529B","omph.duration":"\u6240\u8981\u6642\u9593","omph.send":"\u9001\u4FE1","omph.stop":"\u505C\u6B62","omph.supplement.queued":"\u5B9F\u884C\u4E2D\u306E\u30BF\u30B9\u30AF\u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F","omph.turnRail":"\u30BF\u30FC\u30F3","omph.secondUnit":"\u79D2","omph.minuteUnit":"\u5206","omph.preview.title":"\u30D5\u30A1\u30A4\u30EB\u30D7\u30EC\u30D3\u30E5\u30FC","omph.preview.close":"\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u9589\u3058\u308B","omph.preview.back":"\u4F1A\u8A71\u306B\u623B\u308B","omph.preview.expand":"\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u62E1\u5927","omph.preview.collapse":"\u30D7\u30EC\u30D3\u30E5\u30FC\u306E\u30B5\u30A4\u30BA\u3092\u623B\u3059","omph.preview.copyContent":"\u5185\u5BB9\u3092\u30B3\u30D4\u30FC","omph.preview.copyPath":"\u30D1\u30B9\u3092\u30B3\u30D4\u30FC","omph.preview.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","omph.preview.openExternal":"\u5916\u90E8\u3067\u958B\u304F","omph.preview.wrap":"\u6298\u308A\u8FD4\u3057","omph.preview.loading":"\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u307F\u4E2D","omph.preview.missing":"\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","omph.preview.failed":"\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F","omph.preview.unsupported":"\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u306F\u30D7\u30EC\u30D3\u30E5\u30FC\u3067\u304D\u307E\u305B\u3093","omph.preview.retry":"\u518D\u8A66\u884C","omph.preview.resize":"\u30D7\u30EC\u30D3\u30E5\u30FC\u30B5\u30A4\u30BA\u306E\u5909\u66F4","omph.preview.line":"{start} \u884C\u76EE","omph.preview.lines":"{start}\u2013{end} \u884C","omph.preview.truncated":"\u5168 {total} \u884C\u4E2D\u5148\u982D {shown} \u884C\u3092\u8868\u793A","omph.preview.sheetTruncated":"\u5168 {total} \u884C\u4E2D\u5148\u982D {shown} \u884C\u3092\u8868\u793A","omph.preview.imageFailed":"\u753B\u50CF\u3092\u8868\u793A\u3067\u304D\u307E\u305B\u3093","omph.preview.zoomIn":"\u62E1\u5927","omph.preview.zoomOut":"\u7E2E\u5C0F","omph.preview.zoomFit":"\u5E45\u306B\u5408\u308F\u305B\u308B","omph.newConversation":"\u65B0\u3057\u3044\u4F1A\u8A71","omph.conversationList":"\u4F1A\u8A71\u30EA\u30B9\u30C8","omph.conversations":"\u4F1A\u8A71","omph.noConversations":"\u4F1A\u8A71\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093","omph.approval.waiting":"\u627F\u8A8D\u5F85\u3061","omph.approval.choose":"\u64CD\u4F5C\u3092\u9078\u629E","omph.approval.details":"\u627F\u8A8D\u306E\u8A73\u7D30","omph.approval.choices":"\u64CD\u4F5C","omph.approval.reject":"\u62D2\u5426","omph.approval.allowOnce":"\u4ECA\u56DE\u306E\u307F\u8A31\u53EF","omph.approval.confirm":"\u7D9A\u884C","omph.approval.other":"\u305D\u306E\u4ED6","omph.approval.otherPlaceholder":"\u5B9F\u884C\u3059\u308B\u64CD\u4F5C\u3092\u5165\u529B","omph.approval.escalation":"\u30C4\u30FC\u30EB {toolName} \u304C\u7279\u6A29\u5B9F\u884C\u3092\u8981\u6C42\u3057\u3066\u3044\u307E\u3059","omph.input.placeholder":"\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u5165\u529B\u2026","omph.input.upload":"\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9","omph.input.send":"\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u9001\u4FE1","omph.input.stop":"\u751F\u6210\u3092\u505C\u6B62","omph.input.queue.ask":"\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u304C\u5B9F\u884C\u4E2D\u3067\u3059\u3002\u4ECA\u3059\u3050\u9001\u4FE1\u3057\u307E\u3059\u304B\u3001\u3053\u306E\u30BF\u30FC\u30F3\u306E\u5F8C\u306B\u9001\u4FE1\u3057\u307E\u3059\u304B\uFF1F","omph.input.queue.sendNow":"\u4ECA\u3059\u3050\u9001\u4FE1","omph.input.queue.afterTurn":"\u3053\u306E\u30BF\u30FC\u30F3\u306E\u5F8C\u306B\u9001\u4FE1","omph.input.queue.queued":"\u5F85\u6A5F\u4E2D \u2014 \u3053\u306E\u30BF\u30FC\u30F3\u306E\u5F8C\u306B\u81EA\u52D5\u9001\u4FE1","omph.input.queue.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","omph.input.message":"\u30E1\u30C3\u30BB\u30FC\u30B8\u5165\u529B","omph.input.tools":"\u5165\u529B\u30C4\u30FC\u30EB","agentui.html.defaultTitle":"\u30A4\u30F3\u30BF\u30E9\u30AF\u30C6\u30A3\u30D6 HTML","agentui.html.open":"\u958B\u304F","agentui.html.preview":"\u30D7\u30EC\u30D3\u30E5\u30FC","agentui.html.code":"\u30B3\u30FC\u30C9","agentui.html.toggle":"\u30B3\u30FC\u30C9\u3068\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u5207\u308A\u66FF\u3048\u308B","agentui.html.copy":"\u30B3\u30FC\u30C9\u3092\u30B3\u30D4\u30FC","agentui.html.copied":"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F","agentui.html.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","agentui.html.close":"\u9589\u3058\u308B"},Lf={"common.cancel":"\uCDE8\uC18C","common.save":"\uC800\uC7A5","common.ok":"\uD655\uC778","common.done":"\uC644\uB8CC","common.search":"\uAC80\uC0C9","common.none":"\uC5C6\uC74C","common.all":"\uC804\uCCB4","common.noData":"\uB370\uC774\uD130 \uC5C6\uC74C","common.copy":"\uBCF5\uC0AC","common.delete":"\uC0AD\uC81C","common.loading":"\uB85C\uB529 \uC911...","header.searchPlaceholder":"\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...","header.searchAddFeature":"\uAE30\uB2A5 \uCD94\uAC00","header.searchStartVoice":"\uC74C\uC131 \uC785\uB825 \uC2DC\uC791","header.searchStopVoice":"\uC74C\uC131 \uC785\uB825 \uC911\uC9C0","header.searchOpenPanel":"\uB300\uD654 \uC5F4\uAE30","header.theme.system":"\uD14C\uB9C8: \uC2DC\uC2A4\uD15C","header.theme.dark":"\uD14C\uB9C8: \uB2E4\uD06C","header.theme.light":"\uD14C\uB9C8: \uB77C\uC774\uD2B8","header.menu.setting":"\uC124\uC815","header.menu.refresh":"\uC0C8\uB85C \uACE0\uCE68","header.menu.logout":"\uB85C\uADF8\uC544\uC6C3","navigation.expand":"\uD0D0\uC0C9 \uD3BC\uCE58\uAE30","navigation.collapse":"\uD0D0\uC0C9 \uC811\uAE30","navigation.searchPlaceholder":"\uBA54\uB274 \uAC80\uC0C9...","navigation.noMatch":"\uC77C\uCE58\uD558\uB294 \uBA54\uB274\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noAccessibleApp":"\uC811\uADFC \uAC00\uB2A5\uD55C \uC571\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noItems":"\uD45C\uC2DC\uD560 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.expandView":"{title} \uD3BC\uCE58\uAE30","navigation.mode.switchToFixed":"\uACE0\uC815 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.mode.switchToFloating":"\uD50C\uB85C\uD305 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.pinned":"\uACE0\uC815\uB428","navigation.pin.add":"\uC0C1\uB2E8\uC5D0 \uACE0\uC815","navigation.pin.remove":"\uACE0\uC815 \uD574\uC81C","table.toolbar.searchPlaceholder":"\uAC80\uC0C9...","table.title.default":"\uB370\uC774\uD130 \uD14C\uC774\uBE14","table.toolbar.groupBy":"\uADF8\uB8F9","table.toolbar.summary":"\uC694\uC57D","table.toolbar.columns":"\uC5F4","table.toolbar.export":"\uB0B4\uBCF4\uB0B4\uAE30","table.toolbar.itemsPerPage":"\uD398\uC774\uC9C0\uB2F9 \uD589 \uC218:","table.toolbar.pageOf":"{current} / {total} \uD398\uC774\uC9C0","table.toolbar.newItem":"\uC2E0\uADDC \uD56D\uBAA9","table.toolbar.editItem":"\uD56D\uBAA9 \uC218\uC815","table.toolbar.deleteItem":"\uD56D\uBAA9 \uC0AD\uC81C","table.toolbar.graphicReport":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","table.toolbar.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","table.menu.groupBy":"\uADF8\uB8F9","table.menu.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.menu.visibleColumns":"\uD45C\uC2DC \uC5F4","table.menu.showSummaryRow":"\uC694\uC57D \uD589 \uD45C\uC2DC","table.menu.noNumericColumns":"\uC22B\uC790 \uC5F4 \uC5C6\uC74C","table.group.expandAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uD3BC\uCE58\uAE30","table.group.collapseAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uC811\uAE30","table.mobile.notImplemented":"\uBAA8\uBC14\uC77C \uBDF0\uB294 \uC544\uC9C1 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4","table.headerMenu.sortAsc":"\uC624\uB984\uCC28\uC21C \uC815\uB82C","table.headerMenu.sortDesc":"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C","table.headerMenu.clearSort":"\uC815\uB82C \uD574\uC81C","table.headerMenu.configureSort":"\uC815\uB82C \uC124\uC815...","table.headerMenu.group":"\uC774 \uC5F4\uB85C \uADF8\uB8F9\uD654","table.headerMenu.ungroup":"\uADF8\uB8F9\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.addSummary":"\uC694\uC57D\uC5D0 \uCD94\uAC00","table.headerMenu.removeSummary":"\uC694\uC57D\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.hideColumn":"\uC5F4 \uC228\uAE30\uAE30","table.sortDialog.title":"\uC815\uB82C \uC124\uC815","table.sortDialog.empty":"\uC815\uB82C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uCD94\uAC00\uD558\uC138\uC694.","table.sortDialog.addRule":"\uADDC\uCE59 \uCD94\uAC00","table.sortDialog.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.sortDialog.asc":"\uC624\uB984\uCC28\uC21C","table.sortDialog.desc":"\uB0B4\uB9BC\uCC28\uC21C","pivot.title.default":"\uD53C\uBC97 \uD14C\uC774\uBE14","pivot.subtitle.default":"\uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD53C\uBC97 \uD14C\uC774\uBE14\uC744 \uAD6C\uC131\uD558\uC138\uC694.","pivot.empty":"\uACB0\uACFC\uB97C \uBCF4\uB824\uBA74 \uAC12 \uC601\uC5ED\uC5D0 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.records":"\uB808\uCF54\uB4DC","pivot.afterFilter":"\uD544\uD130 \uD6C4","pivot.grandTotal":"\uCD1D\uD569","pivot.resultLabel":"\uACB0\uACFC","pivot.valueLabel":"\uAC12","pivot.table.dimensions":"\uCC28\uC6D0","pivot.config.title":"\uAD6C\uC131","pivot.fieldList":"\uD544\uB4DC \uBAA9\uB85D","pivot.availableDimensions":"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCC28\uC6D0","pivot.allFieldsInUse":"\uBAA8\uB4E0 \uD544\uB4DC\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC785\uB2C8\uB2E4.","pivot.zone.rows":"\uD589","pivot.zone.columns":"\uC5F4","pivot.zone.filters":"\uD544\uD130","pivot.zone.values":"\uAC12","pivot.hint.rows":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD589 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.columns":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uC5F4 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.filters":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uBCF4\uACE0\uC11C \uD544\uD130\uB85C \uC0AC\uC6A9","pivot.hint.values":"\uC22B\uC790 \uD544\uB4DC\uB97C \uC5EC\uAE30\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC9D1\uACC4","pivot.clearArea":"\uC601\uC5ED \uBE44\uC6B0\uAE30","pivot.filter.na":"\uD574\uB2F9 \uC5C6\uC74C","pivot.filter.noValues":"\uAC12 \uC5C6\uC74C","pivot.filter.noneSelected":"\uC120\uD0DD \uC5C6\uC74C","pivot.filter.allValues":"\uBAA8\uB4E0 \uAC12","pivot.filter.selectedCount":"{selected} / {total} \uC120\uD0DD\uB428","pivot.filter.selectAll":"\uC804\uCCB4 \uC120\uD0DD","pivot.filter.deselectAll":"\uC804\uCCB4 \uD574\uC81C","pivot.filter.noResults":"\uAC80\uC0C9 \uACB0\uACFC \uC5C6\uC74C","pivot.collapse.ariaExpand":"\uAD6C\uC131 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.collapse.ariaCollapse":"\uAD6C\uC131 \uC601\uC5ED \uC811\uAE30","pivot.agg.sum":"\uD569\uACC4","pivot.agg.count":"\uAC1C\uC218","pivot.agg.avg":"\uD3C9\uADE0","pivot.agg.min":"\uCD5C\uC18C","pivot.agg.max":"\uCD5C\uB300","pivot.preset.selectPlaceholder":"\uD504\uB9AC\uC14B \uC120\uD0DD","pivot.preset.save":"\uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.delete":"\uD504\uB9AC\uC14B \uC0AD\uC81C","pivot.preset.saveDialogTitle":"\uD604\uC7AC \uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.nameLabel":"\uD504\uB9AC\uC14B \uC774\uB984","pivot.preset.defaultName":"\uD504\uB9AC\uC14B {index}","pivot.table.sectionTitle":"\uD53C\uBC97 \uACB0\uACFC","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\uD53C\uBC97 \uACB0\uACFC \uD3BC\uCE58\uAE30","pivot.table.collapse.ariaCollapse":"\uD53C\uBC97 \uACB0\uACFC \uC811\uAE30","pivot.chart.title":"\uD53C\uBC97 \uCC28\uD2B8","pivot.chart.subtitle":"\uD558\uB098\uC758 \uCC28\uC6D0\uACFC \uCD5C\uB300 \uB450 \uAC1C\uC758 \uCE21\uC815\uAC12\uC744 \uAC04\uACB0\uD55C \uCC28\uD2B8\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4.","pivot.chart.subtitleReady":"{dimension}\uBCC4 {measure}","pivot.chart.emptyNoDimension":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD589 \uB610\uB294 \uC5F4 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoValue":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uAC12 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoData":"\uD604\uC7AC \uCC28\uD2B8 \uC120\uD0DD\uC5D0 \uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.","pivot.chart.dimension":"\uCC28\uD2B8 \uCC28\uC6D0","pivot.chart.primaryMeasure":"\uC8FC \uCE21\uC815\uAC12","pivot.chart.secondaryMeasure":"\uBE44\uAD50 \uCE21\uC815\uAC12","pivot.chart.chartType":"\uCC28\uD2B8 \uC720\uD615","pivot.chart.style.barVertical":"\uC138\uB85C \uB9C9\uB300","pivot.chart.style.barHorizontal":"\uAC00\uB85C \uB9C9\uB300","pivot.chart.style.line":"\uC120\uD615 \uCC28\uD2B8","pivot.chart.style.scatter":"\uC0B0\uC810\uB3C4","pivot.chart.collapse.ariaExpand":"\uCC28\uD2B8 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.chart.collapse.ariaCollapse":"\uCC28\uD2B8 \uC601\uC5ED \uC811\uAE30","smartFilter.adaptFilters":"\uD544\uD130 \uC870\uC815","smartFilter.addFilters":"\uD544\uD130 \uCD94\uAC00","smartFilter.go":"\uC2E4\uD589","smartFilter.visibleFilters":"\uD45C\uC2DC \uD544\uD130","smartFilter.searchPlaceholder":"\uAC80\uC0C9...","smartFilter.noOptionsFound":"\uC635\uC158\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","smartFilter.min":"\uCD5C\uC18C","smartFilter.max":"\uCD5C\uB300","smartFilter.minMaxPlaceholder":"\uCD5C\uC18C - \uCD5C\uB300","smartFilter.operator.equals":"\uAC19\uC74C","smartFilter.operator.contains":"\uD3EC\uD568","smartFilter.operator.notContains":"\uBBF8\uD3EC\uD568","smartFilter.operator.wildcard":"\uC640\uC77C\uB4DC\uCE74\uB4DC \uAC80\uC0C9","smartFilter.operator.notEquals":"\uAC19\uC9C0 \uC54A\uC74C","smartFilter.operator.greaterThan":"\uBCF4\uB2E4 \uD07C","smartFilter.operator.lessThan":"\uBCF4\uB2E4 \uC791\uC74C","smartFilter.operator.greaterOrEqual":"\uC774\uC0C1","smartFilter.operator.lessOrEqual":"\uC774\uD558","smartFilter.operator.between":"\uBC94\uC704","variant.noOptions":"\uC635\uC158 \uC5C6\uC74C","variant.defaultSuffix":"\uAE30\uBCF8","variant.selectVariant":"\uBDF0 \uC120\uD0DD","variant.saveView":"\uBDF0 \uC800\uC7A5","variant.newVariant":"\uC0C8 \uBDF0","variant.viewName":"\uBDF0 \uC774\uB984","variant.setDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","variant.publicAllUsers":"\uACF5\uAC1C(\uC804\uCCB4 \uC0AC\uC6A9\uC790)","variant.toast.fetchFailed":"\uBDF0\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveFailed":"\uBDF0\uB97C \uC800\uC7A5\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveSuccess":"\uBDF0\uAC00 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.deleteFailed":"\uBDF0\uB97C \uC0AD\uC81C\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.deleteSuccess":"\uBDF0\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.defaultFailed":"\uAE30\uBCF8 \uBDF0\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.defaultSuccess":"\uAE30\uBCF8 \uBDF0\uAC00 \uC5C5\uB370\uC774\uD2B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","layout.layoutOptions":"\uB808\uC774\uC544\uC6C3 \uC635\uC158","layout.selectLayout":"\uB808\uC774\uC544\uC6C3 \uC120\uD0DD","layout.saveCurrentLayout":"\uD604\uC7AC \uB808\uC774\uC544\uC6C3 \uC800\uC7A5...","layout.noSavedLayouts":"\uC800\uC7A5\uB41C \uB808\uC774\uC544\uC6C3 \uC5C6\uC74C","layout.removeDefault":"\uAE30\uBCF8 \uD574\uC81C","layout.setAsDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","layout.layoutName":"\uB808\uC774\uC544\uC6C3 \uC774\uB984","layout.layoutDescription":"\uC124\uBA85","layout.layoutNameHelper":"\uC608: \uCEF4\uD329\uD2B8 \uBDF0","layout.warningOverwrite":"\uACBD\uACE0: \uAE30\uC874 \uB808\uC774\uC544\uC6C3\uC774 \uB36E\uC5B4\uC4F0\uAE30 \uB429\uB2C8\uB2E4","layout.useAsDefault":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC73C\uB85C \uC0AC\uC6A9","layout.publicAllUsers":"\uACF5\uAC1C(\uBAA8\uB4E0 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uD45C\uC2DC)","layout.toast.loadFallback":"\uBC31\uC5D4\uB4DC\uC5D0\uC11C \uB808\uC774\uC544\uC6C3\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD574 \uB85C\uCEEC \uC800\uC7A5\uC18C\uB85C \uC804\uD658\uD588\uC2B5\uB2C8\uB2E4","layout.toast.saveSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.saveLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableSavedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","layout.toast.deleteSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.deleteLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0\uC11C \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDeletedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0\uC11C \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4","layout.toast.defaultSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.defaultLocalSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC\uC5D0 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDefaultLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uAE30\uBCF8\uAC12\uC744 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","dateRange.label":"\uB0A0\uC9DC \uBC94\uC704","dateRange.startDate":"\uC2DC\uC791\uC77C","dateRange.endDate":"\uC885\uB8CC\uC77C","dateRange.select":"\uC120\uD0DD...","dateRange.today":"\uC624\uB298","dateRange.thisWeek":"\uC774\uBC88 \uC8FC","dateRange.thisMonth":"\uC774\uBC88 \uB2EC","graph.records":"{count}\uAC74","graph.kpi.totalRecords":"\uCD1D \uB808\uCF54\uB4DC","graph.kpi.totalReport":"\uCD1D \uBCF4\uACE0 \uC2DC\uAC04","graph.kpi.totalBillable":"\uCD1D \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.kpi.efficiency":"\uD6A8\uC728","graph.kpi.amount":"\uAE08\uC561","graph.kpi.flagged":"\uD50C\uB798\uADF8","graph.chart.billable.title":"\uCC28\uC6D0\uBCC4 \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.chart.billable.subtitle":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04 \uC0C1\uC704 \uAC12","graph.chart.efficiency.title":"\uB2F4\uB2F9\uC790\uBCC4 \uD6A8\uC728","graph.chart.efficiency.subtitle":"\uB0AE\uC740 \uD6A8\uC728 \uC6B0\uC120","graph.chart.status.title":"\uC0C1\uD0DC \uBD84\uD3EC","graph.chart.status.subtitle":"\uC0C1\uD0DC\uBCC4 \uBE44\uC728","graph.dataBody":"\uB370\uC774\uD130 \uBCF8\uBB38","graph.reportTitle":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","graph.unassigned":"\uBBF8\uC9C0\uC815","graph.column.reportHours":"\uBCF4\uACE0 \uC2DC\uAC04","graph.column.billableHours":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","detail.searchAi.placeholder":"\uD544\uB4DC\uB97C \uAC80\uC0C9\uD558\uACE0, \uACB0\uACFC\uAC00 \uC5C6\uC73C\uBA74 AI\uC5D0 \uC9C8\uBB38\uD558\uC138\uC694...","detail.searchAi.matches":"{count}\uAC1C \uC77C\uCE58 \uD56D\uBAA9","detail.searchAi.noMatch":"\uC77C\uCE58\uD558\uB294 \uD544\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","detail.searchAi.autoAiFallback":"\uC77C\uCE58 \uD56D\uBAA9\uC774 \uC5C6\uC5B4 AI \uBD84\uC11D\uC744 \uC2E4\uD589\uD569\uB2C8\uB2E4...","detail.searchAi.aiResultTitle":"AI \uBD84\uC11D \uACB0\uACFC","detail.table.title":"\uAD00\uB828 \uB808\uCF54\uB4DC","kanban.empty":"\uC5EC\uAE30\uC5D0 \uCE74\uB4DC\uB97C \uB193\uC73C\uC138\uC694","kanban.bucket.limit":"\uD55C\uB3C4","kanban.bucket.dropHere":"\uB193\uC73C\uBA74 \uC774 \uBC84\uD0B7\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4","kanban.bucket.add":"\uBC84\uD0B7 \uCD94\uAC00","kanban.bucket.rename":"\uBC84\uD0B7 \uC774\uB984 \uBCC0\uACBD","kanban.bucket.saveRename":"\uBC84\uD0B7 \uC774\uB984 \uC800\uC7A5","kanban.bucket.cancelRename":"\uC774\uB984 \uBCC0\uACBD \uCDE8\uC18C","kanban.search.placeholder":"\uCE74\uB4DC \uBC0F \uBC84\uD0B7 \uAC80\uC0C9","kanban.search.clear":"\uAC80\uC0C9 \uC9C0\uC6B0\uAE30","kanban.search.results":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC {count}\uAC1C","kanban.search.noMatch":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","kanban.card.progress":"\uC9C4\uD589\uB960","kanban.card.openDetail":"\uC0C1\uC138 \uC5F4\uAE30","kanban.priority.critical":"\uAE34\uAE09","kanban.priority.high":"\uB192\uC74C","kanban.priority.medium":"\uBCF4\uD1B5","kanban.priority.low":"\uB0AE\uC74C","quickCreate.newItem":"\uC2E0\uADDC \uD56D\uBAA9","quickCreate.createWithTitle":"{title} \uC0DD\uC131","quickEdit.editWithTitle":"{title} \uC218\uC815","quickDelete.confirmTitle":"\uC0AD\uC81C \uD655\uC778","quickDelete.confirmMessageSingle":"\uC120\uD0DD\uD55C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","quickDelete.confirmMessageMultiple":"\uC120\uD0DD\uD55C {count}\uAC1C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","cardPage.viewDetails":"\uC0C1\uC138 \uBCF4\uAE30","cardPage.download":"\uB2E4\uC6B4\uB85C\uB4DC","cardPage.close":"\uB2EB\uAE30","cardPage.empty":"\uD56D\uBAA9\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","messageBox.confirm":"\uD655\uC778","messageBox.cancel":"\uCDE8\uC18C","omph.status.idle":"\uB300\uAE30","omph.status.pending":"\uB300\uAE30 \uC911","omph.status.running":"\uCC98\uB9AC \uC911","omph.status.success":"\uC644\uB8CC","omph.status.error":"\uC624\uB958","omph.working":"\uCC98\uB9AC \uC911","omph.workingFor":"\uCC98\uB9AC \uC911 {duration} \uACBD\uACFC","omph.loadOlder":"\uC774\uC804 \uBA54\uC2DC\uC9C0 \uBD88\uB7EC\uC624\uAE30","omph.loadingOlder":"\uBD88\uB7EC\uC624\uB294 \uC911\u2026","omph.toBottom":"\uB9E8 \uC544\uB798\uB85C","omph.copy":"\uBCF5\uC0AC","omph.copied":"\uBCF5\uC0AC\uB428","omph.turnActions":"\uC751\uB2F5 \uC791\uC5C5","omph.usage":"\uC0AC\uC6A9\uB7C9","omph.inputTokens":"\uC785\uB825","omph.outputTokens":"\uCD9C\uB825","omph.duration":"\uC18C\uC694 \uC2DC\uAC04","omph.send":"\uBCF4\uB0B4\uAE30","omph.stop":"\uC911\uC9C0","omph.supplement.queued":"\uC2E4\uD589 \uC911\uC778 \uC791\uC5C5\uC5D0 \uCD94\uAC00\uB428","omph.turnRail":"\uD134","omph.secondUnit":"\uCD08","omph.minuteUnit":"\uBD84","omph.preview.title":"\uD30C\uC77C \uBBF8\uB9AC\uBCF4\uAE30","omph.preview.close":"\uBBF8\uB9AC\uBCF4\uAE30 \uB2EB\uAE30","omph.preview.back":"\uB300\uD654\uB85C \uB3CC\uC544\uAC00\uAE30","omph.preview.expand":"\uBBF8\uB9AC\uBCF4\uAE30 \uD655\uB300","omph.preview.collapse":"\uBBF8\uB9AC\uBCF4\uAE30 \uD06C\uAE30 \uBCF5\uC6D0","omph.preview.copyContent":"\uB0B4\uC6A9 \uBCF5\uC0AC","omph.preview.copyPath":"\uACBD\uB85C \uBCF5\uC0AC","omph.preview.download":"\uB2E4\uC6B4\uB85C\uB4DC","omph.preview.openExternal":"\uC678\uBD80\uC5D0\uC11C \uC5F4\uAE30","omph.preview.wrap":"\uC904 \uBC14\uAFC8","omph.preview.loading":"\uD30C\uC77C \uB85C\uB4DC \uC911","omph.preview.missing":"\uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC74C","omph.preview.failed":"\uC774 \uD30C\uC77C\uC744 \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","omph.preview.unsupported":"\uC774 \uD30C\uC77C \uD615\uC2DD\uC740 \uBBF8\uB9AC\uBCFC \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","omph.preview.retry":"\uB2E4\uC2DC \uC2DC\uB3C4","omph.preview.resize":"\uBBF8\uB9AC\uBCF4\uAE30 \uD06C\uAE30 \uC870\uC815","omph.preview.line":"{start}\uC904","omph.preview.lines":"{start}\u2013{end}\uC904","omph.preview.truncated":"\uC804\uCCB4 {total}\uC904 \uC911 \uCC98\uC74C {shown}\uC904 \uD45C\uC2DC","omph.preview.sheetTruncated":"\uC804\uCCB4 {total}\uD589 \uC911 \uCC98\uC74C {shown}\uD589 \uD45C\uC2DC","omph.preview.imageFailed":"\uC774\uBBF8\uC9C0\uB97C \uD45C\uC2DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","omph.preview.zoomIn":"\uD655\uB300","omph.preview.zoomOut":"\uCD95\uC18C","omph.preview.zoomFit":"\uB108\uBE44\uC5D0 \uB9DE\uCD94\uAE30","omph.newConversation":"\uC0C8 \uB300\uD654","omph.conversationList":"\uB300\uD654 \uBAA9\uB85D","omph.conversations":"\uB300\uD654","omph.noConversations":"\uC544\uC9C1 \uB300\uD654\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","omph.approval.waiting":"\uC2B9\uC778 \uB300\uAE30 \uC911","omph.approval.choose":"\uC791\uC5C5\uC744 \uC120\uD0DD\uD558\uC138\uC694","omph.approval.details":"\uC2B9\uC778 \uC138\uBD80 \uC815\uBCF4","omph.approval.choices":"\uC791\uC5C5","omph.approval.reject":"\uAC70\uBD80","omph.approval.allowOnce":"\uD55C \uBC88\uB9CC \uD5C8\uC6A9","omph.approval.confirm":"\uACC4\uC18D","omph.approval.other":"\uAE30\uD0C0","omph.approval.otherPlaceholder":"\uC218\uD589\uD560 \uC791\uC5C5\uC744 \uC124\uBA85\uD558\uC138\uC694","omph.approval.escalation":"\uB3C4\uAD6C {toolName}\uC774(\uAC00) \uAD8C\uD55C \uC788\uB294 \uC2E4\uD589\uC744 \uC694\uCCAD\uD569\uB2C8\uB2E4","omph.input.placeholder":"\uBA54\uC2DC\uC9C0 \uC785\uB825\u2026","omph.input.upload":"\uD30C\uC77C \uC5C5\uB85C\uB4DC","omph.input.send":"\uBA54\uC2DC\uC9C0 \uBCF4\uB0B4\uAE30","omph.input.stop":"\uC0DD\uC131 \uC911\uC9C0","omph.input.queue.ask":"\uC5D0\uC774\uC804\uD2B8\uAC00 \uC2E4\uD589 \uC911\uC785\uB2C8\uB2E4. \uC9C0\uAE08 \uBCF4\uB0BC\uAE4C\uC694, \uC774\uBC88 \uD134\uC774 \uB05D\uB09C \uD6C4\uC5D0 \uBCF4\uB0BC\uAE4C\uC694?","omph.input.queue.sendNow":"\uC9C0\uAE08 \uBCF4\uB0B4\uAE30","omph.input.queue.afterTurn":"\uC774\uBC88 \uD134 \uD6C4\uC5D0 \uBCF4\uB0B4\uAE30","omph.input.queue.queued":"\uB300\uAE30 \uC911 \u2014 \uC774\uBC88 \uD134 \uD6C4 \uC790\uB3D9 \uC804\uC1A1","omph.input.queue.cancel":"\uCDE8\uC18C","omph.input.message":"\uBA54\uC2DC\uC9C0 \uC785\uB825","omph.input.tools":"\uC785\uB825 \uB3C4\uAD6C","agentui.html.defaultTitle":"\uC778\uD130\uB799\uD2F0\uBE0C HTML","agentui.html.open":"\uC5F4\uAE30","agentui.html.preview":"\uBBF8\uB9AC \uBCF4\uAE30","agentui.html.code":"\uCF54\uB4DC","agentui.html.toggle":"\uCF54\uB4DC\uC640 \uBBF8\uB9AC \uBCF4\uAE30 \uC804\uD658","agentui.html.copy":"\uCF54\uB4DC \uBCF5\uC0AC","agentui.html.copied":"\uBCF5\uC0AC\uB428","agentui.html.download":"\uB2E4\uC6B4\uB85C\uB4DC","agentui.html.close":"\uB2EB\uAE30"},Yn={en:Rf,zh:Nf,fr:Df,de:Af,ja:Ef,ko:Lf};I();var Cd=(t,o)=>o?t.replace(/\{(\w+)\}/g,(r,n)=>{let a=o[n];return a==null?"":String(a)}):t,Hf={locale:"en",t:(t,o)=>Cd(Yn.en[t]||t,o)},xd=to.createContext(Hf),ja=({locale:t="en",messages:o,children:r})=>{let n=to.useMemo(()=>{let a=Yn[t]||Yn.en,i=o?.[t]||{},s={...Yn.en,...a,...i};return {locale:t,t:(l,d)=>Cd(s[l]||l,d)}},[t,o]);return e(xd.Provider,{value:n,children:r})},de=()=>to.useContext(xd);I();function jn({items:t,onItemClick:o,className:r="",level:n=0,expandedIds:a,onToggleExpand:i,colorMode:s="light",enablePinning:l=false,pinnedIds:d,onTogglePin:p}){let{t:m}=de(),h=s==="dark",f=navigation.usePathname(),[u,b]=to.useState(false),[C,g]=to.useState(new Set),x=a!==void 0&&i!==void 0,v=x?a:C;to.useEffect(()=>{b(true);},[]);let y=S=>{if(x)i(S);else {let P=new Set(C);P.has(S)?P.delete(S):P.add(S),g(P);}},k=S=>{S.children&&S.children.length>0&&y(S.id),o&&o(S);};return !t||!Array.isArray(t)?e("div",{className:yo("tree-menu",r),children:e("div",{className:"text-sm text-[var(--orb-muted)] p-2",children:m("navigation.noItems")})}):e("div",{className:yo("tree-menu",r),children:t.map(S=>{let P=v.has(S.id)||S.isExpanded,M=S.children&&S.children.length>0,N=56+Math.max(0,n-1)*8,A=n===0?12:M?N-24:N,T=S.appurl||S.href,R=u&&T?f===T:false,E=d?.has(S.id)??false,O=l&&S.pinnable!==false&&!!T&&!M;return c("div",{className:"tree-menu-item relative",children:[R&&e("div",{className:yo("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10","bg-[var(--orb-nav-active-fg)]")}),c(ol,{variant:"ghost",className:yo("w-full justify-start h-auto py-2 relative overflow-hidden group",n>0?"gap-1":"gap-2",M&&P&&!R?h?"bg-[color-mix(in_oklch,var(--orb-inverse-fg)_5%,transparent)] text-[var(--orb-fg)] hover:bg-[color-mix(in_oklch,var(--orb-inverse-fg)_8%,transparent)]":"bg-[color-mix(in_oklch,var(--orb-surface)_70%,transparent)] text-[var(--orb-fg)] hover:bg-[var(--orb-surface)]":"",n>=2?"min-h-9 py-1.5 rounded-md":n>0?"min-h-10 rounded-lg":"rounded-lg",R?h?"bg-transparent text-[var(--orb-nav-active-fg)] hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_35%,transparent)]":"bg-transparent text-[var(--orb-nav-active-fg)] hover:bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]":h?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)] text-[var(--orb-fg)]":"hover:bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)] text-[var(--orb-fg)]"),style:{paddingLeft:`${A}px`,paddingRight:O?"34px":"10px"},onClick:()=>k(S),children:[M&&e("div",{className:yo("flex-shrink-0 transition-transform duration-200",P&&"rotate-90",R?"text-[var(--orb-nav-active-fg)]":h?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:e(Vo,{className:"h-4 w-4"})}),S.icon&&e("div",{className:yo("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",R?"text-[var(--orb-nav-active-fg)]":h?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:S.icon}),c("div",{className:"flex-1 text-left overflow-hidden z-10",children:[e("div",{className:yo("text-sm truncate transition-colors duration-200",R?"font-semibold":"font-medium"),children:S.title||S.label}),S.description&&e("div",{className:yo("text-xs truncate transition-colors duration-200",R?h?"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_70%,transparent)]":"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_75%,transparent)]":"text-[var(--orb-muted)]"),title:S.description,children:S.description})]})]}),O&&p&&e("button",{type:"button","aria-label":m(E?"navigation.pin.remove":"navigation.pin.add"),"aria-pressed":E,title:m(E?"navigation.pin.remove":"navigation.pin.add"),onClick:$=>{$.preventDefault(),$.stopPropagation(),p(S);},className:yo("orb-navigation-pin-button absolute right-1 top-1/2 z-20 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md transition-colors duration-150",E&&"orb-is-pinned"),children:e(Jr,{className:yo("h-3.5 w-3.5",E&&"fill-current")})}),M&&e("div",{className:yo("grid transition-[grid-template-rows] duration-300 ease-in-out",P?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:e("div",{className:yo("overflow-hidden",P&&"pt-1"),children:e(jn,{items:S.children,onItemClick:o,level:n+1,expandedIds:a,onToggleExpand:i,colorMode:s,enablePinning:l,pinnedIds:d,onTogglePin:p})})})]},S.id)})})}I();var $f="orbcafe:navigation-island:pinned-items",rl="orbcafe-navigation-pinned",_f=t=>t.appurl||t.href,Sd=t=>{let o=[];return t.forEach(r=>{let n=!!r.children?.length;r.pinnable!==false&&_f(r)&&!n&&o.push({...r,children:void 0}),r.children?.length&&o.push(...Sd(r.children));}),o},kd=({collapsed:t,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:p=true,pinStorageKey:m=$f,pinnedItemIds:h,defaultPinnedItemIds:f=[],onPinnedItemIdsChange:u,pinnedSectionTitle:b})=>{let{t:C}=de(),g=i==="dark",x=s==="floating",v=navigation.useRouter(),[y,k]=to.useState(""),[S,P]=to.useState(new Set),[M,w]=to.useState(f),[N,A]=to.useState(false),T=h!==void 0,R=to.useMemo(()=>h??M,[h,M]),E=to.useMemo(()=>new Set(R),[R]);to.useEffect(()=>{t&&P(new Set);},[t]),to.useEffect(()=>{if(!p||T){A(true);return}try{let H=window.localStorage.getItem(m);if(H){let X=JSON.parse(H);Array.isArray(X)&&w(X.filter(Y=>typeof Y=="string"));}}catch{}finally{A(true);}},[p,T,m]),to.useEffect(()=>{if(!(!p||T||!N))try{window.localStorage.setItem(m,JSON.stringify(R));}catch{}},[R,p,T,m,N]),to.useEffect(()=>{!p||t||R.length===0||P(H=>{if(H.has(rl))return H;let X=new Set(H);return X.add(rl),X});},[t,R.length,p]);let O=to.useCallback(H=>{let X=Array.from(new Set(H));T||w(X),u?.(X);},[T,u]),$=to.useCallback(H=>{let X=H.id,Y=E.has(X)?R.filter(j=>j!==X):[...R,X];O(Y);},[R,E,O]),ee=to.useMemo(()=>{if(!p||R.length===0)return a;let H=new Map(Sd(a).map(Y=>[Y.id,Y])),X=R.map(Y=>H.get(Y)).filter(Y=>!!Y);return X.length===0?a:[{id:rl,title:b||C("navigation.pinned"),icon:e(Jr,{className:"w-4 h-4"}),children:X,pinnable:false},...a]},[R,p,a,b,C]),F=to.useCallback(H=>{let X=[],Y=j=>{j.forEach(te=>{X.push(te.id),te.children&&Y(te.children);});};return Y(H),X},[]),G=to.useMemo(()=>{if(!y.trim())return ee;let H=X=>X.reduce((Y,j)=>{let te=j.title?.toLowerCase().includes(y.toLowerCase())||j.description?.toLowerCase().includes(y.toLowerCase()),ce=j.children?H(j.children):[];return (te||ce.length>0)&&Y.push({...j,children:ce.length>0?ce:j.children}),Y},[]);return H(ee)},[y,ee]),W=to.useMemo(()=>y.trim()?new Set(F(ee)):S,[y,ee,S,F]),Q=to.useCallback(async H=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",H),H.id==="chat"||H.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{v.push("/chat?new=true");}catch(Y){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",Y),v.push("/chat");}return}let X=H.appurl||H.href;X&&(X.startsWith("http://")||X.startsWith("https://")?window.open(X,"_blank"):v.push(X));},[v]),z=to.useCallback(()=>{l?.(s==="fixed"?"floating":"fixed");},[s,l]);return c("div",{className:`flex flex-col backdrop-blur-xl border ${x?"shadow-[0_28px_80px_rgba(15,23,42,0.34)]":"shadow-[0_4px_8px_0_rgba(31,38,135,0.1)]"} ${t?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${r} ${g?x?"border-white/25":"bg-[var(--orb-nav-bg)] border-white/10":x?"border-white/70":"bg-[color-mix(in_oklch,var(--orb-canvas)_70%,transparent)] border-white/30"}`,style:{backdropFilter:x?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",WebkitBackdropFilter:x?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",backgroundColor:x?g?"rgba(8, 12, 18, 0.34)":"rgba(255, 255, 255, 0.24)":void 0,backgroundImage:x?g?"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.14), rgba(255,255,255,0) 44%), linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.015) 50%, color-mix(in oklch, var(--orb-ai-accent) 5%, transparent))":"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.42), rgba(255,255,255,0) 46%), linear-gradient(145deg, rgba(255,255,255,0.22), rgba(255,255,255,0.07) 50%, color-mix(in oklch, var(--orb-ai-accent) 8%, transparent))":void 0,boxShadow:x?g?"inset 0 1px 0 rgba(255,255,255,0.20), inset 0 -1px 0 rgba(255,255,255,0.08), 0 26px 90px rgba(0,0,0,0.52), 0 0 0 1px rgba(255,255,255,0.06)":"inset 0 1px 0 rgba(255,255,255,0.88), inset 0 -1px 0 rgba(255,255,255,0.34), 0 26px 90px rgba(15,23,42,0.24), 0 0 0 1px rgba(255,255,255,0.35)":void 0,transition:"width 400ms cubic-bezier(0.4, 0.0, 0.2, 1), border-radius 0ms cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 400ms ease-out, background-color 220ms ease-out, backdrop-filter 220ms ease-out",maxHeight:n?`${n}px`:void 0},children:[e("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${t?"px-1":"px-2"}`,children:t?e("div",{className:"flex justify-center",children:e("button",{onClick:o,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${g?"text-[var(--orb-fg)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:C("navigation.expand"),children:e(Wo,{className:"h-5 w-5"})})}):c("div",{className:`relative transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:[e("input",{type:"text",placeholder:C("navigation.searchPlaceholder"),value:y,onChange:H=>k(H.target.value),className:`w-full pl-10 pr-4 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:border-transparent ${g?"border-[var(--orb-border)] bg-[var(--orb-surface-2)] text-[var(--orb-fg)] placeholder-[var(--orb-muted)]":"border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-fg)] placeholder-[var(--orb-muted)]"}`}),e("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:e(Wo,{className:"h-4 w-4 text-[var(--orb-muted)]"})})]})}),e("nav",{className:`flex-1 pb-4 transition-all duration-500 ease-in-out overflow-y-auto min-h-0 ${t?"px-1":"px-2"}`,children:G.length===0?e("div",{className:"flex items-center justify-center py-8 text-[var(--orb-muted)] text-sm",children:t?e(Wn,{className:"h-5 w-5"}):C(y?"navigation.noMatch":"navigation.noAccessibleApp")}):c(jsxRuntime.Fragment,{children:[!t&&e("div",{className:`transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:e(jn,{items:G,onItemClick:Q,className:"space-y-1",expandedIds:W,colorMode:i,enablePinning:p,pinnedIds:E,onTogglePin:$,onToggleExpand:H=>{let X=new Set(S);G.some(j=>j.id===H)?X.has(H)?X.delete(H):(G.forEach(j=>{j.id!==H&&X.has(j.id)&&X.delete(j.id);}),X.add(H)):X.has(H)?X.delete(H):X.add(H),P(X);}})}),t&&e("div",{className:"space-y-2",children:ee.map(H=>e("div",{className:"space-y-1",children:e("button",{onClick:()=>{o();let X=new Set([H.id]);P(X);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${g?"text-[var(--orb-muted)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:C("navigation.expandView",{title:H.title||""}),children:H.icon||e("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${g?"bg-[var(--orb-nav-active-fg)] text-[#0b0b0b]":"bg-[var(--orb-primary)] text-[var(--orb-on-primary)]"}`,children:H.title?.charAt(0)||"?"})})},H.id))})]})}),!t&&e("button",{onClick:o,className:`absolute -bottom-1 -right-1 w-6 h-6 bg-transparent rounded-full flex items-center justify-center transition-all duration-300 ease-in-out z-20 ${g?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)]":"hover:bg-[color-mix(in_oklch,var(--orb-canvas)_20%,transparent)]"}`,title:C("navigation.collapse"),children:e("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:e("div",{className:g?"border-[var(--orb-status-warning)]":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid var(--orb-ai-accent)",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})}),d&&t&&e("button",{type:"button",onClick:z,className:`absolute -bottom-4 left-1/2 z-30 flex h-9 w-9 -translate-x-1/2 items-center justify-center rounded-full border shadow-md transition-colors focus:outline-none focus:ring-2 focus:ring-[color-mix(in_oklch,var(--orb-primary)_45%,transparent)] ${g?"border-[var(--orb-border)] bg-[var(--orb-surface-2)] text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]":"border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-status-fg)] hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]"}`,style:{touchAction:"manipulation"},title:C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?e($a,{className:"h-4 w-4"}):e(_a,{className:"h-4 w-4"})})]})};I();var Uf="orbcafe:navigation-island:pinned-items",nl="orbcafe-navigation-pinned",Pd=t=>t.appurl||t.href,Td=t=>t.flatMap(o=>{let r=!!o.children?.length,n=o.pinnable!==false&&Pd(o)&&!r?[{...o,children:void 0}]:[];return o.children?.length?[...n,...Td(o.children)]:n}),Id=t=>t.flatMap(o=>[o.id,...o.children?Id(o.children):[]]),Md=(t,o)=>t.reduce((r,n)=>{let a=n.children?Md(n.children,o):[];return ([n.title,n.label,n.description].some(s=>s?.toLocaleLowerCase().includes(o))||a.length>0)&&r.push({...n,children:a.length>0?a:n.children}),r},[]),al=({collapsed:t,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:p=true,pinStorageKey:m=Uf,pinnedItemIds:h,defaultPinnedItemIds:f=[],onPinnedItemIdsChange:u,pinnedSectionTitle:b})=>{let{t:C}=de(),g=navigation.useRouter(),x=s==="floating",[v,y]=to.useState(""),[k,S]=to.useState(new Set),[P,M]=to.useState(f),[w,N]=to.useState(false),A=h!==void 0,T=h??P,R=to.useMemo(()=>new Set(T),[T]);to.useEffect(()=>{t&&S(new Set);},[t]),to.useEffect(()=>{if(!p||A){N(true);return}try{let H=window.localStorage.getItem(m);if(H){let X=JSON.parse(H);Array.isArray(X)&&M(X.filter(Y=>typeof Y=="string"));}}catch{}finally{N(true);}},[p,A,m]),to.useEffect(()=>{if(!(!p||A||!w))try{window.localStorage.setItem(m,JSON.stringify(T));}catch{}},[T,p,A,m,w]),to.useEffect(()=>{!p||t||T.length===0||S(H=>{if(H.has(nl))return H;let X=new Set(H);return X.add(nl),X});},[t,T.length,p]);let E=to.useCallback(H=>{let X=Array.from(new Set(H));A||M(X),u?.(X);},[A,u]),O=to.useCallback(H=>{E(R.has(H.id)?T.filter(X=>X!==H.id):[...T,H.id]);},[T,R,E]),$=to.useMemo(()=>{if(!p||T.length===0)return a;let H=new Map(Td(a).map(Y=>[Y.id,Y])),X=T.map(Y=>H.get(Y)).filter(Y=>!!Y);return X.length===0?a:[{id:nl,title:b||C("navigation.pinned"),icon:e(Jr,{className:"h-4 w-4"}),children:X,pinnable:false},...a]},[T,p,a,b,C]),ee=v.trim().toLocaleLowerCase(),F=to.useMemo(()=>ee?Md($,ee):$,[$,ee]),G=to.useMemo(()=>ee?new Set(Id(F)):k,[k,F,ee]),W=to.useCallback(H=>{S(X=>{let Y=new Set(X),j=F.some(te=>te.id===H);return Y.has(H)?Y.delete(H):(j&&F.forEach(te=>Y.delete(te.id)),Y.add(H)),Y});},[F]),Q=to.useCallback(H=>{let X=Pd(H);X&&(H.id==="chat"||H.appurl==="/chat"?g.push("/chat?new=true"):/^https?:\/\//.test(X)?window.open(X,"_blank","noopener,noreferrer"):g.push(X));},[g]),z=H=>{o(),S(new Set([H.id]));};return c("aside",{"data-navigation-island":"v2","data-collapsed":t||void 0,className:`orb-navigation-island-v2 relative flex flex-col border ${t?"w-14":"w-[234px]"} ${r}`,style:{maxHeight:n?`${n}px`:void 0,transition:"width 320ms cubic-bezier(0.4, 0, 0.2, 1), border-radius 220ms ease, box-shadow 220ms ease"},"aria-label":"Navigation",children:[e("div",{className:`orb-navigation-island-v2-search ${t?"px-1":"px-2"}`,children:t?e("button",{type:"button",onClick:o,className:"mx-auto flex h-10 w-10 items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:C("navigation.expand"),"aria-label":C("navigation.expand"),children:e(Wo,{className:"h-5 w-5"})}):c("label",{className:"relative block",children:[e("span",{className:"orb-visually-hidden",children:C("navigation.searchPlaceholder")}),e(Wo,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--orb-muted)]"}),e("input",{type:"search",value:v,onChange:H=>y(H.target.value),placeholder:C("navigation.searchPlaceholder"),className:"w-full py-2 pl-10 pr-3 text-sm outline-none"})]})}),e("nav",{className:`min-h-0 flex-1 overflow-y-auto pb-2 ${t?"px-1":"px-2"}`,children:F.length===0?e("div",{className:"flex items-center justify-center py-8 text-sm text-[var(--orb-muted)]",children:t?e(Wn,{className:"h-5 w-5"}):C(ee?"navigation.noMatch":"navigation.noAccessibleApp")}):t?e("div",{className:"space-y-1",children:$.map(H=>e("button",{type:"button",onClick:()=>z(H),className:"flex h-10 w-full items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:C("navigation.expandView",{title:H.title||H.label||""}),children:H.icon||e(Wn,{className:"h-5 w-5"})},H.id))}):e(jn,{items:F,onItemClick:Q,className:"space-y-1",expandedIds:G,onToggleExpand:W,colorMode:i,enablePinning:p,pinnedIds:R,onTogglePin:O})}),d&&t&&e("div",{className:"orb-navigation-island-v2-footer flex flex-col items-center gap-1 border-t px-1 py-2",children:e("button",{type:"button",onClick:()=>l?.(x?"fixed":"floating"),className:"flex h-9 w-9 items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?e($a,{className:"h-4 w-4"}):e(_a,{className:"h-4 w-4"})})}),!t&&e("button",{type:"button",onClick:o,className:"absolute -bottom-1 -right-1 z-20 flex h-6 w-6 items-center justify-center rounded-full bg-transparent transition-all duration-300 ease-in-out",title:C("navigation.collapse"),"aria-label":C("navigation.collapse"),children:e("span",{"aria-hidden":"true",className:"absolute overflow-hidden",style:{bottom:0,right:0,width:16,height:16},children:e("span",{className:"absolute rounded-full border-[3px] border-[var(--orb-ai-accent)]",style:{width:32,height:32,top:-16,left:-16}})})})]})};al.displayName="NavigationIsland2";var Nd=(t={})=>{let{initialCollapsed:o=false,initialDisplayMode:r="fixed",content:n=[],enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:p}=t,[m,h]=to.useState(o),[f,u]=to.useState(r),[b,C]=to.useState(n),g=to.useCallback(()=>{h(y=>!y);},[]),x=to.useCallback(()=>{u(y=>y==="fixed"?"floating":"fixed");},[]),v=to.useMemo(()=>({collapsed:m,onToggle:g,menuData:b,displayMode:f,onDisplayModeChange:u,enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:p}),[m,g,b,f,u,a,i,s,l,d,p]);return {collapsed:m,setCollapsed:h,toggleCollapsed:g,displayMode:f,setDisplayMode:u,toggleDisplayMode:x,menuData:b,setMenuData:C,navigationIslandProps:v}};var sl=class{constructor(){Dc(this,"listener",null);}register(o){this.listener=o;}unregister(){this.listener=null;}show(o,r,n){this.listener&&this.listener({type:o,content:r,options:n});}hide(){this.listener&&this.listener(null);}},lr=new sl,_T={success:(t,o)=>lr.show("success",t,o),error:(t,o)=>lr.show("error",t,o),warning:(t,o)=>lr.show("warning",t,o),info:(t,o)=>lr.show("info",t,o),show:(t,o,r)=>lr.show(t,o,r),hide:()=>lr.hide()};I();var qf={success:{icon:e(zn,{size:40}),color:"var(--orb-success-bg)",iconColor:"var(--orb-success)"},warning:{icon:e(Ua,{size:40}),color:"var(--orb-warn-bg)",iconColor:"var(--orb-warn)"},error:{icon:e(Fa,{size:40}),color:"var(--orb-err-bg)",iconColor:"var(--orb-err)"},info:{icon:e(Ha,{size:40}),color:"var(--orb-info-bg)",iconColor:"var(--orb-info)"},default:{icon:null,color:"transparent",iconColor:"inherit"}},ea=({open:t,title:o,message:r,onClose:n,onConfirm:a,confirmText:i,cancelText:s,showCancel:l=true,maxWidth:d="xs",type:p="default"})=>{let{t:m}=de(),h=i||m("messageBox.confirm"),f=s||m("messageBox.cancel"),u=()=>{a?a():n();},b=qf[p],C=p!=="default";return c(Ot,{open:t,onClose:n,maxWidth:d,sx:C?{borderTop:`6px solid ${b.iconColor}`}:void 0,children:[C&&e("div",{style:{display:"flex",justifyContent:"center",paddingTop:24,color:b.iconColor},children:b.icon}),o&&e("div",{className:"orb-dialog-title",style:{textAlign:C?"center":"left",paddingTop:C?8:16},children:o}),e("div",{className:"orb-dialog-content",style:{textAlign:C?"center":"left"},children:typeof r=="string"?e("p",{style:{margin:0,color:"var(--orb-muted)"},children:r}):r}),c("div",{className:"orb-dialog-actions",style:{display:"flex",justifyContent:C?"center":"flex-end",gap:8,paddingBottom:24,paddingLeft:24,paddingRight:24},children:[l&&e(Te,{onClick:n,variant:"text",children:f}),e(Te,{onClick:u,variant:"contained",color:C&&p==="error"?"error":"primary",autoFocus:true,children:h})]})]})},jT=()=>{let[t,o]=to__namespace.default.useState(null),[r,n]=to__namespace.default.useState(false);to__namespace.default.useEffect(()=>{let s=l=>{l?(o(l),n(true)):(n(false),o(null));};return lr.register(s),()=>lr.unregister()},[]);let a=()=>{n(false),t?.options?.onClose&&t.options.onClose(),o(null);},i=()=>{t?.options?.onConfirm&&t.options.onConfirm(),n(false),o(null);};return t?e(ea,{open:r,type:t.type,message:t.content,title:t.options?.title,onClose:a,onConfirm:i,confirmText:t.options?.confirmText,cancelText:t.options?.cancelText,showCancel:t.options?.showCancel,maxWidth:t.options?.maxWidth}):null};I();var oI=({status:t,showIcon:o=true})=>{let r="gray",n,a=t;return t==="OK"?(r="blue",n=e(zn,{size:14,strokeWidth:2}),a="Success"):t==="Error"?(r="orange",n=e(Fa,{size:14,strokeWidth:2}),a="Error"):t==="Warning"&&(r="orange",n=e(Ua,{size:14,strokeWidth:2}),a="Warning"),e(xt,{label:a,tone:r,icon:o&&n?n:void 0})};I();var aI=({dense:t,sx:o,className:r,children:n,...a})=>e("ul",{...a,className:r,style:{listStyle:"none",margin:0,padding:0,...o},children:n}),iI=({button:t,divider:o,sx:r,className:n,children:a,...i})=>e("li",{...i,className:n,style:{display:"flex",alignItems:"center",padding:"8px 16px",minHeight:40,borderBottom:o?"1px solid var(--orb-border)":void 0,cursor:t?"pointer":void 0,transition:"var(--orb-t-fast)",...r},onMouseEnter:t?s=>{s.currentTarget.style.background="var(--orb-hover)";}:void 0,onMouseLeave:t?s=>{s.currentTarget.style.background="";}:void 0,children:a}),sI=({sx:t,className:o,children:r,...n})=>e("button",{...n,type:"button",className:o,style:{width:"100%",display:"flex",alignItems:"center",padding:"8px 16px",border:"none",background:"transparent",textAlign:"left",cursor:"pointer",transition:"var(--orb-t-fast)",...t},children:r}),lI=({children:t,sx:o})=>e("div",{style:{marginRight:16,display:"flex",alignItems:"center",minWidth:40,...o},children:t}),cI=({primary:t,secondary:o,sx:r})=>c("div",{style:{flex:1,minWidth:0,...r},children:[e("div",{className:"orb-body",style:{fontWeight:500},children:t}),o&&e("div",{className:"orb-meta",style:{marginTop:2},children:o})]}),dI=({sx:t,className:o,children:r,...n})=>e("li",{...n,className:o,style:{padding:"8px 16px",fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--orb-muted)",...t},children:r}),pI=({children:t,sx:o})=>e("div",{style:{marginRight:12,display:"flex",alignItems:"center",...o},children:t});I();var gI=({xs:t,md:o,lg:r,sx:n,children:a,className:i,...s})=>{let l=r?`span ${r}`:o?`span ${o}`:t?`span ${t}`:"span 12";return e("div",{...s,className:i,style:{gridColumn:l,minWidth:0,...n},children:a})};Gt();I();var Oo=ot,so=(t,o)=>to.forwardRef(({component:r,sx:n,className:a,style:i,children:s,...l},d)=>{let p=r??t,m=Ue(n,[o,a].filter(Boolean).join(" "),i);return e(p,{ref:d,className:m.className,style:m.style,...l,children:s})}),Me=so("div"),Ad=so("a","orb-link"),Br=Ae,Ed=le,Co=L;var Ld=se;var Od=Nt,er=rn,ai=on,ii=Xa;var si=qa,Fd=jo,Bd=({value:t,variant:o,color:r,sx:n})=>e(Un,{value:o==="determinate"?t:void 0,color:r,sx:n}),Hd=so("table","orb-tbl"),zd=so("tbody"),dl=so("td"),Vd=so("div","orb-table-container"),Wd=so("thead"),pl=so("tr");so("tfoot");so("div","orb-dialog-title");so("div","orb-dialog-content");so("div","orb-dialog-actions");so("p","orb-body-dense");var cr=so("span","orb-input-adornment"),$d=to.forwardRef(({sx:t,fullWidth:o,className:r,style:n,...a},i)=>{let s=Ue(t,["orb-input-base",r].filter(Boolean).join(" "),n);return e("input",{ref:i,className:s.className,style:{width:o?"100%":void 0,...s.style},...a})});var Cr=so("div","orb-form-control"),ta=({control:t,label:o,...r})=>c("label",{className:"orb-form-control-label",...r,children:[t,e("span",{children:o})]}),Jf=({primary:t,secondary:o,children:r,primaryTypographyProps:n,secondaryTypographyProps:a,...i})=>c("span",{className:"orb-list-item-text",...i,children:[t??r,o?e("small",{children:o}):null]}),eb=so("span","orb-list-item-icon"),Ut=Jf,$o=eb;so("div","orb-list-subheader");var ul=({container:t,item:o,spacing:r,xs:n,sm:a,md:i,lg:s,xl:l,sx:d,...p})=>{let m={},h=f=>typeof f=="number"?`${f/12*100}%`:f?"100%":void 0;return n!==void 0&&(m.xs=h(n)),a!==void 0&&(m.sm=h(a)),i!==void 0&&(m.md=h(i)),s!==void 0&&(m.lg=h(s)),l!==void 0&&(m.xl=h(l)),e(Me,{...p,sx:{display:t?"flex":void 0,flexWrap:t?"wrap":void 0,gap:t&&r?r:void 0,width:o?m:void 0,...d??{}}})},nn=({in:t,children:o,unmountOnExit:r,...n})=>!t&&r?null:e("div",{hidden:!t,...n,children:o}),_d=({children:t,container:o})=>typeof document>"u"?null:reactDom.createPortal(t,o??document.body),Gd=so("div","orb-toolbar"),Ud=({active:t,direction:o="asc",children:r,sx:n,className:a,style:i,...s})=>{let l=Ue(n,["orb-table-sort-label",t?"orb-is-active":"",a].filter(Boolean).join(" "),i);return c("button",{type:"button",className:l.className,style:l.style,"data-direction":o,...s,children:[e("span",{className:"orb-table-sort-content",children:r}),e(Tt,{className:"orb-table-sort-icon",name:o==="desc"?"down":"up",size:11})]})},li=({open:t,anchorEl:o,onClose:r,children:n,anchorOrigin:a,transformOrigin:i,slotProps:s,PaperProps:l,sx:d,className:p,style:m,...h})=>{let f=to.useRef(null);if(to.useEffect(()=>{if(!t)return;let x=y=>{let k=y.composedPath();f.current&&k.includes(f.current)||o&&k.includes(o)||r?.();},v=y=>{y.key==="Escape"&&r?.();};return document.addEventListener("pointerdown",x,true),document.addEventListener("keydown",v,true),()=>{document.removeEventListener("pointerdown",x,true),document.removeEventListener("keydown",v,true);}},[o,r,t]),!t||typeof document>"u")return null;let u=o?.getBoundingClientRect(),b=s?.paper??l,C=[...Array.isArray(b?.sx)?b.sx:b?.sx?[b.sx]:[],...Array.isArray(d)?d:d?[d]:[]],g=Ue(C,["orb-pop",b?.className,p].filter(Boolean).join(" "),{...b?.style,...m});return reactDom.createPortal(e("div",{...h,ref:f,className:g.className,style:{position:"fixed",left:u?.left??16,top:(u?.bottom??16)+6,zIndex:1301,...g.style},children:n}),document.body)},Kd=({open:t,onClose:o,anchor:r="left",children:n,PaperProps:a})=>{if(!t||typeof document>"u")return null;let i=r==="right"?{right:0,top:0,bottom:0}:r==="top"?{left:0,right:0,top:0}:r==="bottom"?{left:0,right:0,bottom:0}:{left:0,top:0,bottom:0},s=Ue(a?.sx,"orb-drawer");return reactDom.createPortal(c(jsxRuntime.Fragment,{children:[e("button",{type:"button",className:"orb-overlay","aria-label":"Close drawer",onClick:o}),e("aside",{className:s.className,style:{position:"fixed",zIndex:1201,...i},children:n})]}),document.body)},qd=({value:t,onChange:o,children:r,variant:n,scrollButtons:a,...i})=>e("div",{role:"tablist",className:"orb-tabs",...i,children:to.Children.map(r,s=>to.isValidElement(s)?to.cloneElement(s,{selected:s.props.value===t,onSelect:l=>o?.(null,l)}):s)}),Xd=({value:t,label:o,children:r,selected:n,onSelect:a,...i})=>e("button",{type:"button",role:"tab","aria-selected":n,className:`orb-tab ${n?"orb-is-active":""}`,onClick:()=>a?.(t),...i,children:o??r});var lo=()=>Aa(),xr=(t,o)=>Ao(t);var Zd=({day:t,onDaySelect:o,selected:r,outsideCurrentMonth:n,disableMargin:a,sx:i,className:s,...l})=>{let d=Ue(i,`orb-cal-day ${r?"orb-is-selected":""} ${n?"orb-is-outside":""} ${s??""}`);return e("button",{type:"button",className:d.className,style:d.style,onClick:()=>o?.(t),...l,children:t.date()})},Yd=({value:t,referenceDate:o,onChange:r,onMonthChange:n,onYearChange:a,minDate:i,maxDate:s,slots:l,...d})=>e(Xn,{value:t,month:o,onChange:p=>r?.(p),onMonthChange:p=>{n?.(p),a?.(p);},minDate:i,maxDate:s,renderDay:l?.day?(p,m)=>l.day?.({day:p,selected:m.selected,outsideCurrentMonth:m.outsideCurrentMonth,onDaySelect:h=>r?.(h)}):void 0,...d}),jd=({children:t})=>e(jsxRuntime.Fragment,{children:t}),ni=class{};Gt();I();var tb=(t,o)=>o!==void 0?o:typeof t=="number"?t:t==="small"?18:t==="large"?30:t==="inherit"?"1em":22,Pe=t=>({fontSize:r,size:n,sx:a,className:i,style:s,titleAccess:l,...d})=>{let p=Ue(a,i,s);return e(Tt,{name:t,size:tb(r,n),className:p.className,style:p.style,"aria-label":d["aria-label"]??l,...d})},wr=Pe("tree"),Hr=Pe("add"),Qd=Pe("duplicate"),ml=Pe("down"),Jd=Pe("navigationRight"),ep=Pe("navigationRight"),gl=Pe("up"),tp=Pe("delete"),op=Pe("camera"),rp=Pe("accept"),np=Pe("accept"),ci=Pe("navigationRight"),ap=Pe("dimension"),hl=Pe("decline"),Sr=Pe("decline"),ip=Pe("decline"),sp=Pe("decline"),di=Pe("delete"),pi=Pe("delete"),lp=Pe("download"),cp=Pe("move"),dp=Pe("edit"),an=Pe("slimDown"),pp=Pe("filter"),sn=Pe("sum"),up=Pe("lineChart"),mp=Pe("document"),_o=Pe("slimDown"),gp=Pe("navigationLeft"),kr=Pe("navigationRight"),ui=Pe("slimUp"),mi=Pe("navigationLeft"),gi=Pe("navigationRight"),hp=Pe("dimension"),fp=Pe("splitOne"),hi=Pe("menu"),bp=Pe("microphone"),vp=Pe("microphone"),yp=Pe("microphone"),Cp=Pe("qrCode"),Pr=Pe("save"),zr=Pe("search"),xp=Pe("search"),wp=Pe("paperPlane"),Sp=Pe("paperPlane"),kp=Pe("wrench"),Pp=Pe("sort"),fi=Pe("splitTwo"),Tp=Pe("favorite"),Ip=Pe("favorite"),fl=Pe("stop"),Mp=Pe("tableRow"),bi=Pe("collapseAll"),vi=Pe("expandAll"),ln=Pe("tableColumn"),Rp=Pe("overview"),Np=Pe("hide");I();var rb=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],Ap=t=>Array.isArray(t)?t:t==null||t===""?[]:[t],To=t=>String(t),Ep=(t,o)=>t[o],Lp=t=>{let o=t.value??t.id??t.key??t.code;return typeof o=="number"||typeof o=="string"?o:""},nb=t=>{let o=t.label??t.description??t.name??t.title;return String(typeof o=="number"||typeof o=="string"?o:Lp(t))},ab=t=>{let o=t.description??t.subtitle;return typeof o=="number"||typeof o=="string"?String(o):void 0},Op=({value:t=null,items:o=[],columns:r,mode:n="single",dialogTitle:a="Value Help",searchPlaceholder:i="Search values...",selectLabel:s="Select",clearLabel:l="Clear",cancelLabel:d="Cancel",valueHelpLabel:p="Open value help",noResultsText:m="No matching values",loading:h=false,clearable:f=true,allowManualInput:u=true,validateManualInput:b=true,manualInputErrorText:C="Enter a valid value.",selectedItems:g=[],displayValue:x,getOptionValue:v=Lp,getOptionLabel:y=nb,getOptionDescription:k=ab,onChange:S,onSearch:P,disabled:M,InputProps:w,onFocus:N,onBlur:A,onKeyDown:T,error:R,helperText:E,...O})=>{let $=fo(),ee=n==="multiple",[F,G]=to.useState(false),[W,Q]=to.useState(false),[z,H]=to.useState(""),[X,Y]=to.useState(null),[j,te]=to.useState(false),[ce,fe]=to.useState(()=>Ap(t)),[Ve,ve]=to.useState(""),[xe,He]=to.useState(""),pe=to.useMemo(()=>r&&r.length>0?r:rb,[r]),ye=X??o,$e=to.useMemo(()=>{let re=[...g,...o,...X??[]],Ce=new Map;return re.forEach(De=>{Ce.set(To(v(De)),De);}),Ce},[v,o,X,g]),tt=to.useMemo(()=>Ap(t),[t]),at=to.useMemo(()=>tt.map(String).join(", "),[tt]);to.useEffect(()=>{F||fe(tt);},[F,tt]),to.useEffect(()=>{!W&&!xe&&ve(at);},[W,at,xe]);let st=to.useMemo(()=>{let re=z.trim().toLowerCase();if(!re||P)return ye;let Ce=pe.filter(De=>De.searchable!==false);return ye.filter(De=>[v(De),y(De),k(De),...Ce.map(lt=>Ep(De,lt.field))].some(lt=>String(lt??"").toLowerCase().includes(re)))},[ye,k,y,v,P,z,pe]),K=to.useMemo(()=>{if(x!==void 0)return x;if(tt.length===0)return "";let re=Ce=>{let De=$e.get(To(Ce));if(!De)return String(Ce);let Je=y(De);return Je&&Je!==String(Ce)?`${Ce} - ${Je}`:String(Ce)};return ee?tt.length>2?`${tt.length} selected`:tt.map(re).join(", "):re(tt[0])},[x,y,ee,$e,tt]),Ne=to.useCallback(async()=>{if(P){te(true);try{let re=await P(z);Array.isArray(re)&&Y(re);}finally{te(false);}}},[P,z]),Se=()=>{M||(fe(tt),G(true));},Fe=()=>{G(false);},it=()=>{S?.(ee?[]:null,ee?[]:null),fe([]),ve(""),He("");},Ye=re=>{let Ce=v(re);if(ee){fe(De=>De.some(lt=>To(lt)===To(Ce))?De.filter(lt=>To(lt)!==To(Ce)):[...De,Ce]);return}fe([Ce]);},wt=()=>{let re=ce.map(Ce=>$e.get(To(Ce))).filter(Ce=>!!Ce);ee?S?.(ce,re):S?.(ce[0]??null,re[0]??null),He(""),G(false);},Mt=re=>{if(re.key==="F4"){re.preventDefault(),Se();return}if(re.key==="Enter"&&u&&!Et(Ve,true)){re.preventDefault();return}T?.(re);},Ft=re=>b?re.every(Ce=>$e.has(To(Ce))):true,Et=(re,Ce)=>{if(ee){let Je=re.split(/[,;\n]/).map(ut=>ut.trim()).filter(Boolean);if(Je.length===0)return He(""),S?.([],[]),true;if(!Ft(Je))return Ce&&He(C),false;He("");let lt=Je.map(ut=>$e.get(To(ut))).filter(ut=>!!ut);return S?.(Je,lt),true}let De=re.trim();return De?Ft([De])?(He(""),S?.(De,$e.get(To(De))??null),true):(Ce&&He(C),false):(He(""),S?.(null,null),true)},ne=re=>{if(!u)return;let Ce=re.target.value;ve(Ce),He(""),Et(Ce,false);},Ke=h||j,Oe=tt.length>0,we=u&&(W||!!xe)?Ve:K;return c(jsxRuntime.Fragment,{children:[e(ze,{...O,className:["orb-value-help-field",f&&Oe&&!M?"orb-value-help-has-clear":"",O.className??""].filter(Boolean).join(" "),disabled:M,value:we,error:!!xe||R,helperText:xe||E,onChange:ne,onFocus:re=>{Q(true),ve(at),N?.(re);},onBlur:re=>{u&&Et(Ve,true),Q(false),A?.(re);},onKeyDown:Mt,InputProps:{...w,readOnly:!u,endAdornment:c("span",{className:"orb-value-help-actions",children:[Ke?e(jo,{size:18}):null,f&&Oe&&!M?e(se,{className:"orb-value-help-clear-trigger",size:"small",tooltip:l,"aria-label":l,onMouseDown:re=>re.preventDefault(),onClick:re=>{re.stopPropagation(),it();},children:e(Tt,{name:"decline",size:14})}):null,e(se,{className:"orb-value-help-search-trigger",size:"small",tooltip:p,"aria-label":p,onMouseDown:re=>re.preventDefault(),onClick:re=>{re.stopPropagation(),Se();},disabled:M,children:e(Tt,{name:"search",size:16})})]})}}),c(Ot,{open:F,onClose:Fe,fullWidth:true,maxWidth:820,hideCloseButton:true,PaperProps:{sx:re=>({borderRadius:2,overflow:"hidden",border:`1px solid ${re.palette.divider}`,boxShadow:$==="dark"?`0 24px 80px ${ot(re.palette.common.black,.72)}`:`0 24px 80px ${ot(re.palette.common.black,.18)}`})},children:[c("div",{className:"orb-dialog-title",sx:re=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${re.palette.divider}`,bgcolor:re.palette.background.paper}),children:[c("div",{children:[e(L,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),ee?e(L,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${ce.length} selected`}):null]}),e(se,{"aria-label":"Close",onClick:Fe,size:"small",children:e(Sr,{fontSize:"small"})})]}),c("div",{className:"orb-dialog-content",sx:{p:0},children:[c(le,{direction:{xs:"column",sm:"row"},spacing:1,sx:re=>({px:2.5,py:1.5,borderBottom:`1px solid ${re.palette.divider}`,bgcolor:$==="dark"?ot(re.palette.common.white,.025):ot(re.palette.primary.main,.035)}),children:[e(ze,{size:"small",fullWidth:true,autoFocus:true,value:z,placeholder:i,onChange:re=>H(re.target.value),onKeyDown:re=>{re.key==="Enter"&&(re.preventDefault(),Ne());},InputProps:{startAdornment:e(cr,{position:"start",children:e(Tt,{name:"search",size:16})}),sx:re=>({borderRadius:1,bgcolor:re.palette.background.paper,"& fieldset":{borderColor:ot(re.palette.text.primary,$==="dark"?.2:.16)},"&:hover fieldset":{borderColor:ot(re.palette.primary.main,.52)},"&:focus-within fieldset":{borderColor:re.palette.primary.main}})}}),P?e(Te,{variant:"outlined",onClick:()=>{Ne();},disabled:Ke,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:Ke?e(jo,{size:18}):"Search"}):null]}),e("div",{sx:{maxHeight:420},children:c("table",{className:"orb-tbl",stickyHeader:true,size:"small",children:[e("thead",{children:c("tr",{children:[e("td",{padding:"checkbox",sx:re=>({bgcolor:$==="dark"?"var(--orb-canvas)":re.palette.background.paper,borderBottom:`1px solid ${re.palette.divider}`})}),pe.map(re=>e("td",{align:re.align==="inherit"?void 0:re.align,sx:Ce=>({minWidth:re.minWidth,width:re.width,fontSize:"0.78rem",fontWeight:800,bgcolor:$==="dark"?"var(--orb-canvas)":Ce.palette.background.paper,borderBottom:`1px solid ${Ce.palette.divider}`}),children:re.label},String(re.field)))]})}),c("tbody",{children:[st.map(re=>{let Ce=v(re),De=ce.some(Je=>To(Je)===To(Ce));return c("tr",{hover:true,selected:De,onClick:()=>Ye(re),onDoubleClick:()=>{ee||(fe([Ce]),S?.(Ce,re),G(false));},sx:Je=>({cursor:"pointer","&.orb-selected":{bgcolor:ot(Je.palette.primary.main,$==="dark"?.22:.12)},"&.orb-selected:hover":{bgcolor:ot(Je.palette.primary.main,$==="dark"?.28:.18)}}),children:[e("td",{padding:"checkbox",children:e(It,{size:"small",checked:De})}),pe.map(Je=>{let lt=Ep(re,Je.field);return e("td",{align:Je.align==="inherit"?void 0:Je.align,sx:{fontSize:"0.82rem",py:1},children:Je.render?Je.render(lt,re):String(lt??"")},String(Je.field))})]},To(Ce))}),st.length===0?e("tr",{children:e("td",{colSpan:pe.length+1,children:e("div",{sx:{py:5,textAlign:"center",color:"text.secondary"},children:m})})}):null]})]})})]}),c("div",{className:"orb-dialog-actions",sx:re=>({px:2.5,py:1.5,borderTop:`1px solid ${re.palette.divider}`,bgcolor:re.palette.background.paper,"& .orb-btn":{textTransform:"none",fontWeight:700}}),children:[f&&(Oe||ce.length>0)?e(Te,{onClick:it,children:l}):null,e("div",{sx:{flex:1}}),e(Te,{onClick:Fe,children:d}),e(Te,{variant:"contained",onClick:wt,disabled:!ee&&ce.length===0,children:s})]})]})]})};I();var yi=({title:t,hideHeader:o,children:r})=>c("div",{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!o&&e("div",{sx:{mb:2},children:e(L,{variant:"h4",children:t})}),e("div",{sx:{flex:1,overflow:"hidden"},children:r})]});var bl={width:56,minWidth:56,maxWidth:56,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},vl={width:72,minWidth:72,maxWidth:72,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},oa={width:30,height:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},ra={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},Fp={display:"flex",alignItems:"center",justifyContent:"center",gap:.25,width:"100%",minWidth:0},mo={width:32,height:32,minWidth:32,minHeight:32,p:0,flex:"0 0 auto",borderRadius:1,color:"text.secondary","& svg, & [data-sap-icon]":{width:16,height:16,fontSize:16,strokeWidth:1.8}};I();var ib={fontSize:"0.85rem",width:62,minWidth:62,"& .orb-select-trigger":{minHeight:"32px !important",height:"32px !important",padding:"0 8px !important"},"& .orb-select-chevron":{width:"11px !important",height:"11px !important",fontSize:"11px !important"}},Ci=({rowsPerPage:t=20,rowsPerPageOptions:o=[20,50,100,-1],page:r=0,count:n=0,onRowsPerPageChange:a,onPageChange:i})=>{let{t:s}=de(),l=o.length>0?o:[20,50,100,-1],d=Math.max(0,r),p=t===-1?1:Math.max(1,Math.ceil(n/t)),m=Math.min(d+1,p),h=d>0,f=d<p-1&&t!==-1;return c("div",{className:"orb-table-pager",children:[e(L,{className:"orb-table-pager-label",children:s("table.toolbar.itemsPerPage")}),e(dt,{title:s("table.toolbar.itemsPerPage"),children:e(Vt,{size:"small",variant:"standard",value:t,"aria-label":s("table.toolbar.itemsPerPage"),fullWidth:false,disableUnderline:true,onChange:u=>a?.(Number(u.target.value)),sx:ib,children:l.map(u=>e("option",{value:u,children:u===-1?s("common.all"):u},`rows-per-page-${u}`))})}),e("span",{className:"orb-table-pager-divider"}),e(se,{className:"orb-table-pager-button","aria-label":"Previous page",size:"small",onClick:()=>i?.(Math.max(d-1,0)),disabled:!h,sx:mo,children:e(gp,{})}),c(L,{className:"orb-table-pager-page",title:s("table.toolbar.pageOf",{current:m,total:p}),children:[m," / ",p]}),e(se,{className:"orb-table-pager-button","aria-label":"Next page",size:"small",onClick:()=>i?.(Math.min(d+1,p-1)),disabled:!f,sx:mo,children:e(kr,{})})]})};I();var xi=({value:t="",onChange:o})=>{let{t:r}=de();return e("div",{className:"orb-table-toolbar-search",children:e(ze,{className:"orb-table-toolbar-search-field",size:"small",placeholder:r("table.toolbar.searchPlaceholder"),value:t,onChange:n=>o?.(n.target.value),InputProps:{startAdornment:e(cr,{position:"start",children:e(zr,{size:16})})}})})};I();var wi=t=>{let{t:o}=de(),r=Array.isArray(t.actions)?t.actions:t.actions?[t.actions]:[],n=Array.isArray(t.extraTools)?t.extraTools:t.extraTools?[t.extraTools]:[],a=[...r,...n],i=!!(t.showCreateButton||t.showEditButton||t.showDeleteButton),s=!!(t.onOpenGraphReport||t.onLayoutSave&&!t.layoutManager||t.layoutManager);return e(Gd,{className:"orb-table-toolbar",role:"toolbar","aria-label":o("table.title.default"),children:c("div",{className:"orb-table-toolbar-primary",children:[e(xi,{value:t.filterText,onChange:l=>{t.setFilterText(l),t.onPageChange?.(0);}}),e(Ci,{rowsPerPage:t.rowsPerPage,rowsPerPageOptions:t.rowsPerPageOptions,page:t.page,count:t.count,onRowsPerPageChange:t.onRowsPerPageChange,onPageChange:t.onPageChange}),a.length>0?e("div",{className:"orb-table-toolbar-custom",children:a.map((l,d)=>e(to__namespace.default.Fragment,{children:l},`toolbar-custom-${d}`))}):null,e("span",{className:"orb-table-toolbar-spacer"}),c("div",{className:"orb-table-toolbar-actions",children:[c("div",{className:"orb-table-tool-group",children:[!t.disableGrouping&&e(dt,{title:o("table.toolbar.groupBy"),children:e(se,{className:"orb-table-tool-button",sx:mo,onClick:l=>t.setGroupAnchorEl(t.groupAnchorEl?null:l.currentTarget),children:e(ii,{badgeContent:t.grouping?.length,color:"primary",invisible:!t.grouping?.length,children:e(wr,{})})})}),e(dt,{title:o("table.toolbar.summary"),children:e(se,{className:`orb-table-tool-button ${t.showSummary?"orb-is-active":""}`,active:!!t.showSummary,sx:mo,onClick:l=>t.setSummaryAnchorEl(t.summaryAnchorEl?null:l.currentTarget),children:e(sn,{})})}),e(dt,{title:o("table.toolbar.columns"),children:e(se,{className:"orb-table-tool-button",sx:mo,onClick:l=>t.setAnchorEl(t.anchorEl?null:l.currentTarget),children:e(ln,{})})}),e(dt,{title:o("table.toolbar.export"),children:e(se,{className:"orb-table-tool-button",sx:mo,onClick:t.handleExport,children:e(lp,{})})})]}),i&&c("div",{className:"orb-table-tool-group",children:[t.showCreateButton&&e(dt,{title:o("table.toolbar.newItem"),children:e(se,{className:"orb-table-tool-button",onClick:t.onOpenCreateDialog,color:"primary.main",sx:mo,children:e(Hr,{})})}),t.showEditButton&&e(dt,{title:o("table.toolbar.editItem"),children:e("span",{children:e(se,{className:"orb-table-tool-button",onClick:t.onOpenEditDialog,color:"primary.main",disabled:!!t.editDisabled,sx:mo,children:e(dp,{})})})}),t.showDeleteButton&&e(dt,{title:o("table.toolbar.deleteItem"),children:e("span",{children:e(se,{className:"orb-table-tool-button",onClick:t.onOpenDeleteConfirm,disabled:!!t.deleteDisabled,sx:{...mo,color:"error.main"},children:e(di,{})})})})]}),s&&c("div",{className:"orb-table-tool-group",children:[t.onOpenGraphReport&&e(dt,{title:o("table.toolbar.graphicReport"),children:e(se,{className:"orb-table-tool-button",sx:mo,onClick:t.onOpenGraphReport,children:e(up,{})})}),t.onLayoutSave&&!t.layoutManager&&e(dt,{title:o("table.toolbar.saveLayout"),children:e(se,{className:"orb-table-tool-button",sx:mo,onClick:l=>t.onLayoutSave(l),children:e(Pr,{})})}),t.layoutManager]})]})]})})};var Si=Object.freeze({Translate:{toString(t){if(!t)return;let{x:o,y:r}=t;return "translate3d("+(o?Math.round(o):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:o,scaleY:r}=t;return "scaleX("+o+") scaleY("+r+")"}},Transform:{toString(t){if(t)return [Si.Translate.toString(t),Si.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:o,duration:r,easing:n}=t;return o+" "+r+"ms "+n}}});I();var ki=t=>{let{t:o}=de(),{onSelectAllClick:r,order:n,orderBy:a,sortBy:i=[],numSelected:s=0,rowCount:l=0,onRequestSort:d,onContextMenu:p,columns:m,visibleColumns:h,selectionMode:f,grouping:u=[],isAllExpanded:b=false,handleToggleAll:C,onColumnResize:g,columnWidths:x,enableColumnReorder:v=false,disableSorting:y=false}=t,[k,S]=to.useState(null),P=to.useRef(null),M=W=>Q=>{y||k||d(W);},w=(W,Q,z)=>{W.preventDefault(),W.stopPropagation(),S(Q),P.current={startX:W.clientX,startWidth:z,colId:Q},document.addEventListener("mousemove",N),document.addEventListener("mouseup",A),document.body.style.cursor="col-resize";},N=W=>{if(!P.current)return;let{startX:Q,startWidth:z,colId:H}=P.current,X=W.clientX-Q,Y=Math.max(50,z+X);g&&g(H,Y);},A=()=>{S(null),P.current=null,document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",A),document.body.style.cursor="";};to.useEffect(()=>()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",A);},[]);let T=f==="multiple"||f==="single",R=u.length>0&&!!C,E=o(b?"table.group.collapseAll":"table.group.expandAll"),O=m.filter(W=>h.includes(W.id)),$=new Map(i.map((W,Q)=>[W.field,{...W,priority:Q+1}])),ee=O.map(W=>{let Q=x?.[W.id]||W.minWidth||100,z=$.get(W.id);return e(gb,{headCell:W,width:typeof Q=="number"?Q:100,order:n,orderBy:a,multiSortInfo:y?void 0:z,onRequestSort:M(W.id),onContextMenu:p,onResizeMouseDown:H=>w(H,W.id,typeof Q=="number"?Q:100),enableColumnReorder:v,disableSorting:y},W.id)}),F=O.map(W=>W.id),G=c("tr",{children:[T&&e("th",{className:"orb-table-control-head",style:{width:56,minWidth:56,maxWidth:56},children:e(It,{color:"primary",indeterminate:s>0&&s<l,checked:l>0&&s===l,onChange:r,disabled:f==="single",sx:oa})}),R&&e("th",{className:"orb-table-control-head",style:{width:72,minWidth:72,maxWidth:72},children:e(dt,{title:E,children:e(se,{size:"small",onClick:W=>{W.stopPropagation(),C?.(!b);},sx:ra,children:b?e(bi,{}):e(vi,{})})})}),v?e(sortable.SortableContext,{items:F,strategy:sortable.horizontalListSortingStrategy,children:ee}):ee]});return e("thead",{children:G})},gb=({headCell:t,width:o,order:r,orderBy:n,multiSortInfo:a,onRequestSort:i,onContextMenu:s,onResizeMouseDown:l,enableColumnReorder:d,disableSorting:p})=>{let{setNodeRef:m,attributes:h,listeners:f,transform:u,transition:b,isDragging:C}=sortable.useSortable({id:t.id,disabled:!d}),g=d?{transform:Si.Transform.toString(u),transition:b,opacity:C?.6:1}:{},x=p?"asc":a?.direction??(n===t.id?r:"asc"),v=!p&&(!!a||n===t.id);return c("th",{ref:d?m:void 0,className:`orb-table-head-cell ${t.numeric?"orb-num":""} ${d?"orb-is-reorderable":""} ${C?"orb-is-dragging":""}`,"aria-sort":v?x==="asc"?"ascending":"descending":"none",onContextMenu:s?y=>s(y,t.id):void 0,style:{width:o,minWidth:o,maxWidth:o,...g},...d?h:{},...d?f:{},children:[p?e("span",{className:"orb-table-head-label",children:t.label}):e(Ud,{className:"orb-table-head-sort",active:v,direction:x,onClick:i,children:c("span",{className:"orb-table-head-label",children:[t.label,a&&e("span",{className:"orb-table-sort-priority",children:a.priority})]})}),e("div",{className:"orb-table-resize-handle",onMouseDown:l,onPointerDown:y=>y.stopPropagation(),onClick:y=>y.stopPropagation()})]})};I();var Pi=t=>{let{t:o}=de(),{visibleRows:r,visibleColumns:n,selected:a=[],handleClick:i,columns:s,toggleGroupExpand:l,expandedGroups:d=new Set,selectionMode:p,grouping:m=[],isGroupFullyExpanded:h,handleExpandGroupRecursively:f,handleCollapseGroupRecursively:u,emptyLabel:b,getRowDataKey:C,getRowProps:g,getGroupRowProps:x}=t,v=P=>a.indexOf(P)!==-1,y=p==="multiple"||p==="single",k=m.length>0,S=n.length+(y?1:0)+(k?1:0);return c("tbody",{children:[r.map((P,M)=>{if(P.type==="group"){let w=d.has(P.id),N=P.childIds||[],A=N.filter(W=>v(W)).length,T=N.length>0&&A===N.length,R=A>0&&A<N.length,E={entry:P,data:P,id:P.id,index:M,selected:T,group:true},O=x?.(E)||{},{className:$,onClick:ee,...F}=O,G=W=>{if(W.stopPropagation(),!!t.onSelectionChange)if(T){let Q=a.filter(z=>!N.includes(z));t.onSelectionChange(Q);}else {let Q=Array.from(new Set([...a,...N]));t.onSelectionChange(Q);}};return c("tr",{...F,"data-ctable-row-key":C?.(E),className:["orb-table-group-row",$].filter(Boolean).join(" "),onClick:ee,sx:W=>({backgroundColor:"var(--orb-surface)","& th, & td":{color:W.palette.text.primary,borderBottomColor:W.palette.divider},"& .orb-icon-btn":{color:W.palette.text.primary},"& .orb-chk":{color:W.palette.text.secondary},"& .orb-chk:has(input:checked), & .orb-chk:has(input:indeterminate)":{color:W.palette.primary.main}}),children:[y&&e("td",{padding:"checkbox",sx:bl,children:e(It,{size:"small",checked:T,indeterminate:R,onChange:G,onClick:W=>W.stopPropagation(),sx:oa})}),k&&e("td",{padding:"checkbox",sx:vl,children:c("div",{sx:Fp,children:[m.length>1&&P.level<m.length-1&&e(dt,{title:h?.(P.id)?o("table.group.collapseAll"):o("table.group.expandAll"),children:e(se,{size:"small",onClick:()=>{h?.(P.id)?u?.(P.id):f?.(P.id);},sx:ra,children:h?.(P.id)?e(bi,{}):e(vi,{})})}),e(se,{size:"small",onClick:()=>l&&l(P.id),sx:ra,children:w?e(_o,{}):e(kr,{})})]})}),e("td",{colSpan:n.length,sx:{py:1,pl:P.level*3+1},children:c(L,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[P.field,": ",P.value," (",P.count,")"]})})]},P.id)}else {let w=P.data||P,N=P.id||w.id||M,A=v(N),T=`enhanced-table-checkbox-${M}`,R={entry:P,data:w,id:N,index:M,selected:A,group:false},E=g?.(R)||{},{className:O,onClick:$,...ee}=E,G=(P.level!==void 0?P.level:0)*4;return c("tr",{...ee,"data-ctable-row-key":C?.(R),className:[A?"orb-is-selected":"",O].filter(Boolean).join(" "),onClick:W=>{$?.(W),W.defaultPrevented||i?.(W,w);},role:y?"checkbox":ee.role,"aria-checked":y?A:ee["aria-checked"],tabIndex:ee.tabIndex??-1,children:[y&&e("td",{padding:"checkbox",sx:bl,children:e(It,{color:"primary",checked:A,inputProps:{"aria-labelledby":T},sx:oa})}),k&&e("td",{padding:"checkbox",sx:vl}),s.filter(W=>n.includes(W.id)).map((W,Q)=>{let H=Q===0&&G>0?{pl:G+2}:{};return e("td",{className:W.numeric?"orb-num":void 0,align:W.numeric?"right":"left",sx:H,children:W.render?W.render(w[W.id],w):(function(){let Y=w[W.id];if(W.numeric){if(typeof Y=="number")return Y.toLocaleString();if(typeof Y=="string"&&Y.trim()!==""&&!isNaN(Number(Y)))return Number(Y).toLocaleString()}return Y})()},W.id)})]},N)}}),r.length===0&&e("tr",{children:e("td",{colSpan:S,align:"center",children:b??o("common.noData")})})]})};I();var Bp=t=>{let{columns:o=[],visibleColumns:r,summaryRow:n,selectionMode:a,grouping:i=[],columnWidths:s={}}=t;if(!t.showSummary)return null;let l=a==="multiple"||a==="single",d=i.length>0,p=o.filter(m=>r.includes(m.id));return e("tfoot",{className:"orb-table-footer",style:{zIndex:t.zIndex},children:c("tr",{children:[l&&e("td",{className:"orb-table-footer-control",style:{width:56,minWidth:56,maxWidth:56}}),d&&e("td",{className:"orb-table-footer-control",style:{width:72,minWidth:72,maxWidth:72}}),p.map(m=>e("td",{className:`orb-table-footer-cell ${m.numeric?"orb-num":""}`,style:{width:s[m.id]||m.minWidth||100,minWidth:s[m.id]||m.minWidth||100,maxWidth:s[m.id]||m.minWidth||100},children:(function(){let f=n[m.id];return f==null||f===""?"":typeof f=="number"?f.toLocaleString():typeof f=="string"&&f.trim()!==""&&!isNaN(Number(f))?Number(f).toLocaleString():f})()},m.id))]})})};I();var Hp=t=>{let{t:o}=de();return e("div",{sx:{p:2},children:e(L,{children:o("table.mobile.notImplemented")})})};I();var pn=({groupAnchorEl:t,setGroupAnchorEl:o,grouping:r,setGrouping:n,columns:a})=>{let{t:i}=de(),[s,l]=to.useState(r);to.useEffect(()=>{t&&l(r);},[t,r]);let d=()=>{l(r),o(null);},p=h=>{l(f=>f.includes(h)?f.filter(u=>u!==h):[...f,h]);},m=()=>{n(s),o(null);};return c(Jt,{anchorEl:t,open:!!t,onClose:d,sx:{width:224,minWidth:224,maxHeight:360,overflowY:"auto"},children:[c("div",{className:"orb-table-group-menu-header",onClick:h=>h.stopPropagation(),children:[e(L,{className:"orb-table-group-menu-title",variant:"subtitle2",children:i("table.menu.groupBy")}),s.length>0&&e(Te,{className:"orb-table-group-menu-clear",size:"small",color:"error",onClick:h=>{h.stopPropagation(),l([]);},children:i("table.menu.clearAll")})]}),e(Nt,{className:"orb-table-group-menu-divider"}),a.map(h=>{let f=s.includes(h.id),u=s.indexOf(h.id)+1;return e("option",{className:"orb-table-group-menu-option",selected:f,onClick:b=>{b.stopPropagation(),p(h.id);},children:c("div",{className:"orb-table-group-menu-option-content",children:[e(It,{className:"orb-table-group-menu-checkbox",checked:f,size:"small"}),e(Ut,{className:"orb-table-group-menu-label",primary:h.label}),f&&e("span",{className:"orb-table-group-menu-order","aria-label":`${i("table.menu.groupBy")} ${u}`,children:u})]})},h.id)}),c("div",{className:"orb-table-group-menu-footer",children:[e(Te,{size:"small",variant:"ghost",onClick:d,children:i("common.cancel")}),e(Te,{size:"small",variant:"primary",onClick:m,children:i("common.ok")})]})]})},un=({anchorEl:t,setAnchorEl:o,columns:r,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=de();return c(Jt,{anchorEl:t,open:!!t,onClose:()=>o(null),children:[e("option",{disabled:true,children:e(Ut,{primary:i("table.menu.visibleColumns")})}),e(Nt,{}),r.map(s=>c("option",{onClick:()=>a(s.id),children:[e(It,{checked:n.includes(s.id),size:"small"}),e(Ut,{primary:s.label})]},s.id))]})},Ti=({anchorEl:t,setAnchorEl:o,showSummary:r,setShowSummary:n,columns:a,summaryColumns:i,toggleSummaryColumn:s})=>{let{t:l}=de();return c(Jt,{anchorEl:t,open:!!t,onClose:()=>o(null),children:[e("option",{children:e(ta,{control:e(si,{checked:r,onChange:d=>n(d.target.checked),size:"small"}),label:l("table.menu.showSummaryRow")})}),e(Nt,{}),a.filter(d=>d.numeric).map(d=>c("option",{onClick:()=>s(d.id),disabled:!r,children:[e(It,{checked:i.includes(d.id),size:"small"}),e(Ut,{primary:d.label})]},d.id)),a.filter(d=>d.numeric).length===0&&e("option",{disabled:true,children:e(Ut,{primary:l("table.menu.noNumericColumns")})})]})},Ii=({contextMenu:t,handleCloseContextMenu:o,columns:r,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=de();return c(Jt,{open:t!==null,onClose:o,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[e("option",{onClick:o,children:i("common.copy")}),e(Nt,{}),e("option",{disabled:true,children:i("table.menu.visibleColumns")}),r.map(s=>c("option",{onClick:()=>a(s.id),children:[e($o,{children:n.includes(s.id)&&e(rp,{fontSize:"small"})}),e(Ut,{children:s.label})]},s.id))]})},$p=({contextMenu:t,handleClose:o,columns:r,visibleColumns:n,grouping:a,summaryColumns:i,showSummary:s,sortBy:l,orderBy:d,order:p,onSortAsc:m,onSortDesc:h,onClearSort:f,onHideColumn:u,onToggleGroup:b,onToggleSummary:C,onOpenSortDialog:g})=>{let{t:x}=de(),v=t?.columnId??"",y=r.find(T=>T.id===v),k=a.includes(v),S=i.includes(v),P=!!y?.numeric,M=l.find(T=>T.field===v),w=M?M.direction==="asc":d===v&&p==="asc",N=M?M.direction==="desc":d===v&&p==="desc",A=w||N;return c(Jt,{open:t!==null,onClose:o,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[e("option",{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:e(Ut,{primary:y?.label??v})}),e(Nt,{}),c("option",{onClick:()=>{m(v),o();},selected:w,children:[e($o,{children:e(gl,{fontSize:"small"})}),e(Ut,{primary:x("table.headerMenu.sortAsc")})]}),c("option",{onClick:()=>{h(v),o();},selected:N,children:[e($o,{children:e(ml,{fontSize:"small"})}),e(Ut,{primary:x("table.headerMenu.sortDesc")})]}),A&&c("option",{onClick:()=>{f(v),o();},children:[e($o,{children:e(ap,{fontSize:"small"})}),e(Ut,{primary:x("table.headerMenu.clearSort")})]}),c("option",{onClick:()=>{g(),o();},children:[e($o,{children:e(Hr,{fontSize:"small"})}),e(Ut,{primary:x("table.headerMenu.configureSort")})]}),e(Nt,{}),c("option",{onClick:()=>{b(v),o();},selected:k,children:[e($o,{children:e(wr,{fontSize:"small"})}),e(Ut,{primary:x(k?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),P&&s&&c("option",{onClick:()=>{C(v),o();},selected:S,children:[e($o,{children:e(sn,{fontSize:"small"})}),e(Ut,{primary:x(S?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),e(Nt,{}),c("option",{onClick:()=>{u(v),o();},children:[e($o,{children:e(Np,{fontSize:"small"})}),e(Ut,{primary:x("table.headerMenu.hideColumn")})]})]})},_p=({open:t,onClose:o,columns:r,initialRules:n,onApply:a,onClear:i})=>{let{t:s}=de(),[l,d]=to.useState([]);to.useEffect(()=>{t&&d(n.length>0?n.map(C=>({...C})):[]);},[t,n]);let p=to.useMemo(()=>new Set(l.map(C=>C.field)),[l]),m=to.useMemo(()=>r.filter(C=>!p.has(C.id)),[r,p]),h=()=>{let C=m[0];C&&d(g=>[...g,{field:C.id,direction:"asc"}]);},f=C=>{d(g=>g.filter((x,v)=>v!==C));},u=(C,g)=>{d(x=>x.map((v,y)=>y===C?{...v,...g}:v));},b=(C,g)=>{d(x=>{let v=C+g;if(v<0||v>=x.length)return x;let y=[...x],[k]=y.splice(C,1);return y.splice(v,0,k),y});};return e(Ot,{open:t,onClose:o,maxWidth:620,fullWidth:true,className:"orb-table-sort-dialog",title:s("table.sortDialog.title"),actions:c(jsxRuntime.Fragment,{children:[e(Te,{className:"orb-table-sort-clear",variant:"neutral",disabled:l.length===0&&n.length===0,onClick:()=>{i(),o();},children:s("table.sortDialog.clearAll")}),e("span",{className:"orb-table-sort-action-spacer"}),e(Te,{variant:"neutral",onClick:o,children:s("common.cancel")}),e(Te,{variant:"primary",onClick:()=>{a(l),o();},children:s("common.ok")})]}),children:c("div",{className:"orb-table-sort-dialog-content",children:[l.length===0?e(L,{className:"orb-table-sort-empty",variant:"body2",children:s("table.sortDialog.empty")}):e(le,{className:"orb-table-sort-rules",spacing:1,children:l.map((C,g)=>{let x=new Set(l.filter((y,k)=>k!==g).map(y=>y.field)),v=r.filter(y=>!x.has(y.id));return c("div",{className:"orb-table-sort-rule",children:[e(ii,{className:"orb-table-sort-order",badgeContent:g+1,color:"primary"}),e(Vt,{size:"small",value:C.field,onChange:y=>u(g,{field:y.target.value}),options:v.map(y=>({value:y.id,label:y.label}))}),e(Vt,{size:"small",value:C.direction,onChange:y=>u(g,{direction:y.target.value}),options:[{value:"asc",label:s("table.sortDialog.asc")},{value:"desc",label:s("table.sortDialog.desc")}]}),e(se,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>b(g,-1),disabled:g===0,children:e(gl,{fontSize:"small"})}),e(se,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>b(g,1),disabled:g===l.length-1,children:e(ml,{fontSize:"small"})}),e(se,{className:"orb-table-sort-icon-button orb-table-sort-delete",size:"small",onClick:()=>f(g),children:e(pi,{fontSize:"small"})})]},`sort-rule-${g}`)})}),e(Te,{size:"small",onClick:h,disabled:m.length===0,startIcon:e(Hr,{}),variant:"secondary",className:"orb-table-sort-add",children:s("table.sortDialog.addRule")})]})})};I();var na=(t,o=2)=>t.toLocaleString(void 0,{maximumFractionDigits:o}),Gp=({kpis:t})=>{let{t:o}=de(),r=[{label:o("graph.kpi.totalRecords"),value:na(t.totalRecords,0),color:"var(--orb-fg)"},{label:o("graph.kpi.totalReport"),value:na(t.totalReportHours),color:"var(--orb-fg)"},{label:o("graph.kpi.totalBillable"),value:na(t.totalBillableHours),color:"var(--orb-primary)"},{label:o("graph.kpi.efficiency"),value:`${t.efficiency.toFixed(2)}%`,color:"var(--orb-accent)"},{label:o("graph.kpi.amount"),value:na(t.totalAmount),color:"var(--orb-primary)"},{label:o("graph.kpi.flagged"),value:na(t.flaggedCount,0),color:"var(--orb-err)"}];return e("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:12},children:r.map(n=>c(Ae,{elevation:0,sx:{padding:12,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[e(L,{variant:"caption",muted:true,children:n.label}),e(L,{variant:"h3",sx:{fontWeight:800,color:n.color,fontVariantNumeric:"tabular-nums"},children:n.value})]},n.label))})};I();var Mi=({title:t,subtitle:o,children:r})=>c(Ae,{elevation:0,sx:{padding:16},children:[e(L,{variant:"h4",sx:{fontWeight:700},children:t}),o&&e(L,{variant:"body2",muted:true,sx:{marginBottom:16},children:o}),r]});I();var aa=({data:t,orientation:o="horizontal",valueSuffix:r="",minHeight:n=210,activeName:a,onItemClick:i})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let s=Math.max(...t.map(l=>l.value),1);return o==="vertical"?e("div",{style:{display:"flex",gap:1,alignItems:"flex-end",minHeight:n},children:t.map(l=>c("div",{style:{flex:1,minWidth:0},children:[e("div",{onClick:()=>i?.(l),sx:{height:`${Math.max(l.value/s*180,6)}px`,background:l.name===a?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:i?"pointer":"default",opacity:a&&l.name!==a?.45:1}}),e(L,{variant:"caption",title:l.name,sx:{display:"block",mt:.5},children:l.name}),c(L,{variant:"caption",muted:true,children:[l.value.toFixed(1),r]})]},l.name))}):e(le,{spacing:1,children:t.map(l=>c("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[e(L,{variant:"caption",muted:true,title:l.name,children:l.name}),e("div",{onClick:()=>i?.(l),sx:{alignSelf:"center",background:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:i?"pointer":"default",opacity:a&&l.name!==a?.45:1},children:e("div",{style:{width:`${l.value/s*100}%`,height:"100%",background:l.name===a?"primary.dark":"primary.main"}})}),c(L,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[l.value.toFixed(1),r]})]},l.name))})};I();var Up=({data:t,color:o="var(--orb-chart-1)",valueSuffix:r="",height:n=220})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=t.map(f=>f.value),l=Math.min(...s,0),p=Math.max(...s,1)-l||1,m=t.map((f,u)=>{let b=i+u*(a-i*2)/Math.max(t.length-1,1),C=n-i-(f.value-l)/p*(n-i*2);return {x:b,y:C,...f}}),h=m.map(f=>`${f.x},${f.y}`).join(" ");return c("div",{children:[c("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[e("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),e("polyline",{fill:"none",style:{stroke:o},strokeWidth:3,points:h}),m.map(f=>e("circle",{cx:f.x,cy:f.y,r:4,style:{fill:o}},f.name))]}),e("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(f=>c("div",{style:{minWidth:0},children:[e(L,{variant:"caption",title:f.name,sx:{display:"block"},children:f.name}),c(L,{variant:"caption",muted:true,children:[f.value.toFixed(1),r]})]},f.name))})]})};I();var Kp=({data:t,barColor:o="var(--orb-chart-1)",lineColor:r="var(--orb-chart-5)",height:n=220})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=Math.max(...t.map(m=>m.barValue),1),l=Math.max(...t.map(m=>m.lineValue),1),d=t.map((m,h)=>{let f=(a-i*2)/t.length,u=Math.max(f*.5,8),b=i+h*f+(f-u)/2,C=m.barValue/s*(n-i*2),g=n-i-C;return {x:b,y:g,barHeight:C,barWidth:u,item:m}}),p=t.map((m,h)=>{let f=(a-i*2)/t.length,u=i+h*f+f/2,b=n-i-m.lineValue/l*(n-i*2);return {x:u,y:b,item:m}});return c(le,{spacing:1.25,children:[c("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[e("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),d.map(m=>e("rect",{x:m.x,y:m.y,width:m.barWidth,height:Math.max(m.barHeight,4),rx:6,style:{fill:o}},m.item.name)),e("polyline",{fill:"none",style:{stroke:r},strokeWidth:3,points:p.map(m=>`${m.x},${m.y}`).join(" ")}),p.map(m=>e("circle",{cx:m.x,cy:m.y,r:3.5,style:{fill:r}},`${m.item.name}-line`))]}),e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(m=>c("div",{style:{minWidth:0},children:[e(L,{variant:"caption",title:m.name,sx:{display:"block"},children:m.name}),c(L,{variant:"caption",muted:true,sx:{display:"block"},children:["Bar: ",m.barValue.toFixed(1)]}),c(L,{variant:"caption",muted:true,sx:{display:"block"},children:["Line: ",m.lineValue.toFixed(1)]})]},m.name))})]})};I();var hb=t=>{let r=.2+Math.max(0,Math.min(1,t))*.8;return `color-mix(in oklch, var(--orb-chart-1) ${Math.round(r*100)}%, transparent)`},qp=({data:t})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let o=Array.from(new Set(t.map(i=>i.x))),r=Array.from(new Set(t.map(i=>i.y))),n=Math.max(...t.map(i=>i.value),1),a=new Map(t.map(i=>[`${i.y}__${i.x}`,i.value]));return e("div",{style:{overflowX:"auto"},children:c("div",{style:{display:"grid",gridTemplateColumns:`120px repeat(${o.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+o.length*64},children:[e("div",{}),o.map(i=>e(L,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:i},i)),r.map(i=>c("div",{style:{display:"contents"},children:[e(L,{variant:"caption",sx:{alignSelf:"center"},children:i}),o.map(s=>{let l=a.get(`${i}__${s}`)||0,d=l/n;return e("div",{sx:{height:36,borderRadius:1,background:hb(d),border:"1px solid color-mix(in oklch, var(--orb-muted) 20%, transparent)",display:"flex",alignItems:"center",justifyContent:"center"},children:e(L,{variant:"caption",sx:{fontWeight:700},children:l.toFixed(1)})},`${i}-${s}`)})]},i))]})})};I();var fb=["var(--orb-chart-1)","var(--orb-chart-2)","var(--orb-chart-5)","var(--orb-chart-negative)","var(--orb-chart-4)","var(--orb-chart-3)"],Ri=({data:t,variant:o="donut",colors:r=fb,size:n=180,activeName:a,onItemClick:i})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let s=0,l=t.map((d,p)=>{let m=s;return s+=d.percent,`${r[p%r.length]} ${m}% ${s}%`});return c(le,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[e("div",{style:{width:n,height:n,borderRadius:"50%",background:`conic-gradient(${l.join(", ")})`,position:"relative",flexShrink:0},children:o==="donut"&&e("div",{style:{position:"absolute",inset:Math.round(n*.18),background:"background.paper",borderRadius:"50%"}})}),e(le,{spacing:1,sx:{minWidth:180},children:t.map((d,p)=>c("div",{onClick:()=>i?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:i?"pointer":"default",opacity:a&&d.name!==a?.45:1},children:[e("div",{style:{width:10,height:10,borderRadius:"50%",background:r[p%r.length]}}),e(L,{variant:"caption",sx:{flex:1},children:d.name}),c(L,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};I();var Xp=({effect:t,branches:o})=>{if(o.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let r=o.filter((a,i)=>i%2===0),n=o.filter((a,i)=>i%2===1);return c(le,{spacing:1.5,children:[e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(r.length,1)}, minmax(0, 1fr))`,gap:1},children:r.map(a=>c("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[e(L,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>e(L,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))}),c("div",{style:{position:"relative",height:32},children:[e("div",{style:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),e("div",{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,background:"primary.main",color:"primary.contrastText"},children:e(L,{variant:"caption",sx:{fontWeight:700},children:t})})]}),e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(n.length,1)}, minmax(0, 1fr))`,gap:1},children:n.map(a=>c("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[e(L,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>e(L,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))})]})};I();var Zp=({data:t,height:o=240})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let r=0,n=t.map(h=>{let f=h.type==="total"?0:r,u=h.type==="total"?h.value:r+h.value;return h.type!=="total"&&(r=u),{...h,start:f,end:u,delta:u-f}}),a=n.flatMap(h=>[h.start,h.end]),i=Math.min(...a,0),s=Math.max(...a,1),l=680,d=30,p=s-i||1,m=h=>o-d-(h-i)/p*(o-d*2);return c("div",{children:[c("div",{component:"svg",viewBox:`0 0 ${l} ${o}`,style:{width:"100%",height:o},children:[e("line",{x1:d,y1:m(0),x2:l-d,y2:m(0),style:{stroke:"var(--orb-chart-grid)"}}),n.map((h,f)=>{let u=(l-d*2)/n.length,b=Math.max(u*.55,8),C=d+f*u+(u-b)/2,g=m(Math.max(h.start,h.end)),x=m(Math.min(h.start,h.end)),v=h.type==="total"?"var(--orb-chart-1)":h.delta>=0?"var(--orb-chart-positive)":"var(--orb-chart-negative)";return c("g",{children:[e("rect",{x:C,y:g,width:b,height:Math.max(x-g,4),rx:6,style:{fill:v}}),e("text",{x:C+b/2,y:g-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:h.end.toFixed(1)})]},h.name)})]}),e("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`,gap:1},children:n.map(h=>e(L,{variant:"caption",title:h.name,children:h.name},h.name))})]})};var ia=({apiKey:t,query:o,zoom:r=14,mapType:n="roadmap"})=>{let a=encodeURIComponent(o);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(t)}&q=${a}&zoom=${r}&maptype=${n}`},_R=(t,o=360)=>{let r=ia(t);return `<iframe width="100%" height="${o}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${r}"></iframe>`};I();var Yp=({apiKey:t,query:o,embedUrl:r,zoom:n=14,mapType:a="roadmap",height:i=320})=>{let s=r||(t&&o?ia({apiKey:t,query:o,zoom:n,mapType:a}):"");return s?c("div",{children:[e("div",{component:"iframe",src:s,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:i,border:0,borderRadius:2}}),c(L,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",e("a",{href:s,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):e("div",{children:e(L,{variant:"body2",muted:true,children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var Ni=({keyword:t,location:o,src:r="orbcafe-ui"})=>{if(o){let n=encodeURIComponent(o.name||t||"Location");return `https://uri.amap.com/marker?position=${o.lng},${o.lat}&name=${n}&src=${encodeURIComponent(r)}&coordinate=gaode&callnative=0`}return t?`https://uri.amap.com/search?keyword=${encodeURIComponent(t)}&src=${encodeURIComponent(r)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};I();var jp=({keyword:t,location:o,embedUrl:r,height:n=320})=>{let a=r||Ni({keyword:t,location:o?{lng:o.lng,lat:o.lat,name:o.name}:void 0});return c("div",{children:[e("div",{component:"iframe",src:a,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),c(L,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",e("a",{href:a,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};I();var Qp=({billableByPrimary:t,efficiencyBySecondary:o,statusDistribution:r,interaction:n})=>{let{t:a}=de();return c("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:[e(Mi,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:e(aa,{data:t,orientation:"horizontal",activeName:n?.filters?.primaryDimension,onItemClick:i=>n?.onPrimaryDimensionClick?.(i.name)})}),e(Mi,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:e(aa,{data:o,orientation:"vertical",valueSuffix:"%",activeName:n?.filters?.secondaryDimension,onItemClick:i=>n?.onSecondaryDimensionClick?.(i.name)})}),e(Mi,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:e(Ri,{data:r,variant:"donut",activeName:n?.filters?.status,onItemClick:i=>n?.onStatusClick?.(i.name)})})]})};I();var vb=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],yb=["zh","en","de","fr","ja","ko"],Jp=({open:t,onClose:o,value:r,onSaveAll:n,modelOptions:a=vb,promptLangOptions:i=yb,analysisTemplateOptions:s=[],responseTemplateOptions:l=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:p})=>{let[m,h]=to.useState(r),[f,u]=to.useState(d||""),[b,C]=to.useState(p||""),[g,x]=to.useState(false);to.useEffect(()=>{t&&(h(r),u(d||""),C(p||""));},[t,r,d,p]);let v=(k,S)=>{h(P=>({...P,[k]:S}));},y=async()=>{if(n)try{x(!0),await n({settings:m,analysisTemplateId:f||void 0,responseTemplateId:b||void 0});}finally{x(false);}};return c(Ot,{open:t,onClose:o,fullWidth:true,maxWidth:"lg",children:[c("div",{className:"orb-dialog-title",sx:{pr:7,pb:2.2},children:[e(L,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),e(L,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),e(se,{onClick:o,sx:{position:"absolute",right:12,top:12},children:e(Sr,{})})]}),e("div",{className:"orb-dialog-content",sx:{pt:"18px !important"},children:c(le,{spacing:2.2,children:[c("div",{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[e("div",{children:e(ze,{size:"small",value:m.baseUrl,onChange:k=>v("baseUrl",k.target.value),fullWidth:true,label:"Base URL"})}),e("div",{children:e(ze,{size:"small",type:"password",value:m.apiKey,onChange:k=>v("apiKey",k.target.value),fullWidth:true,label:"API Key"})}),e("div",{children:e(ze,{size:"small",value:m.model,onChange:k=>v("model",k.target.value),fullWidth:true,select:true,label:"Model",children:a.map(k=>e("option",{value:k,children:k},k))})}),e("div",{children:e(ze,{size:"small",value:m.promptLang,onChange:k=>v("promptLang",k.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:i.map(k=>e("option",{value:k,children:k},k))})})]}),c("div",{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[c(ze,{size:"small",value:f,onChange:k=>u(k.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[e("option",{value:"",children:"Default"}),s.map(k=>e("option",{value:k.id,children:k.label},k.id))]}),e(Gn,{multiline:true,minRows:8,value:m.analysisPrompt,onChange:k=>v("analysisPrompt",k.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),c(ze,{size:"small",value:b,onChange:k=>C(k.target.value),fullWidth:true,select:true,label:"Response Template",children:[e("option",{value:"",children:"Default"}),l.map(k=>e("option",{value:k.id,children:k.label},k.id))]}),e(Gn,{multiline:true,minRows:8,value:m.responsePrompt,onChange:k=>v("responsePrompt",k.target.value),fullWidth:true,label:"Response Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[e(Te,{variant:"outlined",onClick:o,children:"Cancel"}),e(Te,{variant:"contained",onClick:y,disabled:!n||g,children:"Save"})]})]})};I();var Ai=({open:t,onClose:o,model:r,tableContent:n,extraCharts:a,interaction:i,aiAssistant:s})=>{let{t:l}=de(),[d,p]=to.useState(s?.defaultPrompt||""),[m,h]=to.useState(false),[f,u]=to.useState(false),b=i?.enabled!==false&&!!i,C=s?.enabled!==false,g=i?.filters||{},x=!!(g.primaryDimension||g.secondaryDimension||g.status),v=s?.placeholder||"Ask AI to analyze data, create charts, or find insights...";to.useEffect(()=>{t&&p(s?.defaultPrompt||"");},[t,s?.defaultPrompt]);let y=s?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},k=async()=>{let S=d.trim();if(!(!S||!s?.onSubmit))try{h(!0),await s.onSubmit(S,{filters:g,model:r});}finally{h(false);}};return e(Ot,{open:t,onClose:o,fullWidth:true,maxWidth:1400,hideCloseButton:true,children:c("div",{style:{height:"80vh",display:"flex",flexDirection:"column",background:"var(--orb-canvas)"},children:[e("div",{style:{padding:16,borderBottom:"1px solid var(--orb-border)"},children:c(le,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:12,children:[c(le,{direction:"row",spacing:10,alignItems:"center",sx:{flexWrap:"wrap"},children:[e(L,{variant:"h3",sx:{fontWeight:800},children:r.title}),e(xt,{label:l("graph.records",{count:r.kpis.totalRecords})}),b&&g.primaryDimension&&e(xt,{tone:"outline",label:`${i?.fieldMapping.primaryDimension}: ${g.primaryDimension}`,onDelete:()=>i?.onClearFilter("primaryDimension")}),b&&g.secondaryDimension&&e(xt,{tone:"outline",label:`${i?.fieldMapping.secondaryDimension}: ${g.secondaryDimension}`,onDelete:()=>i?.onClearFilter("secondaryDimension")}),b&&g.status&&e(xt,{tone:"outline",label:`${i?.fieldMapping.status}: ${g.status}`,onDelete:()=>i?.onClearFilter("status")}),b&&x&&e(Te,{size:"small",variant:"ghost",onClick:()=>i?.onClearAll(),children:"Clear"})]}),c(le,{direction:"row",spacing:10,alignItems:"center",children:[C&&c("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 10px",borderRadius:999,border:"1px solid var(--orb-border)",background:"var(--orb-surface)",minWidth:320},children:[e(se,{size:"small",onClick:s?.onVoiceInput,children:e(Wa,{size:16,strokeWidth:1.8})}),e("input",{className:"orb-inp orb-inp-dense",value:d,onChange:S=>p(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),k());},placeholder:v,style:{fontSize:14,border:"none",background:"transparent",flex:1,minWidth:0}}),e(se,{size:"small",onClick:k,disabled:m||!d.trim(),children:e(sd,{size:16,strokeWidth:1.8})}),e(se,{size:"small",onClick:()=>u(true),children:e(tn,{size:16,strokeWidth:1.8})})]}),e(se,{onClick:o,children:e(Xt,{size:18,strokeWidth:2})})]})]})}),c("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12,overflow:"auto",minHeight:0},children:[e(Gp,{kpis:r.kpis}),e(Qp,{billableByPrimary:r.charts.billableByPrimary,efficiencyBySecondary:r.charts.efficiencyBySecondary,statusDistribution:r.charts.statusDistribution,interaction:b?{filters:g,onPrimaryDimensionClick:S=>i?.onPrimaryDimensionClick(S),onSecondaryDimensionClick:S=>i?.onSecondaryDimensionClick(S),onStatusClick:S=>i?.onStatusClick(S)}:void 0}),a,n]}),e(Jp,{open:f,onClose:()=>u(false),value:y,onSaveAll:s?.onSaveAll,modelOptions:s?.modelOptions,promptLangOptions:s?.promptLangOptions,analysisTemplateOptions:s?.analysisTemplateOptions,responseTemplateOptions:s?.responseTemplateOptions,defaultAnalysisTemplateId:s?.defaultAnalysisTemplateId,defaultResponseTemplateId:s?.defaultResponseTemplateId})]})})};var Mr={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"]},xb=5,eu=t=>t.toLowerCase().replace(/[\s_-]/g,""),Rr=(t,o,r,n)=>{if(o)return o;if(t.length===0)return n;let a=Object.keys(t[0]),i=new Map(a.map(s=>[eu(s),s]));for(let s of r){let l=i.get(eu(s));if(l)return l}return a[0]||n},Io=t=>{if(typeof t=="number")return Number.isFinite(t)?t:0;if(typeof t=="string"){let o=Number(t.replace(/,/g,"").trim());return Number.isFinite(o)?o:0}return 0},bo=(t,o)=>t==null||t===""?o:String(t),wb=(t,o,r,n,a)=>{let i=new Map;return t.forEach(s=>{let l=bo(s[o],a);i.set(l,(i.get(l)||0)+Io(s[r]));}),Array.from(i.entries()).map(([s,l])=>({name:s,value:l})).sort((s,l)=>l.value-s.value).slice(0,n)},Sb=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=bo(l[o],i),p=s.get(d)||{report:0,billable:0};p.report+=Io(l[r]),p.billable+=Io(l[n]),s.set(d,p);}),Array.from(s.entries()).map(([l,d])=>({name:l,value:d.report>0?d.billable/d.report*100:0})).sort((l,d)=>l.value-d.value).slice(0,a)},kb=(t,o,r)=>{let n=t.length;if(n===0)return [];let a=new Map;return t.forEach(i=>{let s=bo(i[o],r);a.set(s,(a.get(s)||0)+1);}),Array.from(a.entries()).map(([i,s])=>({name:i,value:s,percent:s/n*100}))},tu=(t,o,r)=>{let n=new Map;return t.forEach(a=>{let i=bo(a[o],"N/A");n.set(i,(n.get(i)||0)+Io(a[r]));}),Array.from(n.entries()).sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>({name:a,value:i}))},Pb=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=bo(l[o],i),p=s.get(d)||{report:0,billable:0};p.report+=Io(l[r]),p.billable+=Io(l[n]),s.set(d,p);}),Array.from(s.entries()).map(([l,d])=>({name:l,barValue:d.billable,lineValue:d.report>0?d.billable/d.report*100:0})).sort((l,d)=>d.barValue-l.barValue).slice(0,a)},Tb=(t,o,r,n,a)=>{let i=new Map;return t.forEach(s=>{let l=bo(s[o],a),d=bo(s[r],a),p=`${l}__${d}`;i.set(p,(i.get(p)||0)+Io(s[n]));}),Array.from(i.entries()).map(([s,l])=>{let[d,p]=s.split("__");return {x:d,y:p,value:l}})},Ib=(t,o,r)=>{let n=tu(t,o,r),a=n.map(s=>({name:s.name,value:s.value,type:"delta"})),i=n.reduce((s,l)=>s+l.value,0);return [...a,{name:"Total",value:i,type:"total"}]},Mb=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=bo(l[o],i),p=`${bo(l[r],i)} / ${bo(l[n],i)}`,m=s.get(d)||new Map;m.set(p,(m.get(p)||0)+1),s.set(d,m);}),Array.from(s.entries()).map(([l,d])=>({title:l,causes:Array.from(d.entries()).sort((p,m)=>m[1]-p[1]).slice(0,a).map(([p,m])=>`${p} (${m})`)})).slice(0,6)},mn=({rows:t,config:o})=>{let{t:r}=de(),n=r("graph.unassigned"),a=to.useMemo(()=>{let m=o?.fieldMapping;return {primaryDimension:Rr(t,m?.primaryDimension,Mr.primaryDimension,"Category"),secondaryDimension:Rr(t,m?.secondaryDimension,Mr.secondaryDimension,"Owner"),status:Rr(t,m?.status,Mr.status,"Status"),date:Rr(t,m?.date,Mr.date,"Date"),description:Rr(t,m?.description,Mr.description,"Description"),reportHours:Rr(t,m?.reportHours,Mr.reportHours,"ReportHours"),billableHours:Rr(t,m?.billableHours,Mr.billableHours,"BillableHours"),amount:Rr(t,m?.amount,Mr.amount,"Amount")}},[t,o?.fieldMapping]),i=to.useMemo(()=>t.map((m,h)=>{let f=Io(m[a.reportHours]),u=Io(m[a.billableHours]),b=Io(m[a.amount]),C=f>0?u/f*100:0;return {id:`graph-row-${h}`,Date:bo(m[a.date],""),Primary:bo(m[a.primaryDimension],n),Secondary:bo(m[a.secondaryDimension],n),Description:bo(m[a.description],""),ReportHours:f,BillableHours:u,Amount:b,Efficiency:C,Status:bo(m[a.status],n)}}),[t,a,n]),s=to.useMemo(()=>{let m=i.length,h=i.reduce((x,v)=>x+Io(v.ReportHours),0),f=i.reduce((x,v)=>x+Io(v.BillableHours),0),u=i.reduce((x,v)=>x+Io(v.Amount),0),b=h>0?f/h*100:0,C=o?.statusFlagValues||["flag","flagged","warning","risk"],g=i.filter(x=>C.includes(bo(x.Status,"").toLowerCase())).length;return {totalRecords:m,totalReportHours:h,totalBillableHours:f,efficiency:b,totalAmount:u,flaggedCount:g}},[i,o?.statusFlagValues]),l=o?.topN||xb,d=to.useMemo(()=>({billableByPrimary:wb(i,"Primary","BillableHours",l,n),efficiencyBySecondary:Sb(i,"Secondary","ReportHours","BillableHours",l,n),statusDistribution:kb(i,"Status",n),lineByDate:tu(i,"Date","BillableHours"),comboByPrimary:Pb(i,"Primary","ReportHours","BillableHours",l,n),heatmapPrimarySecondary:Tb(i,"Primary","Secondary","BillableHours",n),waterfallBillable:Ib(i,"Date","BillableHours"),fishboneStatusCauses:Mb(i,"Status","Primary","Secondary",3,n)}),[i,l,n]),p=to.useMemo(()=>({title:o?.title||r("graph.reportTitle"),kpis:s,charts:d,table:{columns:[{id:"Date",label:a.date},{id:"Primary",label:a.primaryDimension},{id:"Secondary",label:a.secondaryDimension},{id:"Description",label:a.description},{id:"ReportHours",label:r("graph.column.reportHours"),align:"right"},{id:"BillableHours",label:r("graph.column.billableHours"),align:"right"},{id:"Amount",label:"Amount",align:"right"},{id:"Efficiency",label:"Efficiency",align:"right"},{id:"Status",label:a.status}],rows:i}}),[d,o?.title,a,s,i,r]);return {fieldMapping:a,model:p}};var gn=t=>String(t??"").trim(),Li=(t={})=>{let[o,r]=to.useState(t),n=to.useCallback((d,p)=>{r(m=>{let h=p?.trim();if(!h){let f={...m};return delete f[d],f}if(m[d]===h){let f={...m};return delete f[d],f}return {...m,[d]:h}});},[]),a=to.useCallback(d=>{r(p=>{if(!p[d])return p;let m={...p};return delete m[d],m});},[]),i=to.useCallback(()=>{r({});},[]),s=to.useMemo(()=>!!(o.primaryDimension||o.secondaryDimension||o.status),[o]),l=to.useCallback((d,p)=>d.filter(m=>!(o.primaryDimension&&gn(m[p.primaryDimension])!==gn(o.primaryDimension)||o.secondaryDimension&&gn(m[p.secondaryDimension])!==gn(o.secondaryDimension)||o.status&&gn(m[p.status])!==gn(o.status))),[o]);return {filters:o,setFilter:n,clearFilter:a,clearAll:i,hasActiveFilters:s,applyRows:l}};I();var Fi=({variants:t,currentVariantId:o,onLoad:r,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=de(),[l,d]=to.useState(false),[p,m]=to.useState(""),[h,f]=to.useState(false),[u,b]=to.useState(false),C=t.find(v=>v.id===o),g=()=>{m(C?.name||s("variant.newVariant")),f(C?.isDefault||false),b(C?.isPublic||false),d(true);},x=()=>{n({name:p,isDefault:h,isPublic:u,description:""}),d(false);};return c("div",{className:"orb-variant-management",children:[e(Vt,{size:"small",fullWidth:false,sx:{width:"min(240px, 100%)","& .orb-inp":{fontSize:"0.85rem",backgroundColor:"var(--orb-p50)",borderColor:"color-mix(in oklch, var(--orb-primary) 30%, var(--orb-border))"}},value:o||"",options:[{value:"",label:s("variant.selectVariant"),disabled:true},...t.map(v=>({value:v.id,label:v.name+(v.isDefault?` (${s("variant.defaultSuffix")})`:"")}))],onChange:v=>{let y=t.find(k=>k.id===v.target.value);y&&r(y);}}),e(dt,{title:s("variant.saveView"),children:e(se,{className:"orb-variant-save-button",onClick:g,size:"small",color:"primary",children:e(Pr,{fontSize:"small"})})}),c(Ot,{open:l,onClose:()=>d(false),children:[e("div",{className:"orb-dialog-title",children:s("variant.saveView")}),c("div",{className:"orb-dialog-content",children:[e(ze,{autoFocus:true,margin:"dense",label:s("variant.viewName"),fullWidth:true,variant:"outlined",value:p,onChange:v=>m(v.target.value)}),e(ta,{control:e(It,{checked:h,onChange:v=>f(v.target.checked)}),label:s("variant.setDefault")}),e(ta,{control:e(It,{checked:u,onChange:v=>b(v.target.checked)}),label:s("variant.publicAllUsers")})]}),c("div",{className:"orb-dialog-actions",children:[e(Te,{onClick:()=>d(false),children:s("common.cancel")}),e(Te,{onClick:x,variant:"contained",children:s("common.save")})]})]})]})};I();var ru=({appId:t,tableKey:o="default",currentFilters:r,currentLayoutId:n,layoutRefs:a,onLoad:i,variantService:s,serviceUrl:l,onError:d,onSuccess:p,currentVariantId:m,onVariantChange:h})=>{let{t:f}=de(),[u,b]=to.useState([]),[C,g]=to.useState(""),x=`orbcafe.variants.${t}.${o}`,v=m!==void 0?m:C,y=R=>{m===void 0&&g(R),h&&h(R);},k=to.useCallback(()=>{try{let R=localStorage.getItem(x);if(!R)return [];let E=JSON.parse(R);return Array.isArray(E)?E:[]}catch{return []}},[x]),S=to.useCallback(R=>{try{localStorage.setItem(x,JSON.stringify(R));}catch{}},[x]),P=to.useCallback(R=>{b(R);let E=R.find(O=>O.isDefault);E&&!v&&(y(E.id),i(E));},[v,i,y]),M=to.useCallback(async()=>{if(!t)return [];try{let R=[];if(s)R=await s.getVariants(t,o);else if(l){let E=await fetch(`${l}/api/variants?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(o)}`);if(!E.ok)throw new Error(f("variant.toast.fetchFailed"));R=await E.json();}else R=k();return P(R),R}catch(R){console.error("Error fetching variants",R);let E=k();return P(E),d&&d(f("variant.toast.fetchFailed")),E}},[t,o,s,l,k,P,d,f]);return to.useEffect(()=>{M();},[t,o]),e(Fi,{variants:u,currentVariantId:v,onLoad:R=>{y(R.id),i(R);},onSave:async R=>{let E=Date.now().toString(),O;try{let $=R.scope||"Both",ee=u.find(Q=>Q.name===R.name);E=ee?ee.id:Date.now().toString();let F=[];if(ee&&(Array.isArray(ee.filters)?F=[...ee.filters]:ee.filters&&(F=[{scope:"default",filters:ee.filters}])),$==="Search"||$==="Both"){let Q=(Array.isArray(r),r);if(Q)if(Array.isArray(Q)&&Q.length>0&&Q[0].scope)Q.forEach(z=>{let H=F.findIndex(X=>X.scope===z.scope);H>=0?F[H]=z:F.push(z);});else {let z={scope:o,filters:Q},H=F.findIndex(X=>X.scope===o);H>=0?F[H]=z:F.push(z);}}let G=ee?.layout||{},W=[];if(ee&&Array.isArray(ee.layoutRefs)&&(W=[...ee.layoutRefs]),$==="Layout"||$==="Both")if(a&&a.length>0)a.forEach(Q=>{let z=W.findIndex(H=>H.tableKey===Q.tableKey);z>=0?W[z]=Q:W.push(Q);});else {let Q={tableKey:o,layoutId:n||null},z=W.findIndex(H=>H.tableKey===o);z>=0?W[z]=Q:W.push(Q);}if(O={appId:t,tableKey:o,...R,scope:$,id:E,createdAt:new Date().toISOString(),filters:F,layout:G,layoutRefs:W},s)await s.saveVariant(O,t,o);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})).ok)throw new Error(f("variant.toast.saveFailed"))}else {let z=u.some(H=>H.id===E)?u.map(H=>H.id===E?O:H):[...u,O];b(z),S(z);}p&&p(f("variant.toast.saveSuccess")),(s||l)&&await M(),y(E),i(O);}catch($){console.error("Error saving variant",$);let F=u.some(G=>G.id===E)?u.map(G=>G.id===E?O:G):[...u,O];b(F),S(F),y(E),i(O),d&&d(f("variant.toast.saveFailed"));}},onDelete:async R=>{try{if(s)await s.deleteVariant(R);else if(l){if(!(await fetch(`${l}/api/variants/${R}`,{method:"DELETE"})).ok)throw new Error(f("variant.toast.deleteFailed"))}else {let E=u.filter(O=>O.id!==R);b(E),S(E);}v===R&&y(""),(s||l)&&M(),p&&p(f("variant.toast.deleteSuccess"));}catch(E){console.error("Error deleting variant",E);let O=u.filter($=>$.id!==R);b(O),S(O),v===R&&y(""),d&&d(f("variant.toast.deleteFailed"));}},onSetDefault:async R=>{try{let E=u.find($=>$.id===R);if(!E)return;let O={appId:t,tableKey:o,...E,isDefault:!0};if(s)await s.setDefaultVariant(R,t,o);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})).ok)throw new Error(f("variant.toast.defaultFailed"))}else {let $=u.map(ee=>({...ee,isDefault:ee.id===R}));b($),S($);}(s||l)&&await M(),p&&p(f("variant.toast.defaultSuccess"));}catch(E){console.error("Error setting default variant",E);let O=u.map($=>({...$,isDefault:$.id===R}));b(O),S(O),d&&d(f("variant.toast.defaultFailed"));}}})};I();ar__default.default.extend(Lb__default.default);ar__default.default.extend(Ob__default.default);ar__default.default.extend(Cf__default.default);var la="YYYY-MM-DD",Bb=[null,null],Vr="0.85rem",Hb={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},zb=({isInRange:t,isStart:o,isEnd:r,isHovered:n,disableMargin:a,sx:i,...s})=>{let l=lo();return e(Zd,{...s,sx:[...Array.isArray(i)?i:i?[i]:[],t?{borderRadius:0,backgroundColor:l.palette.primary.light,color:l.palette.primary.contrastText}:{},n&&!t&&!o&&!r?{borderRadius:0,backgroundColor:l.palette.action.hover,border:`1px dashed ${l.palette.primary.main}`}:{},o?{borderRadius:"50% 0 0 50%",backgroundColor:l.palette.primary.main,color:l.palette.primary.contrastText}:{},r?{borderRadius:"0 50% 50% 0",backgroundColor:l.palette.primary.main,color:l.palette.primary.contrastText}:{},o&&r?{borderRadius:"50%"}:{}]})},au=({label:t,value:o=Bb,onChange:r})=>{let{t:n,locale:a}=de(),i=Hb[a]||"en",s=t||n("dateRange.label"),[l,d]=to.useState(null),[p,m]=to.useState(o),[h,f]=to.useState("start"),[u,b]=to.useState(null),[C,g]=to.useState((o[0]||ar__default.default()).locale(i)),[x,v]=to.useState(""),[y,k]=to.useState(""),[S,P]=to.useState(false),[M,w]=to.useState(false),N=to__namespace.default.useRef(o);to.useEffect(()=>{let[Q,z]=o,[H,X]=N.current,Y=ce=>ce&&typeof ce.isSame=="function",j=!(Q===null&&H===null||Y(Q)&&Y(H)&&Q.isSame(H,"day")),te=!(z===null&&X===null||Y(z)&&Y(X)&&z.isSame(X,"day"));(j||te)&&(m(o),o[0]&&Y(o[0])&&g(o[0].locale(i))),N.current=o;},[o,i]),to.useEffect(()=>{v(p[0]?p[0].locale(i).format(la):""),k(p[1]?p[1].locale(i).format(la):""),P(false),w(false);},[p,i]);let A=(Q,z)=>{let H=z.trim(),X=Q==="start"?P:w;if(!H){let te=Q==="start"?[null,p[1]]:[p[0],null];X(false),m(te);return}let Y=ar__default.default(H,la,true).locale(i);if(!Y.isValid()){X(true);return}X(false);let j=[...p];if(Q==="start")j[0]=Y,j[1]&&Y.isAfter(j[1],"day")&&(j[1]=null),f(j[1]?"start":"end");else {let te=j[0];te&&Y.isBefore(te,"day")?(j=[Y,null],f("end")):(j[1]=Y,f("start"));}m(j),g(Y);},T=Q=>{d(Q.currentTarget);},R=()=>{d(null),f("start"),b(null);},E=!!l,O=Q=>{if(!Q)return;let z=[...p];if(h==="start")z=[Q,null],f("end");else {let H=z[0];H&&Q.isBefore(H)?(z=[Q,null],f("end")):(z=[H,Q],f("start"));}m(z);},$=Q=>{let z=ar__default.default().locale(i),H=[null,null];switch(Q){case "today":H=[z,z];break;case "week":H=[z.startOf("week"),z.endOf("week")];break;case "month":H=[z.startOf("month"),z.endOf("month")];break}m(H),f("start"),g(z);},ee=()=>{r&&r(p),R();},F=()=>{m(o),f("start"),R();},G=to.useCallback(Q=>{let{day:z,...H}=Q,[X,Y]=p,j=X?z.isSame(X,"day"):false,te=Y?z.isSame(Y,"day"):false,ce=X&&Y?z.isBetween(X,Y,"day","()"):false,fe=false;return h==="end"&&X&&!Y&&u&&z.isAfter(X,"day")&&z.isBefore(u.add(1,"day"),"day")&&(fe=true),e(zb,{...H,day:z,disableMargin:true,isStart:j,isEnd:te,isInRange:ce||fe,onMouseEnter:()=>b(z)})},[p,h,u]),W=Q=>Q?Q.locale(i).format("YYYY-MM-DD"):"";return c("div",{className:"orb-date-range-picker",children:[e(ze,{className:"orb-date-range-field",label:s,value:p[0]?`${W(p[0])} - ${W(p[1])}`:"",onClick:T,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Vr}},InputProps:{readOnly:true,sx:{fontSize:Vr,"& .orb-inp":{fontSize:Vr},paddingRight:"4px"},endAdornment:e(se,{className:"orb-date-range-calendar-trigger",size:"small",onClick:T,tooltip:s,children:e(Tt,{name:"calendar",size:16})})}}),c(li,{open:E,anchorEl:l,onClose:R,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},className:"orb-date-range-popover",children:[e("div",{className:"orb-date-range-inputs",children:c(le,{className:"orb-date-range-input-row",direction:"row",alignItems:"center",spacing:1.5,justifyContent:"space-between",children:[e(ze,{className:"orb-date-range-manual-field",label:n("dateRange.startDate"),placeholder:la,value:x,error:S,size:"small",onFocus:()=>f("start"),onChange:Q=>{v(Q.target.value),S&&P(false);},onBlur:()=>A("start",x),onKeyDown:Q=>{Q.key==="Enter"&&(Q.preventDefault(),A("start",x));},sx:{"& .orb-inp":{fontSize:Vr,py:.75},"& label":{fontSize:Vr}}}),e(Jd,{color:"action",fontSize:"small"}),e(ze,{className:"orb-date-range-manual-field",label:n("dateRange.endDate"),placeholder:la,value:y,error:M,size:"small",onFocus:()=>{p[0]&&f("end");},onChange:Q=>{k(Q.target.value),M&&w(false);},onBlur:()=>A("end",y),onKeyDown:Q=>{Q.key==="Enter"&&(Q.preventDefault(),A("end",y));},sx:{"& .orb-inp":{fontSize:Vr,py:.75},"& label":{fontSize:Vr}}})]})}),e("div",{className:"orb-date-range-shortcuts",children:c(le,{direction:"row",spacing:1,justifyContent:"center",children:[e(xt,{label:n("dateRange.today"),onClick:()=>$("today"),clickable:true,size:"small",variant:"outlined"}),e(xt,{label:n("dateRange.thisWeek"),onClick:()=>$("week"),clickable:true,size:"small",variant:"outlined"}),e(xt,{label:n("dateRange.thisMonth"),onClick:()=>$("month"),clickable:true,size:"small",variant:"outlined"})]})}),e("div",{className:"orb-date-range-calendar",children:e(jd,{dateAdapter:ni,adapterLocale:i,children:e(Yd,{value:null,referenceDate:C,onMonthChange:g,onYearChange:g,onChange:O,slots:{day:G},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true})})}),e(Nt,{}),c(le,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[e(Te,{size:"small",onClick:F,color:"inherit",children:n("common.cancel")}),e(Te,{size:"small",variant:"contained",onClick:ee,children:n("common.done")})]})]})]})};I();var Hi={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},$b={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"},_b=["contains","notContains",">",">=","<","<=","equals"],su=["=","!=",">","<",">=","<=","between"],no="0.85rem",Gb=({field:t,value:o,onChange:r})=>{let{t:n}=de(),[a,i]=to.useState(null),[s,l]=to.useState(null),[d,p]=to.useState(null),[m,h]=to.useState(""),[f,u]=to.useState(""),[b,C]=to.useState(""),[g,x]=to.useState("");to.useEffect(()=>{let T=setTimeout(()=>{x(b);},1e3);return ()=>clearTimeout(T)},[b]);let v=o?.operator||(t.type==="number"?"=":"equals"),y=o?.value,k=T=>{let R=$b[T];return R?n(R):T},S=T=>{i(a?null:T.currentTarget);},P=T=>{r({...o,operator:T,value:y}),i(null);},M={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:no}},InputProps:{sx:{fontSize:no}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:no,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},w=t.type||"text";if(w==="date"){let R=(E=>{if(!E)return [null,null];if(Array.isArray(E)&&E.length===2){let O=E[0]?ar__default.default.isDayjs(E[0])?E[0]:ar__default.default(E[0]):null,$=E[1]?ar__default.default.isDayjs(E[1])?E[1]:ar__default.default(E[1]):null;return [O,$]}return ar__default.default.isDayjs(E)||typeof E=="string"?[ar__default.default.isDayjs(E)?E:ar__default.default(E),null]:[null,null]})(y);return e(au,{label:t.label,value:R,onChange:E=>r({value:E,operator:"between"})})}if(w==="number"&&v==="between"){let T=()=>{r({value:[m,f],operator:"between"}),l(null);},R=Array.isArray(y)?`${y[0]||""} - ${y[1]||""}`:"";return c(jsxRuntime.Fragment,{children:[e(ze,{...M,label:t.label,value:R,placeholder:n("smartFilter.minMaxPlaceholder"),InputProps:{...M.InputProps,startAdornment:e(cr,{position:"start",children:e(dt,{title:k("between"),children:e(se,{size:"small",onClick:S,sx:{width:24,height:24,fontSize:no},children:Hi.between})})}),readOnly:true},onClick:E=>l(s?null:E.currentTarget)}),e(Jt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:no,minHeight:"auto",py:.5}}},children:su.map(E=>c("option",{selected:E===v,onClick:()=>P(E),children:[e("div",{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Hi[E]}),e(Ut,{primary:k(E),primaryTypographyProps:{fontSize:no}})]},E))}),e(li,{open:!!s,anchorEl:s,onClose:()=>l(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:c("div",{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[e(ze,{size:"small",label:n("smartFilter.min"),type:"number",value:m,onChange:E=>h(E.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:no}},InputProps:{sx:{fontSize:no}}}),e(ep,{color:"action"}),e(ze,{size:"small",label:n("smartFilter.max"),type:"number",value:f,onChange:E=>u(E.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:no}},InputProps:{sx:{fontSize:no}}}),e(Te,{variant:"contained",size:"small",onClick:T,children:n("common.ok")})]})})]})}if(t.isValueHelp||w==="value-help"){let T=t.valueHelp?.mode||"single";return e(Op,{...M,...t.valueHelp,label:t.label,placeholder:t.placeholder||t.valueHelp?.placeholder,value:y??(T==="multiple"?[]:null),mode:T,onChange:R=>r({value:R,operator:T==="multiple"?"anyOf":"equals"})})}if(w==="select")return c(Vt,{size:"small",fullWidth:true,label:t.label,value:y||"",onChange:T=>r({...o,value:T.target.value,operator:"equals"}),children:[e("option",{value:"",children:n("common.none")}),t.options?.map(T=>e("option",{value:T.value,children:T.label},T.value))]});if(w==="multi-select"){let T=Array.isArray(y)?y:[],R=t.options?.filter(G=>G.label.toLowerCase().includes(g.toLowerCase()))||[],E=G=>t.options?.find(W=>W.value===G)?.label||G,O=T.map(E),$=O.length===0?n("common.none"):O.length>2?`${O.slice(0,2).join(", ")} +${O.length-2}`:O.join(", "),ee=()=>{p(null),C(""),x("");},F=G=>{let W=T.includes(G)?T.filter(Q=>Q!==G):[...T,G];r({...o,value:W,operator:"anyOf"});};return c("div",{className:"orb-fld",children:[e("label",{children:t.label}),c(Te,{variant:"outlined",size:"small",onClick:G=>p(d?null:G.currentTarget),sx:{width:"100%",minHeight:36,justifyContent:"space-between",fontSize:no,fontWeight:400},children:[e("span",{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:$}),e(_o,{fontSize:"small"})]}),e(Jt,{anchorEl:d,open:!!d,onClose:ee,PaperProps:{sx:{width:280,maxHeight:340,overflowY:"auto",p:.5}},children:c("div",{onClick:G=>G.stopPropagation(),sx:{display:"grid",gap:.35},children:[e(ze,{size:"small",autoFocus:true,placeholder:n("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:e(cr,{position:"start",children:e(zr,{fontSize:"small"})}),sx:{fontSize:no}},value:b,onChange:G=>C(G.target.value),onKeyDown:G=>G.stopPropagation()}),R.length>0?R.map(G=>{let W=T.includes(G.value);return c("div",{role:"option","aria-selected":W,tabIndex:0,className:`orb-menu-item ${W?"orb-selected":""}`,onClick:()=>F(G.value),onKeyDown:Q=>{(Q.key==="Enter"||Q.key===" ")&&(Q.preventDefault(),F(G.value));},children:[e(It,{checked:W,size:"small",inputProps:{tabIndex:-1},sx:{pointerEvents:"none"}}),e(Ut,{primary:G.label})]},String(G.value))}):e("div",{className:"orb-menu-item","aria-disabled":"true",children:n("smartFilter.noOptionsFound")})]})})]})}let N=w==="number"?su:_b;return c(jsxRuntime.Fragment,{children:[e(ze,{...M,className:"orb-filter-operator-field",label:t.label,sx:{minWidth:"120px"},value:y||"",type:w==="number"?"number":"text",onChange:T=>r({...o,value:T.target.value,operator:v}),InputProps:{...M.InputProps,startAdornment:e(cr,{position:"start",children:e(dt,{title:k(v),children:e(se,{className:"orb-filter-operator-trigger",size:"small",onClick:S,onMouseDown:T=>T.preventDefault(),sx:{width:24,height:24,fontSize:no,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Hi[v]})})}),endAdornment:t.hasSearchIcon?e(cr,{position:"end",children:e(zr,{color:"action"})}):void 0}}),e(Jt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:no,minHeight:"auto",py:.5}}},children:N.map(T=>c("option",{selected:T===v,onClick:()=>P(T),children:[e("span",{className:"orb-filter-operator-symbol",children:Hi[T]}),e(Ut,{primary:k(T),primaryTypographyProps:{fontSize:no}})]},T))})]})},Go=({fields:t,filters:o,onFilterChange:r,variants:n=[],currentVariantId:a,onVariantLoad:i,onVariantSave:s,onVariantDelete:l,onVariantSetDefault:d,onSearch:p,loading:m=false,appId:h,tableKey:f,currentLayout:u,currentLayoutId:b,layoutRefs:C,variantService:g,serviceUrl:x})=>{let{t:v}=de(),[y,k]=to.useState(true),[S,P]=to.useState(null),[M,w]=to.useState(t.filter(R=>!R.hidden).map(R=>R.id)),N=(R,E)=>{r({...o,[R]:E});},A=R=>{M.includes(R)?w(M.filter(E=>E!==R)):w([...M,R]);};return c(Ae,{className:`orb-smart-filter ${y?"orb-smart-filter-expanded":"orb-smart-filter-collapsed"}`,sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[y?c(jsxRuntime.Fragment,{children:[c("div",{className:"orb-smart-filter-header",children:[h?e(ru,{appId:h,tableKey:f,currentFilters:{values:o,visibleFields:M},currentLayout:u,currentLayoutId:b,layoutRefs:C,onLoad:R=>{if(!R.filters)return;let E=null;if(Array.isArray(R.filters)){let O=f||"default",$=R.filters.find(ee=>ee.scope===O);E=$?$.filters:null;}else E=R.filters;E&&(E.values||E.visibleFields?(E.visibleFields&&Array.isArray(E.visibleFields)&&w(E.visibleFields),E.values&&r(E.values)):r(E)),i&&i(R);},variantService:g,serviceUrl:x,currentVariantId:a}):e(Fi,{variants:n,currentVariantId:a,onLoad:i,onSave:R=>{s&&s({...R,filters:{values:o,visibleFields:M}});},onDelete:l,onSetDefault:d}),c("div",{className:"orb-smart-filter-actions",children:[e(dt,{title:v("smartFilter.addFilters"),children:e(Te,{className:"orb-smart-filter-adapt",onClick:R=>P(S?null:R.currentTarget),size:"small",color:"primary",startIcon:e(kp,{fontSize:"small"}),sx:{textTransform:"none",fontSize:no,whiteSpace:"nowrap",minWidth:"fit-content"},children:v("smartFilter.adaptFilters")})}),e(se,{className:"orb-smart-filter-go",tooltip:v("smartFilter.go"),"aria-label":v("smartFilter.go"),onClick:p,disabled:m,children:m?e(jo,{size:16}):e(Tt,{name:"play",size:16})}),c(Jt,{anchorEl:S,open:!!S,onClose:()=>P(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .orb-menu-item, & option":{fontSize:no,minHeight:32}}}},children:[e("option",{disabled:true,children:e(Ut,{primary:v("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:no}})}),e(Nt,{}),t.map(R=>c("option",{onClick:()=>A(R.id),children:[e(It,{checked:M.includes(R.id),size:"small"}),e(Ut,{primary:R.label,primaryTypographyProps:{fontSize:no}})]},R.id))]})]})]}),e("div",{className:"orb-smart-filter-grid",children:e(ul,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:t.filter(R=>M.includes(R.id)).map(R=>e(ul,{size:1,children:e(Gb,{field:R,value:o[R.id]||{value:"",operator:R.type==="number"?"=":"equals"},onChange:E=>N(R.id,E)})},R.id))})})]}):null,e("div",{className:"orb-smart-filter-toggle",children:e(se,{className:"orb-smart-filter-toggle-button",size:"small",onClick:()=>k(!y),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:30,height:30,minWidth:30,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:y?e(ui,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"}):e(_o,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"})})})]})};I();var lu=({layouts:t,currentLayoutId:o,onLoad:r,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=de(),[l,d]=to.useState(null),[p,m]=to.useState(false),[h,f]=to.useState(""),[u,b]=to.useState(""),[C,g]=to.useState({isDefault:false,isPublic:false}),x=t.find(M=>M.id===o),v=M=>{d(M.currentTarget);},y=()=>{d(null);},k=M=>{r(M),y();},S=()=>{f(""),b(""),g({isDefault:false,isPublic:false}),m(true),y();},P=()=>{h.trim()&&(n({name:h,description:u,...C}),m(false));};return c("div",{className:"orb-layout-actions",sx:{display:"flex",alignItems:"center",gap:.25},children:[e(dt,{title:s("layout.layoutOptions"),children:e(se,{onClick:v,color:x?"primary":"default",size:"small",children:e(Rp,{fontSize:"small"})})}),c(Jt,{anchorEl:l,open:!!l,onClose:y,align:"end",PaperProps:{sx:{width:320,maxHeight:400}},children:[e("option",{disabled:true,children:e(L,{variant:"caption",children:s("layout.selectLayout")})}),c("option",{onClick:S,children:[e($o,{children:e(Pr,{fontSize:"small"})}),e(Ut,{children:s("layout.saveCurrentLayout")})]}),e(Nt,{}),t.length===0&&e("option",{disabled:true,children:e(L,{variant:"body2",color:"text.secondary",children:s("layout.noSavedLayouts")})}),t.map((M,w)=>e("option",{onClick:()=>k(M),selected:M.id===o,children:c("div",{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[c("div",{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[e("div",{sx:{display:"flex",alignItems:"center",gap:1},children:e(L,{variant:"body2",fontWeight:M.id===o?"bold":"normal",noWrap:true,children:M.name})}),M.description&&e(L,{variant:"caption",color:"text.secondary",noWrap:true,children:M.description})]}),c("div",{sx:{display:"flex",alignItems:"center"},onClick:N=>N.stopPropagation(),children:[e(dt,{title:M.isDefault?s("layout.removeDefault"):s("layout.setAsDefault"),children:e(se,{size:"small",onClick:N=>{N.stopPropagation(),i(M.id);},children:M.isDefault?e(Ip,{fontSize:"small",color:"warning"}):e(Tp,{fontSize:"small"})})}),e(dt,{title:s("common.delete"),children:e(se,{size:"small",color:"error",onClick:N=>{N.stopPropagation(),a(M.id);},children:e(di,{fontSize:"small"})})})]})]})},M.id||w))]}),e(Ot,{open:p,onClose:()=>m(false),maxWidth:"xs",fullWidth:true,className:"orb-layout-save-dialog",title:s("layout.saveLayout"),actions:c(jsxRuntime.Fragment,{children:[e(Te,{variant:"ghost",onClick:()=>m(false),children:s("common.cancel")}),e(Te,{onClick:P,variant:"primary",disabled:!h.trim(),children:s("common.save")})]}),children:c("div",{className:"orb-layout-save-form",children:[e(ze,{label:s("layout.layoutName"),value:h,onChange:M=>f(M.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:s("layout.layoutNameHelper")}),t.some(M=>M.name===h)&&e(L,{className:"orb-layout-save-warning",variant:"caption",color:"warning.main",children:s("layout.warningOverwrite")}),e(ze,{label:s("layout.layoutDescription"),value:u,onChange:M=>b(M.target.value),fullWidth:true,size:"small"}),e(It,{className:"orb-layout-save-option",checked:C.isDefault,onChange:M=>g({...C,isDefault:M.target.checked}),label:s("layout.useAsDefault")}),e(It,{className:"orb-layout-save-option",checked:C.isPublic,onChange:M=>g({...C,isPublic:M.target.checked}),label:s("layout.publicAllUsers")})]})})]})};I();var fn=({appId:t,tableKey:o="default",currentLayoutData:r,onLayoutLoad:n,targetLayoutId:a,activeLayoutId:i,serviceUrl:s,onError:l,onSuccess:d})=>{let{t:p}=de(),[m,h]=to.useState([]),[f,u]=to.useState(""),b=`orbcafe.layouts.${t}.${o}`,C=w=>({id:w.layoutId,name:w.name,description:w.description??"",isDefault:!!w.isDefault,isPublic:!!w.isPublic,createdAt:w.createdAt??new Date().toISOString(),layoutData:w.layout??{}}),g=w=>({appId:t,tableKey:o,layoutId:w.id,name:w.name,description:w.description??"",isDefault:!!w.isDefault,isPublic:!!w.isPublic,createdAt:w.createdAt,layout:w.layoutData}),x=to.useCallback(()=>{try{let w=localStorage.getItem(b);if(!w)return [];let N=JSON.parse(w);return Array.isArray(N)?N:[]}catch{return []}},[b]),v=to.useCallback(w=>{try{localStorage.setItem(b,JSON.stringify(w));}catch{}},[b]);to.useEffect(()=>{i!==void 0&&u(i);},[i]),to.useEffect(()=>{if(a&&m.length>0){let w=m.find(N=>N.id===a);w&&(u(w.id),n(w));}},[a,m,n]);let y=to.useCallback(async()=>{if(t){if(!s){let w=x();h(w);let N=w.find(A=>A.isDefault);N&&!f&&!a&&(u(N.id),n(N));return}try{let w=await fetch(`${s}/api/layouts?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(o)}`);if(!w.ok)throw new Error("LAYOUT_FETCH_FAILED");let A=(await w.json()).map(C);h(A);let T=A.find(R=>R.isDefault);T&&!f&&!a&&(u(T.id),n(T));}catch(w){console.error("Error fetching layouts",w);let N=x();h(N);let A=N.find(T=>T.isDefault);A&&!f&&!a&&(u(A.id),n(A)),l&&l(p("layout.toast.loadFallback"));}}},[t,o,s,l,f,n,a,x,p]);return to.useEffect(()=>{y();},[t,o]),e(lu,{layouts:m,currentLayoutId:f,onLoad:w=>{u(w.id),n(w);},onSave:async w=>{let N=m.find(R=>R.name===w.name),A=N?N.id:Date.now().toString(),T={id:A,...w,createdAt:new Date().toISOString(),layoutData:r,isDefault:w.isDefault??false,isPublic:w.isPublic??false};if(!s){let E=m.some(O=>O.id===A)?m.map(O=>O.id===A?T:O):[...m,T];h(E),v(E),u(A),n(T),d&&d(p("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g(T))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(p("layout.toast.saveSuccess")),await y(),u(A),n(T);}catch(R){console.error("Error saving layout",R);let O=m.some($=>$.id===A)?m.map($=>$.id===A?T:$):[...m,T];h(O),v(O),u(A),n(T),d&&d(p("layout.toast.saveLocalSuccess")),l&&l(p("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async w=>{if(!s){let N=m.filter(A=>A.id!==w);h(N),v(N),f===w&&u(""),d&&d(p("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts/${encodeURIComponent(w)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f===w&&u(""),d&&d(p("layout.toast.deleteSuccess")),await y();}catch(N){console.error("Error deleting layout",N);let A=m.filter(T=>T.id!==w);h(A),v(A),f===w&&u(""),d&&d(p("layout.toast.deleteLocalSuccess")),l&&l(p("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async w=>{if(!s){let N=m.map(A=>({...A,isDefault:A.id===w}));h(N),v(N),d&&d(p("layout.toast.defaultLocalSuccess"));return}try{let N=m.find(T=>T.id===w);if(!N)return;if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g({...N,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(p("layout.toast.defaultSuccess")),await y();}catch(N){console.error("Error setting default",N);let A=m.map(T=>({...T,isDefault:T.id===w}));h(A),v(A),d&&d(p("layout.toast.defaultLocalSuccess")),l&&l(p("layout.toast.backendUnavailableDefaultLocal"));}}})};var zi=(t,o)=>{if(!t||!t.filters)return null;if(Array.isArray(t.filters)){let r=t.filters.find(a=>a.scope===o);if(r)return r.filters;let n=t.filters.find(a=>a.scope==="default");return n?n.filters:null}return typeof t.filters=="object"?t.filters:null},Vi=(t,o)=>{if(!t)return {layout:null,layoutId:null};let r=null,n=null;if(Array.isArray(t.layoutRefs)){let a=t.layoutRefs.find(i=>i.tableKey===o);a&&(r=a.layoutId);}return !r&&t.layoutId&&(r=t.layoutId),t.layout&&typeof t.layout=="object"&&!Array.isArray(t.layout)&&(n=t.layout),{layoutId:r,layout:n}};function du(t,o,r){return o[r]<t[r]?-1:o[r]>t[r]?1:0}function Ub(t,o){return t==="desc"?(r,n)=>du(r,n,o):(r,n)=>-du(r,n,o)}function Kb(t,o){let r=t.map((n,a)=>[n,a]);return r.sort((n,a)=>{let i=o(n[0],a[0]);return i!==0?i:n[1]-a[1]}),r.map(n=>n[0])}var bn=t=>{let o=!!t.disableGrouping,r=!!t.disableSorting,n=to.useCallback(q=>{let Z=String(q?.label??q?.id??"").length*9+64,be=typeof q?.minWidth=="number"?q.minWidth:0;return Math.max(100,be,Z)},[]),a=to.useCallback(()=>(t.columns||[]).filter(q=>!!q?.numeric).map(q=>q.id),[t.columns]),[i,s]=to.useState(""),[l,d]=to.useState(t.order||"asc"),[p,m]=to.useState(t.orderBy||""),[h,f]=to.useState([]),[u,b]=to.useState(t.page||0),[C,g]=to.useState(t.rowsPerPage||20),[x,v]=to.useState(t.selected||[]),[y,k]=to.useState(t.columns?t.columns.map(q=>q.id):[]),[S,P]=to.useState(t.columns?t.columns.map(q=>q.id):[]),[M,w]=to.useState(t.showSummary||false),[N,A]=to.useState(()=>a()),[T,R]=to.useState([]),[E,O]=to.useState(new Set),[$,ee]=to.useState(()=>{let q={};return (t.columns||[]).forEach(V=>{q[V.id]=n(V);}),q}),[F,G]=to.useState(null),[W,Q]=to.useState(null),[z,H]=to.useState(null),[X,Y]=to.useState(null),[j,te]=to.useState(false),[ce,fe]=to.useState(""),[Ve,ve]=to.useState(""),xe=o?[]:T,He=to.useCallback(q=>{if(o){R([]),O(new Set),Q(null);return}R(q);},[o]);to.useEffect(()=>{o&&(R([]),O(new Set),Q(null));},[o]),to.useEffect(()=>{r&&(d("asc"),m(""),f([]));},[r]),to.useEffect(()=>{t.layout&&St(t.layout);},[t.layout]),to.useEffect(()=>{if(r){d("asc"),m("");return}t.order!==void 0&&d(t.order),t.orderBy!==void 0&&m(t.orderBy);},[t.order,t.orderBy,r]),to.useEffect(()=>{t.selected!==void 0&&v(t.selected);},[t.selected]),to.useEffect(()=>{t.page!==void 0&&b(t.page);},[t.page]),to.useEffect(()=>{t.rowsPerPage!==void 0&&g(t.rowsPerPage);},[t.rowsPerPage]),to.useEffect(()=>{let q=a();A(V=>V.filter(be=>q.includes(be)));},[a]),to.useEffect(()=>{ee(q=>{let V={...q};return (t.columns||[]).forEach(Z=>{V[Z.id]===void 0&&(V[Z.id]=n(Z));}),V});},[t.columns,n]),to.useEffect(()=>{P(q=>{let V=(t.columns||[]).map(qe=>qe.id),Z=new Set(V),be=q.filter(qe=>Z.has(qe)),ke=new Set(be),Ee=V.filter(qe=>!ke.has(qe)),_e=[...be,...Ee];return _e.length===q.length&&_e.every((qe,je)=>qe===q[je])?q:_e});},[t.columns]);let pe=to.useMemo(()=>{let q=t.columns||[];if(S.length===0)return q;let V=new Map(q.map(ke=>[ke.id,ke])),Z=[],be=new Set;return S.forEach(ke=>{let Ee=V.get(ke);Ee&&(Z.push(Ee),be.add(ke));}),q.forEach(ke=>{be.has(ke.id)||Z.push(ke);}),Z},[t.columns,S]),ye=to.useMemo(()=>{let q=t.rows||[];return i&&(q=q.filter(V=>Object.keys(V).some(Z=>String(V[Z]).toLowerCase().includes(i.toLowerCase())))),q},[t.rows,i]),$e=to.useMemo(()=>{if(r||t.onSortChange)return ye;if(h.length>0){let q=[...ye];return q.sort((V,Z)=>{for(let be of h){let ke=V?.[be.field],Ee=Z?.[be.field];if(!(ke==null&&Ee==null)){if(ke==null)return be.direction==="asc"?-1:1;if(Ee==null)return be.direction==="asc"?1:-1;if(ke<Ee)return be.direction==="asc"?-1:1;if(ke>Ee)return be.direction==="asc"?1:-1}}return 0}),q}return p?Kb(ye,Ub(l,p)):ye},[ye,l,p,h,t.onSortChange,r]),tt=to.useCallback(q=>{if(xe.length===0)return q.map(Ee=>({type:"row",data:Ee,id:Ee[t.rowKey||"id"]}));let V=[...q].sort((Ee,_e)=>{for(let qe of xe){if(Ee[qe]<_e[qe])return -1;if(Ee[qe]>_e[qe])return 1}return 0}),Z=(Ee,_e=0)=>{if(_e>=xe.length)return Ee;let qe=xe[_e],je={},mt=[];return Ee.forEach(ht=>{let Rt=ht[qe],yt=`${qe}:${Rt}`;je[yt]||(je[yt]={key:yt,field:qe,value:Rt,children:[],count:0,level:_e},mt.push(je[yt])),je[yt].children.push(ht),je[yt].count++;}),mt.forEach(ht=>{ht.children&&(ht.children=Z(ht.children,_e+1));}),mt},be=Z(V),ke=(Ee,_e="")=>{let qe=[];return Ee.forEach(je=>{if(je.children){let mt=_e?`${_e}>${je.key}`:je.key,ht=E.has(mt);qe.push({type:"group",id:mt,field:je.field,value:je.value,level:je.level,count:je.count,isExpanded:ht,childIds:(function Rt(yt){let B=[];return yt.children.forEach(J=>{J.children?B=B.concat(Rt(J)):B.push(J[t.rowKey||"id"]);}),B})(je)}),ht&&(qe=qe.concat(ke(je.children,mt)));}else qe.push({type:"row",data:je,id:je[t.rowKey||"id"],level:xe.length});}),qe};return ke(be)},[xe,E,t.rowKey]),at=to.useCallback(q=>{if(xe.length===0)return [];let V=[...q].sort((ke,Ee)=>{for(let _e of xe){if(ke[_e]<Ee[_e])return -1;if(ke[_e]>Ee[_e])return 1}return 0}),Z=[],be=(ke,Ee,_e)=>{if(Ee>=xe.length)return;let qe=xe[Ee],je=new Map;ke.forEach(mt=>{let ht=mt[qe],Rt=je.get(ht);Rt?Rt.push(mt):je.set(ht,[mt]);}),je.forEach((mt,ht)=>{let Rt=`${qe}:${ht}`,yt=_e?`${_e}>${Rt}`:Rt;Z.push(yt),be(mt,Ee+1,yt);});};return be(V,0,""),Z},[xe]),st=to.useMemo(()=>tt($e),[$e,tt]),K=to.useMemo(()=>at($e),[$e,at]),Ne=to.useMemo(()=>{let q=(t.rows||[]).length;return typeof t.count=="number"&&t.count>q},[t.count,t.rows]),Se=to.useMemo(()=>Ne?st:C>0?st.slice(u*C,u*C+C):st,[st,u,C,Ne]),Fe=to.useMemo(()=>Ne&&typeof t.count=="number"?t.count:st.length,[st.length,Ne,t.count]),it=q=>{O(V=>{let Z=new Set(V);return Z.has(q)?Z.delete(q):Z.add(q),Z});},Ye=q=>{let V=K.filter(Z=>Z===q||Z.startsWith(`${q}>`));O(Z=>{let be=new Set(Z);return V.forEach(ke=>be.add(ke)),be});},wt=q=>{O(V=>{let Z=new Set(V);return Array.from(Z).forEach(be=>{(be===q||be.startsWith(`${q}>`))&&Z.delete(be);}),Z});},Mt=q=>{if(!q){O(new Set);return}O(new Set(K));},Ft=q=>{let V=K.filter(Z=>Z.startsWith(`${q}>`));return V.length===0?E.has(q):E.has(q)&&V.every(Z=>E.has(Z))},Et=q=>{if(r)return;h.length>0&&f([]);let V=p===q&&l==="asc",Z=p===q&&l==="desc";if(t.onSortChange){V?t.onSortChange(q,"desc"):Z?t.onSortChange("","asc"):t.onSortChange(q,"asc");return}V?(d("desc"),m(q)):Z?(d("asc"),m("")):(d("asc"),m(q));},ne=q=>{if(r){d("asc"),m(""),f([]);return}let V=q.filter(Z=>Z&&Z.field);f(V),V.length>0&&m("");},Ke=()=>{f([]);},Oe=(q,V)=>{ee(Z=>({...Z,[q]:V}));},ue=q=>{if(q.target.checked){let V=ye.map(Z=>Z[t.rowKey||"id"]);v(V),t.onSelectionChange&&t.onSelectionChange(V);return}v([]),t.onSelectionChange&&t.onSelectionChange([]);},we=(q,V)=>{let Z=V[t.rowKey||"id"],be=x.indexOf(Z),ke=[];be===-1?ke=ke.concat(x,Z):be===0?ke=ke.concat(x.slice(1)):be===x.length-1?ke=ke.concat(x.slice(0,-1)):be>0&&(ke=ke.concat(x.slice(0,be),x.slice(be+1))),v(ke),t.onSelectionChange&&t.onSelectionChange(ke);},re=q=>{b(q),t.onPageChange&&t.onPageChange(q);},Ce=q=>{g(q),b(0),t.onPageChange&&t.onPageChange(0),t.onRowsPerPageChange&&t.onRowsPerPageChange(q);},De=q=>{let V=y.indexOf(q),Z=[...y];V===-1?Z.push(q):Z.splice(V,1),k(Z);},Je=q=>{if(o)return;let V=xe.indexOf(q),Z=[...xe];V===-1?Z.push(q):Z.splice(V,1),He(Z);},lt=q=>{a().includes(q)&&A(Z=>Z.includes(q)?Z.filter(be=>be!==q):[...Z,q]);},ut=(q,V)=>{!q||!V||q===V||P(Z=>{let be=Z.indexOf(q),ke=Z.indexOf(V);if(be===-1||ke===-1)return Z;let Ee=[...Z];return Ee.splice(be,1),Ee.splice(ke,0,q),Ee});},Ht=q=>{let V=q?.active?.id,Z=q?.over?.id;typeof V=="string"&&typeof Z=="string"&&ut(V,Z);},Yt=q=>{t.onLayoutSave&&t.onLayoutSave({visibleColumns:y,columnOrder:S,order:r?"asc":l,orderBy:r?"":p,sortBy:r?[]:h,grouping:xe,columnWidths:$,showSummary:M,summaryColumns:N});},Wt=q=>{let{layout:V,layoutId:Z}=Vi(q,t.tableKey||"default");Z?(ve(Z),fe(Z)):(ve(""),fe("")),V&&(V.visibleColumns&&k(V.visibleColumns),Array.isArray(V.columnOrder)&&P(V.columnOrder),r?(d("asc"),m(""),f([])):(V.order&&d(V.order),V.orderBy&&m(V.orderBy),Array.isArray(V.sortBy)&&f(V.sortBy)),V.grouping&&He(V.grouping),V.columnWidths&&ee(V.columnWidths),V.showSummary!==void 0&&w(!!V.showSummary),Array.isArray(V.summaryColumns)&&A(V.summaryColumns));},St=q=>{let V=q?.layoutData||q?.layout||q||{};V.visibleColumns&&k(V.visibleColumns),Array.isArray(V.columnOrder)&&P(V.columnOrder),r?(d("asc"),m(""),f([])):(V.order&&d(V.order),V.orderBy!==void 0&&m(V.orderBy),Array.isArray(V.sortBy)&&f(V.sortBy)),V.grouping&&He(V.grouping),V.columnWidths&&ee(V.columnWidths),V.showSummary!==void 0&&w(!!V.showSummary),Array.isArray(V.summaryColumns)&&A(V.summaryColumns),O(new Set),b(0),q?.id&&fe(q.id),ve("");};to.useEffect(()=>{t.layout&&Wt({layout:t.layout});},[t.layout]);let $t=q=>{q.preventDefault(),Y(X===null?{mouseX:q.clientX+2,mouseY:q.clientY-6}:null);},bt=()=>{Y(null);},At=to.useMemo(()=>{if(!M)return {};let q={};t.columns.forEach(Z=>{if(Z.numeric&&N.includes(Z.id)){let be=ye.reduce((ke,Ee)=>{let _e=parseFloat(Ee[Z.id]);return ke+(isNaN(_e)?0:_e)},0);q[Z.id]=be.toFixed(2);}else q[Z.id]="";});let V=t.columns.find(Z=>y.includes(Z.id)&&!Z.numeric);return V&&!V.numeric&&(q[V.id]="Total"),q},[ye,t.columns,M,N,y]),ct=()=>{if(!t.columns||!ye)return;let q=t.columns.map(Ee=>Ee.label).join(","),V=ye.map(Ee=>t.columns.map(_e=>{let qe=Ee[_e.id];return `"${(qe==null?"":String(qe)).replace(/"/g,'""')}"`}).join(",")).join(`
184
+ `),Z=`data:text/csv;charset=utf-8,${q}
185
+ ${V}`,be=encodeURI(Z),ke=document.createElement("a");ke.setAttribute("href",be),ke.setAttribute("download",`${t.title||"export"}.csv`),document.body.appendChild(ke),ke.click(),document.body.removeChild(ke);},Bt=()=>{te(true);},jt=()=>{te(false);};return {isMobile:false,columns:pe,order:l,setOrder:d,orderBy:p,setOrderBy:m,sortBy:h,setSortBy:f,applyMultiSort:ne,clearMultiSort:Ke,columnOrder:S,setColumnOrder:P,filterText:i,setFilterText:s,visibleColumns:y,setVisibleColumns:k,showSummary:M,setShowSummary:w,summaryColumns:N,grouping:xe,setGrouping:He,expandedGroups:E,setExpandedGroups:O,groupAnchorEl:W,setGroupAnchorEl:Q,summaryAnchorEl:z,setSummaryAnchorEl:H,columnWidths:$,setColumnWidths:ee,anchorEl:F,setAnchorEl:G,contextMenu:X,setContextMenu:Y,sensors:void 0,sortedAndFilteredRows:$e,visibleRows:Se,summaryRow:At,page:u,setPage:re,rowsPerPage:C,setRowsPerPage:Ce,totalDisplayCount:Fe,selected:x,setSelected:v,isAllExpanded:K.length>0&&K.every(q=>E.has(q)),handleColumnResize:Oe,handleRequestSort:Et,handleSelectAllClick:ue,handleClick:we,toggleSummaryColumn:lt,handleDragEnd:Ht,handleColumnReorder:ut,handleExport:ct,handleContextMenu:$t,handleCloseContextMenu:bt,toggleColumnVisibility:De,toggleGroupExpand:it,toggleGroupField:Je,handleToggleAll:Mt,handleExpandGroupRecursively:Ye,handleCollapseGroupRecursively:wt,isGroupFullyExpanded:Ft,handleLayoutLoad:St,handleVariantLoad:Wt,handleLayoutSave:Yt,effectiveAppId:t.appId||"",currentLayoutData:{visibleColumns:y,order:r?"asc":l,orderBy:r?"":p,sortBy:r?[]:h,columnOrder:S,grouping:xe,columnWidths:$,showSummary:M,summaryColumns:N},currentLayoutId:ce,layoutIdToLoad:Ve,onPageChange:re,onRowsPerPageChange:Ce,graphReportOpen:j,handleOpenGraphReport:Bt,handleCloseGraphReport:jt}};I();var qN=t=>e("tbody",{...t}),XN=({align:t,...o})=>e("td",{align:t==="inherit"?void 0:t,...o}),ZN=t=>e("div",{...t}),YN=t=>e("thead",{...t}),jN=t=>e("tr",{...t}),or=t=>{let{t:o}=de(),r="0.85rem",{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:p,fitContainer:m=false,fullWidth:h=false,maxHeight:f,loading:u=false,rowsPerPageOptions:b=[20,50,100,-1],onLayoutSave:C,filterConfig:g,rowKey:x,tableKey:v="default",graphReport:y,quickCreate:k,quickEdit:S,quickDelete:P,serviceUrl:M,disableGrouping:w=false,disableSorting:N=false}=t,A=n||o("table.title.default"),{isMobile:T,columns:R,order:E,orderBy:O,filterText:$,setFilterText:ee,visibleColumns:F,showSummary:G,setShowSummary:W,summaryColumns:Q,grouping:z,setGrouping:H,expandedGroups:X,groupAnchorEl:Y,setGroupAnchorEl:j,summaryAnchorEl:te,setSummaryAnchorEl:ce,columnWidths:fe,anchorEl:Ve,setAnchorEl:ve,contextMenu:xe,sensors:He,sortedAndFilteredRows:pe,summaryRow:ye,visibleRows:$e,isAllExpanded:tt,page:at,setPage:st,rowsPerPage:K,setRowsPerPage:Ne,totalDisplayCount:Se,setSelected:Fe,handleColumnResize:it,handleRequestSort:Ye,handleSelectAllClick:wt,handleClick:Mt,toggleSummaryColumn:Ft,handleDragEnd:Et,handleExport:ne,handleContextMenu:Ke,handleCloseContextMenu:Oe,toggleColumnVisibility:ue,toggleGroupExpand:we,handleToggleAll:re,handleExpandGroupRecursively:Ce,handleCollapseGroupRecursively:De,isGroupFullyExpanded:Je,handleLayoutLoad:lt,handleVariantLoad:ut,handleLayoutSave:Ht,effectiveAppId:Yt,currentLayoutData:Wt,currentLayoutId:St,layoutIdToLoad:$t,graphReportOpen:bt,handleOpenGraphReport:At,handleCloseGraphReport:ct}=bn(t),Bt=y?.enabled??false,jt=Bt&&(y?.interaction?.enabled??true),q=Li(),V=!!k?.enabled,Z=!!S?.enabled,be=!!P?.enabled,ke=k?.fields,Ee=k?.excludeFields||[],_e=k?.initialValues||{},[qe,je]=to__namespace.default.useState(false),[mt,ht]=to__namespace.default.useState(false),[Rt,yt]=to__namespace.default.useState({}),[B,J]=to__namespace.default.useState(false),[he,Ie]=to__namespace.default.useState(false),[et,Xe]=to__namespace.default.useState({}),[kt,ft]=to__namespace.default.useState(false),[gt,Ct]=to__namespace.default.useState(false),ao=u||mt||he||gt,Lt=to__namespace.default.useMemo(()=>{let ae=[...R];if(Array.isArray(ke)&&ke.length>0){let ge=new Set(ke);ae=ae.filter(oe=>ge.has(oe.id));}if(Ee.length>0){let ge=new Set(Ee);ae=ae.filter(oe=>!ge.has(oe.id));}return ae.filter(ge=>!!ge?.id)},[R,Ee,ke]),Qt=x||"id",zt=to__namespace.default.useMemo(()=>{let ae=new Set(s);return pe.filter(ge=>ae.has(ge?.[Qt]))},[s,pe,Qt]),qt=zt.length===1?zt[0]:null,_t=S?.fields,ro=S?.excludeFields||[],io=S?.editableFields||[],vo=S?.nonEditableFields||[],Ro=S?.primaryKeys?.length?S.primaryKeys:[Qt],No=to__namespace.default.useMemo(()=>{let ae=[...R];if(Array.isArray(_t)&&_t.length>0){let ge=new Set(_t);ae=ae.filter(oe=>ge.has(oe.id));}if(ro.length>0){let ge=new Set(ro);ae=ae.filter(oe=>!ge.has(oe.id));}return ae.filter(ge=>!!ge?.id)},[R,ro,_t]),ir=to__namespace.default.useMemo(()=>new Set(Ro),[Ro]),wo=to__namespace.default.useMemo(()=>new Set(io),[io]),Ho=to__namespace.default.useMemo(()=>new Set(vo),[vo]),qr=to__namespace.default.useCallback(ae=>wo.size>0?wo.has(ae):!(Ho.has(ae)||ir.has(ae)),[wo,Ho,ir]);to__namespace.default.useEffect(()=>{!bt&&q.hasActiveFilters&&q.clearAll();},[bt,q.hasActiveFilters,q.clearAll]);let Xr=()=>{let ae={};Lt.forEach(ge=>{ae[ge.id]=_e[ge.id]??"";}),yt(ae),je(true);},Lr=()=>{mt||je(false);},Zr=(ae,ge)=>{yt(oe=>({...oe,[ae]:ge}));},Yr=async()=>{if(!k?.onSubmit){je(false);return}try{ht(!0),await k.onSubmit(Rt),je(!1);}finally{ht(false);}},Do=()=>{if(!qt)return;let ae={};No.forEach(oe=>{ae[oe.id]=qt[oe.id]??"";});let ge=S?.getInitialValues?{...ae,...S.getInitialValues(qt)}:ae;Xe(ge),J(true);},Or=()=>{he||J(false);},jr=(ae,ge)=>{Xe(oe=>({...oe,[ae]:ge}));},Yo=async()=>{if(qt){if(!S?.onSubmit){J(false);return}try{Ie(!0),await S.onSubmit(et,qt),J(!1);}finally{Ie(false);}}},sr=()=>{zt.length!==0&&ft(true);},Fn=()=>{gt||ft(false);},Fr=async()=>{if(zt.length===0){ft(false);return}if(!P?.onConfirm){ft(false),Fe([]),l?.([]);return}try{Ct(!0),await P.onConfirm(zt),ft(!1),Fe([]),l?.([]);}finally{Ct(false);}},D=pe,{fieldMapping:_}=mn({rows:D,config:{...y,title:y?.title||`${A} ${o("graph.reportTitle")}`}}),U=to__namespace.default.useMemo(()=>jt?q.applyRows(D,_):D,[jt,q.applyRows,D,_]),{model:me}=mn({rows:U,config:{...y,title:y?.title||`${A} ${o("graph.reportTitle")}`,fieldMapping:_}}),Be=me.table.columns.map(ae=>({id:ae.id,label:ae.label,align:ae.align||"left",minWidth:120,numeric:ae.align==="right"})),nt=Yt?e(fn,{appId:Yt,tableKey:v,currentLayoutData:Wt,onLayoutLoad:lt,targetLayoutId:$t,activeLayoutId:St,serviceUrl:M??g?.serviceUrl}):null,Ge=c(jsxRuntime.Fragment,{children:[!w&&e(pn,{groupAnchorEl:Y,setGroupAnchorEl:j,grouping:z,setGrouping:H,columns:R}),e(un,{anchorEl:Ve,setAnchorEl:ve,columns:R,visibleColumns:F,toggleColumnVisibility:ue}),e(Ti,{anchorEl:te,setAnchorEl:ce,showSummary:G,setShowSummary:W,columns:R,summaryColumns:Q,toggleSummaryColumn:Ft}),e(Ii,{contextMenu:xe,handleCloseContextMenu:Oe,columns:R,visibleColumns:F,toggleColumnVisibility:ue})]});return T?c("div",{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[g&&e(Go,{fields:g.fields,filters:g.filters,onFilterChange:g.onFilterChange,onSearch:g.onSearch,variants:g.variants||[],currentVariantId:g.currentVariantId,onVariantLoad:g.onVariantLoad,onVariantSave:g.onVariantSave,onVariantDelete:g.onVariantDelete,onVariantSetDefault:g.onVariantSetDefault,appId:g.appId,tableKey:v,currentLayout:[{tableKey:v,layoutData:Wt}],variantService:g.variantService,serviceUrl:M??g.serviceUrl}),e(Hp,{title:A,loading:u,showSummary:G,setShowSummary:W,setAnchorEl:ve,setSummaryAnchorEl:ce,filterText:$,setFilterText:ee,sortedAndFilteredRows:pe,selected:s,columns:R,visibleColumns:F,summaryRow:ye,handleClick:Mt,selectionMode:i}),Ge]}):c("div",{sx:{width:h?"100%":"auto",mb:m?0:2,...m?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g&&e("div",{sx:{mb:2},children:e(Go,{fields:g.fields,filters:g.filters,onFilterChange:g.onFilterChange,onSearch:g.onSearch,variants:g.variants||[],currentVariantId:g.currentVariantId,onVariantLoad:ae=>{ut(ae),g.onVariantLoad&&g.onVariantLoad(ae);},onVariantSave:g.onVariantSave,onVariantDelete:g.onVariantDelete,onVariantSetDefault:g.onVariantSetDefault,loading:u,appId:g.appId,tableKey:v,currentLayout:[{tableKey:v,layoutData:Wt}],currentLayoutId:St,layoutRefs:[{tableKey:v,layoutId:St}],variantService:g.variantService,serviceUrl:M??g.serviceUrl})}),c(Ae,{className:"orb-ctable-surface",sx:{width:h?"100%":"auto",mb:m?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":ao?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, color-mix(in oklch, var(--orb-primary) 0%, transparent) 0%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 25%, var(--orb-primary) 50%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 75%, color-mix(in oklch, var(--orb-primary) 0%, transparent) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...f?{height:f}:m?{flex:1,minHeight:0,height:"100%"}:{}},children:[a&&e(wi,{filterText:$,setFilterText:ee,onRowsPerPageChange:Ne,rowsPerPage:K,rowsPerPageOptions:b,page:at,count:Se,onPageChange:st,actions:d,extraTools:p,grouping:z,disableGrouping:w,groupAnchorEl:Y,setGroupAnchorEl:j,showSummary:G,setShowSummary:W,anchorEl:Ve,setAnchorEl:ve,summaryAnchorEl:te,setSummaryAnchorEl:ce,handleExport:ne,showCreateButton:V,onOpenCreateDialog:Xr,showEditButton:Z,onOpenEditDialog:Do,editDisabled:zt.length!==1,showDeleteButton:be,onOpenDeleteConfirm:sr,deleteDisabled:zt.length===0,onLayoutSave:C||g?.variantService&&g?.appId?Ht:void 0,loading:u,layoutManager:nt,onOpenGraphReport:Bt?At:void 0}),e("div",{sx:{flex:1,...f?{maxHeight:f,height:f}:m?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:e(core.DndContext,{sensors:He,collisionDetection:core.closestCenter,onDragEnd:Et,modifiers:[modifiers.restrictToHorizontalAxis],children:c("table",{className:"orb-tbl orb-ctable",style:{minWidth:h?750:void 0,width:h?"100%":"auto",tableLayout:Object.keys(fe).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,fontSize:r},"aria-labelledby":"tableTitle",children:[e(ki,{columns:R,visibleColumns:F,order:E,orderBy:O,onRequestSort:Ye,disableSorting:N,onContextMenu:Ke,selectionMode:i,grouping:z,isAllExpanded:tt,handleToggleAll:re,rowCount:pe.length,numSelected:s.length,onSelectAllClick:wt,columnWidths:fe,onColumnResize:it}),e(Pi,{visibleRows:$e,columns:R,visibleColumns:F,selectionMode:i,selected:s,orderBy:O,loading:u,expandedGroups:X,toggleGroupExpand:we,handleExpandGroupRecursively:Ce,handleCollapseGroupRecursively:De,isGroupFullyExpanded:Je,handleClick:Mt,onSelectionChange:l,grouping:z,rowKeyProp:x,page:at,rowsPerPage:K}),G&&e(Bp,{showSummary:G,columns:R,visibleColumns:F,summaryRow:ye,selectionMode:i?.toString(),grouping:z,columnWidths:fe,orderBy:O,zIndex:3})]})})})]}),V&&c(Ot,{open:qe,onClose:Lr,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:ae=>`1px solid ${ae.palette.divider}`,bgcolor:"background.paper"}}},children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:k?.title||o("quickCreate.createWithTitle",{title:A})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Lt.map(ae=>{let ge=ae.type==="number"||ae.numeric?"number":ae.type==="date"?"date":"text",oe=ae.label||ae.id;return e(ze,{label:oe,value:Rt[ae.id]??"",onChange:Le=>Zr(ae.id,Le.target.value),type:ge,size:"small",fullWidth:true,InputLabelProps:{shrink:ge==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${ae.id}`)}),k?.description&&e(er,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:k.description})]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(Te,{onClick:Lr,sx:{fontSize:"0.85rem"},disabled:mt,children:k?.cancelLabel||o("common.cancel")}),e(Te,{onClick:Yr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:mt,children:k?.submitLabel||o("common.save")})]})]}),Z&&c(Ot,{open:B,onClose:Or,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:ae=>`1px solid ${ae.palette.divider}`,bgcolor:"background.paper"}}},children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:S?.title||o("quickEdit.editWithTitle",{title:A})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[No.map(ae=>{let ge=ae.type==="number"||ae.numeric?"number":ae.type==="date"?"date":"text",oe=ae.label||ae.id,Le=qr(ae.id);return e(ze,{label:oe,value:et[ae.id]??"",onChange:Qe=>jr(ae.id,Qe.target.value),type:ge,size:"small",fullWidth:true,disabled:!Le,InputLabelProps:{shrink:ge==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${ae.id}`)}),S?.description&&e(er,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:S.description})]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(Te,{onClick:Or,sx:{fontSize:"0.85rem"},disabled:he,children:S?.cancelLabel||o("common.cancel")}),e(Te,{onClick:Yo,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:he||!qt,children:S?.submitLabel||o("common.save")})]})]}),be&&e(ea,{open:kt,type:"warning",title:P?.title||o("quickDelete.confirmTitle"),message:P?.message||(zt.length>1?o("quickDelete.confirmMessageMultiple",{count:zt.length}):o("quickDelete.confirmMessageSingle")),confirmText:P?.confirmText||o("common.delete"),cancelText:P?.cancelText||o("common.cancel"),onClose:Fn,onConfirm:Fr}),Ge,Bt&&e(Ai,{open:bt,onClose:ct,model:me,aiAssistant:y?.aiAssistant,interaction:jt?{enabled:true,filters:q.filters,fieldMapping:_,onPrimaryDimensionClick:ae=>q.setFilter("primaryDimension",ae),onSecondaryDimensionClick:ae=>q.setFilter("secondaryDimension",ae),onStatusClick:ae=>q.setFilter("status",ae),onClearFilter:q.clearFilter,onClearAll:q.clearAll}:void 0,tableContent:e(or,{appId:Yt||"graph-report-internal",title:o("graph.dataBody"),columns:Be,rows:me.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},QN=or;I();var aD=({id:t,title:o,hideHeader:r=true,filterConfig:n,tableProps:a,children:i,spacing:s=1,mode:l="separated"})=>{let d=n?{...n,appId:n.appId||t}:void 0,p={...a,appId:a.appId||t};return c(yi,{title:o,hideHeader:r,children:[c(le,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l==="separated"&&d&&e("div",{sx:{flexShrink:0},children:e(Go,{...d})}),e("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:e(or,{...p,fitContainer:true,filterConfig:l==="integrated"?d:void 0})})]}),i]})};var pD=({metadata:t,fetchData:o,initialRowsPerPage:r=20,rowsPerPageOptions:n=[20,50,100,-1],tableKey:a="default",mode:i="integrated",serviceUrl:s,variantService:l})=>{let{t:d}=de(),[p,m]=to.useState(false),[h,f]=to.useState([]),[u,b]=to.useState({}),[C,g]=to.useState(t.variants||[]),[x,v]=to.useState(t.layout||null),[y,k]=to.useState(""),[S,P]=to.useState(0),[M,w]=to.useState(0),[N,A]=to.useState(r),[T,R]=to.useState([]),[E,O]=to.useState("asc"),[$,ee]=to.useState("");to.useEffect(()=>{let te={};t.filters.forEach(ce=>{ce.defaultValue!==void 0&&(te[ce.id]=ce.defaultValue);}),b(te);},[t.filters]);let F=to.useCallback(async(te,ce,fe,Ve,ve)=>{m(true);try{let xe={...te,page:ce+1,limit:fe,sort:ve,order:Ve},He;o?He=await o(xe):typeof t.api=="function"?He=await t.api(xe):t.api&&typeof t.api=="object"?(console.log("Fetching from URL:",t.api.url,xe),He={rows:[],total:0}):(console.warn("No API configured for report"),He={rows:[],total:0}),He&&(f(He.rows||[]),P(He.total||0));}catch(xe){console.error("Failed to fetch report data",xe);}finally{m(false);}},[t.api,o]);to.useEffect(()=>{F(u,M,N,E,$);},[F,M,N,E,$]);let G=()=>{w(0),F(u,0,N,E,$);},W=te=>{w(0),A(te);},Q=(te,ce)=>{O(ce),ee(te);},z=te=>{b(te);},H=te=>{k(te?.id||"");let ce=zi(te,a);if(ce){let Ve=ce.values??ce;b(Ve),F(Ve,0,N,E,$),w(0);}let{layout:fe}=Vi(te,a);fe&&v(fe);},X=te=>{let ce={...te,id:Date.now().toString(),createdAt:new Date().toISOString()};g(fe=>[...fe,ce]);},Y=te=>{v(te);};return {pageProps:{id:t.id,title:t.title,mode:i,filterConfig:{appId:t.id,tableKey:a,fields:t.filters,filters:u,onFilterChange:z,onSearch:G,onVariantLoad:H,onVariantSave:X,onVariantDelete:te=>g(ce=>ce.filter(fe=>fe.id!==te)),onVariantSetDefault:te=>{g(ce=>ce.map(fe=>({...fe,isDefault:fe.id===te})));},variants:C,currentVariantId:y,variantService:l,serviceUrl:s},tableProps:{appId:t.id,tableKey:a,columns:t.columns,rows:h,loading:p,rowKey:"id",count:S,page:M,rowsPerPage:N,rowsPerPageOptions:n,onPageChange:w,onRowsPerPageChange:W,selectionMode:"multiple",selected:T,onSelectionChange:R,onLayoutSave:Y,layout:x,title:t.title,showSummary:true,order:E,orderBy:$,serviceUrl:s,onSortChange:Q,graphReport:t.graphReport||{enabled:true,title:`${t.title} ${d("graph.reportTitle")}`}}},filters:u,rows:h,loading:p,refresh:G}};I();var Jb=new Set(["id","title","description","icon","iconNode","meta"]),ev=t=>t.replace(/([A-Z])/g," $1").replace(/[._-]+/g," ").replace(/^\w/,o=>o.toUpperCase()).trim(),tv=t=>Object.entries(t).filter(([o,r])=>!Jb.has(o)&&r!==null&&r!==void 0&&["string","number","boolean"].includes(typeof r)).map(([o,r])=>({key:o,label:ev(o),value:String(r)})),uu=({item:t,open:o,onClose:r,onDownloadClick:n,renderContent:a,downloadTooltip:i,closeTooltip:s})=>{let{t:l}=de(),p=fo()==="dark"?"var(--orb-p300)":"var(--orb-primary)";to__namespace.default.useEffect(()=>{if(!o)return;let h=f=>{f.key==="Escape"&&r();};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[o,r]);let m=tv(t);return typeof document>"u"?null:reactDom.createPortal(c(jsxRuntime.Fragment,{children:[e("div",{"aria-hidden":"true",onClick:r,sx:{position:"fixed",inset:0,zIndex:1299,backgroundColor:"rgba(1, 9, 26, 0.4)",opacity:o?1:0,pointerEvents:o?"auto":"none",transition:"opacity 200ms ease"}}),c("div",{role:"dialog","aria-modal":"true","aria-label":t.title,sx:{position:"fixed",top:"50%",left:"50%",zIndex:1300,width:"min(520px, 92vw)",maxHeight:"82vh",display:"flex",flexDirection:"column",bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3,boxShadow:"0 24px 64px rgba(1, 9, 26, 0.3)",transform:o?"translate(-50%, -50%) scale(1)":"translate(-50%, -47%) scale(0.96)",opacity:o?1:0,transition:"transform 200ms ease, opacity 180ms ease"},children:[c(le,{direction:"row",spacing:1.5,alignItems:"center",sx:{p:2.5,pb:2,borderBottom:"1px solid",borderColor:"divider",flexShrink:0},children:[e("div",{sx:{width:56,height:56,flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:t.iconNode??e(Tt,{name:t.icon??"product",size:30,style:{color:p}})}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{component:"div",sx:{fontWeight:700,fontSize:"1.1rem",lineHeight:1.3,wordBreak:"break-word"},children:t.title}),t.meta?e(L,{component:"div",sx:{fontSize:"0.8rem",color:"text.secondary"},children:t.meta}):null]}),e(se,{tooltip:s??l("cardPage.close"),"aria-label":s??l("cardPage.close"),onClick:r,children:e(Tt,{name:"decline",size:18})})]}),e("div",{sx:{flex:1,minHeight:0,overflowY:"auto",p:2.5},children:a?a(t):c(jsxRuntime.Fragment,{children:[t.description?e(L,{component:"div",sx:{fontSize:"0.9rem",lineHeight:1.6,color:"text.primary"},children:t.description}):null,m.length>0?e("div",{sx:{mt:t.description?2.5:0,display:"grid",gap:1.5},children:m.map(h=>c("div",{children:[e(L,{component:"div",sx:{fontSize:"0.72rem",fontWeight:600,color:"text.secondary",textTransform:"uppercase",letterSpacing:"0.04em"},children:h.label}),e(L,{component:"div",sx:{fontSize:"0.88rem",color:"text.primary",wordBreak:"break-word"},children:h.value})]},h.key))}):null]})}),n?e("div",{sx:{p:2.5,pt:2,borderTop:"1px solid",borderColor:"divider",flexShrink:0},children:e(Te,{variant:"contained",sx:{width:"100%"},startIcon:e(Tt,{name:"download",size:16}),onClick:()=>n(t),children:i??l("cardPage.download")})}):null]})]}),document.body)};I();var ov={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",overflow:"hidden"},rv=({item:t,onDetailClick:o,onDownloadClick:r,detailTooltip:n,downloadTooltip:a})=>{let{t:i}=de(),l=fo()==="dark"?"var(--orb-p300)":"var(--orb-primary)",d=t.iconNode??e(Tt,{name:t.icon??"product",size:26,style:{color:l}});return c(Ae,{elevation:0,sx:{p:2,height:"100%",display:"flex",flexDirection:"column",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",boxShadow:"0 8px 20px rgba(15, 23, 42, 0.06)",transition:"transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease","&:hover":{transform:"translateY(-2px)",borderColor:"primary.main",boxShadow:"0 14px 32px rgba(15, 23, 42, 0.12)"}},children:[c(le,{direction:"row",spacing:1.5,alignItems:"center",children:[e("div",{sx:{width:48,height:48,flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:d}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{component:"div",noWrap:true,sx:{fontWeight:700,fontSize:"0.98rem",lineHeight:1.3},children:t.title}),t.meta?e(L,{component:"div",noWrap:true,sx:{fontSize:"0.75rem",color:"text.secondary"},children:t.meta}):null]})]}),e("div",{sx:{mt:1.5,flex:1,minHeight:0},children:e(L,{component:"div",sx:{fontSize:"0.84rem",lineHeight:1.45,color:"text.primary",...ov},children:t.description||"\xA0"})}),c(le,{direction:"row",spacing:.5,justifyContent:"flex-end",sx:{mt:1.5},children:[e(se,{tooltip:n??i("cardPage.viewDetails"),"aria-label":n??i("cardPage.viewDetails"),onClick:()=>o?.(t),children:e(Tt,{name:"show",size:18})}),e(se,{tooltip:a??i("cardPage.download"),"aria-label":a??i("cardPage.download"),onClick:()=>r?.(t),children:e(Tt,{name:"download",size:18})})]})]})},gu=({items:t,loading:o=false,onDetailClick:r,onDownloadClick:n,minCardWidth:a=260,detailTooltip:i,downloadTooltip:s,emptyText:l,detailPanel:d=true,renderDetailContent:p})=>{let{t:m}=de(),[h,f]=to__namespace.default.useState(null),[u,b]=to__namespace.default.useState(false),C=x=>{r?.(x),d&&(f(x),requestAnimationFrame(()=>requestAnimationFrame(()=>b(true))));},g=()=>{b(false),setTimeout(()=>f(null),260);};return o?e("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:e(jo,{})}):t.length?c(jsxRuntime.Fragment,{children:[e("div",{sx:{flex:1,minHeight:0,overflowY:"auto",display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${a}px, 1fr))`,gap:2,alignContent:"start",p:.5},children:t.map(x=>e(rv,{item:x,onDetailClick:C,onDownloadClick:n,detailTooltip:i,downloadTooltip:s},x.id))}),d&&h?e(uu,{item:h,open:u,onClose:g,onDownloadClick:n,renderContent:p,downloadTooltip:s}):null]}):e("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:e(L,{sx:{color:"text.secondary"},children:l??m("cardPage.empty")})})};I();var ED=({id:t,title:o,hideHeader:r=true,filterConfig:n,gridProps:a,children:i,spacing:s=1})=>{let l=n?{...n,appId:n.appId||t}:void 0;return c(yi,{title:o,hideHeader:r,children:[c(le,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l&&e("div",{sx:{flexShrink:0},children:e(Go,{...l})}),e("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:e(gu,{...a})})]}),i]})};var HD=({metadata:t,fetchData:o,tableKey:r="default",variantService:n,serviceUrl:a,onDetailClick:i,onDownloadClick:s,minCardWidth:l})=>{let[d,p]=to.useState(false),[m,h]=to.useState([]),[f,u]=to.useState(0),[b,C]=to.useState({}),[g,x]=to.useState(t.variants||[]),[v,y]=to.useState("");to.useEffect(()=>{let A={};t.filters.forEach(T=>{T.defaultValue!==void 0&&(A[T.id]=T.defaultValue);}),C(A);},[t.filters]);let k=to.useCallback(async A=>{p(true);try{let T=o?await o({...A}):{rows:[],total:0};h(T?.rows||[]),u(T?.total||0);}catch(T){console.error("Failed to fetch card page data",T);}finally{p(false);}},[o]);to.useEffect(()=>{k(b);},[k]);let S=()=>{k(b);},P=A=>{C(A);},M=A=>{y(A?.id||"");let T=zi(A,r);if(T){let R=T.values??T;C(R),k(R);}},w=A=>{let T={...A,id:Date.now().toString(),createdAt:new Date().toISOString()};x(R=>[...R,T]);};return {pageProps:{id:t.id,title:t.title,filterConfig:{appId:t.id,tableKey:r,fields:t.filters,filters:b,onFilterChange:P,onSearch:S,onVariantLoad:M,onVariantSave:w,onVariantDelete:A=>x(T=>T.filter(R=>R.id!==A)),onVariantSetDefault:A=>{x(T=>T.map(R=>({...R,isDefault:R.id===A})));},variants:g,currentVariantId:v,variantService:n,serviceUrl:a},gridProps:{items:m,loading:d,onDetailClick:i,onDownloadClick:s,minCardWidth:l}},items:m,total:f,filters:b,loading:d,refresh:S}};var av=t=>[...t].sort((o,r)=>r.value-o.value),WD=({bars:t=[],lines:o=[],combos:r=[],heatmap:n=[],pies:a=[],waterfalls:i=[]})=>{let s=to.useMemo(()=>av(t),[t]),l=to.useMemo(()=>[...o],[o]),d=to.useMemo(()=>[...r],[r]),p=to.useMemo(()=>[...n],[n]),m=to.useMemo(()=>{let f=a.reduce((u,b)=>u+b.value,0);return a.map(u=>({...u,percent:f>0?u.value/f*100:u.percent}))},[a]),h=to.useMemo(()=>[...i],[i]);return {bars:s,lines:l,combos:d,heatmap:p,pies:m,waterfalls:h}};var KD=({apiKey:t,query:o,zoom:r=14,mapType:n="roadmap"})=>to.useMemo(()=>!t||!o?"":ia({apiKey:t,query:o,zoom:r,mapType:n}),[t,o,r,n]),qD=({keyword:t,location:o})=>to.useMemo(()=>Ni({keyword:t,location:o?{lng:o.lng,lat:o.lat,name:o.name}:void 0}),[t,o]);I();var pa=({code:t,language:o="text",copyable:r=true,showLineNumbers:n=false,wrapLongLines:a=false,maxHeight:i})=>{let[s,l]=to.useState(false),d=to.useMemo(()=>t.replace(/\n$/,"").split(`
186
+ `),[t]);return c("div",{style:{border:"1px solid var(--orb-border)",borderRadius:12,overflow:"hidden",background:"var(--orb-canvas)"},children:[c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4.8px 8px",background:"var(--orb-hover)",borderBottom:"1px solid var(--orb-border)"},children:[e("span",{style:{fontSize:12,fontWeight:500,textTransform:"uppercase",letterSpacing:.5,color:"var(--orb-muted)",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:o}),r&&e(se,{size:"small",tooltip:s?"Copied":"Copy",onClick:async()=>{try{await navigator.clipboard.writeText(t),l(!0),window.setTimeout(()=>l(!1),1400);}catch{l(false);}},children:s?e(So,{size:14,strokeWidth:1.8}):e(Eo,{size:14,strokeWidth:1.8})})]}),e("pre",{style:{margin:0,padding:10,fontSize:"0.82rem",lineHeight:1.55,overflow:"auto",maxHeight:i,background:"var(--orb-surface)",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:n?d.map((m,h)=>c("div",{style:{display:"flex"},children:[e("span",{style:{width:34,flexShrink:0,textAlign:"right",paddingRight:8,color:"var(--orb-disabled-fg)",userSelect:"none"},children:h+1}),e("span",{style:{whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:m})]},`${h}-${m}`)):e("code",{style:{display:"block",whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:t})})]})};I();var pv=t=>{let o=t.trim();return o.startsWith("$$")&&o.endsWith("$$")&&o.length>=4&&(o=o.slice(2,-2).trim()),o.startsWith("$")&&o.endsWith("$")&&o.length>=2&&(o=o.slice(1,-1).trim()),o},uv=async t=>new Function("m","return import(m)")(t),ua=({expression:t,inline:o=false,allowKatex:r=false})=>{let n=to.useMemo(()=>pv(t),[t]),[a,i]=to.useState("");return to.useEffect(()=>{let s=true;return (async()=>{if(!r||!n){i("");return}try{let d=await uv("katex"),m=(d?.default||d)?.renderToString?.(n,{displayMode:!o,throwOnError:!1,strict:"warn"});s&&typeof m=="string"&&i(m);}catch{s&&i("");}})(),()=>{s=false;}},[r,n,o]),n?a?e(Me,{component:o?"span":"div",sx:{display:o?"inline-flex":"block",my:o?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:a}}):o?e(Me,{component:"code",sx:{px:.4,py:.05,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:n}):e(Me,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:e(Co,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",fontSize:"0.9rem",lineHeight:1.5,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:n})}):null};I();var hv=async t=>new Function("m","return import(m)")(t),Sl=({code:t,title:o="Mermaid Diagram",height:r=320,enabled:n=true})=>{let[a,i]=to.useState(""),[s,l]=to.useState(""),[d,p]=to.useState(false),m=to.useMemo(()=>t.trim(),[t]);return to.useEffect(()=>{let h=true;return (async()=>{if(!n||!m){i(""),l("");return}p(true),l(""),i("");try{let u=await hv("mermaid"),b=u?.default||u;if(!b||typeof b.render!="function")throw new Error("Mermaid runtime is not available");b.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let C=await b.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,m),g=typeof C=="string"?C:C?.svg;h&&typeof g=="string"&&i(g);}catch(u){if(h){let b=u instanceof Error?u.message:"Failed to render Mermaid diagram";l(b);}}finally{h&&p(false);}})(),()=>{h=false;}},[n,m]),c(Br,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[e(Me,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:e(Co,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:o})}),c(Me,{sx:{p:1},children:[d&&e(Me,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:e(Fd,{size:20})}),!d&&a&&e(Me,{sx:{maxHeight:r,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:a}}),!d&&!a&&c(Me,{children:[s&&e(er,{severity:"info",sx:{mb:1},children:s}),e(pa,{code:m,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};I();var kl=t=>t.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(r=>r.trim()),bv=t=>/^:?-{3,}:?$/.test(t.trim()),vv=t=>{let o=t.trim(),r=o.startsWith(":"),n=o.endsWith(":");return r&&n?"center":n?"right":"left"},Wi=t=>{let o=t.split(`
187
+ `).map(s=>s.trim()).filter(Boolean);if(o.length<2)return null;let r=kl(o[0]),n=kl(o[1]);if(r.length===0||n.length!==r.length||!n.every(bv))return null;let a=n.map(vv),i=o.slice(2).filter(s=>s.includes("|")).map(s=>{let l=kl(s);return l.length<r.length?[...l,...Array.from({length:r.length-l.length},()=>"")]:l.slice(0,r.length)});return {headers:r,aligns:a,rows:i}},Pl=({markdown:t,table:o,maxHeight:r=360})=>{let n=to.useMemo(()=>o||(t?Wi(t):null),[o,t]);return !n||n.headers.length===0?e(Br,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:e(Co,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):e(Br,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:e(Vd,{sx:{maxHeight:r},children:c(Hd,{size:"small",stickyHeader:true,children:[e(Wd,{children:e(pl,{children:n.headers.map((a,i)=>e(dl,{align:n.aligns[i],sx:{fontWeight:700,bgcolor:"background.paper"},children:a},`${a}-${i}`))})}),e(zd,{children:n.rows.map((a,i)=>e(pl,{hover:true,children:a.map((s,l)=>e(dl,{align:n.aligns[l],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s||e(Me,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${i}-${l}`))},`row-${i}`))})]})})})};I();var $i=({content:t,title:o="Thinking",defaultExpanded:r=false,isStreaming:n=false})=>{let[a,i]=to.useState(r);return c(Me,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[c(Ed,{direction:"row",alignItems:"center",spacing:.6,children:[e(Ld,{size:"small",onClick:()=>i(s=>!s),sx:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:e(an,{fontSize:"inherit"})}),c(Co,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[o,n?" ...":""]})]}),e(nn,{in:a,children:e(Co,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:t})})]})};I();var Tl=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,_i=t=>t.trim().startsWith("```"),vu=t=>/^#{1,6}\s+/.test(t.trim()),Il=t=>/^[-*+]\s+/.test(t.trim()),Ml=t=>/^\d+\.\s+/.test(t.trim()),yu=t=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(t.trim()),Rl=t=>t.trim().startsWith(">"),Cu=(t,o)=>{if(o+1>=t.length)return false;let r=t[o],n=t[o+1];return !r.includes("|")||!n.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(n.trim())},xu=t=>t.trim().startsWith("<think>")||t.trim()===":::think",ma=(t,o,r)=>{let n=[],a=0,i=0;Tl.lastIndex=0;let s=Tl.exec(t);for(;s;){s.index>a&&n.push(t.slice(a,s.index));let l=s[0],d=`${r}-${i}`;if(l.startsWith("**")&&l.endsWith("**"))n.push(e("strong",{children:l.slice(2,-2)},d));else if(l.startsWith("*")&&l.endsWith("*"))n.push(e("em",{children:l.slice(1,-1)},d));else if(l.startsWith("`")&&l.endsWith("`"))n.push(e(Me,{component:"code",sx:{px:.45,py:.08,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:l.slice(1,-1)},d));else if(l.startsWith("[")&&l.includes("](")&&l.endsWith(")")){let p=l.match(/^\[([^\]]+)\]\(([^)]+)\)$/);p?n.push(e(Ad,{href:p[2],target:"_blank",rel:"noreferrer",children:p[1]},d)):n.push(l);}else l.startsWith("$")&&l.endsWith("$")&&o.enableMath?n.push(e(ua,{expression:l,inline:true,allowKatex:true},d)):n.push(l);a=s.index+l.length,i+=1,s=Tl.exec(t);}return a<t.length&&n.push(t.slice(a)),n.length>0?n:[t]},ga=({markdown:t,content:o,className:r,enableMath:n=true,enableMermaid:a=true,enableThinkBlock:i=true,codeCopyable:s=true,codeLineNumbers:l=false})=>{let d=t??o??"",p=to.useMemo(()=>{let m=[],h=d.replace(/\r\n/g,`
188
188
  `).split(`
189
- `),b={enableMath:n},m=0;for(;m<f.length;){let v=f[m],y=v.trim();if(!y){m+=1;continue}if(i&&cu(v)){if(y.startsWith("<think>")){let h=[],C=v;for(;;){let k=C.indexOf("<think>"),w=k>=0?C.slice(k+7):C,T=w.indexOf("</think>");if(T>=0){h.push(w.slice(0,T)),m+=1;break}if(h.push(w),m+=1,m>=f.length)break;C=f[m];}p.push(e(Oi,{content:h.join(`
190
- `).trim()},`think-tag-${m}`));continue}m+=1;let x=[];for(;m<f.length&&f[m].trim()!==":::";)x.push(f[m]),m+=1;m<f.length&&f[m].trim()===":::"&&(m+=1),p.push(e(Oi,{content:x.join(`
191
- `).trim()},`think-fence-${m}`));continue}if(Fi(v)){let x=y.slice(3).trim().toLowerCase(),h=[];for(m+=1;m<f.length&&!Fi(f[m]);)h.push(f[m]),m+=1;m<f.length&&Fi(f[m])&&(m+=1);let C=h.join(`
192
- `);if(a&&x==="mermaid"){p.push(e(dl,{code:C},`mermaid-${m}`));continue}if(n&&["math","latex","katex"].includes(x)){p.push(e(ca,{expression:C,allowKatex:true},`math-fence-${m}`));continue}p.push(e(la,{code:C,language:x||"text",copyable:s,showLineNumbers:l,wrapLongLines:true},`code-${m}`));continue}if(n&&y.startsWith("$$")){let x=[];if(y.endsWith("$$")&&y!=="$$")x.push(y.slice(2,-2)),m+=1;else {let C=v.slice(v.indexOf("$$")+2);for(C.trim()&&x.push(C),m+=1;m<f.length;){let k=f[m],w=k.indexOf("$$");if(w>=0){x.push(k.slice(0,w)),m+=1;break}x.push(k),m+=1;}}p.push(e(ca,{expression:x.join(`
193
- `).trim(),allowKatex:true},`math-${m}`));continue}if(iu(v)){let x=Math.min(6,v.match(/^#{1,6}/)?.[0]?.length||1),h=v.replace(/^#{1,6}\s+/,""),C=x===1?"h5":x===2?"h6":"subtitle1";p.push(e(hr,{variant:C,sx:{mt:x===1?1.2:.8,mb:.5,fontWeight:700},children:da(h,b,`h-${m}`)},`heading-${m}`)),m+=1;continue}if(su(v)){p.push(e(xd,{sx:{my:1.2}},`hr-${m}`)),m+=1;continue}if(lu(f,m)){let x=m+2;for(;x<f.length&&f[x].trim()&&f[x].includes("|");)x+=1;let h=f.slice(m,x).join(`
194
- `),C=Li(h);if(C){p.push(e(ul,{table:C},`table-${m}`)),m=x;continue}}if(bl(v)){let x=[];for(;m<f.length&&bl(f[m]);)x.push(f[m].replace(/^\s*>\s?/,"")),m+=1;p.push(e(Bo,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:e(hr,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:x.map((h,C)=>c(er.Fragment,{children:[C>0&&e("br",{}),da(h,b,`q-${m}-${C}`)]},`quote-line-${C}`))})},`quote-${m}`));continue}if(gl(v)){let x=[];for(;m<f.length&&gl(f[m]);)x.push(f[m].trim().replace(/^[-*+]\s+/,"")),m+=1;p.push(e(Ie,{component:"ul",sx:{my:.8,pl:2.5},children:x.map((h,C)=>e(Ie,{component:"li",sx:{mb:.45},children:e(hr,{variant:"body2",children:da(h,b,`ul-${m}-${C}`)})},`ul-item-${C}`))},`ul-${m}`));continue}if(fl(v)){let x=[];for(;m<f.length&&fl(f[m]);)x.push(f[m].trim().replace(/^\d+\.\s+/,"")),m+=1;p.push(e(Ie,{component:"ol",sx:{my:.8,pl:2.7},children:x.map((h,C)=>e(Ie,{component:"li",sx:{mb:.45},children:e(hr,{variant:"body2",children:da(h,b,`ol-${m}-${C}`)})},`ol-item-${C}`))},`ol-${m}`));continue}let g=[];for(;m<f.length;){let x=f[m],h=x.trim();if(!h||Fi(x)||iu(x)||su(x)||gl(x)||fl(x)||bl(x)||lu(f,m)||i&&cu(x)||n&&h.startsWith("$$"))break;g.push(x),m+=1;}g.length>0?p.push(e(hr,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:g.map((x,h)=>c(er.Fragment,{children:[h>0&&e("br",{}),da(x,b,`p-${m}-${h}`)]},`p-line-${h}`))},`p-${m}`)):m+=1;}return p},[d,n,a,i,s,l]);return e(Ie,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:u})};P();var ZN=(t,r)=>e(pa,{markdown:t,...r});P();var du=({value:t,onChange:r,onSubmit:o,onVoiceInput:n,onClear:a,placeholder:i,statusText:s,loading:l=false,compact:d=false,showStatusText:u=true})=>c(ie,{spacing:.75,children:[c("div",{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:d?.25:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minHeight:d?38:44},children:[e(zo,{sx:{fontSize:d?16:18,color:"text.secondary"}}),e(Md,{fullWidth:true,value:t,onChange:p=>r(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),o());},placeholder:i,sx:{fontSize:d?"0.84rem":"0.9rem"}}),t&&a&&e(ae,{size:"small",onClick:a,children:e(wo,{sx:{fontSize:d?16:18}})}),n&&e(ae,{size:"small",onClick:n,children:e(np,{sx:{fontSize:d?16:18}})}),e(ae,{size:"small",onClick:o,disabled:l||!t.trim(),children:e(cp,{sx:{fontSize:d?16:18}})})]}),u&&s&&e(L,{variant:"caption",color:"text.secondary",children:s})]});P();var pu=(t,r)=>{let o=r.trim();if(!o)return t;let n=t.toLowerCase(),a=o.toLowerCase(),i=n.indexOf(a);return i<0?t:c(jsxRuntime.Fragment,{children:[t.slice(0,i),e("div",{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:t.slice(i,i+o.length)}),t.slice(i+o.length)]})},Bi=({section:t,highlightQuery:r=""})=>{let o=t.columns||2;return c(Ae,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[e(L,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:t.title}),e("div",{sx:{display:"grid",gap:1.15,gridTemplateColumns:{xs:"1fr",md:o===3?"repeat(3, minmax(0, 1fr))":o===1?"1fr":"repeat(2, minmax(0, 1fr))"}},children:t.fields.map(n=>{let a=typeof n.value=="string"||typeof n.value=="number"?String(n.value):null;return c("div",{sx:{minWidth:0},children:[e(L,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:pu(n.label,r)}),e(L,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?pu(a,r):n.value})]},n.id)})})]})};var hl=t=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",zi=t=>t.trim().toLowerCase(),av=(t,r)=>{let o=[];return t.forEach(n=>{n.fields.forEach(a=>{let i=a.searchableText||hl(a.value),s={source:"section",sourceId:n.id,sourceSectionId:n.id,sourceTitle:n.title,fieldId:a.id,fieldLabel:a.label,fieldValue:i};o.push({hit:s,text:zi(`${n.title} ${a.label} ${i}`)});});}),r.forEach(n=>{(n.fields||[]).forEach(a=>{let i=a.searchableText||hl(a.value),s={source:"tab",sourceId:n.id,sourceTitle:n.label,fieldId:a.id,fieldLabel:a.label,fieldValue:i};o.push({hit:s,text:zi(`${n.label} ${a.label} ${i}`)});}),(n.sections||[]).forEach(a=>{a.fields.forEach(i=>{let s=i.searchableText||hl(i.value),l={source:"tab",sourceId:n.id,sourceSectionId:a.id,sourceTitle:`${n.label} / ${a.title}`,fieldId:i.id,fieldLabel:i.label,fieldValue:s};o.push({hit:l,text:zi(`${n.label} ${a.title} ${i.label} ${s}`)});});});}),o},uu=({sections:t,tabs:r=[],defaultTabId:o,ai:n})=>{let{t:a}=pe(),[i,s]=er.useState(""),[l,d]=er.useState(o||r[0]?.id),[u,p]=er.useState("idle"),[f,b]=er.useState([]),[m,v]=er.useState(""),[y,g]=er.useState(""),[x,h]=er.useState(false),C=er.useMemo(()=>av(t,r),[t,r]);er.useEffect(()=>{if(r.length===0){d(void 0);return}r.some(A=>A.id===l)||d(o||r[0]?.id);},[r,l,o]);let k=er.useCallback(()=>{p("idle"),b([]),v(""),g("");},[]),w=er.useCallback(S=>{s(S),S.trim()||(p("idle"),b([]),v(""),g(""));},[]),T=er.useCallback(S=>{let A=zi(S);return A?C.filter(R=>R.text.includes(A)).map(R=>R.hit):[]},[C]),I=er.useCallback(async()=>{let S=i.trim();if(!S)return;h(true);let A=T(S);if(b(A),A.length>0){p("search"),g(""),v(a("detail.searchAi.matches",{count:A.length})),h(false);return}if(n?.enabled!==false&&n?.onSubmit){p("ai"),v(a("detail.searchAi.autoAiFallback"));try{let M=await n.onSubmit(S,{query:S,hits:A,activeTabId:l,sections:t,tabs:r});g(typeof M=="string"?M:"");}finally{h(false);}return}p("search"),g(""),v(a("detail.searchAi.noMatch")),h(false);},[i,T,a,n,l,t,r]);return {query:i,setQuery:w,activeTabId:l,setActiveTabId:d,searchMode:u,hits:f,statusText:m,aiResponse:y,searching:x,handleSubmit:I,clearResult:k}};P();var kA=({title:t,subtitle:r,sections:o,tabs:n=[],defaultTabId:a,table:i,ai:s,rightHeaderSlot:l,searchBarWidth:d=460,onClose:u,closeLabel:p="Close"})=>{let{t:f}=pe(),{query:b,setQuery:m,activeTabId:v,setActiveTabId:y,searchMode:g,hits:x,statusText:h,aiResponse:C,searching:k,handleSubmit:w,clearResult:T}=uu({sections:o,tabs:n,defaultTabId:a,ai:s}),I=er.useMemo(()=>n.find(R=>R.id===v)||n[0],[n,v]),S=er.useCallback(R=>{let M=N=>{let E=document.getElementById(R);if(E){E.scrollIntoView({behavior:"smooth",block:"center"});return}N<4&&setTimeout(()=>M(N+1),60);};requestAnimationFrame(()=>M(0));},[]),A=er.useCallback((R,M)=>{if(n.some(N=>N.id===R)){y(R),S(M?`detail-tab-${R}-section-${M}`:`detail-tab-${R}`);return}S(`detail-section-${R}`);},[n,y,S]);return c("div",{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[c(ie,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[c("div",{sx:{minWidth:0},children:[e(L,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:t}),r&&e(L,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:r})]}),c(ie,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[e("div",{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:e(du,{value:b,onChange:m,onSubmit:w,onVoiceInput:s?.onVoiceInput,onClear:()=>{m(""),T();},placeholder:s?.placeholder||f("detail.searchAi.placeholder"),statusText:h,loading:k,compact:true,showStatusText:false})}),u&&e(ct,{title:p,children:e(ae,{size:"small",onClick:u,children:e(qd,{fontSize:"small"})})}),l]})]}),h&&e(L,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:h}),g==="search"&&x.length>0&&c(Ae,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[e(L,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:f("detail.searchAi.matches",{count:x.length})}),e(ie,{spacing:.35,children:x.slice(0,8).map(R=>e("div",{component:"button",type:"button",onClick:()=>A(R.sourceId,R.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:c(L,{variant:"body2",sx:{fontSize:"0.84rem"},children:[e("div",{component:"span",sx:{color:"text.secondary"},children:R.sourceTitle})," \xB7 ",e("div",{component:"span",sx:{fontWeight:700},children:R.fieldLabel})," = ",e("div",{component:"span",children:R.fieldValue||"-"})]})},`${R.source}|${R.sourceId}|${R.fieldId}`))})]}),g==="ai"&&C&&c(Ae,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[e(L,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:f("detail.searchAi.aiResultTitle")}),e("div",{sx:{fontSize:"0.9rem",lineHeight:1.6,"& p":{m:0,mb:.8},"& h1, & h2, & h3, & h4":{mt:1.2,mb:.6,lineHeight:1.3},"& ul, & ol":{mt:.4,mb:.8,pl:2.6},"& code":{px:.5,py:.1,borderRadius:.8,bgcolor:"action.hover",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},"& pre":{m:0,mt:.8,mb:.8,p:1.1,borderRadius:1.2,bgcolor:"action.hover",overflowX:"auto"},"& pre code":{p:0,bgcolor:"transparent"}},children:e(pa,{markdown:C})})]}),e("div",{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(R=>e("div",{id:`detail-section-${R.id}`,children:e(Bi,{section:R,highlightQuery:b})},R.id))}),n.length>0&&c(Ae,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[e(Ed,{value:I?.id||false,onChange:(R,M)=>y(String(M)),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:n.map(R=>e(Ld,{value:R.id,label:R.label,sx:{textTransform:"none"}},R.id))}),c("div",{sx:{p:1.5},children:[e("div",{id:`detail-tab-${I?.id||""}`}),I?.description&&e(L,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:I.description}),I?.content?I.content:c(ie,{spacing:1.5,children:[(I?.sections||[]).map(R=>e("div",{id:`detail-tab-${I?.id}-section-${R.id}`,children:e(Bi,{section:R,highlightQuery:b})},R.id)),I?.fields&&I.fields.length>0&&e(Bi,{section:{id:`${I.id}-fields`,title:I.label,fields:I.fields,columns:2},highlightQuery:b})]})]})]}),i&&e(Jr,{title:i.title||f("detail.table.title"),...i.tableProps,filterConfig:void 0,fitContainer:false})]})};P();var fu=({bucket:t,cardCount:r,highlighted:o=false,children:n,emptyLabel:a,height:i,maxHeight:s,onRename:l,renameLabel:d,sx:u})=>{let{t:p}=pe(),[f,b]=er.useState(false),[m,v]=er.useState(t.title),y=()=>{v(t.title),b(false);},g=x=>{x.preventDefault();let h=m.trim();h&&(h!==t.title&&l?.(h),v(h),b(false));};return e(Ae,{elevation:0,sx:[x=>{let h=t.accentColor??x.palette.primary.main;return {position:"relative",display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:i??s??560,maxHeight:s,borderRadius:"var(--orb-r-container)",overflow:"hidden",border:o?`1px solid ${rt(h,.65)}`:"1px solid var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:o?`0 0 0 2px ${rt(h,.16)}, var(--orb-shadow-2)`:"none",transition:"border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease","&::before":{content:'""',display:"block",flexShrink:0,height:3,bgcolor:h}}},...Array.isArray(u)?u:u?[u]:[]],children:c(ie,{spacing:1.25,sx:{flex:1,minHeight:0,overflow:"hidden",p:1.5},children:[c(Ie,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1.25},children:[e(Ie,{sx:{minWidth:0,flex:1},children:c(Ie,{sx:{display:"flex",alignItems:"center",gap:.75,minHeight:28},children:[t.icon&&e(Ie,{sx:{display:"inline-flex",flexShrink:0,color:t.accentColor??"var(--orb-primary)"},children:t.icon}),f?c(Ie,{component:"form",onSubmit:g,sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[e(ze,{dense:true,autoFocus:true,value:m,onChange:x=>v(x.target.value),onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),y());},inputProps:{"aria-label":d??p("kanban.bucket.rename")},error:!m.trim(),sx:{flex:1,minWidth:0}}),e(ae,{type:"submit",size:"small",tooltip:p("kanban.bucket.saveRename"),"aria-label":p("kanban.bucket.saveRename"),disabled:!m.trim(),children:e(qr,{size:14})}),e(ae,{size:"small",tooltip:p("kanban.bucket.cancelRename"),"aria-label":p("kanban.bucket.cancelRename"),onClick:y,children:e(jt,{size:14})})]}):e(L,{component:"div",sx:{fontSize:15,fontWeight:600,lineHeight:1.35,color:"text.primary"},children:t.title})]})}),!f&&c(ie,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[e(xt,{size:"small",label:r,sx:{minWidth:24,justifyContent:"center",fontWeight:600}}),typeof t.limit=="number"&&e(xt,{size:"small",label:`${p("kanban.bucket.limit")} ${t.limit}`,color:r>t.limit?"warning":"default",variant:"outlined"}),l&&e(ae,{size:"small",tooltip:d??p("kanban.bucket.rename"),"aria-label":d??p("kanban.bucket.rename"),onClick:()=>{v(t.title),b(true);},sx:{width:26,height:26},children:e(Ac,{size:14})})]})]}),o&&e(L,{component:"div",sx:{fontSize:12,color:t.accentColor??"var(--orb-primary)",fontWeight:500},children:p("kanban.bucket.dropHere")}),e(Ie,{sx:{flex:1,height:0,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",pr:.4,scrollbarGutter:"stable"},children:r>0?n:e(Ie,{sx:{minHeight:"100%",borderRadius:"var(--orb-r-container)",border:"1px dashed var(--orb-border)",bgcolor:"transparent",display:"grid",placeItems:"center",px:2,textAlign:"center"},children:e(L,{sx:{fontSize:13,color:"text.secondary"},children:a??t.emptyLabel??p("kanban.empty")})})})]})})};P();var sv={success:"success",warning:"warning",info:"info",error:"error"},lv={critical:"error",high:"warning",medium:"info",low:"success"},cv={default:"var(--orb-primary)",success:"var(--orb-primary)",warning:"var(--orb-accent)",info:"var(--orb-primary)",error:"var(--orb-err)"},dv=(t,r)=>{switch(t){case "critical":return r("kanban.priority.critical");case "high":return r("kanban.priority.high");case "medium":return r("kanban.priority.medium");case "low":return r("kanban.priority.low");default:return t}},pv=t=>t?t.split(/\s+/).map(r=>r.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",vl=({card:t,bucket:r,dragging:o=false,overlay:n=false,onClick:a,sx:i})=>{let{t:s}=pe(),l=!!(a&&r),d=t.tone??(t.priority?lv[t.priority]:"default"),u=d==="default"?"primary":sv[d],p=cv[d],f=r?{card:t,bucket:r}:void 0;return e(Ae,{onClick:l?()=>f&&a?.(f):void 0,onKeyDown:l?b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),f&&a?.(f));}:void 0,role:l?"button":void 0,tabIndex:l?0:void 0,sx:[{position:"relative",minWidth:0,overflow:"hidden",p:1.5,pl:1.75,borderRadius:"var(--orb-r-container)",border:`1px solid ${rt(p,.24)}`,bgcolor:"var(--orb-canvas)",boxShadow:n?"var(--orb-shadow-3)":o?"none":"var(--orb-shadow-1)",transform:n?"rotate(1deg) scale(1.01)":"none",transition:"transform var(--orb-t-fast), box-shadow var(--orb-t-fast), border-color var(--orb-t-fast)",cursor:l?"pointer":"default",opacity:o?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:3,bgcolor:p},"&:hover":l?{transform:"translateY(-1px)",borderColor:rt(p,.48),boxShadow:"var(--orb-shadow-2)"}:void 0,"&:focus-visible":l?{outline:"2px solid var(--orb-focus-solid)",outlineOffset:2}:void 0},...Array.isArray(i)?i:i?[i]:[]],elevation:0,children:c(ie,{spacing:1.25,children:[c(Ie,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[c(Ie,{sx:{minWidth:0,flex:1},children:[(t.kicker||r?.title)&&e(L,{component:"div",sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:t.kicker??r?.title}),e(L,{component:"div",sx:{mt:.25,fontSize:14,fontWeight:600,lineHeight:1.4,color:"text.primary"},children:t.title})]}),t.priority&&e(xt,{size:"small",color:u,label:dv(t.priority,s),variant:d==="default"?"outlined":"filled",sx:{height:22,flexShrink:0,fontWeight:500}})]}),t.summary&&e(L,{component:"div",sx:{fontSize:13,fontWeight:300,color:"text.secondary",lineHeight:1.5},children:t.summary}),t.metrics&&t.metrics.length>0&&e(Ie,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(t.metrics.length,3)}, minmax(0, 1fr))`,gap:.75},children:t.metrics.slice(0,3).map(b=>c(Ie,{sx:{minWidth:0,borderRadius:"var(--orb-r)",px:1,py:.75,bgcolor:"var(--orb-surface)",border:"1px solid var(--orb-border)"},children:[e(L,{component:"div",noWrap:true,sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:b.label}),e(L,{component:"div",noWrap:true,numeric:true,sx:{mt:.25,fontSize:13,fontWeight:600},children:b.value})]},b.id))}),typeof t.progress=="number"&&c(Ie,{children:[c(Ie,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[e(L,{sx:{fontSize:12,color:"text.secondary"},children:s("kanban.card.progress")}),c(L,{numeric:true,sx:{fontSize:12,fontWeight:600},children:[Math.round(t.progress),"%"]})]}),e(wd,{variant:"determinate",value:Math.max(0,Math.min(100,t.progress)),color:p,sx:{height:4,borderRadius:2}})]}),(t.tags?.length||t.assignee||t.dueDate||t.footer||l)&&c(ie,{spacing:.9,children:[t.tags&&t.tags.length>0&&e(Ie,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:t.tags.map(b=>e(xt,{size:"small",label:b.label,color:b.color??"default",variant:"outlined"},b.id))}),c(Ie,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flexWrap:"wrap"},children:[c(Ie,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[t.assignee&&c(jsxRuntime.Fragment,{children:[e(Qa,{src:t.assignee.avatarSrc,sx:{width:28,height:28,fontSize:11},children:t.assignee.initials??pv(t.assignee.name)}),c(Ie,{sx:{minWidth:0},children:[e(L,{component:"div",sx:{fontSize:13,fontWeight:500,lineHeight:1.3},noWrap:true,children:t.assignee.name}),t.dueDate&&e(L,{component:"div",sx:{fontSize:11,color:"text.secondary",lineHeight:1.35},noWrap:true,children:t.dueDate})]})]}),!t.assignee&&t.dueDate&&e(L,{sx:{fontSize:12,color:"text.secondary"},children:t.dueDate})]}),l&&e(L,{sx:{fontSize:12,color:"var(--orb-link)",fontWeight:500,whiteSpace:"nowrap"},children:s("kanban.card.openDetail")})]}),t.footer]})]})})};var bu=(t,r)=>{let o=r.title.trim();return !r.id||!o||t.buckets.some(n=>n.id===r.id)?t:{buckets:[...t.buckets,{...r,title:o,cards:[]}]}},hu=(t,r,o)=>{let n=o.trim();if(!n)return t;let a=t.buckets.find(i=>i.id===r);return !a||a.title===n?t:{buckets:t.buckets.map(i=>i.id===r?{...i,title:n}:i)}},uv=(t,r)=>Number.isNaN(t)||t<0?0:t>r?r:t,vu=({buckets:t,cards:r})=>{let o=new Map;return r.forEach((n,a)=>{let i=o.get(n.bucketId)??[];i.push({card:n,sourceIndex:a}),o.set(n.bucketId,i);}),{buckets:t.map(n=>{let a=[...o.get(n.id)??[]].sort((i,s)=>i.card.position===void 0&&s.card.position===void 0?i.sourceIndex-s.sourceIndex:i.card.position===void 0?1:s.card.position===void 0?-1:i.card.position-s.card.position||i.sourceIndex-s.sourceIndex).map(({card:i},s)=>({...i,bucketId:n.id,position:s}));return {...n,cards:a}})}},_r=(t,r)=>{for(let o=0;o<t.buckets.length;o+=1){let n=t.buckets[o],a=n.cards.findIndex(i=>i.id===r);if(a>=0)return {card:n.cards[a],bucket:n,bucketIndex:o,cardIndex:a}}},Vi=(t,r)=>{let o=_r(t,r.cardId);if(!o)return t;let n=t.buckets.findIndex(u=>u.id===r.toBucketId);if(n<0)return t;let a=t.buckets.map(u=>({...u,cards:u.cards.map(p=>({...p}))})),i=a[o.bucketIndex],[s]=i.cards.splice(o.cardIndex,1);if(!s)return t;let l=a[n],d=uv(r.targetIndex??l.cards.length,l.cards.length);return l.cards.splice(d,0,{...s,bucketId:r.toBucketId}),{buckets:a.map(u=>({...u,cards:u.cards.map((p,f)=>({...p,bucketId:u.id,position:f}))}))}};P();var xl="kanban-card|",Sl="kanban-bucket|",xu=t=>`${xl}${t}`,wv=t=>`${Sl}${t}`,Wi=t=>t?.startsWith(xl)?t.slice(xl.length):void 0,Cu=t=>t?.startsWith(Sl)?t.slice(Sl.length):void 0,kv=({card:t,bucket:r,onCardClick:o})=>{let{setNodeRef:n,attributes:a,listeners:i,transform:s,transition:l,isDragging:d}=sortable.useSortable({id:xu(t.id)}),u={transform:s?`translate3d(${s.x}px, ${s.y}px, 0)`:void 0,transition:l,zIndex:d?2:1,touchAction:"none",cursor:d?"grabbing":"grab"};return e("div",{ref:n,style:u,...a,...i,children:e(vl,{card:t,bucket:r,dragging:d,onClick:o})})},Pv=({bucket:t,highlighted:r,bucketHeight:o,emptyBucketLabel:n,onBucketRename:a,onCardClick:i})=>{let{isOver:s,setNodeRef:l}=core.useDroppable({id:wv(t.id)});return e(Ie,{ref:l,sx:{minWidth:0,minHeight:0,height:o},children:e(fu,{bucket:t,cardCount:t.cards.length,highlighted:r||s,emptyLabel:n,height:o,onRename:a,children:e(sortable.SortableContext,{items:t.cards.map(d=>xu(d.id)),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:1,children:t.cards.map(d=>e(kv,{card:d,bucket:t,onCardClick:i},d.id))})})})})},Su=t=>String(t??"").toLocaleLowerCase(),Tv=(t,r)=>[t.id,t.title,t.summary,t.kicker,t.priority,t.tone,t.progress,t.dueDate,t.assignee?.id,t.assignee?.name,...t.tags?.flatMap(n=>[n.id,n.label])??[],...t.metrics?.flatMap(n=>[n.label,n.value])??[]].some(n=>Su(n).includes(r)),QA=({model:t,onCardMove:r,onCardClick:o,cardFilter:n,onBucketAdd:a,onBucketRename:i,addBucketLabel:s,minBucketWidth:l=320,bucketHeight:d,bucketMaxHeight:u,searchable:p=false,searchValue:f,defaultSearchValue:b="",onSearchValueChange:m,searchPlaceholder:v,emptyBucketLabel:y,sx:g})=>{let{t:x}=pe(),[h,C]=er.useState(null),[k,w]=er.useState(),[T,I]=er.useState(b),S=f??T,A=S.trim().toLocaleLowerCase(),R=d??u??560,M=er.useMemo(()=>({buckets:t.buckets.map(V=>{let z=n?V.cards.filter(q=>n(q,V)):V.cards;if(!A)return {...V,cards:z};let K=[V.id,V.title,V.description].some(q=>Su(q).includes(A));return {...V,cards:K?z:z.filter(q=>Tv(q,A))}})}),[n,t,A]),N=er.useMemo(()=>M.buckets.reduce((V,z)=>V+z.cards.length,0),[M]),E=er.useCallback(V=>{f===void 0&&I(V),m?.(V);},[m,f]),O=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),F=er.useMemo(()=>h?_r(t,h):void 0,[h,t]),_=er.useCallback(()=>{C(null),w(void 0);},[]),B=er.useCallback(V=>{if(!V)return;let z=Wi(V);return z?_r(t,z)?.bucket.id:Cu(V)},[t]),Y=er.useCallback(V=>{C(Wi(String(V.active.id))??null);},[]),W=er.useCallback(V=>{w(B(V.over?String(V.over.id):void 0));},[B]),j=er.useCallback(V=>{let z=Wi(String(V.active.id)),K=V.over?String(V.over.id):void 0;if(!z||!K){_();return}let q=_r(t,z);if(!q){_();return}let fe=q.bucket.id,se=q.cardIndex,ue=Wi(K);if(ue){let ke=_r(t,ue);if(!ke){_();return}fe=ke.bucket.id,se=ke.cardIndex;}else {let ke=Cu(K),le=t.buckets.find(Ee=>Ee.id===ke);if(!ke||!le){_();return}fe=ke,se=le.cards.length;}if(q.bucket.id===fe&&q.cardIndex===se){_();return}let Se=Vi(t,{cardId:z,fromBucketId:q.bucket.id,toBucketId:fe,targetIndex:se}),$e=_r(Se,z);$e&&!($e.bucket.id===q.bucket.id&&$e.cardIndex===q.cardIndex)&&r?.({cardId:z,fromBucketId:q.bucket.id,toBucketId:$e.bucket.id,targetIndex:$e.cardIndex,card:$e.card,model:Se}),_();},[t,r,_]);return c(core.DndContext,{sensors:O,collisionDetection:core.closestCorners,onDragStart:Y,onDragOver:W,onDragEnd:j,onDragCancel:_,children:[c(Ie,{sx:{display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:"100%",overflow:"hidden"},children:[(p||a)&&c(Ie,{role:p?"search":void 0,sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1.5,mb:1.25,minWidth:0},children:[p&&e(Ie,{sx:{width:"100%",maxWidth:360,flex:"1 1 240px"},children:e(ze,{dense:true,value:S,onChange:V=>E(V.target.value),placeholder:v??x("kanban.search.placeholder"),autoComplete:"off",sx:{"& .orb-inp":{paddingLeft:"38px",paddingRight:S?"42px":"12px"},"& .orb-inp-adornment-end":{pointerEvents:"auto"}},startAdornment:e(Hr,{size:16,"aria-hidden":"true"}),endAdornment:S?e(ae,{size:"small",tooltip:x("kanban.search.clear"),"aria-label":x("kanban.search.clear"),onClick:()=>E(""),sx:{width:26,height:26},children:e(jt,{size:15})}):void 0})}),c(Ie,{sx:{display:"flex",alignItems:"center",gap:1,ml:"auto"},children:[A&&e(L,{component:"div","aria-live":"polite",sx:{flexShrink:0,fontSize:12,fontWeight:500,color:"text.secondary"},children:N>0?x("kanban.search.results",{count:N}):x("kanban.search.noMatch")}),a&&e(we,{size:"small",variant:"secondary",startIcon:e(en,{size:15}),onClick:a,children:s??x("kanban.bucket.add")})]})]}),e(Ie,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${l}px, ${Math.max(l,360)}px)`,gap:1.5,gridAutoRows:R==="100%"?"minmax(0, 1fr)":void 0,alignItems:"stretch",justifyContent:"start",flex:"1 1 0",height:"100%",minHeight:0,overflowX:"auto",overflowY:"hidden",overscrollBehavior:"contain",scrollbarGutter:"stable both-edges",pb:.5},...Array.isArray(g)?g:g?[g]:[]],children:M.buckets.map(V=>e(Pv,{bucket:V,highlighted:V.id===k,bucketHeight:R,emptyBucketLabel:A?x("kanban.search.noMatch"):y,onBucketRename:i?z=>i(V.id,z):void 0,onCardClick:o},V.id))})]}),e(core.DragOverlay,{children:F?e(Ie,{sx:{width:Math.max(l-24,260)},children:e(vl,{card:F.card,bucket:F.bucket,overlay:true})}):null})]})};var Rv=({initialModel:t,initialBuckets:r,initialCards:o})=>t||vu({buckets:r??[],cards:o??[]}),oE=t=>{let{onCardMove:r,onCardClick:o}=t,[n,a]=er.useState(()=>Rv(t)),i=er.useCallback(b=>{a(m=>typeof b=="function"?b(m):b);},[]),s=er.useCallback(b=>_r(n,b),[n]),l=er.useCallback((b,m,v)=>{let y=_r(n,b);if(!y)return;let g=Vi(n,{cardId:b,fromBucketId:y.bucket.id,toBucketId:m,targetIndex:v}),x=_r(g,b);if(!x||x.bucket.id===y.bucket.id&&x.cardIndex===y.cardIndex)return;a(g);let h={cardId:b,fromBucketId:y.bucket.id,toBucketId:x.bucket.id,targetIndex:x.cardIndex,card:x.card,model:g};return r?.(h),h},[n,r]),d=er.useCallback((b,m)=>{a(v=>({buckets:v.buckets.map(y=>({...y,cards:y.cards.map(g=>g.id!==b?g:typeof m=="function"?m(g):{...g,...m})}))}));},[]),u=er.useCallback(b=>{let m=bu(n,b);return m===n?false:(a(m),true)},[n]),p=er.useCallback((b,m)=>{let v=hu(n,b,m);return v===n?false:(a(v),true)},[n]),f=er.useMemo(()=>({model:n,onCardMove:b=>{l(b.cardId,b.toBucketId,b.targetIndex);},onCardClick:o}),[n,l,o]);return {model:n,actions:{replaceModel:i,moveCard:l,updateCard:d,addBucket:u,renameBucket:p,getCard:s},boardProps:f}};function Sn({onTextUpdate:t,onComplete:r,onError:o,wsUrl:n="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:i=.015}){let[s,l]=er.useState(false),d=er.useRef(null),u=er.useRef(null),p=er.useRef(null),f=er.useRef(null),b=er.useRef(null),m=er.useRef(0),v=er.useRef(false),y=er.useRef(false),g=er.useCallback(()=>{d.current&&(d.current.close(),d.current=null),f.current&&(f.current.disconnect(),f.current=null),b.current&&(b.current.disconnect(),b.current=null),u.current&&(u.current.getTracks().forEach(C=>C.stop()),u.current=null),p.current&&(p.current.close(),p.current=null),y.current=false,l(false);},[]),x=er.useCallback(()=>{v.current||(v.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(g,500));},[g]),h=er.useCallback(async()=>{if(!(s||y.current)){y.current=true,v.current=false,m.current=Date.now();try{let C=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});u.current=C;let k=new WebSocket(n);d.current=k,k.onopen=()=>{l(!0),y.current=!1;},k.onmessage=A=>{try{let R=JSON.parse(A.data);if(R.type==="recognition")R.is_final?r(R.text):t?.(R.text);else if(R.type==="error"){let M=R.message||"Voice recognition error";o?.(M),x();}}catch{o?.("Failed to parse voice message");}},k.onerror=()=>{o?.("Voice service connection failed"),g();},k.onclose=()=>{g();};let w=window.AudioContext||window.webkitAudioContext;if(!w)throw new Error("AudioContext is not supported in this browser");let T=new w({sampleRate:16e3});p.current=T;let I=T.createMediaStreamSource(C);b.current=I;let S=T.createScriptProcessor(4096,1,1);f.current=S,S.onaudioprocess=A=>{if(d.current?.readyState!==WebSocket.OPEN)return;let R=A.inputBuffer.getChannelData(0),M=0;for(let O=0;O<R.length;O+=1)M+=R[O]*R[O];if(Math.sqrt(M/R.length)>i)m.current=Date.now();else if(Date.now()-m.current>a&&!v.current){x();return}let E=new Int16Array(R.length);for(let O=0;O<R.length;O+=1){let F=Math.max(-1,Math.min(1,R[O]));E[O]=F<0?F*32768:F*32767;}d.current.send(E.buffer);},I.connect(S),S.connect(T.destination);}catch{o?.("Cannot access microphone"),g();}}},[g,s,i,r,o,t,a,x,n]);return er.useEffect(()=>g,[g]),{isRecording:s,startRecording:h,stopRecording:x}}P();var Ev=["en","zh","fr","de","ja","ko"],ku={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},kl=({searchPlaceholder:t,onSearch:r,onSearchAdd:o,onOpenPanel:n,panelOpen:a=false,maxWidth:i=540,sx:s})=>{let{t:l}=pe(),[d,u]=er.useState(""),p=er.useCallback((x=d)=>{let h=x.trim();h&&(u(""),r?.(h));},[r,d]),f=x=>{x.preventDefault(),p();},{isRecording:b,startRecording:m,stopRecording:v}=Sn({onTextUpdate:u,onComplete:x=>{u(x),p(x);},onError:x=>{console.error("Header voice input error:",x);}}),y=er.useCallback(async()=>{if(b){v();return}await m();},[b,m,v]),g=t||l("header.searchPlaceholder");return e("form",{className:"orb-app-header-search",onSubmit:f,style:{width:"100%",maxWidth:typeof i=="number"?`${i}px`:i,...s},children:c("div",{className:"orb-inp-adornment-wrap orb-app-header-search-shell",style:{background:"var(--orb-surface)",border:"1px solid var(--orb-border)",borderRadius:999,paddingRight:4},children:[e("div",{className:"orb-inp-adornment",children:e(ae,{className:"orb-app-header-ai-action",size:"small",onClick:o,tooltip:l("header.searchAddFeature"),children:e(Tt,{name:"add",size:16})})}),e("input",{className:"orb-inp orb-inp-dense orb-app-header-ai-input",value:d,onChange:x=>u(x.target.value),placeholder:g,style:{border:"none",background:"transparent",flex:1,minWidth:0}}),c("div",{className:"orb-inp-adornment orb-inp-adornment-end",children:[n&&!a&&e(ae,{className:"orb-app-header-ai-action",size:"small","aria-label":l("header.searchOpenPanel"),tooltip:l("header.searchOpenPanel"),onClick:n,children:e(Tt,{name:"message",size:16})}),e(ae,{className:"orb-app-header-ai-action",size:"small",onClick:()=>{y();},tooltip:l(b?"header.searchStopVoice":"header.searchStartVoice"),sx:{color:b?"var(--orb-err)":void 0},children:e(Tt,{name:"microphone",size:16})})]})]})})},$i=({appTitle:t,logo:r,onToggleMode:o,locale:n,localeLabel:a,localeOptions:i,onLocaleChange:s,searchPlaceholder:l,showSearch:d=false,onSearch:u,onSearchAdd:p,onOpenPanel:f,panelOpen:b,user:m,onUserRefresh:v,onUserSetting:y,onUserLogout:g,userMenuItems:x,leftSlot:h,rightSlot:C})=>{let{t:k,locale:w}=pe(),T=Cr(),I=n||w,S=a||ku[I],A=i||Ev,R=T==="dark"?e(Gc,{size:15}):e(Xc,{size:15}),M=k(T==="dark"?"header.theme.dark":"header.theme.light"),N=[...v?[{key:"refresh",label:k("header.menu.refresh"),icon:e(Ba,{size:15}),onClick:v}]:[],...y?[{key:"settings",label:k("header.menu.setting"),icon:e(tn,{size:16}),onClick:y}]:[],...g?[{key:"logout",label:k("header.menu.logout"),icon:e(Vc,{size:16}),onClick:g}]:[]],E=x||N,O=A.map(F=>({label:ku[F],onClick:()=>{s?.(F),window.requestAnimationFrame(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur();});},disabled:F===I}));return c("header",{className:"orb-app-header",children:[c("div",{className:"orb-app-header-brand",children:[h,r===null?null:r||e("div",{className:"orb-app-header-default-logo","aria-label":"ORBCAFE",children:e(Tt,{name:"product",size:20})}),t&&e(L,{variant:"h4",sx:{fontWeight:700},children:t})]}),e("div",{className:"orb-app-header-center",children:d&&e(kl,{searchPlaceholder:l,onSearch:u,onSearchAdd:p,onOpenPanel:f,panelOpen:b})}),c("div",{className:"orb-app-header-actions",children:[c("div",{className:"orb-app-header-utilities",children:[s?e(Qt,{triggerLabel:S,trigger:c("button",{type:"button",className:"orb-icon-btn orb-app-header-locale",children:[e(zn,{size:15}),e("span",{className:"orb-label",children:S})]}),items:O,align:"end"}):c("div",{className:"orb-app-header-locale","aria-label":S,children:[e(zn,{size:15}),e("span",{className:"orb-label",children:S})]}),e(ae,{className:"orb-app-header-theme",size:"small",onClick:o,tooltip:M,children:R})]}),m&&e("span",{className:"orb-app-header-divider","aria-hidden":"true"}),m&&e(Qt,{triggerLabel:m.name,trigger:c("button",{type:"button",className:"orb-app-header-user-trigger",children:[c("span",{className:"orb-app-header-user-copy",children:[e(L,{variant:"body2",className:"orb-app-header-user-name",children:m.name}),m.subtitle&&e(L,{variant:"caption",muted:true,className:"orb-app-header-user-subtitle",title:m.subtitle,children:m.subtitle})]}),e(rn,{src:m.avatarSrc,alt:m.name,size:32,children:m.avatarText||m.name.slice(0,1).toUpperCase()})]}),items:E.map(F=>({label:F.label,onClick:F.onClick,disabled:F.disabled,icon:F.icon})),align:"end"}),C]})]})};var Pu=({menuData:t=[],initialNavigationCollapsed:r=false,initialNavigationMode:o="fixed",enableNavigationPinning:n,navigationPinStorageKey:a,pinnedNavigationItemIds:i,defaultPinnedNavigationItemIds:s,onPinnedNavigationItemIdsChange:l,pinnedNavigationSectionTitle:d}={})=>{let{navigationIslandProps:u}=bd({initialCollapsed:r,initialDisplayMode:o,content:t,enablePinning:n,pinStorageKey:a,pinnedItemIds:i,defaultPinnedItemIds:s,onPinnedItemIdsChange:l,pinnedSectionTitle:d}),[p,f]=er.useState(900);er.useEffect(()=>{let m=()=>f(window.innerHeight);return m(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);let b=er.useMemo(()=>Math.max(280,p-100),[p]);return {navigationIslandProps:u,navigationMaxHeight:b}};P();var Lr=12,Iu=56,Mu=234,Hv="orbcafe:page-layout-locale",Ru=["en","zh","fr","de","ja","ko"],zv=t=>encodeURIComponent(t.trim().toLowerCase()).replace(/%/g,"").replace(/[^a-z0-9._~-]+/g,"-")||"app",_i=(t,r)=>`orbcafe:page-layout:${zv(t)}:${r}`,Vv=t=>`orbcafe:page-layout:${t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,Wv=t=>t==="system"?"dark":t==="dark"?"light":"system",Gi=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),$v=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,TE=({appId:t,appTitle:r,menuData:o=[],children:n,showNavigation:a=true,locale:i="en",localeLabel:s,localeOptions:l,onLocaleChange:d,mode:u,defaultMode:p="system",onModeChange:f,user:b,onUserRefresh:m,onUserSetting:v,onUserLogout:y,userMenuItems:g,logo:x,searchPlaceholder:h,searchPlacement:C="hidden",floatingSearchSx:k,onSearch:w,onSearchAdd:T,onOpenPanel:I,panelOpen:S,rightHeaderSlot:A,leftHeaderSlot:R,contentSx:M,navigationVariant:N="classic",navigationMode:E,defaultNavigationMode:O="fixed",onNavigationModeChange:F,showNavigationModeToggle:_=true,enableNavigationPinning:B=true,navigationPinStorageKey:Y,pinnedNavigationItemIds:W,defaultPinnedNavigationItemIds:j,onPinnedNavigationItemIdsChange:V,pinnedNavigationSectionTitle:z})=>{let K=t?_i(t,"mode"):"orbcafe:page-layout-mode",q=t?_i(t,"locale"):Hv,fe=t?_i(t,"navigation-mode"):"orbcafe:page-layout-navigation-mode",[se,ue]=er.useState(p),[Se,$e]=er.useState("light"),[ke,le]=er.useState(false),[Ee,Me]=er.useState(i),[Pe,Ve]=er.useState(false),[tt,nt]=er.useState(false),[it,X]=er.useState(O),[De,ye]=er.useState({x:Lr,y:Lr}),[Be,at]=er.useState("left"),[Ze,St]=er.useState(false),Mt=er.useRef(null),Ot=er.useRef(null),At=u!==void 0,re=u??se,Ke=d!==void 0,Fe=Ke?i:Ee,ce=l?.join("|")??"",ve=E!==void 0,te=E??it,he=te==="floating",Ne=N==="v2"?Xs:dd,Je=C==="header",st=re==="system"?ke?Se:"light":re;er.useEffect(()=>{if(!At)try{let be=window.localStorage.getItem(K);(be==="light"||be==="dark"||be==="system")&&ue(be);}catch{}le(true);let $=window.matchMedia("(prefers-color-scheme: dark)"),Q=()=>{$e($.matches?"dark":"light");};return Q(),$.addEventListener("change",Q),()=>$.removeEventListener("change",Q)},[At,K]),er.useEffect(()=>{if(!(At||!ke))try{window.localStorage.setItem(K,re);}catch{}},[ke,At,re,K]),er.useEffect(()=>{if(Ke){Ve(true);return}try{let $=window.localStorage.getItem(q),Q=l??Ru;$&&Ru.includes($)&&Q.includes($)&&Me($);}catch{}finally{Ve(true);}},[Ke,ce,q]),er.useEffect(()=>{if(!(Ke||!Pe))try{window.localStorage.setItem(q,Fe);}catch{}},[Fe,Ke,Pe,q]),er.useEffect(()=>{if(ve){nt(true);return}try{let $=window.localStorage.getItem(fe);($==="fixed"||$==="floating")&&X($);}catch{}finally{nt(true);}},[ve]),er.useEffect(()=>{if(tt)try{window.localStorage.setItem(fe,te);}catch{}},[te,tt]),er.useEffect(()=>{st==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[st]);let pt=er.useCallback($=>{ve||X($),F?.($);},[ve,F]),Bt=er.useCallback($=>{At||ue($),f?.($);},[At,f]),Xt=er.useCallback($=>{Ke||Me($),d?.($);},[Ke,d]),{navigationIslandProps:Vt,navigationMaxHeight:wt}=Pu({menuData:o,initialNavigationCollapsed:false,initialNavigationMode:te,enableNavigationPinning:B,navigationPinStorageKey:Y??(t?_i(t,"pinned-navigation-items"):Vv(r)),pinnedNavigationItemIds:W,defaultPinnedNavigationItemIds:j,onPinnedNavigationItemIdsChange:V,pinnedNavigationSectionTitle:z}),Wt=Vt.collapsed,ht=er.useCallback($=>{let Q=Mt.current,be=Q?.parentElement;if(!Q||!be)return $;let Ce=be.getBoundingClientRect(),Le=Q.getBoundingClientRect(),_e=Lr,qe=Lr,je=Math.max(_e,Ce.width-Le.width-Lr),mt=Math.max(qe,Ce.height-Le.height-Lr);return {x:Gi($.x,_e,je),y:Gi($.y,qe,mt)}},[]),Nt=er.useCallback($=>{let Q=Mt.current,be=Q?.parentElement;if(!Q||!be)return $;let Ce=be.getBoundingClientRect(),Le=Q.getBoundingClientRect(),_e=Lr,qe=Lr,je=Math.max(_e,Ce.width-Le.width-Lr),mt=Math.max(qe,Ce.height-Le.height-Lr),ft={x:Gi($.x,_e,je),y:Gi($.y,qe,mt)},yt=[{distance:Math.abs(ft.x-_e),position:{x:_e,y:ft.y}},{distance:Math.abs(ft.x-je),position:{x:je,y:ft.y}},{distance:Math.abs(ft.y-qe),position:{x:ft.x,y:qe}},{distance:Math.abs(ft.y-mt),position:{x:ft.x,y:mt}}].reduce((H,J)=>J.distance<H.distance?J:H).position;return at(yt.x>=(_e+je)/2?"right":"left"),yt},[]),lt=er.useMemo(()=>{if(!he||Ze)return De.x;if(Be==="right"){let be=Mt.current?.parentElement?.getBoundingClientRect().width,Ce=Wt?Iu:Mu;return be?Math.max(Lr,be-Ce-Lr):Wt?De.x:De.x-(Mu-Iu)}return De.x},[Be,De.x,Ze,he,Wt]),Ft=er.useCallback($=>{if(!he||!Wt||$v($.target))return;$.preventDefault(),$.currentTarget.setPointerCapture($.pointerId);let Q=ht({x:lt,y:De.y});at("left"),ye(Q),Ot.current={pointerId:$.pointerId,startClientX:$.clientX,startClientY:$.clientY,startX:Q.x,startY:Q.y,currentX:Q.x,currentY:Q.y},St(true);},[ht,lt,De.y,he,Wt]),Yt=er.useCallback($=>{let Q=Ot.current;if(!Q||Q.pointerId!==$.pointerId)return;let be=ht({x:Q.startX+$.clientX-Q.startClientX,y:Q.startY+$.clientY-Q.startClientY});Q.currentX=be.x,Q.currentY=be.y,ye(be);},[ht]),Z=er.useCallback($=>{let Q=Ot.current;if(!(!Q||Q.pointerId!==$.pointerId)){try{$.currentTarget.releasePointerCapture($.pointerId);}catch{}Ot.current=null,ye(Nt({x:Q.currentX,y:Q.currentY})),St(false);}},[Nt]);return er.useEffect(()=>{if(!he)return;let $=()=>{ye(Ce=>ht(Ce));},Q=window.requestAnimationFrame($),be=window.setTimeout($,430);return ()=>{window.cancelAnimationFrame(Q),window.clearTimeout(be);}},[ht,he,Wt,wt]),e(Fn,{mode:re,children:e(Ga,{locale:Fe,children:c("div",{className:"orb-root",style:{minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:"var(--orb-canvas)"},children:[e($i,{appTitle:r,logo:x,mode:re,onToggleMode:()=>Bt(Wv(re)),locale:Fe,localeLabel:Ke||Fe===i?s:void 0,localeOptions:l,onLocaleChange:Xt,user:b,onUserRefresh:m,onUserSetting:v,onUserLogout:y,userMenuItems:g,searchPlaceholder:h,showSearch:Je,onSearch:w,onSearchAdd:T,onOpenPanel:I,panelOpen:S,leftSlot:R,rightSlot:A}),C==="floating"&&e("div",{className:"orb-float-search",style:k,children:e(kl,{searchPlaceholder:h,onSearch:w,onSearchAdd:T,onOpenPanel:I,panelOpen:S,maxWidth:"100%"})}),c("div",{style:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[a&&!he&&e("div",{style:{paddingTop:12,paddingBottom:12,paddingLeft:12,paddingRight:Wt?4:12,display:"flex",alignItems:"flex-start",flexShrink:0},children:e(Ne,{...Vt,maxHeight:wt,colorMode:st,displayMode:te,onDisplayModeChange:pt,showDisplayModeToggle:_&&Wt})}),a&&he&&e("div",{ref:Mt,onPointerDown:Ft,onPointerMove:Yt,onPointerUp:Z,onPointerCancel:Z,style:{position:"absolute",top:De.y,left:lt,zIndex:1205,display:"flex",alignItems:"flex-start",cursor:Wt?Ze?"grabbing":"grab":"default",touchAction:Wt?"none":"auto",userSelect:Ze?"none":void 0,transition:Ze?"none":"left 180ms ease-out, top 180ms ease-out"},children:e(Ne,{...Vt,maxHeight:wt,colorMode:st,displayMode:te,onDisplayModeChange:pt,showDisplayModeToggle:_&&Wt})}),e("div",{style:{flex:1,minWidth:0,minHeight:0,overflow:"auto",paddingTop:12,paddingBottom:12,paddingRight:12,paddingLeft:a&&!he&&Wt?4:12,...M},children:n})]})]})})})};var Ui="(blank)",Du="Result",Nu="Grand Total",Au={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Eu=["sum","count","avg","min","max"];var Lu=["palette","rows","columns","filters","values"];var Ou=t=>Lu.includes(t),Fu=t=>t==="rows"||t==="columns"||t==="filters",Ki=t=>{let r=t.split("|");return r.length===2&&r[0]==="container"&&Ou(r[1])?{kind:"container",zone:r[1]}:r.length===3&&r[0]==="item"&&Ou(r[1])&&r[2]?{kind:"item",zone:r[1],key:r[2]}:null},po=t=>t==null||t===""?Ui:t instanceof Date?t.toISOString().slice(0,10):String(t),_o=t=>JSON.stringify(t),Bu=(t,r)=>{let o=t.join(""),n=r.join("");return o.localeCompare(n,void 0,{sensitivity:"base"})},_v=t=>{if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()!==""){let r=Number(t);return Number.isFinite(r)?r:null}return null},wn=(t,r,o)=>{if(o==="count")return t.length;let n=t.map(a=>_v(a[r])).filter(a=>a!==null);return n.length===0?0:o==="sum"?n.reduce((a,i)=>a+i,0):o==="avg"?n.reduce((a,i)=>a+i,0)/n.length:o==="min"?Math.min(...n):Math.max(...n)},lr=(t,r)=>{if(!t||t.length===0)return [];let o=new Set,n=[];return t.forEach(a=>{!r.has(a)||o.has(a)||(o.add(a),n.push(a));}),n},uo=(t,r)=>t.length!==r.length?false:t.every((o,n)=>o===r[n]),Hu=(t,r)=>{let o=Object.keys(t),n=Object.keys(r);return o.length!==n.length?false:o.every(a=>{let i=t[a]??[],s=r[a]??[];return uo(i,s)})},qi=(t,r)=>t.length!==r.length?false:t.every((o,n)=>{let a=r[n];return o.tokenId===a.tokenId&&o.fieldId===a.fieldId&&o.aggregation===a.aggregation}),Pl=t=>!t?.aggregations||t.aggregations.length===0?Eu:t.aggregations,vr=(t,r)=>{let o=Pl(r);return t&&o.includes(t)?t:r?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},ua=(t,r,o)=>{let n=o.get(r.fieldId);return n?.formatValue?n.formatValue(t):r.aggregation==="count"?Math.round(t).toLocaleString():t.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};P();var Vu=({options:t,selectedValues:r,onChange:o,minWidth:n=96})=>{let{t:a}=pe(),[i,s]=er.useState(""),[l,d]=er.useState(null),u=er.useMemo(()=>{let m=i.trim().toLowerCase();return m?t.filter(v=>v.toLowerCase().includes(m)):t},[t,i]),p=t.length>0&&r.length===t.length,f=t.length===0?a("pivot.filter.na"):r.length===0?a("common.none"):p?a("common.all"):`${r.length}/${t.length}`,b=m=>{o(r.includes(m)?r.filter(v=>v!==m):[...r,m]);};return c("div",{sx:{minWidth:n},onClick:m=>m.stopPropagation(),onMouseDown:m=>m.stopPropagation(),children:[e(we,{variant:"outlined",size:"small",onClick:m=>d(m.currentTarget),sx:{minWidth:n,height:26,px:1,py:.35,fontSize:"0.72rem",justifyContent:"space-between"},children:f}),e(Qt,{anchorEl:l,open:!!l,onClose:()=>d(null),PaperProps:{sx:{width:Math.max(n,220),maxHeight:320,overflowY:"auto",p:.5}},children:c("div",{onClick:m=>m.stopPropagation(),sx:{display:"grid",gap:.4},children:[e(ze,{size:"small",placeholder:`${a("common.search")}...`,fullWidth:true,value:i,onChange:m=>s(m.target.value),onKeyDown:m=>m.stopPropagation(),onClick:m=>m.stopPropagation(),sx:{m:0,"& .orb-inp":{fontSize:"0.75rem",py:.7}}}),e("div",{sx:{px:1,py:.5,borderBottom:"1px solid var(--orb-border)"},children:e(we,{variant:"text",size:"small",onClick:m=>{m.preventDefault(),m.stopPropagation(),o(p?[]:t);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:a(p?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),u.length===0&&e("div",{className:"orb-menu-item","aria-disabled":"true",sx:{fontSize:"0.75rem"},children:a("pivot.filter.noResults")}),u.map(m=>{let v=r.includes(m);return c("div",{role:"option","aria-selected":v,tabIndex:0,className:`orb-menu-item ${v?"orb-selected":""}`,onClick:()=>b(m),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),b(m));},sx:{display:"flex",alignItems:"center",fontSize:"0.75rem",py:.4},children:[e(It,{size:"small",checked:v,inputProps:{tabIndex:-1},sx:{p:.5,mr:.5,pointerEvents:"none"}}),e("span",{children:m})]},m)})]})})]})};P();var kn=({size:t=18,subtle:r=false})=>{let o=Math.max(2,Math.round(t/6));return e(Ie,{"aria-hidden":"true",sx:{display:"grid",gridTemplateColumns:`repeat(2, ${o}px)`,gridAutoRows:`${o}px`,gap:`${Math.max(2,Math.round(o/1.5))}px`,placeItems:"center",width:t,height:t,flexShrink:0,color:r?"var(--orb-muted)":"var(--orb-primary)"},children:Array.from({length:6},(n,a)=>e(Ie,{sx:{width:o,height:o,borderRadius:999,bgcolor:"currentColor"}},a))})};P();var Tl=({label:t,subtitle:r,isDragging:o,dragRef:n,listeners:a,attributes:i,style:s})=>e(Ae,{ref:n,...a,...i,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)",transform:"translateY(-1px)"}},style:{...s,opacity:o?.3:1,cursor:o?"grabbing":"grab"},children:c("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[e("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--orb-r)",bgcolor:"var(--orb-p50)",border:"1px solid var(--orb-p100)"},children:e(kn,{size:13,subtle:true})}),c("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.15},children:[e(L,{component:"div",sx:{fontSize:"0.84rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),r&&e(L,{component:"div",sx:{fontSize:"0.73rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:r})]})]})}),Wu=({id:t,label:r,subtitle:o})=>{let{setNodeRef:n,listeners:a,attributes:i,isDragging:s}=core.useDraggable({id:t});return e(Tl,{label:r,subtitle:o,isDragging:s,dragRef:n,listeners:a,attributes:i})};P();var Pn=({zone:t,title:r,hint:o,icon:n,children:a,itemCount:i,onClear:s})=>{let l=`container|${t}`,{isOver:d,setNodeRef:u}=core.useDroppable({id:l}),{t:p}=pe();return c(Ae,{ref:u,sx:f=>({p:1.1,borderRadius:"var(--orb-r-container)",border:"1px dashed",borderColor:d?"var(--orb-primary)":"var(--orb-p200)",bgcolor:d?"var(--orb-p100)":f.palette.mode==="dark"?"var(--orb-surface-2)":"var(--orb-p50)",transition:"border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease",boxShadow:d?"0 0 0 3px var(--orb-focus-ring)":"none",minHeight:120,display:"flex",flexDirection:"column"}),children:[c("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[c("div",{sx:{display:"flex",alignItems:"center",gap:.8},children:[n,e(L,{component:"div",sx:{fontSize:"0.8rem",fontWeight:700,letterSpacing:.1,color:"var(--orb-fg-strong)"},children:r}),c(L,{component:"div",sx:{fontSize:"0.73rem",fontWeight:500,color:"var(--orb-fg)"},children:["(",i,")"]})]}),i>0&&s&&e(ct,{title:p("pivot.clearArea"),children:e(ae,{size:"small",onClick:s,sx:{width:24,height:24,p:0},children:e(rp,{size:13})})})]}),e(L,{component:"div",sx:{mt:.5,mb:.9,fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)"},children:o}),e("div",{sx:{flex:1},children:a})]})};P();var $u={xs:1.2,md:1.6},Tn=({title:t,subtitle:r,collapsed:o,onToggleCollapse:n,expandAriaLabel:a,collapseAriaLabel:i,children:s,bodySx:l,unmountOnExit:d=false,headerActions:u})=>c(Ae,{sx:p=>({borderRadius:"var(--orb-r-container)",border:`1px solid ${p.palette.divider}`,overflow:"hidden",bgcolor:"var(--orb-surface)",boxShadow:"var(--orb-shadow-1)"}),children:[c("div",{sx:p=>({px:$u,py:1.15,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,bgcolor:"var(--orb-canvas)",borderBottom:o?"none":`1px solid ${p.palette.divider}`}),children:[c("div",{sx:{minWidth:0,flex:1},children:[e(L,{component:"div",sx:{fontSize:"0.92rem",fontWeight:700,color:"var(--orb-fg-strong)"},children:t}),e(L,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r})]}),c("div",{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[u,e(ae,{size:"small","aria-label":o?a:i,onClick:n,sx:p=>({border:`1px solid ${p.palette.divider}`,bgcolor:"var(--orb-canvas)",color:"var(--orb-primary)",width:24,height:24,padding:0,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:"var(--orb-p50)",borderColor:"var(--orb-p200)"}}),children:e(ai,{size:13,sx:{transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:o?"rotate(180deg)":"rotate(0deg)"}})})]})]}),e(nn,{in:!o,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:e("div",{sx:[{px:$u,py:{xs:1.2,md:1.6}},...Array.isArray(l)?l:l?[l]:[]],children:s})})]});P();var Xi=({label:t,caption:r,onRemove:o,trailing:n,isDragging:a,dragRef:i,listeners:s,attributes:l,style:d})=>e(Ae,{ref:i,style:d,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",opacity:a?0:1,transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)"}},children:c("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[e("div",{...l,...s,sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--orb-r)",bgcolor:"var(--orb-p50)",border:"1px solid var(--orb-p100)",cursor:"grab"},children:e(kn,{size:13,subtle:true})}),c("div",{sx:{minWidth:0,flex:1,display:"flex",flexDirection:"column",gap:.15},children:[e(L,{component:"div",sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),r&&e(L,{component:"div",sx:{fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:r})]}),n,o&&e(ae,{size:"small",onClick:u=>{u.stopPropagation(),o();},sx:{width:24,height:24,p:0},children:e(wo,{size:13})})]})}),ma=({id:t,label:r,caption:o,onRemove:n,trailing:a})=>{let{setNodeRef:i,attributes:s,listeners:l,transform:d,transition:u,isDragging:p}=sortable.useSortable({id:t}),f={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:u,zIndex:p?999:"auto"};return e(Xi,{label:r,caption:o,onRemove:n,trailing:a,isDragging:p,dragRef:i,listeners:l,attributes:s,style:f})};P();var ji={rows:e(bp,{size:16,sx:{color:"var(--orb-primary)"}}),columns:e(ln,{size:16,sx:{color:"var(--orb-primary)"}}),filters:e(Qd,{size:16,sx:{color:"var(--orb-primary)"}}),values:e(sn,{size:16,sx:{color:"var(--orb-accent)"}})},_u=({isConfiguratorCollapsed:t,onToggleCollapse:r,availableFields:o,fieldMap:n,filterFields:a,columnFields:i,rowFields:s,valueFields:l,clearZone:d,removeFieldFromZone:u,getFilterSelectionSummary:p,renderDimensionFilterSelect:f,renderAggregationSelect:b,getAggregationLabel:m})=>{let{t:v}=pe(),y=[`${v("pivot.zone.rows")} ${s.length}`,`${v("pivot.zone.columns")} ${i.length}`,`${v("pivot.zone.filters")} ${a.length}`,`${v("pivot.zone.values")} ${l.length}`].join(" \xB7 ");return e(Tn,{title:v("pivot.config.title"),subtitle:y,collapsed:t,onToggleCollapse:r,expandAriaLabel:v("pivot.collapse.ariaExpand"),collapseAriaLabel:v("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:c("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[e(Pn,{zone:"palette",title:v("pivot.fieldList"),hint:v("pivot.availableDimensions"),itemCount:o.length,icon:e(kn,{size:18,subtle:true}),children:c(ie,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[o.length===0&&e(L,{component:"div",sx:{fontSize:"0.74rem",fontWeight:400,color:"var(--orb-fg)",py:1},children:v("pivot.allFieldsInUse")}),o.map(g=>e(Wu,{id:`item|palette|${g.id}`,label:g.label,subtitle:g.type??"string"},g.id))]})}),c(ie,{spacing:2,children:[c("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[e(Pn,{zone:"filters",title:v("pivot.zone.filters"),hint:v("pivot.hint.filters"),icon:ji.filters,itemCount:a.length,onClear:()=>d("filters"),children:e(sortable.SortableContext,{items:a.map(g=>`item|filters|${g}`),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:.7,children:a.map(g=>e(ma,{id:`item|filters|${g}`,label:n.get(g)?.label??g,caption:p(g),trailing:f(g),onRemove:()=>u("filters",g)},g))})})}),e(Pn,{zone:"columns",title:v("pivot.zone.columns"),hint:v("pivot.hint.columns"),icon:ji.columns,itemCount:i.length,onClear:()=>d("columns"),children:e(sortable.SortableContext,{items:i.map(g=>`item|columns|${g}`),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:.7,children:i.map(g=>e(ma,{id:`item|columns|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${p(g)}`,trailing:f(g),onRemove:()=>u("columns",g)},g))})})})]}),c("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[e(Pn,{zone:"rows",title:v("pivot.zone.rows"),hint:v("pivot.hint.rows"),icon:ji.rows,itemCount:s.length,onClear:()=>d("rows"),children:e(sortable.SortableContext,{items:s.map(g=>`item|rows|${g}`),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:.7,children:s.map(g=>e(ma,{id:`item|rows|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${p(g)}`,trailing:f(g),onRemove:()=>u("rows",g)},g))})})}),e(Pn,{zone:"values",title:v("pivot.zone.values"),hint:v("pivot.hint.values"),icon:ji.values,itemCount:l.length,onClear:()=>d("values"),children:e(sortable.SortableContext,{items:l.map(g=>`item|values|${g.tokenId}`),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:.7,children:l.map(g=>{let x=n.get(g.fieldId)?.label??g.fieldId,h=`${m(g.aggregation)}(${x})`;return e(ma,{id:`item|values|${g.tokenId}`,label:x,caption:h,trailing:b(g),onRemove:()=>u("values",g.tokenId)},g.tokenId)})})})})]})]})]})})};P();var Gu=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Uu=({data:t,primaryLabel:r,secondaryLabel:o,formatPrimaryValue:n,formatSecondaryValue:a})=>{let i=sr();if(t.length===0)return null;let s=720,l=250,d={top:20,right:24,bottom:40,left:52},u=o?t.map(g=>g.primaryValue):t.map((g,x)=>x+1),p=o?t.map(g=>g.secondaryValue??0):t.map(g=>g.primaryValue),f=Math.max(...u,1),b=Math.max(...p,1),m=s-d.left-d.right,v=l-d.top-d.bottom,y=t.map((g,x)=>{let h=o?g.primaryValue:x+1,C=o?g.secondaryValue??0:g.primaryValue,k=d.left+h/f*m,w=l-d.bottom-C/b*v;return {...g,x:k,y:w,rawX:h,rawY:C}});return c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[e("div",{sx:{overflowX:"auto"},children:c("div",{component:"svg",viewBox:`0 0 ${s} ${l}`,sx:{width:"100%",minWidth:s,height:l},children:[e("line",{x1:d.left,y1:l-d.bottom,x2:s-d.right,y2:l-d.bottom,stroke:Ar(i.palette.text.secondary,.35)}),e("line",{x1:d.left,y1:d.top,x2:d.left,y2:l-d.bottom,stroke:Ar(i.palette.text.secondary,.35)}),y.map(g=>c("g",{children:[e("circle",{cx:g.x,cy:g.y,r:7,fill:Ar(i.palette.primary.main,.18)}),e("circle",{cx:g.x,cy:g.y,r:4.5,fill:i.palette.primary.main,children:c("title",{children:[g.name,`
195
- `,o?`${r}: ${n(g.primaryValue)}`:`${r}: ${n(g.primaryValue)}`,o?`
196
- ${o}: ${(a??n)(g.secondaryValue??0)}`:""]})}),e("text",{x:g.x,y:Math.max(g.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:i.palette.text.secondary,children:g.name})]},g.name)),e("text",{x:s/2,y:l-10,textAnchor:"middle",fontSize:"11",fill:i.palette.text.secondary,children:o?r:"Index"}),e("text",{x:16,y:l/2,textAnchor:"middle",transform:`rotate(-90 16 ${l/2})`,fontSize:"11",fill:i.palette.text.secondary,children:o??r}),e("text",{x:d.left,y:d.top-4,fontSize:"10",fill:i.palette.text.secondary,children:Gu(b)}),e("text",{x:s-d.right,y:l-d.bottom+16,textAnchor:"end",fontSize:"10",fill:i.palette.text.secondary,children:Gu(f)})]})}),e("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(3, minmax(0, 1fr))"},gap:1},children:t.map(g=>c("div",{sx:x=>({borderRadius:"var(--orb-r-container)",px:1.25,py:1,border:`1px solid ${Ar(x.palette.divider,.7)}`,bgcolor:Ar(x.palette.background.default,.35)}),children:[e(L,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:g.name,children:g.name}),c(L,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[r,": ",n(g.primaryValue)]}),o&&c(L,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[o,": ",(a??n)(g.secondaryValue??0)]})]},g.name))})]})};P();var Il=t=>Math.max(...t,1),Ku=({data:t,chartType:r,primaryLabel:o,secondaryLabel:n,formatPrimaryValue:a,formatSecondaryValue:i})=>{let s=sr(),l=s.palette.primary.main,d=s.palette.warning.main;if(t.length===0)return null;if(r==="bar-horizontal"){let h=Il(t.flatMap(C=>[C.primaryValue,C.secondaryValue??0]));return e(ie,{spacing:1.1,children:t.map(C=>c("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[e(L,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:C.name,children:C.name}),c(ie,{spacing:.65,children:[e("div",{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:Ar(s.palette.action.active,.08)},children:e("div",{sx:{width:`${C.primaryValue/h*100}%`,height:"100%",bgcolor:l}})}),n&&e("div",{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:Ar(s.palette.action.active,.08)},children:e("div",{sx:{width:`${(C.secondaryValue??0)/h*100}%`,height:"100%",bgcolor:d}})})]}),c("div",{sx:{minWidth:0},children:[e(L,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700,color:"var(--orb-fg-strong)"},children:a(C.primaryValue)}),n&&e(L,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"var(--orb-fg)"},children:(i??a)(C.secondaryValue??0)})]})]},C.name))})}if(r==="bar-vertical"){let h=Il(t.flatMap(k=>[k.primaryValue,k.secondaryValue??0])),C=n?92:76;return e("div",{sx:{overflowX:"auto",pb:.5},children:e("div",{sx:{minWidth:Math.max(620,t.length*C),display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:t.map(k=>c("div",{sx:{minWidth:0},children:[c("div",{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[e("div",{sx:{width:n?16:26,minHeight:8,height:`${Math.max(k.primaryValue/h*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:l},title:`${o}: ${a(k.primaryValue)}`}),n&&e("div",{sx:{width:16,minHeight:8,height:`${Math.max((k.secondaryValue??0)/h*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${n}: ${(i??a)(k.secondaryValue??0)}`})]}),e(L,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:k.name,children:k.name}),e(L,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:a(k.primaryValue),children:a(k.primaryValue)}),n&&e(L,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:(i??a)(k.secondaryValue??0),children:(i??a)(k.secondaryValue??0)})]},k.name))})})}let u=Math.max(680,t.length*74),p=240,f={top:20,right:18,bottom:36,left:18},b=Il(t.flatMap(h=>[h.primaryValue,h.secondaryValue??0])),m=u-f.left-f.right,v=p-f.top-f.bottom,y=h=>t.map((C,k)=>{let w=f.left+k*m/Math.max(t.length-1,1),T=p-f.bottom-h(C)/b*v;return {x:w,y:T,item:C}}),g=y(h=>h.primaryValue),x=n?y(h=>h.secondaryValue??0):[];return c("div",{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[e("div",{sx:{overflowX:"auto"},children:c("div",{component:"svg",viewBox:`0 0 ${u} ${p}`,sx:{width:"100%",minWidth:u,height:p},children:[e("line",{x1:f.left,y1:p-f.bottom,x2:u-f.right,y2:p-f.bottom,stroke:Ar(s.palette.text.secondary,.35)}),e("polyline",{fill:"none",stroke:l,strokeWidth:3,points:g.map(h=>`${h.x},${h.y}`).join(" ")}),g.map(h=>e("circle",{cx:h.x,cy:h.y,r:4,fill:l,children:c("title",{children:[h.item.name,`
197
- `,o,": ",a(h.item.primaryValue)]})},`primary-${h.item.name}`)),n&&c(jsxRuntime.Fragment,{children:[e("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:x.map(h=>`${h.x},${h.y}`).join(" ")}),x.map(h=>e("circle",{cx:h.x,cy:h.y,r:3.5,fill:d,children:c("title",{children:[h.item.name,`
198
- `,n,": ",(i??a)(h.item.secondaryValue??0)]})},`secondary-${h.item.name}`))]})]})}),e("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:t.map(h=>c("div",{sx:C=>({borderRadius:"var(--orb-r-container)",px:1.1,py:.9,border:`1px solid ${Ar(C.palette.divider,.7)}`,bgcolor:Ar(C.palette.background.default,.35)}),children:[e(L,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:h.name,children:h.name}),e(L,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:a(h.primaryValue)}),n&&e(L,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:(i??a)(h.secondaryValue??0)})]},h.name))})]})};var qu=(t,r,o)=>{let n=new Set,a=[];return t.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:o.get(i)?.label??i,zone:"rows"}));}),r.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:o.get(i)?.label??i,zone:"columns"}));}),a},Xu=(t,r,o)=>t.map(n=>{let a=r.get(n.fieldId),i=a?.label??n.fieldId;return {fieldId:n.fieldId,label:`${o(n.aggregation)} \xB7 ${i}`,item:n,field:a}}),Yu=({rows:t,dimensionFieldId:r,primaryValue:o,secondaryValue:n})=>{if(!r)return [];let a=new Map;return t.forEach(i=>{let s=po(i[r]),l=a.get(s);if(l){l.push(i);return}a.set(s,[i]);}),Array.from(a.entries()).sort((i,s)=>i[0].localeCompare(s[0],void 0,{sensitivity:"base"})).map(([i,s])=>({name:i,primaryValue:wn(s,o.fieldId,o.aggregation),secondaryValue:n?wn(s,n.fieldId,n.aggregation):void 0}))};P();var Zu=({rows:t,fieldMap:r,rowFields:o,columnFields:n,valueFields:a,chartDimensionFieldId:i,chartPrimaryValueFieldId:s,chartSecondaryValueFieldId:l,chartType:d,isCollapsed:u,onChartDimensionFieldIdChange:p,onChartPrimaryValueFieldIdChange:f,onChartSecondaryValueFieldIdChange:b,onChartTypeChange:m,onToggleCollapse:v,getAggregationLabel:y})=>{let{t:g}=pe(),x=er.useMemo(()=>qu(o,n,r),[n,r,o]),h=er.useMemo(()=>Xu(a,r,y),[r,y,a]),C=h.find(M=>M.fieldId===s)??h[0],k=h.find(M=>M.fieldId===l&&M.fieldId!==C?.fieldId)??null,w=x.find(M=>M.fieldId===i)??x[0],T=w&&C?g("pivot.chart.subtitleReady",{dimension:w.label,measure:k?`${C.label} / ${k.label}`:C.label}):g("pivot.chart.subtitle"),I=er.useMemo(()=>!w||!C?[]:Yu({rows:t,dimensionFieldId:w.fieldId,primaryValue:C.item,secondaryValue:k?.item}),[C,t,k,w]),S=M=>C?ua(M,C.item,r):M.toLocaleString(),A=M=>k?ua(M,k.item,r):M.toLocaleString(),R=x.length>1||h.length>1;return c(Tn,{title:g("pivot.chart.title"),subtitle:T,collapsed:u,onToggleCollapse:v,expandAriaLabel:g("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:g("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[R&&c("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[c(Co,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.dimension")}),e(zt,{value:w?.fieldId??"",onChange:M=>p(String(M.target.value)),sx:{fontSize:"0.75rem",height:32},children:x.map(M=>e("option",{value:M.fieldId,sx:{fontSize:"0.75rem"},children:M.label},M.fieldId))})]}),c(Co,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.primaryMeasure")}),e(zt,{value:C?.fieldId??"",onChange:M=>f(String(M.target.value)),sx:{fontSize:"0.75rem",height:32},children:h.map(M=>e("option",{value:M.fieldId,sx:{fontSize:"0.75rem"},children:M.label},M.fieldId))})]}),c(Co,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.secondaryMeasure")}),c(zt,{value:k?.fieldId??"",onChange:M=>b(String(M.target.value)),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g("common.none")}),h.filter(M=>M.fieldId!==C?.fieldId).map(M=>e("option",{value:M.fieldId,sx:{fontSize:"0.75rem"},children:M.label},M.fieldId))]})]}),c(Co,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.chartType")}),c(zt,{value:d,onChange:M=>m(M.target.value),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.barVertical")}),e("option",{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.barHorizontal")}),e("option",{value:"line",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.line")}),e("option",{value:"scatter",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.scatter")})]})]})]}),e("div",{children:w?C?I.length===0?e("div",{sx:{py:5,textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.chart.emptyNoData")})}):d==="scatter"?e(Uu,{data:I,primaryLabel:C.label,secondaryLabel:k?.label,formatPrimaryValue:S,formatSecondaryValue:A}):e(Ku,{data:I,chartType:d,primaryLabel:C.label,secondaryLabel:k?.label,formatPrimaryValue:S,formatSecondaryValue:A}):e("div",{sx:{py:5,textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.chart.emptyNoValue")})}):e("div",{sx:{py:5,textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.chart.emptyNoDimension")})})})]})};P();var Qi=({node:t,dataColumns:r,fieldMap:o,level:n,expandedKeys:a,onToggle:i,getValue:s})=>{let l=a.has(t.key),d=t.children.length>0,u=t.isGrandTotal,p=d&&!l&&!u,f=u?800:p?700:d?600:500,b=u?800:p?600:500;return c(jsxRuntime.Fragment,{children:[c("tr",{sx:{bgcolor:u?vt()==="dark"?"color-mix(in oklch, var(--orb-primary) 22%, transparent)":"color-mix(in oklch, var(--orb-primary) 8%, transparent)":vt()==="dark"?"var(--orb-surface)":"background.paper","&:hover":{bgcolor:u?vt()==="dark"?"color-mix(in oklch, var(--orb-primary) 28%, transparent)":"color-mix(in oklch, var(--orb-primary) 12%, transparent)":"var(--orb-hover)"}},children:[c("td",{style:{fontWeight:f},sx:m=>({fontSize:"0.76rem",borderBottom:`1px solid ${m.palette.divider}`,whiteSpace:"nowrap",pl:n*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!u&&e(ae,{size:"small",onClick:()=>i(t.key),sx:{width:22,height:22,p:0,mr:.35,ml:-0.8},children:l?e(Vr,{size:12}):e(ko,{size:12})}),!d&&!u&&n>0&&e("div",{sx:{width:18}}),t.value]}),r.map(m=>e("td",{align:"right",style:{fontWeight:b},sx:{fontSize:"0.76rem",borderBottom:v=>`1px solid ${v.palette.divider}`,whiteSpace:"nowrap"},children:ua(s?s(t,m.id):t.aggregatedValues[m.id]??0,m.valueItem,o)},`${t.key}-${m.id}`))]}),l&&t.children.map(m=>e(Qi,{node:m,dataColumns:r,fieldMap:o,level:n+1,expandedKeys:a,onToggle:i,getValue:s},m.key))]})};P();var Rl=(t,r,o)=>{let n=[...t,...r];return o&&n.includes(o)?o:n[0]??""},es=(t,r)=>r&&t.some(o=>o.fieldId===r)?r:t[0]?.fieldId??"",Dl=(t,r,o)=>o===""?"":o&&o!==r&&t.some(n=>n.fieldId===o)?o:t.find(n=>n.fieldId!==r)?.fieldId??"",Qu=t=>{let r=new Set,o=n=>{n.forEach(a=>{a.children.length>0&&(r.add(a.key),o(a.children));});};return o(t),r},Ju=(t,r,o=0)=>t.length===0?o:t.reduce((n,a)=>a.children.length===0||!r.has(a.key)?Math.max(n,o+1):Math.max(n,Ju(a.children,r,o+1)),o),ey=(t,r)=>{let o=[],n=a=>{a.forEach(i=>{if(i.children.length>0&&r.has(i.key)){n(i.children);return}o.push(i);});};return n(t),o},gO=({title:t,rows:r,fields:o,initialLayout:n,initialChart:a,emptyText:i,maxPreviewHeight:s=520,initialChartCollapsed:l=false,initialTableCollapsed:d=false,model:u,enablePresetManagement:p=false,presets:f,defaultPresets:b,onPresetsChange:m,initialPresetId:v,onPresetApplied:y})=>{let{t:g}=pe(),x=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),h=er.useRef(0),C=er.useRef(false),k=t??g("pivot.title.default"),w=i??g("pivot.empty"),T=er.useMemo(()=>({sum:g("pivot.agg.sum"),count:g("pivot.agg.count"),avg:g("pivot.agg.avg"),min:g("pivot.agg.min"),max:g("pivot.agg.max")}),[g]),I=er.useCallback(D=>T[D]??Au[D],[T]),S=er.useMemo(()=>new Set(o.map(D=>D.id)),[o]),A=er.useMemo(()=>new Map(o.map(D=>[D.id,D])),[o]),[R,M]=er.useState(()=>lr(n?.rows,S)),[N,E]=er.useState(()=>lr(n?.columns,S)),[O,F]=er.useState(()=>lr(n?.filters,S)),[_,B]=er.useState(()=>{let D=n?.values??[],G=new Set,U=[];return D.forEach(de=>{if(!S.has(de.fieldId)||G.has(de.fieldId))return;G.add(de.fieldId),h.current+=1;let He=A.get(de.fieldId);U.push({tokenId:`v${h.current}`,fieldId:de.fieldId,aggregation:vr(de.aggregation,He)});}),U}),[Y,W]=er.useState({}),[j,V]=er.useState(true),[z,K]=er.useState(false),[q,fe]=er.useState(()=>Rl(lr(n?.rows,S),lr(n?.columns,S),a?.dimensionFieldId)),[se,ue]=er.useState(()=>{let D=(n?.values??[]).filter((G,U,de)=>S.has(G.fieldId)&&de.findIndex(He=>He.fieldId===G.fieldId)===U).map(G=>({tokenId:G.fieldId,fieldId:G.fieldId,aggregation:vr(G.aggregation,A.get(G.fieldId))}));return es(D,a?.primaryValueFieldId)}),[Se,$e]=er.useState(()=>{let D=(n?.values??[]).filter((U,de,He)=>S.has(U.fieldId)&&He.findIndex(ot=>ot.fieldId===U.fieldId)===de).map(U=>({tokenId:U.fieldId,fieldId:U.fieldId,aggregation:vr(U.aggregation,A.get(U.fieldId))})),G=es(D,a?.primaryValueFieldId);return Dl(D,G,a?.secondaryValueFieldId)}),[ke,le]=er.useState(a?.chartType??"bar-vertical"),[Ee,Me]=er.useState(l),[Pe,Ve]=er.useState(d),[tt,nt]=er.useState(()=>b??[]),[it,X]=er.useState(""),[De,ye]=er.useState(false),[Be,at]=er.useState(""),[Ze,St]=er.useState(null),[Mt,Ot]=er.useState(new Set(["__grand_total__"])),[At,re]=er.useState(new Set),Ke=u?.rowFields??R,Fe=u?.columnFields??N,ce=u?.filterFields??O,ve=u?.valueFields??_,te=u?.filterSelections??Y,he=u?.showGrandTotal??j,Ne=u?.isConfiguratorCollapsed??z,Je=u?.chartDimensionFieldId??q,st=u?.chartPrimaryValueFieldId??se,pt=u?.chartSecondaryValueFieldId??Se,Bt=u?.chartType??ke,Xt=u?.isChartCollapsed??Ee,Vt=u?.isTableCollapsed??Pe,wt=f??tt,Wt=p||wt.length>0||!!m,ht=er.useCallback(D=>{if(u?.setRowFields){u.setRowFields(D);return}M(D);},[u]),Nt=er.useCallback(D=>{if(u?.setColumnFields){u.setColumnFields(D);return}E(D);},[u]),lt=er.useCallback(D=>{if(u?.setFilterFields){u.setFilterFields(D);return}F(D);},[u]),Ft=er.useCallback(D=>{if(u?.setValueFields){u.setValueFields(D);return}B(D);},[u]),Yt=er.useCallback(D=>{if(u?.setFilterSelections){u.setFilterSelections(D);return}W(D);},[u]),Z=er.useCallback(D=>{if(u?.setShowGrandTotal){u.setShowGrandTotal(D);return}V(D);},[u]),$=er.useCallback(D=>{if(u?.setIsConfiguratorCollapsed){u.setIsConfiguratorCollapsed(D);return}K(D);},[u]),Q=er.useCallback(D=>{if(u?.setChartDimensionFieldId){u.setChartDimensionFieldId(D);return}fe(D);},[u]),be=er.useCallback(D=>{if(u?.setChartPrimaryValueFieldId){u.setChartPrimaryValueFieldId(D);return}ue(D);},[u]),Ce=er.useCallback(D=>{if(u?.setChartSecondaryValueFieldId){u.setChartSecondaryValueFieldId(D);return}$e(D);},[u]),Le=er.useCallback(D=>{if(u?.setChartType){u.setChartType(D);return}le(D);},[u]),_e=er.useCallback(D=>{if(u?.setIsChartCollapsed){u.setIsChartCollapsed(D);return}Me(D);},[u]),qe=er.useCallback(D=>{if(u?.setIsTableCollapsed){u.setIsTableCollapsed(D);return}Ve(D);},[u]),je=er.useCallback(D=>{let G=typeof D=="function"?D(wt):D;f||nt(G),m?.(G);},[m,wt,f]),mt=er.useMemo(()=>new Set([...Ke,...Fe,...ce]),[Ke,Fe,ce]),ft=er.useMemo(()=>o.filter(D=>!mt.has(D.id)),[o,mt]),Rt=er.useMemo(()=>{let D=[...Ke,...Fe,...ce],G=new Set,U=[];return D.forEach(de=>{G.has(de)||(G.add(de),U.push(de));}),U},[Fe,ce,Ke]);er.useEffect(()=>{ht(D=>{let G=D.filter(U=>S.has(U));return uo(D,G)?D:G}),Nt(D=>{let G=D.filter(U=>S.has(U));return uo(D,G)?D:G}),lt(D=>{let G=D.filter(U=>S.has(U));return uo(D,G)?D:G}),Ft(D=>{let G=D.filter(U=>S.has(U.fieldId)).map(U=>({...U,aggregation:vr(U.aggregation,A.get(U.fieldId))}));return qi(D,G)?D:G});},[A,S]);let yt=er.useMemo(()=>{let D={};return Rt.forEach(G=>{let U=new Set;r.forEach(de=>{U.add(po(de[G]));}),D[G]=Array.from(U).sort((de,He)=>de.localeCompare(He));}),D},[Rt,r]);er.useEffect(()=>{Yt(D=>{let G={};return Rt.forEach(U=>{let de=yt[U]??[],ot=(D[U]??[]).filter(oe=>de.includes(oe)),Ge=Object.prototype.hasOwnProperty.call(D,U);G[U]=Ge?ot:de;}),Hu(D,G)?D:G});},[Rt,yt]),er.useEffect(()=>{Q(D=>Rl(Ke,Fe,D));},[Fe,Ke,Q]),er.useEffect(()=>{be(D=>es(ve,D));},[be,ve]),er.useEffect(()=>{Ce(D=>Dl(ve,st,D));},[st,Ce,ve]);let H=er.useMemo(()=>r.filter(D=>Rt.every(G=>{let U=te[G]??[],de=yt[G]??[];if(U.length===de.length)return true;if(U.length===0)return false;let He=po(D[G]);return U.includes(He)})),[Rt,yt,te,r]),J=er.useMemo(()=>{if(ve.length===0)return null;let D=new Map;if(H.forEach(Ge=>{let oe=Fe.length>0?Fe.map(ee=>po(Ge[ee])):[g("pivot.valueLabel")],me=_o(oe);D.set(me,oe);}),D.size===0){let Ge=Fe.length>0?Fe.map(()=>Ui):[g("pivot.valueLabel")];D.set(_o(Ge),Ge);}let G=Array.from(D.entries()).sort((Ge,oe)=>Bu(Ge[1],oe[1])),U=G.flatMap(([Ge,oe])=>ve.map(me=>{let ee=A.get(me.fieldId),Oe=`${I(me.aggregation)} ${ee?.label??me.fieldId}`,Qe=Fe.length===0||ve.length>1?`${oe.join(" / ")} \u2022 ${Oe}`:oe.join(" / ");return {id:`${Ge}::${me.tokenId}`,colKey:Ge,valueItem:me,label:Qe}})),de=[];Fe.length>0&&G.forEach(([Ge,oe])=>{let me=U.filter(Qe=>Qe.colKey===Ge),ee=de,Oe=[];oe.forEach((Qe,Re)=>{Oe.push(`d${Re}:${Qe}`);let Ye=`col::${_o(Oe)}`,Pt=ee.find(Qo=>Qo.key===Ye);Pt||(Pt={key:Ye,label:Qe,children:[],leafColumnIds:[],path:oe.slice(0,Re+1),depth:Re},ee.push(Pt)),me.forEach(Qo=>{Pt.leafColumnIds.includes(Qo.id)||Pt.leafColumnIds.push(Qo.id);}),ee=Pt.children;});});let He=Ge=>{let oe={};return U.forEach(me=>{let ee=Ge.filter(Oe=>{let Qe=Fe.length>0?Fe.map(Re=>po(Oe[Re])):[g("pivot.valueLabel")];return _o(Qe)===me.colKey});oe[me.id]=wn(ee,me.valueItem.fieldId,me.valueItem.aggregation);}),oe},ot=[];if(Ke.length===0)ot.push({key:"root",value:g("pivot.resultLabel")||Du,children:[],isLeaf:true,aggregatedValues:He(H),path:[],depth:0});else {let Ge=(oe,me,ee)=>{if(me>=Ke.length)return [];let Oe=Ke[me],Qe=new Map;return oe.forEach(Re=>{let Ye=po(Re[Oe]);Qe.has(Ye)||Qe.set(Ye,[]),Qe.get(Ye).push(Re);}),Array.from(Qe.keys()).sort().map(Re=>{let Ye=Qe.get(Re),Pt=[...ee,Re];return {key:_o(Pt),value:Re,fieldId:Oe,aggregatedValues:He(Ye),children:Ge(Ye,me+1,Pt),isLeaf:me===Ke.length-1,path:Pt,depth:me}})};ot.push(...Ge(H,0,[]));}return {dataColumns:U,columnTree:de,rowTree:ot}},[Fe,A,H,I,Ke,g,ve]),ge=er.useCallback((D,G)=>(h.current+=1,{tokenId:`v${h.current}`,fieldId:D,aggregation:vr(G,A.get(D))}),[A]),Te=er.useCallback(D=>{if(D==="rows")return ht([]);if(D==="columns")return Nt([]);if(D==="filters")return lt([]);Ft([]);},[]),et=er.useCallback((D,G)=>{if(D==="rows")return ht(U=>U.filter(de=>de!==G));if(D==="columns")return Nt(U=>U.filter(de=>de!==G));if(D==="filters")return lt(U=>U.filter(de=>de!==G));Ft(U=>U.filter(de=>de.tokenId!==G));},[]),Xe=er.useCallback((D,G)=>{Ft(U=>U.map(de=>de.tokenId===D?{...de,aggregation:vr(G,A.get(de.fieldId))}:de));},[A]),kt=er.useCallback(D=>{St(String(D.active.id));},[]),bt=er.useCallback(D=>{if(St(null),!D.over)return;let G=Ki(String(D.active.id)),U=Ki(String(D.over.id));if(!G||!U||G.kind!=="item"||!G.key)return;if(G.zone===U.zone&&U.kind==="item"){if(G.zone==="rows"){let Re=Ke.indexOf(G.key),Ye=Ke.indexOf(U.key??"");Re!==-1&&Ye!==-1&&Re!==Ye&&ht(Pt=>sortable.arrayMove(Pt,Re,Ye));return}if(G.zone==="columns"){let Re=Fe.indexOf(G.key),Ye=Fe.indexOf(U.key??"");Re!==-1&&Ye!==-1&&Re!==Ye&&Nt(Pt=>sortable.arrayMove(Pt,Re,Ye));return}if(G.zone==="filters"){let Re=ce.indexOf(G.key),Ye=ce.indexOf(U.key??"");Re!==-1&&Ye!==-1&&Re!==Ye&&lt(Pt=>sortable.arrayMove(Pt,Re,Ye));return}if(G.zone==="values"){let Re=ve.findIndex(Pt=>Pt.tokenId===G.key),Ye=ve.findIndex(Pt=>Pt.tokenId===(U.key??""));Re!==-1&&Ye!==-1&&Re!==Ye&&Ft(Pt=>sortable.arrayMove(Pt,Re,Ye));}return}let de=U.zone,He=[...Ke],ot=[...Fe],Ge=[...ce],oe=[...ve],me="",ee=null;if(G.zone==="palette")me=G.key;else if(G.zone==="values"){let Re=oe.find(Ye=>Ye.tokenId===G.key);if(!Re)return;me=Re.fieldId,ee=Re,oe=oe.filter(Ye=>Ye.tokenId!==G.key);}else G.zone==="rows"?(me=G.key,He=He.filter(Re=>Re!==me)):G.zone==="columns"?(me=G.key,ot=ot.filter(Re=>Re!==me)):G.zone==="filters"&&(me=G.key,Ge=Ge.filter(Re=>Re!==me));if(!me)return;let Oe=()=>{He=He.filter(Re=>Re!==me),ot=ot.filter(Re=>Re!==me),Ge=Ge.filter(Re=>Re!==me);},Qe=Re=>{if(U.kind!=="item"||!U.key)return Re==="rows"?He.length:Re==="columns"?ot.length:Re==="filters"?Ge.length:Re==="values"?oe.length:0;if(Re==="rows"){let Ye=He.indexOf(U.key);return Ye>=0?Ye:He.length}if(Re==="columns"){let Ye=ot.indexOf(U.key);return Ye>=0?Ye:ot.length}if(Re==="filters"){let Ye=Ge.indexOf(U.key);return Ye>=0?Ye:Ge.length}if(Re==="values"){let Ye=oe.findIndex(Pt=>Pt.tokenId===U.key);return Ye>=0?Ye:oe.length}return 0};if(de==="palette"){ht(He),Nt(ot),lt(Ge),Ft(oe);return}if(de==="values"){let Re=Qe("values"),Ye=ee??ge(me);oe.splice(Re,0,Ye),ht(He),Nt(ot),lt(Ge),Ft(oe);return}if(Fu(de)){Oe();let Re=Qe(de);de==="rows"?He.splice(Re,0,me):de==="columns"?ot.splice(Re,0,me):Ge.splice(Re,0,me),ht(He),Nt(ot),lt(Ge),Ft(oe);}},[Fe,ge,ce,Ke,ve]),gt=er.useCallback((D,G)=>{Yt(U=>({...U,[D]:G}));},[]),Ct=er.useCallback(D=>{Ot(G=>{let U=new Set(G);return U.has(D)?U.delete(D):U.add(D),U});},[]),nr=er.useCallback(D=>{re(G=>{let U=new Set(G);return U.has(D)?U.delete(D):U.add(D),U});},[]),Et=er.useCallback(D=>{let G=A.get(D.fieldId),U=Pl(G);return e(Co,{size:"small",sx:{minWidth:98},children:e(zt,{value:D.aggregation,onChange:de=>Xe(D.tokenId,de.target.value),onClick:de=>de.stopPropagation(),onMouseDown:de=>de.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& select.orb-inp":{py:.35}},children:U.map(de=>e("option",{value:de,sx:{fontSize:"0.75rem"},children:I(de)},de))})})},[A,I,Xe]),Zt=er.useCallback(D=>{let G=yt[D]??[],U=te[D]??G;return G.length===0?g("pivot.filter.noValues"):U.length===0?g("pivot.filter.noneSelected"):U.length===G.length?g("pivot.filter.allValues"):g("pivot.filter.selectedCount",{selected:U.length,total:G.length})},[yt,te,g]),Ht=er.useCallback(D=>{let G=yt[D]??[],U=te[D]??G;return e(Vu,{options:G,selectedValues:U,onChange:de=>gt(D,de)})},[yt,te,gt]),Kt=er.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),$t=er.useCallback(()=>{let D={};return new Set([...Rt,...Object.keys(te)]).forEach(U=>{if(!S.has(U))return;let de=te[U]??[];D[U]=[...de];}),{layout:{rows:[...Ke],columns:[...Fe],filters:[...ce],values:ve.map(U=>({fieldId:U.fieldId,aggregation:U.aggregation}))},filterSelections:D,showGrandTotal:he,chart:{dimensionFieldId:Je,primaryValueFieldId:st,secondaryValueFieldId:pt,chartType:Bt}}},[Rt,Je,st,pt,Bt,Fe,ce,te,Ke,he,S,ve]),rr=er.useCallback(D=>{let G=lr(D.layout.rows,S),U=lr(D.layout.columns,S),de=lr(D.layout.filters,S),He=new Set,ot=(D.layout.values??[]).filter(me=>!S.has(me.fieldId)||He.has(me.fieldId)?false:(He.add(me.fieldId),true)).map(me=>ge(me.fieldId,me.aggregation)),Ge={};Object.entries(D.filterSelections??{}).forEach(([me,ee])=>{!S.has(me)||!Array.isArray(ee)||(Ge[me]=Array.from(new Set(ee.map(Oe=>String(Oe)))));}),ht(G),Nt(U),lt(de),Ft(ot),Yt(Ge),typeof D.showGrandTotal=="boolean"&&Z(D.showGrandTotal),Q(Rl(G,U,D.chart?.dimensionFieldId));let oe=es(ot,D.chart?.primaryValueFieldId);be(oe),Ce(Dl(ot,oe,D.chart?.secondaryValueFieldId)),Le(D.chart?.chartType??"bar-vertical"),X(D.id),y?.(D);},[ge,y,Q,be,Ce,Le,Nt,lt,Yt,ht,Z,Ft,S]),ar=er.useCallback(D=>{if(!D){X("");return}let G=wt.find(U=>U.id===D);if(!G){X("");return}rr(G);},[rr,wt]),fr=er.useCallback(()=>{let D=g("pivot.preset.defaultName",{index:wt.length+1});at(D),ye(true);},[wt.length,g]),Ir=er.useCallback(()=>{let D=Be.trim();if(!D)return;let G={id:Kt(),name:D,...$t()};je(U=>[...U,G]),X(G.id),ye(false);},[$t,Kt,Be,je]),Mr=er.useCallback(()=>{it&&(je(D=>D.filter(G=>G.id!==it)),X(""));},[it,je]);er.useEffect(()=>{if(!v||C.current)return;let D=wt.find(G=>G.id===v);D&&(C.current=true,rr(D));},[rr,v,wt]),er.useEffect(()=>{it&&(wt.some(D=>D.id===it)||X(""));},[it,wt]);let no=er.useMemo(()=>{if(!he||!J||!Ke.length)return null;let D={};return J.dataColumns.forEach(G=>{let U=H.filter(de=>{let He=Fe.length>0?Fe.map(ot=>po(de[ot])):[g("pivot.valueLabel")];return _o(He)===G.colKey});D[G.id]=wn(U,G.valueItem.fieldId,G.valueItem.aggregation);}),{key:"__grand_total__",value:g("pivot.grandTotal")||Nu,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:D,path:[],depth:-1}},[he,J,H,Fe,Ke.length,g]),yr=er.useMemo(()=>Qu(J?.rowTree??[]),[J]),Or=er.useMemo(()=>Qu(J?.columnTree??[]),[J]);er.useEffect(()=>{Ot(D=>{let G=new Set;return D.has("__grand_total__")&&G.add("__grand_total__"),yr.forEach(U=>{D.has(U)&&G.add(U);}),G});},[yr]),er.useEffect(()=>{re(D=>{let G=new Set;return Or.forEach(U=>{D.has(U)&&G.add(U);}),G});},[Or]);let qo=er.useCallback(()=>{Ot(D=>{let G=new Set(D);return yr.forEach(U=>G.add(U)),G});},[yr]),Xo=er.useCallback(()=>{Ot(D=>{let G=new Set;return D.has("__grand_total__")&&G.add("__grand_total__"),G});},[]),Lo=er.useCallback(()=>{re(new Set(Or));},[Or]),Yo=er.useCallback(()=>{re(new Set);},[]),Zo=er.useMemo(()=>!J||Fe.length===0?[]:ey(J.columnTree,At),[Fe.length,At,J]),Rr=er.useMemo(()=>{if(!J)return [];if(Fe.length===0)return J.dataColumns.map(G=>({id:G.id,label:G.label,leafColumnIds:[G.id],valueItem:G.valueItem}));let D=new Map(J.dataColumns.map(G=>[G.id,G]));return Zo.flatMap(G=>{let U=new Map;return G.leafColumnIds.forEach(de=>{let He=D.get(de);if(!He)return;let ot=He.valueItem.tokenId,Ge=`${I(He.valueItem.aggregation)} ${A.get(He.valueItem.fieldId)?.label??He.valueItem.fieldId}`,oe=U.get(ot);if(oe){oe.leafColumnIds.push(de);return}U.set(ot,{id:`${G.key}::${ot}`,label:ve.length>1?Ge:G.label,leafColumnIds:[de],valueItem:He.valueItem});}),Array.from(U.values())})},[Fe.length,A,I,J,ve.length,Zo]),Oo=er.useMemo(()=>new Map(Rr.map(D=>[D.id,D])),[Rr]),jo=er.useMemo(()=>Rr.map(D=>({id:D.id,colKey:D.id,valueItem:D.valueItem,label:D.label})),[Rr]),Kr=er.useMemo(()=>{if(!J||Fe.length===0)return [];let D=[],G=Ju(J.columnTree,At),U=G+(ve.length>1?1:0),de=(He,ot)=>{D[ot]??(D[ot]=[]),He.forEach(Ge=>{let oe=Ge.children.length>0&&At.has(Ge.key),me=Rr.filter(Oe=>Ge.leafColumnIds.some(Qe=>Oe.leafColumnIds.includes(Qe))).length,ee=oe||ve.length>1?1:U-ot;D[ot].push({key:Ge.key,label:Ge.label,colSpan:me,rowSpan:ee,expandable:Ge.children.length>0,expanded:oe}),oe&&de(Ge.children,ot+1);});};return de(J.columnTree,0),ve.length>1&&(D[G]=Rr.map(He=>({key:He.id,label:He.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),D},[Fe.length,At,J,ve.length,Rr]),ao=er.useCallback((D,G)=>G.leafColumnIds.reduce((U,de)=>U+(D.aggregatedValues[de]??0),0),[]),Ln=er.useMemo(()=>c(jsxRuntime.Fragment,{children:[e(we,{size:"small",variant:"text",onClick:qo,disabled:yr.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.expandRowsAll")}),e(we,{size:"small",variant:"text",onClick:Xo,disabled:yr.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.collapseRowsAll")}),e(Dt,{orientation:"vertical",flexItem:true}),e(we,{size:"small",variant:"text",onClick:Lo,disabled:Or.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.expandColumnsAll")}),e(we,{size:"small",variant:"text",onClick:Yo,disabled:Fe.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.collapseColumnsAll")})]}),[Fe.length,Or.size,yr.size,Yo,Xo,Lo,qo,g]),Fo=()=>{if(!Ze)return null;let D=Ki(Ze);if(!D||D.kind!=="item"||!D.key)return null;if(D.zone==="palette"){let He=A.get(D.key);return He?e(Tl,{label:He.label,subtitle:He.type}):null}if(D.zone==="values"){let He=ve.find(me=>me.tokenId===D.key);if(!He)return null;let Ge=A.get(He.fieldId)?.label??He.fieldId,oe=`${I(He.aggregation)}(${Ge})`;return e(Xi,{label:Ge,caption:oe})}let U=A.get(D.key)?.label??D.key,de=Zt(D.key);return e(Xi,{label:U,caption:de})};return c(Ae,{sx:D=>({p:{xs:1.2,md:2},borderRadius:"var(--orb-r-container)",border:`1px solid ${D.palette.divider}`,bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-2)",display:"flex",flexDirection:"column",gap:2.25}),children:[c("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[c("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.35},children:[e(L,{component:"div",sx:{fontSize:"1.08rem",fontWeight:700,lineHeight:1.25,color:"var(--orb-fg-strong)"},children:k}),e(L,{component:"div",sx:{fontSize:"0.8rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.subtitle.default")})]}),c(ie,{direction:"row",spacing:1.5,alignItems:"center",children:[Wt&&c(jsxRuntime.Fragment,{children:[e(Co,{size:"small",sx:{minWidth:200},children:c(zt,{value:it,displayEmpty:true,onChange:D=>ar(String(D.target.value)),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g("pivot.preset.selectPlaceholder")}),wt.map(D=>e("option",{value:D.id,sx:{fontSize:"0.75rem"},children:D.name},D.id))]})}),e(ct,{title:g("pivot.preset.save"),children:e(ae,{size:"small",onClick:fr,"aria-label":g("pivot.preset.save"),sx:{width:28,height:28,p:0},children:e(Po,{size:15})})}),e(ct,{title:g("pivot.preset.delete"),children:e("span",{children:e(ae,{size:"small",onClick:Mr,disabled:!it,"aria-label":g("pivot.preset.delete"),sx:{width:28,height:28,p:0},children:e(ni,{size:15})})})}),e(Dt,{flexItem:true,orientation:"vertical"})]}),c(L,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)"},children:[g("pivot.records"),": ",e("strong",{children:r.length.toLocaleString()})," / ",g("pivot.afterFilter"),":"," ",e("strong",{children:H.length.toLocaleString()})]}),e(Dt,{flexItem:true,orientation:"vertical"}),c("div",{sx:{display:"flex",alignItems:"center",gap:.6},children:[e(L,{component:"div",sx:{fontSize:"0.75rem",fontWeight:500,color:"var(--orb-fg-strong)"},children:g("pivot.grandTotal")}),e(ei,{size:"small",checked:he,onChange:D=>Z(D.target.checked)})]})]})]}),e(Dt,{}),c(core.DndContext,{sensors:x,collisionDetection:core.closestCenter,onDragStart:kt,onDragEnd:bt,children:[e(_u,{isConfiguratorCollapsed:Ne,onToggleCollapse:()=>$(D=>!D),availableFields:ft,fieldMap:A,filterFields:ce,columnFields:Fe,rowFields:Ke,valueFields:ve,clearZone:Te,removeFieldFromZone:et,getFilterSelectionSummary:Zt,renderDimensionFilterSelect:Ht,renderAggregationSelect:Et,getAggregationLabel:I}),e(Rd,{children:e(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Fo()})})]}),e(Zu,{rows:H,fieldMap:A,rowFields:Ke,columnFields:Fe,valueFields:ve,chartDimensionFieldId:Je,chartPrimaryValueFieldId:st,chartSecondaryValueFieldId:pt,chartType:Bt,isCollapsed:Xt,onChartDimensionFieldIdChange:D=>Q(D),onChartPrimaryValueFieldIdChange:D=>be(D),onChartSecondaryValueFieldIdChange:D=>Ce(D),onChartTypeChange:D=>Le(D),onToggleCollapse:()=>_e(D=>!D),getAggregationLabel:I}),e(Tn,{title:g("pivot.table.sectionTitle"),subtitle:Ke.length>0?Ke.map(D=>A.get(D)?.label??D).join(" > "):g("pivot.table.dimensions"),collapsed:Vt,onToggleCollapse:()=>qe(D=>!D),expandAriaLabel:g("pivot.table.collapse.ariaExpand"),collapseAriaLabel:g("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:Ln,children:J===null?e("div",{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:w})}):e("div",{sx:{maxHeight:s},children:c("table",{className:"orb-tbl",size:"small",stickyHeader:true,children:[e("thead",{children:(Kr.length>0?Kr:[[]]).map((D,G)=>c("tr",{children:[G===0&&e("td",{rowSpan:Math.max(Kr.length,1),sx:U=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:vt()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${U.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:Ke.length>0?Ke.map(U=>A.get(U)?.label).join(" > "):g("pivot.table.dimensions")}),(D.length>0?D:Rr.map(U=>({key:U.id,label:U.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(U=>e("td",{align:"center",colSpan:U.colSpan,rowSpan:U.rowSpan,sx:de=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:vt()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${de.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:c("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[U.expandable&&e(ae,{size:"small",onClick:()=>nr(U.key),sx:{width:22,height:22,p:0,ml:-0.2},children:U.expanded?e(Vr,{size:12}):e(ko,{size:12})}),e("div",{component:"span",children:U.label})]})},U.key))]},`pivot-header-row-${G}`))}),c("tbody",{children:[J.rowTree.map(D=>e(Qi,{node:D,dataColumns:jo,fieldMap:A,level:0,expandedKeys:Mt,onToggle:Ct,getValue:(G,U)=>{let de=Oo.get(U);return de?ao(G,de):0}},D.key)),no&&e(Qi,{node:no,dataColumns:jo,fieldMap:A,level:0,expandedKeys:Mt,onToggle:Ct,getValue:(D,G)=>{let U=Oo.get(G);return U?ao(D,U):0}})]})]})})}),c(Lt,{open:De,onClose:()=>ye(false),maxWidth:"xs",fullWidth:true,children:[e("div",{className:"orb-dialog-title",children:g("pivot.preset.saveDialogTitle")}),e("div",{className:"orb-dialog-content",children:e(ze,{autoFocus:true,fullWidth:true,margin:"dense",label:g("pivot.preset.nameLabel"),value:Be,onChange:D=>at(D.target.value),onKeyDown:D=>{D.key==="Enter"&&(D.preventDefault(),Ir());}})}),c("div",{className:"orb-dialog-actions",children:[e(we,{onClick:()=>ye(false),children:g("common.cancel")}),e(we,{variant:"contained",onClick:Ir,disabled:!Be.trim(),children:g("common.save")})]})]})]})};var em=(t,r,o)=>{let n=[...t,...r];return o&&n.includes(o)?o:n[0]??""},Al=(t,r)=>r&&t.some(o=>o.fieldId===r)?r:t[0]?.fieldId??"",tm=(t,r,o)=>o===""?"":o&&o!==r&&t.some(n=>n.fieldId===o)?o:t.find(n=>n.fieldId!==r)?.fieldId??"",yO=({fields:t,initialLayout:r,initialFilterSelections:o={},initialShowGrandTotal:n=true,initialConfiguratorCollapsed:a=false,initialChart:i,initialChartCollapsed:s=false,initialTableCollapsed:l=false})=>{let d=er.useRef(0),u=er.useMemo(()=>new Set(t.map(X=>X.id)),[t]),p=er.useMemo(()=>new Map(t.map(X=>[X.id,X])),[t]),[f,b]=er.useState(()=>lr(r?.rows,u)),[m,v]=er.useState(()=>lr(r?.columns,u)),[y,g]=er.useState(()=>lr(r?.filters,u)),[x,h]=er.useState(()=>{let X=r?.values??[],De=new Set,ye=[];return X.forEach(Be=>{!u.has(Be.fieldId)||De.has(Be.fieldId)||(De.add(Be.fieldId),d.current+=1,ye.push({tokenId:`v${d.current}`,fieldId:Be.fieldId,aggregation:vr(Be.aggregation,p.get(Be.fieldId))}));}),ye}),[C,k]=er.useState(o),[w,T]=er.useState(n),[I,S]=er.useState(a),[A,R]=er.useState(()=>em(lr(r?.rows,u),lr(r?.columns,u),i?.dimensionFieldId)),[M,N]=er.useState(()=>{let X=(()=>{let De=r?.values??[],ye=new Set,Be=[];return De.forEach(at=>{!u.has(at.fieldId)||ye.has(at.fieldId)||(ye.add(at.fieldId),Be.push({tokenId:at.fieldId,fieldId:at.fieldId,aggregation:vr(at.aggregation,p.get(at.fieldId))}));}),Be})();return Al(X,i?.primaryValueFieldId)}),[E,O]=er.useState(()=>{let X=(()=>{let ye=r?.values??[],Be=new Set,at=[];return ye.forEach(Ze=>{!u.has(Ze.fieldId)||Be.has(Ze.fieldId)||(Be.add(Ze.fieldId),at.push({tokenId:Ze.fieldId,fieldId:Ze.fieldId,aggregation:vr(Ze.aggregation,p.get(Ze.fieldId))}));}),at})(),De=Al(X,i?.primaryValueFieldId);return tm(X,De,i?.secondaryValueFieldId)}),[F,_]=er.useState(i?.chartType??"bar-vertical"),[B,Y]=er.useState(s),[W,j]=er.useState(l);er.useEffect(()=>{b(X=>{let De=X.filter(ye=>u.has(ye));return uo(X,De)?X:De}),v(X=>{let De=X.filter(ye=>u.has(ye));return uo(X,De)?X:De}),g(X=>{let De=X.filter(ye=>u.has(ye));return uo(X,De)?X:De}),h(X=>{let De=X.filter(ye=>u.has(ye.fieldId)).map(ye=>({...ye,aggregation:vr(ye.aggregation,p.get(ye.fieldId))}));return qi(X,De)?X:De});},[p,u]),er.useEffect(()=>{R(X=>em(f,m,X));},[m,f]),er.useEffect(()=>{N(X=>Al(x,X));},[x]),er.useEffect(()=>{O(X=>tm(x,M,X));},[M,x]);let V=er.useCallback(X=>{b(lr(X,u));},[u]),z=er.useCallback(X=>{v(lr(X,u));},[u]),K=er.useCallback(X=>{g(lr(X,u));},[u]),q=er.useCallback(X=>{h(De=>{let ye=X??[],Be=new Set,at=[];return ye.forEach(Ze=>{if(!u.has(Ze.fieldId)||Be.has(Ze.fieldId))return;Be.add(Ze.fieldId);let St=De.find(Mt=>Mt.fieldId===Ze.fieldId);if(St){at.push({...St,aggregation:vr(Ze.aggregation??St.aggregation,p.get(Ze.fieldId))});return}d.current+=1,at.push({tokenId:`v${d.current}`,fieldId:Ze.fieldId,aggregation:vr(Ze.aggregation,p.get(Ze.fieldId))});}),at});},[p,u]),fe=er.useCallback(X=>{V(X.rows??[]),z(X.columns??[]),K(X.filters??[]),q(X.values??[]);},[z,K,V,q]),se=er.useCallback(X=>{if(X==="rows")return b([]);if(X==="columns")return v([]);if(X==="filters")return g([]);h([]);},[]),ue=er.useCallback((X,De)=>{if(X==="rows")return b(ye=>ye.filter(Be=>Be!==De));if(X==="columns")return v(ye=>ye.filter(Be=>Be!==De));if(X==="filters")return g(ye=>ye.filter(Be=>Be!==De));h(ye=>ye.filter(Be=>Be.tokenId!==De));},[]),Se=er.useCallback((X,De)=>{h(ye=>ye.map(Be=>Be.tokenId===X?{...Be,aggregation:vr(De,p.get(Be.fieldId))}:Be));},[p]),$e=er.useCallback((X,De)=>{k(ye=>({...ye,[X]:De}));},[]),ke=er.useCallback(()=>{k({});},[]),le=er.useCallback(()=>{T(X=>!X);},[]),Ee=er.useCallback(()=>{S(X=>!X);},[]),Me=er.useCallback(X=>{R(X);},[]),Pe=er.useCallback(X=>{N(X);},[]),Ve=er.useCallback(X=>{O(X);},[]),tt=er.useCallback(()=>{Y(X=>!X);},[]),nt=er.useCallback(()=>{j(X=>!X);},[]);return {model:er.useMemo(()=>({rowFields:f,setRowFields:b,columnFields:m,setColumnFields:v,filterFields:y,setFilterFields:g,valueFields:x,setValueFields:h,filterSelections:C,setFilterSelections:k,showGrandTotal:w,setShowGrandTotal:T,isConfiguratorCollapsed:I,setIsConfiguratorCollapsed:S,chartDimensionFieldId:A,setChartDimensionFieldId:R,chartPrimaryValueFieldId:M,setChartPrimaryValueFieldId:N,chartSecondaryValueFieldId:E,setChartSecondaryValueFieldId:O,chartType:F,setChartType:_,isChartCollapsed:B,setIsChartCollapsed:Y,isTableCollapsed:W,setIsTableCollapsed:j}),[A,M,E,F,m,y,C,B,I,W,f,w,x]),actions:{setRows:V,setColumns:z,setFilters:K,setValues:q,setLayout:fe,clearZone:se,removeFieldFromZone:ue,setAggregationForValue:Se,setFilterSelection:$e,resetFilterSelections:ke,toggleGrandTotal:le,toggleConfigurator:Ee,setChartDimension:Me,setChartPrimaryValue:Pe,setChartSecondaryValue:Ve,setChartType:_,toggleChart:tt,toggleTable:nt}}};var wO=({orientation:t="auto",defaultNavigationOpen:r,onNavOpenChange:o}={})=>{let n=sr(),a=xo("(orientation: portrait)"),i=xo(n.breakpoints.down("md")),s=er.useMemo(()=>t==="auto"?a||i?"portrait":"landscape":t,[i,a,t]),[l,d]=er.useState(r??s==="landscape");er.useEffect(()=>{d(r??s==="landscape");},[r,s]);let u=f=>{d(f),o?.(f);};return {resolvedOrientation:s,isPortraitViewport:a,isCompactViewport:i,navigationOpen:l,setNavigationOpen:u,toggleNavigationOpen:()=>u(!l)}};var iy=t=>{let r=Number(t||0);return Number.isFinite(r)?r:0},TO=({rows:t,rowKey:r="id",numericField:o,defaultSelectedId:n})=>{let i=t[0]?.[r],[s,l]=er.useState(n??i),d=er.useMemo(()=>t.find(m=>m[r]===s)||t[0],[r,t,s]),[u,p]=er.useState(()=>{let m=d?.[o];return m==null?"0":String(m)});return {selectedId:s,selectedRecord:d,editorValue:u,setEditorValue:p,selectRecord:m=>{let v=m[r];l(v);let y=m[o];p(y==null?"0":String(y));},applyEditorValue:m=>{if(s===void 0)return;let v=iy(u),y=t.map(g=>g[r]===s?{...g,[o]:v}:g);m(y);}}};P();var sy=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],om=(t,r,o,n)=>{r?.(t),n&&o?.();},AO=({open:t,onClose:r,title:o="Scan barcode",subtitle:n="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:a=sy,facingMode:i="environment",manualEntry:s=true,autoCloseOnDetect:l=true,scanIntervalMs:d=600,confirmLabel:u="Use code",cancelLabel:p="Close",manualPlaceholder:f="Enter barcode manually",onDetected:b,onError:m,sx:v})=>{let y=er__namespace.default.useRef(null),g=er__namespace.default.useRef(null),x=er__namespace.default.useRef(null),h=er__namespace.default.useRef(null),[C,k]=er__namespace.default.useState("idle"),[w,T]=er__namespace.default.useState(""),[I,S]=er__namespace.default.useState(null),[A,R]=er__namespace.default.useState(null),M=er__namespace.default.useCallback(()=>{x.current!==null&&(window.clearInterval(x.current),x.current=null),g.current&&(g.current.getTracks().forEach(O=>O.stop()),g.current=null),y.current&&(y.current.srcObject=null);},[]),N=er__namespace.default.useCallback(O=>{R(O),k("error"),m?.(O);},[m]);er__namespace.default.useEffect(()=>{if(!t){M(),k("idle"),R(null),T("");return}let O=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){k("unsupported"),R("Camera access is not supported in this browser.");return}k("starting"),R(null);try{let _=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:i}}});if(O){_.getTracks().forEach(B=>B.stop());return}if(g.current=_,y.current&&(y.current.srcObject=_,await y.current.play()),!window.BarcodeDetector){k("unsupported"),R("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}h.current=new window.BarcodeDetector({formats:a}),k("ready"),x.current=window.setInterval(async()=>{if(!(!y.current||!h.current)&&!(y.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let Y=(await h.current.detect(y.current)).find(j=>j.rawValue);if(!Y?.rawValue)return;let W={rawValue:Y.rawValue,format:Y.format};S(W),M(),om(W,b,r,l);}catch(B){N(B instanceof Error?B.message:"Failed to detect barcode.");}},d);}catch(_){N(_ instanceof Error?_.message:"Unable to start camera.");}}})(),()=>{O=true,M();}},[l,i,a,r,b,t,N,d,M]);let E=()=>{let O=w.trim();if(!O)return;let F={rawValue:O,format:"manual"};S(F),om(F,b,r,l);};return c(Lt,{open:t,onClose:r,fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:900},children:o}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c(ie,{spacing:2,sx:v,children:[e(L,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:n}),c(Ae,{elevation:0,sx:{position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:vt()==="dark"?"linear-gradient(180deg, color-mix(in oklch, var(--orb-canvas) 92%, transparent), color-mix(in oklch, var(--orb-canvas) 96%, transparent))":"linear-gradient(180deg, var(--orb-surface), color-mix(in oklch, var(--orb-border) 92%, transparent))"},children:[e("video",{ref:y,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),e("div",{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:e("div",{sx:{width:"72%",maxWidth:320,aspectRatio:"1.7 / 1",borderRadius:3,border:"2px solid rgba(255,255,255,0.95)",boxShadow:"0 0 0 999px rgba(15,23,42,0.24)",position:"relative"},children:e("div",{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"var(--orb-ai-accent)",boxShadow:"0 0 18px color-mix(in oklch, var(--orb-ai-accent) 85%, transparent)"}})})}),c("div",{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[e(xt,{icon:e($d,{}),label:C==="ready"?"Camera ready":C==="starting"?"Starting camera":C==="unsupported"?"Preview only":C==="error"?"Scanner error":"Idle",size:"small",color:C==="error"?"error":"primary",variant:"filled"}),I?e(xt,{icon:e(sp,{}),label:`${I.format||"barcode"}: ${I.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),A?e(jr,{severity:C==="unsupported"?"info":"warning",children:A}):null,s?c(ie,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[e(ze,{fullWidth:true,label:"Barcode",placeholder:f,value:w,onChange:O=>T(O.target.value)}),e(we,{variant:"contained",onClick:E,sx:{minHeight:56,px:2.5},children:u})]}):null]})}),e("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:e(we,{onClick:r,children:p})})]})};P();var ly={default:"var(--orb-status-fg)",primary:"var(--orb-status-primary)",success:"var(--orb-status-success)",warning:"var(--orb-status-warning)",error:"var(--orb-status-error)",info:"var(--orb-status-info)"},zO=({title:t,description:r,kicker:o,icon:n,badges:a=[],metrics:i=[],footer:s,children:l,selected:d=false,draggable:u=false,isDragging:p=false,swipeThreshold:f=88,startAction:b,endAction:m,dragHandleProps:v,onClick:y,onSwipe:g,sx:x})=>{let[h,C]=er.useState(0),[k,w]=er.useState(false),T=er.useRef(null),I=er.useRef(0),S=er.useRef(0),A=!!(b||m),R=132,M=()=>{C(0),w(false),T.current=null,I.current=0,S.current=0;},N=B=>{(B==="start"?b:m)?.onTrigger?.(),g?.(B),M();},E=B=>{!A||B.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(T.current=B.pointerId,I.current=B.clientX,S.current=B.clientX,w(true),B.currentTarget.setPointerCapture(B.pointerId));},O=B=>{if(!k||T.current!==B.pointerId)return;S.current=B.clientX;let Y=S.current-I.current,W=Math.max(-R,Math.min(R,Y));C(W);},F=B=>{if(!k||T.current!==B.pointerId)return;let Y=S.current-I.current;if(Y>=f&&b){N("start");return}if(Y<=-f&&m){N("end");return}Math.abs(Y)<12&&y?.(),M();},_=(B,Y)=>{if(!B)return null;let W=B.backgroundColor||ly[B.tone||"default"];return e("div",{sx:{position:"absolute",top:0,bottom:0,[Y]:0,width:R,px:2,display:"flex",alignItems:"center",justifyContent:Y==="left"?"flex-start":"flex-end",color:"var(--orb-on-primary)",background:`linear-gradient(135deg, ${W}, rgba(15,23,42,0.92))`},children:c(ie,{direction:"row",spacing:1,alignItems:"center",children:[B.icon,e(L,{sx:{fontWeight:700,fontSize:"0.95rem"},children:B.label})]})})};return c("div",{sx:{position:"relative",overflow:"hidden",borderRadius:4,...x},children:[_(b,"left"),_(m,"right"),e(Ae,{elevation:0,onPointerDown:E,onPointerMove:O,onPointerUp:F,onPointerCancel:M,sx:{position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:vt()==="dark"?"linear-gradient(180deg, color-mix(in oklch, var(--orb-surface-3) 96%, transparent), color-mix(in oklch, var(--orb-canvas) 92%, transparent))":"linear-gradient(180deg, var(--orb-canvas), var(--orb-surface))",color:"text.primary",boxShadow:d?"0 18px 42px color-mix(in oklch, var(--orb-primary) 18%, transparent)":"0 12px 28px rgba(15, 23, 42, 0.08)",transform:`translate3d(${h}px, 0, 0) scale(${p?.985:1})`,transition:k?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:y?"pointer":"default",opacity:p?.9:1},children:c(ie,{spacing:1.5,children:[c(ie,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[n?e("div",{sx:{mt:.25},children:n}):null,c("div",{sx:{flex:1,minWidth:0},children:[o?e(L,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:o}):null,e(L,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:t}),r?e(L,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:r}):null]}),u?e("div",{"data-no-swipe":"true",...v,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:e(ae,{size:"small",children:e(Zd,{})})}):null]}),a.length>0?e(ie,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((B,Y)=>e(xt,{label:B,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},Y))}):null,i.length>0?e("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:i.map(B=>c(Ae,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[e(L,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:B.label}),e(L,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:B.value})]},B.id))}):null,l,s]})})]})};P();var ga=({label:t,onPress:r,emphasis:o="default"})=>e("div",{component:"button",type:"button",onClick:r,sx:n=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:o==="primary"?"primary.main":"divider",background:o==="primary"?n.palette.primary.main:o==="danger"?vt()==="dark"?"color-mix(in oklch, var(--orb-status-error) 18%, transparent)":"color-mix(in oklch, var(--orb-status-error) 10%, transparent)":vt()==="dark"?"rgba(255,255,255,0.04)":"var(--orb-canvas)",color:o==="primary"?"var(--orb-on-primary)":"text.primary",fontSize:"1.25rem",fontWeight:800,transition:"transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent","&:active":{transform:"scale(0.98)"}}),children:t}),qO=({value:t,defaultValue:r="",title:o,subtitle:n,placeholder:a="0",allowDecimal:i=false,allowNegative:s=false,maxLength:l,confirmLabel:d,clearLabel:u,backspaceLabel:p,onChange:f,onSubmit:b,onClose:m,sx:v})=>{let{t:y}=pe(),[g,x]=er.useState(r),h=t??g,C=M=>{t===void 0&&x(M),f?.(M);},k=M=>{l&&h.length>=l||C(`${h}${M}`);},w=M=>{if(M==="00"){if(!h){C("0");return}k("00");return}k(M);},T=()=>{!i||h.includes(".")||C(h?`${h}.`:"0.");},I=()=>{if(s){if(h.startsWith("-")){C(h.slice(1));return}C(h?`-${h}`:"-");}},S=()=>{C(h.slice(0,-1));},A=()=>{C("");},R=()=>{b?.(h);};return e(Ae,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...v},children:c(ie,{spacing:2,children:[c(ie,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[c("div",{sx:{minWidth:0},children:[o?e(L,{sx:{fontSize:"1rem",fontWeight:800},children:o}):null,n?e(L,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:n}):null]}),m?e(ae,{onClick:m,size:"small",children:e(Xd,{})}):null]}),e(Ae,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:e(L,{sx:{minHeight:38,fontSize:h?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:h?"text.primary":"text.disabled"},children:h||a})}),c("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(M=>e(ga,{label:M,onPress:()=>w(M)},M)),e(ga,{label:s?"+/-":"00",onPress:s?I:()=>w("00")}),e(ga,{label:"0",onPress:()=>w("0")}),e(ga,{label:i?".":p?String(p):"DEL",onPress:i?T:S})]}),c("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[e("div",{component:"button",type:"button",onClick:S,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:c(ie,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[e(Wd,{}),e(L,{sx:{fontWeight:700},children:p||"DEL"})]})}),e(ga,{label:String(u||"CLR"),onPress:A,emphasis:"danger"}),e("div",{component:"button",type:"button",onClick:R,sx:M=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:M.palette.primary.main,color:"var(--orb-on-primary)",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:c(ie,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[e(Gd,{}),e(L,{sx:{fontWeight:800},children:d||y("common.ok")})]})})]})]})})};P();var am=({touchMode:t="comfortable",sx:r,...o})=>{let n=t==="expanded";return e("div",{sx:{"& .orb-card":{borderRadius:4},"& .orb-autocomplete":{minWidth:{xs:"100%",md:260}},"& .orb-autocomplete .orb-inp-adornment-wrap, & .orb-inp":{backgroundColor:"transparent !important"},"& .orb-inp-adornment-wrap, & .orb-inp":{minHeight:n?56:50,borderRadius:3,fontSize:n?"0.98rem":"0.92rem"},"& .orb-inp":{py:n?1.6:1.25,fontSize:n?"0.98rem":"0.92rem"},"& label":{fontSize:n?"0.95rem":"0.88rem"},"& .orb-btn":{minHeight:n?48:44,px:n?2.25:1.75,borderRadius:3,fontSize:n?"0.95rem":"0.88rem",fontWeight:700},"& .orb-icon-btn":{width:n?40:36,height:n?40:36},"& .orb-menu-item, & option":{minHeight:n?44:38,fontSize:n?"0.95rem":"0.88rem"},"& .orb-list-subheader":{py:1},"& .orb-chk":{p:n?1:.75},"& .orb-form-control-label > span":{fontSize:n?"0.95rem":"0.88rem"},"& .orb-dialog":{borderRadius:4},"& .orb-dialog-title":{fontSize:n?"1.05rem":"0.98rem",fontWeight:800},"& .orb-dialog-content .orb-inp-adornment-wrap, & .orb-inp":{minHeight:52},"& .orb-grid > *":{minWidth:0},...r},children:e(Wr,{...o})})};P();var my=(t,r,o)=>{if(o?.(r),!!r.href){if(r.href.startsWith("http://")||r.href.startsWith("https://")){window.open(r.href,"_blank");return}t.push(r.href);}},im=({items:t,selectedId:r,orientation:o="auto",onItemSelect:n,sx:a})=>{let i=sr(),[s,l]=er.useState(false);er.useEffect(()=>{l(true);},[]);let d=xo("(orientation: portrait)"),u=xo(i.breakpoints.down("md")),p=o==="auto"?d||u?"portrait":"landscape":o,f=navigation.useRouter();return e("div",{sx:{display:"grid",gridTemplateColumns:!s||p==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...a},children:t.map(b=>{let m=b.id===r,v=b.color||(m?i.palette.primary.main:i.palette.divider);return e(Ae,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:m?"primary.main":"divider",boxShadow:m?"0 18px 40px color-mix(in oklch, var(--orb-primary) 16%, transparent)":"none",bgcolor:vt()==="dark"?"color-mix(in oklch, var(--orb-surface-3) 60%, transparent)":"background.paper"},children:e("div",{component:"button",type:"button",disabled:b.disabled,onClick:()=>my(f,b,n),sx:{width:"100%",p:2,minHeight:p==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:b.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:c(ie,{spacing:1.5,sx:{height:"100%"},children:[c(ie,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[e("div",{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:m?"var(--orb-on-primary)":"text.primary",background:m?v:"action.hover"},children:b.icon||e(L,{sx:{fontSize:"1rem",fontWeight:900},children:b.title.slice(0,1).toUpperCase()})}),b.badge!==void 0?e("div",{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:m?"primary.main":"action.hover",color:m?"var(--orb-on-primary)":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:b.badge}):null]}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:b.title}),b.caption?e(L,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:b.caption}):null,b.description?e(L,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:b.description}):null]})]})})},b.id)})})};P();var cm=(t,r)=>r.trim()?t.reduce((o,n)=>{let a=n.title?.toLowerCase().includes(r.toLowerCase())||n.label?.toLowerCase().includes(r.toLowerCase())||n.description?.toLowerCase().includes(r.toLowerCase()),i=n.children?cm(n.children,r):[];return (a||i.length>0)&&o.push({...n,children:i.length>0?i:n.children}),o},[]):t,hy=t=>{let r=new Set,o=n=>{n.forEach(a=>{a.children?.length&&(r.add(a.id),o(a.children));});};return o(t),r},dm=({collapsed:t=false,onToggle:r,className:o="",maxHeight:n,menuData:a=[],colorMode:i="light",orientation:s="auto",headerSlot:l,footerSlot:d,activeHref:u,onItemSelect:p})=>{let{t:f}=pe(),b=sr(),m=Dr("(orientation: portrait)"),v=Dr(b.breakpoints.down("md")),y=s==="auto"?m||v?"portrait":"landscape":s,g=i==="dark",x=navigation.useRouter(),h=navigation.usePathname(),[C,k]=er.useState(""),[w,T]=er.useState(new Set),I=er.useMemo(()=>cm(a,C),[a,C]),S=er.useMemo(()=>C.trim()?hy(I):w,[w,I,C]);er.useEffect(()=>{t&&T(new Set);},[t]);let A=O=>O.appurl||O.href||"",R=O=>{p?.(O);let F=A(O);if(F){if(F.startsWith("http://")||F.startsWith("https://")){window.open(F,"_blank");return}x.push(F);}},M=O=>{let F=!!O.children?.length;if(t&&F){r?.();return}if(F){T(_=>{let B=new Set(_);return B.has(O.id)?B.delete(O.id):B.add(O.id),B});return}R(O);},N=O=>{let F=u||h,_=A(O);return !!(_&&F===_)},E=(O,F=0)=>{let _=!!O.children?.length,B=S.has(O.id),Y=N(O);return e("div",{sx:{pl:F===0?0:1.5},children:c(Ae,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:Y?"primary.main":"divider",bgcolor:Y?"action.selected":"background.paper"},children:[c("div",{component:"button",type:"button",onClick:()=>M(O),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:[e(Qa,{variant:"rounded",sx:{width:40,height:40,bgcolor:Y?"primary.main":"action.hover",color:Y?"var(--orb-on-primary)":"text.primary"},children:O.icon||(O.title||O.label||"?").slice(0,1).toUpperCase()}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:O.title||O.label}),O.description?e(L,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:O.description}):null]}),_?e(an,{sx:{transform:B?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):e(ri,{color:"action"})]}),_?e(nn,{in:B,children:e("div",{sx:{px:1.25,pb:1.25},children:O.children?.map(W=>E(W,F+1))})}):null]})},O.id)};return t?e(Ae,{elevation:0,className:o,sx:{width:y==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:g?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflowY:"auto"},children:c(ie,{spacing:1,children:[e(ae,{onClick:r,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:f("navigation.expand"),children:e(li,{})}),a.map(O=>e(ae,{onClick:()=>M(O),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:N(O)?"primary.main":"action.hover",color:N(O)?"var(--orb-on-primary)":"text.primary"},children:O.icon||(O.title||O.label||"?").slice(0,1).toUpperCase()},O.id))]})}):e(Ae,{elevation:0,className:o,sx:{width:y==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:g?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflow:"hidden",display:"flex",flexDirection:"column"},children:c(ie,{spacing:1.25,sx:{flex:1,minHeight:0},children:[c(ie,{direction:"row",spacing:1,alignItems:"center",children:[e(ze,{value:C,onChange:O=>k(O.target.value),placeholder:f("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:e(lp,{fontSize:"small",color:"action"})}}),y==="landscape"&&!t?e(ae,{onClick:r,sx:{bgcolor:"action.hover"},children:e(op,{})}):null]}),l,e("div",{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:I.length>0?I.map(O=>E(O)):e(L,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:f("navigation.noMatch")})}),d]})})};P();var pm=(t,r)=>{let o=r[t.id];if(t.render)return t.render(o,r);if(o==null||o==="")return "--";if(t.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},vy=t=>er__namespace.default.isValidElement(t)?e("div",{sx:{display:"inline-flex",alignItems:"center"},children:t}):e(L,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:t}),yy=(t,r)=>{let o=r[t.id];if(o==null||o==="")return "--";if(t.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},Cy=({summaryRow:t,visibleColumns:r,columns:o})=>{let n=o.filter(a=>r.includes(a.id)&&t[a.id]!=="");return n.length===0?null:e(Ae,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:c(ie,{spacing:1,children:[e(L,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),e("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:n.map(a=>c(Ae,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[e(L,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:a.label}),e(L,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:t[a.id]})]},`summary-${a.id}`))})]})})},xy=t=>{let{t:r}=pe(),o=sr(),{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:u,fitContainer:p=false,fullWidth:f=false,maxHeight:b,loading:m=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g,rowKey:x,tableKey:h="default",graphReport:C,quickCreate:k,quickEdit:w,quickDelete:T,serviceUrl:I,orientation:S="auto",cardTitleField:A,cardSubtitleFields:R,toolbarSlot:M,emptyState:N,rowHeight:E="comfortable",cardActionSlot:O,renderCardFooter:F,onRowClick:_}=t,B=n||r("table.title.default"),Y=Dr("(orientation: portrait)"),W=Dr(o.breakpoints.down("md")),j=S==="auto"?Y||W?"portrait":"landscape":S,{columns:V,filterText:z,setFilterText:K,visibleColumns:q,showSummary:fe,setShowSummary:se,summaryColumns:ue,grouping:Se,setGrouping:$e,expandedGroups:ke,groupAnchorEl:le,setGroupAnchorEl:Ee,summaryAnchorEl:Me,setSummaryAnchorEl:Pe,anchorEl:Ve,setAnchorEl:tt,contextMenu:nt,sortedAndFilteredRows:it,summaryRow:X,visibleRows:De,page:ye,setPage:Be,rowsPerPage:at,setRowsPerPage:Ze,totalDisplayCount:St,setSelected:Mt,handleClick:Ot,toggleSummaryColumn:At,handleExport:re,handleCloseContextMenu:Ke,toggleColumnVisibility:Fe,toggleGroupExpand:ce,handleExpandGroupRecursively:ve,handleCollapseGroupRecursively:te,handleLayoutLoad:he,handleVariantLoad:Ne,handleLayoutSave:Je,effectiveAppId:st,currentLayoutData:pt,currentLayoutId:Bt,layoutIdToLoad:Xt,graphReportOpen:Vt,handleOpenGraphReport:wt,handleCloseGraphReport:Wt}=hn(t),ht=C?.enabled??false,Nt=ht&&(C?.interaction?.enabled??true),lt=Ii(),Ft=x||"id",Yt=er__namespace.default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:rt(o.palette.divider,vt()==="dark"?.55:.3),bgcolor:vt()==="dark"?rt(o.palette.common.white,.06):rt(o.palette.background.paper,.92),color:o.palette.text.primary,"& .orb-chip-label":{px:1.05}}),[o]),Z=er__namespace.default.useMemo(()=>({...Yt,borderColor:rt(o.palette.primary.main,vt()==="dark"?.42:.24),bgcolor:vt()==="dark"?rt(o.palette.primary.main,.16):rt(o.palette.primary.main,.08)}),[Yt,o]),$=er__namespace.default.useMemo(()=>{let ee=new Set(s);return it.filter(Oe=>ee.has(Oe?.[Ft]))},[Ft,s,it]),Q=$.length===1?$[0]:null,be=!!k?.enabled,Ce=!!w?.enabled,Le=!!T?.enabled,_e=k?.fields,qe=k?.excludeFields||[],je=k?.initialValues||{},mt=w?.fields,ft=w?.excludeFields||[],Rt=w?.editableFields||[],yt=w?.nonEditableFields||[],H=w?.primaryKeys?.length?w.primaryKeys:[Ft],[J,ge]=er__namespace.default.useState(false),[Te,et]=er__namespace.default.useState(false),[Xe,kt]=er__namespace.default.useState({}),[bt,gt]=er__namespace.default.useState(false),[Ct,nr]=er__namespace.default.useState(false),[Et,Zt]=er__namespace.default.useState({}),[Ht,Kt]=er__namespace.default.useState(false),[$t,rr]=er__namespace.default.useState(false),ar=m||Te||Ct||$t,fr=er__namespace.default.useMemo(()=>{let ee=[...V];if(Array.isArray(_e)&&_e.length>0){let Oe=new Set(_e);ee=ee.filter(Qe=>Oe.has(Qe.id));}if(qe.length>0){let Oe=new Set(qe);ee=ee.filter(Qe=>!Oe.has(Qe.id));}return ee.filter(Oe=>!!Oe?.id)},[V,qe,_e]),Ir=er__namespace.default.useMemo(()=>{let ee=[...V];if(Array.isArray(mt)&&mt.length>0){let Oe=new Set(mt);ee=ee.filter(Qe=>Oe.has(Qe.id));}if(ft.length>0){let Oe=new Set(ft);ee=ee.filter(Qe=>!Oe.has(Qe.id));}return ee.filter(Oe=>!!Oe?.id)},[V,ft,mt]),Mr=er__namespace.default.useMemo(()=>new Set(H),[H]),no=er__namespace.default.useMemo(()=>new Set(Rt),[Rt]),yr=er__namespace.default.useMemo(()=>new Set(yt),[yt]),Or=er__namespace.default.useCallback(ee=>no.size>0?no.has(ee):!(yr.has(ee)||Mr.has(ee)),[no,yr,Mr]);er__namespace.default.useEffect(()=>{!Vt&&lt.hasActiveFilters&&lt.clearAll();},[lt,Vt]);let qo=()=>{let ee={};fr.forEach(Oe=>{ee[Oe.id]=je[Oe.id]??"";}),kt(ee),ge(true);},Xo=(ee,Oe)=>{kt(Qe=>({...Qe,[ee]:Oe}));},Lo=async()=>{if(!k?.onSubmit){ge(false);return}try{et(!0),await k.onSubmit(Xe),ge(!1);}finally{et(false);}},Yo=()=>{if(!Q)return;let ee={};Ir.forEach(Qe=>{ee[Qe.id]=Q[Qe.id]??"";});let Oe=w?.getInitialValues?{...ee,...w.getInitialValues(Q)}:ee;Zt(Oe),gt(true);},Zo=(ee,Oe)=>{Zt(Qe=>({...Qe,[ee]:Oe}));},Rr=async()=>{if(Q){if(!w?.onSubmit){gt(false);return}try{nr(!0),await w.onSubmit(Et,Q),gt(!1);}finally{nr(false);}}},Oo=()=>{$.length!==0&&Kt(true);},jo=async()=>{if($.length===0){Kt(false);return}if(!T?.onConfirm){Kt(false),Mt([]),l?.([]);return}try{rr(!0),await T.onConfirm($),Kt(!1),Mt([]),l?.([]);}finally{rr(false);}},Kr=it,{fieldMapping:ao}=mn({rows:Kr,config:{...C,title:C?.title||`${B} ${r("graph.reportTitle")}`}}),Ln=er__namespace.default.useMemo(()=>Nt?lt.applyRows(Kr,ao):Kr,[ao,lt,Nt,Kr]),{model:Fo}=mn({rows:Ln,config:{...C,title:C?.title||`${B} ${r("graph.reportTitle")}`,fieldMapping:ao}}),D=Fo.table.columns.map(ee=>({id:ee.id,label:ee.label,align:ee.align||"left",minWidth:120,numeric:ee.align==="right"})),G=st?e(bn,{appId:st,tableKey:h,currentLayoutData:pt,onLayoutLoad:he,targetLayoutId:Xt,activeLayoutId:Bt,serviceUrl:I??g?.serviceUrl}):null,U=V.filter(ee=>q.includes(ee.id)),de=U.find(ee=>ee.id===A)||U[0],He=R?.map(ee=>U.find(Oe=>Oe.id===ee)).filter(Boolean)||U.filter(ee=>ee.id!==de?.id).slice(0,j==="portrait"?2:3),ot=U.filter(ee=>ee.id!==de?.id&&!He.some(Oe=>Oe.id===ee.id)),Ge=[M,u].filter(Boolean),oe=c(jsxRuntime.Fragment,{children:[e(pn,{groupAnchorEl:le,setGroupAnchorEl:Ee,grouping:Se,setGrouping:$e,columns:V}),e(un,{anchorEl:Ve,setAnchorEl:tt,columns:V,visibleColumns:q,toggleColumnVisibility:Fe}),e(yi,{anchorEl:Me,setAnchorEl:Pe,showSummary:fe,setShowSummary:se,columns:V,summaryColumns:ue,toggleSummaryColumn:At}),e(Ci,{contextMenu:nt,handleCloseContextMenu:Ke,columns:V,visibleColumns:q,toggleColumnVisibility:Fe})]}),me=(ee,Oe,Qe)=>{let Re=s.includes(Oe),Ye=j==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",Pt=Qe%2===0?rt(o.palette.primary.main,vt()==="dark"?.09:.04):rt(o.palette.primary.main,vt()==="dark"?.05:.022),Qo=rt(o.palette.divider,.22);return e(Ae,{elevation:0,onClick:()=>{Ot({},ee),_?.(ee);},sx:{p:E==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Re?rt(o.palette.primary.main,.38):Qo,background:Re?`linear-gradient(135deg, ${rt(o.palette.primary.main,.13)}, ${rt(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${Pt}, ${rt(o.palette.primary.main,.015)})`,boxShadow:Re?`0 12px 30px ${rt(o.palette.primary.main,.2)}`:`0 3px 10px ${rt(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:Re?o.palette.primary.main:Qe%2===0?rt(o.palette.primary.main,.26):rt(o.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${rt(o.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:c(ie,{spacing:1.25,children:[c(ie,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[i?e(It,{checked:Re,onClick:Sr=>Sr.stopPropagation(),onChange:()=>Ot({},ee),sx:{mt:-0.6,ml:-0.6}}):null,c("div",{sx:{flex:1,minWidth:0},children:[de?e(L,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:pm(de,ee)}):null,He.length>0?e(ie,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:He.map(Sr=>e(xt,{label:`${Sr.label}: ${yy(Sr,ee)}`,size:"small",variant:"outlined",sx:Yt},`${Oe}-${Sr.id}`))}):null]}),O?e("div",{onClick:Sr=>Sr.stopPropagation(),children:O(ee)}):null]}),ot.length>0?e("div",{sx:{display:"grid",gridTemplateColumns:Ye,gap:1},children:ot.map(Sr=>c(Ae,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:vt()==="dark"?rt(o.palette.background.default,.7):rt(o.palette.background.paper,.92),border:"0.1px solid",borderColor:rt(o.palette.divider,.24)},children:[e(L,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:Sr.label}),vy(pm(Sr,ee))]},`${Oe}-${Sr.id}-detail`))}):null,F?c(jsxRuntime.Fragment,{children:[e(Dt,{}),e("div",{onClick:Sr=>Sr.stopPropagation(),children:F(ee)})]}):null]})},Oe)};return c("div",{sx:{width:f?"100%":"auto",mb:p?0:2,...p?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g?e("div",{sx:{mb:2},children:e(am,{...g,onVariantLoad:ee=>{Ne(ee),g.onVariantLoad?.(ee);},appId:g.appId,tableKey:h,currentLayout:[{tableKey:h,layoutData:pt}],currentLayoutId:Bt,layoutRefs:[{tableKey:h,layoutId:Bt}],variantService:g.variantService,serviceUrl:I??g.serviceUrl,touchMode:j==="portrait"?"expanded":"comfortable"})}):null,c(Ae,{sx:{width:f?"100%":"auto",mb:p?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":ar?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, color-mix(in oklch, var(--orb-primary) 0%, transparent) 0%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 25%, var(--orb-primary) 50%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 75%, color-mix(in oklch, var(--orb-primary) 0%, transparent) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...b?{height:b}:p?{flex:1,minHeight:0,height:"100%"}:{}},children:[a?e("div",{sx:{"& .orb-toolbar":{minHeight:60,alignItems:{xs:"flex-start",md:"center"},flexWrap:"wrap",rowGap:1,columnGap:1},"& .orb-toolbar > :nth-of-type(1)":{width:{xs:"100%",md:"auto"},"& .orb-fld":{width:{xs:"100%",md:300}}},"& .orb-toolbar > :nth-of-type(2)":{flexShrink:0},"& .orb-toolbar > :nth-of-type(3)":{display:{xs:"none",md:"block"}},"& .orb-toolbar > :nth-of-type(4)":{ml:"auto",justifyContent:"flex-end",flexWrap:"wrap"},"& .orb-inp-adornment-wrap, & .orb-inp":{minHeight:46},"& .orb-icon-btn":{width:40,height:40},"& .orb-body, & .orb-body-dense, & .orb-label, & .orb-meta":{fontSize:"0.9rem"},"& button":{borderRadius:2.5}},children:e(fi,{filterText:z,setFilterText:K,onRowsPerPageChange:Ze,rowsPerPage:at,rowsPerPageOptions:v,page:ye,count:St,onPageChange:Be,actions:d,extraTools:Ge,grouping:Se,setGroupAnchorEl:Ee,showSummary:fe,setShowSummary:se,setAnchorEl:tt,setSummaryAnchorEl:Pe,handleExport:re,showCreateButton:be,onOpenCreateDialog:qo,showEditButton:Ce,onOpenEditDialog:Yo,editDisabled:$.length!==1,showDeleteButton:Le,onOpenDeleteConfirm:Oo,deleteDisabled:$.length===0,onLayoutSave:y||g?.variantService&&g?.appId?Je:void 0,loading:m,layoutManager:G,onOpenGraphReport:ht?wt:void 0})}):null,e("div",{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:c(ie,{spacing:1.25,children:[De.length===0&&!m?N||e(Ae,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:e(L,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:r("common.noData")})}):null,De.map((ee,Oe)=>{if(ee.type==="group"){let Ye=ke.has(ee.id);return e(Ae,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:c("div",{component:"button",type:"button",onClick:()=>ce(ee.id),sx:{width:"100%",px:1.5,py:1.3,border:0,background:"transparent",display:"flex",alignItems:"center",gap:1,textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",color:"text.primary"},children:[Ye?e(an,{}):e(ri,{}),c("div",{sx:{flex:1,minWidth:0},children:[c(L,{sx:{fontSize:"0.94rem",fontWeight:800},children:[ee.field,": ",ee.value]}),c(L,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[ee.count," records"]})]}),Se.length>1&&ee.level<Se.length-1?c(ie,{direction:"row",spacing:.5,children:[e(xt,{size:"small",label:r("table.group.expandAll"),onClick:Pt=>{Pt.stopPropagation(),ve(ee.id);},sx:Z}),e(xt,{size:"small",label:r("table.group.collapseAll"),onClick:Pt=>{Pt.stopPropagation(),te(ee.id);},sx:Z})]}):null]})},ee.id)}let Qe=ee.data||ee,Re=ee.id||Qe[Ft]||Oe;return me(Qe,Re,Oe)}),fe?e(Cy,{summaryRow:X,visibleColumns:q,columns:V}):null,m?e(L,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:r("common.loading")}):null]})})]}),be?c(Lt,{open:J,onClose:()=>!Te&&ge(false),fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:k?.title||r("quickCreate.createWithTitle",{title:B})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[fr.map(ee=>{let Oe=ee.type==="number"||ee.numeric?"number":ee.type==="date"?"date":"text";return e(ze,{label:ee.label||ee.id,value:Xe[ee.id]??"",onChange:Qe=>Xo(ee.id,Qe.target.value),type:Oe,fullWidth:true,InputLabelProps:{shrink:Oe==="date"?true:void 0}},`quick-create-${ee.id}`)}),k?.description?e(jr,{severity:"info",children:k.description}):null]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(we,{onClick:()=>ge(false),disabled:Te,children:k?.cancelLabel||r("common.cancel")}),e(we,{onClick:Lo,variant:"contained",disabled:Te,children:k?.submitLabel||r("common.save")})]})]}):null,Ce?c(Lt,{open:bt,onClose:()=>!Ct&&gt(false),fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:w?.title||r("quickEdit.editWithTitle",{title:B})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Ir.map(ee=>{let Oe=ee.type==="number"||ee.numeric?"number":ee.type==="date"?"date":"text";return e(ze,{label:ee.label||ee.id,value:Et[ee.id]??"",onChange:Qe=>Zo(ee.id,Qe.target.value),type:Oe,disabled:!Or(ee.id),fullWidth:true,InputLabelProps:{shrink:Oe==="date"?true:void 0}},`quick-edit-${ee.id}`)}),w?.description?e(jr,{severity:"info",children:w.description}):null]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(we,{onClick:()=>gt(false),disabled:Ct,children:w?.cancelLabel||r("common.cancel")}),e(we,{onClick:Rr,variant:"contained",disabled:Ct||!Q,children:w?.submitLabel||r("common.save")})]})]}):null,Le?e(jn,{open:Ht,type:"warning",title:T?.title||r("quickDelete.confirmTitle"),message:T?.message||($.length>1?r("quickDelete.confirmMessageMultiple",{count:$.length}):r("quickDelete.confirmMessageSingle")),confirmText:T?.confirmText||r("common.delete"),cancelText:T?.cancelText||r("common.cancel"),onClose:()=>!$t&&Kt(false),onConfirm:jo}):null,oe,ht?e(Pi,{open:Vt,onClose:Wt,model:Fo,aiAssistant:C?.aiAssistant,interaction:Nt?{enabled:true,filters:lt.filters,fieldMapping:ao,onPrimaryDimensionClick:ee=>lt.setFilter("primaryDimension",ee),onSecondaryDimensionClick:ee=>lt.setFilter("secondaryDimension",ee),onStatusClick:ee=>lt.setFilter("status",ee),onClearFilter:lt.clearFilter,onClearAll:lt.clearAll}:void 0,tableContent:e(xy,{appId:st||"graph-report-internal",title:r("graph.dataBody"),columns:D,rows:Fo.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};P();var WF=({appTitle:t,children:r,menuData:o=[],workloadItems:n=[],workloadSelectedId:a,showNavigation:i=true,showWorkloadNav:s=true,orientation:l="auto",logo:d,headerSlot:u,actionSlot:p,portraitBottomSlot:f,contentSx:b,containerSx:m,user:v,onSearch:y,onSearchAdd:g,defaultNavigationOpen:x,navOpen:h,onNavOpenChange:C,onWorkloadSelect:k,locale:w="en",localeLabel:T,localeOptions:I,onLocaleChange:S,onUserSetting:A,onUserLogout:R,userMenuItems:M,leftHeaderSlot:N,rightHeaderSlot:E})=>{let O="orbcafe:page-layout-mode",[F,_]=er.useState("system"),[B,Y]=er.useState("light"),[W,j]=er.useState(false),[V,z]=er.useState(false),K=F==="system"?V?B:"light":F;er.useEffect(()=>{j(true);},[]),er.useEffect(()=>{try{let nt=window.localStorage.getItem(O);(nt==="light"||nt==="dark"||nt==="system")&&_(nt);}catch{}z(true);let Ve=window.matchMedia("(prefers-color-scheme: dark)"),tt=()=>{Y(Ve.matches?"dark":"light");};return tt(),Ve.addEventListener("change",tt),()=>Ve.removeEventListener("change",tt)},[]),er.useEffect(()=>{if(V)try{window.localStorage.setItem(O,F);}catch{}},[V,F]),er.useEffect(()=>{K==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.classList.add("orb-dark"),document.documentElement.dataset.orbMode="dark",document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.classList.remove("orb-dark"),document.documentElement.dataset.orbMode="light",document.documentElement.style.colorScheme="light");},[K]);let q=Dr("(orientation: portrait)"),fe=Dr("(max-width: 899.95px)"),se=l==="auto"?!W||q||fe?"portrait":"landscape":l,[ue,Se]=er.useState({landscape:x??true,portrait:false}),$e=ue[se],ke=h??$e,le=Ve=>{h===void 0&&Se(tt=>({...tt,[se]:Ve})),C?.(Ve);},Ee=c(ie,{direction:"row",spacing:1,alignItems:"center",children:[!W||i&&se==="portrait"?e(ae,{onClick:()=>le(!ke),sx:{bgcolor:"action.hover"},children:e(li,{})}):null,N]}),Me=c(ie,{direction:"row",spacing:1,alignItems:"center",children:[p,E]}),Pe=e(dm,{collapsed:se==="landscape"?!ke:false,onToggle:()=>le(!ke),menuData:o,orientation:se,colorMode:K,maxHeight:se==="landscape"?900:void 0});return e(Fn,{mode:F,children:e(Ga,{locale:w,children:c("div",{sx:[Ve=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:Ve.palette.mode==="dark"?"linear-gradient(180deg, var(--orb-canvas) 0%, var(--orb-surface) 55%, var(--orb-surface-2) 100%)":Ve.palette.background.default}),...Array.isArray(m)?m:[m]],children:[e($i,{appTitle:t,logo:d===void 0?null:d,mode:F,onToggleMode:()=>_(Ve=>Ve==="system"?"dark":Ve==="dark"?"light":"system"),locale:w,localeLabel:T,localeOptions:I,onLocaleChange:S,user:v,onUserSetting:A,onUserLogout:R,userMenuItems:M,onSearch:y,onSearchAdd:g,leftSlot:Ee,rightSlot:Me}),u?e("div",{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:u}):null,c("div",{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[W&&i&&se==="landscape"?e("div",{sx:{p:1.5,pr:0,flexShrink:0},children:Pe}):null,!W||i&&se==="portrait"?e(Ad,{open:ke,onClose:()=>le(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:Pe}):null,e("div",{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...b},children:c(ie,{spacing:1.5,children:[s&&n.length>0?e(im,{items:n,selectedId:a,orientation:se,onItemSelect:k}):null,e(Ae,{elevation:0,sx:{flex:1,minHeight:se==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:"color-mix(in oklch, var(--orb-canvas) 72%, transparent)",backdropFilter:"blur(12px)",color:"text.primary"},children:r})]})})]}),se==="portrait"&&f?c(jsxRuntime.Fragment,{children:[e(Dt,{}),e("div",{sx:{p:1.5},children:f})]}):null]})})})};P();var fm=Dy__default.default(()=>Promise.resolve().then(()=>(gm(),mm)).then(t=>t.COrbCanvas),{ssr:false,loading:()=>e("div",{className:"h-full w-full bg-transparent"})});function Ll({isRecording:t}){return e(framerMotion.AnimatePresence,{children:t&&e(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:c("div",{className:"relative flex h-full w-full items-center justify-center",children:[e("div",{className:"absolute inset-0",children:e(fm,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),e("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:e(fm,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var YF=Ll;P();var hm=er.createContext(null);function By(t){if(!t||!(t instanceof HTMLElement))return false;let r=t.tagName;return !!(r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||t.isContentEditable||t.closest('[data-voice-hotkey-ignore="true"]'))}function Hy({children:t,onVoiceSubmit:r,onVoicePartial:o,onVoiceError:n,longPressMs:a=200,disableSpaceTrigger:i=false,ignoreWhenFocusedInput:s=true,renderOverlay:l=true,wsUrl:d,silenceThresholdMs:u,minVolumeRms:p}){let[f,b]=er.useState(false),[m,v]=er.useState(false),y=er.useRef(null),g=er.useRef(false),x=er.useRef(false),h=er.useCallback(()=>{x.current=false,b(false);},[]),{isRecording:C,startRecording:k,stopRecording:w}=Sn({wsUrl:d,silenceThresholdMs:u,minVolumeRms:p,onTextUpdate:A=>{o?.(A);},onComplete:async A=>{try{A.trim()&&(v(!0),await r(A.trim()));}catch(R){let M=R instanceof Error?R.message:"Failed to process voice command";n?.(M);}finally{v(!1),h();}},onError:A=>{n?.(A),v(!1),g.current||h();}}),T=er.useCallback(async()=>{x.current=false,await k();},[k]),I=er.useCallback(()=>{w();},[w]);er.useEffect(()=>{if(i)return;let A=M=>{M.isComposing||(M.code==="Space"||M.key===" ")&&(g.current||M.repeat||s&&By(document.activeElement)||(g.current=true,M.preventDefault(),y.current=setTimeout(()=>{x.current=true,b(true),k();},a)));},R=M=>{(M.code==="Space"||M.key===" ")&&(y.current&&(clearTimeout(y.current),y.current=null),g.current=false,x.current&&(M.preventDefault(),b(false),w()));};return window.addEventListener("keydown",A),window.addEventListener("keyup",R),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",R),y.current&&(clearTimeout(y.current),y.current=null);}},[i,s,a,k,w]);let S=er.useMemo(()=>({isRecording:C,isHotkeyRecording:f,isSubmitting:m,startRecording:T,stopRecording:I}),[f,C,m,T,I]);return c(hm.Provider,{value:S,children:[l?e(Ll,{isRecording:f}):null,t]})}function zy(){let t=er.useContext(hm);if(!t)throw new Error("useAINav must be used within CAINavProvider");return t}var t2=Hy,r2=zy;function ut(...t){return tailwindMerge.twMerge(clsx.clsx(t))}P();var Gy=({content:t,theme:r="light",size:o="base",defaultExpanded:n=false})=>{let[a,i]=er.useState(n),s=er.useMemo(()=>`${(o==="sm"?14:o==="lg"?18:16)-2}px`,[o]);return c("div",{className:`my-6 rounded-lg overflow-hidden transition-all duration-200 ${r==="dark"?"bg-[var(--orb-surface-2)]":"bg-[var(--orb-canvas)]"}`,style:{border:"0.5px solid var(--orb-border)"},children:[c("div",{className:"px-4 py-3 cursor-pointer flex items-center justify-between transition-colors duration-200 bg-[var(--orb-surface)] hover:bg-[var(--orb-hover)]",style:{borderBottom:"0.5px solid var(--orb-border)"},onClick:()=>i(!a),children:[c("span",{className:"flex items-center",children:[e(Aa,{className:"mr-2 h-4 w-4"}),e("span",{className:"font-medium text-[var(--orb-fg)]",style:{fontSize:o==="sm"?"14px":o==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),e(Fr,{className:`w-4 h-4 transition-transform duration-200 ${a?"rotate-180":""} text-[var(--orb-muted)]`})]}),a&&e("div",{className:"p-4 whitespace-pre-wrap italic font-light text-[var(--orb-muted)]",style:{fontSize:s,lineHeight:"1.3 !important"},children:t})]})},vm=Gy;P();var Yy=({content:t,language:r="text",isStreaming:o=false,className:n=""})=>{let a=Cr(),[i,s]=er.useState(false),l=async()=>{try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),2e3);}catch(u){console.error("\u590D\u5236\u5931\u8D25:",u);}},d=a==="dark"?prism.oneDark:prism.oneLight;return c("div",{className:ut("rounded-lg overflow-hidden border border-[var(--orb-border)] my-4",n),children:[c("div",{className:"flex items-center justify-between px-4 py-2 bg-[var(--orb-surface)] border-b border-[var(--orb-border)]",children:[e("span",{className:"text-xs font-medium text-[var(--orb-muted)] uppercase",children:r}),e("button",{onClick:l,className:"p-1 hover:bg-[var(--orb-hover)] rounded transition-colors",disabled:o,title:i?"Copied":"Copy code",children:i?e(qr,{size:14,className:"text-[var(--orb-status-success)]"}):e(Rc,{size:14,className:"text-[var(--orb-muted)]"})})]}),e("div",{className:"text-sm",children:e(reactSyntaxHighlighter.Prism,{language:r,style:d,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:a==="dark"?"var(--orb-surface-2)":"var(--orb-canvas)"},wrapLongLines:true,children:t})})]})},ym=Yy;P();var Cm="orb-html-demo",eC=160,tC=560,rC=220,Bl=`<script>(function(){var post=function(){var height=Math.ceil(document.documentElement.scrollHeight);parent.postMessage({source:${JSON.stringify(Cm)},height:height},'*')};addEventListener('load',post);addEventListener('resize',post);new MutationObserver(post).observe(document.documentElement,{subtree:true,childList:true,attributes:true,characterData:true});post()})()</script>`,oC="html,body{margin:0;padding:12px;font:14px/1.5 system-ui,sans-serif;}",nC=t=>/<html[\s>]/i.test(t),aC=t=>{let r=t.trim();return nC(r)?/<\/body>/i.test(r)?r.replace(/<\/body>/i,`${Bl}</body>`):`${r}${Bl}`:`<!DOCTYPE html><html><head><meta charset="utf-8"><style>${oC}</style></head><body>${r}${Bl}</body></html>`},iC=({content:t,title:r="Interactive HTML"})=>{let o=er.useRef(null),[n,a]=er.useState(rC),i=er.useMemo(()=>aC(t),[t]);return er.useEffect(()=>{let s=l=>{if(l.source!==o.current?.contentWindow)return;let d=l.data;!d||d.source!==Cm||typeof d.height!="number"||!Number.isFinite(d.height)||a(Math.min(tC,Math.max(eC,Math.ceil(d.height))));};return window.addEventListener("message",s),()=>window.removeEventListener("message",s)},[]),c("figure",{className:"orb-html-demo-frame",children:[e("figcaption",{className:"orb-html-demo-caption",children:r}),e("iframe",{ref:o,className:"orb-html-demo",title:r,sandbox:"allow-scripts",srcDoc:i,style:{height:n}})]})},xm=iC;P();var cC=t=>{let r=/line (\d+)/i.exec(t)?.[1];return r?`Mermaid syntax error around line ${r} \u2014 expand for details`:"Mermaid syntax error \u2014 expand for details"},dC=({content:t,isLoading:r,className:o="",style:n})=>{let a=er.useRef(null),[i,s]=er.useState(false),[l,d]=er.useState(null),u=Cr();return er.useEffect(()=>{let p=false,f=async()=>{if(!(!t.trim()||!a.current)){s(true),d(null);try{wm__default.default.initialize({startOnLoad:!1,theme:u==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit",flowchart:{htmlLabels:!1}});let m=`mermaid-${Math.random().toString(36).substr(2,9)}`,v=t.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:y,bindFunctions:g}=await wm__default.default.render(m,v);!p&&a.current&&(a.current.innerHTML=y,g?.(a.current));}catch(m){if(p)return;console.error("Mermaid render failed:",m),d(m instanceof Error?m.message:"Render failed");}finally{p||s(false);}}},b=setTimeout(()=>{f();},100);return ()=>{p=true,clearTimeout(b);}},[t,u]),c("div",{className:`mermaid-block ${o}`,style:n,children:[(r||i)&&c("div",{className:"flex items-center justify-center rounded border border-[var(--orb-border)] bg-[var(--orb-surface)] p-4 dark:bg-[var(--orb-surface-2)]",children:[e("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-b-2 border-[var(--orb-primary)]"}),e("span",{className:"text-sm text-[var(--orb-muted)]",children:"Generating Diagram..."})]}),l&&c("div",{className:"rounded border border-[color-mix(in_oklch,var(--orb-status-error)_30%,transparent)] bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)] p-3 text-sm text-[var(--orb-status-error)]",children:[e("p",{className:"font-medium",children:cC(l)}),c("details",{className:"mt-1",children:[e("summary",{className:"cursor-pointer text-xs text-[var(--orb-muted)]",children:"Details & source"}),e("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words",children:l}),e("pre",{className:"mt-2 max-h-40 overflow-auto text-xs text-[var(--orb-muted)]",children:t})]})]}),e("div",{ref:a,className:`overflow-x-auto ${r||i||l?"hidden":""}`})]})},km=dC;P();var pC=({title:t="\u53D1\u751F\u9519\u8BEF",content:r,errorCode:o,stack:n,icon:a,closable:i=true,onClose:s,onRetry:l,className:d="",...u})=>{let[p,f]=er.useState(false),[b,m]=er.useState(false),v=async()=>{if(l){m(true);try{await l();}catch(y){console.error("\u91CD\u8BD5\u5931\u8D25:",y);}finally{m(false);}}};return c("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${d}`,...u,children:[c("div",{className:"flex p-4 border-l-4 border-l-[var(--orb-status-error)] bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]",children:[e("div",{className:"flex-shrink-0 mr-3 text-[var(--orb-status-error)] mt-0.5",children:a||e(Ta,{className:"w-5 h-5"})}),c("div",{className:"flex-1 min-w-0",children:[c("div",{className:"flex items-center space-x-2 mb-1",children:[e("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),o&&e("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded bg-[color-mix(in_oklch,var(--orb-status-error)_14%,transparent)] text-[var(--orb-status-error)]",children:o})]}),r&&e("div",{className:"text-sm text-[var(--orb-muted)] mb-3 leading-relaxed",children:typeof r=="string"?e("p",{className:"whitespace-pre-wrap",children:r}):r}),(l||n)&&c("div",{className:"flex items-center space-x-4 mt-2",children:[l&&c("button",{onClick:v,disabled:b,className:"flex items-center text-xs font-medium text-[var(--orb-status-error)] hover:opacity-80 transition-colors disabled:opacity-50",children:[e(Kc,{className:`w-3.5 h-3.5 mr-1.5 ${b?"animate-spin":""}`}),b?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),n&&c("button",{onClick:()=>f(!p),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] transition-colors",children:[p?e(Fr,{className:"w-3.5 h-3.5 mr-1"}):e(Br,{className:"w-3.5 h-3.5 mr-1"}),p?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),i&&s&&e("button",{onClick:s,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors self-start",children:e(jt,{className:"w-4 h-4"})})]}),n&&p&&e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 border-t border-[var(--orb-border)]",children:e("pre",{className:"text-xs font-mono text-[var(--orb-muted)] overflow-x-auto whitespace-pre-wrap p-2 bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)]",children:n})})]})},os=pC;P();var uC=({title:t="\u8B66\u544A",content:r,warningType:o,severity:n="warning",warnings:a=[],icon:i,closable:s=true,onClose:l,onConfirm:d,actionText:u,className:p="",...f})=>{let b=()=>{switch(n){case "info":return {borderLeftColor:"border-l-blue-500",iconColor:"text-[var(--orb-primary)]",bgColor:"bg-[var(--orb-p50)]"};case "error":return {borderLeftColor:"border-l-[var(--orb-status-error)]",iconColor:"text-[var(--orb-status-error)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]"};case "success":return {borderLeftColor:"border-l-green-500",iconColor:"text-[var(--orb-status-success)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]"};default:return {borderLeftColor:"border-l-yellow-500",iconColor:"text-[var(--orb-status-warning)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-warning)_8%,transparent)]"}}},m=()=>{switch(n){case "info":return e(Na,{className:"w-5 h-5"});case "error":return e(za,{className:"w-5 h-5"});case "success":return e(Ia,{className:"w-5 h-5"});default:return e(Tc,{className:"w-5 h-5"})}},v=b();return c("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${p}`,...f,children:[c("div",{className:`flex p-4 border-l-4 ${v.borderLeftColor} ${v.bgColor}`,children:[e("div",{className:`flex-shrink-0 mr-3 ${v.iconColor}`,children:i||m()}),c("div",{className:"flex-1 min-w-0",children:[c("div",{className:"flex items-center justify-between mb-1",children:[e("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),o&&e("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-[var(--orb-surface)] text-[var(--orb-muted)]",children:o})]}),r&&e("div",{className:"text-sm text-[var(--orb-muted)] mb-2",children:r}),a&&a.length>0&&e("ul",{className:"mt-2 space-y-1",children:a.map((y,g)=>c("li",{className:"flex items-start text-sm text-[var(--orb-muted)]",children:[e("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-[var(--orb-muted)] flex-shrink-0"}),e("span",{children:y})]},g))})]}),s&&l&&e("button",{onClick:l,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors",children:e(jt,{className:"w-4 h-4"})})]}),d&&e("div",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)] px-4 py-3 flex justify-end border-t border-[var(--orb-border)]",children:e("button",{onClick:d,className:"px-4 py-1.5 text-sm font-medium text-[var(--orb-on-primary)] bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:u||"\u786E\u8BA4"})})]})},ns=uC;P();var mC=({title:t="\u76F8\u5173\u63A8\u8350",content:r,suggestions:o,onSuggestionClick:n,maxDisplay:a=5,icon:i,closable:s=false,onClose:l,className:d="",...u})=>{let[p,f]=er.useState(false),[b,m]=er.useState(""),[v,y]=er.useState(false),g=er.useMemo(()=>b.trim()?o.filter(C=>C.toLowerCase().includes(b.toLowerCase())):o,[o,b]),x=er.useMemo(()=>p?g:g.slice(0,a),[g,p,a]),h=C=>{n?.(C);};return !o||o.length===0?null:c("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${d}`,...u,children:[c("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[c("div",{className:"flex items-center space-x-2.5",children:[e("div",{className:"text-[var(--orb-primary)] flex-shrink-0",children:i||e(Aa,{className:"w-5 h-5"})}),c("div",{className:"flex flex-col",children:[e("h4",{className:"text-sm font-semibold text-[var(--orb-fg)] leading-tight",children:t}),r&&e("span",{className:"text-xs text-[var(--orb-muted)] mt-0.5",children:r})]})]}),c("div",{className:"flex items-center space-x-1",children:[o.length>3&&e("button",{onClick:()=>y(!v),className:`p-1.5 rounded-md transition-colors ${v?"bg-[var(--orb-p100)] text-[var(--orb-status-primary)]":"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]"}`,title:v?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:e(Hr,{className:"w-4 h-4"})}),s&&l&&e("button",{onClick:l,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] p-1.5 rounded-md hover:bg-[var(--orb-hover)] transition-colors",title:"\u5173\u95ED",children:e(jt,{className:"w-4 h-4"})})]})]}),v&&e("div",{className:"px-4 py-2 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:c("div",{className:"relative",children:[e("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:b,onChange:C=>m(C.target.value),className:"w-full text-sm px-3 py-1.5 pl-8 rounded border border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-fg)] focus:ring-1 focus:ring-[var(--orb-primary)] focus:border-[var(--orb-primary)] outline-none transition-shadow",autoFocus:true}),e(Hr,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-[var(--orb-muted)]"})]})}),c("div",{className:"p-2",children:[e("ul",{className:"space-y-1",children:x.map((C,k)=>e("li",{children:c("button",{onClick:()=>h(C),className:"w-full text-left px-3 py-2 rounded-md text-sm text-[var(--orb-fg)] hover:bg-[var(--orb-hover)] hover:text-[var(--orb-status-primary)] transition-colors group flex items-start justify-between",children:[e("span",{children:C}),e(Br,{className:"w-4 h-4 text-[var(--orb-muted)] group-hover:text-[var(--orb-status-primary)] opacity-0 group-hover:opacity-100 transition-all transform group-hover:translate-x-0.5"})]})},k))}),g.length>a&&e("button",{onClick:()=>f(!p),className:"w-full text-center py-2 text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors border-t border-[var(--orb-border)] mt-1",children:p?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${g.length})`}),g.length===0&&b&&e("div",{className:"text-center py-4 text-sm text-[var(--orb-muted)]",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},as=mC;P();var gC=({title:t,content:r,toolName:o,parameters:n,result:a,status:i,duration:s,icon:l,closable:d=false,onClose:u,onAction:p,actionText:f,className:b="",...m})=>{let[v,y]=er.useState(false),[g,x]=er.useState(true),h=()=>{switch(i){case "pending":return {iconColor:"text-[var(--orb-primary)]",badgeBg:"bg-[var(--orb-p50)]",badgeText:"text-[var(--orb-status-primary)]",label:"\u6267\u884C\u4E2D"};case "error":return {iconColor:"text-[var(--orb-status-error)]",badgeBg:"bg-[color-mix(in_oklch,var(--orb-status-error)_10%,transparent)]",badgeText:"text-[var(--orb-status-error)]",label:"\u5931\u8D25"};default:return {iconColor:"text-[var(--orb-status-success)]",badgeBg:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]",badgeText:"text-[var(--orb-status-success)]",label:"\u6210\u529F"}}},C=()=>{switch(i){case "pending":return e(zc,{className:"w-5 h-5 animate-spin"});case "error":return e(za,{className:"w-5 h-5"});default:return e(Ia,{className:"w-5 h-5"})}},k=I=>I?I<1e3?`${I}ms`:`${(I/1e3).toFixed(2)}s`:"",w=h(),T=t||o||"\u5DE5\u5177\u8C03\u7528";return c("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${b}`,...m,children:[c("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:[c("div",{className:"flex items-center space-x-3",children:[e("div",{className:`flex-shrink-0 ${w.iconColor}`,children:l||C()}),c("div",{children:[c("div",{className:"flex items-center space-x-2",children:[e("h4",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:T}),e("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${w.badgeBg} ${w.badgeText}`,children:w.label})]}),o&&t&&c("div",{className:"text-xs text-[var(--orb-muted)] flex items-center mt-0.5",children:[e(Vn,{className:"w-3 h-3 mr-1"}),o]})]})]}),c("div",{className:"flex items-center space-x-2 text-xs text-[var(--orb-muted)]",children:[s&&c("div",{className:"flex items-center bg-[var(--orb-surface)] px-2 py-1 rounded",children:[e(Dc,{className:"w-3 h-3 mr-1"}),k(s)]}),d&&u&&e("button",{onClick:u,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors p-1 rounded",children:e(jt,{className:"w-4 h-4"})})]})]}),c("div",{className:"p-4",children:[r&&e("div",{className:"text-sm text-[var(--orb-muted)] mb-4 leading-relaxed",children:r}),n&&c("div",{className:"mb-3",children:[c("button",{onClick:()=>y(!v),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] mb-2",children:[v?e(Fr,{className:"w-3.5 h-3.5 mr-1"}):e(Br,{className:"w-3.5 h-3.5 mr-1"}),e("div",{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),v&&e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:e("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:JSON.stringify(n,null,2)})})]}),a&&c("div",{children:[c("button",{onClick:()=>x(!g),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] mb-2",children:[g?e(Fr,{className:"w-3.5 h-3.5 mr-1"}):e(Br,{className:"w-3.5 h-3.5 mr-1"}),e(Vn,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),g&&e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:e("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:typeof a=="string"?a:JSON.stringify(a,null,2)})})]}),p&&e("div",{className:"mt-3 pt-3 border-t border-[var(--orb-border)] flex justify-end",children:e("button",{onClick:p,className:"px-4 py-1.5 text-sm font-medium text-[var(--orb-on-primary)] bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:f||"\u6267\u884C\u64CD\u4F5C"})})]})]})},is=gC;P();var bC=({data:t})=>{if(!t)return null;let r=er.useMemo(()=>{let o=[],n=[],a="\u6570\u636E\u8868\u683C";return Array.isArray(t)?(o=t,o.length>0&&(n=Object.keys(o[0]).map(i=>({id:i,label:i.charAt(0).toUpperCase()+i.slice(1),numeric:typeof o[0][i]=="number"})))):typeof t=="object"&&(a=t.title||a,o=Array.isArray(t.rows)?t.rows:Array.isArray(t.data)?t.data:[],Array.isArray(t.columns)?n=t.columns.map(s=>({id:s.key||s.id,label:s.title||s.label,numeric:s.dataType==="number"||s.numeric})):o.length>0&&(n=Object.keys(o[0]).map(s=>({id:s,label:s,numeric:typeof o[0][s]=="number"})))),o=o.map((i,s)=>({...i,id:i.id||`row_${s}`})),{title:a,columns:n,rows:o}},[t]);return r.rows.length===0?e("div",{className:"w-full my-4 p-4 border border-dashed border-[var(--orb-border)] rounded text-center text-[var(--orb-muted)]",children:"\u6682\u65E0\u8868\u683C\u6570\u636E"}):e("div",{className:"w-full my-4",children:e(Jr,{appId:"agent-ui-table-card",title:r.title,columns:r.columns,rows:r.rows,count:r.rows.length,rowKey:"id",fitContainer:false,maxHeight:"500px",rowsPerPage:10,rowsPerPageOptions:[5,10,20,50]})})},ss=bC;P();var hC=({title:t,subtitle:r,data:o,type:n,config:a={}})=>{let i=()=>{switch(n){case "bar-chart-card":return e(Bs,{className:"w-4 h-4 text-[var(--orb-chart-1)]"});case "line-chart-card":return e(Hc,{className:"w-4 h-4 text-[var(--orb-chart-positive)]"});case "pie-chart-card":return e(Uc,{className:"w-4 h-4 text-[var(--orb-chart-2)]"});case "combo-chart-card":return e(Pc,{className:"w-4 h-4 text-[var(--orb-chart-5)]"});case "heatmap-chart-card":return e(Fc,{className:"w-4 h-4 text-[var(--orb-chart-negative)]"});case "fishbone-chart-card":return e(Oc,{className:"w-4 h-4 text-[var(--orb-chart-4)]"});case "waterfall-chart-card":return e(Qc,{className:"w-4 h-4 text-[var(--orb-chart-6)]"});case "google-map-card":return e(zn,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});case "amap-card":return e(Wc,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});default:return e(Bs,{className:"w-4 h-4"})}},s=()=>{if(!o&&n!=="google-map-card"&&n!=="amap-card")return e("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:"No data available"});try{switch(n){case "bar-chart-card":return e(ra,{data:o,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return e(Ep,{data:o,color:a.color,valueSuffix:a.valueSuffix||"",height:a.height});case "pie-chart-card":let l=o.reduce((u,p)=>u+(Number(p.value)||0),0),d=o.map(u=>({name:u.name,value:Number(u.value)||0,percent:typeof u.percent=="number"?u.percent:l>0?(Number(u.value)||0)/l*100:0}));return e(Si,{data:d,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return e(Lp,{data:o,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return e(Op,{data:o});case "fishbone-chart-card":return e(Fp,{branches:o,effect:a.effect||t||"Problem"});case "waterfall-chart-card":return e(Bp,{data:o,height:a.height});case "google-map-card":return e(Hp,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,apiKey:a.apiKey,query:a.query||o&&o[0]?.query||t,height:a.height});case "amap-card":return e(zp,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,keyword:a.keyword||o&&o[0]?.keyword||t,height:a.height});default:return c("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:["Unsupported chart type: ",n]})}}catch(l){return console.error("Error rendering chart:",l),e("div",{className:"text-[var(--orb-status-error)] text-sm p-4 text-center",children:"Error rendering chart"})}};return c("div",{className:"w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md",children:[c("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:[e("div",{className:"mr-2 flex-shrink-0",children:i()}),c("div",{className:"flex-1 min-w-0",children:[e("h3",{className:"text-sm font-semibold text-[var(--orb-fg)] truncate",children:t}),r&&e("p",{className:"text-xs text-[var(--orb-muted)] mt-0.5 truncate",children:r})]})]}),c("div",{className:"p-4",children:[e("div",{className:"overflow-x-auto",children:s()}),e("div",{className:"mt-3",children:c("details",{className:"text-xs text-[var(--orb-muted)]",children:[e("summary",{className:"cursor-pointer hover:text-[var(--orb-fg)] transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),e("pre",{className:"mt-2 p-2 bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-x-auto max-h-40",children:JSON.stringify(o,null,2)})]})})]})]})},ls=hC;P();var ms=["bar","column","line","pie","donut","scatter","bubble","list","metric","progress"],vC={bar:"Bars",column:"Columns",line:"Line",pie:"Pie",donut:"Donut",scatter:"Scatter",bubble:"Bubble",list:"List",metric:"Metric",progress:"Progress"},ps=480,Mn=214,Ut={top:18,right:16,bottom:38,left:30},tr=t=>typeof t=="number"&&Number.isFinite(t)?t:0,Dm=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Ur=(t,r)=>`${t.id||t.label}-${r}`,Nm=(t,r=13)=>t.length>r?`${t.slice(0,Math.max(1,r-1))}\u2026`:t,us=(t,r,o)=>Math.min(o,Math.max(r,t)),go=(t,r,o)=>t.color??o[r%o.length],fo=(t,r)=>r?{onMouseEnter:()=>r.onItemHoverStart?.(t),onMouseMove:()=>r.onItemHoverStart?.(t),onMouseLeave:()=>r.onItemHoverEnd?.(t),onContextMenu:o=>r.onItemContextMenu?.(o,t)}:{},Am=t=>{let r=t.map(a=>tr(a.value)),o=Math.min(0,...r),n=Math.max(0,...r);return {min:o,max:n===o?o+1:n,range:n===o?1:n-o}},yC=(t,r,o)=>{let n=ps-Ut.left-Ut.right,a=Mn-Ut.top-Ut.bottom,{max:i,range:s}=Am(o),l=Ut.left+t*n/Math.max(o.length-1,1),d=Ut.top+(i-tr(r.value))/s*a,u=Ut.top+i/s*a;return {x:l,y:d,zeroY:u}},ds=(t,r,o,n)=>{let a=(n-90)*Math.PI/180;return {x:t+o*Math.cos(a),y:r+o*Math.sin(a)}},CC=(t,r,o,n,a,i)=>{let s=ds(t,r,o,i),l=ds(t,r,o,a),d=i-a>180?1:0;if(n===0)return `M ${t} ${r} L ${s.x} ${s.y} A ${o} ${o} 0 ${d} 0 ${l.x} ${l.y} Z`;let u=ds(t,r,n,i),p=ds(t,r,n,a);return `M ${s.x} ${s.y} A ${o} ${o} 0 ${d} 0 ${l.x} ${l.y} L ${p.x} ${p.y} A ${n} ${n} 0 ${d} 1 ${u.x} ${u.y} Z`},xC=({children:t})=>c("div",{className:"orb-metric-empty",role:"status",children:[e("span",{className:"orb-metric-empty-mark","aria-hidden":"true",children:"\u2014"}),e(L,{variant:"body2",muted:true,children:t})]}),SC=()=>c("div",{className:"orb-metric-loading",role:"status","aria-label":"Loading chart",children:[e("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"}),e("span",{className:"orb-metric-skeleton"}),e("span",{className:"orb-metric-skeleton orb-metric-skeleton-short"}),e("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"})]}),Vl=({item:t,onItemClick:r,interactions:o})=>{let n=()=>r?.(t);return {...r?{role:"button",tabIndex:0,onClick:n,onKeyDown:i=>{r&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n());}}:{},...fo(t,o),style:{cursor:r||o?"pointer":"default"}}},wC=({loading:t,error:r,hasData:o,emptyState:n,children:a})=>t?e(SC,{}):r?e("div",{className:"orb-metric-error",role:"alert",children:r}):o?e(jsxRuntime.Fragment,{children:a}):e(xC,{children:n??"No data for the current selection."}),kC=({data:t,activeId:r,onItemClick:o,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(...t.map(l=>Math.abs(tr(l.value))),1);return e("div",{className:"orb-metric-bars",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let u=tr(l.value),p=`${us(Math.abs(u)/s*100,0,100)}%`,f=r===l.id,b=c(jsxRuntime.Fragment,{children:[e("span",{className:"orb-metric-bar-label",title:l.label,children:l.label}),e("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:e("span",{className:`orb-metric-bar-fill${f?" is-active":""}`,style:{width:p,backgroundColor:go(l,d,i)}})}),e("span",{className:"orb-metric-bar-value",children:a(u)})]});return o?e("button",{type:"button",className:`orb-metric-bar-row${f?" is-active":""}`,onClick:()=>o(l),title:`${l.label}: ${a(u)}`,"aria-pressed":f,...fo(l,n),children:b},Ur(l,d)):e("div",{className:`orb-metric-bar-row${f?" is-active":""}`,role:"listitem",...fo(l,n),children:b},Ur(l,d))})})},PC=({data:t,activeId:r,onItemClick:o,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(t.reduce((l,d)=>l+Math.max(tr(d.value),0),0),1);return e("div",{className:"orb-metric-progress",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let u=Math.max(tr(l.value),0),p=us(u/s*100,0,100),f=r===l.id,b=c(jsxRuntime.Fragment,{children:[c("span",{className:"orb-metric-progress-heading",children:[e("span",{title:l.label,children:l.label}),e("strong",{children:a(u)})]}),e("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:e("span",{className:"orb-metric-bar-fill",style:{width:`${p}%`,backgroundColor:go(l,d,i)}})})]});return o?e("button",{type:"button",className:`orb-metric-progress-row${f?" is-active":""}`,onClick:()=>o(l),"aria-pressed":f,...fo(l,n),children:b},Ur(l,d)):e("div",{className:`orb-metric-progress-row${f?" is-active":""}`,role:"listitem",...fo(l,n),children:b},Ur(l,d))})})},TC=({type:t,data:r,activeId:o,onItemClick:n,interactions:a,valueFormatter:i,secondaryValueFormatter:s,colors:l,ariaLabel:d})=>{let{min:u,max:p,range:f}=Am(r),b=ps-Ut.left-Ut.right,m=Mn-Ut.top-Ut.bottom,v=Ut.top+p/f*m,y=Math.max(1,Math.ceil(r.length/6)),g=r.map((C,k)=>yC(k,C,r)),x=g.map(C=>`${C.x},${C.y}`).join(" "),h=Math.max(...r.map(C=>Math.max(tr(C.secondaryValue),0)),1);return e("div",{className:"orb-metric-svg-wrap",children:c("svg",{className:"orb-metric-svg",viewBox:`0 0 ${ps} ${Mn}`,role:"img","aria-label":d,children:[e("line",{className:"orb-metric-axis",x1:Ut.left,y1:v,x2:ps-Ut.right,y2:v}),e("line",{className:"orb-metric-grid",x1:Ut.left,y1:Ut.top,x2:Ut.left,y2:Mn-Ut.bottom}),t==="column"&&r.map((C,k)=>{let w=g[k],T=tr(C.value),I=Math.max(Math.abs(w.y-v),T===0?2:0),S=w.x-Math.min(18,b/Math.max(r.length*2,1)),A=Math.min(36,Math.max(10,b/Math.max(r.length*1.8,1))),R=o===C.id;return c("g",{...Vl({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(T)}`,children:[e("rect",{className:`orb-metric-column${R?" is-active":""}`,x:S,y:Math.min(w.y,v),width:A,height:I,rx:4,fill:go(C,k,l)}),c("title",{children:[C.label,": ",i(T)]}),(k%y===0||r.length<=6)&&e("text",{className:"orb-metric-svg-label",x:w.x,y:Mn-14,textAnchor:"middle",children:Nm(C.label)})]},Ur(C,k))}),(t==="line"||t==="scatter"||t==="bubble")&&c(jsxRuntime.Fragment,{children:[t==="line"&&e("polyline",{className:"orb-metric-line",fill:"none",points:x,stroke:l[0]}),r.map((C,k)=>{let w=g[k],T=o===C.id,I=t==="bubble"?7+Math.max(tr(C.secondaryValue),0)/h*12:t==="scatter"?5:4;return c("g",{...Vl({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(tr(C.value))}`,children:[t==="line"&&e("circle",{className:`orb-metric-point${T?" is-active":""}`,cx:w.x,cy:w.y,r:T?6:4,fill:go(C,k,l)}),t!=="line"&&e("circle",{className:`orb-metric-point${T?" is-active":""}`,cx:w.x,cy:w.y,r:I,fill:go(C,k,l),opacity:t==="bubble"?.82:.9}),c("title",{children:[C.label,": ",i(tr(C.value)),t==="bubble"&&C.secondaryValue!==void 0?` \xB7 Size: ${s(tr(C.secondaryValue))}`:""]}),(k%y===0||r.length<=6)&&e("text",{className:"orb-metric-svg-label",x:w.x,y:Math.max(Ut.top+8,w.y-I-7),textAnchor:"middle",children:Nm(C.label)})]},Ur(C,k))})]}),e("text",{className:"orb-metric-axis-label",x:Ut.left,y:Ut.top-5,children:i(p)}),u<0&&e("text",{className:"orb-metric-axis-label",x:Ut.left,y:Mn-Ut.bottom+14,children:i(u)})]})})},IC=({type:t,data:r,activeId:o,onItemClick:n,interactions:a,valueFormatter:i,colors:s,ariaLabel:l})=>{let d=r.map(m=>({...m,value:Math.max(tr(m.value),0)})),u=d.reduce((m,v)=>m+v.value,0),p=72,f=92,b=0;return c("div",{className:"orb-metric-circular",children:[c("svg",{className:"orb-metric-donut",viewBox:"0 0 184 184",role:"img","aria-label":l,children:[d.map((m,v)=>{let y=m.value/u*360,g=b;b+=y;let x=o===m.id,h=y>=359.9?void 0:CC(f,f,p,t==="donut"?46:0,g,g+y),C=Vl({item:m,onItemClick:n,interactions:a});return h?e("path",{className:`orb-metric-slice${x?" is-active":""}`,d:h,fill:go(m,v,s),...C,children:c("title",{children:[m.label,": ",i(m.value)," (",(m.value/u*100).toFixed(1),"%)"]})},Ur(m,v)):e("circle",{className:`orb-metric-slice${x?" is-active":""}`,cx:f,cy:f,r:t==="donut"?60:p,fill:t==="donut"?"none":go(m,v,s),stroke:t==="donut"?go(m,v,s):void 0,strokeWidth:28,...C,children:c("title",{children:[m.label,": ",i(m.value)," (100%)"]})},Ur(m,v))}),t==="donut"&&e("circle",{cx:f,cy:f,r:44,fill:"var(--orb-surface)"}),t==="donut"&&e("text",{className:"orb-metric-donut-total",x:f,y:f+5,textAnchor:"middle",children:i(u)})]}),e("div",{className:"orb-metric-legend",role:"list","aria-label":"Chart legend",children:d.map((m,v)=>{let y=o===m.id;return c("button",{type:"button",className:`orb-metric-legend-item${y?" is-active":""}`,onClick:()=>n?.(m),disabled:!n,title:m.label,...fo(m,a),children:[e("span",{className:"orb-metric-legend-dot",style:{backgroundColor:go(m,v,s)}}),e("span",{className:"orb-metric-legend-label",children:m.label}),c("strong",{children:[(m.value/u*100).toFixed(0),"%"]})]},Ur(m,v))})})]})},MC=({data:t,activeId:r,onItemClick:o,interactions:n,valueFormatter:a,secondaryValueFormatter:i})=>e("div",{className:"orb-metric-list",role:"list","aria-label":"Chart data",children:t.map((s,l)=>{let d=c(jsxRuntime.Fragment,{children:[e("span",{className:"orb-metric-list-label",title:s.label,children:s.label}),e("span",{className:"orb-metric-list-value",children:a(tr(s.value))}),s.secondaryValue!==void 0&&e("span",{className:"orb-metric-list-secondary",children:i(tr(s.secondaryValue))})]});return o?e("button",{type:"button",className:`orb-metric-list-row${r===s.id?" is-active":""}`,onClick:()=>o(s),"aria-pressed":r===s.id,...fo(s,n),children:d},Ur(s,l)):e("div",{className:`orb-metric-list-row${r===s.id?" is-active":""}`,role:"listitem",...fo(s,n),children:d},Ur(s,l))})}),gs=({title:t,subtitle:r,data:o=[],chartType:n="bar",onChartTypeChange:a,onItemClick:i,onDataDetails:s,activeId:l,valueFormatter:d=Dm,secondaryValueFormatter:u=Dm,valueLabel:p,secondaryValueLabel:f,emptyState:b,loading:m=false,error:v,maxItems:y=8,showChartTypeControl:g=true,showDataDetails:x=true,dataRevealDelayMs:h=1e3,chartTypeOptions:C,chartTypeLabels:k,footer:w,ariaLabel:T,className:I,style:S,sx:A})=>{let R=Fs(),M=er.useRef(null),N=er.useRef(null),[E,O]=er.useState(n),[F,_]=er.useState(false),[B,Y]=er.useState(null),[W,j]=er.useState(null);er.useEffect(()=>O(n),[n]);let V=er.useCallback(()=>{N.current!==null&&(window.clearTimeout(N.current),N.current=null);},[]);er.useEffect(()=>V,[V]),er.useEffect(()=>{if(!W)return;let X=De=>{let ye=De.target;ye instanceof HTMLElement&&ye.closest(".orb-metric-context-menu")||j(null);};return document.addEventListener("pointerdown",X),()=>document.removeEventListener("pointerdown",X)},[W]);let z=E,K=er.useMemo(()=>[R.chart1,R.chart2,R.chart3,R.chart4,R.chart5,R.chart6],[R]),q=er.useMemo(()=>F?o:o.slice(0,Math.max(1,y)),[o,y,F]),fe=Math.max(0,o.length-q.length),se=q.some(X=>tr(X.value)>0),ue=q.length>0&&(z!=="pie"&&z!=="donut"?true:se),Se=(C??[z,"bar","column","line","pie","donut","scatter","bubble","list"]).filter((X,De,ye)=>ms.includes(X)&&ye.indexOf(X)===De),$e={...vC,...k},ke=q[0],le=T??`${t} ${$e[z]} chart`,Ee=X=>{O(X),a?.(X);},Me=er.useCallback((X,De)=>{Y({item:X,source:De}),j(null),s?.(X,De);},[s]),Pe=er.useCallback(X=>{V(),!(!x||W)&&(N.current=window.setTimeout(()=>{Me(X,"hover"),N.current=null;},Math.max(0,h)));},[V,W,h,Me,x]),Ve=er.useCallback(()=>{V();},[V]),tt=er.useCallback((X,De)=>{if(!x)return;X.preventDefault(),V();let ye=M.current?.getBoundingClientRect(),Be=ye?us(X.clientX-ye.left,8,Math.max(8,ye.width-164)):8,at=ye?us(X.clientY-ye.top,8,Math.max(8,ye.height-72)):8;j({item:De,left:Be,top:at});},[V,x]),nt=x?{onItemHoverStart:Pe,onItemHoverEnd:Ve,onItemContextMenu:tt}:void 0,it=z==="metric"?c("div",{className:"orb-metric-kpi",role:i?"button":"img",tabIndex:i?0:void 0,onClick:()=>ke&&i?.(ke),onKeyDown:X=>{ke&&i&&(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),i(ke));},"aria-label":le,...ke?fo(ke,nt):{},children:[e("span",{className:"orb-metric-kpi-label",children:ke?.label??p??"Value"}),e("strong",{children:ke?d(tr(ke.value)):"\u2014"}),ke?.secondaryValue!==void 0&&c("span",{className:"orb-metric-kpi-secondary",children:[f??"Compared with"," \xB7 ",u(tr(ke.secondaryValue))]})]}):z==="progress"?e(PC,{data:q,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,colors:K}):z==="bar"?e(kC,{data:q,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,colors:K}):z==="list"?e(MC,{data:q,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,secondaryValueFormatter:u}):z==="pie"||z==="donut"?e(IC,{type:z,data:q,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,colors:K,ariaLabel:le}):e(TC,{type:z,data:q,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,secondaryValueFormatter:u,colors:K,ariaLabel:le});return c("div",{ref:M,className:"orb-metric-chart-shell",onMouseLeave:()=>{V(),B?.source==="hover"&&Y(null);},children:[c(Ae,{elevation:1,variant:"outlined",className:`orb-metric-chart-card ${I??""}`,style:S,sx:A,children:[c("div",{className:"orb-metric-chart-header",children:[c("div",{className:"orb-metric-chart-heading",children:[e(L,{variant:"subtitle1",component:"h3",noWrap:true,title:t,children:t}),r&&e(L,{variant:"caption",muted:true,component:"div",noWrap:true,children:r})]}),g&&Se.length>1&&e(zt,{"aria-label":`${t} chart type`,className:"orb-metric-chart-select",value:z,options:Se.map(X=>({value:X,label:$e[X]})),onChange:X=>Ee(X.target.value),minWidth:108,fullWidth:false,size:"small"})]}),c("div",{className:"orb-metric-chart-body",children:[e(wC,{loading:m,error:v,hasData:ue,emptyState:b,children:it}),fe>0&&!m&&!v&&e("button",{type:"button",className:"orb-metric-more",onClick:()=>_(X=>!X),children:F?"Show fewer":`Show all ${o.length}`})]}),w&&e("div",{className:"orb-metric-chart-footer",children:w})]}),W&&c("div",{className:"orb-metric-context-menu",role:"menu",onMouseEnter:V,onKeyDown:X=>{X.key==="Escape"&&j(null);},style:{left:W.left,top:W.top},onPointerDown:X=>X.stopPropagation(),children:[e("div",{className:"orb-metric-context-label",children:W.item.label}),e("button",{type:"button",role:"menuitem",onClick:X=>{X.preventDefault(),X.stopPropagation(),Me(W.item,"contextmenu");},children:"Show data"})]}),B&&c("div",{className:"orb-metric-data-details",role:"dialog","aria-label":`${B.item.label} data details`,onPointerDown:X=>X.stopPropagation(),children:[c("div",{className:"orb-metric-data-details-header",children:[e("strong",{children:B.item.label}),e("button",{type:"button","aria-label":"Close data details",onClick:()=>Y(null),children:"\xD7"})]}),c("div",{className:"orb-metric-data-details-row",children:[e("span",{children:p??"Value"}),e("strong",{children:d(tr(B.item.value))})]}),B.item.secondaryValue!==void 0&&c("div",{className:"orb-metric-data-details-row",children:[e("span",{children:f??"Secondary value"}),e("strong",{children:u(tr(B.item.secondaryValue))})]}),e("span",{className:"orb-metric-data-details-hint",children:B.source==="hover"?`Shown after ${Math.max(0,h)/1e3} seconds of stillness`:"Shown from the context menu"})]})]})};gs.displayName="CMetricChartCard";P();var RC=({messageId:t,cardHooks:r,valueSuffix:o,secondaryValueSuffix:n,...a})=>{let i=(l,d)=>{r?.onCardEvent?.({messageId:t,cardType:"metric-chart-card",action:l,title:a.title,payload:d,rawData:a});},s=(l,d)=>`${l.toLocaleString()}${d??""}`;return e(gs,{...a,valueFormatter:l=>s(l,o),secondaryValueFormatter:l=>s(l,n),onChartTypeChange:l=>i("action",{chartType:l}),onItemClick:l=>i("action",{item:l}),onDataDetails:(l,d)=>i("show-data",{item:l,source:d})})},fs=RC;P();var DC=({type:t,manifest:r})=>c("div",{className:"w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md",children:[c("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[e("div",{className:"w-4 h-4 mr-2 text-[var(--orb-status-primary)]"}),c("h3",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:["SAP Card: ",t]})]}),e("div",{className:"p-4",children:e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 rounded border border-[var(--orb-border)] overflow-x-auto",children:e("pre",{className:"text-xs font-mono text-[var(--orb-muted)] whitespace-pre-wrap",children:JSON.stringify(r,null,2)})})})]}),bs=DC;var NC=t=>Array.isArray(t)?t.flatMap((r,o)=>{if(!r||typeof r!="object")return [];let n=r,a=String(n.label??n.name??n.id??`Item ${o+1}`),i=Number(n.value),s=Number.isFinite(i)?i:0,l=n.secondaryValue===void 0?void 0:Number(n.secondaryValue);return [{id:String(n.id??n.name??n.label??o),label:a,value:s,...l!==void 0&&Number.isFinite(l)?{secondaryValue:l}:{},...typeof n.color=="string"?{color:n.color}:{}}]}):[],hs=t=>{let r;try{r=JSON.parse(t);}catch{return null}if(r&&typeof r=="object"){if(r.type==="metric-chart-card"&&r.title&&Array.isArray(r.data)){let o=ms.includes(r.chartType)?r.chartType:"bar";return {...r,type:"metric-chart-card",chartType:o,data:NC(r.data)}}if((r.type==="bar-chart-card"||r.type==="line-chart-card"||r.type==="pie-chart-card"||r.type==="combo-chart-card"||r.type==="heatmap-chart-card"||r.type==="fishbone-chart-card"||r.type==="waterfall-chart-card"||r.type==="google-map-card"||r.type==="amap-card")&&r.title||(r.type==="sap-analytical-card"||r.type==="sap-list-card"||r.type==="sap-object-card"||r.type==="sap-component-card")&&r.manifest||r.type==="error-card"||r.type==="warning-card"||r.type==="suggestions-card"||r.type==="tool-result-card"||r.type==="table"&&r.data)return r}return null};P();var HC=({content:t,theme:r,size:o="base",className:n,enableCodeHighlight:a=true,enableMermaid:i=true,messageId:s,cardHooks:l})=>{let d=er.useRef(l);d.current=l;let u=!!l?.onCardEvent,p=er.useMemo(()=>u?{onCardEvent:y=>d.current?.onCardEvent?.(y)}:void 0,[u]),f=er.useMemo(()=>t?t.replace(/<think>([\s\S]*?)<\/think>/g,(y,g)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(g.trim())}"></div>`):"",[t]),b=(y,g,x,h,C)=>{p?.onCardEvent?.({messageId:s,cardType:y,action:g,title:x,payload:h,rawData:C});},m=(y,g,x,h,C,k)=>{if(!(!C&&!p?.onCardEvent))return (...w)=>{let T=C?.(...w),I=k?k(...w):void 0;return b(y,g,x,I,h),T}},v=er.useMemo(()=>({div(y){let{"data-component":g,"data-think-content":x,...h}=y;return g==="thinkbox"&&x?e(vm,{content:decodeURIComponent(x),theme:r,size:o,defaultExpanded:false}):e("div",{...h})},table({children:y}){return e("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-[var(--orb-border)]",children:e("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:y})})},thead({children:y}){return e("thead",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]",children:y})},tbody({children:y}){return e("tbody",{className:"bg-[var(--orb-canvas)] dark:bg-[var(--orb-canvas)]",children:y})},tr({children:y}){return e("tr",{className:"border-b border-[var(--orb-border)] last:border-b-0",children:y})},th({children:y,align:g}){return e("th",{className:`px-3 py-2 font-semibold text-[var(--orb-fg)] ${g==="center"?"text-center":g==="right"?"text-right":"text-left"}`,children:y})},td({children:y,align:g}){return e("td",{className:`px-3 py-2 text-[var(--orb-fg)] align-top ${g==="center"?"text-center":g==="right"?"text-right":"text-left"}`,children:y})},code({className:y,children:g,...x}){let h=/language-([\w-]+)/.exec(y||""),C=h?h[1]:"",k=String(g);if(!h&&!k.includes(`
199
- `))return e("code",{children:g});let T=k.replace(/\n$/,"");if(i&&C==="mermaid")return e(km,{content:T});if(C==="html"||C==="htm")return e(xm,{content:T});if(C==="json"){let I=hs(T);if(I)switch(I.type){case "table":return e(ss,{data:I.data});case "metric-chart-card":return e(fs,{...I,messageId:s,cardHooks:p});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 e(ls,{...I});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return e(bs,{...I});case "error-card":{let S=I;return e(os,{...S,onClose:m("error-card","close",S.title,S,S.onClose),onRetry:m("error-card","retry",S.title,S,S.onRetry)})}case "warning-card":{let S=I,A=S.onConfirm?m("warning-card","confirm",S.title,S,S.onConfirm):S.actionText&&p?.onCardEvent?m("warning-card","confirm",S.title,S):void 0;return e(ns,{...S,onClose:m("warning-card","close",S.title,S,S.onClose),onConfirm:A})}case "suggestions-card":{let S=I;return e(as,{...S,onClose:m("suggestions-card","close",S.title,S,S.onClose),onSuggestionClick:m("suggestions-card","suggestion-click",S.title,S,S.onSuggestionClick,A=>({suggestion:A}))})}case "tool-result-card":{let S=I;return e(is,{...S,onClose:m("tool-result-card","close",S.title,S,S.onClose),onAction:m("tool-result-card","action",S.title,S,S.onAction)})}}}return a?e(ym,{content:T,language:C,className:"not-prose"}):e("code",{className:y,...x,children:g})}}),[r,o,i,a,p,s]);return e("div",{className:ut("markdown-body max-w-none",n),children:e(EC__default.default,{remarkPlugins:[LC__default.default,OC__default.default],rehypePlugins:[FC__default.default,BC__default.default],components:v,children:f})})},Rn=HC;P();var zC=({content:t,messageId:r,cardHooks:o})=>{let n=(s,l,d,u,p)=>{o?.onCardEvent?.({messageId:r,cardType:s,action:l,title:d,payload:u,rawData:p});},a=(s,l,d,u,p,f)=>{if(!(!p&&!o?.onCardEvent))return (...b)=>{let m=p?.(...b),v=f?f(...b):void 0;return n(s,l,d,v,u),m}},i=hs(t);if(i)switch(i.type){case "table":return e(ss,{data:i.data});case "metric-chart-card":return e(fs,{...i,messageId:r,cardHooks:o});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return e(ls,{...i});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return e(bs,{...i});case "error-card":{let s=i;return e(os,{...s,onClose:a("error-card","close",s.title,s,s.onClose),onRetry:a("error-card","retry",s.title,s,s.onRetry)})}case "warning-card":{let s=i,l=s.onConfirm?a("warning-card","confirm",s.title,s,s.onConfirm):s.actionText&&o?.onCardEvent?a("warning-card","confirm",s.title,s):void 0;return e(ns,{...s,onClose:a("warning-card","close",s.title,s,s.onClose),onConfirm:l})}case "suggestions-card":{let s=i;return e(as,{...s,onClose:a("suggestions-card","close",s.title,s,s.onClose),onSuggestionClick:a("suggestions-card","suggestion-click",s.title,s,s.onSuggestionClick,l=>({suggestion:l}))})}case "tool-result-card":{let s=i;return e(is,{...s,onClose:a("tool-result-card","close",s.title,s,s.onClose),onAction:a("tool-result-card","action",s.title,s,s.onAction)})}}return e("div",{className:"dynamic-card-fallback",children:e(Rn,{content:t,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:r,cardHooks:o})})},Em=zC;P();var $l=class{static analyze(r){if(!r.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let n=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(r),a=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(r),i=r.includes("NQ#")||r.includes("data-component");return n||a||i?{blocks:[{type:"mixed",content:r,startIndex:0,endIndex:r.length}],hasComplexContent:true,overallType:"complex"}:{blocks:[{type:"markdown",content:r,startIndex:0,endIndex:r.length}],hasComplexContent:false,overallType:"simple"}}},WC=({content:t,className:r="",messageId:o,cardHooks:n})=>{let a=er__namespace.default.useMemo(()=>$l.analyze(t),[t]);return e("div",{className:`universal-content-renderer ${r}`,children:a.blocks.map((i,s)=>i.type==="mixed"||i.type==="json-card"?e(Em,{content:i.content,messageId:o,cardHooks:n},`block-${s}`):e(Rn,{content:i.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:n},`block-${s}`))})},vs=WC;P();var $C=({content:t,isStreaming:r=true,onComplete:o,className:n="",streamIntervalMs:a=24,streamChunkSize:i=3,messageId:s,cardHooks:l})=>{let[d,u]=er.useState(r?0:t.length),[p,f]=er.useState(!r);er.useEffect(()=>{if(r){u(0),f(false);return}u(t.length),f(true);},[t,r]),er.useEffect(()=>{if(!r||p)return;if(d>=t.length){f(true),o?.();return}let g=window.setTimeout(()=>{u(x=>Math.min(x+i,t.length));},a);return ()=>{window.clearTimeout(g);}},[t.length,p,r,o,i,a,d]);let b=()=>{r&&!p&&(u(t.length),f(true),o?.());},m=r?t.slice(0,d):t,v=r&&!p,y=r&&!p;return c("div",{className:`streaming-markdown ${n}`,onClick:b,style:{cursor:r?"pointer":"default"},children:[c("div",{className:"relative",children:[e(vs,{content:m,messageId:s,cardHooks:l}),v&&e("span",{className:"inline-block w-[2px] h-[13px] ml-0.5 animate-pulse",style:{verticalAlign:"text-bottom",backgroundColor:"var(--orb-primary, #154194)"}})]}),y&&e("div",{className:"streaming-hint",style:{fontSize:"9px",color:"var(--orb-muted)",marginTop:"8px",fontStyle:"italic",opacity:.7},children:"\u70B9\u51FB\u6B64\u5904\u663E\u793A\u5B8C\u6574\u5185\u5BB9"})]})},Fm=$C;P();var Bm=({buttons:t,className:r})=>{let o=n=>{switch(n){case "copy":return e(vo,{size:14});case "refresh":return e(Ba,{size:14});case "volume":return e(ed,{size:14});case "like":return e(Zc,{size:14});case "dislike":return e(Yc,{size:14});default:return null}};return e("div",{className:ut("flex items-center gap-1",r),children:t.map((n,a)=>e("button",{onClick:n.onClick,disabled:n.disabled,"aria-busy":n.loading||void 0,className:ut("p-1.5 rounded-md transition-colors","text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:text-[var(--orb-fg)]","hover:bg-[var(--orb-hover)]","disabled:opacity-50 disabled:cursor-not-allowed",n.active&&"text-[var(--orb-primary)] bg-[var(--orb-p50)]",n.type==="refresh"&&n.loading&&"animate-spin"),title:n.type,type:"button",children:o(n.type)},`${n.type}-${a}`))})};P();var ys=({message:t,onStreamingComplete:r,assistantActions:o,streamIntervalMs:n,streamChunkSize:a,cardHooks:i})=>{let s={lineHeight:1.55,fontSize:13,fontWeight:300,fontFamily:'var(--orb-font, "Montserrat", system-ui, sans-serif)',color:"var(--orb-fg, #555555)",borderRadius:"var(--orb-r, 10px)",padding:"10px 14px"},l={marginTop:6,fontSize:11,color:"var(--orb-muted, #8c8c8c)"};if(t.type==="assistant"){let d=!!(o?.isResponding||t.isStreaming);return e("div",{className:"mb-4 flex justify-start",children:c("div",{className:"mr-auto w-full",style:{...s,background:"var(--orb-surface, #f5f5f5)",border:"1px solid var(--orb-border, #dbdbdb)"},children:[e(Fm,{content:t.content,isStreaming:t.isStreaming??false,onComplete:r,streamIntervalMs:n,streamChunkSize:a,messageId:t.id,cardHooks:i}),t.content&&o?.isLatestAssistant&&e("div",{className:"mt-3 flex flex-row justify-start gap-2 border-t pt-2",style:{borderColor:"var(--orb-border, #dbdbdb)"},children:e(Bm,{buttons:[{type:"refresh",onClick:()=>{o?.onRegenerate?.();},disabled:d||!o?.onRegenerate,loading:d},{type:"copy",onClick:()=>navigator.clipboard.writeText(t.content),disabled:false},{type:"volume",onClick:()=>console.log("\u8BED\u97F3\u64AD\u653E"),disabled:false},{type:"like",onClick:()=>console.log("\u70B9\u8D5E"),disabled:false},{type:"dislike",onClick:()=>console.log("\u70B9\u8E29"),disabled:false}],size:"sm",variant:"default"})}),e("div",{style:l,children:t.timestamp.toLocaleTimeString()})]})})}return e("div",{className:"mb-4 flex justify-end",children:c("div",{className:"ml-auto max-w-[80%]",style:{...s,background:"var(--orb-p50, #eef2f9)",border:"1px solid var(--orb-p100, #e4e9f5)"},children:[e("div",{className:"whitespace-pre-wrap",children:t.content}),e("div",{style:l,children:t.timestamp.toLocaleTimeString()})]})})};P();var Hm=({onTextUpdate:t,onComplete:r,onCancel:o,disabled:n,className:a})=>{let{isRecording:i,startRecording:s,stopRecording:l}=Sn({onTextUpdate:t,onComplete:u=>{r?.(u);},onError:u=>{console.error("Voice input error:",u),o?.();}});return e("button",{onClick:async()=>{i?l():await s();},disabled:n,className:ut("transition-all duration-200 flex items-center justify-center rounded-full",i?"bg-[color-mix(in_oklch,var(--orb-status-error)_12%,transparent)] text-[var(--orb-status-error)] hover:bg-[color-mix(in_oklch,var(--orb-status-error)_20%,transparent)] animate-pulse":"bg-transparent hover:bg-[var(--orb-hover)] text-[var(--orb-muted)] active:scale-95",n&&"opacity-50 cursor-not-allowed",a),title:i?"Stop recording":"Start recording",type:"button",children:i?e(ap,{size:16}):e(ip,{size:16})})};P();var dr={container:"w-full max-w-4xl mx-auto",inputContainer:ut("w-full flex flex-col border border-[var(--orb-border,#dbdbdb)] bg-[color-mix(in_oklch,var(--orb-canvas)_64%,transparent)] backdrop-blur-[28px] transition-colors duration-200","orb-agent-input","focus-within:border-[var(--orb-primary,#154194)] focus-within:ring-1 focus-within:ring-[var(--orb-focus-ring,#e4e9f5)]"),dragActive:"border-[var(--orb-primary,#154194)] bg-[var(--orb-p50,#eef2f9)]",textareaWrapper:"flex-1 relative flex items-center",textarea:ut("w-full outline-none appearance-none resize-none bg-transparent border-none text-sm font-normal py-3 px-3","placeholder:text-[var(--orb-muted,#8c8c8c)] placeholder:font-normal","text-[var(--orb-fg,#555555)] selection:bg-[var(--orb-p100,#e4e9f5)]","focus:ring-0 focus:outline-none focus:border-none focus:shadow-none","min-h-[44px] max-h-[12em] overflow-y-auto scrollbar-thin scrollbar-thumb-[var(--orb-border)]"),filePreviewArea:"px-4 pt-3 pb-1 flex flex-wrap gap-2",fileTag:ut("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium","bg-[var(--orb-surface,#f5f5f5)] text-[var(--orb-fg,#555555)]","border border-[var(--orb-border,#dbdbdb)]","transition-all hover:bg-[var(--orb-hover,#eef2f9)]"),buttonBase:"flex items-center justify-center transition-all duration-200 rounded-full",buttonSmall:"h-[38px] w-[38px] shrink-0 md:h-8 md:w-8",buttonNormal:ut("bg-transparent hover:bg-[var(--orb-hover,#eef2f9)] text-[var(--orb-muted,#8c8c8c)] hover:text-[var(--orb-fg,#555555)]","cursor-pointer active:scale-95"),sendButton:ut("cursor-pointer bg-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p600,#0e2d63)] text-[var(--orb-on-primary)] shadow-none active:scale-95"),sendButtonDisabled:ut("cursor-not-allowed opacity-40 bg-[var(--orb-disabled-bg,#f5f5f5)] text-[var(--orb-disabled-fg,#8c8c8c)]"),stopButton:ut("cursor-pointer bg-[var(--orb-err,#c43f02)] hover:opacity-90 text-[var(--orb-on-primary)] shadow-none active:scale-95")},GC={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},UC=({enabled:t,onClick:r})=>e("button",{className:ut(dr.buttonBase,dr.buttonSmall,dr.buttonNormal),onClick:r,disabled:!t,"aria-label":"Upload file",type:"button",children:e(Hd,{size:16})}),KC=({canSend:t,isResponding:r,onSend:o,onStop:n})=>r?e("button",{className:ut(dr.buttonBase,dr.buttonSmall,dr.stopButton),onClick:n,"aria-label":"Stop generating",type:"button",children:e(fp,{size:15})}):e("button",{className:ut(dr.buttonBase,dr.buttonSmall,t?dr.sendButton:dr.sendButtonDisabled),onClick:o,disabled:!t,"aria-label":"Send message",type:"button",children:e(dp,{size:16,className:t?"text-[var(--orb-on-primary,#ffffff)]":"text-[var(--orb-disabled-fg,#8c8c8c)]"})}),_l=({onSend:t,onStop:r,isResponding:o=false,placeholder:n,getText:a})=>{let[i,s]=er.useState(""),[l,d]=er.useState([]),[u,p]=er.useState(false),[f,b]=er.useState(false),m=er.useRef(null),v=n||(a?a("00019","Type a message..."):"Type a message..."),y=(i.trim().length>0||l.length>0)&&!o,g={enabled:true},x=er.useCallback(F=>{s(F.target.value),F.target.style.height="auto",F.target.style.height=`${Math.min(F.target.scrollHeight,200)}px`;},[]),h=er.useCallback(F=>{if(F.target.files&&F.target.files.length>0){let _=Array.from(F.target.files);d(B=>{let Y=_.filter(j=>B.some(V=>V.name===j.name&&V.size===j.size));Y.length>0&&console.warn("Duplicate files ignored:",Y.map(j=>j.name));let W=_.filter(j=>!B.some(V=>V.name===j.name&&V.size===j.size));return [...B,...W]}),m.current&&(m.current.value="");}},[]),C=er.useCallback(F=>{d(_=>_.filter((B,Y)=>Y!==F));},[]),k=er.useCallback(()=>{m.current?.click();},[]),w=er.useCallback(async()=>{if(!y)return;let F=i,_=[...l];s(""),d([]),m.current&&(m.current.value="");try{await t(F,_);}catch(B){console.error("Failed to send message:",B),s(F),d(_);}},[i,y,t,l]),T=er.useCallback(F=>{F.key==="Enter"&&!F.shiftKey&&!u&&(F.preventDefault(),w());},[w,u]),I=er.useCallback(()=>{p(true);},[]),S=er.useCallback(()=>{p(false);},[]),A=er.useCallback(F=>{s(F);},[]),R=er.useCallback(F=>{s(F);},[]),M=er.useCallback(()=>{},[]),N=er.useCallback(F=>{F.preventDefault(),b(true);},[]),E=er.useCallback(F=>{F.preventDefault(),b(false);},[]),O=er.useCallback(F=>{if(F.preventDefault(),b(false),F.dataTransfer.files&&F.dataTransfer.files.length>0){let _=Array.from(F.dataTransfer.files);d(B=>[...B,..._]);}},[]);return e("div",{className:dr.container,children:c("div",{className:"relative",children:[e("input",{type:"file",multiple:true,className:"hidden",ref:m,onChange:h}),c("div",{className:ut(dr.inputContainer,f&&dr.dragActive),onDragOver:N,onDragLeave:E,onDrop:O,children:[l.length>0&&e("div",{className:dr.filePreviewArea,children:l.map((F,_)=>c("div",{className:dr.fileTag,children:[e(ep,{sx:{fontSize:16},className:"text-[var(--orb-primary)]"}),e("span",{className:"truncate max-w-[150px]",children:F.name}),e("button",{onClick:()=>C(_),className:"ml-1 hover:text-[var(--orb-status-error)] focus:outline-none",type:"button",children:e(Kd,{sx:{fontSize:16}})})]},`${F.name}-${_}`))}),c("div",{className:"flex w-full flex-col p-2",children:[e("div",{className:ut(dr.textareaWrapper,"min-h-[52px] px-2 pb-2 pt-1.5 md:min-h-[44px]"),children:e("textarea",{className:ut(dr.textarea,"min-h-[24px] py-0 px-0"),placeholder:v,value:i,onChange:x,onKeyDown:T,onCompositionStart:I,onCompositionEnd:S,style:GC,"aria-label":"Message input",spellCheck:false,rows:1})}),c("div",{className:"flex items-center justify-between px-1 pb-0.5",children:[e("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:e(UC,{enabled:g.enabled,onClick:k})}),c("div",{className:"flex items-center gap-1",children:[e(Hm,{onTextUpdate:A,onComplete:R,onCancel:M,disabled:o,className:dr.buttonSmall}),e(KC,{canSend:y,isResponding:o,onSend:w,onStop:r})]})]})]})]})]})})};P();var Vm=({messages:t,onSend:r,onStop:o,onRegenerate:n,isResponding:a=false,className:i,placeholder:s,streamIntervalMs:l,streamChunkSize:d,onMessageStreamingComplete:u,cardHooks:p,showInput:f=true,statusLine:b})=>{let m=er.useRef(null),v=er.useRef(t.length);return er.useEffect(()=>{t.length>v.current&&m.current?.scrollIntoView({behavior:"smooth"}),v.current=t.length;},[t]),c("div",{className:ut("flex flex-col h-full w-full relative",i),children:[c("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((y,g)=>{let x=y.type==="assistant"&&g===t.length-1,h=y.type==="assistant"?{isLatestAssistant:x,isResponding:a,onRegenerate:n?()=>n(y.id):void 0}:void 0;return e(ys,{message:y,assistantActions:h,onStreamingComplete:()=>u?.(y.id),streamIntervalMs:l,streamChunkSize:d,cardHooks:p},y.id)}),b,e("div",{ref:m})]}),f&&e("div",{className:"border-t border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] p-4 z-10",children:e(_l,{onSend:r||(async()=>{}),onStop:o||(()=>{}),isResponding:a,placeholder:s})})]})};P();var Wm={idle:"Idle",running:"Working",success:"Success",error:"Error",pending:"Pending"},$m=({title:t="AI Agent",description:r,headerActions:o,className:n,agentStatus:a,statusText:i,onHeaderPointerDown:s,showInput:l=false,...d})=>{let u=a??(d.isResponding?"running":"idle"),p=u==="running"||u==="pending",f=[Wm[u],r].filter(Boolean).join(" \xB7 ");return c("div",{className:ut("orb-agent-panel",n),children:[c("div",{className:ut("orb-agent-header",s&&"cursor-grab active:cursor-grabbing"),onPointerDown:s,children:[e("span",{className:"orb-agent-avatar","aria-hidden":"true",children:"AI"}),c("div",{className:"min-w-0 flex-1",children:[e("div",{className:"orb-agent-title",children:t}),c("div",{className:"orb-agent-subtitle",children:[e("span",{className:"orb-agent-dot","data-active":p||void 0}),e("span",{className:"truncate",children:f||"Agent"})]})]}),o&&e("div",{className:"ml-auto flex flex-none items-center gap-1",children:o})]}),e("div",{className:"relative min-h-0 flex-1",children:e(Vm,{...d,showInput:l,statusLine:p?c("div",{className:ut("orb-agent-status-line","mb-1"),children:[e("span",{className:"orb-agent-spinner","aria-hidden":"true"}),e("span",{children:i??`${Wm[u]}\u2026`})]}):void 0})})]})};P();var ZC=t=>Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t),Gm=({conversations:t,activeConversationId:r,labels:o,onNewConversation:n,onSelectConversation:a})=>{let[i,s]=er.useState(false),l=er.useRef(null),d=er.useRef(null),u=er.useRef(null),p=er.useId(),f=!!a;er.useEffect(()=>{if(!i)return;let m=y=>{l.current?.contains(y.target)||s(false);},v=y=>{y.key==="Escape"&&(y.stopPropagation(),s(false),u.current?.focus());};return document.addEventListener("pointerdown",m),document.addEventListener("keydown",v),()=>{document.removeEventListener("pointerdown",m),document.removeEventListener("keydown",v);}},[i]),er.useEffect(()=>{if(!i)return;let m=d.current?.querySelector('[aria-selected="true"]'),v=d.current?.querySelector('[role="option"]');(m??v)?.focus();},[i]);let b=m=>{let v=Array.from(d.current?.querySelectorAll('[role="option"]')??[]);if(v.length===0)return;let y=v.findIndex(x=>x===document.activeElement),g=y<0?m===1?0:v.length-1:(y+m+v.length)%v.length;v[g]?.focus();};return !n&&!f?null:c(jsxRuntime.Fragment,{children:[n&&e("button",{type:"button",className:"orb-omph-icon-btn","aria-label":o.newConversation,onClick:()=>{s(false),n();},children:e(en,{size:16})}),f&&a&&c("div",{className:"orb-omph-conversation-anchor",ref:l,children:[e("button",{ref:u,type:"button",className:"orb-omph-icon-btn","aria-label":o.conversationList,"aria-expanded":i,"aria-controls":p,onClick:()=>s(m=>!m),children:e($c,{size:16})}),i&&e("div",{ref:d,id:p,className:"orb-omph-conversations",role:"listbox","aria-label":o.conversations,onKeyDown:m=>{m.key==="ArrowDown"?(m.preventDefault(),b(1)):m.key==="ArrowUp"&&(m.preventDefault(),b(-1));},children:t.length===0?e("p",{className:"orb-omph-conversation-empty",children:o.noConversations}):t.map(m=>{let v=m.updatedAt?ZC(m.updatedAt):"",y=[m.preview,v].filter(x=>x&&x.length>0).join(" \xB7 "),g=m.id===r;return c("button",{type:"button",role:"option",className:"orb-omph-conversation","aria-selected":g,"data-active":g||void 0,onClick:()=>{a(m.id),s(false);},children:[e("span",{className:"orb-omph-conversation-title",children:m.title}),y&&e("span",{className:"orb-omph-conversation-meta",children:y})]},m.id)})})]})]})};P();var rx=2e3,ox=1/3,xs=[.25,.5,.75,1,1.5,2,3,4],nx=100,Um={color:"inherit",background:"transparent",textShadow:"none",fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",textAlign:"left",wordSpacing:"normal",wordBreak:"normal",overflowWrap:"normal",tabSize:"inherit",hyphens:"none"},Km=({text:t,language:r,startLine:o,endLine:n,wrap:a,labels:i})=>{let s=er.useRef(null),l=er.useMemo(()=>{let p=t.split(`
200
- `);p.length>1&&p[p.length-1]===""&&p.pop();let f=Math.min(p.length,rx);return {shown:p.slice(0,f).join(`
201
- `),shownCount:f,total:p.length}},[t]),d=er.useCallback(p=>{let f=n??o,b=o!==void 0&&f!==void 0&&p>=o&&p<=f;return {className:"orb-omph-code-line","data-line":p,...b?{"data-hit":"true"}:{}}},[n,o]);er.useEffect(()=>{let p=s.current,f=p?.closest(".orb-omph-pv-body");if(!p||!f)return;if(o===void 0){f.scrollTop=0;return}let b=p.querySelector(`[data-line="${o}"]`);if(!b)return;let m=b.getBoundingClientRect().top-f.getBoundingClientRect().top+f.scrollTop;f.scrollTop=Math.max(0,m-f.clientHeight*ox);},[o,l.shown]);let u={"--orb-omph-digits":String(l.shownCount).length};return c("div",{ref:s,className:"orb-omph-code","data-wrap":a||void 0,style:u,children:[e(reactSyntaxHighlighter.Prism,{language:r,useInlineStyles:false,PreTag:"div",CodeTag:"div",showLineNumbers:true,wrapLines:true,lineProps:d,customStyle:Um,codeTagProps:{className:`language-${r}`,style:Um},children:l.shown}),l.total>l.shownCount&&e("div",{className:"orb-omph-pv-note",children:i.previewTruncated(l.shownCount,l.total)})]})},qm=({text:t})=>e("div",{className:"orb-omph-pv-doc",children:e(Rn,{content:t})}),Xm=({url:t,alt:r,labels:o})=>{let[n,a]=er.useState("fit"),[i,s]=er.useState(null),[l,d]=er.useState(false),u=n==="fit"?1:n,p=xs.some(v=>v>u),f=xs.some(v=>v<u),b=v=>a(y=>{let g=y==="fit"?1:y;return (v>0?xs.find(h=>h>g):[...xs].reverse().find(h=>h<g))??y}),m=n==="fit"||i===null?{maxWidth:"100%",height:"auto"}:{width:i*n,maxWidth:"none",height:"auto"};return l?e("div",{className:"orb-omph-pv-note",role:"alert",children:r?`${o.imageFailed} \xB7 ${r}`:o.imageFailed}):c("div",{className:"orb-omph-img",children:[e("div",{className:"orb-omph-img-stage",children:e("img",{src:t,alt:r??"",draggable:false,style:m,onLoad:v=>s(v.currentTarget.naturalWidth),onError:()=>d(true)})}),c("div",{className:"orb-omph-img-zoom",role:"group","aria-label":o.zoomFit,children:[e("button",{type:"button","aria-label":o.zoomOut,disabled:!f,onClick:()=>b(-1),children:"\u2212"}),e("button",{type:"button","aria-label":o.zoomFit,"data-active":n==="fit"||void 0,onClick:()=>a("fit"),children:n==="fit"?o.zoomFit:`${Math.round(n*nx)}%`}),e("button",{type:"button","aria-label":o.zoomIn,disabled:!p,onClick:()=>b(1),children:"+"})]})]})};var ax=/^[a-z][a-z0-9+.-]*:/i,ix=/^L(\d+)(?:-L?(\d+))?$/i;var Ym=["B","KB","MB","GB"];var sx=t=>{try{return decodeURIComponent(t)}catch{return t}},Kl=t=>{let r=t.trim();if(!r||r.startsWith("#")||r.startsWith("//")||ax.test(r))return null;let o=r.indexOf("#"),n=o>=0?r.slice(0,o):r,a=o>=0?r.slice(o+1):"",i=n.indexOf("?"),s=sx(i>=0?n.slice(0,i):n);if(!s||s.endsWith("/"))return null;let l=ix.exec(a);if(!l)return {path:s};let d=Number(l[1]);if(d<1)return {path:s};let u=l[2]?Number(l[2]):d;return {path:s,startLine:d,endLine:Math.max(d,u)}},Ss=t=>t.split("/").filter(Boolean).pop()??t,jm=t=>{let r=t.split("/");return r.pop(),r.join("/")},ql=t=>{let r=Ss(t),o=r.lastIndexOf(".");return o>0?r.slice(o+1).toLowerCase():""},Qm={prism:"text",label:"Text"},Zm={ts:{prism:"typescript",label:"TypeScript"},tsx:{prism:"tsx",label:"TSX"},js:{prism:"javascript",label:"JavaScript"},mjs:{prism:"javascript",label:"JavaScript"},cjs:{prism:"javascript",label:"JavaScript"},jsx:{prism:"jsx",label:"JSX"},json:{prism:"json",label:"JSON"},py:{prism:"python",label:"Python"},java:{prism:"java",label:"Java"},go:{prism:"go",label:"Go"},rs:{prism:"rust",label:"Rust"},c:{prism:"c",label:"C"},h:{prism:"c",label:"C"},cpp:{prism:"cpp",label:"C++"},cs:{prism:"csharp",label:"C#"},sql:{prism:"sql",label:"SQL"},sh:{prism:"bash",label:"Shell"},bash:{prism:"bash",label:"Shell"},yml:{prism:"yaml",label:"YAML"},yaml:{prism:"yaml",label:"YAML"},xml:{prism:"markup",label:"XML"},html:{prism:"markup",label:"HTML"},css:{prism:"css",label:"CSS"},scss:{prism:"scss",label:"SCSS"},abap:{prism:"abap",label:"ABAP"},toml:{prism:"toml",label:"TOML"},ini:{prism:"ini",label:"INI"},md:{prism:"markdown",label:"Markdown"},csv:{prism:"text",label:"CSV"},log:{prism:"text",label:"Log"},txt:Qm},Xl=(t,r)=>r?Object.values(Zm).find(n=>n.prism===r)??{prism:r,label:r}:Zm[ql(t)]??Qm,Jm=t=>{let r=t,o=0;for(;r>=1024&&o<Ym.length-1;)r/=1024,o+=1;return `${o>0&&r<10?r.toFixed(1):Math.round(r).toString()} ${Ym[o]}`};P();var lx=1e3,cx=9,to=16,dx={markdown:"text/markdown;charset=utf-8",code:"text/plain;charset=utf-8"},rg=(t,r)=>{let o=URL.createObjectURL(t),n=document.createElement("a");n.href=o,n.download=r,n.click(),window.setTimeout(()=>URL.revokeObjectURL(o),1e3);},Yl=({tone:t,icon:r,title:o,text:n,action:a})=>c("div",{className:"orb-omph-pv-notice","data-tone":t,role:t==="error"?"alert":void 0,children:[e("span",{className:"orb-omph-pv-notice-icon","aria-hidden":"true",children:r}),e("div",{className:"orb-omph-pv-notice-title",children:o}),n&&e("p",{className:"orb-omph-pv-notice-text",children:n}),a]}),og=({state:t,placement:r,expanded:o,canExpand:n,labels:a,gripProps:i,paneRef:s,onClose:l,onRetry:d,onToggleExpand:u,onOpenExternally:p})=>{let[f,b]=er.useState(true),[m,v]=er.useState(false),{open:y,ref:g,phase:x,data:h}=t,C=h?.body;er.useEffect(()=>{if(!m)return;let _=window.setTimeout(()=>v(false),lx);return ()=>window.clearTimeout(_)},[m]),er.useEffect(()=>{y&&s.current?.focus({preventScroll:true});},[y,s,g?.path]);let k=h?.absolutePath??g?.path??"",w=C&&(C.kind==="markdown"||C.kind==="code")?C.text:k,T=w===k?a.previewCopyPath:a.previewCopyContent,I=C?.kind==="code"&&g?Xl(g.path,C.language):null,S=!!(g&&C&&(C.kind==="markdown"||C.kind==="code"||C.kind==="image"||C.kind==="embed")),A=()=>{if(!C||!g)return;let _=Ss(g.path);if(C.kind==="markdown"||C.kind==="code"){rg(new Blob([C.text],{type:dx[C.kind]}),_);return}(C.kind==="image"||C.kind==="embed")&&fetch(C.url).then(B=>{if(!B.ok)throw new Error(`HTTP ${B.status}`);return B.blob()}).then(B=>rg(B,_)).catch(()=>window.open(C.url,"_blank","noopener"));},R=[];I&&R.push(I.label),C?.kind==="markdown"&&R.push("Markdown"),C?.kind==="image"&&g&&R.push(ql(g.path).toUpperCase()),h?.size!==void 0&&R.push(Jm(h.size)),C?.kind==="code"&&g?.startLine!==void 0&&R.push(a.previewLines(g.startLine,g.endLine??g.startLine));let M=_=>{_.key==="Escape"&&(_.stopPropagation(),l(true));},N=e("button",{type:"button",className:"orb-omph-pv-action",onClick:d,children:a.previewRetry}),E=()=>{if(!g)return null;if(x==="loading")return e("div",{className:"orb-omph-pv-skel",role:"status","aria-label":a.previewLoading,children:Array.from({length:cx},(_,B)=>e("span",{},B))});if(x==="error"||!C)return e(Yl,{tone:"error",icon:e(Ta,{size:to}),title:a.previewFailed,text:k,action:N});switch(C.kind){case "missing":return e(Yl,{tone:"neutral",icon:e(Da,{size:to}),title:a.previewMissing,text:C.message??k});case "unsupported":return e(Yl,{tone:"neutral",icon:e(Da,{size:to}),title:a.previewUnsupported,text:C.message??k,action:p&&e("button",{type:"button",className:"orb-omph-pv-action",onClick:()=>p(g),children:a.previewOpenExternal})});case "markdown":return e(qm,{text:C.text},g.path);case "code":return e(Km,{text:C.text,language:Xl(g.path,C.language).prism,startLine:g.startLine,endLine:g.endLine,wrap:f,labels:a},g.path);case "image":return e(Xm,{url:C.url,alt:C.alt,labels:a},C.url);case "embed":return e("iframe",{src:C.url,title:C.caption??"Embedded document",className:"orb-omph-pv-embed"},C.url);default:return null}},O=r==="overlay",F=C?.kind==="image"?Bc:Da;return c("aside",{ref:s,className:"orb-omph-preview","data-open":y||void 0,"data-placement":r,role:O?"dialog":"complementary","aria-label":a.previewTitle,"aria-hidden":!y||void 0,tabIndex:-1,onKeyDown:M,children:[!O&&y&&e("div",{className:"orb-omph-pv-grip","aria-label":a.previewResize,...i}),c("div",{className:"orb-omph-pv",children:[c("header",{className:"orb-omph-pv-head",children:[O&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewBack,onClick:()=>l(true),children:e(Ma,{size:to})}),e("span",{className:"orb-omph-pv-glyph","aria-hidden":"true",children:e(F,{size:to})}),c("div",{className:"orb-omph-pv-titles",children:[e("div",{className:"orb-omph-pv-name",title:k,children:g?Ss(g.path):""}),e("div",{className:"orb-omph-pv-path",title:k,children:e("bdi",{children:jm(k)})})]}),c("div",{className:"orb-omph-pv-actions",children:[C?.kind==="code"&&e("button",{type:"button",className:"orb-omph-text-button","aria-pressed":f,onClick:()=>b(_=>!_),children:a.previewWrap}),S&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewDownload,title:a.previewDownload,onClick:A,children:e(Nc,{size:to})}),g&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":m?a.copied:T,title:m?a.copied:T,onClick:()=>{navigator.clipboard.writeText(w).then(()=>v(true));},children:m?e(qr,{size:to}):e(vo,{size:to})}),n&&e("button",{type:"button",className:"orb-omph-icon-button","aria-pressed":o,"aria-label":o?a.previewCollapse:a.previewExpand,title:o?a.previewCollapse:a.previewExpand,onClick:u,children:e(Ec,{size:to})}),!O&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewClose,onClick:()=>l(true),children:e(jt,{size:to})})]})]}),e("div",{className:"orb-omph-pv-meta",children:R.join(" \xB7 ")}),e("div",{className:"orb-omph-pv-body","data-kind":x==="ready"?C?.kind:void 0,children:E()})]})]})};P();var ux=1e3,ng=50,mx=1e3,gx=t=>t==="tool"?tn:t==="command"?Vn:_c,ig=t=>!!t.streaming||t.status==="running"||t.status==="pending",fx=(t,r)=>r==="expanded"?true:ig(t),bx=t=>t!==void 0&&(t.inputTokens!==void 0||t.outputTokens!==void 0||t.durationMs!==void 0),hx=(t,r)=>`${Math.max(1,Math.round(t/mx))}${r.secondUnit}`,vx=({content:t})=>{let r=er.useRef(null),[o,n]=er.useState(false);return er.useEffect(()=>{let a=r.current;if(!a)return;let i=()=>n(a.scrollHeight>a.clientHeight+1);i();let s=new ResizeObserver(i);return s.observe(a),()=>s.disconnect()},[t]),e("div",{ref:r,className:"orb-omph-process-body","data-overflow":o||void 0,children:t})},yx=({turn:t,labels:r})=>{let[o,n]=er.useState(false),[a,i]=er.useState(false),s=t.assistant?.content??"",l=t.usage;return er.useEffect(()=>{if(!o)return;let d=window.setTimeout(()=>n(false),ux);return ()=>window.clearTimeout(d)},[o]),c("div",{className:"orb-omph-turn-actions",role:"group","aria-label":r.turnActions,children:[e("span",{className:"orb-omph-actions-time",children:t.assistant?.timestamp.toLocaleTimeString()}),bx(l)&&c(jsxRuntime.Fragment,{children:[e("span",{className:"orb-omph-actions-divider","aria-hidden":"true"}),e("button",{type:"button",className:"orb-omph-text-button","aria-expanded":a,onClick:()=>i(d=>!d),children:r.usage})]}),e("button",{type:"button",className:"orb-omph-icon-button orb-omph-actions-end","aria-label":o?r.copied:r.copy,onClick:()=>{navigator.clipboard.writeText(s).then(()=>n(true));},children:o?e(qr,{size:14}):e(vo,{size:14})}),a&&l&&c("div",{className:"orb-omph-usage",children:[l.inputTokens!==void 0&&c("span",{children:[r.inputTokens," ",l.inputTokens.toLocaleString()]}),l.outputTokens!==void 0&&c("span",{children:[r.outputTokens," ",l.outputTokens.toLocaleString()]}),l.durationMs!==void 0&&c("span",{children:[r.duration," ",hx(l.durationMs,r)]})]})]})},Cx=({item:t,display:r,open:o,onToggle:n})=>{let a=gx(t.kind),i=ig(t),s=r!=="compact"&&!!t.summary,l=o&&!!t.content;return c("div",{className:"orb-omph-process","data-status":t.status,"data-open":o||void 0,children:[c("button",{type:"button",className:"orb-omph-process-toggle","aria-expanded":o,onClick:n,children:[e(Fr,{size:12,className:"orb-omph-process-chevron"}),e(a,{size:14}),e("span",{className:i?"orb-omph-shimmer":void 0,children:t.title}),s&&e("span",{className:"orb-omph-process-summary",children:t.summary})]}),l&&t.content&&e(vx,{content:t.content}),o&&t.streaming&&e("span",{className:"orb-omph-caret","aria-hidden":"true"})]})},Zl=t=>{let r=t.user?.content||t.assistant?.content||t.id,o=r.split(`
202
- `).find(n=>n.trim())??r;return o.length>ng?`${o.slice(0,ng)}\u2026`:o},xx=0,sg=({turns:t,labels:r,processDisplay:o,cardHooks:n,resolveFileLink:a,onOpenFile:i})=>{let[s,l]=er.useState({}),d=u=>{if(!i||u.defaultPrevented||u.button!==xx||u.metaKey||u.ctrlKey||u.shiftKey||u.altKey)return;let p=u.target.closest("a[href]");if(!p)return;let f=a(p.getAttribute("href")??"");f&&(u.preventDefault(),i(f,p));};return e(jsxRuntime.Fragment,{children:t.map((u,p)=>{let f=!!(u.assistant&&!u.assistant.streaming),m=p===t.length-1&&f?"always":"hover";return c("article",{className:"orb-omph-turn","data-omph-turn":u.id,"data-actions-reveal":m,children:[u.user&&c("div",{className:"orb-omph-user",children:[e("div",{className:"orb-omph-user-bubble",children:u.user.content}),e("div",{className:"orb-omph-clock",children:u.user.timestamp.toLocaleTimeString()})]}),u.process&&u.process.length>0&&e("div",{className:"orb-omph-process-list",children:u.process.map(v=>{let y=v.id in s?s[v.id]:fx(v,o);return e(Cx,{item:v,display:o,open:y,onToggle:()=>l(g=>({...g,[v.id]:!y}))},v.id)})}),u.assistant&&c("div",{className:"orb-omph-assistant","data-file-links":i?"true":void 0,onClick:d,children:[e(vs,{content:u.assistant.content,messageId:u.assistant.id,cardHooks:n}),u.assistant.streaming&&e("span",{className:"orb-omph-caret","aria-hidden":"true"})]}),u.failure&&e("div",{className:"orb-omph-failure","data-severity":u.failure.severity,children:u.failure.content}),f&&e(yx,{turn:u,labels:r})]},u.id)})})};var Sx={idle:"Idle",pending:"Pending",running:"Working",success:"Success",error:"Error",working:"Working",workingFor:t=>`Working for ${t}`,loadOlder:"Load earlier",loadingOlder:"Loading earlier\u2026",toBottom:"Back to bottom",copy:"Copy",copied:"Copied",turnActions:"Reply actions",usage:"Usage",inputTokens:"Input",outputTokens:"Output",duration:"Duration",send:"Send",stop:"Stop",turnRail:"Turns",secondUnit:"s",minuteUnit:"m",previewTitle:"File preview",previewClose:"Close preview",previewBack:"Back to conversation",previewExpand:"Expand preview",previewCollapse:"Restore preview size",previewCopyContent:"Copy content",previewCopyPath:"Copy path",previewDownload:"Download",previewOpenExternal:"Open externally",previewWrap:"Wrap",previewLoading:"Loading file",previewMissing:"File not found",previewFailed:"Could not load this file",previewUnsupported:"No preview for this file type",previewRetry:"Try again",previewResize:"Resize preview",previewLines:(t,r)=>t===r?`Line ${t}`:`Lines ${t}\u2013${r}`,previewTruncated:(t,r)=>`Showing the first ${t.toLocaleString()} of ${r.toLocaleString()} lines`,imageFailed:"The image could not be displayed",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomFit:"Fit to width",newConversation:"New conversation",conversationList:"Conversation list",conversations:"Conversations",noConversations:"No conversations yet"},cg=t=>({...Sx,...t}),wx={waiting:"Waiting for approval",choose:"Choose an action",details:"Approval details",choices:"Actions",reject:"Reject",allowOnce:"Allow once",confirm:"Continue",other:"Other",otherPlaceholder:"Describe the action to take",escalation:t=>`Tool ${t} requests privileged execution`},dg=t=>({...wx,...t}),kx=1e3,lg=60,Px=1e3,pg=(t,r)=>{let o=Math.max(1,Math.round(Math.max(t,Px)/kx)),n=Math.floor(o/lg),a=o%lg;return n<=0?`${o}${r.secondUnit}`:`${n}${r.minuteUnit} ${a}${r.secondUnit}`};var Mx={open:false,ref:null,phase:"loading",data:null},ug=t=>{let[r,o]=er.useState(Mx),n=er.useRef(r);n.current=r;let a=er.useRef(t);a.current=t;let i=er.useRef(null),s=er.useRef(0),l=er.useRef(null),d=er.useCallback(b=>{let m=a.current;if(!m)return;i.current?.abort();let v=new AbortController;i.current=v,s.current+=1;let y=s.current;o({open:true,ref:b,phase:"loading",data:null}),m(b,v.signal).then(g=>{y===s.current&&o(x=>({...x,phase:"ready",data:g}));},()=>{y!==s.current||v.signal.aborted||o(g=>({...g,phase:"error",data:null}));});},[]),u=er.useCallback((b,m)=>{l.current=m??null;let v=n.current;if(v.ref?.path===b.path&&v.phase==="ready"){o({...v,open:true,ref:b});return}d(b);},[d]),p=er.useCallback((b=false)=>{s.current+=1,i.current?.abort(),o(v=>({...v,open:false}));let m=l.current;b&&m?.isConnected&&m.focus({preventScroll:true});},[]),f=er.useCallback(()=>{let{ref:b}=n.current;b&&d(b);},[d]);return er.useEffect(()=>()=>{i.current?.abort();},[]),{state:r,open:u,close:p,reload:f}};var Ql="--orb-omph-pv-w",Jl="--orb-omph-pv-pref",Nx=880,Ax=560,gg=400,Go=320,Ex=.45,Lx=.7,fg=24,jl=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),bg=({open:t,layout:r})=>{let o=er.useRef(null),n=er.useRef(null),[a,i]=er.useState(0),[s,l]=er.useState(null),[d,u]=er.useState(false),[p,f]=er.useState(false);er.useLayoutEffect(()=>{let T=o.current;if(!T)return;let I=()=>i(T.getBoundingClientRect().width);I();let S=new ResizeObserver(I);return S.observe(T),()=>S.disconnect()},[]),er.useEffect(()=>{t||u(false);},[t]);let b=r==="overlay"?false:r==="split"?a>=gg+Go:a>=Nx,m=b&&!d?"split":"overlay",v=Math.max(Go,Math.min(a*Lx,a-gg)),y=jl(s??a*Ex,Go,v),g=a>0&&a<Ax,x=er.useCallback(T=>{let I=o.current;I&&(I.style.setProperty(Jl,`${T}px`),I.dataset.placement==="split"&&I.dataset.open==="true"&&I.style.setProperty(Ql,`${T}px`));},[]),h=er.useCallback(T=>{T.button===0&&(T.preventDefault(),T.currentTarget.setPointerCapture(T.pointerId),n.current={pointerId:T.pointerId,startX:T.clientX,startWidth:y,latest:y},f(true));},[y]),C=er.useCallback(T=>{let I=n.current;!I||I.pointerId!==T.pointerId||(I.latest=jl(I.startWidth+(I.startX-T.clientX),Go,v),x(I.latest));},[v,x]),k=er.useCallback(T=>{let I=n.current;!I||I.pointerId!==T.pointerId||(n.current=null,T.currentTarget.hasPointerCapture(T.pointerId)&&T.currentTarget.releasePointerCapture(T.pointerId),l(I.latest),f(false));},[]),w=er.useCallback(T=>{let I={ArrowLeft:y+fg,ArrowRight:y-fg,Home:Go,End:v};T.key in I&&(T.preventDefault(),l(jl(I[T.key],Go,v)));},[v,y]);return {mainRef:o,placement:m,width:y,compact:g,dragging:p,expanded:d,canExpand:b,toggleExpanded:()=>u(T=>!T),gripProps:{role:"separator","aria-orientation":"vertical","aria-valuemin":Go,"aria-valuemax":Math.round(v),"aria-valuenow":Math.round(y),tabIndex:0,onPointerDown:h,onPointerMove:C,onPointerUp:k,onPointerCancel:k,onKeyDown:w}}};var Ts=48,Fx=900,vg=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,yg=({turns:t,contentVersion:r,hasOlder:o=false,loadingOlder:n=false,onLoadOlder:a})=>{let i=er.useRef(null),s=er.useRef(null),l=er.useRef(true),d=er.useRef({height:0,top:0}),u=er.useRef(void 0),p=er.useRef(false),[f,b]=er.useState(true),[m,v]=er.useState(false),[y,g]=er.useState(t[0]?.id),x=er.useCallback(()=>{let T=i.current;T&&(d.current={height:T.scrollHeight,top:T.scrollTop});},[]),h=er.useCallback(()=>{let T=i.current;if(!T)return;let I=T.getBoundingClientRect().top,S=T.querySelector("[data-omph-turn]")?.dataset.omphTurn;T.querySelectorAll("[data-omph-turn]").forEach(A=>{A.getBoundingClientRect().top-I<=Ts&&(S=A.dataset.omphTurn);}),g(S);},[]);er.useEffect(()=>{let T=i.current,I=s.current;if(!T||!I)return;let S=()=>{v(T.clientWidth>Fx),l.current&&(T.scrollTop=T.scrollHeight),x();};S();let A=new ResizeObserver(S);return A.observe(T),A.observe(I),()=>A.disconnect()},[x]),er.useLayoutEffect(()=>{let T=i.current;if(!T)return;let I=t[0]?.id,S=u.current,A=S!==void 0&&t.some(N=>N.id===S),R=A&&I!==void 0&&I!==S,M=S!==void 0&&!A;if(u.current=I,M){l.current=true,b(true),T.scrollTop=T.scrollHeight,x(),h();return}if(R){l.current=false,b(false);let N=T.scrollHeight-d.current.height;T.scrollTop=d.current.top+Math.max(0,N),x(),h();return}l.current&&(T.scrollTop=T.scrollHeight),x(),h();},[r,x,t,h]),er.useEffect(()=>{n||(p.current=false);},[n]);let C=er.useCallback(()=>{let T=i.current;if(!T)return;let S=T.scrollHeight-T.scrollTop-T.clientHeight<=Ts;S!==l.current&&(l.current=S,b(S)),x(),h();let A=T.scrollHeight-T.clientHeight>Ts,R=T.scrollTop<=Ts;!A||!R||S||!o||n||!a||p.current||(p.current=true,a());},[o,n,a,x,h]),k=er.useCallback(()=>{let T=i.current;T&&(l.current=true,b(true),T.scrollTo({top:T.scrollHeight,behavior:vg()?"auto":"smooth"}));},[]),w=er.useCallback(T=>{let S=i.current?.querySelector(`[data-omph-turn="${CSS.escape(T)}"]`);S&&(l.current=false,b(false),S.scrollIntoView({block:"start",behavior:vg()?"auto":"smooth"}));},[]);return {scrollerRef:i,contentRef:s,following:f,railVisible:m,activeTurnId:y,onScroll:C,returnToBottom:k,scrollToTurn:w}};P();var Hx=1e3,zx=(t,r)=>r[t],Vx=t=>t.map(r=>[r.id,r.user?.content.length??0,r.assistant?.content.length??0,r.assistant?.streaming?"1":"0",r.failure?.id??"",(r.process??[]).map(o=>`${o.id}:${o.status}:${o.content?.length??0}`).join(",")].join(":")).join("|"),Wx=({startedAt:t,labels:r})=>{let[o,n]=er.useState(()=>Date.now());er.useEffect(()=>{n(Date.now());let i=window.setInterval(()=>n(Date.now()),Hx);return ()=>window.clearInterval(i)},[t]);let a=t===void 0?r.working:r.workingFor(pg(Math.max(0,o-t),r));return c("div",{className:"orb-omph-running","data-omph-running":"true",children:[e("span",{className:"orb-visually-hidden",role:"status","aria-live":"polite",children:r.working}),e("span",{className:"orb-omph-running-rule","aria-hidden":"true"}),c("span",{className:"orb-omph-running-body",children:[e("span",{className:"orb-omph-spinner","aria-hidden":"true"}),e("span",{className:"orb-omph-shimmer",children:a})]})]})},Pz=({turns:t,title:r="OMPH Agent",description:o,headerActions:n,agentStatus:a,isResponding:i=false,labels:s,processDisplay:l="standard",showInput:d=false,placeholder:u,className:p,cardHooks:f,hasOlder:b=false,loadingOlder:m=false,onLoadOlder:v,onSend:y,onStop:g,onHeaderPointerDown:x,conversations:h=[],activeConversationId:C,onNewConversation:k,onSelectConversation:w,loadFilePreview:T,resolveFileLink:I=Kl,filePreviewLayout:S="auto",onOpenFileExternally:A})=>{let R=cg(s),M=a??(i?"running":"idle"),N=M==="running"||M==="pending",E=[zx(M,R),o].filter(Boolean).join(" \xB7 "),O=er.useMemo(()=>Vx(t),[t]),F=yg({turns:t,contentVersion:O,hasOlder:b,loadingOlder:m,onLoadOlder:v}),[_,B]=er.useState(""),Y=_.trim(),W=i&&Y.length===0,j=[...t].reverse().find(le=>!!le.assistant?.streaming||le.process?.some(Ee=>Ee.streaming||Ee.status==="running"||Ee.status==="pending")),V=N?j?.startedAt:void 0,z=!!T,K=ug(T),q=bg({open:K.state.open,layout:S}),fe=er.useRef(null),se=er.useRef(null),ue=z&&K.state.open&&q.placement==="overlay",Se=q.placement==="split"&&K.state.open,$e={[Jl]:`${q.width}px`,[Ql]:Se?`${q.width}px`:"0px"};er.useEffect(()=>{se.current?.toggleAttribute("inert",ue);},[ue]);let ke=async()=>{if(!Y||!y)return;let le=Y;B("");try{await y(le);}catch{B(Ee=>Ee.trim().length===0?le:Ee);}};return c("div",{className:ut("orb-omph-panel",p),"data-omph-panel":"","data-status":M,"data-compact":q.compact||void 0,children:[c("div",{className:ut("orb-omph-header",x&&"cursor-grab active:cursor-grabbing"),onPointerDown:x,children:[e("span",{className:"orb-omph-avatar","aria-hidden":"true",children:"AI"}),c("div",{className:"min-w-0 flex-1",children:[e("div",{className:"orb-omph-title",children:r}),c("div",{className:"orb-omph-subtitle",children:[e("span",{className:"orb-omph-dot","data-active":N||void 0}),e("span",{className:"truncate",children:E||R.idle})]})]}),(k||w||n)&&c("div",{className:"orb-omph-header-actions",onPointerDown:le=>le.stopPropagation(),children:[e(Gm,{conversations:h,activeConversationId:C,labels:R,onNewConversation:k,onSelectConversation:w}),n]})]}),c("div",{ref:q.mainRef,className:"orb-omph-main","data-placement":q.placement,"data-open":String(K.state.open),"data-dragging":q.dragging||void 0,style:$e,children:[c("div",{ref:se,className:"orb-omph-center",children:[c("div",{className:"orb-omph-stage","data-rail":F.railVisible||void 0,children:[e("div",{ref:F.scrollerRef,className:"orb-omph-scroll",onScroll:F.onScroll,children:c("div",{ref:F.contentRef,className:"orb-omph-column",children:[b&&v&&e("button",{type:"button",className:"orb-omph-older",disabled:m,onClick:v,children:m?R.loadingOlder:R.loadOlder}),e(sg,{turns:t,labels:R,processDisplay:l,cardHooks:f,resolveFileLink:I,onOpenFile:z?K.open:void 0}),N&&e(Wx,{startedAt:V,labels:R})]})}),F.railVisible&&t.length>0&&e("nav",{className:"orb-omph-rail","aria-label":R.turnRail,children:t.map(le=>e("button",{type:"button",className:"orb-omph-rail-mark","data-active":F.activeTurnId===le.id||void 0,"aria-label":Zl(le),title:Zl(le),onClick:()=>F.scrollToTurn(le.id)},le.id))}),!F.following&&e("button",{type:"button",className:"orb-omph-to-bottom","aria-label":R.toBottom,onClick:F.returnToBottom,children:e(Fr,{size:16})})]}),d&&c("form",{className:"orb-omph-composer",onSubmit:le=>{le.preventDefault(),W?g?.():ke();},children:[e("textarea",{className:"orb-omph-input",value:_,placeholder:u,rows:1,onChange:le=>B(le.target.value),onKeyDown:le=>{le.key!=="Enter"||le.shiftKey||le.nativeEvent.isComposing||(le.preventDefault(),W?g?.():ke());}}),e("button",{type:"submit",className:W?"orb-omph-stop":"orb-omph-send","aria-label":W?R.stop:R.send,disabled:!W&&Y.length===0,children:W?e(Mc,{size:16}):e(Ic,{size:16})})]})]}),z&&e(og,{state:K.state,placement:q.placement,expanded:q.expanded,canExpand:q.canExpand,labels:R,gripProps:q.gripProps,paneRef:fe,onClose:K.close,onRetry:K.reload,onToggleExpand:q.toggleExpanded,onOpenExternally:A})]})]})};P();var bo="other",$x=t=>t instanceof HTMLElement&&t.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')!==null,_x=({request:t,onDecide:r,labels:o})=>{let n=dg(o),a=er.useRef(null),i=er.useRef(null),s=er.useRef(false),l=er.useRef(false),[d,u]=er.useState(false),[p,f]=er.useState(null),[b,m]=er.useState(""),v=t.choices??[],y=t.allowOther??v.length>0,g=v.length>0||y,x=t.reason?.trim()||n.escalation(t.toolName),h=t.detail?.trim(),C=p===bo&&b.trim().length>0,k=!g||p!==null&&p!==bo||C;er.useEffect(()=>{u(false),f(null),m(""),a.current?.focus();},[t.id]),er.useEffect(()=>{p===bo&&i.current?.focus();},[p]);let w=S=>{d||(u(true),r(S,t));},T=()=>{if(k){if(!g){w({kind:"allowed-once"});return}if(p===bo){let S=b.trim();if(!S)return;w({kind:"other",text:S});return}p&&w({kind:"choice",choiceId:p});}},I=S=>{if(!(d||$x(S.target))&&!(S.key!=="Enter"&&S.key!=="Escape")&&!(S.key==="Enter"&&S.target instanceof HTMLElement&&S.target.closest('button, a[href], [role="button"]'))&&!(S.ctrlKey||S.metaKey||S.altKey||S.shiftKey)&&(S.preventDefault(),S.stopPropagation(),!(S.repeat||s.current||l.current||S.nativeEvent.isComposing))){if(S.key==="Escape"){w({kind:"rejected"});return}T();}};return e("div",{className:"orb-omph-approval","data-omph-approval":t.id,"aria-busy":d,onKeyDown:I,onKeyUpCapture:()=>{l.current=false;},onCompositionStartCapture:()=>{s.current=true;},onCompositionEndCapture:()=>{s.current=false,l.current=true;},children:c("div",{className:"orb-omph-approval-card",children:[c("div",{className:"orb-omph-approval-strip",children:[e("span",{className:"orb-omph-approval-dot","aria-hidden":"true"}),g?n.choose:n.waiting]}),c("div",{ref:a,className:"orb-omph-approval-body",tabIndex:0,role:"group","aria-label":n.details,children:[e("div",{className:"orb-omph-approval-headline",children:x}),h&&e("div",{className:"orb-omph-approval-detail",children:h}),g&&c("fieldset",{className:"orb-omph-approval-choices",disabled:d,children:[e("legend",{className:"orb-visually-hidden",children:n.choices}),v.map(S=>{let A=p===S.id;return c("label",{className:"orb-omph-approval-choice","data-selected":A,children:[e("input",{type:"radio",name:`omph-approval-${t.id}`,value:S.id,checked:A,onChange:()=>f(S.id)}),c("span",{className:"orb-omph-approval-choice-copy",children:[e("span",{children:S.label}),S.description&&e("span",{className:"orb-omph-approval-choice-description",children:S.description})]})]},S.id)}),y&&c("label",{className:"orb-omph-approval-choice","data-selected":p===bo,children:[e("input",{type:"radio",name:`omph-approval-${t.id}`,value:bo,checked:p===bo,onChange:()=>f(bo)}),e("span",{className:"orb-omph-approval-choice-copy",children:e("span",{children:n.other})})]}),y&&p===bo&&e("textarea",{ref:i,className:"orb-omph-approval-other",value:b,placeholder:n.otherPlaceholder,rows:3,"aria-label":n.other,onChange:S=>m(S.target.value)})]})]}),c("div",{className:"orb-omph-approval-actions",children:[e("button",{type:"button",className:"orb-btn orb-btn-neutral orb-omph-approval-reject",disabled:d,onClick:()=>w({kind:"rejected"}),children:n.reject}),e("button",{type:"button",className:"orb-btn orb-btn-primary",disabled:d||!k,onClick:T,children:g?n.confirm:n.allowOnce})]})]})})};P();var Tg=520,Kx=88,qx=88,Xx=24,Ms=640,Ig=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),rc=t=>typeof t=="number"?`${t}px`:t,Yx=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,Fz=({anchor:t,defaultAnchor:r="right",onAnchorChange:o,width:n=Tg,top:a=Kx,bottom:i=qx,inset:s=Xx,zIndex:l=1300,shellClassName:d,shellStyle:u,className:p,onHeaderPointerDown:f,...b})=>{let m=er.useRef(null),v=er.useRef(null),[y,g]=er.useState(r),[x,h]=er.useState(0),[C,k]=er.useState(typeof n=="number"?n:Tg),[w,T]=er.useState(0),[I,S]=er.useState(false),A=t??y;er.useEffect(()=>{let B=()=>h(window.innerWidth);return B(),window.addEventListener("resize",B),()=>window.removeEventListener("resize",B)},[]),er.useLayoutEffect(()=>{let B=()=>{let W=m.current?.getBoundingClientRect();W?.width?k(W.width):typeof n=="number"&&k(n);};if(B(),!m.current||typeof ResizeObserver>"u")return;let Y=new ResizeObserver(B);return Y.observe(m.current),()=>Y.disconnect()},[n]);let R=er.useCallback(B=>{if(!x)return s;let Y=x<Ms?12:s,W=Math.max(Y,x-C-Y);return x<Ms||B==="left"?Y:B==="center"?Ig((x-C)/2,Y,W):W},[s,C,x]),M=er.useCallback(B=>["left","center","right"].reduce((W,j)=>{let V=Math.abs(B-R(W));return Math.abs(B-R(j))<V?j:W},"right"),[R]),N=er.useCallback(B=>{t===void 0&&g(B),o?.(B);},[t,o]);er.useEffect(()=>{I||T(R(A));},[R,I,A]);let E=er.useCallback(B=>{f?.(B),!(B.defaultPrevented||Yx(B.target))&&(B.preventDefault(),B.currentTarget.setPointerCapture(B.pointerId),v.current={pointerId:B.pointerId,startClientX:B.clientX,startX:w,currentX:w,captureElement:B.currentTarget},S(true));},[f,w]),O=er.useCallback(B=>{let Y=v.current;if(!Y||Y.pointerId!==B.pointerId)return;let W=x<Ms?12:s,j=Math.max(W,x-C-W),V=Ig(Y.startX+B.clientX-Y.startClientX,W,j);Y.currentX=V,T(V);},[s,C,x]),F=er.useCallback(B=>{let Y=v.current;if(!Y||Y.pointerId!==B.pointerId)return;try{Y.captureElement.releasePointerCapture(B.pointerId);}catch{}let W=M(Y.currentX);v.current=null,S(false),N(W),T(R(W));},[R,N,M]),_=er.useMemo(()=>({position:"fixed",top:rc(a),bottom:rc(i),left:w,width:rc(n),maxWidth:`calc(100vw - ${x<Ms?24:s*2}px)`,zIndex:l,pointerEvents:"auto",transition:I?"none":"left 180ms ease-out",touchAction:"none",...u}),[i,s,I,w,u,a,x,n,l]);return e("div",{ref:m,className:ut("orbcafe-floating-agent-panel min-w-0",d),"data-anchor":A,"data-dragging":I?"true":"false",style:_,onPointerMove:O,onPointerUp:F,onPointerCancel:F,children:e($m,{...b,className:p,onHeaderPointerDown:E})})};P();var Qx={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},Gz=({messages:t,onSend:r,onRegenerate:o,isResponding:n=false,className:a,placeholder:i,title:s="Copilot",corner:l="bottom-right",onCollapse:d,onHeaderPointerDown:u,onPlusClick:p,onMicClick:f,streamIntervalMs:b,streamChunkSize:m,onMessageStreamingComplete:v,cardHooks:y})=>{let[g,x]=er.useState(""),[h,C]=er.useState(false),k=er.useRef(null),w=Qx[l];er.useEffect(()=>{k.current?.scrollIntoView({behavior:"smooth"});},[t,n]);let T=er.useCallback(async()=>{let S=g.trim();!S||n||(x(""),await r(S));},[n,r,g]),I=er.useCallback(async S=>{S.key==="Enter"&&!h&&(S.preventDefault(),await T());},[T,h]);return c("div",{className:ut("relative flex h-full w-full min-h-[460px] min-w-[340px] flex-col overflow-hidden rounded-3xl border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-none dark:bg-[var(--orb-surface-2)]",a),children:[d&&e("button",{onClick:d,className:ut("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",w==="top-left"&&"-left-2 -top-2",w==="top-right"&&"-right-2 -top-2",w==="bottom-left"&&"-bottom-2 -left-2",w==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:e("span",{className:ut("block h-4 w-4 border-[var(--orb-ai-accent)]",w==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",w==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",w==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",w==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),c("div",{className:"flex items-center justify-between border-b border-[var(--orb-border)] px-4 py-3",onPointerDown:u,children:[e("div",{className:"flex items-center",children:e("h3",{className:"text-base font-semibold tracking-tight text-[var(--orb-fg)]",children:s})}),e("div",{})]}),c("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((S,A)=>{let R=S.type==="assistant"&&A===t.length-1,M=S.type==="assistant"?{isLatestAssistant:R,isResponding:n,onRegenerate:o?()=>o(S.id):void 0}:void 0;return e(ys,{message:S,assistantActions:M,onStreamingComplete:()=>v?.(S.id),streamIntervalMs:b,streamChunkSize:m,cardHooks:y},S.id)}),e("div",{ref:k})]}),e("div",{className:"border-t border-[var(--orb-border)] px-3 py-3",children:c("div",{className:"flex items-center gap-2 rounded-xl border border-[var(--orb-p300)] bg-[var(--orb-canvas)] px-2 py-1.5 dark:bg-[var(--orb-surface-2)]",children:[e("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-surface)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:bg-[var(--orb-surface-2)]",onClick:p,type:"button","aria-label":"Add",children:e(en,{className:"h-4 w-4"})}),e("input",{className:"h-7 flex-1 border-none bg-transparent text-sm text-[var(--orb-fg)] outline-none placeholder:text-[var(--orb-muted)] dark:text-[var(--orb-fg)] dark:placeholder:text-[var(--orb-muted)]",placeholder:i||"Ask Copilot...",value:g,onChange:S=>x(S.target.value),onCompositionStart:()=>C(true),onCompositionEnd:()=>C(false),onKeyDown:I,"aria-label":"Copilot input",spellCheck:false}),e("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-surface)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:bg-[var(--orb-surface-2)]",onClick:f,type:"button","aria-label":"Microphone",children:e(La,{className:"h-4 w-4"})})]})})]})};P();var Jx=["var(--orb-primary)","var(--orb-primary)","var(--orb-primary)"],e0=`
189
+ `),f={enableMath:n},u=0;for(;u<h.length;){let b=h[u],C=b.trim();if(!C){u+=1;continue}if(i&&xu(b)){if(C.startsWith("<think>")){let v=[],y=b;for(;;){let k=y.indexOf("<think>"),S=k>=0?y.slice(k+7):y,P=S.indexOf("</think>");if(P>=0){v.push(S.slice(0,P)),u+=1;break}if(v.push(S),u+=1,u>=h.length)break;y=h[u];}m.push(e($i,{content:v.join(`
190
+ `).trim()},`think-tag-${u}`));continue}u+=1;let x=[];for(;u<h.length&&h[u].trim()!==":::";)x.push(h[u]),u+=1;u<h.length&&h[u].trim()===":::"&&(u+=1),m.push(e($i,{content:x.join(`
191
+ `).trim()},`think-fence-${u}`));continue}if(_i(b)){let x=C.slice(3).trim().toLowerCase(),v=[];for(u+=1;u<h.length&&!_i(h[u]);)v.push(h[u]),u+=1;u<h.length&&_i(h[u])&&(u+=1);let y=v.join(`
192
+ `);if(a&&x==="mermaid"){m.push(e(Sl,{code:y},`mermaid-${u}`));continue}if(n&&["math","latex","katex"].includes(x)){m.push(e(ua,{expression:y,allowKatex:true},`math-fence-${u}`));continue}m.push(e(pa,{code:y,language:x||"text",copyable:s,showLineNumbers:l,wrapLongLines:true},`code-${u}`));continue}if(n&&C.startsWith("$$")){let x=[];if(C.endsWith("$$")&&C!=="$$")x.push(C.slice(2,-2)),u+=1;else {let y=b.slice(b.indexOf("$$")+2);for(y.trim()&&x.push(y),u+=1;u<h.length;){let k=h[u],S=k.indexOf("$$");if(S>=0){x.push(k.slice(0,S)),u+=1;break}x.push(k),u+=1;}}m.push(e(ua,{expression:x.join(`
193
+ `).trim(),allowKatex:true},`math-${u}`));continue}if(vu(b)){let x=Math.min(6,b.match(/^#{1,6}/)?.[0]?.length||1),v=b.replace(/^#{1,6}\s+/,""),y=x===1?"h5":x===2?"h6":"subtitle1";m.push(e(Co,{variant:y,sx:{mt:x===1?1.2:.8,mb:.5,fontWeight:700},children:ma(v,f,`h-${u}`)},`heading-${u}`)),u+=1;continue}if(yu(b)){m.push(e(Od,{sx:{my:1.2}},`hr-${u}`)),u+=1;continue}if(Cu(h,u)){let x=u+2;for(;x<h.length&&h[x].trim()&&h[x].includes("|");)x+=1;let v=h.slice(u,x).join(`
194
+ `),y=Wi(v);if(y){m.push(e(Pl,{table:y},`table-${u}`)),u=x;continue}}if(Rl(b)){let x=[];for(;u<h.length&&Rl(h[u]);)x.push(h[u].replace(/^\s*>\s?/,"")),u+=1;m.push(e(Br,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:e(Co,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:x.map((v,y)=>c(to.Fragment,{children:[y>0&&e("br",{}),ma(v,f,`q-${u}-${y}`)]},`quote-line-${y}`))})},`quote-${u}`));continue}if(Il(b)){let x=[];for(;u<h.length&&Il(h[u]);)x.push(h[u].trim().replace(/^[-*+]\s+/,"")),u+=1;m.push(e(Me,{component:"ul",sx:{my:.8,pl:2.5},children:x.map((v,y)=>e(Me,{component:"li",sx:{mb:.45},children:e(Co,{variant:"body2",children:ma(v,f,`ul-${u}-${y}`)})},`ul-item-${y}`))},`ul-${u}`));continue}if(Ml(b)){let x=[];for(;u<h.length&&Ml(h[u]);)x.push(h[u].trim().replace(/^\d+\.\s+/,"")),u+=1;m.push(e(Me,{component:"ol",sx:{my:.8,pl:2.7},children:x.map((v,y)=>e(Me,{component:"li",sx:{mb:.45},children:e(Co,{variant:"body2",children:ma(v,f,`ol-${u}-${y}`)})},`ol-item-${y}`))},`ol-${u}`));continue}let g=[];for(;u<h.length;){let x=h[u],v=x.trim();if(!v||_i(x)||vu(x)||yu(x)||Il(x)||Ml(x)||Rl(x)||Cu(h,u)||i&&xu(x)||n&&v.startsWith("$$"))break;g.push(x),u+=1;}g.length>0?m.push(e(Co,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:g.map((x,v)=>c(to.Fragment,{children:[v>0&&e("br",{}),ma(x,f,`p-${u}-${v}`)]},`p-line-${v}`))},`p-${u}`)):u+=1;}return m},[d,n,a,i,s,l]);return e(Me,{className:r,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:p})};I();var IA=(t,o)=>e(ga,{markdown:t,...o});I();var wu=({value:t,onChange:o,onSubmit:r,onVoiceInput:n,onClear:a,placeholder:i,statusText:s,loading:l=false,compact:d=false,showStatusText:p=true})=>c(le,{spacing:.75,children:[c("div",{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:d?.25:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minHeight:d?38:44},children:[e(zr,{sx:{fontSize:d?16:18,color:"text.secondary"}}),e($d,{fullWidth:true,value:t,onChange:m=>o(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),r());},placeholder:i,sx:{fontSize:d?"0.84rem":"0.9rem"}}),t&&a&&e(se,{size:"small",onClick:a,children:e(Sr,{sx:{fontSize:d?16:18}})}),n&&e(se,{size:"small",onClick:n,children:e(bp,{sx:{fontSize:d?16:18}})}),e(se,{size:"small",onClick:r,disabled:l||!t.trim(),children:e(wp,{sx:{fontSize:d?16:18}})})]}),p&&s&&e(L,{variant:"caption",color:"text.secondary",children:s})]});I();var Su=(t,o)=>{let r=o.trim();if(!r)return t;let n=t.toLowerCase(),a=r.toLowerCase(),i=n.indexOf(a);return i<0?t:c(jsxRuntime.Fragment,{children:[t.slice(0,i),e("div",{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:t.slice(i,i+r.length)}),t.slice(i+r.length)]})},Gi=({section:t,highlightQuery:o=""})=>{let r=t.columns||2;return c(Ae,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[e(L,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:t.title}),e("div",{sx:{display:"grid",gap:1.15,gridTemplateColumns:{xs:"1fr",md:r===3?"repeat(3, minmax(0, 1fr))":r===1?"1fr":"repeat(2, minmax(0, 1fr))"}},children:t.fields.map(n=>{let a=typeof n.value=="string"||typeof n.value=="number"?String(n.value):null;return c("div",{sx:{minWidth:0},children:[e(L,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:Su(n.label,o)}),e(L,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?Su(a,o):n.value})]},n.id)})})]})};var Nl=t=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",Ki=t=>t.trim().toLowerCase(),Sv=(t,o)=>{let r=[];return t.forEach(n=>{n.fields.forEach(a=>{let i=a.searchableText||Nl(a.value),s={source:"section",sourceId:n.id,sourceSectionId:n.id,sourceTitle:n.title,fieldId:a.id,fieldLabel:a.label,fieldValue:i};r.push({hit:s,text:Ki(`${n.title} ${a.label} ${i}`)});});}),o.forEach(n=>{(n.fields||[]).forEach(a=>{let i=a.searchableText||Nl(a.value),s={source:"tab",sourceId:n.id,sourceTitle:n.label,fieldId:a.id,fieldLabel:a.label,fieldValue:i};r.push({hit:s,text:Ki(`${n.label} ${a.label} ${i}`)});}),(n.sections||[]).forEach(a=>{a.fields.forEach(i=>{let s=i.searchableText||Nl(i.value),l={source:"tab",sourceId:n.id,sourceSectionId:a.id,sourceTitle:`${n.label} / ${a.title}`,fieldId:i.id,fieldLabel:i.label,fieldValue:s};r.push({hit:l,text:Ki(`${n.label} ${a.title} ${i.label} ${s}`)});});});}),r},ku=({sections:t,tabs:o=[],defaultTabId:r,ai:n})=>{let{t:a}=de(),[i,s]=to.useState(""),[l,d]=to.useState(r||o[0]?.id),[p,m]=to.useState("idle"),[h,f]=to.useState([]),[u,b]=to.useState(""),[C,g]=to.useState(""),[x,v]=to.useState(false),y=to.useMemo(()=>Sv(t,o),[t,o]);to.useEffect(()=>{if(o.length===0){d(void 0);return}o.some(N=>N.id===l)||d(r||o[0]?.id);},[o,l,r]);let k=to.useCallback(()=>{m("idle"),f([]),b(""),g("");},[]),S=to.useCallback(w=>{s(w),w.trim()||(m("idle"),f([]),b(""),g(""));},[]),P=to.useCallback(w=>{let N=Ki(w);return N?y.filter(A=>A.text.includes(N)).map(A=>A.hit):[]},[y]),M=to.useCallback(async()=>{let w=i.trim();if(!w)return;v(true);let N=P(w);if(f(N),N.length>0){m("search"),g(""),b(a("detail.searchAi.matches",{count:N.length})),v(false);return}if(n?.enabled!==false&&n?.onSubmit){m("ai"),b(a("detail.searchAi.autoAiFallback"));try{let T=await n.onSubmit(w,{query:w,hits:N,activeTabId:l,sections:t,tabs:o});g(typeof T=="string"?T:"");}finally{v(false);}return}m("search"),g(""),b(a("detail.searchAi.noMatch")),v(false);},[i,P,a,n,l,t,o]);return {query:i,setQuery:S,activeTabId:l,setActiveTabId:d,searchMode:p,hits:h,statusText:u,aiResponse:C,searching:x,handleSubmit:M,clearResult:k}};I();var tE=({title:t,subtitle:o,sections:r,tabs:n=[],defaultTabId:a,table:i,ai:s,rightHeaderSlot:l,searchBarWidth:d=460,onClose:p,closeLabel:m="Close"})=>{let{t:h}=de(),{query:f,setQuery:u,activeTabId:b,setActiveTabId:C,searchMode:g,hits:x,statusText:v,aiResponse:y,searching:k,handleSubmit:S,clearResult:P}=ku({sections:r,tabs:n,defaultTabId:a,ai:s}),M=to.useMemo(()=>n.find(A=>A.id===b)||n[0],[n,b]),w=to.useCallback(A=>{let T=R=>{let E=document.getElementById(A);if(E){E.scrollIntoView({behavior:"smooth",block:"center"});return}R<4&&setTimeout(()=>T(R+1),60);};requestAnimationFrame(()=>T(0));},[]),N=to.useCallback((A,T)=>{if(n.some(R=>R.id===A)){C(A),w(T?`detail-tab-${A}-section-${T}`:`detail-tab-${A}`);return}w(`detail-section-${A}`);},[n,C,w]);return c("div",{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[c(le,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[c("div",{sx:{minWidth:0},children:[e(L,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:t}),o&&e(L,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:o})]}),c(le,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[e("div",{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:e(wu,{value:f,onChange:u,onSubmit:S,onVoiceInput:s?.onVoiceInput,onClear:()=>{u(""),P();},placeholder:s?.placeholder||h("detail.searchAi.placeholder"),statusText:v,loading:k,compact:true,showStatusText:false})}),p&&e(dt,{title:m,children:e(se,{size:"small",onClick:p,children:e(ip,{fontSize:"small"})})}),l]})]}),v&&e(L,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:v}),g==="search"&&x.length>0&&c(Ae,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[e(L,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:h("detail.searchAi.matches",{count:x.length})}),e(le,{spacing:.35,children:x.slice(0,8).map(A=>e("div",{component:"button",type:"button",onClick:()=>N(A.sourceId,A.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:c(L,{variant:"body2",sx:{fontSize:"0.84rem"},children:[e("div",{component:"span",sx:{color:"text.secondary"},children:A.sourceTitle})," \xB7 ",e("div",{component:"span",sx:{fontWeight:700},children:A.fieldLabel})," = ",e("div",{component:"span",children:A.fieldValue||"-"})]})},`${A.source}|${A.sourceId}|${A.fieldId}`))})]}),g==="ai"&&y&&c(Ae,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[e(L,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:h("detail.searchAi.aiResultTitle")}),e("div",{sx:{fontSize:"0.9rem",lineHeight:1.6,"& p":{m:0,mb:.8},"& h1, & h2, & h3, & h4":{mt:1.2,mb:.6,lineHeight:1.3},"& ul, & ol":{mt:.4,mb:.8,pl:2.6},"& code":{px:.5,py:.1,borderRadius:.8,bgcolor:"action.hover",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},"& pre":{m:0,mt:.8,mb:.8,p:1.1,borderRadius:1.2,bgcolor:"action.hover",overflowX:"auto"},"& pre code":{p:0,bgcolor:"transparent"}},children:e(ga,{markdown:y})})]}),e("div",{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:r.map(A=>e("div",{id:`detail-section-${A.id}`,children:e(Gi,{section:A,highlightQuery:f})},A.id))}),n.length>0&&c(Ae,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[e(qd,{value:M?.id||false,onChange:(A,T)=>C(String(T)),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:n.map(A=>e(Xd,{value:A.id,label:A.label,sx:{textTransform:"none"}},A.id))}),c("div",{sx:{p:1.5},children:[e("div",{id:`detail-tab-${M?.id||""}`}),M?.description&&e(L,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:M.description}),M?.content?M.content:c(le,{spacing:1.5,children:[(M?.sections||[]).map(A=>e("div",{id:`detail-tab-${M?.id}-section-${A.id}`,children:e(Gi,{section:A,highlightQuery:f})},A.id)),M?.fields&&M.fields.length>0&&e(Gi,{section:{id:`${M.id}-fields`,title:M.label,fields:M.fields,columns:2},highlightQuery:f})]})]})]}),i&&e(or,{title:i.title||h("detail.table.title"),...i.tableProps,filterConfig:void 0,fitContainer:false})]})};I();var Iu=({bucket:t,cardCount:o,highlighted:r=false,children:n,emptyLabel:a,height:i,maxHeight:s,onRename:l,renameLabel:d,sx:p})=>{let{t:m}=de(),[h,f]=to.useState(false),[u,b]=to.useState(t.title),C=()=>{b(t.title),f(false);},g=x=>{x.preventDefault();let v=u.trim();v&&(v!==t.title&&l?.(v),b(v),f(false));};return e(Ae,{elevation:0,sx:[x=>{let v=t.accentColor??x.palette.primary.main;return {position:"relative",display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:i??s??560,maxHeight:s,borderRadius:"var(--orb-r-container)",overflow:"hidden",border:r?`1px solid ${ot(v,.65)}`:"1px solid var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:r?`0 0 0 2px ${ot(v,.16)}, var(--orb-shadow-2)`:"none",transition:"border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease","&::before":{content:'""',display:"block",flexShrink:0,height:3,bgcolor:v}}},...Array.isArray(p)?p:p?[p]:[]],children:c(le,{spacing:1.25,sx:{flex:1,minHeight:0,overflow:"hidden",p:1.5},children:[c(Me,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1.25},children:[e(Me,{sx:{minWidth:0,flex:1},children:c(Me,{sx:{display:"flex",alignItems:"center",gap:.75,minHeight:28},children:[t.icon&&e(Me,{sx:{display:"inline-flex",flexShrink:0,color:t.accentColor??"var(--orb-primary)"},children:t.icon}),h?c(Me,{component:"form",onSubmit:g,sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[e(ze,{dense:true,autoFocus:true,value:u,onChange:x=>b(x.target.value),onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),C());},inputProps:{"aria-label":d??m("kanban.bucket.rename")},error:!u.trim(),sx:{flex:1,minWidth:0}}),e(se,{type:"submit",size:"small",tooltip:m("kanban.bucket.saveRename"),"aria-label":m("kanban.bucket.saveRename"),disabled:!u.trim(),children:e(So,{size:14})}),e(se,{size:"small",tooltip:m("kanban.bucket.cancelRename"),"aria-label":m("kanban.bucket.cancelRename"),onClick:C,children:e(Xt,{size:14})})]}):e(L,{component:"div",sx:{fontSize:15,fontWeight:600,lineHeight:1.35,color:"text.primary"},children:t.title})]})}),!h&&c(le,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[e(xt,{size:"small",label:o,sx:{minWidth:24,justifyContent:"center",fontWeight:600}}),typeof t.limit=="number"&&e(xt,{size:"small",label:`${m("kanban.bucket.limit")} ${t.limit}`,color:o>t.limit?"warning":"default",variant:"outlined"}),l&&e(se,{size:"small",tooltip:d??m("kanban.bucket.rename"),"aria-label":d??m("kanban.bucket.rename"),onClick:()=>{b(t.title),f(true);},sx:{width:26,height:26},children:e(Kc,{size:14})})]})]}),r&&e(L,{component:"div",sx:{fontSize:12,color:t.accentColor??"var(--orb-primary)",fontWeight:500},children:m("kanban.bucket.dropHere")}),e(Me,{sx:{flex:1,height:0,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",pr:.4,scrollbarGutter:"stable"},children:o>0?n:e(Me,{sx:{minHeight:"100%",borderRadius:"var(--orb-r-container)",border:"1px dashed var(--orb-border)",bgcolor:"transparent",display:"grid",placeItems:"center",px:2,textAlign:"center"},children:e(L,{sx:{fontSize:13,color:"text.secondary"},children:a??t.emptyLabel??m("kanban.empty")})})})]})})};I();var Pv={success:"success",warning:"warning",info:"info",error:"error"},Tv={critical:"error",high:"warning",medium:"info",low:"success"},Iv={default:"var(--orb-primary)",success:"var(--orb-primary)",warning:"var(--orb-accent)",info:"var(--orb-primary)",error:"var(--orb-err)"},Mv=(t,o)=>{switch(t){case "critical":return o("kanban.priority.critical");case "high":return o("kanban.priority.high");case "medium":return o("kanban.priority.medium");case "low":return o("kanban.priority.low");default:return t}},Rv=t=>t?t.split(/\s+/).map(o=>o.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",Dl=({card:t,bucket:o,dragging:r=false,overlay:n=false,onClick:a,sx:i})=>{let{t:s}=de(),l=!!(a&&o),d=t.tone??(t.priority?Tv[t.priority]:"default"),p=d==="default"?"primary":Pv[d],m=Iv[d],h=o?{card:t,bucket:o}:void 0;return e(Ae,{onClick:l?()=>h&&a?.(h):void 0,onKeyDown:l?f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),h&&a?.(h));}:void 0,role:l?"button":void 0,tabIndex:l?0:void 0,sx:[{position:"relative",minWidth:0,overflow:"hidden",p:1.5,pl:1.75,borderRadius:"var(--orb-r-container)",border:`1px solid ${ot(m,.24)}`,bgcolor:"var(--orb-canvas)",boxShadow:n?"var(--orb-shadow-3)":r?"none":"var(--orb-shadow-1)",transform:n?"rotate(1deg) scale(1.01)":"none",transition:"transform var(--orb-t-fast), box-shadow var(--orb-t-fast), border-color var(--orb-t-fast)",cursor:l?"pointer":"default",opacity:r?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:3,bgcolor:m},"&:hover":l?{transform:"translateY(-1px)",borderColor:ot(m,.48),boxShadow:"var(--orb-shadow-2)"}:void 0,"&:focus-visible":l?{outline:"2px solid var(--orb-focus-solid)",outlineOffset:2}:void 0},...Array.isArray(i)?i:i?[i]:[]],elevation:0,children:c(le,{spacing:1.25,children:[c(Me,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[c(Me,{sx:{minWidth:0,flex:1},children:[(t.kicker||o?.title)&&e(L,{component:"div",sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:t.kicker??o?.title}),e(L,{component:"div",sx:{mt:.25,fontSize:14,fontWeight:600,lineHeight:1.4,color:"text.primary"},children:t.title})]}),t.priority&&e(xt,{size:"small",color:p,label:Mv(t.priority,s),variant:d==="default"?"outlined":"filled",sx:{height:22,flexShrink:0,fontWeight:500}})]}),t.summary&&e(L,{component:"div",sx:{fontSize:13,fontWeight:300,color:"text.secondary",lineHeight:1.5},children:t.summary}),t.metrics&&t.metrics.length>0&&e(Me,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(t.metrics.length,3)}, minmax(0, 1fr))`,gap:.75},children:t.metrics.slice(0,3).map(f=>c(Me,{sx:{minWidth:0,borderRadius:"var(--orb-r)",px:1,py:.75,bgcolor:"var(--orb-surface)",border:"1px solid var(--orb-border)"},children:[e(L,{component:"div",noWrap:true,sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:f.label}),e(L,{component:"div",noWrap:true,numeric:true,sx:{mt:.25,fontSize:13,fontWeight:600},children:f.value})]},f.id))}),typeof t.progress=="number"&&c(Me,{children:[c(Me,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[e(L,{sx:{fontSize:12,color:"text.secondary"},children:s("kanban.card.progress")}),c(L,{numeric:true,sx:{fontSize:12,fontWeight:600},children:[Math.round(t.progress),"%"]})]}),e(Bd,{variant:"determinate",value:Math.max(0,Math.min(100,t.progress)),color:m,sx:{height:4,borderRadius:2}})]}),(t.tags?.length||t.assignee||t.dueDate||t.footer||l)&&c(le,{spacing:.9,children:[t.tags&&t.tags.length>0&&e(Me,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:t.tags.map(f=>e(xt,{size:"small",label:f.label,color:f.color??"default",variant:"outlined"},f.id))}),c(Me,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flexWrap:"wrap"},children:[c(Me,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[t.assignee&&c(jsxRuntime.Fragment,{children:[e(ai,{src:t.assignee.avatarSrc,sx:{width:28,height:28,fontSize:11},children:t.assignee.initials??Rv(t.assignee.name)}),c(Me,{sx:{minWidth:0},children:[e(L,{component:"div",sx:{fontSize:13,fontWeight:500,lineHeight:1.3},noWrap:true,children:t.assignee.name}),t.dueDate&&e(L,{component:"div",sx:{fontSize:11,color:"text.secondary",lineHeight:1.35},noWrap:true,children:t.dueDate})]})]}),!t.assignee&&t.dueDate&&e(L,{sx:{fontSize:12,color:"text.secondary"},children:t.dueDate})]}),l&&e(L,{sx:{fontSize:12,color:"var(--orb-link)",fontWeight:500,whiteSpace:"nowrap"},children:s("kanban.card.openDetail")})]}),t.footer]})]})})};var Mu=(t,o)=>{let r=o.title.trim();return !o.id||!r||t.buckets.some(n=>n.id===o.id)?t:{buckets:[...t.buckets,{...o,title:r,cards:[]}]}},Ru=(t,o,r)=>{let n=r.trim();if(!n)return t;let a=t.buckets.find(i=>i.id===o);return !a||a.title===n?t:{buckets:t.buckets.map(i=>i.id===o?{...i,title:n}:i)}},Nv=(t,o)=>Number.isNaN(t)||t<0?0:t>o?o:t,Nu=({buckets:t,cards:o})=>{let r=new Map;return o.forEach((n,a)=>{let i=r.get(n.bucketId)??[];i.push({card:n,sourceIndex:a}),r.set(n.bucketId,i);}),{buckets:t.map(n=>{let a=[...r.get(n.id)??[]].sort((i,s)=>i.card.position===void 0&&s.card.position===void 0?i.sourceIndex-s.sourceIndex:i.card.position===void 0?1:s.card.position===void 0?-1:i.card.position-s.card.position||i.sourceIndex-s.sourceIndex).map(({card:i},s)=>({...i,bucketId:n.id,position:s}));return {...n,cards:a}})}},Ko=(t,o)=>{for(let r=0;r<t.buckets.length;r+=1){let n=t.buckets[r],a=n.cards.findIndex(i=>i.id===o);if(a>=0)return {card:n.cards[a],bucket:n,bucketIndex:r,cardIndex:a}}},qi=(t,o)=>{let r=Ko(t,o.cardId);if(!r)return t;let n=t.buckets.findIndex(p=>p.id===o.toBucketId);if(n<0)return t;let a=t.buckets.map(p=>({...p,cards:p.cards.map(m=>({...m}))})),i=a[r.bucketIndex],[s]=i.cards.splice(r.cardIndex,1);if(!s)return t;let l=a[n],d=Nv(o.targetIndex??l.cards.length,l.cards.length);return l.cards.splice(d,0,{...s,bucketId:o.toBucketId}),{buckets:a.map(p=>({...p,cards:p.cards.map((m,h)=>({...m,bucketId:p.id,position:h}))}))}};I();var Ll="kanban-card|",Ol="kanban-bucket|",Eu=t=>`${Ll}${t}`,Wv=t=>`${Ol}${t}`,Xi=t=>t?.startsWith(Ll)?t.slice(Ll.length):void 0,Au=t=>t?.startsWith(Ol)?t.slice(Ol.length):void 0,$v=({card:t,bucket:o,onCardClick:r})=>{let{setNodeRef:n,attributes:a,listeners:i,transform:s,transition:l,isDragging:d}=sortable.useSortable({id:Eu(t.id)}),p={transform:s?`translate3d(${s.x}px, ${s.y}px, 0)`:void 0,transition:l,zIndex:d?2:1,touchAction:"none",cursor:d?"grabbing":"grab"};return e("div",{ref:n,style:p,...a,...i,children:e(Dl,{card:t,bucket:o,dragging:d,onClick:r})})},_v=({bucket:t,highlighted:o,bucketHeight:r,emptyBucketLabel:n,onBucketRename:a,onCardClick:i})=>{let{isOver:s,setNodeRef:l}=core.useDroppable({id:Wv(t.id)});return e(Me,{ref:l,sx:{minWidth:0,minHeight:0,height:r},children:e(Iu,{bucket:t,cardCount:t.cards.length,highlighted:o||s,emptyLabel:n,height:r,onRename:a,children:e(sortable.SortableContext,{items:t.cards.map(d=>Eu(d.id)),strategy:sortable.verticalListSortingStrategy,children:e(le,{spacing:1,children:t.cards.map(d=>e($v,{card:d,bucket:t,onCardClick:i},d.id))})})})})},Lu=t=>String(t??"").toLocaleLowerCase(),Gv=(t,o)=>[t.id,t.title,t.summary,t.kicker,t.priority,t.tone,t.progress,t.dueDate,t.assignee?.id,t.assignee?.name,...t.tags?.flatMap(n=>[n.id,n.label])??[],...t.metrics?.flatMap(n=>[n.label,n.value])??[]].some(n=>Lu(n).includes(o)),RE=({model:t,onCardMove:o,onCardClick:r,cardFilter:n,onBucketAdd:a,onBucketRename:i,addBucketLabel:s,minBucketWidth:l=320,bucketHeight:d,bucketMaxHeight:p,searchable:m=false,searchValue:h,defaultSearchValue:f="",onSearchValueChange:u,searchPlaceholder:b,emptyBucketLabel:C,sx:g})=>{let{t:x}=de(),[v,y]=to.useState(null),[k,S]=to.useState(),[P,M]=to.useState(f),w=h??P,N=w.trim().toLocaleLowerCase(),A=d??p??560,T=to.useMemo(()=>({buckets:t.buckets.map(z=>{let H=n?z.cards.filter(Y=>n(Y,z)):z.cards;if(!N)return {...z,cards:H};let X=[z.id,z.title,z.description].some(Y=>Lu(Y).includes(N));return {...z,cards:X?H:H.filter(Y=>Gv(Y,N))}})}),[n,t,N]),R=to.useMemo(()=>T.buckets.reduce((z,H)=>z+H.cards.length,0),[T]),E=to.useCallback(z=>{h===void 0&&M(z),u?.(z);},[u,h]),O=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),$=to.useMemo(()=>v?Ko(t,v):void 0,[v,t]),ee=to.useCallback(()=>{y(null),S(void 0);},[]),F=to.useCallback(z=>{if(!z)return;let H=Xi(z);return H?Ko(t,H)?.bucket.id:Au(z)},[t]),G=to.useCallback(z=>{y(Xi(String(z.active.id))??null);},[]),W=to.useCallback(z=>{S(F(z.over?String(z.over.id):void 0));},[F]),Q=to.useCallback(z=>{let H=Xi(String(z.active.id)),X=z.over?String(z.over.id):void 0;if(!H||!X){ee();return}let Y=Ko(t,H);if(!Y){ee();return}let j=Y.bucket.id,te=Y.cardIndex,ce=Xi(X);if(ce){let ve=Ko(t,ce);if(!ve){ee();return}j=ve.bucket.id,te=ve.cardIndex;}else {let ve=Au(X),xe=t.buckets.find(He=>He.id===ve);if(!ve||!xe){ee();return}j=ve,te=xe.cards.length;}if(Y.bucket.id===j&&Y.cardIndex===te){ee();return}let fe=qi(t,{cardId:H,fromBucketId:Y.bucket.id,toBucketId:j,targetIndex:te}),Ve=Ko(fe,H);Ve&&!(Ve.bucket.id===Y.bucket.id&&Ve.cardIndex===Y.cardIndex)&&o?.({cardId:H,fromBucketId:Y.bucket.id,toBucketId:Ve.bucket.id,targetIndex:Ve.cardIndex,card:Ve.card,model:fe}),ee();},[t,o,ee]);return c(core.DndContext,{sensors:O,collisionDetection:core.closestCorners,onDragStart:G,onDragOver:W,onDragEnd:Q,onDragCancel:ee,children:[c(Me,{sx:{display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:"100%",overflow:"hidden"},children:[(m||a)&&c(Me,{role:m?"search":void 0,sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1.5,mb:1.25,minWidth:0},children:[m&&e(Me,{sx:{width:"100%",maxWidth:360,flex:"1 1 240px"},children:e(ze,{dense:true,value:w,onChange:z=>E(z.target.value),placeholder:b??x("kanban.search.placeholder"),autoComplete:"off",sx:{"& .orb-inp":{paddingLeft:"38px",paddingRight:w?"42px":"12px"},"& .orb-inp-adornment-end":{pointerEvents:"auto"}},startAdornment:e(Wo,{size:16,"aria-hidden":"true"}),endAdornment:w?e(se,{size:"small",tooltip:x("kanban.search.clear"),"aria-label":x("kanban.search.clear"),onClick:()=>E(""),sx:{width:26,height:26},children:e(Xt,{size:15})}):void 0})}),c(Me,{sx:{display:"flex",alignItems:"center",gap:1,ml:"auto"},children:[N&&e(L,{component:"div","aria-live":"polite",sx:{flexShrink:0,fontSize:12,fontWeight:500,color:"text.secondary"},children:R>0?x("kanban.search.results",{count:R}):x("kanban.search.noMatch")}),a&&e(Te,{size:"small",variant:"secondary",startIcon:e(en,{size:15}),onClick:a,children:s??x("kanban.bucket.add")})]})]}),e(Me,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${l}px, ${Math.max(l,360)}px)`,gap:1.5,gridAutoRows:A==="100%"?"minmax(0, 1fr)":void 0,alignItems:"stretch",justifyContent:"start",flex:"1 1 0",height:"100%",minHeight:0,overflowX:"auto",overflowY:"hidden",overscrollBehavior:"contain",scrollbarGutter:"stable both-edges",pb:.5},...Array.isArray(g)?g:g?[g]:[]],children:T.buckets.map(z=>e(_v,{bucket:z,highlighted:z.id===k,bucketHeight:A,emptyBucketLabel:N?x("kanban.search.noMatch"):C,onBucketRename:i?H=>i(z.id,H):void 0,onCardClick:r},z.id))})]}),e(core.DragOverlay,{children:$?e(Me,{sx:{width:Math.max(l-24,260)},children:e(Dl,{card:$.card,bucket:$.bucket,overlay:true})}):null})]})};var qv=({initialModel:t,initialBuckets:o,initialCards:r})=>t||Nu({buckets:o??[],cards:r??[]}),LE=t=>{let{onCardMove:o,onCardClick:r}=t,[n,a]=to.useState(()=>qv(t)),i=to.useCallback(f=>{a(u=>typeof f=="function"?f(u):f);},[]),s=to.useCallback(f=>Ko(n,f),[n]),l=to.useCallback((f,u,b)=>{let C=Ko(n,f);if(!C)return;let g=qi(n,{cardId:f,fromBucketId:C.bucket.id,toBucketId:u,targetIndex:b}),x=Ko(g,f);if(!x||x.bucket.id===C.bucket.id&&x.cardIndex===C.cardIndex)return;a(g);let v={cardId:f,fromBucketId:C.bucket.id,toBucketId:x.bucket.id,targetIndex:x.cardIndex,card:x.card,model:g};return o?.(v),v},[n,o]),d=to.useCallback((f,u)=>{a(b=>({buckets:b.buckets.map(C=>({...C,cards:C.cards.map(g=>g.id!==f?g:typeof u=="function"?u(g):{...g,...u})}))}));},[]),p=to.useCallback(f=>{let u=Mu(n,f);return u===n?false:(a(u),true)},[n]),m=to.useCallback((f,u)=>{let b=Ru(n,f,u);return b===n?false:(a(b),true)},[n]),h=to.useMemo(()=>({model:n,onCardMove:f=>{l(f.cardId,f.toBucketId,f.targetIndex);},onCardClick:r}),[n,l,r]);return {model:n,actions:{replaceModel:i,moveCard:l,updateCard:d,addBucket:p,renameBucket:m,getCard:s},boardProps:h}};function wn({onTextUpdate:t,onComplete:o,onError:r,wsUrl:n="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:i=.015}){let[s,l]=to.useState(false),d=to.useRef(null),p=to.useRef(null),m=to.useRef(null),h=to.useRef(null),f=to.useRef(null),u=to.useRef(0),b=to.useRef(false),C=to.useRef(false),g=to.useCallback(()=>{d.current&&(d.current.close(),d.current=null),h.current&&(h.current.disconnect(),h.current=null),f.current&&(f.current.disconnect(),f.current=null),p.current&&(p.current.getTracks().forEach(y=>y.stop()),p.current=null),m.current&&(m.current.close(),m.current=null),C.current=false,l(false);},[]),x=to.useCallback(()=>{b.current||(b.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(g,500));},[g]),v=to.useCallback(async()=>{if(!(s||C.current)){C.current=true,b.current=false,u.current=Date.now();try{let y=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});p.current=y;let k=new WebSocket(n);d.current=k,k.onopen=()=>{l(!0),C.current=!1;},k.onmessage=N=>{try{let A=JSON.parse(N.data);if(A.type==="recognition")A.is_final?o(A.text):t?.(A.text);else if(A.type==="error"){let T=A.message||"Voice recognition error";r?.(T),x();}}catch{r?.("Failed to parse voice message");}},k.onerror=()=>{r?.("Voice service connection failed"),g();},k.onclose=()=>{g();};let S=window.AudioContext||window.webkitAudioContext;if(!S)throw new Error("AudioContext is not supported in this browser");let P=new S({sampleRate:16e3});m.current=P;let M=P.createMediaStreamSource(y);f.current=M;let w=P.createScriptProcessor(4096,1,1);h.current=w,w.onaudioprocess=N=>{if(d.current?.readyState!==WebSocket.OPEN)return;let A=N.inputBuffer.getChannelData(0),T=0;for(let O=0;O<A.length;O+=1)T+=A[O]*A[O];if(Math.sqrt(T/A.length)>i)u.current=Date.now();else if(Date.now()-u.current>a&&!b.current){x();return}let E=new Int16Array(A.length);for(let O=0;O<A.length;O+=1){let $=Math.max(-1,Math.min(1,A[O]));E[O]=$<0?$*32768:$*32767;}d.current.send(E.buffer);},M.connect(w),w.connect(P.destination);}catch{r?.("Cannot access microphone"),g();}}},[g,s,i,o,r,t,a,x,n]);return to.useEffect(()=>g,[g]),{isRecording:s,startRecording:v,stopRecording:x}}I();var jv=["en","zh","fr","de","ja","ko"],Fu={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},Bl=({searchPlaceholder:t,onSearch:o,onSearchAdd:r,onOpenPanel:n,panelOpen:a=false,maxWidth:i=540,sx:s})=>{let{t:l}=de(),[d,p]=to.useState(""),m=to.useCallback((x=d)=>{let v=x.trim();v&&(p(""),o?.(v));},[o,d]),h=x=>{x.preventDefault(),m();},{isRecording:f,startRecording:u,stopRecording:b}=wn({onTextUpdate:p,onComplete:x=>{p(x),m(x);},onError:x=>{console.error("Header voice input error:",x);}}),C=to.useCallback(async()=>{if(f){b();return}await u();},[f,u,b]),g=t||l("header.searchPlaceholder");return e("form",{className:"orb-app-header-search",onSubmit:h,style:{width:"100%",maxWidth:typeof i=="number"?`${i}px`:i,...s},children:c("div",{className:"orb-inp-adornment-wrap orb-app-header-search-shell",style:{background:"var(--orb-surface)",border:"1px solid var(--orb-border)",borderRadius:999,paddingRight:4},children:[e("div",{className:"orb-inp-adornment",children:e(se,{className:"orb-app-header-ai-action",size:"small",onClick:r,tooltip:l("header.searchAddFeature"),children:e(Tt,{name:"add",size:16})})}),e("input",{className:"orb-inp orb-inp-dense orb-app-header-ai-input",value:d,onChange:x=>p(x.target.value),placeholder:g,style:{border:"none",background:"transparent",flex:1,minWidth:0}}),c("div",{className:"orb-inp-adornment orb-inp-adornment-end",children:[n&&!a&&e(se,{className:"orb-app-header-ai-action",size:"small","aria-label":l("header.searchOpenPanel"),tooltip:l("header.searchOpenPanel"),onClick:n,children:e(Tt,{name:"message",size:16})}),e(se,{className:"orb-app-header-ai-action",size:"small",onClick:()=>{C();},tooltip:l(f?"header.searchStopVoice":"header.searchStartVoice"),sx:{color:f?"var(--orb-err)":void 0},children:e(Tt,{name:"microphone",size:16})})]})]})})},Zi=({appTitle:t,logo:o,onToggleMode:r,locale:n,localeLabel:a,localeOptions:i,onLocaleChange:s,searchPlaceholder:l,showSearch:d=false,onSearch:p,onSearchAdd:m,onOpenPanel:h,panelOpen:f,user:u,onUserRefresh:b,onUserSetting:C,onUserLogout:g,userMenuItems:x,leftSlot:v,rightSlot:y})=>{let{t:k,locale:S}=de(),P=fo(),M=n||S,w=a||Fu[M],N=i||jv,A=P==="dark"?e(nd,{size:15}):e(ld,{size:15}),T=k(P==="dark"?"header.theme.dark":"header.theme.light"),R=[...b?[{key:"refresh",label:k("header.menu.refresh"),icon:e(Ga,{size:15}),onClick:b}]:[],...C?[{key:"settings",label:k("header.menu.setting"),icon:e(tn,{size:16}),onClick:C}]:[],...g?[{key:"logout",label:k("header.menu.logout"),icon:e(ed,{size:16}),onClick:g}]:[]],E=x||R,O=N.map($=>({label:Fu[$],onClick:()=>{s?.($),window.requestAnimationFrame(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur();});},disabled:$===M}));return c("header",{className:"orb-app-header",children:[c("div",{className:"orb-app-header-brand",children:[v,o===null?null:o||e("div",{className:"orb-app-header-default-logo","aria-label":"ORBCAFE",children:e(Tt,{name:"product",size:20})}),t&&e(L,{variant:"h4",sx:{fontWeight:700},children:t})]}),e("div",{className:"orb-app-header-center",children:d&&e(Bl,{searchPlaceholder:l,onSearch:p,onSearchAdd:m,onOpenPanel:h,panelOpen:f})}),c("div",{className:"orb-app-header-actions",children:[c("div",{className:"orb-app-header-utilities",children:[s?e(Jt,{triggerLabel:w,trigger:c("button",{type:"button",className:"orb-icon-btn orb-app-header-locale",children:[e($n,{size:15}),e("span",{className:"orb-label",children:w})]}),items:O,align:"end"}):c("div",{className:"orb-app-header-locale","aria-label":w,children:[e($n,{size:15}),e("span",{className:"orb-label",children:w})]}),e(se,{className:"orb-app-header-theme",size:"small",onClick:r,tooltip:T,children:A})]}),u&&e("span",{className:"orb-app-header-divider","aria-hidden":"true"}),u&&e(Jt,{triggerLabel:u.name,trigger:c("button",{type:"button",className:"orb-app-header-user-trigger",children:[c("span",{className:"orb-app-header-user-copy",children:[e(L,{variant:"body2",className:"orb-app-header-user-name",children:u.name}),u.subtitle&&e(L,{variant:"caption",muted:true,className:"orb-app-header-user-subtitle",title:u.subtitle,children:u.subtitle})]}),e(on,{src:u.avatarSrc,alt:u.name,size:32,children:u.avatarText||u.name.slice(0,1).toUpperCase()})]}),items:E.map($=>({label:$.label,onClick:$.onClick,disabled:$.disabled,icon:$.icon})),align:"end"}),y]})]})};var Bu=({menuData:t=[],initialNavigationCollapsed:o=false,initialNavigationMode:r="fixed",enableNavigationPinning:n,navigationPinStorageKey:a,pinnedNavigationItemIds:i,defaultPinnedNavigationItemIds:s,onPinnedNavigationItemIdsChange:l,pinnedNavigationSectionTitle:d}={})=>{let{navigationIslandProps:p}=Nd({initialCollapsed:o,initialDisplayMode:r,content:t,enablePinning:n,pinStorageKey:a,pinnedItemIds:i,defaultPinnedItemIds:s,onPinnedItemIdsChange:l,pinnedSectionTitle:d}),[m,h]=to.useState(900);to.useEffect(()=>{let u=()=>h(window.innerHeight);return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[]);let f=to.useMemo(()=>Math.max(280,m-100),[m]);return {navigationIslandProps:p,navigationMaxHeight:f}};I();var Bo=12,zu=56,Vu=234,oy="orbcafe:page-layout-locale",Wu=["en","zh","fr","de","ja","ko"],ry=t=>encodeURIComponent(t.trim().toLowerCase()).replace(/%/g,"").replace(/[^a-z0-9._~-]+/g,"-")||"app",Yi=(t,o)=>`orbcafe:page-layout:${ry(t)}:${o}`,ny=t=>`orbcafe:page-layout:${t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,ay=t=>t==="system"?"dark":t==="dark"?"light":"system",ji=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),iy=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,rL=({appId:t,appTitle:o,menuData:r=[],children:n,showNavigation:a=true,locale:i="en",localeLabel:s,localeOptions:l,onLocaleChange:d,mode:p,defaultMode:m="system",onModeChange:h,user:f,onUserRefresh:u,onUserSetting:b,onUserLogout:C,userMenuItems:g,logo:x,searchPlaceholder:v,searchPlacement:y="hidden",floatingSearchSx:k,onSearch:S,onSearchAdd:P,onOpenPanel:M,panelOpen:w,rightHeaderSlot:N,leftHeaderSlot:A,contentSx:T,navigationVariant:R="classic",navigationMode:E,defaultNavigationMode:O="fixed",onNavigationModeChange:$,showNavigationModeToggle:ee=true,enableNavigationPinning:F=true,navigationPinStorageKey:G,pinnedNavigationItemIds:W,defaultPinnedNavigationItemIds:Q,onPinnedNavigationItemIdsChange:z,pinnedNavigationSectionTitle:H})=>{let X=t?Yi(t,"mode"):"orbcafe:page-layout-mode",Y=t?Yi(t,"locale"):oy,j=t?Yi(t,"navigation-mode"):"orbcafe:page-layout-navigation-mode",[te,ce]=to.useState(m),[fe,Ve]=to.useState("light"),[ve,xe]=to.useState(false),[He,pe]=to.useState(i),[ye,$e]=to.useState(false),[tt,at]=to.useState(false),[st,K]=to.useState(O),[Ne,Se]=to.useState({x:Bo,y:Bo}),[Fe,it]=to.useState("left"),[Ye,wt]=to.useState(false),Mt=to.useRef(null),Ft=to.useRef(null),Et=p!==void 0,ne=p??te,Ke=d!==void 0,Oe=Ke?i:He,ue=l?.join("|")??"",we=E!==void 0,re=E??st,Ce=re==="floating",De=R==="v2"?al:kd,Je=y==="header",lt=ne==="system"?ve?fe:"light":ne;to.useEffect(()=>{if(!Et)try{let be=window.localStorage.getItem(X);(be==="light"||be==="dark"||be==="system")&&ce(be);}catch{}xe(true);let V=window.matchMedia("(prefers-color-scheme: dark)"),Z=()=>{Ve(V.matches?"dark":"light");};return Z(),V.addEventListener("change",Z),()=>V.removeEventListener("change",Z)},[Et,X]),to.useEffect(()=>{if(!(Et||!ve))try{window.localStorage.setItem(X,ne);}catch{}},[ve,Et,ne,X]),to.useEffect(()=>{if(Ke){$e(true);return}try{let V=window.localStorage.getItem(Y),Z=l??Wu;V&&Wu.includes(V)&&Z.includes(V)&&pe(V);}catch{}finally{$e(true);}},[Ke,ue,Y]),to.useEffect(()=>{if(!(Ke||!ye))try{window.localStorage.setItem(Y,Oe);}catch{}},[Oe,Ke,ye,Y]),to.useEffect(()=>{if(we){at(true);return}try{let V=window.localStorage.getItem(j);(V==="fixed"||V==="floating")&&K(V);}catch{}finally{at(true);}},[we]),to.useEffect(()=>{if(tt)try{window.localStorage.setItem(j,re);}catch{}},[re,tt]),to.useEffect(()=>{lt==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[lt]);let ut=to.useCallback(V=>{we||K(V),$?.(V);},[we,$]),Ht=to.useCallback(V=>{Et||ce(V),h?.(V);},[Et,h]),Yt=to.useCallback(V=>{Ke||pe(V),d?.(V);},[Ke,d]),{navigationIslandProps:Wt,navigationMaxHeight:St}=Bu({menuData:r,initialNavigationCollapsed:false,initialNavigationMode:re,enableNavigationPinning:F,navigationPinStorageKey:G??(t?Yi(t,"pinned-navigation-items"):ny(o)),pinnedNavigationItemIds:W,defaultPinnedNavigationItemIds:Q,onPinnedNavigationItemIdsChange:z,pinnedNavigationSectionTitle:H}),$t=Wt.collapsed,bt=to.useCallback(V=>{let Z=Mt.current,be=Z?.parentElement;if(!Z||!be)return V;let ke=be.getBoundingClientRect(),Ee=Z.getBoundingClientRect(),_e=Bo,qe=Bo,je=Math.max(_e,ke.width-Ee.width-Bo),mt=Math.max(qe,ke.height-Ee.height-Bo);return {x:ji(V.x,_e,je),y:ji(V.y,qe,mt)}},[]),At=to.useCallback(V=>{let Z=Mt.current,be=Z?.parentElement;if(!Z||!be)return V;let ke=be.getBoundingClientRect(),Ee=Z.getBoundingClientRect(),_e=Bo,qe=Bo,je=Math.max(_e,ke.width-Ee.width-Bo),mt=Math.max(qe,ke.height-Ee.height-Bo),ht={x:ji(V.x,_e,je),y:ji(V.y,qe,mt)},yt=[{distance:Math.abs(ht.x-_e),position:{x:_e,y:ht.y}},{distance:Math.abs(ht.x-je),position:{x:je,y:ht.y}},{distance:Math.abs(ht.y-qe),position:{x:ht.x,y:qe}},{distance:Math.abs(ht.y-mt),position:{x:ht.x,y:mt}}].reduce((B,J)=>J.distance<B.distance?J:B).position;return it(yt.x>=(_e+je)/2?"right":"left"),yt},[]),ct=to.useMemo(()=>{if(!Ce||Ye)return Ne.x;if(Fe==="right"){let be=Mt.current?.parentElement?.getBoundingClientRect().width,ke=$t?zu:Vu;return be?Math.max(Bo,be-ke-Bo):$t?Ne.x:Ne.x-(Vu-zu)}return Ne.x},[Fe,Ne.x,Ye,Ce,$t]),Bt=to.useCallback(V=>{if(!Ce||!$t||iy(V.target))return;V.preventDefault(),V.currentTarget.setPointerCapture(V.pointerId);let Z=bt({x:ct,y:Ne.y});it("left"),Se(Z),Ft.current={pointerId:V.pointerId,startClientX:V.clientX,startClientY:V.clientY,startX:Z.x,startY:Z.y,currentX:Z.x,currentY:Z.y},wt(true);},[bt,ct,Ne.y,Ce,$t]),jt=to.useCallback(V=>{let Z=Ft.current;if(!Z||Z.pointerId!==V.pointerId)return;let be=bt({x:Z.startX+V.clientX-Z.startClientX,y:Z.startY+V.clientY-Z.startClientY});Z.currentX=be.x,Z.currentY=be.y,Se(be);},[bt]),q=to.useCallback(V=>{let Z=Ft.current;if(!(!Z||Z.pointerId!==V.pointerId)){try{V.currentTarget.releasePointerCapture(V.pointerId);}catch{}Ft.current=null,Se(At({x:Z.currentX,y:Z.currentY})),wt(false);}},[At]);return to.useEffect(()=>{if(!Ce)return;let V=()=>{Se(ke=>bt(ke));},Z=window.requestAnimationFrame(V),be=window.setTimeout(V,430);return ()=>{window.cancelAnimationFrame(Z),window.clearTimeout(be);}},[bt,Ce,$t,St]),e(Hn,{mode:ne,children:e(ja,{locale:Oe,children:c("div",{className:"orb-root",style:{minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:"var(--orb-canvas)"},children:[e(Zi,{appTitle:o,logo:x,mode:ne,onToggleMode:()=>Ht(ay(ne)),locale:Oe,localeLabel:Ke||Oe===i?s:void 0,localeOptions:l,onLocaleChange:Yt,user:f,onUserRefresh:u,onUserSetting:b,onUserLogout:C,userMenuItems:g,searchPlaceholder:v,showSearch:Je,onSearch:S,onSearchAdd:P,onOpenPanel:M,panelOpen:w,leftSlot:A,rightSlot:N}),y==="floating"&&e("div",{className:"orb-float-search",style:k,children:e(Bl,{searchPlaceholder:v,onSearch:S,onSearchAdd:P,onOpenPanel:M,panelOpen:w,maxWidth:"100%"})}),c("div",{style:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[a&&!Ce&&e("div",{style:{paddingTop:12,paddingBottom:12,paddingLeft:12,paddingRight:$t?4:12,display:"flex",alignItems:"flex-start",flexShrink:0},children:e(De,{...Wt,maxHeight:St,colorMode:lt,displayMode:re,onDisplayModeChange:ut,showDisplayModeToggle:ee&&$t})}),a&&Ce&&e("div",{ref:Mt,onPointerDown:Bt,onPointerMove:jt,onPointerUp:q,onPointerCancel:q,style:{position:"absolute",top:Ne.y,left:ct,zIndex:1205,display:"flex",alignItems:"flex-start",cursor:$t?Ye?"grabbing":"grab":"default",touchAction:$t?"none":"auto",userSelect:Ye?"none":void 0,transition:Ye?"none":"left 180ms ease-out, top 180ms ease-out"},children:e(De,{...Wt,maxHeight:St,colorMode:lt,displayMode:re,onDisplayModeChange:ut,showDisplayModeToggle:ee&&$t})}),e("div",{style:{flex:1,minWidth:0,minHeight:0,overflow:"auto",paddingTop:12,paddingBottom:12,paddingRight:12,paddingLeft:a&&!Ce&&$t?4:12,...T},children:n})]})]})})})};var Qi="(blank)",$u="Result",_u="Grand Total",Gu={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Uu=["sum","count","avg","min","max"];var Ku=["palette","rows","columns","filters","values"];var qu=t=>Ku.includes(t),Xu=t=>t==="rows"||t==="columns"||t==="filters",Ji=t=>{let o=t.split("|");return o.length===2&&o[0]==="container"&&qu(o[1])?{kind:"container",zone:o[1]}:o.length===3&&o[0]==="item"&&qu(o[1])&&o[2]?{kind:"item",zone:o[1],key:o[2]}:null},ur=t=>t==null||t===""?Qi:t instanceof Date?t.toISOString().slice(0,10):String(t),_r=t=>JSON.stringify(t),Zu=(t,o)=>{let r=t.join(""),n=o.join("");return r.localeCompare(n,void 0,{sensitivity:"base"})},sy=t=>{if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()!==""){let o=Number(t);return Number.isFinite(o)?o:null}return null},Sn=(t,o,r)=>{if(r==="count")return t.length;let n=t.map(a=>sy(a[o])).filter(a=>a!==null);return n.length===0?0:r==="sum"?n.reduce((a,i)=>a+i,0):r==="avg"?n.reduce((a,i)=>a+i,0)/n.length:r==="min"?Math.min(...n):Math.max(...n)},co=(t,o)=>{if(!t||t.length===0)return [];let r=new Set,n=[];return t.forEach(a=>{!o.has(a)||r.has(a)||(r.add(a),n.push(a));}),n},mr=(t,o)=>t.length!==o.length?false:t.every((r,n)=>r===o[n]),Yu=(t,o)=>{let r=Object.keys(t),n=Object.keys(o);return r.length!==n.length?false:r.every(a=>{let i=t[a]??[],s=o[a]??[];return mr(i,s)})},es=(t,o)=>t.length!==o.length?false:t.every((r,n)=>{let a=o[n];return r.tokenId===a.tokenId&&r.fieldId===a.fieldId&&r.aggregation===a.aggregation}),Hl=t=>!t?.aggregations||t.aggregations.length===0?Uu:t.aggregations,xo=(t,o)=>{let r=Hl(o);return t&&r.includes(t)?t:o?.type==="number"&&r.includes("sum")?"sum":r.includes("count")?"count":r[0]},ha=(t,o,r)=>{let n=r.get(o.fieldId);return n?.formatValue?n.formatValue(t):o.aggregation==="count"?Math.round(t).toLocaleString():t.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};I();var Qu=({options:t,selectedValues:o,onChange:r,minWidth:n=96})=>{let{t:a}=de(),[i,s]=to.useState(""),[l,d]=to.useState(null),p=to.useMemo(()=>{let u=i.trim().toLowerCase();return u?t.filter(b=>b.toLowerCase().includes(u)):t},[t,i]),m=t.length>0&&o.length===t.length,h=t.length===0?a("pivot.filter.na"):o.length===0?a("common.none"):m?a("common.all"):`${o.length}/${t.length}`,f=u=>{r(o.includes(u)?o.filter(b=>b!==u):[...o,u]);};return c("div",{sx:{minWidth:n},onClick:u=>u.stopPropagation(),onMouseDown:u=>u.stopPropagation(),children:[e(Te,{variant:"outlined",size:"small",onClick:u=>d(u.currentTarget),sx:{minWidth:n,height:26,px:1,py:.35,fontSize:"0.72rem",justifyContent:"space-between"},children:h}),e(Jt,{anchorEl:l,open:!!l,onClose:()=>d(null),PaperProps:{sx:{width:Math.max(n,220),maxHeight:320,overflowY:"auto",p:.5}},children:c("div",{onClick:u=>u.stopPropagation(),sx:{display:"grid",gap:.4},children:[e(ze,{size:"small",placeholder:`${a("common.search")}...`,fullWidth:true,value:i,onChange:u=>s(u.target.value),onKeyDown:u=>u.stopPropagation(),onClick:u=>u.stopPropagation(),sx:{m:0,"& .orb-inp":{fontSize:"0.75rem",py:.7}}}),e("div",{sx:{px:1,py:.5,borderBottom:"1px solid var(--orb-border)"},children:e(Te,{variant:"text",size:"small",onClick:u=>{u.preventDefault(),u.stopPropagation(),r(m?[]:t);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:a(m?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),p.length===0&&e("div",{className:"orb-menu-item","aria-disabled":"true",sx:{fontSize:"0.75rem"},children:a("pivot.filter.noResults")}),p.map(u=>{let b=o.includes(u);return c("div",{role:"option","aria-selected":b,tabIndex:0,className:`orb-menu-item ${b?"orb-selected":""}`,onClick:()=>f(u),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),f(u));},sx:{display:"flex",alignItems:"center",fontSize:"0.75rem",py:.4},children:[e(It,{size:"small",checked:b,inputProps:{tabIndex:-1},sx:{p:.5,mr:.5,pointerEvents:"none"}}),e("span",{children:u})]},u)})]})})]})};I();var kn=({size:t=18,subtle:o=false})=>{let r=Math.max(2,Math.round(t/6));return e(Me,{"aria-hidden":"true",sx:{display:"grid",gridTemplateColumns:`repeat(2, ${r}px)`,gridAutoRows:`${r}px`,gap:`${Math.max(2,Math.round(r/1.5))}px`,placeItems:"center",width:t,height:t,flexShrink:0,color:o?"var(--orb-muted)":"var(--orb-primary)"},children:Array.from({length:6},(n,a)=>e(Me,{sx:{width:r,height:r,borderRadius:999,bgcolor:"currentColor"}},a))})};I();var zl=({label:t,subtitle:o,isDragging:r,dragRef:n,listeners:a,attributes:i,style:s})=>e(Ae,{ref:n,...a,...i,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)",transform:"translateY(-1px)"}},style:{...s,opacity:r?.3:1,cursor:r?"grabbing":"grab"},children:c("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[e("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--orb-r)",bgcolor:"var(--orb-p50)",border:"1px solid var(--orb-p100)"},children:e(kn,{size:13,subtle:true})}),c("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.15},children:[e(L,{component:"div",sx:{fontSize:"0.84rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),o&&e(L,{component:"div",sx:{fontSize:"0.73rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:o})]})]})}),Ju=({id:t,label:o,subtitle:r})=>{let{setNodeRef:n,listeners:a,attributes:i,isDragging:s}=core.useDraggable({id:t});return e(zl,{label:o,subtitle:r,isDragging:s,dragRef:n,listeners:a,attributes:i})};I();var Pn=({zone:t,title:o,hint:r,icon:n,children:a,itemCount:i,onClear:s})=>{let l=`container|${t}`,{isOver:d,setNodeRef:p}=core.useDroppable({id:l}),{t:m}=de();return c(Ae,{ref:p,sx:h=>({p:1.1,borderRadius:"var(--orb-r-container)",border:"1px dashed",borderColor:d?"var(--orb-primary)":"var(--orb-p200)",bgcolor:d?"var(--orb-p100)":h.palette.mode==="dark"?"var(--orb-surface-2)":"var(--orb-p50)",transition:"border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease",boxShadow:d?"0 0 0 3px var(--orb-focus-ring)":"none",minHeight:120,display:"flex",flexDirection:"column"}),children:[c("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[c("div",{sx:{display:"flex",alignItems:"center",gap:.8},children:[n,e(L,{component:"div",sx:{fontSize:"0.8rem",fontWeight:700,letterSpacing:.1,color:"var(--orb-fg-strong)"},children:o}),c(L,{component:"div",sx:{fontSize:"0.73rem",fontWeight:500,color:"var(--orb-fg)"},children:["(",i,")"]})]}),i>0&&s&&e(dt,{title:m("pivot.clearArea"),children:e(se,{size:"small",onClick:s,sx:{width:24,height:24,p:0},children:e(hp,{size:13})})})]}),e(L,{component:"div",sx:{mt:.5,mb:.9,fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)"},children:r}),e("div",{sx:{flex:1},children:a})]})};I();var em={xs:1.2,md:1.6},Tn=({title:t,subtitle:o,collapsed:r,onToggleCollapse:n,expandAriaLabel:a,collapseAriaLabel:i,children:s,bodySx:l,unmountOnExit:d=false,headerActions:p})=>c(Ae,{sx:m=>({borderRadius:"var(--orb-r-container)",border:`1px solid ${m.palette.divider}`,overflow:"hidden",bgcolor:"var(--orb-surface)",boxShadow:"var(--orb-shadow-1)"}),children:[c("div",{sx:m=>({px:em,py:1.15,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,bgcolor:"var(--orb-canvas)",borderBottom:r?"none":`1px solid ${m.palette.divider}`}),children:[c("div",{sx:{minWidth:0,flex:1},children:[e(L,{component:"div",sx:{fontSize:"0.92rem",fontWeight:700,color:"var(--orb-fg-strong)"},children:t}),e(L,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o})]}),c("div",{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[p,e(se,{size:"small","aria-label":r?a:i,onClick:n,sx:m=>({border:`1px solid ${m.palette.divider}`,bgcolor:"var(--orb-canvas)",color:"var(--orb-primary)",width:24,height:24,padding:0,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:"var(--orb-p50)",borderColor:"var(--orb-p200)"}}),children:e(ui,{size:13,sx:{transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:r?"rotate(180deg)":"rotate(0deg)"}})})]})]}),e(nn,{in:!r,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:e("div",{sx:[{px:em,py:{xs:1.2,md:1.6}},...Array.isArray(l)?l:l?[l]:[]],children:s})})]});I();var ts=({label:t,caption:o,onRemove:r,trailing:n,isDragging:a,dragRef:i,listeners:s,attributes:l,style:d})=>e(Ae,{ref:i,style:d,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",opacity:a?0:1,transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)"}},children:c("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[e("div",{...l,...s,sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--orb-r)",bgcolor:"var(--orb-p50)",border:"1px solid var(--orb-p100)",cursor:"grab"},children:e(kn,{size:13,subtle:true})}),c("div",{sx:{minWidth:0,flex:1,display:"flex",flexDirection:"column",gap:.15},children:[e(L,{component:"div",sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),o&&e(L,{component:"div",sx:{fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:o})]}),n,r&&e(se,{size:"small",onClick:p=>{p.stopPropagation(),r();},sx:{width:24,height:24,p:0},children:e(Sr,{size:13})})]})}),fa=({id:t,label:o,caption:r,onRemove:n,trailing:a})=>{let{setNodeRef:i,attributes:s,listeners:l,transform:d,transition:p,isDragging:m}=sortable.useSortable({id:t}),h={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:p,zIndex:m?999:"auto"};return e(ts,{label:o,caption:r,onRemove:n,trailing:a,isDragging:m,dragRef:i,listeners:l,attributes:s,style:h})};I();var ns={rows:e(Mp,{size:16,sx:{color:"var(--orb-primary)"}}),columns:e(ln,{size:16,sx:{color:"var(--orb-primary)"}}),filters:e(pp,{size:16,sx:{color:"var(--orb-primary)"}}),values:e(sn,{size:16,sx:{color:"var(--orb-accent)"}})},tm=({isConfiguratorCollapsed:t,onToggleCollapse:o,availableFields:r,fieldMap:n,filterFields:a,columnFields:i,rowFields:s,valueFields:l,clearZone:d,removeFieldFromZone:p,getFilterSelectionSummary:m,renderDimensionFilterSelect:h,renderAggregationSelect:f,getAggregationLabel:u})=>{let{t:b}=de(),C=[`${b("pivot.zone.rows")} ${s.length}`,`${b("pivot.zone.columns")} ${i.length}`,`${b("pivot.zone.filters")} ${a.length}`,`${b("pivot.zone.values")} ${l.length}`].join(" \xB7 ");return e(Tn,{title:b("pivot.config.title"),subtitle:C,collapsed:t,onToggleCollapse:o,expandAriaLabel:b("pivot.collapse.ariaExpand"),collapseAriaLabel:b("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:c("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[e(Pn,{zone:"palette",title:b("pivot.fieldList"),hint:b("pivot.availableDimensions"),itemCount:r.length,icon:e(kn,{size:18,subtle:true}),children:c(le,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[r.length===0&&e(L,{component:"div",sx:{fontSize:"0.74rem",fontWeight:400,color:"var(--orb-fg)",py:1},children:b("pivot.allFieldsInUse")}),r.map(g=>e(Ju,{id:`item|palette|${g.id}`,label:g.label,subtitle:g.type??"string"},g.id))]})}),c(le,{spacing:2,children:[c("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[e(Pn,{zone:"filters",title:b("pivot.zone.filters"),hint:b("pivot.hint.filters"),icon:ns.filters,itemCount:a.length,onClear:()=>d("filters"),children:e(sortable.SortableContext,{items:a.map(g=>`item|filters|${g}`),strategy:sortable.verticalListSortingStrategy,children:e(le,{spacing:.7,children:a.map(g=>e(fa,{id:`item|filters|${g}`,label:n.get(g)?.label??g,caption:m(g),trailing:h(g),onRemove:()=>p("filters",g)},g))})})}),e(Pn,{zone:"columns",title:b("pivot.zone.columns"),hint:b("pivot.hint.columns"),icon:ns.columns,itemCount:i.length,onClear:()=>d("columns"),children:e(sortable.SortableContext,{items:i.map(g=>`item|columns|${g}`),strategy:sortable.verticalListSortingStrategy,children:e(le,{spacing:.7,children:i.map(g=>e(fa,{id:`item|columns|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${m(g)}`,trailing:h(g),onRemove:()=>p("columns",g)},g))})})})]}),c("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[e(Pn,{zone:"rows",title:b("pivot.zone.rows"),hint:b("pivot.hint.rows"),icon:ns.rows,itemCount:s.length,onClear:()=>d("rows"),children:e(sortable.SortableContext,{items:s.map(g=>`item|rows|${g}`),strategy:sortable.verticalListSortingStrategy,children:e(le,{spacing:.7,children:s.map(g=>e(fa,{id:`item|rows|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${m(g)}`,trailing:h(g),onRemove:()=>p("rows",g)},g))})})}),e(Pn,{zone:"values",title:b("pivot.zone.values"),hint:b("pivot.hint.values"),icon:ns.values,itemCount:l.length,onClear:()=>d("values"),children:e(sortable.SortableContext,{items:l.map(g=>`item|values|${g.tokenId}`),strategy:sortable.verticalListSortingStrategy,children:e(le,{spacing:.7,children:l.map(g=>{let x=n.get(g.fieldId)?.label??g.fieldId,v=`${u(g.aggregation)}(${x})`;return e(fa,{id:`item|values|${g.tokenId}`,label:x,caption:v,trailing:f(g),onRemove:()=>p("values",g.tokenId)},g.tokenId)})})})})]})]})]})})};I();var om=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),rm=({data:t,primaryLabel:o,secondaryLabel:r,formatPrimaryValue:n,formatSecondaryValue:a})=>{let i=lo();if(t.length===0)return null;let s=720,l=250,d={top:20,right:24,bottom:40,left:52},p=r?t.map(g=>g.primaryValue):t.map((g,x)=>x+1),m=r?t.map(g=>g.secondaryValue??0):t.map(g=>g.primaryValue),h=Math.max(...p,1),f=Math.max(...m,1),u=s-d.left-d.right,b=l-d.top-d.bottom,C=t.map((g,x)=>{let v=r?g.primaryValue:x+1,y=r?g.secondaryValue??0:g.primaryValue,k=d.left+v/h*u,S=l-d.bottom-y/f*b;return {...g,x:k,y:S,rawX:v,rawY:y}});return c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[e("div",{sx:{overflowX:"auto"},children:c("div",{component:"svg",viewBox:`0 0 ${s} ${l}`,sx:{width:"100%",minWidth:s,height:l},children:[e("line",{x1:d.left,y1:l-d.bottom,x2:s-d.right,y2:l-d.bottom,stroke:Oo(i.palette.text.secondary,.35)}),e("line",{x1:d.left,y1:d.top,x2:d.left,y2:l-d.bottom,stroke:Oo(i.palette.text.secondary,.35)}),C.map(g=>c("g",{children:[e("circle",{cx:g.x,cy:g.y,r:7,fill:Oo(i.palette.primary.main,.18)}),e("circle",{cx:g.x,cy:g.y,r:4.5,fill:i.palette.primary.main,children:c("title",{children:[g.name,`
195
+ `,r?`${o}: ${n(g.primaryValue)}`:`${o}: ${n(g.primaryValue)}`,r?`
196
+ ${r}: ${(a??n)(g.secondaryValue??0)}`:""]})}),e("text",{x:g.x,y:Math.max(g.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:i.palette.text.secondary,children:g.name})]},g.name)),e("text",{x:s/2,y:l-10,textAnchor:"middle",fontSize:"11",fill:i.palette.text.secondary,children:r?o:"Index"}),e("text",{x:16,y:l/2,textAnchor:"middle",transform:`rotate(-90 16 ${l/2})`,fontSize:"11",fill:i.palette.text.secondary,children:r??o}),e("text",{x:d.left,y:d.top-4,fontSize:"10",fill:i.palette.text.secondary,children:om(f)}),e("text",{x:s-d.right,y:l-d.bottom+16,textAnchor:"end",fontSize:"10",fill:i.palette.text.secondary,children:om(h)})]})}),e("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(3, minmax(0, 1fr))"},gap:1},children:t.map(g=>c("div",{sx:x=>({borderRadius:"var(--orb-r-container)",px:1.25,py:1,border:`1px solid ${Oo(x.palette.divider,.7)}`,bgcolor:Oo(x.palette.background.default,.35)}),children:[e(L,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:g.name,children:g.name}),c(L,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[o,": ",n(g.primaryValue)]}),r&&c(L,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[r,": ",(a??n)(g.secondaryValue??0)]})]},g.name))})]})};I();var Vl=t=>Math.max(...t,1),nm=({data:t,chartType:o,primaryLabel:r,secondaryLabel:n,formatPrimaryValue:a,formatSecondaryValue:i})=>{let s=lo(),l=s.palette.primary.main,d=s.palette.warning.main;if(t.length===0)return null;if(o==="bar-horizontal"){let v=Vl(t.flatMap(y=>[y.primaryValue,y.secondaryValue??0]));return e(le,{spacing:1.1,children:t.map(y=>c("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[e(L,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:y.name,children:y.name}),c(le,{spacing:.65,children:[e("div",{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:Oo(s.palette.action.active,.08)},children:e("div",{sx:{width:`${y.primaryValue/v*100}%`,height:"100%",bgcolor:l}})}),n&&e("div",{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:Oo(s.palette.action.active,.08)},children:e("div",{sx:{width:`${(y.secondaryValue??0)/v*100}%`,height:"100%",bgcolor:d}})})]}),c("div",{sx:{minWidth:0},children:[e(L,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700,color:"var(--orb-fg-strong)"},children:a(y.primaryValue)}),n&&e(L,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"var(--orb-fg)"},children:(i??a)(y.secondaryValue??0)})]})]},y.name))})}if(o==="bar-vertical"){let v=Vl(t.flatMap(k=>[k.primaryValue,k.secondaryValue??0])),y=n?92:76;return e("div",{sx:{overflowX:"auto",pb:.5},children:e("div",{sx:{minWidth:Math.max(620,t.length*y),display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:t.map(k=>c("div",{sx:{minWidth:0},children:[c("div",{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[e("div",{sx:{width:n?16:26,minHeight:8,height:`${Math.max(k.primaryValue/v*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:l},title:`${r}: ${a(k.primaryValue)}`}),n&&e("div",{sx:{width:16,minHeight:8,height:`${Math.max((k.secondaryValue??0)/v*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${n}: ${(i??a)(k.secondaryValue??0)}`})]}),e(L,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:k.name,children:k.name}),e(L,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:a(k.primaryValue),children:a(k.primaryValue)}),n&&e(L,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:(i??a)(k.secondaryValue??0),children:(i??a)(k.secondaryValue??0)})]},k.name))})})}let p=Math.max(680,t.length*74),m=240,h={top:20,right:18,bottom:36,left:18},f=Vl(t.flatMap(v=>[v.primaryValue,v.secondaryValue??0])),u=p-h.left-h.right,b=m-h.top-h.bottom,C=v=>t.map((y,k)=>{let S=h.left+k*u/Math.max(t.length-1,1),P=m-h.bottom-v(y)/f*b;return {x:S,y:P,item:y}}),g=C(v=>v.primaryValue),x=n?C(v=>v.secondaryValue??0):[];return c("div",{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[e("div",{sx:{overflowX:"auto"},children:c("div",{component:"svg",viewBox:`0 0 ${p} ${m}`,sx:{width:"100%",minWidth:p,height:m},children:[e("line",{x1:h.left,y1:m-h.bottom,x2:p-h.right,y2:m-h.bottom,stroke:Oo(s.palette.text.secondary,.35)}),e("polyline",{fill:"none",stroke:l,strokeWidth:3,points:g.map(v=>`${v.x},${v.y}`).join(" ")}),g.map(v=>e("circle",{cx:v.x,cy:v.y,r:4,fill:l,children:c("title",{children:[v.item.name,`
197
+ `,r,": ",a(v.item.primaryValue)]})},`primary-${v.item.name}`)),n&&c(jsxRuntime.Fragment,{children:[e("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:x.map(v=>`${v.x},${v.y}`).join(" ")}),x.map(v=>e("circle",{cx:v.x,cy:v.y,r:3.5,fill:d,children:c("title",{children:[v.item.name,`
198
+ `,n,": ",(i??a)(v.item.secondaryValue??0)]})},`secondary-${v.item.name}`))]})]})}),e("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:t.map(v=>c("div",{sx:y=>({borderRadius:"var(--orb-r-container)",px:1.1,py:.9,border:`1px solid ${Oo(y.palette.divider,.7)}`,bgcolor:Oo(y.palette.background.default,.35)}),children:[e(L,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:v.name,children:v.name}),e(L,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:a(v.primaryValue)}),n&&e(L,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:(i??a)(v.secondaryValue??0)})]},v.name))})]})};var am=(t,o,r)=>{let n=new Set,a=[];return t.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:r.get(i)?.label??i,zone:"rows"}));}),o.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:r.get(i)?.label??i,zone:"columns"}));}),a},im=(t,o,r)=>t.map(n=>{let a=o.get(n.fieldId),i=a?.label??n.fieldId;return {fieldId:n.fieldId,label:`${r(n.aggregation)} \xB7 ${i}`,item:n,field:a}}),sm=({rows:t,dimensionFieldId:o,primaryValue:r,secondaryValue:n})=>{if(!o)return [];let a=new Map;return t.forEach(i=>{let s=ur(i[o]),l=a.get(s);if(l){l.push(i);return}a.set(s,[i]);}),Array.from(a.entries()).sort((i,s)=>i[0].localeCompare(s[0],void 0,{sensitivity:"base"})).map(([i,s])=>({name:i,primaryValue:Sn(s,r.fieldId,r.aggregation),secondaryValue:n?Sn(s,n.fieldId,n.aggregation):void 0}))};I();var lm=({rows:t,fieldMap:o,rowFields:r,columnFields:n,valueFields:a,chartDimensionFieldId:i,chartPrimaryValueFieldId:s,chartSecondaryValueFieldId:l,chartType:d,isCollapsed:p,onChartDimensionFieldIdChange:m,onChartPrimaryValueFieldIdChange:h,onChartSecondaryValueFieldIdChange:f,onChartTypeChange:u,onToggleCollapse:b,getAggregationLabel:C})=>{let{t:g}=de(),x=to.useMemo(()=>am(r,n,o),[n,o,r]),v=to.useMemo(()=>im(a,o,C),[o,C,a]),y=v.find(T=>T.fieldId===s)??v[0],k=v.find(T=>T.fieldId===l&&T.fieldId!==y?.fieldId)??null,S=x.find(T=>T.fieldId===i)??x[0],P=S&&y?g("pivot.chart.subtitleReady",{dimension:S.label,measure:k?`${y.label} / ${k.label}`:y.label}):g("pivot.chart.subtitle"),M=to.useMemo(()=>!S||!y?[]:sm({rows:t,dimensionFieldId:S.fieldId,primaryValue:y.item,secondaryValue:k?.item}),[y,t,k,S]),w=T=>y?ha(T,y.item,o):T.toLocaleString(),N=T=>k?ha(T,k.item,o):T.toLocaleString(),A=x.length>1||v.length>1;return c(Tn,{title:g("pivot.chart.title"),subtitle:P,collapsed:p,onToggleCollapse:b,expandAriaLabel:g("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:g("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[A&&c("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[c(Cr,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.dimension")}),e(Vt,{value:S?.fieldId??"",onChange:T=>m(String(T.target.value)),sx:{fontSize:"0.75rem",height:32},children:x.map(T=>e("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))})]}),c(Cr,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.primaryMeasure")}),e(Vt,{value:y?.fieldId??"",onChange:T=>h(String(T.target.value)),sx:{fontSize:"0.75rem",height:32},children:v.map(T=>e("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))})]}),c(Cr,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.secondaryMeasure")}),c(Vt,{value:k?.fieldId??"",onChange:T=>f(String(T.target.value)),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g("common.none")}),v.filter(T=>T.fieldId!==y?.fieldId).map(T=>e("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))]})]}),c(Cr,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.chartType")}),c(Vt,{value:d,onChange:T=>u(T.target.value),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.barVertical")}),e("option",{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.barHorizontal")}),e("option",{value:"line",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.line")}),e("option",{value:"scatter",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.scatter")})]})]})]}),e("div",{children:S?y?M.length===0?e("div",{sx:{py:5,textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.chart.emptyNoData")})}):d==="scatter"?e(rm,{data:M,primaryLabel:y.label,secondaryLabel:k?.label,formatPrimaryValue:w,formatSecondaryValue:N}):e(nm,{data:M,chartType:d,primaryLabel:y.label,secondaryLabel:k?.label,formatPrimaryValue:w,formatSecondaryValue:N}):e("div",{sx:{py:5,textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.chart.emptyNoValue")})}):e("div",{sx:{py:5,textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.chart.emptyNoDimension")})})})]})};I();var as=({node:t,dataColumns:o,fieldMap:r,level:n,expandedKeys:a,onToggle:i,getValue:s})=>{let l=a.has(t.key),d=t.children.length>0,p=t.isGrandTotal,m=d&&!l&&!p,h=p?800:m?700:d?600:500,f=p?800:m?600:500;return c(jsxRuntime.Fragment,{children:[c("tr",{sx:{bgcolor:p?vt()==="dark"?"color-mix(in oklch, var(--orb-primary) 22%, transparent)":"color-mix(in oklch, var(--orb-primary) 8%, transparent)":vt()==="dark"?"var(--orb-surface)":"background.paper","&:hover":{bgcolor:p?vt()==="dark"?"color-mix(in oklch, var(--orb-primary) 28%, transparent)":"color-mix(in oklch, var(--orb-primary) 12%, transparent)":"var(--orb-hover)"}},children:[c("td",{style:{fontWeight:h},sx:u=>({fontSize:"0.76rem",borderBottom:`1px solid ${u.palette.divider}`,whiteSpace:"nowrap",pl:n*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!p&&e(se,{size:"small",onClick:()=>i(t.key),sx:{width:22,height:22,p:0,mr:.35,ml:-0.8},children:l?e(_o,{size:12}):e(kr,{size:12})}),!d&&!p&&n>0&&e("div",{sx:{width:18}}),t.value]}),o.map(u=>e("td",{align:"right",style:{fontWeight:f},sx:{fontSize:"0.76rem",borderBottom:b=>`1px solid ${b.palette.divider}`,whiteSpace:"nowrap"},children:ha(s?s(t,u.id):t.aggregatedValues[u.id]??0,u.valueItem,r)},`${t.key}-${u.id}`))]}),l&&t.children.map(u=>e(as,{node:u,dataColumns:o,fieldMap:r,level:n+1,expandedKeys:a,onToggle:i,getValue:s},u.key))]})};I();var $l=(t,o,r)=>{let n=[...t,...o];return r&&n.includes(r)?r:n[0]??""},ss=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",_l=(t,o,r)=>r===""?"":r&&r!==o&&t.some(n=>n.fieldId===r)?r:t.find(n=>n.fieldId!==o)?.fieldId??"",dm=t=>{let o=new Set,r=n=>{n.forEach(a=>{a.children.length>0&&(o.add(a.key),r(a.children));});};return r(t),o},pm=(t,o,r=0)=>t.length===0?r:t.reduce((n,a)=>a.children.length===0||!o.has(a.key)?Math.max(n,r+1):Math.max(n,pm(a.children,o,r+1)),r),vy=(t,o)=>{let r=[],n=a=>{a.forEach(i=>{if(i.children.length>0&&o.has(i.key)){n(i.children);return}r.push(i);});};return n(t),r},UO=({title:t,rows:o,fields:r,initialLayout:n,initialChart:a,emptyText:i,maxPreviewHeight:s=520,initialChartCollapsed:l=false,initialTableCollapsed:d=false,model:p,enablePresetManagement:m=false,presets:h,defaultPresets:f,onPresetsChange:u,initialPresetId:b,onPresetApplied:C})=>{let{t:g}=de(),x=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),v=to.useRef(0),y=to.useRef(false),k=t??g("pivot.title.default"),S=i??g("pivot.empty"),P=to.useMemo(()=>({sum:g("pivot.agg.sum"),count:g("pivot.agg.count"),avg:g("pivot.agg.avg"),min:g("pivot.agg.min"),max:g("pivot.agg.max")}),[g]),M=to.useCallback(D=>P[D]??Gu[D],[P]),w=to.useMemo(()=>new Set(r.map(D=>D.id)),[r]),N=to.useMemo(()=>new Map(r.map(D=>[D.id,D])),[r]),[A,T]=to.useState(()=>co(n?.rows,w)),[R,E]=to.useState(()=>co(n?.columns,w)),[O,$]=to.useState(()=>co(n?.filters,w)),[ee,F]=to.useState(()=>{let D=n?.values??[],_=new Set,U=[];return D.forEach(me=>{if(!w.has(me.fieldId)||_.has(me.fieldId))return;_.add(me.fieldId),v.current+=1;let Be=N.get(me.fieldId);U.push({tokenId:`v${v.current}`,fieldId:me.fieldId,aggregation:xo(me.aggregation,Be)});}),U}),[G,W]=to.useState({}),[Q,z]=to.useState(true),[H,X]=to.useState(false),[Y,j]=to.useState(()=>$l(co(n?.rows,w),co(n?.columns,w),a?.dimensionFieldId)),[te,ce]=to.useState(()=>{let D=(n?.values??[]).filter((_,U,me)=>w.has(_.fieldId)&&me.findIndex(Be=>Be.fieldId===_.fieldId)===U).map(_=>({tokenId:_.fieldId,fieldId:_.fieldId,aggregation:xo(_.aggregation,N.get(_.fieldId))}));return ss(D,a?.primaryValueFieldId)}),[fe,Ve]=to.useState(()=>{let D=(n?.values??[]).filter((U,me,Be)=>w.has(U.fieldId)&&Be.findIndex(nt=>nt.fieldId===U.fieldId)===me).map(U=>({tokenId:U.fieldId,fieldId:U.fieldId,aggregation:xo(U.aggregation,N.get(U.fieldId))})),_=ss(D,a?.primaryValueFieldId);return _l(D,_,a?.secondaryValueFieldId)}),[ve,xe]=to.useState(a?.chartType??"bar-vertical"),[He,pe]=to.useState(l),[ye,$e]=to.useState(d),[tt,at]=to.useState(()=>f??[]),[st,K]=to.useState(""),[Ne,Se]=to.useState(false),[Fe,it]=to.useState(""),[Ye,wt]=to.useState(null),[Mt,Ft]=to.useState(new Set(["__grand_total__"])),[Et,ne]=to.useState(new Set),Ke=p?.rowFields??A,Oe=p?.columnFields??R,ue=p?.filterFields??O,we=p?.valueFields??ee,re=p?.filterSelections??G,Ce=p?.showGrandTotal??Q,De=p?.isConfiguratorCollapsed??H,Je=p?.chartDimensionFieldId??Y,lt=p?.chartPrimaryValueFieldId??te,ut=p?.chartSecondaryValueFieldId??fe,Ht=p?.chartType??ve,Yt=p?.isChartCollapsed??He,Wt=p?.isTableCollapsed??ye,St=h??tt,$t=m||St.length>0||!!u,bt=to.useCallback(D=>{if(p?.setRowFields){p.setRowFields(D);return}T(D);},[p]),At=to.useCallback(D=>{if(p?.setColumnFields){p.setColumnFields(D);return}E(D);},[p]),ct=to.useCallback(D=>{if(p?.setFilterFields){p.setFilterFields(D);return}$(D);},[p]),Bt=to.useCallback(D=>{if(p?.setValueFields){p.setValueFields(D);return}F(D);},[p]),jt=to.useCallback(D=>{if(p?.setFilterSelections){p.setFilterSelections(D);return}W(D);},[p]),q=to.useCallback(D=>{if(p?.setShowGrandTotal){p.setShowGrandTotal(D);return}z(D);},[p]),V=to.useCallback(D=>{if(p?.setIsConfiguratorCollapsed){p.setIsConfiguratorCollapsed(D);return}X(D);},[p]),Z=to.useCallback(D=>{if(p?.setChartDimensionFieldId){p.setChartDimensionFieldId(D);return}j(D);},[p]),be=to.useCallback(D=>{if(p?.setChartPrimaryValueFieldId){p.setChartPrimaryValueFieldId(D);return}ce(D);},[p]),ke=to.useCallback(D=>{if(p?.setChartSecondaryValueFieldId){p.setChartSecondaryValueFieldId(D);return}Ve(D);},[p]),Ee=to.useCallback(D=>{if(p?.setChartType){p.setChartType(D);return}xe(D);},[p]),_e=to.useCallback(D=>{if(p?.setIsChartCollapsed){p.setIsChartCollapsed(D);return}pe(D);},[p]),qe=to.useCallback(D=>{if(p?.setIsTableCollapsed){p.setIsTableCollapsed(D);return}$e(D);},[p]),je=to.useCallback(D=>{let _=typeof D=="function"?D(St):D;h||at(_),u?.(_);},[u,St,h]),mt=to.useMemo(()=>new Set([...Ke,...Oe,...ue]),[Ke,Oe,ue]),ht=to.useMemo(()=>r.filter(D=>!mt.has(D.id)),[r,mt]),Rt=to.useMemo(()=>{let D=[...Ke,...Oe,...ue],_=new Set,U=[];return D.forEach(me=>{_.has(me)||(_.add(me),U.push(me));}),U},[Oe,ue,Ke]);to.useEffect(()=>{bt(D=>{let _=D.filter(U=>w.has(U));return mr(D,_)?D:_}),At(D=>{let _=D.filter(U=>w.has(U));return mr(D,_)?D:_}),ct(D=>{let _=D.filter(U=>w.has(U));return mr(D,_)?D:_}),Bt(D=>{let _=D.filter(U=>w.has(U.fieldId)).map(U=>({...U,aggregation:xo(U.aggregation,N.get(U.fieldId))}));return es(D,_)?D:_});},[N,w]);let yt=to.useMemo(()=>{let D={};return Rt.forEach(_=>{let U=new Set;o.forEach(me=>{U.add(ur(me[_]));}),D[_]=Array.from(U).sort((me,Be)=>me.localeCompare(Be));}),D},[Rt,o]);to.useEffect(()=>{jt(D=>{let _={};return Rt.forEach(U=>{let me=yt[U]??[],nt=(D[U]??[]).filter(ae=>me.includes(ae)),Ge=Object.prototype.hasOwnProperty.call(D,U);_[U]=Ge?nt:me;}),Yu(D,_)?D:_});},[Rt,yt]),to.useEffect(()=>{Z(D=>$l(Ke,Oe,D));},[Oe,Ke,Z]),to.useEffect(()=>{be(D=>ss(we,D));},[be,we]),to.useEffect(()=>{ke(D=>_l(we,lt,D));},[lt,ke,we]);let B=to.useMemo(()=>o.filter(D=>Rt.every(_=>{let U=re[_]??[],me=yt[_]??[];if(U.length===me.length)return true;if(U.length===0)return false;let Be=ur(D[_]);return U.includes(Be)})),[Rt,yt,re,o]),J=to.useMemo(()=>{if(we.length===0)return null;let D=new Map;if(B.forEach(Ge=>{let ae=Oe.length>0?Oe.map(oe=>ur(Ge[oe])):[g("pivot.valueLabel")],ge=_r(ae);D.set(ge,ae);}),D.size===0){let Ge=Oe.length>0?Oe.map(()=>Qi):[g("pivot.valueLabel")];D.set(_r(Ge),Ge);}let _=Array.from(D.entries()).sort((Ge,ae)=>Zu(Ge[1],ae[1])),U=_.flatMap(([Ge,ae])=>we.map(ge=>{let oe=N.get(ge.fieldId),Le=`${M(ge.aggregation)} ${oe?.label??ge.fieldId}`,Qe=Oe.length===0||we.length>1?`${ae.join(" / ")} \u2022 ${Le}`:ae.join(" / ");return {id:`${Ge}::${ge.tokenId}`,colKey:Ge,valueItem:ge,label:Qe}})),me=[];Oe.length>0&&_.forEach(([Ge,ae])=>{let ge=U.filter(Qe=>Qe.colKey===Ge),oe=me,Le=[];ae.forEach((Qe,Re)=>{Le.push(`d${Re}:${Qe}`);let Ze=`col::${_r(Le)}`,Pt=oe.find(Qr=>Qr.key===Ze);Pt||(Pt={key:Ze,label:Qe,children:[],leafColumnIds:[],path:ae.slice(0,Re+1),depth:Re},oe.push(Pt)),ge.forEach(Qr=>{Pt.leafColumnIds.includes(Qr.id)||Pt.leafColumnIds.push(Qr.id);}),oe=Pt.children;});});let Be=Ge=>{let ae={};return U.forEach(ge=>{let oe=Ge.filter(Le=>{let Qe=Oe.length>0?Oe.map(Re=>ur(Le[Re])):[g("pivot.valueLabel")];return _r(Qe)===ge.colKey});ae[ge.id]=Sn(oe,ge.valueItem.fieldId,ge.valueItem.aggregation);}),ae},nt=[];if(Ke.length===0)nt.push({key:"root",value:g("pivot.resultLabel")||$u,children:[],isLeaf:true,aggregatedValues:Be(B),path:[],depth:0});else {let Ge=(ae,ge,oe)=>{if(ge>=Ke.length)return [];let Le=Ke[ge],Qe=new Map;return ae.forEach(Re=>{let Ze=ur(Re[Le]);Qe.has(Ze)||Qe.set(Ze,[]),Qe.get(Ze).push(Re);}),Array.from(Qe.keys()).sort().map(Re=>{let Ze=Qe.get(Re),Pt=[...oe,Re];return {key:_r(Pt),value:Re,fieldId:Le,aggregatedValues:Be(Ze),children:Ge(Ze,ge+1,Pt),isLeaf:ge===Ke.length-1,path:Pt,depth:ge}})};nt.push(...Ge(B,0,[]));}return {dataColumns:U,columnTree:me,rowTree:nt}},[Oe,N,B,M,Ke,g,we]),he=to.useCallback((D,_)=>(v.current+=1,{tokenId:`v${v.current}`,fieldId:D,aggregation:xo(_,N.get(D))}),[N]),Ie=to.useCallback(D=>{if(D==="rows")return bt([]);if(D==="columns")return At([]);if(D==="filters")return ct([]);Bt([]);},[]),et=to.useCallback((D,_)=>{if(D==="rows")return bt(U=>U.filter(me=>me!==_));if(D==="columns")return At(U=>U.filter(me=>me!==_));if(D==="filters")return ct(U=>U.filter(me=>me!==_));Bt(U=>U.filter(me=>me.tokenId!==_));},[]),Xe=to.useCallback((D,_)=>{Bt(U=>U.map(me=>me.tokenId===D?{...me,aggregation:xo(_,N.get(me.fieldId))}:me));},[N]),kt=to.useCallback(D=>{wt(String(D.active.id));},[]),ft=to.useCallback(D=>{if(wt(null),!D.over)return;let _=Ji(String(D.active.id)),U=Ji(String(D.over.id));if(!_||!U||_.kind!=="item"||!_.key)return;if(_.zone===U.zone&&U.kind==="item"){if(_.zone==="rows"){let Re=Ke.indexOf(_.key),Ze=Ke.indexOf(U.key??"");Re!==-1&&Ze!==-1&&Re!==Ze&&bt(Pt=>sortable.arrayMove(Pt,Re,Ze));return}if(_.zone==="columns"){let Re=Oe.indexOf(_.key),Ze=Oe.indexOf(U.key??"");Re!==-1&&Ze!==-1&&Re!==Ze&&At(Pt=>sortable.arrayMove(Pt,Re,Ze));return}if(_.zone==="filters"){let Re=ue.indexOf(_.key),Ze=ue.indexOf(U.key??"");Re!==-1&&Ze!==-1&&Re!==Ze&&ct(Pt=>sortable.arrayMove(Pt,Re,Ze));return}if(_.zone==="values"){let Re=we.findIndex(Pt=>Pt.tokenId===_.key),Ze=we.findIndex(Pt=>Pt.tokenId===(U.key??""));Re!==-1&&Ze!==-1&&Re!==Ze&&Bt(Pt=>sortable.arrayMove(Pt,Re,Ze));}return}let me=U.zone,Be=[...Ke],nt=[...Oe],Ge=[...ue],ae=[...we],ge="",oe=null;if(_.zone==="palette")ge=_.key;else if(_.zone==="values"){let Re=ae.find(Ze=>Ze.tokenId===_.key);if(!Re)return;ge=Re.fieldId,oe=Re,ae=ae.filter(Ze=>Ze.tokenId!==_.key);}else _.zone==="rows"?(ge=_.key,Be=Be.filter(Re=>Re!==ge)):_.zone==="columns"?(ge=_.key,nt=nt.filter(Re=>Re!==ge)):_.zone==="filters"&&(ge=_.key,Ge=Ge.filter(Re=>Re!==ge));if(!ge)return;let Le=()=>{Be=Be.filter(Re=>Re!==ge),nt=nt.filter(Re=>Re!==ge),Ge=Ge.filter(Re=>Re!==ge);},Qe=Re=>{if(U.kind!=="item"||!U.key)return Re==="rows"?Be.length:Re==="columns"?nt.length:Re==="filters"?Ge.length:Re==="values"?ae.length:0;if(Re==="rows"){let Ze=Be.indexOf(U.key);return Ze>=0?Ze:Be.length}if(Re==="columns"){let Ze=nt.indexOf(U.key);return Ze>=0?Ze:nt.length}if(Re==="filters"){let Ze=Ge.indexOf(U.key);return Ze>=0?Ze:Ge.length}if(Re==="values"){let Ze=ae.findIndex(Pt=>Pt.tokenId===U.key);return Ze>=0?Ze:ae.length}return 0};if(me==="palette"){bt(Be),At(nt),ct(Ge),Bt(ae);return}if(me==="values"){let Re=Qe("values"),Ze=oe??he(ge);ae.splice(Re,0,Ze),bt(Be),At(nt),ct(Ge),Bt(ae);return}if(Xu(me)){Le();let Re=Qe(me);me==="rows"?Be.splice(Re,0,ge):me==="columns"?nt.splice(Re,0,ge):Ge.splice(Re,0,ge),bt(Be),At(nt),ct(Ge),Bt(ae);}},[Oe,he,ue,Ke,we]),gt=to.useCallback((D,_)=>{jt(U=>({...U,[D]:_}));},[]),Ct=to.useCallback(D=>{Ft(_=>{let U=new Set(_);return U.has(D)?U.delete(D):U.add(D),U});},[]),ao=to.useCallback(D=>{ne(_=>{let U=new Set(_);return U.has(D)?U.delete(D):U.add(D),U});},[]),Lt=to.useCallback(D=>{let _=N.get(D.fieldId),U=Hl(_);return e(Cr,{size:"small",sx:{minWidth:98},children:e(Vt,{value:D.aggregation,onChange:me=>Xe(D.tokenId,me.target.value),onClick:me=>me.stopPropagation(),onMouseDown:me=>me.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& select.orb-inp":{py:.35}},children:U.map(me=>e("option",{value:me,sx:{fontSize:"0.75rem"},children:M(me)},me))})})},[N,M,Xe]),Qt=to.useCallback(D=>{let _=yt[D]??[],U=re[D]??_;return _.length===0?g("pivot.filter.noValues"):U.length===0?g("pivot.filter.noneSelected"):U.length===_.length?g("pivot.filter.allValues"):g("pivot.filter.selectedCount",{selected:U.length,total:_.length})},[yt,re,g]),zt=to.useCallback(D=>{let _=yt[D]??[],U=re[D]??_;return e(Qu,{options:_,selectedValues:U,onChange:me=>gt(D,me)})},[yt,re,gt]),qt=to.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),_t=to.useCallback(()=>{let D={};return new Set([...Rt,...Object.keys(re)]).forEach(U=>{if(!w.has(U))return;let me=re[U]??[];D[U]=[...me];}),{layout:{rows:[...Ke],columns:[...Oe],filters:[...ue],values:we.map(U=>({fieldId:U.fieldId,aggregation:U.aggregation}))},filterSelections:D,showGrandTotal:Ce,chart:{dimensionFieldId:Je,primaryValueFieldId:lt,secondaryValueFieldId:ut,chartType:Ht}}},[Rt,Je,lt,ut,Ht,Oe,ue,re,Ke,Ce,w,we]),ro=to.useCallback(D=>{let _=co(D.layout.rows,w),U=co(D.layout.columns,w),me=co(D.layout.filters,w),Be=new Set,nt=(D.layout.values??[]).filter(ge=>!w.has(ge.fieldId)||Be.has(ge.fieldId)?false:(Be.add(ge.fieldId),true)).map(ge=>he(ge.fieldId,ge.aggregation)),Ge={};Object.entries(D.filterSelections??{}).forEach(([ge,oe])=>{!w.has(ge)||!Array.isArray(oe)||(Ge[ge]=Array.from(new Set(oe.map(Le=>String(Le)))));}),bt(_),At(U),ct(me),Bt(nt),jt(Ge),typeof D.showGrandTotal=="boolean"&&q(D.showGrandTotal),Z($l(_,U,D.chart?.dimensionFieldId));let ae=ss(nt,D.chart?.primaryValueFieldId);be(ae),ke(_l(nt,ae,D.chart?.secondaryValueFieldId)),Ee(D.chart?.chartType??"bar-vertical"),K(D.id),C?.(D);},[he,C,Z,be,ke,Ee,At,ct,jt,bt,q,Bt,w]),io=to.useCallback(D=>{if(!D){K("");return}let _=St.find(U=>U.id===D);if(!_){K("");return}ro(_);},[ro,St]),vo=to.useCallback(()=>{let D=g("pivot.preset.defaultName",{index:St.length+1});it(D),Se(true);},[St.length,g]),Ro=to.useCallback(()=>{let D=Fe.trim();if(!D)return;let _={id:qt(),name:D,..._t()};je(U=>[...U,_]),K(_.id),Se(false);},[_t,qt,Fe,je]),No=to.useCallback(()=>{st&&(je(D=>D.filter(_=>_.id!==st)),K(""));},[st,je]);to.useEffect(()=>{if(!b||y.current)return;let D=St.find(_=>_.id===b);D&&(y.current=true,ro(D));},[ro,b,St]),to.useEffect(()=>{st&&(St.some(D=>D.id===st)||K(""));},[st,St]);let ir=to.useMemo(()=>{if(!Ce||!J||!Ke.length)return null;let D={};return J.dataColumns.forEach(_=>{let U=B.filter(me=>{let Be=Oe.length>0?Oe.map(nt=>ur(me[nt])):[g("pivot.valueLabel")];return _r(Be)===_.colKey});D[_.id]=Sn(U,_.valueItem.fieldId,_.valueItem.aggregation);}),{key:"__grand_total__",value:g("pivot.grandTotal")||_u,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:D,path:[],depth:-1}},[Ce,J,B,Oe,Ke.length,g]),wo=to.useMemo(()=>dm(J?.rowTree??[]),[J]),Ho=to.useMemo(()=>dm(J?.columnTree??[]),[J]);to.useEffect(()=>{Ft(D=>{let _=new Set;return D.has("__grand_total__")&&_.add("__grand_total__"),wo.forEach(U=>{D.has(U)&&_.add(U);}),_});},[wo]),to.useEffect(()=>{ne(D=>{let _=new Set;return Ho.forEach(U=>{D.has(U)&&_.add(U);}),_});},[Ho]);let qr=to.useCallback(()=>{Ft(D=>{let _=new Set(D);return wo.forEach(U=>_.add(U)),_});},[wo]),Xr=to.useCallback(()=>{Ft(D=>{let _=new Set;return D.has("__grand_total__")&&_.add("__grand_total__"),_});},[]),Lr=to.useCallback(()=>{ne(new Set(Ho));},[Ho]),Zr=to.useCallback(()=>{ne(new Set);},[]),Yr=to.useMemo(()=>!J||Oe.length===0?[]:vy(J.columnTree,Et),[Oe.length,Et,J]),Do=to.useMemo(()=>{if(!J)return [];if(Oe.length===0)return J.dataColumns.map(_=>({id:_.id,label:_.label,leafColumnIds:[_.id],valueItem:_.valueItem}));let D=new Map(J.dataColumns.map(_=>[_.id,_]));return Yr.flatMap(_=>{let U=new Map;return _.leafColumnIds.forEach(me=>{let Be=D.get(me);if(!Be)return;let nt=Be.valueItem.tokenId,Ge=`${M(Be.valueItem.aggregation)} ${N.get(Be.valueItem.fieldId)?.label??Be.valueItem.fieldId}`,ae=U.get(nt);if(ae){ae.leafColumnIds.push(me);return}U.set(nt,{id:`${_.key}::${nt}`,label:we.length>1?Ge:_.label,leafColumnIds:[me],valueItem:Be.valueItem});}),Array.from(U.values())})},[Oe.length,N,M,J,we.length,Yr]),Or=to.useMemo(()=>new Map(Do.map(D=>[D.id,D])),[Do]),jr=to.useMemo(()=>Do.map(D=>({id:D.id,colKey:D.id,valueItem:D.valueItem,label:D.label})),[Do]),Yo=to.useMemo(()=>{if(!J||Oe.length===0)return [];let D=[],_=pm(J.columnTree,Et),U=_+(we.length>1?1:0),me=(Be,nt)=>{D[nt]??(D[nt]=[]),Be.forEach(Ge=>{let ae=Ge.children.length>0&&Et.has(Ge.key),ge=Do.filter(Le=>Ge.leafColumnIds.some(Qe=>Le.leafColumnIds.includes(Qe))).length,oe=ae||we.length>1?1:U-nt;D[nt].push({key:Ge.key,label:Ge.label,colSpan:ge,rowSpan:oe,expandable:Ge.children.length>0,expanded:ae}),ae&&me(Ge.children,nt+1);});};return me(J.columnTree,0),we.length>1&&(D[_]=Do.map(Be=>({key:Be.id,label:Be.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),D},[Oe.length,Et,J,we.length,Do]),sr=to.useCallback((D,_)=>_.leafColumnIds.reduce((U,me)=>U+(D.aggregatedValues[me]??0),0),[]),Fn=to.useMemo(()=>c(jsxRuntime.Fragment,{children:[e(Te,{size:"small",variant:"text",onClick:qr,disabled:wo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.expandRowsAll")}),e(Te,{size:"small",variant:"text",onClick:Xr,disabled:wo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.collapseRowsAll")}),e(Nt,{orientation:"vertical",flexItem:true}),e(Te,{size:"small",variant:"text",onClick:Lr,disabled:Ho.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.expandColumnsAll")}),e(Te,{size:"small",variant:"text",onClick:Zr,disabled:Oe.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.collapseColumnsAll")})]}),[Oe.length,Ho.size,wo.size,Zr,Xr,Lr,qr,g]),Fr=()=>{if(!Ye)return null;let D=Ji(Ye);if(!D||D.kind!=="item"||!D.key)return null;if(D.zone==="palette"){let Be=N.get(D.key);return Be?e(zl,{label:Be.label,subtitle:Be.type}):null}if(D.zone==="values"){let Be=we.find(ge=>ge.tokenId===D.key);if(!Be)return null;let Ge=N.get(Be.fieldId)?.label??Be.fieldId,ae=`${M(Be.aggregation)}(${Ge})`;return e(ts,{label:Ge,caption:ae})}let U=N.get(D.key)?.label??D.key,me=Qt(D.key);return e(ts,{label:U,caption:me})};return c(Ae,{sx:D=>({p:{xs:1.2,md:2},borderRadius:"var(--orb-r-container)",border:`1px solid ${D.palette.divider}`,bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-2)",display:"flex",flexDirection:"column",gap:2.25}),children:[c("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[c("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.35},children:[e(L,{component:"div",sx:{fontSize:"1.08rem",fontWeight:700,lineHeight:1.25,color:"var(--orb-fg-strong)"},children:k}),e(L,{component:"div",sx:{fontSize:"0.8rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.subtitle.default")})]}),c(le,{direction:"row",spacing:1.5,alignItems:"center",children:[$t&&c(jsxRuntime.Fragment,{children:[e(Cr,{size:"small",sx:{minWidth:200},children:c(Vt,{value:st,displayEmpty:true,onChange:D=>io(String(D.target.value)),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g("pivot.preset.selectPlaceholder")}),St.map(D=>e("option",{value:D.id,sx:{fontSize:"0.75rem"},children:D.name},D.id))]})}),e(dt,{title:g("pivot.preset.save"),children:e(se,{size:"small",onClick:vo,"aria-label":g("pivot.preset.save"),sx:{width:28,height:28,p:0},children:e(Pr,{size:15})})}),e(dt,{title:g("pivot.preset.delete"),children:e("span",{children:e(se,{size:"small",onClick:No,disabled:!st,"aria-label":g("pivot.preset.delete"),sx:{width:28,height:28,p:0},children:e(pi,{size:15})})})}),e(Nt,{flexItem:true,orientation:"vertical"})]}),c(L,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)"},children:[g("pivot.records"),": ",e("strong",{children:o.length.toLocaleString()})," / ",g("pivot.afterFilter"),":"," ",e("strong",{children:B.length.toLocaleString()})]}),e(Nt,{flexItem:true,orientation:"vertical"}),c("div",{sx:{display:"flex",alignItems:"center",gap:.6},children:[e(L,{component:"div",sx:{fontSize:"0.75rem",fontWeight:500,color:"var(--orb-fg-strong)"},children:g("pivot.grandTotal")}),e(si,{size:"small",checked:Ce,onChange:D=>q(D.target.checked)})]})]})]}),e(Nt,{}),c(core.DndContext,{sensors:x,collisionDetection:core.closestCenter,onDragStart:kt,onDragEnd:ft,children:[e(tm,{isConfiguratorCollapsed:De,onToggleCollapse:()=>V(D=>!D),availableFields:ht,fieldMap:N,filterFields:ue,columnFields:Oe,rowFields:Ke,valueFields:we,clearZone:Ie,removeFieldFromZone:et,getFilterSelectionSummary:Qt,renderDimensionFilterSelect:zt,renderAggregationSelect:Lt,getAggregationLabel:M}),e(_d,{children:e(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Fr()})})]}),e(lm,{rows:B,fieldMap:N,rowFields:Ke,columnFields:Oe,valueFields:we,chartDimensionFieldId:Je,chartPrimaryValueFieldId:lt,chartSecondaryValueFieldId:ut,chartType:Ht,isCollapsed:Yt,onChartDimensionFieldIdChange:D=>Z(D),onChartPrimaryValueFieldIdChange:D=>be(D),onChartSecondaryValueFieldIdChange:D=>ke(D),onChartTypeChange:D=>Ee(D),onToggleCollapse:()=>_e(D=>!D),getAggregationLabel:M}),e(Tn,{title:g("pivot.table.sectionTitle"),subtitle:Ke.length>0?Ke.map(D=>N.get(D)?.label??D).join(" > "):g("pivot.table.dimensions"),collapsed:Wt,onToggleCollapse:()=>qe(D=>!D),expandAriaLabel:g("pivot.table.collapse.ariaExpand"),collapseAriaLabel:g("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:Fn,children:J===null?e("div",{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:S})}):e("div",{sx:{maxHeight:s},children:c("table",{className:"orb-tbl",size:"small",stickyHeader:true,children:[e("thead",{children:(Yo.length>0?Yo:[[]]).map((D,_)=>c("tr",{children:[_===0&&e("td",{rowSpan:Math.max(Yo.length,1),sx:U=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:vt()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${U.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:Ke.length>0?Ke.map(U=>N.get(U)?.label).join(" > "):g("pivot.table.dimensions")}),(D.length>0?D:Do.map(U=>({key:U.id,label:U.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(U=>e("td",{align:"center",colSpan:U.colSpan,rowSpan:U.rowSpan,sx:me=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:vt()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${me.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:c("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[U.expandable&&e(se,{size:"small",onClick:()=>ao(U.key),sx:{width:22,height:22,p:0,ml:-0.2},children:U.expanded?e(_o,{size:12}):e(kr,{size:12})}),e("div",{component:"span",children:U.label})]})},U.key))]},`pivot-header-row-${_}`))}),c("tbody",{children:[J.rowTree.map(D=>e(as,{node:D,dataColumns:jr,fieldMap:N,level:0,expandedKeys:Mt,onToggle:Ct,getValue:(_,U)=>{let me=Or.get(U);return me?sr(_,me):0}},D.key)),ir&&e(as,{node:ir,dataColumns:jr,fieldMap:N,level:0,expandedKeys:Mt,onToggle:Ct,getValue:(D,_)=>{let U=Or.get(_);return U?sr(D,U):0}})]})]})})}),c(Ot,{open:Ne,onClose:()=>Se(false),maxWidth:"xs",fullWidth:true,children:[e("div",{className:"orb-dialog-title",children:g("pivot.preset.saveDialogTitle")}),e("div",{className:"orb-dialog-content",children:e(ze,{autoFocus:true,fullWidth:true,margin:"dense",label:g("pivot.preset.nameLabel"),value:Fe,onChange:D=>it(D.target.value),onKeyDown:D=>{D.key==="Enter"&&(D.preventDefault(),Ro());}})}),c("div",{className:"orb-dialog-actions",children:[e(Te,{onClick:()=>Se(false),children:g("common.cancel")}),e(Te,{variant:"contained",onClick:Ro,disabled:!Fe.trim(),children:g("common.save")})]})]})]})};var um=(t,o,r)=>{let n=[...t,...o];return r&&n.includes(r)?r:n[0]??""},Ul=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",mm=(t,o,r)=>r===""?"":r&&r!==o&&t.some(n=>n.fieldId===r)?r:t.find(n=>n.fieldId!==o)?.fieldId??"",YO=({fields:t,initialLayout:o,initialFilterSelections:r={},initialShowGrandTotal:n=true,initialConfiguratorCollapsed:a=false,initialChart:i,initialChartCollapsed:s=false,initialTableCollapsed:l=false})=>{let d=to.useRef(0),p=to.useMemo(()=>new Set(t.map(K=>K.id)),[t]),m=to.useMemo(()=>new Map(t.map(K=>[K.id,K])),[t]),[h,f]=to.useState(()=>co(o?.rows,p)),[u,b]=to.useState(()=>co(o?.columns,p)),[C,g]=to.useState(()=>co(o?.filters,p)),[x,v]=to.useState(()=>{let K=o?.values??[],Ne=new Set,Se=[];return K.forEach(Fe=>{!p.has(Fe.fieldId)||Ne.has(Fe.fieldId)||(Ne.add(Fe.fieldId),d.current+=1,Se.push({tokenId:`v${d.current}`,fieldId:Fe.fieldId,aggregation:xo(Fe.aggregation,m.get(Fe.fieldId))}));}),Se}),[y,k]=to.useState(r),[S,P]=to.useState(n),[M,w]=to.useState(a),[N,A]=to.useState(()=>um(co(o?.rows,p),co(o?.columns,p),i?.dimensionFieldId)),[T,R]=to.useState(()=>{let K=(()=>{let Ne=o?.values??[],Se=new Set,Fe=[];return Ne.forEach(it=>{!p.has(it.fieldId)||Se.has(it.fieldId)||(Se.add(it.fieldId),Fe.push({tokenId:it.fieldId,fieldId:it.fieldId,aggregation:xo(it.aggregation,m.get(it.fieldId))}));}),Fe})();return Ul(K,i?.primaryValueFieldId)}),[E,O]=to.useState(()=>{let K=(()=>{let Se=o?.values??[],Fe=new Set,it=[];return Se.forEach(Ye=>{!p.has(Ye.fieldId)||Fe.has(Ye.fieldId)||(Fe.add(Ye.fieldId),it.push({tokenId:Ye.fieldId,fieldId:Ye.fieldId,aggregation:xo(Ye.aggregation,m.get(Ye.fieldId))}));}),it})(),Ne=Ul(K,i?.primaryValueFieldId);return mm(K,Ne,i?.secondaryValueFieldId)}),[$,ee]=to.useState(i?.chartType??"bar-vertical"),[F,G]=to.useState(s),[W,Q]=to.useState(l);to.useEffect(()=>{f(K=>{let Ne=K.filter(Se=>p.has(Se));return mr(K,Ne)?K:Ne}),b(K=>{let Ne=K.filter(Se=>p.has(Se));return mr(K,Ne)?K:Ne}),g(K=>{let Ne=K.filter(Se=>p.has(Se));return mr(K,Ne)?K:Ne}),v(K=>{let Ne=K.filter(Se=>p.has(Se.fieldId)).map(Se=>({...Se,aggregation:xo(Se.aggregation,m.get(Se.fieldId))}));return es(K,Ne)?K:Ne});},[m,p]),to.useEffect(()=>{A(K=>um(h,u,K));},[u,h]),to.useEffect(()=>{R(K=>Ul(x,K));},[x]),to.useEffect(()=>{O(K=>mm(x,T,K));},[T,x]);let z=to.useCallback(K=>{f(co(K,p));},[p]),H=to.useCallback(K=>{b(co(K,p));},[p]),X=to.useCallback(K=>{g(co(K,p));},[p]),Y=to.useCallback(K=>{v(Ne=>{let Se=K??[],Fe=new Set,it=[];return Se.forEach(Ye=>{if(!p.has(Ye.fieldId)||Fe.has(Ye.fieldId))return;Fe.add(Ye.fieldId);let wt=Ne.find(Mt=>Mt.fieldId===Ye.fieldId);if(wt){it.push({...wt,aggregation:xo(Ye.aggregation??wt.aggregation,m.get(Ye.fieldId))});return}d.current+=1,it.push({tokenId:`v${d.current}`,fieldId:Ye.fieldId,aggregation:xo(Ye.aggregation,m.get(Ye.fieldId))});}),it});},[m,p]),j=to.useCallback(K=>{z(K.rows??[]),H(K.columns??[]),X(K.filters??[]),Y(K.values??[]);},[H,X,z,Y]),te=to.useCallback(K=>{if(K==="rows")return f([]);if(K==="columns")return b([]);if(K==="filters")return g([]);v([]);},[]),ce=to.useCallback((K,Ne)=>{if(K==="rows")return f(Se=>Se.filter(Fe=>Fe!==Ne));if(K==="columns")return b(Se=>Se.filter(Fe=>Fe!==Ne));if(K==="filters")return g(Se=>Se.filter(Fe=>Fe!==Ne));v(Se=>Se.filter(Fe=>Fe.tokenId!==Ne));},[]),fe=to.useCallback((K,Ne)=>{v(Se=>Se.map(Fe=>Fe.tokenId===K?{...Fe,aggregation:xo(Ne,m.get(Fe.fieldId))}:Fe));},[m]),Ve=to.useCallback((K,Ne)=>{k(Se=>({...Se,[K]:Ne}));},[]),ve=to.useCallback(()=>{k({});},[]),xe=to.useCallback(()=>{P(K=>!K);},[]),He=to.useCallback(()=>{w(K=>!K);},[]),pe=to.useCallback(K=>{A(K);},[]),ye=to.useCallback(K=>{R(K);},[]),$e=to.useCallback(K=>{O(K);},[]),tt=to.useCallback(()=>{G(K=>!K);},[]),at=to.useCallback(()=>{Q(K=>!K);},[]);return {model:to.useMemo(()=>({rowFields:h,setRowFields:f,columnFields:u,setColumnFields:b,filterFields:C,setFilterFields:g,valueFields:x,setValueFields:v,filterSelections:y,setFilterSelections:k,showGrandTotal:S,setShowGrandTotal:P,isConfiguratorCollapsed:M,setIsConfiguratorCollapsed:w,chartDimensionFieldId:N,setChartDimensionFieldId:A,chartPrimaryValueFieldId:T,setChartPrimaryValueFieldId:R,chartSecondaryValueFieldId:E,setChartSecondaryValueFieldId:O,chartType:$,setChartType:ee,isChartCollapsed:F,setIsChartCollapsed:G,isTableCollapsed:W,setIsTableCollapsed:Q}),[N,T,E,$,u,C,y,F,M,W,h,S,x]),actions:{setRows:z,setColumns:H,setFilters:X,setValues:Y,setLayout:j,clearZone:te,removeFieldFromZone:ce,setAggregationForValue:fe,setFilterSelection:Ve,resetFilterSelections:ve,toggleGrandTotal:xe,toggleConfigurator:He,setChartDimension:pe,setChartPrimaryValue:ye,setChartSecondaryValue:$e,setChartType:ee,toggleChart:tt,toggleTable:at}}};var eF=({orientation:t="auto",defaultNavigationOpen:o,onNavOpenChange:r}={})=>{let n=lo(),a=xr("(orientation: portrait)"),i=xr(n.breakpoints.down("md")),s=to.useMemo(()=>t==="auto"?a||i?"portrait":"landscape":t,[i,a,t]),[l,d]=to.useState(o??s==="landscape");to.useEffect(()=>{d(o??s==="landscape");},[o,s]);let p=h=>{d(h),r?.(h);};return {resolvedOrientation:s,isPortraitViewport:a,isCompactViewport:i,navigationOpen:l,setNavigationOpen:p,toggleNavigationOpen:()=>p(!l)}};var ky=t=>{let o=Number(t||0);return Number.isFinite(o)?o:0},rF=({rows:t,rowKey:o="id",numericField:r,defaultSelectedId:n})=>{let i=t[0]?.[o],[s,l]=to.useState(n??i),d=to.useMemo(()=>t.find(u=>u[o]===s)||t[0],[o,t,s]),[p,m]=to.useState(()=>{let u=d?.[r];return u==null?"0":String(u)});return {selectedId:s,selectedRecord:d,editorValue:p,setEditorValue:m,selectRecord:u=>{let b=u[o];l(b);let C=u[r];m(C==null?"0":String(C));},applyEditorValue:u=>{if(s===void 0)return;let b=ky(p),C=t.map(g=>g[o]===s?{...g,[r]:b}:g);u(C);}}};I();var Py=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],hm=(t,o,r,n)=>{o?.(t),n&&r?.();},cF=({open:t,onClose:o,title:r="Scan barcode",subtitle:n="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:a=Py,facingMode:i="environment",manualEntry:s=true,autoCloseOnDetect:l=true,scanIntervalMs:d=600,confirmLabel:p="Use code",cancelLabel:m="Close",manualPlaceholder:h="Enter barcode manually",onDetected:f,onError:u,sx:b})=>{let C=to__namespace.default.useRef(null),g=to__namespace.default.useRef(null),x=to__namespace.default.useRef(null),v=to__namespace.default.useRef(null),[y,k]=to__namespace.default.useState("idle"),[S,P]=to__namespace.default.useState(""),[M,w]=to__namespace.default.useState(null),[N,A]=to__namespace.default.useState(null),T=to__namespace.default.useCallback(()=>{x.current!==null&&(window.clearInterval(x.current),x.current=null),g.current&&(g.current.getTracks().forEach(O=>O.stop()),g.current=null),C.current&&(C.current.srcObject=null);},[]),R=to__namespace.default.useCallback(O=>{A(O),k("error"),u?.(O);},[u]);to__namespace.default.useEffect(()=>{if(!t){T(),k("idle"),A(null),P("");return}let O=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){k("unsupported"),A("Camera access is not supported in this browser.");return}k("starting"),A(null);try{let ee=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:i}}});if(O){ee.getTracks().forEach(F=>F.stop());return}if(g.current=ee,C.current&&(C.current.srcObject=ee,await C.current.play()),!window.BarcodeDetector){k("unsupported"),A("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}v.current=new window.BarcodeDetector({formats:a}),k("ready"),x.current=window.setInterval(async()=>{if(!(!C.current||!v.current)&&!(C.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let G=(await v.current.detect(C.current)).find(Q=>Q.rawValue);if(!G?.rawValue)return;let W={rawValue:G.rawValue,format:G.format};w(W),T(),hm(W,f,o,l);}catch(F){R(F instanceof Error?F.message:"Failed to detect barcode.");}},d);}catch(ee){R(ee instanceof Error?ee.message:"Unable to start camera.");}}})(),()=>{O=true,T();}},[l,i,a,o,f,t,R,d,T]);let E=()=>{let O=S.trim();if(!O)return;let $={rawValue:O,format:"manual"};w($),hm($,f,o,l);};return c(Ot,{open:t,onClose:o,fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:900},children:r}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c(le,{spacing:2,sx:b,children:[e(L,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:n}),c(Ae,{elevation:0,sx:{position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:vt()==="dark"?"linear-gradient(180deg, color-mix(in oklch, var(--orb-canvas) 92%, transparent), color-mix(in oklch, var(--orb-canvas) 96%, transparent))":"linear-gradient(180deg, var(--orb-surface), color-mix(in oklch, var(--orb-border) 92%, transparent))"},children:[e("video",{ref:C,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),e("div",{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:e("div",{sx:{width:"72%",maxWidth:320,aspectRatio:"1.7 / 1",borderRadius:3,border:"2px solid rgba(255,255,255,0.95)",boxShadow:"0 0 0 999px rgba(15,23,42,0.24)",position:"relative"},children:e("div",{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"var(--orb-ai-accent)",boxShadow:"0 0 18px color-mix(in oklch, var(--orb-ai-accent) 85%, transparent)"}})})}),c("div",{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[e(xt,{icon:e(op,{}),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"}),M?e(xt,{icon:e(Cp,{}),label:`${M.format||"barcode"}: ${M.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),N?e(er,{severity:y==="unsupported"?"info":"warning",children:N}):null,s?c(le,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[e(ze,{fullWidth:true,label:"Barcode",placeholder:h,value:S,onChange:O=>P(O.target.value)}),e(Te,{variant:"contained",onClick:E,sx:{minHeight:56,px:2.5},children:p})]}):null]})}),e("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:e(Te,{onClick:o,children:m})})]})};I();var Ty={default:"var(--orb-status-fg)",primary:"var(--orb-status-primary)",success:"var(--orb-status-success)",warning:"var(--orb-status-warning)",error:"var(--orb-status-error)",info:"var(--orb-status-info)"},fF=({title:t,description:o,kicker:r,icon:n,badges:a=[],metrics:i=[],footer:s,children:l,selected:d=false,draggable:p=false,isDragging:m=false,swipeThreshold:h=88,startAction:f,endAction:u,dragHandleProps:b,onClick:C,onSwipe:g,sx:x})=>{let[v,y]=to.useState(0),[k,S]=to.useState(false),P=to.useRef(null),M=to.useRef(0),w=to.useRef(0),N=!!(f||u),A=132,T=()=>{y(0),S(false),P.current=null,M.current=0,w.current=0;},R=F=>{(F==="start"?f:u)?.onTrigger?.(),g?.(F),T();},E=F=>{!N||F.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(P.current=F.pointerId,M.current=F.clientX,w.current=F.clientX,S(true),F.currentTarget.setPointerCapture(F.pointerId));},O=F=>{if(!k||P.current!==F.pointerId)return;w.current=F.clientX;let G=w.current-M.current,W=Math.max(-A,Math.min(A,G));y(W);},$=F=>{if(!k||P.current!==F.pointerId)return;let G=w.current-M.current;if(G>=h&&f){R("start");return}if(G<=-h&&u){R("end");return}Math.abs(G)<12&&C?.(),T();},ee=(F,G)=>{if(!F)return null;let W=F.backgroundColor||Ty[F.tone||"default"];return e("div",{sx:{position:"absolute",top:0,bottom:0,[G]:0,width:A,px:2,display:"flex",alignItems:"center",justifyContent:G==="left"?"flex-start":"flex-end",color:"var(--orb-on-primary)",background:`linear-gradient(135deg, ${W}, rgba(15,23,42,0.92))`},children:c(le,{direction:"row",spacing:1,alignItems:"center",children:[F.icon,e(L,{sx:{fontWeight:700,fontSize:"0.95rem"},children:F.label})]})})};return c("div",{sx:{position:"relative",overflow:"hidden",borderRadius:4,...x},children:[ee(f,"left"),ee(u,"right"),e(Ae,{elevation:0,onPointerDown:E,onPointerMove:O,onPointerUp:$,onPointerCancel:T,sx:{position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:vt()==="dark"?"linear-gradient(180deg, color-mix(in oklch, var(--orb-surface-3) 96%, transparent), color-mix(in oklch, var(--orb-canvas) 92%, transparent))":"linear-gradient(180deg, var(--orb-canvas), var(--orb-surface))",color:"text.primary",boxShadow:d?"0 18px 42px color-mix(in oklch, var(--orb-primary) 18%, transparent)":"0 12px 28px rgba(15, 23, 42, 0.08)",transform:`translate3d(${v}px, 0, 0) scale(${m?.985:1})`,transition:k?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:C?"pointer":"default",opacity:m?.9:1},children:c(le,{spacing:1.5,children:[c(le,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[n?e("div",{sx:{mt:.25},children:n}):null,c("div",{sx:{flex:1,minWidth:0},children:[r?e(L,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:r}):null,e(L,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:t}),o?e(L,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:o}):null]}),p?e("div",{"data-no-swipe":"true",...b,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:e(se,{size:"small",children:e(cp,{})})}):null]}),a.length>0?e(le,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((F,G)=>e(xt,{label:F,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},G))}):null,i.length>0?e("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:i.map(F=>c(Ae,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[e(L,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:F.label}),e(L,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:F.value})]},F.id))}):null,l,s]})})]})};I();var ba=({label:t,onPress:o,emphasis:r="default"})=>e("div",{component:"button",type:"button",onClick:o,sx:n=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:r==="primary"?"primary.main":"divider",background:r==="primary"?n.palette.primary.main:r==="danger"?vt()==="dark"?"color-mix(in oklch, var(--orb-status-error) 18%, transparent)":"color-mix(in oklch, var(--orb-status-error) 10%, transparent)":vt()==="dark"?"rgba(255,255,255,0.04)":"var(--orb-canvas)",color:r==="primary"?"var(--orb-on-primary)":"text.primary",fontSize:"1.25rem",fontWeight:800,transition:"transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent","&:active":{transform:"scale(0.98)"}}),children:t}),kF=({value:t,defaultValue:o="",title:r,subtitle:n,placeholder:a="0",allowDecimal:i=false,allowNegative:s=false,maxLength:l,confirmLabel:d,clearLabel:p,backspaceLabel:m,onChange:h,onSubmit:f,onClose:u,sx:b})=>{let{t:C}=de(),[g,x]=to.useState(o),v=t??g,y=T=>{t===void 0&&x(T),h?.(T);},k=T=>{l&&v.length>=l||y(`${v}${T}`);},S=T=>{if(T==="00"){if(!v){y("0");return}k("00");return}k(T);},P=()=>{!i||v.includes(".")||y(v?`${v}.`:"0.");},M=()=>{if(s){if(v.startsWith("-")){y(v.slice(1));return}y(v?`-${v}`:"-");}},w=()=>{y(v.slice(0,-1));},N=()=>{y("");},A=()=>{f?.(v);};return e(Ae,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...b},children:c(le,{spacing:2,children:[c(le,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[c("div",{sx:{minWidth:0},children:[r?e(L,{sx:{fontSize:"1rem",fontWeight:800},children:r}):null,n?e(L,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:n}):null]}),u?e(se,{onClick:u,size:"small",children:e(sp,{})}):null]}),e(Ae,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:e(L,{sx:{minHeight:38,fontSize:v?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:v?"text.primary":"text.disabled"},children:v||a})}),c("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(T=>e(ba,{label:T,onPress:()=>S(T)},T)),e(ba,{label:s?"+/-":"00",onPress:s?M:()=>S("00")}),e(ba,{label:"0",onPress:()=>S("0")}),e(ba,{label:i?".":m?String(m):"DEL",onPress:i?P:w})]}),c("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[e("div",{component:"button",type:"button",onClick:w,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:c(le,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[e(tp,{}),e(L,{sx:{fontWeight:700},children:m||"DEL"})]})}),e(ba,{label:String(p||"CLR"),onPress:N,emphasis:"danger"}),e("div",{component:"button",type:"button",onClick:A,sx:T=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:T.palette.primary.main,color:"var(--orb-on-primary)",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:c(le,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[e(np,{}),e(L,{sx:{fontWeight:800},children:d||C("common.ok")})]})})]})]})})};I();var bm=({touchMode:t="comfortable",sx:o,...r})=>{let n=t==="expanded";return e("div",{sx:{"& .orb-card":{borderRadius:4},"& .orb-autocomplete":{minWidth:{xs:"100%",md:260}},"& .orb-autocomplete .orb-inp-adornment-wrap, & .orb-inp":{backgroundColor:"transparent !important"},"& .orb-inp-adornment-wrap, & .orb-inp":{minHeight:n?56:50,borderRadius:3,fontSize:n?"0.98rem":"0.92rem"},"& .orb-inp":{py:n?1.6:1.25,fontSize:n?"0.98rem":"0.92rem"},"& label":{fontSize:n?"0.95rem":"0.88rem"},"& .orb-btn":{minHeight:n?48:44,px:n?2.25:1.75,borderRadius:3,fontSize:n?"0.95rem":"0.88rem",fontWeight:700},"& .orb-icon-btn":{width:n?40:36,height:n?40:36},"& .orb-menu-item, & option":{minHeight:n?44:38,fontSize:n?"0.95rem":"0.88rem"},"& .orb-list-subheader":{py:1},"& .orb-chk":{p:n?1:.75},"& .orb-form-control-label > span":{fontSize:n?"0.95rem":"0.88rem"},"& .orb-dialog":{borderRadius:4},"& .orb-dialog-title":{fontSize:n?"1.05rem":"0.98rem",fontWeight:800},"& .orb-dialog-content .orb-inp-adornment-wrap, & .orb-inp":{minHeight:52},"& .orb-grid > *":{minWidth:0},...o},children:e(Go,{...r})})};I();var Dy=(t,o,r)=>{if(r?.(o),!!o.href){if(o.href.startsWith("http://")||o.href.startsWith("https://")){window.open(o.href,"_blank");return}t.push(o.href);}},vm=({items:t,selectedId:o,orientation:r="auto",onItemSelect:n,sx:a})=>{let i=lo(),[s,l]=to.useState(false);to.useEffect(()=>{l(true);},[]);let d=xr("(orientation: portrait)"),p=xr(i.breakpoints.down("md")),m=r==="auto"?d||p?"portrait":"landscape":r,h=navigation.useRouter();return e("div",{sx:{display:"grid",gridTemplateColumns:!s||m==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...a},children:t.map(f=>{let u=f.id===o,b=f.color||(u?i.palette.primary.main:i.palette.divider);return e(Ae,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:u?"primary.main":"divider",boxShadow:u?"0 18px 40px color-mix(in oklch, var(--orb-primary) 16%, transparent)":"none",bgcolor:vt()==="dark"?"color-mix(in oklch, var(--orb-surface-3) 60%, transparent)":"background.paper"},children:e("div",{component:"button",type:"button",disabled:f.disabled,onClick:()=>Dy(h,f,n),sx:{width:"100%",p:2,minHeight:m==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:f.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:c(le,{spacing:1.5,sx:{height:"100%"},children:[c(le,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[e("div",{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:u?"var(--orb-on-primary)":"text.primary",background:u?b:"action.hover"},children:f.icon||e(L,{sx:{fontSize:"1rem",fontWeight:900},children:f.title.slice(0,1).toUpperCase()})}),f.badge!==void 0?e("div",{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:u?"primary.main":"action.hover",color:u?"var(--orb-on-primary)":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:f.badge}):null]}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:f.title}),f.caption?e(L,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:f.caption}):null,f.description?e(L,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:f.description}):null]})]})})},f.id)})})};I();var xm=(t,o)=>o.trim()?t.reduce((r,n)=>{let a=n.title?.toLowerCase().includes(o.toLowerCase())||n.label?.toLowerCase().includes(o.toLowerCase())||n.description?.toLowerCase().includes(o.toLowerCase()),i=n.children?xm(n.children,o):[];return (a||i.length>0)&&r.push({...n,children:i.length>0?i:n.children}),r},[]):t,Oy=t=>{let o=new Set,r=n=>{n.forEach(a=>{a.children?.length&&(o.add(a.id),r(a.children));});};return r(t),o},wm=({collapsed:t=false,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",orientation:s="auto",headerSlot:l,footerSlot:d,activeHref:p,onItemSelect:m})=>{let{t:h}=de(),f=lo(),u=Ao("(orientation: portrait)"),b=Ao(f.breakpoints.down("md")),C=s==="auto"?u||b?"portrait":"landscape":s,g=i==="dark",x=navigation.useRouter(),v=navigation.usePathname(),[y,k]=to.useState(""),[S,P]=to.useState(new Set),M=to.useMemo(()=>xm(a,y),[a,y]),w=to.useMemo(()=>y.trim()?Oy(M):S,[S,M,y]);to.useEffect(()=>{t&&P(new Set);},[t]);let N=O=>O.appurl||O.href||"",A=O=>{m?.(O);let $=N(O);if($){if($.startsWith("http://")||$.startsWith("https://")){window.open($,"_blank");return}x.push($);}},T=O=>{let $=!!O.children?.length;if(t&&$){o?.();return}if($){P(ee=>{let F=new Set(ee);return F.has(O.id)?F.delete(O.id):F.add(O.id),F});return}A(O);},R=O=>{let $=p||v,ee=N(O);return !!(ee&&$===ee)},E=(O,$=0)=>{let ee=!!O.children?.length,F=w.has(O.id),G=R(O);return e("div",{sx:{pl:$===0?0:1.5},children:c(Ae,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:G?"primary.main":"divider",bgcolor:G?"action.selected":"background.paper"},children:[c("div",{component:"button",type:"button",onClick:()=>T(O),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:[e(ai,{variant:"rounded",sx:{width:40,height:40,bgcolor:G?"primary.main":"action.hover",color:G?"var(--orb-on-primary)":"text.primary"},children:O.icon||(O.title||O.label||"?").slice(0,1).toUpperCase()}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:O.title||O.label}),O.description?e(L,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:O.description}):null]}),ee?e(an,{sx:{transform:F?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):e(ci,{color:"action"})]}),ee?e(nn,{in:F,children:e("div",{sx:{px:1.25,pb:1.25},children:O.children?.map(W=>E(W,$+1))})}):null]})},O.id)};return t?e(Ae,{elevation:0,className:r,sx:{width:C==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:g?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflowY:"auto"},children:c(le,{spacing:1,children:[e(se,{onClick:o,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:h("navigation.expand"),children:e(hi,{})}),a.map(O=>e(se,{onClick:()=>T(O),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:R(O)?"primary.main":"action.hover",color:R(O)?"var(--orb-on-primary)":"text.primary"},children:O.icon||(O.title||O.label||"?").slice(0,1).toUpperCase()},O.id))]})}):e(Ae,{elevation:0,className:r,sx:{width:C==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:g?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflow:"hidden",display:"flex",flexDirection:"column"},children:c(le,{spacing:1.25,sx:{flex:1,minHeight:0},children:[c(le,{direction:"row",spacing:1,alignItems:"center",children:[e(ze,{value:y,onChange:O=>k(O.target.value),placeholder:h("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:e(xp,{fontSize:"small",color:"action"})}}),C==="landscape"&&!t?e(se,{onClick:o,sx:{bgcolor:"action.hover"},children:e(fp,{})}):null]}),l,e("div",{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:M.length>0?M.map(O=>E(O)):e(L,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:h("navigation.noMatch")})}),d]})})};I();var Sm=(t,o)=>{let r=o[t.id];if(t.render)return t.render(r,o);if(r==null||r==="")return "--";if(t.numeric){if(typeof r=="number")return r.toLocaleString();if(typeof r=="string"&&r.trim()!==""&&!Number.isNaN(Number(r)))return Number(r).toLocaleString()}return String(r)},Fy=t=>to__namespace.default.isValidElement(t)?e("div",{sx:{display:"inline-flex",alignItems:"center"},children:t}):e(L,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:t}),By=(t,o)=>{let r=o[t.id];if(r==null||r==="")return "--";if(t.numeric){if(typeof r=="number")return r.toLocaleString();if(typeof r=="string"&&r.trim()!==""&&!Number.isNaN(Number(r)))return Number(r).toLocaleString()}return String(r)},Hy=({summaryRow:t,visibleColumns:o,columns:r})=>{let n=r.filter(a=>o.includes(a.id)&&t[a.id]!=="");return n.length===0?null:e(Ae,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:c(le,{spacing:1,children:[e(L,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),e("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:n.map(a=>c(Ae,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[e(L,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:a.label}),e(L,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:t[a.id]})]},`summary-${a.id}`))})]})})},zy=t=>{let{t:o}=de(),r=lo(),{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:p,fitContainer:m=false,fullWidth:h=false,maxHeight:f,loading:u=false,rowsPerPageOptions:b=[20,50,100,-1],onLayoutSave:C,filterConfig:g,rowKey:x,tableKey:v="default",graphReport:y,quickCreate:k,quickEdit:S,quickDelete:P,serviceUrl:M,orientation:w="auto",cardTitleField:N,cardSubtitleFields:A,toolbarSlot:T,emptyState:R,rowHeight:E="comfortable",cardActionSlot:O,renderCardFooter:$,onRowClick:ee}=t,F=n||o("table.title.default"),G=Ao("(orientation: portrait)"),W=Ao(r.breakpoints.down("md")),Q=w==="auto"?G||W?"portrait":"landscape":w,{columns:z,filterText:H,setFilterText:X,visibleColumns:Y,showSummary:j,setShowSummary:te,summaryColumns:ce,grouping:fe,setGrouping:Ve,expandedGroups:ve,groupAnchorEl:xe,setGroupAnchorEl:He,summaryAnchorEl:pe,setSummaryAnchorEl:ye,anchorEl:$e,setAnchorEl:tt,contextMenu:at,sortedAndFilteredRows:st,summaryRow:K,visibleRows:Ne,page:Se,setPage:Fe,rowsPerPage:it,setRowsPerPage:Ye,totalDisplayCount:wt,setSelected:Mt,handleClick:Ft,toggleSummaryColumn:Et,handleExport:ne,handleCloseContextMenu:Ke,toggleColumnVisibility:Oe,toggleGroupExpand:ue,handleExpandGroupRecursively:we,handleCollapseGroupRecursively:re,handleLayoutLoad:Ce,handleVariantLoad:De,handleLayoutSave:Je,effectiveAppId:lt,currentLayoutData:ut,currentLayoutId:Ht,layoutIdToLoad:Yt,graphReportOpen:Wt,handleOpenGraphReport:St,handleCloseGraphReport:$t}=bn(t),bt=y?.enabled??false,At=bt&&(y?.interaction?.enabled??true),ct=Li(),Bt=x||"id",jt=to__namespace.default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:ot(r.palette.divider,vt()==="dark"?.55:.3),bgcolor:vt()==="dark"?ot(r.palette.common.white,.06):ot(r.palette.background.paper,.92),color:r.palette.text.primary,"& .orb-chip-label":{px:1.05}}),[r]),q=to__namespace.default.useMemo(()=>({...jt,borderColor:ot(r.palette.primary.main,vt()==="dark"?.42:.24),bgcolor:vt()==="dark"?ot(r.palette.primary.main,.16):ot(r.palette.primary.main,.08)}),[jt,r]),V=to__namespace.default.useMemo(()=>{let oe=new Set(s);return st.filter(Le=>oe.has(Le?.[Bt]))},[Bt,s,st]),Z=V.length===1?V[0]:null,be=!!k?.enabled,ke=!!S?.enabled,Ee=!!P?.enabled,_e=k?.fields,qe=k?.excludeFields||[],je=k?.initialValues||{},mt=S?.fields,ht=S?.excludeFields||[],Rt=S?.editableFields||[],yt=S?.nonEditableFields||[],B=S?.primaryKeys?.length?S.primaryKeys:[Bt],[J,he]=to__namespace.default.useState(false),[Ie,et]=to__namespace.default.useState(false),[Xe,kt]=to__namespace.default.useState({}),[ft,gt]=to__namespace.default.useState(false),[Ct,ao]=to__namespace.default.useState(false),[Lt,Qt]=to__namespace.default.useState({}),[zt,qt]=to__namespace.default.useState(false),[_t,ro]=to__namespace.default.useState(false),io=u||Ie||Ct||_t,vo=to__namespace.default.useMemo(()=>{let oe=[...z];if(Array.isArray(_e)&&_e.length>0){let Le=new Set(_e);oe=oe.filter(Qe=>Le.has(Qe.id));}if(qe.length>0){let Le=new Set(qe);oe=oe.filter(Qe=>!Le.has(Qe.id));}return oe.filter(Le=>!!Le?.id)},[z,qe,_e]),Ro=to__namespace.default.useMemo(()=>{let oe=[...z];if(Array.isArray(mt)&&mt.length>0){let Le=new Set(mt);oe=oe.filter(Qe=>Le.has(Qe.id));}if(ht.length>0){let Le=new Set(ht);oe=oe.filter(Qe=>!Le.has(Qe.id));}return oe.filter(Le=>!!Le?.id)},[z,ht,mt]),No=to__namespace.default.useMemo(()=>new Set(B),[B]),ir=to__namespace.default.useMemo(()=>new Set(Rt),[Rt]),wo=to__namespace.default.useMemo(()=>new Set(yt),[yt]),Ho=to__namespace.default.useCallback(oe=>ir.size>0?ir.has(oe):!(wo.has(oe)||No.has(oe)),[ir,wo,No]);to__namespace.default.useEffect(()=>{!Wt&&ct.hasActiveFilters&&ct.clearAll();},[ct,Wt]);let qr=()=>{let oe={};vo.forEach(Le=>{oe[Le.id]=je[Le.id]??"";}),kt(oe),he(true);},Xr=(oe,Le)=>{kt(Qe=>({...Qe,[oe]:Le}));},Lr=async()=>{if(!k?.onSubmit){he(false);return}try{et(!0),await k.onSubmit(Xe),he(!1);}finally{et(false);}},Zr=()=>{if(!Z)return;let oe={};Ro.forEach(Qe=>{oe[Qe.id]=Z[Qe.id]??"";});let Le=S?.getInitialValues?{...oe,...S.getInitialValues(Z)}:oe;Qt(Le),gt(true);},Yr=(oe,Le)=>{Qt(Qe=>({...Qe,[oe]:Le}));},Do=async()=>{if(Z){if(!S?.onSubmit){gt(false);return}try{ao(!0),await S.onSubmit(Lt,Z),gt(!1);}finally{ao(false);}}},Or=()=>{V.length!==0&&qt(true);},jr=async()=>{if(V.length===0){qt(false);return}if(!P?.onConfirm){qt(false),Mt([]),l?.([]);return}try{ro(!0),await P.onConfirm(V),qt(!1),Mt([]),l?.([]);}finally{ro(false);}},Yo=st,{fieldMapping:sr}=mn({rows:Yo,config:{...y,title:y?.title||`${F} ${o("graph.reportTitle")}`}}),Fn=to__namespace.default.useMemo(()=>At?ct.applyRows(Yo,sr):Yo,[sr,ct,At,Yo]),{model:Fr}=mn({rows:Fn,config:{...y,title:y?.title||`${F} ${o("graph.reportTitle")}`,fieldMapping:sr}}),D=Fr.table.columns.map(oe=>({id:oe.id,label:oe.label,align:oe.align||"left",minWidth:120,numeric:oe.align==="right"})),_=lt?e(fn,{appId:lt,tableKey:v,currentLayoutData:ut,onLayoutLoad:Ce,targetLayoutId:Yt,activeLayoutId:Ht,serviceUrl:M??g?.serviceUrl}):null,U=z.filter(oe=>Y.includes(oe.id)),me=U.find(oe=>oe.id===N)||U[0],Be=A?.map(oe=>U.find(Le=>Le.id===oe)).filter(Boolean)||U.filter(oe=>oe.id!==me?.id).slice(0,Q==="portrait"?2:3),nt=U.filter(oe=>oe.id!==me?.id&&!Be.some(Le=>Le.id===oe.id)),Ge=[T,p].filter(Boolean),ae=c(jsxRuntime.Fragment,{children:[e(pn,{groupAnchorEl:xe,setGroupAnchorEl:He,grouping:fe,setGrouping:Ve,columns:z}),e(un,{anchorEl:$e,setAnchorEl:tt,columns:z,visibleColumns:Y,toggleColumnVisibility:Oe}),e(Ti,{anchorEl:pe,setAnchorEl:ye,showSummary:j,setShowSummary:te,columns:z,summaryColumns:ce,toggleSummaryColumn:Et}),e(Ii,{contextMenu:at,handleCloseContextMenu:Ke,columns:z,visibleColumns:Y,toggleColumnVisibility:Oe})]}),ge=(oe,Le,Qe)=>{let Re=s.includes(Le),Ze=Q==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",Pt=Qe%2===0?ot(r.palette.primary.main,vt()==="dark"?.09:.04):ot(r.palette.primary.main,vt()==="dark"?.05:.022),Qr=ot(r.palette.divider,.22);return e(Ae,{elevation:0,onClick:()=>{Ft({},oe),ee?.(oe);},sx:{p:E==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Re?ot(r.palette.primary.main,.38):Qr,background:Re?`linear-gradient(135deg, ${ot(r.palette.primary.main,.13)}, ${ot(r.palette.primary.main,.06)})`:`linear-gradient(135deg, ${Pt}, ${ot(r.palette.primary.main,.015)})`,boxShadow:Re?`0 12px 30px ${ot(r.palette.primary.main,.2)}`:`0 3px 10px ${ot(r.palette.common.black,.045)}`,cursor:"pointer",position:"relative",overflow:"hidden",transition:"border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease, background 160ms ease","&::before":{content:'""',position:"absolute",left:0,top:0,bottom:0,width:4,background:Re?r.palette.primary.main:Qe%2===0?ot(r.palette.primary.main,.26):ot(r.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${ot(r.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:c(le,{spacing:1.25,children:[c(le,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[i?e(It,{checked:Re,onClick:ko=>ko.stopPropagation(),onChange:()=>Ft({},oe),sx:{mt:-0.6,ml:-0.6}}):null,c("div",{sx:{flex:1,minWidth:0},children:[me?e(L,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:Sm(me,oe)}):null,Be.length>0?e(le,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Be.map(ko=>e(xt,{label:`${ko.label}: ${By(ko,oe)}`,size:"small",variant:"outlined",sx:jt},`${Le}-${ko.id}`))}):null]}),O?e("div",{onClick:ko=>ko.stopPropagation(),children:O(oe)}):null]}),nt.length>0?e("div",{sx:{display:"grid",gridTemplateColumns:Ze,gap:1},children:nt.map(ko=>c(Ae,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:vt()==="dark"?ot(r.palette.background.default,.7):ot(r.palette.background.paper,.92),border:"0.1px solid",borderColor:ot(r.palette.divider,.24)},children:[e(L,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:ko.label}),Fy(Sm(ko,oe))]},`${Le}-${ko.id}-detail`))}):null,$?c(jsxRuntime.Fragment,{children:[e(Nt,{}),e("div",{onClick:ko=>ko.stopPropagation(),children:$(oe)})]}):null]})},Le)};return c("div",{sx:{width:h?"100%":"auto",mb:m?0:2,...m?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g?e("div",{sx:{mb:2},children:e(bm,{...g,onVariantLoad:oe=>{De(oe),g.onVariantLoad?.(oe);},appId:g.appId,tableKey:v,currentLayout:[{tableKey:v,layoutData:ut}],currentLayoutId:Ht,layoutRefs:[{tableKey:v,layoutId:Ht}],variantService:g.variantService,serviceUrl:M??g.serviceUrl,touchMode:Q==="portrait"?"expanded":"comfortable"})}):null,c(Ae,{sx:{width:h?"100%":"auto",mb:m?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":io?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, color-mix(in oklch, var(--orb-primary) 0%, transparent) 0%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 25%, var(--orb-primary) 50%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 75%, color-mix(in oklch, var(--orb-primary) 0%, transparent) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...f?{height:f}:m?{flex:1,minHeight:0,height:"100%"}:{}},children:[a?e("div",{sx:{"& .orb-toolbar":{minHeight:60,alignItems:{xs:"flex-start",md:"center"},flexWrap:"wrap",rowGap:1,columnGap:1},"& .orb-toolbar > :nth-of-type(1)":{width:{xs:"100%",md:"auto"},"& .orb-fld":{width:{xs:"100%",md:300}}},"& .orb-toolbar > :nth-of-type(2)":{flexShrink:0},"& .orb-toolbar > :nth-of-type(3)":{display:{xs:"none",md:"block"}},"& .orb-toolbar > :nth-of-type(4)":{ml:"auto",justifyContent:"flex-end",flexWrap:"wrap"},"& .orb-inp-adornment-wrap, & .orb-inp":{minHeight:46},"& .orb-icon-btn":{width:40,height:40},"& .orb-body, & .orb-body-dense, & .orb-label, & .orb-meta":{fontSize:"0.9rem"},"& button":{borderRadius:2.5}},children:e(wi,{filterText:H,setFilterText:X,onRowsPerPageChange:Ye,rowsPerPage:it,rowsPerPageOptions:b,page:Se,count:wt,onPageChange:Fe,actions:d,extraTools:Ge,grouping:fe,setGroupAnchorEl:He,showSummary:j,setShowSummary:te,setAnchorEl:tt,setSummaryAnchorEl:ye,handleExport:ne,showCreateButton:be,onOpenCreateDialog:qr,showEditButton:ke,onOpenEditDialog:Zr,editDisabled:V.length!==1,showDeleteButton:Ee,onOpenDeleteConfirm:Or,deleteDisabled:V.length===0,onLayoutSave:C||g?.variantService&&g?.appId?Je:void 0,loading:u,layoutManager:_,onOpenGraphReport:bt?St:void 0})}):null,e("div",{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:c(le,{spacing:1.25,children:[Ne.length===0&&!u?R||e(Ae,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:e(L,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:o("common.noData")})}):null,Ne.map((oe,Le)=>{if(oe.type==="group"){let Ze=ve.has(oe.id);return e(Ae,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:c("div",{component:"button",type:"button",onClick:()=>ue(oe.id),sx:{width:"100%",px:1.5,py:1.3,border:0,background:"transparent",display:"flex",alignItems:"center",gap:1,textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",color:"text.primary"},children:[Ze?e(an,{}):e(ci,{}),c("div",{sx:{flex:1,minWidth:0},children:[c(L,{sx:{fontSize:"0.94rem",fontWeight:800},children:[oe.field,": ",oe.value]}),c(L,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[oe.count," records"]})]}),fe.length>1&&oe.level<fe.length-1?c(le,{direction:"row",spacing:.5,children:[e(xt,{size:"small",label:o("table.group.expandAll"),onClick:Pt=>{Pt.stopPropagation(),we(oe.id);},sx:q}),e(xt,{size:"small",label:o("table.group.collapseAll"),onClick:Pt=>{Pt.stopPropagation(),re(oe.id);},sx:q})]}):null]})},oe.id)}let Qe=oe.data||oe,Re=oe.id||Qe[Bt]||Le;return ge(Qe,Re,Le)}),j?e(Hy,{summaryRow:K,visibleColumns:Y,columns:z}):null,u?e(L,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:o("common.loading")}):null]})})]}),be?c(Ot,{open:J,onClose:()=>!Ie&&he(false),fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:k?.title||o("quickCreate.createWithTitle",{title:F})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[vo.map(oe=>{let Le=oe.type==="number"||oe.numeric?"number":oe.type==="date"?"date":"text";return e(ze,{label:oe.label||oe.id,value:Xe[oe.id]??"",onChange:Qe=>Xr(oe.id,Qe.target.value),type:Le,fullWidth:true,InputLabelProps:{shrink:Le==="date"?true:void 0}},`quick-create-${oe.id}`)}),k?.description?e(er,{severity:"info",children:k.description}):null]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(Te,{onClick:()=>he(false),disabled:Ie,children:k?.cancelLabel||o("common.cancel")}),e(Te,{onClick:Lr,variant:"contained",disabled:Ie,children:k?.submitLabel||o("common.save")})]})]}):null,ke?c(Ot,{open:ft,onClose:()=>!Ct&&gt(false),fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:S?.title||o("quickEdit.editWithTitle",{title:F})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Ro.map(oe=>{let Le=oe.type==="number"||oe.numeric?"number":oe.type==="date"?"date":"text";return e(ze,{label:oe.label||oe.id,value:Lt[oe.id]??"",onChange:Qe=>Yr(oe.id,Qe.target.value),type:Le,disabled:!Ho(oe.id),fullWidth:true,InputLabelProps:{shrink:Le==="date"?true:void 0}},`quick-edit-${oe.id}`)}),S?.description?e(er,{severity:"info",children:S.description}):null]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(Te,{onClick:()=>gt(false),disabled:Ct,children:S?.cancelLabel||o("common.cancel")}),e(Te,{onClick:Do,variant:"contained",disabled:Ct||!Z,children:S?.submitLabel||o("common.save")})]})]}):null,Ee?e(ea,{open:zt,type:"warning",title:P?.title||o("quickDelete.confirmTitle"),message:P?.message||(V.length>1?o("quickDelete.confirmMessageMultiple",{count:V.length}):o("quickDelete.confirmMessageSingle")),confirmText:P?.confirmText||o("common.delete"),cancelText:P?.cancelText||o("common.cancel"),onClose:()=>!_t&&qt(false),onConfirm:jr}):null,ae,bt?e(Ai,{open:Wt,onClose:$t,model:Fr,aiAssistant:y?.aiAssistant,interaction:At?{enabled:true,filters:ct.filters,fieldMapping:sr,onPrimaryDimensionClick:oe=>ct.setFilter("primaryDimension",oe),onSecondaryDimensionClick:oe=>ct.setFilter("secondaryDimension",oe),onStatusClick:oe=>ct.setFilter("status",oe),onClearFilter:ct.clearFilter,onClearAll:ct.clearAll}:void 0,tableContent:e(zy,{appId:lt||"graph-report-internal",title:o("graph.dataBody"),columns:D,rows:Fr.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};I();var v2=({appTitle:t,children:o,menuData:r=[],workloadItems:n=[],workloadSelectedId:a,showNavigation:i=true,showWorkloadNav:s=true,orientation:l="auto",logo:d,headerSlot:p,actionSlot:m,portraitBottomSlot:h,contentSx:f,containerSx:u,user:b,onSearch:C,onSearchAdd:g,defaultNavigationOpen:x,navOpen:v,onNavOpenChange:y,onWorkloadSelect:k,locale:S="en",localeLabel:P,localeOptions:M,onLocaleChange:w,onUserSetting:N,onUserLogout:A,userMenuItems:T,leftHeaderSlot:R,rightHeaderSlot:E})=>{let O="orbcafe:page-layout-mode",[$,ee]=to.useState("system"),[F,G]=to.useState("light"),[W,Q]=to.useState(false),[z,H]=to.useState(false),X=$==="system"?z?F:"light":$;to.useEffect(()=>{Q(true);},[]),to.useEffect(()=>{try{let at=window.localStorage.getItem(O);(at==="light"||at==="dark"||at==="system")&&ee(at);}catch{}H(true);let $e=window.matchMedia("(prefers-color-scheme: dark)"),tt=()=>{G($e.matches?"dark":"light");};return tt(),$e.addEventListener("change",tt),()=>$e.removeEventListener("change",tt)},[]),to.useEffect(()=>{if(z)try{window.localStorage.setItem(O,$);}catch{}},[z,$]),to.useEffect(()=>{X==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.classList.add("orb-dark"),document.documentElement.dataset.orbMode="dark",document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.classList.remove("orb-dark"),document.documentElement.dataset.orbMode="light",document.documentElement.style.colorScheme="light");},[X]);let Y=Ao("(orientation: portrait)"),j=Ao("(max-width: 899.95px)"),te=l==="auto"?!W||Y||j?"portrait":"landscape":l,[ce,fe]=to.useState({landscape:x??true,portrait:false}),Ve=ce[te],ve=v??Ve,xe=$e=>{v===void 0&&fe(tt=>({...tt,[te]:$e})),y?.($e);},He=c(le,{direction:"row",spacing:1,alignItems:"center",children:[!W||i&&te==="portrait"?e(se,{onClick:()=>xe(!ve),sx:{bgcolor:"action.hover"},children:e(hi,{})}):null,R]}),pe=c(le,{direction:"row",spacing:1,alignItems:"center",children:[m,E]}),ye=e(wm,{collapsed:te==="landscape"?!ve:false,onToggle:()=>xe(!ve),menuData:r,orientation:te,colorMode:X,maxHeight:te==="landscape"?900:void 0});return e(Hn,{mode:$,children:e(ja,{locale:S,children:c("div",{sx:[$e=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:$e.palette.mode==="dark"?"linear-gradient(180deg, var(--orb-canvas) 0%, var(--orb-surface) 55%, var(--orb-surface-2) 100%)":$e.palette.background.default}),...Array.isArray(u)?u:[u]],children:[e(Zi,{appTitle:t,logo:d===void 0?null:d,mode:$,onToggleMode:()=>ee($e=>$e==="system"?"dark":$e==="dark"?"light":"system"),locale:S,localeLabel:P,localeOptions:M,onLocaleChange:w,user:b,onUserSetting:N,onUserLogout:A,userMenuItems:T,onSearch:C,onSearchAdd:g,leftSlot:He,rightSlot:pe}),p?e("div",{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:p}):null,c("div",{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[W&&i&&te==="landscape"?e("div",{sx:{p:1.5,pr:0,flexShrink:0},children:ye}):null,!W||i&&te==="portrait"?e(Kd,{open:ve,onClose:()=>xe(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:ye}):null,e("div",{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...f},children:c(le,{spacing:1.5,children:[s&&n.length>0?e(vm,{items:n,selectedId:a,orientation:te,onItemSelect:k}):null,e(Ae,{elevation:0,sx:{flex:1,minHeight:te==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:"color-mix(in oklch, var(--orb-canvas) 72%, transparent)",backdropFilter:"blur(12px)",color:"text.primary"},children:o})]})})]}),te==="portrait"&&h?c(jsxRuntime.Fragment,{children:[e(Nt,{}),e("div",{sx:{p:1.5},children:h})]}):null]})})})};I();var Im=Xy__default.default(()=>Promise.resolve().then(()=>(Tm(),Pm)).then(t=>t.COrbCanvas),{ssr:false,loading:()=>e("div",{className:"h-full w-full bg-transparent"})});function ql({isRecording:t}){return e(framerMotion.AnimatePresence,{children:t&&e(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:c("div",{className:"relative flex h-full w-full items-center justify-center",children:[e("div",{className:"absolute inset-0",children:e(Im,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),e("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:e(Im,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var T2=ql;I();var Rm=to.createContext(null);function tC(t){if(!t||!(t instanceof HTMLElement))return false;let o=t.tagName;return !!(o==="INPUT"||o==="TEXTAREA"||o==="SELECT"||t.isContentEditable||t.closest('[data-voice-hotkey-ignore="true"]'))}function oC({children:t,onVoiceSubmit:o,onVoicePartial:r,onVoiceError:n,longPressMs:a=200,disableSpaceTrigger:i=false,ignoreWhenFocusedInput:s=true,renderOverlay:l=true,wsUrl:d,silenceThresholdMs:p,minVolumeRms:m}){let[h,f]=to.useState(false),[u,b]=to.useState(false),C=to.useRef(null),g=to.useRef(false),x=to.useRef(false),v=to.useCallback(()=>{x.current=false,f(false);},[]),{isRecording:y,startRecording:k,stopRecording:S}=wn({wsUrl:d,silenceThresholdMs:p,minVolumeRms:m,onTextUpdate:N=>{r?.(N);},onComplete:async N=>{try{N.trim()&&(b(!0),await o(N.trim()));}catch(A){let T=A instanceof Error?A.message:"Failed to process voice command";n?.(T);}finally{b(!1),v();}},onError:N=>{n?.(N),b(!1),g.current||v();}}),P=to.useCallback(async()=>{x.current=false,await k();},[k]),M=to.useCallback(()=>{S();},[S]);to.useEffect(()=>{if(i)return;let N=T=>{T.isComposing||(T.code==="Space"||T.key===" ")&&(g.current||T.repeat||s&&tC(document.activeElement)||(g.current=true,T.preventDefault(),C.current=setTimeout(()=>{x.current=true,f(true),k();},a)));},A=T=>{(T.code==="Space"||T.key===" ")&&(C.current&&(clearTimeout(C.current),C.current=null),g.current=false,x.current&&(T.preventDefault(),f(false),S()));};return window.addEventListener("keydown",N),window.addEventListener("keyup",A),()=>{window.removeEventListener("keydown",N),window.removeEventListener("keyup",A),C.current&&(clearTimeout(C.current),C.current=null);}},[i,s,a,k,S]);let w=to.useMemo(()=>({isRecording:y,isHotkeyRecording:h,isSubmitting:u,startRecording:P,stopRecording:M}),[h,y,u,P,M]);return c(Rm.Provider,{value:w,children:[l?e(ql,{isRecording:h}):null,t]})}function rC(){let t=to.useContext(Rm);if(!t)throw new Error("useAINav must be used within CAINavProvider");return t}var A2=oC,E2=rC;function rt(...t){return tailwindMerge.twMerge(clsx.clsx(t))}I();var lC=({content:t,theme:o="light",size:r="base",defaultExpanded:n=false})=>{let[a,i]=to.useState(n),s=to.useMemo(()=>`${(r==="sm"?14:r==="lg"?18:16)-2}px`,[r]);return c("div",{className:`my-6 rounded-lg overflow-hidden transition-all duration-200 ${o==="dark"?"bg-[var(--orb-surface-2)]":"bg-[var(--orb-canvas)]"}`,style:{border:"0.5px solid var(--orb-border)"},children:[c("div",{className:"px-4 py-3 cursor-pointer flex items-center justify-between transition-colors duration-200 bg-[var(--orb-surface)] hover:bg-[var(--orb-hover)]",style:{borderBottom:"0.5px solid var(--orb-border)"},onClick:()=>i(!a),children:[c("span",{className:"flex items-center",children:[e(za,{className:"mr-2 h-4 w-4"}),e("span",{className:"font-medium text-[var(--orb-fg)]",style:{fontSize:r==="sm"?"14px":r==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),e(zo,{className:`w-4 h-4 transition-transform duration-200 ${a?"rotate-180":""} text-[var(--orb-muted)]`})]}),a&&e("div",{className:"p-4 whitespace-pre-wrap italic font-light text-[var(--orb-muted)]",style:{fontSize:s,lineHeight:"1.3 !important"},children:t})]})},Nm=lC;I();var mC=({content:t,language:o="text",isStreaming:r=false,className:n=""})=>{let a=fo(),[i,s]=to.useState(false),l=async()=>{try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),2e3);}catch(p){console.error("\u590D\u5236\u5931\u8D25:",p);}},d=a==="dark"?prism.oneDark:prism.oneLight;return c("div",{className:rt("rounded-lg overflow-hidden border border-[var(--orb-border)] my-4",n),children:[c("div",{className:"flex items-center justify-between px-4 py-2 bg-[var(--orb-surface)] border-b border-[var(--orb-border)]",children:[e("span",{className:"text-xs font-medium text-[var(--orb-muted)] uppercase",children:o}),e("button",{onClick:l,className:"p-1 hover:bg-[var(--orb-hover)] rounded transition-colors",disabled:r,title:i?"Copied":"Copy code",children:i?e(So,{size:14,className:"text-[var(--orb-status-success)]"}):e(Gc,{size:14,className:"text-[var(--orb-muted)]"})})]}),e("div",{className:"text-sm",children:e(reactSyntaxHighlighter.Prism,{language:o,style:d,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:a==="dark"?"var(--orb-surface-2)":"var(--orb-canvas)"},wrapLongLines:true,children:t})})]})},Dm=mC;I();var Em="orb-html-demo",Lm="orb-html-demo-ping",ds=16,bC=2,vC=2e3,yC=300,CC=96,xC=200,wC=560,SC=320,Yl=`<script>(function(){var post=function(){var body=document.body;var height=Math.ceil(document.documentElement.scrollHeight);if(body){var style=getComputedStyle(body);height=Math.ceil(Math.max(body.offsetHeight,body.scrollHeight)+parseFloat(style.marginTop||'0')+parseFloat(style.marginBottom||'0'))}parent.postMessage({source:${JSON.stringify(Em)},height:height},'*')};addEventListener('load',post);addEventListener('resize',post);addEventListener('message',function(event){if(event.data&&event.data.source===${JSON.stringify(Lm)})post()});new MutationObserver(post).observe(document.documentElement,{subtree:true,childList:true,attributes:true,characterData:true});var retries=0;var timer=setInterval(function(){post();retries+=1;if(retries>5)clearInterval(timer)},250);post()})()</script>`,kC="html,body{margin:0;padding:12px;font:14px/1.5 system-ui,sans-serif;}",PC=t=>/<html[\s>]/i.test(t),TC=t=>{let o=t.trim();return PC(o)?/<\/body>/i.test(o)?o.replace(/<\/body>/i,`${Yl}</body>`):`${o}${Yl}`:`<!DOCTYPE html><html><head><meta charset="utf-8"><style>${kC}</style></head><body>${o}${Yl}</body></html>`},IC=t=>{let o=/<title[^>]*>([^<]+)<\/title>/i.exec(t)?.[1]?.trim();return o||(/<h1[^>]*>([^<]+)<\/h1>/i.exec(t)?.[1]?.trim()??null)},MC=t=>{if(t<1024)return `${t} B`;let o=t/1024;if(o<1024)return `${o<10?o.toFixed(1):Math.round(o)} KB`;let r=o/1024;return `${r<10?r.toFixed(1):Math.round(r)} MB`},RC=t=>`${t.toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,60)||"interactive-demo"}.html`,NC=(t,o)=>{let r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=o,n.click(),window.setTimeout(()=>URL.revokeObjectURL(r),1e3);},xa=new Map,Ql="orb-html-demo-store",DC=t=>t.replace(/^\s+/,"").slice(0,CC),jl=(t,o)=>{xa.set(t,o),window.dispatchEvent(new CustomEvent(Ql));},AC=({content:t,title:o})=>{let{t:r}=de(),n=fo(),a=DC(t),[i,s]=to.useState(()=>xa.get(a)?.open??false),[l,d]=to.useState(()=>xa.get(a)?.view??"preview"),[p,m]=to.useState(false),[h,f]=to.useState(SC),u=to.useRef(null),b=to.useRef(null),C=to.useRef(false),g=to.useRef(false),x=to.useRef(t),v=R=>jl(a,{open:R,view:l}),y=R=>jl(a,{open:i,view:R}),k=()=>{g.current=true,v(false);};to.useEffect(()=>{let R=()=>{let E=xa.get(a);s(E?.open??false),d(E?.view??"preview");};return window.addEventListener(Ql,R),()=>window.removeEventListener(Ql,R)},[a]),to.useEffect(()=>{x.current!==t&&(x.current=t,xa.has(a)||jl(a,{open:true,view:"preview"}));},[t,a]);let[S,P]=to.useState(t);to.useEffect(()=>{if(t===S)return;let R=window.setTimeout(()=>P(t),yC);return ()=>window.clearTimeout(R)},[t,S]);let M=to.useMemo(()=>TC(S),[S]);to.useEffect(()=>{if(!i)return;let R=E=>{let O=E.data;!O||O.source!==Em||typeof O.height!="number"||b.current&&E.source!==b.current.contentWindow||f(Math.max(xC,Math.min(wC,Math.ceil(O.height))));};return window.addEventListener("message",R),b.current?.contentWindow?.postMessage({source:Lm},"*"),()=>window.removeEventListener("message",R)},[i]);let w=o??IC(t)??r("agentui.html.defaultTitle"),N=to.useMemo(()=>new TextEncoder().encode(t).length,[t]);to.useEffect(()=>{if(!p)return;let R=window.setTimeout(()=>m(false),vC);return ()=>window.clearTimeout(R)},[p]),to.useEffect(()=>{if(i){C.current=true;return}C.current&&(C.current=false,g.current&&(g.current=false,u.current?.focus()));},[i]);let A=()=>{navigator.clipboard.writeText(t).then(()=>m(true));},T=()=>NC(new Blob([t],{type:"text/html;charset=utf-8"}),RC(w));return i?c("section",{className:"orb-html-demo","aria-label":w,"data-view":l,children:[c("header",{className:"orb-html-demo-head",children:[e("span",{className:"orb-html-demo-glyph","aria-hidden":"true",children:"</>"}),e("span",{className:"orb-html-demo-head-title",title:w,children:w}),c("div",{className:"orb-segmented-control orb-html-demo-segment",role:"group","aria-label":r("agentui.html.toggle"),"data-has-selection":"true",style:{"--orb-segmented-count":bC,"--orb-segmented-index":l==="code"?0:1},children:[e("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),e("button",{type:"button",className:"orb-segmented-control-item orb-segmented-control-item-label","data-selected":l==="code","aria-pressed":l==="code",onClick:()=>y("code"),children:r("agentui.html.code")}),e("button",{type:"button",className:"orb-segmented-control-item orb-segmented-control-item-label","data-selected":l==="preview","aria-pressed":l==="preview",onClick:()=>y("preview"),children:r("agentui.html.preview")})]}),c("div",{className:"orb-html-demo-actions",children:[e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":r(p?"agentui.html.copied":"agentui.html.copy"),title:r(p?"agentui.html.copied":"agentui.html.copy"),onClick:A,children:p?e(So,{size:ds}):e(Eo,{size:ds})}),e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":r("agentui.html.download"),title:r("agentui.html.download"),onClick:T,children:e(Vn,{size:ds})}),e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":r("agentui.html.close"),title:r("agentui.html.close"),onClick:k,children:e(Xt,{size:ds})})]})]}),c("div",{className:"orb-html-demo-body",children:[e("iframe",{ref:b,className:"orb-html-demo-frame",title:w,sandbox:"allow-scripts",srcDoc:M,style:{height:h},hidden:l!=="preview"}),e("div",{className:"orb-html-demo-code",hidden:l!=="code",children:e(reactSyntaxHighlighter.Prism,{language:"html",style:n==="dark"?prism.oneDark:prism.oneLight,customStyle:{margin:0,padding:"16px 20px",background:"transparent",fontSize:"13px",lineHeight:"1.6"},wrapLongLines:true,children:t})})]})]}):c("button",{ref:u,type:"button",className:"orb-html-demo-card","aria-expanded":false,onClick:()=>v(true),children:[e("span",{className:"orb-html-demo-glyph","aria-hidden":"true",children:"</>"}),c("span",{className:"orb-html-demo-info",children:[e("span",{className:"orb-html-demo-title",children:w}),c("span",{className:"orb-html-demo-meta",children:["HTML \xB7 ",MC(N)]})]}),e("span",{className:"orb-html-demo-openpill",children:r("agentui.html.open")})]})},Om=AC;I();var OC=t=>{let o=/line (\d+)/i.exec(t)?.[1];return o?`Mermaid syntax error around line ${o} \u2014 expand for details`:"Mermaid syntax error \u2014 expand for details"},FC=({content:t,isLoading:o,className:r="",style:n})=>{let a=to.useRef(null),[i,s]=to.useState(false),[l,d]=to.useState(null),p=fo();return to.useEffect(()=>{let m=false,h=async()=>{if(!(!t.trim()||!a.current)){s(true),d(null);try{Bm__default.default.initialize({startOnLoad:!1,theme:p==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit",flowchart:{htmlLabels:!1}});let u=`mermaid-${Math.random().toString(36).substr(2,9)}`,b=t.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:C,bindFunctions:g}=await Bm__default.default.render(u,b);!m&&a.current&&(a.current.innerHTML=C,g?.(a.current));}catch(u){if(m)return;console.error("Mermaid render failed:",u),d(u instanceof Error?u.message:"Render failed");}finally{m||s(false);}}},f=setTimeout(()=>{h();},100);return ()=>{m=true,clearTimeout(f);}},[t,p]),c("div",{className:`mermaid-block ${r}`,style:n,children:[(o||i)&&c("div",{className:"flex items-center justify-center rounded border border-[var(--orb-border)] bg-[var(--orb-surface)] p-4 dark:bg-[var(--orb-surface-2)]",children:[e("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-b-2 border-[var(--orb-primary)]"}),e("span",{className:"text-sm text-[var(--orb-muted)]",children:"Generating Diagram..."})]}),l&&c("div",{className:"rounded border border-[color-mix(in_oklch,var(--orb-status-error)_30%,transparent)] bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)] p-3 text-sm text-[var(--orb-status-error)]",children:[e("p",{className:"font-medium",children:OC(l)}),c("details",{className:"mt-1",children:[e("summary",{className:"cursor-pointer text-xs text-[var(--orb-muted)]",children:"Details & source"}),e("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words",children:l}),e("pre",{className:"mt-2 max-h-40 overflow-auto text-xs text-[var(--orb-muted)]",children:t})]})]}),e("div",{ref:a,className:`overflow-x-auto ${o||i||l?"hidden":""}`})]})},Hm=FC;I();var BC=({title:t="\u53D1\u751F\u9519\u8BEF",content:o,errorCode:r,stack:n,icon:a,closable:i=true,onClose:s,onRetry:l,className:d="",...p})=>{let[m,h]=to.useState(false),[f,u]=to.useState(false),b=async()=>{if(l){u(true);try{await l();}catch(C){console.error("\u91CD\u8BD5\u5931\u8D25:",C);}finally{u(false);}}};return c("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${d}`,...p,children:[c("div",{className:"flex p-4 border-l-4 border-l-[var(--orb-status-error)] bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]",children:[e("div",{className:"flex-shrink-0 mr-3 text-[var(--orb-status-error)] mt-0.5",children:a||e(Ea,{className:"w-5 h-5"})}),c("div",{className:"flex-1 min-w-0",children:[c("div",{className:"flex items-center space-x-2 mb-1",children:[e("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),r&&e("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded bg-[color-mix(in_oklch,var(--orb-status-error)_14%,transparent)] text-[var(--orb-status-error)]",children:r})]}),o&&e("div",{className:"text-sm text-[var(--orb-muted)] mb-3 leading-relaxed",children:typeof o=="string"?e("p",{className:"whitespace-pre-wrap",children:o}):o}),(l||n)&&c("div",{className:"flex items-center space-x-4 mt-2",children:[l&&c("button",{onClick:b,disabled:f,className:"flex items-center text-xs font-medium text-[var(--orb-status-error)] hover:opacity-80 transition-colors disabled:opacity-50",children:[e(id,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),n&&c("button",{onClick:()=>h(!m),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] transition-colors",children:[m?e(zo,{className:"w-3.5 h-3.5 mr-1"}):e(Vo,{className:"w-3.5 h-3.5 mr-1"}),m?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),i&&s&&e("button",{onClick:s,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors self-start",children:e(Xt,{className:"w-4 h-4"})})]}),n&&m&&e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 border-t border-[var(--orb-border)]",children:e("pre",{className:"text-xs font-mono text-[var(--orb-muted)] overflow-x-auto whitespace-pre-wrap p-2 bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)]",children:n})})]})},ps=BC;I();var HC=({title:t="\u8B66\u544A",content:o,warningType:r,severity:n="warning",warnings:a=[],icon:i,closable:s=true,onClose:l,onConfirm:d,actionText:p,className:m="",...h})=>{let f=()=>{switch(n){case "info":return {borderLeftColor:"border-l-blue-500",iconColor:"text-[var(--orb-primary)]",bgColor:"bg-[var(--orb-p50)]"};case "error":return {borderLeftColor:"border-l-[var(--orb-status-error)]",iconColor:"text-[var(--orb-status-error)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]"};case "success":return {borderLeftColor:"border-l-green-500",iconColor:"text-[var(--orb-status-success)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]"};default:return {borderLeftColor:"border-l-yellow-500",iconColor:"text-[var(--orb-status-warning)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-warning)_8%,transparent)]"}}},u=()=>{switch(n){case "info":return e(Ha,{className:"w-5 h-5"});case "error":return e(Ka,{className:"w-5 h-5"});case "success":return e(La,{className:"w-5 h-5"});default:return e($c,{className:"w-5 h-5"})}},b=f();return c("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${m}`,...h,children:[c("div",{className:`flex p-4 border-l-4 ${b.borderLeftColor} ${b.bgColor}`,children:[e("div",{className:`flex-shrink-0 mr-3 ${b.iconColor}`,children:i||u()}),c("div",{className:"flex-1 min-w-0",children:[c("div",{className:"flex items-center justify-between mb-1",children:[e("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),r&&e("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-[var(--orb-surface)] text-[var(--orb-muted)]",children:r})]}),o&&e("div",{className:"text-sm text-[var(--orb-muted)] mb-2",children:o}),a&&a.length>0&&e("ul",{className:"mt-2 space-y-1",children:a.map((C,g)=>c("li",{className:"flex items-start text-sm text-[var(--orb-muted)]",children:[e("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-[var(--orb-muted)] flex-shrink-0"}),e("span",{children:C})]},g))})]}),s&&l&&e("button",{onClick:l,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors",children:e(Xt,{className:"w-4 h-4"})})]}),d&&e("div",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)] px-4 py-3 flex justify-end border-t border-[var(--orb-border)]",children:e("button",{onClick:d,className:"px-4 py-1.5 text-sm font-medium text-[var(--orb-on-primary)] bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:p||"\u786E\u8BA4"})})]})},us=HC;I();var zC=({title:t="\u76F8\u5173\u63A8\u8350",content:o,suggestions:r,onSuggestionClick:n,maxDisplay:a=5,icon:i,closable:s=false,onClose:l,className:d="",...p})=>{let[m,h]=to.useState(false),[f,u]=to.useState(""),[b,C]=to.useState(false),g=to.useMemo(()=>f.trim()?r.filter(y=>y.toLowerCase().includes(f.toLowerCase())):r,[r,f]),x=to.useMemo(()=>m?g:g.slice(0,a),[g,m,a]),v=y=>{n?.(y);};return !r||r.length===0?null:c("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${d}`,...p,children:[c("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[c("div",{className:"flex items-center space-x-2.5",children:[e("div",{className:"text-[var(--orb-primary)] flex-shrink-0",children:i||e(za,{className:"w-5 h-5"})}),c("div",{className:"flex flex-col",children:[e("h4",{className:"text-sm font-semibold text-[var(--orb-fg)] leading-tight",children:t}),o&&e("span",{className:"text-xs text-[var(--orb-muted)] mt-0.5",children:o})]})]}),c("div",{className:"flex items-center space-x-1",children:[r.length>3&&e("button",{onClick:()=>C(!b),className:`p-1.5 rounded-md transition-colors ${b?"bg-[var(--orb-p100)] text-[var(--orb-status-primary)]":"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]"}`,title:b?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:e(Wo,{className:"w-4 h-4"})}),s&&l&&e("button",{onClick:l,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] p-1.5 rounded-md hover:bg-[var(--orb-hover)] transition-colors",title:"\u5173\u95ED",children:e(Xt,{className:"w-4 h-4"})})]})]}),b&&e("div",{className:"px-4 py-2 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:c("div",{className:"relative",children:[e("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:f,onChange:y=>u(y.target.value),className:"w-full text-sm px-3 py-1.5 pl-8 rounded border border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-fg)] focus:ring-1 focus:ring-[var(--orb-primary)] focus:border-[var(--orb-primary)] outline-none transition-shadow",autoFocus:true}),e(Wo,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-[var(--orb-muted)]"})]})}),c("div",{className:"p-2",children:[e("ul",{className:"space-y-1",children:x.map((y,k)=>e("li",{children:c("button",{onClick:()=>v(y),className:"w-full text-left px-3 py-2 rounded-md text-sm text-[var(--orb-fg)] hover:bg-[var(--orb-hover)] hover:text-[var(--orb-status-primary)] transition-colors group flex items-start justify-between",children:[e("span",{children:y}),e(Vo,{className:"w-4 h-4 text-[var(--orb-muted)] group-hover:text-[var(--orb-status-primary)] opacity-0 group-hover:opacity-100 transition-all transform group-hover:translate-x-0.5"})]})},k))}),g.length>a&&e("button",{onClick:()=>h(!m),className:"w-full text-center py-2 text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors border-t border-[var(--orb-border)] mt-1",children:m?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${g.length})`}),g.length===0&&f&&e("div",{className:"text-center py-4 text-sm text-[var(--orb-muted)]",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},ms=zC;I();var VC=({title:t,content:o,toolName:r,parameters:n,result:a,status:i,duration:s,icon:l,closable:d=false,onClose:p,onAction:m,actionText:h,className:f="",...u})=>{let[b,C]=to.useState(false),[g,x]=to.useState(true),v=()=>{switch(i){case "pending":return {iconColor:"text-[var(--orb-primary)]",badgeBg:"bg-[var(--orb-p50)]",badgeText:"text-[var(--orb-status-primary)]",label:"\u6267\u884C\u4E2D"};case "error":return {iconColor:"text-[var(--orb-status-error)]",badgeBg:"bg-[color-mix(in_oklch,var(--orb-status-error)_10%,transparent)]",badgeText:"text-[var(--orb-status-error)]",label:"\u5931\u8D25"};default:return {iconColor:"text-[var(--orb-status-success)]",badgeBg:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]",badgeText:"text-[var(--orb-status-success)]",label:"\u6210\u529F"}}},y=()=>{switch(i){case "pending":return e(Jc,{className:"w-5 h-5 animate-spin"});case "error":return e(Ka,{className:"w-5 h-5"});default:return e(La,{className:"w-5 h-5"})}},k=M=>M?M<1e3?`${M}ms`:`${(M/1e3).toFixed(2)}s`:"",S=v(),P=t||r||"\u5DE5\u5177\u8C03\u7528";return c("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${f}`,...u,children:[c("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:[c("div",{className:"flex items-center space-x-3",children:[e("div",{className:`flex-shrink-0 ${S.iconColor}`,children:l||y()}),c("div",{children:[c("div",{className:"flex items-center space-x-2",children:[e("h4",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:P}),e("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${S.badgeBg} ${S.badgeText}`,children:S.label})]}),r&&t&&c("div",{className:"text-xs text-[var(--orb-muted)] flex items-center mt-0.5",children:[e(_n,{className:"w-3 h-3 mr-1"}),r]})]})]}),c("div",{className:"flex items-center space-x-2 text-xs text-[var(--orb-muted)]",children:[s&&c("div",{className:"flex items-center bg-[var(--orb-surface)] px-2 py-1 rounded",children:[e(Uc,{className:"w-3 h-3 mr-1"}),k(s)]}),d&&p&&e("button",{onClick:p,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors p-1 rounded",children:e(Xt,{className:"w-4 h-4"})})]})]}),c("div",{className:"p-4",children:[o&&e("div",{className:"text-sm text-[var(--orb-muted)] mb-4 leading-relaxed",children:o}),n&&c("div",{className:"mb-3",children:[c("button",{onClick:()=>C(!b),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] mb-2",children:[b?e(zo,{className:"w-3.5 h-3.5 mr-1"}):e(Vo,{className:"w-3.5 h-3.5 mr-1"}),e("div",{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),b&&e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:e("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:JSON.stringify(n,null,2)})})]}),a&&c("div",{children:[c("button",{onClick:()=>x(!g),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] mb-2",children:[g?e(zo,{className:"w-3.5 h-3.5 mr-1"}):e(Vo,{className:"w-3.5 h-3.5 mr-1"}),e(_n,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),g&&e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:e("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:typeof a=="string"?a:JSON.stringify(a,null,2)})})]}),m&&e("div",{className:"mt-3 pt-3 border-t border-[var(--orb-border)] flex justify-end",children:e("button",{onClick:m,className:"px-4 py-1.5 text-sm font-medium text-[var(--orb-on-primary)] bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:h||"\u6267\u884C\u64CD\u4F5C"})})]})]})},gs=VC;I();var $C=({data:t})=>{if(!t)return null;let o=to.useMemo(()=>{let r=[],n=[],a="\u6570\u636E\u8868\u683C";return Array.isArray(t)?(r=t,r.length>0&&(n=Object.keys(r[0]).map(i=>({id:i,label:i.charAt(0).toUpperCase()+i.slice(1),numeric:typeof r[0][i]=="number"})))):typeof t=="object"&&(a=t.title||a,r=Array.isArray(t.rows)?t.rows:Array.isArray(t.data)?t.data:[],Array.isArray(t.columns)?n=t.columns.map(s=>({id:s.key||s.id,label:s.title||s.label,numeric:s.dataType==="number"||s.numeric})):r.length>0&&(n=Object.keys(r[0]).map(s=>({id:s,label:s,numeric:typeof r[0][s]=="number"})))),r=r.map((i,s)=>({...i,id:i.id||`row_${s}`})),{title:a,columns:n,rows:r}},[t]);return o.rows.length===0?e("div",{className:"w-full my-4 p-4 border border-dashed border-[var(--orb-border)] rounded text-center text-[var(--orb-muted)]",children:"\u6682\u65E0\u8868\u683C\u6570\u636E"}):e("div",{className:"w-full my-4",children:e(or,{appId:"agent-ui-table-card",title:o.title,columns:o.columns,rows:o.rows,count:o.rows.length,rowKey:"id",fitContainer:false,maxHeight:"500px",rowsPerPage:10,rowsPerPageOptions:[5,10,20,50]})})},hs=$C;I();var _C=({title:t,subtitle:o,data:r,type:n,config:a={}})=>{let i=()=>{switch(n){case "bar-chart-card":return e(qs,{className:"w-4 h-4 text-[var(--orb-chart-1)]"});case "line-chart-card":return e(Qc,{className:"w-4 h-4 text-[var(--orb-chart-positive)]"});case "pie-chart-card":return e(ad,{className:"w-4 h-4 text-[var(--orb-chart-2)]"});case "combo-chart-card":return e(Wc,{className:"w-4 h-4 text-[var(--orb-chart-5)]"});case "heatmap-chart-card":return e(Yc,{className:"w-4 h-4 text-[var(--orb-chart-negative)]"});case "fishbone-chart-card":return e(Zc,{className:"w-4 h-4 text-[var(--orb-chart-4)]"});case "waterfall-chart-card":return e(ud,{className:"w-4 h-4 text-[var(--orb-chart-6)]"});case "google-map-card":return e($n,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});case "amap-card":return e(td,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});default:return e(qs,{className:"w-4 h-4"})}},s=()=>{if(!r&&n!=="google-map-card"&&n!=="amap-card")return e("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:"No data available"});try{switch(n){case "bar-chart-card":return e(aa,{data:r,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return e(Up,{data:r,color:a.color,valueSuffix:a.valueSuffix||"",height:a.height});case "pie-chart-card":let l=r.reduce((p,m)=>p+(Number(m.value)||0),0),d=r.map(p=>({name:p.name,value:Number(p.value)||0,percent:typeof p.percent=="number"?p.percent:l>0?(Number(p.value)||0)/l*100:0}));return e(Ri,{data:d,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return e(Kp,{data:r,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return e(qp,{data:r});case "fishbone-chart-card":return e(Xp,{branches:r,effect:a.effect||t||"Problem"});case "waterfall-chart-card":return e(Zp,{data:r,height:a.height});case "google-map-card":return e(Yp,{embedUrl:a.embedUrl||r&&r[0]?.embedUrl,apiKey:a.apiKey,query:a.query||r&&r[0]?.query||t,height:a.height});case "amap-card":return e(jp,{embedUrl:a.embedUrl||r&&r[0]?.embedUrl,keyword:a.keyword||r&&r[0]?.keyword||t,height:a.height});default:return c("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:["Unsupported chart type: ",n]})}}catch(l){return console.error("Error rendering chart:",l),e("div",{className:"text-[var(--orb-status-error)] text-sm p-4 text-center",children:"Error rendering chart"})}};return c("div",{className:"w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md",children:[c("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:[e("div",{className:"mr-2 flex-shrink-0",children:i()}),c("div",{className:"flex-1 min-w-0",children:[e("h3",{className:"text-sm font-semibold text-[var(--orb-fg)] truncate",children:t}),o&&e("p",{className:"text-xs text-[var(--orb-muted)] mt-0.5 truncate",children:o})]})]}),c("div",{className:"p-4",children:[e("div",{className:"overflow-x-auto",children:s()}),e("div",{className:"mt-3",children:c("details",{className:"text-xs text-[var(--orb-muted)]",children:[e("summary",{className:"cursor-pointer hover:text-[var(--orb-fg)] transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),e("pre",{className:"mt-2 p-2 bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-x-auto max-h-40",children:JSON.stringify(r,null,2)})]})})]})]})},fs=_C;I();var xs=["bar","column","line","pie","donut","scatter","bubble","list","metric","progress"],GC={bar:"Bars",column:"Columns",line:"Line",pie:"Pie",donut:"Donut",scatter:"Scatter",bubble:"Bubble",list:"List",metric:"Metric",progress:"Progress"},ys=480,Rn=214,Kt={top:18,right:16,bottom:38,left:30},oo=t=>typeof t=="number"&&Number.isFinite(t)?t:0,Gm=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Xo=(t,o)=>`${t.id||t.label}-${o}`,Um=(t,o=13)=>t.length>o?`${t.slice(0,Math.max(1,o-1))}\u2026`:t,Cs=(t,o,r)=>Math.min(r,Math.max(o,t)),hr=(t,o,r)=>t.color??r[o%r.length],fr=(t,o)=>o?{onMouseEnter:()=>o.onItemHoverStart?.(t),onMouseMove:()=>o.onItemHoverStart?.(t),onMouseLeave:()=>o.onItemHoverEnd?.(t),onContextMenu:r=>o.onItemContextMenu?.(r,t)}:{},Km=t=>{let o=t.map(a=>oo(a.value)),r=Math.min(0,...o),n=Math.max(0,...o);return {min:r,max:n===r?r+1:n,range:n===r?1:n-r}},UC=(t,o,r)=>{let n=ys-Kt.left-Kt.right,a=Rn-Kt.top-Kt.bottom,{max:i,range:s}=Km(r),l=Kt.left+t*n/Math.max(r.length-1,1),d=Kt.top+(i-oo(o.value))/s*a,p=Kt.top+i/s*a;return {x:l,y:d,zeroY:p}},vs=(t,o,r,n)=>{let a=(n-90)*Math.PI/180;return {x:t+r*Math.cos(a),y:o+r*Math.sin(a)}},KC=(t,o,r,n,a,i)=>{let s=vs(t,o,r,i),l=vs(t,o,r,a),d=i-a>180?1:0;if(n===0)return `M ${t} ${o} L ${s.x} ${s.y} A ${r} ${r} 0 ${d} 0 ${l.x} ${l.y} Z`;let p=vs(t,o,n,i),m=vs(t,o,n,a);return `M ${s.x} ${s.y} A ${r} ${r} 0 ${d} 0 ${l.x} ${l.y} L ${m.x} ${m.y} A ${n} ${n} 0 ${d} 1 ${p.x} ${p.y} Z`},qC=({children:t})=>c("div",{className:"orb-metric-empty",role:"status",children:[e("span",{className:"orb-metric-empty-mark","aria-hidden":"true",children:"\u2014"}),e(L,{variant:"body2",muted:true,children:t})]}),XC=()=>c("div",{className:"orb-metric-loading",role:"status","aria-label":"Loading chart",children:[e("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"}),e("span",{className:"orb-metric-skeleton"}),e("span",{className:"orb-metric-skeleton orb-metric-skeleton-short"}),e("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"})]}),tc=({item:t,onItemClick:o,interactions:r})=>{let n=()=>o?.(t);return {...o?{role:"button",tabIndex:0,onClick:n,onKeyDown:i=>{o&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n());}}:{},...fr(t,r),style:{cursor:o||r?"pointer":"default"}}},ZC=({loading:t,error:o,hasData:r,emptyState:n,children:a})=>t?e(XC,{}):o?e("div",{className:"orb-metric-error",role:"alert",children:o}):r?e(jsxRuntime.Fragment,{children:a}):e(qC,{children:n??"No data for the current selection."}),YC=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(...t.map(l=>Math.abs(oo(l.value))),1);return e("div",{className:"orb-metric-bars",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let p=oo(l.value),m=`${Cs(Math.abs(p)/s*100,0,100)}%`,h=o===l.id,f=c(jsxRuntime.Fragment,{children:[e("span",{className:"orb-metric-bar-label",title:l.label,children:l.label}),e("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:e("span",{className:`orb-metric-bar-fill${h?" is-active":""}`,style:{width:m,backgroundColor:hr(l,d,i)}})}),e("span",{className:"orb-metric-bar-value",children:a(p)})]});return r?e("button",{type:"button",className:`orb-metric-bar-row${h?" is-active":""}`,onClick:()=>r(l),title:`${l.label}: ${a(p)}`,"aria-pressed":h,...fr(l,n),children:f},Xo(l,d)):e("div",{className:`orb-metric-bar-row${h?" is-active":""}`,role:"listitem",...fr(l,n),children:f},Xo(l,d))})})},jC=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(t.reduce((l,d)=>l+Math.max(oo(d.value),0),0),1);return e("div",{className:"orb-metric-progress",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let p=Math.max(oo(l.value),0),m=Cs(p/s*100,0,100),h=o===l.id,f=c(jsxRuntime.Fragment,{children:[c("span",{className:"orb-metric-progress-heading",children:[e("span",{title:l.label,children:l.label}),e("strong",{children:a(p)})]}),e("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:e("span",{className:"orb-metric-bar-fill",style:{width:`${m}%`,backgroundColor:hr(l,d,i)}})})]});return r?e("button",{type:"button",className:`orb-metric-progress-row${h?" is-active":""}`,onClick:()=>r(l),"aria-pressed":h,...fr(l,n),children:f},Xo(l,d)):e("div",{className:`orb-metric-progress-row${h?" is-active":""}`,role:"listitem",...fr(l,n),children:f},Xo(l,d))})})},QC=({type:t,data:o,activeId:r,onItemClick:n,interactions:a,valueFormatter:i,secondaryValueFormatter:s,colors:l,ariaLabel:d})=>{let{min:p,max:m,range:h}=Km(o),f=ys-Kt.left-Kt.right,u=Rn-Kt.top-Kt.bottom,b=Kt.top+m/h*u,C=Math.max(1,Math.ceil(o.length/6)),g=o.map((y,k)=>UC(k,y,o)),x=g.map(y=>`${y.x},${y.y}`).join(" "),v=Math.max(...o.map(y=>Math.max(oo(y.secondaryValue),0)),1);return e("div",{className:"orb-metric-svg-wrap",children:c("svg",{className:"orb-metric-svg",viewBox:`0 0 ${ys} ${Rn}`,role:"img","aria-label":d,children:[e("line",{className:"orb-metric-axis",x1:Kt.left,y1:b,x2:ys-Kt.right,y2:b}),e("line",{className:"orb-metric-grid",x1:Kt.left,y1:Kt.top,x2:Kt.left,y2:Rn-Kt.bottom}),t==="column"&&o.map((y,k)=>{let S=g[k],P=oo(y.value),M=Math.max(Math.abs(S.y-b),P===0?2:0),w=S.x-Math.min(18,f/Math.max(o.length*2,1)),N=Math.min(36,Math.max(10,f/Math.max(o.length*1.8,1))),A=r===y.id;return c("g",{...tc({item:y,onItemClick:n,interactions:a}),"aria-label":`${y.label}: ${i(P)}`,children:[e("rect",{className:`orb-metric-column${A?" is-active":""}`,x:w,y:Math.min(S.y,b),width:N,height:M,rx:4,fill:hr(y,k,l)}),c("title",{children:[y.label,": ",i(P)]}),(k%C===0||o.length<=6)&&e("text",{className:"orb-metric-svg-label",x:S.x,y:Rn-14,textAnchor:"middle",children:Um(y.label)})]},Xo(y,k))}),(t==="line"||t==="scatter"||t==="bubble")&&c(jsxRuntime.Fragment,{children:[t==="line"&&e("polyline",{className:"orb-metric-line",fill:"none",points:x,stroke:l[0]}),o.map((y,k)=>{let S=g[k],P=r===y.id,M=t==="bubble"?7+Math.max(oo(y.secondaryValue),0)/v*12:t==="scatter"?5:4;return c("g",{...tc({item:y,onItemClick:n,interactions:a}),"aria-label":`${y.label}: ${i(oo(y.value))}`,children:[t==="line"&&e("circle",{className:`orb-metric-point${P?" is-active":""}`,cx:S.x,cy:S.y,r:P?6:4,fill:hr(y,k,l)}),t!=="line"&&e("circle",{className:`orb-metric-point${P?" is-active":""}`,cx:S.x,cy:S.y,r:M,fill:hr(y,k,l),opacity:t==="bubble"?.82:.9}),c("title",{children:[y.label,": ",i(oo(y.value)),t==="bubble"&&y.secondaryValue!==void 0?` \xB7 Size: ${s(oo(y.secondaryValue))}`:""]}),(k%C===0||o.length<=6)&&e("text",{className:"orb-metric-svg-label",x:S.x,y:Math.max(Kt.top+8,S.y-M-7),textAnchor:"middle",children:Um(y.label)})]},Xo(y,k))})]}),e("text",{className:"orb-metric-axis-label",x:Kt.left,y:Kt.top-5,children:i(m)}),p<0&&e("text",{className:"orb-metric-axis-label",x:Kt.left,y:Rn-Kt.bottom+14,children:i(p)})]})})},JC=({type:t,data:o,activeId:r,onItemClick:n,interactions:a,valueFormatter:i,colors:s,ariaLabel:l})=>{let d=o.map(u=>({...u,value:Math.max(oo(u.value),0)})),p=d.reduce((u,b)=>u+b.value,0),m=72,h=92,f=0;return c("div",{className:"orb-metric-circular",children:[c("svg",{className:"orb-metric-donut",viewBox:"0 0 184 184",role:"img","aria-label":l,children:[d.map((u,b)=>{let C=u.value/p*360,g=f;f+=C;let x=r===u.id,v=C>=359.9?void 0:KC(h,h,m,t==="donut"?46:0,g,g+C),y=tc({item:u,onItemClick:n,interactions:a});return v?e("path",{className:`orb-metric-slice${x?" is-active":""}`,d:v,fill:hr(u,b,s),...y,children:c("title",{children:[u.label,": ",i(u.value)," (",(u.value/p*100).toFixed(1),"%)"]})},Xo(u,b)):e("circle",{className:`orb-metric-slice${x?" is-active":""}`,cx:h,cy:h,r:t==="donut"?60:m,fill:t==="donut"?"none":hr(u,b,s),stroke:t==="donut"?hr(u,b,s):void 0,strokeWidth:28,...y,children:c("title",{children:[u.label,": ",i(u.value)," (100%)"]})},Xo(u,b))}),t==="donut"&&e("circle",{cx:h,cy:h,r:44,fill:"var(--orb-surface)"}),t==="donut"&&e("text",{className:"orb-metric-donut-total",x:h,y:h+5,textAnchor:"middle",children:i(p)})]}),e("div",{className:"orb-metric-legend",role:"list","aria-label":"Chart legend",children:d.map((u,b)=>{let C=r===u.id;return c("button",{type:"button",className:`orb-metric-legend-item${C?" is-active":""}`,onClick:()=>n?.(u),disabled:!n,title:u.label,...fr(u,a),children:[e("span",{className:"orb-metric-legend-dot",style:{backgroundColor:hr(u,b,s)}}),e("span",{className:"orb-metric-legend-label",children:u.label}),c("strong",{children:[(u.value/p*100).toFixed(0),"%"]})]},Xo(u,b))})})]})},ex=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,secondaryValueFormatter:i})=>e("div",{className:"orb-metric-list",role:"list","aria-label":"Chart data",children:t.map((s,l)=>{let d=c(jsxRuntime.Fragment,{children:[e("span",{className:"orb-metric-list-label",title:s.label,children:s.label}),e("span",{className:"orb-metric-list-value",children:a(oo(s.value))}),s.secondaryValue!==void 0&&e("span",{className:"orb-metric-list-secondary",children:i(oo(s.secondaryValue))})]});return r?e("button",{type:"button",className:`orb-metric-list-row${o===s.id?" is-active":""}`,onClick:()=>r(s),"aria-pressed":o===s.id,...fr(s,n),children:d},Xo(s,l)):e("div",{className:`orb-metric-list-row${o===s.id?" is-active":""}`,role:"listitem",...fr(s,n),children:d},Xo(s,l))})}),ws=({title:t,subtitle:o,data:r=[],chartType:n="bar",onChartTypeChange:a,onItemClick:i,onDataDetails:s,activeId:l,valueFormatter:d=Gm,secondaryValueFormatter:p=Gm,valueLabel:m,secondaryValueLabel:h,emptyState:f,loading:u=false,error:b,maxItems:C=8,showChartTypeControl:g=true,showDataDetails:x=true,dataRevealDelayMs:v=1e3,chartTypeOptions:y,chartTypeLabels:k,footer:S,ariaLabel:P,className:M,style:w,sx:N})=>{let A=Ks(),T=to.useRef(null),R=to.useRef(null),[E,O]=to.useState(n),[$,ee]=to.useState(false),[F,G]=to.useState(null),[W,Q]=to.useState(null);to.useEffect(()=>O(n),[n]);let z=to.useCallback(()=>{R.current!==null&&(window.clearTimeout(R.current),R.current=null);},[]);to.useEffect(()=>z,[z]),to.useEffect(()=>{if(!W)return;let K=Ne=>{let Se=Ne.target;Se instanceof HTMLElement&&Se.closest(".orb-metric-context-menu")||Q(null);};return document.addEventListener("pointerdown",K),()=>document.removeEventListener("pointerdown",K)},[W]);let H=E,X=to.useMemo(()=>[A.chart1,A.chart2,A.chart3,A.chart4,A.chart5,A.chart6],[A]),Y=to.useMemo(()=>$?r:r.slice(0,Math.max(1,C)),[r,C,$]),j=Math.max(0,r.length-Y.length),te=Y.some(K=>oo(K.value)>0),ce=Y.length>0&&(H!=="pie"&&H!=="donut"?true:te),fe=(y??[H,"bar","column","line","pie","donut","scatter","bubble","list"]).filter((K,Ne,Se)=>xs.includes(K)&&Se.indexOf(K)===Ne),Ve={...GC,...k},ve=Y[0],xe=P??`${t} ${Ve[H]} chart`,He=K=>{O(K),a?.(K);},pe=to.useCallback((K,Ne)=>{G({item:K,source:Ne}),Q(null),s?.(K,Ne);},[s]),ye=to.useCallback(K=>{z(),!(!x||W)&&(R.current=window.setTimeout(()=>{pe(K,"hover"),R.current=null;},Math.max(0,v)));},[z,W,v,pe,x]),$e=to.useCallback(()=>{z();},[z]),tt=to.useCallback((K,Ne)=>{if(!x)return;K.preventDefault(),z();let Se=T.current?.getBoundingClientRect(),Fe=Se?Cs(K.clientX-Se.left,8,Math.max(8,Se.width-164)):8,it=Se?Cs(K.clientY-Se.top,8,Math.max(8,Se.height-72)):8;Q({item:Ne,left:Fe,top:it});},[z,x]),at=x?{onItemHoverStart:ye,onItemHoverEnd:$e,onItemContextMenu:tt}:void 0,st=H==="metric"?c("div",{className:"orb-metric-kpi",role:i?"button":"img",tabIndex:i?0:void 0,onClick:()=>ve&&i?.(ve),onKeyDown:K=>{ve&&i&&(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),i(ve));},"aria-label":xe,...ve?fr(ve,at):{},children:[e("span",{className:"orb-metric-kpi-label",children:ve?.label??m??"Value"}),e("strong",{children:ve?d(oo(ve.value)):"\u2014"}),ve?.secondaryValue!==void 0&&c("span",{className:"orb-metric-kpi-secondary",children:[h??"Compared with"," \xB7 ",p(oo(ve.secondaryValue))]})]}):H==="progress"?e(jC,{data:Y,activeId:l,onItemClick:i,interactions:at,valueFormatter:d,colors:X}):H==="bar"?e(YC,{data:Y,activeId:l,onItemClick:i,interactions:at,valueFormatter:d,colors:X}):H==="list"?e(ex,{data:Y,activeId:l,onItemClick:i,interactions:at,valueFormatter:d,secondaryValueFormatter:p}):H==="pie"||H==="donut"?e(JC,{type:H,data:Y,activeId:l,onItemClick:i,interactions:at,valueFormatter:d,colors:X,ariaLabel:xe}):e(QC,{type:H,data:Y,activeId:l,onItemClick:i,interactions:at,valueFormatter:d,secondaryValueFormatter:p,colors:X,ariaLabel:xe});return c("div",{ref:T,className:"orb-metric-chart-shell",onMouseLeave:()=>{z(),F?.source==="hover"&&G(null);},children:[c(Ae,{elevation:1,variant:"outlined",className:`orb-metric-chart-card ${M??""}`,style:w,sx:N,children:[c("div",{className:"orb-metric-chart-header",children:[c("div",{className:"orb-metric-chart-heading",children:[e(L,{variant:"subtitle1",component:"h3",noWrap:true,title:t,children:t}),o&&e(L,{variant:"caption",muted:true,component:"div",noWrap:true,children:o})]}),g&&fe.length>1&&e(Vt,{"aria-label":`${t} chart type`,className:"orb-metric-chart-select",value:H,options:fe.map(K=>({value:K,label:Ve[K]})),onChange:K=>He(K.target.value),minWidth:108,fullWidth:false,size:"small"})]}),c("div",{className:"orb-metric-chart-body",children:[e(ZC,{loading:u,error:b,hasData:ce,emptyState:f,children:st}),j>0&&!u&&!b&&e("button",{type:"button",className:"orb-metric-more",onClick:()=>ee(K=>!K),children:$?"Show fewer":`Show all ${r.length}`})]}),S&&e("div",{className:"orb-metric-chart-footer",children:S})]}),W&&c("div",{className:"orb-metric-context-menu",role:"menu",onMouseEnter:z,onKeyDown:K=>{K.key==="Escape"&&Q(null);},style:{left:W.left,top:W.top},onPointerDown:K=>K.stopPropagation(),children:[e("div",{className:"orb-metric-context-label",children:W.item.label}),e("button",{type:"button",role:"menuitem",onClick:K=>{K.preventDefault(),K.stopPropagation(),pe(W.item,"contextmenu");},children:"Show data"})]}),F&&c("div",{className:"orb-metric-data-details",role:"dialog","aria-label":`${F.item.label} data details`,onPointerDown:K=>K.stopPropagation(),children:[c("div",{className:"orb-metric-data-details-header",children:[e("strong",{children:F.item.label}),e("button",{type:"button","aria-label":"Close data details",onClick:()=>G(null),children:"\xD7"})]}),c("div",{className:"orb-metric-data-details-row",children:[e("span",{children:m??"Value"}),e("strong",{children:d(oo(F.item.value))})]}),F.item.secondaryValue!==void 0&&c("div",{className:"orb-metric-data-details-row",children:[e("span",{children:h??"Secondary value"}),e("strong",{children:p(oo(F.item.secondaryValue))})]}),e("span",{className:"orb-metric-data-details-hint",children:F.source==="hover"?`Shown after ${Math.max(0,v)/1e3} seconds of stillness`:"Shown from the context menu"})]})]})};ws.displayName="CMetricChartCard";I();var tx=({messageId:t,cardHooks:o,valueSuffix:r,secondaryValueSuffix:n,...a})=>{let i=(l,d)=>{o?.onCardEvent?.({messageId:t,cardType:"metric-chart-card",action:l,title:a.title,payload:d,rawData:a});},s=(l,d)=>`${l.toLocaleString()}${d??""}`;return e(ws,{...a,valueFormatter:l=>s(l,r),secondaryValueFormatter:l=>s(l,n),onChartTypeChange:l=>i("action",{chartType:l}),onItemClick:l=>i("action",{item:l}),onDataDetails:(l,d)=>i("show-data",{item:l,source:d})})},Ss=tx;I();var ox=({type:t,manifest:o})=>c("div",{className:"w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md",children:[c("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[e("div",{className:"w-4 h-4 mr-2 text-[var(--orb-status-primary)]"}),c("h3",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:["SAP Card: ",t]})]}),e("div",{className:"p-4",children:e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 rounded border border-[var(--orb-border)] overflow-x-auto",children:e("pre",{className:"text-xs font-mono text-[var(--orb-muted)] whitespace-pre-wrap",children:JSON.stringify(o,null,2)})})})]}),ks=ox;var rx=t=>Array.isArray(t)?t.flatMap((o,r)=>{if(!o||typeof o!="object")return [];let n=o,a=String(n.label??n.name??n.id??`Item ${r+1}`),i=Number(n.value),s=Number.isFinite(i)?i:0,l=n.secondaryValue===void 0?void 0:Number(n.secondaryValue);return [{id:String(n.id??n.name??n.label??r),label:a,value:s,...l!==void 0&&Number.isFinite(l)?{secondaryValue:l}:{},...typeof n.color=="string"?{color:n.color}:{}}]}):[],Ps=t=>{let o;try{o=JSON.parse(t);}catch{return null}if(o&&typeof o=="object"){if(o.type==="metric-chart-card"&&o.title&&Array.isArray(o.data)){let r=xs.includes(o.chartType)?o.chartType:"bar";return {...o,type:"metric-chart-card",chartType:r,data:rx(o.data)}}if((o.type==="bar-chart-card"||o.type==="line-chart-card"||o.type==="pie-chart-card"||o.type==="combo-chart-card"||o.type==="heatmap-chart-card"||o.type==="fishbone-chart-card"||o.type==="waterfall-chart-card"||o.type==="google-map-card"||o.type==="amap-card")&&o.title||(o.type==="sap-analytical-card"||o.type==="sap-list-card"||o.type==="sap-object-card"||o.type==="sap-component-card")&&o.manifest||o.type==="error-card"||o.type==="warning-card"||o.type==="suggestions-card"||o.type==="tool-result-card"||o.type==="table"&&o.data)return o}return null};I();var dx=({content:t,theme:o,size:r="base",className:n,enableCodeHighlight:a=true,enableMermaid:i=true,messageId:s,cardHooks:l})=>{let d=to.useRef(l);d.current=l;let p=!!l?.onCardEvent,m=to.useMemo(()=>p?{onCardEvent:C=>d.current?.onCardEvent?.(C)}:void 0,[p]),h=to.useMemo(()=>t?t.replace(/<think>([\s\S]*?)<\/think>/g,(C,g)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(g.trim())}"></div>`):"",[t]),f=(C,g,x,v,y)=>{m?.onCardEvent?.({messageId:s,cardType:C,action:g,title:x,payload:v,rawData:y});},u=(C,g,x,v,y,k)=>{if(!(!y&&!m?.onCardEvent))return (...S)=>{let P=y?.(...S),M=k?k(...S):void 0;return f(C,g,x,M,v),P}},b=to.useMemo(()=>({div(C){let{"data-component":g,"data-think-content":x,...v}=C;return g==="thinkbox"&&x?e(Nm,{content:decodeURIComponent(x),theme:o,size:r,defaultExpanded:false}):e("div",{...v})},table({children:C}){return e("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-[var(--orb-border)]",children:e("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:C})})},thead({children:C}){return e("thead",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]",children:C})},tbody({children:C}){return e("tbody",{className:"bg-[var(--orb-canvas)] dark:bg-[var(--orb-canvas)]",children:C})},tr({children:C}){return e("tr",{className:"border-b border-[var(--orb-border)] last:border-b-0",children:C})},th({children:C,align:g}){return e("th",{className:`px-3 py-2 font-semibold text-[var(--orb-fg)] ${g==="center"?"text-center":g==="right"?"text-right":"text-left"}`,children:C})},td({children:C,align:g}){return e("td",{className:`px-3 py-2 text-[var(--orb-fg)] align-top ${g==="center"?"text-center":g==="right"?"text-right":"text-left"}`,children:C})},code({className:C,children:g,...x}){let v=/language-([\w-]+)/.exec(C||""),y=v?v[1]:"",k=String(g);if(!v&&!k.includes(`
199
+ `))return e("code",{children:g});let P=k.replace(/\n$/,"");if(i&&y==="mermaid")return e(Hm,{content:P});if(y==="html"||y==="htm")return e(Om,{content:P});if(y==="json"){let M=Ps(P);if(M)switch(M.type){case "table":return e(hs,{data:M.data});case "metric-chart-card":return e(Ss,{...M,messageId:s,cardHooks:m});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return e(fs,{...M});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return e(ks,{...M});case "error-card":{let w=M;return e(ps,{...w,onClose:u("error-card","close",w.title,w,w.onClose),onRetry:u("error-card","retry",w.title,w,w.onRetry)})}case "warning-card":{let w=M,N=w.onConfirm?u("warning-card","confirm",w.title,w,w.onConfirm):w.actionText&&m?.onCardEvent?u("warning-card","confirm",w.title,w):void 0;return e(us,{...w,onClose:u("warning-card","close",w.title,w,w.onClose),onConfirm:N})}case "suggestions-card":{let w=M;return e(ms,{...w,onClose:u("suggestions-card","close",w.title,w,w.onClose),onSuggestionClick:u("suggestions-card","suggestion-click",w.title,w,w.onSuggestionClick,N=>({suggestion:N}))})}case "tool-result-card":{let w=M;return e(gs,{...w,onClose:u("tool-result-card","close",w.title,w,w.onClose),onAction:u("tool-result-card","action",w.title,w,w.onAction)})}}}return a?e(Dm,{content:P,language:y,className:"not-prose"}):e("code",{className:C,...x,children:g})}}),[o,r,i,a,m,s]);return e("div",{className:rt("markdown-body max-w-none",n),children:e(ax__default.default,{remarkPlugins:[ix__default.default,sx__default.default],rehypePlugins:[lx__default.default,cx__default.default],components:b,children:h})})},Nn=dx;I();var px=({content:t,messageId:o,cardHooks:r})=>{let n=(s,l,d,p,m)=>{r?.onCardEvent?.({messageId:o,cardType:s,action:l,title:d,payload:p,rawData:m});},a=(s,l,d,p,m,h)=>{if(!(!m&&!r?.onCardEvent))return (...f)=>{let u=m?.(...f),b=h?h(...f):void 0;return n(s,l,d,b,p),u}},i=Ps(t);if(i)switch(i.type){case "table":return e(hs,{data:i.data});case "metric-chart-card":return e(Ss,{...i,messageId:o,cardHooks:r});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return e(fs,{...i});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return e(ks,{...i});case "error-card":{let s=i;return e(ps,{...s,onClose:a("error-card","close",s.title,s,s.onClose),onRetry:a("error-card","retry",s.title,s,s.onRetry)})}case "warning-card":{let s=i,l=s.onConfirm?a("warning-card","confirm",s.title,s,s.onConfirm):s.actionText&&r?.onCardEvent?a("warning-card","confirm",s.title,s):void 0;return e(us,{...s,onClose:a("warning-card","close",s.title,s,s.onClose),onConfirm:l})}case "suggestions-card":{let s=i;return e(ms,{...s,onClose:a("suggestions-card","close",s.title,s,s.onClose),onSuggestionClick:a("suggestions-card","suggestion-click",s.title,s,s.onSuggestionClick,l=>({suggestion:l}))})}case "tool-result-card":{let s=i;return e(gs,{...s,onClose:a("tool-result-card","close",s.title,s,s.onClose),onAction:a("tool-result-card","action",s.title,s,s.onAction)})}}return e("div",{className:"dynamic-card-fallback",children:e(Nn,{content:t,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:r})})},qm=px;I();var rc=class{static analyze(o){if(!o.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let n=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(o),a=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(o),i=o.includes("NQ#")||o.includes("data-component");return n||a||i?{blocks:[{type:"mixed",content:o,startIndex:0,endIndex:o.length}],hasComplexContent:true,overallType:"complex"}:{blocks:[{type:"markdown",content:o,startIndex:0,endIndex:o.length}],hasComplexContent:false,overallType:"simple"}}},mx=({content:t,className:o="",messageId:r,cardHooks:n})=>{let a=to__namespace.default.useMemo(()=>rc.analyze(t),[t]);return e("div",{className:`universal-content-renderer ${o}`,children:a.blocks.map((i,s)=>i.type==="mixed"||i.type==="json-card"?e(qm,{content:i.content,messageId:r,cardHooks:n},`block-${s}`):e(Nn,{content:i.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:r,cardHooks:n},`block-${s}`))})},Ts=mx;I();var gx=({content:t,isStreaming:o=true,onComplete:r,className:n="",streamIntervalMs:a=24,streamChunkSize:i=3,messageId:s,cardHooks:l})=>{let[d,p]=to.useState(o?0:t.length),[m,h]=to.useState(!o);to.useEffect(()=>{if(o){p(0),h(false);return}p(t.length),h(true);},[t,o]),to.useEffect(()=>{if(!o||m)return;if(d>=t.length){h(true),r?.();return}let g=window.setTimeout(()=>{p(x=>Math.min(x+i,t.length));},a);return ()=>{window.clearTimeout(g);}},[t.length,m,o,r,i,a,d]);let f=()=>{o&&!m&&(p(t.length),h(true),r?.());},u=o?t.slice(0,d):t,b=o&&!m,C=o&&!m;return c("div",{className:`streaming-markdown ${n}`,onClick:f,style:{cursor:o?"pointer":"default"},children:[c("div",{className:"relative",children:[e(Ts,{content:u,messageId:s,cardHooks:l}),b&&e("span",{className:"inline-block w-[2px] h-[13px] ml-0.5 animate-pulse",style:{verticalAlign:"text-bottom",backgroundColor:"var(--orb-primary, #154194)"}})]}),C&&e("div",{className:"streaming-hint",style:{fontSize:"9px",color:"var(--orb-muted)",marginTop:"8px",fontStyle:"italic",opacity:.7},children:"\u70B9\u51FB\u6B64\u5904\u663E\u793A\u5B8C\u6574\u5185\u5BB9"})]})},Ym=gx;I();var jm=({buttons:t,className:o})=>{let r=n=>{switch(n){case "copy":return e(Eo,{size:14});case "refresh":return e(Ga,{size:14});case "volume":return e(gd,{size:14});case "like":return e(dd,{size:14});case "dislike":return e(cd,{size:14});default:return null}};return e("div",{className:rt("flex items-center gap-1",o),children:t.map((n,a)=>e("button",{onClick:n.onClick,disabled:n.disabled,"aria-busy":n.loading||void 0,className:rt("p-1.5 rounded-md transition-colors","text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:text-[var(--orb-fg)]","hover:bg-[var(--orb-hover)]","disabled:opacity-50 disabled:cursor-not-allowed",n.active&&"text-[var(--orb-primary)] bg-[var(--orb-p50)]",n.type==="refresh"&&n.loading&&"animate-spin"),title:n.type,type:"button",children:r(n.type)},`${n.type}-${a}`))})};I();var Is=({message:t,onStreamingComplete:o,assistantActions:r,streamIntervalMs:n,streamChunkSize:a,cardHooks:i})=>{let s={lineHeight:1.55,fontSize:13,fontWeight:300,fontFamily:'var(--orb-font, "Montserrat", system-ui, sans-serif)',color:"var(--orb-fg, #555555)",borderRadius:"var(--orb-r, 10px)",padding:"10px 14px"},l={marginTop:6,fontSize:11,color:"var(--orb-muted, #8c8c8c)"};if(t.type==="assistant"){let d=!!(r?.isResponding||t.isStreaming);return e("div",{className:"mb-4 flex justify-start",children:c("div",{className:"mr-auto w-full",style:{...s,background:"var(--orb-surface, #f5f5f5)",border:"1px solid var(--orb-border, #dbdbdb)"},children:[e(Ym,{content:t.content,isStreaming:t.isStreaming??false,onComplete:o,streamIntervalMs:n,streamChunkSize:a,messageId:t.id,cardHooks:i}),t.content&&r?.isLatestAssistant&&e("div",{className:"mt-3 flex flex-row justify-start gap-2 border-t pt-2",style:{borderColor:"var(--orb-border, #dbdbdb)"},children:e(jm,{buttons:[{type:"refresh",onClick:()=>{r?.onRegenerate?.();},disabled:d||!r?.onRegenerate,loading:d},{type:"copy",onClick:()=>navigator.clipboard.writeText(t.content),disabled:false},{type:"volume",onClick:()=>console.log("\u8BED\u97F3\u64AD\u653E"),disabled:false},{type:"like",onClick:()=>console.log("\u70B9\u8D5E"),disabled:false},{type:"dislike",onClick:()=>console.log("\u70B9\u8E29"),disabled:false}],size:"sm",variant:"default"})}),e("div",{style:l,children:t.timestamp.toLocaleTimeString()})]})})}return e("div",{className:"mb-4 flex justify-end",children:c("div",{className:"ml-auto max-w-[80%]",style:{...s,background:"var(--orb-p50, #eef2f9)",border:"1px solid var(--orb-p100, #e4e9f5)"},children:[e("div",{className:"whitespace-pre-wrap",children:t.content}),e("div",{style:l,children:t.timestamp.toLocaleTimeString()})]})})};I();var Qm=({onTextUpdate:t,onComplete:o,onCancel:r,disabled:n,className:a})=>{let{isRecording:i,startRecording:s,stopRecording:l}=wn({onTextUpdate:t,onComplete:p=>{o?.(p);},onError:p=>{console.error("Voice input error:",p),r?.();}});return e("button",{onClick:async()=>{i?l():await s();},disabled:n,className:rt("transition-all duration-200 flex items-center justify-center rounded-full",i?"bg-[color-mix(in_oklch,var(--orb-status-error)_12%,transparent)] text-[var(--orb-status-error)] hover:bg-[color-mix(in_oklch,var(--orb-status-error)_20%,transparent)] animate-pulse":"bg-transparent hover:bg-[var(--orb-hover)] text-[var(--orb-muted)] active:scale-95",n&&"opacity-50 cursor-not-allowed",a),title:i?"Stop recording":"Start recording",type:"button",children:i?e(vp,{size:16}):e(yp,{size:16})})};I();var Dt={container:"w-full max-w-4xl mx-auto",inputContainer:rt("w-full flex flex-col border border-[var(--orb-border,#dbdbdb)] bg-[color-mix(in_oklch,var(--orb-canvas)_64%,transparent)] backdrop-blur-[28px] transition-colors duration-200","orb-agent-input","focus-within:border-[var(--orb-primary,#154194)] focus-within:ring-1 focus-within:ring-[var(--orb-focus-ring,#e4e9f5)]"),dragActive:"border-[var(--orb-primary,#154194)] bg-[var(--orb-p50,#eef2f9)]",textareaWrapper:"flex-1 relative flex items-center",textarea:rt("w-full outline-none appearance-none resize-none bg-transparent border-none text-sm font-normal py-3 px-3","placeholder:text-[var(--orb-muted,#8c8c8c)] placeholder:font-normal","text-[var(--orb-fg,#555555)] selection:bg-[var(--orb-p100,#e4e9f5)]","focus:ring-0 focus:outline-none focus:border-none focus:shadow-none","min-h-[44px] max-h-[12em] overflow-y-auto scrollbar-thin scrollbar-thumb-[var(--orb-border)]"),filePreviewArea:"px-4 pt-3 pb-1 flex flex-wrap gap-2",queueArea:"px-4 pt-3 flex flex-col gap-2",queueCard:rt("flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-2 rounded-lg","bg-[var(--orb-p50,#eef2f9)] border border-[var(--orb-p100,#dbdbdb)]","text-xs text-[var(--orb-fg,#555555)]"),queueContent:"min-w-0 flex-1 truncate font-medium",queueHint:"text-[var(--orb-muted,#8c8c8c)]",queueButton:rt("shrink-0 px-2 py-1 rounded-md text-xs font-semibold cursor-pointer active:scale-95","text-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p50,#eef2f9)]"),queueCancelButton:rt("shrink-0 flex items-center justify-center h-5 w-5 rounded-full cursor-pointer","text-[var(--orb-muted,#8c8c8c)] hover:text-[var(--orb-fg,#555555)] hover:bg-[var(--orb-hover,#eef2f9)]"),fileTag:rt("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium","bg-[var(--orb-surface,#f5f5f5)] text-[var(--orb-fg,#555555)]","border border-[var(--orb-border,#dbdbdb)]","transition-all hover:bg-[var(--orb-hover,#eef2f9)]"),buttonBase:"flex items-center justify-center transition-all duration-200 rounded-full",buttonSmall:"h-[38px] w-[38px] shrink-0 md:h-8 md:w-8",buttonNormal:rt("bg-transparent hover:bg-[var(--orb-hover,#eef2f9)] text-[var(--orb-muted,#8c8c8c)] hover:text-[var(--orb-fg,#555555)]","cursor-pointer active:scale-95"),sendButton:rt("cursor-pointer bg-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p600,#0e2d63)] text-[var(--orb-on-primary)] shadow-none active:scale-95"),sendButtonDisabled:rt("cursor-not-allowed opacity-40 bg-[var(--orb-disabled-bg,#f5f5f5)] text-[var(--orb-disabled-fg,#8c8c8c)]"),stopButton:rt("cursor-pointer bg-[var(--orb-err,#c43f02)] hover:opacity-90 text-[var(--orb-on-primary)] shadow-none active:scale-95"),stopSecondary:rt("cursor-pointer border border-[var(--orb-border,#dbdbdb)] text-[var(--orb-muted,#8c8c8c)]","hover:border-[var(--orb-err,#c43f02)] hover:text-[var(--orb-err,#c43f02)] active:scale-95")},fx={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},bx=({enabled:t,onClick:o})=>{let{t:r}=de();return e("button",{className:rt(Dt.buttonBase,Dt.buttonSmall,Dt.buttonNormal),onClick:o,disabled:!t,"aria-label":r("omph.input.upload"),type:"button",children:e(Qd,{size:16})})},vx=({canSend:t,isResponding:o,onSend:r,onStop:n})=>{let{t:a}=de();return o&&!t?e("button",{className:rt(Dt.buttonBase,Dt.buttonSmall,Dt.stopButton),onClick:n,"aria-label":a("omph.input.stop"),type:"button",children:e(fl,{size:15})}):c(jsxRuntime.Fragment,{children:[o&&e("button",{className:rt(Dt.buttonBase,Dt.buttonSmall,Dt.stopSecondary),onClick:n,"aria-label":a("omph.input.stop"),type:"button",children:e(fl,{size:14})}),e("button",{className:rt(Dt.buttonBase,Dt.buttonSmall,t?Dt.sendButton:Dt.sendButtonDisabled),onClick:r,disabled:!t,"aria-label":a("omph.input.send"),type:"button",children:e(Sp,{size:16,className:t?"text-[var(--orb-on-primary,#ffffff)]":"text-[var(--orb-disabled-fg,#8c8c8c)]"})})]})},nc=({onSend:t,onStop:o,isResponding:r=false,placeholder:n,getText:a})=>{let[i,s]=to.useState(""),[l,d]=to.useState([]),[p,m]=to.useState(false),[h,f]=to.useState(false),[u,b]=to.useState([]),C=to.useRef(null),g=to.useRef(0),{t:x}=de(),v=x("omph.input.placeholder"),y=v!=="omph.input.placeholder"?v:"Type a message...",k=n||(a?a("00019",y):y),S=i.trim().length>0||l.length>0,P={enabled:true},M=to.useCallback(j=>{s(j.target.value),j.target.style.height="auto",j.target.style.height=`${Math.min(j.target.scrollHeight,200)}px`;},[]),w=to.useCallback(j=>{if(j.target.files&&j.target.files.length>0){let te=Array.from(j.target.files);d(ce=>{let fe=te.filter(ve=>ce.some(xe=>xe.name===ve.name&&xe.size===ve.size));fe.length>0&&console.warn("Duplicate files ignored:",fe.map(ve=>ve.name));let Ve=te.filter(ve=>!ce.some(xe=>xe.name===ve.name&&xe.size===ve.size));return [...ce,...Ve]}),C.current&&(C.current.value="");}},[]),N=to.useCallback(j=>{d(te=>te.filter((ce,fe)=>fe!==j));},[]),A=to.useCallback(()=>{C.current?.click();},[]),T=to.useCallback(async()=>{if(!S)return;let j=i,te=[...l];if(r){g.current+=1,b(ce=>[...ce,{id:g.current,content:j,files:te,confirmed:false}]),s(""),d([]),C.current&&(C.current.value="");return}s(""),d([]),C.current&&(C.current.value="");try{await t(j,te);}catch(ce){console.error("Failed to send message:",ce),s(j),d(te);}},[i,S,r,t,l]),R=to.useCallback(j=>{let te=u.find(ce=>ce.id===j);te&&(b(ce=>ce.filter(fe=>fe.id!==j)),t(te.content,te.files).catch(()=>s(te.content)));},[u,t]),E=to.useCallback(j=>{b(te=>te.map(ce=>ce.id===j?{...ce,confirmed:true}:ce));},[]),O=to.useCallback(j=>{b(te=>te.filter(ce=>ce.id!==j));},[]);to.useEffect(()=>{if(r||u.length===0)return;let j=u;b([]),(async()=>{for(let te of j)try{await t(te.content,te.files);}catch(ce){console.error("Failed to send queued message:",ce),s(te.content);}})();},[r,u,t]);let $=to.useCallback(()=>{b([]),o();},[o]),ee=to.useCallback(j=>{j.key==="Enter"&&!j.shiftKey&&!p&&(j.preventDefault(),T());},[T,p]),F=to.useCallback(()=>{m(true);},[]),G=to.useCallback(()=>{m(false);},[]),W=to.useCallback(j=>{s(j);},[]),Q=to.useCallback(j=>{s(j);},[]),z=to.useCallback(()=>{},[]),H=to.useCallback(j=>{j.preventDefault(),f(true);},[]),X=to.useCallback(j=>{j.preventDefault(),f(false);},[]),Y=to.useCallback(j=>{if(j.preventDefault(),f(false),j.dataTransfer.files&&j.dataTransfer.files.length>0){let te=Array.from(j.dataTransfer.files);d(ce=>[...ce,...te]);}},[]);return e("div",{className:Dt.container,children:c("div",{className:"relative",children:[e("input",{type:"file",multiple:true,className:"hidden",ref:C,onChange:w}),c("div",{className:rt(Dt.inputContainer,h&&Dt.dragActive),onDragOver:H,onDragLeave:X,onDrop:Y,children:[u.length>0&&e("div",{className:Dt.queueArea,children:u.map(j=>c("div",{className:Dt.queueCard,"data-omph-queue":j.id,children:[e("span",{className:Dt.queueContent,title:j.content,children:j.content}),j.confirmed?e("span",{className:Dt.queueHint,children:x("omph.input.queue.queued")}):e("span",{className:Dt.queueHint,children:x("omph.input.queue.ask")}),e("button",{className:Dt.queueButton,onClick:()=>R(j.id),type:"button",children:x("omph.input.queue.sendNow")}),!j.confirmed&&e("button",{className:Dt.queueButton,onClick:()=>E(j.id),type:"button",children:x("omph.input.queue.afterTurn")}),e("button",{className:Dt.queueCancelButton,onClick:()=>O(j.id),"aria-label":x("omph.input.queue.cancel"),type:"button",children:e(hl,{sx:{fontSize:14}})})]},j.id))}),l.length>0&&e("div",{className:Dt.filePreviewArea,children:l.map((j,te)=>c("div",{className:Dt.fileTag,children:[e(mp,{sx:{fontSize:16},className:"text-[var(--orb-primary)]"}),e("span",{className:"truncate max-w-[150px]",children:j.name}),e("button",{onClick:()=>N(te),className:"ml-1 hover:text-[var(--orb-status-error)] focus:outline-none",type:"button",children:e(hl,{sx:{fontSize:16}})})]},`${j.name}-${te}`))}),c("div",{className:"flex w-full flex-col p-2",children:[e("div",{className:rt(Dt.textareaWrapper,"min-h-[52px] px-2 pb-2 pt-1.5 md:min-h-[44px]"),children:e("textarea",{className:rt(Dt.textarea,"min-h-[24px] py-0 px-0"),placeholder:k,value:i,onChange:M,onKeyDown:ee,onCompositionStart:F,onCompositionEnd:G,style:fx,"aria-label":x("omph.input.message"),spellCheck:false,rows:1})}),c("div",{className:"flex items-center justify-between px-1 pb-0.5",children:[e("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":x("omph.input.tools"),children:e(bx,{enabled:P.enabled,onClick:A})}),c("div",{className:"flex items-center gap-1",children:[e(Qm,{onTextUpdate:W,onComplete:Q,onCancel:z,disabled:r,className:Dt.buttonSmall}),e(vx,{canSend:S,isResponding:r,onSend:T,onStop:$})]})]})]})]})]})})};I();var tg=({messages:t,onSend:o,onStop:r,onRegenerate:n,isResponding:a=false,className:i,placeholder:s,streamIntervalMs:l,streamChunkSize:d,onMessageStreamingComplete:p,cardHooks:m,showInput:h=true,statusLine:f})=>{let u=to.useRef(null),b=to.useRef(t.length);return to.useEffect(()=>{t.length>b.current&&u.current?.scrollIntoView({behavior:"smooth"}),b.current=t.length;},[t]),c("div",{className:rt("flex flex-col h-full w-full relative",i),children:[c("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((C,g)=>{let x=C.type==="assistant"&&g===t.length-1,v=C.type==="assistant"?{isLatestAssistant:x,isResponding:a,onRegenerate:n?()=>n(C.id):void 0}:void 0;return e(Is,{message:C,assistantActions:v,onStreamingComplete:()=>p?.(C.id),streamIntervalMs:l,streamChunkSize:d,cardHooks:m},C.id)}),f,e("div",{ref:u})]}),h&&e("div",{className:"border-t border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] p-4 z-10",children:e(nc,{onSend:o||(async()=>{}),onStop:r||(()=>{}),isResponding:a,placeholder:s})})]})};I();var og={idle:"Idle",running:"Working",success:"Success",error:"Error",pending:"Pending"},rg=({title:t="AI Agent",description:o,headerActions:r,className:n,agentStatus:a,statusText:i,onHeaderPointerDown:s,showInput:l=false,...d})=>{let p=a??(d.isResponding?"running":"idle"),m=p==="running"||p==="pending",h=[og[p],o].filter(Boolean).join(" \xB7 ");return c("div",{className:rt("orb-agent-panel",n),children:[c("div",{className:rt("orb-agent-header",s&&"cursor-grab active:cursor-grabbing"),onPointerDown:s,children:[e("span",{className:"orb-agent-avatar","aria-hidden":"true",children:"AI"}),c("div",{className:"min-w-0 flex-1",children:[e("div",{className:"orb-agent-title",children:t}),c("div",{className:"orb-agent-subtitle",children:[e("span",{className:"orb-agent-dot","data-active":m||void 0}),e("span",{className:"truncate",children:h||"Agent"})]})]}),r&&e("div",{className:"ml-auto flex flex-none items-center gap-1",children:r})]}),e("div",{className:"relative min-h-0 flex-1",children:e(tg,{...d,showInput:l,statusLine:m?c("div",{className:rt("orb-agent-status-line","mb-1"),children:[e("span",{className:"orb-agent-spinner","aria-hidden":"true"}),e("span",{children:i??`${og[p]}\u2026`})]}):void 0})})]})};I();var wx=t=>Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t),ag=({conversations:t,activeConversationId:o,labels:r,onNewConversation:n,onSelectConversation:a})=>{let[i,s]=to.useState(false),l=to.useRef(null),d=to.useRef(null),p=to.useRef(null),m=to.useId(),h=!!a;to.useEffect(()=>{if(!i)return;let u=C=>{l.current?.contains(C.target)||s(false);},b=C=>{C.key==="Escape"&&(C.stopPropagation(),s(false),p.current?.focus());};return document.addEventListener("pointerdown",u),document.addEventListener("keydown",b),()=>{document.removeEventListener("pointerdown",u),document.removeEventListener("keydown",b);}},[i]),to.useEffect(()=>{if(!i)return;let u=d.current?.querySelector('[aria-selected="true"]'),b=d.current?.querySelector('[role="option"]');(u??b)?.focus();},[i]);let f=u=>{let b=Array.from(d.current?.querySelectorAll('[role="option"]')??[]);if(b.length===0)return;let C=b.findIndex(x=>x===document.activeElement),g=C<0?u===1?0:b.length-1:(C+u+b.length)%b.length;b[g]?.focus();};return !n&&!h?null:c(jsxRuntime.Fragment,{children:[n&&e("button",{type:"button",className:"orb-omph-icon-btn","aria-label":r.newConversation,onClick:()=>{s(false),n();},children:e(en,{size:16})}),h&&a&&c("div",{className:"orb-omph-conversation-anchor",ref:l,children:[e("button",{ref:p,type:"button",className:"orb-omph-icon-btn","aria-label":r.conversationList,"aria-expanded":i,"aria-controls":m,onClick:()=>s(u=>!u),children:e(od,{size:16})}),i&&e("div",{ref:d,id:m,className:"orb-omph-conversations",role:"listbox","aria-label":r.conversations,onKeyDown:u=>{u.key==="ArrowDown"?(u.preventDefault(),f(1)):u.key==="ArrowUp"&&(u.preventDefault(),f(-1));},children:t.length===0?e("p",{className:"orb-omph-conversation-empty",children:r.noConversations}):t.map(u=>{let b=u.updatedAt?wx(u.updatedAt):"",C=[u.preview,b].filter(x=>x&&x.length>0).join(" \xB7 "),g=u.id===o;return c("button",{type:"button",role:"option",className:"orb-omph-conversation","aria-selected":g,"data-active":g||void 0,onClick:()=>{a(u.id),s(false);},children:[e("span",{className:"orb-omph-conversation-title",children:u.title}),C&&e("span",{className:"orb-omph-conversation-meta",children:C})]},u.id)})})]})]})};var Sx=t=>{let o=0;for(let r=0;r<t.length;r+=1){let n=t.charCodeAt(r);if(n<65||n>90)break;o=o*26+(n-64);}return o-1},kx=/^\$?([A-Za-z]+)\$?\d+$/,ig=t=>{let o=[];return t.querySelectorAll("t").forEach(r=>o.push(r.textContent??"")),o.join("")},Ms=t=>new DOMParser().parseFromString(t,"application/xml"),Px="http://schemas.openxmlformats.org/officeDocument/2006/relationships",sg=async t=>{let{default:o}=await import('jszip'),r=await o.loadAsync(t),n=[],a=r.file("xl/sharedStrings.xml");a&&Ms(await a.async("string")).querySelectorAll("si").forEach(u=>n.push(ig(u)));let i=r.file("xl/workbook.xml");if(!i)throw new Error("Not an xlsx workbook");let s=Ms(await i.async("string")),l=new Map,d=r.file("xl/_rels/workbook.xml.rels");d&&Ms(await d.async("string")).querySelectorAll("Relationship").forEach(u=>{let b=u.getAttribute("Id"),C=u.getAttribute("Target");b&&C&&l.set(b,C.startsWith("xl/")?C:`xl/${C.replace(/^\//,"")}`);});let p=2e5,m=[],h=Array.from(s.querySelectorAll("sheet"));for(let f of h){let u=f.getAttribute("name")??`Sheet${m.length+1}`,b=f.getAttributeNS(Px,"id"),C=b&&l.get(b)||`xl/worksheets/sheet${m.length+1}.xml`,g=r.file(C);if(!g)continue;let x=Ms(await g.async("string")),v=[],y=false;for(x.querySelectorAll("row").forEach(k=>{if(v.length>=5e3||p<=0){y=true;return}let S=[];k.querySelectorAll("c").forEach(P=>{if(p<=0)return;let M=P.getAttribute("r")??"",w=kx.exec(M),N=w?Sx(w[1].toUpperCase()):S.length;if(N<0)return;let A=P.getAttribute("t"),T="";if(A==="inlineStr"){let R=P.querySelector("is");T=R?ig(R):"";}else {let R=P.querySelector("v")?.textContent??"";A==="s"?T=n[Number(R)]??"":A==="b"?T=R==="1"?"TRUE":"FALSE":T=R;}T!==""&&(S[N]=T,p-=1);}),v.push(Array.from(S,P=>P??""));});v.length>0&&v[v.length-1].every(k=>k==="");)v.pop();m.push({name:u,rows:v,truncated:y});}if(m.length===0)throw new Error("No worksheets found");return m},lg=t=>t.map(o=>{let r=[...o];for(;r.length>0&&r[r.length-1]==="";)r.pop();return r.join(" ")}).join(`
200
+ `);I();var Rx=2e3,Nx=1/3,Rs=[.25,.5,.75,1,1.5,2,3,4],Dx=100,Ax=500,Ex=100,Lx=9,Ox=1e3,cg=14,dg={color:"inherit",background:"transparent",textShadow:"none",fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",textAlign:"left",wordSpacing:"normal",wordBreak:"normal",overflowWrap:"normal",tabSize:"inherit",hyphens:"none"},ug=({text:t,language:o,startLine:r,endLine:n,wrap:a,labels:i})=>{let s=to.useRef(null),l=to.useMemo(()=>{let m=t.split(`
201
+ `);m.length>1&&m[m.length-1]===""&&m.pop();let h=Math.min(m.length,Rx);return {shown:m.slice(0,h).join(`
202
+ `),shownCount:h,total:m.length}},[t]),d=to.useCallback(m=>{let h=n??r,f=r!==void 0&&h!==void 0&&m>=r&&m<=h;return {className:"orb-omph-code-line","data-line":m,...f?{"data-hit":"true"}:{}}},[n,r]);to.useEffect(()=>{let m=s.current,h=m?.closest(".orb-omph-pv-body");if(!m||!h)return;if(r===void 0){h.scrollTop=0;return}let f=m.querySelector(`[data-line="${r}"]`);if(!f)return;let u=f.getBoundingClientRect().top-h.getBoundingClientRect().top+h.scrollTop;h.scrollTop=Math.max(0,u-h.clientHeight*Nx);},[r,l.shown]);let p={"--orb-omph-digits":String(l.shownCount).length};return c("div",{ref:s,className:"orb-omph-code","data-wrap":a||void 0,style:p,children:[e(reactSyntaxHighlighter.Prism,{language:o,useInlineStyles:false,PreTag:"div",CodeTag:"div",showLineNumbers:true,wrapLines:true,lineProps:d,customStyle:dg,codeTagProps:{className:`language-${o}`,style:dg},children:l.shown}),l.total>l.shownCount&&e("div",{className:"orb-omph-pv-note",children:i.previewTruncated(l.shownCount,l.total)})]})},mg=({text:t})=>e("div",{className:"orb-omph-pv-doc",children:e(Nn,{content:t})}),gg=({url:t,alt:o,labels:r})=>{let[n,a]=to.useState("fit"),[i,s]=to.useState(null),[l,d]=to.useState(false),p=n==="fit"?1:n,m=Rs.some(b=>b>p),h=Rs.some(b=>b<p),f=b=>a(C=>{let g=C==="fit"?1:C;return (b>0?Rs.find(v=>v>g):[...Rs].reverse().find(v=>v<g))??C}),u=n==="fit"||i===null?{maxWidth:"100%",height:"auto"}:{width:i*n,maxWidth:"none",height:"auto"};return l?e("div",{className:"orb-omph-pv-note",role:"alert",children:o?`${r.imageFailed} \xB7 ${o}`:r.imageFailed}):c("div",{className:"orb-omph-img",children:[e("div",{className:"orb-omph-img-stage",children:e("img",{src:t,alt:o??"",draggable:false,style:u,onLoad:b=>s(b.currentTarget.naturalWidth),onError:()=>d(true)})}),c("div",{className:"orb-omph-img-zoom",role:"group","aria-label":r.zoomFit,children:[e("button",{type:"button","aria-label":r.zoomOut,disabled:!h,onClick:()=>f(-1),children:"\u2212"}),e("button",{type:"button","aria-label":r.zoomFit,"data-active":n==="fit"||void 0,onClick:()=>a("fit"),children:n==="fit"?r.zoomFit:`${Math.round(n*Dx)}%`}),e("button",{type:"button","aria-label":r.zoomIn,disabled:!m,onClick:()=>f(1),children:"+"})]})]})},Fx=t=>{let o=t+1,r="";for(;o>0;){let n=(o-1)%26;r=String.fromCharCode(65+n)+r,o=Math.floor((o-1)/26);}return r},hg=({body:t,labels:o})=>{let[r,n]=to.useState({status:"parsing"}),[a,i]=to.useState(0),[s,l]=to.useState(false);to.useEffect(()=>{let h=false,f=new AbortController;return n({status:"parsing"}),(async()=>{if(t.bytes)return t.bytes;if(!t.url)throw new Error("Sheet body has neither bytes nor url");let b=await fetch(t.url,{signal:f.signal});if(!b.ok)throw new Error(`HTTP ${b.status}`);return b.arrayBuffer()})().then(b=>sg(b)).then(b=>{h||(i(0),n({status:"ready",sheets:b}));}).catch(b=>{h||b instanceof DOMException&&b.name==="AbortError"||n({status:"error",message:b instanceof Error?b.message:String(b)});}),()=>{h=true,f.abort();}},[t]),to.useEffect(()=>{if(!s)return;let h=window.setTimeout(()=>l(false),Ox);return ()=>window.clearTimeout(h)},[s]);let d=r.status==="ready"?r.sheets[Math.min(a,r.sheets.length-1)]:null,p=to.useMemo(()=>{if(!d)return null;let h=Math.min(d.rows.reduce((u,b)=>Math.max(u,b.length),0),Ex),f=d.rows.slice(0,Ax);return {columnCount:h,shownRows:f}},[d]);if(r.status==="parsing")return e("div",{className:"orb-omph-pv-skel",role:"status","aria-label":o.previewLoading,children:Array.from({length:Lx},(h,f)=>e("span",{},f))});if(r.status==="error")return c("div",{className:"orb-omph-pv-note",role:"alert",children:[o.previewFailed," \xB7 ",r.message]});if(!d||!p)return null;let m=d.truncated||d.rows.length>p.shownRows.length;return c("div",{className:"orb-omph-sheet",children:[c("div",{className:"orb-omph-sheet-bar",children:[e("div",{className:"orb-omph-sheet-tabs",role:"tablist",children:r.sheets.map((h,f)=>e("button",{type:"button",role:"tab","aria-selected":f===a,"data-active":f===a||void 0,className:"orb-omph-sheet-tab",onClick:()=>i(f),children:h.name},h.name))}),e("button",{type:"button",className:"orb-omph-icon-button","aria-label":s?o.copied:o.previewCopyContent,title:s?o.copied:o.previewCopyContent,onClick:()=>{navigator.clipboard.writeText(lg(d.rows)).then(()=>l(true));},children:s?e(So,{size:cg}):e(Eo,{size:cg})})]}),c("div",{className:"orb-omph-sheet-scroll",children:[c("table",{className:"orb-omph-sheet-grid",children:[e("thead",{children:c("tr",{children:[e("th",{className:"orb-omph-sheet-corner","aria-label":d.name}),Array.from({length:p.columnCount},(h,f)=>e("th",{scope:"col",children:Fx(f)},f))]})}),e("tbody",{children:p.shownRows.map((h,f)=>c("tr",{children:[e("th",{scope:"row",children:f+1}),Array.from({length:p.columnCount},(u,b)=>e("td",{children:h[b]??""},b))]},f))})]}),d.rows.length===0&&e("div",{className:"orb-omph-pv-note",children:o.previewUnsupported}),m&&e("div",{className:"orb-omph-pv-note",children:o.previewSheetTruncated(p.shownRows.length,d.rows.length)})]})]})};var Bx=/^[a-z][a-z0-9+.-]*:/i,Hx=/^L(\d+)(?:-L?(\d+))?$/i;var fg=["B","KB","MB","GB"];var zx=t=>{try{return decodeURIComponent(t)}catch{return t}},sc=t=>{let o=t.trim();if(!o||o.startsWith("#")||o.startsWith("//")||Bx.test(o))return null;let r=o.indexOf("#"),n=r>=0?o.slice(0,r):o,a=r>=0?o.slice(r+1):"",i=n.indexOf("?"),s=zx(i>=0?n.slice(0,i):n);if(!s||s.endsWith("/"))return null;let l=Hx.exec(a);if(!l)return {path:s};let d=Number(l[1]);if(d<1)return {path:s};let p=l[2]?Number(l[2]):d;return {path:s,startLine:d,endLine:Math.max(d,p)}},Ns=t=>t.split("/").filter(Boolean).pop()??t,vg=t=>{let o=t.split("/");return o.pop(),o.join("/")},Ds=t=>{let o=Ns(t),r=o.lastIndexOf(".");return r>0?o.slice(r+1).toLowerCase():""},yg={prism:"text",label:"Text"},bg={ts:{prism:"typescript",label:"TypeScript"},tsx:{prism:"tsx",label:"TSX"},js:{prism:"javascript",label:"JavaScript"},mjs:{prism:"javascript",label:"JavaScript"},cjs:{prism:"javascript",label:"JavaScript"},jsx:{prism:"jsx",label:"JSX"},json:{prism:"json",label:"JSON"},py:{prism:"python",label:"Python"},java:{prism:"java",label:"Java"},go:{prism:"go",label:"Go"},rs:{prism:"rust",label:"Rust"},c:{prism:"c",label:"C"},h:{prism:"c",label:"C"},cpp:{prism:"cpp",label:"C++"},cs:{prism:"csharp",label:"C#"},sql:{prism:"sql",label:"SQL"},sh:{prism:"bash",label:"Shell"},bash:{prism:"bash",label:"Shell"},yml:{prism:"yaml",label:"YAML"},yaml:{prism:"yaml",label:"YAML"},xml:{prism:"markup",label:"XML"},html:{prism:"markup",label:"HTML"},css:{prism:"css",label:"CSS"},scss:{prism:"scss",label:"SCSS"},abap:{prism:"abap",label:"ABAP"},toml:{prism:"toml",label:"TOML"},ini:{prism:"ini",label:"INI"},md:{prism:"markdown",label:"Markdown"},csv:{prism:"text",label:"CSV"},log:{prism:"text",label:"Log"},txt:yg},lc=(t,o)=>o?Object.values(bg).find(n=>n.prism===o)??{prism:o,label:o}:bg[Ds(t)]??yg,Cg=t=>{let o=t,r=0;for(;o>=1024&&r<fg.length-1;)o/=1024,r+=1;return `${r>0&&o<10?o.toFixed(1):Math.round(o).toString()} ${fg[r]}`};I();var Vx=1e3,Wx=9,Zo=16,$x={markdown:"text/markdown;charset=utf-8",code:"text/plain;charset=utf-8"},_x="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",As=(t,o)=>{let r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=o,n.click(),window.setTimeout(()=>URL.revokeObjectURL(r),1e3);},cc=({tone:t,icon:o,title:r,text:n,action:a})=>c("div",{className:"orb-omph-pv-notice","data-tone":t,role:t==="error"?"alert":void 0,children:[e("span",{className:"orb-omph-pv-notice-icon","aria-hidden":"true",children:o}),e("div",{className:"orb-omph-pv-notice-title",children:r}),n&&e("p",{className:"orb-omph-pv-notice-text",children:n}),a]}),Sg=({state:t,placement:o,expanded:r,canExpand:n,labels:a,gripProps:i,paneRef:s,onClose:l,onRetry:d,onToggleExpand:p,onOpenExternally:m})=>{let[h,f]=to.useState(true),[u,b]=to.useState(false),{open:C,ref:g,phase:x,data:v}=t,y=v?.body;to.useEffect(()=>{if(!u)return;let F=window.setTimeout(()=>b(false),Vx);return ()=>window.clearTimeout(F)},[u]),to.useEffect(()=>{C&&s.current?.focus({preventScroll:true});},[C,s,g?.path]);let k=v?.absolutePath??g?.path??"",S=y&&(y.kind==="markdown"||y.kind==="code")?y.text:k,P=S===k?a.previewCopyPath:a.previewCopyContent,M=y?.kind==="code"&&g?lc(g.path,y.language):null,w=!!(y&&(y.kind==="markdown"||y.kind==="code")&&y.previewOnly),N=!!(g&&y&&!w&&(y.kind==="markdown"||y.kind==="code"||y.kind==="image"||y.kind==="embed"||y.kind==="sheet")),A=()=>{if(!y||!g)return;let F=Ns(k);if(y.kind==="markdown"&&!/\.(md|markdown|txt)$/i.test(F)&&(F=`${F}.md`),y.kind==="markdown"||y.kind==="code"){As(new Blob([y.text],{type:$x[y.kind]}),F);return}if(y.kind==="sheet"){if(y.fileName&&(F=y.fileName),/\.(xlsx|xlsm|xls|csv)$/i.test(F)||(F=`${F}.xlsx`),y.bytes){let G=y.bytes instanceof Uint8Array?y.bytes.slice().buffer:y.bytes;As(new Blob([G],{type:_x}),F);return}y.url&&fetch(y.url).then(G=>{if(!G.ok)throw new Error(`HTTP ${G.status}`);return G.blob()}).then(G=>As(G,F)).catch(()=>window.open(y.url,"_blank","noopener"));return}(y.kind==="image"||y.kind==="embed")&&fetch(y.url).then(G=>{if(!G.ok)throw new Error(`HTTP ${G.status}`);return G.blob()}).then(G=>As(G,F)).catch(()=>window.open(y.url,"_blank","noopener"));},T=[];M&&T.push(M.label),y?.kind==="markdown"&&T.push("Markdown"),y?.kind==="image"&&g&&T.push(Ds(g.path).toUpperCase()),y?.kind==="sheet"&&g&&T.push(Ds(g.path).toUpperCase()||"XLSX"),v?.size!==void 0&&T.push(Cg(v.size)),y?.kind==="code"&&g?.startLine!==void 0&&T.push(a.previewLines(g.startLine,g.endLine??g.startLine));let R=F=>{F.key==="Escape"&&(F.stopPropagation(),l(true));},E=e("button",{type:"button",className:"orb-omph-pv-action",onClick:d,children:a.previewRetry}),O=()=>{if(!g)return null;if(x==="loading")return e("div",{className:"orb-omph-pv-skel",role:"status","aria-label":a.previewLoading,children:Array.from({length:Wx},(F,G)=>e("span",{},G))});if(x==="error"||!y)return e(cc,{tone:"error",icon:e(Ea,{size:Zo}),title:a.previewFailed,text:k,action:E});switch(y.kind){case "missing":return e(cc,{tone:"neutral",icon:e(Ba,{size:Zo}),title:a.previewMissing,text:y.message??k});case "unsupported":return e(cc,{tone:"neutral",icon:e(Ba,{size:Zo}),title:a.previewUnsupported,text:y.message??k,action:m&&e("button",{type:"button",className:"orb-omph-pv-action",onClick:()=>m(g),children:a.previewOpenExternal})});case "markdown":return e(mg,{text:y.text},g.path);case "code":return e(ug,{text:y.text,language:lc(g.path,y.language).prism,startLine:g.startLine,endLine:g.endLine,wrap:h,labels:a},g.path);case "image":return e(gg,{url:y.url,alt:y.alt,labels:a},y.url);case "sheet":return e(hg,{body:y,labels:a},g.path);case "embed":return e("iframe",{src:y.url,title:y.caption??a.previewTitle,className:"orb-omph-pv-embed"},y.url);default:return null}},$=o==="overlay",ee=y?.kind==="image"?jc:Ba;return c("aside",{ref:s,className:"orb-omph-preview","data-open":C||void 0,"data-placement":o,role:$?"dialog":"complementary","aria-label":a.previewTitle,"aria-hidden":!C||void 0,tabIndex:-1,onKeyDown:R,children:[!$&&C&&e("div",{className:"orb-omph-pv-grip","aria-label":a.previewResize,...i}),c("div",{className:"orb-omph-pv",children:[c("header",{className:"orb-omph-pv-head",children:[$&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewBack,onClick:()=>l(true),children:e(Oa,{size:Zo})}),e("span",{className:"orb-omph-pv-glyph","aria-hidden":"true",children:e(ee,{size:Zo})}),c("div",{className:"orb-omph-pv-titles",children:[e("div",{className:"orb-omph-pv-name",title:k,children:g?Ns(k):""}),e("div",{className:"orb-omph-pv-path",title:k,children:e("bdi",{children:vg(k)})})]}),c("div",{className:"orb-omph-pv-actions",children:[y?.kind==="code"&&e("button",{type:"button",className:"orb-omph-text-button","aria-pressed":h,onClick:()=>f(F=>!F),children:a.previewWrap}),N&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewDownload,title:a.previewDownload,onClick:A,children:e(Vn,{size:Zo})}),w&&g&&m&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewOpenExternal,title:a.previewOpenExternal,onClick:()=>m(g),children:e(Vn,{size:Zo})}),g&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":u?a.copied:P,title:u?a.copied:P,onClick:()=>{navigator.clipboard.writeText(S).then(()=>b(true));},children:u?e(So,{size:Zo}):e(Eo,{size:Zo})}),n&&e("button",{type:"button",className:"orb-omph-icon-button","aria-pressed":r,"aria-label":r?a.previewCollapse:a.previewExpand,title:r?a.previewCollapse:a.previewExpand,onClick:p,children:e(qc,{size:Zo})}),!$&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewClose,onClick:()=>l(true),children:e(Xt,{size:Zo})})]})]}),e("div",{className:"orb-omph-pv-meta",children:T.join(" \xB7 ")}),e("div",{className:"orb-omph-pv-body","data-kind":x==="ready"?y?.kind:void 0,children:O()})]})]})};I();var Ux=1e3,kg=50,Kx=1e3,qx=t=>t==="tool"?tn:t==="command"?_n:rd,Tg=t=>!!t.streaming||t.status==="running"||t.status==="pending",Xx=(t,o)=>o==="expanded"?true:Tg(t),Zx=t=>t!==void 0&&(t.inputTokens!==void 0||t.outputTokens!==void 0||t.durationMs!==void 0),Yx=(t,o)=>`${Math.max(1,Math.round(t/Kx))}${o.secondUnit}`,jx=({content:t})=>{let o=to.useRef(null),[r,n]=to.useState(false);return to.useEffect(()=>{let a=o.current;if(!a)return;let i=()=>n(a.scrollHeight>a.clientHeight+1);i();let s=new ResizeObserver(i);return s.observe(a),()=>s.disconnect()},[t]),e("div",{ref:o,className:"orb-omph-process-body","data-overflow":r||void 0,children:t})},Qx=({turn:t,labels:o})=>{let[r,n]=to.useState(false),[a,i]=to.useState(false),s=t.assistant?.content??"",l=t.usage;return to.useEffect(()=>{if(!r)return;let d=window.setTimeout(()=>n(false),Ux);return ()=>window.clearTimeout(d)},[r]),c("div",{className:"orb-omph-turn-actions",role:"group","aria-label":o.turnActions,children:[e("span",{className:"orb-omph-actions-time",children:t.assistant?.timestamp.toLocaleTimeString()}),Zx(l)&&c(jsxRuntime.Fragment,{children:[e("span",{className:"orb-omph-actions-divider","aria-hidden":"true"}),e("button",{type:"button",className:"orb-omph-text-button","aria-expanded":a,onClick:()=>i(d=>!d),children:o.usage})]}),e("button",{type:"button",className:"orb-omph-icon-button orb-omph-actions-end","aria-label":r?o.copied:o.copy,onClick:()=>{navigator.clipboard.writeText(s).then(()=>n(true));},children:r?e(So,{size:14}):e(Eo,{size:14})}),a&&l&&c("div",{className:"orb-omph-usage",children:[l.inputTokens!==void 0&&c("span",{children:[o.inputTokens," ",l.inputTokens.toLocaleString()]}),l.outputTokens!==void 0&&c("span",{children:[o.outputTokens," ",l.outputTokens.toLocaleString()]}),l.durationMs!==void 0&&c("span",{children:[o.duration," ",Yx(l.durationMs,o)]})]})]})},Jx=({item:t,display:o,open:r,onToggle:n})=>{let a=qx(t.kind),i=Tg(t),s=o!=="compact"&&!!t.summary,l=r&&!!t.content;return c("div",{className:"orb-omph-process","data-status":t.status,"data-open":r||void 0,children:[c("button",{type:"button",className:"orb-omph-process-toggle","aria-expanded":r,onClick:n,children:[e(zo,{size:12,className:"orb-omph-process-chevron"}),e(a,{size:14}),e("span",{className:i?"orb-omph-shimmer":void 0,children:t.title}),s&&e("span",{className:"orb-omph-process-summary",children:t.summary})]}),l&&t.content&&e(jx,{content:t.content}),r&&t.streaming&&e("span",{className:"orb-omph-caret","aria-hidden":"true"})]})},dc=t=>{let o=t.user?.content||t.assistant?.content||t.id,r=o.split(`
203
+ `).find(n=>n.trim())??o;return r.length>kg?`${r.slice(0,kg)}\u2026`:r},e0=0,Ig=({turns:t,labels:o,processDisplay:r,cardHooks:n,resolveFileLink:a,onOpenFile:i})=>{let[s,l]=to.useState({}),d=p=>{if(!i||p.defaultPrevented||p.button!==e0||p.metaKey||p.ctrlKey||p.shiftKey||p.altKey)return;let m=p.target.closest("a[href]");if(!m)return;let h=a(m.getAttribute("href")??"");h&&(p.preventDefault(),i(h,m));};return e(jsxRuntime.Fragment,{children:t.map((p,m)=>{let h=!!(p.assistant&&!p.assistant.streaming),u=m===t.length-1&&h?"always":"hover";return c("article",{className:"orb-omph-turn","data-omph-turn":p.id,"data-actions-reveal":u,children:[p.user&&c("div",{className:"orb-omph-user",children:[e("div",{className:"orb-omph-user-bubble","data-queued":p.user.queued||void 0,children:p.user.content}),c("div",{className:"orb-omph-user-meta",children:[p.user.queued&&e("span",{className:"orb-omph-user-queued",children:o.supplementQueued}),e("span",{className:"orb-omph-clock",children:p.user.timestamp.toLocaleTimeString()})]})]}),p.process&&p.process.length>0&&e("div",{className:"orb-omph-process-list",children:p.process.map(b=>{let C=b.id in s?s[b.id]:Xx(b,r);return e(Jx,{item:b,display:r,open:C,onToggle:()=>l(g=>({...g,[b.id]:!C}))},b.id)})}),p.assistant&&c("div",{className:"orb-omph-assistant","data-file-links":i?"true":void 0,onClick:d,children:[e(Ts,{content:p.assistant.content,messageId:p.assistant.id,cardHooks:n}),p.assistant.streaming&&e("span",{className:"orb-omph-caret","aria-hidden":"true"})]}),p.failure&&e("div",{className:"orb-omph-failure","data-severity":p.failure.severity,children:p.failure.content}),h&&e(Qx,{turn:p,labels:o})]},p.id)})})};var pc=t=>({idle:t("omph.status.idle"),pending:t("omph.status.pending"),running:t("omph.status.running"),success:t("omph.status.success"),error:t("omph.status.error"),working:t("omph.working"),workingFor:o=>t("omph.workingFor",{duration:o}),loadOlder:t("omph.loadOlder"),loadingOlder:t("omph.loadingOlder"),toBottom:t("omph.toBottom"),copy:t("omph.copy"),copied:t("omph.copied"),turnActions:t("omph.turnActions"),usage:t("omph.usage"),inputTokens:t("omph.inputTokens"),outputTokens:t("omph.outputTokens"),duration:t("omph.duration"),send:t("omph.send"),stop:t("omph.stop"),supplementQueued:t("omph.supplement.queued"),turnRail:t("omph.turnRail"),secondUnit:t("omph.secondUnit"),minuteUnit:t("omph.minuteUnit"),previewTitle:t("omph.preview.title"),previewClose:t("omph.preview.close"),previewBack:t("omph.preview.back"),previewExpand:t("omph.preview.expand"),previewCollapse:t("omph.preview.collapse"),previewCopyContent:t("omph.preview.copyContent"),previewCopyPath:t("omph.preview.copyPath"),previewDownload:t("omph.preview.download"),previewOpenExternal:t("omph.preview.openExternal"),previewWrap:t("omph.preview.wrap"),previewLoading:t("omph.preview.loading"),previewMissing:t("omph.preview.missing"),previewFailed:t("omph.preview.failed"),previewUnsupported:t("omph.preview.unsupported"),previewRetry:t("omph.preview.retry"),previewResize:t("omph.preview.resize"),previewLines:(o,r)=>t(o===r?"omph.preview.line":"omph.preview.lines",{start:o,end:r}),previewTruncated:(o,r)=>t("omph.preview.truncated",{shown:o,total:r}),previewSheetTruncated:(o,r)=>t("omph.preview.sheetTruncated",{shown:o,total:r}),imageFailed:t("omph.preview.imageFailed"),zoomIn:t("omph.preview.zoomIn"),zoomOut:t("omph.preview.zoomOut"),zoomFit:t("omph.preview.zoomFit"),newConversation:t("omph.newConversation"),conversationList:t("omph.conversationList"),conversations:t("omph.conversations"),noConversations:t("omph.noConversations")}),uc=t=>({waiting:t("omph.approval.waiting"),choose:t("omph.approval.choose"),details:t("omph.approval.details"),choices:t("omph.approval.choices"),reject:t("omph.approval.reject"),allowOnce:t("omph.approval.allowOnce"),confirm:t("omph.approval.confirm"),other:t("omph.approval.other"),otherPlaceholder:t("omph.approval.otherPlaceholder"),escalation:o=>t("omph.approval.escalation",{toolName:o})});var t0=1e3,Mg=60,o0=1e3,Rg=(t,o)=>{let r=Math.max(1,Math.round(Math.max(t,o0)/t0)),n=Math.floor(r/Mg),a=r%Mg;return n<=0?`${r}${o.secondUnit}`:`${n}${o.minuteUnit} ${a}${o.secondUnit}`};var a0={open:false,ref:null,phase:"loading",data:null},Ng=t=>{let[o,r]=to.useState(a0),n=to.useRef(o);n.current=o;let a=to.useRef(t);a.current=t;let i=to.useRef(null),s=to.useRef(0),l=to.useRef(null),d=to.useCallback(f=>{let u=a.current;if(!u)return;i.current?.abort();let b=new AbortController;i.current=b,s.current+=1;let C=s.current;r({open:true,ref:f,phase:"loading",data:null}),u(f,b.signal).then(g=>{C===s.current&&r(x=>({...x,phase:"ready",data:g}));},()=>{C!==s.current||b.signal.aborted||r(g=>({...g,phase:"error",data:null}));});},[]),p=to.useCallback((f,u)=>{l.current=u??null;let b=n.current;if(b.ref?.path===f.path&&b.phase==="ready"){r({...b,open:true,ref:f});return}d(f);},[d]),m=to.useCallback((f=false)=>{s.current+=1,i.current?.abort(),r(b=>({...b,open:false}));let u=l.current;f&&u?.isConnected&&u.focus({preventScroll:true});},[]),h=to.useCallback(()=>{let{ref:f}=n.current;f&&d(f);},[d]);return to.useEffect(()=>()=>{i.current?.abort();},[]),{state:o,open:p,close:m,reload:h}};var gc="--orb-omph-pv-w",hc="--orb-omph-pv-pref",l0=880,c0=560,Ag=400,Gr=320,d0=.45,p0=.7,Eg=24,mc=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),Lg=({open:t,layout:o})=>{let r=to.useRef(null),n=to.useRef(null),[a,i]=to.useState(0),[s,l]=to.useState(null),[d,p]=to.useState(false),[m,h]=to.useState(false);to.useLayoutEffect(()=>{let P=r.current;if(!P)return;let M=()=>i(P.getBoundingClientRect().width);M();let w=new ResizeObserver(M);return w.observe(P),()=>w.disconnect()},[]),to.useEffect(()=>{t||p(false);},[t]);let f=o==="overlay"?false:o==="split"?a>=Ag+Gr:a>=l0,u=f&&!d?"split":"overlay",b=Math.max(Gr,Math.min(a*p0,a-Ag)),C=mc(s??a*d0,Gr,b),g=a>0&&a<c0,x=to.useCallback(P=>{let M=r.current;M&&(M.style.setProperty(hc,`${P}px`),M.dataset.placement==="split"&&M.dataset.open==="true"&&M.style.setProperty(gc,`${P}px`));},[]),v=to.useCallback(P=>{P.button===0&&(P.preventDefault(),P.currentTarget.setPointerCapture(P.pointerId),n.current={pointerId:P.pointerId,startX:P.clientX,startWidth:C,latest:C},h(true));},[C]),y=to.useCallback(P=>{let M=n.current;!M||M.pointerId!==P.pointerId||(M.latest=mc(M.startWidth+(M.startX-P.clientX),Gr,b),x(M.latest));},[b,x]),k=to.useCallback(P=>{let M=n.current;!M||M.pointerId!==P.pointerId||(n.current=null,P.currentTarget.hasPointerCapture(P.pointerId)&&P.currentTarget.releasePointerCapture(P.pointerId),l(M.latest),h(false));},[]),S=to.useCallback(P=>{let M={ArrowLeft:C+Eg,ArrowRight:C-Eg,Home:Gr,End:b};P.key in M&&(P.preventDefault(),l(mc(M[P.key],Gr,b)));},[b,C]);return {mainRef:r,placement:u,width:C,compact:g,dragging:m,expanded:d,canExpand:f,toggleExpanded:()=>p(P=>!P),gripProps:{role:"separator","aria-orientation":"vertical","aria-valuemin":Gr,"aria-valuemax":Math.round(b),"aria-valuenow":Math.round(C),tabIndex:0,onPointerDown:v,onPointerMove:y,onPointerUp:k,onPointerCancel:k,onKeyDown:S}}};var Fs=48,m0=900,Fg=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Bg=({turns:t,contentVersion:o,hasOlder:r=false,loadingOlder:n=false,onLoadOlder:a})=>{let i=to.useRef(null),s=to.useRef(null),l=to.useRef(true),d=to.useRef({height:0,top:0}),p=to.useRef(void 0),m=to.useRef(false),[h,f]=to.useState(true),[u,b]=to.useState(false),[C,g]=to.useState(t[0]?.id),x=to.useCallback(()=>{let P=i.current;P&&(d.current={height:P.scrollHeight,top:P.scrollTop});},[]),v=to.useCallback(()=>{let P=i.current;if(!P)return;let M=P.getBoundingClientRect().top,w=P.querySelector("[data-omph-turn]")?.dataset.omphTurn;P.querySelectorAll("[data-omph-turn]").forEach(N=>{N.getBoundingClientRect().top-M<=Fs&&(w=N.dataset.omphTurn);}),g(w);},[]);to.useEffect(()=>{let P=i.current,M=s.current;if(!P||!M)return;let w=()=>{b(P.clientWidth>m0),l.current&&(P.scrollTop=P.scrollHeight),x();};w();let N=new ResizeObserver(w);return N.observe(P),N.observe(M),()=>N.disconnect()},[x]),to.useLayoutEffect(()=>{let P=i.current;if(!P)return;let M=t[0]?.id,w=p.current,N=w!==void 0&&t.some(R=>R.id===w),A=N&&M!==void 0&&M!==w,T=w!==void 0&&!N;if(p.current=M,T){l.current=true,f(true),P.scrollTop=P.scrollHeight,x(),v();return}if(A){l.current=false,f(false);let R=P.scrollHeight-d.current.height;P.scrollTop=d.current.top+Math.max(0,R),x(),v();return}l.current&&(P.scrollTop=P.scrollHeight),x(),v();},[o,x,t,v]),to.useEffect(()=>{n||(m.current=false);},[n]);let y=to.useCallback(()=>{let P=i.current;if(!P)return;let w=P.scrollHeight-P.scrollTop-P.clientHeight<=Fs;w!==l.current&&(l.current=w,f(w)),x(),v();let N=P.scrollHeight-P.clientHeight>Fs,A=P.scrollTop<=Fs;!N||!A||w||!r||n||!a||m.current||(m.current=true,a());},[r,n,a,x,v]),k=to.useCallback(()=>{let P=i.current;P&&(l.current=true,f(true),P.scrollTo({top:P.scrollHeight,behavior:Fg()?"auto":"smooth"}));},[]),S=to.useCallback(P=>{let w=i.current?.querySelector(`[data-omph-turn="${CSS.escape(P)}"]`);w&&(l.current=false,f(false),w.scrollIntoView({block:"start",behavior:Fg()?"auto":"smooth"}));},[]);return {scrollerRef:i,contentRef:s,following:h,railVisible:u,activeTurnId:C,onScroll:y,returnToBottom:k,scrollToTurn:S}};I();var h0=1e3,f0=(t,o)=>o[t],b0=t=>t.map(o=>[o.id,o.user?.content.length??0,o.assistant?.content.length??0,o.assistant?.streaming?"1":"0",o.failure?.id??"",(o.process??[]).map(r=>`${r.id}:${r.status}:${r.content?.length??0}`).join(",")].join(":")).join("|"),v0=({startedAt:t,labels:o})=>{let[r,n]=to.useState(()=>Date.now());to.useEffect(()=>{n(Date.now());let i=window.setInterval(()=>n(Date.now()),h0);return ()=>window.clearInterval(i)},[t]);let a=t===void 0?o.working:o.workingFor(Rg(Math.max(0,r-t),o));return c("div",{className:"orb-omph-running","data-omph-running":"true",children:[e("span",{className:"orb-visually-hidden",role:"status","aria-live":"polite",children:o.working}),e("span",{className:"orb-omph-running-rule","aria-hidden":"true"}),c("span",{className:"orb-omph-running-body",children:[e("span",{className:"orb-omph-spinner","aria-hidden":"true"}),e("span",{className:"orb-omph-shimmer",children:a})]})]})},u5=({turns:t,title:o,avatar:r,description:n,headerActions:a,agentStatus:i,isResponding:s=false,labels:l,processDisplay:d="standard",showInput:p=false,placeholder:m,className:h,cardHooks:f,hasOlder:u=false,loadingOlder:b=false,onLoadOlder:C,onSend:g,onStop:x,onHeaderPointerDown:v,conversations:y=[],activeConversationId:k,onNewConversation:S,onSelectConversation:P,loadFilePreview:M,resolveFileLink:w=sc,filePreviewLayout:N="auto",onOpenFileExternally:A})=>{let{t:T}=de(),R={...pc(T),...l},E=i??(s?"running":"idle"),O=E==="running"||E==="pending",$=[f0(E,R),n].filter(Boolean).join(" \xB7 "),ee=to.useMemo(()=>b0(t),[t]),F=Bg({turns:t,contentVersion:ee,hasOlder:u,loadingOlder:b,onLoadOlder:C}),[G,W]=to.useState(""),Q=G.trim(),z=s&&Q.length===0,H=[...t].reverse().find(pe=>!!pe.assistant?.streaming||pe.process?.some(ye=>ye.streaming||ye.status==="running"||ye.status==="pending")),X=O?H?.startedAt:void 0,Y=!!M,j=Ng(M),te=Lg({open:j.state.open,layout:N}),ce=to.useRef(null),fe=to.useRef(null),Ve=Y&&j.state.open&&te.placement==="overlay",ve=te.placement==="split"&&j.state.open,xe={[hc]:`${te.width}px`,[gc]:ve?`${te.width}px`:"0px"};to.useEffect(()=>{fe.current?.toggleAttribute("inert",Ve);},[Ve]);let He=async()=>{if(!Q||!g)return;let pe=Q;W("");try{await g(pe);}catch{W(ye=>ye.trim().length===0?pe:ye);}};return c("div",{className:rt("orb-omph-panel",h),"data-omph-panel":"","data-status":E,"data-compact":te.compact||void 0,children:[c("div",{className:rt("orb-omph-header",v&&"cursor-grab active:cursor-grabbing"),onPointerDown:v,children:[e("span",{className:"orb-omph-avatar","aria-hidden":"true",children:r??"AI"}),c("div",{className:"min-w-0 flex-1",children:[o&&e("div",{className:"orb-omph-title",children:o}),c("div",{className:"orb-omph-subtitle",children:[e("span",{className:"orb-omph-dot","data-active":O||void 0}),e("span",{className:"truncate",children:$||R.idle})]})]}),(S||P||a)&&c("div",{className:"orb-omph-header-actions",onPointerDown:pe=>pe.stopPropagation(),children:[e(ag,{conversations:y,activeConversationId:k,labels:R,onNewConversation:S,onSelectConversation:P}),a]})]}),c("div",{ref:te.mainRef,className:"orb-omph-main","data-placement":te.placement,"data-open":String(j.state.open),"data-dragging":te.dragging||void 0,style:xe,children:[c("div",{ref:fe,className:"orb-omph-center",children:[c("div",{className:"orb-omph-stage","data-rail":F.railVisible||void 0,children:[e("div",{ref:F.scrollerRef,className:"orb-omph-scroll",onScroll:F.onScroll,children:c("div",{ref:F.contentRef,className:"orb-omph-column",children:[u&&C&&e("button",{type:"button",className:"orb-omph-older",disabled:b,onClick:C,children:b?R.loadingOlder:R.loadOlder}),e(Ig,{turns:t,labels:R,processDisplay:d,cardHooks:f,resolveFileLink:w,onOpenFile:Y?j.open:void 0}),O&&e(v0,{startedAt:X,labels:R})]})}),F.railVisible&&t.length>0&&e("nav",{className:"orb-omph-rail","aria-label":R.turnRail,children:t.map(pe=>e("button",{type:"button",className:"orb-omph-rail-mark","data-active":F.activeTurnId===pe.id||void 0,"aria-label":dc(pe),title:dc(pe),onClick:()=>F.scrollToTurn(pe.id)},pe.id))}),!F.following&&e("button",{type:"button",className:"orb-omph-to-bottom","aria-label":R.toBottom,onClick:F.returnToBottom,children:e(zo,{size:16})})]}),p&&c("form",{className:"orb-omph-composer",onSubmit:pe=>{pe.preventDefault(),z?x?.():He();},children:[e("textarea",{className:"orb-omph-input",value:G,placeholder:m,rows:1,onChange:pe=>W(pe.target.value),onKeyDown:pe=>{pe.key!=="Enter"||pe.shiftKey||pe.nativeEvent.isComposing||(pe.preventDefault(),z?x?.():He());}}),!z&&s&&x&&e("button",{type:"button",className:"orb-omph-stop-secondary","aria-label":R.stop,title:R.stop,onClick:x,children:e(Zs,{size:14})}),e("button",{type:"submit",className:z?"orb-omph-stop":"orb-omph-send","aria-label":z?R.stop:R.send,disabled:!z&&Q.length===0,children:z?e(Zs,{size:16}):e(_c,{size:16})})]})]}),Y&&e(Sg,{state:j.state,placement:te.placement,expanded:te.expanded,canExpand:te.canExpand,labels:R,gripProps:te.gripProps,paneRef:ce,onClose:j.close,onRetry:j.reload,onToggleExpand:te.toggleExpanded,onOpenExternally:A})]})]})};I();var br="other",y0=t=>t instanceof HTMLElement&&t.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')!==null,C0=({request:t,onDecide:o,labels:r})=>{let{t:n}=de(),a={...uc(n),...r},i=to.useRef(null),s=to.useRef(null),l=to.useRef(false),d=to.useRef(false),[p,m]=to.useState(false),[h,f]=to.useState(null),[u,b]=to.useState(""),C=t.choices??[],g=t.allowOther??C.length>0,x=C.length>0||g,v=t.reason?.trim()||a.escalation(t.toolName),y=t.detail?.trim(),k=h===br&&u.trim().length>0,S=!x||h!==null&&h!==br||k;to.useEffect(()=>{m(false),f(null),b(""),i.current?.focus();},[t.id]),to.useEffect(()=>{h===br&&s.current?.focus();},[h]);let P=N=>{p||(m(true),o(N,t));},M=()=>{if(S){if(!x){P({kind:"allowed-once"});return}if(h===br){let N=u.trim();if(!N)return;P({kind:"other",text:N});return}h&&P({kind:"choice",choiceId:h});}},w=N=>{if(!(p||y0(N.target))&&!(N.key!=="Enter"&&N.key!=="Escape")&&!(N.key==="Enter"&&N.target instanceof HTMLElement&&N.target.closest('button, a[href], [role="button"]'))&&!(N.ctrlKey||N.metaKey||N.altKey||N.shiftKey)&&(N.preventDefault(),N.stopPropagation(),!(N.repeat||l.current||d.current||N.nativeEvent.isComposing))){if(N.key==="Escape"){P({kind:"rejected"});return}M();}};return e("div",{className:"orb-omph-approval","data-omph-approval":t.id,"aria-busy":p,onKeyDown:w,onKeyUpCapture:()=>{d.current=false;},onCompositionStartCapture:()=>{l.current=true;},onCompositionEndCapture:()=>{l.current=false,d.current=true;},children:c("div",{className:"orb-omph-approval-card",children:[c("div",{className:"orb-omph-approval-strip",children:[e("span",{className:"orb-omph-approval-dot","aria-hidden":"true"}),x?a.choose:a.waiting]}),c("div",{ref:i,className:"orb-omph-approval-body",tabIndex:0,role:"group","aria-label":a.details,children:[e("div",{className:"orb-omph-approval-headline",children:v}),y&&e("div",{className:"orb-omph-approval-detail",children:y}),x&&c("fieldset",{className:"orb-omph-approval-choices",disabled:p,children:[e("legend",{className:"orb-visually-hidden",children:a.choices}),C.map(N=>{let A=h===N.id;return c("label",{className:"orb-omph-approval-choice","data-selected":A,children:[e("input",{type:"radio",name:`omph-approval-${t.id}`,value:N.id,checked:A,onChange:()=>f(N.id)}),c("span",{className:"orb-omph-approval-choice-copy",children:[e("span",{children:N.label}),N.description&&e("span",{className:"orb-omph-approval-choice-description",children:N.description})]})]},N.id)}),g&&c("label",{className:"orb-omph-approval-choice","data-selected":h===br,children:[e("input",{type:"radio",name:`omph-approval-${t.id}`,value:br,checked:h===br,onChange:()=>f(br)}),e("span",{className:"orb-omph-approval-choice-copy",children:e("span",{children:a.other})})]}),g&&h===br&&e("textarea",{ref:s,className:"orb-omph-approval-other",value:u,placeholder:a.otherPlaceholder,rows:3,"aria-label":a.other,onChange:N=>b(N.target.value)})]})]}),c("div",{className:"orb-omph-approval-actions",children:[e("button",{type:"button",className:"orb-btn orb-btn-neutral orb-omph-approval-reject",disabled:p,onClick:()=>P({kind:"rejected"}),children:a.reject}),e("button",{type:"button",className:"orb-btn orb-btn-primary",disabled:p||!S,onClick:M,children:x?a.confirm:a.allowOnce})]})]})})};I();var Gg=520,S0=88,k0=88,P0=24,Hs=640,Ug=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),vc=t=>typeof t=="number"?`${t}px`:t,T0=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,k5=({anchor:t,defaultAnchor:o="right",onAnchorChange:r,width:n=Gg,top:a=S0,bottom:i=k0,inset:s=P0,zIndex:l=1300,shellClassName:d,shellStyle:p,className:m,onHeaderPointerDown:h,...f})=>{let u=to.useRef(null),b=to.useRef(null),[C,g]=to.useState(o),[x,v]=to.useState(0),[y,k]=to.useState(typeof n=="number"?n:Gg),[S,P]=to.useState(0),[M,w]=to.useState(false),N=t??C;to.useEffect(()=>{let F=()=>v(window.innerWidth);return F(),window.addEventListener("resize",F),()=>window.removeEventListener("resize",F)},[]),to.useLayoutEffect(()=>{let F=()=>{let W=u.current?.getBoundingClientRect();W?.width?k(W.width):typeof n=="number"&&k(n);};if(F(),!u.current||typeof ResizeObserver>"u")return;let G=new ResizeObserver(F);return G.observe(u.current),()=>G.disconnect()},[n]);let A=to.useCallback(F=>{if(!x)return s;let G=x<Hs?12:s,W=Math.max(G,x-y-G);return x<Hs||F==="left"?G:F==="center"?Ug((x-y)/2,G,W):W},[s,y,x]),T=to.useCallback(F=>["left","center","right"].reduce((W,Q)=>{let z=Math.abs(F-A(W));return Math.abs(F-A(Q))<z?Q:W},"right"),[A]),R=to.useCallback(F=>{t===void 0&&g(F),r?.(F);},[t,r]);to.useEffect(()=>{M||P(A(N));},[A,M,N]);let E=to.useCallback(F=>{h?.(F),!(F.defaultPrevented||T0(F.target))&&(F.preventDefault(),F.currentTarget.setPointerCapture(F.pointerId),b.current={pointerId:F.pointerId,startClientX:F.clientX,startX:S,currentX:S,captureElement:F.currentTarget},w(true));},[h,S]),O=to.useCallback(F=>{let G=b.current;if(!G||G.pointerId!==F.pointerId)return;let W=x<Hs?12:s,Q=Math.max(W,x-y-W),z=Ug(G.startX+F.clientX-G.startClientX,W,Q);G.currentX=z,P(z);},[s,y,x]),$=to.useCallback(F=>{let G=b.current;if(!G||G.pointerId!==F.pointerId)return;try{G.captureElement.releasePointerCapture(F.pointerId);}catch{}let W=T(G.currentX);b.current=null,w(false),R(W),P(A(W));},[A,R,T]),ee=to.useMemo(()=>({position:"fixed",top:vc(a),bottom:vc(i),left:S,width:vc(n),maxWidth:`calc(100vw - ${x<Hs?24:s*2}px)`,zIndex:l,pointerEvents:"auto",transition:M?"none":"left 180ms ease-out",touchAction:"none",...p}),[i,s,M,S,p,a,x,n,l]);return e("div",{ref:u,className:rt("orbcafe-floating-agent-panel min-w-0",d),"data-anchor":N,"data-dragging":M?"true":"false",style:ee,onPointerMove:O,onPointerUp:$,onPointerCancel:$,children:e(rg,{...f,className:m,onHeaderPointerDown:E})})};I();var R0={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},A5=({messages:t,onSend:o,onRegenerate:r,isResponding:n=false,className:a,placeholder:i,title:s="Copilot",corner:l="bottom-right",onCollapse:d,onHeaderPointerDown:p,onPlusClick:m,onMicClick:h,streamIntervalMs:f,streamChunkSize:u,onMessageStreamingComplete:b,cardHooks:C})=>{let[g,x]=to.useState(""),[v,y]=to.useState(false),k=to.useRef(null),S=R0[l];to.useEffect(()=>{k.current?.scrollIntoView({behavior:"smooth"});},[t,n]);let P=to.useCallback(async()=>{let w=g.trim();!w||n||(x(""),await o(w));},[n,o,g]),M=to.useCallback(async w=>{w.key==="Enter"&&!v&&(w.preventDefault(),await P());},[P,v]);return c("div",{className:rt("relative flex h-full w-full min-h-[460px] min-w-[340px] flex-col overflow-hidden rounded-3xl border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-none dark:bg-[var(--orb-surface-2)]",a),children:[d&&e("button",{onClick:d,className:rt("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",S==="top-left"&&"-left-2 -top-2",S==="top-right"&&"-right-2 -top-2",S==="bottom-left"&&"-bottom-2 -left-2",S==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:e("span",{className:rt("block h-4 w-4 border-[var(--orb-ai-accent)]",S==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",S==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",S==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",S==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),c("div",{className:"flex items-center justify-between border-b border-[var(--orb-border)] px-4 py-3",onPointerDown:p,children:[e("div",{className:"flex items-center",children:e("h3",{className:"text-base font-semibold tracking-tight text-[var(--orb-fg)]",children:s})}),e("div",{})]}),c("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((w,N)=>{let A=w.type==="assistant"&&N===t.length-1,T=w.type==="assistant"?{isLatestAssistant:A,isResponding:n,onRegenerate:r?()=>r(w.id):void 0}:void 0;return e(Is,{message:w,assistantActions:T,onStreamingComplete:()=>b?.(w.id),streamIntervalMs:f,streamChunkSize:u,cardHooks:C},w.id)}),e("div",{ref:k})]}),e("div",{className:"border-t border-[var(--orb-border)] px-3 py-3",children:c("div",{className:"flex items-center gap-2 rounded-xl border border-[var(--orb-p300)] bg-[var(--orb-canvas)] px-2 py-1.5 dark:bg-[var(--orb-surface-2)]",children:[e("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-surface)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:bg-[var(--orb-surface-2)]",onClick:m,type:"button","aria-label":"Add",children:e(en,{className:"h-4 w-4"})}),e("input",{className:"h-7 flex-1 border-none bg-transparent text-sm text-[var(--orb-fg)] outline-none placeholder:text-[var(--orb-muted)] dark:text-[var(--orb-fg)] dark:placeholder:text-[var(--orb-muted)]",placeholder:i||"Ask Copilot...",value:g,onChange:w=>x(w.target.value),onCompositionStart:()=>y(true),onCompositionEnd:()=>y(false),onKeyDown:M,"aria-label":"Copilot input",spellCheck:false}),e("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-surface)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:bg-[var(--orb-surface-2)]",onClick:h,type:"button","aria-label":"Microphone",children:e(Wa,{className:"h-4 w-4"})})]})})]})};I();var N0=["var(--orb-primary)","var(--orb-primary)","var(--orb-primary)"],D0=`
203
204
  .orbcafe-ai-browser-glow {
204
205
  position: fixed;
205
206
  inset: 0;
@@ -231,4 +232,4 @@ ${o}: ${(a??n)(g.secondaryValue??0)}`:""]})}),e("text",{x:g.x,y:Math.max(g.y-12,
231
232
  0%, 100% { opacity: 0.5; }
232
233
  50% { opacity: 1; }
233
234
  }
234
- `,qz=({active:t=false,colors:r=Jx,zIndex:o=2147483e3})=>{let n={"--orbcafe-ai-glow-line":r[0],"--orbcafe-ai-glow-z-index":o};return c(jsxRuntime.Fragment,{children:[e("style",{children:e0}),e("div",{className:"orbcafe-ai-browser-glow","data-active":t?"true":"false",style:n,"aria-hidden":"true"})]})};var s5=({defaultMode:t="login",onLogin:r,onRegister:o,onForgotPassword:n}={})=>{let[a,i]=er.useState(t),[s,l]=er.useState(false),d=er.useCallback(async m=>{l(true);try{await m?.();}finally{l(false);}},[]),u=er.useCallback(m=>d(()=>r?.(m)),[r,d]),p=er.useCallback(m=>d(()=>o?.(m)),[o,d]),f=er.useCallback(m=>d(()=>n?.(m)),[n,d]),b=er.useMemo(()=>({mode:a,loading:s,onModeChange:i,onLogin:u,onRegister:p,onForgotPassword:f}),[f,u,p,s,a]);return {mode:a,loading:s,setMode:i,authPageProps:b}};P();var o0={productName:"ORBCAFE \u2014 Enterprise suite",headline:"We digitalize you.",subheadline:"One sign-in for planning, production and analytics across your value chain.",brandMeta:"ORBCAFE \xB7 Enterprise manufacturing suite",loginTitle:"Sign in",loginSubtitle:"Use your corporate account to continue.",registerTitle:"Create account",registerSubtitle:"Request a demo workspace user for evaluation.",forgotTitle:"Reset password",forgotSubtitle:"Send a password reset request to your email address."},b5=({mode:t,defaultMode:r="login",onModeChange:o,onLogin:n,onRegister:a,onForgotPassword:i,loading:s=false,logo:l,copy:d,sx:u})=>{let p=t!==void 0,[f,b]=er.useState(r),m=t??f,v=er.useMemo(()=>({...o0,...d}),[d]),[y,g]=er.useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[x,h]=er.useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[C,k]=er.useState({email:""}),[w,T]=er.useState(""),I=E=>{p||b(E),T(""),o?.(E);},S=async E=>{E.preventDefault(),await n?.(y),T("Demo login accepted. No real authentication request was sent.");},A=async E=>{E.preventDefault(),await a?.(x),T("Demo registration saved locally for this screen.");},R=async E=>{E.preventDefault(),await i?.(C),T("Demo reset link request created. No email was sent.");},M=m==="login"?v.loginTitle:m==="register"?v.registerTitle:v.forgotTitle,N=m==="login"?v.loginSubtitle:m==="register"?v.registerSubtitle:v.forgotSubtitle;return c("div",{className:"orb-auth-frame orb-root",style:u,children:[c("div",{className:"orb-auth-brand",children:[e("span",{className:"orb-auth-dia",style:{width:230,height:230,right:-70,bottom:-60}}),e("span",{className:"orb-auth-dia orb-auth-dia-sm-hide",style:{width:140,height:140,right:120,bottom:80,borderColor:"rgba(255,255,255,.09)"}}),e("span",{className:"orb-auth-dia orb-auth-dia-sm-hide",style:{width:76,height:76,right:60,bottom:170,background:"color-mix(in oklch, var(--orb-primary) 35%, transparent)",borderColor:"rgba(255,255,255,.2)"}}),l?e("span",{style:{alignSelf:"flex-start",position:"relative"},children:l}):e("span",{className:"orb-logo-slot",children:"Host logo"}),c("div",{className:"orb-auth-claim",children:[e("div",{className:"orb-auth-rule"}),e("h2",{children:v.headline}),e("p",{children:v.subheadline})]}),e("div",{className:"orb-auth-meta",children:v.brandMeta})]}),e("div",{className:"orb-auth-form",children:c("div",{className:"orb-auth-card",children:[e("span",{className:"orb-overline",style:{letterSpacing:"0.12em"},children:v.productName}),e("h1",{className:"orb-h2",style:{margin:0},children:M}),e("p",{className:"orb-body-dense",style:{color:"var(--orb-muted)",margin:"-10px 0 0"},children:N}),w&&e(on,{severity:"success",children:w}),m==="login"&&c("form",{onSubmit:S,style:{display:"flex",flexDirection:"column",gap:16},children:[e(ze,{label:"Email",type:"email",autoComplete:"username",value:y.username,onChange:E=>g(O=>({...O,username:E.target.value})),startAdornment:e(Vs,{size:15,strokeWidth:1.8})}),e(ze,{label:"Password",type:"password",autoComplete:"current-password",value:y.password,onChange:E=>g(O=>({...O,password:E.target.value})),startAdornment:e(Ea,{size:15,strokeWidth:1.8})}),c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[e(It,{label:"Remember me",checked:y.remember,onChange:E=>g(O=>({...O,remember:E.target.checked}))}),e("button",{type:"button",className:"orb-link",onClick:()=>I("forgot"),children:"Forgot password?"})]}),e(we,{type:"submit",size:"large",block:true,loading:s,children:s?"Signing in\u2026":"Sign in"}),c("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["New user?"," ",e("button",{type:"button",className:"orb-link",onClick:()=>I("register"),children:"Register"})]})]}),m==="register"&&c("form",{onSubmit:A,style:{display:"flex",flexDirection:"column",gap:16},children:[e(ze,{label:"Full name",value:x.name,onChange:E=>h(O=>({...O,name:E.target.value})),startAdornment:e(Vs,{size:15,strokeWidth:1.8})}),e(ze,{label:"Work email",type:"email",autoComplete:"username",value:x.email,onChange:E=>h(O=>({...O,email:E.target.value})),startAdornment:e(zs,{size:15,strokeWidth:1.8})}),e(ze,{label:"Password",type:"password",autoComplete:"new-password",value:x.password,onChange:E=>h(O=>({...O,password:E.target.value})),startAdornment:e(Ea,{size:15,strokeWidth:1.8})}),e(ze,{label:"Confirm password",type:"password",autoComplete:"new-password",value:x.confirmPassword,onChange:E=>h(O=>({...O,confirmPassword:E.target.value}))}),e(It,{label:"I accept the demo workspace terms",checked:x.acceptedTerms,onChange:E=>h(O=>({...O,acceptedTerms:E.target.checked}))}),e(we,{type:"submit",size:"large",block:true,loading:s,children:"Create demo account"}),c("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Already have an account?"," ",e("button",{type:"button",className:"orb-link",onClick:()=>I("login"),children:"Sign in"})]})]}),m==="forgot"&&c("form",{onSubmit:R,style:{display:"flex",flexDirection:"column",gap:16},children:[e(ze,{label:"Work email",type:"email",autoComplete:"username",value:C.email,onChange:E=>k({email:E.target.value}),startAdornment:e(zs,{size:15,strokeWidth:1.8})}),e(we,{type:"submit",size:"large",block:true,loading:s,children:"Send reset request"}),c("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Remember your password?"," ",e("button",{type:"button",className:"orb-link",onClick:()=>I("login"),children:"Back to sign in"})]})]}),c("div",{style:{display:"flex",alignItems:"center",gap:12,font:"500 10px/1 var(--orb-font)",letterSpacing:"0.1em",textTransform:"uppercase",color:"var(--orb-muted)"},children:[e("span",{style:{flex:1,height:1,background:"var(--orb-border)"}}),"or",e("span",{style:{flex:1,height:1,background:"var(--orb-border)"}})]}),e(we,{variant:"neutral",size:"large",block:true,children:"Continue with corporate SSO"}),c("p",{className:"orb-meta",style:{textAlign:"center",fontWeight:300,margin:0},children:["Protected by corporate single sign-on.",e("br",{}),"Demo credentials: demo@orbcafe.local / orbcafe-demo"]})]})})]})};var a0={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},i0=[{id:"keyword",label:"Keyword",type:"text",placeholder:"Task/ID/Project",hasSearchIcon:true},{id:"status",label:"Status",type:"select",options:[{label:"In progress",value:"in-progress"},{label:"Blocked",value:"blocked"},{label:"Planned",value:"planned"},{label:"Not started",value:"not-started"}]},{id:"owner",label:"Owner",type:"text",placeholder:"Owner name"},{id:"workCenter",label:"Work Center",type:"text",placeholder:"CNC-02 / WH-A / ..."},{id:"dateRange",label:"Date Range",type:"date"}],Ng=({tasks:t,appId:r,tableKey:o,defaultScale:n="week",defaultSelectedTaskId:a,initialFilters:i,filterFields:s,filterAppId:l,filterTableKey:d,serviceUrl:u,variantService:p,layout:f,columns:b,page:m,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:h,onFilterSearch:C,onFilterVariantLoad:k,enableRowReorder:w,onTaskReorder:T,onLayoutIdChange:I,onLayoutSave:S})=>{let A=r??l??"planning-gantt",R=o??d??"planning",[M,N]=er.useState(n),[E,O]=er.useState(a??t[0]?.id??""),[F,_]=er.useState(""),[B,Y]=er.useState(null),[W,j]=er.useState({...a0,...i}),V=er.useMemo(()=>{let ue=String(W.keyword?.value??"").trim().toLowerCase(),Se=String(W.status?.value??"").trim(),$e=String(W.owner?.value??"").trim().toLowerCase(),ke=String(W.workCenter?.value??"").trim().toLowerCase(),le=W.dateRange?.value,Ee=le?.[0]?oo__default.default(le[0]):null,Me=le?.[1]?oo__default.default(le[1]):null;return t.filter(Pe=>{if(ue&&![Pe.id,Pe.code,Pe.title,Pe.project,Pe.workCenter,Pe.owner?.name].join(" ").toLowerCase().includes(ue)||Se&&Pe.status!==Se||$e&&!String(Pe.owner?.name??"").toLowerCase().includes($e)||ke&&!String(Pe.workCenter??"").toLowerCase().includes(ke))return false;if(Ee||Me){let Ve=oo__default.default(Pe.startDate),tt=oo__default.default(Pe.endDate),nt=Ee?tt.isAfter(Ee)||tt.isSame(Ee,"day"):true,it=Me?Ve.isBefore(Me)||Ve.isSame(Me,"day"):true;if(!nt||!it)return false}return true})},[W,t]);er.useEffect(()=>{V.length!==0&&(V.some(ue=>ue.id===E)||O(V[0].id));},[V,E]);let z=er.useCallback(ue=>{O(ue.id);},[]),K=er.useCallback(ue=>{_(ue),I?.(ue);},[I]),q=er.useCallback(ue=>{Y(Se=>({key:(Se?.key??0)+1,variant:ue})),k?.(ue);},[k]),fe=er.useMemo(()=>({appId:A,tableKey:R,fields:s??i0,filters:W,onFilterChange:j,onVariantLoad:q,onSearch:C??(()=>{}),currentLayoutId:F,layoutRefs:[{tableKey:R,layoutId:F||null}],variantService:p,serviceUrl:u}),[F,s,W,q,C,A,R,u,p]),se=er.useMemo(()=>({appId:A,tableKey:R,serviceUrl:u,tasks:V,columns:b,scale:M,onScaleChange:N,page:m,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:h,selectedTaskId:E,onTaskSelect:z,enableRowReorder:w,onTaskReorder:T,layout:f,layoutVariant:B?.variant,layoutVariantLoadKey:B?.key,onLayoutIdChange:K,onLayoutSave:S}),[b,g,w,V,K,f,B?.key,B?.variant,x,h,S,T,z,m,A,R,v,y,M,u,E]);return {scale:M,setScale:N,selectedTaskId:E,setSelectedTaskId:O,filters:W,setFilters:j,filteredTasks:V,smartFilterProps:fe,planningGanttProps:se}};var k5=t=>{let r=Ng(t),o=er.useMemo(()=>({filterProps:r.smartFilterProps,ganttProps:r.planningGanttProps}),[r.planningGanttProps,r.smartFilterProps]);return {...r,layoutProps:o}};P();oo__default.default.extend(l0__default.default);var ic=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],sc=36,lc=58,wa=8,cc=260,f0=320,Uo="220ms cubic-bezier(0.2, 0, 0, 1)",Ag={"not-started":{label:"Not started",color:"default"},planned:{label:"Planned",color:"info"},"in-progress":{label:"In progress",color:"primary"},blocked:{label:"Blocked",color:"error"},done:{label:"Done",color:"success"}},b0=t=>t?Ag[t]?.label??t:"Planned",h0=t=>t?Ag[t]?.color??"default":"info",Eg=t=>Math.min(100,Math.max(0,t??0)),Lg=(t,r=0)=>t.flatMap(o=>[{...o,level:r},...Lg(o.children??[],r+1)]),v0=t=>({id:t.id,code:t.code??t.id,title:t.title,titleSub:t.project??t.workCenter??"General",project:t.project??"",workCenter:t.workCenter??"",owner:t.owner?.name??"Unassigned",status:b0(t.status),statusTone:t.status??"planned",progress:Eg(t.progress),startDate:t.startDate,endDate:t.endDate,color:t.color,reorderable:t.reorderable!==false}),Og=(t,r)=>r==="month"?t.startOf("month"):r==="week"?t.startOf("week"):r==="day"?t.startOf("day"):t.startOf("hour"),Fg=(t,r)=>r==="month"?t.endOf("month"):r==="week"?t.endOf("week"):r==="day"?t.endOf("day"):t.endOf("hour"),y0=(t,r,o)=>{let n=[],a=Og(t,o),i=Fg(r,o);for(;a.isBefore(i)||a.isSame(i);){let s=o==="month"?a.add(1,"month"):o==="week"?a.add(1,"week"):o==="day"?a.add(1,"day"):a.add(1,"hour");n.push({key:`${o}-${a.valueOf()}`,label:o==="month"?a.format("MMM YYYY"):o==="week"?a.format("MMM D"):o==="day"?a.format("D"):a.format("HH:mm"),contextLabel:o==="hour"?a.format("MMM D"):o==="day"?a.format("MMM"):o==="week"?`W${a.isoWeek()}`:void 0,title:o==="hour"?a.format("MMM D, YYYY HH:mm"):o==="day"?a.format("MMM D, YYYY"):o==="week"?`${a.format("MMM D, YYYY")} - Week ${a.isoWeek()}`:void 0,start:a,end:s}),a=s;}return n},dc=(t,r,o)=>{let n=0;for(let a of r){if(t.isBefore(a.start))return n;if(t.isBefore(a.end)){let i=Math.max(1,a.end.valueOf()-a.start.valueOf()),s=Math.max(0,t.valueOf()-a.start.valueOf());return n+s/i*o}n+=o;}return n},Bg=({appId:t="planning-gantt",tableKey:r="planning",serviceUrl:o,title:n="Project Plan",extraTools:a,bodyHeight:i=560,tasks:s,columns:l,scale:d="week",onScaleChange:u,page:p,rowsPerPage:f=20,rowsPerPageOptions:b=[20,50,100,-1],count:m,onPageChange:v,onRowsPerPageChange:y,timelineStart:g,timelineEnd:x,selectedTaskId:h,onTaskSelect:C,enableRowReorder:k=true,onTaskReorder:w,layout:T,layoutVariant:I,layoutVariantLoadKey:S,onLayoutIdChange:A,onLayoutSave:R,emptyLabel:M="No planning tasks available.",sx:N})=>{let E=sr(),{t:O}=pe(),F=er.useRef(null),_=er.useRef(null),B=er.useRef(null),Y=er.useRef(false),[W,j]=er.useState(null),[V,z]=er.useState("content"),[K,q]=er.useState(null),[fe,se]=er.useState(0),[ue,Se]=er.useState({}),[$e,ke]=er.useState(sc),[le,Ee]=er.useState([]),Me=er.useRef(void 0),[Pe,Ve]=er.useState({activeId:null,overId:null}),[tt,nt]=er.useState(null),[it,X]=er.useState(false),De=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:4}})),ye=er.useRef(null),Be=er.useMemo(()=>Lg(s),[s]),at=er.useMemo(()=>{if(le.length===0)return Be;let H=new Map(Be.map(Te=>[Te.id,Te])),J=le.map(Te=>H.get(Te)).filter(Te=>!!Te),ge=new Set(J.map(Te=>Te.id));return [...J,...Be.filter(Te=>!ge.has(Te.id))]},[Be,le]),Ze=er.useMemo(()=>new Map(at.map(H=>[H.id,H])),[at]),St=er.useMemo(()=>at.map(H=>v0(H)),[at]),Mt=er.useMemo(()=>new Map(St.map(H=>[H.id,H])),[St]),Ot=er.useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(H,J)=>c(ie,{spacing:.2,children:[e(L,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:J.title}),e(L,{sx:{fontSize:13,color:"text.secondary"},children:J.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(H,J)=>e(xt,{label:J.status,color:h0(J.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:H=>c(ie,{spacing:.6,children:[c(L,{variant:"caption",sx:{color:"text.secondary"},children:[H,"%"]}),e($n,{variant:"determinate",value:H,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),At=er.useMemo(()=>{if(!l||l.length===0)return Ot;let H=new Map(Ot.map(J=>[J.id,J]));return l.map(J=>{let ge=H.get(J.id),Te=J.width??ge?.minWidth??120,et={id:J.id,label:J.label,minWidth:Te};if(ge?.numeric&&(et.numeric=true),J.render){let Xe=J.render;return et.render=(kt,bt)=>{let gt=Ze.get(bt.id);return Xe(gt||bt)},et}return ge?.render?(et.render=ge.render,et):(et.render=(Xe,kt)=>{let bt=kt[J.id];if(bt!=null&&String(bt).length>0)return String(bt);let Ct=Ze.get(kt.id)?.[J.id];return Ct!=null&&String(Ct).length>0?String(Ct):"-"},et)})},[l,Ot,Ze]),re=hn({appId:t,tableKey:r,title:n,columns:At,rows:St,rowKey:"id",page:p,rowsPerPage:f,rowsPerPageOptions:b,count:m??St.length,onPageChange:v,onRowsPerPageChange:y,showSummary:false,layout:T,onLayoutSave:R}),Ke=t?e(bn,{appId:t,tableKey:r,currentLayoutData:re.currentLayoutData,onLayoutLoad:re.handleLayoutLoad,targetLayoutId:re.layoutIdToLoad,activeLayoutId:re.currentLayoutId,serviceUrl:o}):null,Fe=re.visibleRows;er.useEffect(()=>{let H=Be.map(J=>J.id);Ee(J=>{let ge=new Set(H),Te=J.filter(bt=>ge.has(bt)),et=new Set(Te),Xe=H.filter(bt=>!et.has(bt)),kt=[...Te,...Xe];return kt.length===J.length&&kt.every((bt,gt)=>bt===J[gt])?J:kt});},[Be]),er.useEffect(()=>{S===void 0||!I||Me.current!==S&&(Me.current=S,re.handleVariantLoad(I));},[re,I,S]),er.useEffect(()=>{A?.(re.currentLayoutId);},[re.currentLayoutId,A]);let ce=H=>H.type==="group"?`group-${H.id}`:`row-${(H.data||H)?.id}`,ve=er.useMemo(()=>{let H=St.map(gt=>oo__default.default(gt.startDate)),J=St.map(gt=>oo__default.default(gt.endDate)),ge=g?oo__default.default(g):H.reduce((gt,Ct)=>Ct.isBefore(gt)?Ct:gt,H[0]??oo__default.default()),Te=x?oo__default.default(x):J.reduce((gt,Ct)=>Ct.isAfter(gt)?Ct:gt,J[0]??oo__default.default().add(30,"day")),et=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",Xe=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",kt=d==="hour"?12:1,bt=d==="hour"?12:1;return {start:Og(ge.subtract(kt,et),d),end:Fg(Te.add(bt,Xe),d)}},[St,d,x,g]),te=ic.find(H=>H.value===d)??ic[1],he=Array.isArray(a)?a:a?[a]:[],Ne=er.useMemo(()=>y0(ve.start,ve.end,d),[ve.end,ve.start,d]),Je=Ne.length*te.width,st=Ne.length>0?100/Ne.length:100,pt=Ne.length>0?`repeat(${Ne.length}, minmax(${te.width}px, 1fr))`:"1fr",Bt=Ne.length>0?`calc(100% / ${Ne.length}) 100%`:"100% 100%",Xt=(re.columns||[]).filter(H=>re.visibleColumns.includes(H.id)).reduce((H,J)=>H+(re.columnWidths?.[J.id]||J.minWidth||100),0)+(re.grouping.length>0?72:0),Vt=V==="manual"&&W!==null?W:Xt,wt=K==="table",Wt=K==="timeline",ht=K==="timeline",Nt=K==="table",lt=!ht&&!Nt,Ft=()=>{let H=fe||F.current?.clientWidth||0;return H>0?Math.max(cc,H-wa-f0):Math.max(cc,Xt)},Yt=H=>Math.min(Math.max(H,cc),Ft()),$=(()=>{if(fe<=0)return null;let H=lt?wa:0;if(wt)return {tableWidth:fe,splitterWidth:H,timelineWidth:0};if(Wt)return {tableWidth:0,splitterWidth:H,timelineWidth:fe};if(V==="even"){let ge=Math.max(0,(fe-H)/2);return {tableWidth:ge,splitterWidth:H,timelineWidth:Math.max(0,fe-H-ge)}}let J=Yt(Vt);return {tableWidth:J,splitterWidth:H,timelineWidth:Math.max(0,fe-H-J)}})(),Q=$?`${$.tableWidth}px ${$.splitterWidth}px ${$.timelineWidth}px`:wt?"minmax(0, 1fr) 0px 0px":Wt?"0px 0px minmax(0, 1fr)":V==="even"?`minmax(0, 1fr) ${wa}px minmax(0, 1fr)`:`${Vt}px ${wa}px minmax(0, 1fr)`;er.useEffect(()=>{V==="manual"&&j(H=>H===null?null:Yt(H));},[V,Xt,fe]);let be=H=>{H.preventDefault(),H.currentTarget.setPointerCapture(H.pointerId),q(null),z("manual"),ye.current={startX:H.clientX,startWidth:_.current?.getBoundingClientRect().width??Vt};let J=Te=>{let et=ye.current;if(!et)return;let Xe=Yt(et.startWidth+Te.clientX-et.startX);j(Xe);},ge=()=>{ye.current=null,window.removeEventListener("pointermove",J),window.removeEventListener("pointerup",ge),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",J),window.addEventListener("pointerup",ge);},Ce=()=>{q(null),z("even"),j(null);},Le=H=>!k||!H?false:Mt.get(H)?.reorderable!==false,_e=(H,J)=>{if(!H||!J||H===J||!Le(H)||!Le(J))return false;if(re.grouping.length===0)return true;let ge=Mt.get(H),Te=Mt.get(J);return !ge||!Te?false:re.grouping.every(et=>ge[et]===Te[et])},qe=(H,J)=>{if(!_e(H,J))return;let ge=Fe.filter(Et=>Et.type!=="group").map(Et=>String((Et.data||Et)?.id)),Te=ge.indexOf(H),et=ge.indexOf(J);if(Te<0||et<0)return;let Xe=[...ge];[Xe[Te],Xe[et]]=[Xe[et],Xe[Te]];let kt=new Set(ge),bt=at.map(Et=>Et.id),gt=[...Xe,...bt.filter(Et=>!kt.has(Et))],Ct=Ze.get(H),nr=Ze.get(J);if(re.setOrder("asc"),re.setOrderBy(""),Ee(gt),Ct&&nr){let{level:Et,...Zt}=Ct,{level:Ht,...Kt}=nr,$t=gt.reduce((rr,ar)=>{let fr=Ze.get(ar);if(fr){let{level:Ir,...Mr}=fr;rr.push(Mr);}return rr},[]);w?.($t,{activeTask:Zt,targetTask:Kt});}},je=(H,J)=>{if(!Le(J.id)){H.preventDefault();return}H.stopPropagation(),H.dataTransfer.effectAllowed="move",H.dataTransfer.setData("text/plain",J.id),Ve({activeId:J.id,overId:null}),C?.(Ze.get(J.id)||J);},mt=(H,J)=>{if(!_e(Pe.activeId,J)){Ve(ge=>ge.overId===null?ge:{...ge,overId:null});return}H.preventDefault(),H.stopPropagation(),H.dataTransfer.dropEffect="move",Ve(ge=>ge.overId===J?ge:{...ge,overId:J});},ft=(H,J)=>{let ge=Pe.activeId||H.dataTransfer.getData("text/plain");if(!_e(ge,J)){Ve({activeId:null,overId:null});return}H.preventDefault(),H.stopPropagation(),qe(ge,J),Ve({activeId:null,overId:null});},Rt=()=>{Ve({activeId:null,overId:null});},yt=H=>{if(Y.current)return;let J=H==="table"?_.current:B.current,ge=H==="table"?B.current:_.current;!J||!ge||(Y.current=true,ge.scrollTop=J.scrollTop,window.requestAnimationFrame(()=>{Y.current=false;}));};return er.useLayoutEffect(()=>{let H=F.current;if(!H){se(0);return}let J=0,ge=()=>{window.cancelAnimationFrame(J),J=window.requestAnimationFrame(()=>{let et=H.clientWidth;se(Xe=>Math.abs(Xe-et)<.5?Xe:et);});};if(ge(),typeof ResizeObserver>"u")return window.addEventListener("resize",ge),()=>{window.cancelAnimationFrame(J),window.removeEventListener("resize",ge);};let Te=new ResizeObserver(ge);return Te.observe(H),window.addEventListener("resize",ge),()=>{window.cancelAnimationFrame(J),Te.disconnect(),window.removeEventListener("resize",ge);}},[St.length]),er.useLayoutEffect(()=>{if(!h||Nt)return;let H=B.current,J=_.current;if(!H)return;let ge=`row-${h}`,Te=Array.from(H.querySelectorAll("[data-planning-timeline-row-key]")).find(kt=>kt.dataset.planningTimelineRowKey===ge),et=Mt.get(h);if(!Te||!et)return;let Xe=window.requestAnimationFrame(()=>{let kt=H.getBoundingClientRect(),bt=Te.getBoundingClientRect(),gt=Math.max(1,H.clientHeight-$e),Ct=H.scrollTop+bt.top-kt.top-$e-(gt-bt.height)/2;Y.current=true,H.scrollTop=Math.max(0,Ct),J&&!ht&&(J.scrollTop=H.scrollTop);let nr=Math.max(1,H.scrollWidth),Et=Ne.length>0?nr/Ne.length:te.width,Zt=dc(oo__default.default(et.startDate),Ne,Et),Ht=Math.max(0,Zt-Et);H.scrollLeft=Math.min(Ht,Math.max(0,nr-H.clientWidth)),window.requestAnimationFrame(()=>{Y.current=false;});});return ()=>window.cancelAnimationFrame(Xe)},[te.width,$e,h,ht,Mt,Nt,Fe,Ne]),er.useLayoutEffect(()=>{let H=_.current;if(!H)return;let J=0,ge=0,Te=false,et=()=>{if(Te)return;let Ht=H.querySelector("thead"),Kt=Array.from(H.querySelectorAll("tbody tr[data-ctable-row-key]"));if(Kt.length===0)return;let $t=Ht?.getBoundingClientRect().height||sc,rr={};Kt.forEach(ar=>{let fr=ar.dataset.ctableRowKey;fr&&(rr[fr]=ar.getBoundingClientRect().height);}),ke(ar=>Math.abs(ar-$t)<.01?ar:$t),Se(ar=>{let fr=Object.keys(ar),Ir=Object.keys(rr);return fr.length===Ir.length&&Ir.every(Mr=>Math.abs((ar[Mr]??0)-rr[Mr])<.01)?ar:rr});},Xe=()=>{window.cancelAnimationFrame(J),J=window.requestAnimationFrame(et);};if(et(),window.cancelAnimationFrame(ge),ge=window.requestAnimationFrame(()=>{ge=window.requestAnimationFrame(et);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{Te||Xe();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",Xe),()=>{Te=true,window.cancelAnimationFrame(J),window.cancelAnimationFrame(ge),window.removeEventListener("resize",Xe);};let kt=new ResizeObserver(Xe),bt=H.querySelector("table"),gt=H.querySelector("tbody"),Ct=H.querySelector("thead");bt&&kt.observe(bt),Ct&&kt.observe(Ct);let nr=new WeakSet,Et=()=>{H.querySelectorAll("tbody tr[data-ctable-row-key]").forEach(Ht=>{nr.has(Ht)||(kt.observe(Ht),nr.add(Ht));});};Et();let Zt=null;return gt&&typeof MutationObserver<"u"&&(Zt=new MutationObserver(()=>{Et(),Xe();}),Zt.observe(gt,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",Xe),()=>{Te=true,window.cancelAnimationFrame(J),window.cancelAnimationFrame(ge),kt.disconnect(),Zt?.disconnect(),window.removeEventListener("resize",Xe);}},[Fe,re.visibleColumns,re.grouping,re.columnWidths]),c(Ae,{className:"orb-ctable-surface orb-planning-gantt",elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:"var(--orb-r-container)",border:`1px solid ${E.palette.divider}`,...N},children:[e("div",{className:"orb-table-toolbar orb-planning-table-toolbar",role:"toolbar","aria-label":O("table.title.default"),children:c("div",{className:"orb-table-toolbar-primary",children:[e(gi,{value:re.filterText,onChange:H=>{re.setFilterText(H),re.setPage(0);}}),e(mi,{rowsPerPage:re.rowsPerPage,rowsPerPageOptions:b,page:re.page,count:re.totalDisplayCount,onRowsPerPageChange:re.setRowsPerPage,onPageChange:re.setPage}),he.length>0&&e("div",{className:"orb-table-toolbar-custom",children:he.map((H,J)=>e("div",{className:"orb-planning-extra-tool",children:H},`planning-extra-tool-${J}`))}),e("span",{className:"orb-table-toolbar-spacer"}),c("div",{className:"orb-table-toolbar-actions",children:[c("div",{className:"orb-table-tool-group",children:[e(ae,{className:"orb-table-tool-button",tooltip:"Column visibility",onClick:H=>re.setAnchorEl(H.currentTarget),sx:pr,children:e(ln,{fontSize:"small"})}),e(ae,{className:"orb-table-tool-button",tooltip:"Group by",onClick:H=>re.setGroupAnchorEl(H.currentTarget),sx:pr,children:e(So,{fontSize:"small"})}),e(ae,{className:`orb-table-tool-button ${re.sortBy.length>0||re.orderBy?"orb-is-active":""}`,tooltip:"Sort by...",active:re.sortBy.length>0||!!re.orderBy,onClick:()=>X(true),sx:pr,children:e(up,{fontSize:"small"})})]}),Ke&&e("div",{className:"orb-table-tool-group",children:Ke}),e("div",{className:"orb-table-tool-group orb-planning-pane-controls",children:e(_n,{"aria-label":"Planning pane layout",size:"small",value:K??(V==="even"?"split":null),options:[{value:"table",label:"Expand task table",icon:e(si,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:e(ci,{fontSize:"small"})},{value:"timeline",label:"Expand timeline",icon:e(ii,{fontSize:"small"})}],onValueChange:H=>{H==="split"?Ce():q(H);}})}),e("div",{className:"orb-table-tool-group orb-planning-scale-control",children:e(zt,{label:"",value:d,options:ic.map(H=>({value:H.value,label:H.label})),onChange:H=>u?.(H.target.value)})})]})]})}),St.length===0?e("div",{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:M}):e("div",{sx:{overflow:"hidden",flex:1,minHeight:0},children:c("div",{ref:F,sx:{height:"100%",display:"grid",gridTemplateColumns:Q,minWidth:0,transition:`grid-template-columns ${Uo}`},children:[e("div",{"data-planning-scroll-pane":"table",ref:_,onScroll:()=>yt("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:i,overflowX:"auto",overflowY:"auto",opacity:ht?0:1,transform:ht?"translateX(-10px)":"translateX(0)",pointerEvents:ht?"none":"auto",transition:`opacity ${Uo}, transform ${Uo}`},children:e(core.DndContext,{sensors:De,collisionDetection:core.closestCenter,modifiers:[modifiers.restrictToHorizontalAxis],onDragEnd:H=>{let J=H?.active?.id,ge=H?.over?.id;typeof J=="string"&&typeof ge=="string"&&re.handleColumnReorder(J,ge);},children:c("table",{className:"orb-tbl orb-ctable orb-planning-table",sx:{tableLayout:"fixed",width:Xt,"& thead th":{height:sc,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[e(hi,{columns:re.columns,visibleColumns:re.visibleColumns,order:re.order,orderBy:re.orderBy,sortBy:re.sortBy,onRequestSort:re.handleRequestSort,onContextMenu:(H,J)=>{H.preventDefault(),H.stopPropagation(),nt({mouseX:H.clientX+2,mouseY:H.clientY-6,columnId:J});},grouping:re.grouping,isAllExpanded:re.isAllExpanded,handleToggleAll:re.handleToggleAll,columnWidths:re.columnWidths,onColumnResize:re.handleColumnResize,enableColumnReorder:true}),e(vi,{visibleRows:Fe,columns:re.columns,visibleColumns:re.visibleColumns,selected:h?[h]:[],expandedGroups:re.expandedGroups,toggleGroupExpand:re.toggleGroupExpand,handleExpandGroupRecursively:re.handleExpandGroupRecursively,handleCollapseGroupRecursively:re.handleCollapseGroupRecursively,isGroupFullyExpanded:re.isGroupFullyExpanded,grouping:re.grouping,rowKeyProp:"id",page:re.page,rowsPerPage:re.rowsPerPage,emptyLabel:M,handleClick:(H,J)=>{C?.(Ze.get(J.id)||J);},getRowDataKey:({entry:H})=>ce(H),getGroupRowProps:()=>({style:{height:lc}}),getRowProps:({data:H})=>{let J=H,ge=Le(J.id),Te=Pe.activeId===J.id,et=Pe.overId===J.id&&_e(Pe.activeId,J.id);return {draggable:ge,className:et?"orb-is-drop-target":void 0,style:{cursor:Te?"grabbing":ge?"grab":C?"pointer":"default",height:lc,opacity:Te?.56:1,transition:"background-color 120ms ease, opacity 120ms ease"},onDragStart:Xe=>je(Xe,J),onDragOver:Xe=>mt(Xe,J.id),onDragEnter:Xe=>mt(Xe,J.id),onDrop:Xe=>ft(Xe,J.id),onDragEnd:Rt}}})]})})}),e("div",{onPointerDown:lt?be:void 0,role:"separator","aria-orientation":"vertical",sx:{width:lt?wa:0,cursor:lt?"col-resize":"default",opacity:lt?1:0,pointerEvents:lt?"auto":"none",borderLeft:lt?`1px solid ${E.palette.divider}`:"0 solid transparent",borderRight:lt?`1px solid ${E.palette.divider}`:"0 solid transparent",backgroundColor:vt()==="dark"?"color-mix(in oklch, var(--orb-muted) 10%, transparent)":"color-mix(in oklch, var(--orb-fg) 4%, transparent)",transition:`width ${Uo}, opacity ${Uo}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:E.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:lt?"col-resize":"default"}}}),e("div",{sx:{minWidth:0,overflow:"hidden",opacity:Nt?0:1,transform:Nt?"translateX(10px)":"translateX(0)",pointerEvents:Nt?"none":"auto",transition:`opacity ${Uo}, transform ${Uo}`},children:e("div",{"data-planning-scroll-pane":"timeline",ref:B,onScroll:()=>yt("timeline"),sx:{width:"100%",height:i,overflowX:"auto",overflowY:"auto"},children:c("div",{sx:{width:"100%",minWidth:Je||"100%"},children:[e("div",{className:"orb-planning-timeline-header",sx:{display:"grid",gridTemplateColumns:pt,height:$e,boxSizing:"border-box",borderBottom:`1px solid ${E.palette.divider}`,position:"sticky",top:0,zIndex:2},children:Ne.map(H=>c("div",{title:H.title,sx:{px:.75,display:"flex",flexDirection:H.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:H.contextLabel?.15:0,borderRight:`1px solid ${E.palette.divider}`,color:H.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[H.contextLabel&&e(L,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"text.secondary",fontSize:11,fontWeight:700,lineHeight:1.1},children:H.contextLabel}),e(L,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:H.label})]},H.key))}),e(ie,{sx:{position:"relative"},children:Fe.map(H=>{let J=ce(H),ge=ue[J]??lc;if(H.type==="group")return e("div",{className:"orb-planning-timeline-row orb-table-group-row","data-planning-timeline-row-key":J,sx:{position:"relative",height:ge,boxSizing:"border-box",borderBottom:`1px solid ${E.palette.divider}`}},H.id);let Te=H.data||H,et=oo__default.default(Te.startDate),Xe=oo__default.default(Te.endDate),kt=dc(et,Ne,st),bt=dc(Xe,Ne,st),gt=Math.max(0,bt-kt),Ct=Eg(Te.progress),nr=Te.id===h,Et=Le(Te.id),Zt=Pe.activeId===Te.id,Ht=Pe.overId===Te.id&&_e(Pe.activeId,Te.id),Kt=Te.color??(Te.statusTone==="blocked"?E.palette.error.main:E.palette.primary.main);return e("div",{className:`orb-planning-timeline-row ${nr?"orb-is-selected":""}`,"data-planning-timeline-row-key":J,draggable:Et,onDragStart:$t=>je($t,Te),onDragOver:$t=>mt($t,Te.id),onDragEnter:$t=>mt($t,Te.id),onDrop:$t=>ft($t,Te.id),onDragEnd:Rt,onClick:()=>C?.(Ze.get(Te.id)||Te),sx:{position:"relative",height:ge,boxSizing:"border-box",borderBottom:`1px solid ${E.palette.divider}`,opacity:Zt?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:E.palette.primary.main,opacity:Ht?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:vt()==="dark"?"linear-gradient(90deg, color-mix(in oklch, var(--orb-muted) 8%, transparent) 1px, transparent 1px)":"linear-gradient(90deg, color-mix(in oklch, var(--orb-fg) 6%, transparent) 1px, transparent 1px)",backgroundSize:Bt,cursor:Zt?"grabbing":Et?"grab":C?"pointer":"default",transition:"opacity 120ms ease"},children:e(ct,{title:`${Te.title}: ${et.format("MMM D HH:mm")} - ${Xe.format("MMM D HH:mm")}`,children:c("div",{sx:{position:"absolute",left:`${kt}%`,top:Math.max(8,(ge-24)/2),width:`max(18px, ${gt}%)`,height:24,borderRadius:999,overflow:"hidden",backgroundColor:vt()==="dark"?"color-mix(in oklch, var(--orb-muted) 18%, transparent)":"color-mix(in oklch, var(--orb-fg) 10%, transparent)",outline:nr?`2px solid ${E.palette.warning.main}`:"none",outlineOffset:2},children:[e("div",{sx:{height:"100%",width:`${Ct}%`,backgroundColor:Kt}}),e(L,{sx:{position:"absolute",inset:0,px:1,display:"flex",alignItems:"center",color:"var(--orb-on-primary)",fontSize:11,fontWeight:800,textShadow:"0 1px 4px rgba(0,0,0,0.45)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Te.code})]})})},Te.id)})})]})})})]})}),e(pn,{groupAnchorEl:re.groupAnchorEl,setGroupAnchorEl:re.setGroupAnchorEl,grouping:re.grouping,setGrouping:re.setGrouping,columns:re.columns}),e(un,{anchorEl:re.anchorEl,setAnchorEl:re.setAnchorEl,columns:re.columns,visibleColumns:re.visibleColumns,toggleColumnVisibility:re.toggleColumnVisibility}),e(Dp,{contextMenu:tt,handleClose:()=>nt(null),columns:re.columns,visibleColumns:re.visibleColumns,grouping:re.grouping,summaryColumns:re.summaryColumns,showSummary:re.showSummary,sortBy:re.sortBy,orderBy:re.orderBy,order:re.order,onSortAsc:H=>{re.applyMultiSort([{field:H,direction:"asc"}]);},onSortDesc:H=>{re.applyMultiSort([{field:H,direction:"desc"}]);},onClearSort:H=>{let J=re.sortBy.filter(ge=>ge.field!==H);J.length>0?re.applyMultiSort(J):(re.clearMultiSort(),re.orderBy===H&&re.setOrderBy(""));},onHideColumn:H=>{re.visibleColumns.includes(H)&&re.toggleColumnVisibility(H);},onToggleGroup:H=>re.toggleGroupField(H),onToggleSummary:H=>re.toggleSummaryColumn(H),onOpenSortDialog:()=>X(true)}),e(Np,{open:it,onClose:()=>X(false),columns:re.columns,initialRules:re.sortBy.length>0?re.sortBy:re.orderBy?[{field:re.orderBy,direction:re.order}]:[],onApply:H=>re.applyMultiSort(H),onClear:()=>{re.clearMultiSort(),re.setOrderBy("");}})]})};P();var oV=({filterProps:t,ganttProps:r,spacing:o=2,sx:n,children:a})=>{let i=n?[{height:"100%",overflow:"hidden"},n]:{height:"100%",overflow:"hidden"},s=r.sx?[{height:"100%"},r.sx]:{height:"100%"};return c(ie,{spacing:o,sx:i,children:[e("div",{sx:{flexShrink:0},children:e(Wr,{...t})}),e("div",{sx:{flex:1,minHeight:0,overflow:"hidden"},children:e(Bg,{...r,bodyHeight:r.bodyHeight??"100%",sx:s})}),a]})};P();var Hg=640,C0=360,x0=360,As=8,En="220ms cubic-bezier(0.2, 0, 0, 1)",mc=(t,r,o=0,n=[])=>t.flatMap(a=>{let i=a.children??[],s=[{node:a,level:o,hasChildren:i.length>0,parentIds:n}];return r.has(a.id)?[...s,...mc(i,r,o+1,[...n,a.id])]:s}),Vg=t=>t.flatMap(r=>[r,...Vg(r.children??[])]),Wg=(t,r=0,o=[])=>t.flatMap(n=>{let a=n.children??[];return [{node:n,level:r,hasChildren:a.length>0,parentIds:o},...Wg(a,r+1,[...o,n.id])]}),$g=t=>t.flatMap(r=>{let o=r.children??[];return o.length===0?[]:[r.id,...$g(o)]}),zg=t=>Object.entries(t).filter(([r])=>r!=="children").map(([,r])=>r==null?"":typeof r=="string"||typeof r=="number"||typeof r=="boolean"?String(r):"").join(" ").toLowerCase(),gV=({title:t,subtitle:r,nodes:o,columns:n,detail:a,selectedNodeId:i,defaultSelectedNodeId:s,onNodeSelect:l,expandedNodeIds:d,defaultExpandedNodeIds:u,onExpandedNodeIdsChange:p,defaultPaneMode:f="split",minTreePaneWidth:b=C0,minDetailPaneWidth:m=x0,tableAppId:v="ctree-comp",tableKey:y="default",tableTitle:g,filterConfig:x,searchQuery:h,searchToken:C,defaultRowsPerPage:k=-1,rowsPerPageOptions:w=[20,50,100,-1],serviceUrl:T,emptyLabel:I="No tree items available.",headerAction:S,sx:A,className:R})=>{let M=sr(),N=er.useRef(null),E=er.useRef(null),O=er.useRef(null),[F,_]=er.useState(s??o[0]?.id??null),[B,Y]=er.useState(u??$g(o).slice(0,3)),[W,j]=er.useState(f),[V,z]=er.useState(Hg),[K,q]=er.useState(0),[fe,se]=er.useState(0),[ue,Se]=er.useState(k),$e=er.useMemo(()=>n&&n.length>0?n:[{id:"label",label:"Name",render:ce=>c(ie,{spacing:.3,children:[e(L,{sx:{fontSize:15,fontWeight:700,lineHeight:1.15},children:ce.label}),ce.subtitle&&e(L,{sx:{fontSize:13,color:"text.secondary",lineHeight:1.2},children:ce.subtitle})]})}],[n]),ke=er.useMemo(()=>new Set(d??B),[d,B]),le=er.useMemo(()=>mc(o,ke),[o,ke]),Ee=er.useMemo(()=>Vg(o),[o]),Me=er.useMemo(()=>Wg(o),[o]),Pe=i===void 0?F:i,Ve=er.useMemo(()=>Ee.find(ce=>ce.id===Pe)??null,[Pe,Ee]),tt=ce=>{let ve=E.current?.clientWidth??0,te=ve>0?Math.max(b,ve-As-m):Math.max(b,ce);return Math.min(Math.max(ce,b),te)},nt=W==="detail",it=W==="tree"||!a,X=W==="split"&&!!a,ye=(()=>{if(K<=0)return null;if(W==="tree"||!a)return {treeWidth:K,splitterWidth:0,detailWidth:0};if(W==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:K};let ce=X?As:0,ve=tt(V);return {treeWidth:ve,splitterWidth:ce,detailWidth:Math.max(0,K-ce-ve)}})(),Be=ye?`${ye.treeWidth}px ${ye.splitterWidth}px ${ye.detailWidth}px`:W==="tree"||!a?"minmax(0, 1fr) 0px 0px":W==="detail"?"0px 0px minmax(0, 1fr)":`minmax(${b}px, ${V}px) ${As}px minmax(${m}px, 1fr)`;er.useEffect(()=>{let ce=E.current;if(!ce){q(0);return}let ve=0,te=()=>{window.cancelAnimationFrame(ve),ve=window.requestAnimationFrame(()=>{let Ne=ce.clientWidth;q(Je=>Math.abs(Je-Ne)<.5?Je:Ne);});};if(te(),typeof ResizeObserver>"u")return window.addEventListener("resize",te),()=>{window.cancelAnimationFrame(ve),window.removeEventListener("resize",te);};let he=new ResizeObserver(te);return he.observe(ce),window.addEventListener("resize",te),()=>{window.cancelAnimationFrame(ve),he.disconnect(),window.removeEventListener("resize",te);}},[]);let at=ce=>{d===void 0&&Y(ce),p?.(ce);},Ze=ce=>{let ve=new Set(ke);ve.has(ce)?ve.delete(ce):ve.add(ce),at(Array.from(ve));},St=ce=>{i===void 0&&_(ce.id),l?.(ce);};er.useEffect(()=>{se(0);},[o]),er.useEffect(()=>{let ce=h?.trim().toLowerCase();if(!ce)return;let ve=Me.find(({node:pt})=>zg(pt).includes(ce));if(!ve)return;let te=new Set(ke);ve.parentIds.forEach(pt=>te.add(pt)),at(Array.from(te)),St(ve.node);let Ne=mc(o,te).findIndex(({node:pt})=>pt.id===ve.node.id);Ne>=0&&ue>0&&se(Math.floor(Ne/ue));let Je=0,st=0;return Je=window.requestAnimationFrame(()=>{st=window.requestAnimationFrame(()=>{let pt=N.current?.querySelector("tr.orb-selected"),Bt=pt?.closest(".orb-table-container");if(pt&&Bt){let Xt=Bt.getBoundingClientRect(),Vt=pt.getBoundingClientRect(),wt=Vt.top-Xt.top+Bt.scrollTop;Bt.scrollTo({top:wt-Bt.clientHeight/2+Vt.height/2,behavior:"smooth"});return}pt?.scrollIntoView({block:"center",behavior:"smooth"});});}),()=>{window.cancelAnimationFrame(Je),window.cancelAnimationFrame(st);}},[h,C,Me,o,ue]);let Mt=er.useMemo(()=>le.map(({node:ce,level:ve,hasChildren:te})=>({...ce,id:ce.id,__node:ce,__level:ve,__hasChildren:te,__expanded:ke.has(ce.id),__searchText:zg(ce)})),[ke,le]),Ot=er.useMemo(()=>$e.map((ce,ve)=>({id:ce.id,label:ce.label,minWidth:typeof ce.width=="number"?ce.width:ce.minWidth??(ve===0?320:120),numeric:ce.numeric??ce.align==="right",render:(te,he)=>{let Ne=he.__node,Je=ce.render?ce.render(Ne):Ne[ce.id];if(ve!==0)return e(Ie,{sx:{minWidth:0,color:ce.align==="right"?"text.primary":"text.secondary",fontWeight:ce.align==="right"?750:500,textAlign:ce.align??"left"},children:Je});let st=Number(he.__level??0),pt=!!he.__hasChildren,Bt=!!he.__expanded;return c(ie,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,pl:`${st*24}px`},children:[e(ae,{tooltip:pt?Bt?"Collapse":"Expand":"",onClick:Xt=>{Xt.stopPropagation(),pt&&Ze(Ne.id);},disabled:!pt,sx:{width:24,height:24,visibility:pt?"visible":"hidden",transform:Bt?"rotate(0deg)":"rotate(-90deg)",transition:"transform 160ms ease"},children:e(Vr,{sx:{fontSize:20}})}),e(Ie,{sx:{width:10,height:10,borderRadius:"50%",flexShrink:0,backgroundColor:Ne.markerColor??M.palette.primary.main}}),e(Ie,{sx:{minWidth:0},children:Je})]})}})),[$e,ke,M.palette.primary.main]),At=ce=>{if(!X)return;ce.preventDefault(),ce.currentTarget.setPointerCapture(ce.pointerId),O.current={startX:ce.clientX,startWidth:V};let ve=he=>{let Ne=O.current;Ne&&z(tt(Ne.startWidth+he.clientX-Ne.startX));},te=()=>{O.current=null,window.removeEventListener("pointermove",ve),window.removeEventListener("pointerup",te),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",ve),window.addEventListener("pointerup",te);},re=()=>{let ce=E.current?.clientWidth??0,ve=ce>0?Math.max(b,(ce-As)/2):Hg;j("split"),z(tt(ve));},Ke=()=>a?typeof a=="function"?a(Ve):a:null,Fe=a?e(_n,{"aria-label":"Tree pane layout",value:W,options:[{value:"tree",label:"Expand tree",icon:e(si,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:e(ci,{fontSize:"small"})},{value:"detail",label:"Expand detail",icon:e(ii,{fontSize:"small"})}],onValueChange:ce=>{ce==="split"?re():j(ce);},sx:{position:"absolute",top:13,right:56,zIndex:3,backdropFilter:"blur(10px)"}}):null;return c(Ie,{ref:N,className:["ctree_comp",R].filter(Boolean).join(" "),sx:{position:"relative",height:"100%",minHeight:0,border:`1px solid ${M.palette.divider}`,borderRadius:"var(--orb-r-container)",overflow:"hidden",backgroundColor:"background.paper",boxShadow:`0 18px 42px ${rt(M.palette.common.black,vt()==="dark"?.24:.08)}`,...A},children:[Fe,c(Ie,{ref:E,sx:{height:"100%",display:"grid",gridTemplateColumns:Be,transition:`grid-template-columns ${En}`,minWidth:0},children:[c(Ie,{"aria-hidden":nt?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:nt?0:1,transform:nt?"translateX(-12px)":"translateX(0)",pointerEvents:nt?"none":"auto",transition:`opacity ${En}, transform ${En}`,willChange:"opacity, transform"},children:[c(ie,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,sx:{px:2,py:1.5,minHeight:74,borderBottom:`1px solid ${M.palette.divider}`},children:[c(ie,{direction:"row",alignItems:"center",spacing:1.4,sx:{minWidth:0},children:[e(So,{sx:{color:"primary.main",fontSize:28}}),c(Ie,{sx:{minWidth:0},children:[e(L,{sx:{fontSize:20,fontWeight:750,lineHeight:1.12},noWrap:true,children:t}),r&&e(L,{sx:{fontSize:14,color:"text.secondary",mt:.3},noWrap:true,children:r})]})]}),S!==void 0?S:e(ae,{tooltip:"Add node",color:"default",children:e(Ho,{fontSize:"small"})})]}),c(Ie,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[e(Jr,{appId:v,tableKey:y,title:g??(typeof t=="string"?t:"Tree"),columns:Ot,rows:Mt,rowKey:"id",fitContainer:true,fullWidth:true,showSummary:false,selectionMode:"single",selected:Pe?[Pe]:[],onSelectionChange:ce=>{let ve=ce[ce.length-1],te=Ee.find(he=>he.id===ve);te&&St(te);},page:fe,rowsPerPage:ue,rowsPerPageOptions:w,count:Mt.length,onPageChange:se,onRowsPerPageChange:ce=>{se(0),Se(ce);},filterConfig:x,serviceUrl:T,graphReport:{enabled:false},disableGrouping:true,disableSorting:true,maxHeight:"100%"}),Mt.length===0&&e(Ie,{sx:{minHeight:220,display:"grid",placeItems:"center",color:"text.secondary"},children:I})]})]}),e(Ie,{"data-ctree-splitter":"true",role:"separator","aria-orientation":"vertical",onPointerDown:X?At:void 0,sx:{width:"100%",cursor:X?"col-resize":"default",backgroundColor:X?rt(M.palette.text.primary,vt()==="dark"?.16:.08):"transparent",opacity:X?1:0,pointerEvents:X?"auto":"none",position:"relative",transition:`opacity ${En}, background-color 120ms ease`,"&:hover":{backgroundColor:X?rt(M.palette.primary.main,vt()==="dark"?.35:.18):"transparent"}}}),c(Ie,{"aria-hidden":it?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:it?0:1,transform:it?"translateX(12px)":"translateX(0)",pointerEvents:it?"none":"auto",transition:`opacity ${En}, transform ${En}`,willChange:"opacity, transform"},children:[e(Ie,{sx:{px:2,pt:2,minHeight:74,display:"flex",alignItems:"flex-end"},children:e(Dt,{sx:{width:"100%"}})}),e(Ie,{sx:{flex:1,minHeight:0,overflow:"auto",px:2,pb:2},children:Ke()})]})]})]})};P();var P0={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)"}}},yV=({children:t,transitionKey:r,variant:o="fade",durationMs:n=220,delayMs:a=0,easing:i="cubic-bezier(0.22, 1, 0.36, 1)",disabled:s=false,sx:l})=>{let d=xo("(prefers-reduced-motion: reduce)"),[u,p]=er.useState("to"),f=!s&&!d&&o!=="none";er.useEffect(()=>{if(!f){p("to");return}p("from");let v=requestAnimationFrame(()=>{v=requestAnimationFrame(()=>{p("to");});});return ()=>cancelAnimationFrame(v)},[r,f]);let b=P0[o],m=er.useMemo(()=>f?u==="from"?b.from:b.to:{opacity:1,transform:"none"},[f,u,b.from,b.to]);return e(Ie,{sx:{willChange:f?"opacity, transform":"auto",transition:f?`opacity ${n}ms ${i} ${a}ms, transform ${n}ms ${i} ${a}ms`:"none",backfaceVisibility:"hidden",...m,...l},children:t})},CV={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};exports.AIBrowserGlow=qz;exports.Activity=Pc;exports.AgentPanel=$m;exports.AlertCircle=Ta;exports.AlertTriangle=Tc;exports.ArrowDown=Q0;exports.ArrowRight=J0;exports.ArrowUp=Ic;exports.BarChart=Bs;exports.Bot=eS;exports.Button=Us;exports.CAINavProvider=Hy;exports.CAlert=on;exports.CAmapChart=zp;exports.CAppHeader=$i;exports.CAppHeaderSearch=kl;exports.CAppPageLayout=TE;exports.CAuthPage=b5;exports.CAvatar=rn;exports.CBadge=Wa;exports.CBarChart=ra;exports.CButton=we;exports.CCalendar=Un;exports.CCardDetailPanel=eu;exports.CCardGrid=ru;exports.CCardGridCard=zh;exports.CCardPage=rN;exports.CChartCard=xi;exports.CCheckbox=It;exports.CChip=xt;exports.CComboChart=Lp;exports.CCustomizeAgent=Wp;exports.CDatePicker=ob;exports.CDetailInfoPage=kA;exports.CDetailSearchAiBar=du;exports.CDetailSectionCard=Bi;exports.CDialog=Lt;exports.CDivider=Dt;exports.CFileUpload=ab;exports.CFilterField=BT;exports.CFishboneChart=Fp;exports.CGoogleMapChart=Hp;exports.CGraphCharts=Vp;exports.CGraphKpiCards=Ap;exports.CGraphReport=Pi;exports.CHeatmapChart=Op;exports.CIconButton=ae;exports.CKanbanBoard=QA;exports.CKanbanBucket=fu;exports.CKanbanCard=vl;exports.CLayoutManagement=Zp;exports.CLayoutManager=bn;exports.CLineChart=Ep;exports.CList=MT;exports.CListItem=RT;exports.CListItemAvatar=LT;exports.CListItemButton=DT;exports.CListItemIcon=NT;exports.CListItemText=AT;exports.CListSubheader=ET;exports.CMenu=Qt;exports.CMessageBox=jn;exports.CMetricChartCard=gs;exports.COrbCanvas=My;exports.CPageLayout=ui;exports.CPageTransition=yV;exports.CPaper=Ae;exports.CPieChart=Si;exports.CPivotTable=gO;exports.CPlanningGantt=Bg;exports.CPlanningLayout=oV;exports.CPopover=$s;exports.CProgress=$n;exports.CRadioGroup=Rf;exports.CSegmentedControl=_n;exports.CSelect=zt;exports.CSkeleton=Ff;exports.CSmartFilter=Wr;exports.CSmartTable=xD;exports.CSpinner=Xr;exports.CStack=ie;exports.CStandardPage=MD;exports.CStatusBadge=PT;exports.CSwitch=Va;exports.CTable=Jr;exports.CTableBody=bD;exports.CTableCell=hD;exports.CTableContainer=vD;exports.CTableHead=yD;exports.CTableRow=CD;exports.CTabs=Jf;exports.CTextArea=Wn;exports.CTextField=ze;exports.CTooltip=ct;exports.CTreeComp=gV;exports.CTypography=L;exports.CValueHelp=wp;exports.CVariantManagement=Ri;exports.CVariantManager=Up;exports.CVoiceWaveOverlay=Ll;exports.CWaterfallChart=Bp;exports.Calendar=Hs;exports.CalendarDays=tS;exports.Camera=rS;exports.ChartNoAxesCombined=oS;exports.Check=qr;exports.CheckCircle=Ia;exports.ChevronDown=Fr;exports.ChevronLeft=Ma;exports.ChevronRight=Br;exports.ChevronUp=nS;exports.ChevronsDown=aS;exports.ChevronsUp=iS;exports.CircleAlert=Ra;exports.CircleCheck=Bn;exports.CircleCheckBig=sS;exports.CircleStop=Mc;exports.Clipboard=Rc;exports.ClipboardCheck=lS;exports.ClipboardList=cS;exports.Clock=Dc;exports.CodeBlock=la;exports.Columns3=dS;exports.CopilotChat=Gz;exports.Copy=vo;exports.CopyPlus=pS;exports.Delete=uS;exports.Download=Nc;exports.Edit=Ac;exports.Expand=Ec;exports.Eye=mS;exports.EyeOff=gS;exports.File=Da;exports.FileText=Lc;exports.Filter=fS;exports.FloatingAgentPanel=Fz;exports.FolderTree=Hn;exports.GitBranch=Oc;exports.GlobalMessage=CT;exports.Globe=zn;exports.Grid=Fc;exports.GripVertical=bS;exports.Hammer=hS;exports.Image=Bc;exports.Info=Na;exports.InputArea=_l;exports.Languages=vS;exports.Layers=yS;exports.LayoutDashboard=CS;exports.Lightbulb=Aa;exports.LineChart=Hc;exports.Loader2=zc;exports.Lock=Ea;exports.LockKeyhole=xS;exports.LogOut=Vc;exports.METRIC_CHART_TYPES=ms;exports.Mail=zs;exports.MapPin=Wc;exports.MarkdownRenderer=pa;exports.MathBlock=ca;exports.Menu=$c;exports.MermaidBlock=dl;exports.MessageCircle=uf;exports.MessageSquare=_c;exports.Mic=La;exports.MicOff=SS;exports.Moon=Gc;exports.MoreHorizontal=wS;exports.NavigationIsland=dd;exports.NavigationIsland2=Xs;exports.OMPHApprovalCard=_x;exports.OMPHPanel=Pz;exports.ORBCAFE_I18N_MESSAGES=qn;exports.ORB_DARK=Kg;exports.ORB_FONT_STACK=I0;exports.ORB_LIGHT=Ug;exports.ORB_RADIUS=R0;exports.ORB_TOKENS=Ls;exports.ORB_TRANSITION_FAST=D0;exports.OrbcafeI18nProvider=Ga;exports.OrbisModeProvider=Fn;exports.PAGE_TRANSITION_PRESETS=CV;exports.PAppPageLayout=WF;exports.PBarcodeScanner=AO;exports.PNavIsland=dm;exports.PNumericKeypad=qO;exports.PSmartFilter=am;exports.PTable=xy;exports.PTouchCard=zO;exports.PWorkloadNav=im;exports.PackageCheck=kS;exports.PackageSearch=PS;exports.PanelLeftOpen=Oa;exports.PanelRight=Fa;exports.PanelsTopLeft=TS;exports.PieChart=Uc;exports.Pin=Jo;exports.PivotChartPanel=Zu;exports.Play=IS;exports.Plus=en;exports.QrCode=MS;exports.ReceiptText=RS;exports.RefreshCw=Ba;exports.Rocket=DS;exports.RotateCcw=NS;exports.RotateCw=Kc;exports.Rows3=AS;exports.SapIcon=Tt;exports.Save=ES;exports.ScanLine=LS;exports.Search=Hr;exports.Send=mf;exports.SendHorizontal=qc;exports.Settings=tn;exports.ShieldCheck=OS;exports.Sigma=FS;exports.SortAsc=BS;exports.SquareSplitHorizontal=HS;exports.Star=zS;exports.StdChat=Vm;exports.Sun=Xc;exports.Table2=VS;exports.TableBlock=ul;exports.TabletSmartphone=WS;exports.Terminal=Vn;exports.ThinkBlock=Oi;exports.ThumbsDown=Yc;exports.ThumbsUp=Zc;exports.Trash2=jc;exports.TreeMenu=Xn;exports.TreePine=$S;exports.TrendingDown=Qc;exports.TriangleAlert=Ha;exports.Truck=_S;exports.UploadCloud=Jc;exports.User=Vs;exports.VoiceNavigatorProvider=t2;exports.VoiceWaveOverlay=YF;exports.Volume2=ed;exports.Warehouse=GS;exports.Workflow=US;exports.X=jt;exports.XCircle=za;exports.addKanbanBucket=bu;exports.buildAmapEmbedUrl=wi;exports.buildGoogleMapEmbedUrl=oa;exports.buildGoogleMapIframe=uR;exports.buttonVariants=db;exports.createKanbanBoardModel=vu;exports.createSapIcon=ne;exports.findKanbanCard=_r;exports.message=uT;exports.messageManager=io;exports.moveKanbanCard=Vi;exports.orbAlpha=rt;exports.orbChartSeries=M0;exports.parseMarkdownTable=Li;exports.parseOmphFileHref=Kl;exports.renameKanbanBucket=hu;exports.renderMarkdown=ZN;exports.resolveVariantFilters=Ai;exports.resolveVariantLayout=Ei;exports.useAINav=zy;exports.useAmapEmbedUrl=bN;exports.useAuthPage=s5;exports.useCardPage=sN;exports.useDetailInfo=uu;exports.useGoogleMapEmbedUrl=fN;exports.useGraphChartData=dN;exports.useGraphInteraction=Ii;exports.useGraphReport=mn;exports.useKanbanBoard=oE;exports.useMediaQuery=Dr;exports.useNavigationIsland=bd;exports.useOrbMode=Cr;exports.useOrbTokens=Fs;exports.useOrbcafeI18n=pe;exports.usePadLayout=wO;exports.usePadRecordEditor=TO;exports.usePageLayout=Pu;exports.usePivotTable=yO;exports.usePlanningGantt=Ng;exports.usePlanningLayout=k5;exports.useStandardReport=LD;exports.useVoiceInput=Sn;exports.useVoiceNavigator=r2;
235
+ `,O5=({active:t=false,colors:o=N0,zIndex:r=2147483e3})=>{let n={"--orbcafe-ai-glow-line":o[0],"--orbcafe-ai-glow-z-index":r};return c(jsxRuntime.Fragment,{children:[e("style",{children:D0}),e("div",{className:"orbcafe-ai-browser-glow","data-active":t?"true":"false",style:n,"aria-hidden":"true"})]})};var Y5=({defaultMode:t="login",onLogin:o,onRegister:r,onForgotPassword:n}={})=>{let[a,i]=to.useState(t),[s,l]=to.useState(false),d=to.useCallback(async u=>{l(true);try{await u?.();}finally{l(false);}},[]),p=to.useCallback(u=>d(()=>o?.(u)),[o,d]),m=to.useCallback(u=>d(()=>r?.(u)),[r,d]),h=to.useCallback(u=>d(()=>n?.(u)),[n,d]),f=to.useMemo(()=>({mode:a,loading:s,onModeChange:i,onLogin:p,onRegister:m,onForgotPassword:h}),[h,p,m,s,a]);return {mode:a,loading:s,setMode:i,authPageProps:f}};I();var L0={productName:"ORBCAFE \u2014 Enterprise suite",headline:"We digitalize you.",subheadline:"One sign-in for planning, production and analytics across your value chain.",brandMeta:"ORBCAFE \xB7 Enterprise manufacturing suite",loginTitle:"Sign in",loginSubtitle:"Use your corporate account to continue.",registerTitle:"Create account",registerSubtitle:"Request a demo workspace user for evaluation.",forgotTitle:"Reset password",forgotSubtitle:"Send a password reset request to your email address."},aV=({mode:t,defaultMode:o="login",onModeChange:r,onLogin:n,onRegister:a,onForgotPassword:i,loading:s=false,logo:l,copy:d,sx:p})=>{let m=t!==void 0,[h,f]=to.useState(o),u=t??h,b=to.useMemo(()=>({...L0,...d}),[d]),[C,g]=to.useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[x,v]=to.useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[y,k]=to.useState({email:""}),[S,P]=to.useState(""),M=E=>{m||f(E),P(""),r?.(E);},w=async E=>{E.preventDefault(),await n?.(C),P("Demo login accepted. No real authentication request was sent.");},N=async E=>{E.preventDefault(),await a?.(x),P("Demo registration saved locally for this screen.");},A=async E=>{E.preventDefault(),await i?.(y),P("Demo reset link request created. No email was sent.");},T=u==="login"?b.loginTitle:u==="register"?b.registerTitle:b.forgotTitle,R=u==="login"?b.loginSubtitle:u==="register"?b.registerSubtitle:b.forgotSubtitle;return c("div",{className:"orb-auth-frame orb-root",style:p,children:[c("div",{className:"orb-auth-brand",children:[e("span",{className:"orb-auth-dia",style:{width:230,height:230,right:-70,bottom:-60}}),e("span",{className:"orb-auth-dia orb-auth-dia-sm-hide",style:{width:140,height:140,right:120,bottom:80,borderColor:"rgba(255,255,255,.09)"}}),e("span",{className:"orb-auth-dia orb-auth-dia-sm-hide",style:{width:76,height:76,right:60,bottom:170,background:"color-mix(in oklch, var(--orb-primary) 35%, transparent)",borderColor:"rgba(255,255,255,.2)"}}),l?e("span",{style:{alignSelf:"flex-start",position:"relative"},children:l}):e("span",{className:"orb-logo-slot",children:"Host logo"}),c("div",{className:"orb-auth-claim",children:[e("div",{className:"orb-auth-rule"}),e("h2",{children:b.headline}),e("p",{children:b.subheadline})]}),e("div",{className:"orb-auth-meta",children:b.brandMeta})]}),e("div",{className:"orb-auth-form",children:c("div",{className:"orb-auth-card",children:[e("span",{className:"orb-overline",style:{letterSpacing:"0.12em"},children:b.productName}),e("h1",{className:"orb-h2",style:{margin:0},children:T}),e("p",{className:"orb-body-dense",style:{color:"var(--orb-muted)",margin:"-10px 0 0"},children:R}),S&&e(rn,{severity:"success",children:S}),u==="login"&&c("form",{onSubmit:w,style:{display:"flex",flexDirection:"column",gap:16},children:[e(ze,{label:"Email",type:"email",autoComplete:"username",value:C.username,onChange:E=>g(O=>({...O,username:E.target.value})),startAdornment:e(js,{size:15,strokeWidth:1.8})}),e(ze,{label:"Password",type:"password",autoComplete:"current-password",value:C.password,onChange:E=>g(O=>({...O,password:E.target.value})),startAdornment:e(Va,{size:15,strokeWidth:1.8})}),c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[e(It,{label:"Remember me",checked:C.remember,onChange:E=>g(O=>({...O,remember:E.target.checked}))}),e("button",{type:"button",className:"orb-link",onClick:()=>M("forgot"),children:"Forgot password?"})]}),e(Te,{type:"submit",size:"large",block:true,loading:s,children:s?"Signing in\u2026":"Sign in"}),c("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["New user?"," ",e("button",{type:"button",className:"orb-link",onClick:()=>M("register"),children:"Register"})]})]}),u==="register"&&c("form",{onSubmit:N,style:{display:"flex",flexDirection:"column",gap:16},children:[e(ze,{label:"Full name",value:x.name,onChange:E=>v(O=>({...O,name:E.target.value})),startAdornment:e(js,{size:15,strokeWidth:1.8})}),e(ze,{label:"Work email",type:"email",autoComplete:"username",value:x.email,onChange:E=>v(O=>({...O,email:E.target.value})),startAdornment:e(Ys,{size:15,strokeWidth:1.8})}),e(ze,{label:"Password",type:"password",autoComplete:"new-password",value:x.password,onChange:E=>v(O=>({...O,password:E.target.value})),startAdornment:e(Va,{size:15,strokeWidth:1.8})}),e(ze,{label:"Confirm password",type:"password",autoComplete:"new-password",value:x.confirmPassword,onChange:E=>v(O=>({...O,confirmPassword:E.target.value}))}),e(It,{label:"I accept the demo workspace terms",checked:x.acceptedTerms,onChange:E=>v(O=>({...O,acceptedTerms:E.target.checked}))}),e(Te,{type:"submit",size:"large",block:true,loading:s,children:"Create demo account"}),c("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Already have an account?"," ",e("button",{type:"button",className:"orb-link",onClick:()=>M("login"),children:"Sign in"})]})]}),u==="forgot"&&c("form",{onSubmit:A,style:{display:"flex",flexDirection:"column",gap:16},children:[e(ze,{label:"Work email",type:"email",autoComplete:"username",value:y.email,onChange:E=>k({email:E.target.value}),startAdornment:e(Ys,{size:15,strokeWidth:1.8})}),e(Te,{type:"submit",size:"large",block:true,loading:s,children:"Send reset request"}),c("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Remember your password?"," ",e("button",{type:"button",className:"orb-link",onClick:()=>M("login"),children:"Back to sign in"})]})]}),c("div",{style:{display:"flex",alignItems:"center",gap:12,font:"500 10px/1 var(--orb-font)",letterSpacing:"0.1em",textTransform:"uppercase",color:"var(--orb-muted)"},children:[e("span",{style:{flex:1,height:1,background:"var(--orb-border)"}}),"or",e("span",{style:{flex:1,height:1,background:"var(--orb-border)"}})]}),e(Te,{variant:"neutral",size:"large",block:true,children:"Continue with corporate SSO"}),c("p",{className:"orb-meta",style:{textAlign:"center",fontWeight:300,margin:0},children:["Protected by corporate single sign-on.",e("br",{}),"Demo credentials: demo@orbcafe.local / orbcafe-demo"]})]})})]})};var F0={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},B0=[{id:"keyword",label:"Keyword",type:"text",placeholder:"Task/ID/Project",hasSearchIcon:true},{id:"status",label:"Status",type:"select",options:[{label:"In progress",value:"in-progress"},{label:"Blocked",value:"blocked"},{label:"Planned",value:"planned"},{label:"Not started",value:"not-started"}]},{id:"owner",label:"Owner",type:"text",placeholder:"Owner name"},{id:"workCenter",label:"Work Center",type:"text",placeholder:"CNC-02 / WH-A / ..."},{id:"dateRange",label:"Date Range",type:"date"}],Zg=({tasks:t,appId:o,tableKey:r,defaultScale:n="week",defaultSelectedTaskId:a,initialFilters:i,filterFields:s,filterAppId:l,filterTableKey:d,serviceUrl:p,variantService:m,layout:h,columns:f,page:u,rowsPerPage:b,rowsPerPageOptions:C,count:g,onPageChange:x,onRowsPerPageChange:v,onFilterSearch:y,onFilterVariantLoad:k,enableRowReorder:S,onTaskReorder:P,onLayoutIdChange:M,onLayoutSave:w})=>{let N=o??l??"planning-gantt",A=r??d??"planning",[T,R]=to.useState(n),[E,O]=to.useState(a??t[0]?.id??""),[$,ee]=to.useState(""),[F,G]=to.useState(null),[W,Q]=to.useState({...F0,...i}),z=to.useMemo(()=>{let ce=String(W.keyword?.value??"").trim().toLowerCase(),fe=String(W.status?.value??"").trim(),Ve=String(W.owner?.value??"").trim().toLowerCase(),ve=String(W.workCenter?.value??"").trim().toLowerCase(),xe=W.dateRange?.value,He=xe?.[0]?ar__default.default(xe[0]):null,pe=xe?.[1]?ar__default.default(xe[1]):null;return t.filter(ye=>{if(ce&&![ye.id,ye.code,ye.title,ye.project,ye.workCenter,ye.owner?.name].join(" ").toLowerCase().includes(ce)||fe&&ye.status!==fe||Ve&&!String(ye.owner?.name??"").toLowerCase().includes(Ve)||ve&&!String(ye.workCenter??"").toLowerCase().includes(ve))return false;if(He||pe){let $e=ar__default.default(ye.startDate),tt=ar__default.default(ye.endDate),at=He?tt.isAfter(He)||tt.isSame(He,"day"):true,st=pe?$e.isBefore(pe)||$e.isSame(pe,"day"):true;if(!at||!st)return false}return true})},[W,t]);to.useEffect(()=>{z.length!==0&&(z.some(ce=>ce.id===E)||O(z[0].id));},[z,E]);let H=to.useCallback(ce=>{O(ce.id);},[]),X=to.useCallback(ce=>{ee(ce),M?.(ce);},[M]),Y=to.useCallback(ce=>{G(fe=>({key:(fe?.key??0)+1,variant:ce})),k?.(ce);},[k]),j=to.useMemo(()=>({appId:N,tableKey:A,fields:s??B0,filters:W,onFilterChange:Q,onVariantLoad:Y,onSearch:y??(()=>{}),currentLayoutId:$,layoutRefs:[{tableKey:A,layoutId:$||null}],variantService:m,serviceUrl:p}),[$,s,W,Y,y,N,A,p,m]),te=to.useMemo(()=>({appId:N,tableKey:A,serviceUrl:p,tasks:z,columns:f,scale:T,onScaleChange:R,page:u,rowsPerPage:b,rowsPerPageOptions:C,count:g,onPageChange:x,onRowsPerPageChange:v,selectedTaskId:E,onTaskSelect:H,enableRowReorder:S,onTaskReorder:P,layout:h,layoutVariant:F?.variant,layoutVariantLoadKey:F?.key,onLayoutIdChange:X,onLayoutSave:w}),[f,g,S,z,X,h,F?.key,F?.variant,x,v,w,P,H,u,N,A,b,C,T,p,E]);return {scale:T,setScale:R,selectedTaskId:E,setSelectedTaskId:O,filters:W,setFilters:Q,filteredTasks:z,smartFilterProps:j,planningGanttProps:te}};var mV=t=>{let o=Zg(t),r=to.useMemo(()=>({filterProps:o.smartFilterProps,ganttProps:o.planningGanttProps}),[o.planningGanttProps,o.smartFilterProps]);return {...o,layoutProps:r}};I();ar__default.default.extend(z0__default.default);var wc=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],Sc=36,kc=58,Na=8,Pc=260,K0=320,Ur="220ms cubic-bezier(0.2, 0, 0, 1)",Yg={"not-started":{label:"Not started",color:"default"},planned:{label:"Planned",color:"info"},"in-progress":{label:"In progress",color:"primary"},blocked:{label:"Blocked",color:"error"},done:{label:"Done",color:"success"}},q0=t=>t?Yg[t]?.label??t:"Planned",X0=t=>t?Yg[t]?.color??"default":"info",jg=t=>Math.min(100,Math.max(0,t??0)),Qg=(t,o=0)=>t.flatMap(r=>[{...r,level:o},...Qg(r.children??[],o+1)]),Z0=t=>({id:t.id,code:t.code??t.id,title:t.title,titleSub:t.project??t.workCenter??"General",project:t.project??"",workCenter:t.workCenter??"",owner:t.owner?.name??"Unassigned",status:q0(t.status),statusTone:t.status??"planned",progress:jg(t.progress),startDate:t.startDate,endDate:t.endDate,color:t.color,reorderable:t.reorderable!==false}),Jg=(t,o)=>o==="month"?t.startOf("month"):o==="week"?t.startOf("week"):o==="day"?t.startOf("day"):t.startOf("hour"),eh=(t,o)=>o==="month"?t.endOf("month"):o==="week"?t.endOf("week"):o==="day"?t.endOf("day"):t.endOf("hour"),Y0=(t,o,r)=>{let n=[],a=Jg(t,r),i=eh(o,r);for(;a.isBefore(i)||a.isSame(i);){let s=r==="month"?a.add(1,"month"):r==="week"?a.add(1,"week"):r==="day"?a.add(1,"day"):a.add(1,"hour");n.push({key:`${r}-${a.valueOf()}`,label:r==="month"?a.format("MMM YYYY"):r==="week"?a.format("MMM D"):r==="day"?a.format("D"):a.format("HH:mm"),contextLabel:r==="hour"?a.format("MMM D"):r==="day"?a.format("MMM"):r==="week"?`W${a.isoWeek()}`:void 0,title:r==="hour"?a.format("MMM D, YYYY HH:mm"):r==="day"?a.format("MMM D, YYYY"):r==="week"?`${a.format("MMM D, YYYY")} - Week ${a.isoWeek()}`:void 0,start:a,end:s}),a=s;}return n},Tc=(t,o,r)=>{let n=0;for(let a of o){if(t.isBefore(a.start))return n;if(t.isBefore(a.end)){let i=Math.max(1,a.end.valueOf()-a.start.valueOf()),s=Math.max(0,t.valueOf()-a.start.valueOf());return n+s/i*r}n+=r;}return n},th=({appId:t="planning-gantt",tableKey:o="planning",serviceUrl:r,title:n="Project Plan",extraTools:a,bodyHeight:i=560,tasks:s,columns:l,scale:d="week",onScaleChange:p,page:m,rowsPerPage:h=20,rowsPerPageOptions:f=[20,50,100,-1],count:u,onPageChange:b,onRowsPerPageChange:C,timelineStart:g,timelineEnd:x,selectedTaskId:v,onTaskSelect:y,enableRowReorder:k=true,onTaskReorder:S,layout:P,layoutVariant:M,layoutVariantLoadKey:w,onLayoutIdChange:N,onLayoutSave:A,emptyLabel:T="No planning tasks available.",sx:R})=>{let E=lo(),{t:O}=de(),$=to.useRef(null),ee=to.useRef(null),F=to.useRef(null),G=to.useRef(false),[W,Q]=to.useState(null),[z,H]=to.useState("content"),[X,Y]=to.useState(null),[j,te]=to.useState(0),[ce,fe]=to.useState({}),[Ve,ve]=to.useState(Sc),[xe,He]=to.useState([]),pe=to.useRef(void 0),[ye,$e]=to.useState({activeId:null,overId:null}),[tt,at]=to.useState(null),[st,K]=to.useState(false),Ne=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:4}})),Se=to.useRef(null),Fe=to.useMemo(()=>Qg(s),[s]),it=to.useMemo(()=>{if(xe.length===0)return Fe;let B=new Map(Fe.map(Ie=>[Ie.id,Ie])),J=xe.map(Ie=>B.get(Ie)).filter(Ie=>!!Ie),he=new Set(J.map(Ie=>Ie.id));return [...J,...Fe.filter(Ie=>!he.has(Ie.id))]},[Fe,xe]),Ye=to.useMemo(()=>new Map(it.map(B=>[B.id,B])),[it]),wt=to.useMemo(()=>it.map(B=>Z0(B)),[it]),Mt=to.useMemo(()=>new Map(wt.map(B=>[B.id,B])),[wt]),Ft=to.useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(B,J)=>c(le,{spacing:.2,children:[e(L,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:J.title}),e(L,{sx:{fontSize:13,color:"text.secondary"},children:J.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(B,J)=>e(xt,{label:J.status,color:X0(J.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:B=>c(le,{spacing:.6,children:[c(L,{variant:"caption",sx:{color:"text.secondary"},children:[B,"%"]}),e(Un,{variant:"determinate",value:B,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),Et=to.useMemo(()=>{if(!l||l.length===0)return Ft;let B=new Map(Ft.map(J=>[J.id,J]));return l.map(J=>{let he=B.get(J.id),Ie=J.width??he?.minWidth??120,et={id:J.id,label:J.label,minWidth:Ie};if(he?.numeric&&(et.numeric=true),J.render){let Xe=J.render;return et.render=(kt,ft)=>{let gt=Ye.get(ft.id);return Xe(gt||ft)},et}return he?.render?(et.render=he.render,et):(et.render=(Xe,kt)=>{let ft=kt[J.id];if(ft!=null&&String(ft).length>0)return String(ft);let Ct=Ye.get(kt.id)?.[J.id];return Ct!=null&&String(Ct).length>0?String(Ct):"-"},et)})},[l,Ft,Ye]),ne=bn({appId:t,tableKey:o,title:n,columns:Et,rows:wt,rowKey:"id",page:m,rowsPerPage:h,rowsPerPageOptions:f,count:u??wt.length,onPageChange:b,onRowsPerPageChange:C,showSummary:false,layout:P,onLayoutSave:A}),Ke=t?e(fn,{appId:t,tableKey:o,currentLayoutData:ne.currentLayoutData,onLayoutLoad:ne.handleLayoutLoad,targetLayoutId:ne.layoutIdToLoad,activeLayoutId:ne.currentLayoutId,serviceUrl:r}):null,Oe=ne.visibleRows;to.useEffect(()=>{let B=Fe.map(J=>J.id);He(J=>{let he=new Set(B),Ie=J.filter(ft=>he.has(ft)),et=new Set(Ie),Xe=B.filter(ft=>!et.has(ft)),kt=[...Ie,...Xe];return kt.length===J.length&&kt.every((ft,gt)=>ft===J[gt])?J:kt});},[Fe]),to.useEffect(()=>{w===void 0||!M||pe.current!==w&&(pe.current=w,ne.handleVariantLoad(M));},[ne,M,w]),to.useEffect(()=>{N?.(ne.currentLayoutId);},[ne.currentLayoutId,N]);let ue=B=>B.type==="group"?`group-${B.id}`:`row-${(B.data||B)?.id}`,we=to.useMemo(()=>{let B=wt.map(gt=>ar__default.default(gt.startDate)),J=wt.map(gt=>ar__default.default(gt.endDate)),he=g?ar__default.default(g):B.reduce((gt,Ct)=>Ct.isBefore(gt)?Ct:gt,B[0]??ar__default.default()),Ie=x?ar__default.default(x):J.reduce((gt,Ct)=>Ct.isAfter(gt)?Ct:gt,J[0]??ar__default.default().add(30,"day")),et=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",Xe=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",kt=d==="hour"?12:1,ft=d==="hour"?12:1;return {start:Jg(he.subtract(kt,et),d),end:eh(Ie.add(ft,Xe),d)}},[wt,d,x,g]),re=wc.find(B=>B.value===d)??wc[1],Ce=Array.isArray(a)?a:a?[a]:[],De=to.useMemo(()=>Y0(we.start,we.end,d),[we.end,we.start,d]),Je=De.length*re.width,lt=De.length>0?100/De.length:100,ut=De.length>0?`repeat(${De.length}, minmax(${re.width}px, 1fr))`:"1fr",Ht=De.length>0?`calc(100% / ${De.length}) 100%`:"100% 100%",Yt=(ne.columns||[]).filter(B=>ne.visibleColumns.includes(B.id)).reduce((B,J)=>B+(ne.columnWidths?.[J.id]||J.minWidth||100),0)+(ne.grouping.length>0?72:0),Wt=z==="manual"&&W!==null?W:Yt,St=X==="table",$t=X==="timeline",bt=X==="timeline",At=X==="table",ct=!bt&&!At,Bt=()=>{let B=j||$.current?.clientWidth||0;return B>0?Math.max(Pc,B-Na-K0):Math.max(Pc,Yt)},jt=B=>Math.min(Math.max(B,Pc),Bt()),V=(()=>{if(j<=0)return null;let B=ct?Na:0;if(St)return {tableWidth:j,splitterWidth:B,timelineWidth:0};if($t)return {tableWidth:0,splitterWidth:B,timelineWidth:j};if(z==="even"){let he=Math.max(0,(j-B)/2);return {tableWidth:he,splitterWidth:B,timelineWidth:Math.max(0,j-B-he)}}let J=jt(Wt);return {tableWidth:J,splitterWidth:B,timelineWidth:Math.max(0,j-B-J)}})(),Z=V?`${V.tableWidth}px ${V.splitterWidth}px ${V.timelineWidth}px`:St?"minmax(0, 1fr) 0px 0px":$t?"0px 0px minmax(0, 1fr)":z==="even"?`minmax(0, 1fr) ${Na}px minmax(0, 1fr)`:`${Wt}px ${Na}px minmax(0, 1fr)`;to.useEffect(()=>{z==="manual"&&Q(B=>B===null?null:jt(B));},[z,Yt,j]);let be=B=>{B.preventDefault(),B.currentTarget.setPointerCapture(B.pointerId),Y(null),H("manual"),Se.current={startX:B.clientX,startWidth:ee.current?.getBoundingClientRect().width??Wt};let J=Ie=>{let et=Se.current;if(!et)return;let Xe=jt(et.startWidth+Ie.clientX-et.startX);Q(Xe);},he=()=>{Se.current=null,window.removeEventListener("pointermove",J),window.removeEventListener("pointerup",he),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",J),window.addEventListener("pointerup",he);},ke=()=>{Y(null),H("even"),Q(null);},Ee=B=>!k||!B?false:Mt.get(B)?.reorderable!==false,_e=(B,J)=>{if(!B||!J||B===J||!Ee(B)||!Ee(J))return false;if(ne.grouping.length===0)return true;let he=Mt.get(B),Ie=Mt.get(J);return !he||!Ie?false:ne.grouping.every(et=>he[et]===Ie[et])},qe=(B,J)=>{if(!_e(B,J))return;let he=Oe.filter(Lt=>Lt.type!=="group").map(Lt=>String((Lt.data||Lt)?.id)),Ie=he.indexOf(B),et=he.indexOf(J);if(Ie<0||et<0)return;let Xe=[...he];[Xe[Ie],Xe[et]]=[Xe[et],Xe[Ie]];let kt=new Set(he),ft=it.map(Lt=>Lt.id),gt=[...Xe,...ft.filter(Lt=>!kt.has(Lt))],Ct=Ye.get(B),ao=Ye.get(J);if(ne.setOrder("asc"),ne.setOrderBy(""),He(gt),Ct&&ao){let{level:Lt,...Qt}=Ct,{level:zt,...qt}=ao,_t=gt.reduce((ro,io)=>{let vo=Ye.get(io);if(vo){let{level:Ro,...No}=vo;ro.push(No);}return ro},[]);S?.(_t,{activeTask:Qt,targetTask:qt});}},je=(B,J)=>{if(!Ee(J.id)){B.preventDefault();return}B.stopPropagation(),B.dataTransfer.effectAllowed="move",B.dataTransfer.setData("text/plain",J.id),$e({activeId:J.id,overId:null}),y?.(Ye.get(J.id)||J);},mt=(B,J)=>{if(!_e(ye.activeId,J)){$e(he=>he.overId===null?he:{...he,overId:null});return}B.preventDefault(),B.stopPropagation(),B.dataTransfer.dropEffect="move",$e(he=>he.overId===J?he:{...he,overId:J});},ht=(B,J)=>{let he=ye.activeId||B.dataTransfer.getData("text/plain");if(!_e(he,J)){$e({activeId:null,overId:null});return}B.preventDefault(),B.stopPropagation(),qe(he,J),$e({activeId:null,overId:null});},Rt=()=>{$e({activeId:null,overId:null});},yt=B=>{if(G.current)return;let J=B==="table"?ee.current:F.current,he=B==="table"?F.current:ee.current;!J||!he||(G.current=true,he.scrollTop=J.scrollTop,window.requestAnimationFrame(()=>{G.current=false;}));};return to.useLayoutEffect(()=>{let B=$.current;if(!B){te(0);return}let J=0,he=()=>{window.cancelAnimationFrame(J),J=window.requestAnimationFrame(()=>{let et=B.clientWidth;te(Xe=>Math.abs(Xe-et)<.5?Xe:et);});};if(he(),typeof ResizeObserver>"u")return window.addEventListener("resize",he),()=>{window.cancelAnimationFrame(J),window.removeEventListener("resize",he);};let Ie=new ResizeObserver(he);return Ie.observe(B),window.addEventListener("resize",he),()=>{window.cancelAnimationFrame(J),Ie.disconnect(),window.removeEventListener("resize",he);}},[wt.length]),to.useLayoutEffect(()=>{if(!v||At)return;let B=F.current,J=ee.current;if(!B)return;let he=`row-${v}`,Ie=Array.from(B.querySelectorAll("[data-planning-timeline-row-key]")).find(kt=>kt.dataset.planningTimelineRowKey===he),et=Mt.get(v);if(!Ie||!et)return;let Xe=window.requestAnimationFrame(()=>{let kt=B.getBoundingClientRect(),ft=Ie.getBoundingClientRect(),gt=Math.max(1,B.clientHeight-Ve),Ct=B.scrollTop+ft.top-kt.top-Ve-(gt-ft.height)/2;G.current=true,B.scrollTop=Math.max(0,Ct),J&&!bt&&(J.scrollTop=B.scrollTop);let ao=Math.max(1,B.scrollWidth),Lt=De.length>0?ao/De.length:re.width,Qt=Tc(ar__default.default(et.startDate),De,Lt),zt=Math.max(0,Qt-Lt);B.scrollLeft=Math.min(zt,Math.max(0,ao-B.clientWidth)),window.requestAnimationFrame(()=>{G.current=false;});});return ()=>window.cancelAnimationFrame(Xe)},[re.width,Ve,v,bt,Mt,At,Oe,De]),to.useLayoutEffect(()=>{let B=ee.current;if(!B)return;let J=0,he=0,Ie=false,et=()=>{if(Ie)return;let zt=B.querySelector("thead"),qt=Array.from(B.querySelectorAll("tbody tr[data-ctable-row-key]"));if(qt.length===0)return;let _t=zt?.getBoundingClientRect().height||Sc,ro={};qt.forEach(io=>{let vo=io.dataset.ctableRowKey;vo&&(ro[vo]=io.getBoundingClientRect().height);}),ve(io=>Math.abs(io-_t)<.01?io:_t),fe(io=>{let vo=Object.keys(io),Ro=Object.keys(ro);return vo.length===Ro.length&&Ro.every(No=>Math.abs((io[No]??0)-ro[No])<.01)?io:ro});},Xe=()=>{window.cancelAnimationFrame(J),J=window.requestAnimationFrame(et);};if(et(),window.cancelAnimationFrame(he),he=window.requestAnimationFrame(()=>{he=window.requestAnimationFrame(et);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{Ie||Xe();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",Xe),()=>{Ie=true,window.cancelAnimationFrame(J),window.cancelAnimationFrame(he),window.removeEventListener("resize",Xe);};let kt=new ResizeObserver(Xe),ft=B.querySelector("table"),gt=B.querySelector("tbody"),Ct=B.querySelector("thead");ft&&kt.observe(ft),Ct&&kt.observe(Ct);let ao=new WeakSet,Lt=()=>{B.querySelectorAll("tbody tr[data-ctable-row-key]").forEach(zt=>{ao.has(zt)||(kt.observe(zt),ao.add(zt));});};Lt();let Qt=null;return gt&&typeof MutationObserver<"u"&&(Qt=new MutationObserver(()=>{Lt(),Xe();}),Qt.observe(gt,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",Xe),()=>{Ie=true,window.cancelAnimationFrame(J),window.cancelAnimationFrame(he),kt.disconnect(),Qt?.disconnect(),window.removeEventListener("resize",Xe);}},[Oe,ne.visibleColumns,ne.grouping,ne.columnWidths]),c(Ae,{className:"orb-ctable-surface orb-planning-gantt",elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:"var(--orb-r-container)",border:`1px solid ${E.palette.divider}`,...R},children:[e("div",{className:"orb-table-toolbar orb-planning-table-toolbar",role:"toolbar","aria-label":O("table.title.default"),children:c("div",{className:"orb-table-toolbar-primary",children:[e(xi,{value:ne.filterText,onChange:B=>{ne.setFilterText(B),ne.setPage(0);}}),e(Ci,{rowsPerPage:ne.rowsPerPage,rowsPerPageOptions:f,page:ne.page,count:ne.totalDisplayCount,onRowsPerPageChange:ne.setRowsPerPage,onPageChange:ne.setPage}),Ce.length>0&&e("div",{className:"orb-table-toolbar-custom",children:Ce.map((B,J)=>e("div",{className:"orb-planning-extra-tool",children:B},`planning-extra-tool-${J}`))}),e("span",{className:"orb-table-toolbar-spacer"}),c("div",{className:"orb-table-toolbar-actions",children:[c("div",{className:"orb-table-tool-group",children:[e(se,{className:"orb-table-tool-button",tooltip:"Column visibility",onClick:B=>ne.setAnchorEl(B.currentTarget),sx:mo,children:e(ln,{fontSize:"small"})}),e(se,{className:"orb-table-tool-button",tooltip:"Group by",onClick:B=>ne.setGroupAnchorEl(B.currentTarget),sx:mo,children:e(wr,{fontSize:"small"})}),e(se,{className:`orb-table-tool-button ${ne.sortBy.length>0||ne.orderBy?"orb-is-active":""}`,tooltip:"Sort by...",active:ne.sortBy.length>0||!!ne.orderBy,onClick:()=>K(true),sx:mo,children:e(Pp,{fontSize:"small"})})]}),Ke&&e("div",{className:"orb-table-tool-group",children:Ke}),e("div",{className:"orb-table-tool-group orb-planning-pane-controls",children:e(Kn,{"aria-label":"Planning pane layout",size:"small",value:X??(z==="even"?"split":null),options:[{value:"table",label:"Expand task table",icon:e(gi,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:e(fi,{fontSize:"small"})},{value:"timeline",label:"Expand timeline",icon:e(mi,{fontSize:"small"})}],onValueChange:B=>{B==="split"?ke():Y(B);}})}),e("div",{className:"orb-table-tool-group orb-planning-scale-control",children:e(Vt,{label:"",value:d,options:wc.map(B=>({value:B.value,label:B.label})),onChange:B=>p?.(B.target.value)})})]})]})}),wt.length===0?e("div",{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:T}):e("div",{sx:{overflow:"hidden",flex:1,minHeight:0},children:c("div",{ref:$,sx:{height:"100%",display:"grid",gridTemplateColumns:Z,minWidth:0,transition:`grid-template-columns ${Ur}`},children:[e("div",{"data-planning-scroll-pane":"table",ref:ee,onScroll:()=>yt("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:i,overflowX:"auto",overflowY:"auto",opacity:bt?0:1,transform:bt?"translateX(-10px)":"translateX(0)",pointerEvents:bt?"none":"auto",transition:`opacity ${Ur}, transform ${Ur}`},children:e(core.DndContext,{sensors:Ne,collisionDetection:core.closestCenter,modifiers:[modifiers.restrictToHorizontalAxis],onDragEnd:B=>{let J=B?.active?.id,he=B?.over?.id;typeof J=="string"&&typeof he=="string"&&ne.handleColumnReorder(J,he);},children:c("table",{className:"orb-tbl orb-ctable orb-planning-table",sx:{tableLayout:"fixed",width:Yt,"& thead th":{height:Sc,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[e(ki,{columns:ne.columns,visibleColumns:ne.visibleColumns,order:ne.order,orderBy:ne.orderBy,sortBy:ne.sortBy,onRequestSort:ne.handleRequestSort,onContextMenu:(B,J)=>{B.preventDefault(),B.stopPropagation(),at({mouseX:B.clientX+2,mouseY:B.clientY-6,columnId:J});},grouping:ne.grouping,isAllExpanded:ne.isAllExpanded,handleToggleAll:ne.handleToggleAll,columnWidths:ne.columnWidths,onColumnResize:ne.handleColumnResize,enableColumnReorder:true}),e(Pi,{visibleRows:Oe,columns:ne.columns,visibleColumns:ne.visibleColumns,selected:v?[v]:[],expandedGroups:ne.expandedGroups,toggleGroupExpand:ne.toggleGroupExpand,handleExpandGroupRecursively:ne.handleExpandGroupRecursively,handleCollapseGroupRecursively:ne.handleCollapseGroupRecursively,isGroupFullyExpanded:ne.isGroupFullyExpanded,grouping:ne.grouping,rowKeyProp:"id",page:ne.page,rowsPerPage:ne.rowsPerPage,emptyLabel:T,handleClick:(B,J)=>{y?.(Ye.get(J.id)||J);},getRowDataKey:({entry:B})=>ue(B),getGroupRowProps:()=>({style:{height:kc}}),getRowProps:({data:B})=>{let J=B,he=Ee(J.id),Ie=ye.activeId===J.id,et=ye.overId===J.id&&_e(ye.activeId,J.id);return {draggable:he,className:et?"orb-is-drop-target":void 0,style:{cursor:Ie?"grabbing":he?"grab":y?"pointer":"default",height:kc,opacity:Ie?.56:1,transition:"background-color 120ms ease, opacity 120ms ease"},onDragStart:Xe=>je(Xe,J),onDragOver:Xe=>mt(Xe,J.id),onDragEnter:Xe=>mt(Xe,J.id),onDrop:Xe=>ht(Xe,J.id),onDragEnd:Rt}}})]})})}),e("div",{onPointerDown:ct?be:void 0,role:"separator","aria-orientation":"vertical",sx:{width:ct?Na:0,cursor:ct?"col-resize":"default",opacity:ct?1:0,pointerEvents:ct?"auto":"none",borderLeft:ct?`1px solid ${E.palette.divider}`:"0 solid transparent",borderRight:ct?`1px solid ${E.palette.divider}`:"0 solid transparent",backgroundColor:vt()==="dark"?"color-mix(in oklch, var(--orb-muted) 10%, transparent)":"color-mix(in oklch, var(--orb-fg) 4%, transparent)",transition:`width ${Ur}, opacity ${Ur}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:E.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:ct?"col-resize":"default"}}}),e("div",{sx:{minWidth:0,overflow:"hidden",opacity:At?0:1,transform:At?"translateX(10px)":"translateX(0)",pointerEvents:At?"none":"auto",transition:`opacity ${Ur}, transform ${Ur}`},children:e("div",{"data-planning-scroll-pane":"timeline",ref:F,onScroll:()=>yt("timeline"),sx:{width:"100%",height:i,overflowX:"auto",overflowY:"auto"},children:c("div",{sx:{width:"100%",minWidth:Je||"100%"},children:[e("div",{className:"orb-planning-timeline-header",sx:{display:"grid",gridTemplateColumns:ut,height:Ve,boxSizing:"border-box",borderBottom:`1px solid ${E.palette.divider}`,position:"sticky",top:0,zIndex:2},children:De.map(B=>c("div",{title:B.title,sx:{px:.75,display:"flex",flexDirection:B.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:B.contextLabel?.15:0,borderRight:`1px solid ${E.palette.divider}`,color:B.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[B.contextLabel&&e(L,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"text.secondary",fontSize:11,fontWeight:700,lineHeight:1.1},children:B.contextLabel}),e(L,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:B.label})]},B.key))}),e(le,{sx:{position:"relative"},children:Oe.map(B=>{let J=ue(B),he=ce[J]??kc;if(B.type==="group")return e("div",{className:"orb-planning-timeline-row orb-table-group-row","data-planning-timeline-row-key":J,sx:{position:"relative",height:he,boxSizing:"border-box",borderBottom:`1px solid ${E.palette.divider}`}},B.id);let Ie=B.data||B,et=ar__default.default(Ie.startDate),Xe=ar__default.default(Ie.endDate),kt=Tc(et,De,lt),ft=Tc(Xe,De,lt),gt=Math.max(0,ft-kt),Ct=jg(Ie.progress),ao=Ie.id===v,Lt=Ee(Ie.id),Qt=ye.activeId===Ie.id,zt=ye.overId===Ie.id&&_e(ye.activeId,Ie.id),qt=Ie.color??(Ie.statusTone==="blocked"?E.palette.error.main:E.palette.primary.main);return e("div",{className:`orb-planning-timeline-row ${ao?"orb-is-selected":""}`,"data-planning-timeline-row-key":J,draggable:Lt,onDragStart:_t=>je(_t,Ie),onDragOver:_t=>mt(_t,Ie.id),onDragEnter:_t=>mt(_t,Ie.id),onDrop:_t=>ht(_t,Ie.id),onDragEnd:Rt,onClick:()=>y?.(Ye.get(Ie.id)||Ie),sx:{position:"relative",height:he,boxSizing:"border-box",borderBottom:`1px solid ${E.palette.divider}`,opacity:Qt?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:E.palette.primary.main,opacity:zt?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:vt()==="dark"?"linear-gradient(90deg, color-mix(in oklch, var(--orb-muted) 8%, transparent) 1px, transparent 1px)":"linear-gradient(90deg, color-mix(in oklch, var(--orb-fg) 6%, transparent) 1px, transparent 1px)",backgroundSize:Ht,cursor:Qt?"grabbing":Lt?"grab":y?"pointer":"default",transition:"opacity 120ms ease"},children:e(dt,{title:`${Ie.title}: ${et.format("MMM D HH:mm")} - ${Xe.format("MMM D HH:mm")}`,children:c("div",{sx:{position:"absolute",left:`${kt}%`,top:Math.max(8,(he-24)/2),width:`max(18px, ${gt}%)`,height:24,borderRadius:999,overflow:"hidden",backgroundColor:vt()==="dark"?"color-mix(in oklch, var(--orb-muted) 18%, transparent)":"color-mix(in oklch, var(--orb-fg) 10%, transparent)",outline:ao?`2px solid ${E.palette.warning.main}`:"none",outlineOffset:2},children:[e("div",{sx:{height:"100%",width:`${Ct}%`,backgroundColor:qt}}),e(L,{sx:{position:"absolute",inset:0,px:1,display:"flex",alignItems:"center",color:"var(--orb-on-primary)",fontSize:11,fontWeight:800,textShadow:"0 1px 4px rgba(0,0,0,0.45)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Ie.code})]})})},Ie.id)})})]})})})]})}),e(pn,{groupAnchorEl:ne.groupAnchorEl,setGroupAnchorEl:ne.setGroupAnchorEl,grouping:ne.grouping,setGrouping:ne.setGrouping,columns:ne.columns}),e(un,{anchorEl:ne.anchorEl,setAnchorEl:ne.setAnchorEl,columns:ne.columns,visibleColumns:ne.visibleColumns,toggleColumnVisibility:ne.toggleColumnVisibility}),e($p,{contextMenu:tt,handleClose:()=>at(null),columns:ne.columns,visibleColumns:ne.visibleColumns,grouping:ne.grouping,summaryColumns:ne.summaryColumns,showSummary:ne.showSummary,sortBy:ne.sortBy,orderBy:ne.orderBy,order:ne.order,onSortAsc:B=>{ne.applyMultiSort([{field:B,direction:"asc"}]);},onSortDesc:B=>{ne.applyMultiSort([{field:B,direction:"desc"}]);},onClearSort:B=>{let J=ne.sortBy.filter(he=>he.field!==B);J.length>0?ne.applyMultiSort(J):(ne.clearMultiSort(),ne.orderBy===B&&ne.setOrderBy(""));},onHideColumn:B=>{ne.visibleColumns.includes(B)&&ne.toggleColumnVisibility(B);},onToggleGroup:B=>ne.toggleGroupField(B),onToggleSummary:B=>ne.toggleSummaryColumn(B),onOpenSortDialog:()=>K(true)}),e(_p,{open:st,onClose:()=>K(false),columns:ne.columns,initialRules:ne.sortBy.length>0?ne.sortBy:ne.orderBy?[{field:ne.orderBy,direction:ne.order}]:[],onApply:B=>ne.applyMultiSort(B),onClear:()=>{ne.clearMultiSort(),ne.setOrderBy("");}})]})};I();var KV=({filterProps:t,ganttProps:o,spacing:r=2,sx:n,children:a})=>{let i=n?[{height:"100%",overflow:"hidden"},n]:{height:"100%",overflow:"hidden"},s=o.sx?[{height:"100%"},o.sx]:{height:"100%"};return c(le,{spacing:r,sx:i,children:[e("div",{sx:{flexShrink:0},children:e(Go,{...t})}),e("div",{sx:{flex:1,minHeight:0,overflow:"hidden"},children:e(th,{...o,bodyHeight:o.bodyHeight??"100%",sx:s})}),a]})};I();var oh=640,j0=360,Q0=360,$s=8,On="220ms cubic-bezier(0.2, 0, 0, 1)",Rc=(t,o,r=0,n=[])=>t.flatMap(a=>{let i=a.children??[],s=[{node:a,level:r,hasChildren:i.length>0,parentIds:n}];return o.has(a.id)?[...s,...Rc(i,o,r+1,[...n,a.id])]:s}),nh=t=>t.flatMap(o=>[o,...nh(o.children??[])]),ah=(t,o=0,r=[])=>t.flatMap(n=>{let a=n.children??[];return [{node:n,level:o,hasChildren:a.length>0,parentIds:r},...ah(a,o+1,[...r,n.id])]}),ih=t=>t.flatMap(o=>{let r=o.children??[];return r.length===0?[]:[o.id,...ih(r)]}),rh=t=>Object.entries(t).filter(([o])=>o!=="children").map(([,o])=>o==null?"":typeof o=="string"||typeof o=="number"||typeof o=="boolean"?String(o):"").join(" ").toLowerCase(),rW=({title:t,subtitle:o,nodes:r,columns:n,detail:a,selectedNodeId:i,defaultSelectedNodeId:s,onNodeSelect:l,expandedNodeIds:d,defaultExpandedNodeIds:p,onExpandedNodeIdsChange:m,defaultPaneMode:h="split",minTreePaneWidth:f=j0,minDetailPaneWidth:u=Q0,tableAppId:b="ctree-comp",tableKey:C="default",tableTitle:g,filterConfig:x,searchQuery:v,searchToken:y,defaultRowsPerPage:k=-1,rowsPerPageOptions:S=[20,50,100,-1],serviceUrl:P,emptyLabel:M="No tree items available.",headerAction:w,sx:N,className:A})=>{let T=lo(),R=to.useRef(null),E=to.useRef(null),O=to.useRef(null),[$,ee]=to.useState(s??r[0]?.id??null),[F,G]=to.useState(p??ih(r).slice(0,3)),[W,Q]=to.useState(h),[z,H]=to.useState(oh),[X,Y]=to.useState(0),[j,te]=to.useState(0),[ce,fe]=to.useState(k),Ve=to.useMemo(()=>n&&n.length>0?n:[{id:"label",label:"Name",render:ue=>c(le,{spacing:.3,children:[e(L,{sx:{fontSize:15,fontWeight:700,lineHeight:1.15},children:ue.label}),ue.subtitle&&e(L,{sx:{fontSize:13,color:"text.secondary",lineHeight:1.2},children:ue.subtitle})]})}],[n]),ve=to.useMemo(()=>new Set(d??F),[d,F]),xe=to.useMemo(()=>Rc(r,ve),[r,ve]),He=to.useMemo(()=>nh(r),[r]),pe=to.useMemo(()=>ah(r),[r]),ye=i===void 0?$:i,$e=to.useMemo(()=>He.find(ue=>ue.id===ye)??null,[ye,He]),tt=ue=>{let we=E.current?.clientWidth??0,re=we>0?Math.max(f,we-$s-u):Math.max(f,ue);return Math.min(Math.max(ue,f),re)},at=W==="detail",st=W==="tree"||!a,K=W==="split"&&!!a,Se=(()=>{if(X<=0)return null;if(W==="tree"||!a)return {treeWidth:X,splitterWidth:0,detailWidth:0};if(W==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:X};let ue=K?$s:0,we=tt(z);return {treeWidth:we,splitterWidth:ue,detailWidth:Math.max(0,X-ue-we)}})(),Fe=Se?`${Se.treeWidth}px ${Se.splitterWidth}px ${Se.detailWidth}px`:W==="tree"||!a?"minmax(0, 1fr) 0px 0px":W==="detail"?"0px 0px minmax(0, 1fr)":`minmax(${f}px, ${z}px) ${$s}px minmax(${u}px, 1fr)`;to.useEffect(()=>{let ue=E.current;if(!ue){Y(0);return}let we=0,re=()=>{window.cancelAnimationFrame(we),we=window.requestAnimationFrame(()=>{let De=ue.clientWidth;Y(Je=>Math.abs(Je-De)<.5?Je:De);});};if(re(),typeof ResizeObserver>"u")return window.addEventListener("resize",re),()=>{window.cancelAnimationFrame(we),window.removeEventListener("resize",re);};let Ce=new ResizeObserver(re);return Ce.observe(ue),window.addEventListener("resize",re),()=>{window.cancelAnimationFrame(we),Ce.disconnect(),window.removeEventListener("resize",re);}},[]);let it=ue=>{d===void 0&&G(ue),m?.(ue);},Ye=ue=>{let we=new Set(ve);we.has(ue)?we.delete(ue):we.add(ue),it(Array.from(we));},wt=ue=>{i===void 0&&ee(ue.id),l?.(ue);};to.useEffect(()=>{te(0);},[r]),to.useEffect(()=>{let ue=v?.trim().toLowerCase();if(!ue)return;let we=pe.find(({node:ut})=>rh(ut).includes(ue));if(!we)return;let re=new Set(ve);we.parentIds.forEach(ut=>re.add(ut)),it(Array.from(re)),wt(we.node);let De=Rc(r,re).findIndex(({node:ut})=>ut.id===we.node.id);De>=0&&ce>0&&te(Math.floor(De/ce));let Je=0,lt=0;return Je=window.requestAnimationFrame(()=>{lt=window.requestAnimationFrame(()=>{let ut=R.current?.querySelector("tr.orb-selected"),Ht=ut?.closest(".orb-table-container");if(ut&&Ht){let Yt=Ht.getBoundingClientRect(),Wt=ut.getBoundingClientRect(),St=Wt.top-Yt.top+Ht.scrollTop;Ht.scrollTo({top:St-Ht.clientHeight/2+Wt.height/2,behavior:"smooth"});return}ut?.scrollIntoView({block:"center",behavior:"smooth"});});}),()=>{window.cancelAnimationFrame(Je),window.cancelAnimationFrame(lt);}},[v,y,pe,r,ce]);let Mt=to.useMemo(()=>xe.map(({node:ue,level:we,hasChildren:re})=>({...ue,id:ue.id,__node:ue,__level:we,__hasChildren:re,__expanded:ve.has(ue.id),__searchText:rh(ue)})),[ve,xe]),Ft=to.useMemo(()=>Ve.map((ue,we)=>({id:ue.id,label:ue.label,minWidth:typeof ue.width=="number"?ue.width:ue.minWidth??(we===0?320:120),numeric:ue.numeric??ue.align==="right",render:(re,Ce)=>{let De=Ce.__node,Je=ue.render?ue.render(De):De[ue.id];if(we!==0)return e(Me,{sx:{minWidth:0,color:ue.align==="right"?"text.primary":"text.secondary",fontWeight:ue.align==="right"?750:500,textAlign:ue.align??"left"},children:Je});let lt=Number(Ce.__level??0),ut=!!Ce.__hasChildren,Ht=!!Ce.__expanded;return c(le,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,pl:`${lt*24}px`},children:[e(se,{tooltip:ut?Ht?"Collapse":"Expand":"",onClick:Yt=>{Yt.stopPropagation(),ut&&Ye(De.id);},disabled:!ut,sx:{width:24,height:24,visibility:ut?"visible":"hidden",transform:Ht?"rotate(0deg)":"rotate(-90deg)",transition:"transform 160ms ease"},children:e(_o,{sx:{fontSize:20}})}),e(Me,{sx:{width:10,height:10,borderRadius:"50%",flexShrink:0,backgroundColor:De.markerColor??T.palette.primary.main}}),e(Me,{sx:{minWidth:0},children:Je})]})}})),[Ve,ve,T.palette.primary.main]),Et=ue=>{if(!K)return;ue.preventDefault(),ue.currentTarget.setPointerCapture(ue.pointerId),O.current={startX:ue.clientX,startWidth:z};let we=Ce=>{let De=O.current;De&&H(tt(De.startWidth+Ce.clientX-De.startX));},re=()=>{O.current=null,window.removeEventListener("pointermove",we),window.removeEventListener("pointerup",re),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",we),window.addEventListener("pointerup",re);},ne=()=>{let ue=E.current?.clientWidth??0,we=ue>0?Math.max(f,(ue-$s)/2):oh;Q("split"),H(tt(we));},Ke=()=>a?typeof a=="function"?a($e):a:null,Oe=a?e(Kn,{"aria-label":"Tree pane layout",value:W,options:[{value:"tree",label:"Expand tree",icon:e(gi,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:e(fi,{fontSize:"small"})},{value:"detail",label:"Expand detail",icon:e(mi,{fontSize:"small"})}],onValueChange:ue=>{ue==="split"?ne():Q(ue);},sx:{position:"absolute",top:13,right:56,zIndex:3,backdropFilter:"blur(10px)"}}):null;return c(Me,{ref:R,className:["ctree_comp",A].filter(Boolean).join(" "),sx:{position:"relative",height:"100%",minHeight:0,border:`1px solid ${T.palette.divider}`,borderRadius:"var(--orb-r-container)",overflow:"hidden",backgroundColor:"background.paper",boxShadow:`0 18px 42px ${ot(T.palette.common.black,vt()==="dark"?.24:.08)}`,...N},children:[Oe,c(Me,{ref:E,sx:{height:"100%",display:"grid",gridTemplateColumns:Fe,transition:`grid-template-columns ${On}`,minWidth:0},children:[c(Me,{"aria-hidden":at?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:at?0:1,transform:at?"translateX(-12px)":"translateX(0)",pointerEvents:at?"none":"auto",transition:`opacity ${On}, transform ${On}`,willChange:"opacity, transform"},children:[c(le,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,sx:{px:2,py:1.5,minHeight:74,borderBottom:`1px solid ${T.palette.divider}`},children:[c(le,{direction:"row",alignItems:"center",spacing:1.4,sx:{minWidth:0},children:[e(wr,{sx:{color:"primary.main",fontSize:28}}),c(Me,{sx:{minWidth:0},children:[e(L,{sx:{fontSize:20,fontWeight:750,lineHeight:1.12},noWrap:true,children:t}),o&&e(L,{sx:{fontSize:14,color:"text.secondary",mt:.3},noWrap:true,children:o})]})]}),w!==void 0?w:e(se,{tooltip:"Add node",color:"default",children:e(Hr,{fontSize:"small"})})]}),c(Me,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[e(or,{appId:b,tableKey:C,title:g??(typeof t=="string"?t:"Tree"),columns:Ft,rows:Mt,rowKey:"id",fitContainer:true,fullWidth:true,showSummary:false,selectionMode:"single",selected:ye?[ye]:[],onSelectionChange:ue=>{let we=ue[ue.length-1],re=He.find(Ce=>Ce.id===we);re&&wt(re);},page:j,rowsPerPage:ce,rowsPerPageOptions:S,count:Mt.length,onPageChange:te,onRowsPerPageChange:ue=>{te(0),fe(ue);},filterConfig:x,serviceUrl:P,graphReport:{enabled:false},disableGrouping:true,disableSorting:true,maxHeight:"100%"}),Mt.length===0&&e(Me,{sx:{minHeight:220,display:"grid",placeItems:"center",color:"text.secondary"},children:M})]})]}),e(Me,{"data-ctree-splitter":"true",role:"separator","aria-orientation":"vertical",onPointerDown:K?Et:void 0,sx:{width:"100%",cursor:K?"col-resize":"default",backgroundColor:K?ot(T.palette.text.primary,vt()==="dark"?.16:.08):"transparent",opacity:K?1:0,pointerEvents:K?"auto":"none",position:"relative",transition:`opacity ${On}, background-color 120ms ease`,"&:hover":{backgroundColor:K?ot(T.palette.primary.main,vt()==="dark"?.35:.18):"transparent"}}}),c(Me,{"aria-hidden":st?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:st?0:1,transform:st?"translateX(12px)":"translateX(0)",pointerEvents:st?"none":"auto",transition:`opacity ${On}, transform ${On}`,willChange:"opacity, transform"},children:[e(Me,{sx:{px:2,pt:2,minHeight:74,display:"flex",alignItems:"flex-end"},children:e(Nt,{sx:{width:"100%"}})}),e(Me,{sx:{flex:1,minHeight:0,overflow:"auto",px:2,pb:2},children:Ke()})]})]})]})};I();var ow={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)"}}},lW=({children:t,transitionKey:o,variant:r="fade",durationMs:n=220,delayMs:a=0,easing:i="cubic-bezier(0.22, 1, 0.36, 1)",disabled:s=false,sx:l})=>{let d=xr("(prefers-reduced-motion: reduce)"),[p,m]=to.useState("to"),h=!s&&!d&&r!=="none";to.useEffect(()=>{if(!h){m("to");return}m("from");let b=requestAnimationFrame(()=>{b=requestAnimationFrame(()=>{m("to");});});return ()=>cancelAnimationFrame(b)},[o,h]);let f=ow[r],u=to.useMemo(()=>h?p==="from"?f.from:f.to:{opacity:1,transform:"none"},[h,p,f.from,f.to]);return e(Me,{sx:{willChange:h?"opacity, transform":"auto",transition:h?`opacity ${n}ms ${i} ${a}ms, transform ${n}ms ${i} ${a}ms`:"none",backfaceVisibility:"hidden",...u,...l},children:t})},cW={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};exports.AIBrowserGlow=O5;exports.Activity=Wc;exports.AgentPanel=rg;exports.AlertCircle=Ea;exports.AlertTriangle=$c;exports.ArrowDown=Rw;exports.ArrowRight=Nw;exports.ArrowUp=_c;exports.BarChart=qs;exports.Bot=Dw;exports.Button=ol;exports.CAINavProvider=oC;exports.CAlert=rn;exports.CAmapChart=jp;exports.CAppHeader=Zi;exports.CAppHeaderSearch=Bl;exports.CAppPageLayout=rL;exports.CAuthPage=aV;exports.CAvatar=on;exports.CBadge=Xa;exports.CBarChart=aa;exports.CButton=Te;exports.CCalendar=Xn;exports.CCardDetailPanel=uu;exports.CCardGrid=gu;exports.CCardGridCard=rv;exports.CCardPage=ED;exports.CChartCard=Mi;exports.CCheckbox=It;exports.CChip=xt;exports.CComboChart=Kp;exports.CCustomizeAgent=Jp;exports.CDatePicker=xf;exports.CDetailInfoPage=tE;exports.CDetailSearchAiBar=wu;exports.CDetailSectionCard=Gi;exports.CDialog=Ot;exports.CDivider=Nt;exports.CFileUpload=Sf;exports.CFilterField=gI;exports.CFishboneChart=Xp;exports.CGoogleMapChart=Yp;exports.CGraphCharts=Qp;exports.CGraphKpiCards=Gp;exports.CGraphReport=Ai;exports.CHeatmapChart=qp;exports.CIconButton=se;exports.CKanbanBoard=RE;exports.CKanbanBucket=Iu;exports.CKanbanCard=Dl;exports.CLayoutManagement=lu;exports.CLayoutManager=fn;exports.CLineChart=Up;exports.CList=aI;exports.CListItem=iI;exports.CListItemAvatar=pI;exports.CListItemButton=sI;exports.CListItemIcon=lI;exports.CListItemText=cI;exports.CListSubheader=dI;exports.CMenu=Jt;exports.CMessageBox=ea;exports.CMetricChartCard=ws;exports.COrbCanvas=Ky;exports.CPageLayout=yi;exports.CPageTransition=lW;exports.CPaper=Ae;exports.CPieChart=Ri;exports.CPivotTable=UO;exports.CPlanningGantt=th;exports.CPlanningLayout=KV;exports.CPopover=Js;exports.CProgress=Un;exports.CRadioGroup=Kh;exports.CSegmentedControl=Kn;exports.CSelect=Vt;exports.CSkeleton=Jh;exports.CSmartFilter=Go;exports.CSmartTable=QN;exports.CSpinner=jo;exports.CStack=le;exports.CStandardPage=aD;exports.CStatusBadge=oI;exports.CSwitch=qa;exports.CTable=or;exports.CTableBody=qN;exports.CTableCell=XN;exports.CTableContainer=ZN;exports.CTableHead=YN;exports.CTableRow=jN;exports.CTabs=bf;exports.CTextArea=Gn;exports.CTextField=ze;exports.CTooltip=dt;exports.CTreeComp=rW;exports.CTypography=L;exports.CValueHelp=Op;exports.CVariantManagement=Fi;exports.CVariantManager=ru;exports.CVoiceWaveOverlay=ql;exports.CWaterfallChart=Zp;exports.Calendar=Xs;exports.CalendarDays=Aw;exports.Camera=Ew;exports.ChartNoAxesCombined=Lw;exports.Check=So;exports.CheckCircle=La;exports.ChevronDown=zo;exports.ChevronLeft=Oa;exports.ChevronRight=Vo;exports.ChevronUp=Ow;exports.ChevronsDown=Fw;exports.ChevronsUp=Bw;exports.CircleAlert=Fa;exports.CircleCheck=zn;exports.CircleCheckBig=Hw;exports.CircleStop=Zs;exports.Clipboard=Gc;exports.ClipboardCheck=zw;exports.ClipboardList=Vw;exports.Clock=Uc;exports.CodeBlock=pa;exports.Columns3=Ww;exports.CopilotChat=A5;exports.Copy=Eo;exports.CopyPlus=$w;exports.Delete=_w;exports.Download=Vn;exports.Edit=Kc;exports.Expand=qc;exports.Eye=Gw;exports.EyeOff=Uw;exports.File=Ba;exports.FileText=Xc;exports.Filter=Kw;exports.FloatingAgentPanel=k5;exports.FolderTree=Wn;exports.GitBranch=Zc;exports.GlobalMessage=jT;exports.Globe=$n;exports.Grid=Yc;exports.GripVertical=qw;exports.Hammer=Xw;exports.Image=jc;exports.Info=Ha;exports.InputArea=nc;exports.Languages=Zw;exports.Layers=Yw;exports.LayoutDashboard=jw;exports.Lightbulb=za;exports.LineChart=Qc;exports.Loader2=Jc;exports.Lock=Va;exports.LockKeyhole=Qw;exports.LogOut=ed;exports.METRIC_CHART_TYPES=xs;exports.Mail=Ys;exports.MapPin=td;exports.MarkdownRenderer=ga;exports.MathBlock=ua;exports.Menu=od;exports.MermaidBlock=Sl;exports.MessageCircle=Rh;exports.MessageSquare=rd;exports.Mic=Wa;exports.MicOff=Jw;exports.Moon=nd;exports.MoreHorizontal=eS;exports.NavigationIsland=kd;exports.NavigationIsland2=al;exports.OMPHApprovalCard=C0;exports.OMPHPanel=u5;exports.ORBCAFE_I18N_MESSAGES=Yn;exports.ORB_DARK=dh;exports.ORB_FONT_STACK=nw;exports.ORB_LIGHT=ch;exports.ORB_RADIUS=iw;exports.ORB_TOKENS=Gs;exports.ORB_TRANSITION_FAST=sw;exports.OrbcafeI18nProvider=ja;exports.OrbisModeProvider=Hn;exports.PAGE_TRANSITION_PRESETS=cW;exports.PAppPageLayout=v2;exports.PBarcodeScanner=cF;exports.PNavIsland=wm;exports.PNumericKeypad=kF;exports.PSmartFilter=bm;exports.PTable=zy;exports.PTouchCard=fF;exports.PWorkloadNav=vm;exports.PackageCheck=tS;exports.PackageSearch=oS;exports.PanelLeftOpen=$a;exports.PanelRight=_a;exports.PanelsTopLeft=rS;exports.PieChart=ad;exports.Pin=Jr;exports.PivotChartPanel=lm;exports.Play=nS;exports.Plus=en;exports.QrCode=aS;exports.ReceiptText=iS;exports.RefreshCw=Ga;exports.Rocket=sS;exports.RotateCcw=lS;exports.RotateCw=id;exports.Rows3=cS;exports.SapIcon=Tt;exports.Save=dS;exports.ScanLine=pS;exports.Search=Wo;exports.Send=Nh;exports.SendHorizontal=sd;exports.Settings=tn;exports.ShieldCheck=uS;exports.Sigma=mS;exports.SortAsc=gS;exports.SquareSplitHorizontal=hS;exports.Star=fS;exports.StdChat=tg;exports.Sun=ld;exports.Table2=bS;exports.TableBlock=Pl;exports.TabletSmartphone=vS;exports.Terminal=_n;exports.ThinkBlock=$i;exports.ThumbsDown=cd;exports.ThumbsUp=dd;exports.Trash2=pd;exports.TreeMenu=jn;exports.TreePine=yS;exports.TrendingDown=ud;exports.TriangleAlert=Ua;exports.Truck=CS;exports.UploadCloud=md;exports.User=js;exports.VoiceNavigatorProvider=A2;exports.VoiceWaveOverlay=T2;exports.Volume2=gd;exports.Warehouse=xS;exports.Workflow=wS;exports.X=Xt;exports.XCircle=Ka;exports.addKanbanBucket=Mu;exports.buildAmapEmbedUrl=Ni;exports.buildGoogleMapEmbedUrl=ia;exports.buildGoogleMapIframe=_R;exports.buttonVariants=Mf;exports.createKanbanBoardModel=Nu;exports.createSapIcon=ie;exports.findKanbanCard=Ko;exports.message=_T;exports.messageManager=lr;exports.moveKanbanCard=qi;exports.omphApprovalLabelsFromI18n=uc;exports.omphLabelsFromI18n=pc;exports.orbAlpha=ot;exports.orbChartSeries=aw;exports.parseMarkdownTable=Wi;exports.parseOmphFileHref=sc;exports.renameKanbanBucket=Ru;exports.renderMarkdown=IA;exports.resolveVariantFilters=zi;exports.resolveVariantLayout=Vi;exports.useAINav=rC;exports.useAmapEmbedUrl=qD;exports.useAuthPage=Y5;exports.useCardPage=HD;exports.useDetailInfo=ku;exports.useGoogleMapEmbedUrl=KD;exports.useGraphChartData=WD;exports.useGraphInteraction=Li;exports.useGraphReport=mn;exports.useKanbanBoard=LE;exports.useMediaQuery=Ao;exports.useNavigationIsland=Nd;exports.useOrbMode=fo;exports.useOrbTokens=Ks;exports.useOrbcafeI18n=de;exports.usePadLayout=eF;exports.usePadRecordEditor=rF;exports.usePageLayout=Bu;exports.usePivotTable=YO;exports.usePlanningGantt=Zg;exports.usePlanningLayout=mV;exports.useStandardReport=pD;exports.useVoiceInput=wn;exports.useVoiceNavigator=E2;