orbcafe-ui 3.1.1 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +48 -9
- package/dist/index.d.ts +48 -9
- package/dist/index.js +17 -17
- package/dist/index.mjs +20 -20
- package/dist/orbis.css +290 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var jsxRuntime=require('react/jsx-runtime'),ogl=require('ogl'),
|
|
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'),ro=require('dayjs'),eb=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'),gh=require('dayjs/plugin/isBetween'),fh=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 My=require('next/dynamic'),framerMotion=require('framer-motion'),NC=require('react-markdown'),AC=require('remark-gfm'),EC=require('remark-math'),LC=require('rehype-katex'),OC=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),Sm=require('mermaid'),a0=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 ro__default=/*#__PURE__*/_interopDefault(ro);var eb__default=/*#__PURE__*/_interopDefault(eb);var gh__default=/*#__PURE__*/_interopDefault(gh);var fh__default=/*#__PURE__*/_interopDefault(fh);var My__default=/*#__PURE__*/_interopDefault(My);var NC__default=/*#__PURE__*/_interopDefault(NC);var AC__default=/*#__PURE__*/_interopDefault(AC);var EC__default=/*#__PURE__*/_interopDefault(EC);var LC__default=/*#__PURE__*/_interopDefault(LC);var OC__default=/*#__PURE__*/_interopDefault(OC);var Sm__default=/*#__PURE__*/_interopDefault(Sm);var a0__default=/*#__PURE__*/_interopDefault(a0);var gc=Object.defineProperty;var Wg=(t,r,o)=>r in t?gc(t,r,{enumerable:true,configurable:true,writable:true,value:o}):t[r]=o;var As=(t,r,o)=>()=>{if(o)throw o[0];try{return t&&(r=t(t=0)),r}catch(n){throw o=[n],n}};var $g=(t,r)=>{for(var o in r)gc(t,o,{get:r[o],enumerable:true});};var fc=(t,r,o)=>Wg(t,r+"",o);var ka,Ug,vt,Pa,bc,Kg,qg,hc,vc,Xg,Ls,Yg,yc,Zg,On,Ue,_t=As(()=>{"use strict";ka={xs:0,sm:600,md:900,lg:1200,xl:1536},Ug=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=()=>Ug(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"]},Kg=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"]),qg=(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=qg(t,r);return typeof o=="number"&&o!==0&&!Kg.has(t)?["margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","gap","rowGap","columnGap"].includes(t)?`${o*8}px`:`${o}px`:String(o)},Xg=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}},{}):{},Ls=t=>!t||typeof t!="object"?JSON.stringify(t):Array.isArray(t)?`[${t.map(Ls).join(",")}]`:`{${Object.keys(t).sort().map(r=>`${JSON.stringify(r)}:${Ls(t[r])}`).join(",")}}`,Yg=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,Zg=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=Xg(t);if(Object.keys(n).length===0)return {className:r,style:o};let a=`orb-sx-${Yg(Ls(n))}`;return Zg(On(`.${a}`,n)),{className:[a,r].filter(Boolean).join(" "),style:o}};});var Cc,e,c,P=As(()=>{"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 um={};$g(um,{COrbCanvas:()=>Ty});function Ty({hue:t=0,hoverIntensity:r=.2,rotateOnHover:o=true,forceHoverState:n=false,backgroundColor:a="transparent"}){let i=er.useRef(null),s=`
|
|
2
2
|
precision highp float;
|
|
3
3
|
attribute vec2 position;
|
|
4
4
|
attribute vec2 uv;
|
|
@@ -180,26 +180,26 @@
|
|
|
180
180
|
vec4 col = mainImage(fragCoord);
|
|
181
181
|
gl_FragColor = vec4(col.rgb * col.a, col.a);
|
|
182
182
|
}
|
|
183
|
-
`;return Jt.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:dm(a)}}}),m=new ogl.Mesh(p,{geometry:f,program:b});function v(){if(!d)return;let I=window.devicePixelRatio||1,S=d.clientWidth,E=d.clientHeight;u.setSize(S*I,E*I),p.canvas.style.width=S+"px",p.canvas.style.height=E+"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(),E=I.clientX-S.left,D=I.clientY-S.top,R=S.width,A=S.height,N=Math.min(R,A),O=R/2,F=A/2,q=(E-O)/N*2,z=(D-F)/N*2;Math.sqrt(q*q+z*z)<.8?y=1:y=0;},P=()=>{y=0;};d.addEventListener("mousemove",C),d.addEventListener("mouseleave",P);let w,k=I=>{w=requestAnimationFrame(k);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=dm(a);let E=n?1:y;b.uniforms.hover.value+=(E-b.uniforms.hover.value)*.1,o&&E>.5&&(x+=S*h),b.uniforms.rot.value=x,u.render({scene:m});};return w=requestAnimationFrame(k),()=>{cancelAnimationFrame(w),window.removeEventListener("resize",v),d.removeEventListener("mousemove",C),d.removeEventListener("mouseleave",P),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 ky(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 dm(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 ky(n,a,i)}return new ogl.Vec3(0,0,0)}var um=As(()=>{"use strict";"use client";T();});var Vg={canvas:"#ffffff",surface:"#f5f5f5",surface2:"#f5f5f5",surface3:"#f5f5f5",fg:"#555555",muted:"#8c8c8c",border:"#dbdbdb",primary:"#154194",onPrimary:"#ffffff",link:"#154194",p50:"#f0f3f9",p100:"#dce4f1",p200:"#bac9e3",p300:"#91a8d1",p600:"#0f3276",p700:"#08255a",accent:"#fc4c02",err:"#ac3101",errBg:"#fff4f0",warnBg:"#fff2ee",hover:"rgba(21, 65, 148, 0.06)",selected:"rgba(21, 65, 148, 0.10)",focusRing:"rgba(21, 65, 148, 0.18)",focusSolid:"#154194",disabledFg:"#aeaeae",disabledBg:"#f0f0f0",chartGrid:"#dbdbdb",chartText:"#8c8c8c",track:"#f5f5f5",shadow1:"0 1px 2px rgba(1,9,26,.05),0 2px 6px rgba(1,9,26,.06)",shadow2:"0 4px 14px rgba(1,9,26,.10)",shadow3:"0 12px 32px rgba(1,9,26,.16)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#475569",statusPrimary:"#1d4ed8",statusSuccess:"#047857",statusWarning:"#b45309",statusError:"#b91c1c",statusInfo:"#0369a1",chart1:"#154194",chart2:"#91a8d1",chart3:"#8c8c8c",chart4:"#08255a",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},Wg={canvas:"#01091a",surface:"#0a1526",surface2:"#061324",surface3:"#0e1b2b",fg:"#ffffff",muted:"rgba(255,255,255,0.7)",border:"rgba(255,255,255,0.12)",primary:"#154194",onPrimary:"#ffffff",link:"#91a8d1",p50:"#021432",p100:"#021a3d",p200:"#bac9e3",p300:"#91a8d1",p600:"#375ea5",p700:"#6e8cc1",accent:"#fc4c02",err:"#d53f01",errBg:"#16163b",warnBg:"#19173f",hover:"rgba(255,255,255,0.08)",selected:"rgba(21, 65, 148, 0.45)",focusRing:"rgba(145, 168, 209, 0.45)",focusSolid:"#91a8d1",disabledFg:"rgba(255,255,255,0.38)",disabledBg:"rgba(255,255,255,0.07)",chartGrid:"rgba(255,255,255,0.12)",chartText:"rgba(255,255,255,0.7)",track:"rgba(255,255,255,0.1)",shadow1:"0 1px 2px rgba(0,0,0,.4),0 2px 8px rgba(0,0,0,.35)",shadow2:"0 4px 16px rgba(0,0,0,.5)",shadow3:"0 12px 32px rgba(0,0,0,.55)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#94a3b8",statusPrimary:"#60a5fa",statusSuccess:"#34d399",statusWarning:"#fbbf24",statusError:"#f87171",statusInfo:"#38bdf8",chart1:"#154194",chart2:"#91a8d1",chart3:"rgba(255,255,255,0.7)",chart4:"#a4b8dd",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},Es={light:Vg,dark:Wg},v0='"Montserrat", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif',y0=t=>{let r=Es[t];return [r.primary,r.p300,r.muted,r.p700]},C0=10,x0="0.2s ease";T();var Sc=Jt.createContext({mode:"light",setting:"light"}),Jg=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;},On=({mode:t,defaultMode:r="light",children:o})=>{let n=t??r,[a,i]=Jt.useState("light"),[s,l]=Jt.useState(false);Jt.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;Jt.useEffect(()=>{Jg(d);},[d]);let u=Jt.useMemo(()=>({mode:d,setting:n}),[d,n]);return e(Sc.Provider,{value:u,children:o})},yr=()=>Jt.useContext(Sc).mode,Os=()=>Es[yr()];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]=Jt.useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia(r).matches);return Jt.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};T();var rf={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},of=t=>typeof t=="number"?`${t}px`:t,nf={"2.5":10,3:12,"3.5":14,4:16,5:20,6:24,7:28,8:32,10:40,12:48},af=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?nf[r[1]]:void 0},Mt=Jt.forwardRef(({name:t,size:r,title:o,className:n,style:a,strokeWidth:i,fill:s,...l},d)=>{let u=l["aria-label"]??o,p=of(r??af(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(rf[t])})});Mt.displayName="SapIcon";var ne=(t,r)=>{let o=Jt.forwardRef((n,a)=>e(Mt,{ref:a,name:t,...n}));return o.displayName=r??`SapIcon(${t})`,o};var kc=ne("activity","Activity"),Pa=ne("error","AlertCircle"),Pc=ne("warning","AlertTriangle"),G0=ne("down","ArrowDown"),_0=ne("navigationRight","ArrowRight"),Tc=ne("up","ArrowUp"),Fs=ne("barChart","BarChart"),U0=ne("activate","Bot"),Bs=ne("calendar","Calendar"),K0=Bs,q0=ne("camera","Camera"),X0=ne("lineChart","ChartNoAxesCombined"),qr=ne("accept","Check"),Ta=ne("accept","CheckCircle"),Fr=ne("slimDown","ChevronDown"),Ia=ne("navigationLeft","ChevronLeft"),Br=ne("navigationRight","ChevronRight"),Y0=ne("slimUp","ChevronUp"),Z0=ne("expandAll","ChevronsDown"),j0=ne("collapseAll","ChevronsUp"),Ra=ne("error","CircleAlert"),Fn=ne("accept","CircleCheck"),Q0=Fn,Ic=ne("stop","CircleStop"),Rc=ne("copy","Clipboard"),J0=ne("checklist","ClipboardCheck"),eS=ne("checklist","ClipboardList"),Mc=ne("time","Clock"),tS=ne("tableColumn","Columns3"),vo=ne("copy","Copy"),rS=ne("duplicate","CopyPlus"),oS=ne("delete","Delete"),nS=ne("download","Download"),Dc=ne("edit","Edit"),Nc=ne("fullScreen","Expand"),aS=ne("show","Eye"),iS=ne("hide","EyeOff"),Ma=ne("document","File"),Ac=ne("document","FileText"),sS=ne("filter","Filter"),Bn=ne("tree","FolderTree"),Ec=ne("process","GitBranch"),Hn=ne("world","Globe"),Lc=ne("grid","Grid"),lS=ne("move","GripVertical"),cS=ne("wrench","Hammer"),Oc=ne("picture","Image"),Da=ne("information","Info"),dS=ne("translate","Languages"),pS=ne("dimension","Layers"),uS=ne("home","LayoutDashboard"),Na=ne("lightbulb","Lightbulb"),Fc=ne("lineChart","LineChart"),Bc=ne("synchronize","Loader2"),Aa=ne("locked","Lock"),mS=Aa,Hc=ne("log","LogOut"),Hs=ne("email","Mail"),zc=ne("map","MapPin"),gS=ne("menu","Menu"),sf=ne("message","MessageCircle"),Vc=sf,Ea=ne("microphone","Mic"),fS=ne("microphone","MicOff"),Wc=ne("darkMode","Moon"),bS=ne("overflow","MoreHorizontal"),hS=ne("accept","PackageCheck"),vS=ne("product","PackageSearch"),La=ne("splitOne","PanelLeftOpen"),Oa=ne("splitTwo","PanelRight"),yS=ne("overview","PanelsTopLeft"),$c=ne("pieChart","PieChart"),Jo=ne("pushpin","Pin"),CS=ne("play","Play"),Fa=ne("add","Plus"),xS=ne("qrCode","QrCode"),SS=ne("receipt","ReceiptText"),Ba=ne("refresh","RefreshCw"),wS=ne("activate","Rocket"),kS=ne("refresh","RotateCcw"),Gc=ne("refresh","RotateCw"),PS=ne("tableRow","Rows3"),TS=ne("save","Save"),IS=ne("qrCode","ScanLine"),Hr=ne("search","Search"),lf=ne("paperPlane","Send"),_c=lf,en=ne("wrench","Settings"),RS=ne("accept","ShieldCheck"),MS=ne("sum","Sigma"),DS=ne("sort","SortAsc"),NS=ne("splitTwo","SquareSplitHorizontal"),AS=ne("favorite","Star"),Uc=ne("lightMode","Sun"),ES=ne("table","Table2"),LS=ne("ipad","TabletSmartphone"),zn=ne("command","Terminal"),Kc=ne("thumbDown","ThumbsDown"),qc=ne("thumbUp","ThumbsUp"),Xc=ne("delete","Trash2"),OS=ne("tree","TreePine"),Yc=ne("trendDown","TrendingDown"),Ha=ne("warning","TriangleAlert"),FS=ne("shipping","Truck"),Zc=ne("upload","UploadCloud"),zs=ne("employee","User"),jc=ne("sound","Volume2"),BS=ne("factory","Warehouse"),HS=ne("process","Workflow"),Zt=ne("decline","X"),za=ne("error","XCircle");Gt();T();var df={contained:"primary",outlined:"secondary",text:"ghost"},pf={small:"orb-btn-sm",medium:void 0,large:"orb-btn-lg"},Ce=Jt.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=df[t]??t,g=["orb-btn",`orb-btn-${y}`,pf[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]})});Ce.displayName="CButton";Gt();T();var ze=Jt.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:P=true,select:w=false,multiline:k=false,rows:I,children:S,variant:E,margin:D,onClick:R,startAdornment:A,endAdornment:N,InputProps:O,inputProps:F,InputLabelProps:q,SelectProps:z,sx:X,className:$},_)=>{let V=Jt.useId(),B=y??`orb-tf-${V}`,Z=A??O?.startAdornment,Q=N??O?.endAdornment,se=(typeof g=="string"?g:void 0)??x,be={id:B,className:`orb-inp ${h||C==="small"?"orb-inp-dense":""}`,style:P?void 0:{width:"auto"},value:r,defaultValue:o,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,placeholder:d,disabled:u,required:f,autoFocus:b,autoComplete:m,name:v,onClick:R,"aria-invalid":!!g},_e=w?e("select",{...be,ref:_,onChange:n,children:S}):k?e("textarea",{...be,ref:_,onChange:n,rows:I,readOnly:p||O?.readOnly}):e("input",{...be,ref:_,onChange:n,type:l,readOnly:p||O?.readOnly,...F}),De=Ue(X,`orb-fld ${g?"orb-is-error":""} ${$??""}`,{width:P?"100%":void 0});return c("div",{className:De.className,style:De.style,children:[t&&e("label",{htmlFor:B,children:t}),Z||Q?c("div",{className:"orb-inp-adornment-wrap",children:[Z&&e("span",{className:"orb-inp-adornment",children:Z}),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";Gt();T();var Vn=Jt.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=Jt.useId(),P=v??`orb-ta-${C}`,k=(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:P,children:t}),e("textarea",{ref:h,id:P,className:"orb-inp",value:r,defaultValue:o,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l??d,name:m,"aria-invalid":!!p,...y}),k&&e("span",{className:"orb-fld-msg",children:k})]})});Vn.displayName="CTextArea";Gt();T();var Wt=Jt.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:P,helperText:w,name:k,id:I,"aria-label":S,sx:E,className:D},R)=>{let A=Jt.useId(),N=I??`orb-sel-${A}`,F=(typeof P=="string"?P:void 0)??w,q=Jt.useRef(null),z=Jt.useRef(null),[X,$]=Jt.useState(false),[_,V]=Jt.useState(180),[B,Z]=Jt.useState(a??"");Jt.useImperativeHandle(R,()=>q.current);let Q=Jt.useMemo(()=>Jt.Children.toArray(o).flatMap(Te=>{if(!Jt.isValidElement(Te)||Te.type!=="option")return [];let xe=Te;return [{value:Array.isArray(xe.props.value)?xe.props.value[0]??"":xe.props.value??"",label:xe.props.children,disabled:xe.props.disabled}]}),[o]),ge=r??Q,se=n??B,le=Array.isArray(se)?se[0]??"":se,be=String(le??""),_e=ge.find(Te=>String(Te.value)===be),De=m?m(se):_e?.label??(be||(f??"")),Pe=Ue(E,`orb-fld ${P?"orb-is-error":""} ${D??""}`,{width:u?"100%":void 0,minWidth:typeof p=="number"?`${p}px`:p});if(v)return c("div",{className:Pe.className,style:Pe.style,children:[t&&e("label",{htmlFor:N,children:t}),c("select",{ref:R,id:N,className:`orb-inp ${d||l==="small"?"orb-inp-dense":""}`,value:n,defaultValue:a,onChange:i,disabled:s,name:k,multiple:true,onClick:h,onMouseDown:C,"aria-invalid":!!P,"aria-label":S,children:[f!==void 0&&e("option",{value:"",children:f}),r?r.map(Te=>e("option",{value:Te.value,disabled:Te.disabled,children:Te.label},Te.value)):o]}),F&&e("span",{className:"orb-fld-msg",children:F})]});let Ve=Te=>{n===void 0&&Z(Te);let xe=q.current;xe&&(Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set?.call(xe,Te),i?.({target:xe,currentTarget:xe}));};return c("div",{className:Pe.className,style:Pe.style,children:[t&&e("label",{htmlFor:N,children:t}),e("select",{ref:q,className:"orb-visually-hidden",tabIndex:-1,"aria-hidden":"true",name:k,value:be,disabled:s,onChange:()=>{},children:ge.map(Te=>e("option",{value:Te.value,disabled:Te.disabled,children:Te.label},String(Te.value)))}),c(Nr__namespace.Root,{open:X,onOpenChange:Te=>{Te&&V(z.current?.getBoundingClientRect().width??180),$(Te);},children:[e(Nr__namespace.Trigger,{asChild:true,children:c("button",{ref:z,id:N,type:"button",className:`orb-inp orb-select-trigger ${d||l==="small"?"orb-inp-dense":""}`,disabled:s,"aria-invalid":!!P,"aria-label":S,"aria-haspopup":"listbox","data-placeholder":!_e&&!be?"":void 0,onClick:h,onMouseDown:C,children:[e("span",{className:"orb-select-value",children:De}),e(Mt,{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:_},children:e(Nr__namespace.RadioGroup,{value:be,onValueChange:Ve,children:ge.map(Te=>c(Nr__namespace.RadioItem,{className:"orb-select-option",value:String(Te.value),disabled:Te.disabled,children:[e("span",{className:"orb-select-check","aria-hidden":"true",children:String(Te.value)===be?e(Mt,{name:"accept",size:13}):null}),e("span",{children:Te.label})]},String(Te.value)))})})})]}),F&&e("span",{className:"orb-fld-msg",children:F})]})});Wt.displayName="CSelect";Gt();T();var Dt=Jt.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})]})});Dt.displayName="CCheckbox";T();var kf=({label:t,options:r,value:o,defaultValue:n,onChange:a,name:i,row:s=false,disabled:l,sx:d,className:u})=>{let p=Jt.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))})]})};Gt();T();var Va=Jt.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";Gt();T();var If={default:"gray",primary:"blue",success:"blue",info:"blue",warning:"orange",error:"orange"},Pt=Jt.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":If[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(Zt,{size:13,strokeWidth:2})})]})});Pt.displayName="CChip";Gt();T();var Wa=Jt.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";Gt();T();var tn=Jt.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})});tn.displayName="CAvatar";Gt();T();var rn=Jt.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"})]})});rn.displayName="CAlert";Gt();T();var Wn=({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%; } }"})]})},Nf=({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"});T();var lt=({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})})]})});Gt();T();var ae=Jt.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(lt,{title:t,children:b}):b});ae.displayName="CIconButton";Gt();T();var $n=({value:t,options:r,onValueChange:o,size:n="medium",sx:a,className:i,...s})=>{let l=Jt.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)})]})};Gt();T();var jt=({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=Jt.useRef(null);if(Jt.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=Jt.Children.map(l,P=>{if(!Jt.isValidElement(P)||P.type!=="option")return P;let w=P.props,{children:k,disabled:I,selected:S}=w,E=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:E.className,style:E.style,onClick:I?void 0:w.onClick,onKeyDown:D=>{!I&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),w.onClick?.(D));},children:k})});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(Ce,{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))})})]})};Gt();T();var Ee=Jt.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})});Ee.displayName="CPaper";Gt();T();var At=Jt.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})});At.displayName="CDivider";Gt();T();var $f={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"},Gf={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},L=Jt.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??Gf[t]??"span",v=[t==="inherit"?void 0:$f[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";Gt();T();var Uf=t=>{if(t!==void 0)return typeof t=="number"?`${t*8}px`:t},ie=Jt.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:Uf(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";Gt();T();var zt=({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(Zt,{size:16,strokeWidth:2})})})]}),e("div",{style:{minWidth:0},children:n}),a&&e("div",{className:"orb-dialog-actions",children:a})]})]})})};T();var Ws=({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})})]});T();var Xf=({items:t,value:r,defaultValue:o,onChange:n,sx:a,className:i})=>{let s=r!==void 0,[l,d]=Jt.useState(o??t[0]?.value),u=s?r:l,p=Jt.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)})})};T();var Zf=["su","mo","tu","we","th","fr","sa"],Gn=(t,r)=>!!(t&&r&&t.isSame(r,"day")),_n=({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]=Jt.useState(()=>i??t??r??ro__default.default()),v=(f?a:b).startOf("month"),y=w=>{f||m(w),s?.(w);},g=Jt.useMemo(()=>u?v.locale(u):v,[v,u]),x=Jt.useMemo(()=>{let k=v.startOf("month").startOf("week"),I=[],S=k;for(let E=0;E<6;E+=1){let D=[];for(let R=0;R<7;R+=1)D.push(S),S=S.add(1,"day");if(I.push(D),S.isAfter(v.endOf("month"))&&E>=3)break}return I},[v]),h=Jt.useMemo(()=>{let w=u?ro__default.default().locale(u):ro__default.default();return Zf.map((k,I)=>w.startOf("week").add(I,"day").format("dd"))},[u]),C=w=>!!(l&&w.isBefore(l.startOf("day"))||d&&w.isAfter(d.startOf("day"))),P=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(Ia,{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,k)=>e("span",{className:"orb-cal-dow",children:w},`${w}-${k}`)),x.flat().map(w=>{let k=!w.isSame(v,"month"),I=C(w),S=P?Gn(w,r)||Gn(w,o):Gn(w,t),E=w.isSame(ro__default.default(),"day"),D=P&&r&&o&&w.isAfter(r.startOf("day"))&&w.isBefore(o.startOf("day")),R=P&&Gn(w,r)&&!!o,A=P&&Gn(w,o)&&!!r,N=["orb-cal-day",k?"orb-is-outside":void 0,E?"orb-is-today":void 0,S?"orb-is-selected":void 0,D?"orb-is-in-range":void 0,R?"orb-is-range-start":void 0,A?"orb-is-range-end":void 0].filter(Boolean).join(" ");return p?e("span",{className:"orb-cal-day-slot",children:p(w,{outsideCurrentMonth:k,selected:S,today:E,disabled:I})},w.format("YYYY-MM-DD")):e("button",{type:"button",role:"gridcell","aria-selected":S,"aria-current":E?"date":void 0,className:N,disabled:I,onClick:()=>n?.(w),children:w.date()},w.format("YYYY-MM-DD"))})]})]})};T();ro__default.default.extend(jf__default.default);var Qf=({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]=Jt.useState(o??null),h=y?r:g,[C,P]=Jt.useState(false),[w,k]=Jt.useState(null),I=A=>{y||x(A),n?.(A);},S=w??(h?(u?h.locale(u):h).format(l):""),E=()=>{if(w===null)return;let A=w.trim();if(!A)I(null);else {let N=ro__default.default(A,l,true);N.isValid()&&!(a&&N.isBefore(a.startOf("day")))&&!(i&&N.isAfter(i.startOf("day")))&&I(N);}k(null);},R=(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(Ws,{open:C,onOpenChange:P,trigger:c("div",{className:"orb-inp-adornment-wrap",style:{width:"100%"},children:[e("span",{className:"orb-inp-adornment",children:e(Bs,{size:15,strokeWidth:1.8})}),e("input",{className:`orb-inp ${p?"orb-inp-dense":""}`,value:S,placeholder:d??l,disabled:s,onFocus:()=>P(true),onChange:A=>k(A.target.value),onBlur:E,onKeyDown:A=>{A.key==="Enter"&&(E(),P(false)),A.key==="Escape"&&P(false);}})]}),children:e(_n,{value:h,onChange:A=>{I(A),k(null),P(false);},minDate:a,maxDate:i,locale:u,defaultMonth:h??void 0})}),R&&e("span",{className:"orb-fld-msg",children:R})]})};T();var eb=({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]=Jt.useState(false),[u,p]=Jt.useState([]),f=Jt.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 P=r?[...u,...C]:C;r&&(P=P.filter((w,k,I)=>k===I.findIndex(S=>S.name===w.name&&S.size===w.size&&S.lastModified===w.lastModified))),p(P),t?.(P),f.current&&(f.current.value="");},x=h=>{let C=u.filter((P,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(Zc,{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(Ac,{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(Xc,{size:15,strokeWidth:1.8})})]},`${h.name}-${C}`))})]})};function fr(...t){return tailwindMerge.twMerge(clsx.clsx(t))}var Ga={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"},Un={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},td=()=>"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";T();var ab=classVarianceAuthority.cva(td(),{variants:{variant:{default:`${Ga.primary} shadow-sm`,destructive:"bg-[var(--orb-status-error)] text-[var(--orb-on-primary)] hover:opacity-90 active:opacity-80 shadow-sm",outline:`${Ga.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:Ga.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:Un.none,sm:Un.sm,md:Un.md,full:Un.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),_s=Jt__namespace.forwardRef(({className:t,variant:r,size:o,asChild:n=false,...a},i)=>e(n?reactSlot.Slot:"button",{className:fr(ab({variant:r,size:o,className:t})),ref:i,...a}));_s.displayName="Button";var ib={"common.cancel":"Cancel","common.save":"Save","common.ok":"OK","common.done":"Done","common.search":"Search","common.none":"None","common.all":"All","common.noData":"No data","common.copy":"Copy","common.delete":"Delete","common.loading":"Loading...","header.searchPlaceholder":"Ask me...","header.searchAddFeature":"Add feature","header.searchSend":"Send","header.searchStartVoice":"Start voice input","header.searchStopVoice":"Stop voice input","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dark","header.theme.light":"Theme: Light","header.menu.setting":"Setting","header.menu.refresh":"Refresh","header.menu.logout":"Logout","navigation.expand":"Expand navigation","navigation.collapse":"Collapse navigation","navigation.searchPlaceholder":"Search menu...","navigation.noMatch":"No matching menu items","navigation.noAccessibleApp":"No accessible applications","navigation.noItems":"No items to display","navigation.expandView":"Expand {title}","navigation.mode.switchToFixed":"Switch to fixed navigation","navigation.mode.switchToFloating":"Switch to floating navigation","navigation.pinned":"Pinned","navigation.pin.add":"Pin to top","navigation.pin.remove":"Unpin","table.toolbar.searchPlaceholder":"Search...","table.title.default":"Data Table","table.toolbar.groupBy":"Group By","table.toolbar.summary":"Summary","table.toolbar.columns":"Columns","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Items per page:","table.toolbar.pageOf":"Page {current} of {total}","table.toolbar.newItem":"New Item","table.toolbar.editItem":"Edit Item","table.toolbar.deleteItem":"Delete Item","table.toolbar.graphicReport":"Graphic Report","table.toolbar.saveLayout":"Save Layout","table.menu.groupBy":"Group By","table.menu.clearAll":"Clear All","table.menu.visibleColumns":"Visible Columns","table.menu.showSummaryRow":"Show Summary Row","table.menu.noNumericColumns":"No numeric columns","table.group.expandAll":"Expand All Groups","table.group.collapseAll":"Collapse All Groups","table.mobile.notImplemented":"Mobile View Not Implemented","table.headerMenu.sortAsc":"Sort Ascending","table.headerMenu.sortDesc":"Sort Descending","table.headerMenu.clearSort":"Clear Sort","table.headerMenu.configureSort":"Configure Sort...","table.headerMenu.group":"Group by this column","table.headerMenu.ungroup":"Remove from grouping","table.headerMenu.addSummary":"Include in Summary","table.headerMenu.removeSummary":"Remove from Summary","table.headerMenu.hideColumn":"Hide Column","table.sortDialog.title":"Sort Settings","table.sortDialog.empty":"No sort rules. Add one to start ordering rows.","table.sortDialog.addRule":"Add Sort Rule","table.sortDialog.clearAll":"Clear All","table.sortDialog.asc":"Ascending","table.sortDialog.desc":"Descending","pivot.title.default":"Pivot Table Builder","pivot.subtitle.default":"Drag fields to configure the pivot table.","pivot.empty":"Drag at least one field into Values to render the pivot result.","pivot.records":"Records","pivot.afterFilter":"After filter","pivot.grandTotal":"Grand Total","pivot.resultLabel":"Result","pivot.valueLabel":"Value","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Field List","pivot.availableDimensions":"Available dimensions","pivot.allFieldsInUse":"All fields are in use.","pivot.zone.rows":"Rows","pivot.zone.columns":"Columns","pivot.zone.filters":"Filters","pivot.zone.values":"Values","pivot.hint.rows":"Drag fields here to build row hierarchy","pivot.hint.columns":"Drag fields here to build column hierarchy","pivot.hint.filters":"Drag fields here for report filters","pivot.hint.values":"Drag numeric fields here for aggregation","pivot.clearArea":"Clear area","pivot.filter.na":"N/A","pivot.filter.noValues":"No values","pivot.filter.noneSelected":"None selected","pivot.filter.allValues":"All values","pivot.filter.selectedCount":"{selected} / {total} selected","pivot.filter.selectAll":"Select All","pivot.filter.deselectAll":"Deselect All","pivot.filter.noResults":"No results","pivot.collapse.ariaExpand":"Expand configuration area","pivot.collapse.ariaCollapse":"Collapse configuration area","pivot.agg.sum":"Sum","pivot.agg.count":"Count","pivot.agg.avg":"Average","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Select preset","pivot.preset.save":"Save preset","pivot.preset.delete":"Delete preset","pivot.preset.saveDialogTitle":"Save current preset","pivot.preset.nameLabel":"Preset name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot Result","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Expand pivot result","pivot.table.collapse.ariaCollapse":"Collapse pivot result","pivot.chart.title":"Pivot Chart","pivot.chart.subtitle":"Map one dimension and up to two measures into a compact chart.","pivot.chart.subtitleReady":"{dimension} by {measure}","pivot.chart.emptyNoDimension":"Add at least one row or column field to render the chart.","pivot.chart.emptyNoValue":"Add at least one value field to render the chart.","pivot.chart.emptyNoData":"No data available for the current chart selection.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Measure","pivot.chart.secondaryMeasure":"Compare measure","pivot.chart.chartType":"Chart type","pivot.chart.style.barVertical":"Vertical bars","pivot.chart.style.barHorizontal":"Horizontal bars","pivot.chart.style.line":"Line","pivot.chart.style.scatter":"Scatter","pivot.chart.collapse.ariaExpand":"Expand chart area","pivot.chart.collapse.ariaCollapse":"Collapse chart area","smartFilter.adaptFilters":"Adapt Filters","smartFilter.addFilters":"Add Filters","smartFilter.go":"Go","smartFilter.visibleFilters":"Visible Filters","smartFilter.searchPlaceholder":"Search...","smartFilter.noOptionsFound":"No options found","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Equals","smartFilter.operator.contains":"Contains","smartFilter.operator.notContains":"Does Not Contain","smartFilter.operator.wildcard":"Wildcard Search","smartFilter.operator.notEquals":"Not Equals","smartFilter.operator.greaterThan":"Greater Than","smartFilter.operator.lessThan":"Less Than","smartFilter.operator.greaterOrEqual":"Greater Than or Equal","smartFilter.operator.lessOrEqual":"Less Than or Equal","smartFilter.operator.between":"Between","variant.noOptions":"No options","variant.defaultSuffix":"Default","variant.selectVariant":"Select Variant","variant.saveView":"Save View","variant.newVariant":"New Variant","variant.viewName":"View Name","variant.setDefault":"Set as Default","variant.publicAllUsers":"Public (All Users)","variant.toast.fetchFailed":"Failed to load variants","variant.toast.saveFailed":"Failed to save variant","variant.toast.saveSuccess":"Variant saved successfully","variant.toast.deleteFailed":"Failed to delete variant","variant.toast.deleteSuccess":"Variant deleted successfully","variant.toast.defaultFailed":"Failed to update default variant","variant.toast.defaultSuccess":"Default variant updated","layout.saveLayout":"Save Layout","layout.layoutOptions":"Layout Options","layout.selectLayout":"Select Layout","layout.saveCurrentLayout":"Save Current Layout...","layout.noSavedLayouts":"No saved layouts","layout.removeDefault":"Remove Default","layout.setAsDefault":"Set as Default","layout.layoutName":"Layout Name","layout.layoutDescription":"Description","layout.layoutNameHelper":"e.g., 'Compact View'","layout.warningOverwrite":"Warning: Existing layout will be overwritten","layout.useAsDefault":"Use as Default Layout","layout.publicAllUsers":"Public (Visible to all users)","layout.toast.loadFallback":"Failed to load layouts from backend, fallback to local storage","layout.toast.saveSuccess":"Layout saved successfully","layout.toast.saveLocalSuccess":"Layout saved to local storage","layout.toast.backendUnavailableSavedLocal":"Backend unavailable, saved to local storage","layout.toast.deleteSuccess":"Layout deleted successfully","layout.toast.deleteLocalSuccess":"Layout deleted from local storage","layout.toast.backendUnavailableDeletedLocal":"Backend unavailable, deleted from local storage","layout.toast.defaultSuccess":"Default layout set","layout.toast.defaultLocalSuccess":"Default layout set in local storage","layout.toast.backendUnavailableDefaultLocal":"Backend unavailable, default saved to local storage","dateRange.label":"Date Range","dateRange.startDate":"Start Date","dateRange.endDate":"End Date","dateRange.select":"Select...","dateRange.today":"Today","dateRange.thisWeek":"This Week","dateRange.thisMonth":"This Month","graph.records":"{count} records","graph.kpi.totalRecords":"Total Records","graph.kpi.totalReport":"Total Report","graph.kpi.totalBillable":"Total Billable","graph.kpi.efficiency":"Efficiency","graph.kpi.amount":"Amount","graph.kpi.flagged":"Flagged","graph.chart.billable.title":"Billable by Dimension","graph.chart.billable.subtitle":"Top values by billable hours","graph.chart.efficiency.title":"Efficiency by Person","graph.chart.efficiency.subtitle":"Lowest efficiency first","graph.chart.status.title":"Status Distribution","graph.chart.status.subtitle":"Record ratio by status","graph.dataBody":"Data Body","graph.reportTitle":"Graphic Report","graph.unassigned":"Unassigned","graph.column.reportHours":"Report Hours","graph.column.billableHours":"Billable Hours","detail.searchAi.placeholder":"Search fields, or ask AI if no match...","detail.searchAi.matches":"{count} matches found","detail.searchAi.noMatch":"No matching field found.","detail.searchAi.autoAiFallback":"No direct match. Triggering AI analysis...","detail.searchAi.aiResultTitle":"AI Insight","detail.table.title":"Related Records","kanban.empty":"Drop cards here","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Release to move into this bucket","kanban.bucket.add":"Add bucket","kanban.bucket.rename":"Rename bucket","kanban.bucket.saveRename":"Save bucket name","kanban.bucket.cancelRename":"Cancel renaming","kanban.search.placeholder":"Search cards and buckets","kanban.search.clear":"Clear search","kanban.search.results":"{count} matching cards","kanban.search.noMatch":"No matching cards","kanban.card.progress":"Progress","kanban.card.openDetail":"Open Detail","kanban.priority.critical":"Critical","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","quickCreate.newItem":"New Item","quickCreate.createWithTitle":"Create {title}","quickEdit.editWithTitle":"Edit {title}","quickDelete.confirmTitle":"Confirm Delete","quickDelete.confirmMessageSingle":"Are you sure you want to delete the selected record?","quickDelete.confirmMessageMultiple":"Are you sure you want to delete {count} selected records?","cardPage.viewDetails":"View Details","cardPage.download":"Download","cardPage.close":"Close","cardPage.empty":"No items found","messageBox.confirm":"OK","messageBox.cancel":"Cancel"},sb={"common.cancel":"\u53D6\u6D88","common.save":"\u4FDD\u5B58","common.ok":"\u786E\u5B9A","common.done":"\u5B8C\u6210","common.search":"\u641C\u7D22","common.none":"\u65E0","common.all":"\u5168\u90E8","common.noData":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.delete":"\u5220\u9664","common.loading":"\u52A0\u8F7D\u4E2D...","header.searchPlaceholder":"\u95EE\u6211\u70B9\u4EC0\u4E48...","header.searchAddFeature":"\u589E\u52A0\u529F\u80FD","header.searchSend":"\u53D1\u9001","header.searchStartVoice":"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165","header.searchStopVoice":"\u505C\u6B62\u8BED\u97F3\u8F93\u5165","header.theme.system":"\u4E3B\u9898\uFF1A\u8DDF\u968F\u7CFB\u7EDF","header.theme.dark":"\u4E3B\u9898\uFF1A\u6DF1\u8272","header.theme.light":"\u4E3B\u9898\uFF1A\u6D45\u8272","header.menu.setting":"\u8BBE\u7F6E","header.menu.refresh":"\u5237\u65B0","header.menu.logout":"\u6CE8\u9500","navigation.expand":"\u5C55\u5F00\u5BFC\u822A","navigation.collapse":"\u6298\u53E0\u5BFC\u822A","navigation.searchPlaceholder":"\u641C\u7D22\u83DC\u5355...","navigation.noMatch":"\u672A\u627E\u5230\u5339\u914D\u7684\u83DC\u5355\u9879","navigation.noAccessibleApp":"\u6682\u65E0\u53EF\u8BBF\u95EE\u7684\u5E94\u7528","navigation.noItems":"\u6682\u65E0\u53EF\u663E\u793A\u9879","navigation.expandView":"\u5C55\u5F00\u67E5\u770B {title}","navigation.mode.switchToFixed":"\u5207\u6362\u4E3A\u56FA\u5B9A\u5BFC\u822A","navigation.mode.switchToFloating":"\u5207\u6362\u4E3A\u60AC\u6D6E\u5BFC\u822A","navigation.pinned":"\u5DF2\u56FA\u5B9A","navigation.pin.add":"\u56FA\u5B9A\u5230\u9876\u90E8","navigation.pin.remove":"\u53D6\u6D88\u56FA\u5B9A","table.toolbar.searchPlaceholder":"\u641C\u7D22...","table.title.default":"\u6570\u636E\u8868","table.toolbar.groupBy":"\u5206\u7EC4","table.toolbar.summary":"\u6C47\u603B","table.toolbar.columns":"\u5217","table.toolbar.export":"\u5BFC\u51FA","table.toolbar.itemsPerPage":"\u6BCF\u9875\u6761\u6570\uFF1A","table.toolbar.pageOf":"\u7B2C {current} / {total} \u9875","table.toolbar.newItem":"\u65B0\u5EFA\u6761\u76EE","table.toolbar.editItem":"\u7F16\u8F91\u6761\u76EE","table.toolbar.deleteItem":"\u5220\u9664\u6761\u76EE","table.toolbar.graphicReport":"\u56FE\u8868\u62A5\u8868","table.toolbar.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","table.menu.groupBy":"\u5206\u7EC4","table.menu.clearAll":"\u6E05\u7A7A","table.menu.visibleColumns":"\u53EF\u89C1\u5217","table.menu.showSummaryRow":"\u663E\u793A\u6C47\u603B\u884C","table.menu.noNumericColumns":"\u6CA1\u6709\u6570\u503C\u5217","table.group.expandAll":"\u5C55\u5F00\u5168\u90E8\u5206\u7EC4","table.group.collapseAll":"\u6298\u53E0\u5168\u90E8\u5206\u7EC4","table.mobile.notImplemented":"\u79FB\u52A8\u7AEF\u89C6\u56FE\u6682\u672A\u5B9E\u73B0","table.headerMenu.sortAsc":"\u5347\u5E8F\u6392\u5217","table.headerMenu.sortDesc":"\u964D\u5E8F\u6392\u5217","table.headerMenu.clearSort":"\u6E05\u9664\u6392\u5E8F","table.headerMenu.configureSort":"\u6392\u5E8F\u8BBE\u7F6E...","table.headerMenu.group":"\u6309\u6B64\u5217\u5206\u7EC4","table.headerMenu.ungroup":"\u53D6\u6D88\u5206\u7EC4","table.headerMenu.addSummary":"\u52A0\u5165\u6C47\u603B","table.headerMenu.removeSummary":"\u4ECE\u6C47\u603B\u4E2D\u79FB\u9664","table.headerMenu.hideColumn":"\u9690\u85CF\u8BE5\u5217","table.sortDialog.title":"\u6392\u5E8F\u8BBE\u7F6E","table.sortDialog.empty":"\u6682\u65E0\u6392\u5E8F\u89C4\u5219\uFF0C\u8BF7\u6DFB\u52A0\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\u3002","table.sortDialog.addRule":"\u6DFB\u52A0\u6392\u5E8F\u89C4\u5219","table.sortDialog.clearAll":"\u6E05\u7A7A\u89C4\u5219","table.sortDialog.asc":"\u5347\u5E8F","table.sortDialog.desc":"\u964D\u5E8F","pivot.title.default":"\u6570\u636E\u900F\u89C6\u8868","pivot.subtitle.default":"\u62D6\u62FD\u5B57\u6BB5\u4EE5\u914D\u7F6E\u900F\u89C6\u8868\u3002","pivot.empty":"\u8BF7\u81F3\u5C11\u62D6\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u900F\u89C6\u7ED3\u679C\u3002","pivot.records":"\u8BB0\u5F55\u6570","pivot.afterFilter":"\u7B5B\u9009\u540E","pivot.grandTotal":"\u603B\u8BA1","pivot.resultLabel":"\u7ED3\u679C","pivot.valueLabel":"\u503C","pivot.table.dimensions":"\u7EF4\u5EA6","pivot.config.title":"\u5E03\u5C40\u914D\u7F6E","pivot.fieldList":"\u5B57\u6BB5\u5217\u8868","pivot.availableDimensions":"\u53EF\u7528\u7EF4\u5EA6","pivot.allFieldsInUse":"\u6240\u6709\u5B57\u6BB5\u90FD\u5DF2\u4F7F\u7528\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u7B5B\u9009","pivot.zone.values":"\u503C","pivot.hint.rows":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u884C\u5C42\u7EA7","pivot.hint.columns":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u5217\u5C42\u7EA7","pivot.hint.filters":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u4F5C\u4E3A\u62A5\u8868\u7B5B\u9009","pivot.hint.values":"\u5C06\u6570\u503C\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u8FDB\u884C\u805A\u5408","pivot.clearArea":"\u6E05\u7A7A\u533A\u57DF","pivot.filter.na":"\u4E0D\u53EF\u7528","pivot.filter.noValues":"\u65E0\u53EF\u9009\u503C","pivot.filter.noneSelected":"\u672A\u9009\u62E9","pivot.filter.allValues":"\u5168\u90E8\u503C","pivot.filter.selectedCount":"\u5DF2\u9009 {selected} / {total}","pivot.filter.selectAll":"\u5168\u9009","pivot.filter.deselectAll":"\u53D6\u6D88\u5168\u9009","pivot.filter.noResults":"\u65E0\u5339\u914D\u7ED3\u679C","pivot.collapse.ariaExpand":"\u5C55\u5F00\u914D\u7F6E\u533A\u57DF","pivot.collapse.ariaCollapse":"\u6298\u53E0\u914D\u7F6E\u533A\u57DF","pivot.agg.sum":"\u6C42\u548C","pivot.agg.count":"\u8BA1\u6570","pivot.agg.avg":"\u5E73\u5747\u503C","pivot.agg.min":"\u6700\u5C0F\u503C","pivot.agg.max":"\u6700\u5927\u503C","pivot.preset.selectPlaceholder":"\u9009\u62E9\u65B9\u6848","pivot.preset.save":"\u4FDD\u5B58\u65B9\u6848","pivot.preset.delete":"\u5220\u9664\u65B9\u6848","pivot.preset.saveDialogTitle":"\u4FDD\u5B58\u5F53\u524D\u65B9\u6848","pivot.preset.nameLabel":"\u65B9\u6848\u540D\u79F0","pivot.preset.defaultName":"\u65B9\u6848 {index}","pivot.table.sectionTitle":"\u900F\u89C6\u7ED3\u679C","pivot.table.expandRowsAll":"\u884C\u5168\u90E8\u6253\u5F00","pivot.table.collapseRowsAll":"\u884C\u5168\u90E8\u6298\u53E0","pivot.table.expandColumnsAll":"\u5217\u5168\u90E8\u6253\u5F00","pivot.table.collapseColumnsAll":"\u5217\u5168\u90E8\u6298\u53E0","pivot.table.collapse.ariaExpand":"\u5C55\u5F00\u900F\u89C6\u7ED3\u679C","pivot.table.collapse.ariaCollapse":"\u6298\u53E0\u900F\u89C6\u7ED3\u679C","pivot.chart.title":"\u900F\u89C6\u56FE\u8868","pivot.chart.subtitle":"\u5C06\u4E00\u4E2A\u7EF4\u5EA6\u4E0E\u6700\u591A\u4E24\u4E2A\u5EA6\u91CF\u6620\u5C04\u4E3A\u7D27\u51D1\u56FE\u8868\u3002","pivot.chart.subtitleReady":"{dimension} \xB7 {measure}","pivot.chart.emptyNoDimension":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u884C\u6216\u5217\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoValue":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoData":"\u5F53\u524D\u56FE\u8868\u9009\u62E9\u4E0B\u6682\u65E0\u53EF\u5C55\u793A\u6570\u636E\u3002","pivot.chart.dimension":"\u56FE\u8868\u7EF4\u5EA6","pivot.chart.primaryMeasure":"\u4E3B\u5EA6\u91CF","pivot.chart.secondaryMeasure":"\u5BF9\u6BD4\u5EA6\u91CF","pivot.chart.chartType":"\u56FE\u8868\u7C7B\u578B","pivot.chart.style.barVertical":"\u7EB5\u5411\u67F1\u72B6\u56FE","pivot.chart.style.barHorizontal":"\u6A2A\u5411\u67F1\u72B6\u56FE","pivot.chart.style.line":"\u6298\u7EBF\u56FE","pivot.chart.style.scatter":"\u6563\u70B9\u56FE","pivot.chart.collapse.ariaExpand":"\u5C55\u5F00\u56FE\u8868\u533A\u57DF","pivot.chart.collapse.ariaCollapse":"\u6298\u53E0\u56FE\u8868\u533A\u57DF","smartFilter.adaptFilters":"\u7B5B\u9009\u8BBE\u7F6E","smartFilter.addFilters":"\u6DFB\u52A0\u7B5B\u9009","smartFilter.go":"\u6267\u884C","smartFilter.visibleFilters":"\u53EF\u89C1\u7B5B\u9009\u9879","smartFilter.searchPlaceholder":"\u641C\u7D22...","smartFilter.noOptionsFound":"\u672A\u627E\u5230\u9009\u9879","smartFilter.min":"\u6700\u5C0F\u503C","smartFilter.max":"\u6700\u5927\u503C","smartFilter.minMaxPlaceholder":"\u6700\u5C0F\u503C - \u6700\u5927\u503C","smartFilter.operator.equals":"\u7B49\u4E8E","smartFilter.operator.contains":"\u5305\u542B","smartFilter.operator.notContains":"\u4E0D\u5305\u542B","smartFilter.operator.wildcard":"\u901A\u914D\u7B26\u641C\u7D22","smartFilter.operator.notEquals":"\u4E0D\u7B49\u4E8E","smartFilter.operator.greaterThan":"\u5927\u4E8E","smartFilter.operator.lessThan":"\u5C0F\u4E8E","smartFilter.operator.greaterOrEqual":"\u5927\u4E8E\u7B49\u4E8E","smartFilter.operator.lessOrEqual":"\u5C0F\u4E8E\u7B49\u4E8E","smartFilter.operator.between":"\u533A\u95F4","variant.noOptions":"\u65E0\u9009\u9879","variant.defaultSuffix":"\u9ED8\u8BA4","variant.selectVariant":"\u9009\u62E9\u89C6\u56FE","variant.saveView":"\u4FDD\u5B58\u89C6\u56FE","variant.newVariant":"\u65B0\u89C6\u56FE","variant.viewName":"\u89C6\u56FE\u540D\u79F0","variant.setDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","variant.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\uFF09","variant.toast.fetchFailed":"\u52A0\u8F7D\u89C6\u56FE\u5931\u8D25","variant.toast.saveFailed":"\u4FDD\u5B58\u89C6\u56FE\u5931\u8D25","variant.toast.saveSuccess":"\u89C6\u56FE\u4FDD\u5B58\u6210\u529F","variant.toast.deleteFailed":"\u5220\u9664\u89C6\u56FE\u5931\u8D25","variant.toast.deleteSuccess":"\u89C6\u56FE\u5220\u9664\u6210\u529F","variant.toast.defaultFailed":"\u66F4\u65B0\u9ED8\u8BA4\u89C6\u56FE\u5931\u8D25","variant.toast.defaultSuccess":"\u9ED8\u8BA4\u89C6\u56FE\u5DF2\u66F4\u65B0","layout.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","layout.layoutOptions":"\u5E03\u5C40\u9009\u9879","layout.selectLayout":"\u9009\u62E9\u5E03\u5C40","layout.saveCurrentLayout":"\u4FDD\u5B58\u5F53\u524D\u5E03\u5C40...","layout.noSavedLayouts":"\u6682\u65E0\u5DF2\u4FDD\u5B58\u5E03\u5C40","layout.removeDefault":"\u53D6\u6D88\u9ED8\u8BA4","layout.setAsDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","layout.layoutName":"\u5E03\u5C40\u540D\u79F0","layout.layoutDescription":"\u63CF\u8FF0","layout.layoutNameHelper":"\u4F8B\u5982\uFF1A\u7D27\u51D1\u89C6\u56FE","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u5C06\u8986\u76D6\u540C\u540D\u5E03\u5C40","layout.useAsDefault":"\u7528\u4F5C\u9ED8\u8BA4\u5E03\u5C40","layout.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09","layout.toast.loadFallback":"\u540E\u7AEF\u52A0\u8F7D\u5E03\u5C40\u5931\u8D25\uFF0C\u5DF2\u56DE\u9000\u5230\u672C\u5730\u5B58\u50A8","layout.toast.saveSuccess":"\u5E03\u5C40\u4FDD\u5B58\u6210\u529F","layout.toast.saveLocalSuccess":"\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.backendUnavailableSavedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.deleteSuccess":"\u5E03\u5C40\u5220\u9664\u6210\u529F","layout.toast.deleteLocalSuccess":"\u5E03\u5C40\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.backendUnavailableDeletedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.defaultSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u8BBE\u7F6E","layout.toast.defaultLocalSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u5728\u672C\u5730\u5B58\u50A8\u8BBE\u7F6E","layout.toast.backendUnavailableDefaultLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","dateRange.label":"\u65E5\u671F\u8303\u56F4","dateRange.startDate":"\u5F00\u59CB\u65E5\u671F","dateRange.endDate":"\u7ED3\u675F\u65E5\u671F","dateRange.select":"\u8BF7\u9009\u62E9...","dateRange.today":"\u4ECA\u5929","dateRange.thisWeek":"\u672C\u5468","dateRange.thisMonth":"\u672C\u6708","graph.records":"{count} \u6761\u8BB0\u5F55","graph.kpi.totalRecords":"\u603B\u8BB0\u5F55\u6570","graph.kpi.totalReport":"\u603B\u7533\u62A5\u5DE5\u65F6","graph.kpi.totalBillable":"\u603B\u53EF\u8BA1\u8D39\u5DE5\u65F6","graph.kpi.efficiency":"\u6548\u7387","graph.kpi.amount":"\u91D1\u989D","graph.kpi.flagged":"\u6807\u8BB0","graph.chart.billable.title":"\u7EF4\u5EA6\u8BA1\u8D39\u5DE5\u65F6","graph.chart.billable.subtitle":"\u6309\u53EF\u8BA1\u8D39\u5DE5\u65F6\u6392\u5E8F\u524D\u5217","graph.chart.efficiency.title":"\u4EBA\u5458\u6548\u7387","graph.chart.efficiency.subtitle":"\u6309\u6700\u4F4E\u6548\u7387\u4F18\u5148","graph.chart.status.title":"\u72B6\u6001\u5206\u5E03","graph.chart.status.subtitle":"\u6309\u72B6\u6001\u8BB0\u5F55\u5360\u6BD4","graph.dataBody":"\u6570\u636E\u660E\u7EC6","graph.reportTitle":"\u56FE\u8868\u62A5\u8868","graph.unassigned":"\u672A\u5206\u914D","graph.column.reportHours":"\u7533\u62A5\u5DE5\u65F6","graph.column.billableHours":"\u53EF\u8BA1\u8D39\u5DE5\u65F6","detail.searchAi.placeholder":"\u641C\u7D22\u5B57\u6BB5\uFF1B\u5982\u65E0\u7ED3\u679C\u5219\u81EA\u52A8\u89E6\u53D1 AI...","detail.searchAi.matches":"{count} \u6761\u5339\u914D\u7ED3\u679C","detail.searchAi.noMatch":"\u672A\u627E\u5230\u5339\u914D\u5B57\u6BB5\u3002","detail.searchAi.autoAiFallback":"\u672A\u547D\u4E2D\u5B57\u6BB5\uFF0C\u6B63\u5728\u89E6\u53D1 AI \u5206\u6790...","detail.searchAi.aiResultTitle":"AI \u5206\u6790\u7ED3\u679C","detail.table.title":"\u5173\u8054\u8BB0\u5F55","kanban.empty":"\u5C06\u5361\u7247\u62D6\u5230\u8FD9\u91CC","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u91CA\u653E\u540E\u79FB\u52A8\u5230\u8BE5 bucket","kanban.bucket.add":"\u65B0\u589E bucket","kanban.bucket.rename":"\u91CD\u547D\u540D bucket","kanban.bucket.saveRename":"\u4FDD\u5B58 bucket \u540D\u79F0","kanban.bucket.cancelRename":"\u53D6\u6D88\u91CD\u547D\u540D","kanban.search.placeholder":"\u641C\u7D22\u5361\u7247\u548C bucket","kanban.search.clear":"\u6E05\u9664\u641C\u7D22","kanban.search.results":"{count} \u5F20\u5339\u914D\u5361\u7247","kanban.search.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u5361\u7247","kanban.card.progress":"\u8FDB\u5EA6","kanban.card.openDetail":"\u6253\u5F00\u8BE6\u60C5","kanban.priority.critical":"\u7D27\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u5EFA\u6761\u76EE","quickCreate.createWithTitle":"\u521B\u5EFA{title}","quickEdit.editWithTitle":"\u7F16\u8F91{title}","quickDelete.confirmTitle":"\u786E\u8BA4\u5220\u9664","quickDelete.confirmMessageSingle":"\u786E\u8BA4\u5220\u9664\u5F53\u524D\u9009\u4E2D\u8BB0\u5F55\u5417\uFF1F","quickDelete.confirmMessageMultiple":"\u786E\u8BA4\u5220\u9664\u5DF2\u9009\u4E2D\u7684 {count} \u6761\u8BB0\u5F55\u5417\uFF1F","cardPage.viewDetails":"\u67E5\u770B\u8BE6\u60C5","cardPage.download":"\u4E0B\u8F7D","cardPage.close":"\u5173\u95ED","cardPage.empty":"\u672A\u627E\u5230\u6761\u76EE","messageBox.confirm":"\u786E\u5B9A","messageBox.cancel":"\u53D6\u6D88"},lb={"common.cancel":"Annuler","common.save":"Enregistrer","common.ok":"OK","common.done":"Terminer","common.search":"Rechercher","common.none":"Aucun","common.all":"Tout","common.noData":"Aucune donn\xE9e","common.copy":"Copier","common.delete":"Supprimer","common.loading":"Chargement...","header.searchPlaceholder":"Demandez-moi...","header.searchAddFeature":"Ajouter une fonction","header.searchSend":"Envoyer","header.searchStartVoice":"D\xE9marrer la saisie vocale","header.searchStopVoice":"Arr\xEAter la saisie vocale","header.theme.system":"Th\xE8me : Syst\xE8me","header.theme.dark":"Th\xE8me : Sombre","header.theme.light":"Th\xE8me : Clair","header.menu.setting":"Param\xE8tres","header.menu.refresh":"Actualiser","header.menu.logout":"Se d\xE9connecter","navigation.expand":"D\xE9velopper la navigation","navigation.collapse":"R\xE9duire la navigation","navigation.searchPlaceholder":"Rechercher dans le menu...","navigation.noMatch":"Aucun \xE9l\xE9ment correspondant","navigation.noAccessibleApp":"Aucune application accessible","navigation.noItems":"Aucun \xE9l\xE9ment \xE0 afficher","navigation.expandView":"D\xE9velopper {title}","navigation.mode.switchToFixed":"Basculer vers la navigation fixe","navigation.mode.switchToFloating":"Basculer vers la navigation flottante","navigation.pinned":"\xC9pingl\xE9s","navigation.pin.add":"\xC9pingler en haut","navigation.pin.remove":"D\xE9s\xE9pingler","table.toolbar.searchPlaceholder":"Rechercher...","table.title.default":"Tableau de donn\xE9es","table.toolbar.groupBy":"Grouper","table.toolbar.summary":"R\xE9sum\xE9","table.toolbar.columns":"Colonnes","table.toolbar.export":"Exporter","table.toolbar.itemsPerPage":"Lignes par page :","table.toolbar.pageOf":"Page {current} sur {total}","table.toolbar.newItem":"Nouvel \xE9l\xE9ment","table.toolbar.editItem":"Modifier l'\xE9l\xE9ment","table.toolbar.deleteItem":"Supprimer l'\xE9l\xE9ment","table.toolbar.graphicReport":"Rapport graphique","table.toolbar.saveLayout":"Enregistrer la vue","table.menu.groupBy":"Grouper","table.menu.clearAll":"Tout effacer","table.menu.visibleColumns":"Colonnes visibles","table.menu.showSummaryRow":"Afficher la ligne de r\xE9sum\xE9","table.menu.noNumericColumns":"Aucune colonne num\xE9rique","table.group.expandAll":"D\xE9velopper tous les groupes","table.group.collapseAll":"R\xE9duire tous les groupes","table.mobile.notImplemented":"Vue mobile non impl\xE9ment\xE9e","table.headerMenu.sortAsc":"Trier ascendant","table.headerMenu.sortDesc":"Trier descendant","table.headerMenu.clearSort":"Effacer le tri","table.headerMenu.configureSort":"Configurer le tri...","table.headerMenu.group":"Grouper par cette colonne","table.headerMenu.ungroup":"Retirer du groupement","table.headerMenu.addSummary":"Inclure dans le r\xE9sum\xE9","table.headerMenu.removeSummary":"Retirer du r\xE9sum\xE9","table.headerMenu.hideColumn":"Masquer la colonne","table.sortDialog.title":"Param\xE8tres de tri","table.sortDialog.empty":"Aucune r\xE8gle de tri. Ajoutez-en une pour commencer.","table.sortDialog.addRule":"Ajouter une r\xE8gle","table.sortDialog.clearAll":"Tout effacer","table.sortDialog.asc":"Ascendant","table.sortDialog.desc":"Descendant","pivot.title.default":"Tableau crois\xE9 dynamique","pivot.subtitle.default":"Faites glisser les champs pour configurer le tableau crois\xE9.","pivot.empty":"Ajoutez au moins un champ de valeur pour afficher le r\xE9sultat.","pivot.records":"Enregistrements","pivot.afterFilter":"Apr\xE8s filtre","pivot.grandTotal":"Total g\xE9n\xE9ral","pivot.resultLabel":"R\xE9sultat","pivot.valueLabel":"Valeur","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Liste des champs","pivot.availableDimensions":"Dimensions disponibles","pivot.allFieldsInUse":"Tous les champs sont d\xE9j\xE0 utilis\xE9s.","pivot.zone.rows":"Lignes","pivot.zone.columns":"Colonnes","pivot.zone.filters":"Filtres","pivot.zone.values":"Valeurs","pivot.hint.rows":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des lignes","pivot.hint.columns":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des colonnes","pivot.hint.filters":"D\xE9posez les champs ici pour les filtres du rapport","pivot.hint.values":"D\xE9posez les champs num\xE9riques ici pour les agr\xE9gations","pivot.clearArea":"Vider la zone","pivot.filter.na":"N/A","pivot.filter.noValues":"Aucune valeur","pivot.filter.noneSelected":"Aucune s\xE9lection","pivot.filter.allValues":"Toutes les valeurs","pivot.filter.selectedCount":"{selected} / {total} s\xE9lectionn\xE9es","pivot.filter.selectAll":"Tout s\xE9lectionner","pivot.filter.deselectAll":"Tout d\xE9s\xE9lectionner","pivot.filter.noResults":"Aucun r\xE9sultat","pivot.collapse.ariaExpand":"D\xE9velopper la zone de configuration","pivot.collapse.ariaCollapse":"R\xE9duire la zone de configuration","pivot.agg.sum":"Somme","pivot.agg.count":"Compte","pivot.agg.avg":"Moyenne","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"S\xE9lectionner un preset","pivot.preset.save":"Enregistrer le preset","pivot.preset.delete":"Supprimer le preset","pivot.preset.saveDialogTitle":"Enregistrer le preset actuel","pivot.preset.nameLabel":"Nom du preset","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"R\xE9sultat du pivot","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"D\xE9velopper le r\xE9sultat du pivot","pivot.table.collapse.ariaCollapse":"R\xE9duire le r\xE9sultat du pivot","pivot.chart.title":"Graphique pivot","pivot.chart.subtitle":"Associez une dimension et jusqu\u2019\xE0 deux mesures dans un graphique compact.","pivot.chart.subtitleReady":"{dimension} par {measure}","pivot.chart.emptyNoDimension":"Ajoutez au moins un champ de ligne ou de colonne pour afficher le graphique.","pivot.chart.emptyNoValue":"Ajoutez au moins un champ de valeur pour afficher le graphique.","pivot.chart.emptyNoData":"Aucune donn\xE9e disponible pour la s\xE9lection actuelle du graphique.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Mesure","pivot.chart.secondaryMeasure":"Mesure de comparaison","pivot.chart.chartType":"Type de graphique","pivot.chart.style.barVertical":"Barres verticales","pivot.chart.style.barHorizontal":"Barres horizontales","pivot.chart.style.line":"Ligne","pivot.chart.style.scatter":"Nuage de points","pivot.chart.collapse.ariaExpand":"D\xE9velopper la zone du graphique","pivot.chart.collapse.ariaCollapse":"R\xE9duire la zone du graphique","smartFilter.adaptFilters":"Adapter les filtres","smartFilter.addFilters":"Ajouter des filtres","smartFilter.go":"Ex\xE9cuter","smartFilter.visibleFilters":"Filtres visibles","smartFilter.searchPlaceholder":"Rechercher...","smartFilter.noOptionsFound":"Aucune option trouv\xE9e","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"\xC9gal \xE0","smartFilter.operator.contains":"Contient","smartFilter.operator.notContains":"Ne contient pas","smartFilter.operator.wildcard":"Recherche g\xE9n\xE9rique","smartFilter.operator.notEquals":"Diff\xE9rent de","smartFilter.operator.greaterThan":"Sup\xE9rieur \xE0","smartFilter.operator.lessThan":"Inf\xE9rieur \xE0","smartFilter.operator.greaterOrEqual":"Sup\xE9rieur ou \xE9gal","smartFilter.operator.lessOrEqual":"Inf\xE9rieur ou \xE9gal","smartFilter.operator.between":"Entre","variant.noOptions":"Aucune option","variant.defaultSuffix":"Par d\xE9faut","variant.selectVariant":"S\xE9lectionner une vue","variant.saveView":"Enregistrer la vue","variant.newVariant":"Nouvelle vue","variant.viewName":"Nom de la vue","variant.setDefault":"D\xE9finir par d\xE9faut","variant.publicAllUsers":"Public (tous les utilisateurs)","variant.toast.fetchFailed":"\xC9chec du chargement des vues","variant.toast.saveFailed":"\xC9chec de l'enregistrement de la vue","variant.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","variant.toast.deleteFailed":"\xC9chec de la suppression de la vue","variant.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","variant.toast.defaultFailed":"\xC9chec de la mise \xE0 jour de la vue par d\xE9faut","variant.toast.defaultSuccess":"Vue par d\xE9faut mise \xE0 jour","layout.saveLayout":"Enregistrer la vue","layout.layoutOptions":"Options de vue","layout.selectLayout":"S\xE9lectionner une vue","layout.saveCurrentLayout":"Enregistrer la vue actuelle...","layout.noSavedLayouts":"Aucune vue enregistr\xE9e","layout.removeDefault":"Retirer le d\xE9faut","layout.setAsDefault":"D\xE9finir par d\xE9faut","layout.layoutName":"Nom de la vue","layout.layoutDescription":"Description","layout.layoutNameHelper":"ex. : Vue compacte","layout.warningOverwrite":"Attention : la vue existante sera \xE9cras\xE9e","layout.useAsDefault":"Utiliser comme vue par d\xE9faut","layout.publicAllUsers":"Public (visible par tous les utilisateurs)","layout.toast.loadFallback":"\xC9chec du chargement depuis le backend, bascule vers le stockage local","layout.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","layout.toast.saveLocalSuccess":"Vue enregistr\xE9e dans le stockage local","layout.toast.backendUnavailableSavedLocal":"Backend indisponible, enregistr\xE9 en local","layout.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","layout.toast.deleteLocalSuccess":"Vue supprim\xE9e du stockage local","layout.toast.backendUnavailableDeletedLocal":"Backend indisponible, supprim\xE9 en local","layout.toast.defaultSuccess":"Vue par d\xE9faut d\xE9finie","layout.toast.defaultLocalSuccess":"Vue par d\xE9faut d\xE9finie en local","layout.toast.backendUnavailableDefaultLocal":"Backend indisponible, d\xE9faut enregistr\xE9 en local","dateRange.label":"Plage de dates","dateRange.startDate":"Date de d\xE9but","dateRange.endDate":"Date de fin","dateRange.select":"S\xE9lectionner...","dateRange.today":"Aujourd'hui","dateRange.thisWeek":"Cette semaine","dateRange.thisMonth":"Ce mois-ci","graph.records":"{count} enregistrements","graph.kpi.totalRecords":"Total des enregistrements","graph.kpi.totalReport":"Total d\xE9clar\xE9","graph.kpi.totalBillable":"Total facturable","graph.kpi.efficiency":"Efficacit\xE9","graph.kpi.amount":"Montant","graph.kpi.flagged":"Signal\xE9","graph.chart.billable.title":"Facturable par dimension","graph.chart.billable.subtitle":"Top valeurs par heures facturables","graph.chart.efficiency.title":"Efficacit\xE9 par personne","graph.chart.efficiency.subtitle":"Efficacit\xE9 la plus faible en premier","graph.chart.status.title":"R\xE9partition des statuts","graph.chart.status.subtitle":"Ratio des enregistrements par statut","graph.dataBody":"Donn\xE9es","graph.reportTitle":"Rapport graphique","graph.unassigned":"Non attribu\xE9","graph.column.reportHours":"Heures d\xE9clar\xE9es","graph.column.billableHours":"Heures facturables","detail.searchAi.placeholder":"Rechercher des champs, ou interroger l\u2019IA en cas d\u2019absence de r\xE9sultat...","detail.searchAi.matches":"{count} correspondances trouv\xE9es","detail.searchAi.noMatch":"Aucun champ correspondant trouv\xE9.","detail.searchAi.autoAiFallback":"Aucune correspondance directe. Analyse IA en cours...","detail.searchAi.aiResultTitle":"Analyse IA","detail.table.title":"Enregistrements li\xE9s","kanban.empty":"D\xE9posez les cartes ici","kanban.bucket.limit":"Limite","kanban.bucket.dropHere":"Rel\xE2chez pour d\xE9placer dans cette colonne","kanban.bucket.add":"Ajouter une colonne","kanban.bucket.rename":"Renommer la colonne","kanban.bucket.saveRename":"Enregistrer le nom","kanban.bucket.cancelRename":"Annuler le renommage","kanban.search.placeholder":"Rechercher des cartes et colonnes","kanban.search.clear":"Effacer la recherche","kanban.search.results":"{count} cartes correspondantes","kanban.search.noMatch":"Aucune carte correspondante","kanban.card.progress":"Progression","kanban.card.openDetail":"Ouvrir le d\xE9tail","kanban.priority.critical":"Critique","kanban.priority.high":"\xC9lev\xE9e","kanban.priority.medium":"Moyenne","kanban.priority.low":"Faible","quickCreate.newItem":"Nouvel \xE9l\xE9ment","quickCreate.createWithTitle":"Cr\xE9er {title}","quickEdit.editWithTitle":"Modifier {title}","quickDelete.confirmTitle":"Confirmer la suppression","quickDelete.confirmMessageSingle":"Voulez-vous vraiment supprimer l\u2019enregistrement s\xE9lectionn\xE9 ?","quickDelete.confirmMessageMultiple":"Voulez-vous vraiment supprimer les {count} enregistrements s\xE9lectionn\xE9s ?","cardPage.viewDetails":"Voir les d\xE9tails","cardPage.download":"T\xE9l\xE9charger","cardPage.close":"Fermer","cardPage.empty":"Aucun \xE9l\xE9ment trouv\xE9","messageBox.confirm":"OK","messageBox.cancel":"Annuler"},cb={"common.cancel":"Abbrechen","common.save":"Speichern","common.ok":"OK","common.done":"Fertig","common.search":"Suchen","common.none":"Keine","common.all":"Alle","common.noData":"Keine Daten","common.copy":"Kopieren","common.delete":"L\xF6schen","common.loading":"Wird geladen...","header.searchPlaceholder":"Frag mich...","header.searchAddFeature":"Funktion hinzuf\xFCgen","header.searchSend":"Senden","header.searchStartVoice":"Spracheingabe starten","header.searchStopVoice":"Spracheingabe stoppen","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dunkel","header.theme.light":"Theme: Hell","header.menu.setting":"Einstellungen","header.menu.refresh":"Aktualisieren","header.menu.logout":"Abmelden","navigation.expand":"Navigation erweitern","navigation.collapse":"Navigation einklappen","navigation.searchPlaceholder":"Men\xFC suchen...","navigation.noMatch":"Keine passenden Men\xFCeintr\xE4ge","navigation.noAccessibleApp":"Keine verf\xFCgbaren Anwendungen","navigation.noItems":"Keine Eintr\xE4ge vorhanden","navigation.expandView":"{title} aufklappen","navigation.mode.switchToFixed":"Zu fester Navigation wechseln","navigation.mode.switchToFloating":"Zu schwebender Navigation wechseln","navigation.pinned":"Angeheftet","navigation.pin.add":"Oben anheften","navigation.pin.remove":"L\xF6sen","table.toolbar.searchPlaceholder":"Suchen...","table.title.default":"Datentabelle","table.toolbar.groupBy":"Gruppieren","table.toolbar.summary":"Zusammenfassung","table.toolbar.columns":"Spalten","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Zeilen pro Seite:","table.toolbar.pageOf":"Seite {current} von {total}","table.toolbar.newItem":"Neuer Eintrag","table.toolbar.editItem":"Eintrag bearbeiten","table.toolbar.deleteItem":"Eintrag l\xF6schen","table.toolbar.graphicReport":"Grafikbericht","table.toolbar.saveLayout":"Layout speichern","table.menu.groupBy":"Gruppieren","table.menu.clearAll":"Alles l\xF6schen","table.menu.visibleColumns":"Sichtbare Spalten","table.menu.showSummaryRow":"Summenzeile anzeigen","table.menu.noNumericColumns":"Keine numerischen Spalten","table.group.expandAll":"Alle Gruppen aufklappen","table.group.collapseAll":"Alle Gruppen zuklappen","table.mobile.notImplemented":"Mobile Ansicht nicht implementiert","table.headerMenu.sortAsc":"Aufsteigend sortieren","table.headerMenu.sortDesc":"Absteigend sortieren","table.headerMenu.clearSort":"Sortierung entfernen","table.headerMenu.configureSort":"Sortierung konfigurieren...","table.headerMenu.group":"Nach dieser Spalte gruppieren","table.headerMenu.ungroup":"Aus Gruppierung entfernen","table.headerMenu.addSummary":"In Summe einbeziehen","table.headerMenu.removeSummary":"Aus Summe entfernen","table.headerMenu.hideColumn":"Spalte ausblenden","table.sortDialog.title":"Sortiereinstellungen","table.sortDialog.empty":"Keine Sortierregeln. F\xFCgen Sie eine hinzu, um zu sortieren.","table.sortDialog.addRule":"Regel hinzuf\xFCgen","table.sortDialog.clearAll":"Alle l\xF6schen","table.sortDialog.asc":"Aufsteigend","table.sortDialog.desc":"Absteigend","pivot.title.default":"Pivot-Tabelle","pivot.subtitle.default":"Ziehen Sie Felder, um die Pivot-Tabelle zu konfigurieren.","pivot.empty":"Ziehen Sie mindestens ein Wertefeld, um das Ergebnis anzuzeigen.","pivot.records":"Datens\xE4tze","pivot.afterFilter":"Nach Filter","pivot.grandTotal":"Gesamtsumme","pivot.resultLabel":"Ergebnis","pivot.valueLabel":"Wert","pivot.table.dimensions":"Dimensionen","pivot.config.title":"Konfiguration","pivot.fieldList":"Feldliste","pivot.availableDimensions":"Verf\xFCgbare Dimensionen","pivot.allFieldsInUse":"Alle Felder sind bereits verwendet.","pivot.zone.rows":"Zeilen","pivot.zone.columns":"Spalten","pivot.zone.filters":"Filter","pivot.zone.values":"Werte","pivot.hint.rows":"Felder hierhin ziehen, um die Zeilenhierarchie zu erstellen","pivot.hint.columns":"Felder hierhin ziehen, um die Spaltenhierarchie zu erstellen","pivot.hint.filters":"Felder hierhin ziehen f\xFCr Berichtsfilter","pivot.hint.values":"Numerische Felder hierhin ziehen f\xFCr Aggregation","pivot.clearArea":"Bereich leeren","pivot.filter.na":"N/V","pivot.filter.noValues":"Keine Werte","pivot.filter.noneSelected":"Nichts ausgew\xE4hlt","pivot.filter.allValues":"Alle Werte","pivot.filter.selectedCount":"{selected} / {total} ausgew\xE4hlt","pivot.filter.selectAll":"Alle ausw\xE4hlen","pivot.filter.deselectAll":"Alle abw\xE4hlen","pivot.filter.noResults":"Keine Ergebnisse","pivot.collapse.ariaExpand":"Konfigurationsbereich erweitern","pivot.collapse.ariaCollapse":"Konfigurationsbereich reduzieren","pivot.agg.sum":"Summe","pivot.agg.count":"Anzahl","pivot.agg.avg":"Durchschnitt","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Preset w\xE4hlen","pivot.preset.save":"Preset speichern","pivot.preset.delete":"Preset l\xF6schen","pivot.preset.saveDialogTitle":"Aktuelles Preset speichern","pivot.preset.nameLabel":"Preset-Name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot-Ergebnis","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Pivot-Ergebnis erweitern","pivot.table.collapse.ariaCollapse":"Pivot-Ergebnis reduzieren","pivot.chart.title":"Pivot-Diagramm","pivot.chart.subtitle":"Eine Dimension und bis zu zwei Kennzahlen in einem kompakten Diagramm abbilden.","pivot.chart.subtitleReady":"{dimension} nach {measure}","pivot.chart.emptyNoDimension":"F\xFCgen Sie mindestens ein Zeilen- oder Spaltenfeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoValue":"F\xFCgen Sie mindestens ein Wertefeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoData":"F\xFCr die aktuelle Diagrammauswahl sind keine Daten verf\xFCgbar.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Kennzahl","pivot.chart.secondaryMeasure":"Vergleichskennzahl","pivot.chart.chartType":"Diagrammtyp","pivot.chart.style.barVertical":"Vertikale Balken","pivot.chart.style.barHorizontal":"Horizontale Balken","pivot.chart.style.line":"Linie","pivot.chart.style.scatter":"Streudiagramm","pivot.chart.collapse.ariaExpand":"Diagrammbereich erweitern","pivot.chart.collapse.ariaCollapse":"Diagrammbereich reduzieren","smartFilter.adaptFilters":"Filter anpassen","smartFilter.addFilters":"Filter hinzuf\xFCgen","smartFilter.go":"Los","smartFilter.visibleFilters":"Sichtbare Filter","smartFilter.searchPlaceholder":"Suchen...","smartFilter.noOptionsFound":"Keine Optionen gefunden","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Gleich","smartFilter.operator.contains":"Enth\xE4lt","smartFilter.operator.notContains":"Enth\xE4lt nicht","smartFilter.operator.wildcard":"Wildcard-Suche","smartFilter.operator.notEquals":"Ungleich","smartFilter.operator.greaterThan":"Gr\xF6\xDFer als","smartFilter.operator.lessThan":"Kleiner als","smartFilter.operator.greaterOrEqual":"Gr\xF6\xDFer gleich","smartFilter.operator.lessOrEqual":"Kleiner gleich","smartFilter.operator.between":"Zwischen","variant.noOptions":"Keine Optionen","variant.defaultSuffix":"Standard","variant.selectVariant":"Variante w\xE4hlen","variant.saveView":"Ansicht speichern","variant.newVariant":"Neue Variante","variant.viewName":"Ansichtsname","variant.setDefault":"Als Standard setzen","variant.publicAllUsers":"\xD6ffentlich (alle Benutzer)","variant.toast.fetchFailed":"Varianten konnten nicht geladen werden","variant.toast.saveFailed":"Variante konnte nicht gespeichert werden","variant.toast.saveSuccess":"Variante erfolgreich gespeichert","variant.toast.deleteFailed":"Variante konnte nicht gel\xF6scht werden","variant.toast.deleteSuccess":"Variante erfolgreich gel\xF6scht","variant.toast.defaultFailed":"Standardvariante konnte nicht aktualisiert werden","variant.toast.defaultSuccess":"Standardvariante aktualisiert","layout.saveLayout":"Layout speichern","layout.layoutOptions":"Layout-Optionen","layout.selectLayout":"Layout w\xE4hlen","layout.saveCurrentLayout":"Aktuelles Layout speichern...","layout.noSavedLayouts":"Keine gespeicherten Layouts","layout.removeDefault":"Standard entfernen","layout.setAsDefault":"Als Standard setzen","layout.layoutName":"Layoutname","layout.layoutDescription":"Beschreibung","layout.layoutNameHelper":"z. B. Kompaktansicht","layout.warningOverwrite":"Warnung: Vorhandenes Layout wird \xFCberschrieben","layout.useAsDefault":"Als Standardlayout verwenden","layout.publicAllUsers":"\xD6ffentlich (f\xFCr alle sichtbar)","layout.toast.loadFallback":"Layouts konnten nicht vom Backend geladen werden, Wechsel zu lokalem Speicher","layout.toast.saveSuccess":"Layout erfolgreich gespeichert","layout.toast.saveLocalSuccess":"Layout im lokalen Speicher gespeichert","layout.toast.backendUnavailableSavedLocal":"Backend nicht verf\xFCgbar, lokal gespeichert","layout.toast.deleteSuccess":"Layout erfolgreich gel\xF6scht","layout.toast.deleteLocalSuccess":"Layout aus lokalem Speicher gel\xF6scht","layout.toast.backendUnavailableDeletedLocal":"Backend nicht verf\xFCgbar, lokal gel\xF6scht","layout.toast.defaultSuccess":"Standardlayout gesetzt","layout.toast.defaultLocalSuccess":"Standardlayout lokal gesetzt","layout.toast.backendUnavailableDefaultLocal":"Backend nicht verf\xFCgbar, Standard lokal gespeichert","dateRange.label":"Datumsbereich","dateRange.startDate":"Startdatum","dateRange.endDate":"Enddatum","dateRange.select":"Ausw\xE4hlen...","dateRange.today":"Heute","dateRange.thisWeek":"Diese Woche","dateRange.thisMonth":"Diesen Monat","graph.records":"{count} Datens\xE4tze","graph.kpi.totalRecords":"Gesamt Datens\xE4tze","graph.kpi.totalReport":"Gesamt Report","graph.kpi.totalBillable":"Gesamt abrechenbar","graph.kpi.efficiency":"Effizienz","graph.kpi.amount":"Betrag","graph.kpi.flagged":"Markiert","graph.chart.billable.title":"Abrechenbar nach Dimension","graph.chart.billable.subtitle":"Top-Werte nach abrechenbaren Stunden","graph.chart.efficiency.title":"Effizienz pro Person","graph.chart.efficiency.subtitle":"Niedrigste Effizienz zuerst","graph.chart.status.title":"Statusverteilung","graph.chart.status.subtitle":"Anteil je Status","graph.dataBody":"Datentabelle","graph.reportTitle":"Grafikbericht","graph.unassigned":"Nicht zugewiesen","graph.column.reportHours":"Melde-Stunden","graph.column.billableHours":"Abrechenbare Stunden","detail.searchAi.placeholder":"Felder suchen, oder bei keinem Treffer die KI fragen...","detail.searchAi.matches":"{count} Treffer gefunden","detail.searchAi.noMatch":"Kein passendes Feld gefunden.","detail.searchAi.autoAiFallback":"Keine direkte \xDCbereinstimmung. KI-Analyse wird gestartet...","detail.searchAi.aiResultTitle":"KI-Ergebnis","detail.table.title":"Verkn\xFCpfte Eintr\xE4ge","kanban.empty":"Karten hier ablegen","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Loslassen, um in diese Spalte zu verschieben","kanban.bucket.add":"Spalte hinzuf\xFCgen","kanban.bucket.rename":"Spalte umbenennen","kanban.bucket.saveRename":"Spaltennamen speichern","kanban.bucket.cancelRename":"Umbenennen abbrechen","kanban.search.placeholder":"Karten und Spalten durchsuchen","kanban.search.clear":"Suche l\xF6schen","kanban.search.results":"{count} passende Karten","kanban.search.noMatch":"Keine passenden Karten","kanban.card.progress":"Fortschritt","kanban.card.openDetail":"Detail \xF6ffnen","kanban.priority.critical":"Kritisch","kanban.priority.high":"Hoch","kanban.priority.medium":"Mittel","kanban.priority.low":"Niedrig","quickCreate.newItem":"Neuer Eintrag","quickCreate.createWithTitle":"{title} erstellen","quickEdit.editWithTitle":"{title} bearbeiten","quickDelete.confirmTitle":"L\xF6schen best\xE4tigen","quickDelete.confirmMessageSingle":"M\xF6chten Sie den ausgew\xE4hlten Datensatz wirklich l\xF6schen?","quickDelete.confirmMessageMultiple":"M\xF6chten Sie die {count} ausgew\xE4hlten Datens\xE4tze wirklich l\xF6schen?","cardPage.viewDetails":"Details anzeigen","cardPage.download":"Herunterladen","cardPage.close":"Schlie\xDFen","cardPage.empty":"Keine Eintr\xE4ge gefunden","messageBox.confirm":"OK","messageBox.cancel":"Abbrechen"},db={"common.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","common.save":"\u4FDD\u5B58","common.ok":"OK","common.done":"\u5B8C\u4E86","common.search":"\u691C\u7D22","common.none":"\u306A\u3057","common.all":"\u3059\u3079\u3066","common.noData":"\u30C7\u30FC\u30BF\u306A\u3057","common.copy":"\u30B3\u30D4\u30FC","common.delete":"\u524A\u9664","common.loading":"\u8AAD\u307F\u8FBC\u307F\u4E2D...","header.searchPlaceholder":"\u4F55\u304B\u805E\u3044\u3066\u304F\u3060\u3055\u3044...","header.searchAddFeature":"\u6A5F\u80FD\u3092\u8FFD\u52A0","header.searchSend":"\u9001\u4FE1","header.searchStartVoice":"\u97F3\u58F0\u5165\u529B\u3092\u958B\u59CB","header.searchStopVoice":"\u97F3\u58F0\u5165\u529B\u3092\u505C\u6B62","header.theme.system":"\u30C6\u30FC\u30DE\uFF1A\u30B7\u30B9\u30C6\u30E0","header.theme.dark":"\u30C6\u30FC\u30DE\uFF1A\u30C0\u30FC\u30AF","header.theme.light":"\u30C6\u30FC\u30DE\uFF1A\u30E9\u30A4\u30C8","header.menu.setting":"\u8A2D\u5B9A","header.menu.refresh":"\u518D\u8AAD\u307F\u8FBC\u307F","header.menu.logout":"\u30ED\u30B0\u30A2\u30A6\u30C8","navigation.expand":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u5C55\u958B","navigation.collapse":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u6298\u308A\u305F\u305F\u3080","navigation.searchPlaceholder":"\u30E1\u30CB\u30E5\u30FC\u3092\u691C\u7D22...","navigation.noMatch":"\u4E00\u81F4\u3059\u308B\u30E1\u30CB\u30E5\u30FC\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noAccessibleApp":"\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30A2\u30D7\u30EA\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noItems":"\u8868\u793A\u3067\u304D\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093","navigation.expandView":"{title} \u3092\u5C55\u958B","navigation.mode.switchToFixed":"\u56FA\u5B9A\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.mode.switchToFloating":"\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.pinned":"\u30D4\u30F3\u7559\u3081","navigation.pin.add":"\u4E0A\u90E8\u306B\u30D4\u30F3\u7559\u3081","navigation.pin.remove":"\u30D4\u30F3\u7559\u3081\u3092\u89E3\u9664","table.toolbar.searchPlaceholder":"\u691C\u7D22...","table.title.default":"\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB","table.toolbar.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.toolbar.summary":"\u96C6\u8A08","table.toolbar.columns":"\u5217","table.toolbar.export":"\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","table.toolbar.itemsPerPage":"1\u30DA\u30FC\u30B8\u306E\u4EF6\u6570\uFF1A","table.toolbar.pageOf":"{current} / {total} \u30DA\u30FC\u30B8","table.toolbar.newItem":"\u65B0\u898F\u4F5C\u6210","table.toolbar.editItem":"\u7DE8\u96C6","table.toolbar.deleteItem":"\u524A\u9664","table.toolbar.graphicReport":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","table.toolbar.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","table.menu.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.menu.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.menu.visibleColumns":"\u8868\u793A\u5217","table.menu.showSummaryRow":"\u96C6\u8A08\u884C\u3092\u8868\u793A","table.menu.noNumericColumns":"\u6570\u5024\u5217\u304C\u3042\u308A\u307E\u305B\u3093","table.group.expandAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B","table.group.collapseAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080","table.mobile.notImplemented":"\u30E2\u30D0\u30A4\u30EB\u8868\u793A\u306F\u672A\u5B9F\u88C5\u3067\u3059","table.headerMenu.sortAsc":"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.sortDesc":"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.clearSort":"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664","table.headerMenu.configureSort":"\u4E26\u3079\u66FF\u3048\u3092\u8A2D\u5B9A...","table.headerMenu.group":"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316","table.headerMenu.ungroup":"\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u5916\u3059","table.headerMenu.addSummary":"\u96C6\u8A08\u306B\u8FFD\u52A0","table.headerMenu.removeSummary":"\u96C6\u8A08\u304B\u3089\u524A\u9664","table.headerMenu.hideColumn":"\u5217\u3092\u975E\u8868\u793A","table.sortDialog.title":"\u4E26\u3079\u66FF\u3048\u8A2D\u5B9A","table.sortDialog.empty":"\u4E26\u3079\u66FF\u3048\u30EB\u30FC\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","table.sortDialog.addRule":"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0","table.sortDialog.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.sortDialog.asc":"\u6607\u9806","table.sortDialog.desc":"\u964D\u9806","pivot.title.default":"\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB","pivot.subtitle.default":"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002","pivot.empty":"\u7D50\u679C\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5024\u30A8\u30EA\u30A2\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.records":"\u30EC\u30B3\u30FC\u30C9","pivot.afterFilter":"\u30D5\u30A3\u30EB\u30BF\u30FC\u5F8C","pivot.grandTotal":"\u7DCF\u8A08","pivot.resultLabel":"\u7D50\u679C","pivot.valueLabel":"\u5024","pivot.table.dimensions":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.config.title":"\u8A2D\u5B9A","pivot.fieldList":"\u30D5\u30A3\u30FC\u30EB\u30C9\u4E00\u89A7","pivot.availableDimensions":"\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.allFieldsInUse":"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u4F7F\u7528\u4E2D\u3067\u3059\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u30D5\u30A3\u30EB\u30BF\u30FC","pivot.zone.values":"\u5024","pivot.hint.rows":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u884C\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.columns":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u5217\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.filters":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30EC\u30DD\u30FC\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8A2D\u5B9A","pivot.hint.values":"\u3053\u3053\u306B\u6570\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u96C6\u8A08","pivot.clearArea":"\u30A8\u30EA\u30A2\u3092\u30AF\u30EA\u30A2","pivot.filter.na":"N/A","pivot.filter.noValues":"\u5024\u304C\u3042\u308A\u307E\u305B\u3093","pivot.filter.noneSelected":"\u672A\u9078\u629E","pivot.filter.allValues":"\u3059\u3079\u3066\u306E\u5024","pivot.filter.selectedCount":"{selected} / {total} \u3092\u9078\u629E","pivot.filter.selectAll":"\u3059\u3079\u3066\u9078\u629E","pivot.filter.deselectAll":"\u3059\u3079\u3066\u89E3\u9664","pivot.filter.noResults":"\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093","pivot.collapse.ariaExpand":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u5C55\u958B","pivot.collapse.ariaCollapse":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u6298\u308A\u305F\u305F\u3080","pivot.agg.sum":"\u5408\u8A08","pivot.agg.count":"\u4EF6\u6570","pivot.agg.avg":"\u5E73\u5747","pivot.agg.min":"\u6700\u5C0F","pivot.agg.max":"\u6700\u5927","pivot.preset.selectPlaceholder":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u9078\u629E","pivot.preset.save":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.delete":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u524A\u9664","pivot.preset.saveDialogTitle":"\u73FE\u5728\u306E\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.nameLabel":"\u30D7\u30EA\u30BB\u30C3\u30C8\u540D","pivot.preset.defaultName":"\u30D7\u30EA\u30BB\u30C3\u30C8 {index}","pivot.table.sectionTitle":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u5C55\u958B","pivot.table.collapse.ariaCollapse":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u6298\u308A\u305F\u305F\u3080","pivot.chart.title":"\u30D4\u30DC\u30C3\u30C8\u30C1\u30E3\u30FC\u30C8","pivot.chart.subtitle":"1\u3064\u306E\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u6700\u59272\u3064\u306E\u6307\u6A19\u3092\u30B3\u30F3\u30D1\u30AF\u30C8\u306A\u30C1\u30E3\u30FC\u30C8\u306B\u307E\u3068\u3081\u307E\u3059\u3002","pivot.chart.subtitleReady":"{dimension} \u3054\u3068\u306E {measure}","pivot.chart.emptyNoDimension":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u884C\u307E\u305F\u306F\u5217\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoValue":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoData":"\u73FE\u5728\u306E\u30C1\u30E3\u30FC\u30C8\u9078\u629E\u3067\u306F\u8868\u793A\u3067\u304D\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002","pivot.chart.dimension":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.chart.primaryMeasure":"\u6307\u6A19","pivot.chart.secondaryMeasure":"\u6BD4\u8F03\u6307\u6A19","pivot.chart.chartType":"\u30C1\u30E3\u30FC\u30C8\u7A2E\u5225","pivot.chart.style.barVertical":"\u7E26\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.barHorizontal":"\u6A2A\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.line":"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5","pivot.chart.style.scatter":"\u6563\u5E03\u56F3","pivot.chart.collapse.ariaExpand":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u5C55\u958B","pivot.chart.collapse.ariaCollapse":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u6298\u308A\u305F\u305F\u3080","smartFilter.adaptFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8ABF\u6574","smartFilter.addFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8FFD\u52A0","smartFilter.go":"\u5B9F\u884C","smartFilter.visibleFilters":"\u8868\u793A\u30D5\u30A3\u30EB\u30BF\u30FC","smartFilter.searchPlaceholder":"\u691C\u7D22...","smartFilter.noOptionsFound":"\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","smartFilter.min":"\u6700\u5C0F","smartFilter.max":"\u6700\u5927","smartFilter.minMaxPlaceholder":"\u6700\u5C0F - \u6700\u5927","smartFilter.operator.equals":"\u7B49\u3057\u3044","smartFilter.operator.contains":"\u542B\u3080","smartFilter.operator.notContains":"\u542B\u307E\u306A\u3044","smartFilter.operator.wildcard":"\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u691C\u7D22","smartFilter.operator.notEquals":"\u7B49\u3057\u304F\u306A\u3044","smartFilter.operator.greaterThan":"\u3088\u308A\u5927\u304D\u3044","smartFilter.operator.lessThan":"\u3088\u308A\u5C0F\u3055\u3044","smartFilter.operator.greaterOrEqual":"\u4EE5\u4E0A","smartFilter.operator.lessOrEqual":"\u4EE5\u4E0B","smartFilter.operator.between":"\u7BC4\u56F2","variant.noOptions":"\u30AA\u30D7\u30B7\u30E7\u30F3\u306A\u3057","variant.defaultSuffix":"\u30C7\u30D5\u30A9\u30EB\u30C8","variant.selectVariant":"\u30D3\u30E5\u30FC\u3092\u9078\u629E","variant.saveView":"\u30D3\u30E5\u30FC\u4FDD\u5B58","variant.newVariant":"\u65B0\u3057\u3044\u30D3\u30E5\u30FC","variant.viewName":"\u30D3\u30E5\u30FC\u540D","variant.setDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","variant.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\uFF09","variant.toast.fetchFailed":"\u30D3\u30E5\u30FC\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveFailed":"\u30D3\u30E5\u30FC\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveSuccess":"\u30D3\u30E5\u30FC\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","variant.toast.deleteFailed":"\u30D3\u30E5\u30FC\u306E\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.deleteSuccess":"\u30D3\u30E5\u30FC\u3092\u524A\u9664\u3057\u307E\u3057\u305F","variant.toast.defaultFailed":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F","layout.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","layout.layoutOptions":"\u30EC\u30A4\u30A2\u30A6\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3","layout.selectLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u9078\u629E","layout.saveCurrentLayout":"\u73FE\u5728\u306E\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58...","layout.noSavedLayouts":"\u4FDD\u5B58\u6E08\u307F\u30EC\u30A4\u30A2\u30A6\u30C8\u306A\u3057","layout.removeDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u89E3\u9664","layout.setAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","layout.layoutName":"\u30EC\u30A4\u30A2\u30A6\u30C8\u540D","layout.layoutDescription":"\u8AAC\u660E","layout.layoutNameHelper":"\u4F8B\uFF1A\u30B3\u30F3\u30D1\u30AF\u30C8\u8868\u793A","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u65E2\u5B58\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059","layout.useAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3068\u3057\u3066\u4F7F\u7528","layout.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\uFF09","layout.toast.loadFallback":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u304B\u3089\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u3001\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u306B\u5207\u308A\u66FF\u3048\u307E\u3057\u305F","layout.toast.saveSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.saveLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableSavedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.deleteSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.deleteLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDeletedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.defaultLocalSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDefaultLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","dateRange.label":"\u65E5\u4ED8\u7BC4\u56F2","dateRange.startDate":"\u958B\u59CB\u65E5","dateRange.endDate":"\u7D42\u4E86\u65E5","dateRange.select":"\u9078\u629E...","dateRange.today":"\u4ECA\u65E5","dateRange.thisWeek":"\u4ECA\u9031","dateRange.thisMonth":"\u4ECA\u6708","graph.records":"{count} \u4EF6","graph.kpi.totalRecords":"\u7DCF\u30EC\u30B3\u30FC\u30C9","graph.kpi.totalReport":"\u7DCF\u5831\u544A\u6642\u9593","graph.kpi.totalBillable":"\u7DCF\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.kpi.efficiency":"\u52B9\u7387","graph.kpi.amount":"\u91D1\u984D","graph.kpi.flagged":"\u8981\u78BA\u8A8D","graph.chart.billable.title":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u5225\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.chart.billable.subtitle":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593\u306E\u4E0A\u4F4D","graph.chart.efficiency.title":"\u62C5\u5F53\u8005\u5225\u52B9\u7387","graph.chart.efficiency.subtitle":"\u52B9\u7387\u306E\u4F4E\u3044\u9806","graph.chart.status.title":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5206\u5E03","graph.chart.status.subtitle":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5225\u6BD4\u7387","graph.dataBody":"\u30C7\u30FC\u30BF\u672C\u4F53","graph.reportTitle":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","graph.unassigned":"\u672A\u5272\u308A\u5F53\u3066","graph.column.reportHours":"\u5831\u544A\u6642\u9593","graph.column.billableHours":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","detail.searchAi.placeholder":"\u9805\u76EE\u3092\u691C\u7D22\u3002\u898B\u3064\u304B\u3089\u306A\u3044\u5834\u5408\u306FAI\u306B\u8CEA\u554F\u3057\u307E\u3059...","detail.searchAi.matches":"{count} \u4EF6\u306E\u4E00\u81F4","detail.searchAi.noMatch":"\u4E00\u81F4\u3059\u308B\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002","detail.searchAi.autoAiFallback":"\u4E00\u81F4\u306A\u3057\u3002AI\u5206\u6790\u3092\u5B9F\u884C\u3057\u307E\u3059...","detail.searchAi.aiResultTitle":"AI\u5206\u6790\u7D50\u679C","detail.table.title":"\u95A2\u9023\u30EC\u30B3\u30FC\u30C9","kanban.empty":"\u3053\u3053\u306B\u30AB\u30FC\u30C9\u3092\u30C9\u30ED\u30C3\u30D7","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u96E2\u3059\u3068\u3053\u306E bucket \u306B\u79FB\u52D5\u3057\u307E\u3059","kanban.bucket.add":"bucket \u3092\u8FFD\u52A0","kanban.bucket.rename":"bucket \u540D\u3092\u5909\u66F4","kanban.bucket.saveRename":"bucket \u540D\u3092\u4FDD\u5B58","kanban.bucket.cancelRename":"\u540D\u524D\u5909\u66F4\u3092\u30AD\u30E3\u30F3\u30BB\u30EB","kanban.search.placeholder":"\u30AB\u30FC\u30C9\u3068 bucket \u3092\u691C\u7D22","kanban.search.clear":"\u691C\u7D22\u3092\u30AF\u30EA\u30A2","kanban.search.results":"{count} \u4EF6\u306E\u30AB\u30FC\u30C9\u304C\u4E00\u81F4","kanban.search.noMatch":"\u4E00\u81F4\u3059\u308B\u30AB\u30FC\u30C9\u306F\u3042\u308A\u307E\u305B\u3093","kanban.card.progress":"\u9032\u6357","kanban.card.openDetail":"\u8A73\u7D30\u3092\u958B\u304F","kanban.priority.critical":"\u7DCA\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u898F\u4F5C\u6210","quickCreate.createWithTitle":"{title} \u3092\u4F5C\u6210","quickEdit.editWithTitle":"{title} \u3092\u7DE8\u96C6","quickDelete.confirmTitle":"\u524A\u9664\u306E\u78BA\u8A8D","quickDelete.confirmMessageSingle":"\u9078\u629E\u3057\u305F\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","quickDelete.confirmMessageMultiple":"\u9078\u629E\u3057\u305F {count} \u4EF6\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","cardPage.viewDetails":"\u8A73\u7D30\u3092\u8868\u793A","cardPage.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","cardPage.close":"\u9589\u3058\u308B","cardPage.empty":"\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","messageBox.confirm":"OK","messageBox.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB"},pb={"common.cancel":"\uCDE8\uC18C","common.save":"\uC800\uC7A5","common.ok":"\uD655\uC778","common.done":"\uC644\uB8CC","common.search":"\uAC80\uC0C9","common.none":"\uC5C6\uC74C","common.all":"\uC804\uCCB4","common.noData":"\uB370\uC774\uD130 \uC5C6\uC74C","common.copy":"\uBCF5\uC0AC","common.delete":"\uC0AD\uC81C","common.loading":"\uB85C\uB529 \uC911...","header.searchPlaceholder":"\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...","header.searchAddFeature":"\uAE30\uB2A5 \uCD94\uAC00","header.searchSend":"\uBCF4\uB0B4\uAE30","header.searchStartVoice":"\uC74C\uC131 \uC785\uB825 \uC2DC\uC791","header.searchStopVoice":"\uC74C\uC131 \uC785\uB825 \uC911\uC9C0","header.theme.system":"\uD14C\uB9C8: \uC2DC\uC2A4\uD15C","header.theme.dark":"\uD14C\uB9C8: \uB2E4\uD06C","header.theme.light":"\uD14C\uB9C8: \uB77C\uC774\uD2B8","header.menu.setting":"\uC124\uC815","header.menu.refresh":"\uC0C8\uB85C \uACE0\uCE68","header.menu.logout":"\uB85C\uADF8\uC544\uC6C3","navigation.expand":"\uD0D0\uC0C9 \uD3BC\uCE58\uAE30","navigation.collapse":"\uD0D0\uC0C9 \uC811\uAE30","navigation.searchPlaceholder":"\uBA54\uB274 \uAC80\uC0C9...","navigation.noMatch":"\uC77C\uCE58\uD558\uB294 \uBA54\uB274\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noAccessibleApp":"\uC811\uADFC \uAC00\uB2A5\uD55C \uC571\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noItems":"\uD45C\uC2DC\uD560 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.expandView":"{title} \uD3BC\uCE58\uAE30","navigation.mode.switchToFixed":"\uACE0\uC815 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.mode.switchToFloating":"\uD50C\uB85C\uD305 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.pinned":"\uACE0\uC815\uB428","navigation.pin.add":"\uC0C1\uB2E8\uC5D0 \uACE0\uC815","navigation.pin.remove":"\uACE0\uC815 \uD574\uC81C","table.toolbar.searchPlaceholder":"\uAC80\uC0C9...","table.title.default":"\uB370\uC774\uD130 \uD14C\uC774\uBE14","table.toolbar.groupBy":"\uADF8\uB8F9","table.toolbar.summary":"\uC694\uC57D","table.toolbar.columns":"\uC5F4","table.toolbar.export":"\uB0B4\uBCF4\uB0B4\uAE30","table.toolbar.itemsPerPage":"\uD398\uC774\uC9C0\uB2F9 \uD589 \uC218:","table.toolbar.pageOf":"{current} / {total} \uD398\uC774\uC9C0","table.toolbar.newItem":"\uC2E0\uADDC \uD56D\uBAA9","table.toolbar.editItem":"\uD56D\uBAA9 \uC218\uC815","table.toolbar.deleteItem":"\uD56D\uBAA9 \uC0AD\uC81C","table.toolbar.graphicReport":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","table.toolbar.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","table.menu.groupBy":"\uADF8\uB8F9","table.menu.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.menu.visibleColumns":"\uD45C\uC2DC \uC5F4","table.menu.showSummaryRow":"\uC694\uC57D \uD589 \uD45C\uC2DC","table.menu.noNumericColumns":"\uC22B\uC790 \uC5F4 \uC5C6\uC74C","table.group.expandAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uD3BC\uCE58\uAE30","table.group.collapseAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uC811\uAE30","table.mobile.notImplemented":"\uBAA8\uBC14\uC77C \uBDF0\uB294 \uC544\uC9C1 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4","table.headerMenu.sortAsc":"\uC624\uB984\uCC28\uC21C \uC815\uB82C","table.headerMenu.sortDesc":"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C","table.headerMenu.clearSort":"\uC815\uB82C \uD574\uC81C","table.headerMenu.configureSort":"\uC815\uB82C \uC124\uC815...","table.headerMenu.group":"\uC774 \uC5F4\uB85C \uADF8\uB8F9\uD654","table.headerMenu.ungroup":"\uADF8\uB8F9\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.addSummary":"\uC694\uC57D\uC5D0 \uCD94\uAC00","table.headerMenu.removeSummary":"\uC694\uC57D\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.hideColumn":"\uC5F4 \uC228\uAE30\uAE30","table.sortDialog.title":"\uC815\uB82C \uC124\uC815","table.sortDialog.empty":"\uC815\uB82C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uCD94\uAC00\uD558\uC138\uC694.","table.sortDialog.addRule":"\uADDC\uCE59 \uCD94\uAC00","table.sortDialog.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.sortDialog.asc":"\uC624\uB984\uCC28\uC21C","table.sortDialog.desc":"\uB0B4\uB9BC\uCC28\uC21C","pivot.title.default":"\uD53C\uBC97 \uD14C\uC774\uBE14","pivot.subtitle.default":"\uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD53C\uBC97 \uD14C\uC774\uBE14\uC744 \uAD6C\uC131\uD558\uC138\uC694.","pivot.empty":"\uACB0\uACFC\uB97C \uBCF4\uB824\uBA74 \uAC12 \uC601\uC5ED\uC5D0 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.records":"\uB808\uCF54\uB4DC","pivot.afterFilter":"\uD544\uD130 \uD6C4","pivot.grandTotal":"\uCD1D\uD569","pivot.resultLabel":"\uACB0\uACFC","pivot.valueLabel":"\uAC12","pivot.table.dimensions":"\uCC28\uC6D0","pivot.config.title":"\uAD6C\uC131","pivot.fieldList":"\uD544\uB4DC \uBAA9\uB85D","pivot.availableDimensions":"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCC28\uC6D0","pivot.allFieldsInUse":"\uBAA8\uB4E0 \uD544\uB4DC\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC785\uB2C8\uB2E4.","pivot.zone.rows":"\uD589","pivot.zone.columns":"\uC5F4","pivot.zone.filters":"\uD544\uD130","pivot.zone.values":"\uAC12","pivot.hint.rows":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD589 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.columns":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uC5F4 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.filters":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uBCF4\uACE0\uC11C \uD544\uD130\uB85C \uC0AC\uC6A9","pivot.hint.values":"\uC22B\uC790 \uD544\uB4DC\uB97C \uC5EC\uAE30\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC9D1\uACC4","pivot.clearArea":"\uC601\uC5ED \uBE44\uC6B0\uAE30","pivot.filter.na":"\uD574\uB2F9 \uC5C6\uC74C","pivot.filter.noValues":"\uAC12 \uC5C6\uC74C","pivot.filter.noneSelected":"\uC120\uD0DD \uC5C6\uC74C","pivot.filter.allValues":"\uBAA8\uB4E0 \uAC12","pivot.filter.selectedCount":"{selected} / {total} \uC120\uD0DD\uB428","pivot.filter.selectAll":"\uC804\uCCB4 \uC120\uD0DD","pivot.filter.deselectAll":"\uC804\uCCB4 \uD574\uC81C","pivot.filter.noResults":"\uAC80\uC0C9 \uACB0\uACFC \uC5C6\uC74C","pivot.collapse.ariaExpand":"\uAD6C\uC131 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.collapse.ariaCollapse":"\uAD6C\uC131 \uC601\uC5ED \uC811\uAE30","pivot.agg.sum":"\uD569\uACC4","pivot.agg.count":"\uAC1C\uC218","pivot.agg.avg":"\uD3C9\uADE0","pivot.agg.min":"\uCD5C\uC18C","pivot.agg.max":"\uCD5C\uB300","pivot.preset.selectPlaceholder":"\uD504\uB9AC\uC14B \uC120\uD0DD","pivot.preset.save":"\uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.delete":"\uD504\uB9AC\uC14B \uC0AD\uC81C","pivot.preset.saveDialogTitle":"\uD604\uC7AC \uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.nameLabel":"\uD504\uB9AC\uC14B \uC774\uB984","pivot.preset.defaultName":"\uD504\uB9AC\uC14B {index}","pivot.table.sectionTitle":"\uD53C\uBC97 \uACB0\uACFC","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\uD53C\uBC97 \uACB0\uACFC \uD3BC\uCE58\uAE30","pivot.table.collapse.ariaCollapse":"\uD53C\uBC97 \uACB0\uACFC \uC811\uAE30","pivot.chart.title":"\uD53C\uBC97 \uCC28\uD2B8","pivot.chart.subtitle":"\uD558\uB098\uC758 \uCC28\uC6D0\uACFC \uCD5C\uB300 \uB450 \uAC1C\uC758 \uCE21\uC815\uAC12\uC744 \uAC04\uACB0\uD55C \uCC28\uD2B8\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4.","pivot.chart.subtitleReady":"{dimension}\uBCC4 {measure}","pivot.chart.emptyNoDimension":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD589 \uB610\uB294 \uC5F4 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoValue":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uAC12 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoData":"\uD604\uC7AC \uCC28\uD2B8 \uC120\uD0DD\uC5D0 \uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.","pivot.chart.dimension":"\uCC28\uD2B8 \uCC28\uC6D0","pivot.chart.primaryMeasure":"\uC8FC \uCE21\uC815\uAC12","pivot.chart.secondaryMeasure":"\uBE44\uAD50 \uCE21\uC815\uAC12","pivot.chart.chartType":"\uCC28\uD2B8 \uC720\uD615","pivot.chart.style.barVertical":"\uC138\uB85C \uB9C9\uB300","pivot.chart.style.barHorizontal":"\uAC00\uB85C \uB9C9\uB300","pivot.chart.style.line":"\uC120\uD615 \uCC28\uD2B8","pivot.chart.style.scatter":"\uC0B0\uC810\uB3C4","pivot.chart.collapse.ariaExpand":"\uCC28\uD2B8 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.chart.collapse.ariaCollapse":"\uCC28\uD2B8 \uC601\uC5ED \uC811\uAE30","smartFilter.adaptFilters":"\uD544\uD130 \uC870\uC815","smartFilter.addFilters":"\uD544\uD130 \uCD94\uAC00","smartFilter.go":"\uC2E4\uD589","smartFilter.visibleFilters":"\uD45C\uC2DC \uD544\uD130","smartFilter.searchPlaceholder":"\uAC80\uC0C9...","smartFilter.noOptionsFound":"\uC635\uC158\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","smartFilter.min":"\uCD5C\uC18C","smartFilter.max":"\uCD5C\uB300","smartFilter.minMaxPlaceholder":"\uCD5C\uC18C - \uCD5C\uB300","smartFilter.operator.equals":"\uAC19\uC74C","smartFilter.operator.contains":"\uD3EC\uD568","smartFilter.operator.notContains":"\uBBF8\uD3EC\uD568","smartFilter.operator.wildcard":"\uC640\uC77C\uB4DC\uCE74\uB4DC \uAC80\uC0C9","smartFilter.operator.notEquals":"\uAC19\uC9C0 \uC54A\uC74C","smartFilter.operator.greaterThan":"\uBCF4\uB2E4 \uD07C","smartFilter.operator.lessThan":"\uBCF4\uB2E4 \uC791\uC74C","smartFilter.operator.greaterOrEqual":"\uC774\uC0C1","smartFilter.operator.lessOrEqual":"\uC774\uD558","smartFilter.operator.between":"\uBC94\uC704","variant.noOptions":"\uC635\uC158 \uC5C6\uC74C","variant.defaultSuffix":"\uAE30\uBCF8","variant.selectVariant":"\uBDF0 \uC120\uD0DD","variant.saveView":"\uBDF0 \uC800\uC7A5","variant.newVariant":"\uC0C8 \uBDF0","variant.viewName":"\uBDF0 \uC774\uB984","variant.setDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","variant.publicAllUsers":"\uACF5\uAC1C(\uC804\uCCB4 \uC0AC\uC6A9\uC790)","variant.toast.fetchFailed":"\uBDF0\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveFailed":"\uBDF0\uB97C \uC800\uC7A5\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveSuccess":"\uBDF0\uAC00 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.deleteFailed":"\uBDF0\uB97C \uC0AD\uC81C\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.deleteSuccess":"\uBDF0\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.defaultFailed":"\uAE30\uBCF8 \uBDF0\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.defaultSuccess":"\uAE30\uBCF8 \uBDF0\uAC00 \uC5C5\uB370\uC774\uD2B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","layout.layoutOptions":"\uB808\uC774\uC544\uC6C3 \uC635\uC158","layout.selectLayout":"\uB808\uC774\uC544\uC6C3 \uC120\uD0DD","layout.saveCurrentLayout":"\uD604\uC7AC \uB808\uC774\uC544\uC6C3 \uC800\uC7A5...","layout.noSavedLayouts":"\uC800\uC7A5\uB41C \uB808\uC774\uC544\uC6C3 \uC5C6\uC74C","layout.removeDefault":"\uAE30\uBCF8 \uD574\uC81C","layout.setAsDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","layout.layoutName":"\uB808\uC774\uC544\uC6C3 \uC774\uB984","layout.layoutDescription":"\uC124\uBA85","layout.layoutNameHelper":"\uC608: \uCEF4\uD329\uD2B8 \uBDF0","layout.warningOverwrite":"\uACBD\uACE0: \uAE30\uC874 \uB808\uC774\uC544\uC6C3\uC774 \uB36E\uC5B4\uC4F0\uAE30 \uB429\uB2C8\uB2E4","layout.useAsDefault":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC73C\uB85C \uC0AC\uC6A9","layout.publicAllUsers":"\uACF5\uAC1C(\uBAA8\uB4E0 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uD45C\uC2DC)","layout.toast.loadFallback":"\uBC31\uC5D4\uB4DC\uC5D0\uC11C \uB808\uC774\uC544\uC6C3\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD574 \uB85C\uCEEC \uC800\uC7A5\uC18C\uB85C \uC804\uD658\uD588\uC2B5\uB2C8\uB2E4","layout.toast.saveSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.saveLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableSavedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","layout.toast.deleteSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.deleteLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0\uC11C \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDeletedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0\uC11C \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4","layout.toast.defaultSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.defaultLocalSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC\uC5D0 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDefaultLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uAE30\uBCF8\uAC12\uC744 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","dateRange.label":"\uB0A0\uC9DC \uBC94\uC704","dateRange.startDate":"\uC2DC\uC791\uC77C","dateRange.endDate":"\uC885\uB8CC\uC77C","dateRange.select":"\uC120\uD0DD...","dateRange.today":"\uC624\uB298","dateRange.thisWeek":"\uC774\uBC88 \uC8FC","dateRange.thisMonth":"\uC774\uBC88 \uB2EC","graph.records":"{count}\uAC74","graph.kpi.totalRecords":"\uCD1D \uB808\uCF54\uB4DC","graph.kpi.totalReport":"\uCD1D \uBCF4\uACE0 \uC2DC\uAC04","graph.kpi.totalBillable":"\uCD1D \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.kpi.efficiency":"\uD6A8\uC728","graph.kpi.amount":"\uAE08\uC561","graph.kpi.flagged":"\uD50C\uB798\uADF8","graph.chart.billable.title":"\uCC28\uC6D0\uBCC4 \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.chart.billable.subtitle":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04 \uC0C1\uC704 \uAC12","graph.chart.efficiency.title":"\uB2F4\uB2F9\uC790\uBCC4 \uD6A8\uC728","graph.chart.efficiency.subtitle":"\uB0AE\uC740 \uD6A8\uC728 \uC6B0\uC120","graph.chart.status.title":"\uC0C1\uD0DC \uBD84\uD3EC","graph.chart.status.subtitle":"\uC0C1\uD0DC\uBCC4 \uBE44\uC728","graph.dataBody":"\uB370\uC774\uD130 \uBCF8\uBB38","graph.reportTitle":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","graph.unassigned":"\uBBF8\uC9C0\uC815","graph.column.reportHours":"\uBCF4\uACE0 \uC2DC\uAC04","graph.column.billableHours":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","detail.searchAi.placeholder":"\uD544\uB4DC\uB97C \uAC80\uC0C9\uD558\uACE0, \uACB0\uACFC\uAC00 \uC5C6\uC73C\uBA74 AI\uC5D0 \uC9C8\uBB38\uD558\uC138\uC694...","detail.searchAi.matches":"{count}\uAC1C \uC77C\uCE58 \uD56D\uBAA9","detail.searchAi.noMatch":"\uC77C\uCE58\uD558\uB294 \uD544\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","detail.searchAi.autoAiFallback":"\uC77C\uCE58 \uD56D\uBAA9\uC774 \uC5C6\uC5B4 AI \uBD84\uC11D\uC744 \uC2E4\uD589\uD569\uB2C8\uB2E4...","detail.searchAi.aiResultTitle":"AI \uBD84\uC11D \uACB0\uACFC","detail.table.title":"\uAD00\uB828 \uB808\uCF54\uB4DC","kanban.empty":"\uC5EC\uAE30\uC5D0 \uCE74\uB4DC\uB97C \uB193\uC73C\uC138\uC694","kanban.bucket.limit":"\uD55C\uB3C4","kanban.bucket.dropHere":"\uB193\uC73C\uBA74 \uC774 \uBC84\uD0B7\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4","kanban.bucket.add":"\uBC84\uD0B7 \uCD94\uAC00","kanban.bucket.rename":"\uBC84\uD0B7 \uC774\uB984 \uBCC0\uACBD","kanban.bucket.saveRename":"\uBC84\uD0B7 \uC774\uB984 \uC800\uC7A5","kanban.bucket.cancelRename":"\uC774\uB984 \uBCC0\uACBD \uCDE8\uC18C","kanban.search.placeholder":"\uCE74\uB4DC \uBC0F \uBC84\uD0B7 \uAC80\uC0C9","kanban.search.clear":"\uAC80\uC0C9 \uC9C0\uC6B0\uAE30","kanban.search.results":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC {count}\uAC1C","kanban.search.noMatch":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","kanban.card.progress":"\uC9C4\uD589\uB960","kanban.card.openDetail":"\uC0C1\uC138 \uC5F4\uAE30","kanban.priority.critical":"\uAE34\uAE09","kanban.priority.high":"\uB192\uC74C","kanban.priority.medium":"\uBCF4\uD1B5","kanban.priority.low":"\uB0AE\uC74C","quickCreate.newItem":"\uC2E0\uADDC \uD56D\uBAA9","quickCreate.createWithTitle":"{title} \uC0DD\uC131","quickEdit.editWithTitle":"{title} \uC218\uC815","quickDelete.confirmTitle":"\uC0AD\uC81C \uD655\uC778","quickDelete.confirmMessageSingle":"\uC120\uD0DD\uD55C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","quickDelete.confirmMessageMultiple":"\uC120\uD0DD\uD55C {count}\uAC1C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","cardPage.viewDetails":"\uC0C1\uC138 \uBCF4\uAE30","cardPage.download":"\uB2E4\uC6B4\uB85C\uB4DC","cardPage.close":"\uB2EB\uAE30","cardPage.empty":"\uD56D\uBAA9\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","messageBox.confirm":"\uD655\uC778","messageBox.cancel":"\uCDE8\uC18C"},Kn={en:ib,zh:sb,fr:lb,de:cb,ja:db,ko:pb};T();var od=(t,r)=>r?t.replace(/\{(\w+)\}/g,(o,n)=>{let a=r[n];return a==null?"":String(a)}):t,fb={locale:"en",t:(t,r)=>od(Kn.en[t]||t,r)},nd=Jt.createContext(fb),_a=({locale:t="en",messages:r,children:o})=>{let n=Jt.useMemo(()=>{let a=Kn[t]||Kn.en,i=r?.[t]||{},s={...Kn.en,...a,...i};return {locale:t,t:(l,d)=>od(s[l]||l,d)}},[t,r]);return e(nd.Provider,{value:n,children:o})},pe=()=>Jt.useContext(nd);T();function qn({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]=Jt.useState(false),[y,g]=Jt.useState(new Set),x=a!==void 0&&i!==void 0,h=x?a:y;Jt.useEffect(()=>{v(true);},[]);let C=w=>{if(x)i(w);else {let k=new Set(y);k.has(w)?k.delete(w):k.add(w),g(k);}},P=w=>{w.children&&w.children.length>0&&C(w.id),r&&r(w);};return !t||!Array.isArray(t)?e("div",{className:fr("tree-menu",o),children:e("div",{className:"text-sm text-[var(--orb-muted)] p-2",children:p("navigation.noItems")})}):e("div",{className:fr("tree-menu",o),children:t.map(w=>{let k=h.has(w.id)||w.isExpanded,I=w.children&&w.children.length>0,E=56+Math.max(0,n-1)*8,D=n===0?12:I?E-24:E,R=w.appurl||w.href,A=m&&R?b===R:false,N=d?.has(w.id)??false,O=l&&w.pinnable!==false&&!!R&&!I;return c("div",{className:"tree-menu-item relative",children:[A&&e("div",{className:fr("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10","bg-[var(--orb-nav-active-fg)]")}),c(_s,{variant:"ghost",className:fr("w-full justify-start h-auto py-2 relative overflow-hidden group",n>0?"gap-1":"gap-2",I&&k&&!A?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",A?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:`${D}px`,paddingRight:O?"34px":"10px"},onClick:()=>P(w),children:[I&&e("div",{className:fr("flex-shrink-0 transition-transform duration-200",k&&"rotate-90",A?"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:fr("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",A?"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:fr("text-sm truncate transition-colors duration-200",A?"font-semibold":"font-medium"),children:w.title||w.label}),w.description&&e("div",{className:fr("text-xs truncate transition-colors duration-200",A?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(N?"navigation.pin.remove":"navigation.pin.add"),"aria-pressed":N,title:p(N?"navigation.pin.remove":"navigation.pin.add"),onClick:F=>{F.preventDefault(),F.stopPropagation(),u(w);},className:fr("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",N&&"orb-is-pinned"),children:e(Jo,{className:fr("h-3.5 w-3.5",N&&"fill-current")})}),I&&e("div",{className:fr("grid transition-[grid-template-rows] duration-300 ease-in-out",k?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:e("div",{className:fr("overflow-hidden",k&&"pt-1"),children:e(qn,{items:w.children,onItemClick:r,level:n+1,expandedIds:a,onToggleExpand:i,colorMode:s,enablePinning:l,pinnedIds:d,onTogglePin:u})})})]},w.id)})})}T();var yb="orbcafe:navigation-island:pinned-items",Us="orbcafe-navigation-pinned",Cb=t=>t.appurl||t.href,id=t=>{let r=[];return t.forEach(o=>{let n=!!o.children?.length;o.pinnable!==false&&Cb(o)&&!n&&r.push({...o,children:void 0}),o.children?.length&&r.push(...id(o.children));}),r},sd=({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=yb,pinnedItemIds:f,defaultPinnedItemIds:b=[],onPinnedItemIdsChange:m,pinnedSectionTitle:v})=>{let{t:y}=pe(),g=i==="dark",x=s==="floating",h=navigation.useRouter(),[C,P]=Jt.useState(""),[w,k]=Jt.useState(new Set),[I,S]=Jt.useState(b),[E,D]=Jt.useState(false),R=f!==void 0,A=Jt.useMemo(()=>f??I,[f,I]),N=Jt.useMemo(()=>new Set(A),[A]);Jt.useEffect(()=>{t&&k(new Set);},[t]),Jt.useEffect(()=>{if(!u||R){D(true);return}try{let B=window.localStorage.getItem(p);if(B){let Z=JSON.parse(B);Array.isArray(Z)&&S(Z.filter(Q=>typeof Q=="string"));}}catch{}finally{D(true);}},[u,R,p]),Jt.useEffect(()=>{if(!(!u||R||!E))try{window.localStorage.setItem(p,JSON.stringify(A));}catch{}},[A,u,R,p,E]),Jt.useEffect(()=>{!u||t||A.length===0||k(B=>{if(B.has(Us))return B;let Z=new Set(B);return Z.add(Us),Z});},[t,A.length,u]);let O=Jt.useCallback(B=>{let Z=Array.from(new Set(B));R||S(Z),m?.(Z);},[R,m]),F=Jt.useCallback(B=>{let Z=B.id,Q=N.has(Z)?A.filter(ge=>ge!==Z):[...A,Z];O(Q);},[A,N,O]),q=Jt.useMemo(()=>{if(!u||A.length===0)return a;let B=new Map(id(a).map(Q=>[Q.id,Q])),Z=A.map(Q=>B.get(Q)).filter(Q=>!!Q);return Z.length===0?a:[{id:Us,title:v||y("navigation.pinned"),icon:e(Jo,{className:"w-4 h-4"}),children:Z,pinnable:false},...a]},[A,u,a,v,y]),z=Jt.useCallback(B=>{let Z=[],Q=ge=>{ge.forEach(se=>{Z.push(se.id),se.children&&Q(se.children);});};return Q(B),Z},[]),X=Jt.useMemo(()=>{if(!C.trim())return q;let B=Z=>Z.reduce((Q,ge)=>{let se=ge.title?.toLowerCase().includes(C.toLowerCase())||ge.description?.toLowerCase().includes(C.toLowerCase()),le=ge.children?B(ge.children):[];return (se||le.length>0)&&Q.push({...ge,children:le.length>0?le:ge.children}),Q},[]);return B(q)},[C,q]),$=Jt.useMemo(()=>C.trim()?new Set(z(q)):w,[C,q,w,z]),_=Jt.useCallback(async B=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",B),B.id==="chat"||B.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{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 Z=B.appurl||B.href;Z&&(Z.startsWith("http://")||Z.startsWith("https://")?window.open(Z,"_blank"):h.push(Z));},[h]),V=Jt.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:B=>P(B.target.value),className:`w-full pl-10 pr-4 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:border-transparent ${g?"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:X.length===0?e("div",{className:"flex items-center justify-center py-8 text-[var(--orb-muted)] text-sm",children:t?e(Bn,{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(qn,{items:X,onItemClick:_,className:"space-y-1",expandedIds:$,colorMode:i,enablePinning:u,pinnedIds:N,onTogglePin:F,onToggleExpand:B=>{let Z=new Set(w);X.some(ge=>ge.id===B)?Z.has(B)?Z.delete(B):(X.forEach(ge=>{ge.id!==B&&Z.has(ge.id)&&Z.delete(ge.id);}),Z.add(B)):Z.has(B)?Z.delete(B):Z.add(B),k(Z);}})}),t&&e("div",{className:"space-y-2",children:q.map(B=>e("div",{className:"space-y-1",children:e("button",{onClick:()=>{r();let Z=new Set([B.id]);k(Z);},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:B.title||""}),children:B.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:B.title?.charAt(0)||"?"})})},B.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(La,{className:"h-4 w-4"}):e(Oa,{className:"h-4 w-4"})})]})};T();var Sb="orbcafe:navigation-island:pinned-items",Ks="orbcafe-navigation-pinned",ld=t=>t.appurl||t.href,cd=t=>t.flatMap(r=>{let o=!!r.children?.length,n=r.pinnable!==false&&ld(r)&&!o?[{...r,children:void 0}]:[];return r.children?.length?[...n,...cd(r.children)]:n}),dd=t=>t.flatMap(r=>[r.id,...r.children?dd(r.children):[]]),pd=(t,r)=>t.reduce((o,n)=>{let a=n.children?pd(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},[]),qs=({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=Sb,pinnedItemIds:f,defaultPinnedItemIds:b=[],onPinnedItemIdsChange:m,pinnedSectionTitle:v})=>{let{t:y}=pe(),g=navigation.useRouter(),x=s==="floating",[h,C]=Jt.useState(""),[P,w]=Jt.useState(new Set),[k,I]=Jt.useState(b),[S,E]=Jt.useState(false),D=f!==void 0,R=f??k,A=Jt.useMemo(()=>new Set(R),[R]);Jt.useEffect(()=>{t&&w(new Set);},[t]),Jt.useEffect(()=>{if(!u||D){E(true);return}try{let B=window.localStorage.getItem(p);if(B){let Z=JSON.parse(B);Array.isArray(Z)&&I(Z.filter(Q=>typeof Q=="string"));}}catch{}finally{E(true);}},[u,D,p]),Jt.useEffect(()=>{if(!(!u||D||!S))try{window.localStorage.setItem(p,JSON.stringify(R));}catch{}},[R,u,D,p,S]),Jt.useEffect(()=>{!u||t||R.length===0||w(B=>{if(B.has(Ks))return B;let Z=new Set(B);return Z.add(Ks),Z});},[t,R.length,u]);let N=Jt.useCallback(B=>{let Z=Array.from(new Set(B));D||I(Z),m?.(Z);},[D,m]),O=Jt.useCallback(B=>{N(A.has(B.id)?R.filter(Z=>Z!==B.id):[...R,B.id]);},[R,A,N]),F=Jt.useMemo(()=>{if(!u||R.length===0)return a;let B=new Map(cd(a).map(Q=>[Q.id,Q])),Z=R.map(Q=>B.get(Q)).filter(Q=>!!Q);return Z.length===0?a:[{id:Ks,title:v||y("navigation.pinned"),icon:e(Jo,{className:"h-4 w-4"}),children:Z,pinnable:false},...a]},[R,u,a,v,y]),q=h.trim().toLocaleLowerCase(),z=Jt.useMemo(()=>q?pd(F,q):F,[F,q]),X=Jt.useMemo(()=>q?new Set(dd(z)):P,[P,z,q]),$=Jt.useCallback(B=>{w(Z=>{let Q=new Set(Z),ge=z.some(se=>se.id===B);return Q.has(B)?Q.delete(B):(ge&&z.forEach(se=>Q.delete(se.id)),Q.add(B)),Q});},[z]),_=Jt.useCallback(B=>{let Z=ld(B);Z&&(B.id==="chat"||B.appurl==="/chat"?g.push("/chat?new=true"):/^https?:\/\//.test(Z)?window.open(Z,"_blank","noopener,noreferrer"):g.push(Z));},[g]),V=B=>{r(),w(new Set([B.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:B=>C(B.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:z.length===0?e("div",{className:"flex items-center justify-center py-8 text-sm text-[var(--orb-muted)]",children:t?e(Bn,{className:"h-5 w-5"}):y(q?"navigation.noMatch":"navigation.noAccessibleApp")}):t?e("div",{className:"space-y-1",children:F.map(B=>e("button",{type:"button",onClick:()=>V(B),className:"flex h-10 w-full items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y("navigation.expandView",{title:B.title||B.label||""}),children:B.icon||e(Bn,{className:"h-5 w-5"})},B.id))}):e(qn,{items:z,onItemClick:_,className:"space-y-1",expandedIds:X,onToggleExpand:$,colorMode:i,enablePinning:u,pinnedIds:A,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(La,{className:"h-4 w-4"}):e(Oa,{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}})})})]})};qs.displayName="NavigationIsland2";var md=(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]=Jt.useState(r),[b,m]=Jt.useState(o),[v,y]=Jt.useState(n),g=Jt.useCallback(()=>{f(C=>!C);},[]),x=Jt.useCallback(()=>{m(C=>C==="fixed"?"floating":"fixed");},[]),h=Jt.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 Ys=class{constructor(){gc(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);}},ao=new Ys,aT={success:(t,r)=>ao.show("success",t,r),error:(t,r)=>ao.show("error",t,r),warning:(t,r)=>ao.show("warning",t,r),info:(t,r)=>ao.show("info",t,r),show:(t,r,o)=>ao.show(t,r,o),hide:()=>ao.hide()};T();var kb={success:{icon:e(Fn,{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(Da,{size:40}),color:"var(--orb-info-bg)",iconColor:"var(--orb-info)"},default:{icon:null,color:"transparent",iconColor:"inherit"}},Zn=({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=kb[u],y=u!=="default";return c(zt,{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(Ce,{onClick:n,variant:"text",children:b}),e(Ce,{onClick:m,variant:"contained",color:y&&u==="error"?"error":"primary",autoFocus:true,children:f})]})]})},mT=()=>{let[t,r]=Jt__namespace.default.useState(null),[o,n]=Jt__namespace.default.useState(false);Jt__namespace.default.useEffect(()=>{let s=l=>{l?(r(l),n(true)):(n(false),r(null));};return ao.register(s),()=>ao.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(Zn,{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};T();var vT=({status:t,showIcon:r=true})=>{let o="gray",n,a=t;return t==="OK"?(o="blue",n=e(Fn,{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(Pt,{label:a,tone:o,icon:r&&n?n:void 0})};T();var xT=({dense:t,sx:r,className:o,children:n,...a})=>e("ul",{...a,className:o,style:{listStyle:"none",margin:0,padding:0,...r},children:n}),ST=({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}),wT=({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}),kT=({children:t,sx:r})=>e("div",{style:{marginRight:16,display:"flex",alignItems:"center",minWidth:40,...r},children:t}),PT=({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})]}),TT=({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}),IT=({children:t,sx:r})=>e("div",{style:{marginRight:12,display:"flex",alignItems:"center",...r},children:t});T();var DT=({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})};Gt();T();var Ar=rt,ir=(t,r)=>Jt.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})}),ke=ir("div"),fd=ir("a","orb-link"),Bo=Ee,bd=ie,br=L;var hd=ae;var vd=At,jr=rn,Qa=tn,Ja=Wa;var ei=Va,yd=Xr,Cd=({value:t,variant:r,color:o,sx:n})=>e(Wn,{value:r==="determinate"?t:void 0,color:o,sx:n}),xd=ir("table","orb-tbl"),Sd=ir("tbody"),Qs=ir("td"),wd=ir("div","orb-table-container"),kd=ir("thead"),Js=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 io=ir("span","orb-input-adornment"),Pd=Jt.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"),jn=({control:t,label:r,...o})=>c("label",{className:"orb-form-control-label",...o,children:[t,e("span",{children:r})]}),Db=({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]}),Nb=ir("span","orb-list-item-icon"),_t=Db,zr=Nb;ir("div","orb-list-subheader");var el=({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(ke,{...u,sx:{display:t?"flex":void 0,flexWrap:t?"wrap":void 0,gap:t&&o?o:void 0,width:r?p:void 0,...d??{}}})},on=({in:t,children:r,unmountOnExit:o,...n})=>!t&&o?null:e("div",{hidden:!t,...n,children:r}),Td=({children:t,container:r})=>typeof document>"u"?null:reactDom.createPortal(t,r??document.body),Id=ir("div","orb-toolbar"),Rd=({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(Mt,{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=Jt.useRef(null);if(Jt.useEffect(()=>{if(!t)return;let x=C=>{let P=C.composedPath();b.current&&P.includes(b.current)||r&&P.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)},Md=({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)},Dd=({value:t,onChange:r,children:o,variant:n,scrollButtons:a,...i})=>e("div",{role:"tablist",className:"orb-tabs",...i,children:Jt.Children.map(o,s=>Jt.isValidElement(s)?Jt.cloneElement(s,{selected:s.props.value===t,onSelect:l=>r?.(null,l)}):s)}),Nd=({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=()=>ka(),xo=(t,r)=>Dr(t);var Ad=({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()})},Ed=({value:t,referenceDate:r,onChange:o,onMonthChange:n,onYearChange:a,minDate:i,maxDate:s,slots:l,...d})=>e(_n,{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}),Ld=({children:t})=>e(jsxRuntime.Fragment,{children:t}),ja=class{};Gt();T();var Ab=(t,r)=>r!==void 0?r:typeof t=="number"?t:t==="small"?18:t==="large"?30:t==="inherit"?"1em":22,ve=t=>({fontSize:o,size:n,sx:a,className:i,style:s,titleAccess:l,...d})=>{let u=Ue(a,i,s);return e(Mt,{name:t,size:Ab(o,n),className:u.className,style:u.style,"aria-label":d["aria-label"]??l,...d})},So=ve("tree"),Ho=ve("add"),Od=ve("duplicate"),tl=ve("down"),Fd=ve("navigationRight"),Bd=ve("navigationRight"),rl=ve("up"),Hd=ve("delete"),zd=ve("camera"),Vd=ve("accept"),Wd=ve("accept"),ri=ve("navigationRight"),$d=ve("dimension"),Gd=ve("decline"),wo=ve("decline"),_d=ve("decline"),Ud=ve("decline"),oi=ve("delete"),ni=ve("delete"),Kd=ve("download"),qd=ve("move"),Xd=ve("edit"),nn=ve("slimDown"),Yd=ve("filter"),an=ve("sum"),Zd=ve("wrench"),jd=ve("lineChart"),Qd=ve("document"),Vr=ve("slimDown"),Jd=ve("navigationLeft"),ko=ve("navigationRight"),ai=ve("slimUp"),ii=ve("navigationLeft"),si=ve("navigationRight"),ep=ve("dimension"),tp=ve("splitOne"),li=ve("menu"),rp=ve("microphone"),op=ve("microphone"),np=ve("microphone"),ap=ve("qrCode"),Po=ve("save"),zo=ve("search"),ip=ve("search"),sp=ve("paperPlane"),lp=ve("paperPlane"),cp=ve("wrench"),dp=ve("sort"),ci=ve("splitTwo"),pp=ve("favorite"),up=ve("favorite"),mp=ve("stop"),gp=ve("tableRow"),di=ve("collapseAll"),pi=ve("expandAll"),sn=ve("tableColumn"),fp=ve("overview"),bp=ve("hide");T();var Lb=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],vp=t=>Array.isArray(t)?t:t==null||t===""?[]:[t],kr=t=>String(t),yp=(t,r)=>t[r],Cp=t=>{let r=t.value??t.id??t.key??t.code;return typeof r=="number"||typeof r=="string"?r:""},Ob=t=>{let r=t.label??t.description??t.name??t.title;return String(typeof r=="number"||typeof r=="string"?r:Cp(t))},Fb=t=>{let r=t.description??t.subtitle;return typeof r=="number"||typeof r=="string"?String(r):void 0},xp=({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=Cp,getOptionLabel:C=Ob,getOptionDescription:P=Fb,onChange:w,onSearch:k,disabled:I,InputProps:S,onFocus:E,onBlur:D,onKeyDown:R,error:A,helperText:N,...O})=>{let F=yr(),q=n==="multiple",[z,X]=Jt.useState(false),[$,_]=Jt.useState(false),[V,B]=Jt.useState(""),[Z,Q]=Jt.useState(null),[ge,se]=Jt.useState(false),[le,be]=Jt.useState(()=>vp(t)),[_e,De]=Jt.useState(""),[Pe,Ve]=Jt.useState(""),Te=Jt.useMemo(()=>o&&o.length>0?o:Lb,[o]),xe=Z??r,We=Jt.useMemo(()=>{let ee=[...g,...r,...Z??[]],Ie=new Map;return ee.forEach(Re=>{Ie.set(kr(h(Re)),Re);}),Ie},[h,r,Z,g]),ot=Jt.useMemo(()=>vp(t),[t]),it=Jt.useMemo(()=>ot.map(String).join(", "),[ot]);Jt.useEffect(()=>{z||be(ot);},[z,ot]),Jt.useEffect(()=>{!$&&!Pe&&De(it);},[$,it,Pe]);let Ze=Jt.useMemo(()=>{let ee=V.trim().toLowerCase();if(!ee||k)return xe;let Ie=Te.filter(Re=>Re.searchable!==false);return xe.filter(Re=>[h(Re),C(Re),P(Re),...Ie.map(mt=>yp(Re,mt.field))].some(mt=>String(mt??"").toLowerCase().includes(ee)))},[xe,P,C,h,k,V,Te]),U=Jt.useMemo(()=>{if(x!==void 0)return x;if(ot.length===0)return "";let ee=Ie=>{let Re=We.get(kr(Ie));if(!Re)return String(Ie);let je=C(Re);return je&&je!==String(Ie)?`${Ie} - ${je}`:String(Ie)};return q?ot.length>2?`${ot.length} selected`:ot.map(ee).join(", "):ee(ot[0])},[x,C,q,We,ot]),Fe=Jt.useCallback(async()=>{if(k){se(true);try{let ee=await k(V);Array.isArray(ee)&&Q(ee);}finally{se(false);}}},[k,V]),ye=()=>{I||(be(ot),X(true));},Le=()=>{X(false);},st=()=>{w?.(q?[]:null,q?[]:null),be([]),De(""),Ve("");},Je=ee=>{let Ie=h(ee);if(q){be(Re=>Re.some(mt=>kr(mt)===kr(Ie))?Re.filter(mt=>kr(mt)!==kr(Ie)):[...Re,Ie]);return}be([Ie]);},vt=()=>{let ee=le.map(Ie=>We.get(kr(Ie))).filter(Ie=>!!Ie);q?w?.(le,ee):w?.(le[0]??null,ee[0]??null),Ve(""),X(false);},St=ee=>{if(ee.key==="F4"){ee.preventDefault(),ye();return}if(ee.key==="Enter"&&m&&!Lt(_e,true)){ee.preventDefault();return}R?.(ee);},Et=ee=>v?ee.every(Ie=>We.has(kr(Ie))):true,Lt=(ee,Ie)=>{if(q){let je=ee.split(/[,;\n]/).map(pt=>pt.trim()).filter(Boolean);if(je.length===0)return Ve(""),w?.([],[]),true;if(!Et(je))return Ie&&Ve(y),false;Ve("");let mt=je.map(pt=>We.get(kr(pt))).filter(pt=>!!pt);return w?.(je,mt),true}let Re=ee.trim();return Re?Et([Re])?(Ve(""),w?.(Re,We.get(kr(Re))??null),true):(Ie&&Ve(y),false):(Ve(""),w?.(null,null),true)},re=ee=>{if(!m)return;let Ie=ee.target.value;De(Ie),Ve(""),Lt(Ie,false);},nt=f||ge,Be=ot.length>0,fe=m&&($||!!Pe)?_e:U;return c(jsxRuntime.Fragment,{children:[e(ze,{...O,className:["orb-value-help-field",b&&Be&&!I?"orb-value-help-has-clear":"",O.className??""].filter(Boolean).join(" "),disabled:I,value:fe,error:!!Pe||A,helperText:Pe||N,onChange:re,onFocus:ee=>{_(true),De(it),E?.(ee);},onBlur:ee=>{m&&Lt(_e,true),_(false),D?.(ee);},onKeyDown:St,InputProps:{...S,readOnly:!m,endAdornment:c("span",{className:"orb-value-help-actions",children:[nt?e(Xr,{size:18}):null,b&&Be&&!I?e(ae,{className:"orb-value-help-clear-trigger",size:"small",tooltip:l,"aria-label":l,onMouseDown:ee=>ee.preventDefault(),onClick:ee=>{ee.stopPropagation(),st();},children:e(Mt,{name:"decline",size:14})}):null,e(ae,{className:"orb-value-help-search-trigger",size:"small",tooltip:u,"aria-label":u,onMouseDown:ee=>ee.preventDefault(),onClick:ee=>{ee.stopPropagation(),ye();},disabled:I,children:e(Mt,{name:"search",size:16})})]})}}),c(zt,{open:z,onClose:Le,fullWidth:true,maxWidth:820,hideCloseButton:true,PaperProps:{sx:ee=>({borderRadius:2,overflow:"hidden",border:`1px solid ${ee.palette.divider}`,boxShadow:F==="dark"?`0 24px 80px ${rt(ee.palette.common.black,.72)}`:`0 24px 80px ${rt(ee.palette.common.black,.18)}`})},children:[c("div",{className:"orb-dialog-title",sx:ee=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${ee.palette.divider}`,bgcolor:ee.palette.background.paper}),children:[c("div",{children:[e(L,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),q?e(L,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${le.length} selected`}):null]}),e(ae,{"aria-label":"Close",onClick:Le,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:ee=>({px:2.5,py:1.5,borderBottom:`1px solid ${ee.palette.divider}`,bgcolor:F==="dark"?rt(ee.palette.common.white,.025):rt(ee.palette.primary.main,.035)}),children:[e(ze,{size:"small",fullWidth:true,autoFocus:true,value:V,placeholder:i,onChange:ee=>B(ee.target.value),onKeyDown:ee=>{ee.key==="Enter"&&(ee.preventDefault(),Fe());},InputProps:{startAdornment:e(io,{position:"start",children:e(Mt,{name:"search",size:16})}),sx:ee=>({borderRadius:1,bgcolor:ee.palette.background.paper,"& fieldset":{borderColor:rt(ee.palette.text.primary,F==="dark"?.2:.16)},"&:hover fieldset":{borderColor:rt(ee.palette.primary.main,.52)},"&:focus-within fieldset":{borderColor:ee.palette.primary.main}})}}),k?e(Ce,{variant:"outlined",onClick:()=>{Fe();},disabled:nt,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:nt?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:ee=>({bgcolor:F==="dark"?"var(--orb-canvas)":ee.palette.background.paper,borderBottom:`1px solid ${ee.palette.divider}`})}),Te.map(ee=>e("td",{align:ee.align==="inherit"?void 0:ee.align,sx:Ie=>({minWidth:ee.minWidth,width:ee.width,fontSize:"0.78rem",fontWeight:800,bgcolor:F==="dark"?"var(--orb-canvas)":Ie.palette.background.paper,borderBottom:`1px solid ${Ie.palette.divider}`}),children:ee.label},String(ee.field)))]})}),c("tbody",{children:[Ze.map(ee=>{let Ie=h(ee),Re=le.some(je=>kr(je)===kr(Ie));return c("tr",{hover:true,selected:Re,onClick:()=>Je(ee),onDoubleClick:()=>{q||(be([Ie]),w?.(Ie,ee),X(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(Dt,{size:"small",checked:Re})}),Te.map(je=>{let mt=yp(ee,je.field);return e("td",{align:je.align==="inherit"?void 0:je.align,sx:{fontSize:"0.82rem",py:1},children:je.render?je.render(mt,ee):String(mt??"")},String(je.field))})]},kr(Ie))}),Ze.length===0?e("tr",{children:e("td",{colSpan:Te.length+1,children:e("div",{sx:{py:5,textAlign:"center",color:"text.secondary"},children:p})})}):null]})]})})]}),c("div",{className:"orb-dialog-actions",sx:ee=>({px:2.5,py:1.5,borderTop:`1px solid ${ee.palette.divider}`,bgcolor:ee.palette.background.paper,"& .orb-btn":{textTransform:"none",fontWeight:700}}),children:[b&&(Be||le.length>0)?e(Ce,{onClick:st,children:l}):null,e("div",{sx:{flex:1}}),e(Ce,{onClick:Le,children:d}),e(Ce,{variant:"contained",onClick:vt,disabled:!q&&le.length===0,children:s})]})]})]})};T();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 ol={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"},nl={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"},Qn={width:30,height:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},Jn={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},Sp={display:"flex",alignItems:"center",justifyContent:"center",gap:.25,width:"100%",minWidth:0},dr={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}};T();var Bb={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(lt,{title:s("table.toolbar.itemsPerPage"),children:e(Wt,{size:"small",variant:"standard",value:t,"aria-label":s("table.toolbar.itemsPerPage"),fullWidth:false,disableUnderline:true,onChange:m=>a?.(Number(m.target.value)),sx:Bb,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:dr,children:e(Jd,{})}),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:dr,children:e(ko,{})})]})};T();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(io,{position:"start",children:e(zo,{size:16})})}})})};T();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(Id,{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(Jt__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(lt,{title:r("table.toolbar.groupBy"),children:e(ae,{className:"orb-table-tool-button",sx:dr,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(lt,{title:r("table.toolbar.summary"),children:e(ae,{className:`orb-table-tool-button ${t.showSummary?"orb-is-active":""}`,active:!!t.showSummary,sx:dr,onClick:l=>t.setSummaryAnchorEl(t.summaryAnchorEl?null:l.currentTarget),children:e(an,{})})}),e(lt,{title:r("table.toolbar.columns"),children:e(ae,{className:"orb-table-tool-button",sx:dr,onClick:l=>t.setAnchorEl(t.anchorEl?null:l.currentTarget),children:e(sn,{})})}),e(lt,{title:r("table.toolbar.export"),children:e(ae,{className:"orb-table-tool-button",sx:dr,onClick:t.handleExport,children:e(Kd,{})})})]}),i&&c("div",{className:"orb-table-tool-group",children:[t.showCreateButton&&e(lt,{title:r("table.toolbar.newItem"),children:e(ae,{className:"orb-table-tool-button",onClick:t.onOpenCreateDialog,color:"primary.main",sx:dr,children:e(Ho,{})})}),t.showEditButton&&e(lt,{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:dr,children:e(Xd,{})})})}),t.showDeleteButton&&e(lt,{title:r("table.toolbar.deleteItem"),children:e("span",{children:e(ae,{className:"orb-table-tool-button",onClick:t.onOpenDeleteConfirm,disabled:!!t.deleteDisabled,sx:{...dr,color:"error.main"},children:e(oi,{})})})})]}),s&&c("div",{className:"orb-table-tool-group",children:[t.onOpenGraphReport&&e(lt,{title:r("table.toolbar.graphicReport"),children:e(ae,{className:"orb-table-tool-button",sx:dr,onClick:t.onOpenGraphReport,children:e(jd,{})})}),t.onLayoutSave&&!t.layoutManager&&e(lt,{title:r("table.toolbar.saveLayout"),children:e(ae,{className:"orb-table-tool-button",sx:dr,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}}});T();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,[P,w]=Jt.useState(null),k=Jt.useRef(null),I=$=>_=>{C||P||d($);},S=($,_,V)=>{$.preventDefault(),$.stopPropagation(),w(_),k.current={startX:$.clientX,startWidth:V,colId:_},document.addEventListener("mousemove",E),document.addEventListener("mouseup",D),document.body.style.cursor="col-resize";},E=$=>{if(!k.current)return;let{startX:_,startWidth:V,colId:B}=k.current,Z=$.clientX-_,Q=Math.max(50,V+Z);g&&g(B,Q);},D=()=>{w(null),k.current=null,document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",D),document.body.style.cursor="";};Jt.useEffect(()=>()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",D);},[]);let R=b==="multiple"||b==="single",A=m.length>0&&!!y,N=r(v?"table.group.collapseAll":"table.group.expandAll"),O=p.filter($=>f.includes($.id)),F=new Map(i.map(($,_)=>[$.field,{...$,priority:_+1}])),q=O.map($=>{let _=x?.[$.id]||$.minWidth||100,V=F.get($.id);return e(Ub,{headCell:$,width:typeof _=="number"?_:100,order:n,orderBy:a,multiSortInfo:C?void 0:V,onRequestSort:I($.id),onContextMenu:u,onResizeMouseDown:B=>S(B,$.id,typeof _=="number"?_:100),enableColumnReorder:h,disableSorting:C},$.id)}),z=O.map($=>$.id),X=c("tr",{children:[R&&e("th",{className:"orb-table-control-head",style:{width:56,minWidth:56,maxWidth:56},children:e(Dt,{color:"primary",indeterminate:s>0&&s<l,checked:l>0&&s===l,onChange:o,disabled:b==="single",sx:Qn})}),A&&e("th",{className:"orb-table-control-head",style:{width:72,minWidth:72,maxWidth:72},children:e(lt,{title:N,children:e(ae,{size:"small",onClick:$=>{$.stopPropagation(),y?.(!v);},sx:Jn,children:v?e(di,{}):e(pi,{})})})}),h?e(sortable.SortableContext,{items:z,strategy:sortable.horizontalListSortingStrategy,children:q}):q]});return e("thead",{children:X})},Ub=({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(Rd,{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()})]})};T();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=k=>a.indexOf(k)!==-1,C=u==="multiple"||u==="single",P=p.length>0,w=n.length+(C?1:0)+(P?1:0);return c("tbody",{children:[o.map((k,I)=>{if(k.type==="group"){let S=d.has(k.id),E=k.childIds||[],D=E.filter($=>h($)).length,R=E.length>0&&D===E.length,A=D>0&&D<E.length,N={entry:k,data:k,id:k.id,index:I,selected:R,group:true},O=x?.(N)||{},{className:F,onClick:q,...z}=O,X=$=>{if($.stopPropagation(),!!t.onSelectionChange)if(R){let _=a.filter(V=>!E.includes(V));t.onSelectionChange(_);}else {let _=Array.from(new Set([...a,...E]));t.onSelectionChange(_);}};return c("tr",{...z,"data-ctable-row-key":y?.(N),className:["orb-table-group-row",F].filter(Boolean).join(" "),onClick:q,sx:$=>({backgroundColor:"var(--orb-surface)","& th, & td":{color:$.palette.text.primary,borderBottomColor:$.palette.divider},"& .orb-icon-btn":{color:$.palette.text.primary},"& .orb-chk":{color:$.palette.text.secondary},"& .orb-chk:has(input:checked), & .orb-chk:has(input:indeterminate)":{color:$.palette.primary.main}}),children:[C&&e("td",{padding:"checkbox",sx:ol,children:e(Dt,{size:"small",checked:R,indeterminate:A,onChange:X,onClick:$=>$.stopPropagation(),sx:Qn})}),P&&e("td",{padding:"checkbox",sx:nl,children:c("div",{sx:Sp,children:[p.length>1&&k.level<p.length-1&&e(lt,{title:f?.(k.id)?r("table.group.collapseAll"):r("table.group.expandAll"),children:e(ae,{size:"small",onClick:()=>{f?.(k.id)?m?.(k.id):b?.(k.id);},sx:Jn,children:f?.(k.id)?e(di,{}):e(pi,{})})}),e(ae,{size:"small",onClick:()=>l&&l(k.id),sx:Jn,children:S?e(Vr,{}):e(ko,{})})]})}),e("td",{colSpan:n.length,sx:{py:1,pl:k.level*3+1},children:c(L,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[k.field,": ",k.value," (",k.count,")"]})})]},k.id)}else {let S=k.data||k,E=k.id||S.id||I,D=h(E),R=`enhanced-table-checkbox-${I}`,A={entry:k,data:S,id:E,index:I,selected:D,group:false},N=g?.(A)||{},{className:O,onClick:F,...q}=N,X=(k.level!==void 0?k.level:0)*4;return c("tr",{...q,"data-ctable-row-key":y?.(A),className:[D?"orb-is-selected":"",O].filter(Boolean).join(" "),onClick:$=>{F?.($),$.defaultPrevented||i?.($,S);},role:C?"checkbox":q.role,"aria-checked":C?D:q["aria-checked"],tabIndex:q.tabIndex??-1,children:[C&&e("td",{padding:"checkbox",sx:ol,children:e(Dt,{color:"primary",checked:D,inputProps:{"aria-labelledby":R},sx:Qn})}),P&&e("td",{padding:"checkbox",sx:nl}),s.filter($=>n.includes($.id)).map(($,_)=>{let B=_===0&&X>0?{pl:X+2}:{};return e("td",{className:$.numeric?"orb-num":void 0,align:$.numeric?"right":"left",sx:B,children:$.render?$.render(S[$.id],S):(function(){let Q=S[$.id];if($.numeric){if(typeof Q=="number")return Q.toLocaleString();if(typeof Q=="string"&&Q.trim()!==""&&!isNaN(Number(Q)))return Number(Q).toLocaleString()}return Q})()},$.id)})]},E)}}),o.length===0&&e("tr",{children:e("td",{colSpan:w,align:"center",children:v??r("common.noData")})})]})};T();var wp=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))]})})};T();var kp=t=>{let{t:r}=pe();return e("div",{sx:{p:2},children:e(L,{children:r("table.mobile.notImplemented")})})};T();var dn=({groupAnchorEl:t,setGroupAnchorEl:r,grouping:o,setGrouping:n,columns:a})=>{let{t:i}=pe(),[s,l]=Jt.useState(o);Jt.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(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:f=>f.stopPropagation(),children:[e(L,{className:"orb-table-group-menu-title",variant:"subtitle2",children:i("table.menu.groupBy")}),s.length>0&&e(Ce,{className:"orb-table-group-menu-clear",size:"small",color:"error",onClick:f=>{f.stopPropagation(),l([]);},children:i("table.menu.clearAll")})]}),e(At,{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(Dt,{className:"orb-table-group-menu-checkbox",checked:b,size:"small"}),e(_t,{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(Ce,{size:"small",variant:"ghost",onClick:d,children:i("common.cancel")}),e(Ce,{size:"small",variant:"primary",onClick:p,children:i("common.ok")})]})]})},pn=({anchorEl:t,setAnchorEl:r,columns:o,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=pe();return c(jt,{anchorEl:t,open:!!t,onClose:()=>r(null),children:[e("option",{disabled:true,children:e(_t,{primary:i("table.menu.visibleColumns")})}),e(At,{}),o.map(s=>c("option",{onClick:()=>a(s.id),children:[e(Dt,{checked:n.includes(s.id),size:"small"}),e(_t,{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(jt,{anchorEl:t,open:!!t,onClose:()=>r(null),children:[e("option",{children:e(jn,{control:e(ei,{checked:o,onChange:d=>n(d.target.checked),size:"small"}),label:l("table.menu.showSummaryRow")})}),e(At,{}),a.filter(d=>d.numeric).map(d=>c("option",{onClick:()=>s(d.id),disabled:!o,children:[e(Dt,{checked:i.includes(d.id),size:"small"}),e(_t,{primary:d.label})]},d.id)),a.filter(d=>d.numeric).length===0&&e("option",{disabled:true,children:e(_t,{primary:l("table.menu.noNumericColumns")})})]})},Ci=({contextMenu:t,handleCloseContextMenu:r,columns:o,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=pe();return c(jt,{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(At,{}),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(Vd,{fontSize:"small"})}),e(_t,{children:s.label})]},s.id))]})},Rp=({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(R=>R.id===h),P=a.includes(h),w=i.includes(h),k=!!C?.numeric,I=l.find(R=>R.field===h),S=I?I.direction==="asc":d===h&&u==="asc",E=I?I.direction==="desc":d===h&&u==="desc",D=S||E;return c(jt,{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(_t,{primary:C?.label??h})}),e(At,{}),c("option",{onClick:()=>{p(h),r();},selected:S,children:[e(zr,{children:e(rl,{fontSize:"small"})}),e(_t,{primary:x("table.headerMenu.sortAsc")})]}),c("option",{onClick:()=>{f(h),r();},selected:E,children:[e(zr,{children:e(tl,{fontSize:"small"})}),e(_t,{primary:x("table.headerMenu.sortDesc")})]}),D&&c("option",{onClick:()=>{b(h),r();},children:[e(zr,{children:e($d,{fontSize:"small"})}),e(_t,{primary:x("table.headerMenu.clearSort")})]}),c("option",{onClick:()=>{g(),r();},children:[e(zr,{children:e(Ho,{fontSize:"small"})}),e(_t,{primary:x("table.headerMenu.configureSort")})]}),e(At,{}),c("option",{onClick:()=>{v(h),r();},selected:P,children:[e(zr,{children:e(So,{fontSize:"small"})}),e(_t,{primary:x(P?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),k&&s&&c("option",{onClick:()=>{y(h),r();},selected:w,children:[e(zr,{children:e(an,{fontSize:"small"})}),e(_t,{primary:x(w?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),e(At,{}),c("option",{onClick:()=>{m(h),r();},children:[e(zr,{children:e(bp,{fontSize:"small"})}),e(_t,{primary:x("table.headerMenu.hideColumn")})]})]})},Mp=({open:t,onClose:r,columns:o,initialRules:n,onApply:a,onClear:i})=>{let{t:s}=pe(),[l,d]=Jt.useState([]);Jt.useEffect(()=>{t&&d(n.length>0?n.map(y=>({...y})):[]);},[t,n]);let u=Jt.useMemo(()=>new Set(l.map(y=>y.field)),[l]),p=Jt.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],[P]=C.splice(y,1);return C.splice(h,0,P),C});};return e(zt,{open:t,onClose:r,maxWidth:620,fullWidth:true,className:"orb-table-sort-dialog",title:s("table.sortDialog.title"),actions:c(jsxRuntime.Fragment,{children:[e(Ce,{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(Ce,{variant:"neutral",onClick:r,children:s("common.cancel")}),e(Ce,{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,P)=>P!==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(Wt,{size:"small",value:y.field,onChange:C=>m(g,{field:C.target.value}),options:h.map(C=>({value:C.id,label:C.label}))}),e(Wt,{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(rl,{fontSize:"small"})}),e(ae,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g,1),disabled:g===l.length-1,children:e(tl,{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(Ce,{size:"small",onClick:f,disabled:p.length===0,startIcon:e(Ho,{}),variant:"secondary",className:"orb-table-sort-add",children:s("table.sortDialog.addRule")})]})})};T();var ea=(t,r=2)=>t.toLocaleString(void 0,{maximumFractionDigits:r}),Dp=({kpis:t})=>{let{t:r}=pe(),o=[{label:r("graph.kpi.totalRecords"),value:ea(t.totalRecords,0),color:"var(--orb-fg)"},{label:r("graph.kpi.totalReport"),value:ea(t.totalReportHours),color:"var(--orb-fg)"},{label:r("graph.kpi.totalBillable"),value:ea(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:ea(t.totalAmount),color:"var(--orb-primary)"},{label:r("graph.kpi.flagged"),value:ea(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(Ee,{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))})};T();var xi=({title:t,subtitle:r,children:o})=>c(Ee,{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]});T();var ta=({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))})};T();var Np=({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))})]})};T();var Ap=({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))})]})};T();var Kb=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)`},Ep=({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:Kb(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))]})})};T();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))})]})};T();var Lp=({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))})]})};T();var Op=({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 ra=({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}`},nM=(t,r=360)=>{let o=ra(t);return `<iframe width="100%" height="${r}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};T();var Fp=({apiKey:t,query:r,embedUrl:o,zoom:n=14,mapType:a="roadmap",height:i=320})=>{let s=o||(t&&r?ra({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"};T();var Bp=({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"})]})]})};T();var Hp=({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(ta,{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(ta,{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)})})]})};T();var Yb=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],Zb=["zh","en","de","fr","ja","ko"],zp=({open:t,onClose:r,value:o,onSaveAll:n,modelOptions:a=Yb,promptLangOptions:i=Zb,analysisTemplateOptions:s=[],responseTemplateOptions:l=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:u})=>{let[p,f]=Jt.useState(o),[b,m]=Jt.useState(d||""),[v,y]=Jt.useState(u||""),[g,x]=Jt.useState(false);Jt.useEffect(()=>{t&&(f(o),m(d||""),y(u||""));},[t,o,d,u]);let h=(P,w)=>{f(k=>({...k,[P]: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(zt,{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:P=>h("baseUrl",P.target.value),fullWidth:true,label:"Base URL"})}),e("div",{children:e(ze,{size:"small",type:"password",value:p.apiKey,onChange:P=>h("apiKey",P.target.value),fullWidth:true,label:"API Key"})}),e("div",{children:e(ze,{size:"small",value:p.model,onChange:P=>h("model",P.target.value),fullWidth:true,select:true,label:"Model",children:a.map(P=>e("option",{value:P,children:P},P))})}),e("div",{children:e(ze,{size:"small",value:p.promptLang,onChange:P=>h("promptLang",P.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:i.map(P=>e("option",{value:P,children:P},P))})})]}),c("div",{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[c(ze,{size:"small",value:b,onChange:P=>m(P.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[e("option",{value:"",children:"Default"}),s.map(P=>e("option",{value:P.id,children:P.label},P.id))]}),e(Vn,{multiline:true,minRows:8,value:p.analysisPrompt,onChange:P=>h("analysisPrompt",P.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:P=>y(P.target.value),fullWidth:true,select:true,label:"Response Template",children:[e("option",{value:"",children:"Default"}),l.map(P=>e("option",{value:P.id,children:P.label},P.id))]}),e(Vn,{multiline:true,minRows:8,value:p.responsePrompt,onChange:P=>h("responsePrompt",P.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(Ce,{variant:"outlined",onClick:r,children:"Cancel"}),e(Ce,{variant:"contained",onClick:C,disabled:!n||g,children:"Save"})]})]})};T();var Pi=({open:t,onClose:r,model:o,tableContent:n,extraCharts:a,interaction:i,aiAssistant:s})=>{let{t:l}=pe(),[d,u]=Jt.useState(s?.defaultPrompt||""),[p,f]=Jt.useState(false),[b,m]=Jt.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...";Jt.useEffect(()=>{t&&u(s?.defaultPrompt||"");},[t,s?.defaultPrompt]);let C=s?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},P=async()=>{let w=d.trim();if(!(!w||!s?.onSubmit))try{f(!0),await s.onSubmit(w,{filters:g,model:o});}finally{f(false);}};return e(zt,{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(Pt,{label:l("graph.records",{count:o.kpis.totalRecords})}),v&&g.primaryDimension&&e(Pt,{tone:"outline",label:`${i?.fieldMapping.primaryDimension}: ${g.primaryDimension}`,onDelete:()=>i?.onClearFilter("primaryDimension")}),v&&g.secondaryDimension&&e(Pt,{tone:"outline",label:`${i?.fieldMapping.secondaryDimension}: ${g.secondaryDimension}`,onDelete:()=>i?.onClearFilter("secondaryDimension")}),v&&g.status&&e(Pt,{tone:"outline",label:`${i?.fieldMapping.status}: ${g.status}`,onDelete:()=>i?.onClearFilter("status")}),v&&x&&e(Ce,{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(Ea,{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(),P());},placeholder:h,style:{fontSize:14,border:"none",background:"transparent",flex:1,minWidth:0}}),e(ae,{size:"small",onClick:P,disabled:p||!d.trim(),children:e(_c,{size:16,strokeWidth:1.8})}),e(ae,{size:"small",onClick:()=>m(true),children:e(en,{size:16,strokeWidth:1.8})})]}),e(ae,{onClick:r,children:e(Zt,{size:18,strokeWidth:2})})]})]})}),c("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12,overflow:"auto",minHeight:0},children:[e(Dp,{kpis:o.kpis}),e(Hp,{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(zp,{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 Ro={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"]},Qb=5,Vp=t=>t.toLowerCase().replace(/[\s_-]/g,""),Mo=(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=>[Vp(s),s]));for(let s of o){let l=i.get(Vp(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},mr=(t,r)=>t==null||t===""?r:String(t),Jb=(t,r,o,n,a)=>{let i=new Map;return t.forEach(s=>{let l=mr(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)},eh=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=mr(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)},th=(t,r,o)=>{let n=t.length;if(n===0)return [];let a=new Map;return t.forEach(i=>{let s=mr(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}))},Wp=(t,r,o)=>{let n=new Map;return t.forEach(a=>{let i=mr(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}))},rh=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=mr(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)},oh=(t,r,o,n,a)=>{let i=new Map;return t.forEach(s=>{let l=mr(s[r],a),d=mr(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}})},nh=(t,r,o)=>{let n=Wp(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"}]},ah=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=mr(l[r],i),u=`${mr(l[o],i)} / ${mr(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)},un=({rows:t,config:r})=>{let{t:o}=pe(),n=o("graph.unassigned"),a=Jt.useMemo(()=>{let p=r?.fieldMapping;return {primaryDimension:Mo(t,p?.primaryDimension,Ro.primaryDimension,"Category"),secondaryDimension:Mo(t,p?.secondaryDimension,Ro.secondaryDimension,"Owner"),status:Mo(t,p?.status,Ro.status,"Status"),date:Mo(t,p?.date,Ro.date,"Date"),description:Mo(t,p?.description,Ro.description,"Description"),reportHours:Mo(t,p?.reportHours,Ro.reportHours,"ReportHours"),billableHours:Mo(t,p?.billableHours,Ro.billableHours,"BillableHours"),amount:Mo(t,p?.amount,Ro.amount,"Amount")}},[t,r?.fieldMapping]),i=Jt.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:mr(p[a.date],""),Primary:mr(p[a.primaryDimension],n),Secondary:mr(p[a.secondaryDimension],n),Description:mr(p[a.description],""),ReportHours:b,BillableHours:m,Amount:v,Efficiency:y,Status:mr(p[a.status],n)}}),[t,a,n]),s=Jt.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(mr(x.Status,"").toLowerCase())).length;return {totalRecords:p,totalReportHours:f,totalBillableHours:b,efficiency:v,totalAmount:m,flaggedCount:g}},[i,r?.statusFlagValues]),l=r?.topN||Qb,d=Jt.useMemo(()=>({billableByPrimary:Jb(i,"Primary","BillableHours",l,n),efficiencyBySecondary:eh(i,"Secondary","ReportHours","BillableHours",l,n),statusDistribution:th(i,"Status",n),lineByDate:Wp(i,"Date","BillableHours"),comboByPrimary:rh(i,"Primary","ReportHours","BillableHours",l,n),heatmapPrimarySecondary:oh(i,"Primary","Secondary","BillableHours",n),waterfallBillable:nh(i,"Date","BillableHours"),fishboneStatusCauses:ah(i,"Status","Primary","Secondary",3,n)}),[i,l,n]),u=Jt.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 mn=t=>String(t??"").trim(),Ii=(t={})=>{let[r,o]=Jt.useState(t),n=Jt.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=Jt.useCallback(d=>{o(u=>{if(!u[d])return u;let p={...u};return delete p[d],p});},[]),i=Jt.useCallback(()=>{o({});},[]),s=Jt.useMemo(()=>!!(r.primaryDimension||r.secondaryDimension||r.status),[r]),l=Jt.useCallback((d,u)=>d.filter(p=>!(r.primaryDimension&&mn(p[u.primaryDimension])!==mn(r.primaryDimension)||r.secondaryDimension&&mn(p[u.secondaryDimension])!==mn(r.secondaryDimension)||r.status&&mn(p[u.status])!==mn(r.status))),[r]);return {filters:r,setFilter:n,clearFilter:a,clearAll:i,hasActiveFilters:s,applyRows:l}};T();var Mi=({variants:t,currentVariantId:r,onLoad:o,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=pe(),[l,d]=Jt.useState(false),[u,p]=Jt.useState(""),[f,b]=Jt.useState(false),[m,v]=Jt.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(Wt,{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(P=>P.id===h.target.value);C&&o(C);}}),e(lt,{title:s("variant.saveView"),children:e(ae,{className:"orb-variant-save-button",onClick:g,size:"small",color:"primary",children:e(Po,{fontSize:"small"})})}),c(zt,{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(jn,{control:e(Dt,{checked:f,onChange:h=>b(h.target.checked)}),label:s("variant.setDefault")}),e(jn,{control:e(Dt,{checked:m,onChange:h=>v(h.target.checked)}),label:s("variant.publicAllUsers")})]}),c("div",{className:"orb-dialog-actions",children:[e(Ce,{onClick:()=>d(false),children:s("common.cancel")}),e(Ce,{onClick:x,variant:"contained",children:s("common.save")})]})]})]})};T();var Gp=({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]=Jt.useState([]),[y,g]=Jt.useState(""),x=`orbcafe.variants.${t}.${r}`,h=p!==void 0?p:y,C=A=>{p===void 0&&g(A),f&&f(A);},P=Jt.useCallback(()=>{try{let A=localStorage.getItem(x);if(!A)return [];let N=JSON.parse(A);return Array.isArray(N)?N:[]}catch{return []}},[x]),w=Jt.useCallback(A=>{try{localStorage.setItem(x,JSON.stringify(A));}catch{}},[x]),k=Jt.useCallback(A=>{v(A);let N=A.find(O=>O.isDefault);N&&!h&&(C(N.id),i(N));},[h,i,C]),I=Jt.useCallback(async()=>{if(!t)return [];try{let A=[];if(s)A=await s.getVariants(t,r);else if(l){let N=await fetch(`${l}/api/variants?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(r)}`);if(!N.ok)throw new Error(b("variant.toast.fetchFailed"));A=await N.json();}else A=P();return k(A),A}catch(A){console.error("Error fetching variants",A);let N=P();return k(N),d&&d(b("variant.toast.fetchFailed")),N}},[t,r,s,l,P,k,d,b]);return Jt.useEffect(()=>{I();},[t,r]),e(Mi,{variants:m,currentVariantId:h,onLoad:A=>{C(A.id),i(A);},onSave:async A=>{let N=Date.now().toString(),O;try{let F=A.scope||"Both",q=m.find(_=>_.name===A.name);N=q?q.id:Date.now().toString();let z=[];if(q&&(Array.isArray(q.filters)?z=[...q.filters]:q.filters&&(z=[{scope:"default",filters:q.filters}])),F==="Search"||F==="Both"){let _=(Array.isArray(o),o);if(_)if(Array.isArray(_)&&_.length>0&&_[0].scope)_.forEach(V=>{let B=z.findIndex(Z=>Z.scope===V.scope);B>=0?z[B]=V:z.push(V);});else {let V={scope:r,filters:_},B=z.findIndex(Z=>Z.scope===r);B>=0?z[B]=V:z.push(V);}}let X=q?.layout||{},$=[];if(q&&Array.isArray(q.layoutRefs)&&($=[...q.layoutRefs]),F==="Layout"||F==="Both")if(a&&a.length>0)a.forEach(_=>{let V=$.findIndex(B=>B.tableKey===_.tableKey);V>=0?$[V]=_:$.push(_);});else {let _={tableKey:r,layoutId:n||null},V=$.findIndex(B=>B.tableKey===r);V>=0?$[V]=_:$.push(_);}if(O={appId:t,tableKey:r,...A,scope:F,id:N,createdAt:new Date().toISOString(),filters:z,layout:X,layoutRefs:$},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(B=>B.id===N)?m.map(B=>B.id===N?O:B):[...m,O];v(V),w(V);}u&&u(b("variant.toast.saveSuccess")),(s||l)&&await I(),C(N),i(O);}catch(F){console.error("Error saving variant",F);let z=m.some(X=>X.id===N)?m.map(X=>X.id===N?O:X):[...m,O];v(z),w(z),C(N),i(O),d&&d(b("variant.toast.saveFailed"));}},onDelete:async A=>{try{if(s)await s.deleteVariant(A);else if(l){if(!(await fetch(`${l}/api/variants/${A}`,{method:"DELETE"})).ok)throw new Error(b("variant.toast.deleteFailed"))}else {let N=m.filter(O=>O.id!==A);v(N),w(N);}h===A&&C(""),(s||l)&&I(),u&&u(b("variant.toast.deleteSuccess"));}catch(N){console.error("Error deleting variant",N);let O=m.filter(F=>F.id!==A);v(O),w(O),h===A&&C(""),d&&d(b("variant.toast.deleteFailed"));}},onSetDefault:async A=>{try{let N=m.find(F=>F.id===A);if(!N)return;let O={appId:t,tableKey:r,...N,isDefault:!0};if(s)await s.setDefaultVariant(A,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(q=>({...q,isDefault:q.id===A}));v(F),w(F);}(s||l)&&await I(),u&&u(b("variant.toast.defaultSuccess"));}catch(N){console.error("Error setting default variant",N);let O=m.map(F=>({...F,isDefault:F.id===A}));v(O),w(O),d&&d(b("variant.toast.defaultFailed"));}}})};T();ro__default.default.extend(ph__default.default);ro__default.default.extend(uh__default.default);ro__default.default.extend(jf__default.default);var na="YYYY-MM-DD",gh=[null,null],Vo="0.85rem",fh={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},bh=({isInRange:t,isStart:r,isEnd:o,isHovered:n,disableMargin:a,sx:i,...s})=>{let l=sr();return e(Ad,{...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%"}:{}]})},Up=({label:t,value:r=gh,onChange:o})=>{let{t:n,locale:a}=pe(),i=fh[a]||"en",s=t||n("dateRange.label"),[l,d]=Jt.useState(null),[u,p]=Jt.useState(r),[f,b]=Jt.useState("start"),[m,v]=Jt.useState(null),[y,g]=Jt.useState((r[0]||ro__default.default()).locale(i)),[x,h]=Jt.useState(""),[C,P]=Jt.useState(""),[w,k]=Jt.useState(false),[I,S]=Jt.useState(false),E=Jt__namespace.default.useRef(r);Jt.useEffect(()=>{let[_,V]=r,[B,Z]=E.current,Q=le=>le&&typeof le.isSame=="function",ge=!(_===null&&B===null||Q(_)&&Q(B)&&_.isSame(B,"day")),se=!(V===null&&Z===null||Q(V)&&Q(Z)&&V.isSame(Z,"day"));(ge||se)&&(p(r),r[0]&&Q(r[0])&&g(r[0].locale(i))),E.current=r;},[r,i]),Jt.useEffect(()=>{h(u[0]?u[0].locale(i).format(na):""),P(u[1]?u[1].locale(i).format(na):""),k(false),S(false);},[u,i]);let D=(_,V)=>{let B=V.trim(),Z=_==="start"?k:S;if(!B){let se=_==="start"?[null,u[1]]:[u[0],null];Z(false),p(se);return}let Q=ro__default.default(B,na,true).locale(i);if(!Q.isValid()){Z(true);return}Z(false);let ge=[...u];if(_==="start")ge[0]=Q,ge[1]&&Q.isAfter(ge[1],"day")&&(ge[1]=null),b(ge[1]?"start":"end");else {let se=ge[0];se&&Q.isBefore(se,"day")?(ge=[Q,null],b("end")):(ge[1]=Q,b("start"));}p(ge),g(Q);},R=_=>{d(_.currentTarget);},A=()=>{d(null),b("start"),v(null);},N=!!l,O=_=>{if(!_)return;let V=[...u];if(f==="start")V=[_,null],b("end");else {let B=V[0];B&&_.isBefore(B)?(V=[_,null],b("end")):(V=[B,_],b("start"));}p(V);},F=_=>{let V=ro__default.default().locale(i),B=[null,null];switch(_){case "today":B=[V,V];break;case "week":B=[V.startOf("week"),V.endOf("week")];break;case "month":B=[V.startOf("month"),V.endOf("month")];break}p(B),b("start"),g(V);},q=()=>{o&&o(u),A();},z=()=>{p(r),b("start"),A();},X=Jt.useCallback(_=>{let{day:V,...B}=_,[Z,Q]=u,ge=Z?V.isSame(Z,"day"):false,se=Q?V.isSame(Q,"day"):false,le=Z&&Q?V.isBetween(Z,Q,"day","()"):false,be=false;return f==="end"&&Z&&!Q&&m&&V.isAfter(Z,"day")&&V.isBefore(m.add(1,"day"),"day")&&(be=true),e(bh,{...B,day:V,disableMargin:true,isStart:ge,isEnd:se,isInRange:le||be,onMouseEnter:()=>v(V)})},[u,f,m]),$=_=>_?_.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]?`${$(u[0])} - ${$(u[1])}`:"",onClick:R,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:R,tooltip:s,children:e(Mt,{name:"calendar",size:16})})}}),c(ti,{open:N,anchorEl:l,onClose:A,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:na,value:x,error:w,size:"small",onFocus:()=>b("start"),onChange:_=>{h(_.target.value),w&&k(false);},onBlur:()=>D("start",x),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),D("start",x));},sx:{"& .orb-inp":{fontSize:Vo,py:.75},"& label":{fontSize:Vo}}}),e(Fd,{color:"action",fontSize:"small"}),e(ze,{className:"orb-date-range-manual-field",label:n("dateRange.endDate"),placeholder:na,value:C,error:I,size:"small",onFocus:()=>{u[0]&&b("end");},onChange:_=>{P(_.target.value),I&&S(false);},onBlur:()=>D("end",C),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),D("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(Pt,{label:n("dateRange.today"),onClick:()=>F("today"),clickable:true,size:"small",variant:"outlined"}),e(Pt,{label:n("dateRange.thisWeek"),onClick:()=>F("week"),clickable:true,size:"small",variant:"outlined"}),e(Pt,{label:n("dateRange.thisMonth"),onClick:()=>F("month"),clickable:true,size:"small",variant:"outlined"})]})}),e("div",{className:"orb-date-range-calendar",children:e(Ld,{dateAdapter:ja,adapterLocale:i,children:e(Ed,{value:null,referenceDate:y,onMonthChange:g,onYearChange:g,onChange:O,slots:{day:X},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true})})}),e(At,{}),c(ie,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[e(Ce,{size:"small",onClick:z,color:"inherit",children:n("common.cancel")}),e(Ce,{size:"small",variant:"contained",onClick:q,children:n("common.done")})]})]})]})};T();var Ni={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},yh={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"},Ch=["contains","notContains",">",">=","<","<=","equals"],qp=["=","!=",">","<",">=","<=","between"],or="0.85rem",xh=({field:t,value:r,onChange:o})=>{let{t:n}=pe(),[a,i]=Jt.useState(null),[s,l]=Jt.useState(null),[d,u]=Jt.useState(null),[p,f]=Jt.useState(""),[b,m]=Jt.useState(""),[v,y]=Jt.useState(""),[g,x]=Jt.useState("");Jt.useEffect(()=>{let R=setTimeout(()=>{x(v);},1e3);return ()=>clearTimeout(R)},[v]);let h=r?.operator||(t.type==="number"?"=":"equals"),C=r?.value,P=R=>{let A=yh[R];return A?n(A):R},w=R=>{i(a?null:R.currentTarget);},k=R=>{o({...r,operator:R,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 A=(N=>{if(!N)return [null,null];if(Array.isArray(N)&&N.length===2){let O=N[0]?ro__default.default.isDayjs(N[0])?N[0]:ro__default.default(N[0]):null,F=N[1]?ro__default.default.isDayjs(N[1])?N[1]:ro__default.default(N[1]):null;return [O,F]}return ro__default.default.isDayjs(N)||typeof N=="string"?[ro__default.default.isDayjs(N)?N:ro__default.default(N),null]:[null,null]})(C);return e(Up,{label:t.label,value:A,onChange:N=>o({value:N,operator:"between"})})}if(S==="number"&&h==="between"){let R=()=>{o({value:[p,b],operator:"between"}),l(null);},A=Array.isArray(C)?`${C[0]||""} - ${C[1]||""}`:"";return c(jsxRuntime.Fragment,{children:[e(ze,{...I,label:t.label,value:A,placeholder:n("smartFilter.minMaxPlaceholder"),InputProps:{...I.InputProps,startAdornment:e(io,{position:"start",children:e(lt,{title:P("between"),children:e(ae,{size:"small",onClick:w,sx:{width:24,height:24,fontSize:or},children:Ni.between})})}),readOnly:true},onClick:N=>l(s?null:N.currentTarget)}),e(jt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:or,minHeight:"auto",py:.5}}},children:qp.map(N=>c("option",{selected:N===h,onClick:()=>k(N),children:[e("div",{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Ni[N]}),e(_t,{primary:P(N),primaryTypographyProps:{fontSize:or}})]},N))}),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:N=>f(N.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:or}},InputProps:{sx:{fontSize:or}}}),e(Bd,{color:"action"}),e(ze,{size:"small",label:n("smartFilter.max"),type:"number",value:b,onChange:N=>m(N.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:or}},InputProps:{sx:{fontSize:or}}}),e(Ce,{variant:"contained",size:"small",onClick:R,children:n("common.ok")})]})})]})}if(t.isValueHelp||S==="value-help"){let R=t.valueHelp?.mode||"single";return e(xp,{...I,...t.valueHelp,label:t.label,placeholder:t.placeholder||t.valueHelp?.placeholder,value:C??(R==="multiple"?[]:null),mode:R,onChange:A=>o({value:A,operator:R==="multiple"?"anyOf":"equals"})})}if(S==="select")return c(Wt,{size:"small",fullWidth:true,label:t.label,value:C||"",onChange:R=>o({...r,value:R.target.value,operator:"equals"}),children:[e("option",{value:"",children:n("common.none")}),t.options?.map(R=>e("option",{value:R.value,children:R.label},R.value))]});if(S==="multi-select"){let R=Array.isArray(C)?C:[],A=t.options?.filter(X=>X.label.toLowerCase().includes(g.toLowerCase()))||[],N=X=>t.options?.find($=>$.value===X)?.label||X,O=R.map(N),F=O.length===0?n("common.none"):O.length>2?`${O.slice(0,2).join(", ")} +${O.length-2}`:O.join(", "),q=()=>{u(null),y(""),x("");},z=X=>{let $=R.includes(X)?R.filter(_=>_!==X):[...R,X];o({...r,value:$,operator:"anyOf"});};return c("div",{className:"orb-fld",children:[e("label",{children:t.label}),c(Ce,{variant:"outlined",size:"small",onClick:X=>u(d?null:X.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(jt,{anchorEl:d,open:!!d,onClose:q,PaperProps:{sx:{width:280,maxHeight:340,overflowY:"auto",p:.5}},children:c("div",{onClick:X=>X.stopPropagation(),sx:{display:"grid",gap:.35},children:[e(ze,{size:"small",autoFocus:true,placeholder:n("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:e(io,{position:"start",children:e(zo,{fontSize:"small"})}),sx:{fontSize:or}},value:v,onChange:X=>y(X.target.value),onKeyDown:X=>X.stopPropagation()}),A.length>0?A.map(X=>{let $=R.includes(X.value);return c("div",{role:"option","aria-selected":$,tabIndex:0,className:`orb-menu-item ${$?"orb-selected":""}`,onClick:()=>z(X.value),onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),z(X.value));},children:[e(Dt,{checked:$,size:"small",inputProps:{tabIndex:-1},sx:{pointerEvents:"none"}}),e(_t,{primary:X.label})]},String(X.value))}):e("div",{className:"orb-menu-item","aria-disabled":"true",children:n("smartFilter.noOptionsFound")})]})})]})}let E=S==="number"?qp:Ch;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:R=>o({...r,value:R.target.value,operator:h}),InputProps:{...I.InputProps,startAdornment:e(io,{position:"start",children:e(lt,{title:P(h),children:e(ae,{className:"orb-filter-operator-trigger",size:"small",onClick:w,onMouseDown:R=>R.preventDefault(),sx:{width:24,height:24,fontSize:or,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Ni[h]})})}),endAdornment:t.hasSearchIcon?e(io,{position:"end",children:e(zo,{color:"action"})}):void 0}}),e(jt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:or,minHeight:"auto",py:.5}}},children:E.map(R=>c("option",{selected:R===h,onClick:()=>k(R),children:[e("span",{className:"orb-filter-operator-symbol",children:Ni[R]}),e(_t,{primary:P(R),primaryTypographyProps:{fontSize:or}})]},R))})]})},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,P]=Jt.useState(true),[w,k]=Jt.useState(null),[I,S]=Jt.useState(t.filter(A=>!A.hidden).map(A=>A.id)),E=(A,N)=>{o({...r,[A]:N});},D=A=>{I.includes(A)?S(I.filter(N=>N!==A)):S([...I,A]);};return c(Ee,{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(Gp,{appId:f,tableKey:b,currentFilters:{values:r,visibleFields:I},currentLayout:m,currentLayoutId:v,layoutRefs:y,onLoad:A=>{if(!A.filters)return;let N=null;if(Array.isArray(A.filters)){let O=b||"default",F=A.filters.find(q=>q.scope===O);N=F?F.filters:null;}else N=A.filters;N&&(N.values||N.visibleFields?(N.visibleFields&&Array.isArray(N.visibleFields)&&S(N.visibleFields),N.values&&o(N.values)):o(N)),i&&i(A);},variantService:g,serviceUrl:x,currentVariantId:a}):e(Mi,{variants:n,currentVariantId:a,onLoad:i,onSave:A=>{s&&s({...A,filters:{values:r,visibleFields:I}});},onDelete:l,onSetDefault:d}),c("div",{className:"orb-smart-filter-actions",children:[e(lt,{title:h("smartFilter.addFilters"),children:e(Ce,{className:"orb-smart-filter-adapt",onClick:A=>k(w?null:A.currentTarget),size:"small",color:"primary",startIcon:e(cp,{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(Mt,{name:"play",size:16})}),c(jt,{anchorEl:w,open:!!w,onClose:()=>k(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .orb-menu-item, & option":{fontSize:or,minHeight:32}}}},children:[e("option",{disabled:true,children:e(_t,{primary:h("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:or}})}),e(At,{}),t.map(A=>c("option",{onClick:()=>D(A.id),children:[e(Dt,{checked:I.includes(A.id),size:"small"}),e(_t,{primary:A.label,primaryTypographyProps:{fontSize:or}})]},A.id))]})]})]}),e("div",{className:"orb-smart-filter-grid",children:e(el,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:t.filter(A=>I.includes(A.id)).map(A=>e(el,{size:1,children:e(xh,{field:A,value:r[A.id]||{value:"",operator:A.type==="number"?"=":"equals"},onChange:N=>E(A.id,N)})},A.id))})})]}):null,e("div",{className:"orb-smart-filter-toggle",children:e(ae,{className:"orb-smart-filter-toggle-button",size:"small",onClick:()=>P(!C),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:30,height:30,minWidth:30,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:C?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"})})})]})};T();var Xp=({layouts:t,currentLayoutId:r,onLoad:o,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=pe(),[l,d]=Jt.useState(null),[u,p]=Jt.useState(false),[f,b]=Jt.useState(""),[m,v]=Jt.useState(""),[y,g]=Jt.useState({isDefault:false,isPublic:false}),x=t.find(I=>I.id===r),h=I=>{d(I.currentTarget);},C=()=>{d(null);},P=I=>{o(I),C();},w=()=>{b(""),v(""),g({isDefault:false,isPublic:false}),p(true),C();},k=()=>{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(lt,{title:s("layout.layoutOptions"),children:e(ae,{onClick:h,color:x?"primary":"default",size:"small",children:e(fp,{fontSize:"small"})})}),c(jt,{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(_t,{children:s("layout.saveCurrentLayout")})]}),e(At,{}),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:()=>P(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:E=>E.stopPropagation(),children:[e(lt,{title:I.isDefault?s("layout.removeDefault"):s("layout.setAsDefault"),children:e(ae,{size:"small",onClick:E=>{E.stopPropagation(),i(I.id);},children:I.isDefault?e(up,{fontSize:"small",color:"warning"}):e(pp,{fontSize:"small"})})}),e(lt,{title:s("common.delete"),children:e(ae,{size:"small",color:"error",onClick:E=>{E.stopPropagation(),a(I.id);},children:e(oi,{fontSize:"small"})})})]})]})},I.id||S))]}),e(zt,{open:u,onClose:()=>p(false),maxWidth:"xs",fullWidth:true,className:"orb-layout-save-dialog",title:s("layout.saveLayout"),actions:c(jsxRuntime.Fragment,{children:[e(Ce,{variant:"ghost",onClick:()=>p(false),children:s("common.cancel")}),e(Ce,{onClick:k,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(Dt,{className:"orb-layout-save-option",checked:y.isDefault,onChange:I=>g({...y,isDefault:I.target.checked}),label:s("layout.useAsDefault")}),e(Dt,{className:"orb-layout-save-option",checked:y.isPublic,onChange:I=>g({...y,isPublic:I.target.checked}),label:s("layout.publicAllUsers")})]})})]})};T();var fn=({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]=Jt.useState([]),[b,m]=Jt.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=Jt.useCallback(()=>{try{let S=localStorage.getItem(v);if(!S)return [];let E=JSON.parse(S);return Array.isArray(E)?E:[]}catch{return []}},[v]),h=Jt.useCallback(S=>{try{localStorage.setItem(v,JSON.stringify(S));}catch{}},[v]);Jt.useEffect(()=>{i!==void 0&&m(i);},[i]),Jt.useEffect(()=>{if(a&&p.length>0){let S=p.find(E=>E.id===a);S&&(m(S.id),n(S));}},[a,p,n]);let C=Jt.useCallback(async()=>{if(t){if(!s){let S=x();f(S);let E=S.find(D=>D.isDefault);E&&!b&&!a&&(m(E.id),n(E));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 D=(await S.json()).map(y);f(D);let R=D.find(A=>A.isDefault);R&&!b&&!a&&(m(R.id),n(R));}catch(S){console.error("Error fetching layouts",S);let E=x();f(E);let D=E.find(R=>R.isDefault);D&&!b&&!a&&(m(D.id),n(D)),l&&l(u("layout.toast.loadFallback"));}}},[t,r,s,l,b,n,a,x,u]);return Jt.useEffect(()=>{C();},[t,r]),e(Xp,{layouts:p,currentLayoutId:b,onLoad:S=>{m(S.id),n(S);},onSave:async S=>{let E=p.find(A=>A.name===S.name),D=E?E.id:Date.now().toString(),R={id:D,...S,createdAt:new Date().toISOString(),layoutData:o,isDefault:S.isDefault??false,isPublic:S.isPublic??false};if(!s){let N=p.some(O=>O.id===D)?p.map(O=>O.id===D?R:O):[...p,R];f(N),h(N),m(D),n(R),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(R))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(u("layout.toast.saveSuccess")),await C(),m(D),n(R);}catch(A){console.error("Error saving layout",A);let O=p.some(F=>F.id===D)?p.map(F=>F.id===D?R:F):[...p,R];f(O),h(O),m(D),n(R),d&&d(u("layout.toast.saveLocalSuccess")),l&&l(u("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async S=>{if(!s){let E=p.filter(D=>D.id!==S);f(E),h(E),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(E){console.error("Error deleting layout",E);let D=p.filter(R=>R.id!==S);f(D),h(D),b===S&&m(""),d&&d(u("layout.toast.deleteLocalSuccess")),l&&l(u("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async S=>{if(!s){let E=p.map(D=>({...D,isDefault:D.id===S}));f(E),h(E),d&&d(u("layout.toast.defaultLocalSuccess"));return}try{let E=p.find(R=>R.id===S);if(!E)return;if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g({...E,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(u("layout.toast.defaultSuccess")),await C();}catch(E){console.error("Error setting default",E);let D=p.map(R=>({...R,isDefault:R.id===S}));f(D),h(D),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 Zp(t,r,o){return r[o]<t[o]?-1:r[o]>t[o]?1:0}function Sh(t,r){return t==="desc"?(o,n)=>Zp(o,n,r):(o,n)=>-Zp(o,n,r)}function wh(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 bn=t=>{let r=!!t.disableGrouping,o=!!t.disableSorting,n=Jt.useCallback(W=>{let te=String(W?.label??W?.id??"").length*9+64,Ne=typeof W?.minWidth=="number"?W.minWidth:0;return Math.max(100,Ne,te)},[]),a=Jt.useCallback(()=>(t.columns||[]).filter(W=>!!W?.numeric).map(W=>W.id),[t.columns]),[i,s]=Jt.useState(""),[l,d]=Jt.useState(t.order||"asc"),[u,p]=Jt.useState(t.orderBy||""),[f,b]=Jt.useState([]),[m,v]=Jt.useState(t.page||0),[y,g]=Jt.useState(t.rowsPerPage||20),[x,h]=Jt.useState(t.selected||[]),[C,P]=Jt.useState(t.columns?t.columns.map(W=>W.id):[]),[w,k]=Jt.useState(t.columns?t.columns.map(W=>W.id):[]),[I,S]=Jt.useState(t.showSummary||false),[E,D]=Jt.useState(()=>a()),[R,A]=Jt.useState([]),[N,O]=Jt.useState(new Set),[F,q]=Jt.useState(()=>{let W={};return (t.columns||[]).forEach(Y=>{W[Y.id]=n(Y);}),W}),[z,X]=Jt.useState(null),[$,_]=Jt.useState(null),[V,B]=Jt.useState(null),[Z,Q]=Jt.useState(null),[ge,se]=Jt.useState(false),[le,be]=Jt.useState(""),[_e,De]=Jt.useState(""),Pe=r?[]:R,Ve=Jt.useCallback(W=>{if(r){A([]),O(new Set),_(null);return}A(W);},[r]);Jt.useEffect(()=>{r&&(A([]),O(new Set),_(null));},[r]),Jt.useEffect(()=>{o&&(d("asc"),p(""),b([]));},[o]),Jt.useEffect(()=>{t.layout&&bt(t.layout);},[t.layout]),Jt.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]),Jt.useEffect(()=>{t.selected!==void 0&&h(t.selected);},[t.selected]),Jt.useEffect(()=>{t.page!==void 0&&v(t.page);},[t.page]),Jt.useEffect(()=>{t.rowsPerPage!==void 0&&g(t.rowsPerPage);},[t.rowsPerPage]),Jt.useEffect(()=>{let W=a();D(Y=>Y.filter(Ne=>W.includes(Ne)));},[a]),Jt.useEffect(()=>{q(W=>{let Y={...W};return (t.columns||[]).forEach(te=>{Y[te.id]===void 0&&(Y[te.id]=n(te));}),Y});},[t.columns,n]),Jt.useEffect(()=>{k(W=>{let Y=(t.columns||[]).map(et=>et.id),te=new Set(Y),Ne=W.filter(et=>te.has(et)),he=new Set(Ne),Ae=Y.filter(et=>!he.has(et)),Ke=[...Ne,...Ae];return Ke.length===W.length&&Ke.every((et,qe)=>et===W[qe])?W:Ke});},[t.columns]);let Te=Jt.useMemo(()=>{let W=t.columns||[];if(w.length===0)return W;let Y=new Map(W.map(he=>[he.id,he])),te=[],Ne=new Set;return w.forEach(he=>{let Ae=Y.get(he);Ae&&(te.push(Ae),Ne.add(he));}),W.forEach(he=>{Ne.has(he.id)||te.push(he);}),te},[t.columns,w]),xe=Jt.useMemo(()=>{let W=t.rows||[];return i&&(W=W.filter(Y=>Object.keys(Y).some(te=>String(Y[te]).toLowerCase().includes(i.toLowerCase())))),W},[t.rows,i]),We=Jt.useMemo(()=>{if(o||t.onSortChange)return xe;if(f.length>0){let W=[...xe];return W.sort((Y,te)=>{for(let Ne of f){let he=Y?.[Ne.field],Ae=te?.[Ne.field];if(!(he==null&&Ae==null)){if(he==null)return Ne.direction==="asc"?-1:1;if(Ae==null)return Ne.direction==="asc"?1:-1;if(he<Ae)return Ne.direction==="asc"?-1:1;if(he>Ae)return Ne.direction==="asc"?1:-1}}return 0}),W}return u?wh(xe,Sh(l,u)):xe},[xe,l,u,f,t.onSortChange,o]),ot=Jt.useCallback(W=>{if(Pe.length===0)return W.map(Ae=>({type:"row",data:Ae,id:Ae[t.rowKey||"id"]}));let Y=[...W].sort((Ae,Ke)=>{for(let et of Pe){if(Ae[et]<Ke[et])return -1;if(Ae[et]>Ke[et])return 1}return 0}),te=(Ae,Ke=0)=>{if(Ke>=Pe.length)return Ae;let et=Pe[Ke],qe={},Ct=[];return Ae.forEach(Nt=>{let wt=Nt[et],xt=`${et}:${wt}`;qe[xt]||(qe[xt]={key:xt,field:et,value:wt,children:[],count:0,level:Ke},Ct.push(qe[xt])),qe[xt].children.push(Nt),qe[xt].count++;}),Ct.forEach(Nt=>{Nt.children&&(Nt.children=te(Nt.children,Ke+1));}),Ct},Ne=te(Y),he=(Ae,Ke="")=>{let et=[];return Ae.forEach(qe=>{if(qe.children){let Ct=Ke?`${Ke}>${qe.key}`:qe.key,Nt=N.has(Ct);et.push({type:"group",id:Ct,field:qe.field,value:qe.value,level:qe.level,count:qe.count,isExpanded:Nt,childIds:(function wt(xt){let H=[];return xt.children.forEach(j=>{j.children?H=H.concat(wt(j)):H.push(j[t.rowKey||"id"]);}),H})(qe)}),Nt&&(et=et.concat(he(qe.children,Ct)));}else et.push({type:"row",data:qe,id:qe[t.rowKey||"id"],level:Pe.length});}),et};return he(Ne)},[Pe,N,t.rowKey]),it=Jt.useCallback(W=>{if(Pe.length===0)return [];let Y=[...W].sort((he,Ae)=>{for(let Ke of Pe){if(he[Ke]<Ae[Ke])return -1;if(he[Ke]>Ae[Ke])return 1}return 0}),te=[],Ne=(he,Ae,Ke)=>{if(Ae>=Pe.length)return;let et=Pe[Ae],qe=new Map;he.forEach(Ct=>{let Nt=Ct[et],wt=qe.get(Nt);wt?wt.push(Ct):qe.set(Nt,[Ct]);}),qe.forEach((Ct,Nt)=>{let wt=`${et}:${Nt}`,xt=Ke?`${Ke}>${wt}`:wt;te.push(xt),Ne(Ct,Ae+1,xt);});};return Ne(Y,0,""),te},[Pe]),Ze=Jt.useMemo(()=>ot(We),[We,ot]),U=Jt.useMemo(()=>it(We),[We,it]),Fe=Jt.useMemo(()=>{let W=(t.rows||[]).length;return typeof t.count=="number"&&t.count>W},[t.count,t.rows]),ye=Jt.useMemo(()=>Fe?Ze:y>0?Ze.slice(m*y,m*y+y):Ze,[Ze,m,y,Fe]),Le=Jt.useMemo(()=>Fe&&typeof t.count=="number"?t.count:Ze.length,[Ze.length,Fe,t.count]),st=W=>{O(Y=>{let te=new Set(Y);return te.has(W)?te.delete(W):te.add(W),te});},Je=W=>{let Y=U.filter(te=>te===W||te.startsWith(`${W}>`));O(te=>{let Ne=new Set(te);return Y.forEach(he=>Ne.add(he)),Ne});},vt=W=>{O(Y=>{let te=new Set(Y);return Array.from(te).forEach(Ne=>{(Ne===W||Ne.startsWith(`${W}>`))&&te.delete(Ne);}),te});},St=W=>{if(!W){O(new Set);return}O(new Set(U));},Et=W=>{let Y=U.filter(te=>te.startsWith(`${W}>`));return Y.length===0?N.has(W):N.has(W)&&Y.every(te=>N.has(te))},Lt=W=>{if(o)return;f.length>0&&b([]);let Y=u===W&&l==="asc",te=u===W&&l==="desc";if(t.onSortChange){Y?t.onSortChange(W,"desc"):te?t.onSortChange("","asc"):t.onSortChange(W,"asc");return}Y?(d("desc"),p(W)):te?(d("asc"),p("")):(d("asc"),p(W));},re=W=>{if(o){d("asc"),p(""),b([]);return}let Y=W.filter(te=>te&&te.field);b(Y),Y.length>0&&p("");},nt=()=>{b([]);},Be=(W,Y)=>{q(te=>({...te,[W]:Y}));},ce=W=>{if(W.target.checked){let Y=xe.map(te=>te[t.rowKey||"id"]);h(Y),t.onSelectionChange&&t.onSelectionChange(Y);return}h([]),t.onSelectionChange&&t.onSelectionChange([]);},fe=(W,Y)=>{let te=Y[t.rowKey||"id"],Ne=x.indexOf(te),he=[];Ne===-1?he=he.concat(x,te):Ne===0?he=he.concat(x.slice(1)):Ne===x.length-1?he=he.concat(x.slice(0,-1)):Ne>0&&(he=he.concat(x.slice(0,Ne),x.slice(Ne+1))),h(he),t.onSelectionChange&&t.onSelectionChange(he);},ee=W=>{v(W),t.onPageChange&&t.onPageChange(W);},Ie=W=>{g(W),v(0),t.onPageChange&&t.onPageChange(0),t.onRowsPerPageChange&&t.onRowsPerPageChange(W);},Re=W=>{let Y=C.indexOf(W),te=[...C];Y===-1?te.push(W):te.splice(Y,1),P(te);},je=W=>{if(r)return;let Y=Pe.indexOf(W),te=[...Pe];Y===-1?te.push(W):te.splice(Y,1),Ve(te);},mt=W=>{a().includes(W)&&D(te=>te.includes(W)?te.filter(Ne=>Ne!==W):[...te,W]);},pt=(W,Y)=>{!W||!Y||W===Y||k(te=>{let Ne=te.indexOf(W),he=te.indexOf(Y);if(Ne===-1||he===-1)return te;let Ae=[...te];return Ae.splice(Ne,1),Ae.splice(he,0,W),Ae});},Ot=W=>{let Y=W?.active?.id,te=W?.over?.id;typeof Y=="string"&&typeof te=="string"&&pt(Y,te);},Kt=W=>{t.onLayoutSave&&t.onLayoutSave({visibleColumns:C,columnOrder:w,order:o?"asc":l,orderBy:o?"":u,sortBy:o?[]:f,grouping:Pe,columnWidths:F,showSummary:I,summaryColumns:E});},yt=W=>{let{layout:Y,layoutId:te}=Ei(W,t.tableKey||"default");te?(De(te),be(te)):(De(""),be("")),Y&&(Y.visibleColumns&&P(Y.visibleColumns),Array.isArray(Y.columnOrder)&&k(Y.columnOrder),o?(d("asc"),p(""),b([])):(Y.order&&d(Y.order),Y.orderBy&&p(Y.orderBy),Array.isArray(Y.sortBy)&&b(Y.sortBy)),Y.grouping&&Ve(Y.grouping),Y.columnWidths&&q(Y.columnWidths),Y.showSummary!==void 0&&S(!!Y.showSummary),Array.isArray(Y.summaryColumns)&&D(Y.summaryColumns));},bt=W=>{let Y=W?.layoutData||W?.layout||W||{};Y.visibleColumns&&P(Y.visibleColumns),Array.isArray(Y.columnOrder)&&k(Y.columnOrder),o?(d("asc"),p(""),b([])):(Y.order&&d(Y.order),Y.orderBy!==void 0&&p(Y.orderBy),Array.isArray(Y.sortBy)&&b(Y.sortBy)),Y.grouping&&Ve(Y.grouping),Y.columnWidths&&q(Y.columnWidths),Y.showSummary!==void 0&&S(!!Y.showSummary),Array.isArray(Y.summaryColumns)&&D(Y.summaryColumns),O(new Set),v(0),W?.id&&be(W.id),De("");};Jt.useEffect(()=>{t.layout&&yt({layout:t.layout});},[t.layout]);let xr=W=>{W.preventDefault(),Q(Z===null?{mouseX:W.clientX+2,mouseY:W.clientY-6}:null);},Tt=()=>{Q(null);},Ft=Jt.useMemo(()=>{if(!I)return {};let W={};t.columns.forEach(te=>{if(te.numeric&&E.includes(te.id)){let Ne=xe.reduce((he,Ae)=>{let Ke=parseFloat(Ae[te.id]);return he+(isNaN(Ke)?0:Ke)},0);W[te.id]=Ne.toFixed(2);}else W[te.id]="";});let Y=t.columns.find(te=>C.includes(te.id)&&!te.numeric);return Y&&!Y.numeric&&(W[Y.id]="Total"),W},[xe,t.columns,I,E,C]),ut=()=>{if(!t.columns||!xe)return;let W=t.columns.map(Ae=>Ae.label).join(","),Y=xe.map(Ae=>t.columns.map(Ke=>{let et=Ae[Ke.id];return `"${(et==null?"":String(et)).replace(/"/g,'""')}"`}).join(",")).join(`
|
|
184
|
-
`),
|
|
185
|
-
${Y}`,Ne=encodeURI(te),he=document.createElement("a");he.setAttribute("href",Ne),he.setAttribute("download",`${t.title||"export"}.csv`),document.body.appendChild(he),he.click(),document.body.removeChild(he);},Bt=()=>{se(true);},we=()=>{se(false);};return {isMobile:false,columns:Te,order:l,setOrder:d,orderBy:u,setOrderBy:p,sortBy:f,setSortBy:b,applyMultiSort:re,clearMultiSort:nt,columnOrder:w,setColumnOrder:k,filterText:i,setFilterText:s,visibleColumns:C,setVisibleColumns:P,showSummary:I,setShowSummary:S,summaryColumns:E,grouping:Pe,setGrouping:Ve,expandedGroups:N,setExpandedGroups:O,groupAnchorEl:$,setGroupAnchorEl:_,summaryAnchorEl:V,setSummaryAnchorEl:B,columnWidths:F,setColumnWidths:q,anchorEl:z,setAnchorEl:X,contextMenu:Z,setContextMenu:Q,sensors:void 0,sortedAndFilteredRows:We,visibleRows:ye,summaryRow:Ft,page:m,setPage:ee,rowsPerPage:y,setRowsPerPage:Ie,totalDisplayCount:Le,selected:x,setSelected:h,isAllExpanded:U.length>0&&U.every(W=>N.has(W)),handleColumnResize:Be,handleRequestSort:Lt,handleSelectAllClick:ce,handleClick:fe,toggleSummaryColumn:mt,handleDragEnd:Ot,handleColumnReorder:pt,handleExport:ut,handleContextMenu:xr,handleCloseContextMenu:Tt,toggleColumnVisibility:Re,toggleGroupExpand:st,toggleGroupField:je,handleToggleAll:St,handleExpandGroupRecursively:Je,handleCollapseGroupRecursively:vt,isGroupFullyExpanded:Et,handleLayoutLoad:bt,handleVariantLoad:yt,handleLayoutSave:Kt,effectiveAppId:t.appId||"",currentLayoutData:{visibleColumns:C,order:o?"asc":l,orderBy:o?"":u,sortBy:o?[]:f,columnOrder:w,grouping:Pe,columnWidths:F,showSummary:I,summaryColumns:E},currentLayoutId:le,layoutIdToLoad:_e,onPageChange:ee,onRowsPerPageChange:Ie,graphReportOpen:ge,handleOpenGraphReport:Bt,handleCloseGraphReport:we}};T();var lD=t=>e("tbody",{...t}),cD=({align:t,...r})=>e("td",{align:t==="inherit"?void 0:t,...r}),dD=t=>e("div",{...t}),pD=t=>e("thead",{...t}),uD=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:P,quickEdit:w,quickDelete:k,serviceUrl:I,disableGrouping:S=false,disableSorting:E=false}=t,D=n||r("table.title.default"),{isMobile:R,columns:A,order:N,orderBy:O,filterText:F,setFilterText:q,visibleColumns:z,showSummary:X,setShowSummary:$,summaryColumns:_,grouping:V,setGrouping:B,expandedGroups:Z,groupAnchorEl:Q,setGroupAnchorEl:ge,summaryAnchorEl:se,setSummaryAnchorEl:le,columnWidths:be,anchorEl:_e,setAnchorEl:De,contextMenu:Pe,sensors:Ve,sortedAndFilteredRows:Te,summaryRow:xe,visibleRows:We,isAllExpanded:ot,page:it,setPage:Ze,rowsPerPage:U,setRowsPerPage:Fe,totalDisplayCount:ye,setSelected:Le,handleColumnResize:st,handleRequestSort:Je,handleSelectAllClick:vt,handleClick:St,toggleSummaryColumn:Et,handleDragEnd:Lt,handleExport:re,handleContextMenu:nt,handleCloseContextMenu:Be,toggleColumnVisibility:ce,toggleGroupExpand:fe,handleToggleAll:ee,handleExpandGroupRecursively:Ie,handleCollapseGroupRecursively:Re,isGroupFullyExpanded:je,handleLayoutLoad:mt,handleVariantLoad:pt,handleLayoutSave:Ot,effectiveAppId:Kt,currentLayoutData:yt,currentLayoutId:bt,layoutIdToLoad:xr,graphReportOpen:Tt,handleOpenGraphReport:Ft,handleCloseGraphReport:ut}=bn(t),Bt=C?.enabled??false,we=Bt&&(C?.interaction?.enabled??true),W=Ii(),Y=!!P?.enabled,te=!!w?.enabled,Ne=!!k?.enabled,he=P?.fields,Ae=P?.excludeFields||[],Ke=P?.initialValues||{},[et,qe]=Jt__namespace.default.useState(false),[Ct,Nt]=Jt__namespace.default.useState(false),[wt,xt]=Jt__namespace.default.useState({}),[H,j]=Jt__namespace.default.useState(false),[me,Se]=Jt__namespace.default.useState(false),[tt,Xe]=Jt__namespace.default.useState({}),[It,ft]=Jt__namespace.default.useState(false),[gt,kt]=Jt__namespace.default.useState(false),nr=m||Ct||me||gt,Ht=Jt__namespace.default.useMemo(()=>{let oe=[...A];if(Array.isArray(he)&&he.length>0){let ue=new Set(he);oe=oe.filter(J=>ue.has(J.id));}if(Ae.length>0){let ue=new Set(Ae);oe=oe.filter(J=>!ue.has(J.id));}return oe.filter(ue=>!!ue?.id)},[A,Ae,he]),Yt=x||"id",Vt=Jt__namespace.default.useMemo(()=>{let oe=new Set(s);return Te.filter(ue=>oe.has(ue?.[Yt]))},[s,Te,Yt]),qt=Vt.length===1?Vt[0]:null,$t=w?.fields,rr=w?.excludeFields||[],ar=w?.editableFields||[],gr=w?.nonEditableFields||[],Ir=w?.primaryKeys?.length?w.primaryKeys:[Yt],Rr=Jt__namespace.default.useMemo(()=>{let oe=[...A];if(Array.isArray($t)&&$t.length>0){let ue=new Set($t);oe=oe.filter(J=>ue.has(J.id));}if(rr.length>0){let ue=new Set(rr);oe=oe.filter(J=>!ue.has(J.id));}return oe.filter(ue=>!!ue?.id)},[A,rr,$t]),oo=Jt__namespace.default.useMemo(()=>new Set(Ir),[Ir]),vr=Jt__namespace.default.useMemo(()=>new Set(ar),[ar]),Or=Jt__namespace.default.useMemo(()=>new Set(gr),[gr]),qo=Jt__namespace.default.useCallback(oe=>vr.size>0?vr.has(oe):!(Or.has(oe)||oo.has(oe)),[vr,Or,oo]);Jt__namespace.default.useEffect(()=>{!Tt&&W.hasActiveFilters&&W.clearAll();},[Tt,W.hasActiveFilters,W.clearAll]);let Xo=()=>{let oe={};Ht.forEach(ue=>{oe[ue.id]=Ke[ue.id]??"";}),xt(oe),qe(true);},Lo=()=>{Ct||qe(false);},Yo=(oe,ue)=>{xt(J=>({...J,[oe]:ue}));},Zo=async()=>{if(!P?.onSubmit){qe(false);return}try{Nt(!0),await P.onSubmit(wt),qe(!1);}finally{Nt(false);}},Mr=()=>{if(!qt)return;let oe={};Rr.forEach(J=>{oe[J.id]=qt[J.id]??"";});let ue=w?.getInitialValues?{...oe,...w.getInitialValues(qt)}:oe;Xe(ue),j(true);},Oo=()=>{me||j(false);},jo=(oe,ue)=>{Xe(J=>({...J,[oe]:ue}));},Kr=async()=>{if(qt){if(!w?.onSubmit){j(false);return}try{Se(!0),await w.onSubmit(tt,qt),j(!1);}finally{Se(false);}}},no=()=>{Vt.length!==0&&ft(true);},En=()=>{gt||ft(false);},Fo=async()=>{if(Vt.length===0){ft(false);return}if(!k?.onConfirm){ft(false),Le([]),l?.([]);return}try{kt(!0),await k.onConfirm(Vt),ft(!1),Le([]),l?.([]);}finally{kt(false);}},M=Te,{fieldMapping:G}=un({rows:M,config:{...C,title:C?.title||`${D} ${r("graph.reportTitle")}`}}),K=Jt__namespace.default.useMemo(()=>we?W.applyRows(M,G):M,[we,W.applyRows,M,G]),{model:de}=un({rows:K,config:{...C,title:C?.title||`${D} ${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"})),at=Kt?e(fn,{appId:Kt,tableKey:h,currentLayoutData:yt,onLayoutLoad:mt,targetLayoutId:xr,activeLayoutId:bt,serviceUrl:I??g?.serviceUrl}):null,$e=c(jsxRuntime.Fragment,{children:[!S&&e(dn,{groupAnchorEl:Q,setGroupAnchorEl:ge,grouping:V,setGrouping:B,columns:A}),e(pn,{anchorEl:_e,setAnchorEl:De,columns:A,visibleColumns:z,toggleColumnVisibility:ce}),e(yi,{anchorEl:se,setAnchorEl:le,showSummary:X,setShowSummary:$,columns:A,summaryColumns:_,toggleSummaryColumn:Et}),e(Ci,{contextMenu:Pe,handleCloseContextMenu:Be,columns:A,visibleColumns:z,toggleColumnVisibility:ce})]});return R?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:yt}],variantService:g.variantService,serviceUrl:I??g.serviceUrl}),e(kp,{title:D,loading:m,showSummary:X,setShowSummary:$,setAnchorEl:De,setSummaryAnchorEl:le,filterText:F,setFilterText:q,sortedAndFilteredRows:Te,selected:s,columns:A,visibleColumns:z,summaryRow:xe,handleClick:St,selectionMode:i}),$e]}):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:yt}],currentLayoutId:bt,layoutRefs:[{tableKey:h,layoutId:bt}],variantService:g.variantService,serviceUrl:I??g.serviceUrl})}),c(Ee,{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:q,onRowsPerPageChange:Fe,rowsPerPage:U,rowsPerPageOptions:v,page:it,count:ye,onPageChange:Ze,actions:d,extraTools:u,grouping:V,disableGrouping:S,groupAnchorEl:Q,setGroupAnchorEl:ge,showSummary:X,setShowSummary:$,anchorEl:_e,setAnchorEl:De,summaryAnchorEl:se,setSummaryAnchorEl:le,handleExport:re,showCreateButton:Y,onOpenCreateDialog:Xo,showEditButton:te,onOpenEditDialog:Mr,editDisabled:Vt.length!==1,showDeleteButton:Ne,onOpenDeleteConfirm:no,deleteDisabled:Vt.length===0,onLayoutSave:y||g?.variantService&&g?.appId?Ot:void 0,loading:m,layoutManager:at,onOpenGraphReport:Bt?Ft: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:Ve,collisionDetection:core.closestCenter,onDragEnd:Lt,modifiers:[modifiers.restrictToHorizontalAxis],children:c("table",{className:"orb-tbl orb-ctable",style:{minWidth:f?750:void 0,width:f?"100%":"auto",tableLayout:Object.keys(be).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,fontSize:o},"aria-labelledby":"tableTitle",children:[e(hi,{columns:A,visibleColumns:z,order:N,orderBy:O,onRequestSort:Je,disableSorting:E,onContextMenu:nt,selectionMode:i,grouping:V,isAllExpanded:ot,handleToggleAll:ee,rowCount:Te.length,numSelected:s.length,onSelectAllClick:vt,columnWidths:be,onColumnResize:st}),e(vi,{visibleRows:We,columns:A,visibleColumns:z,selectionMode:i,selected:s,orderBy:O,loading:m,expandedGroups:Z,toggleGroupExpand:fe,handleExpandGroupRecursively:Ie,handleCollapseGroupRecursively:Re,isGroupFullyExpanded:je,handleClick:St,onSelectionChange:l,grouping:V,rowKeyProp:x,page:it,rowsPerPage:U}),X&&e(wp,{showSummary:X,columns:A,visibleColumns:z,summaryRow:xe,selectionMode:i?.toString(),grouping:V,columnWidths:be,orderBy:O,zIndex:3})]})})})]}),Y&&c(zt,{open:et,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:P?.title||r("quickCreate.createWithTitle",{title:D})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Ht.map(oe=>{let ue=oe.type==="number"||oe.numeric?"number":oe.type==="date"?"date":"text",J=oe.label||oe.id;return e(ze,{label:J,value:wt[oe.id]??"",onChange:Oe=>Yo(oe.id,Oe.target.value),type:ue,size:"small",fullWidth:true,InputLabelProps:{shrink:ue==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${oe.id}`)}),P?.description&&e(jr,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:P.description})]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(Ce,{onClick:Lo,sx:{fontSize:"0.85rem"},disabled:Ct,children:P?.cancelLabel||r("common.cancel")}),e(Ce,{onClick:Zo,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Ct,children:P?.submitLabel||r("common.save")})]})]}),te&&c(zt,{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:D})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Rr.map(oe=>{let ue=oe.type==="number"||oe.numeric?"number":oe.type==="date"?"date":"text",J=oe.label||oe.id,Oe=qo(oe.id);return e(ze,{label:J,value:tt[oe.id]??"",onChange:Qe=>jo(oe.id,Qe.target.value),type:ue,size:"small",fullWidth:true,disabled:!Oe,InputLabelProps:{shrink:ue==="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(Ce,{onClick:Oo,sx:{fontSize:"0.85rem"},disabled:me,children:w?.cancelLabel||r("common.cancel")}),e(Ce,{onClick:Kr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:me||!qt,children:w?.submitLabel||r("common.save")})]})]}),Ne&&e(Zn,{open:It,type:"warning",title:k?.title||r("quickDelete.confirmTitle"),message:k?.message||(Vt.length>1?r("quickDelete.confirmMessageMultiple",{count:Vt.length}):r("quickDelete.confirmMessageSingle")),confirmText:k?.confirmText||r("common.delete"),cancelText:k?.cancelText||r("common.cancel"),onClose:En,onConfirm:Fo}),$e,Bt&&e(Pi,{open:Tt,onClose:ut,model:de,aiAssistant:C?.aiAssistant,interaction:we?{enabled:true,filters:W.filters,fieldMapping:G,onPrimaryDimensionClick:oe=>W.setFilter("primaryDimension",oe),onSecondaryDimensionClick:oe=>W.setFilter("secondaryDimension",oe),onStatusClick:oe=>W.setFilter("status",oe),onClearFilter:W.clearFilter,onClearAll:W.clearAll}:void 0,tableContent:e(Jr,{appId:Kt||"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}})})]})},mD=Jr;T();var CD=({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 TD=({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]=Jt.useState(false),[f,b]=Jt.useState([]),[m,v]=Jt.useState({}),[y,g]=Jt.useState(t.variants||[]),[x,h]=Jt.useState(t.layout||null),[C,P]=Jt.useState(""),[w,k]=Jt.useState(0),[I,S]=Jt.useState(0),[E,D]=Jt.useState(o),[R,A]=Jt.useState([]),[N,O]=Jt.useState("asc"),[F,q]=Jt.useState("");Jt.useEffect(()=>{let se={};t.filters.forEach(le=>{le.defaultValue!==void 0&&(se[le.id]=le.defaultValue);}),v(se);},[t.filters]);let z=Jt.useCallback(async(se,le,be,_e,De)=>{p(true);try{let Pe={...se,page:le+1,limit:be,sort:De,order:_e},Ve;r?Ve=await r(Pe):typeof t.api=="function"?Ve=await t.api(Pe):t.api&&typeof t.api=="object"?(console.log("Fetching from URL:",t.api.url,Pe),Ve={rows:[],total:0}):(console.warn("No API configured for report"),Ve={rows:[],total:0}),Ve&&(b(Ve.rows||[]),k(Ve.total||0));}catch(Pe){console.error("Failed to fetch report data",Pe);}finally{p(false);}},[t.api,r]);Jt.useEffect(()=>{z(m,I,E,N,F);},[z,I,E,N,F]);let X=()=>{S(0),z(m,0,E,N,F);},$=se=>{S(0),D(se);},_=(se,le)=>{O(le),q(se);},V=se=>{v(se);},B=se=>{P(se?.id||"");let le=Ai(se,a);if(le){let _e=le.values??le;v(_e),z(_e,0,E,N,F),S(0);}let{layout:be}=Ei(se,a);be&&h(be);},Z=se=>{let le={...se,id:Date.now().toString(),createdAt:new Date().toISOString()};g(be=>[...be,le]);},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:X,onVariantLoad:B,onVariantSave:Z,onVariantDelete:se=>g(le=>le.filter(be=>be.id!==se)),onVariantSetDefault:se=>{g(le=>le.map(be=>({...be,isDefault:be.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:E,rowsPerPageOptions:n,onPageChange:S,onRowsPerPageChange:$,selectionMode:"multiple",selected:R,onSelectionChange:A,onLayoutSave:Q,layout:x,title:t.title,showSummary:true,order:N,orderBy:F,serviceUrl:s,onSortChange:_,graphReport:t.graphReport||{enabled:true,title:`${t.title} ${d("graph.reportTitle")}`}}},filters:m,rows:f,loading:u,refresh:X}};T();var Dh=new Set(["id","title","description","icon","iconNode","meta"]),Nh=t=>t.replace(/([A-Z])/g," $1").replace(/[._-]+/g," ").replace(/^\w/,r=>r.toUpperCase()).trim(),Ah=t=>Object.entries(t).filter(([r,o])=>!Dh.has(r)&&o!==null&&o!==void 0&&["string","number","boolean"].includes(typeof o)).map(([r,o])=>({key:r,label:Nh(r),value:String(o)})),Qp=({item:t,open:r,onClose:o,onDownloadClick:n,renderContent:a,downloadTooltip:i,closeTooltip:s})=>{let{t:l}=pe(),u=yr()==="dark"?"var(--orb-p300)":"var(--orb-primary)";Jt__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=Ah(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(Mt,{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(Mt,{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(Ce,{variant:"contained",sx:{width:"100%"},startIcon:e(Mt,{name:"download",size:16}),onClick:()=>n(t),children:i??l("cardPage.download")})}):null]})]}),document.body)};T();var Eh={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",overflow:"hidden"},Lh=({item:t,onDetailClick:r,onDownloadClick:o,detailTooltip:n,downloadTooltip:a})=>{let{t:i}=pe(),l=yr()==="dark"?"var(--orb-p300)":"var(--orb-primary)",d=t.iconNode??e(Mt,{name:t.icon??"product",size:26,style:{color:l}});return c(Ee,{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",...Eh},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(Mt,{name:"show",size:18})}),e(ae,{tooltip:a??i("cardPage.download"),"aria-label":a??i("cardPage.download"),onClick:()=>o?.(t),children:e(Mt,{name:"download",size:18})})]})]})},eu=({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]=Jt__namespace.default.useState(null),[m,v]=Jt__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(Lh,{item:x,onDetailClick:y,onDownloadClick:n,detailTooltip:i,downloadTooltip:s},x.id))}),d&&f?e(Qp,{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")})})};T();var XD=({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(eu,{...a})})]}),i]})};var JD=({metadata:t,fetchData:r,tableKey:o="default",variantService:n,serviceUrl:a,onDetailClick:i,onDownloadClick:s,minCardWidth:l})=>{let[d,u]=Jt.useState(false),[p,f]=Jt.useState([]),[b,m]=Jt.useState(0),[v,y]=Jt.useState({}),[g,x]=Jt.useState(t.variants||[]),[h,C]=Jt.useState("");Jt.useEffect(()=>{let D={};t.filters.forEach(R=>{R.defaultValue!==void 0&&(D[R.id]=R.defaultValue);}),y(D);},[t.filters]);let P=Jt.useCallback(async D=>{u(true);try{let R=r?await r({...D}):{rows:[],total:0};f(R?.rows||[]),m(R?.total||0);}catch(R){console.error("Failed to fetch card page data",R);}finally{u(false);}},[r]);Jt.useEffect(()=>{P(v);},[P]);let w=()=>{P(v);},k=D=>{y(D);},I=D=>{C(D?.id||"");let R=Ai(D,o);if(R){let A=R.values??R;y(A),P(A);}},S=D=>{let R={...D,id:Date.now().toString(),createdAt:new Date().toISOString()};x(A=>[...A,R]);};return {pageProps:{id:t.id,title:t.title,filterConfig:{appId:t.id,tableKey:o,fields:t.filters,filters:v,onFilterChange:k,onSearch:w,onVariantLoad:I,onVariantSave:S,onVariantDelete:D=>x(R=>R.filter(A=>A.id!==D)),onVariantSetDefault:D=>{x(R=>R.map(A=>({...A,isDefault:A.id===D})));},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 Fh=t=>[...t].sort((r,o)=>o.value-r.value),rN=({bars:t=[],lines:r=[],combos:o=[],heatmap:n=[],pies:a=[],waterfalls:i=[]})=>{let s=Jt.useMemo(()=>Fh(t),[t]),l=Jt.useMemo(()=>[...r],[r]),d=Jt.useMemo(()=>[...o],[o]),u=Jt.useMemo(()=>[...n],[n]),p=Jt.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=Jt.useMemo(()=>[...i],[i]);return {bars:s,lines:l,combos:d,heatmap:u,pies:p,waterfalls:f}};var sN=({apiKey:t,query:r,zoom:o=14,mapType:n="roadmap"})=>Jt.useMemo(()=>!t||!r?"":ra({apiKey:t,query:r,zoom:o,mapType:n}),[t,r,o,n]),lN=({keyword:t,location:r})=>Jt.useMemo(()=>wi({keyword:t,location:r?{lng:r.lng,lat:r.lat,name:r.name}:void 0}),[t,r]);T();var sa=({code:t,language:r="text",copyable:o=true,showLineNumbers:n=false,wrapLongLines:a=false,maxHeight:i})=>{let[s,l]=Jt.useState(false),d=Jt.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})})]})};
|
|
187
|
-
`).map(s=>s.trim()).filter(Boolean);if(r.length<2)return null;let o=dl(r[0]),n=dl(r[1]);if(o.length===0||n.length!==o.length||!n.every(
|
|
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:pm(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,D=I.clientY-S.top,M=S.width,N=S.height,E=Math.min(M,N),O=M/2,F=N/2,X=(A-O)/E*2,H=(D-F)/E*2;Math.sqrt(X*X+H*H)<.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=pm(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 Iy(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 pm(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 Iy(n,a,i)}return new ogl.Vec3(0,0,0)}var mm=As(()=>{"use strict";"use client";P();});var _g={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"},Gg={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"},Es={light:_g,dark:Gg},k0='"Montserrat", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif',P0=t=>{let r=Es[t];return [r.primary,r.p300,r.muted,r.p700]},T0=10,I0="0.2s ease";P();var wc=er.createContext({mode:"light",setting:"light"}),rf=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(()=>{rf(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,Os=()=>Es[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 af={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},sf=t=>typeof t=="number"?`${t}px`:t,lf={"2.5":10,3:12,"3.5":14,4:16,5:20,6:24,7:28,8:32,10:40,12:48},cf=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?lf[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=sf(r??cf(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(af[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"),Y0=ne("down","ArrowDown"),Z0=ne("navigationRight","ArrowRight"),Ic=ne("up","ArrowUp"),Fs=ne("barChart","BarChart"),j0=ne("activate","Bot"),Bs=ne("calendar","Calendar"),Q0=Bs,J0=ne("camera","Camera"),eS=ne("lineChart","ChartNoAxesCombined"),qr=ne("accept","Check"),Ia=ne("accept","CheckCircle"),Fr=ne("slimDown","ChevronDown"),Ma=ne("navigationLeft","ChevronLeft"),Br=ne("navigationRight","ChevronRight"),tS=ne("slimUp","ChevronUp"),rS=ne("expandAll","ChevronsDown"),oS=ne("collapseAll","ChevronsUp"),Ra=ne("error","CircleAlert"),Bn=ne("accept","CircleCheck"),nS=Bn,Mc=ne("stop","CircleStop"),Rc=ne("copy","Clipboard"),aS=ne("checklist","ClipboardCheck"),iS=ne("checklist","ClipboardList"),Dc=ne("time","Clock"),sS=ne("tableColumn","Columns3"),vo=ne("copy","Copy"),lS=ne("duplicate","CopyPlus"),cS=ne("delete","Delete"),dS=ne("download","Download"),Nc=ne("edit","Edit"),Ac=ne("fullScreen","Expand"),pS=ne("show","Eye"),uS=ne("hide","EyeOff"),Da=ne("document","File"),Ec=ne("document","FileText"),mS=ne("filter","Filter"),Hn=ne("tree","FolderTree"),Lc=ne("process","GitBranch"),zn=ne("world","Globe"),Oc=ne("grid","Grid"),gS=ne("move","GripVertical"),fS=ne("wrench","Hammer"),Fc=ne("picture","Image"),Na=ne("information","Info"),bS=ne("translate","Languages"),hS=ne("dimension","Layers"),vS=ne("home","LayoutDashboard"),Aa=ne("lightbulb","Lightbulb"),Bc=ne("lineChart","LineChart"),Hc=ne("synchronize","Loader2"),Ea=ne("locked","Lock"),yS=Ea,zc=ne("log","LogOut"),Hs=ne("email","Mail"),Vc=ne("map","MapPin"),Wc=ne("menu","Menu"),df=ne("message","MessageCircle"),$c=df,La=ne("microphone","Mic"),CS=ne("microphone","MicOff"),_c=ne("darkMode","Moon"),xS=ne("overflow","MoreHorizontal"),SS=ne("accept","PackageCheck"),wS=ne("product","PackageSearch"),Oa=ne("splitOne","PanelLeftOpen"),Fa=ne("splitTwo","PanelRight"),kS=ne("overview","PanelsTopLeft"),Gc=ne("pieChart","PieChart"),Jo=ne("pushpin","Pin"),PS=ne("play","Play"),en=ne("add","Plus"),TS=ne("qrCode","QrCode"),IS=ne("receipt","ReceiptText"),Ba=ne("refresh","RefreshCw"),MS=ne("activate","Rocket"),RS=ne("refresh","RotateCcw"),Uc=ne("refresh","RotateCw"),DS=ne("tableRow","Rows3"),NS=ne("save","Save"),AS=ne("qrCode","ScanLine"),Hr=ne("search","Search"),pf=ne("paperPlane","Send"),Kc=pf,tn=ne("wrench","Settings"),ES=ne("accept","ShieldCheck"),LS=ne("sum","Sigma"),OS=ne("sort","SortAsc"),FS=ne("splitTwo","SquareSplitHorizontal"),BS=ne("favorite","Star"),qc=ne("lightMode","Sun"),HS=ne("table","Table2"),zS=ne("ipad","TabletSmartphone"),Vn=ne("command","Terminal"),Xc=ne("thumbDown","ThumbsDown"),Yc=ne("thumbUp","ThumbsUp"),Zc=ne("delete","Trash2"),VS=ne("tree","TreePine"),jc=ne("trendDown","TrendingDown"),Ha=ne("warning","TriangleAlert"),WS=ne("shipping","Truck"),Qc=ne("upload","UploadCloud"),zs=ne("employee","User"),Jc=ne("sound","Volume2"),$S=ne("factory","Warehouse"),_S=ne("process","Workflow"),jt=ne("decline","X"),za=ne("error","XCircle");_t();P();var mf={contained:"primary",outlined:"secondary",text:"ghost"},gf={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=mf[t]??t,g=["orb-btn",`orb-btn-${y}`,gf[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:D,onClick:M,startAdornment:N,endAdornment:E,InputProps:O,inputProps:F,InputLabelProps:X,SelectProps:H,sx:Y,className:W},j)=>{let V=er.useId(),z=y??`orb-tf-${V}`,U=N??O?.startAdornment,K=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}),U||K?c("div",{className:"orb-inp-adornment-wrap",children:[U&&e("span",{className:"orb-inp-adornment",children:U}),K&&e("span",{className:"orb-inp-adornment orb-inp-adornment-end",children:K}),$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:D},M)=>{let N=er.useId(),E=I??`orb-sel-${N}`,F=(typeof k=="string"?k:void 0)??w,X=er.useRef(null),H=er.useRef(null),[Y,W]=er.useState(false),[j,V]=er.useState(180),[z,U]=er.useState(a??"");er.useImperativeHandle(M,()=>X.current);let K=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??K,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":""} ${D??""}`,{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&&U(Me);let Pe=X.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:X,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(H.current?.getBoundingClientRect().width??180),W(Me);},children:[e(Nr__namespace.Trigger,{asChild:true,children:c("button",{ref:H,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 If=({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 Df={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":Df[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%; } }"})]})},Lf=({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:D=>{!I&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),w.onClick?.(D));},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 Uf={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"},Kf={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??Kf[t]??"span",v=[t==="inherit"?void 0:Uf[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 Xf=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:Xf(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 Ws=({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 Jf=["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??ro__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 D=[];for(let M=0;M<7;M+=1)D.push(S),S=S.add(1,"day");if(I.push(D),S.isAfter(v.endOf("month"))&&A>=3)break}return I},[v]),h=er.useMemo(()=>{let w=u?ro__default.default().locale(u):ro__default.default();return Jf.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(ro__default.default(),"day"),D=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,D?"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();ro__default.default.extend(eb__default.default);var tb=({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=ro__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(Ws,{open:C,onOpenChange:k,trigger:c("div",{className:"orb-inp-adornment-wrap",style:{width:"100%"},children:[e("span",{className:"orb-inp-adornment",children:e(Bs,{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 ob=({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(Qc,{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(Ec,{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(Zc,{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"},od=()=>"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 lb=classVarianceAuthority.cva(od(),{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"}}),Gs=er__namespace.forwardRef(({className:t,variant:r,size:o,asChild:n=false,...a},i)=>e(n?reactSlot.Slot:"button",{className:br(lb({variant:r,size:o,className:t})),ref:i,...a}));Gs.displayName="Button";var cb={"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"},db={"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"},pb={"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"},ub={"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"},mb={"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"},gb={"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:cb,zh:db,fr:pb,de:ub,ja:mb,ko:gb};P();var ad=(t,r)=>r?t.replace(/\{(\w+)\}/g,(o,n)=>{let a=r[n];return a==null?"":String(a)}):t,vb={locale:"en",t:(t,r)=>ad(qn.en[t]||t,r)},id=er.createContext(vb),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)=>ad(s[l]||l,d)}},[t,r]);return e(id.Provider,{value:n,children:o})},pe=()=>er.useContext(id);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,D=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(Gs,{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:`${D}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 Sb="orbcafe:navigation-island:pinned-items",Us="orbcafe-navigation-pinned",wb=t=>t.appurl||t.href,ld=t=>{let r=[];return t.forEach(o=>{let n=!!o.children?.length;o.pinnable!==false&&wb(o)&&!n&&r.push({...o,children:void 0}),o.children?.length&&r.push(...ld(o.children));}),r},cd=({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=Sb,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,D]=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){D(true);return}try{let z=window.localStorage.getItem(p);if(z){let U=JSON.parse(z);Array.isArray(U)&&S(U.filter(K=>typeof K=="string"));}}catch{}finally{D(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(Us))return z;let U=new Set(z);return U.add(Us),U});},[t,N.length,u]);let O=er.useCallback(z=>{let U=Array.from(new Set(z));M||S(U),m?.(U);},[M,m]),F=er.useCallback(z=>{let U=z.id,K=E.has(U)?N.filter(fe=>fe!==U):[...N,U];O(K);},[N,E,O]),X=er.useMemo(()=>{if(!u||N.length===0)return a;let z=new Map(ld(a).map(K=>[K.id,K])),U=N.map(K=>z.get(K)).filter(K=>!!K);return U.length===0?a:[{id:Us,title:v||y("navigation.pinned"),icon:e(Jo,{className:"w-4 h-4"}),children:U,pinnable:false},...a]},[N,u,a,v,y]),H=er.useCallback(z=>{let U=[],K=fe=>{fe.forEach(se=>{U.push(se.id),se.children&&K(se.children);});};return K(z),U},[]),Y=er.useMemo(()=>{if(!C.trim())return X;let z=U=>U.reduce((K,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)&&K.push({...fe,children:ue.length>0?ue:fe.children}),K},[]);return z(X)},[C,X]),W=er.useMemo(()=>C.trim()?new Set(H(X)):w,[C,X,w,H]),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(K){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",K),h.push("/chat");}return}let U=z.appurl||z.href;U&&(U.startsWith("http://")||U.startsWith("https://")?window.open(U,"_blank"):h.push(U));},[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 U=new Set(w);Y.some(fe=>fe.id===z)?U.has(z)?U.delete(z):(Y.forEach(fe=>{fe.id!==z&&U.has(fe.id)&&U.delete(fe.id);}),U.add(z)):U.has(z)?U.delete(z):U.add(z),T(U);}})}),t&&e("div",{className:"space-y-2",children:X.map(z=>e("div",{className:"space-y-1",children:e("button",{onClick:()=>{r();let U=new Set([z.id]);T(U);},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 Pb="orbcafe:navigation-island:pinned-items",Ks="orbcafe-navigation-pinned",dd=t=>t.appurl||t.href,pd=t=>t.flatMap(r=>{let o=!!r.children?.length,n=r.pinnable!==false&&dd(r)&&!o?[{...r,children:void 0}]:[];return r.children?.length?[...n,...pd(r.children)]:n}),ud=t=>t.flatMap(r=>[r.id,...r.children?ud(r.children):[]]),md=(t,r)=>t.reduce((o,n)=>{let a=n.children?md(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},[]),qs=({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=Pb,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),D=f!==void 0,M=f??T,N=er.useMemo(()=>new Set(M),[M]);er.useEffect(()=>{t&&w(new Set);},[t]),er.useEffect(()=>{if(!u||D){A(true);return}try{let z=window.localStorage.getItem(p);if(z){let U=JSON.parse(z);Array.isArray(U)&&I(U.filter(K=>typeof K=="string"));}}catch{}finally{A(true);}},[u,D,p]),er.useEffect(()=>{if(!(!u||D||!S))try{window.localStorage.setItem(p,JSON.stringify(M));}catch{}},[M,u,D,p,S]),er.useEffect(()=>{!u||t||M.length===0||w(z=>{if(z.has(Ks))return z;let U=new Set(z);return U.add(Ks),U});},[t,M.length,u]);let E=er.useCallback(z=>{let U=Array.from(new Set(z));D||I(U),m?.(U);},[D,m]),O=er.useCallback(z=>{E(N.has(z.id)?M.filter(U=>U!==z.id):[...M,z.id]);},[M,N,E]),F=er.useMemo(()=>{if(!u||M.length===0)return a;let z=new Map(pd(a).map(K=>[K.id,K])),U=M.map(K=>z.get(K)).filter(K=>!!K);return U.length===0?a:[{id:Ks,title:v||y("navigation.pinned"),icon:e(Jo,{className:"h-4 w-4"}),children:U,pinnable:false},...a]},[M,u,a,v,y]),X=h.trim().toLocaleLowerCase(),H=er.useMemo(()=>X?md(F,X):F,[F,X]),Y=er.useMemo(()=>X?new Set(ud(H)):k,[k,H,X]),W=er.useCallback(z=>{w(U=>{let K=new Set(U),fe=H.some(se=>se.id===z);return K.has(z)?K.delete(z):(fe&&H.forEach(se=>K.delete(se.id)),K.add(z)),K});},[H]),j=er.useCallback(z=>{let U=dd(z);U&&(z.id==="chat"||z.appurl==="/chat"?g.push("/chat?new=true"):/^https?:\/\//.test(U)?window.open(U,"_blank","noopener,noreferrer"):g.push(U));},[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:H.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(X?"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:H,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}})})})]})};qs.displayName="NavigationIsland2";var fd=(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 Ys=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);}},ao=new Ys,dT={success:(t,r)=>ao.show("success",t,r),error:(t,r)=>ao.show("error",t,r),warning:(t,r)=>ao.show("warning",t,r),info:(t,r)=>ao.show("info",t,r),show:(t,r,o)=>ao.show(t,r,o),hide:()=>ao.hide()};P();var Ib={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=Ib[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})]})]})},vT=()=>{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 ao.register(s),()=>ao.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 wT=({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 TT=({dense:t,sx:r,className:o,children:n,...a})=>e("ul",{...a,className:o,style:{listStyle:"none",margin:0,padding:0,...r},children:n}),IT=({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}),MT=({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}),RT=({children:t,sx:r})=>e("div",{style:{marginRight:16,display:"flex",alignItems:"center",minWidth:40,...r},children:t}),DT=({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})]}),NT=({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}),AT=({children:t,sx:r})=>e("div",{style:{marginRight:12,display:"flex",alignItems:"center",...r},children:t});P();var OT=({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"),hd=ir("a","orb-link"),Bo=Ae,vd=ie,hr=L;var yd=ae;var Cd=Dt,jr=on,Qa=rn,Ja=Wa;var ei=Va,xd=Xr,Sd=({value:t,variant:r,color:o,sx:n})=>e($n,{value:r==="determinate"?t:void 0,color:o,sx:n}),wd=ir("table","orb-tbl"),kd=ir("tbody"),Qs=ir("td"),Pd=ir("div","orb-table-container"),Td=ir("thead"),Js=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 io=ir("span","orb-input-adornment"),Id=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})]}),Eb=({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]}),Lb=ir("span","orb-list-item-icon"),Gt=Eb,zr=Lb;ir("div","orb-list-subheader");var el=({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}),Md=({children:t,container:r})=>typeof document>"u"?null:reactDom.createPortal(t,r??document.body),Rd=ir("div","orb-toolbar"),Dd=({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)},Nd=({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)},Ad=({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)}),Ed=({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 Ld=({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()})},Od=({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}),Fd=({children:t})=>e(jsxRuntime.Fragment,{children:t}),ja=class{};_t();P();var Ob=(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:Ob(o,n),className:u.className,style:u.style,"aria-label":d["aria-label"]??l,...d})},So=xe("tree"),Ho=xe("add"),Bd=xe("duplicate"),tl=xe("down"),Hd=xe("navigationRight"),zd=xe("navigationRight"),rl=xe("up"),Vd=xe("delete"),Wd=xe("camera"),$d=xe("accept"),_d=xe("accept"),ri=xe("navigationRight"),Gd=xe("dimension"),Ud=xe("decline"),wo=xe("decline"),Kd=xe("decline"),qd=xe("decline"),oi=xe("delete"),ni=xe("delete"),Xd=xe("download"),Yd=xe("move"),Zd=xe("edit"),an=xe("slimDown"),jd=xe("filter"),sn=xe("sum"),Qd=xe("lineChart"),Jd=xe("document"),Vr=xe("slimDown"),ep=xe("navigationLeft"),ko=xe("navigationRight"),ai=xe("slimUp"),ii=xe("navigationLeft"),si=xe("navigationRight"),tp=xe("dimension"),rp=xe("splitOne"),li=xe("menu"),op=xe("microphone"),np=xe("microphone"),ap=xe("microphone"),ip=xe("qrCode"),Po=xe("save"),zo=xe("search"),sp=xe("search"),lp=xe("paperPlane"),cp=xe("paperPlane"),dp=xe("wrench"),pp=xe("sort"),ci=xe("splitTwo"),up=xe("favorite"),mp=xe("favorite"),gp=xe("stop"),fp=xe("tableRow"),di=xe("collapseAll"),pi=xe("expandAll"),ln=xe("tableColumn"),bp=xe("overview"),hp=xe("hide");P();var Bb=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],yp=t=>Array.isArray(t)?t:t==null||t===""?[]:[t],kr=t=>String(t),Cp=(t,r)=>t[r],xp=t=>{let r=t.value??t.id??t.key??t.code;return typeof r=="number"||typeof r=="string"?r:""},Hb=t=>{let r=t.label??t.description??t.name??t.title;return String(typeof r=="number"||typeof r=="string"?r:xp(t))},zb=t=>{let r=t.description??t.subtitle;return typeof r=="number"||typeof r=="string"?String(r):void 0},Sp=({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=xp,getOptionLabel:C=Hb,getOptionDescription:k=zb,onChange:w,onSearch:T,disabled:I,InputProps:S,onFocus:A,onBlur:D,onKeyDown:M,error:N,helperText:E,...O})=>{let F=Cr(),X=n==="multiple",[H,Y]=er.useState(false),[W,j]=er.useState(false),[V,z]=er.useState(""),[U,K]=er.useState(null),[fe,se]=er.useState(false),[ue,Se]=er.useState(()=>yp(t)),[$e,ke]=er.useState(""),[le,Ee]=er.useState(""),Me=er.useMemo(()=>o&&o.length>0?o:Bb,[o]),Pe=U??r,Ve=er.useMemo(()=>{let te=[...g,...r,...U??[]],he=new Map;return te.forEach(Ne=>{he.set(kr(h(Ne)),Ne);}),he},[h,r,U,g]),tt=er.useMemo(()=>yp(t),[t]),nt=er.useMemo(()=>tt.map(String).join(", "),[tt]);er.useEffect(()=>{H||Se(tt);},[H,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=>Cp(Ne,st.field))].some(st=>String(st??"").toLowerCase().includes(te)))},[Pe,k,C,h,T,V,Me]),q=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 X?tt.length>2?`${tt.length} selected`:tt.map(te).join(", "):te(tt[0])},[x,C,X,Ve,tt]),De=er.useCallback(async()=>{if(T){se(true);try{let te=await T(V);Array.isArray(te)&&K(te);}finally{se(false);}}},[T,V]),ye=()=>{I||(Se(tt),Y(true));},Be=()=>{Y(false);},at=()=>{w?.(X?[]:null,X?[]:null),Se([]),ke(""),Ee("");},Ze=te=>{let he=h(te);if(X){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);X?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(X){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:q;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),D?.(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:H,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}),X?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(io,{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:()=>{X||(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=Cp(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:!X&&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 ol={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"},nl={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}},wp={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 Vb={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:Vb,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(ep,{})}),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(io,{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(Rd,{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(Xd,{})})})]}),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(Zd,{})})})}),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(Qd,{})})}),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",D),document.body.style.cursor="col-resize";},A=W=>{if(!T.current)return;let{startX:j,startWidth:V,colId:z}=T.current,U=W.clientX-j,K=Math.max(50,V+U);g&&g(z,K);},D=()=>{w(null),T.current=null,document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",D),document.body.style.cursor="";};er.useEffect(()=>()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",D);},[]);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}])),X=O.map(W=>{let j=x?.[W.id]||W.minWidth||100,V=F.get(W.id);return e(Xb,{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)}),H=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:H,strategy:sortable.horizontalListSortingStrategy,children:X}):X]});return e("thead",{children:Y})},Xb=({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(Dd,{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||[],D=A.filter(W=>h(W)).length,M=A.length>0&&D===A.length,N=D>0&&D<A.length,E={entry:T,data:T,id:T.id,index:I,selected:M,group:true},O=x?.(E)||{},{className:F,onClick:X,...H}=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",{...H,"data-ctable-row-key":y?.(E),className:["orb-table-group-row",F].filter(Boolean).join(" "),onClick:X,sx:W=>({backgroundColor:"var(--orb-surface)","& th, & td":{color:W.palette.text.primary,borderBottomColor:W.palette.divider},"& .orb-icon-btn":{color:W.palette.text.primary},"& .orb-chk":{color:W.palette.text.secondary},"& .orb-chk:has(input:checked), & .orb-chk:has(input:indeterminate)":{color:W.palette.primary.main}}),children:[C&&e("td",{padding:"checkbox",sx:ol,children:e(It,{size:"small",checked:M,indeterminate:N,onChange:Y,onClick:W=>W.stopPropagation(),sx:Jn})}),k&&e("td",{padding:"checkbox",sx:nl,children:c("div",{sx:wp,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,D=h(A),M=`enhanced-table-checkbox-${I}`,N={entry:T,data:S,id:A,index:I,selected:D,group:false},E=g?.(N)||{},{className:O,onClick:F,...X}=E,Y=(T.level!==void 0?T.level:0)*4;return c("tr",{...X,"data-ctable-row-key":y?.(N),className:[D?"orb-is-selected":"",O].filter(Boolean).join(" "),onClick:W=>{F?.(W),W.defaultPrevented||i?.(W,S);},role:C?"checkbox":X.role,"aria-checked":C?D:X["aria-checked"],tabIndex:X.tabIndex??-1,children:[C&&e("td",{padding:"checkbox",sx:ol,children:e(It,{color:"primary",checked:D,inputProps:{"aria-labelledby":M},sx:Jn})}),k&&e("td",{padding:"checkbox",sx:nl}),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 K=S[W.id];if(W.numeric){if(typeof K=="number")return K.toLocaleString();if(typeof K=="string"&&K.trim()!==""&&!isNaN(Number(K)))return Number(K).toLocaleString()}return K})()},W.id)})]},A)}}),o.length===0&&e("tr",{children:e("td",{colSpan:w,align:"center",children:v??r("common.noData")})})]})};P();var kp=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 Pp=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))]})},Rp=({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",D=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(rl,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.sortAsc")})]}),c("option",{onClick:()=>{f(h),r();},selected:A,children:[e(zr,{children:e(tl,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.sortDesc")})]}),D&&c("option",{onClick:()=>{b(h),r();},children:[e(zr,{children:e(Gd,{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(hp,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.hideColumn")})]})]})},Dp=({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(rl,{fontSize:"small"})}),e(ae,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g,1),disabled:g===l.length-1,children:e(tl,{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}),Np=({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 Ap=({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 Ep=({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 Yb=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)`},Lp=({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:Yb(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 Zb=["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=Zb,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 Op=({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 Fp=({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}`},dR=(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 Bp=({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 Hp=({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 zp=({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 Qb=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],Jb=["zh","en","de","fr","ja","ko"],Vp=({open:t,onClose:r,value:o,onSaveAll:n,modelOptions:a=Qb,promptLangOptions:i=Jb,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(Kc,{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(Np,{kpis:o.kpis}),e(zp,{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(Vp,{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"]},th=5,Wp=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=>[Wp(s),s]));for(let s of o){let l=i.get(Wp(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),rh=(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)},oh=(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)},nh=(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}))},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,barValue:d.billable,lineValue:d.report>0?d.billable/d.report*100:0})).sort((l,d)=>d.barValue-l.barValue).slice(0,a)},ih=(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}})},sh=(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"}]},lh=(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||th,d=er.useMemo(()=>({billableByPrimary:rh(i,"Primary","BillableHours",l,n),efficiencyBySecondary:oh(i,"Secondary","ReportHours","BillableHours",l,n),statusDistribution:nh(i,"Status",n),lineByDate:$p(i,"Date","BillableHours"),comboByPrimary:ah(i,"Primary","ReportHours","BillableHours",l,n),heatmapPrimarySecondary:ih(i,"Primary","Secondary","BillableHours",n),waterfallBillable:sh(i,"Date","BillableHours"),fishboneStatusCauses:lh(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 Gp=({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",X=m.find(j=>j.name===N.name);E=X?X.id:Date.now().toString();let H=[];if(X&&(Array.isArray(X.filters)?H=[...X.filters]:X.filters&&(H=[{scope:"default",filters:X.filters}])),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=H.findIndex(U=>U.scope===V.scope);z>=0?H[z]=V:H.push(V);});else {let V={scope:r,filters:j},z=H.findIndex(U=>U.scope===r);z>=0?H[z]=V:H.push(V);}}let Y=X?.layout||{},W=[];if(X&&Array.isArray(X.layoutRefs)&&(W=[...X.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:H,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 H=m.some(Y=>Y.id===E)?m.map(Y=>Y.id===E?O:Y):[...m,O];v(H),w(H),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(X=>({...X,isDefault:X.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();ro__default.default.extend(gh__default.default);ro__default.default.extend(fh__default.default);ro__default.default.extend(eb__default.default);var aa="YYYY-MM-DD",hh=[null,null],Vo="0.85rem",vh={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},yh=({isInRange:t,isStart:r,isEnd:o,isHovered:n,disableMargin:a,sx:i,...s})=>{let l=sr();return e(Ld,{...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%"}:{}]})},Kp=({label:t,value:r=hh,onChange:o})=>{let{t:n,locale:a}=pe(),i=vh[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]||ro__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,U]=A.current,K=ue=>ue&&typeof ue.isSame=="function",fe=!(j===null&&z===null||K(j)&&K(z)&&j.isSame(z,"day")),se=!(V===null&&U===null||K(V)&&K(U)&&V.isSame(U,"day"));(fe||se)&&(p(r),r[0]&&K(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 D=(j,V)=>{let z=V.trim(),U=j==="start"?T:S;if(!z){let se=j==="start"?[null,u[1]]:[u[0],null];U(false),p(se);return}let K=ro__default.default(z,aa,true).locale(i);if(!K.isValid()){U(true);return}U(false);let fe=[...u];if(j==="start")fe[0]=K,fe[1]&&K.isAfter(fe[1],"day")&&(fe[1]=null),b(fe[1]?"start":"end");else {let se=fe[0];se&&K.isBefore(se,"day")?(fe=[K,null],b("end")):(fe[1]=K,b("start"));}p(fe),g(K);},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=ro__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);},X=()=>{o&&o(u),N();},H=()=>{p(r),b("start"),N();},Y=er.useCallback(j=>{let{day:V,...z}=j,[U,K]=u,fe=U?V.isSame(U,"day"):false,se=K?V.isSame(K,"day"):false,ue=U&&K?V.isBetween(U,K,"day","()"):false,Se=false;return f==="end"&&U&&!K&&m&&V.isAfter(U,"day")&&V.isBefore(m.add(1,"day"),"day")&&(Se=true),e(yh,{...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:()=>D("start",x),onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),D("start",x));},sx:{"& .orb-inp":{fontSize:Vo,py:.75},"& label":{fontSize:Vo}}}),e(Hd,{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:()=>D("end",C),onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),D("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(Fd,{dateAdapter:ja,adapterLocale:i,children:e(Od,{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:H,color:"inherit",children:n("common.cancel")}),e(we,{size:"small",variant:"contained",onClick:X,children:n("common.done")})]})]})]})};P();var Ni={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},Sh={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"},wh=["contains","notContains",">",">=","<","<=","equals"],Xp=["=","!=",">","<",">=","<=","between"],or="0.85rem",kh=({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=Sh[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]?ro__default.default.isDayjs(E[0])?E[0]:ro__default.default(E[0]):null,F=E[1]?ro__default.default.isDayjs(E[1])?E[1]:ro__default.default(E[1]):null;return [O,F]}return ro__default.default.isDayjs(E)||typeof E=="string"?[ro__default.default.isDayjs(E)?E:ro__default.default(E),null]:[null,null]})(C);return e(Kp,{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(io,{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:Xp.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(zd,{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(Sp,{...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(", "),X=()=>{u(null),y(""),x("");},H=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:X,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(io,{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:()=>H(Y.value),onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),H(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"?Xp:wh;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(io,{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(io,{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});},D=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(Gp,{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(X=>X.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(dp,{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:()=>D(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(el,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:t.filter(N=>I.includes(N.id)).map(N=>e(el,{size:1,children:e(kh,{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 Yp=({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(bp,{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(mp,{fontSize:"small",color:"warning"}):e(up,{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(D=>D.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 D=(await S.json()).map(y);f(D);let M=D.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 D=A.find(M=>M.isDefault);D&&!b&&!a&&(m(D.id),n(D)),l&&l(u("layout.toast.loadFallback"));}}},[t,r,s,l,b,n,a,x,u]);return er.useEffect(()=>{C();},[t,r]),e(Yp,{layouts:p,currentLayoutId:b,onLoad:S=>{m(S.id),n(S);},onSave:async S=>{let A=p.find(N=>N.name===S.name),D=A?A.id:Date.now().toString(),M={id:D,...S,createdAt:new Date().toISOString(),layoutData:o,isDefault:S.isDefault??false,isPublic:S.isPublic??false};if(!s){let E=p.some(O=>O.id===D)?p.map(O=>O.id===D?M:O):[...p,M];f(E),h(E),m(D),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(D),n(M);}catch(N){console.error("Error saving layout",N);let O=p.some(F=>F.id===D)?p.map(F=>F.id===D?M:F):[...p,M];f(O),h(O),m(D),n(M),d&&d(u("layout.toast.saveLocalSuccess")),l&&l(u("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async S=>{if(!s){let A=p.filter(D=>D.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 D=p.filter(M=>M.id!==S);f(D),h(D),b===S&&m(""),d&&d(u("layout.toast.deleteLocalSuccess")),l&&l(u("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async S=>{if(!s){let A=p.map(D=>({...D,isDefault:D.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 D=p.map(M=>({...M,isDefault:M.id===S}));f(D),h(D),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 jp(t,r,o){return r[o]<t[o]?-1:r[o]>t[o]?1:0}function Ph(t,r){return t==="desc"?(o,n)=>jp(o,n,r):(o,n)=>-jp(o,n,r)}function Th(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,D]=er.useState(()=>a()),[M,N]=er.useState([]),[E,O]=er.useState(new Set),[F,X]=er.useState(()=>{let Z={};return (t.columns||[]).forEach($=>{Z[$.id]=n($);}),Z}),[H,Y]=er.useState(null),[W,j]=er.useState(null),[V,z]=er.useState(null),[U,K]=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();D($=>$.filter(be=>Z.includes(be)));},[a]),er.useEffect(()=>{X(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?Th(Pe,Ph(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 B=[];return yt.children.forEach(J=>{J.children?B=B.concat(Rt(J)):B.push(J[t.rowKey||"id"]);}),B})(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]),q=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 $=q.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(q));},Ot=Z=>{let $=q.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,$)=>{X(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)&&D(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&&X($.columnWidths),$.showSummary!==void 0&&S(!!$.showSummary),Array.isArray($.summaryColumns)&&D($.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&&X($.columnWidths),$.showSummary!==void 0&&S(!!$.showSummary),Array.isArray($.summaryColumns)&&D($.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(),K(U===null?{mouseX:Z.clientX+2,mouseY:Z.clientY-6}:null);},ht=()=>{K(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:X,anchorEl:H,setAnchorEl:Y,contextMenu:U,setContextMenu:K,sensors:void 0,sortedAndFilteredRows:Ve,visibleRows:ye,summaryRow:Nt,page:m,setPage:te,rowsPerPage:y,setRowsPerPage:he,totalDisplayCount:Be,selected:x,setSelected:h,isAllExpanded:q.length>0&&q.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 gD=t=>e("tbody",{...t}),fD=({align:t,...r})=>e("td",{align:t==="inherit"?void 0:t,...r}),bD=t=>e("div",{...t}),hD=t=>e("thead",{...t}),vD=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,D=n||r("table.title.default"),{isMobile:M,columns:N,order:E,orderBy:O,filterText:F,setFilterText:X,visibleColumns:H,showSummary:Y,setShowSummary:W,summaryColumns:j,grouping:V,setGrouping:z,expandedGroups:U,groupAnchorEl:K,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:q,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({}),[B,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]),oo=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)||oo.has(oe)),[yr,Or,oo]);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);}}},no=()=>{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);}},R=Me,{fieldMapping:_}=mn({rows:R,config:{...C,title:C?.title||`${D} ${r("graph.reportTitle")}`}}),G=er__namespace.default.useMemo(()=>Yt?Z.applyRows(R,_):R,[Yt,Z.applyRows,R,_]),{model:de}=mn({rows:G,config:{...C,title:C?.title||`${D} ${r("graph.reportTitle")}`,fieldMapping:_}}),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:K,setGroupAnchorEl:fe,grouping:V,setGrouping:z,columns:N}),e(un,{anchorEl:$e,setAnchorEl:ke,columns:N,visibleColumns:H,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:H,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(Pp,{title:D,loading:m,showSummary:Y,setShowSummary:W,setAnchorEl:ke,setSummaryAnchorEl:ue,filterText:F,setFilterText:X,sortedAndFilteredRows:Me,selected:s,columns:N,visibleColumns:H,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:X,onRowsPerPageChange:De,rowsPerPage:q,rowsPerPageOptions:v,page:nt,count:ye,onPageChange:it,actions:d,extraTools:u,grouping:V,disableGrouping:S,groupAnchorEl:K,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:no,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:H,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:H,selectionMode:i,selected:s,orderBy:O,loading:m,expandedGroups:U,toggleGroupExpand:ve,handleExpandGroupRecursively:he,handleCollapseGroupRecursively:Ne,isGroupFullyExpanded:Je,handleClick:Mt,onSelectionChange:l,grouping:V,rowKeyProp:x,page:nt,rowsPerPage:q}),Y&&e(kp,{showSummary:Y,columns:N,visibleColumns:H,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:D})}),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:B,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:D})}),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:_,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}})})]})},yD=Jr;P();var TD=({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 AD=({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,D]=er.useState(o),[M,N]=er.useState([]),[E,O]=er.useState("asc"),[F,X]=er.useState("");er.useEffect(()=>{let se={};t.filters.forEach(ue=>{ue.defaultValue!==void 0&&(se[ue.id]=ue.defaultValue);}),v(se);},[t.filters]);let H=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(()=>{H(m,I,A,E,F);},[H,I,A,E,F]);let Y=()=>{S(0),H(m,0,A,E,F);},W=se=>{S(0),D(se);},j=(se,ue)=>{O(ue),X(se);},V=se=>{v(se);},z=se=>{k(se?.id||"");let ue=Ai(se,a);if(ue){let $e=ue.values??ue;v($e),H($e,0,A,E,F),S(0);}let{layout:Se}=Ei(se,a);Se&&h(Se);},U=se=>{let ue={...se,id:Date.now().toString(),createdAt:new Date().toISOString()};g(Se=>[...Se,ue]);},K=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:U,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:K,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 Eh=new Set(["id","title","description","icon","iconNode","meta"]),Lh=t=>t.replace(/([A-Z])/g," $1").replace(/[._-]+/g," ").replace(/^\w/,r=>r.toUpperCase()).trim(),Oh=t=>Object.entries(t).filter(([r,o])=>!Eh.has(r)&&o!==null&&o!==void 0&&["string","number","boolean"].includes(typeof o)).map(([r,o])=>({key:r,label:Lh(r),value:String(o)})),Jp=({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=Oh(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 Fh={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",overflow:"hidden"},Bh=({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",...Fh},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})})]})]})},tu=({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(Bh,{item:x,onDetailClick:y,onDownloadClick:n,detailTooltip:i,downloadTooltip:s},x.id))}),d&&f?e(Jp,{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 eN=({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(tu,{...a})})]}),i]})};var aN=({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 D={};t.filters.forEach(M=>{M.defaultValue!==void 0&&(D[M.id]=M.defaultValue);}),y(D);},[t.filters]);let k=er.useCallback(async D=>{u(true);try{let M=r?await r({...D}):{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=D=>{y(D);},I=D=>{C(D?.id||"");let M=Ai(D,o);if(M){let N=M.values??M;y(N),k(N);}},S=D=>{let M={...D,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:D=>x(M=>M.filter(N=>N.id!==D)),onVariantSetDefault:D=>{x(M=>M.map(N=>({...N,isDefault:N.id===D})));},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 zh=t=>[...t].sort((r,o)=>o.value-r.value),lN=({bars:t=[],lines:r=[],combos:o=[],heatmap:n=[],pies:a=[],waterfalls:i=[]})=>{let s=er.useMemo(()=>zh(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 mN=({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]),gN=({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 Uh=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},Kh=async t=>new Function("m","return import(m)")(t),ca=({expression:t,inline:r=false,allowKatex:o=false})=>{let n=er.useMemo(()=>Uh(t),[t]),[a,i]=er.useState("");return er.useEffect(()=>{let s=true;return (async()=>{if(!o||!n){i("");return}try{let d=await Kh("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 Yh=async t=>new Function("m","return import(m)")(t),cl=({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 Yh("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(xd,{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 dl=t=>t.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),jh=t=>/^:?-{3,}:?$/.test(t.trim()),Qh=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=dl(r[0]),n=dl(r[1]);if(o.length===0||n.length!==o.length||!n.every(jh))return null;let a=n.map(Qh),i=r.slice(2).filter(s=>s.includes("|")).map(s=>{let l=dl(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}},pl=({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(Pd,{sx:{maxHeight:o},children:c(wd,{size:"small",stickyHeader:true,children:[e(Td,{children:e(Js,{children:n.headers.map((a,i)=>e(Qs,{align:n.aligns[i],sx:{fontWeight:700,bgcolor:"background.paper"},children:a},`${a}-${i}`))})}),e(kd,{children:n.rows.map((a,i)=>e(Js,{hover:true,children:a.map((s,l)=>e(Qs,{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(vd,{direction:"row",alignItems:"center",spacing:.6,children:[e(yd,{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 ul=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,Fi=t=>t.trim().startsWith("```"),au=t=>/^#{1,6}\s+/.test(t.trim()),ml=t=>/^[-*+]\s+/.test(t.trim()),gl=t=>/^\d+\.\s+/.test(t.trim()),iu=t=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(t.trim()),fl=t=>t.trim().startsWith(">"),su=(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())},lu=t=>t.trim().startsWith("<think>")||t.trim()===":::think",da=(t,r,o)=>{let n=[],a=0,i=0;ul.lastIndex=0;let s=ul.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(hd,{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=ul.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,`
|
|
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&&
|
|
189
|
+
`),b={enableMath:n},m=0;for(;m<f.length;){let v=f[m],y=v.trim();if(!y){m+=1;continue}if(i&&lu(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
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
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(cl,{code:C},`mermaid-${m}`));continue}if(n&&["math","latex","katex"].includes(x)){p.push(e(
|
|
193
|
-
`).trim(),allowKatex:true},`math-${m}`));continue}if(
|
|
194
|
-
`),C=Li(h);if(C){p.push(e(pl,{table:C},`table-${m}`)),m=x;continue}}if(fl(v)){let x=[];for(;m<f.length&&fl(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(br,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:x.map((h,C)=>c(Jt.Fragment,{children:[C>0&&e("br",{}),ca(h,b,`q-${m}-${C}`)]},`quote-line-${C}`))})},`quote-${m}`));continue}if(ml(v)){let x=[];for(;m<f.length&&ml(f[m]);)x.push(f[m].trim().replace(/^[-*+]\s+/,"")),m+=1;p.push(e(ke,{component:"ul",sx:{my:.8,pl:2.5},children:x.map((h,C)=>e(ke,{component:"li",sx:{mb:.45},children:e(br,{variant:"body2",children:ca(h,b,`ul-${m}-${C}`)})},`ul-item-${C}`))},`ul-${m}`));continue}if(gl(v)){let x=[];for(;m<f.length&&gl(f[m]);)x.push(f[m].trim().replace(/^\d+\.\s+/,"")),m+=1;p.push(e(ke,{component:"ol",sx:{my:.8,pl:2.7},children:x.map((h,C)=>e(ke,{component:"li",sx:{mb:.45},children:e(br,{variant:"body2",children:ca(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)||nu(x)||au(x)||ml(x)||gl(x)||fl(x)||iu(f,m)||i&&su(x)||n&&h.startsWith("$$"))break;g.push(x),m+=1;}g.length>0?p.push(e(br,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:g.map((x,h)=>c(Jt.Fragment,{children:[h>0&&e("br",{}),ca(x,b,`p-${m}-${h}`)]},`p-line-${h}`))},`p-${m}`)):m+=1;}return p},[d,n,a,i,s,l]);return e(ke,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:u})};T();var $N=(t,r)=>e(da,{markdown:t,...r});T();var lu=({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(Pd,{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(rp,{sx:{fontSize:d?16:18}})}),e(ae,{size:"small",onClick:o,disabled:l||!t.trim(),children:e(sp,{sx:{fontSize:d?16:18}})})]}),u&&s&&e(L,{variant:"caption",color:"text.secondary",children:s})]});T();var cu=(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(Ee,{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:cu(n.label,r)}),e(L,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?cu(a,r):n.value})]},n.id)})})]})};var bl=t=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",zi=t=>t.trim().toLowerCase(),ev=(t,r)=>{let o=[];return t.forEach(n=>{n.fields.forEach(a=>{let i=a.searchableText||bl(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||bl(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||bl(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},du=({sections:t,tabs:r=[],defaultTabId:o,ai:n})=>{let{t:a}=pe(),[i,s]=Jt.useState(""),[l,d]=Jt.useState(o||r[0]?.id),[u,p]=Jt.useState("idle"),[f,b]=Jt.useState([]),[m,v]=Jt.useState(""),[y,g]=Jt.useState(""),[x,h]=Jt.useState(false),C=Jt.useMemo(()=>ev(t,r),[t,r]);Jt.useEffect(()=>{if(r.length===0){d(void 0);return}r.some(E=>E.id===l)||d(o||r[0]?.id);},[r,l,o]);let P=Jt.useCallback(()=>{p("idle"),b([]),v(""),g("");},[]),w=Jt.useCallback(S=>{s(S),S.trim()||(p("idle"),b([]),v(""),g(""));},[]),k=Jt.useCallback(S=>{let E=zi(S);return E?C.filter(D=>D.text.includes(E)).map(D=>D.hit):[]},[C]),I=Jt.useCallback(async()=>{let S=i.trim();if(!S)return;h(true);let E=k(S);if(b(E),E.length>0){p("search"),g(""),v(a("detail.searchAi.matches",{count:E.length})),h(false);return}if(n?.enabled!==false&&n?.onSubmit){p("ai"),v(a("detail.searchAi.autoAiFallback"));try{let R=await n.onSubmit(S,{query:S,hits:E,activeTabId:l,sections:t,tabs:r});g(typeof R=="string"?R:"");}finally{h(false);}return}p("search"),g(""),v(a("detail.searchAi.noMatch")),h(false);},[i,k,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:P}};T();var bA=({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:P,handleSubmit:w,clearResult:k}=du({sections:o,tabs:n,defaultTabId:a,ai:s}),I=Jt.useMemo(()=>n.find(D=>D.id===v)||n[0],[n,v]),S=Jt.useCallback(D=>{let R=A=>{let N=document.getElementById(D);if(N){N.scrollIntoView({behavior:"smooth",block:"center"});return}A<4&&setTimeout(()=>R(A+1),60);};requestAnimationFrame(()=>R(0));},[]),E=Jt.useCallback((D,R)=>{if(n.some(A=>A.id===D)){y(D),S(R?`detail-tab-${D}-section-${R}`:`detail-tab-${D}`);return}S(`detail-section-${D}`);},[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(lu,{value:b,onChange:m,onSubmit:w,onVoiceInput:s?.onVoiceInput,onClear:()=>{m(""),k();},placeholder:s?.placeholder||f("detail.searchAi.placeholder"),statusText:h,loading:P,compact:true,showStatusText:false})}),u&&e(lt,{title:p,children:e(ae,{size:"small",onClick:u,children:e(_d,{fontSize:"small"})})}),l]})]}),h&&e(L,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:h}),g==="search"&&x.length>0&&c(Ee,{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(D=>e("div",{component:"button",type:"button",onClick:()=>E(D.sourceId,D.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:D.sourceTitle})," \xB7 ",e("div",{component:"span",sx:{fontWeight:700},children:D.fieldLabel})," = ",e("div",{component:"span",children:D.fieldValue||"-"})]})},`${D.source}|${D.sourceId}|${D.fieldId}`))})]}),g==="ai"&&C&&c(Ee,{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(da,{markdown:C})})]}),e("div",{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(D=>e("div",{id:`detail-section-${D.id}`,children:e(Bi,{section:D,highlightQuery:b})},D.id))}),n.length>0&&c(Ee,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[e(Dd,{value:I?.id||false,onChange:(D,R)=>y(String(R)),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:n.map(D=>e(Nd,{value:D.id,label:D.label,sx:{textTransform:"none"}},D.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(D=>e("div",{id:`detail-tab-${I?.id}-section-${D.id}`,children:e(Bi,{section:D,highlightQuery:b})},D.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})]})};T();var mu=({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]=Jt.useState(false),[m,v]=Jt.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(Ee,{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(ke,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1.25},children:[e(ke,{sx:{minWidth:0,flex:1},children:c(ke,{sx:{display:"flex",alignItems:"center",gap:.75,minHeight:28},children:[t.icon&&e(ke,{sx:{display:"inline-flex",flexShrink:0,color:t.accentColor??"var(--orb-primary)"},children:t.icon}),f?c(ke,{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(Zt,{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(Pt,{size:"small",label:r,sx:{minWidth:24,justifyContent:"center",fontWeight:600}}),typeof t.limit=="number"&&e(Pt,{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(Dc,{size:14})})]})]}),o&&e(L,{component:"div",sx:{fontSize:12,color:t.accentColor??"var(--orb-primary)",fontWeight:500},children:p("kanban.bucket.dropHere")}),e(ke,{sx:{flex:1,height:0,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",pr:.4,scrollbarGutter:"stable"},children:r>0?n:e(ke,{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")})})})]})})};T();var rv={success:"success",warning:"warning",info:"info",error:"error"},ov={critical:"error",high:"warning",medium:"info",low:"success"},nv={default:"var(--orb-primary)",success:"var(--orb-primary)",warning:"var(--orb-accent)",info:"var(--orb-primary)",error:"var(--orb-err)"},av=(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}},iv=t=>t?t.split(/\s+/).map(r=>r.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",hl=({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?ov[t.priority]:"default"),u=d==="default"?"primary":rv[d],p=nv[d],f=r?{card:t,bucket:r}:void 0;return e(Ee,{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(ke,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[c(ke,{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(Pt,{size:"small",color:u,label:av(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(ke,{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(ke,{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(ke,{children:[c(ke,{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(Cd,{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(ke,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:t.tags.map(b=>e(Pt,{size:"small",label:b.label,color:b.color??"default",variant:"outlined"},b.id))}),c(ke,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flexWrap:"wrap"},children:[c(ke,{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??iv(t.assignee.name)}),c(ke,{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 gu=(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:[]}]}},fu=(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)}},sv=(t,r)=>Number.isNaN(t)||t<0?0:t>r?r:t,bu=({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}})}},Gr=(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=Gr(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=sv(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}))}))}};T();var Cl="kanban-card|",xl="kanban-bucket|",yu=t=>`${Cl}${t}`,vv=t=>`${xl}${t}`,Wi=t=>t?.startsWith(Cl)?t.slice(Cl.length):void 0,vu=t=>t?.startsWith(xl)?t.slice(xl.length):void 0,yv=({card:t,bucket:r,onCardClick:o})=>{let{setNodeRef:n,attributes:a,listeners:i,transform:s,transition:l,isDragging:d}=sortable.useSortable({id:yu(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(hl,{card:t,bucket:r,dragging:d,onClick:o})})},Cv=({bucket:t,highlighted:r,bucketHeight:o,emptyBucketLabel:n,onBucketRename:a,onCardClick:i})=>{let{isOver:s,setNodeRef:l}=core.useDroppable({id:vv(t.id)});return e(ke,{ref:l,sx:{minWidth:0,minHeight:0,height:o},children:e(mu,{bucket:t,cardCount:t.cards.length,highlighted:r||s,emptyLabel:n,height:o,onRename:a,children:e(sortable.SortableContext,{items:t.cards.map(d=>yu(d.id)),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:1,children:t.cards.map(d=>e(yv,{card:d,bucket:t,onCardClick:i},d.id))})})})})},Cu=t=>String(t??"").toLocaleLowerCase(),xv=(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=>Cu(n).includes(r)),_A=({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]=Jt.useState(null),[P,w]=Jt.useState(),[k,I]=Jt.useState(b),S=f??k,E=S.trim().toLocaleLowerCase(),D=d??u??560,R=Jt.useMemo(()=>({buckets:t.buckets.map(V=>{let B=n?V.cards.filter(Q=>n(Q,V)):V.cards;if(!E)return {...V,cards:B};let Z=[V.id,V.title,V.description].some(Q=>Cu(Q).includes(E));return {...V,cards:Z?B:B.filter(Q=>xv(Q,E))}})}),[n,t,E]),A=Jt.useMemo(()=>R.buckets.reduce((V,B)=>V+B.cards.length,0),[R]),N=Jt.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=Jt.useMemo(()=>h?Gr(t,h):void 0,[h,t]),q=Jt.useCallback(()=>{C(null),w(void 0);},[]),z=Jt.useCallback(V=>{if(!V)return;let B=Wi(V);return B?Gr(t,B)?.bucket.id:vu(V)},[t]),X=Jt.useCallback(V=>{C(Wi(String(V.active.id))??null);},[]),$=Jt.useCallback(V=>{w(z(V.over?String(V.over.id):void 0));},[z]),_=Jt.useCallback(V=>{let B=Wi(String(V.active.id)),Z=V.over?String(V.over.id):void 0;if(!B||!Z){q();return}let Q=Gr(t,B);if(!Q){q();return}let ge=Q.bucket.id,se=Q.cardIndex,le=Wi(Z);if(le){let De=Gr(t,le);if(!De){q();return}ge=De.bucket.id,se=De.cardIndex;}else {let De=vu(Z),Pe=t.buckets.find(Ve=>Ve.id===De);if(!De||!Pe){q();return}ge=De,se=Pe.cards.length;}if(Q.bucket.id===ge&&Q.cardIndex===se){q();return}let be=Vi(t,{cardId:B,fromBucketId:Q.bucket.id,toBucketId:ge,targetIndex:se}),_e=Gr(be,B);_e&&!(_e.bucket.id===Q.bucket.id&&_e.cardIndex===Q.cardIndex)&&r?.({cardId:B,fromBucketId:Q.bucket.id,toBucketId:_e.bucket.id,targetIndex:_e.cardIndex,card:_e.card,model:be}),q();},[t,r,q]);return c(core.DndContext,{sensors:O,collisionDetection:core.closestCorners,onDragStart:X,onDragOver:$,onDragEnd:_,onDragCancel:q,children:[c(ke,{sx:{display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:"100%",overflow:"hidden"},children:[(p||a)&&c(ke,{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(ke,{sx:{width:"100%",maxWidth:360,flex:"1 1 240px"},children:e(ze,{dense:true,value:S,onChange:V=>N(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:()=>N(""),sx:{width:26,height:26},children:e(Zt,{size:15})}):void 0})}),c(ke,{sx:{display:"flex",alignItems:"center",gap:1,ml:"auto"},children:[E&&e(L,{component:"div","aria-live":"polite",sx:{flexShrink:0,fontSize:12,fontWeight:500,color:"text.secondary"},children:A>0?x("kanban.search.results",{count:A}):x("kanban.search.noMatch")}),a&&e(Ce,{size:"small",variant:"secondary",startIcon:e(Fa,{size:15}),onClick:a,children:s??x("kanban.bucket.add")})]})]}),e(ke,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${l}px, ${Math.max(l,360)}px)`,gap:1.5,gridAutoRows:D==="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:R.buckets.map(V=>e(Cv,{bucket:V,highlighted:V.id===P,bucketHeight:D,emptyBucketLabel:E?x("kanban.search.noMatch"):y,onBucketRename:i?B=>i(V.id,B):void 0,onCardClick:o},V.id))})]}),e(core.DragOverlay,{children:F?e(ke,{sx:{width:Math.max(l-24,260)},children:e(hl,{card:F.card,bucket:F.bucket,overlay:true})}):null})]})};var kv=({initialModel:t,initialBuckets:r,initialCards:o})=>t||bu({buckets:r??[],cards:o??[]}),YA=t=>{let{onCardMove:r,onCardClick:o}=t,[n,a]=Jt.useState(()=>kv(t)),i=Jt.useCallback(b=>{a(m=>typeof b=="function"?b(m):b);},[]),s=Jt.useCallback(b=>Gr(n,b),[n]),l=Jt.useCallback((b,m,v)=>{let y=Gr(n,b);if(!y)return;let g=Vi(n,{cardId:b,fromBucketId:y.bucket.id,toBucketId:m,targetIndex:v}),x=Gr(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=Jt.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=Jt.useCallback(b=>{let m=gu(n,b);return m===n?false:(a(m),true)},[n]),p=Jt.useCallback((b,m)=>{let v=fu(n,b,m);return v===n?false:(a(v),true)},[n]),f=Jt.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 xn({onTextUpdate:t,onComplete:r,onError:o,wsUrl:n="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:i=.015}){let[s,l]=Jt.useState(false),d=Jt.useRef(null),u=Jt.useRef(null),p=Jt.useRef(null),f=Jt.useRef(null),b=Jt.useRef(null),m=Jt.useRef(0),v=Jt.useRef(false),y=Jt.useRef(false),g=Jt.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=Jt.useCallback(()=>{v.current||(v.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(g,500));},[g]),h=Jt.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 P=new WebSocket(n);d.current=P,P.onopen=()=>{l(!0),y.current=!1;},P.onmessage=E=>{try{let D=JSON.parse(E.data);if(D.type==="recognition")D.is_final?r(D.text):t?.(D.text);else if(D.type==="error"){let R=D.message||"Voice recognition error";o?.(R),x();}}catch{o?.("Failed to parse voice message");}},P.onerror=()=>{o?.("Voice service connection failed"),g();},P.onclose=()=>{g();};let w=window.AudioContext||window.webkitAudioContext;if(!w)throw new Error("AudioContext is not supported in this browser");let k=new w({sampleRate:16e3});p.current=k;let I=k.createMediaStreamSource(C);b.current=I;let S=k.createScriptProcessor(4096,1,1);f.current=S,S.onaudioprocess=E=>{if(d.current?.readyState!==WebSocket.OPEN)return;let D=E.inputBuffer.getChannelData(0),R=0;for(let O=0;O<D.length;O+=1)R+=D[O]*D[O];if(Math.sqrt(R/D.length)>i)m.current=Date.now();else if(Date.now()-m.current>a&&!v.current){x();return}let N=new Int16Array(D.length);for(let O=0;O<D.length;O+=1){let F=Math.max(-1,Math.min(1,D[O]));N[O]=F<0?F*32768:F*32767;}d.current.send(N.buffer);},I.connect(S),S.connect(k.destination);}catch{o?.("Cannot access microphone"),g();}}},[g,s,i,r,o,t,a,x,n]);return Jt.useEffect(()=>g,[g]),{isRecording:s,startRecording:h,stopRecording:x}}T();var Rv=["en","zh","fr","de","ja","ko"],Su={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},wl=({searchPlaceholder:t,onSearch:r,onSearchAdd:o,maxWidth:n=540,sx:a})=>{let{t:i}=pe(),[s,l]=Jt.useState(""),d=Jt.useCallback((g=s)=>{let x=g.trim();x&&(l(""),r?.(x));},[r,s]),u=g=>{g.preventDefault(),d();},{isRecording:p,startRecording:f,stopRecording:b}=xn({onTextUpdate:l,onComplete:g=>{l(g),d(g);},onError:g=>{console.error("Header voice input error:",g);}}),m=Jt.useCallback(async()=>{if(p){b();return}await f();},[p,f,b]),v=t||i("header.searchPlaceholder"),y=s.trim().length>0;return e("form",{className:"orb-app-header-search",onSubmit:u,style:{width:"100%",maxWidth:typeof n=="number"?`${n}px`:n,...a},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:i("header.searchAddFeature"),children:e(Mt,{name:"add",size:16})})}),e("input",{className:"orb-inp orb-inp-dense orb-app-header-ai-input",value:s,onChange:g=>l(g.target.value),placeholder:v,style:{border:"none",background:"transparent",flex:1,minWidth:0}}),c("div",{className:"orb-inp-adornment orb-inp-adornment-end",children:[e(ae,{className:"orb-app-header-ai-action",size:"small",onClick:()=>{m();},tooltip:i(p?"header.searchStopVoice":"header.searchStartVoice"),sx:{color:p?"var(--orb-err)":void 0},children:e(Mt,{name:"microphone",size:16})}),e(ae,{className:"orb-app-header-ai-action",size:"small",type:"submit",disabled:!y,tooltip:i("header.searchSend"),children:e(Mt,{name:"paperPlane",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,user:f,onUserRefresh:b,onUserSetting:m,onUserLogout:v,userMenuItems:y,leftSlot:g,rightSlot:x})=>{let{t:h,locale:C}=pe(),P=yr(),w=n||C,k=a||Su[w],I=i||Rv,S=P==="dark"?e(Wc,{size:15}):e(Uc,{size:15}),E=h(P==="dark"?"header.theme.dark":"header.theme.light"),D=[...b?[{key:"refresh",label:h("header.menu.refresh"),icon:e(Ba,{size:15}),onClick:b}]:[],...m?[{key:"settings",label:h("header.menu.setting"),icon:e(en,{size:16}),onClick:m}]:[],...v?[{key:"logout",label:h("header.menu.logout"),icon:e(Hc,{size:16}),onClick:v}]:[]],R=y||D,A=I.map(N=>({label:Su[N],onClick:()=>{s?.(N),window.requestAnimationFrame(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur();});},disabled:N===w}));return c("header",{className:"orb-app-header",children:[c("div",{className:"orb-app-header-brand",children:[g,r===null?null:r||e("div",{className:"orb-app-header-default-logo","aria-label":"ORBCAFE",children:e(Mt,{name:"product",size:20})}),t&&e(L,{variant:"h4",sx:{fontWeight:700},children:t})]}),e("div",{className:"orb-app-header-center",children:d&&e(wl,{searchPlaceholder:l,onSearch:u,onSearchAdd:p})}),c("div",{className:"orb-app-header-actions",children:[c("div",{className:"orb-app-header-utilities",children:[s?e(jt,{triggerLabel:k,trigger:c("button",{type:"button",className:"orb-icon-btn orb-app-header-locale",children:[e(Hn,{size:15}),e("span",{className:"orb-label",children:k})]}),items:A,align:"end"}):c("div",{className:"orb-app-header-locale","aria-label":k,children:[e(Hn,{size:15}),e("span",{className:"orb-label",children:k})]}),e(ae,{className:"orb-app-header-theme",size:"small",onClick:o,tooltip:E,children:S})]}),f&&e("span",{className:"orb-app-header-divider","aria-hidden":"true"}),f&&e(jt,{triggerLabel:f.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:f.name}),f.subtitle&&e(L,{variant:"caption",muted:true,className:"orb-app-header-user-subtitle",title:f.subtitle,children:f.subtitle})]}),e(tn,{src:f.avatarSrc,alt:f.name,size:32,children:f.avatarText||f.name.slice(0,1).toUpperCase()})]}),items:R.map(N=>({label:N.label,onClick:N.onClick,disabled:N.disabled,icon:N.icon})),align:"end"}),x]})]})};var wu=({menuData:t=[],initialNavigationCollapsed:r=false,initialNavigationMode:o="fixed",enableNavigationPinning:n,navigationPinStorageKey:a,pinnedNavigationItemIds:i,defaultPinnedNavigationItemIds:s,onPinnedNavigationItemIdsChange:l,pinnedNavigationSectionTitle:d}={})=>{let{navigationIslandProps:u}=md({initialCollapsed:r,initialDisplayMode:o,content:t,enablePinning:n,pinStorageKey:a,pinnedItemIds:i,defaultPinnedItemIds:s,onPinnedItemIdsChange:l,pinnedSectionTitle:d}),[p,f]=Jt.useState(900);Jt.useEffect(()=>{let m=()=>f(window.innerHeight);return m(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);let b=Jt.useMemo(()=>Math.max(280,p-100),[p]);return {navigationIslandProps:u,navigationMaxHeight:b}};T();var Lr=12,Pu=56,Tu=234,Ev="orbcafe:page-layout-locale",Iu=["en","zh","fr","de","ja","ko"],Lv=t=>encodeURIComponent(t.trim().toLowerCase()).replace(/%/g,"").replace(/[^a-z0-9._~-]+/g,"-")||"app",Gi=(t,r)=>`orbcafe:page-layout:${Lv(t)}:${r}`,Ov=t=>`orbcafe:page-layout:${t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,Fv=t=>t==="system"?"dark":t==="dark"?"light":"system",_i=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),Bv=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,vE=({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:P,onSearch:w,onSearchAdd:k,rightHeaderSlot:I,leftHeaderSlot:S,contentSx:E,navigationVariant:D="classic",navigationMode:R,defaultNavigationMode:A="fixed",onNavigationModeChange:N,showNavigationModeToggle:O=true,enableNavigationPinning:F=true,navigationPinStorageKey:q,pinnedNavigationItemIds:z,defaultPinnedNavigationItemIds:X,onPinnedNavigationItemIdsChange:$,pinnedNavigationSectionTitle:_})=>{let V=t?Gi(t,"mode"):"orbcafe:page-layout-mode",B=t?Gi(t,"locale"):Ev,Z=t?Gi(t,"navigation-mode"):"orbcafe:page-layout-navigation-mode",[Q,ge]=Jt.useState(p),[se,le]=Jt.useState("light"),[be,_e]=Jt.useState(false),[De,Pe]=Jt.useState(i),[Ve,Te]=Jt.useState(false),[xe,We]=Jt.useState(false),[ot,it]=Jt.useState(A),[Ze,U]=Jt.useState({x:Lr,y:Lr}),[Fe,ye]=Jt.useState("left"),[Le,st]=Jt.useState(false),Je=Jt.useRef(null),vt=Jt.useRef(null),St=u!==void 0,Et=u??Q,Lt=d!==void 0,re=Lt?i:De,nt=l?.join("|")??"",Be=R!==void 0,ce=R??ot,fe=ce==="floating",ee=D==="v2"?qs:sd,Ie=C==="header",Re=Et==="system"?be?se:"light":Et;Jt.useEffect(()=>{if(!St)try{let Y=window.localStorage.getItem(V);(Y==="light"||Y==="dark"||Y==="system")&&ge(Y);}catch{}_e(true);let we=window.matchMedia("(prefers-color-scheme: dark)"),W=()=>{le(we.matches?"dark":"light");};return W(),we.addEventListener("change",W),()=>we.removeEventListener("change",W)},[St,V]),Jt.useEffect(()=>{if(!(St||!be))try{window.localStorage.setItem(V,Et);}catch{}},[be,St,Et,V]),Jt.useEffect(()=>{if(Lt){Te(true);return}try{let we=window.localStorage.getItem(B),W=l??Iu;we&&Iu.includes(we)&&W.includes(we)&&Pe(we);}catch{}finally{Te(true);}},[Lt,nt,B]),Jt.useEffect(()=>{if(!(Lt||!Ve))try{window.localStorage.setItem(B,re);}catch{}},[re,Lt,Ve,B]),Jt.useEffect(()=>{if(Be){We(true);return}try{let we=window.localStorage.getItem(Z);(we==="fixed"||we==="floating")&&it(we);}catch{}finally{We(true);}},[Be]),Jt.useEffect(()=>{if(xe)try{window.localStorage.setItem(Z,ce);}catch{}},[ce,xe]),Jt.useEffect(()=>{Re==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[Re]);let je=Jt.useCallback(we=>{Be||it(we),N?.(we);},[Be,N]),mt=Jt.useCallback(we=>{St||ge(we),f?.(we);},[St,f]),pt=Jt.useCallback(we=>{Lt||Pe(we),d?.(we);},[Lt,d]),{navigationIslandProps:Ot,navigationMaxHeight:Kt}=wu({menuData:o,initialNavigationCollapsed:false,initialNavigationMode:ce,enableNavigationPinning:F,navigationPinStorageKey:q??(t?Gi(t,"pinned-navigation-items"):Ov(r)),pinnedNavigationItemIds:z,defaultPinnedNavigationItemIds:X,onPinnedNavigationItemIdsChange:$,pinnedNavigationSectionTitle:_}),yt=Ot.collapsed,bt=Jt.useCallback(we=>{let W=Je.current,Y=W?.parentElement;if(!W||!Y)return we;let te=Y.getBoundingClientRect(),Ne=W.getBoundingClientRect(),he=Lr,Ae=Lr,Ke=Math.max(he,te.width-Ne.width-Lr),et=Math.max(Ae,te.height-Ne.height-Lr);return {x:_i(we.x,he,Ke),y:_i(we.y,Ae,et)}},[]),xr=Jt.useCallback(we=>{let W=Je.current,Y=W?.parentElement;if(!W||!Y)return we;let te=Y.getBoundingClientRect(),Ne=W.getBoundingClientRect(),he=Lr,Ae=Lr,Ke=Math.max(he,te.width-Ne.width-Lr),et=Math.max(Ae,te.height-Ne.height-Lr),qe={x:_i(we.x,he,Ke),y:_i(we.y,Ae,et)},Nt=[{distance:Math.abs(qe.x-he),position:{x:he,y:qe.y}},{distance:Math.abs(qe.x-Ke),position:{x:Ke,y:qe.y}},{distance:Math.abs(qe.y-Ae),position:{x:qe.x,y:Ae}},{distance:Math.abs(qe.y-et),position:{x:qe.x,y:et}}].reduce((wt,xt)=>xt.distance<wt.distance?xt:wt).position;return ye(Nt.x>=(he+Ke)/2?"right":"left"),Nt},[]),Tt=Jt.useMemo(()=>{if(!fe||Le)return Ze.x;if(Fe==="right"){let Y=Je.current?.parentElement?.getBoundingClientRect().width,te=yt?Pu:Tu;return Y?Math.max(Lr,Y-te-Lr):yt?Ze.x:Ze.x-(Tu-Pu)}return Ze.x},[Fe,Ze.x,Le,fe,yt]),Ft=Jt.useCallback(we=>{if(!fe||!yt||Bv(we.target))return;we.preventDefault(),we.currentTarget.setPointerCapture(we.pointerId);let W=bt({x:Tt,y:Ze.y});ye("left"),U(W),vt.current={pointerId:we.pointerId,startClientX:we.clientX,startClientY:we.clientY,startX:W.x,startY:W.y,currentX:W.x,currentY:W.y},st(true);},[bt,Tt,Ze.y,fe,yt]),ut=Jt.useCallback(we=>{let W=vt.current;if(!W||W.pointerId!==we.pointerId)return;let Y=bt({x:W.startX+we.clientX-W.startClientX,y:W.startY+we.clientY-W.startClientY});W.currentX=Y.x,W.currentY=Y.y,U(Y);},[bt]),Bt=Jt.useCallback(we=>{let W=vt.current;if(!(!W||W.pointerId!==we.pointerId)){try{we.currentTarget.releasePointerCapture(we.pointerId);}catch{}vt.current=null,U(xr({x:W.currentX,y:W.currentY})),st(false);}},[xr]);return Jt.useEffect(()=>{if(!fe)return;let we=()=>{U(te=>bt(te));},W=window.requestAnimationFrame(we),Y=window.setTimeout(we,430);return ()=>{window.cancelAnimationFrame(W),window.clearTimeout(Y);}},[bt,fe,yt,Kt]),e(On,{mode:Et,children:e(_a,{locale:re,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:Et,onToggleMode:()=>mt(Fv(Et)),locale:re,localeLabel:Lt||re===i?s:void 0,localeOptions:l,onLocaleChange:pt,user:b,onUserRefresh:m,onUserSetting:v,onUserLogout:y,userMenuItems:g,searchPlaceholder:h,showSearch:Ie,onSearch:w,onSearchAdd:k,leftSlot:S,rightSlot:I}),C==="floating"&&e("div",{className:"orb-float-search",style:P,children:e(wl,{searchPlaceholder:h,onSearch:w,onSearchAdd:k,maxWidth:"100%"})}),c("div",{style:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[a&&!fe&&e("div",{style:{paddingTop:12,paddingBottom:12,paddingLeft:12,paddingRight:yt?4:12,display:"flex",alignItems:"flex-start",flexShrink:0},children:e(ee,{...Ot,maxHeight:Kt,colorMode:Re,displayMode:ce,onDisplayModeChange:je,showDisplayModeToggle:O&&yt})}),a&&fe&&e("div",{ref:Je,onPointerDown:Ft,onPointerMove:ut,onPointerUp:Bt,onPointerCancel:Bt,style:{position:"absolute",top:Ze.y,left:Tt,zIndex:1205,display:"flex",alignItems:"flex-start",cursor:yt?Le?"grabbing":"grab":"default",touchAction:yt?"none":"auto",userSelect:Le?"none":void 0,transition:Le?"none":"left 180ms ease-out, top 180ms ease-out"},children:e(ee,{...Ot,maxHeight:Kt,colorMode:Re,displayMode:ce,onDisplayModeChange:je,showDisplayModeToggle:O&&yt})}),e("div",{style:{flex:1,minWidth:0,minHeight:0,overflow:"auto",paddingTop:12,paddingBottom:12,paddingRight:12,paddingLeft:a&&!fe&&yt?4:12,...E},children:n})]})]})})})};var Ui="(blank)",Ru="Result",Mu="Grand Total",Du={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Nu=["sum","count","avg","min","max"];var Au=["palette","rows","columns","filters","values"];var Eu=t=>Au.includes(t),Lu=t=>t==="rows"||t==="columns"||t==="filters",Ki=t=>{let r=t.split("|");return r.length===2&&r[0]==="container"&&Eu(r[1])?{kind:"container",zone:r[1]}:r.length===3&&r[0]==="item"&&Eu(r[1])&&r[2]?{kind:"item",zone:r[1],key:r[2]}:null},co=t=>t==null||t===""?Ui:t instanceof Date?t.toISOString().slice(0,10):String(t),Go=t=>JSON.stringify(t),Ou=(t,r)=>{let o=t.join(""),n=r.join("");return o.localeCompare(n,void 0,{sensitivity:"base"})},Hv=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},Sn=(t,r,o)=>{if(o==="count")return t.length;let n=t.map(a=>Hv(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},po=(t,r)=>t.length!==r.length?false:t.every((o,n)=>o===r[n]),Fu=(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 po(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}),kl=t=>!t?.aggregations||t.aggregations.length===0?Nu:t.aggregations,hr=(t,r)=>{let o=kl(r);return t&&o.includes(t)?t:r?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},pa=(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})};T();var Hu=({options:t,selectedValues:r,onChange:o,minWidth:n=96})=>{let{t:a}=pe(),[i,s]=Jt.useState(""),[l,d]=Jt.useState(null),u=Jt.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(Ce,{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(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: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(Ce,{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(Dt,{size:"small",checked:v,inputProps:{tabIndex:-1},sx:{p:.5,mr:.5,pointerEvents:"none"}}),e("span",{children:m})]},m)})]})})]})};T();var wn=({size:t=18,subtle:r=false})=>{let o=Math.max(2,Math.round(t/6));return e(ke,{"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(ke,{sx:{width:o,height:o,borderRadius:999,bgcolor:"currentColor"}},a))})};T();var Pl=({label:t,subtitle:r,isDragging:o,dragRef:n,listeners:a,attributes:i,style:s})=>e(Ee,{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(wn,{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})]})]})}),zu=({id:t,label:r,subtitle:o})=>{let{setNodeRef:n,listeners:a,attributes:i,isDragging:s}=core.useDraggable({id:t});return e(Pl,{label:r,subtitle:o,isDragging:s,dragRef:n,listeners:a,attributes:i})};T();var kn=({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(Ee,{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(lt,{title:p("pivot.clearArea"),children:e(ae,{size:"small",onClick:s,sx:{width:24,height:24,p:0},children:e(ep,{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})]})};T();var Vu={xs:1.2,md:1.6},Pn=({title:t,subtitle:r,collapsed:o,onToggleCollapse:n,expandAriaLabel:a,collapseAriaLabel:i,children:s,bodySx:l,unmountOnExit:d=false,headerActions:u})=>c(Ee,{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:Vu,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(on,{in:!o,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:e("div",{sx:[{px:Vu,py:{xs:1.2,md:1.6}},...Array.isArray(l)?l:l?[l]:[]],children:s})})]});T();var Xi=({label:t,caption:r,onRemove:o,trailing:n,isDragging:a,dragRef:i,listeners:s,attributes:l,style:d})=>e(Ee,{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(wn,{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})})]})}),ua=({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})};T();var ji={rows:e(gp,{size:16,sx:{color:"var(--orb-primary)"}}),columns:e(sn,{size:16,sx:{color:"var(--orb-primary)"}}),filters:e(Yd,{size:16,sx:{color:"var(--orb-primary)"}}),values:e(an,{size:16,sx:{color:"var(--orb-accent)"}})},Wu=({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(Pn,{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(kn,{zone:"palette",title:v("pivot.fieldList"),hint:v("pivot.availableDimensions"),itemCount:o.length,icon:e(wn,{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(zu,{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(kn,{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(ua,{id:`item|filters|${g}`,label:n.get(g)?.label??g,caption:p(g),trailing:f(g),onRemove:()=>u("filters",g)},g))})})}),e(kn,{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(ua,{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(kn,{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(ua,{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(kn,{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(ua,{id:`item|values|${g.tokenId}`,label:x,caption:h,trailing:b(g),onRemove:()=>u("values",g.tokenId)},g.tokenId)})})})})]})]})]})})};T();var $u=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Gu=({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,P=d.left+h/f*m,w=l-d.bottom-C/b*v;return {...g,x:P,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,`
|
|
192
|
+
`);if(a&&x==="mermaid"){p.push(e(cl,{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(au(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(iu(v)){p.push(e(Cd,{sx:{my:1.2}},`hr-${m}`)),m+=1;continue}if(su(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(pl,{table:C},`table-${m}`)),m=x;continue}}if(fl(v)){let x=[];for(;m<f.length&&fl(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(ml(v)){let x=[];for(;m<f.length&&ml(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(gl(v)){let x=[];for(;m<f.length&&gl(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)||au(x)||iu(x)||ml(x)||gl(x)||fl(x)||su(f,m)||i&&lu(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 XN=(t,r)=>e(pa,{markdown:t,...r});P();var cu=({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(Id,{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(op,{sx:{fontSize:d?16:18}})}),e(ae,{size:"small",onClick:o,disabled:l||!t.trim(),children:e(lp,{sx:{fontSize:d?16:18}})})]}),u&&s&&e(L,{variant:"caption",color:"text.secondary",children:s})]});P();var du=(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:du(n.label,r)}),e(L,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?du(a,r):n.value})]},n.id)})})]})};var bl=t=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",zi=t=>t.trim().toLowerCase(),ov=(t,r)=>{let o=[];return t.forEach(n=>{n.fields.forEach(a=>{let i=a.searchableText||bl(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||bl(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||bl(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},pu=({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(()=>ov(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(D=>D.text.includes(A)).map(D=>D.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 SA=({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}=pu({sections:o,tabs:n,defaultTabId:a,ai:s}),I=er.useMemo(()=>n.find(D=>D.id===v)||n[0],[n,v]),S=er.useCallback(D=>{let M=N=>{let E=document.getElementById(D);if(E){E.scrollIntoView({behavior:"smooth",block:"center"});return}N<4&&setTimeout(()=>M(N+1),60);};requestAnimationFrame(()=>M(0));},[]),A=er.useCallback((D,M)=>{if(n.some(N=>N.id===D)){y(D),S(M?`detail-tab-${D}-section-${M}`:`detail-tab-${D}`);return}S(`detail-section-${D}`);},[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(cu,{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(Kd,{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(D=>e("div",{component:"button",type:"button",onClick:()=>A(D.sourceId,D.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:D.sourceTitle})," \xB7 ",e("div",{component:"span",sx:{fontWeight:700},children:D.fieldLabel})," = ",e("div",{component:"span",children:D.fieldValue||"-"})]})},`${D.source}|${D.sourceId}|${D.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(D=>e("div",{id:`detail-section-${D.id}`,children:e(Bi,{section:D,highlightQuery:b})},D.id))}),n.length>0&&c(Ae,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[e(Ad,{value:I?.id||false,onChange:(D,M)=>y(String(M)),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:n.map(D=>e(Ed,{value:D.id,label:D.label,sx:{textTransform:"none"}},D.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(D=>e("div",{id:`detail-tab-${I?.id}-section-${D.id}`,children:e(Bi,{section:D,highlightQuery:b})},D.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 gu=({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(Nc,{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 av={success:"success",warning:"warning",info:"info",error:"error"},iv={critical:"error",high:"warning",medium:"info",low:"success"},sv={default:"var(--orb-primary)",success:"var(--orb-primary)",warning:"var(--orb-accent)",info:"var(--orb-primary)",error:"var(--orb-err)"},lv=(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}},cv=t=>t?t.split(/\s+/).map(r=>r.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",hl=({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?iv[t.priority]:"default"),u=d==="default"?"primary":av[d],p=sv[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:lv(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(Sd,{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??cv(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 fu=(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:[]}]}},bu=(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)}},dv=(t,r)=>Number.isNaN(t)||t<0?0:t>r?r:t,hu=({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=dv(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 Cl="kanban-card|",xl="kanban-bucket|",Cu=t=>`${Cl}${t}`,xv=t=>`${xl}${t}`,Wi=t=>t?.startsWith(Cl)?t.slice(Cl.length):void 0,yu=t=>t?.startsWith(xl)?t.slice(xl.length):void 0,Sv=({card:t,bucket:r,onCardClick:o})=>{let{setNodeRef:n,attributes:a,listeners:i,transform:s,transition:l,isDragging:d}=sortable.useSortable({id:Cu(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(hl,{card:t,bucket:r,dragging:d,onClick:o})})},wv=({bucket:t,highlighted:r,bucketHeight:o,emptyBucketLabel:n,onBucketRename:a,onCardClick:i})=>{let{isOver:s,setNodeRef:l}=core.useDroppable({id:xv(t.id)});return e(Ie,{ref:l,sx:{minWidth:0,minHeight:0,height:o},children:e(gu,{bucket:t,cardCount:t.cards.length,highlighted:r||s,emptyLabel:n,height:o,onRename:a,children:e(sortable.SortableContext,{items:t.cards.map(d=>Cu(d.id)),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:1,children:t.cards.map(d=>e(Sv,{card:d,bucket:t,onCardClick:i},d.id))})})})})},xu=t=>String(t??"").toLocaleLowerCase(),kv=(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=>xu(n).includes(r)),ZA=({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(),D=d??u??560,M=er.useMemo(()=>({buckets:t.buckets.map(V=>{let z=n?V.cards.filter(K=>n(K,V)):V.cards;if(!A)return {...V,cards:z};let U=[V.id,V.title,V.description].some(K=>xu(K).includes(A));return {...V,cards:U?z:z.filter(K=>kv(K,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]),X=er.useCallback(()=>{C(null),w(void 0);},[]),H=er.useCallback(V=>{if(!V)return;let z=Wi(V);return z?_r(t,z)?.bucket.id:yu(V)},[t]),Y=er.useCallback(V=>{C(Wi(String(V.active.id))??null);},[]),W=er.useCallback(V=>{w(H(V.over?String(V.over.id):void 0));},[H]),j=er.useCallback(V=>{let z=Wi(String(V.active.id)),U=V.over?String(V.over.id):void 0;if(!z||!U){X();return}let K=_r(t,z);if(!K){X();return}let fe=K.bucket.id,se=K.cardIndex,ue=Wi(U);if(ue){let ke=_r(t,ue);if(!ke){X();return}fe=ke.bucket.id,se=ke.cardIndex;}else {let ke=yu(U),le=t.buckets.find(Ee=>Ee.id===ke);if(!ke||!le){X();return}fe=ke,se=le.cards.length;}if(K.bucket.id===fe&&K.cardIndex===se){X();return}let Se=Vi(t,{cardId:z,fromBucketId:K.bucket.id,toBucketId:fe,targetIndex:se}),$e=_r(Se,z);$e&&!($e.bucket.id===K.bucket.id&&$e.cardIndex===K.cardIndex)&&r?.({cardId:z,fromBucketId:K.bucket.id,toBucketId:$e.bucket.id,targetIndex:$e.cardIndex,card:$e.card,model:Se}),X();},[t,r,X]);return c(core.DndContext,{sensors:O,collisionDetection:core.closestCorners,onDragStart:Y,onDragOver:W,onDragEnd:j,onDragCancel:X,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:D==="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(wv,{bucket:V,highlighted:V.id===k,bucketHeight:D,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(hl,{card:F.card,bucket:F.bucket,overlay:true})}):null})]})};var Iv=({initialModel:t,initialBuckets:r,initialCards:o})=>t||hu({buckets:r??[],cards:o??[]}),tE=t=>{let{onCardMove:r,onCardClick:o}=t,[n,a]=er.useState(()=>Iv(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=fu(n,b);return m===n?false:(a(m),true)},[n]),p=er.useCallback((b,m)=>{let v=bu(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 D=JSON.parse(A.data);if(D.type==="recognition")D.is_final?r(D.text):t?.(D.text);else if(D.type==="error"){let M=D.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 D=A.inputBuffer.getChannelData(0),M=0;for(let O=0;O<D.length;O+=1)M+=D[O]*D[O];if(Math.sqrt(M/D.length)>i)m.current=Date.now();else if(Date.now()-m.current>a&&!v.current){x();return}let E=new Int16Array(D.length);for(let O=0;O<D.length;O+=1){let F=Math.max(-1,Math.min(1,D[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 Nv=["en","zh","fr","de","ja","ko"],wu={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},wl=({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||wu[I],A=i||Nv,D=T==="dark"?e(_c,{size:15}):e(qc,{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(zc,{size:16}),onClick:g}]:[]],E=x||N,O=A.map(F=>({label:wu[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(wl,{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:D})]}),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 ku=({menuData:t=[],initialNavigationCollapsed:r=false,initialNavigationMode:o="fixed",enableNavigationPinning:n,navigationPinStorageKey:a,pinnedNavigationItemIds:i,defaultPinnedNavigationItemIds:s,onPinnedNavigationItemIdsChange:l,pinnedNavigationSectionTitle:d}={})=>{let{navigationIslandProps:u}=fd({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,Tu=56,Iu=234,Fv="orbcafe:page-layout-locale",Mu=["en","zh","fr","de","ja","ko"],Bv=t=>encodeURIComponent(t.trim().toLowerCase()).replace(/%/g,"").replace(/[^a-z0-9._~-]+/g,"-")||"app",_i=(t,r)=>`orbcafe:page-layout:${Bv(t)}:${r}`,Hv=t=>`orbcafe:page-layout:${t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,zv=t=>t==="system"?"dark":t==="dark"?"light":"system",Gi=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),Vv=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,kE=({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:D,contentSx:M,navigationVariant:N="classic",navigationMode:E,defaultNavigationMode:O="fixed",onNavigationModeChange:F,showNavigationModeToggle:X=true,enableNavigationPinning:H=true,navigationPinStorageKey:Y,pinnedNavigationItemIds:W,defaultPinnedNavigationItemIds:j,onPinnedNavigationItemIdsChange:V,pinnedNavigationSectionTitle:z})=>{let U=t?_i(t,"mode"):"orbcafe:page-layout-mode",K=t?_i(t,"locale"):Fv,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,q]=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"?qs:cd,Je=C==="header",st=re==="system"?ke?Se:"light":re;er.useEffect(()=>{if(!At)try{let be=window.localStorage.getItem(U);(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,U]),er.useEffect(()=>{if(!(At||!ke))try{window.localStorage.setItem(U,re);}catch{}},[ke,At,re,U]),er.useEffect(()=>{if(Ke){Ve(true);return}try{let $=window.localStorage.getItem(K),Q=l??Mu;$&&Mu.includes($)&&Q.includes($)&&Me($);}catch{}finally{Ve(true);}},[Ke,ce,K]),er.useEffect(()=>{if(!(Ke||!Pe))try{window.localStorage.setItem(K,Fe);}catch{}},[Fe,Ke,Pe,K]),er.useEffect(()=>{if(ve){nt(true);return}try{let $=window.localStorage.getItem(fe);($==="fixed"||$==="floating")&&q($);}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||q($),F?.($);},[ve,F]),Bt=er.useCallback($=>{At||ue($),f?.($);},[At,f]),Xt=er.useCallback($=>{Ke||Me($),d?.($);},[Ke,d]),{navigationIslandProps:Vt,navigationMaxHeight:wt}=ku({menuData:o,initialNavigationCollapsed:false,initialNavigationMode:te,enableNavigationPinning:H,navigationPinStorageKey:Y??(t?_i(t,"pinned-navigation-items"):Hv(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((B,J)=>J.distance<B.distance?J:B).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?Tu:Iu;return be?Math.max(Lr,be-Ce-Lr):Wt?De.x:De.x-(Iu-Tu)}return De.x},[Be,De.x,Ze,he,Wt]),Ft=er.useCallback($=>{if(!he||!Wt||Vv($.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(zv(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:D,rightSlot:A}),C==="floating"&&e("div",{className:"orb-float-search",style:k,children:e(wl,{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:X&&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:X&&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)",Ru="Result",Du="Grand Total",Nu={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Au=["sum","count","avg","min","max"];var Eu=["palette","rows","columns","filters","values"];var Lu=t=>Eu.includes(t),Ou=t=>t==="rows"||t==="columns"||t==="filters",Ki=t=>{let r=t.split("|");return r.length===2&&r[0]==="container"&&Lu(r[1])?{kind:"container",zone:r[1]}:r.length===3&&r[0]==="item"&&Lu(r[1])&&r[2]?{kind:"item",zone:r[1],key:r[2]}:null},co=t=>t==null||t===""?Ui:t instanceof Date?t.toISOString().slice(0,10):String(t),_o=t=>JSON.stringify(t),Fu=(t,r)=>{let o=t.join(""),n=r.join("");return o.localeCompare(n,void 0,{sensitivity:"base"})},Wv=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=>Wv(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},po=(t,r)=>t.length!==r.length?false:t.every((o,n)=>o===r[n]),Bu=(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 po(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}),kl=t=>!t?.aggregations||t.aggregations.length===0?Au:t.aggregations,vr=(t,r)=>{let o=kl(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 zu=({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 Pl=({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})]})]})}),Vu=({id:t,label:r,subtitle:o})=>{let{setNodeRef:n,listeners:a,attributes:i,isDragging:s}=core.useDraggable({id:t});return e(Pl,{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(tp,{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 Wu={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:Wu,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:Wu,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(fp,{size:16,sx:{color:"var(--orb-primary)"}}),columns:e(ln,{size:16,sx:{color:"var(--orb-primary)"}}),filters:e(jd,{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(Vu,{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 _u=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Gu=({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
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
|
|
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:_u(b)}),e("text",{x:s-d.right,y:l-d.bottom+16,textAnchor:"end",fontSize:"10",fill:i.palette.text.secondary,children:_u(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 Tl=t=>Math.max(...t,1),Uu=({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=Tl(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=Tl(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=Tl(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
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 Uu=(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},Ku=(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}}),qu=({rows:t,dimensionFieldId:r,primaryValue:o,secondaryValue:n})=>{if(!r)return [];let a=new Map;return t.forEach(i=>{let s=co(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:Sn(s,o.fieldId,o.aggregation),secondaryValue:n?Sn(s,n.fieldId,n.aggregation):void 0}))};T();var Xu=({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=Jt.useMemo(()=>Uu(o,n,r),[n,r,o]),h=Jt.useMemo(()=>Ku(a,r,y),[r,y,a]),C=h.find(R=>R.fieldId===s)??h[0],P=h.find(R=>R.fieldId===l&&R.fieldId!==C?.fieldId)??null,w=x.find(R=>R.fieldId===i)??x[0],k=w&&C?g("pivot.chart.subtitleReady",{dimension:w.label,measure:P?`${C.label} / ${P.label}`:C.label}):g("pivot.chart.subtitle"),I=Jt.useMemo(()=>!w||!C?[]:qu({rows:t,dimensionFieldId:w.fieldId,primaryValue:C.item,secondaryValue:P?.item}),[C,t,P,w]),S=R=>C?pa(R,C.item,r):R.toLocaleString(),E=R=>P?pa(R,P.item,r):R.toLocaleString(),D=x.length>1||h.length>1;return c(Pn,{title:g("pivot.chart.title"),subtitle:k,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:[D&&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(Wt,{value:w?.fieldId??"",onChange:R=>p(String(R.target.value)),sx:{fontSize:"0.75rem",height:32},children:x.map(R=>e("option",{value:R.fieldId,sx:{fontSize:"0.75rem"},children:R.label},R.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(Wt,{value:C?.fieldId??"",onChange:R=>f(String(R.target.value)),sx:{fontSize:"0.75rem",height:32},children:h.map(R=>e("option",{value:R.fieldId,sx:{fontSize:"0.75rem"},children:R.label},R.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(Wt,{value:P?.fieldId??"",onChange:R=>b(String(R.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(R=>R.fieldId!==C?.fieldId).map(R=>e("option",{value:R.fieldId,sx:{fontSize:"0.75rem"},children:R.label},R.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(Wt,{value:d,onChange:R=>m(R.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(Gu,{data:I,primaryLabel:C.label,secondaryLabel:P?.label,formatPrimaryValue:S,formatSecondaryValue:E}):e(_u,{data:I,chartType:d,primaryLabel:C.label,secondaryLabel:P?.label,formatPrimaryValue:S,formatSecondaryValue:E}):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")})})})]})};T();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?ht()==="dark"?"color-mix(in oklch, var(--orb-primary) 22%, transparent)":"color-mix(in oklch, var(--orb-primary) 8%, transparent)":ht()==="dark"?"var(--orb-surface)":"background.paper","&:hover":{bgcolor:u?ht()==="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:pa(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))]})};T();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??"",Ml=(t,r,o)=>o===""?"":o&&o!==r&&t.some(n=>n.fieldId===o)?o:t.find(n=>n.fieldId!==r)?.fieldId??"",Zu=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),Yv=(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},iO=({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=Jt.useRef(0),C=Jt.useRef(false),P=t??g("pivot.title.default"),w=i??g("pivot.empty"),k=Jt.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=Jt.useCallback(M=>k[M]??Du[M],[k]),S=Jt.useMemo(()=>new Set(o.map(M=>M.id)),[o]),E=Jt.useMemo(()=>new Map(o.map(M=>[M.id,M])),[o]),[D,R]=Jt.useState(()=>lr(n?.rows,S)),[A,N]=Jt.useState(()=>lr(n?.columns,S)),[O,F]=Jt.useState(()=>lr(n?.filters,S)),[q,z]=Jt.useState(()=>{let M=n?.values??[],G=new Set,K=[];return M.forEach(de=>{if(!S.has(de.fieldId)||G.has(de.fieldId))return;G.add(de.fieldId),h.current+=1;let He=E.get(de.fieldId);K.push({tokenId:`v${h.current}`,fieldId:de.fieldId,aggregation:hr(de.aggregation,He)});}),K}),[X,$]=Jt.useState({}),[_,V]=Jt.useState(true),[B,Z]=Jt.useState(false),[Q,ge]=Jt.useState(()=>Rl(lr(n?.rows,S),lr(n?.columns,S),a?.dimensionFieldId)),[se,le]=Jt.useState(()=>{let M=(n?.values??[]).filter((G,K,de)=>S.has(G.fieldId)&&de.findIndex(He=>He.fieldId===G.fieldId)===K).map(G=>({tokenId:G.fieldId,fieldId:G.fieldId,aggregation:hr(G.aggregation,E.get(G.fieldId))}));return es(M,a?.primaryValueFieldId)}),[be,_e]=Jt.useState(()=>{let M=(n?.values??[]).filter((K,de,He)=>S.has(K.fieldId)&&He.findIndex(at=>at.fieldId===K.fieldId)===de).map(K=>({tokenId:K.fieldId,fieldId:K.fieldId,aggregation:hr(K.aggregation,E.get(K.fieldId))})),G=es(M,a?.primaryValueFieldId);return Ml(M,G,a?.secondaryValueFieldId)}),[De,Pe]=Jt.useState(a?.chartType??"bar-vertical"),[Ve,Te]=Jt.useState(l),[xe,We]=Jt.useState(d),[ot,it]=Jt.useState(()=>b??[]),[Ze,U]=Jt.useState(""),[Fe,ye]=Jt.useState(false),[Le,st]=Jt.useState(""),[Je,vt]=Jt.useState(null),[St,Et]=Jt.useState(new Set(["__grand_total__"])),[Lt,re]=Jt.useState(new Set),nt=u?.rowFields??D,Be=u?.columnFields??A,ce=u?.filterFields??O,fe=u?.valueFields??q,ee=u?.filterSelections??X,Ie=u?.showGrandTotal??_,Re=u?.isConfiguratorCollapsed??B,je=u?.chartDimensionFieldId??Q,mt=u?.chartPrimaryValueFieldId??se,pt=u?.chartSecondaryValueFieldId??be,Ot=u?.chartType??De,Kt=u?.isChartCollapsed??Ve,yt=u?.isTableCollapsed??xe,bt=f??ot,xr=p||bt.length>0||!!m,Tt=Jt.useCallback(M=>{if(u?.setRowFields){u.setRowFields(M);return}R(M);},[u]),Ft=Jt.useCallback(M=>{if(u?.setColumnFields){u.setColumnFields(M);return}N(M);},[u]),ut=Jt.useCallback(M=>{if(u?.setFilterFields){u.setFilterFields(M);return}F(M);},[u]),Bt=Jt.useCallback(M=>{if(u?.setValueFields){u.setValueFields(M);return}z(M);},[u]),we=Jt.useCallback(M=>{if(u?.setFilterSelections){u.setFilterSelections(M);return}$(M);},[u]),W=Jt.useCallback(M=>{if(u?.setShowGrandTotal){u.setShowGrandTotal(M);return}V(M);},[u]),Y=Jt.useCallback(M=>{if(u?.setIsConfiguratorCollapsed){u.setIsConfiguratorCollapsed(M);return}Z(M);},[u]),te=Jt.useCallback(M=>{if(u?.setChartDimensionFieldId){u.setChartDimensionFieldId(M);return}ge(M);},[u]),Ne=Jt.useCallback(M=>{if(u?.setChartPrimaryValueFieldId){u.setChartPrimaryValueFieldId(M);return}le(M);},[u]),he=Jt.useCallback(M=>{if(u?.setChartSecondaryValueFieldId){u.setChartSecondaryValueFieldId(M);return}_e(M);},[u]),Ae=Jt.useCallback(M=>{if(u?.setChartType){u.setChartType(M);return}Pe(M);},[u]),Ke=Jt.useCallback(M=>{if(u?.setIsChartCollapsed){u.setIsChartCollapsed(M);return}Te(M);},[u]),et=Jt.useCallback(M=>{if(u?.setIsTableCollapsed){u.setIsTableCollapsed(M);return}We(M);},[u]),qe=Jt.useCallback(M=>{let G=typeof M=="function"?M(bt):M;f||it(G),m?.(G);},[m,bt,f]),Ct=Jt.useMemo(()=>new Set([...nt,...Be,...ce]),[nt,Be,ce]),Nt=Jt.useMemo(()=>o.filter(M=>!Ct.has(M.id)),[o,Ct]),wt=Jt.useMemo(()=>{let M=[...nt,...Be,...ce],G=new Set,K=[];return M.forEach(de=>{G.has(de)||(G.add(de),K.push(de));}),K},[Be,ce,nt]);Jt.useEffect(()=>{Tt(M=>{let G=M.filter(K=>S.has(K));return po(M,G)?M:G}),Ft(M=>{let G=M.filter(K=>S.has(K));return po(M,G)?M:G}),ut(M=>{let G=M.filter(K=>S.has(K));return po(M,G)?M:G}),Bt(M=>{let G=M.filter(K=>S.has(K.fieldId)).map(K=>({...K,aggregation:hr(K.aggregation,E.get(K.fieldId))}));return qi(M,G)?M:G});},[E,S]);let xt=Jt.useMemo(()=>{let M={};return wt.forEach(G=>{let K=new Set;r.forEach(de=>{K.add(co(de[G]));}),M[G]=Array.from(K).sort((de,He)=>de.localeCompare(He));}),M},[wt,r]);Jt.useEffect(()=>{we(M=>{let G={};return wt.forEach(K=>{let de=xt[K]??[],at=(M[K]??[]).filter(oe=>de.includes(oe)),$e=Object.prototype.hasOwnProperty.call(M,K);G[K]=$e?at:de;}),Fu(M,G)?M:G});},[wt,xt]),Jt.useEffect(()=>{te(M=>Rl(nt,Be,M));},[Be,nt,te]),Jt.useEffect(()=>{Ne(M=>es(fe,M));},[Ne,fe]),Jt.useEffect(()=>{he(M=>Ml(fe,mt,M));},[mt,he,fe]);let H=Jt.useMemo(()=>r.filter(M=>wt.every(G=>{let K=ee[G]??[],de=xt[G]??[];if(K.length===de.length)return true;if(K.length===0)return false;let He=co(M[G]);return K.includes(He)})),[wt,xt,ee,r]),j=Jt.useMemo(()=>{if(fe.length===0)return null;let M=new Map;if(H.forEach($e=>{let oe=Be.length>0?Be.map(J=>co($e[J])):[g("pivot.valueLabel")],ue=Go(oe);M.set(ue,oe);}),M.size===0){let $e=Be.length>0?Be.map(()=>Ui):[g("pivot.valueLabel")];M.set(Go($e),$e);}let G=Array.from(M.entries()).sort(($e,oe)=>Ou($e[1],oe[1])),K=G.flatMap(([$e,oe])=>fe.map(ue=>{let J=E.get(ue.fieldId),Oe=`${I(ue.aggregation)} ${J?.label??ue.fieldId}`,Qe=Be.length===0||fe.length>1?`${oe.join(" / ")} \u2022 ${Oe}`:oe.join(" / ");return {id:`${$e}::${ue.tokenId}`,colKey:$e,valueItem:ue,label:Qe}})),de=[];Be.length>0&&G.forEach(([$e,oe])=>{let ue=K.filter(Qe=>Qe.colKey===$e),J=de,Oe=[];oe.forEach((Qe,Me)=>{Oe.push(`d${Me}:${Qe}`);let Ye=`col::${Go(Oe)}`,Rt=J.find(Qo=>Qo.key===Ye);Rt||(Rt={key:Ye,label:Qe,children:[],leafColumnIds:[],path:oe.slice(0,Me+1),depth:Me},J.push(Rt)),ue.forEach(Qo=>{Rt.leafColumnIds.includes(Qo.id)||Rt.leafColumnIds.push(Qo.id);}),J=Rt.children;});});let He=$e=>{let oe={};return K.forEach(ue=>{let J=$e.filter(Oe=>{let Qe=Be.length>0?Be.map(Me=>co(Oe[Me])):[g("pivot.valueLabel")];return Go(Qe)===ue.colKey});oe[ue.id]=Sn(J,ue.valueItem.fieldId,ue.valueItem.aggregation);}),oe},at=[];if(nt.length===0)at.push({key:"root",value:g("pivot.resultLabel")||Ru,children:[],isLeaf:true,aggregatedValues:He(H),path:[],depth:0});else {let $e=(oe,ue,J)=>{if(ue>=nt.length)return [];let Oe=nt[ue],Qe=new Map;return oe.forEach(Me=>{let Ye=co(Me[Oe]);Qe.has(Ye)||Qe.set(Ye,[]),Qe.get(Ye).push(Me);}),Array.from(Qe.keys()).sort().map(Me=>{let Ye=Qe.get(Me),Rt=[...J,Me];return {key:Go(Rt),value:Me,fieldId:Oe,aggregatedValues:He(Ye),children:$e(Ye,ue+1,Rt),isLeaf:ue===nt.length-1,path:Rt,depth:ue}})};at.push(...$e(H,0,[]));}return {dataColumns:K,columnTree:de,rowTree:at}},[Be,E,H,I,nt,g,fe]),me=Jt.useCallback((M,G)=>(h.current+=1,{tokenId:`v${h.current}`,fieldId:M,aggregation:hr(G,E.get(M))}),[E]),Se=Jt.useCallback(M=>{if(M==="rows")return Tt([]);if(M==="columns")return Ft([]);if(M==="filters")return ut([]);Bt([]);},[]),tt=Jt.useCallback((M,G)=>{if(M==="rows")return Tt(K=>K.filter(de=>de!==G));if(M==="columns")return Ft(K=>K.filter(de=>de!==G));if(M==="filters")return ut(K=>K.filter(de=>de!==G));Bt(K=>K.filter(de=>de.tokenId!==G));},[]),Xe=Jt.useCallback((M,G)=>{Bt(K=>K.map(de=>de.tokenId===M?{...de,aggregation:hr(G,E.get(de.fieldId))}:de));},[E]),It=Jt.useCallback(M=>{vt(String(M.active.id));},[]),ft=Jt.useCallback(M=>{if(vt(null),!M.over)return;let G=Ki(String(M.active.id)),K=Ki(String(M.over.id));if(!G||!K||G.kind!=="item"||!G.key)return;if(G.zone===K.zone&&K.kind==="item"){if(G.zone==="rows"){let Me=nt.indexOf(G.key),Ye=nt.indexOf(K.key??"");Me!==-1&&Ye!==-1&&Me!==Ye&&Tt(Rt=>sortable.arrayMove(Rt,Me,Ye));return}if(G.zone==="columns"){let Me=Be.indexOf(G.key),Ye=Be.indexOf(K.key??"");Me!==-1&&Ye!==-1&&Me!==Ye&&Ft(Rt=>sortable.arrayMove(Rt,Me,Ye));return}if(G.zone==="filters"){let Me=ce.indexOf(G.key),Ye=ce.indexOf(K.key??"");Me!==-1&&Ye!==-1&&Me!==Ye&&ut(Rt=>sortable.arrayMove(Rt,Me,Ye));return}if(G.zone==="values"){let Me=fe.findIndex(Rt=>Rt.tokenId===G.key),Ye=fe.findIndex(Rt=>Rt.tokenId===(K.key??""));Me!==-1&&Ye!==-1&&Me!==Ye&&Bt(Rt=>sortable.arrayMove(Rt,Me,Ye));}return}let de=K.zone,He=[...nt],at=[...Be],$e=[...ce],oe=[...fe],ue="",J=null;if(G.zone==="palette")ue=G.key;else if(G.zone==="values"){let Me=oe.find(Ye=>Ye.tokenId===G.key);if(!Me)return;ue=Me.fieldId,J=Me,oe=oe.filter(Ye=>Ye.tokenId!==G.key);}else G.zone==="rows"?(ue=G.key,He=He.filter(Me=>Me!==ue)):G.zone==="columns"?(ue=G.key,at=at.filter(Me=>Me!==ue)):G.zone==="filters"&&(ue=G.key,$e=$e.filter(Me=>Me!==ue));if(!ue)return;let Oe=()=>{He=He.filter(Me=>Me!==ue),at=at.filter(Me=>Me!==ue),$e=$e.filter(Me=>Me!==ue);},Qe=Me=>{if(K.kind!=="item"||!K.key)return Me==="rows"?He.length:Me==="columns"?at.length:Me==="filters"?$e.length:Me==="values"?oe.length:0;if(Me==="rows"){let Ye=He.indexOf(K.key);return Ye>=0?Ye:He.length}if(Me==="columns"){let Ye=at.indexOf(K.key);return Ye>=0?Ye:at.length}if(Me==="filters"){let Ye=$e.indexOf(K.key);return Ye>=0?Ye:$e.length}if(Me==="values"){let Ye=oe.findIndex(Rt=>Rt.tokenId===K.key);return Ye>=0?Ye:oe.length}return 0};if(de==="palette"){Tt(He),Ft(at),ut($e),Bt(oe);return}if(de==="values"){let Me=Qe("values"),Ye=J??me(ue);oe.splice(Me,0,Ye),Tt(He),Ft(at),ut($e),Bt(oe);return}if(Lu(de)){Oe();let Me=Qe(de);de==="rows"?He.splice(Me,0,ue):de==="columns"?at.splice(Me,0,ue):$e.splice(Me,0,ue),Tt(He),Ft(at),ut($e),Bt(oe);}},[Be,me,ce,nt,fe]),gt=Jt.useCallback((M,G)=>{we(K=>({...K,[M]:G}));},[]),kt=Jt.useCallback(M=>{Et(G=>{let K=new Set(G);return K.has(M)?K.delete(M):K.add(M),K});},[]),nr=Jt.useCallback(M=>{re(G=>{let K=new Set(G);return K.has(M)?K.delete(M):K.add(M),K});},[]),Ht=Jt.useCallback(M=>{let G=E.get(M.fieldId),K=kl(G);return e(Co,{size:"small",sx:{minWidth:98},children:e(Wt,{value:M.aggregation,onChange:de=>Xe(M.tokenId,de.target.value),onClick:de=>de.stopPropagation(),onMouseDown:de=>de.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& select.orb-inp":{py:.35}},children:K.map(de=>e("option",{value:de,sx:{fontSize:"0.75rem"},children:I(de)},de))})})},[E,I,Xe]),Yt=Jt.useCallback(M=>{let G=xt[M]??[],K=ee[M]??G;return G.length===0?g("pivot.filter.noValues"):K.length===0?g("pivot.filter.noneSelected"):K.length===G.length?g("pivot.filter.allValues"):g("pivot.filter.selectedCount",{selected:K.length,total:G.length})},[xt,ee,g]),Vt=Jt.useCallback(M=>{let G=xt[M]??[],K=ee[M]??G;return e(Hu,{options:G,selectedValues:K,onChange:de=>gt(M,de)})},[xt,ee,gt]),qt=Jt.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),$t=Jt.useCallback(()=>{let M={};return new Set([...wt,...Object.keys(ee)]).forEach(K=>{if(!S.has(K))return;let de=ee[K]??[];M[K]=[...de];}),{layout:{rows:[...nt],columns:[...Be],filters:[...ce],values:fe.map(K=>({fieldId:K.fieldId,aggregation:K.aggregation}))},filterSelections:M,showGrandTotal:Ie,chart:{dimensionFieldId:je,primaryValueFieldId:mt,secondaryValueFieldId:pt,chartType:Ot}}},[wt,je,mt,pt,Ot,Be,ce,ee,nt,Ie,S,fe]),rr=Jt.useCallback(M=>{let G=lr(M.layout.rows,S),K=lr(M.layout.columns,S),de=lr(M.layout.filters,S),He=new Set,at=(M.layout.values??[]).filter(ue=>!S.has(ue.fieldId)||He.has(ue.fieldId)?false:(He.add(ue.fieldId),true)).map(ue=>me(ue.fieldId,ue.aggregation)),$e={};Object.entries(M.filterSelections??{}).forEach(([ue,J])=>{!S.has(ue)||!Array.isArray(J)||($e[ue]=Array.from(new Set(J.map(Oe=>String(Oe)))));}),Tt(G),Ft(K),ut(de),Bt(at),we($e),typeof M.showGrandTotal=="boolean"&&W(M.showGrandTotal),te(Rl(G,K,M.chart?.dimensionFieldId));let oe=es(at,M.chart?.primaryValueFieldId);Ne(oe),he(Ml(at,oe,M.chart?.secondaryValueFieldId)),Ae(M.chart?.chartType??"bar-vertical"),U(M.id),y?.(M);},[me,y,te,Ne,he,Ae,Ft,ut,we,Tt,W,Bt,S]),ar=Jt.useCallback(M=>{if(!M){U("");return}let G=bt.find(K=>K.id===M);if(!G){U("");return}rr(G);},[rr,bt]),gr=Jt.useCallback(()=>{let M=g("pivot.preset.defaultName",{index:bt.length+1});st(M),ye(true);},[bt.length,g]),Ir=Jt.useCallback(()=>{let M=Le.trim();if(!M)return;let G={id:qt(),name:M,...$t()};qe(K=>[...K,G]),U(G.id),ye(false);},[$t,qt,Le,qe]),Rr=Jt.useCallback(()=>{Ze&&(qe(M=>M.filter(G=>G.id!==Ze)),U(""));},[Ze,qe]);Jt.useEffect(()=>{if(!v||C.current)return;let M=bt.find(G=>G.id===v);M&&(C.current=true,rr(M));},[rr,v,bt]),Jt.useEffect(()=>{Ze&&(bt.some(M=>M.id===Ze)||U(""));},[Ze,bt]);let oo=Jt.useMemo(()=>{if(!Ie||!j||!nt.length)return null;let M={};return j.dataColumns.forEach(G=>{let K=H.filter(de=>{let He=Be.length>0?Be.map(at=>co(de[at])):[g("pivot.valueLabel")];return Go(He)===G.colKey});M[G.id]=Sn(K,G.valueItem.fieldId,G.valueItem.aggregation);}),{key:"__grand_total__",value:g("pivot.grandTotal")||Mu,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:M,path:[],depth:-1}},[Ie,j,H,Be,nt.length,g]),vr=Jt.useMemo(()=>Zu(j?.rowTree??[]),[j]),Or=Jt.useMemo(()=>Zu(j?.columnTree??[]),[j]);Jt.useEffect(()=>{Et(M=>{let G=new Set;return M.has("__grand_total__")&&G.add("__grand_total__"),vr.forEach(K=>{M.has(K)&&G.add(K);}),G});},[vr]),Jt.useEffect(()=>{re(M=>{let G=new Set;return Or.forEach(K=>{M.has(K)&&G.add(K);}),G});},[Or]);let qo=Jt.useCallback(()=>{Et(M=>{let G=new Set(M);return vr.forEach(K=>G.add(K)),G});},[vr]),Xo=Jt.useCallback(()=>{Et(M=>{let G=new Set;return M.has("__grand_total__")&&G.add("__grand_total__"),G});},[]),Lo=Jt.useCallback(()=>{re(new Set(Or));},[Or]),Yo=Jt.useCallback(()=>{re(new Set);},[]),Zo=Jt.useMemo(()=>!j||Be.length===0?[]:Yv(j.columnTree,Lt),[Be.length,Lt,j]),Mr=Jt.useMemo(()=>{if(!j)return [];if(Be.length===0)return j.dataColumns.map(G=>({id:G.id,label:G.label,leafColumnIds:[G.id],valueItem:G.valueItem}));let M=new Map(j.dataColumns.map(G=>[G.id,G]));return Zo.flatMap(G=>{let K=new Map;return G.leafColumnIds.forEach(de=>{let He=M.get(de);if(!He)return;let at=He.valueItem.tokenId,$e=`${I(He.valueItem.aggregation)} ${E.get(He.valueItem.fieldId)?.label??He.valueItem.fieldId}`,oe=K.get(at);if(oe){oe.leafColumnIds.push(de);return}K.set(at,{id:`${G.key}::${at}`,label:fe.length>1?$e:G.label,leafColumnIds:[de],valueItem:He.valueItem});}),Array.from(K.values())})},[Be.length,E,I,j,fe.length,Zo]),Oo=Jt.useMemo(()=>new Map(Mr.map(M=>[M.id,M])),[Mr]),jo=Jt.useMemo(()=>Mr.map(M=>({id:M.id,colKey:M.id,valueItem:M.valueItem,label:M.label})),[Mr]),Kr=Jt.useMemo(()=>{if(!j||Be.length===0)return [];let M=[],G=ju(j.columnTree,Lt),K=G+(fe.length>1?1:0),de=(He,at)=>{M[at]??(M[at]=[]),He.forEach($e=>{let oe=$e.children.length>0&&Lt.has($e.key),ue=Mr.filter(Oe=>$e.leafColumnIds.some(Qe=>Oe.leafColumnIds.includes(Qe))).length,J=oe||fe.length>1?1:K-at;M[at].push({key:$e.key,label:$e.label,colSpan:ue,rowSpan:J,expandable:$e.children.length>0,expanded:oe}),oe&&de($e.children,at+1);});};return de(j.columnTree,0),fe.length>1&&(M[G]=Mr.map(He=>({key:He.id,label:He.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),M},[Be.length,Lt,j,fe.length,Mr]),no=Jt.useCallback((M,G)=>G.leafColumnIds.reduce((K,de)=>K+(M.aggregatedValues[de]??0),0),[]),En=Jt.useMemo(()=>c(jsxRuntime.Fragment,{children:[e(Ce,{size:"small",variant:"text",onClick:qo,disabled:vr.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.expandRowsAll")}),e(Ce,{size:"small",variant:"text",onClick:Xo,disabled:vr.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.collapseRowsAll")}),e(At,{orientation:"vertical",flexItem:true}),e(Ce,{size:"small",variant:"text",onClick:Lo,disabled:Or.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.expandColumnsAll")}),e(Ce,{size:"small",variant:"text",onClick:Yo,disabled:Be.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.collapseColumnsAll")})]}),[Be.length,Or.size,vr.size,Yo,Xo,Lo,qo,g]),Fo=()=>{if(!Je)return null;let M=Ki(Je);if(!M||M.kind!=="item"||!M.key)return null;if(M.zone==="palette"){let He=E.get(M.key);return He?e(Pl,{label:He.label,subtitle:He.type}):null}if(M.zone==="values"){let He=fe.find(ue=>ue.tokenId===M.key);if(!He)return null;let $e=E.get(He.fieldId)?.label??He.fieldId,oe=`${I(He.aggregation)}(${$e})`;return e(Xi,{label:$e,caption:oe})}let K=E.get(M.key)?.label??M.key,de=Yt(M.key);return e(Xi,{label:K,caption:de})};return c(Ee,{sx:M=>({p:{xs:1.2,md:2},borderRadius:"var(--orb-r-container)",border:`1px solid ${M.palette.divider}`,bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-2)",display:"flex",flexDirection:"column",gap:2.25}),children:[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:P}),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:[xr&&c(jsxRuntime.Fragment,{children:[e(Co,{size:"small",sx:{minWidth:200},children:c(Wt,{value:Ze,displayEmpty:true,onChange:M=>ar(String(M.target.value)),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g("pivot.preset.selectPlaceholder")}),bt.map(M=>e("option",{value:M.id,sx:{fontSize:"0.75rem"},children:M.name},M.id))]})}),e(lt,{title:g("pivot.preset.save"),children:e(ae,{size:"small",onClick:gr,"aria-label":g("pivot.preset.save"),sx:{width:28,height:28,p:0},children:e(Po,{size:15})})}),e(lt,{title:g("pivot.preset.delete"),children:e("span",{children:e(ae,{size:"small",onClick:Rr,disabled:!Ze,"aria-label":g("pivot.preset.delete"),sx:{width:28,height:28,p:0},children:e(ni,{size:15})})})}),e(At,{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(At,{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:Ie,onChange:M=>W(M.target.checked)})]})]})]}),e(At,{}),c(core.DndContext,{sensors:x,collisionDetection:core.closestCenter,onDragStart:It,onDragEnd:ft,children:[e(Wu,{isConfiguratorCollapsed:Re,onToggleCollapse:()=>Y(M=>!M),availableFields:Nt,fieldMap:E,filterFields:ce,columnFields:Be,rowFields:nt,valueFields:fe,clearZone:Se,removeFieldFromZone:tt,getFilterSelectionSummary:Yt,renderDimensionFilterSelect:Vt,renderAggregationSelect:Ht,getAggregationLabel:I}),e(Td,{children:e(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Fo()})})]}),e(Xu,{rows:H,fieldMap:E,rowFields:nt,columnFields:Be,valueFields:fe,chartDimensionFieldId:je,chartPrimaryValueFieldId:mt,chartSecondaryValueFieldId:pt,chartType:Ot,isCollapsed:Kt,onChartDimensionFieldIdChange:M=>te(M),onChartPrimaryValueFieldIdChange:M=>Ne(M),onChartSecondaryValueFieldIdChange:M=>he(M),onChartTypeChange:M=>Ae(M),onToggleCollapse:()=>Ke(M=>!M),getAggregationLabel:I}),e(Pn,{title:g("pivot.table.sectionTitle"),subtitle:nt.length>0?nt.map(M=>E.get(M)?.label??M).join(" > "):g("pivot.table.dimensions"),collapsed:yt,onToggleCollapse:()=>et(M=>!M),expandAriaLabel:g("pivot.table.collapse.ariaExpand"),collapseAriaLabel:g("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:En,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((M,G)=>c("tr",{children:[G===0&&e("td",{rowSpan:Math.max(Kr.length,1),sx:K=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:ht()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${K.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:nt.length>0?nt.map(K=>E.get(K)?.label).join(" > "):g("pivot.table.dimensions")}),(M.length>0?M:Mr.map(K=>({key:K.id,label:K.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(K=>e("td",{align:"center",colSpan:K.colSpan,rowSpan:K.rowSpan,sx:de=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:ht()==="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:[K.expandable&&e(ae,{size:"small",onClick:()=>nr(K.key),sx:{width:22,height:22,p:0,ml:-0.2},children:K.expanded?e(Vr,{size:12}):e(ko,{size:12})}),e("div",{component:"span",children:K.label})]})},K.key))]},`pivot-header-row-${G}`))}),c("tbody",{children:[j.rowTree.map(M=>e(Qi,{node:M,dataColumns:jo,fieldMap:E,level:0,expandedKeys:St,onToggle:kt,getValue:(G,K)=>{let de=Oo.get(K);return de?no(G,de):0}},M.key)),oo&&e(Qi,{node:oo,dataColumns:jo,fieldMap:E,level:0,expandedKeys:St,onToggle:kt,getValue:(M,G)=>{let K=Oo.get(G);return K?no(M,K):0}})]})]})})}),c(zt,{open:Fe,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:Le,onChange:M=>st(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),Ir());}})}),c("div",{className:"orb-dialog-actions",children:[e(Ce,{onClick:()=>ye(false),children:g("common.cancel")}),e(Ce,{variant:"contained",onClick:Ir,disabled:!Le.trim(),children:g("common.save")})]})]})]})};var Qu=(t,r,o)=>{let n=[...t,...r];return o&&n.includes(o)?o:n[0]??""},Nl=(t,r)=>r&&t.some(o=>o.fieldId===r)?r:t[0]?.fieldId??"",Ju=(t,r,o)=>o===""?"":o&&o!==r&&t.some(n=>n.fieldId===o)?o:t.find(n=>n.fieldId!==r)?.fieldId??"",pO=({fields:t,initialLayout:r,initialFilterSelections:o={},initialShowGrandTotal:n=true,initialConfiguratorCollapsed:a=false,initialChart:i,initialChartCollapsed:s=false,initialTableCollapsed:l=false})=>{let d=Jt.useRef(0),u=Jt.useMemo(()=>new Set(t.map(U=>U.id)),[t]),p=Jt.useMemo(()=>new Map(t.map(U=>[U.id,U])),[t]),[f,b]=Jt.useState(()=>lr(r?.rows,u)),[m,v]=Jt.useState(()=>lr(r?.columns,u)),[y,g]=Jt.useState(()=>lr(r?.filters,u)),[x,h]=Jt.useState(()=>{let U=r?.values??[],Fe=new Set,ye=[];return U.forEach(Le=>{!u.has(Le.fieldId)||Fe.has(Le.fieldId)||(Fe.add(Le.fieldId),d.current+=1,ye.push({tokenId:`v${d.current}`,fieldId:Le.fieldId,aggregation:hr(Le.aggregation,p.get(Le.fieldId))}));}),ye}),[C,P]=Jt.useState(o),[w,k]=Jt.useState(n),[I,S]=Jt.useState(a),[E,D]=Jt.useState(()=>Qu(lr(r?.rows,u),lr(r?.columns,u),i?.dimensionFieldId)),[R,A]=Jt.useState(()=>{let U=(()=>{let Fe=r?.values??[],ye=new Set,Le=[];return Fe.forEach(st=>{!u.has(st.fieldId)||ye.has(st.fieldId)||(ye.add(st.fieldId),Le.push({tokenId:st.fieldId,fieldId:st.fieldId,aggregation:hr(st.aggregation,p.get(st.fieldId))}));}),Le})();return Nl(U,i?.primaryValueFieldId)}),[N,O]=Jt.useState(()=>{let U=(()=>{let ye=r?.values??[],Le=new Set,st=[];return ye.forEach(Je=>{!u.has(Je.fieldId)||Le.has(Je.fieldId)||(Le.add(Je.fieldId),st.push({tokenId:Je.fieldId,fieldId:Je.fieldId,aggregation:hr(Je.aggregation,p.get(Je.fieldId))}));}),st})(),Fe=Nl(U,i?.primaryValueFieldId);return Ju(U,Fe,i?.secondaryValueFieldId)}),[F,q]=Jt.useState(i?.chartType??"bar-vertical"),[z,X]=Jt.useState(s),[$,_]=Jt.useState(l);Jt.useEffect(()=>{b(U=>{let Fe=U.filter(ye=>u.has(ye));return po(U,Fe)?U:Fe}),v(U=>{let Fe=U.filter(ye=>u.has(ye));return po(U,Fe)?U:Fe}),g(U=>{let Fe=U.filter(ye=>u.has(ye));return po(U,Fe)?U:Fe}),h(U=>{let Fe=U.filter(ye=>u.has(ye.fieldId)).map(ye=>({...ye,aggregation:hr(ye.aggregation,p.get(ye.fieldId))}));return qi(U,Fe)?U:Fe});},[p,u]),Jt.useEffect(()=>{D(U=>Qu(f,m,U));},[m,f]),Jt.useEffect(()=>{A(U=>Nl(x,U));},[x]),Jt.useEffect(()=>{O(U=>Ju(x,R,U));},[R,x]);let V=Jt.useCallback(U=>{b(lr(U,u));},[u]),B=Jt.useCallback(U=>{v(lr(U,u));},[u]),Z=Jt.useCallback(U=>{g(lr(U,u));},[u]),Q=Jt.useCallback(U=>{h(Fe=>{let ye=U??[],Le=new Set,st=[];return ye.forEach(Je=>{if(!u.has(Je.fieldId)||Le.has(Je.fieldId))return;Le.add(Je.fieldId);let vt=Fe.find(St=>St.fieldId===Je.fieldId);if(vt){st.push({...vt,aggregation:hr(Je.aggregation??vt.aggregation,p.get(Je.fieldId))});return}d.current+=1,st.push({tokenId:`v${d.current}`,fieldId:Je.fieldId,aggregation:hr(Je.aggregation,p.get(Je.fieldId))});}),st});},[p,u]),ge=Jt.useCallback(U=>{V(U.rows??[]),B(U.columns??[]),Z(U.filters??[]),Q(U.values??[]);},[B,Z,V,Q]),se=Jt.useCallback(U=>{if(U==="rows")return b([]);if(U==="columns")return v([]);if(U==="filters")return g([]);h([]);},[]),le=Jt.useCallback((U,Fe)=>{if(U==="rows")return b(ye=>ye.filter(Le=>Le!==Fe));if(U==="columns")return v(ye=>ye.filter(Le=>Le!==Fe));if(U==="filters")return g(ye=>ye.filter(Le=>Le!==Fe));h(ye=>ye.filter(Le=>Le.tokenId!==Fe));},[]),be=Jt.useCallback((U,Fe)=>{h(ye=>ye.map(Le=>Le.tokenId===U?{...Le,aggregation:hr(Fe,p.get(Le.fieldId))}:Le));},[p]),_e=Jt.useCallback((U,Fe)=>{P(ye=>({...ye,[U]:Fe}));},[]),De=Jt.useCallback(()=>{P({});},[]),Pe=Jt.useCallback(()=>{k(U=>!U);},[]),Ve=Jt.useCallback(()=>{S(U=>!U);},[]),Te=Jt.useCallback(U=>{D(U);},[]),xe=Jt.useCallback(U=>{A(U);},[]),We=Jt.useCallback(U=>{O(U);},[]),ot=Jt.useCallback(()=>{X(U=>!U);},[]),it=Jt.useCallback(()=>{_(U=>!U);},[]);return {model:Jt.useMemo(()=>({rowFields:f,setRowFields:b,columnFields:m,setColumnFields:v,filterFields:y,setFilterFields:g,valueFields:x,setValueFields:h,filterSelections:C,setFilterSelections:P,showGrandTotal:w,setShowGrandTotal:k,isConfiguratorCollapsed:I,setIsConfiguratorCollapsed:S,chartDimensionFieldId:E,setChartDimensionFieldId:D,chartPrimaryValueFieldId:R,setChartPrimaryValueFieldId:A,chartSecondaryValueFieldId:N,setChartSecondaryValueFieldId:O,chartType:F,setChartType:q,isChartCollapsed:z,setIsChartCollapsed:X,isTableCollapsed:$,setIsTableCollapsed:_}),[E,R,N,F,m,y,C,z,I,$,f,w,x]),actions:{setRows:V,setColumns:B,setFilters:Z,setValues:Q,setLayout:ge,clearZone:se,removeFieldFromZone:le,setAggregationForValue:be,setFilterSelection:_e,resetFilterSelections:De,toggleGrandTotal:Pe,toggleConfigurator:Ve,setChartDimension:Te,setChartPrimaryValue:xe,setChartSecondaryValue:We,setChartType:q,toggleChart:ot,toggleTable:it}}};var fO=({orientation:t="auto",defaultNavigationOpen:r,onNavOpenChange:o}={})=>{let n=sr(),a=xo("(orientation: portrait)"),i=xo(n.breakpoints.down("md")),s=Jt.useMemo(()=>t==="auto"?a||i?"portrait":"landscape":t,[i,a,t]),[l,d]=Jt.useState(r??s==="landscape");Jt.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 ty=t=>{let r=Number(t||0);return Number.isFinite(r)?r:0},vO=({rows:t,rowKey:r="id",numericField:o,defaultSelectedId:n})=>{let i=t[0]?.[r],[s,l]=Jt.useState(n??i),d=Jt.useMemo(()=>t.find(m=>m[r]===s)||t[0],[r,t,s]),[u,p]=Jt.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=ty(u),y=t.map(g=>g[r]===s?{...g,[o]:v}:g);m(y);}}};T();var ry=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],tm=(t,r,o,n)=>{r?.(t),n&&o?.();},kO=({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=ry,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=Jt__namespace.default.useRef(null),g=Jt__namespace.default.useRef(null),x=Jt__namespace.default.useRef(null),h=Jt__namespace.default.useRef(null),[C,P]=Jt__namespace.default.useState("idle"),[w,k]=Jt__namespace.default.useState(""),[I,S]=Jt__namespace.default.useState(null),[E,D]=Jt__namespace.default.useState(null),R=Jt__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);},[]),A=Jt__namespace.default.useCallback(O=>{D(O),P("error"),m?.(O);},[m]);Jt__namespace.default.useEffect(()=>{if(!t){R(),P("idle"),D(null),k("");return}let O=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){P("unsupported"),D("Camera access is not supported in this browser.");return}P("starting"),D(null);try{let q=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:i}}});if(O){q.getTracks().forEach(z=>z.stop());return}if(g.current=q,y.current&&(y.current.srcObject=q,await y.current.play()),!window.BarcodeDetector){P("unsupported"),D("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}h.current=new window.BarcodeDetector({formats:a}),P("ready"),x.current=window.setInterval(async()=>{if(!(!y.current||!h.current)&&!(y.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let X=(await h.current.detect(y.current)).find(_=>_.rawValue);if(!X?.rawValue)return;let $={rawValue:X.rawValue,format:X.format};S($),R(),tm($,b,r,l);}catch(z){A(z instanceof Error?z.message:"Failed to detect barcode.");}},d);}catch(q){A(q instanceof Error?q.message:"Unable to start camera.");}}})(),()=>{O=true,R();}},[l,i,a,r,b,t,A,d,R]);let N=()=>{let O=w.trim();if(!O)return;let F={rawValue:O,format:"manual"};S(F),tm(F,b,r,l);};return c(zt,{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(Ee,{elevation:0,sx:{position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:ht()==="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(Pt,{icon:e(zd,{}),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(Pt,{icon:e(ap,{}),label:`${I.format||"barcode"}: ${I.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),E?e(jr,{severity:C==="unsupported"?"info":"warning",children:E}):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=>k(O.target.value)}),e(Ce,{variant:"contained",onClick:N,sx:{minHeight:56,px:2.5},children:u})]}):null]})}),e("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:e(Ce,{onClick:r,children:p})})]})};T();var oy={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)"},NO=({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]=Jt.useState(0),[P,w]=Jt.useState(false),k=Jt.useRef(null),I=Jt.useRef(0),S=Jt.useRef(0),E=!!(b||m),D=132,R=()=>{C(0),w(false),k.current=null,I.current=0,S.current=0;},A=z=>{(z==="start"?b:m)?.onTrigger?.(),g?.(z),R();},N=z=>{!E||z.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(k.current=z.pointerId,I.current=z.clientX,S.current=z.clientX,w(true),z.currentTarget.setPointerCapture(z.pointerId));},O=z=>{if(!P||k.current!==z.pointerId)return;S.current=z.clientX;let X=S.current-I.current,$=Math.max(-D,Math.min(D,X));C($);},F=z=>{if(!P||k.current!==z.pointerId)return;let X=S.current-I.current;if(X>=f&&b){A("start");return}if(X<=-f&&m){A("end");return}Math.abs(X)<12&&y?.(),R();},q=(z,X)=>{if(!z)return null;let $=z.backgroundColor||oy[z.tone||"default"];return e("div",{sx:{position:"absolute",top:0,bottom:0,[X]:0,width:D,px:2,display:"flex",alignItems:"center",justifyContent:X==="left"?"flex-start":"flex-end",color:"var(--orb-on-primary)",background:`linear-gradient(135deg, ${$}, rgba(15,23,42,0.92))`},children:c(ie,{direction:"row",spacing:1,alignItems:"center",children:[z.icon,e(L,{sx:{fontWeight:700,fontSize:"0.95rem"},children:z.label})]})})};return c("div",{sx:{position:"relative",overflow:"hidden",borderRadius:4,...x},children:[q(b,"left"),q(m,"right"),e(Ee,{elevation:0,onPointerDown:N,onPointerMove:O,onPointerUp:F,onPointerCancel:R,sx:{position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:ht()==="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:P?"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(qd,{})})}):null]}),a.length>0?e(ie,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((z,X)=>e(Pt,{label:z,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},X))}):null,i.length>0?e("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:i.map(z=>c(Ee,{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:z.label}),e(L,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:z.value})]},z.id))}):null,l,s]})})]})};T();var ma=({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"?ht()==="dark"?"color-mix(in oklch, var(--orb-status-error) 18%, transparent)":"color-mix(in oklch, var(--orb-status-error) 10%, transparent)":ht()==="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}),zO=({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]=Jt.useState(r),h=t??g,C=R=>{t===void 0&&x(R),f?.(R);},P=R=>{l&&h.length>=l||C(`${h}${R}`);},w=R=>{if(R==="00"){if(!h){C("0");return}P("00");return}P(R);},k=()=>{!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));},E=()=>{C("");},D=()=>{b?.(h);};return e(Ee,{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(Ud,{})}):null]}),e(Ee,{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(R=>e(ma,{label:R,onPress:()=>w(R)},R)),e(ma,{label:s?"+/-":"00",onPress:s?I:()=>w("00")}),e(ma,{label:"0",onPress:()=>w("0")}),e(ma,{label:i?".":p?String(p):"DEL",onPress:i?k: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(Hd,{}),e(L,{sx:{fontWeight:700},children:p||"DEL"})]})}),e(ma,{label:String(u||"CLR"),onPress:E,emphasis:"danger"}),e("div",{component:"button",type:"button",onClick:D,sx:R=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:R.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(Wd,{}),e(L,{sx:{fontWeight:800},children:d||y("common.ok")})]})})]})]})})};T();var om=({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})})};T();var ly=(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);}},nm=({items:t,selectedId:r,orientation:o="auto",onItemSelect:n,sx:a})=>{let i=sr(),[s,l]=Jt.useState(false);Jt.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(Ee,{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:ht()==="dark"?"color-mix(in oklch, var(--orb-surface-3) 60%, transparent)":"background.paper"},children:e("div",{component:"button",type:"button",disabled:b.disabled,onClick:()=>ly(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)})})};T();var sm=(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?sm(n.children,r):[];return (a||i.length>0)&&o.push({...n,children:i.length>0?i:n.children}),o},[]):t,uy=t=>{let r=new Set,o=n=>{n.forEach(a=>{a.children?.length&&(r.add(a.id),o(a.children));});};return o(t),r},lm=({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,P]=Jt.useState(""),[w,k]=Jt.useState(new Set),I=Jt.useMemo(()=>sm(a,C),[a,C]),S=Jt.useMemo(()=>C.trim()?uy(I):w,[w,I,C]);Jt.useEffect(()=>{t&&k(new Set);},[t]);let E=O=>O.appurl||O.href||"",D=O=>{p?.(O);let F=E(O);if(F){if(F.startsWith("http://")||F.startsWith("https://")){window.open(F,"_blank");return}x.push(F);}},R=O=>{let F=!!O.children?.length;if(t&&F){r?.();return}if(F){k(q=>{let z=new Set(q);return z.has(O.id)?z.delete(O.id):z.add(O.id),z});return}D(O);},A=O=>{let F=u||h,q=E(O);return !!(q&&F===q)},N=(O,F=0)=>{let q=!!O.children?.length,z=S.has(O.id),X=A(O);return e("div",{sx:{pl:F===0?0:1.5},children:c(Ee,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:X?"primary.main":"divider",bgcolor:X?"action.selected":"background.paper"},children:[c("div",{component:"button",type:"button",onClick:()=>R(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:X?"primary.main":"action.hover",color:X?"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]}),q?e(nn,{sx:{transform:z?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):e(ri,{color:"action"})]}),q?e(on,{in:z,children:e("div",{sx:{px:1.25,pb:1.25},children:O.children?.map($=>N($,F+1))})}):null]})},O.id)};return t?e(Ee,{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:()=>R(O),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:A(O)?"primary.main":"action.hover",color:A(O)?"var(--orb-on-primary)":"text.primary"},children:O.icon||(O.title||O.label||"?").slice(0,1).toUpperCase()},O.id))]})}):e(Ee,{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=>P(O.target.value),placeholder:f("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:e(ip,{fontSize:"small",color:"action"})}}),y==="landscape"&&!t?e(ae,{onClick:r,sx:{bgcolor:"action.hover"},children:e(tp,{})}):null]}),l,e("div",{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:I.length>0?I.map(O=>N(O)):e(L,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:f("navigation.noMatch")})}),d]})})};T();var cm=(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)},my=t=>Jt__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}),gy=(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)},fy=({summaryRow:t,visibleColumns:r,columns:o})=>{let n=o.filter(a=>r.includes(a.id)&&t[a.id]!=="");return n.length===0?null:e(Ee,{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(Ee,{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}`))})]})})},by=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:P,quickEdit:w,quickDelete:k,serviceUrl:I,orientation:S="auto",cardTitleField:E,cardSubtitleFields:D,toolbarSlot:R,emptyState:A,rowHeight:N="comfortable",cardActionSlot:O,renderCardFooter:F,onRowClick:q}=t,z=n||r("table.title.default"),X=Dr("(orientation: portrait)"),$=Dr(o.breakpoints.down("md")),_=S==="auto"?X||$?"portrait":"landscape":S,{columns:V,filterText:B,setFilterText:Z,visibleColumns:Q,showSummary:ge,setShowSummary:se,summaryColumns:le,grouping:be,setGrouping:_e,expandedGroups:De,groupAnchorEl:Pe,setGroupAnchorEl:Ve,summaryAnchorEl:Te,setSummaryAnchorEl:xe,anchorEl:We,setAnchorEl:ot,contextMenu:it,sortedAndFilteredRows:Ze,summaryRow:U,visibleRows:Fe,page:ye,setPage:Le,rowsPerPage:st,setRowsPerPage:Je,totalDisplayCount:vt,setSelected:St,handleClick:Et,toggleSummaryColumn:Lt,handleExport:re,handleCloseContextMenu:nt,toggleColumnVisibility:Be,toggleGroupExpand:ce,handleExpandGroupRecursively:fe,handleCollapseGroupRecursively:ee,handleLayoutLoad:Ie,handleVariantLoad:Re,handleLayoutSave:je,effectiveAppId:mt,currentLayoutData:pt,currentLayoutId:Ot,layoutIdToLoad:Kt,graphReportOpen:yt,handleOpenGraphReport:bt,handleCloseGraphReport:xr}=bn(t),Tt=C?.enabled??false,Ft=Tt&&(C?.interaction?.enabled??true),ut=Ii(),Bt=x||"id",we=Jt__namespace.default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:rt(o.palette.divider,ht()==="dark"?.55:.3),bgcolor:ht()==="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]),W=Jt__namespace.default.useMemo(()=>({...we,borderColor:rt(o.palette.primary.main,ht()==="dark"?.42:.24),bgcolor:ht()==="dark"?rt(o.palette.primary.main,.16):rt(o.palette.primary.main,.08)}),[we,o]),Y=Jt__namespace.default.useMemo(()=>{let J=new Set(s);return Ze.filter(Oe=>J.has(Oe?.[Bt]))},[Bt,s,Ze]),te=Y.length===1?Y[0]:null,Ne=!!P?.enabled,he=!!w?.enabled,Ae=!!k?.enabled,Ke=P?.fields,et=P?.excludeFields||[],qe=P?.initialValues||{},Ct=w?.fields,Nt=w?.excludeFields||[],wt=w?.editableFields||[],xt=w?.nonEditableFields||[],H=w?.primaryKeys?.length?w.primaryKeys:[Bt],[j,me]=Jt__namespace.default.useState(false),[Se,tt]=Jt__namespace.default.useState(false),[Xe,It]=Jt__namespace.default.useState({}),[ft,gt]=Jt__namespace.default.useState(false),[kt,nr]=Jt__namespace.default.useState(false),[Ht,Yt]=Jt__namespace.default.useState({}),[Vt,qt]=Jt__namespace.default.useState(false),[$t,rr]=Jt__namespace.default.useState(false),ar=m||Se||kt||$t,gr=Jt__namespace.default.useMemo(()=>{let J=[...V];if(Array.isArray(Ke)&&Ke.length>0){let Oe=new Set(Ke);J=J.filter(Qe=>Oe.has(Qe.id));}if(et.length>0){let Oe=new Set(et);J=J.filter(Qe=>!Oe.has(Qe.id));}return J.filter(Oe=>!!Oe?.id)},[V,et,Ke]),Ir=Jt__namespace.default.useMemo(()=>{let J=[...V];if(Array.isArray(Ct)&&Ct.length>0){let Oe=new Set(Ct);J=J.filter(Qe=>Oe.has(Qe.id));}if(Nt.length>0){let Oe=new Set(Nt);J=J.filter(Qe=>!Oe.has(Qe.id));}return J.filter(Oe=>!!Oe?.id)},[V,Nt,Ct]),Rr=Jt__namespace.default.useMemo(()=>new Set(H),[H]),oo=Jt__namespace.default.useMemo(()=>new Set(wt),[wt]),vr=Jt__namespace.default.useMemo(()=>new Set(xt),[xt]),Or=Jt__namespace.default.useCallback(J=>oo.size>0?oo.has(J):!(vr.has(J)||Rr.has(J)),[oo,vr,Rr]);Jt__namespace.default.useEffect(()=>{!yt&&ut.hasActiveFilters&&ut.clearAll();},[ut,yt]);let qo=()=>{let J={};gr.forEach(Oe=>{J[Oe.id]=qe[Oe.id]??"";}),It(J),me(true);},Xo=(J,Oe)=>{It(Qe=>({...Qe,[J]:Oe}));},Lo=async()=>{if(!P?.onSubmit){me(false);return}try{tt(!0),await P.onSubmit(Xe),me(!1);}finally{tt(false);}},Yo=()=>{if(!te)return;let J={};Ir.forEach(Qe=>{J[Qe.id]=te[Qe.id]??"";});let Oe=w?.getInitialValues?{...J,...w.getInitialValues(te)}:J;Yt(Oe),gt(true);},Zo=(J,Oe)=>{Yt(Qe=>({...Qe,[J]:Oe}));},Mr=async()=>{if(te){if(!w?.onSubmit){gt(false);return}try{nr(!0),await w.onSubmit(Ht,te),gt(!1);}finally{nr(false);}}},Oo=()=>{Y.length!==0&&qt(true);},jo=async()=>{if(Y.length===0){qt(false);return}if(!k?.onConfirm){qt(false),St([]),l?.([]);return}try{rr(!0),await k.onConfirm(Y),qt(!1),St([]),l?.([]);}finally{rr(false);}},Kr=Ze,{fieldMapping:no}=un({rows:Kr,config:{...C,title:C?.title||`${z} ${r("graph.reportTitle")}`}}),En=Jt__namespace.default.useMemo(()=>Ft?ut.applyRows(Kr,no):Kr,[no,ut,Ft,Kr]),{model:Fo}=un({rows:En,config:{...C,title:C?.title||`${z} ${r("graph.reportTitle")}`,fieldMapping:no}}),M=Fo.table.columns.map(J=>({id:J.id,label:J.label,align:J.align||"left",minWidth:120,numeric:J.align==="right"})),G=mt?e(fn,{appId:mt,tableKey:h,currentLayoutData:pt,onLayoutLoad:Ie,targetLayoutId:Kt,activeLayoutId:Ot,serviceUrl:I??g?.serviceUrl}):null,K=V.filter(J=>Q.includes(J.id)),de=K.find(J=>J.id===E)||K[0],He=D?.map(J=>K.find(Oe=>Oe.id===J)).filter(Boolean)||K.filter(J=>J.id!==de?.id).slice(0,_==="portrait"?2:3),at=K.filter(J=>J.id!==de?.id&&!He.some(Oe=>Oe.id===J.id)),$e=[R,u].filter(Boolean),oe=c(jsxRuntime.Fragment,{children:[e(dn,{groupAnchorEl:Pe,setGroupAnchorEl:Ve,grouping:be,setGrouping:_e,columns:V}),e(pn,{anchorEl:We,setAnchorEl:ot,columns:V,visibleColumns:Q,toggleColumnVisibility:Be}),e(yi,{anchorEl:Te,setAnchorEl:xe,showSummary:ge,setShowSummary:se,columns:V,summaryColumns:le,toggleSummaryColumn:Lt}),e(Ci,{contextMenu:it,handleCloseContextMenu:nt,columns:V,visibleColumns:Q,toggleColumnVisibility:Be})]}),ue=(J,Oe,Qe)=>{let Me=s.includes(Oe),Ye=_==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",Rt=Qe%2===0?rt(o.palette.primary.main,ht()==="dark"?.09:.04):rt(o.palette.primary.main,ht()==="dark"?.05:.022),Qo=rt(o.palette.divider,.22);return e(Ee,{elevation:0,onClick:()=>{Et({},J),q?.(J);},sx:{p:N==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Me?rt(o.palette.primary.main,.38):Qo,background:Me?`linear-gradient(135deg, ${rt(o.palette.primary.main,.13)}, ${rt(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${Rt}, ${rt(o.palette.primary.main,.015)})`,boxShadow:Me?`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:Me?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(Dt,{checked:Me,onClick:Sr=>Sr.stopPropagation(),onChange:()=>Et({},J),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:cm(de,J)}):null,He.length>0?e(ie,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:He.map(Sr=>e(Pt,{label:`${Sr.label}: ${gy(Sr,J)}`,size:"small",variant:"outlined",sx:we},`${Oe}-${Sr.id}`))}):null]}),O?e("div",{onClick:Sr=>Sr.stopPropagation(),children:O(J)}):null]}),at.length>0?e("div",{sx:{display:"grid",gridTemplateColumns:Ye,gap:1},children:at.map(Sr=>c(Ee,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:ht()==="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}),my(cm(Sr,J))]},`${Oe}-${Sr.id}-detail`))}):null,F?c(jsxRuntime.Fragment,{children:[e(At,{}),e("div",{onClick:Sr=>Sr.stopPropagation(),children:F(J)})]}):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(om,{...g,onVariantLoad:J=>{Re(J),g.onVariantLoad?.(J);},appId:g.appId,tableKey:h,currentLayout:[{tableKey:h,layoutData:pt}],currentLayoutId:Ot,layoutRefs:[{tableKey:h,layoutId:Ot}],variantService:g.variantService,serviceUrl:I??g.serviceUrl,touchMode:_==="portrait"?"expanded":"comfortable"})}):null,c(Ee,{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:B,setFilterText:Z,onRowsPerPageChange:Je,rowsPerPage:st,rowsPerPageOptions:v,page:ye,count:vt,onPageChange:Le,actions:d,extraTools:$e,grouping:be,setGroupAnchorEl:Ve,showSummary:ge,setShowSummary:se,setAnchorEl:ot,setSummaryAnchorEl:xe,handleExport:re,showCreateButton:Ne,onOpenCreateDialog:qo,showEditButton:he,onOpenEditDialog:Yo,editDisabled:Y.length!==1,showDeleteButton:Ae,onOpenDeleteConfirm:Oo,deleteDisabled:Y.length===0,onLayoutSave:y||g?.variantService&&g?.appId?je:void 0,loading:m,layoutManager:G,onOpenGraphReport:Tt?bt:void 0})}):null,e("div",{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:c(ie,{spacing:1.25,children:[Fe.length===0&&!m?A||e(Ee,{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,Fe.map((J,Oe)=>{if(J.type==="group"){let Ye=De.has(J.id);return e(Ee,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:c("div",{component:"button",type:"button",onClick:()=>ce(J.id),sx:{width:"100%",px:1.5,py:1.3,border:0,background:"transparent",display:"flex",alignItems:"center",gap:1,textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",color:"text.primary"},children:[Ye?e(nn,{}):e(ri,{}),c("div",{sx:{flex:1,minWidth:0},children:[c(L,{sx:{fontSize:"0.94rem",fontWeight:800},children:[J.field,": ",J.value]}),c(L,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[J.count," records"]})]}),be.length>1&&J.level<be.length-1?c(ie,{direction:"row",spacing:.5,children:[e(Pt,{size:"small",label:r("table.group.expandAll"),onClick:Rt=>{Rt.stopPropagation(),fe(J.id);},sx:W}),e(Pt,{size:"small",label:r("table.group.collapseAll"),onClick:Rt=>{Rt.stopPropagation(),ee(J.id);},sx:W})]}):null]})},J.id)}let Qe=J.data||J,Me=J.id||Qe[Bt]||Oe;return ue(Qe,Me,Oe)}),ge?e(fy,{summaryRow:U,visibleColumns:Q,columns:V}):null,m?e(L,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:r("common.loading")}):null]})})]}),Ne?c(zt,{open:j,onClose:()=>!Se&&me(false),fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:P?.title||r("quickCreate.createWithTitle",{title:z})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[gr.map(J=>{let Oe=J.type==="number"||J.numeric?"number":J.type==="date"?"date":"text";return e(ze,{label:J.label||J.id,value:Xe[J.id]??"",onChange:Qe=>Xo(J.id,Qe.target.value),type:Oe,fullWidth:true,InputLabelProps:{shrink:Oe==="date"?true:void 0}},`quick-create-${J.id}`)}),P?.description?e(jr,{severity:"info",children:P.description}):null]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(Ce,{onClick:()=>me(false),disabled:Se,children:P?.cancelLabel||r("common.cancel")}),e(Ce,{onClick:Lo,variant:"contained",disabled:Se,children:P?.submitLabel||r("common.save")})]})]}):null,he?c(zt,{open:ft,onClose:()=>!kt&>(false),fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:w?.title||r("quickEdit.editWithTitle",{title:z})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Ir.map(J=>{let Oe=J.type==="number"||J.numeric?"number":J.type==="date"?"date":"text";return e(ze,{label:J.label||J.id,value:Ht[J.id]??"",onChange:Qe=>Zo(J.id,Qe.target.value),type:Oe,disabled:!Or(J.id),fullWidth:true,InputLabelProps:{shrink:Oe==="date"?true:void 0}},`quick-edit-${J.id}`)}),w?.description?e(jr,{severity:"info",children:w.description}):null]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(Ce,{onClick:()=>gt(false),disabled:kt,children:w?.cancelLabel||r("common.cancel")}),e(Ce,{onClick:Mr,variant:"contained",disabled:kt||!te,children:w?.submitLabel||r("common.save")})]})]}):null,Ae?e(Zn,{open:Vt,type:"warning",title:k?.title||r("quickDelete.confirmTitle"),message:k?.message||(Y.length>1?r("quickDelete.confirmMessageMultiple",{count:Y.length}):r("quickDelete.confirmMessageSingle")),confirmText:k?.confirmText||r("common.delete"),cancelText:k?.cancelText||r("common.cancel"),onClose:()=>!$t&&qt(false),onConfirm:jo}):null,oe,Tt?e(Pi,{open:yt,onClose:xr,model:Fo,aiAssistant:C?.aiAssistant,interaction:Ft?{enabled:true,filters:ut.filters,fieldMapping:no,onPrimaryDimensionClick:J=>ut.setFilter("primaryDimension",J),onSecondaryDimensionClick:J=>ut.setFilter("secondaryDimension",J),onStatusClick:J=>ut.setFilter("status",J),onClearFilter:ut.clearFilter,onClearAll:ut.clearAll}:void 0,tableContent:e(by,{appId:mt||"graph-report-internal",title:r("graph.dataBody"),columns:M,rows:Fo.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};T();var EF=({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:P,locale:w="en",localeLabel:k,localeOptions:I,onLocaleChange:S,onUserSetting:E,onUserLogout:D,userMenuItems:R,leftHeaderSlot:A,rightHeaderSlot:N})=>{let O="orbcafe:page-layout-mode",[F,q]=Jt.useState("system"),[z,X]=Jt.useState("light"),[$,_]=Jt.useState(false),[V,B]=Jt.useState(false),Z=F==="system"?V?z:"light":F;Jt.useEffect(()=>{_(true);},[]),Jt.useEffect(()=>{try{let it=window.localStorage.getItem(O);(it==="light"||it==="dark"||it==="system")&&q(it);}catch{}B(true);let We=window.matchMedia("(prefers-color-scheme: dark)"),ot=()=>{X(We.matches?"dark":"light");};return ot(),We.addEventListener("change",ot),()=>We.removeEventListener("change",ot)},[]),Jt.useEffect(()=>{if(V)try{window.localStorage.setItem(O,F);}catch{}},[V,F]),Jt.useEffect(()=>{Z==="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");},[Z]);let Q=Dr("(orientation: portrait)"),ge=Dr("(max-width: 899.95px)"),se=l==="auto"?!$||Q||ge?"portrait":"landscape":l,[le,be]=Jt.useState({landscape:x??true,portrait:false}),_e=le[se],De=h??_e,Pe=We=>{h===void 0&&be(ot=>({...ot,[se]:We})),C?.(We);},Ve=c(ie,{direction:"row",spacing:1,alignItems:"center",children:[!$||i&&se==="portrait"?e(ae,{onClick:()=>Pe(!De),sx:{bgcolor:"action.hover"},children:e(li,{})}):null,A]}),Te=c(ie,{direction:"row",spacing:1,alignItems:"center",children:[p,N]}),xe=e(lm,{collapsed:se==="landscape"?!De:false,onToggle:()=>Pe(!De),menuData:o,orientation:se,colorMode:Z,maxHeight:se==="landscape"?900:void 0});return e(On,{mode:F,children:e(_a,{locale:w,children:c("div",{sx:[We=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:We.palette.mode==="dark"?"linear-gradient(180deg, var(--orb-canvas) 0%, var(--orb-surface) 55%, var(--orb-surface-2) 100%)":We.palette.background.default}),...Array.isArray(m)?m:[m]],children:[e($i,{appTitle:t,logo:d===void 0?null:d,mode:F,onToggleMode:()=>q(We=>We==="system"?"dark":We==="dark"?"light":"system"),locale:w,localeLabel:k,localeOptions:I,onLocaleChange:S,user:v,onUserSetting:E,onUserLogout:D,userMenuItems:R,onSearch:y,onSearchAdd:g,leftSlot:Ve,rightSlot:Te}),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:[$&&i&&se==="landscape"?e("div",{sx:{p:1.5,pr:0,flexShrink:0},children:xe}):null,!$||i&&se==="portrait"?e(Md,{open:De,onClose:()=>Pe(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:xe}):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(nm,{items:n,selectedId:a,orientation:se,onItemSelect:P}):null,e(Ee,{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(At,{}),e("div",{sx:{p:1.5},children:f})]}):null]})})})};T();var mm=Py__default.default(()=>Promise.resolve().then(()=>(um(),pm)).then(t=>t.COrbCanvas),{ssr:false,loading:()=>e("div",{className:"h-full w-full bg-transparent"})});function El({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(mm,{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(mm,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var WF=El;T();var fm=Jt.createContext(null);function Ay(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 Ey({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]=Jt.useState(false),[m,v]=Jt.useState(false),y=Jt.useRef(null),g=Jt.useRef(false),x=Jt.useRef(false),h=Jt.useCallback(()=>{x.current=false,b(false);},[]),{isRecording:C,startRecording:P,stopRecording:w}=xn({wsUrl:d,silenceThresholdMs:u,minVolumeRms:p,onTextUpdate:E=>{o?.(E);},onComplete:async E=>{try{E.trim()&&(v(!0),await r(E.trim()));}catch(D){let R=D instanceof Error?D.message:"Failed to process voice command";n?.(R);}finally{v(!1),h();}},onError:E=>{n?.(E),v(!1),g.current||h();}}),k=Jt.useCallback(async()=>{x.current=false,await P();},[P]),I=Jt.useCallback(()=>{w();},[w]);Jt.useEffect(()=>{if(i)return;let E=R=>{R.isComposing||(R.code==="Space"||R.key===" ")&&(g.current||R.repeat||s&&Ay(document.activeElement)||(g.current=true,R.preventDefault(),y.current=setTimeout(()=>{x.current=true,b(true),P();},a)));},D=R=>{(R.code==="Space"||R.key===" ")&&(y.current&&(clearTimeout(y.current),y.current=null),g.current=false,x.current&&(R.preventDefault(),b(false),w()));};return window.addEventListener("keydown",E),window.addEventListener("keyup",D),()=>{window.removeEventListener("keydown",E),window.removeEventListener("keyup",D),y.current&&(clearTimeout(y.current),y.current=null);}},[i,s,a,P,w]);let S=Jt.useMemo(()=>({isRecording:C,isHotkeyRecording:f,isSubmitting:m,startRecording:k,stopRecording:I}),[f,C,m,k,I]);return c(fm.Provider,{value:S,children:[l?e(El,{isRecording:f}):null,t]})}function Ly(){let t=Jt.useContext(fm);if(!t)throw new Error("useAINav must be used within CAINavProvider");return t}var qF=Ey,XF=Ly;function dt(...t){return tailwindMerge.twMerge(clsx.clsx(t))}T();var zy=({content:t,theme:r="light",size:o="base",defaultExpanded:n=false})=>{let[a,i]=Jt.useState(n),s=Jt.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(Na,{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})]})},bm=zy;T();var _y=({content:t,language:r="text",isStreaming:o=false,className:n=""})=>{let a=yr(),[i,s]=Jt.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:dt("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})})]})},hm=_y;T();var vm="orb-html-demo",Yy=160,Zy=560,jy=220,Fl=`<script>(function(){var post=function(){var height=Math.ceil(document.documentElement.scrollHeight);parent.postMessage({source:${JSON.stringify(vm)},height:height},'*')};addEventListener('load',post);addEventListener('resize',post);new MutationObserver(post).observe(document.documentElement,{subtree:true,childList:true,attributes:true,characterData:true});post()})()</script>`,Qy="html,body{margin:0;padding:12px;font:14px/1.5 system-ui,sans-serif;}",Jy=t=>/<html[\s>]/i.test(t),eC=t=>{let r=t.trim();return Jy(r)?/<\/body>/i.test(r)?r.replace(/<\/body>/i,`${Fl}</body>`):`${r}${Fl}`:`<!DOCTYPE html><html><head><meta charset="utf-8"><style>${Qy}</style></head><body>${r}${Fl}</body></html>`},tC=({content:t,title:r="Interactive HTML"})=>{let o=Jt.useRef(null),[n,a]=Jt.useState(jy),i=Jt.useMemo(()=>eC(t),[t]);return Jt.useEffect(()=>{let s=l=>{if(l.source!==o.current?.contentWindow)return;let d=l.data;!d||d.source!==vm||typeof d.height!="number"||!Number.isFinite(d.height)||a(Math.min(Zy,Math.max(Yy,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}})]})},ym=tC;T();var nC=({content:t,isLoading:r,className:o="",style:n})=>{let a=Jt.useRef(null),[i,s]=Jt.useState(false),[l,d]=Jt.useState(null),u=yr();return Jt.useEffect(()=>{let p=false,f=async()=>{if(!(!t.trim()||!a.current)){s(true),d(null);try{xm__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 xm__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:"overflow-auto rounded border border-[color-mix(in_oklch,var(--orb-status-error)_30%,transparent)] bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)] p-4 text-sm text-[var(--orb-status-error)]",children:[e("p",{className:"mb-2 font-semibold",children:"Mermaid Error:"}),e("pre",{children:l}),e("pre",{className:"mt-4 text-xs text-[var(--orb-muted)]",children:t})]}),e("div",{ref:a,className:`overflow-x-auto ${r||i||l?"hidden":""}`})]})},Sm=nC;T();var aC=({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]=Jt.useState(false),[b,m]=Jt.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(Pa,{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(Gc,{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(Zt,{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=aC;T();var iC=({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(Da,{className:"w-5 h-5"});case "error":return e(za,{className:"w-5 h-5"});case "success":return e(Ta,{className:"w-5 h-5"});default:return e(Pc,{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(Zt,{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=iC;T();var sC=({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]=Jt.useState(false),[b,m]=Jt.useState(""),[v,y]=Jt.useState(false),g=Jt.useMemo(()=>b.trim()?o.filter(C=>C.toLowerCase().includes(b.toLowerCase())):o,[o,b]),x=Jt.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(Na,{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(Zt,{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,P)=>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"})]})},P))}),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=sC;T();var lC=({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]=Jt.useState(false),[g,x]=Jt.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(Bc,{className:"w-5 h-5 animate-spin"});case "error":return e(za,{className:"w-5 h-5"});default:return e(Ta,{className:"w-5 h-5"})}},P=I=>I?I<1e3?`${I}ms`:`${(I/1e3).toFixed(2)}s`:"",w=h(),k=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:k}),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(zn,{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(Mc,{className:"w-3 h-3 mr-1"}),P(s)]}),d&&u&&e("button",{onClick:u,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors p-1 rounded",children:e(Zt,{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(zn,{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=lC;T();var dC=({data:t})=>{if(!t)return null;let r=Jt.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=dC;T();var pC=({title:t,subtitle:r,data:o,type:n,config:a={}})=>{let i=()=>{switch(n){case "bar-chart-card":return e(Fs,{className:"w-4 h-4 text-[var(--orb-chart-1)]"});case "line-chart-card":return e(Fc,{className:"w-4 h-4 text-[var(--orb-chart-positive)]"});case "pie-chart-card":return e($c,{className:"w-4 h-4 text-[var(--orb-chart-2)]"});case "combo-chart-card":return e(kc,{className:"w-4 h-4 text-[var(--orb-chart-5)]"});case "heatmap-chart-card":return e(Lc,{className:"w-4 h-4 text-[var(--orb-chart-negative)]"});case "fishbone-chart-card":return e(Ec,{className:"w-4 h-4 text-[var(--orb-chart-4)]"});case "waterfall-chart-card":return e(Yc,{className:"w-4 h-4 text-[var(--orb-chart-6)]"});case "google-map-card":return e(Hn,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});case "amap-card":return e(zc,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});default:return e(Fs,{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(ta,{data:o,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return e(Np,{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(Ap,{data:o,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return e(Ep,{data:o});case "fishbone-chart-card":return e(Lp,{branches:o,effect:a.effect||t||"Problem"});case "waterfall-chart-card":return e(Op,{data:o,height:a.height});case "google-map-card":return e(Fp,{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(Bp,{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=pC;T();var ms=["bar","column","line","pie","donut","scatter","bubble","list","metric","progress"],uC={bar:"Bars",column:"Columns",line:"Line",pie:"Pie",donut:"Donut",scatter:"Scatter",bubble:"Bubble",list:"List",metric:"Metric",progress:"Progress"},ps=480,In=214,Ut={top:18,right:16,bottom:38,left:30},er=t=>typeof t=="number"&&Number.isFinite(t)?t:0,Rm=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Ur=(t,r)=>`${t.id||t.label}-${r}`,Mm=(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)),mo=(t,r,o)=>t.color??o[r%o.length],go=(t,r)=>r?{onMouseEnter:()=>r.onItemHoverStart?.(t),onMouseMove:()=>r.onItemHoverStart?.(t),onMouseLeave:()=>r.onItemHoverEnd?.(t),onContextMenu:o=>r.onItemContextMenu?.(o,t)}:{},Dm=t=>{let r=t.map(a=>er(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}},mC=(t,r,o)=>{let n=ps-Ut.left-Ut.right,a=In-Ut.top-Ut.bottom,{max:i,range:s}=Dm(o),l=Ut.left+t*n/Math.max(o.length-1,1),d=Ut.top+(i-er(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)}},gC=(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`},fC=({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})]}),bC=()=>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"})]}),zl=({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());}}:{},...go(t,o),style:{cursor:r||o?"pointer":"default"}}},hC=({loading:t,error:r,hasData:o,emptyState:n,children:a})=>t?e(bC,{}):r?e("div",{className:"orb-metric-error",role:"alert",children:r}):o?e(jsxRuntime.Fragment,{children:a}):e(fC,{children:n??"No data for the current selection."}),vC=({data:t,activeId:r,onItemClick:o,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(...t.map(l=>Math.abs(er(l.value))),1);return e("div",{className:"orb-metric-bars",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let u=er(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:mo(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,...go(l,n),children:b},Ur(l,d)):e("div",{className:`orb-metric-bar-row${f?" is-active":""}`,role:"listitem",...go(l,n),children:b},Ur(l,d))})})},yC=({data:t,activeId:r,onItemClick:o,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(t.reduce((l,d)=>l+Math.max(er(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(er(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:mo(l,d,i)}})})]});return o?e("button",{type:"button",className:`orb-metric-progress-row${f?" is-active":""}`,onClick:()=>o(l),"aria-pressed":f,...go(l,n),children:b},Ur(l,d)):e("div",{className:`orb-metric-progress-row${f?" is-active":""}`,role:"listitem",...go(l,n),children:b},Ur(l,d))})})},CC=({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}=Dm(r),b=ps-Ut.left-Ut.right,m=In-Ut.top-Ut.bottom,v=Ut.top+p/f*m,y=Math.max(1,Math.ceil(r.length/6)),g=r.map((C,P)=>mC(P,C,r)),x=g.map(C=>`${C.x},${C.y}`).join(" "),h=Math.max(...r.map(C=>Math.max(er(C.secondaryValue),0)),1);return e("div",{className:"orb-metric-svg-wrap",children:c("svg",{className:"orb-metric-svg",viewBox:`0 0 ${ps} ${In}`,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:In-Ut.bottom}),t==="column"&&r.map((C,P)=>{let w=g[P],k=er(C.value),I=Math.max(Math.abs(w.y-v),k===0?2:0),S=w.x-Math.min(18,b/Math.max(r.length*2,1)),E=Math.min(36,Math.max(10,b/Math.max(r.length*1.8,1))),D=o===C.id;return c("g",{...zl({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(k)}`,children:[e("rect",{className:`orb-metric-column${D?" is-active":""}`,x:S,y:Math.min(w.y,v),width:E,height:I,rx:4,fill:mo(C,P,l)}),c("title",{children:[C.label,": ",i(k)]}),(P%y===0||r.length<=6)&&e("text",{className:"orb-metric-svg-label",x:w.x,y:In-14,textAnchor:"middle",children:Mm(C.label)})]},Ur(C,P))}),(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,P)=>{let w=g[P],k=o===C.id,I=t==="bubble"?7+Math.max(er(C.secondaryValue),0)/h*12:t==="scatter"?5:4;return c("g",{...zl({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(er(C.value))}`,children:[t==="line"&&e("circle",{className:`orb-metric-point${k?" is-active":""}`,cx:w.x,cy:w.y,r:k?6:4,fill:mo(C,P,l)}),t!=="line"&&e("circle",{className:`orb-metric-point${k?" is-active":""}`,cx:w.x,cy:w.y,r:I,fill:mo(C,P,l),opacity:t==="bubble"?.82:.9}),c("title",{children:[C.label,": ",i(er(C.value)),t==="bubble"&&C.secondaryValue!==void 0?` \xB7 Size: ${s(er(C.secondaryValue))}`:""]}),(P%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:Mm(C.label)})]},Ur(C,P))})]}),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:In-Ut.bottom+14,children:i(u)})]})})},xC=({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(er(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:gC(f,f,p,t==="donut"?46:0,g,g+y),C=zl({item:m,onItemClick:n,interactions:a});return h?e("path",{className:`orb-metric-slice${x?" is-active":""}`,d:h,fill:mo(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":mo(m,v,s),stroke:t==="donut"?mo(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,...go(m,a),children:[e("span",{className:"orb-metric-legend-dot",style:{backgroundColor:mo(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))})})]})},SC=({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(er(s.value))}),s.secondaryValue!==void 0&&e("span",{className:"orb-metric-list-secondary",children:i(er(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,...go(s,n),children:d},Ur(s,l)):e("div",{className:`orb-metric-list-row${r===s.id?" is-active":""}`,role:"listitem",...go(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=Rm,secondaryValueFormatter:u=Rm,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:P,footer:w,ariaLabel:k,className:I,style:S,sx:E})=>{let D=Os(),R=Jt.useRef(null),A=Jt.useRef(null),[N,O]=Jt.useState(n),[F,q]=Jt.useState(false),[z,X]=Jt.useState(null),[$,_]=Jt.useState(null);Jt.useEffect(()=>O(n),[n]);let V=Jt.useCallback(()=>{A.current!==null&&(window.clearTimeout(A.current),A.current=null);},[]);Jt.useEffect(()=>V,[V]),Jt.useEffect(()=>{if(!$)return;let U=Fe=>{let ye=Fe.target;ye instanceof HTMLElement&&ye.closest(".orb-metric-context-menu")||_(null);};return document.addEventListener("pointerdown",U),()=>document.removeEventListener("pointerdown",U)},[$]);let B=N,Z=Jt.useMemo(()=>[D.chart1,D.chart2,D.chart3,D.chart4,D.chart5,D.chart6],[D]),Q=Jt.useMemo(()=>F?o:o.slice(0,Math.max(1,y)),[o,y,F]),ge=Math.max(0,o.length-Q.length),se=Q.some(U=>er(U.value)>0),le=Q.length>0&&(B!=="pie"&&B!=="donut"?true:se),be=(C??[B,"bar","column","line","pie","donut","scatter","bubble","list"]).filter((U,Fe,ye)=>ms.includes(U)&&ye.indexOf(U)===Fe),_e={...uC,...P},De=Q[0],Pe=k??`${t} ${_e[B]} chart`,Ve=U=>{O(U),a?.(U);},Te=Jt.useCallback((U,Fe)=>{X({item:U,source:Fe}),_(null),s?.(U,Fe);},[s]),xe=Jt.useCallback(U=>{V(),!(!x||$)&&(A.current=window.setTimeout(()=>{Te(U,"hover"),A.current=null;},Math.max(0,h)));},[V,$,h,Te,x]),We=Jt.useCallback(()=>{V();},[V]),ot=Jt.useCallback((U,Fe)=>{if(!x)return;U.preventDefault(),V();let ye=R.current?.getBoundingClientRect(),Le=ye?us(U.clientX-ye.left,8,Math.max(8,ye.width-164)):8,st=ye?us(U.clientY-ye.top,8,Math.max(8,ye.height-72)):8;_({item:Fe,left:Le,top:st});},[V,x]),it=x?{onItemHoverStart:xe,onItemHoverEnd:We,onItemContextMenu:ot}:void 0,Ze=B==="metric"?c("div",{className:"orb-metric-kpi",role:i?"button":"img",tabIndex:i?0:void 0,onClick:()=>De&&i?.(De),onKeyDown:U=>{De&&i&&(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),i(De));},"aria-label":Pe,...De?go(De,it):{},children:[e("span",{className:"orb-metric-kpi-label",children:De?.label??p??"Value"}),e("strong",{children:De?d(er(De.value)):"\u2014"}),De?.secondaryValue!==void 0&&c("span",{className:"orb-metric-kpi-secondary",children:[f??"Compared with"," \xB7 ",u(er(De.secondaryValue))]})]}):B==="progress"?e(yC,{data:Q,activeId:l,onItemClick:i,interactions:it,valueFormatter:d,colors:Z}):B==="bar"?e(vC,{data:Q,activeId:l,onItemClick:i,interactions:it,valueFormatter:d,colors:Z}):B==="list"?e(SC,{data:Q,activeId:l,onItemClick:i,interactions:it,valueFormatter:d,secondaryValueFormatter:u}):B==="pie"||B==="donut"?e(xC,{type:B,data:Q,activeId:l,onItemClick:i,interactions:it,valueFormatter:d,colors:Z,ariaLabel:Pe}):e(CC,{type:B,data:Q,activeId:l,onItemClick:i,interactions:it,valueFormatter:d,secondaryValueFormatter:u,colors:Z,ariaLabel:Pe});return c("div",{ref:R,className:"orb-metric-chart-shell",onMouseLeave:()=>{V(),z?.source==="hover"&&X(null);},children:[c(Ee,{elevation:1,variant:"outlined",className:`orb-metric-chart-card ${I??""}`,style:S,sx:E,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&&be.length>1&&e(Wt,{"aria-label":`${t} chart type`,className:"orb-metric-chart-select",value:B,options:be.map(U=>({value:U,label:_e[U]})),onChange:U=>Ve(U.target.value),minWidth:108,fullWidth:false,size:"small"})]}),c("div",{className:"orb-metric-chart-body",children:[e(hC,{loading:m,error:v,hasData:le,emptyState:b,children:Ze}),ge>0&&!m&&!v&&e("button",{type:"button",className:"orb-metric-more",onClick:()=>q(U=>!U),children:F?"Show fewer":`Show all ${o.length}`})]}),w&&e("div",{className:"orb-metric-chart-footer",children:w})]}),$&&c("div",{className:"orb-metric-context-menu",role:"menu",onMouseEnter:V,onKeyDown:U=>{U.key==="Escape"&&_(null);},style:{left:$.left,top:$.top},onPointerDown:U=>U.stopPropagation(),children:[e("div",{className:"orb-metric-context-label",children:$.item.label}),e("button",{type:"button",role:"menuitem",onClick:U=>{U.preventDefault(),U.stopPropagation(),Te($.item,"contextmenu");},children:"Show data"})]}),z&&c("div",{className:"orb-metric-data-details",role:"dialog","aria-label":`${z.item.label} data details`,onPointerDown:U=>U.stopPropagation(),children:[c("div",{className:"orb-metric-data-details-header",children:[e("strong",{children:z.item.label}),e("button",{type:"button","aria-label":"Close data details",onClick:()=>X(null),children:"\xD7"})]}),c("div",{className:"orb-metric-data-details-row",children:[e("span",{children:p??"Value"}),e("strong",{children:d(er(z.item.value))})]}),z.item.secondaryValue!==void 0&&c("div",{className:"orb-metric-data-details-row",children:[e("span",{children:f??"Secondary value"}),e("strong",{children:u(er(z.item.secondaryValue))})]}),e("span",{className:"orb-metric-data-details-hint",children:z.source==="hover"?`Shown after ${Math.max(0,h)/1e3} seconds of stillness`:"Shown from the context menu"})]})]})};gs.displayName="CMetricChartCard";T();var wC=({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=wC;T();var kC=({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=kC;var PC=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:PC(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};T();var AC=({content:t,theme:r,size:o="base",className:n,enableCodeHighlight:a=true,enableMermaid:i=true,messageId:s,cardHooks:l})=>{let d=Jt.useRef(l);d.current=l;let u=!!l?.onCardEvent,p=Jt.useMemo(()=>u?{onCardEvent:y=>d.current?.onCardEvent?.(y)}:void 0,[u]),f=Jt.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,P)=>{if(!(!C&&!p?.onCardEvent))return (...w)=>{let k=C?.(...w),I=P?P(...w):void 0;return b(y,g,x,I,h),k}},v=Jt.useMemo(()=>({div(y){let{"data-component":g,"data-think-content":x,...h}=y;return g==="thinkbox"&&x?e(bm,{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]:"",P=String(g);if(!h&&!P.includes(`
|
|
199
|
-
`))return e("code",{children:g});let k=P.replace(/\n$/,"");if(i&&C==="mermaid")return e(Sm,{content:k});if(C==="html"||C==="htm")return e(ym,{content:k});if(C==="json"){let I=hs(k);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,E=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:E})}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,E=>({suggestion:E}))})}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(hm,{content:k,language:C,className:"not-prose"}):e("code",{className:y,...x,children:g})}}),[r,o,i,a,p,s]);return e("div",{className:dt("markdown-body max-w-none",n),children:e(IC__default.default,{remarkPlugins:[RC__default.default,MC__default.default],rehypePlugins:[DC__default.default,NC__default.default],components:v,children:f})})},Rn=AC;T();var EC=({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})})},Nm=EC;T();var Wl=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"}}},OC=({content:t,className:r="",messageId:o,cardHooks:n})=>{let a=Jt__namespace.default.useMemo(()=>Wl.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(Nm,{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=OC;T();var FC=({content:t,isStreaming:r=true,onComplete:o,className:n="",streamIntervalMs:a=24,streamChunkSize:i=3,messageId:s,cardHooks:l})=>{let[d,u]=Jt.useState(r?0:t.length),[p,f]=Jt.useState(!r);Jt.useEffect(()=>{if(r){u(0),f(false);return}u(t.length),f(true);},[t,r]),Jt.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"})]})},Lm=FC;T();var Om=({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(jc,{size:14});case "like":return e(qc,{size:14});case "dislike":return e(Kc,{size:14});default:return null}};return e("div",{className:dt("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:dt("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}`))})};T();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(Lm,{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(Om,{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()})]})})};T();var Fm=({onTextUpdate:t,onComplete:r,onCancel:o,disabled:n,className:a})=>{let{isRecording:i,startRecording:s,stopRecording:l}=xn({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:dt("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(op,{size:16}):e(np,{size:16})})};T();var tr={container:"w-full max-w-4xl mx-auto",inputContainer:dt("w-full flex flex-col border border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] transition-colors duration-200","orb-agent-input","focus-within:border-[var(--orb-primary,#154194)] focus-within:ring-1 focus-within:ring-[var(--orb-focus-ring,#e4e9f5)]"),dragActive:"border-[var(--orb-primary,#154194)] bg-[var(--orb-p50,#eef2f9)]",textareaWrapper:"flex-1 relative flex items-center",textarea:dt("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:dt("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:dt("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:dt("cursor-pointer bg-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p600,#0e2d63)] text-[var(--orb-on-primary)] shadow-none active:scale-95"),sendButtonDisabled:dt("cursor-not-allowed opacity-40 bg-[var(--orb-disabled-bg,#f5f5f5)] text-[var(--orb-disabled-fg,#8c8c8c)]"),stopButton:dt("cursor-pointer bg-[var(--orb-err,#c43f02)] hover:opacity-90 text-[var(--orb-on-primary)] shadow-none active:scale-95")},HC={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},zC=({enabled:t,onClick:r})=>e("button",{className:dt(tr.buttonBase,tr.buttonSmall,tr.buttonNormal),onClick:r,disabled:!t,"aria-label":"Upload file",type:"button",children:e(Od,{size:16})}),VC=()=>c("button",{className:dt(tr.buttonBase,"h-[38px] gap-1 rounded-full px-2.5 md:h-8 md:px-2",tr.buttonNormal),"aria-label":"Tools",type:"button",children:[e(Zd,{size:15}),e("span",{className:"text-xs font-medium",children:"Tools"})]}),WC=({canSend:t,isResponding:r,onSend:o,onStop:n})=>r?e("button",{className:dt(tr.buttonBase,tr.buttonSmall,tr.stopButton),onClick:n,"aria-label":"Stop generating",type:"button",children:e(mp,{size:15})}):e("button",{className:dt(tr.buttonBase,tr.buttonSmall,t?tr.sendButton:tr.sendButtonDisabled),onClick:o,disabled:!t,"aria-label":"Send message",type:"button",children:e(lp,{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]=Jt.useState(""),[l,d]=Jt.useState([]),[u,p]=Jt.useState(false),[f,b]=Jt.useState(false),m=Jt.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=Jt.useCallback(F=>{s(F.target.value),F.target.style.height="auto",F.target.style.height=`${Math.min(F.target.scrollHeight,200)}px`;},[]),h=Jt.useCallback(F=>{if(F.target.files&&F.target.files.length>0){let q=Array.from(F.target.files);d(z=>{let X=q.filter(_=>z.some(V=>V.name===_.name&&V.size===_.size));X.length>0&&console.warn("Duplicate files ignored:",X.map(_=>_.name));let $=q.filter(_=>!z.some(V=>V.name===_.name&&V.size===_.size));return [...z,...$]}),m.current&&(m.current.value="");}},[]),C=Jt.useCallback(F=>{d(q=>q.filter((z,X)=>X!==F));},[]),P=Jt.useCallback(()=>{m.current?.click();},[]),w=Jt.useCallback(async()=>{if(!y)return;let F=i,q=[...l];s(""),d([]),m.current&&(m.current.value="");try{await t(F,q);}catch(z){console.error("Failed to send message:",z),s(F),d(q);}},[i,y,t,l]),k=Jt.useCallback(F=>{F.key==="Enter"&&!F.shiftKey&&!u&&(F.preventDefault(),w());},[w,u]),I=Jt.useCallback(()=>{p(true);},[]),S=Jt.useCallback(()=>{p(false);},[]),E=Jt.useCallback(F=>{s(F);},[]),D=Jt.useCallback(F=>{s(F);},[]),R=Jt.useCallback(()=>{},[]),A=Jt.useCallback(F=>{F.preventDefault(),b(true);},[]),N=Jt.useCallback(F=>{F.preventDefault(),b(false);},[]),O=Jt.useCallback(F=>{if(F.preventDefault(),b(false),F.dataTransfer.files&&F.dataTransfer.files.length>0){let q=Array.from(F.dataTransfer.files);d(z=>[...z,...q]);}},[]);return e("div",{className:tr.container,children:c("div",{className:"relative",children:[e("input",{type:"file",multiple:true,className:"hidden",ref:m,onChange:h}),c("div",{className:dt(tr.inputContainer,f&&tr.dragActive),onDragOver:A,onDragLeave:N,onDrop:O,children:[l.length>0&&e("div",{className:tr.filePreviewArea,children:l.map((F,q)=>c("div",{className:tr.fileTag,children:[e(Qd,{sx:{fontSize:16},className:"text-[var(--orb-primary)]"}),e("span",{className:"truncate max-w-[150px]",children:F.name}),e("button",{onClick:()=>C(q),className:"ml-1 hover:text-[var(--orb-status-error)] focus:outline-none",type:"button",children:e(Gd,{sx:{fontSize:16}})})]},`${F.name}-${q}`))}),c("div",{className:"flex w-full flex-col p-2",children:[e("div",{className:dt(tr.textareaWrapper,"min-h-[52px] px-2 pb-2 pt-1.5 md:min-h-[44px]"),children:e("textarea",{className:dt(tr.textarea,"min-h-[24px] py-0 px-0"),placeholder:v,value:i,onChange:x,onKeyDown:k,onCompositionStart:I,onCompositionEnd:S,style:HC,"aria-label":"Message input",spellCheck:false,rows:1})}),c("div",{className:"flex items-center justify-between px-1 pb-0.5",children:[c("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:[e(zC,{enabled:g.enabled,onClick:P}),e(VC,{})]}),c("div",{className:"flex items-center gap-1",children:[e(Fm,{onTextUpdate:E,onComplete:D,onCancel:R,disabled:o,className:tr.buttonSmall}),e(WC,{canSend:y,isResponding:o,onSend:w,onStop:r})]})]})]})]})]})})};T();var Hm=({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=Jt.useRef(null),v=Jt.useRef(t.length);return Jt.useEffect(()=>{t.length>v.current&&m.current?.scrollIntoView({behavior:"smooth"}),v.current=t.length;},[t]),c("div",{className:dt("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})})]})};T();var zm={idle:"Idle",running:"Working",success:"Success",error:"Error",pending:"Pending"},Vm=({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=[zm[u],r].filter(Boolean).join(" \xB7 ");return c("div",{className:dt("orb-agent-panel",n),children:[c("div",{className:dt("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(Hm,{...d,showInput:l,statusLine:p?c("div",{className:dt("orb-agent-status-line","mb-1"),children:[e("span",{className:"orb-agent-spinner","aria-hidden":"true"}),e("span",{children:i??`${zm[u]}\u2026`})]}):void 0})})]})};T();var XC=2e3,YC=1/3,xs=[.25,.5,.75,1,1.5,2,3,4],ZC=100,Wm={color:"inherit",background:"transparent",textShadow:"none",fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",textAlign:"left",wordSpacing:"normal",wordBreak:"normal",overflowWrap:"normal",tabSize:"inherit",hyphens:"none"},$m=({text:t,language:r,startLine:o,endLine:n,wrap:a,labels:i})=>{let s=Jt.useRef(null),l=Jt.useMemo(()=>{let p=t.split(`
|
|
200
|
-
`);p.length>1&&p[p.length-1]===""&&p.pop();let f=Math.min(p.length,
|
|
201
|
-
`),shownCount:f,total:p.length}},[t]),d=Jt.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]);Jt.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*YC);},[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:Wm,codeTagProps:{className:`language-${r}`,style:Wm},children:l.shown}),l.total>l.shownCount&&e("div",{className:"orb-omph-pv-note",children:i.previewTruncated(l.shownCount,l.total)})]})},Gm=({text:t})=>e("div",{className:"orb-omph-pv-doc",children:e(Rn,{content:t})}),_m=({url:t,alt:r,labels:o})=>{let[n,a]=Jt.useState("fit"),[i,s]=Jt.useState(null),[l,d]=Jt.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*ZC)}%`}),e("button",{type:"button","aria-label":o.zoomIn,disabled:!p,onClick:()=>b(1),children:"+"})]})]})};var jC=/^[a-z][a-z0-9+.-]*:/i,QC=/^L(\d+)(?:-L?(\d+))?$/i;var Um=["B","KB","MB","GB"];var JC=t=>{try{return decodeURIComponent(t)}catch{return t}},_l=t=>{let r=t.trim();if(!r||r.startsWith("#")||r.startsWith("//")||jC.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=JC(i>=0?n.slice(0,i):n);if(!s||s.endsWith("/"))return null;let l=QC.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)}},Ul=t=>t.split("/").filter(Boolean).pop()??t,qm=t=>{let r=t.split("/");return r.pop(),r.join("/")},Kl=t=>{let r=Ul(t),o=r.lastIndexOf(".");return o>0?r.slice(o+1).toLowerCase():""},Xm={prism:"text",label:"Text"},Km={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:Xm},ql=(t,r)=>r?Object.values(Km).find(n=>n.prism===r)??{prism:r,label:r}:Km[Kl(t)]??Xm,Ym=t=>{let r=t,o=0;for(;r>=1024&&o<Um.length-1;)r/=1024,o+=1;return `${o>0&&r<10?r.toFixed(1):Math.round(r).toString()} ${Um[o]}`};T();var ex=1e3,tx=9,fo=16,Xl=({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]}),Qm=({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]=Jt.useState(true),[m,v]=Jt.useState(false),{open:y,ref:g,phase:x,data:h}=t,C=h?.body;Jt.useEffect(()=>{if(!m)return;let O=window.setTimeout(()=>v(false),ex);return ()=>window.clearTimeout(O)},[m]),Jt.useEffect(()=>{y&&s.current?.focus({preventScroll:true});},[y,s,g?.path]);let P=h?.absolutePath??g?.path??"",w=C&&(C.kind==="markdown"||C.kind==="code")?C.text:P,k=w===P?a.previewCopyPath:a.previewCopyContent,I=C?.kind==="code"&&g?ql(g.path,C.language):null,S=[];I&&S.push(I.label),C?.kind==="markdown"&&S.push("Markdown"),C?.kind==="image"&&g&&S.push(Kl(g.path).toUpperCase()),h?.size!==void 0&&S.push(Ym(h.size)),C?.kind==="code"&&g?.startLine!==void 0&&S.push(a.previewLines(g.startLine,g.endLine??g.startLine));let E=O=>{O.key==="Escape"&&(O.stopPropagation(),l(true));},D=e("button",{type:"button",className:"orb-omph-pv-action",onClick:d,children:a.previewRetry}),R=()=>{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:tx},(O,F)=>e("span",{},F))});if(x==="error"||!C)return e(Xl,{tone:"error",icon:e(Pa,{size:fo}),title:a.previewFailed,text:P,action:D});switch(C.kind){case "missing":return e(Xl,{tone:"neutral",icon:e(Ma,{size:fo}),title:a.previewMissing,text:C.message??P});case "unsupported":return e(Xl,{tone:"neutral",icon:e(Ma,{size:fo}),title:a.previewUnsupported,text:C.message??P,action:p&&e("button",{type:"button",className:"orb-omph-pv-action",onClick:()=>p(g),children:a.previewOpenExternal})});case "markdown":return e(Gm,{text:C.text},g.path);case "code":return e($m,{text:C.text,language:ql(g.path,C.language).prism,startLine:g.startLine,endLine:g.endLine,wrap:f,labels:a},g.path);case "image":return e(_m,{url:C.url,alt:C.alt,labels:a},C.url);default:return null}},A=r==="overlay",N=C?.kind==="image"?Oc:Ma;return c("aside",{ref:s,className:"orb-omph-preview","data-open":y||void 0,"data-placement":r,role:A?"dialog":"complementary","aria-label":a.previewTitle,"aria-hidden":!y||void 0,tabIndex:-1,onKeyDown:E,children:[!A&&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:[A&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewBack,onClick:()=>l(true),children:e(Ia,{size:fo})}),e("span",{className:"orb-omph-pv-glyph","aria-hidden":"true",children:e(N,{size:fo})}),c("div",{className:"orb-omph-pv-titles",children:[e("div",{className:"orb-omph-pv-name",title:P,children:g?Ul(g.path):""}),e("div",{className:"orb-omph-pv-path",title:P,children:e("bdi",{children:qm(P)})})]}),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(O=>!O),children:a.previewWrap}),g&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":m?a.copied:k,title:m?a.copied:k,onClick:()=>{navigator.clipboard.writeText(w).then(()=>v(true));},children:m?e(qr,{size:fo}):e(vo,{size:fo})}),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(Nc,{size:fo})}),!A&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewClose,onClick:()=>l(true),children:e(Zt,{size:fo})})]})]}),e("div",{className:"orb-omph-pv-meta",children:S.join(" \xB7 ")}),e("div",{className:"orb-omph-pv-body","data-kind":x==="ready"?C?.kind:void 0,children:R()})]})]})};T();var ox=1e3,Jm=50,nx=1e3,ax=t=>t==="tool"?en:t==="command"?zn:Vc,tg=t=>!!t.streaming||t.status==="running"||t.status==="pending",ix=(t,r)=>r==="expanded"?true:tg(t),sx=t=>t!==void 0&&(t.inputTokens!==void 0||t.outputTokens!==void 0||t.durationMs!==void 0),lx=(t,r)=>`${Math.max(1,Math.round(t/nx))}${r.secondUnit}`,cx=({content:t})=>{let r=Jt.useRef(null),[o,n]=Jt.useState(false);return Jt.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})},dx=({turn:t,labels:r})=>{let[o,n]=Jt.useState(false),[a,i]=Jt.useState(false),s=t.assistant?.content??"",l=t.usage;return Jt.useEffect(()=>{if(!o)return;let d=window.setTimeout(()=>n(false),ox);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()}),sx(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," ",lx(l.durationMs,r)]})]})]})},px=({item:t,display:r,open:o,onToggle:n})=>{let a=ax(t.kind),i=tg(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(cx,{content:t.content}),o&&t.streaming&&e("span",{className:"orb-omph-caret","aria-hidden":"true"})]})},Yl=t=>{let r=t.user?.content||t.assistant?.content||t.id,o=r.split(`
|
|
202
|
-
`).find(n=>n.trim())??r;return o.length>Jm?`${o.slice(0,Jm)}\u2026`:o},ux=0,rg=({turns:t,labels:r,processDisplay:o,cardHooks:n,resolveFileLink:a,onOpenFile:i})=>{let[s,l]=Jt.useState({}),d=u=>{if(!i||u.defaultPrevented||u.button!==ux||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]:ix(v,o);return e(px,{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(dx,{turn:u,labels:r})]},u.id)})})};var mx={idle:"Idle",pending:"Pending",running:"Working",success:"Success",error:"Error",working:"Working",workingFor:t=>`Working for ${t}`,loadOlder:"Load earlier",loadingOlder:"Loading earlier\u2026",toBottom:"Back to bottom",copy:"Copy",copied:"Copied",turnActions:"Reply actions",usage:"Usage",inputTokens:"Input",outputTokens:"Output",duration:"Duration",send:"Send",stop:"Stop",turnRail:"Turns",secondUnit:"s",minuteUnit:"m",previewTitle:"File preview",previewClose:"Close preview",previewBack:"Back to conversation",previewExpand:"Expand preview",previewCollapse:"Restore preview size",previewCopyContent:"Copy content",previewCopyPath:"Copy path",previewOpenExternal:"Open externally",previewWrap:"Wrap",previewLoading:"Loading file",previewMissing:"File not found",previewFailed:"Could not load this file",previewUnsupported:"No preview for this file type",previewRetry:"Try again",previewResize:"Resize preview",previewLines:(t,r)=>t===r?`Line ${t}`:`Lines ${t}\u2013${r}`,previewTruncated:(t,r)=>`Showing the first ${t.toLocaleString()} of ${r.toLocaleString()} lines`,imageFailed:"The image could not be displayed",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomFit:"Fit to width"},ng=t=>({...mx,...t}),gx={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`},ag=t=>({...gx,...t}),fx=1e3,og=60,bx=1e3,ig=(t,r)=>{let o=Math.max(1,Math.round(Math.max(t,bx)/fx)),n=Math.floor(o/og),a=o%og;return n<=0?`${o}${r.secondUnit}`:`${n}${r.minuteUnit} ${a}${r.secondUnit}`};var yx={open:false,ref:null,phase:"loading",data:null},sg=t=>{let[r,o]=Jt.useState(yx),n=Jt.useRef(r);n.current=r;let a=Jt.useRef(t);a.current=t;let i=Jt.useRef(null),s=Jt.useRef(0),l=Jt.useRef(null),d=Jt.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=Jt.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=Jt.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=Jt.useCallback(()=>{let{ref:b}=n.current;b&&d(b);},[d]);return Jt.useEffect(()=>()=>{i.current?.abort();},[]),{state:r,open:u,close:p,reload:f}};var jl="--orb-omph-pv-w",Ql="--orb-omph-pv-pref",Sx=880,wx=560,cg=400,_o=320,kx=.45,Px=.7,dg=24,Zl=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),pg=({open:t,layout:r})=>{let o=Jt.useRef(null),n=Jt.useRef(null),[a,i]=Jt.useState(0),[s,l]=Jt.useState(null),[d,u]=Jt.useState(false),[p,f]=Jt.useState(false);Jt.useLayoutEffect(()=>{let k=o.current;if(!k)return;let I=()=>i(k.getBoundingClientRect().width);I();let S=new ResizeObserver(I);return S.observe(k),()=>S.disconnect()},[]),Jt.useEffect(()=>{t||u(false);},[t]);let b=r==="overlay"?false:r==="split"?a>=cg+_o:a>=Sx,m=b&&!d?"split":"overlay",v=Math.max(_o,Math.min(a*Px,a-cg)),y=Zl(s??a*kx,_o,v),g=a>0&&a<wx,x=Jt.useCallback(k=>{let I=o.current;I&&(I.style.setProperty(Ql,`${k}px`),I.dataset.placement==="split"&&I.dataset.open==="true"&&I.style.setProperty(jl,`${k}px`));},[]),h=Jt.useCallback(k=>{k.button===0&&(k.preventDefault(),k.currentTarget.setPointerCapture(k.pointerId),n.current={pointerId:k.pointerId,startX:k.clientX,startWidth:y,latest:y},f(true));},[y]),C=Jt.useCallback(k=>{let I=n.current;!I||I.pointerId!==k.pointerId||(I.latest=Zl(I.startWidth+(I.startX-k.clientX),_o,v),x(I.latest));},[v,x]),P=Jt.useCallback(k=>{let I=n.current;!I||I.pointerId!==k.pointerId||(n.current=null,k.currentTarget.hasPointerCapture(k.pointerId)&&k.currentTarget.releasePointerCapture(k.pointerId),l(I.latest),f(false));},[]),w=Jt.useCallback(k=>{let I={ArrowLeft:y+dg,ArrowRight:y-dg,Home:_o,End:v};k.key in I&&(k.preventDefault(),l(Zl(I[k.key],_o,v)));},[v,y]);return {mainRef:o,placement:m,width:y,compact:g,dragging:p,expanded:d,canExpand:b,toggleExpanded:()=>u(k=>!k),gripProps:{role:"separator","aria-orientation":"vertical","aria-valuemin":_o,"aria-valuemax":Math.round(v),"aria-valuenow":Math.round(y),tabIndex:0,onPointerDown:h,onPointerMove:C,onPointerUp:P,onPointerCancel:P,onKeyDown:w}}};var Ps=48,Ix=900,mg=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,gg=({turns:t,contentVersion:r,hasOlder:o=false,loadingOlder:n=false,onLoadOlder:a})=>{let i=Jt.useRef(null),s=Jt.useRef(null),l=Jt.useRef(true),d=Jt.useRef({height:0,top:0}),u=Jt.useRef(void 0),p=Jt.useRef(false),[f,b]=Jt.useState(true),[m,v]=Jt.useState(false),[y,g]=Jt.useState(t[0]?.id),x=Jt.useCallback(()=>{let k=i.current;k&&(d.current={height:k.scrollHeight,top:k.scrollTop});},[]),h=Jt.useCallback(()=>{let k=i.current;if(!k)return;let I=k.getBoundingClientRect().top,S=k.querySelector("[data-omph-turn]")?.dataset.omphTurn;k.querySelectorAll("[data-omph-turn]").forEach(E=>{E.getBoundingClientRect().top-I<=Ps&&(S=E.dataset.omphTurn);}),g(S);},[]);Jt.useEffect(()=>{let k=i.current,I=s.current;if(!k||!I)return;let S=()=>{v(k.clientWidth>Ix),l.current&&(k.scrollTop=k.scrollHeight),x();};S();let E=new ResizeObserver(S);return E.observe(k),E.observe(I),()=>E.disconnect()},[x]),Jt.useLayoutEffect(()=>{let k=i.current;if(!k)return;let I=t[0]?.id,S=u.current,E=S!==void 0&&I!==void 0&&I!==S;if(u.current=I,E){l.current=false,b(false);let D=k.scrollHeight-d.current.height;k.scrollTop=d.current.top+Math.max(0,D),x(),h();return}l.current&&(k.scrollTop=k.scrollHeight),x(),h();},[r,x,t,h]),Jt.useEffect(()=>{n||(p.current=false);},[n]);let C=Jt.useCallback(()=>{let k=i.current;if(!k)return;let S=k.scrollHeight-k.scrollTop-k.clientHeight<=Ps;S!==l.current&&(l.current=S,b(S)),x(),h();let E=k.scrollHeight-k.clientHeight>Ps,D=k.scrollTop<=Ps;!E||!D||S||!o||n||!a||p.current||(p.current=true,a());},[o,n,a,x,h]),P=Jt.useCallback(()=>{let k=i.current;k&&(l.current=true,b(true),k.scrollTo({top:k.scrollHeight,behavior:mg()?"auto":"smooth"}));},[]),w=Jt.useCallback(k=>{let S=i.current?.querySelector(`[data-omph-turn="${CSS.escape(k)}"]`);S&&(l.current=false,b(false),S.scrollIntoView({block:"start",behavior:mg()?"auto":"smooth"}));},[]);return {scrollerRef:i,contentRef:s,following:f,railVisible:m,activeTurnId:y,onScroll:C,returnToBottom:P,scrollToTurn:w}};T();var Mx=1e3,Dx=(t,r)=>r[t],Nx=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("|"),Ax=({startedAt:t,labels:r})=>{let[o,n]=Jt.useState(()=>Date.now());Jt.useEffect(()=>{n(Date.now());let i=window.setInterval(()=>n(Date.now()),Mx);return ()=>window.clearInterval(i)},[t]);let a=t===void 0?r.working:r.workingFor(ig(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})]})]})},u5=({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,loadFilePreview:h,resolveFileLink:C=_l,filePreviewLayout:P="auto",onOpenFileExternally:w})=>{let k=ng(s),I=a??(i?"running":"idle"),S=I==="running"||I==="pending",E=[Dx(I,k),o].filter(Boolean).join(" \xB7 "),D=Jt.useMemo(()=>Nx(t),[t]),R=gg({turns:t,contentVersion:D,hasOlder:b,loadingOlder:m,onLoadOlder:v}),[A,N]=Jt.useState(""),O=A.trim(),F=i&&O.length===0,q=[...t].reverse().find(le=>!!le.assistant?.streaming||le.process?.some(be=>be.streaming||be.status==="running"||be.status==="pending")),z=S?q?.startedAt:void 0,X=!!h,$=sg(h),_=pg({open:$.state.open,layout:P}),V=Jt.useRef(null),B=Jt.useRef(null),Z=X&&$.state.open&&_.placement==="overlay",Q=_.placement==="split"&&$.state.open,ge={[Ql]:`${_.width}px`,[jl]:Q?`${_.width}px`:"0px"};Jt.useEffect(()=>{B.current?.toggleAttribute("inert",Z);},[Z]);let se=async()=>{if(!O||!y)return;let le=O;N("");try{await y(le);}catch{N(be=>be.trim().length===0?le:be);}};return c("div",{className:dt("orb-omph-panel",p),"data-omph-panel":"","data-status":I,"data-compact":_.compact||void 0,children:[c("div",{className:dt("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":S||void 0}),e("span",{className:"truncate",children:E||k.idle})]})]}),n&&e("div",{className:"ml-auto flex flex-none items-center gap-1",children:n})]}),c("div",{ref:_.mainRef,className:"orb-omph-main","data-placement":_.placement,"data-open":String($.state.open),"data-dragging":_.dragging||void 0,style:ge,children:[c("div",{ref:B,className:"orb-omph-center",children:[c("div",{className:"orb-omph-stage","data-rail":R.railVisible||void 0,children:[e("div",{ref:R.scrollerRef,className:"orb-omph-scroll",onScroll:R.onScroll,children:c("div",{ref:R.contentRef,className:"orb-omph-column",children:[b&&v&&e("button",{type:"button",className:"orb-omph-older",disabled:m,onClick:v,children:m?k.loadingOlder:k.loadOlder}),e(rg,{turns:t,labels:k,processDisplay:l,cardHooks:f,resolveFileLink:C,onOpenFile:X?$.open:void 0}),S&&e(Ax,{startedAt:z,labels:k})]})}),R.railVisible&&t.length>0&&e("nav",{className:"orb-omph-rail","aria-label":k.turnRail,children:t.map(le=>e("button",{type:"button",className:"orb-omph-rail-mark","data-active":R.activeTurnId===le.id||void 0,"aria-label":Yl(le),title:Yl(le),onClick:()=>R.scrollToTurn(le.id)},le.id))}),!R.following&&e("button",{type:"button",className:"orb-omph-to-bottom","aria-label":k.toBottom,onClick:R.returnToBottom,children:e(Fr,{size:16})})]}),d&&c("form",{className:"orb-omph-composer",onSubmit:le=>{le.preventDefault(),F?g?.():se();},children:[e("textarea",{className:"orb-omph-input",value:A,placeholder:u,rows:1,onChange:le=>N(le.target.value),onKeyDown:le=>{le.key!=="Enter"||le.shiftKey||le.nativeEvent.isComposing||(le.preventDefault(),F?g?.():se());}}),e("button",{type:"submit",className:F?"orb-omph-stop":"orb-omph-send","aria-label":F?k.stop:k.send,disabled:!F&&O.length===0,children:F?e(Ic,{size:16}):e(Tc,{size:16})})]})]}),X&&e(Qm,{state:$.state,placement:_.placement,expanded:_.expanded,canExpand:_.canExpand,labels:k,gripProps:_.gripProps,paneRef:V,onClose:$.close,onRetry:$.reload,onToggleExpand:_.toggleExpanded,onOpenExternally:w})]})]})};T();var bo="other",Ex=t=>t instanceof HTMLElement&&t.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')!==null,Lx=({request:t,onDecide:r,labels:o})=>{let n=ag(o),a=Jt.useRef(null),i=Jt.useRef(null),s=Jt.useRef(false),l=Jt.useRef(false),[d,u]=Jt.useState(false),[p,f]=Jt.useState(null),[b,m]=Jt.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,P=!g||p!==null&&p!==bo||C;Jt.useEffect(()=>{u(false),f(null),m(""),a.current?.focus();},[t.id]),Jt.useEffect(()=>{p===bo&&i.current?.focus();},[p]);let w=S=>{d||(u(true),r(S,t));},k=()=>{if(P){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||Ex(S.target))&&!(S.key!=="Enter"&&S.key!=="Escape")&&!(S.key==="Enter"&&S.target instanceof HTMLElement&&S.target.closest('button, a[href], [role="button"]'))&&!(S.ctrlKey||S.metaKey||S.altKey||S.shiftKey)&&(S.preventDefault(),S.stopPropagation(),!(S.repeat||s.current||l.current||S.nativeEvent.isComposing))){if(S.key==="Escape"){w({kind:"rejected"});return}k();}};return 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 E=p===S.id;return c("label",{className:"orb-omph-approval-choice","data-selected":E,children:[e("input",{type:"radio",name:`omph-approval-${t.id}`,value:S.id,checked:E,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||!P,onClick:k,children:g?n.confirm:n.allowOnce})]})]})})};T();var xg=520,Bx=88,Hx=88,zx=24,Is=640,Sg=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),tc=t=>typeof t=="number"?`${t}px`:t,Vx=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,w5=({anchor:t,defaultAnchor:r="right",onAnchorChange:o,width:n=xg,top:a=Bx,bottom:i=Hx,inset:s=zx,zIndex:l=1300,shellClassName:d,shellStyle:u,className:p,onHeaderPointerDown:f,...b})=>{let m=Jt.useRef(null),v=Jt.useRef(null),[y,g]=Jt.useState(r),[x,h]=Jt.useState(0),[C,P]=Jt.useState(typeof n=="number"?n:xg),[w,k]=Jt.useState(0),[I,S]=Jt.useState(false),E=t??y;Jt.useEffect(()=>{let z=()=>h(window.innerWidth);return z(),window.addEventListener("resize",z),()=>window.removeEventListener("resize",z)},[]),Jt.useLayoutEffect(()=>{let z=()=>{let $=m.current?.getBoundingClientRect();$?.width?P($.width):typeof n=="number"&&P(n);};if(z(),!m.current||typeof ResizeObserver>"u")return;let X=new ResizeObserver(z);return X.observe(m.current),()=>X.disconnect()},[n]);let D=Jt.useCallback(z=>{if(!x)return s;let X=x<Is?12:s,$=Math.max(X,x-C-X);return x<Is||z==="left"?X:z==="center"?Sg((x-C)/2,X,$):$},[s,C,x]),R=Jt.useCallback(z=>["left","center","right"].reduce(($,_)=>{let V=Math.abs(z-D($));return Math.abs(z-D(_))<V?_:$},"right"),[D]),A=Jt.useCallback(z=>{t===void 0&&g(z),o?.(z);},[t,o]);Jt.useEffect(()=>{I||k(D(E));},[D,I,E]);let N=Jt.useCallback(z=>{f?.(z),!(z.defaultPrevented||Vx(z.target))&&(z.preventDefault(),z.currentTarget.setPointerCapture(z.pointerId),v.current={pointerId:z.pointerId,startClientX:z.clientX,startX:w,currentX:w,captureElement:z.currentTarget},S(true));},[f,w]),O=Jt.useCallback(z=>{let X=v.current;if(!X||X.pointerId!==z.pointerId)return;let $=x<Is?12:s,_=Math.max($,x-C-$),V=Sg(X.startX+z.clientX-X.startClientX,$,_);X.currentX=V,k(V);},[s,C,x]),F=Jt.useCallback(z=>{let X=v.current;if(!X||X.pointerId!==z.pointerId)return;try{X.captureElement.releasePointerCapture(z.pointerId);}catch{}let $=R(X.currentX);v.current=null,S(false),A($),k(D($));},[D,A,R]),q=Jt.useMemo(()=>({position:"fixed",top:tc(a),bottom:tc(i),left:w,width:tc(n),maxWidth:`calc(100vw - ${x<Is?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:dt("orbcafe-floating-agent-panel min-w-0",d),"data-anchor":E,"data-dragging":I?"true":"false",style:q,onPointerMove:O,onPointerUp:F,onPointerCancel:F,children:e(Vm,{...b,className:p,onHeaderPointerDown:N})})};T();var Gx={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},N5=({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]=Jt.useState(""),[h,C]=Jt.useState(false),P=Jt.useRef(null),w=Gx[l];Jt.useEffect(()=>{P.current?.scrollIntoView({behavior:"smooth"});},[t,n]);let k=Jt.useCallback(async()=>{let S=g.trim();!S||n||(x(""),await r(S));},[n,r,g]),I=Jt.useCallback(async S=>{S.key==="Enter"&&!h&&(S.preventDefault(),await k());},[k,h]);return c("div",{className:dt("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:dt("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:dt("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,E)=>{let D=S.type==="assistant"&&E===t.length-1,R=S.type==="assistant"?{isLatestAssistant:D,isResponding:n,onRegenerate:o?()=>o(S.id):void 0}:void 0;return e(ys,{message:S,assistantActions:R,onStreamingComplete:()=>v?.(S.id),streamIntervalMs:b,streamChunkSize:m,cardHooks:y},S.id)}),e("div",{ref:P})]}),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(Fa,{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(Ea,{className:"h-4 w-4"})})]})})]})};T();var _x=["var(--orb-primary)","var(--orb-primary)","var(--orb-primary)"],Ux=`
|
|
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 Ku=(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},qu=(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}}),Xu=({rows:t,dimensionFieldId:r,primaryValue:o,secondaryValue:n})=>{if(!r)return [];let a=new Map;return t.forEach(i=>{let s=co(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 Yu=({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(()=>Ku(o,n,r),[n,r,o]),h=er.useMemo(()=>qu(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?[]:Xu({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(),D=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:[D&&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(Gu,{data:I,primaryLabel:C.label,secondaryLabel:k?.label,formatPrimaryValue:S,formatSecondaryValue:A}):e(Uu,{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 Ml=(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??"",Rl=(t,r,o)=>o===""?"":o&&o!==r&&t.some(n=>n.fieldId===o)?o:t.find(n=>n.fieldId!==r)?.fieldId??"",ju=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},Qu=(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,Qu(a.children,r,o+1)),o),Qv=(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},uO=({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(R=>T[R]??Nu[R],[T]),S=er.useMemo(()=>new Set(o.map(R=>R.id)),[o]),A=er.useMemo(()=>new Map(o.map(R=>[R.id,R])),[o]),[D,M]=er.useState(()=>lr(n?.rows,S)),[N,E]=er.useState(()=>lr(n?.columns,S)),[O,F]=er.useState(()=>lr(n?.filters,S)),[X,H]=er.useState(()=>{let R=n?.values??[],_=new Set,G=[];return R.forEach(de=>{if(!S.has(de.fieldId)||_.has(de.fieldId))return;_.add(de.fieldId),h.current+=1;let He=A.get(de.fieldId);G.push({tokenId:`v${h.current}`,fieldId:de.fieldId,aggregation:vr(de.aggregation,He)});}),G}),[Y,W]=er.useState({}),[j,V]=er.useState(true),[z,U]=er.useState(false),[K,fe]=er.useState(()=>Ml(lr(n?.rows,S),lr(n?.columns,S),a?.dimensionFieldId)),[se,ue]=er.useState(()=>{let R=(n?.values??[]).filter((_,G,de)=>S.has(_.fieldId)&&de.findIndex(He=>He.fieldId===_.fieldId)===G).map(_=>({tokenId:_.fieldId,fieldId:_.fieldId,aggregation:vr(_.aggregation,A.get(_.fieldId))}));return es(R,a?.primaryValueFieldId)}),[Se,$e]=er.useState(()=>{let R=(n?.values??[]).filter((G,de,He)=>S.has(G.fieldId)&&He.findIndex(ot=>ot.fieldId===G.fieldId)===de).map(G=>({tokenId:G.fieldId,fieldId:G.fieldId,aggregation:vr(G.aggregation,A.get(G.fieldId))})),_=es(R,a?.primaryValueFieldId);return Rl(R,_,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,q]=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??D,Fe=u?.columnFields??N,ce=u?.filterFields??O,ve=u?.valueFields??X,te=u?.filterSelections??Y,he=u?.showGrandTotal??j,Ne=u?.isConfiguratorCollapsed??z,Je=u?.chartDimensionFieldId??K,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(R=>{if(u?.setRowFields){u.setRowFields(R);return}M(R);},[u]),Nt=er.useCallback(R=>{if(u?.setColumnFields){u.setColumnFields(R);return}E(R);},[u]),lt=er.useCallback(R=>{if(u?.setFilterFields){u.setFilterFields(R);return}F(R);},[u]),Ft=er.useCallback(R=>{if(u?.setValueFields){u.setValueFields(R);return}H(R);},[u]),Yt=er.useCallback(R=>{if(u?.setFilterSelections){u.setFilterSelections(R);return}W(R);},[u]),Z=er.useCallback(R=>{if(u?.setShowGrandTotal){u.setShowGrandTotal(R);return}V(R);},[u]),$=er.useCallback(R=>{if(u?.setIsConfiguratorCollapsed){u.setIsConfiguratorCollapsed(R);return}U(R);},[u]),Q=er.useCallback(R=>{if(u?.setChartDimensionFieldId){u.setChartDimensionFieldId(R);return}fe(R);},[u]),be=er.useCallback(R=>{if(u?.setChartPrimaryValueFieldId){u.setChartPrimaryValueFieldId(R);return}ue(R);},[u]),Ce=er.useCallback(R=>{if(u?.setChartSecondaryValueFieldId){u.setChartSecondaryValueFieldId(R);return}$e(R);},[u]),Le=er.useCallback(R=>{if(u?.setChartType){u.setChartType(R);return}le(R);},[u]),_e=er.useCallback(R=>{if(u?.setIsChartCollapsed){u.setIsChartCollapsed(R);return}Me(R);},[u]),qe=er.useCallback(R=>{if(u?.setIsTableCollapsed){u.setIsTableCollapsed(R);return}Ve(R);},[u]),je=er.useCallback(R=>{let _=typeof R=="function"?R(wt):R;f||nt(_),m?.(_);},[m,wt,f]),mt=er.useMemo(()=>new Set([...Ke,...Fe,...ce]),[Ke,Fe,ce]),ft=er.useMemo(()=>o.filter(R=>!mt.has(R.id)),[o,mt]),Rt=er.useMemo(()=>{let R=[...Ke,...Fe,...ce],_=new Set,G=[];return R.forEach(de=>{_.has(de)||(_.add(de),G.push(de));}),G},[Fe,ce,Ke]);er.useEffect(()=>{ht(R=>{let _=R.filter(G=>S.has(G));return po(R,_)?R:_}),Nt(R=>{let _=R.filter(G=>S.has(G));return po(R,_)?R:_}),lt(R=>{let _=R.filter(G=>S.has(G));return po(R,_)?R:_}),Ft(R=>{let _=R.filter(G=>S.has(G.fieldId)).map(G=>({...G,aggregation:vr(G.aggregation,A.get(G.fieldId))}));return qi(R,_)?R:_});},[A,S]);let yt=er.useMemo(()=>{let R={};return Rt.forEach(_=>{let G=new Set;r.forEach(de=>{G.add(co(de[_]));}),R[_]=Array.from(G).sort((de,He)=>de.localeCompare(He));}),R},[Rt,r]);er.useEffect(()=>{Yt(R=>{let _={};return Rt.forEach(G=>{let de=yt[G]??[],ot=(R[G]??[]).filter(oe=>de.includes(oe)),Ge=Object.prototype.hasOwnProperty.call(R,G);_[G]=Ge?ot:de;}),Bu(R,_)?R:_});},[Rt,yt]),er.useEffect(()=>{Q(R=>Ml(Ke,Fe,R));},[Fe,Ke,Q]),er.useEffect(()=>{be(R=>es(ve,R));},[be,ve]),er.useEffect(()=>{Ce(R=>Rl(ve,st,R));},[st,Ce,ve]);let B=er.useMemo(()=>r.filter(R=>Rt.every(_=>{let G=te[_]??[],de=yt[_]??[];if(G.length===de.length)return true;if(G.length===0)return false;let He=co(R[_]);return G.includes(He)})),[Rt,yt,te,r]),J=er.useMemo(()=>{if(ve.length===0)return null;let R=new Map;if(B.forEach(Ge=>{let oe=Fe.length>0?Fe.map(ee=>co(Ge[ee])):[g("pivot.valueLabel")],me=_o(oe);R.set(me,oe);}),R.size===0){let Ge=Fe.length>0?Fe.map(()=>Ui):[g("pivot.valueLabel")];R.set(_o(Ge),Ge);}let _=Array.from(R.entries()).sort((Ge,oe)=>Fu(Ge[1],oe[1])),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&&_.forEach(([Ge,oe])=>{let me=G.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 G.forEach(me=>{let ee=Ge.filter(Oe=>{let Qe=Fe.length>0?Fe.map(Re=>co(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")||Ru,children:[],isLeaf:true,aggregatedValues:He(B),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=co(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(B,0,[]));}return {dataColumns:G,columnTree:de,rowTree:ot}},[Fe,A,B,I,Ke,g,ve]),ge=er.useCallback((R,_)=>(h.current+=1,{tokenId:`v${h.current}`,fieldId:R,aggregation:vr(_,A.get(R))}),[A]),Te=er.useCallback(R=>{if(R==="rows")return ht([]);if(R==="columns")return Nt([]);if(R==="filters")return lt([]);Ft([]);},[]),et=er.useCallback((R,_)=>{if(R==="rows")return ht(G=>G.filter(de=>de!==_));if(R==="columns")return Nt(G=>G.filter(de=>de!==_));if(R==="filters")return lt(G=>G.filter(de=>de!==_));Ft(G=>G.filter(de=>de.tokenId!==_));},[]),Xe=er.useCallback((R,_)=>{Ft(G=>G.map(de=>de.tokenId===R?{...de,aggregation:vr(_,A.get(de.fieldId))}:de));},[A]),kt=er.useCallback(R=>{St(String(R.active.id));},[]),bt=er.useCallback(R=>{if(St(null),!R.over)return;let _=Ki(String(R.active.id)),G=Ki(String(R.over.id));if(!_||!G||_.kind!=="item"||!_.key)return;if(_.zone===G.zone&&G.kind==="item"){if(_.zone==="rows"){let Re=Ke.indexOf(_.key),Ye=Ke.indexOf(G.key??"");Re!==-1&&Ye!==-1&&Re!==Ye&&ht(Pt=>sortable.arrayMove(Pt,Re,Ye));return}if(_.zone==="columns"){let Re=Fe.indexOf(_.key),Ye=Fe.indexOf(G.key??"");Re!==-1&&Ye!==-1&&Re!==Ye&&Nt(Pt=>sortable.arrayMove(Pt,Re,Ye));return}if(_.zone==="filters"){let Re=ce.indexOf(_.key),Ye=ce.indexOf(G.key??"");Re!==-1&&Ye!==-1&&Re!==Ye&<(Pt=>sortable.arrayMove(Pt,Re,Ye));return}if(_.zone==="values"){let Re=ve.findIndex(Pt=>Pt.tokenId===_.key),Ye=ve.findIndex(Pt=>Pt.tokenId===(G.key??""));Re!==-1&&Ye!==-1&&Re!==Ye&&Ft(Pt=>sortable.arrayMove(Pt,Re,Ye));}return}let de=G.zone,He=[...Ke],ot=[...Fe],Ge=[...ce],oe=[...ve],me="",ee=null;if(_.zone==="palette")me=_.key;else if(_.zone==="values"){let Re=oe.find(Ye=>Ye.tokenId===_.key);if(!Re)return;me=Re.fieldId,ee=Re,oe=oe.filter(Ye=>Ye.tokenId!==_.key);}else _.zone==="rows"?(me=_.key,He=He.filter(Re=>Re!==me)):_.zone==="columns"?(me=_.key,ot=ot.filter(Re=>Re!==me)):_.zone==="filters"&&(me=_.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(G.kind!=="item"||!G.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(G.key);return Ye>=0?Ye:He.length}if(Re==="columns"){let Ye=ot.indexOf(G.key);return Ye>=0?Ye:ot.length}if(Re==="filters"){let Ye=Ge.indexOf(G.key);return Ye>=0?Ye:Ge.length}if(Re==="values"){let Ye=oe.findIndex(Pt=>Pt.tokenId===G.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(Ou(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((R,_)=>{Yt(G=>({...G,[R]:_}));},[]),Ct=er.useCallback(R=>{Ot(_=>{let G=new Set(_);return G.has(R)?G.delete(R):G.add(R),G});},[]),nr=er.useCallback(R=>{re(_=>{let G=new Set(_);return G.has(R)?G.delete(R):G.add(R),G});},[]),Et=er.useCallback(R=>{let _=A.get(R.fieldId),G=kl(_);return e(Co,{size:"small",sx:{minWidth:98},children:e(zt,{value:R.aggregation,onChange:de=>Xe(R.tokenId,de.target.value),onClick:de=>de.stopPropagation(),onMouseDown:de=>de.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& select.orb-inp":{py:.35}},children:G.map(de=>e("option",{value:de,sx:{fontSize:"0.75rem"},children:I(de)},de))})})},[A,I,Xe]),Zt=er.useCallback(R=>{let _=yt[R]??[],G=te[R]??_;return _.length===0?g("pivot.filter.noValues"):G.length===0?g("pivot.filter.noneSelected"):G.length===_.length?g("pivot.filter.allValues"):g("pivot.filter.selectedCount",{selected:G.length,total:_.length})},[yt,te,g]),Ht=er.useCallback(R=>{let _=yt[R]??[],G=te[R]??_;return e(zu,{options:_,selectedValues:G,onChange:de=>gt(R,de)})},[yt,te,gt]),Kt=er.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),$t=er.useCallback(()=>{let R={};return new Set([...Rt,...Object.keys(te)]).forEach(G=>{if(!S.has(G))return;let de=te[G]??[];R[G]=[...de];}),{layout:{rows:[...Ke],columns:[...Fe],filters:[...ce],values:ve.map(G=>({fieldId:G.fieldId,aggregation:G.aggregation}))},filterSelections:R,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(R=>{let _=lr(R.layout.rows,S),G=lr(R.layout.columns,S),de=lr(R.layout.filters,S),He=new Set,ot=(R.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(R.filterSelections??{}).forEach(([me,ee])=>{!S.has(me)||!Array.isArray(ee)||(Ge[me]=Array.from(new Set(ee.map(Oe=>String(Oe)))));}),ht(_),Nt(G),lt(de),Ft(ot),Yt(Ge),typeof R.showGrandTotal=="boolean"&&Z(R.showGrandTotal),Q(Ml(_,G,R.chart?.dimensionFieldId));let oe=es(ot,R.chart?.primaryValueFieldId);be(oe),Ce(Rl(ot,oe,R.chart?.secondaryValueFieldId)),Le(R.chart?.chartType??"bar-vertical"),q(R.id),y?.(R);},[ge,y,Q,be,Ce,Le,Nt,lt,Yt,ht,Z,Ft,S]),ar=er.useCallback(R=>{if(!R){q("");return}let _=wt.find(G=>G.id===R);if(!_){q("");return}rr(_);},[rr,wt]),fr=er.useCallback(()=>{let R=g("pivot.preset.defaultName",{index:wt.length+1});at(R),ye(true);},[wt.length,g]),Ir=er.useCallback(()=>{let R=Be.trim();if(!R)return;let _={id:Kt(),name:R,...$t()};je(G=>[...G,_]),q(_.id),ye(false);},[$t,Kt,Be,je]),Mr=er.useCallback(()=>{it&&(je(R=>R.filter(_=>_.id!==it)),q(""));},[it,je]);er.useEffect(()=>{if(!v||C.current)return;let R=wt.find(_=>_.id===v);R&&(C.current=true,rr(R));},[rr,v,wt]),er.useEffect(()=>{it&&(wt.some(R=>R.id===it)||q(""));},[it,wt]);let oo=er.useMemo(()=>{if(!he||!J||!Ke.length)return null;let R={};return J.dataColumns.forEach(_=>{let G=B.filter(de=>{let He=Fe.length>0?Fe.map(ot=>co(de[ot])):[g("pivot.valueLabel")];return _o(He)===_.colKey});R[_.id]=wn(G,_.valueItem.fieldId,_.valueItem.aggregation);}),{key:"__grand_total__",value:g("pivot.grandTotal")||Du,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:R,path:[],depth:-1}},[he,J,B,Fe,Ke.length,g]),yr=er.useMemo(()=>ju(J?.rowTree??[]),[J]),Or=er.useMemo(()=>ju(J?.columnTree??[]),[J]);er.useEffect(()=>{Ot(R=>{let _=new Set;return R.has("__grand_total__")&&_.add("__grand_total__"),yr.forEach(G=>{R.has(G)&&_.add(G);}),_});},[yr]),er.useEffect(()=>{re(R=>{let _=new Set;return Or.forEach(G=>{R.has(G)&&_.add(G);}),_});},[Or]);let qo=er.useCallback(()=>{Ot(R=>{let _=new Set(R);return yr.forEach(G=>_.add(G)),_});},[yr]),Xo=er.useCallback(()=>{Ot(R=>{let _=new Set;return R.has("__grand_total__")&&_.add("__grand_total__"),_});},[]),Lo=er.useCallback(()=>{re(new Set(Or));},[Or]),Yo=er.useCallback(()=>{re(new Set);},[]),Zo=er.useMemo(()=>!J||Fe.length===0?[]:Qv(J.columnTree,At),[Fe.length,At,J]),Rr=er.useMemo(()=>{if(!J)return [];if(Fe.length===0)return J.dataColumns.map(_=>({id:_.id,label:_.label,leafColumnIds:[_.id],valueItem:_.valueItem}));let R=new Map(J.dataColumns.map(_=>[_.id,_]));return Zo.flatMap(_=>{let G=new Map;return _.leafColumnIds.forEach(de=>{let He=R.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=G.get(ot);if(oe){oe.leafColumnIds.push(de);return}G.set(ot,{id:`${_.key}::${ot}`,label:ve.length>1?Ge:_.label,leafColumnIds:[de],valueItem:He.valueItem});}),Array.from(G.values())})},[Fe.length,A,I,J,ve.length,Zo]),Oo=er.useMemo(()=>new Map(Rr.map(R=>[R.id,R])),[Rr]),jo=er.useMemo(()=>Rr.map(R=>({id:R.id,colKey:R.id,valueItem:R.valueItem,label:R.label})),[Rr]),Kr=er.useMemo(()=>{if(!J||Fe.length===0)return [];let R=[],_=Qu(J.columnTree,At),G=_+(ve.length>1?1:0),de=(He,ot)=>{R[ot]??(R[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:G-ot;R[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&&(R[_]=Rr.map(He=>({key:He.id,label:He.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),R},[Fe.length,At,J,ve.length,Rr]),no=er.useCallback((R,_)=>_.leafColumnIds.reduce((G,de)=>G+(R.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 R=Ki(Ze);if(!R||R.kind!=="item"||!R.key)return null;if(R.zone==="palette"){let He=A.get(R.key);return He?e(Pl,{label:He.label,subtitle:He.type}):null}if(R.zone==="values"){let He=ve.find(me=>me.tokenId===R.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 G=A.get(R.key)?.label??R.key,de=Zt(R.key);return e(Xi,{label:G,caption:de})};return c(Ae,{sx:R=>({p:{xs:1.2,md:2},borderRadius:"var(--orb-r-container)",border:`1px solid ${R.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:R=>ar(String(R.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(R=>e("option",{value:R.id,sx:{fontSize:"0.75rem"},children:R.name},R.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:B.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:R=>Z(R.target.checked)})]})]})]}),e(Dt,{}),c(core.DndContext,{sensors:x,collisionDetection:core.closestCenter,onDragStart:kt,onDragEnd:bt,children:[e($u,{isConfiguratorCollapsed:Ne,onToggleCollapse:()=>$(R=>!R),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(Md,{children:e(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Fo()})})]}),e(Yu,{rows:B,fieldMap:A,rowFields:Ke,columnFields:Fe,valueFields:ve,chartDimensionFieldId:Je,chartPrimaryValueFieldId:st,chartSecondaryValueFieldId:pt,chartType:Bt,isCollapsed:Xt,onChartDimensionFieldIdChange:R=>Q(R),onChartPrimaryValueFieldIdChange:R=>be(R),onChartSecondaryValueFieldIdChange:R=>Ce(R),onChartTypeChange:R=>Le(R),onToggleCollapse:()=>_e(R=>!R),getAggregationLabel:I}),e(Tn,{title:g("pivot.table.sectionTitle"),subtitle:Ke.length>0?Ke.map(R=>A.get(R)?.label??R).join(" > "):g("pivot.table.dimensions"),collapsed:Vt,onToggleCollapse:()=>qe(R=>!R),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((R,_)=>c("tr",{children:[_===0&&e("td",{rowSpan:Math.max(Kr.length,1),sx:G=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:vt()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${G.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:Ke.length>0?Ke.map(G=>A.get(G)?.label).join(" > "):g("pivot.table.dimensions")}),(R.length>0?R:Rr.map(G=>({key:G.id,label:G.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(G=>e("td",{align:"center",colSpan:G.colSpan,rowSpan:G.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:[G.expandable&&e(ae,{size:"small",onClick:()=>nr(G.key),sx:{width:22,height:22,p:0,ml:-0.2},children:G.expanded?e(Vr,{size:12}):e(ko,{size:12})}),e("div",{component:"span",children:G.label})]})},G.key))]},`pivot-header-row-${_}`))}),c("tbody",{children:[J.rowTree.map(R=>e(Qi,{node:R,dataColumns:jo,fieldMap:A,level:0,expandedKeys:Mt,onToggle:Ct,getValue:(_,G)=>{let de=Oo.get(G);return de?no(_,de):0}},R.key)),oo&&e(Qi,{node:oo,dataColumns:jo,fieldMap:A,level:0,expandedKeys:Mt,onToggle:Ct,getValue:(R,_)=>{let G=Oo.get(_);return G?no(R,G):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:R=>at(R.target.value),onKeyDown:R=>{R.key==="Enter"&&(R.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 Ju=(t,r,o)=>{let n=[...t,...r];return o&&n.includes(o)?o:n[0]??""},Nl=(t,r)=>r&&t.some(o=>o.fieldId===r)?r:t[0]?.fieldId??"",em=(t,r,o)=>o===""?"":o&&o!==r&&t.some(n=>n.fieldId===o)?o:t.find(n=>n.fieldId!==r)?.fieldId??"",hO=({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(q=>q.id)),[t]),p=er.useMemo(()=>new Map(t.map(q=>[q.id,q])),[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 q=r?.values??[],De=new Set,ye=[];return q.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,D]=er.useState(()=>Ju(lr(r?.rows,u),lr(r?.columns,u),i?.dimensionFieldId)),[M,N]=er.useState(()=>{let q=(()=>{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 Nl(q,i?.primaryValueFieldId)}),[E,O]=er.useState(()=>{let q=(()=>{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=Nl(q,i?.primaryValueFieldId);return em(q,De,i?.secondaryValueFieldId)}),[F,X]=er.useState(i?.chartType??"bar-vertical"),[H,Y]=er.useState(s),[W,j]=er.useState(l);er.useEffect(()=>{b(q=>{let De=q.filter(ye=>u.has(ye));return po(q,De)?q:De}),v(q=>{let De=q.filter(ye=>u.has(ye));return po(q,De)?q:De}),g(q=>{let De=q.filter(ye=>u.has(ye));return po(q,De)?q:De}),h(q=>{let De=q.filter(ye=>u.has(ye.fieldId)).map(ye=>({...ye,aggregation:vr(ye.aggregation,p.get(ye.fieldId))}));return qi(q,De)?q:De});},[p,u]),er.useEffect(()=>{D(q=>Ju(f,m,q));},[m,f]),er.useEffect(()=>{N(q=>Nl(x,q));},[x]),er.useEffect(()=>{O(q=>em(x,M,q));},[M,x]);let V=er.useCallback(q=>{b(lr(q,u));},[u]),z=er.useCallback(q=>{v(lr(q,u));},[u]),U=er.useCallback(q=>{g(lr(q,u));},[u]),K=er.useCallback(q=>{h(De=>{let ye=q??[],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(q=>{V(q.rows??[]),z(q.columns??[]),U(q.filters??[]),K(q.values??[]);},[z,U,V,K]),se=er.useCallback(q=>{if(q==="rows")return b([]);if(q==="columns")return v([]);if(q==="filters")return g([]);h([]);},[]),ue=er.useCallback((q,De)=>{if(q==="rows")return b(ye=>ye.filter(Be=>Be!==De));if(q==="columns")return v(ye=>ye.filter(Be=>Be!==De));if(q==="filters")return g(ye=>ye.filter(Be=>Be!==De));h(ye=>ye.filter(Be=>Be.tokenId!==De));},[]),Se=er.useCallback((q,De)=>{h(ye=>ye.map(Be=>Be.tokenId===q?{...Be,aggregation:vr(De,p.get(Be.fieldId))}:Be));},[p]),$e=er.useCallback((q,De)=>{k(ye=>({...ye,[q]:De}));},[]),ke=er.useCallback(()=>{k({});},[]),le=er.useCallback(()=>{T(q=>!q);},[]),Ee=er.useCallback(()=>{S(q=>!q);},[]),Me=er.useCallback(q=>{D(q);},[]),Pe=er.useCallback(q=>{N(q);},[]),Ve=er.useCallback(q=>{O(q);},[]),tt=er.useCallback(()=>{Y(q=>!q);},[]),nt=er.useCallback(()=>{j(q=>!q);},[]);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:D,chartPrimaryValueFieldId:M,setChartPrimaryValueFieldId:N,chartSecondaryValueFieldId:E,setChartSecondaryValueFieldId:O,chartType:F,setChartType:X,isChartCollapsed:H,setIsChartCollapsed:Y,isTableCollapsed:W,setIsTableCollapsed:j}),[A,M,E,F,m,y,C,H,I,W,f,w,x]),actions:{setRows:V,setColumns:z,setFilters:U,setValues:K,setLayout:fe,clearZone:se,removeFieldFromZone:ue,setAggregationForValue:Se,setFilterSelection:$e,resetFilterSelections:ke,toggleGrandTotal:le,toggleConfigurator:Ee,setChartDimension:Me,setChartPrimaryValue:Pe,setChartSecondaryValue:Ve,setChartType:X,toggleChart:tt,toggleTable:nt}}};var xO=({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 ny=t=>{let r=Number(t||0);return Number.isFinite(r)?r:0},kO=({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=ny(u),y=t.map(g=>g[r]===s?{...g,[o]:v}:g);m(y);}}};P();var ay=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],rm=(t,r,o,n)=>{r?.(t),n&&o?.();},DO=({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=ay,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,D]=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=>{D(O),k("error"),m?.(O);},[m]);er__namespace.default.useEffect(()=>{if(!t){M(),k("idle"),D(null),T("");return}let O=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){k("unsupported"),D("Camera access is not supported in this browser.");return}k("starting"),D(null);try{let X=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:i}}});if(O){X.getTracks().forEach(H=>H.stop());return}if(g.current=X,y.current&&(y.current.srcObject=X,await y.current.play()),!window.BarcodeDetector){k("unsupported"),D("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(),rm(W,b,r,l);}catch(H){N(H instanceof Error?H.message:"Failed to detect barcode.");}},d);}catch(X){N(X instanceof Error?X.message:"Unable to start camera.");}}})(),()=>{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),rm(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(Wd,{}),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(ip,{}),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 iy={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)"},BO=({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),D=132,M=()=>{C(0),w(false),T.current=null,I.current=0,S.current=0;},N=H=>{(H==="start"?b:m)?.onTrigger?.(),g?.(H),M();},E=H=>{!A||H.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(T.current=H.pointerId,I.current=H.clientX,S.current=H.clientX,w(true),H.currentTarget.setPointerCapture(H.pointerId));},O=H=>{if(!k||T.current!==H.pointerId)return;S.current=H.clientX;let Y=S.current-I.current,W=Math.max(-D,Math.min(D,Y));C(W);},F=H=>{if(!k||T.current!==H.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();},X=(H,Y)=>{if(!H)return null;let W=H.backgroundColor||iy[H.tone||"default"];return e("div",{sx:{position:"absolute",top:0,bottom:0,[Y]:0,width:D,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:[H.icon,e(L,{sx:{fontWeight:700,fontSize:"0.95rem"},children:H.label})]})})};return c("div",{sx:{position:"relative",overflow:"hidden",borderRadius:4,...x},children:[X(b,"left"),X(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(Yd,{})})}):null]}),a.length>0?e(ie,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((H,Y)=>e(xt,{label:H,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(H=>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:H.label}),e(L,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:H.value})]},H.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}),UO=({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("");},D=()=>{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(qd,{})}):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(Vd,{}),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:D,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(_d,{}),e(L,{sx:{fontWeight:800},children:d||y("common.ok")})]})})]})]})})};P();var nm=({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 py=(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);}},am=({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:()=>py(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 lm=(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?lm(n.children,r):[];return (a||i.length>0)&&o.push({...n,children:i.length>0?i:n.children}),o},[]):t,fy=t=>{let r=new Set,o=n=>{n.forEach(a=>{a.children?.length&&(r.add(a.id),o(a.children));});};return o(t),r},cm=({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(()=>lm(a,C),[a,C]),S=er.useMemo(()=>C.trim()?fy(I):w,[w,I,C]);er.useEffect(()=>{t&&T(new Set);},[t]);let A=O=>O.appurl||O.href||"",D=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(X=>{let H=new Set(X);return H.has(O.id)?H.delete(O.id):H.add(O.id),H});return}D(O);},N=O=>{let F=u||h,X=A(O);return !!(X&&F===X)},E=(O,F=0)=>{let X=!!O.children?.length,H=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]}),X?e(an,{sx:{transform:H?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):e(ri,{color:"action"})]}),X?e(nn,{in:H,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(sp,{fontSize:"small",color:"action"})}}),y==="landscape"&&!t?e(ae,{onClick:r,sx:{bgcolor:"action.hover"},children:e(rp,{})}):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 dm=(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)},by=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}),hy=(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)},vy=({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}`))})]})})},yy=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:D,toolbarSlot:M,emptyState:N,rowHeight:E="comfortable",cardActionSlot:O,renderCardFooter:F,onRowClick:X}=t,H=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:U,visibleColumns:K,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:q,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||[],B=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(B),[B]),oo=er__namespace.default.useMemo(()=>new Set(Rt),[Rt]),yr=er__namespace.default.useMemo(()=>new Set(yt),[yt]),Or=er__namespace.default.useCallback(ee=>oo.size>0?oo.has(ee):!(yr.has(ee)||Mr.has(ee)),[oo,yr,Mr]);er__namespace.default.useEffect(()=>{!Vt&<.hasActiveFilters&<.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:no}=mn({rows:Kr,config:{...C,title:C?.title||`${H} ${r("graph.reportTitle")}`}}),Ln=er__namespace.default.useMemo(()=>Nt?lt.applyRows(Kr,no):Kr,[no,lt,Nt,Kr]),{model:Fo}=mn({rows:Ln,config:{...C,title:C?.title||`${H} ${r("graph.reportTitle")}`,fieldMapping:no}}),R=Fo.table.columns.map(ee=>({id:ee.id,label:ee.label,align:ee.align||"left",minWidth:120,numeric:ee.align==="right"})),_=st?e(bn,{appId:st,tableKey:h,currentLayoutData:pt,onLayoutLoad:he,targetLayoutId:Xt,activeLayoutId:Bt,serviceUrl:I??g?.serviceUrl}):null,G=V.filter(ee=>K.includes(ee.id)),de=G.find(ee=>ee.id===A)||G[0],He=D?.map(ee=>G.find(Oe=>Oe.id===ee)).filter(Boolean)||G.filter(ee=>ee.id!==de?.id).slice(0,j==="portrait"?2:3),ot=G.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:K,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:K,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),X?.(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:dm(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}: ${hy(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}),by(dm(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(nm,{...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:U,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:_,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(vy,{summaryRow:q,visibleColumns:K,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:H})}),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&>(false),fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:w?.title||r("quickEdit.editWithTitle",{title:H})}),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:no,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(yy,{appId:st||"graph-report-internal",title:r("graph.dataBody"),columns:R,rows:Fo.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};P();var zF=({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:D,userMenuItems:M,leftHeaderSlot:N,rightHeaderSlot:E})=>{let O="orbcafe:page-layout-mode",[F,X]=er.useState("system"),[H,Y]=er.useState("light"),[W,j]=er.useState(false),[V,z]=er.useState(false),U=F==="system"?V?H:"light":F;er.useEffect(()=>{j(true);},[]),er.useEffect(()=>{try{let nt=window.localStorage.getItem(O);(nt==="light"||nt==="dark"||nt==="system")&&X(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(()=>{U==="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");},[U]);let K=Dr("(orientation: portrait)"),fe=Dr("(max-width: 899.95px)"),se=l==="auto"?!W||K||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(cm,{collapsed:se==="landscape"?!ke:false,onToggle:()=>le(!ke),menuData:o,orientation:se,colorMode:U,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:()=>X(Ve=>Ve==="system"?"dark":Ve==="dark"?"light":"system"),locale:w,localeLabel:T,localeOptions:I,onLocaleChange:S,user:v,onUserSetting:A,onUserLogout:D,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(Nd,{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(am,{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 gm=My__default.default(()=>Promise.resolve().then(()=>(mm(),um)).then(t=>t.COrbCanvas),{ssr:false,loading:()=>e("div",{className:"h-full w-full bg-transparent"})});function El({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(gm,{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(gm,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var qF=El;P();var bm=er.createContext(null);function Oy(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 Fy({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(D){let M=D instanceof Error?D.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&&Oy(document.activeElement)||(g.current=true,M.preventDefault(),y.current=setTimeout(()=>{x.current=true,b(true),k();},a)));},D=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",D),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",D),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(bm.Provider,{value:S,children:[l?e(El,{isRecording:f}):null,t]})}function By(){let t=er.useContext(bm);if(!t)throw new Error("useAINav must be used within CAINavProvider");return t}var JF=Fy,e2=By;function ut(...t){return tailwindMerge.twMerge(clsx.clsx(t))}P();var $y=({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})]})},hm=$y;P();var qy=({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})})]})},vm=qy;P();var ym="orb-html-demo",Qy=160,Jy=560,eC=220,Fl=`<script>(function(){var post=function(){var height=Math.ceil(document.documentElement.scrollHeight);parent.postMessage({source:${JSON.stringify(ym)},height:height},'*')};addEventListener('load',post);addEventListener('resize',post);new MutationObserver(post).observe(document.documentElement,{subtree:true,childList:true,attributes:true,characterData:true});post()})()</script>`,tC="html,body{margin:0;padding:12px;font:14px/1.5 system-ui,sans-serif;}",rC=t=>/<html[\s>]/i.test(t),oC=t=>{let r=t.trim();return rC(r)?/<\/body>/i.test(r)?r.replace(/<\/body>/i,`${Fl}</body>`):`${r}${Fl}`:`<!DOCTYPE html><html><head><meta charset="utf-8"><style>${tC}</style></head><body>${r}${Fl}</body></html>`},nC=({content:t,title:r="Interactive HTML"})=>{let o=er.useRef(null),[n,a]=er.useState(eC),i=er.useMemo(()=>oC(t),[t]);return er.useEffect(()=>{let s=l=>{if(l.source!==o.current?.contentWindow)return;let d=l.data;!d||d.source!==ym||typeof d.height!="number"||!Number.isFinite(d.height)||a(Math.min(Jy,Math.max(Qy,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}})]})},Cm=nC;P();var sC=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"},lC=({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{Sm__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 Sm__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:sC(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":""}`})]})},wm=lC;P();var cC=({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(Uc,{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=cC;P();var dC=({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=dC;P();var pC=({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=pC;P();var uC=({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(Hc,{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=uC;P();var gC=({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=gC;P();var fC=({title:t,subtitle:r,data:o,type:n,config:a={}})=>{let i=()=>{switch(n){case "bar-chart-card":return e(Fs,{className:"w-4 h-4 text-[var(--orb-chart-1)]"});case "line-chart-card":return e(Bc,{className:"w-4 h-4 text-[var(--orb-chart-positive)]"});case "pie-chart-card":return e(Gc,{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(Oc,{className:"w-4 h-4 text-[var(--orb-chart-negative)]"});case "fishbone-chart-card":return e(Lc,{className:"w-4 h-4 text-[var(--orb-chart-4)]"});case "waterfall-chart-card":return e(jc,{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(Vc,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});default:return e(Fs,{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(Ap,{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(Ep,{data:o,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return e(Lp,{data:o});case "fishbone-chart-card":return e(Op,{branches:o,effect:a.effect||t||"Problem"});case "waterfall-chart-card":return e(Fp,{data:o,height:a.height});case "google-map-card":return e(Bp,{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(Hp,{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=fC;P();var ms=["bar","column","line","pie","donut","scatter","bubble","list","metric","progress"],bC={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,Rm=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Ur=(t,r)=>`${t.id||t.label}-${r}`,Dm=(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)),mo=(t,r,o)=>t.color??o[r%o.length],go=(t,r)=>r?{onMouseEnter:()=>r.onItemHoverStart?.(t),onMouseMove:()=>r.onItemHoverStart?.(t),onMouseLeave:()=>r.onItemHoverEnd?.(t),onContextMenu:o=>r.onItemContextMenu?.(o,t)}:{},Nm=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}},hC=(t,r,o)=>{let n=ps-Ut.left-Ut.right,a=Mn-Ut.top-Ut.bottom,{max:i,range:s}=Nm(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)}},vC=(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`},yC=({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})]}),CC=()=>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"})]}),zl=({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());}}:{},...go(t,o),style:{cursor:r||o?"pointer":"default"}}},xC=({loading:t,error:r,hasData:o,emptyState:n,children:a})=>t?e(CC,{}):r?e("div",{className:"orb-metric-error",role:"alert",children:r}):o?e(jsxRuntime.Fragment,{children:a}):e(yC,{children:n??"No data for the current selection."}),SC=({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:mo(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,...go(l,n),children:b},Ur(l,d)):e("div",{className:`orb-metric-bar-row${f?" is-active":""}`,role:"listitem",...go(l,n),children:b},Ur(l,d))})})},wC=({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:mo(l,d,i)}})})]});return o?e("button",{type:"button",className:`orb-metric-progress-row${f?" is-active":""}`,onClick:()=>o(l),"aria-pressed":f,...go(l,n),children:b},Ur(l,d)):e("div",{className:`orb-metric-progress-row${f?" is-active":""}`,role:"listitem",...go(l,n),children:b},Ur(l,d))})})},kC=({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}=Nm(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)=>hC(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))),D=o===C.id;return c("g",{...zl({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(T)}`,children:[e("rect",{className:`orb-metric-column${D?" is-active":""}`,x:S,y:Math.min(w.y,v),width:A,height:I,rx:4,fill:mo(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:Dm(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",{...zl({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:mo(C,k,l)}),t!=="line"&&e("circle",{className:`orb-metric-point${T?" is-active":""}`,cx:w.x,cy:w.y,r:I,fill:mo(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:Dm(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)})]})})},PC=({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:vC(f,f,p,t==="donut"?46:0,g,g+y),C=zl({item:m,onItemClick:n,interactions:a});return h?e("path",{className:`orb-metric-slice${x?" is-active":""}`,d:h,fill:mo(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":mo(m,v,s),stroke:t==="donut"?mo(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,...go(m,a),children:[e("span",{className:"orb-metric-legend-dot",style:{backgroundColor:mo(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))})})]})},TC=({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,...go(s,n),children:d},Ur(s,l)):e("div",{className:`orb-metric-list-row${r===s.id?" is-active":""}`,role:"listitem",...go(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=Rm,secondaryValueFormatter:u=Rm,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 D=Os(),M=er.useRef(null),N=er.useRef(null),[E,O]=er.useState(n),[F,X]=er.useState(false),[H,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 q=De=>{let ye=De.target;ye instanceof HTMLElement&&ye.closest(".orb-metric-context-menu")||j(null);};return document.addEventListener("pointerdown",q),()=>document.removeEventListener("pointerdown",q)},[W]);let z=E,U=er.useMemo(()=>[D.chart1,D.chart2,D.chart3,D.chart4,D.chart5,D.chart6],[D]),K=er.useMemo(()=>F?o:o.slice(0,Math.max(1,y)),[o,y,F]),fe=Math.max(0,o.length-K.length),se=K.some(q=>tr(q.value)>0),ue=K.length>0&&(z!=="pie"&&z!=="donut"?true:se),Se=(C??[z,"bar","column","line","pie","donut","scatter","bubble","list"]).filter((q,De,ye)=>ms.includes(q)&&ye.indexOf(q)===De),$e={...bC,...k},ke=K[0],le=T??`${t} ${$e[z]} chart`,Ee=q=>{O(q),a?.(q);},Me=er.useCallback((q,De)=>{Y({item:q,source:De}),j(null),s?.(q,De);},[s]),Pe=er.useCallback(q=>{V(),!(!x||W)&&(N.current=window.setTimeout(()=>{Me(q,"hover"),N.current=null;},Math.max(0,h)));},[V,W,h,Me,x]),Ve=er.useCallback(()=>{V();},[V]),tt=er.useCallback((q,De)=>{if(!x)return;q.preventDefault(),V();let ye=M.current?.getBoundingClientRect(),Be=ye?us(q.clientX-ye.left,8,Math.max(8,ye.width-164)):8,at=ye?us(q.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:q=>{ke&&i&&(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),i(ke));},"aria-label":le,...ke?go(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(wC,{data:K,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,colors:U}):z==="bar"?e(SC,{data:K,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,colors:U}):z==="list"?e(TC,{data:K,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,secondaryValueFormatter:u}):z==="pie"||z==="donut"?e(PC,{type:z,data:K,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,colors:U,ariaLabel:le}):e(kC,{type:z,data:K,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,secondaryValueFormatter:u,colors:U,ariaLabel:le});return c("div",{ref:M,className:"orb-metric-chart-shell",onMouseLeave:()=>{V(),H?.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(q=>({value:q,label:$e[q]})),onChange:q=>Ee(q.target.value),minWidth:108,fullWidth:false,size:"small"})]}),c("div",{className:"orb-metric-chart-body",children:[e(xC,{loading:m,error:v,hasData:ue,emptyState:b,children:it}),fe>0&&!m&&!v&&e("button",{type:"button",className:"orb-metric-more",onClick:()=>X(q=>!q),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:q=>{q.key==="Escape"&&j(null);},style:{left:W.left,top:W.top},onPointerDown:q=>q.stopPropagation(),children:[e("div",{className:"orb-metric-context-label",children:W.item.label}),e("button",{type:"button",role:"menuitem",onClick:q=>{q.preventDefault(),q.stopPropagation(),Me(W.item,"contextmenu");},children:"Show data"})]}),H&&c("div",{className:"orb-metric-data-details",role:"dialog","aria-label":`${H.item.label} data details`,onPointerDown:q=>q.stopPropagation(),children:[c("div",{className:"orb-metric-data-details-header",children:[e("strong",{children:H.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(H.item.value))})]}),H.item.secondaryValue!==void 0&&c("div",{className:"orb-metric-data-details-row",children:[e("span",{children:f??"Secondary value"}),e("strong",{children:u(tr(H.item.secondaryValue))})]}),e("span",{className:"orb-metric-data-details-hint",children:H.source==="hover"?`Shown after ${Math.max(0,h)/1e3} seconds of stillness`:"Shown from the context menu"})]})]})};gs.displayName="CMetricChartCard";P();var IC=({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=IC;P();var MC=({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=MC;var RC=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:RC(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 FC=({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(hm,{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(wm,{content:T});if(C==="html"||C==="htm")return e(Cm,{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(vm,{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(NC__default.default,{remarkPlugins:[AC__default.default,EC__default.default],rehypePlugins:[LC__default.default,OC__default.default],components:v,children:f})})},Rn=FC;P();var BC=({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})})},Am=BC;P();var Wl=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"}}},zC=({content:t,className:r="",messageId:o,cardHooks:n})=>{let a=er__namespace.default.useMemo(()=>Wl.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(Am,{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=zC;P();var VC=({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"})]})},Om=VC;P();var Fm=({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(Jc,{size:14});case "like":return e(Yc,{size:14});case "dislike":return e(Xc,{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(Om,{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(Fm,{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 Bm=({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(np,{size:16}):e(ap,{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")},$C={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},_C=({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(Bd,{size:16})}),GC=({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(gp,{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(cp,{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 X=Array.from(F.target.files);d(H=>{let Y=X.filter(j=>H.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=X.filter(j=>!H.some(V=>V.name===j.name&&V.size===j.size));return [...H,...W]}),m.current&&(m.current.value="");}},[]),C=er.useCallback(F=>{d(X=>X.filter((H,Y)=>Y!==F));},[]),k=er.useCallback(()=>{m.current?.click();},[]),w=er.useCallback(async()=>{if(!y)return;let F=i,X=[...l];s(""),d([]),m.current&&(m.current.value="");try{await t(F,X);}catch(H){console.error("Failed to send message:",H),s(F),d(X);}},[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);},[]),D=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 X=Array.from(F.dataTransfer.files);d(H=>[...H,...X]);}},[]);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,X)=>c("div",{className:dr.fileTag,children:[e(Jd,{sx:{fontSize:16},className:"text-[var(--orb-primary)]"}),e("span",{className:"truncate max-w-[150px]",children:F.name}),e("button",{onClick:()=>C(X),className:"ml-1 hover:text-[var(--orb-status-error)] focus:outline-none",type:"button",children:e(Ud,{sx:{fontSize:16}})})]},`${F.name}-${X}`))}),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:$C,"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(_C,{enabled:g.enabled,onClick:k})}),c("div",{className:"flex items-center gap-1",children:[e(Bm,{onTextUpdate:A,onComplete:D,onCancel:M,disabled:o,className:dr.buttonSmall}),e(GC,{canSend:y,isResponding:o,onSend:w,onStop:r})]})]})]})]})]})})};P();var zm=({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 Vm={idle:"Idle",running:"Working",success:"Success",error:"Error",pending:"Pending"},Wm=({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=[Vm[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(zm,{...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??`${Vm[u]}\u2026`})]}):void 0})})]})};P();var XC=t=>Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t),_m=({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(Wc,{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?XC(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 ex=2e3,tx=1/3,xs=[.25,.5,.75,1,1.5,2,3,4],rx=100,Gm={color:"inherit",background:"transparent",textShadow:"none",fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",textAlign:"left",wordSpacing:"normal",wordBreak:"normal",overflowWrap:"normal",tabSize:"inherit",hyphens:"none"},Um=({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,ex);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*tx);},[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:Gm,codeTagProps:{className:`language-${r}`,style:Gm},children:l.shown}),l.total>l.shownCount&&e("div",{className:"orb-omph-pv-note",children:i.previewTruncated(l.shownCount,l.total)})]})},Km=({text:t})=>e("div",{className:"orb-omph-pv-doc",children:e(Rn,{content:t})}),qm=({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*rx)}%`}),e("button",{type:"button","aria-label":o.zoomIn,disabled:!p,onClick:()=>b(1),children:"+"})]})]})};var ox=/^[a-z][a-z0-9+.-]*:/i,nx=/^L(\d+)(?:-L?(\d+))?$/i;var Xm=["B","KB","MB","GB"];var ax=t=>{try{return decodeURIComponent(t)}catch{return t}},Ul=t=>{let r=t.trim();if(!r||r.startsWith("#")||r.startsWith("//")||ox.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=ax(i>=0?n.slice(0,i):n);if(!s||s.endsWith("/"))return null;let l=nx.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)}},Kl=t=>t.split("/").filter(Boolean).pop()??t,Zm=t=>{let r=t.split("/");return r.pop(),r.join("/")},ql=t=>{let r=Kl(t),o=r.lastIndexOf(".");return o>0?r.slice(o+1).toLowerCase():""},jm={prism:"text",label:"Text"},Ym={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:jm},Xl=(t,r)=>r?Object.values(Ym).find(n=>n.prism===r)??{prism:r,label:r}:Ym[ql(t)]??jm,Qm=t=>{let r=t,o=0;for(;r>=1024&&o<Xm.length-1;)r/=1024,o+=1;return `${o>0&&r<10?r.toFixed(1):Math.round(r).toString()} ${Xm[o]}`};P();var ix=1e3,sx=9,fo=16,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]}),tg=({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 O=window.setTimeout(()=>v(false),ix);return ()=>window.clearTimeout(O)},[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=[];I&&S.push(I.label),C?.kind==="markdown"&&S.push("Markdown"),C?.kind==="image"&&g&&S.push(ql(g.path).toUpperCase()),h?.size!==void 0&&S.push(Qm(h.size)),C?.kind==="code"&&g?.startLine!==void 0&&S.push(a.previewLines(g.startLine,g.endLine??g.startLine));let A=O=>{O.key==="Escape"&&(O.stopPropagation(),l(true));},D=e("button",{type:"button",className:"orb-omph-pv-action",onClick:d,children:a.previewRetry}),M=()=>{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:sx},(O,F)=>e("span",{},F))});if(x==="error"||!C)return e(Yl,{tone:"error",icon:e(Ta,{size:fo}),title:a.previewFailed,text:k,action:D});switch(C.kind){case "missing":return e(Yl,{tone:"neutral",icon:e(Da,{size:fo}),title:a.previewMissing,text:C.message??k});case "unsupported":return e(Yl,{tone:"neutral",icon:e(Da,{size:fo}),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(Km,{text:C.text},g.path);case "code":return e(Um,{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(qm,{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}},N=r==="overlay",E=C?.kind==="image"?Fc:Da;return c("aside",{ref:s,className:"orb-omph-preview","data-open":y||void 0,"data-placement":r,role:N?"dialog":"complementary","aria-label":a.previewTitle,"aria-hidden":!y||void 0,tabIndex:-1,onKeyDown:A,children:[!N&&y&&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:[N&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewBack,onClick:()=>l(true),children:e(Ma,{size:fo})}),e("span",{className:"orb-omph-pv-glyph","aria-hidden":"true",children:e(E,{size:fo})}),c("div",{className:"orb-omph-pv-titles",children:[e("div",{className:"orb-omph-pv-name",title:k,children:g?Kl(g.path):""}),e("div",{className:"orb-omph-pv-path",title:k,children:e("bdi",{children:Zm(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(O=>!O),children:a.previewWrap}),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:fo}):e(vo,{size:fo})}),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(Ac,{size:fo})}),!N&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewClose,onClick:()=>l(true),children:e(jt,{size:fo})})]})]}),e("div",{className:"orb-omph-pv-meta",children:S.join(" \xB7 ")}),e("div",{className:"orb-omph-pv-body","data-kind":x==="ready"?C?.kind:void 0,children:M()})]})]})};P();var cx=1e3,rg=50,dx=1e3,px=t=>t==="tool"?tn:t==="command"?Vn:$c,ng=t=>!!t.streaming||t.status==="running"||t.status==="pending",ux=(t,r)=>r==="expanded"?true:ng(t),mx=t=>t!==void 0&&(t.inputTokens!==void 0||t.outputTokens!==void 0||t.durationMs!==void 0),gx=(t,r)=>`${Math.max(1,Math.round(t/dx))}${r.secondUnit}`,fx=({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})},bx=({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),cx);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()}),mx(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," ",gx(l.durationMs,r)]})]})]})},hx=({item:t,display:r,open:o,onToggle:n})=>{let a=px(t.kind),i=ng(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(fx,{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>rg?`${o.slice(0,rg)}\u2026`:o},vx=0,ag=({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!==vx||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]:ux(v,o);return e(hx,{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(bx,{turn:u,labels:r})]},u.id)})})};var yx={idle:"Idle",pending:"Pending",running:"Working",success:"Success",error:"Error",working:"Working",workingFor:t=>`Working for ${t}`,loadOlder:"Load earlier",loadingOlder:"Loading earlier\u2026",toBottom:"Back to bottom",copy:"Copy",copied:"Copied",turnActions:"Reply actions",usage:"Usage",inputTokens:"Input",outputTokens:"Output",duration:"Duration",send:"Send",stop:"Stop",turnRail:"Turns",secondUnit:"s",minuteUnit:"m",previewTitle:"File preview",previewClose:"Close preview",previewBack:"Back to conversation",previewExpand:"Expand preview",previewCollapse:"Restore preview size",previewCopyContent:"Copy content",previewCopyPath:"Copy path",previewOpenExternal:"Open externally",previewWrap:"Wrap",previewLoading:"Loading file",previewMissing:"File not found",previewFailed:"Could not load this file",previewUnsupported:"No preview for this file type",previewRetry:"Try again",previewResize:"Resize preview",previewLines:(t,r)=>t===r?`Line ${t}`:`Lines ${t}\u2013${r}`,previewTruncated:(t,r)=>`Showing the first ${t.toLocaleString()} of ${r.toLocaleString()} lines`,imageFailed:"The image could not be displayed",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomFit:"Fit to width",newConversation:"New conversation",conversationList:"Conversation list",conversations:"Conversations",noConversations:"No conversations yet"},sg=t=>({...yx,...t}),Cx={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`},lg=t=>({...Cx,...t}),xx=1e3,ig=60,Sx=1e3,cg=(t,r)=>{let o=Math.max(1,Math.round(Math.max(t,Sx)/xx)),n=Math.floor(o/ig),a=o%ig;return n<=0?`${o}${r.secondUnit}`:`${n}${r.minuteUnit} ${a}${r.secondUnit}`};var Px={open:false,ref:null,phase:"loading",data:null},dg=t=>{let[r,o]=er.useState(Px),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",Mx=880,Rx=560,ug=400,Go=320,Dx=.45,Nx=.7,mg=24,jl=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),gg=({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>=ug+Go:a>=Mx,m=b&&!d?"split":"overlay",v=Math.max(Go,Math.min(a*Nx,a-ug)),y=jl(s??a*Dx,Go,v),g=a>0&&a<Rx,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+mg,ArrowRight:y-mg,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 Ps=48,Ex=900,bg=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,hg=({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<=Ps&&(S=A.dataset.omphTurn);}),g(S);},[]);er.useEffect(()=>{let T=i.current,I=s.current;if(!T||!I)return;let S=()=>{v(T.clientWidth>Ex),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),D=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(D){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<=Ps;S!==l.current&&(l.current=S,b(S)),x(),h();let A=T.scrollHeight-T.clientHeight>Ps,D=T.scrollTop<=Ps;!A||!D||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:bg()?"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:bg()?"auto":"smooth"}));},[]);return {scrollerRef:i,contentRef:s,following:f,railVisible:m,activeTurnId:y,onScroll:C,returnToBottom:k,scrollToTurn:w}};P();var Ox=1e3,Fx=(t,r)=>r[t],Bx=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("|"),Hx=({startedAt:t,labels:r})=>{let[o,n]=er.useState(()=>Date.now());er.useEffect(()=>{n(Date.now());let i=window.setInterval(()=>n(Date.now()),Ox);return ()=>window.clearInterval(i)},[t]);let a=t===void 0?r.working:r.workingFor(cg(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})]})]})},wz=({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=Ul,filePreviewLayout:S="auto",onOpenFileExternally:A})=>{let D=sg(s),M=a??(i?"running":"idle"),N=M==="running"||M==="pending",E=[Fx(M,D),o].filter(Boolean).join(" \xB7 "),O=er.useMemo(()=>Bx(t),[t]),F=hg({turns:t,contentVersion:O,hasOlder:b,loadingOlder:m,onLoadOlder:v}),[X,H]=er.useState(""),Y=X.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,U=dg(T),K=gg({open:U.state.open,layout:S}),fe=er.useRef(null),se=er.useRef(null),ue=z&&U.state.open&&K.placement==="overlay",Se=K.placement==="split"&&U.state.open,$e={[Jl]:`${K.width}px`,[Ql]:Se?`${K.width}px`:"0px"};er.useEffect(()=>{se.current?.toggleAttribute("inert",ue);},[ue]);let ke=async()=>{if(!Y||!y)return;let le=Y;H("");try{await y(le);}catch{H(Ee=>Ee.trim().length===0?le:Ee);}};return c("div",{className:ut("orb-omph-panel",p),"data-omph-panel":"","data-status":M,"data-compact":K.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||D.idle})]})]}),(k||w||n)&&c("div",{className:"orb-omph-header-actions",onPointerDown:le=>le.stopPropagation(),children:[e(_m,{conversations:h,activeConversationId:C,labels:D,onNewConversation:k,onSelectConversation:w}),n]})]}),c("div",{ref:K.mainRef,className:"orb-omph-main","data-placement":K.placement,"data-open":String(U.state.open),"data-dragging":K.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?D.loadingOlder:D.loadOlder}),e(ag,{turns:t,labels:D,processDisplay:l,cardHooks:f,resolveFileLink:I,onOpenFile:z?U.open:void 0}),N&&e(Hx,{startedAt:V,labels:D})]})}),F.railVisible&&t.length>0&&e("nav",{className:"orb-omph-rail","aria-label":D.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":D.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:X,placeholder:u,rows:1,onChange:le=>H(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?D.stop:D.send,disabled:!W&&Y.length===0,children:W?e(Mc,{size:16}):e(Ic,{size:16})})]})]}),z&&e(tg,{state:U.state,placement:K.placement,expanded:K.expanded,canExpand:K.canExpand,labels:D,gripProps:K.gripProps,paneRef:fe,onClose:U.close,onRetry:U.reload,onToggleExpand:K.toggleExpanded,onOpenExternally:A})]})]})};P();var bo="other",zx=t=>t instanceof HTMLElement&&t.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')!==null,Vx=({request:t,onDecide:r,labels:o})=>{let n=lg(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||zx(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 kg=520,_x=88,Gx=88,Ux=24,Is=640,Pg=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),rc=t=>typeof t=="number"?`${t}px`:t,Kx=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,Lz=({anchor:t,defaultAnchor:r="right",onAnchorChange:o,width:n=kg,top:a=_x,bottom:i=Gx,inset:s=Ux,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:kg),[w,T]=er.useState(0),[I,S]=er.useState(false),A=t??y;er.useEffect(()=>{let H=()=>h(window.innerWidth);return H(),window.addEventListener("resize",H),()=>window.removeEventListener("resize",H)},[]),er.useLayoutEffect(()=>{let H=()=>{let W=m.current?.getBoundingClientRect();W?.width?k(W.width):typeof n=="number"&&k(n);};if(H(),!m.current||typeof ResizeObserver>"u")return;let Y=new ResizeObserver(H);return Y.observe(m.current),()=>Y.disconnect()},[n]);let D=er.useCallback(H=>{if(!x)return s;let Y=x<Is?12:s,W=Math.max(Y,x-C-Y);return x<Is||H==="left"?Y:H==="center"?Pg((x-C)/2,Y,W):W},[s,C,x]),M=er.useCallback(H=>["left","center","right"].reduce((W,j)=>{let V=Math.abs(H-D(W));return Math.abs(H-D(j))<V?j:W},"right"),[D]),N=er.useCallback(H=>{t===void 0&&g(H),o?.(H);},[t,o]);er.useEffect(()=>{I||T(D(A));},[D,I,A]);let E=er.useCallback(H=>{f?.(H),!(H.defaultPrevented||Kx(H.target))&&(H.preventDefault(),H.currentTarget.setPointerCapture(H.pointerId),v.current={pointerId:H.pointerId,startClientX:H.clientX,startX:w,currentX:w,captureElement:H.currentTarget},S(true));},[f,w]),O=er.useCallback(H=>{let Y=v.current;if(!Y||Y.pointerId!==H.pointerId)return;let W=x<Is?12:s,j=Math.max(W,x-C-W),V=Pg(Y.startX+H.clientX-Y.startClientX,W,j);Y.currentX=V,T(V);},[s,C,x]),F=er.useCallback(H=>{let Y=v.current;if(!Y||Y.pointerId!==H.pointerId)return;try{Y.captureElement.releasePointerCapture(H.pointerId);}catch{}let W=M(Y.currentX);v.current=null,S(false),N(W),T(D(W));},[D,N,M]),X=er.useMemo(()=>({position:"fixed",top:rc(a),bottom:rc(i),left:w,width:rc(n),maxWidth:`calc(100vw - ${x<Is?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:X,onPointerMove:O,onPointerUp:F,onPointerCancel:F,children:e(Wm,{...b,className:p,onHeaderPointerDown:E})})};P();var Yx={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},$z=({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=Yx[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 D=S.type==="assistant"&&A===t.length-1,M=S.type==="assistant"?{isLatestAssistant:D,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 Zx=["var(--orb-primary)","var(--orb-primary)","var(--orb-primary)"],jx=`
|
|
203
203
|
.orbcafe-ai-browser-glow {
|
|
204
204
|
position: fixed;
|
|
205
205
|
inset: 0;
|
|
@@ -231,4 +231,4 @@ ${o}: ${(a??n)(g.secondaryValue??0)}`:""]})}),e("text",{x:g.x,y:Math.max(g.y-12,
|
|
|
231
231
|
0%, 100% { opacity: 0.5; }
|
|
232
232
|
50% { opacity: 1; }
|
|
233
233
|
}
|
|
234
|
-
`,L5=({active:t=false,colors:r=_x,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:Ux}),e("div",{className:"orbcafe-ai-browser-glow","data-active":t?"true":"false",style:n,"aria-hidden":"true"})]})};var X5=({defaultMode:t="login",onLogin:r,onRegister:o,onForgotPassword:n}={})=>{let[a,i]=Jt.useState(t),[s,l]=Jt.useState(false),d=Jt.useCallback(async m=>{l(true);try{await m?.();}finally{l(false);}},[]),u=Jt.useCallback(m=>d(()=>r?.(m)),[r,d]),p=Jt.useCallback(m=>d(()=>o?.(m)),[o,d]),f=Jt.useCallback(m=>d(()=>n?.(m)),[n,d]),b=Jt.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}};T();var Xx={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."},oz=({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]=Jt.useState(r),m=t??f,v=Jt.useMemo(()=>({...Xx,...d}),[d]),[y,g]=Jt.useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[x,h]=Jt.useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[C,P]=Jt.useState({email:""}),[w,k]=Jt.useState(""),I=N=>{p||b(N),k(""),o?.(N);},S=async N=>{N.preventDefault(),await n?.(y),k("Demo login accepted. No real authentication request was sent.");},E=async N=>{N.preventDefault(),await a?.(x),k("Demo registration saved locally for this screen.");},D=async N=>{N.preventDefault(),await i?.(C),k("Demo reset link request created. No email was sent.");},R=m==="login"?v.loginTitle:m==="register"?v.registerTitle:v.forgotTitle,A=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:R}),e("p",{className:"orb-body-dense",style:{color:"var(--orb-muted)",margin:"-10px 0 0"},children:A}),w&&e(rn,{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:N=>g(O=>({...O,username:N.target.value})),startAdornment:e(zs,{size:15,strokeWidth:1.8})}),e(ze,{label:"Password",type:"password",autoComplete:"current-password",value:y.password,onChange:N=>g(O=>({...O,password:N.target.value})),startAdornment:e(Aa,{size:15,strokeWidth:1.8})}),c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[e(Dt,{label:"Remember me",checked:y.remember,onChange:N=>g(O=>({...O,remember:N.target.checked}))}),e("button",{type:"button",className:"orb-link",onClick:()=>I("forgot"),children:"Forgot password?"})]}),e(Ce,{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:E,style:{display:"flex",flexDirection:"column",gap:16},children:[e(ze,{label:"Full name",value:x.name,onChange:N=>h(O=>({...O,name:N.target.value})),startAdornment:e(zs,{size:15,strokeWidth:1.8})}),e(ze,{label:"Work email",type:"email",autoComplete:"username",value:x.email,onChange:N=>h(O=>({...O,email:N.target.value})),startAdornment:e(Hs,{size:15,strokeWidth:1.8})}),e(ze,{label:"Password",type:"password",autoComplete:"new-password",value:x.password,onChange:N=>h(O=>({...O,password:N.target.value})),startAdornment:e(Aa,{size:15,strokeWidth:1.8})}),e(ze,{label:"Confirm password",type:"password",autoComplete:"new-password",value:x.confirmPassword,onChange:N=>h(O=>({...O,confirmPassword:N.target.value}))}),e(Dt,{label:"I accept the demo workspace terms",checked:x.acceptedTerms,onChange:N=>h(O=>({...O,acceptedTerms:N.target.checked}))}),e(Ce,{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:D,style:{display:"flex",flexDirection:"column",gap:16},children:[e(ze,{label:"Work email",type:"email",autoComplete:"username",value:C.email,onChange:N=>P({email:N.target.value}),startAdornment:e(Hs,{size:15,strokeWidth:1.8})}),e(Ce,{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(Ce,{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 Zx={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},jx=[{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"}],Tg=({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:P,enableRowReorder:w,onTaskReorder:k,onLayoutIdChange:I,onLayoutSave:S})=>{let E=r??l??"planning-gantt",D=o??d??"planning",[R,A]=Jt.useState(n),[N,O]=Jt.useState(a??t[0]?.id??""),[F,q]=Jt.useState(""),[z,X]=Jt.useState(null),[$,_]=Jt.useState({...Zx,...i}),V=Jt.useMemo(()=>{let le=String($.keyword?.value??"").trim().toLowerCase(),be=String($.status?.value??"").trim(),_e=String($.owner?.value??"").trim().toLowerCase(),De=String($.workCenter?.value??"").trim().toLowerCase(),Pe=$.dateRange?.value,Ve=Pe?.[0]?ro__default.default(Pe[0]):null,Te=Pe?.[1]?ro__default.default(Pe[1]):null;return t.filter(xe=>{if(le&&![xe.id,xe.code,xe.title,xe.project,xe.workCenter,xe.owner?.name].join(" ").toLowerCase().includes(le)||be&&xe.status!==be||_e&&!String(xe.owner?.name??"").toLowerCase().includes(_e)||De&&!String(xe.workCenter??"").toLowerCase().includes(De))return false;if(Ve||Te){let We=ro__default.default(xe.startDate),ot=ro__default.default(xe.endDate),it=Ve?ot.isAfter(Ve)||ot.isSame(Ve,"day"):true,Ze=Te?We.isBefore(Te)||We.isSame(Te,"day"):true;if(!it||!Ze)return false}return true})},[$,t]);Jt.useEffect(()=>{V.length!==0&&(V.some(le=>le.id===N)||O(V[0].id));},[V,N]);let B=Jt.useCallback(le=>{O(le.id);},[]),Z=Jt.useCallback(le=>{q(le),I?.(le);},[I]),Q=Jt.useCallback(le=>{X(be=>({key:(be?.key??0)+1,variant:le})),P?.(le);},[P]),ge=Jt.useMemo(()=>({appId:E,tableKey:D,fields:s??jx,filters:$,onFilterChange:_,onVariantLoad:Q,onSearch:C??(()=>{}),currentLayoutId:F,layoutRefs:[{tableKey:D,layoutId:F||null}],variantService:p,serviceUrl:u}),[F,s,$,Q,C,E,D,u,p]),se=Jt.useMemo(()=>({appId:E,tableKey:D,serviceUrl:u,tasks:V,columns:b,scale:R,onScaleChange:A,page:m,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:h,selectedTaskId:N,onTaskSelect:B,enableRowReorder:w,onTaskReorder:k,layout:f,layoutVariant:z?.variant,layoutVariantLoadKey:z?.key,onLayoutIdChange:Z,onLayoutSave:S}),[b,g,w,V,Z,f,z?.key,z?.variant,x,h,S,k,B,m,E,D,v,y,R,u,N]);return {scale:R,setScale:A,selectedTaskId:N,setSelectedTaskId:O,filters:$,setFilters:_,filteredTasks:V,smartFilterProps:ge,planningGanttProps:se}};var pz=t=>{let r=Tg(t),o=Jt.useMemo(()=>({filterProps:r.smartFilterProps,ganttProps:r.planningGanttProps}),[r.planningGanttProps,r.smartFilterProps]);return {...r,layoutProps:o}};T();ro__default.default.extend(Jx__default.default);var ac=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],ic=36,sc=58,Sa=8,lc=260,i0=320,Uo="220ms cubic-bezier(0.2, 0, 0, 1)",Ig={"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"}},s0=t=>t?Ig[t]?.label??t:"Planned",l0=t=>t?Ig[t]?.color??"default":"info",Rg=t=>Math.min(100,Math.max(0,t??0)),Mg=(t,r=0)=>t.flatMap(o=>[{...o,level:r},...Mg(o.children??[],r+1)]),c0=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:s0(t.status),statusTone:t.status??"planned",progress:Rg(t.progress),startDate:t.startDate,endDate:t.endDate,color:t.color,reorderable:t.reorderable!==false}),Dg=(t,r)=>r==="month"?t.startOf("month"):r==="week"?t.startOf("week"):r==="day"?t.startOf("day"):t.startOf("hour"),Ng=(t,r)=>r==="month"?t.endOf("month"):r==="week"?t.endOf("week"):r==="day"?t.endOf("day"):t.endOf("hour"),d0=(t,r,o)=>{let n=[],a=Dg(t,o),i=Ng(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},cc=(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},Ag=({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:P=true,onTaskReorder:w,layout:k,layoutVariant:I,layoutVariantLoadKey:S,onLayoutIdChange:E,onLayoutSave:D,emptyLabel:R="No planning tasks available.",sx:A})=>{let N=sr(),{t:O}=pe(),F=Jt.useRef(null),q=Jt.useRef(null),z=Jt.useRef(null),X=Jt.useRef(false),[$,_]=Jt.useState(null),[V,B]=Jt.useState("content"),[Z,Q]=Jt.useState(null),[ge,se]=Jt.useState(0),[le,be]=Jt.useState({}),[_e,De]=Jt.useState(ic),[Pe,Ve]=Jt.useState([]),Te=Jt.useRef(void 0),[xe,We]=Jt.useState({activeId:null,overId:null}),[ot,it]=Jt.useState(null),[Ze,U]=Jt.useState(false),Fe=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:4}})),ye=Jt.useRef(null),Le=Jt.useMemo(()=>Mg(s),[s]),st=Jt.useMemo(()=>{if(Pe.length===0)return Le;let H=new Map(Le.map(Se=>[Se.id,Se])),j=Pe.map(Se=>H.get(Se)).filter(Se=>!!Se),me=new Set(j.map(Se=>Se.id));return [...j,...Le.filter(Se=>!me.has(Se.id))]},[Le,Pe]),Je=Jt.useMemo(()=>new Map(st.map(H=>[H.id,H])),[st]),vt=Jt.useMemo(()=>st.map(H=>c0(H)),[st]),St=Jt.useMemo(()=>new Map(vt.map(H=>[H.id,H])),[vt]),Et=Jt.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(Pt,{label:j.status,color:l0(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(Wn,{variant:"determinate",value:H,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),Lt=Jt.useMemo(()=>{if(!l||l.length===0)return Et;let H=new Map(Et.map(j=>[j.id,j]));return l.map(j=>{let me=H.get(j.id),Se=j.width??me?.minWidth??120,tt={id:j.id,label:j.label,minWidth:Se};if(me?.numeric&&(tt.numeric=true),j.render){let Xe=j.render;return tt.render=(It,ft)=>{let gt=Je.get(ft.id);return Xe(gt||ft)},tt}return me?.render?(tt.render=me.render,tt):(tt.render=(Xe,It)=>{let ft=It[j.id];if(ft!=null&&String(ft).length>0)return String(ft);let kt=Je.get(It.id)?.[j.id];return kt!=null&&String(kt).length>0?String(kt):"-"},tt)})},[l,Et,Je]),re=bn({appId:t,tableKey:r,title:n,columns:Lt,rows:vt,rowKey:"id",page:p,rowsPerPage:f,rowsPerPageOptions:b,count:m??vt.length,onPageChange:v,onRowsPerPageChange:y,showSummary:false,layout:k,onLayoutSave:D}),nt=t?e(fn,{appId:t,tableKey:r,currentLayoutData:re.currentLayoutData,onLayoutLoad:re.handleLayoutLoad,targetLayoutId:re.layoutIdToLoad,activeLayoutId:re.currentLayoutId,serviceUrl:o}):null,Be=re.visibleRows;Jt.useEffect(()=>{let H=Le.map(j=>j.id);Ve(j=>{let me=new Set(H),Se=j.filter(ft=>me.has(ft)),tt=new Set(Se),Xe=H.filter(ft=>!tt.has(ft)),It=[...Se,...Xe];return It.length===j.length&&It.every((ft,gt)=>ft===j[gt])?j:It});},[Le]),Jt.useEffect(()=>{S===void 0||!I||Te.current!==S&&(Te.current=S,re.handleVariantLoad(I));},[re,I,S]),Jt.useEffect(()=>{E?.(re.currentLayoutId);},[re.currentLayoutId,E]);let ce=H=>H.type==="group"?`group-${H.id}`:`row-${(H.data||H)?.id}`,fe=Jt.useMemo(()=>{let H=vt.map(gt=>ro__default.default(gt.startDate)),j=vt.map(gt=>ro__default.default(gt.endDate)),me=g?ro__default.default(g):H.reduce((gt,kt)=>kt.isBefore(gt)?kt:gt,H[0]??ro__default.default()),Se=x?ro__default.default(x):j.reduce((gt,kt)=>kt.isAfter(gt)?kt:gt,j[0]??ro__default.default().add(30,"day")),tt=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",Xe=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",It=d==="hour"?12:1,ft=d==="hour"?12:1;return {start:Dg(me.subtract(It,tt),d),end:Ng(Se.add(ft,Xe),d)}},[vt,d,x,g]),ee=ac.find(H=>H.value===d)??ac[1],Ie=Array.isArray(a)?a:a?[a]:[],Re=Jt.useMemo(()=>d0(fe.start,fe.end,d),[fe.end,fe.start,d]),je=Re.length*ee.width,mt=Re.length>0?100/Re.length:100,pt=Re.length>0?`repeat(${Re.length}, minmax(${ee.width}px, 1fr))`:"1fr",Ot=Re.length>0?`calc(100% / ${Re.length}) 100%`:"100% 100%",Kt=(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),yt=V==="manual"&&$!==null?$:Kt,bt=Z==="table",xr=Z==="timeline",Tt=Z==="timeline",Ft=Z==="table",ut=!Tt&&!Ft,Bt=()=>{let H=ge||F.current?.clientWidth||0;return H>0?Math.max(lc,H-Sa-i0):Math.max(lc,Kt)},we=H=>Math.min(Math.max(H,lc),Bt()),Y=(()=>{if(ge<=0)return null;let H=ut?Sa:0;if(bt)return {tableWidth:ge,splitterWidth:H,timelineWidth:0};if(xr)return {tableWidth:0,splitterWidth:H,timelineWidth:ge};if(V==="even"){let me=Math.max(0,(ge-H)/2);return {tableWidth:me,splitterWidth:H,timelineWidth:Math.max(0,ge-H-me)}}let j=we(yt);return {tableWidth:j,splitterWidth:H,timelineWidth:Math.max(0,ge-H-j)}})(),te=Y?`${Y.tableWidth}px ${Y.splitterWidth}px ${Y.timelineWidth}px`:bt?"minmax(0, 1fr) 0px 0px":xr?"0px 0px minmax(0, 1fr)":V==="even"?`minmax(0, 1fr) ${Sa}px minmax(0, 1fr)`:`${yt}px ${Sa}px minmax(0, 1fr)`;Jt.useEffect(()=>{V==="manual"&&_(H=>H===null?null:we(H));},[V,Kt,ge]);let Ne=H=>{H.preventDefault(),H.currentTarget.setPointerCapture(H.pointerId),Q(null),B("manual"),ye.current={startX:H.clientX,startWidth:q.current?.getBoundingClientRect().width??yt};let j=Se=>{let tt=ye.current;if(!tt)return;let Xe=we(tt.startWidth+Se.clientX-tt.startX);_(Xe);},me=()=>{ye.current=null,window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",me),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",j),window.addEventListener("pointerup",me);},he=()=>{Q(null),B("even"),_(null);},Ae=H=>!P||!H?false:St.get(H)?.reorderable!==false,Ke=(H,j)=>{if(!H||!j||H===j||!Ae(H)||!Ae(j))return false;if(re.grouping.length===0)return true;let me=St.get(H),Se=St.get(j);return !me||!Se?false:re.grouping.every(tt=>me[tt]===Se[tt])},et=(H,j)=>{if(!Ke(H,j))return;let me=Be.filter(Ht=>Ht.type!=="group").map(Ht=>String((Ht.data||Ht)?.id)),Se=me.indexOf(H),tt=me.indexOf(j);if(Se<0||tt<0)return;let Xe=[...me];[Xe[Se],Xe[tt]]=[Xe[tt],Xe[Se]];let It=new Set(me),ft=st.map(Ht=>Ht.id),gt=[...Xe,...ft.filter(Ht=>!It.has(Ht))],kt=Je.get(H),nr=Je.get(j);if(re.setOrder("asc"),re.setOrderBy(""),Ve(gt),kt&&nr){let{level:Ht,...Yt}=kt,{level:Vt,...qt}=nr,$t=gt.reduce((rr,ar)=>{let gr=Je.get(ar);if(gr){let{level:Ir,...Rr}=gr;rr.push(Rr);}return rr},[]);w?.($t,{activeTask:Yt,targetTask:qt});}},qe=(H,j)=>{if(!Ae(j.id)){H.preventDefault();return}H.stopPropagation(),H.dataTransfer.effectAllowed="move",H.dataTransfer.setData("text/plain",j.id),We({activeId:j.id,overId:null}),C?.(Je.get(j.id)||j);},Ct=(H,j)=>{if(!Ke(xe.activeId,j)){We(me=>me.overId===null?me:{...me,overId:null});return}H.preventDefault(),H.stopPropagation(),H.dataTransfer.dropEffect="move",We(me=>me.overId===j?me:{...me,overId:j});},Nt=(H,j)=>{let me=xe.activeId||H.dataTransfer.getData("text/plain");if(!Ke(me,j)){We({activeId:null,overId:null});return}H.preventDefault(),H.stopPropagation(),et(me,j),We({activeId:null,overId:null});},wt=()=>{We({activeId:null,overId:null});},xt=H=>{if(X.current)return;let j=H==="table"?q.current:z.current,me=H==="table"?z.current:q.current;!j||!me||(X.current=true,me.scrollTop=j.scrollTop,window.requestAnimationFrame(()=>{X.current=false;}));};return Jt.useLayoutEffect(()=>{let H=F.current;if(!H){se(0);return}let j=0,me=()=>{window.cancelAnimationFrame(j),j=window.requestAnimationFrame(()=>{let tt=H.clientWidth;se(Xe=>Math.abs(Xe-tt)<.5?Xe:tt);});};if(me(),typeof ResizeObserver>"u")return window.addEventListener("resize",me),()=>{window.cancelAnimationFrame(j),window.removeEventListener("resize",me);};let Se=new ResizeObserver(me);return Se.observe(H),window.addEventListener("resize",me),()=>{window.cancelAnimationFrame(j),Se.disconnect(),window.removeEventListener("resize",me);}},[vt.length]),Jt.useLayoutEffect(()=>{if(!h||Ft)return;let H=z.current,j=q.current;if(!H)return;let me=`row-${h}`,Se=Array.from(H.querySelectorAll("[data-planning-timeline-row-key]")).find(It=>It.dataset.planningTimelineRowKey===me),tt=St.get(h);if(!Se||!tt)return;let Xe=window.requestAnimationFrame(()=>{let It=H.getBoundingClientRect(),ft=Se.getBoundingClientRect(),gt=Math.max(1,H.clientHeight-_e),kt=H.scrollTop+ft.top-It.top-_e-(gt-ft.height)/2;X.current=true,H.scrollTop=Math.max(0,kt),j&&!Tt&&(j.scrollTop=H.scrollTop);let nr=Math.max(1,H.scrollWidth),Ht=Re.length>0?nr/Re.length:ee.width,Yt=cc(ro__default.default(tt.startDate),Re,Ht),Vt=Math.max(0,Yt-Ht);H.scrollLeft=Math.min(Vt,Math.max(0,nr-H.clientWidth)),window.requestAnimationFrame(()=>{X.current=false;});});return ()=>window.cancelAnimationFrame(Xe)},[ee.width,_e,h,Tt,St,Ft,Be,Re]),Jt.useLayoutEffect(()=>{let H=q.current;if(!H)return;let j=0,me=0,Se=false,tt=()=>{if(Se)return;let Vt=H.querySelector("thead"),qt=Array.from(H.querySelectorAll("tbody tr[data-ctable-row-key]"));if(qt.length===0)return;let $t=Vt?.getBoundingClientRect().height||ic,rr={};qt.forEach(ar=>{let gr=ar.dataset.ctableRowKey;gr&&(rr[gr]=ar.getBoundingClientRect().height);}),De(ar=>Math.abs(ar-$t)<.01?ar:$t),be(ar=>{let gr=Object.keys(ar),Ir=Object.keys(rr);return gr.length===Ir.length&&Ir.every(Rr=>Math.abs((ar[Rr]??0)-rr[Rr])<.01)?ar:rr});},Xe=()=>{window.cancelAnimationFrame(j),j=window.requestAnimationFrame(tt);};if(tt(),window.cancelAnimationFrame(me),me=window.requestAnimationFrame(()=>{me=window.requestAnimationFrame(tt);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{Se||Xe();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",Xe),()=>{Se=true,window.cancelAnimationFrame(j),window.cancelAnimationFrame(me),window.removeEventListener("resize",Xe);};let It=new ResizeObserver(Xe),ft=H.querySelector("table"),gt=H.querySelector("tbody"),kt=H.querySelector("thead");ft&&It.observe(ft),kt&&It.observe(kt);let nr=new WeakSet,Ht=()=>{H.querySelectorAll("tbody tr[data-ctable-row-key]").forEach(Vt=>{nr.has(Vt)||(It.observe(Vt),nr.add(Vt));});};Ht();let Yt=null;return gt&&typeof MutationObserver<"u"&&(Yt=new MutationObserver(()=>{Ht(),Xe();}),Yt.observe(gt,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",Xe),()=>{Se=true,window.cancelAnimationFrame(j),window.cancelAnimationFrame(me),It.disconnect(),Yt?.disconnect(),window.removeEventListener("resize",Xe);}},[Be,re.visibleColumns,re.grouping,re.columnWidths]),c(Ee,{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 ${N.palette.divider}`,...A},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}),Ie.length>0&&e("div",{className:"orb-table-toolbar-custom",children:Ie.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:dr,children:e(sn,{fontSize:"small"})}),e(ae,{className:"orb-table-tool-button",tooltip:"Group by",onClick:H=>re.setGroupAnchorEl(H.currentTarget),sx:dr,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:()=>U(true),sx:dr,children:e(dp,{fontSize:"small"})})]}),nt&&e("div",{className:"orb-table-tool-group",children:nt}),e("div",{className:"orb-table-tool-group orb-planning-pane-controls",children:e($n,{"aria-label":"Planning pane layout",size:"small",value:Z??(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"?he():Q(H);}})}),e("div",{className:"orb-table-tool-group orb-planning-scale-control",children:e(Wt,{label:"",value:d,options:ac.map(H=>({value:H.value,label:H.label})),onChange:H=>u?.(H.target.value)})})]})]})}),vt.length===0?e("div",{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:R}):e("div",{sx:{overflow:"hidden",flex:1,minHeight:0},children:c("div",{ref:F,sx:{height:"100%",display:"grid",gridTemplateColumns:te,minWidth:0,transition:`grid-template-columns ${Uo}`},children:[e("div",{"data-planning-scroll-pane":"table",ref:q,onScroll:()=>xt("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:i,overflowX:"auto",overflowY:"auto",opacity:Tt?0:1,transform:Tt?"translateX(-10px)":"translateX(0)",pointerEvents:Tt?"none":"auto",transition:`opacity ${Uo}, transform ${Uo}`},children:e(core.DndContext,{sensors:Fe,collisionDetection:core.closestCenter,modifiers:[modifiers.restrictToHorizontalAxis],onDragEnd:H=>{let j=H?.active?.id,me=H?.over?.id;typeof j=="string"&&typeof me=="string"&&re.handleColumnReorder(j,me);},children:c("table",{className:"orb-tbl orb-ctable orb-planning-table",sx:{tableLayout:"fixed",width:Kt,"& thead th":{height:ic,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(),it({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:Be,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:R,handleClick:(H,j)=>{C?.(Je.get(j.id)||j);},getRowDataKey:({entry:H})=>ce(H),getGroupRowProps:()=>({style:{height:sc}}),getRowProps:({data:H})=>{let j=H,me=Ae(j.id),Se=xe.activeId===j.id,tt=xe.overId===j.id&&Ke(xe.activeId,j.id);return {draggable:me,className:tt?"orb-is-drop-target":void 0,style:{cursor:Se?"grabbing":me?"grab":C?"pointer":"default",height:sc,opacity:Se?.56:1,transition:"background-color 120ms ease, opacity 120ms ease"},onDragStart:Xe=>qe(Xe,j),onDragOver:Xe=>Ct(Xe,j.id),onDragEnter:Xe=>Ct(Xe,j.id),onDrop:Xe=>Nt(Xe,j.id),onDragEnd:wt}}})]})})}),e("div",{onPointerDown:ut?Ne:void 0,role:"separator","aria-orientation":"vertical",sx:{width:ut?Sa:0,cursor:ut?"col-resize":"default",opacity:ut?1:0,pointerEvents:ut?"auto":"none",borderLeft:ut?`1px solid ${N.palette.divider}`:"0 solid transparent",borderRight:ut?`1px solid ${N.palette.divider}`:"0 solid transparent",backgroundColor:ht()==="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:N.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:ut?"col-resize":"default"}}}),e("div",{sx:{minWidth:0,overflow:"hidden",opacity:Ft?0:1,transform:Ft?"translateX(10px)":"translateX(0)",pointerEvents:Ft?"none":"auto",transition:`opacity ${Uo}, transform ${Uo}`},children:e("div",{"data-planning-scroll-pane":"timeline",ref:z,onScroll:()=>xt("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 ${N.palette.divider}`,position:"sticky",top:0,zIndex:2},children:Re.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 ${N.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:Be.map(H=>{let j=ce(H),me=le[j]??sc;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:me,boxSizing:"border-box",borderBottom:`1px solid ${N.palette.divider}`}},H.id);let Se=H.data||H,tt=ro__default.default(Se.startDate),Xe=ro__default.default(Se.endDate),It=cc(tt,Re,mt),ft=cc(Xe,Re,mt),gt=Math.max(0,ft-It),kt=Rg(Se.progress),nr=Se.id===h,Ht=Ae(Se.id),Yt=xe.activeId===Se.id,Vt=xe.overId===Se.id&&Ke(xe.activeId,Se.id),qt=Se.color??(Se.statusTone==="blocked"?N.palette.error.main:N.palette.primary.main);return e("div",{className:`orb-planning-timeline-row ${nr?"orb-is-selected":""}`,"data-planning-timeline-row-key":j,draggable:Ht,onDragStart:$t=>qe($t,Se),onDragOver:$t=>Ct($t,Se.id),onDragEnter:$t=>Ct($t,Se.id),onDrop:$t=>Nt($t,Se.id),onDragEnd:wt,onClick:()=>C?.(Je.get(Se.id)||Se),sx:{position:"relative",height:me,boxSizing:"border-box",borderBottom:`1px solid ${N.palette.divider}`,opacity:Yt?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:N.palette.primary.main,opacity:Vt?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:ht()==="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:Ot,cursor:Yt?"grabbing":Ht?"grab":C?"pointer":"default",transition:"opacity 120ms ease"},children:e(lt,{title:`${Se.title}: ${tt.format("MMM D HH:mm")} - ${Xe.format("MMM D HH:mm")}`,children:c("div",{sx:{position:"absolute",left:`${It}%`,top:Math.max(8,(me-24)/2),width:`max(18px, ${gt}%)`,height:24,borderRadius:999,overflow:"hidden",backgroundColor:ht()==="dark"?"color-mix(in oklch, var(--orb-muted) 18%, transparent)":"color-mix(in oklch, var(--orb-fg) 10%, transparent)",outline:nr?`2px solid ${N.palette.warning.main}`:"none",outlineOffset:2},children:[e("div",{sx:{height:"100%",width:`${kt}%`,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:Se.code})]})})},Se.id)})})]})})})]})}),e(dn,{groupAnchorEl:re.groupAnchorEl,setGroupAnchorEl:re.setGroupAnchorEl,grouping:re.grouping,setGrouping:re.setGrouping,columns:re.columns}),e(pn,{anchorEl:re.anchorEl,setAnchorEl:re.setAnchorEl,columns:re.columns,visibleColumns:re.visibleColumns,toggleColumnVisibility:re.toggleColumnVisibility}),e(Rp,{contextMenu:ot,handleClose:()=>it(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(me=>me.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:()=>U(true)}),e(Mp,{open:Ze,onClose:()=>U(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("");}})]})};T();var _z=({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(Ag,{...r,bodyHeight:r.bodyHeight??"100%",sx:s})}),a]})};T();var Eg=640,p0=360,u0=360,Ns=8,An="220ms cubic-bezier(0.2, 0, 0, 1)",uc=(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,...uc(i,r,o+1,[...n,a.id])]:s}),Og=t=>t.flatMap(r=>[r,...Og(r.children??[])]),Fg=(t,r=0,o=[])=>t.flatMap(n=>{let a=n.children??[];return [{node:n,level:r,hasChildren:a.length>0,parentIds:o},...Fg(a,r+1,[...o,n.id])]}),Bg=t=>t.flatMap(r=>{let o=r.children??[];return o.length===0?[]:[r.id,...Bg(o)]}),Lg=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(),tV=({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=p0,minDetailPaneWidth:m=u0,tableAppId:v="ctree-comp",tableKey:y="default",tableTitle:g,filterConfig:x,searchQuery:h,searchToken:C,defaultRowsPerPage:P=-1,rowsPerPageOptions:w=[20,50,100,-1],serviceUrl:k,emptyLabel:I="No tree items available.",headerAction:S,sx:E,className:D})=>{let R=sr(),A=Jt.useRef(null),N=Jt.useRef(null),O=Jt.useRef(null),[F,q]=Jt.useState(s??o[0]?.id??null),[z,X]=Jt.useState(u??Bg(o).slice(0,3)),[$,_]=Jt.useState(f),[V,B]=Jt.useState(Eg),[Z,Q]=Jt.useState(0),[ge,se]=Jt.useState(0),[le,be]=Jt.useState(P),_e=Jt.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]),De=Jt.useMemo(()=>new Set(d??z),[d,z]),Pe=Jt.useMemo(()=>uc(o,De),[o,De]),Ve=Jt.useMemo(()=>Og(o),[o]),Te=Jt.useMemo(()=>Fg(o),[o]),xe=i===void 0?F:i,We=Jt.useMemo(()=>Ve.find(ce=>ce.id===xe)??null,[xe,Ve]),ot=ce=>{let fe=N.current?.clientWidth??0,ee=fe>0?Math.max(b,fe-Ns-m):Math.max(b,ce);return Math.min(Math.max(ce,b),ee)},it=$==="detail",Ze=$==="tree"||!a,U=$==="split"&&!!a,ye=(()=>{if(Z<=0)return null;if($==="tree"||!a)return {treeWidth:Z,splitterWidth:0,detailWidth:0};if($==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:Z};let ce=U?Ns:0,fe=ot(V);return {treeWidth:fe,splitterWidth:ce,detailWidth:Math.max(0,Z-ce-fe)}})(),Le=ye?`${ye.treeWidth}px ${ye.splitterWidth}px ${ye.detailWidth}px`:$==="tree"||!a?"minmax(0, 1fr) 0px 0px":$==="detail"?"0px 0px minmax(0, 1fr)":`minmax(${b}px, ${V}px) ${Ns}px minmax(${m}px, 1fr)`;Jt.useEffect(()=>{let ce=N.current;if(!ce){Q(0);return}let fe=0,ee=()=>{window.cancelAnimationFrame(fe),fe=window.requestAnimationFrame(()=>{let Re=ce.clientWidth;Q(je=>Math.abs(je-Re)<.5?je:Re);});};if(ee(),typeof ResizeObserver>"u")return window.addEventListener("resize",ee),()=>{window.cancelAnimationFrame(fe),window.removeEventListener("resize",ee);};let Ie=new ResizeObserver(ee);return Ie.observe(ce),window.addEventListener("resize",ee),()=>{window.cancelAnimationFrame(fe),Ie.disconnect(),window.removeEventListener("resize",ee);}},[]);let st=ce=>{d===void 0&&X(ce),p?.(ce);},Je=ce=>{let fe=new Set(De);fe.has(ce)?fe.delete(ce):fe.add(ce),st(Array.from(fe));},vt=ce=>{i===void 0&&q(ce.id),l?.(ce);};Jt.useEffect(()=>{se(0);},[o]),Jt.useEffect(()=>{let ce=h?.trim().toLowerCase();if(!ce)return;let fe=Te.find(({node:pt})=>Lg(pt).includes(ce));if(!fe)return;let ee=new Set(De);fe.parentIds.forEach(pt=>ee.add(pt)),st(Array.from(ee)),vt(fe.node);let Re=uc(o,ee).findIndex(({node:pt})=>pt.id===fe.node.id);Re>=0&&le>0&&se(Math.floor(Re/le));let je=0,mt=0;return je=window.requestAnimationFrame(()=>{mt=window.requestAnimationFrame(()=>{let pt=A.current?.querySelector("tr.orb-selected"),Ot=pt?.closest(".orb-table-container");if(pt&&Ot){let Kt=Ot.getBoundingClientRect(),yt=pt.getBoundingClientRect(),bt=yt.top-Kt.top+Ot.scrollTop;Ot.scrollTo({top:bt-Ot.clientHeight/2+yt.height/2,behavior:"smooth"});return}pt?.scrollIntoView({block:"center",behavior:"smooth"});});}),()=>{window.cancelAnimationFrame(je),window.cancelAnimationFrame(mt);}},[h,C,Te,o,le]);let St=Jt.useMemo(()=>Pe.map(({node:ce,level:fe,hasChildren:ee})=>({...ce,id:ce.id,__node:ce,__level:fe,__hasChildren:ee,__expanded:De.has(ce.id),__searchText:Lg(ce)})),[De,Pe]),Et=Jt.useMemo(()=>_e.map((ce,fe)=>({id:ce.id,label:ce.label,minWidth:typeof ce.width=="number"?ce.width:ce.minWidth??(fe===0?320:120),numeric:ce.numeric??ce.align==="right",render:(ee,Ie)=>{let Re=Ie.__node,je=ce.render?ce.render(Re):Re[ce.id];if(fe!==0)return e(ke,{sx:{minWidth:0,color:ce.align==="right"?"text.primary":"text.secondary",fontWeight:ce.align==="right"?750:500,textAlign:ce.align??"left"},children:je});let mt=Number(Ie.__level??0),pt=!!Ie.__hasChildren,Ot=!!Ie.__expanded;return c(ie,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,pl:`${mt*24}px`},children:[e(ae,{tooltip:pt?Ot?"Collapse":"Expand":"",onClick:Kt=>{Kt.stopPropagation(),pt&&Je(Re.id);},disabled:!pt,sx:{width:24,height:24,visibility:pt?"visible":"hidden",transform:Ot?"rotate(0deg)":"rotate(-90deg)",transition:"transform 160ms ease"},children:e(Vr,{sx:{fontSize:20}})}),e(ke,{sx:{width:10,height:10,borderRadius:"50%",flexShrink:0,backgroundColor:Re.markerColor??R.palette.primary.main}}),e(ke,{sx:{minWidth:0},children:je})]})}})),[_e,De,R.palette.primary.main]),Lt=ce=>{if(!U)return;ce.preventDefault(),ce.currentTarget.setPointerCapture(ce.pointerId),O.current={startX:ce.clientX,startWidth:V};let fe=Ie=>{let Re=O.current;Re&&B(ot(Re.startWidth+Ie.clientX-Re.startX));},ee=()=>{O.current=null,window.removeEventListener("pointermove",fe),window.removeEventListener("pointerup",ee),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",fe),window.addEventListener("pointerup",ee);},re=()=>{let ce=N.current?.clientWidth??0,fe=ce>0?Math.max(b,(ce-Ns)/2):Eg;_("split"),B(ot(fe));},nt=()=>a?typeof a=="function"?a(We):a:null,Be=a?e($n,{"aria-label":"Tree pane layout",value:$,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():_(ce);},sx:{position:"absolute",top:13,right:56,zIndex:3,backdropFilter:"blur(10px)"}}):null;return c(ke,{ref:A,className:["ctree_comp",D].filter(Boolean).join(" "),sx:{position:"relative",height:"100%",minHeight:0,border:`1px solid ${R.palette.divider}`,borderRadius:"var(--orb-r-container)",overflow:"hidden",backgroundColor:"background.paper",boxShadow:`0 18px 42px ${rt(R.palette.common.black,ht()==="dark"?.24:.08)}`,...E},children:[Be,c(ke,{ref:N,sx:{height:"100%",display:"grid",gridTemplateColumns:Le,transition:`grid-template-columns ${An}`,minWidth:0},children:[c(ke,{"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 ${An}, transform ${An}`,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 ${R.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(ke,{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(ke,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[e(Jr,{appId:v,tableKey:y,title:g??(typeof t=="string"?t:"Tree"),columns:Et,rows:St,rowKey:"id",fitContainer:true,fullWidth:true,showSummary:false,selectionMode:"single",selected:xe?[xe]:[],onSelectionChange:ce=>{let fe=ce[ce.length-1],ee=Ve.find(Ie=>Ie.id===fe);ee&&vt(ee);},page:ge,rowsPerPage:le,rowsPerPageOptions:w,count:St.length,onPageChange:se,onRowsPerPageChange:ce=>{se(0),be(ce);},filterConfig:x,serviceUrl:k,graphReport:{enabled:false},disableGrouping:true,disableSorting:true,maxHeight:"100%"}),St.length===0&&e(ke,{sx:{minHeight:220,display:"grid",placeItems:"center",color:"text.secondary"},children:I})]})]}),e(ke,{"data-ctree-splitter":"true",role:"separator","aria-orientation":"vertical",onPointerDown:U?Lt:void 0,sx:{width:"100%",cursor:U?"col-resize":"default",backgroundColor:U?rt(R.palette.text.primary,ht()==="dark"?.16:.08):"transparent",opacity:U?1:0,pointerEvents:U?"auto":"none",position:"relative",transition:`opacity ${An}, background-color 120ms ease`,"&:hover":{backgroundColor:U?rt(R.palette.primary.main,ht()==="dark"?.35:.18):"transparent"}}}),c(ke,{"aria-hidden":Ze?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:Ze?0:1,transform:Ze?"translateX(12px)":"translateX(0)",pointerEvents:Ze?"none":"auto",transition:`opacity ${An}, transform ${An}`,willChange:"opacity, transform"},children:[e(ke,{sx:{px:2,pt:2,minHeight:74,display:"flex",alignItems:"flex-end"},children:e(At,{sx:{width:"100%"}})}),e(ke,{sx:{flex:1,minHeight:0,overflow:"auto",px:2,pb:2},children:nt()})]})]})]})};T();var b0={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)"}}},iV=({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]=Jt.useState("to"),f=!s&&!d&&o!=="none";Jt.useEffect(()=>{if(!f){p("to");return}p("from");let v=requestAnimationFrame(()=>{v=requestAnimationFrame(()=>{p("to");});});return ()=>cancelAnimationFrame(v)},[r,f]);let b=b0[o],m=Jt.useMemo(()=>f?u==="from"?b.from:b.to:{opacity:1,transform:"none"},[f,u,b.from,b.to]);return e(ke,{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})},sV={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};exports.AIBrowserGlow=L5;exports.Activity=kc;exports.AgentPanel=Vm;exports.AlertCircle=Pa;exports.AlertTriangle=Pc;exports.ArrowDown=G0;exports.ArrowRight=_0;exports.ArrowUp=Tc;exports.BarChart=Fs;exports.Bot=U0;exports.Button=_s;exports.CAINavProvider=Ey;exports.CAlert=rn;exports.CAmapChart=Bp;exports.CAppHeader=$i;exports.CAppHeaderSearch=wl;exports.CAppPageLayout=vE;exports.CAuthPage=oz;exports.CAvatar=tn;exports.CBadge=Wa;exports.CBarChart=ta;exports.CButton=Ce;exports.CCalendar=_n;exports.CCardDetailPanel=Qp;exports.CCardGrid=eu;exports.CCardGridCard=Lh;exports.CCardPage=XD;exports.CChartCard=xi;exports.CCheckbox=Dt;exports.CChip=Pt;exports.CComboChart=Ap;exports.CCustomizeAgent=zp;exports.CDatePicker=Qf;exports.CDetailInfoPage=bA;exports.CDetailSearchAiBar=lu;exports.CDetailSectionCard=Bi;exports.CDialog=zt;exports.CDivider=At;exports.CFileUpload=eb;exports.CFilterField=DT;exports.CFishboneChart=Lp;exports.CGoogleMapChart=Fp;exports.CGraphCharts=Hp;exports.CGraphKpiCards=Dp;exports.CGraphReport=Pi;exports.CHeatmapChart=Ep;exports.CIconButton=ae;exports.CKanbanBoard=_A;exports.CKanbanBucket=mu;exports.CKanbanCard=hl;exports.CLayoutManagement=Xp;exports.CLayoutManager=fn;exports.CLineChart=Np;exports.CList=xT;exports.CListItem=ST;exports.CListItemAvatar=IT;exports.CListItemButton=wT;exports.CListItemIcon=kT;exports.CListItemText=PT;exports.CListSubheader=TT;exports.CMenu=jt;exports.CMessageBox=Zn;exports.CMetricChartCard=gs;exports.COrbCanvas=wy;exports.CPageLayout=ui;exports.CPageTransition=iV;exports.CPaper=Ee;exports.CPieChart=Si;exports.CPivotTable=iO;exports.CPlanningGantt=Ag;exports.CPlanningLayout=_z;exports.CPopover=Ws;exports.CProgress=Wn;exports.CRadioGroup=kf;exports.CSegmentedControl=$n;exports.CSelect=Wt;exports.CSkeleton=Nf;exports.CSmartFilter=Wr;exports.CSmartTable=mD;exports.CSpinner=Xr;exports.CStack=ie;exports.CStandardPage=CD;exports.CStatusBadge=vT;exports.CSwitch=Va;exports.CTable=Jr;exports.CTableBody=lD;exports.CTableCell=cD;exports.CTableContainer=dD;exports.CTableHead=pD;exports.CTableRow=uD;exports.CTabs=Xf;exports.CTextArea=Vn;exports.CTextField=ze;exports.CTooltip=lt;exports.CTreeComp=tV;exports.CTypography=L;exports.CValueHelp=xp;exports.CVariantManagement=Mi;exports.CVariantManager=Gp;exports.CVoiceWaveOverlay=El;exports.CWaterfallChart=Op;exports.Calendar=Bs;exports.CalendarDays=K0;exports.Camera=q0;exports.ChartNoAxesCombined=X0;exports.Check=qr;exports.CheckCircle=Ta;exports.ChevronDown=Fr;exports.ChevronLeft=Ia;exports.ChevronRight=Br;exports.ChevronUp=Y0;exports.ChevronsDown=Z0;exports.ChevronsUp=j0;exports.CircleAlert=Ra;exports.CircleCheck=Fn;exports.CircleCheckBig=Q0;exports.CircleStop=Ic;exports.Clipboard=Rc;exports.ClipboardCheck=J0;exports.ClipboardList=eS;exports.Clock=Mc;exports.CodeBlock=sa;exports.Columns3=tS;exports.CopilotChat=N5;exports.Copy=vo;exports.CopyPlus=rS;exports.Delete=oS;exports.Download=nS;exports.Edit=Dc;exports.Expand=Nc;exports.Eye=aS;exports.EyeOff=iS;exports.File=Ma;exports.FileText=Ac;exports.Filter=sS;exports.FloatingAgentPanel=w5;exports.FolderTree=Bn;exports.GitBranch=Ec;exports.GlobalMessage=mT;exports.Globe=Hn;exports.Grid=Lc;exports.GripVertical=lS;exports.Hammer=cS;exports.Image=Oc;exports.Info=Da;exports.InputArea=$l;exports.Languages=dS;exports.Layers=pS;exports.LayoutDashboard=uS;exports.Lightbulb=Na;exports.LineChart=Fc;exports.Loader2=Bc;exports.Lock=Aa;exports.LockKeyhole=mS;exports.LogOut=Hc;exports.METRIC_CHART_TYPES=ms;exports.Mail=Hs;exports.MapPin=zc;exports.MarkdownRenderer=da;exports.MathBlock=la;exports.Menu=gS;exports.MermaidBlock=cl;exports.MessageCircle=sf;exports.MessageSquare=Vc;exports.Mic=Ea;exports.MicOff=fS;exports.Moon=Wc;exports.MoreHorizontal=bS;exports.NavigationIsland=sd;exports.NavigationIsland2=qs;exports.OMPHApprovalCard=Lx;exports.OMPHPanel=u5;exports.ORBCAFE_I18N_MESSAGES=Kn;exports.ORB_DARK=Wg;exports.ORB_FONT_STACK=v0;exports.ORB_LIGHT=Vg;exports.ORB_RADIUS=C0;exports.ORB_TOKENS=Es;exports.ORB_TRANSITION_FAST=x0;exports.OrbcafeI18nProvider=_a;exports.OrbisModeProvider=On;exports.PAGE_TRANSITION_PRESETS=sV;exports.PAppPageLayout=EF;exports.PBarcodeScanner=kO;exports.PNavIsland=lm;exports.PNumericKeypad=zO;exports.PSmartFilter=om;exports.PTable=by;exports.PTouchCard=NO;exports.PWorkloadNav=nm;exports.PackageCheck=hS;exports.PackageSearch=vS;exports.PanelLeftOpen=La;exports.PanelRight=Oa;exports.PanelsTopLeft=yS;exports.PieChart=$c;exports.Pin=Jo;exports.PivotChartPanel=Xu;exports.Play=CS;exports.Plus=Fa;exports.QrCode=xS;exports.ReceiptText=SS;exports.RefreshCw=Ba;exports.Rocket=wS;exports.RotateCcw=kS;exports.RotateCw=Gc;exports.Rows3=PS;exports.SapIcon=Mt;exports.Save=TS;exports.ScanLine=IS;exports.Search=Hr;exports.Send=lf;exports.SendHorizontal=_c;exports.Settings=en;exports.ShieldCheck=RS;exports.Sigma=MS;exports.SortAsc=DS;exports.SquareSplitHorizontal=NS;exports.Star=AS;exports.StdChat=Hm;exports.Sun=Uc;exports.Table2=ES;exports.TableBlock=pl;exports.TabletSmartphone=LS;exports.Terminal=zn;exports.ThinkBlock=Oi;exports.ThumbsDown=Kc;exports.ThumbsUp=qc;exports.Trash2=Xc;exports.TreeMenu=qn;exports.TreePine=OS;exports.TrendingDown=Yc;exports.TriangleAlert=Ha;exports.Truck=FS;exports.UploadCloud=Zc;exports.User=zs;exports.VoiceNavigatorProvider=qF;exports.VoiceWaveOverlay=WF;exports.Volume2=jc;exports.Warehouse=BS;exports.Workflow=HS;exports.X=Zt;exports.XCircle=za;exports.addKanbanBucket=gu;exports.buildAmapEmbedUrl=wi;exports.buildGoogleMapEmbedUrl=ra;exports.buildGoogleMapIframe=nM;exports.buttonVariants=ab;exports.createKanbanBoardModel=bu;exports.createSapIcon=ne;exports.findKanbanCard=Gr;exports.message=aT;exports.messageManager=ao;exports.moveKanbanCard=Vi;exports.orbAlpha=rt;exports.orbChartSeries=y0;exports.parseMarkdownTable=Li;exports.parseOmphFileHref=_l;exports.renameKanbanBucket=fu;exports.renderMarkdown=$N;exports.resolveVariantFilters=Ai;exports.resolveVariantLayout=Ei;exports.useAINav=Ly;exports.useAmapEmbedUrl=lN;exports.useAuthPage=X5;exports.useCardPage=JD;exports.useDetailInfo=du;exports.useGoogleMapEmbedUrl=sN;exports.useGraphChartData=rN;exports.useGraphInteraction=Ii;exports.useGraphReport=un;exports.useKanbanBoard=YA;exports.useMediaQuery=Dr;exports.useNavigationIsland=md;exports.useOrbMode=yr;exports.useOrbTokens=Os;exports.useOrbcafeI18n=pe;exports.usePadLayout=fO;exports.usePadRecordEditor=vO;exports.usePageLayout=wu;exports.usePivotTable=pO;exports.usePlanningGantt=Tg;exports.usePlanningLayout=pz;exports.useStandardReport=TD;exports.useVoiceInput=xn;exports.useVoiceNavigator=XF;
|
|
234
|
+
`,Uz=({active:t=false,colors:r=Zx,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:jx}),e("div",{className:"orbcafe-ai-browser-glow","data-active":t?"true":"false",style:n,"aria-hidden":"true"})]})};var a5=({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 e0={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."},g5=({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(()=>({...e0,...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.");},D=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(zs,{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(zs,{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(Hs,{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:D,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(Hs,{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 r0={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},o0=[{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"}],Rg=({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",D=o??d??"planning",[M,N]=er.useState(n),[E,O]=er.useState(a??t[0]?.id??""),[F,X]=er.useState(""),[H,Y]=er.useState(null),[W,j]=er.useState({...r0,...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]?ro__default.default(le[0]):null,Me=le?.[1]?ro__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=ro__default.default(Pe.startDate),tt=ro__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);},[]),U=er.useCallback(ue=>{X(ue),I?.(ue);},[I]),K=er.useCallback(ue=>{Y(Se=>({key:(Se?.key??0)+1,variant:ue})),k?.(ue);},[k]),fe=er.useMemo(()=>({appId:A,tableKey:D,fields:s??o0,filters:W,onFilterChange:j,onVariantLoad:K,onSearch:C??(()=>{}),currentLayoutId:F,layoutRefs:[{tableKey:D,layoutId:F||null}],variantService:p,serviceUrl:u}),[F,s,W,K,C,A,D,u,p]),se=er.useMemo(()=>({appId:A,tableKey:D,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:H?.variant,layoutVariantLoadKey:H?.key,onLayoutIdChange:U,onLayoutSave:S}),[b,g,w,V,U,f,H?.key,H?.variant,x,h,S,T,z,m,A,D,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 S5=t=>{let r=Rg(t),o=er.useMemo(()=>({filterProps:r.smartFilterProps,ganttProps:r.planningGanttProps}),[r.planningGanttProps,r.smartFilterProps]);return {...r,layoutProps:o}};P();ro__default.default.extend(a0__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,u0=320,Uo="220ms cubic-bezier(0.2, 0, 0, 1)",Dg={"not-started":{label:"Not started",color:"default"},planned:{label:"Planned",color:"info"},"in-progress":{label:"In progress",color:"primary"},blocked:{label:"Blocked",color:"error"},done:{label:"Done",color:"success"}},m0=t=>t?Dg[t]?.label??t:"Planned",g0=t=>t?Dg[t]?.color??"default":"info",Ng=t=>Math.min(100,Math.max(0,t??0)),Ag=(t,r=0)=>t.flatMap(o=>[{...o,level:r},...Ag(o.children??[],r+1)]),f0=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:m0(t.status),statusTone:t.status??"planned",progress:Ng(t.progress),startDate:t.startDate,endDate:t.endDate,color:t.color,reorderable:t.reorderable!==false}),Eg=(t,r)=>r==="month"?t.startOf("month"):r==="week"?t.startOf("week"):r==="day"?t.startOf("day"):t.startOf("hour"),Lg=(t,r)=>r==="month"?t.endOf("month"):r==="week"?t.endOf("week"):r==="day"?t.endOf("day"):t.endOf("hour"),b0=(t,r,o)=>{let n=[],a=Eg(t,o),i=Lg(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},Og=({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:D,emptyLabel:M="No planning tasks available.",sx:N})=>{let E=sr(),{t:O}=pe(),F=er.useRef(null),X=er.useRef(null),H=er.useRef(null),Y=er.useRef(false),[W,j]=er.useState(null),[V,z]=er.useState("content"),[U,K]=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,q]=er.useState(false),De=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:4}})),ye=er.useRef(null),Be=er.useMemo(()=>Ag(s),[s]),at=er.useMemo(()=>{if(le.length===0)return Be;let B=new Map(Be.map(Te=>[Te.id,Te])),J=le.map(Te=>B.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(B=>[B.id,B])),[at]),St=er.useMemo(()=>at.map(B=>f0(B)),[at]),Mt=er.useMemo(()=>new Map(St.map(B=>[B.id,B])),[St]),Ot=er.useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(B,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:(B,J)=>e(xt,{label:J.status,color:g0(J.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:B=>c(ie,{spacing:.6,children:[c(L,{variant:"caption",sx:{color:"text.secondary"},children:[B,"%"]}),e($n,{variant:"determinate",value:B,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 B=new Map(Ot.map(J=>[J.id,J]));return l.map(J=>{let ge=B.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:D}),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 B=Be.map(J=>J.id);Ee(J=>{let ge=new Set(B),Te=J.filter(bt=>ge.has(bt)),et=new Set(Te),Xe=B.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=B=>B.type==="group"?`group-${B.id}`:`row-${(B.data||B)?.id}`,ve=er.useMemo(()=>{let B=St.map(gt=>ro__default.default(gt.startDate)),J=St.map(gt=>ro__default.default(gt.endDate)),ge=g?ro__default.default(g):B.reduce((gt,Ct)=>Ct.isBefore(gt)?Ct:gt,B[0]??ro__default.default()),Te=x?ro__default.default(x):J.reduce((gt,Ct)=>Ct.isAfter(gt)?Ct:gt,J[0]??ro__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:Eg(ge.subtract(kt,et),d),end:Lg(Te.add(bt,Xe),d)}},[St,d,x,g]),te=ic.find(B=>B.value===d)??ic[1],he=Array.isArray(a)?a:a?[a]:[],Ne=er.useMemo(()=>b0(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(B=>re.visibleColumns.includes(B.id)).reduce((B,J)=>B+(re.columnWidths?.[J.id]||J.minWidth||100),0)+(re.grouping.length>0?72:0),Vt=V==="manual"&&W!==null?W:Xt,wt=U==="table",Wt=U==="timeline",ht=U==="timeline",Nt=U==="table",lt=!ht&&!Nt,Ft=()=>{let B=fe||F.current?.clientWidth||0;return B>0?Math.max(cc,B-wa-u0):Math.max(cc,Xt)},Yt=B=>Math.min(Math.max(B,cc),Ft()),$=(()=>{if(fe<=0)return null;let B=lt?wa:0;if(wt)return {tableWidth:fe,splitterWidth:B,timelineWidth:0};if(Wt)return {tableWidth:0,splitterWidth:B,timelineWidth:fe};if(V==="even"){let ge=Math.max(0,(fe-B)/2);return {tableWidth:ge,splitterWidth:B,timelineWidth:Math.max(0,fe-B-ge)}}let J=Yt(Vt);return {tableWidth:J,splitterWidth:B,timelineWidth:Math.max(0,fe-B-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(B=>B===null?null:Yt(B));},[V,Xt,fe]);let be=B=>{B.preventDefault(),B.currentTarget.setPointerCapture(B.pointerId),K(null),z("manual"),ye.current={startX:B.clientX,startWidth:X.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=()=>{K(null),z("even"),j(null);},Le=B=>!k||!B?false:Mt.get(B)?.reorderable!==false,_e=(B,J)=>{if(!B||!J||B===J||!Le(B)||!Le(J))return false;if(re.grouping.length===0)return true;let ge=Mt.get(B),Te=Mt.get(J);return !ge||!Te?false:re.grouping.every(et=>ge[et]===Te[et])},qe=(B,J)=>{if(!_e(B,J))return;let ge=Fe.filter(Et=>Et.type!=="group").map(Et=>String((Et.data||Et)?.id)),Te=ge.indexOf(B),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(B),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=(B,J)=>{if(!Le(J.id)){B.preventDefault();return}B.stopPropagation(),B.dataTransfer.effectAllowed="move",B.dataTransfer.setData("text/plain",J.id),Ve({activeId:J.id,overId:null}),C?.(Ze.get(J.id)||J);},mt=(B,J)=>{if(!_e(Pe.activeId,J)){Ve(ge=>ge.overId===null?ge:{...ge,overId:null});return}B.preventDefault(),B.stopPropagation(),B.dataTransfer.dropEffect="move",Ve(ge=>ge.overId===J?ge:{...ge,overId:J});},ft=(B,J)=>{let ge=Pe.activeId||B.dataTransfer.getData("text/plain");if(!_e(ge,J)){Ve({activeId:null,overId:null});return}B.preventDefault(),B.stopPropagation(),qe(ge,J),Ve({activeId:null,overId:null});},Rt=()=>{Ve({activeId:null,overId:null});},yt=B=>{if(Y.current)return;let J=B==="table"?X.current:H.current,ge=B==="table"?H.current:X.current;!J||!ge||(Y.current=true,ge.scrollTop=J.scrollTop,window.requestAnimationFrame(()=>{Y.current=false;}));};return er.useLayoutEffect(()=>{let B=F.current;if(!B){se(0);return}let J=0,ge=()=>{window.cancelAnimationFrame(J),J=window.requestAnimationFrame(()=>{let et=B.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(B),window.addEventListener("resize",ge),()=>{window.cancelAnimationFrame(J),Te.disconnect(),window.removeEventListener("resize",ge);}},[St.length]),er.useLayoutEffect(()=>{if(!h||Nt)return;let B=H.current,J=X.current;if(!B)return;let ge=`row-${h}`,Te=Array.from(B.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=B.getBoundingClientRect(),bt=Te.getBoundingClientRect(),gt=Math.max(1,B.clientHeight-$e),Ct=B.scrollTop+bt.top-kt.top-$e-(gt-bt.height)/2;Y.current=true,B.scrollTop=Math.max(0,Ct),J&&!ht&&(J.scrollTop=B.scrollTop);let nr=Math.max(1,B.scrollWidth),Et=Ne.length>0?nr/Ne.length:te.width,Zt=dc(ro__default.default(et.startDate),Ne,Et),Ht=Math.max(0,Zt-Et);B.scrollLeft=Math.min(Ht,Math.max(0,nr-B.clientWidth)),window.requestAnimationFrame(()=>{Y.current=false;});});return ()=>window.cancelAnimationFrame(Xe)},[te.width,$e,h,ht,Mt,Nt,Fe,Ne]),er.useLayoutEffect(()=>{let B=X.current;if(!B)return;let J=0,ge=0,Te=false,et=()=>{if(Te)return;let Ht=B.querySelector("thead"),Kt=Array.from(B.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=B.querySelector("table"),gt=B.querySelector("tbody"),Ct=B.querySelector("thead");bt&&kt.observe(bt),Ct&&kt.observe(Ct);let nr=new WeakSet,Et=()=>{B.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:B=>{re.setFilterText(B),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((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(ae,{className:"orb-table-tool-button",tooltip:"Column visibility",onClick:B=>re.setAnchorEl(B.currentTarget),sx:pr,children:e(ln,{fontSize:"small"})}),e(ae,{className:"orb-table-tool-button",tooltip:"Group by",onClick:B=>re.setGroupAnchorEl(B.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:()=>q(true),sx:pr,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(_n,{"aria-label":"Planning pane layout",size:"small",value:U??(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:B=>{B==="split"?Ce():K(B);}})}),e("div",{className:"orb-table-tool-group orb-planning-scale-control",children:e(zt,{label:"",value:d,options:ic.map(B=>({value:B.value,label:B.label})),onChange:B=>u?.(B.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:X,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:B=>{let J=B?.active?.id,ge=B?.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:(B,J)=>{B.preventDefault(),B.stopPropagation(),nt({mouseX:B.clientX+2,mouseY:B.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:(B,J)=>{C?.(Ze.get(J.id)||J);},getRowDataKey:({entry:B})=>ce(B),getGroupRowProps:()=>({style:{height:lc}}),getRowProps:({data:B})=>{let J=B,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:H,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(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(ie,{sx:{position:"relative"},children:Fe.map(B=>{let J=ce(B),ge=ue[J]??lc;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:ge,boxSizing:"border-box",borderBottom:`1px solid ${E.palette.divider}`}},B.id);let Te=B.data||B,et=ro__default.default(Te.startDate),Xe=ro__default.default(Te.endDate),kt=dc(et,Ne,st),bt=dc(Xe,Ne,st),gt=Math.max(0,bt-kt),Ct=Ng(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(Rp,{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:B=>{re.applyMultiSort([{field:B,direction:"asc"}]);},onSortDesc:B=>{re.applyMultiSort([{field:B,direction:"desc"}]);},onClearSort:B=>{let J=re.sortBy.filter(ge=>ge.field!==B);J.length>0?re.applyMultiSort(J):(re.clearMultiSort(),re.orderBy===B&&re.setOrderBy(""));},onHideColumn:B=>{re.visibleColumns.includes(B)&&re.toggleColumnVisibility(B);},onToggleGroup:B=>re.toggleGroupField(B),onToggleSummary:B=>re.toggleSummaryColumn(B),onOpenSortDialog:()=>q(true)}),e(Dp,{open:it,onClose:()=>q(false),columns:re.columns,initialRules:re.sortBy.length>0?re.sortBy:re.orderBy?[{field:re.orderBy,direction:re.order}]:[],onApply:B=>re.applyMultiSort(B),onClear:()=>{re.clearMultiSort(),re.setOrderBy("");}})]})};P();var tV=({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(Og,{...r,bodyHeight:r.bodyHeight??"100%",sx:s})}),a]})};P();var Fg=640,h0=360,v0=360,Ns=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}),Hg=t=>t.flatMap(r=>[r,...Hg(r.children??[])]),zg=(t,r=0,o=[])=>t.flatMap(n=>{let a=n.children??[];return [{node:n,level:r,hasChildren:a.length>0,parentIds:o},...zg(a,r+1,[...o,n.id])]}),Vg=t=>t.flatMap(r=>{let o=r.children??[];return o.length===0?[]:[r.id,...Vg(o)]}),Bg=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(),uV=({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=h0,minDetailPaneWidth:m=v0,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:D})=>{let M=sr(),N=er.useRef(null),E=er.useRef(null),O=er.useRef(null),[F,X]=er.useState(s??o[0]?.id??null),[H,Y]=er.useState(u??Vg(o).slice(0,3)),[W,j]=er.useState(f),[V,z]=er.useState(Fg),[U,K]=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??H),[d,H]),le=er.useMemo(()=>mc(o,ke),[o,ke]),Ee=er.useMemo(()=>Hg(o),[o]),Me=er.useMemo(()=>zg(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-Ns-m):Math.max(b,ce);return Math.min(Math.max(ce,b),te)},nt=W==="detail",it=W==="tree"||!a,q=W==="split"&&!!a,ye=(()=>{if(U<=0)return null;if(W==="tree"||!a)return {treeWidth:U,splitterWidth:0,detailWidth:0};if(W==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:U};let ce=q?Ns:0,ve=tt(V);return {treeWidth:ve,splitterWidth:ce,detailWidth:Math.max(0,U-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) ${Ns}px minmax(${m}px, 1fr)`;er.useEffect(()=>{let ce=E.current;if(!ce){K(0);return}let ve=0,te=()=>{window.cancelAnimationFrame(ve),ve=window.requestAnimationFrame(()=>{let Ne=ce.clientWidth;K(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&&X(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})=>Bg(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:Bg(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(!q)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-Ns)/2):Fg;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",D].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:q?At:void 0,sx:{width:"100%",cursor:q?"col-resize":"default",backgroundColor:q?rt(M.palette.text.primary,vt()==="dark"?.16:.08):"transparent",opacity:q?1:0,pointerEvents:q?"auto":"none",position:"relative",transition:`opacity ${En}, background-color 120ms ease`,"&:hover":{backgroundColor:q?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 S0={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)"}}},hV=({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=S0[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})},vV={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};exports.AIBrowserGlow=Uz;exports.Activity=Pc;exports.AgentPanel=Wm;exports.AlertCircle=Ta;exports.AlertTriangle=Tc;exports.ArrowDown=Y0;exports.ArrowRight=Z0;exports.ArrowUp=Ic;exports.BarChart=Fs;exports.Bot=j0;exports.Button=Gs;exports.CAINavProvider=Fy;exports.CAlert=on;exports.CAmapChart=Hp;exports.CAppHeader=$i;exports.CAppHeaderSearch=wl;exports.CAppPageLayout=kE;exports.CAuthPage=g5;exports.CAvatar=rn;exports.CBadge=Wa;exports.CBarChart=ra;exports.CButton=we;exports.CCalendar=Un;exports.CCardDetailPanel=Jp;exports.CCardGrid=tu;exports.CCardGridCard=Bh;exports.CCardPage=eN;exports.CChartCard=xi;exports.CCheckbox=It;exports.CChip=xt;exports.CComboChart=Ep;exports.CCustomizeAgent=Vp;exports.CDatePicker=tb;exports.CDetailInfoPage=SA;exports.CDetailSearchAiBar=cu;exports.CDetailSectionCard=Bi;exports.CDialog=Lt;exports.CDivider=Dt;exports.CFileUpload=ob;exports.CFilterField=OT;exports.CFishboneChart=Op;exports.CGoogleMapChart=Bp;exports.CGraphCharts=zp;exports.CGraphKpiCards=Np;exports.CGraphReport=Pi;exports.CHeatmapChart=Lp;exports.CIconButton=ae;exports.CKanbanBoard=ZA;exports.CKanbanBucket=gu;exports.CKanbanCard=hl;exports.CLayoutManagement=Yp;exports.CLayoutManager=bn;exports.CLineChart=Ap;exports.CList=TT;exports.CListItem=IT;exports.CListItemAvatar=AT;exports.CListItemButton=MT;exports.CListItemIcon=RT;exports.CListItemText=DT;exports.CListSubheader=NT;exports.CMenu=Qt;exports.CMessageBox=jn;exports.CMetricChartCard=gs;exports.COrbCanvas=Ty;exports.CPageLayout=ui;exports.CPageTransition=hV;exports.CPaper=Ae;exports.CPieChart=Si;exports.CPivotTable=uO;exports.CPlanningGantt=Og;exports.CPlanningLayout=tV;exports.CPopover=Ws;exports.CProgress=$n;exports.CRadioGroup=If;exports.CSegmentedControl=_n;exports.CSelect=zt;exports.CSkeleton=Lf;exports.CSmartFilter=Wr;exports.CSmartTable=yD;exports.CSpinner=Xr;exports.CStack=ie;exports.CStandardPage=TD;exports.CStatusBadge=wT;exports.CSwitch=Va;exports.CTable=Jr;exports.CTableBody=gD;exports.CTableCell=fD;exports.CTableContainer=bD;exports.CTableHead=hD;exports.CTableRow=vD;exports.CTabs=jf;exports.CTextArea=Wn;exports.CTextField=ze;exports.CTooltip=ct;exports.CTreeComp=uV;exports.CTypography=L;exports.CValueHelp=Sp;exports.CVariantManagement=Ri;exports.CVariantManager=Gp;exports.CVoiceWaveOverlay=El;exports.CWaterfallChart=Fp;exports.Calendar=Bs;exports.CalendarDays=Q0;exports.Camera=J0;exports.ChartNoAxesCombined=eS;exports.Check=qr;exports.CheckCircle=Ia;exports.ChevronDown=Fr;exports.ChevronLeft=Ma;exports.ChevronRight=Br;exports.ChevronUp=tS;exports.ChevronsDown=rS;exports.ChevronsUp=oS;exports.CircleAlert=Ra;exports.CircleCheck=Bn;exports.CircleCheckBig=nS;exports.CircleStop=Mc;exports.Clipboard=Rc;exports.ClipboardCheck=aS;exports.ClipboardList=iS;exports.Clock=Dc;exports.CodeBlock=la;exports.Columns3=sS;exports.CopilotChat=$z;exports.Copy=vo;exports.CopyPlus=lS;exports.Delete=cS;exports.Download=dS;exports.Edit=Nc;exports.Expand=Ac;exports.Eye=pS;exports.EyeOff=uS;exports.File=Da;exports.FileText=Ec;exports.Filter=mS;exports.FloatingAgentPanel=Lz;exports.FolderTree=Hn;exports.GitBranch=Lc;exports.GlobalMessage=vT;exports.Globe=zn;exports.Grid=Oc;exports.GripVertical=gS;exports.Hammer=fS;exports.Image=Fc;exports.Info=Na;exports.InputArea=$l;exports.Languages=bS;exports.Layers=hS;exports.LayoutDashboard=vS;exports.Lightbulb=Aa;exports.LineChart=Bc;exports.Loader2=Hc;exports.Lock=Ea;exports.LockKeyhole=yS;exports.LogOut=zc;exports.METRIC_CHART_TYPES=ms;exports.Mail=Hs;exports.MapPin=Vc;exports.MarkdownRenderer=pa;exports.MathBlock=ca;exports.Menu=Wc;exports.MermaidBlock=cl;exports.MessageCircle=df;exports.MessageSquare=$c;exports.Mic=La;exports.MicOff=CS;exports.Moon=_c;exports.MoreHorizontal=xS;exports.NavigationIsland=cd;exports.NavigationIsland2=qs;exports.OMPHApprovalCard=Vx;exports.OMPHPanel=wz;exports.ORBCAFE_I18N_MESSAGES=qn;exports.ORB_DARK=Gg;exports.ORB_FONT_STACK=k0;exports.ORB_LIGHT=_g;exports.ORB_RADIUS=T0;exports.ORB_TOKENS=Es;exports.ORB_TRANSITION_FAST=I0;exports.OrbcafeI18nProvider=Ga;exports.OrbisModeProvider=Fn;exports.PAGE_TRANSITION_PRESETS=vV;exports.PAppPageLayout=zF;exports.PBarcodeScanner=DO;exports.PNavIsland=cm;exports.PNumericKeypad=UO;exports.PSmartFilter=nm;exports.PTable=yy;exports.PTouchCard=BO;exports.PWorkloadNav=am;exports.PackageCheck=SS;exports.PackageSearch=wS;exports.PanelLeftOpen=Oa;exports.PanelRight=Fa;exports.PanelsTopLeft=kS;exports.PieChart=Gc;exports.Pin=Jo;exports.PivotChartPanel=Yu;exports.Play=PS;exports.Plus=en;exports.QrCode=TS;exports.ReceiptText=IS;exports.RefreshCw=Ba;exports.Rocket=MS;exports.RotateCcw=RS;exports.RotateCw=Uc;exports.Rows3=DS;exports.SapIcon=Tt;exports.Save=NS;exports.ScanLine=AS;exports.Search=Hr;exports.Send=pf;exports.SendHorizontal=Kc;exports.Settings=tn;exports.ShieldCheck=ES;exports.Sigma=LS;exports.SortAsc=OS;exports.SquareSplitHorizontal=FS;exports.Star=BS;exports.StdChat=zm;exports.Sun=qc;exports.Table2=HS;exports.TableBlock=pl;exports.TabletSmartphone=zS;exports.Terminal=Vn;exports.ThinkBlock=Oi;exports.ThumbsDown=Xc;exports.ThumbsUp=Yc;exports.Trash2=Zc;exports.TreeMenu=Xn;exports.TreePine=VS;exports.TrendingDown=jc;exports.TriangleAlert=Ha;exports.Truck=WS;exports.UploadCloud=Qc;exports.User=zs;exports.VoiceNavigatorProvider=JF;exports.VoiceWaveOverlay=qF;exports.Volume2=Jc;exports.Warehouse=$S;exports.Workflow=_S;exports.X=jt;exports.XCircle=za;exports.addKanbanBucket=fu;exports.buildAmapEmbedUrl=wi;exports.buildGoogleMapEmbedUrl=oa;exports.buildGoogleMapIframe=dR;exports.buttonVariants=lb;exports.createKanbanBoardModel=hu;exports.createSapIcon=ne;exports.findKanbanCard=_r;exports.message=dT;exports.messageManager=ao;exports.moveKanbanCard=Vi;exports.orbAlpha=rt;exports.orbChartSeries=P0;exports.parseMarkdownTable=Li;exports.parseOmphFileHref=Ul;exports.renameKanbanBucket=bu;exports.renderMarkdown=XN;exports.resolveVariantFilters=Ai;exports.resolveVariantLayout=Ei;exports.useAINav=By;exports.useAmapEmbedUrl=gN;exports.useAuthPage=a5;exports.useCardPage=aN;exports.useDetailInfo=pu;exports.useGoogleMapEmbedUrl=mN;exports.useGraphChartData=lN;exports.useGraphInteraction=Ii;exports.useGraphReport=mn;exports.useKanbanBoard=tE;exports.useMediaQuery=Dr;exports.useNavigationIsland=fd;exports.useOrbMode=Cr;exports.useOrbTokens=Os;exports.useOrbcafeI18n=pe;exports.usePadLayout=xO;exports.usePadRecordEditor=kO;exports.usePageLayout=ku;exports.usePivotTable=hO;exports.usePlanningGantt=Rg;exports.usePlanningLayout=S5;exports.useStandardReport=AD;exports.useVoiceInput=Sn;exports.useVoiceNavigator=e2;
|