@axiom-lattice/gateway 10.1.1 → 10.2.1

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.
Files changed (110) hide show
  1. package/dist/{WechatChannelAdapter-QLPJJD6S.mjs → WechatChannelAdapter-EEETBUR3.mjs} +2 -2
  2. package/dist/{a2a-standard-NOAVPYXJ.mjs → a2a-standard-OANCQYQ2.mjs} +8 -4
  3. package/dist/a2a-standard-OANCQYQ2.mjs.map +1 -0
  4. package/dist/{chunk-A7YNAU5L.mjs → chunk-4XWI7U3L.mjs} +106 -1
  5. package/dist/chunk-4XWI7U3L.mjs.map +1 -0
  6. package/dist/{chunk-PHWGCRW2.mjs → chunk-67CDUQM3.mjs} +16 -2
  7. package/dist/chunk-67CDUQM3.mjs.map +1 -0
  8. package/dist/{chunk-6CUQGDJI.mjs → chunk-ELYWN3TJ.mjs} +8 -4
  9. package/dist/chunk-ELYWN3TJ.mjs.map +1 -0
  10. package/dist/embed/{embed-page-AgentDetailSideApp-HNSIMIXX.js → embed-page-AgentDetailSideApp-WAATX6D3.js} +1 -1
  11. package/dist/embed/{embed-page-AgentGovernanceWorkbench-QBEH3KYW.js → embed-page-AgentGovernanceWorkbench-MOIYXL5S.js} +1 -1
  12. package/dist/embed/{embed-page-LangfuseDashboard-QHWHMJVB.js → embed-page-LangfuseDashboard-7ZWWE45Q.js} +1 -1
  13. package/dist/embed/{embed-page-MessageGraph-GXEC7IPB.js → embed-page-MessageGraph-JG554SNZ.js} +1 -1
  14. package/dist/embed/{embed-page-ReactChart-LW6COMT3.js → embed-page-ReactChart-WHOMS6I6.js} +1 -1
  15. package/dist/embed/{embed-page-ReactInfographic-677NVKOU.js → embed-page-ReactInfographic-5P36JLSX.js} +1 -1
  16. package/dist/embed/{embed-page-SkillFlow-ULY3XZ3A.js → embed-page-SkillFlow-RP54B2A5.js} +1 -1
  17. package/dist/embed/{embed-page-TasksSideApp-Q76BWXUV.js → embed-page-TasksSideApp-6TCN3T73.js} +1 -1
  18. package/dist/embed/{embed-page-ThreadMaintenancePanel-N5IFOOFT.js → embed-page-ThreadMaintenancePanel-WNWYNASM.js} +1 -1
  19. package/dist/embed/{embed-page-TopologyRuntimeView-POBS44XX.js → embed-page-TopologyRuntimeView-UMC4XOUL.js} +1 -1
  20. package/dist/embed/{embed-page-WorkflowAutomationView-UH633BXC.js → embed-page-WorkflowAutomationView-PUOPYYGB.js} +1 -1
  21. package/dist/embed/embed-page-all-NEJVJ4G7.js +1 -0
  22. package/dist/embed/{embed-page-architectureDiagram-VXUJARFQ-TYJ3NO2K.js → embed-page-architectureDiagram-VXUJARFQ-THUN2PFL.js} +1 -1
  23. package/dist/embed/embed-page-aspnet-SRK67AH2.js +1 -0
  24. package/dist/embed/{embed-page-blockDiagram-VD42YOAC-L4J3TZWR.js → embed-page-blockDiagram-VD42YOAC-K7OX6LIO.js} +1 -1
  25. package/dist/embed/{embed-page-c4Diagram-YG6GDRKO-CP2IXU3Z.js → embed-page-c4Diagram-YG6GDRKO-DJDAF5AO.js} +1 -1
  26. package/dist/embed/embed-page-chunk-4GCFDWE7.js +6997 -0
  27. package/dist/embed/{embed-page-chunk-3FNSGFP2.js → embed-page-chunk-5EENS2J7.js} +16 -16
  28. package/dist/embed/{embed-page-chunk-3XPHW2C7.js → embed-page-chunk-5O5IKZOC.js} +1 -1
  29. package/dist/embed/{embed-page-chunk-DQJVWZOB.js → embed-page-chunk-A2AHDN6K.js} +1 -1
  30. package/dist/embed/embed-page-chunk-AFYXBC77.js +217 -0
  31. package/dist/embed/{embed-page-chunk-F5QVZLK5.js → embed-page-chunk-DTRFJLVZ.js} +1 -1
  32. package/dist/embed/embed-page-chunk-ESQ5V77Q.js +1 -0
  33. package/dist/embed/{embed-page-chunk-2VJ7T35I.js → embed-page-chunk-FD2PRLMW.js} +1 -1
  34. package/dist/embed/{embed-page-chunk-KXVXKWED.js → embed-page-chunk-G2RO6IBN.js} +1 -1
  35. package/dist/embed/{embed-page-chunk-KKNZYZVB.js → embed-page-chunk-G6UTU7IC.js} +1 -1
  36. package/dist/embed/{embed-page-chunk-7GLQRV3J.js → embed-page-chunk-J5AHS4PO.js} +1 -1
  37. package/dist/embed/{embed-page-chunk-5WWOKLDB.js → embed-page-chunk-JUZPOR5Y.js} +1 -1
  38. package/dist/embed/{embed-page-chunk-62CAXPZK.js → embed-page-chunk-ML6AVDQQ.js} +1 -1
  39. package/dist/embed/{embed-page-chunk-YBP3MD23.js → embed-page-chunk-OBN4XHZP.js} +1 -1
  40. package/dist/embed/{embed-page-chunk-NVFNRWRN.js → embed-page-chunk-PLNJRORR.js} +1 -1
  41. package/dist/embed/{embed-page-chunk-AJV2ISVF.js → embed-page-chunk-QRFTGCB2.js} +1 -1
  42. package/dist/embed/{embed-page-chunk-NR4M6XSO.js → embed-page-chunk-RU45VIPM.js} +1 -1
  43. package/dist/embed/{embed-page-chunk-AEDAOTEO.js → embed-page-chunk-SQ4GANYE.js} +1 -1
  44. package/dist/embed/embed-page-chunk-TZPX2O54.js +7 -0
  45. package/dist/embed/{embed-page-chunk-YJUCDIYK.js → embed-page-chunk-V7R2Y72J.js} +1 -1
  46. package/dist/embed/{embed-page-chunk-XSKDYUNQ.js → embed-page-chunk-VY6MAPHR.js} +1 -1
  47. package/dist/embed/{embed-page-chunk-WK77HIEN.js → embed-page-chunk-WFUFTRWA.js} +1 -1
  48. package/dist/embed/{embed-page-chunk-7CJDHJEH.js → embed-page-chunk-XKGF5D6L.js} +1 -1
  49. package/dist/embed/{embed-page-chunk-WWXRO4ZL.js → embed-page-chunk-XSKNS3LY.js} +1 -1
  50. package/dist/embed/{embed-page-chunk-NGO5C5RH.js → embed-page-chunk-ZVTX7OVB.js} +1 -1
  51. package/dist/embed/embed-page-classDiagram-2ON5EDUG-VYHHMIKZ.js +1 -0
  52. package/dist/embed/embed-page-classDiagram-v2-WZHVMYZB-5AISLXUF.js +1 -0
  53. package/dist/embed/{embed-page-code-highlighter-4XNLEZAM.js → embed-page-code-highlighter-ZZBZ7CEQ.js} +1 -1
  54. package/dist/embed/embed-page-cshtml-ZY7LJSTH.js +1 -0
  55. package/dist/embed/{embed-page-dagre-6UL2VRFP-LTZ2DVVO.js → embed-page-dagre-6UL2VRFP-UQFZMKYW.js} +1 -1
  56. package/dist/embed/{embed-page-diagram-PSM6KHXK-JHYXSMCB.js → embed-page-diagram-PSM6KHXK-4IKXWNA4.js} +1 -1
  57. package/dist/embed/{embed-page-diagram-QEK2KX5R-2YGDFFTU.js → embed-page-diagram-QEK2KX5R-245T32UF.js} +1 -1
  58. package/dist/embed/{embed-page-diagram-S2PKOQOG-6EW6MDJW.js → embed-page-diagram-S2PKOQOG-BOA5MJA5.js} +1 -1
  59. package/dist/embed/embed-page-en-5E2A4Q7G.js +1 -0
  60. package/dist/embed/embed-page-en-AEJHFSAV.js +1 -0
  61. package/dist/embed/{embed-page-en-3Z4N5KXB.js → embed-page-en-QULE3S6E.js} +1 -1
  62. package/dist/embed/{embed-page-erDiagram-Q2GNP2WA-KSUS6MHW.js → embed-page-erDiagram-Q2GNP2WA-S4J4SQPR.js} +1 -1
  63. package/dist/embed/{embed-page-flowDiagram-NV44I4VS-AYXRDKAJ.js → embed-page-flowDiagram-NV44I4VS-ZFIJXKMW.js} +1 -1
  64. package/dist/embed/{embed-page-ganttDiagram-JELNMOA3-AV7N2N3T.js → embed-page-ganttDiagram-JELNMOA3-7MSIEWL4.js} +1 -1
  65. package/dist/embed/{embed-page-gitGraphDiagram-NY62KEGX-IBVOXVO5.js → embed-page-gitGraphDiagram-NY62KEGX-F6KE6PZK.js} +1 -1
  66. package/dist/embed/embed-page-infoDiagram-WHAUD3N6-FQMKXERB.js +2 -0
  67. package/dist/embed/{embed-page-journeyDiagram-XKPGCS4Q-3GILI7Y4.js → embed-page-journeyDiagram-XKPGCS4Q-6VTW6GQ3.js} +1 -1
  68. package/dist/embed/{embed-page-kanban-definition-3W4ZIXB7-UGO3J7IH.js → embed-page-kanban-definition-3W4ZIXB7-7IZYCLQZ.js} +1 -1
  69. package/dist/embed/{embed-page-mermaid-QZJOSGTZ.js → embed-page-mermaid-O5AJMXHC.js} +2 -2
  70. package/dist/embed/{embed-page-mindmap-definition-VGOIOE7T-VXXZJS3Z.js → embed-page-mindmap-definition-VGOIOE7T-GKTOT34A.js} +1 -1
  71. package/dist/embed/{embed-page-pieDiagram-ADFJNKIX-ZFAWYA2N.js → embed-page-pieDiagram-ADFJNKIX-VDPALO42.js} +1 -1
  72. package/dist/embed/{embed-page-requirementDiagram-UZGBJVZJ-2QBINXR7.js → embed-page-requirementDiagram-UZGBJVZJ-LTZH6RTD.js} +1 -1
  73. package/dist/embed/{embed-page-sequenceDiagram-WL72ISMW-3MGTESG4.js → embed-page-sequenceDiagram-WL72ISMW-LV6Q4SHW.js} +1 -1
  74. package/dist/embed/{embed-page-stateDiagram-FKZM4ZOC-W6VPIMB5.js → embed-page-stateDiagram-FKZM4ZOC-U4NHQDNP.js} +1 -1
  75. package/dist/embed/embed-page-stateDiagram-v2-4FDKWEC3-G3EWQCOW.js +1 -0
  76. package/dist/embed/{embed-page-tsx-LGDDERM2.js → embed-page-tsx-PNW7N5T4.js} +1 -1
  77. package/dist/embed/{embed-page-xychartDiagram-PRI3JC2R-7XKT4R7V.js → embed-page-xychartDiagram-PRI3JC2R-VZSIXBFK.js} +1 -1
  78. package/dist/embed/embed-page-zh-EZHTNARQ.js +1 -0
  79. package/dist/embed/embed-page-zh-TOINMHLQ.js +1 -0
  80. package/dist/embed/{embed-page-zh-GXE63PQ7.js → embed-page-zh-WT752BVZ.js} +1 -1
  81. package/dist/embed/embed-page.js +1 -1
  82. package/dist/embed/mcp-app-page.js +32 -32
  83. package/dist/index.d.mts +145 -1
  84. package/dist/index.d.ts +145 -1
  85. package/dist/index.js +8156 -1476
  86. package/dist/index.js.map +1 -1
  87. package/dist/index.mjs +7077 -491
  88. package/dist/index.mjs.map +1 -1
  89. package/dist/{mcp-app-shares-SHPBJQXS.mjs → mcp-app-shares-VN6G3LNW.mjs} +2 -2
  90. package/package.json +11 -7
  91. package/dist/a2a-standard-NOAVPYXJ.mjs.map +0 -1
  92. package/dist/chunk-6CUQGDJI.mjs.map +0 -1
  93. package/dist/chunk-A7YNAU5L.mjs.map +0 -1
  94. package/dist/chunk-PHWGCRW2.mjs.map +0 -1
  95. package/dist/embed/embed-page-all-JEPF6WHD.js +0 -1
  96. package/dist/embed/embed-page-aspnet-GIV4ESY6.js +0 -1
  97. package/dist/embed/embed-page-chunk-54M4265G.js +0 -211
  98. package/dist/embed/embed-page-chunk-5QZRLAW2.js +0 -7
  99. package/dist/embed/embed-page-chunk-KWZEITYQ.js +0 -6986
  100. package/dist/embed/embed-page-chunk-ZQQFWEWO.js +0 -1
  101. package/dist/embed/embed-page-classDiagram-2ON5EDUG-MHNSVPAN.js +0 -1
  102. package/dist/embed/embed-page-classDiagram-v2-WZHVMYZB-QCMEVMYH.js +0 -1
  103. package/dist/embed/embed-page-cshtml-RYMZMLKB.js +0 -1
  104. package/dist/embed/embed-page-en-2S7Q4NKN.js +0 -1
  105. package/dist/embed/embed-page-infoDiagram-WHAUD3N6-ZULKOSOZ.js +0 -2
  106. package/dist/embed/embed-page-stateDiagram-v2-4FDKWEC3-QYJ47QBY.js +0 -1
  107. package/dist/embed/embed-page-zh-GX6IEO57.js +0 -1
  108. /package/dist/{WechatChannelAdapter-QLPJJD6S.mjs.map → WechatChannelAdapter-EEETBUR3.mjs.map} +0 -0
  109. /package/dist/embed/{embed-page-chunk-UH47IEAR.js → embed-page-chunk-34FVRFPW.js} +0 -0
  110. /package/dist/{mcp-app-shares-SHPBJQXS.mjs.map → mcp-app-shares-VN6G3LNW.mjs.map} +0 -0
@@ -1 +1 @@
1
- import{a as X}from"./embed-page-chunk-D7YTSCUO.js";import{K as q,Na as Q,P as J,Wa as de,a as j}from"./embed-page-chunk-F7ZUYG42.js";import{k as G,l as H}from"./embed-page-chunk-3FNSGFP2.js";import{a as Y}from"./embed-page-chunk-QV7QAJ4N.js";import{Ra as p,W as T,_a as w,bb as R,qa as F,ta as c}from"./embed-page-chunk-BUFWD6SE.js";import"./embed-page-chunk-R5QL57JJ.js";import"./embed-page-chunk-EUOOO2LS.js";import{f as I}from"./embed-page-chunk-QBTAJ2YI.js";var re=I(de());var t=I(Y()),O=["#6366f1","#8b5cf6","#10b981","#f59e0b","#ef4444","#0ea5e9","#ec4899","#14b8a6"],Z="#6366f1",ee="#10b981",te="#8b5cf6",oe="#ef4444",be="#f59e0b",ue="#0ea5e9";function v(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}function d(o){return Array.isArray(o)&&o.every(e=>v(e)&&typeof e.bucket=="string"&&(e.value===null||typeof e.value=="number"))}function pe(o){if(!v(o)||!v(o.kpis)||!v(o.series))return!1;let e=o.series,n=e.tokens,r=e.latency;return typeof o.samplingRate=="number"&&typeof o.kpis.traces=="number"&&typeof o.kpis.costUsd=="number"&&typeof o.kpis.inputTokens=="number"&&typeof o.kpis.outputTokens=="number"&&typeof o.kpis.errorRate=="number"&&d(e.traces)&&d(e.cost)&&d(e.errorRate)&&d(e.toolCalls)&&v(n)&&d(n.input)&&d(n.output)&&v(r)&&d(r.p50)&&d(r.p95)&&d(r.p99)&&Array.isArray(o.agents)&&Array.isArray(o.models)&&Array.isArray(o.tools)}function ne(o,e){let n=(0,re.default)(o);return e==="7d"||e==="30d"?n.format("MM-DD"):n.format("MM-DD HH:mm")}function k(o,e){return o.map(n=>ne(n.bucket,e))}function b(o){return o.map(e=>e.value??0)}function u(o){return o.some(e=>(e.value??0)!==0)}var ye=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1});function D(o){return ye.format(o)}function P(o){return Number.isFinite(o)?o.toLocaleString():"0"}function ae(o){return`$${(Number.isFinite(o)?o:0).toFixed(4)}`}function ie(o,e){let n=Number(o);if(!Number.isFinite(n))return"\u2014";switch(e){case"currency":return ae(n);case"tokens":return D(n);case"percent":return`${(n*100).toFixed(1)}%`;case"ms":return`${Math.round(n)} ms`;default:return P(n)}}function se(o){return{backgroundColor:o.background,borderColor:o.border,borderWidth:1,textStyle:{color:o.text,fontSize:12},extraCssText:"box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12); border-radius: 12px;"}}function he(o,e){return{color:o.textSecondary,fontSize:11,...e?{formatter:e}:{}}}function V(o,e,n=!1){return{type:"category",data:e,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:o.textSecondary,fontSize:11,hideOverlap:!0,...n?{formatter:r=>r.length>18?`${r.slice(0,17)}\u2026`:r}:{}},splitLine:{show:!1}}}function $(o,e,n){return{type:"value",...e?{max:1}:{},axisLine:{show:!1},axisTick:{show:!1},axisLabel:he(o,e?r=>`${Math.round(r*100)}%`:void 0),splitLine:{lineStyle:{color:o.border,type:"dashed"}},...n==="number"?{}:{}}}function C(o,e,n){let r=n.kind??(n.percent?"percent":"number");return{color:O,tooltip:{trigger:"axis",...se(n.theme),valueFormatter:i=>ie(i,r)},legend:{top:0,right:0,icon:"circle",itemWidth:8,itemHeight:8,textStyle:{color:n.theme.textSecondary,fontSize:11}},grid:{left:8,right:16,top:36,bottom:8,containLabel:!0},xAxis:V(n.theme,o),yAxis:$(n.theme,n.percent===!0,r),series:e.map((i,s)=>({name:i.name,type:"line",smooth:.35,symbol:"none",lineStyle:{width:2},...n.stacked?{stack:"total"}:{},...n.area?{areaStyle:{opacity:n.stacked?.18:.12,color:O[s%O.length]}}:{},data:i.data}))}}function y(o,e,n){let r=n.kind??(n.percent?"percent":"number"),i=n.horizontal===!0;return{color:O,tooltip:{trigger:"axis",...se(n.theme),valueFormatter:s=>ie(s,r)},legend:{top:0,right:0,icon:"circle",itemWidth:8,itemHeight:8,textStyle:{color:n.theme.textSecondary,fontSize:11}},grid:i?{left:8,right:24,top:16,bottom:8,containLabel:!0}:{left:8,right:16,top:36,bottom:8,containLabel:!0},xAxis:i?$(n.theme,n.percent===!0,r):V(n.theme,o),yAxis:i?V(n.theme,o,!0):$(n.theme,n.percent===!0,r),series:e.map(s=>({name:s.name,type:"bar",...n.stacked?{stack:"total"}:{},barMaxWidth:i?18:28,itemStyle:{borderRadius:i?[0,6,6,0]:[6,6,0,0]},emphasis:{focus:"series"},data:s.data}))}}var A=({title:o,value:e,hint:n,accent:r,icon:i})=>{let{token:s}=w.useToken();return(0,t.jsx)(F,{size:"small",style:{borderRadius:16,border:`1px solid ${s.colorBorderSecondary}`,background:s.colorBgContainer,boxShadow:s.boxShadowTertiary,height:"100%"},styles:{body:{padding:16}},children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,t.jsx)("div",{style:{width:40,height:40,flexShrink:0,borderRadius:12,display:"grid",placeItems:"center",background:`${r}1a`,color:r},children:i}),(0,t.jsxs)("div",{style:{minWidth:0},children:[(0,t.jsx)("div",{style:{fontSize:11,fontWeight:600,letterSpacing:.6,textTransform:"uppercase",color:s.colorTextSecondary,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o}),(0,t.jsx)("div",{style:{fontSize:24,fontWeight:700,lineHeight:1.2,color:s.colorText,fontVariantNumeric:"tabular-nums"},children:e}),(0,t.jsx)("div",{style:{fontSize:11,color:s.colorTextTertiary,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n})]})]})})},f=({title:o,accent:e})=>(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[(0,t.jsx)("span",{style:{width:4,height:16,borderRadius:2,background:e}}),(0,t.jsx)(R.Text,{strong:!0,style:{fontSize:14},children:o})]}),m=({title:o,option:e,hasData:n})=>{let{token:r}=w.useToken(),i=H();return(0,t.jsx)(F,{size:"small",title:(0,t.jsx)("span",{style:{fontSize:12,fontWeight:600,color:r.colorTextSecondary},children:o}),style:{borderRadius:16,border:`1px solid ${r.colorBorderSecondary}`,background:r.colorBgContainer,boxShadow:r.boxShadowTertiary,height:"100%"},styles:{header:{borderBottom:"none",padding:"12px 16px 0",minHeight:0},body:{padding:"4px 8px 10px"}},children:n?(0,t.jsx)(X,{option:e,height:200}):(0,t.jsx)("div",{style:{height:200,display:"grid",placeItems:"center"},children:(0,t.jsx)(R.Text,{type:"secondary",style:{fontSize:12},children:i("common.observability.empty")})})})},Te=({data:o})=>{let e=H(),{token:n}=w.useToken();if(o.version!==G)return(0,t.jsx)(T,{type:"warning",showIcon:!0,message:e("common.observability.unsupportedVersion")});if(!pe(o.payload))return(0,t.jsx)(T,{type:"warning",showIcon:!0,message:e("common.observability.unsupportedVersion")});let r=o.payload,i=o.range,s=r.series.traces,L=r.series.cost,_=r.series.costByModel??[],x=r.series.tokens,h=r.series.latency,E=r.series.errorRate,z=r.series.toolCalls,l={text:n.colorText,textSecondary:n.colorTextTertiary,border:n.colorBorderSecondary,background:n.colorBgElevated},W=r.agents.map(a=>a.name&&a.name.trim()?a.name:a.assistantId==="unattributed"?e("common.observability.unknownAgent"):a.assistantId?a.assistantId.slice(0,8):e("common.observability.unknownAgent")),B=r.models.map(a=>a.model),ce=r.tools.slice(0,10).map(a=>a.tool),K=new Set;for(let a of _)for(let g of a.points)K.add(g.bucket);let U=[...K].sort(),le=U.map(a=>ne(a,i)),M=_.map(a=>{let g=new Map(a.points.map(S=>[S.bucket,S.value??0]));return{name:a.model,data:U.map(S=>g.get(S)??0)}}),N=M.length>0,me=r.agents.reduce((a,g)=>a+g.errorCount,0);return(0,t.jsxs)("div",{style:{display:"grid",gap:20},children:[(0,t.jsx)(R.Text,{type:"secondary",style:{fontSize:12},children:e("common.observability.scopeNote",{environment:r.environment??e("common.observability.allEnvironments"),range:i})}),o.warnings&&o.warnings.length>0?(0,t.jsx)(T,{type:"warning",showIcon:!0,message:e("common.observability.partial")}):null,r.samplingRate<1?(0,t.jsx)(T,{type:"info",showIcon:!0,message:e("common.observability.sampling",{rate:Math.round(r.samplingRate*100)})}):null,(0,t.jsxs)(p,{gutter:[12,12],children:[(0,t.jsx)(c,{xs:12,md:6,children:(0,t.jsx)(A,{title:e("common.observability.kpi.traces"),value:P(r.kpis.traces),hint:e("common.observability.kpi.tracesHint"),accent:Z,icon:(0,t.jsx)(j,{size:18})})}),(0,t.jsx)(c,{xs:12,md:6,children:(0,t.jsx)(A,{title:e("common.observability.kpi.cost"),value:ae(r.kpis.costUsd),hint:"USD",accent:ee,icon:(0,t.jsx)(J,{size:18})})}),(0,t.jsx)(c,{xs:12,md:6,children:(0,t.jsx)(A,{title:e("common.observability.kpi.tokens"),value:D(r.kpis.inputTokens+r.kpis.outputTokens),hint:e("common.observability.kpi.tokensHint",{input:D(r.kpis.inputTokens),output:D(r.kpis.outputTokens)}),accent:te,icon:(0,t.jsx)(q,{size:18})})}),(0,t.jsx)(c,{xs:12,md:6,children:(0,t.jsx)(A,{title:e("common.observability.kpi.errorRate"),value:`${(r.kpis.errorRate*100).toFixed(2)}%`,hint:e("common.observability.kpi.errorsHint",{count:P(me)}),accent:oe,icon:(0,t.jsx)(Q,{size:18})})})]}),(0,t.jsx)(f,{title:e("common.observability.section.traces"),accent:Z}),(0,t.jsxs)(p,{gutter:[16,16],children:[(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.tracesByAssistant"),hasData:r.agents.length>0,option:y(W,[{name:e("common.observability.table.calls"),data:r.agents.map(a=>a.calls)}],{theme:l,horizontal:!0,kind:"number"})})}),(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.tracesOverTime"),hasData:u(s),option:y(k(s,i),[{name:e("common.observability.kpi.traces"),data:b(s)}],{theme:l,kind:"number"})})})]}),(0,t.jsx)(f,{title:e("common.observability.section.cost"),accent:ee}),(0,t.jsxs)(p,{gutter:[16,16],children:[(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.costByModel"),hasData:r.models.length>0,option:y(B,[{name:e("common.observability.kpi.cost"),data:r.models.map(a=>a.costUsd)}],{theme:l,kind:"currency"})})}),(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e(N?"common.observability.chart.costByModelOverTime":"common.observability.chart.costOverTime"),hasData:N?M.some(a=>a.data.some(g=>g!==0)):u(L),option:N?C(le,M,{theme:l,stacked:!0,area:!0,kind:"currency"}):C(k(L,i),[{name:e("common.observability.kpi.cost"),data:b(L)}],{theme:l,area:!0,kind:"currency"})})})]}),(0,t.jsx)(f,{title:e("common.observability.section.tokens"),accent:te}),(0,t.jsxs)(p,{gutter:[16,16],children:[(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.tokensByModel"),hasData:r.models.length>0,option:y(B,[{name:e("common.observability.table.inputTokens"),data:r.models.map(a=>a.inputTokens)},{name:e("common.observability.table.outputTokens"),data:r.models.map(a=>a.outputTokens)}],{theme:l,stacked:!0,kind:"tokens"})})}),(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.tokensOverTime"),hasData:u(x.input)||u(x.output),option:C(k(x.input,i),[{name:"input",data:b(x.input)},{name:"output",data:b(x.output)}],{theme:l,area:!0,stacked:!0,kind:"tokens"})})})]}),(0,t.jsx)(f,{title:e("common.observability.section.errors"),accent:oe}),(0,t.jsxs)(p,{gutter:[16,16],children:[(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.errorRateByAssistant"),hasData:r.agents.length>0,option:y(W,[{name:e("common.observability.kpi.errorRate"),data:r.agents.map(a=>a.errorRate)}],{theme:l,horizontal:!0,percent:!0})})}),(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.errorRateOverTime"),hasData:u(E),option:C(k(E,i),[{name:e("common.observability.kpi.errorRate"),data:b(E)}],{theme:l,percent:!0,area:!0})})})]}),(0,t.jsx)(f,{title:e("common.observability.section.latency"),accent:be}),(0,t.jsxs)(p,{gutter:[16,16],children:[(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.p95ByModel"),hasData:r.models.length>0,option:y(B,[{name:e("common.observability.kpi.p95"),data:r.models.map(a=>a.p95LatencyMs??0)}],{theme:l,horizontal:!0,kind:"ms"})})}),(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.latencyOverTime"),hasData:u(h.p50)||u(h.p95)||u(h.p99),option:C(k(h.p95,i),[{name:"p50",data:b(h.p50)},{name:"p95",data:b(h.p95)},{name:"p99",data:b(h.p99)}],{theme:l,kind:"ms"})})})]}),(0,t.jsx)(f,{title:e("common.observability.section.tools"),accent:ue}),(0,t.jsxs)(p,{gutter:[16,16],children:[(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.toolsByTool"),hasData:r.tools.length>0,option:y(ce,[{name:e("common.observability.table.calls"),data:r.tools.slice(0,10).map(a=>a.count)}],{theme:l,horizontal:!0,kind:"number"})})}),(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.toolsOverTime"),hasData:u(z),option:y(k(z,i),[{name:e("common.observability.table.calls"),data:b(z)}],{theme:l,kind:"number"})})})]})]})};export{Te as LangfuseDashboard};
1
+ import{a as X}from"./embed-page-chunk-D7YTSCUO.js";import{K as q,Na as Q,P as J,Wa as de,a as j}from"./embed-page-chunk-F7ZUYG42.js";import{k as G,l as H}from"./embed-page-chunk-5EENS2J7.js";import{a as Y}from"./embed-page-chunk-QV7QAJ4N.js";import{Ra as p,W as T,_a as w,bb as R,qa as F,ta as c}from"./embed-page-chunk-BUFWD6SE.js";import"./embed-page-chunk-R5QL57JJ.js";import"./embed-page-chunk-EUOOO2LS.js";import{f as I}from"./embed-page-chunk-QBTAJ2YI.js";var re=I(de());var t=I(Y()),O=["#6366f1","#8b5cf6","#10b981","#f59e0b","#ef4444","#0ea5e9","#ec4899","#14b8a6"],Z="#6366f1",ee="#10b981",te="#8b5cf6",oe="#ef4444",be="#f59e0b",ue="#0ea5e9";function v(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}function d(o){return Array.isArray(o)&&o.every(e=>v(e)&&typeof e.bucket=="string"&&(e.value===null||typeof e.value=="number"))}function pe(o){if(!v(o)||!v(o.kpis)||!v(o.series))return!1;let e=o.series,n=e.tokens,r=e.latency;return typeof o.samplingRate=="number"&&typeof o.kpis.traces=="number"&&typeof o.kpis.costUsd=="number"&&typeof o.kpis.inputTokens=="number"&&typeof o.kpis.outputTokens=="number"&&typeof o.kpis.errorRate=="number"&&d(e.traces)&&d(e.cost)&&d(e.errorRate)&&d(e.toolCalls)&&v(n)&&d(n.input)&&d(n.output)&&v(r)&&d(r.p50)&&d(r.p95)&&d(r.p99)&&Array.isArray(o.agents)&&Array.isArray(o.models)&&Array.isArray(o.tools)}function ne(o,e){let n=(0,re.default)(o);return e==="7d"||e==="30d"?n.format("MM-DD"):n.format("MM-DD HH:mm")}function k(o,e){return o.map(n=>ne(n.bucket,e))}function b(o){return o.map(e=>e.value??0)}function u(o){return o.some(e=>(e.value??0)!==0)}var ye=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1});function D(o){return ye.format(o)}function P(o){return Number.isFinite(o)?o.toLocaleString():"0"}function ae(o){return`$${(Number.isFinite(o)?o:0).toFixed(4)}`}function ie(o,e){let n=Number(o);if(!Number.isFinite(n))return"\u2014";switch(e){case"currency":return ae(n);case"tokens":return D(n);case"percent":return`${(n*100).toFixed(1)}%`;case"ms":return`${Math.round(n)} ms`;default:return P(n)}}function se(o){return{backgroundColor:o.background,borderColor:o.border,borderWidth:1,textStyle:{color:o.text,fontSize:12},extraCssText:"box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12); border-radius: 12px;"}}function he(o,e){return{color:o.textSecondary,fontSize:11,...e?{formatter:e}:{}}}function V(o,e,n=!1){return{type:"category",data:e,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:o.textSecondary,fontSize:11,hideOverlap:!0,...n?{formatter:r=>r.length>18?`${r.slice(0,17)}\u2026`:r}:{}},splitLine:{show:!1}}}function $(o,e,n){return{type:"value",...e?{max:1}:{},axisLine:{show:!1},axisTick:{show:!1},axisLabel:he(o,e?r=>`${Math.round(r*100)}%`:void 0),splitLine:{lineStyle:{color:o.border,type:"dashed"}},...n==="number"?{}:{}}}function C(o,e,n){let r=n.kind??(n.percent?"percent":"number");return{color:O,tooltip:{trigger:"axis",...se(n.theme),valueFormatter:i=>ie(i,r)},legend:{top:0,right:0,icon:"circle",itemWidth:8,itemHeight:8,textStyle:{color:n.theme.textSecondary,fontSize:11}},grid:{left:8,right:16,top:36,bottom:8,containLabel:!0},xAxis:V(n.theme,o),yAxis:$(n.theme,n.percent===!0,r),series:e.map((i,s)=>({name:i.name,type:"line",smooth:.35,symbol:"none",lineStyle:{width:2},...n.stacked?{stack:"total"}:{},...n.area?{areaStyle:{opacity:n.stacked?.18:.12,color:O[s%O.length]}}:{},data:i.data}))}}function y(o,e,n){let r=n.kind??(n.percent?"percent":"number"),i=n.horizontal===!0;return{color:O,tooltip:{trigger:"axis",...se(n.theme),valueFormatter:s=>ie(s,r)},legend:{top:0,right:0,icon:"circle",itemWidth:8,itemHeight:8,textStyle:{color:n.theme.textSecondary,fontSize:11}},grid:i?{left:8,right:24,top:16,bottom:8,containLabel:!0}:{left:8,right:16,top:36,bottom:8,containLabel:!0},xAxis:i?$(n.theme,n.percent===!0,r):V(n.theme,o),yAxis:i?V(n.theme,o,!0):$(n.theme,n.percent===!0,r),series:e.map(s=>({name:s.name,type:"bar",...n.stacked?{stack:"total"}:{},barMaxWidth:i?18:28,itemStyle:{borderRadius:i?[0,6,6,0]:[6,6,0,0]},emphasis:{focus:"series"},data:s.data}))}}var A=({title:o,value:e,hint:n,accent:r,icon:i})=>{let{token:s}=w.useToken();return(0,t.jsx)(F,{size:"small",style:{borderRadius:16,border:`1px solid ${s.colorBorderSecondary}`,background:s.colorBgContainer,boxShadow:s.boxShadowTertiary,height:"100%"},styles:{body:{padding:16}},children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,t.jsx)("div",{style:{width:40,height:40,flexShrink:0,borderRadius:12,display:"grid",placeItems:"center",background:`${r}1a`,color:r},children:i}),(0,t.jsxs)("div",{style:{minWidth:0},children:[(0,t.jsx)("div",{style:{fontSize:11,fontWeight:600,letterSpacing:.6,textTransform:"uppercase",color:s.colorTextSecondary,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o}),(0,t.jsx)("div",{style:{fontSize:24,fontWeight:700,lineHeight:1.2,color:s.colorText,fontVariantNumeric:"tabular-nums"},children:e}),(0,t.jsx)("div",{style:{fontSize:11,color:s.colorTextTertiary,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n})]})]})})},f=({title:o,accent:e})=>(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[(0,t.jsx)("span",{style:{width:4,height:16,borderRadius:2,background:e}}),(0,t.jsx)(R.Text,{strong:!0,style:{fontSize:14},children:o})]}),m=({title:o,option:e,hasData:n})=>{let{token:r}=w.useToken(),i=H();return(0,t.jsx)(F,{size:"small",title:(0,t.jsx)("span",{style:{fontSize:12,fontWeight:600,color:r.colorTextSecondary},children:o}),style:{borderRadius:16,border:`1px solid ${r.colorBorderSecondary}`,background:r.colorBgContainer,boxShadow:r.boxShadowTertiary,height:"100%"},styles:{header:{borderBottom:"none",padding:"12px 16px 0",minHeight:0},body:{padding:"4px 8px 10px"}},children:n?(0,t.jsx)(X,{option:e,height:200}):(0,t.jsx)("div",{style:{height:200,display:"grid",placeItems:"center"},children:(0,t.jsx)(R.Text,{type:"secondary",style:{fontSize:12},children:i("common.observability.empty")})})})},Te=({data:o})=>{let e=H(),{token:n}=w.useToken();if(o.version!==G)return(0,t.jsx)(T,{type:"warning",showIcon:!0,message:e("common.observability.unsupportedVersion")});if(!pe(o.payload))return(0,t.jsx)(T,{type:"warning",showIcon:!0,message:e("common.observability.unsupportedVersion")});let r=o.payload,i=o.range,s=r.series.traces,L=r.series.cost,_=r.series.costByModel??[],x=r.series.tokens,h=r.series.latency,E=r.series.errorRate,z=r.series.toolCalls,l={text:n.colorText,textSecondary:n.colorTextTertiary,border:n.colorBorderSecondary,background:n.colorBgElevated},W=r.agents.map(a=>a.name&&a.name.trim()?a.name:a.assistantId==="unattributed"?e("common.observability.unknownAgent"):a.assistantId?a.assistantId.slice(0,8):e("common.observability.unknownAgent")),B=r.models.map(a=>a.model),ce=r.tools.slice(0,10).map(a=>a.tool),K=new Set;for(let a of _)for(let g of a.points)K.add(g.bucket);let U=[...K].sort(),le=U.map(a=>ne(a,i)),M=_.map(a=>{let g=new Map(a.points.map(S=>[S.bucket,S.value??0]));return{name:a.model,data:U.map(S=>g.get(S)??0)}}),N=M.length>0,me=r.agents.reduce((a,g)=>a+g.errorCount,0);return(0,t.jsxs)("div",{style:{display:"grid",gap:20},children:[(0,t.jsx)(R.Text,{type:"secondary",style:{fontSize:12},children:e("common.observability.scopeNote",{environment:r.environment??e("common.observability.allEnvironments"),range:i})}),o.warnings&&o.warnings.length>0?(0,t.jsx)(T,{type:"warning",showIcon:!0,message:e("common.observability.partial")}):null,r.samplingRate<1?(0,t.jsx)(T,{type:"info",showIcon:!0,message:e("common.observability.sampling",{rate:Math.round(r.samplingRate*100)})}):null,(0,t.jsxs)(p,{gutter:[12,12],children:[(0,t.jsx)(c,{xs:12,md:6,children:(0,t.jsx)(A,{title:e("common.observability.kpi.traces"),value:P(r.kpis.traces),hint:e("common.observability.kpi.tracesHint"),accent:Z,icon:(0,t.jsx)(j,{size:18})})}),(0,t.jsx)(c,{xs:12,md:6,children:(0,t.jsx)(A,{title:e("common.observability.kpi.cost"),value:ae(r.kpis.costUsd),hint:"USD",accent:ee,icon:(0,t.jsx)(J,{size:18})})}),(0,t.jsx)(c,{xs:12,md:6,children:(0,t.jsx)(A,{title:e("common.observability.kpi.tokens"),value:D(r.kpis.inputTokens+r.kpis.outputTokens),hint:e("common.observability.kpi.tokensHint",{input:D(r.kpis.inputTokens),output:D(r.kpis.outputTokens)}),accent:te,icon:(0,t.jsx)(q,{size:18})})}),(0,t.jsx)(c,{xs:12,md:6,children:(0,t.jsx)(A,{title:e("common.observability.kpi.errorRate"),value:`${(r.kpis.errorRate*100).toFixed(2)}%`,hint:e("common.observability.kpi.errorsHint",{count:P(me)}),accent:oe,icon:(0,t.jsx)(Q,{size:18})})})]}),(0,t.jsx)(f,{title:e("common.observability.section.traces"),accent:Z}),(0,t.jsxs)(p,{gutter:[16,16],children:[(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.tracesByAssistant"),hasData:r.agents.length>0,option:y(W,[{name:e("common.observability.table.calls"),data:r.agents.map(a=>a.calls)}],{theme:l,horizontal:!0,kind:"number"})})}),(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.tracesOverTime"),hasData:u(s),option:y(k(s,i),[{name:e("common.observability.kpi.traces"),data:b(s)}],{theme:l,kind:"number"})})})]}),(0,t.jsx)(f,{title:e("common.observability.section.cost"),accent:ee}),(0,t.jsxs)(p,{gutter:[16,16],children:[(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.costByModel"),hasData:r.models.length>0,option:y(B,[{name:e("common.observability.kpi.cost"),data:r.models.map(a=>a.costUsd)}],{theme:l,kind:"currency"})})}),(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e(N?"common.observability.chart.costByModelOverTime":"common.observability.chart.costOverTime"),hasData:N?M.some(a=>a.data.some(g=>g!==0)):u(L),option:N?C(le,M,{theme:l,stacked:!0,area:!0,kind:"currency"}):C(k(L,i),[{name:e("common.observability.kpi.cost"),data:b(L)}],{theme:l,area:!0,kind:"currency"})})})]}),(0,t.jsx)(f,{title:e("common.observability.section.tokens"),accent:te}),(0,t.jsxs)(p,{gutter:[16,16],children:[(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.tokensByModel"),hasData:r.models.length>0,option:y(B,[{name:e("common.observability.table.inputTokens"),data:r.models.map(a=>a.inputTokens)},{name:e("common.observability.table.outputTokens"),data:r.models.map(a=>a.outputTokens)}],{theme:l,stacked:!0,kind:"tokens"})})}),(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.tokensOverTime"),hasData:u(x.input)||u(x.output),option:C(k(x.input,i),[{name:"input",data:b(x.input)},{name:"output",data:b(x.output)}],{theme:l,area:!0,stacked:!0,kind:"tokens"})})})]}),(0,t.jsx)(f,{title:e("common.observability.section.errors"),accent:oe}),(0,t.jsxs)(p,{gutter:[16,16],children:[(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.errorRateByAssistant"),hasData:r.agents.length>0,option:y(W,[{name:e("common.observability.kpi.errorRate"),data:r.agents.map(a=>a.errorRate)}],{theme:l,horizontal:!0,percent:!0})})}),(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.errorRateOverTime"),hasData:u(E),option:C(k(E,i),[{name:e("common.observability.kpi.errorRate"),data:b(E)}],{theme:l,percent:!0,area:!0})})})]}),(0,t.jsx)(f,{title:e("common.observability.section.latency"),accent:be}),(0,t.jsxs)(p,{gutter:[16,16],children:[(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.p95ByModel"),hasData:r.models.length>0,option:y(B,[{name:e("common.observability.kpi.p95"),data:r.models.map(a=>a.p95LatencyMs??0)}],{theme:l,horizontal:!0,kind:"ms"})})}),(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.latencyOverTime"),hasData:u(h.p50)||u(h.p95)||u(h.p99),option:C(k(h.p95,i),[{name:"p50",data:b(h.p50)},{name:"p95",data:b(h.p95)},{name:"p99",data:b(h.p99)}],{theme:l,kind:"ms"})})})]}),(0,t.jsx)(f,{title:e("common.observability.section.tools"),accent:ue}),(0,t.jsxs)(p,{gutter:[16,16],children:[(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.toolsByTool"),hasData:r.tools.length>0,option:y(ce,[{name:e("common.observability.table.calls"),data:r.tools.slice(0,10).map(a=>a.count)}],{theme:l,horizontal:!0,kind:"number"})})}),(0,t.jsx)(c,{xs:24,md:12,children:(0,t.jsx)(m,{title:e("common.observability.chart.toolsOverTime"),hasData:u(z),option:y(k(z,i),[{name:e("common.observability.table.calls"),data:b(z)}],{theme:l,kind:"number"})})})]})]})};export{Te as LangfuseDashboard};
@@ -1,4 +1,4 @@
1
- import{c as $,d as J}from"./embed-page-chunk-HQLSH3FC.js";import{b as R,d as V,e as S}from"./embed-page-chunk-5AWYMAAX.js";import"./embed-page-chunk-S4XZPBRM.js";import{j as N,k as H,l as L,m as U,n as W,x as A,y as K,z as Y}from"./embed-page-chunk-KWZEITYQ.js";import"./embed-page-chunk-54M4265G.js";import"./embed-page-chunk-3XPHW2C7.js";import"./embed-page-chunk-5QZRLAW2.js";import"./embed-page-chunk-F7ZUYG42.js";import{l as w}from"./embed-page-chunk-3FNSGFP2.js";import{a as g}from"./embed-page-chunk-QV7QAJ4N.js";import"./embed-page-chunk-VW3NF5NT.js";import"./embed-page-chunk-Z4Z6VCUZ.js";import{Aa as G,Oa as _,ab as z,bb as k,eb as F,t as E,y as D}from"./embed-page-chunk-L7GPZSYD.js";import{Za as P,_ as T,ha as B}from"./embed-page-chunk-BUFWD6SE.js";import{a as b}from"./embed-page-chunk-R5QL57JJ.js";import"./embed-page-chunk-QOWM3LMZ.js";import"./embed-page-chunk-EUOOO2LS.js";import"./embed-page-chunk-5JDQ456X.js";import{f}from"./embed-page-chunk-QBTAJ2YI.js";var n=f(b());var I=f(b());var o=f(g());var ae="tracePulse 1.4s ease-in-out infinite",le={running:(0,o.jsx)(G,{style:{color:"#1890ff"}}),success:(0,o.jsx)(E,{style:{color:"#52c41a"}}),error:(0,o.jsx)(D,{style:{color:"#ff4d4f"}})};function de({kind:e}){switch(e){case"human":return(0,o.jsx)(F,{});case"agent":return(0,o.jsx)(z,{});case"tool":return(0,o.jsx)(k,{});case"ai":return(0,o.jsx)(_,{});default:return(0,o.jsx)(k,{})}}var M=I.default.createContext({}),ce=()=>I.default.useContext(M),pe=({data:e,selected:i})=>{let l=w(),{onJumpToMessage:t}=ce(),s=e.isAnswer===!0,a=e.status==="running",p=(e.parallelCount??1)>1,m=!!(t&&e.messageId&&!e.messageId.startsWith("summary:")),v=e.toolCall?L(e.toolCall.name):e.label,y=()=>{if((e.kind==="tool"||e.kind==="agent")&&e.toolCall){let h=U(e.toolCall.response);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(H,{data:{name:e.toolCall.name,parameters:e.toolCall.args,type:"tool_call"},component_key:`${e.toolCall.id}-params`,interactive:!1}),h&&(0,o.jsx)("div",{style:{marginTop:8},children:(0,o.jsx)(N,{content:h})}),(0,o.jsx)(W,{ui:e.toolCall.ui})]})}return e.content?(0,o.jsx)(N,{content:e.content}):(0,o.jsx)("span",{style:{color:"#8c8c8c"},children:e.label})};return(0,o.jsxs)("div",{"data-testid":"trace-card",style:{height:"100%",display:"flex",flexDirection:"column",border:`1px solid ${s||i?"#6366f1":a?"#91caff":"#e5e7eb"}`,borderRadius:12,background:s?"#eef2ff":"#fff",boxShadow:a?"0 0 0 2px rgba(24,144,255,0.18)":i?"0 0 0 2px rgba(99,102,241,0.2)":"none",animation:a?ae:void 0,overflow:"hidden",fontSize:13},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",borderBottom:"1px solid #f0f0f0",background:"rgba(0,0,0,0.02)"},children:[(0,o.jsx)(de,{kind:e.kind}),(0,o.jsx)("span",{style:{fontWeight:s?700:600,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:v}),p&&(0,o.jsx)(P,{color:"purple",style:{marginInlineEnd:0,fontSize:10},children:l("chat.trace.parallelBadge",{count:e.parallelCount??1})}),le[e.status],m&&(0,o.jsx)(T,{type:"text",size:"small",onClick:()=>t?.(e.messageId),children:l("chat.trace.jumpToChat")})]}),(0,o.jsx)("div",{style:{flex:1,minHeight:0,overflow:"auto",padding:12},children:y()})]})},fe=({data:e,selected:i})=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(S,{type:"target",position:R.Top}),(0,o.jsx)(pe,{data:e,selected:i}),(0,o.jsx)(S,{type:"source",position:R.Bottom})]}),j={trace:fe};var Z=f(b());var u=f(g()),ue={running:"#1890ff",success:"#52c41a",error:"#ff4d4f"},q=({graph:e,activeNodeId:i,onSelectNode:l})=>{let t=Z.default.useMemo(()=>new Map(e.nodes.map(s=>[s.id,s])),[e.nodes]);return(0,u.jsx)("div",{"data-testid":"trace-overview-rail",style:{display:"flex",flexDirection:"column",gap:10,width:160,padding:8,overflowY:"auto",borderRight:"1px solid #f0f0f0"},children:e.phases.map(s=>(0,u.jsxs)("div",{"data-testid":"trace-rail-phase",children:[(0,u.jsx)("div",{style:{fontSize:12,color:"#8c8c8c",marginBottom:4},children:s.title}),(0,u.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:s.nodeIds.map(a=>{let p=t.get(a);if(!p)return null;let m=a===i;return(0,u.jsx)(B,{title:p.data.label,children:(0,u.jsx)("button",{type:"button","data-testid":"trace-rail-tick",onClick:()=>l?.(a),style:{width:m?12:8,height:m?12:8,borderRadius:"50%",border:"none",padding:0,cursor:"pointer",background:ue[p.data.status],outline:m?"2px solid #6366f1":"none"}})},a)})})]},s.id))})};var d=f(g()),Q=3,X=()=>{},me=`
1
+ import{c as $,d as J}from"./embed-page-chunk-HQLSH3FC.js";import{b as R,d as V,e as S}from"./embed-page-chunk-5AWYMAAX.js";import"./embed-page-chunk-S4XZPBRM.js";import{j as N,k as H,l as L,m as U,n as W,x as A,y as K,z as Y}from"./embed-page-chunk-4GCFDWE7.js";import"./embed-page-chunk-5O5IKZOC.js";import"./embed-page-chunk-AFYXBC77.js";import"./embed-page-chunk-TZPX2O54.js";import"./embed-page-chunk-F7ZUYG42.js";import{l as w}from"./embed-page-chunk-5EENS2J7.js";import{a as g}from"./embed-page-chunk-QV7QAJ4N.js";import"./embed-page-chunk-VW3NF5NT.js";import"./embed-page-chunk-Z4Z6VCUZ.js";import{Aa as G,Oa as _,ab as z,bb as k,eb as F,t as E,y as D}from"./embed-page-chunk-L7GPZSYD.js";import{Za as P,_ as T,ha as B}from"./embed-page-chunk-BUFWD6SE.js";import{a as b}from"./embed-page-chunk-R5QL57JJ.js";import"./embed-page-chunk-QOWM3LMZ.js";import"./embed-page-chunk-EUOOO2LS.js";import"./embed-page-chunk-5JDQ456X.js";import{f}from"./embed-page-chunk-QBTAJ2YI.js";var n=f(b());var I=f(b());var o=f(g());var ae="tracePulse 1.4s ease-in-out infinite",le={running:(0,o.jsx)(G,{style:{color:"#1890ff"}}),success:(0,o.jsx)(E,{style:{color:"#52c41a"}}),error:(0,o.jsx)(D,{style:{color:"#ff4d4f"}})};function de({kind:e}){switch(e){case"human":return(0,o.jsx)(F,{});case"agent":return(0,o.jsx)(z,{});case"tool":return(0,o.jsx)(k,{});case"ai":return(0,o.jsx)(_,{});default:return(0,o.jsx)(k,{})}}var M=I.default.createContext({}),ce=()=>I.default.useContext(M),pe=({data:e,selected:i})=>{let l=w(),{onJumpToMessage:t}=ce(),s=e.isAnswer===!0,a=e.status==="running",p=(e.parallelCount??1)>1,m=!!(t&&e.messageId&&!e.messageId.startsWith("summary:")),v=e.toolCall?L(e.toolCall.name):e.label,y=()=>{if((e.kind==="tool"||e.kind==="agent")&&e.toolCall){let h=U(e.toolCall.response);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(H,{data:{name:e.toolCall.name,parameters:e.toolCall.args,type:"tool_call"},component_key:`${e.toolCall.id}-params`,interactive:!1}),h&&(0,o.jsx)("div",{style:{marginTop:8},children:(0,o.jsx)(N,{content:h})}),(0,o.jsx)(W,{ui:e.toolCall.ui})]})}return e.content?(0,o.jsx)(N,{content:e.content}):(0,o.jsx)("span",{style:{color:"#8c8c8c"},children:e.label})};return(0,o.jsxs)("div",{"data-testid":"trace-card",style:{height:"100%",display:"flex",flexDirection:"column",border:`1px solid ${s||i?"#6366f1":a?"#91caff":"#e5e7eb"}`,borderRadius:12,background:s?"#eef2ff":"#fff",boxShadow:a?"0 0 0 2px rgba(24,144,255,0.18)":i?"0 0 0 2px rgba(99,102,241,0.2)":"none",animation:a?ae:void 0,overflow:"hidden",fontSize:13},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",borderBottom:"1px solid #f0f0f0",background:"rgba(0,0,0,0.02)"},children:[(0,o.jsx)(de,{kind:e.kind}),(0,o.jsx)("span",{style:{fontWeight:s?700:600,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:v}),p&&(0,o.jsx)(P,{color:"purple",style:{marginInlineEnd:0,fontSize:10},children:l("chat.trace.parallelBadge",{count:e.parallelCount??1})}),le[e.status],m&&(0,o.jsx)(T,{type:"text",size:"small",onClick:()=>t?.(e.messageId),children:l("chat.trace.jumpToChat")})]}),(0,o.jsx)("div",{style:{flex:1,minHeight:0,overflow:"auto",padding:12},children:y()})]})},fe=({data:e,selected:i})=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(S,{type:"target",position:R.Top}),(0,o.jsx)(pe,{data:e,selected:i}),(0,o.jsx)(S,{type:"source",position:R.Bottom})]}),j={trace:fe};var Z=f(b());var u=f(g()),ue={running:"#1890ff",success:"#52c41a",error:"#ff4d4f"},q=({graph:e,activeNodeId:i,onSelectNode:l})=>{let t=Z.default.useMemo(()=>new Map(e.nodes.map(s=>[s.id,s])),[e.nodes]);return(0,u.jsx)("div",{"data-testid":"trace-overview-rail",style:{display:"flex",flexDirection:"column",gap:10,width:160,padding:8,overflowY:"auto",borderRight:"1px solid #f0f0f0"},children:e.phases.map(s=>(0,u.jsxs)("div",{"data-testid":"trace-rail-phase",children:[(0,u.jsx)("div",{style:{fontSize:12,color:"#8c8c8c",marginBottom:4},children:s.title}),(0,u.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:s.nodeIds.map(a=>{let p=t.get(a);if(!p)return null;let m=a===i;return(0,u.jsx)(B,{title:p.data.label,children:(0,u.jsx)("button",{type:"button","data-testid":"trace-rail-tick",onClick:()=>l?.(a),style:{width:m?12:8,height:m?12:8,borderRadius:"50%",border:"none",padding:0,cursor:"pointer",background:ue[p.data.status],outline:m?"2px solid #6366f1":"none"}})},a)})})]},s.id))})};var d=f(g()),Q=3,X=()=>{},me=`
2
2
  @keyframes tracePulse {
3
3
  0%, 100% { box-shadow: 0 0 0 2px rgba(24,144,255,0.18); }
4
4
  50% { box-shadow: 0 0 0 6px rgba(24,144,255,0.05); }
@@ -1 +1 @@
1
- import{s as D}from"./embed-page-chunk-UDSGGVJH.js";import{i as E}from"./embed-page-chunk-KWZEITYQ.js";import"./embed-page-chunk-54M4265G.js";import"./embed-page-chunk-3XPHW2C7.js";import{a as T}from"./embed-page-chunk-5QZRLAW2.js";import"./embed-page-chunk-F7ZUYG42.js";import{l as v}from"./embed-page-chunk-3FNSGFP2.js";import{a as C}from"./embed-page-chunk-QV7QAJ4N.js";import"./embed-page-chunk-VW3NF5NT.js";import"./embed-page-chunk-Z4Z6VCUZ.js";import"./embed-page-chunk-L7GPZSYD.js";import{qa as x}from"./embed-page-chunk-BUFWD6SE.js";import{a as w}from"./embed-page-chunk-R5QL57JJ.js";import"./embed-page-chunk-QOWM3LMZ.js";import"./embed-page-chunk-EUOOO2LS.js";import"./embed-page-chunk-5JDQ456X.js";import{f as p}from"./embed-page-chunk-QBTAJ2YI.js";var u=p(w());var R=p(T());var y=p(C());function g(l,i){if(!l||l.length===0)return{title:{text:i("genui.chart.title"),left:"left"},tooltip:{trigger:"axis"},legend:{right:0,orient:"vertical"},xAxis:{type:"category",data:[]},yAxis:{type:"value"},series:[{type:"line",name:i("genui.chart.seriesDefault",{n:1}),data:[]}],grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0}};let s=l[0],t=Object.keys(s);if(t.length===0)return g([],i);let r=t.filter(e=>{let n=s[e];return typeof n=="number"||!isNaN(Number(n))});if(r.length>0){let e=r[0],n=t.find(a=>!r.includes(a))||t[0],o=l.map((a,c)=>a[n]!==void 0?String(a[n]):i("genui.chart.itemDefault",{n:c+1})),f=l.map(a=>{let c=a[e];return typeof c=="number"?c:Number(c)||0});return{title:{text:i("genui.chart.title"),left:"left"},tooltip:{trigger:"axis"},legend:{right:0,orient:"vertical",data:[e]},xAxis:{type:"category",data:o},yAxis:{type:"value"},series:[{type:"line",name:e,data:f}],grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0}}}return{title:{text:i("genui.chart.title"),left:"left"},tooltip:{trigger:"axis"},legend:{right:0,orient:"vertical"},xAxis:{type:"category",data:l.map((e,n)=>i("genui.chart.itemDefault",{n:n+1}))},yAxis:{type:"value"},series:[{type:"bar",name:i("genui.chart.countSeries"),data:l.map(()=>1)}],grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0}}}function j(l,i){if(!l||typeof l!="object"||!l.series||!Array.isArray(l.series)||l.series.length===0)return null;let s=l.series.map((e,n)=>{if(!e||typeof e!="object"||!e.type||!e.data||!Array.isArray(e.data)||e.data.length===0)return null;let o={...e,name:e.name||i("genui.chart.seriesDefault",{n:n+1})};if(e.type==="pie"){let f=e.data.map((a,c)=>typeof a=="object"&&a!==null&&"value"in a?{value:a.value,name:a.name||i("genui.chart.itemDefault",{n:c+1})}:typeof a=="number"?{value:a,name:i("genui.chart.itemDefault",{n:c+1})}:null).filter(a=>a!==null);return f.length===0?null:{...o,data:f}}return o}).filter(e=>e!==null);if(s.length===0)return null;let t={...l,series:s},r=s[0].type;if(r!=="pie"){if(!t.xAxis)t.xAxis={type:"category",data:[]};else if(typeof t.xAxis=="object"&&!Array.isArray(t.xAxis)){let e=t.xAxis;if(e.type||(e.type="category"),e.type==="category"&&!e.data){let n=s[0].data;Array.isArray(n)&&n.length>0?Array.isArray(n[0])?e.data=n.map(o=>o[0]):e.data=n.map((o,f)=>i("genui.chart.itemDefault",{n:f+1})):e.data=[]}t.xAxis=e}t.yAxis?typeof t.yAxis=="object"&&!Array.isArray(t.yAxis)&&(t.yAxis.type||(t.yAxis.type="value")):t.yAxis={type:"value"}}if(!t.title)t.title={text:i("genui.chart.title"),left:"left"};else if(typeof t.title=="object"){let e=t.title;e.left||(e.left="left"),e.text||(e.text=i("genui.chart.title")),t.title=e}if(t.tooltip||(t.tooltip={trigger:r==="pie"?"item":"axis"}),!t.legend)s.length>1&&(t.legend={right:0,orient:"vertical"});else if(typeof t.legend=="object"){let e=t.legend;t.legend=e}return r!=="pie"&&!t.grid&&(t.grid={left:"3%",right:"4%",bottom:"3%",containLabel:!0}),t}function O(l,i){let s=null;try{let n=typeof l=="string"?l:l.join("");s=(0,R.parse)(n)}catch(n){return{data:null,error:`Failed to parse JSON: ${n instanceof Error?n.message:String(n)}`}}if(!s||typeof s!="object")return{data:null,error:"Parsed data is not an object"};let t=s.series&&Array.isArray(s.series)&&s.series.length>0,r={table:Array.isArray(s.table)?s.table:void 0},e=null;if(s.echarts?e=s.echarts:t&&(e=s),e){let n=j(e,i);if(n)r.echarts=n;else if(r.table&&r.table.length>0)r.echarts=g(r.table,i);else return{data:null,error:"ECharts configuration is invalid or incomplete. Required: series array with at least one series containing type and data."}}else r.table&&r.table.length>0?r.echarts=g(r.table,i):r.echarts=g([],i);return{data:r,error:null}}var K=l=>{let{children:i}=l,s=v(),t=(0,u.useRef)(null),r=(0,u.useRef)(null),e=(0,u.useRef)(null),[n,o]=(0,u.useState)(null);(0,u.useEffect)(()=>{if(!t.current)return;r.current||(r.current=D(t.current));let a=null;if((typeof i=="string"||Array.isArray(i))&&(a=i),!a){r.current&&r.current.clear(),o(null);return}let{data:c,error:m}=O(a,s);if(m||!c){console.warn("ReactChart failed to parse chart data:",m||"Unknown parse error"),r.current&&r.current.clear(),o(null);return}if(c.table&&Array.isArray(c.table)&&o(c.table),c.echarts)try{r.current.setOption(c.echarts,!0)}catch(d){let A=d instanceof Error?d.message:"Failed to render chart";console.error("Failed to set ECharts option:",d),r.current&&r.current.clear(),o(null)}let h=()=>{r.current&&r.current.resize()};return e.current&&(e.current.disconnect(),e.current=null),t.current&&typeof ResizeObserver<"u"&&(e.current=new ResizeObserver(d=>{requestAnimationFrame(()=>{h()})}),e.current.observe(t.current)),window.addEventListener("resize",h),()=>{e.current&&(e.current.disconnect(),e.current=null),window.removeEventListener("resize",h)}},[i,s]),(0,u.useEffect)(()=>()=>{e.current&&(e.current.disconnect(),e.current=null),r.current&&(r.current.dispose(),r.current=null)},[]);let f=a=>{if(!a||a.length===0)return[];if(Array.isArray(a[0])){let c=a[0];return a.slice(1).map((h,d)=>{let A={};return h.forEach((S,b)=>{A[c[b]||`col_${b}`]=S}),A})}return a};return(0,y.jsxs)(x,{children:[(0,y.jsx)("div",{ref:t,style:{width:"100%",height:"400px",minHeight:"300px"}}),n&&n.length>0&&(0,y.jsx)("div",{style:{marginTop:16},children:(0,y.jsx)(E,{component_key:"chart_table_data",data:{dataSource:f(n),message:s("genui.chart.dataDetails")},interactive:!0,default_open_in_side_app:!0})})]})};export{K as ReactChart};
1
+ import{s as D}from"./embed-page-chunk-UDSGGVJH.js";import{i as E}from"./embed-page-chunk-4GCFDWE7.js";import"./embed-page-chunk-5O5IKZOC.js";import"./embed-page-chunk-AFYXBC77.js";import{a as T}from"./embed-page-chunk-TZPX2O54.js";import"./embed-page-chunk-F7ZUYG42.js";import{l as v}from"./embed-page-chunk-5EENS2J7.js";import{a as C}from"./embed-page-chunk-QV7QAJ4N.js";import"./embed-page-chunk-VW3NF5NT.js";import"./embed-page-chunk-Z4Z6VCUZ.js";import"./embed-page-chunk-L7GPZSYD.js";import{qa as x}from"./embed-page-chunk-BUFWD6SE.js";import{a as w}from"./embed-page-chunk-R5QL57JJ.js";import"./embed-page-chunk-QOWM3LMZ.js";import"./embed-page-chunk-EUOOO2LS.js";import"./embed-page-chunk-5JDQ456X.js";import{f as p}from"./embed-page-chunk-QBTAJ2YI.js";var u=p(w());var R=p(T());var y=p(C());function g(l,i){if(!l||l.length===0)return{title:{text:i("genui.chart.title"),left:"left"},tooltip:{trigger:"axis"},legend:{right:0,orient:"vertical"},xAxis:{type:"category",data:[]},yAxis:{type:"value"},series:[{type:"line",name:i("genui.chart.seriesDefault",{n:1}),data:[]}],grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0}};let s=l[0],t=Object.keys(s);if(t.length===0)return g([],i);let r=t.filter(e=>{let n=s[e];return typeof n=="number"||!isNaN(Number(n))});if(r.length>0){let e=r[0],n=t.find(a=>!r.includes(a))||t[0],o=l.map((a,c)=>a[n]!==void 0?String(a[n]):i("genui.chart.itemDefault",{n:c+1})),f=l.map(a=>{let c=a[e];return typeof c=="number"?c:Number(c)||0});return{title:{text:i("genui.chart.title"),left:"left"},tooltip:{trigger:"axis"},legend:{right:0,orient:"vertical",data:[e]},xAxis:{type:"category",data:o},yAxis:{type:"value"},series:[{type:"line",name:e,data:f}],grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0}}}return{title:{text:i("genui.chart.title"),left:"left"},tooltip:{trigger:"axis"},legend:{right:0,orient:"vertical"},xAxis:{type:"category",data:l.map((e,n)=>i("genui.chart.itemDefault",{n:n+1}))},yAxis:{type:"value"},series:[{type:"bar",name:i("genui.chart.countSeries"),data:l.map(()=>1)}],grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0}}}function j(l,i){if(!l||typeof l!="object"||!l.series||!Array.isArray(l.series)||l.series.length===0)return null;let s=l.series.map((e,n)=>{if(!e||typeof e!="object"||!e.type||!e.data||!Array.isArray(e.data)||e.data.length===0)return null;let o={...e,name:e.name||i("genui.chart.seriesDefault",{n:n+1})};if(e.type==="pie"){let f=e.data.map((a,c)=>typeof a=="object"&&a!==null&&"value"in a?{value:a.value,name:a.name||i("genui.chart.itemDefault",{n:c+1})}:typeof a=="number"?{value:a,name:i("genui.chart.itemDefault",{n:c+1})}:null).filter(a=>a!==null);return f.length===0?null:{...o,data:f}}return o}).filter(e=>e!==null);if(s.length===0)return null;let t={...l,series:s},r=s[0].type;if(r!=="pie"){if(!t.xAxis)t.xAxis={type:"category",data:[]};else if(typeof t.xAxis=="object"&&!Array.isArray(t.xAxis)){let e=t.xAxis;if(e.type||(e.type="category"),e.type==="category"&&!e.data){let n=s[0].data;Array.isArray(n)&&n.length>0?Array.isArray(n[0])?e.data=n.map(o=>o[0]):e.data=n.map((o,f)=>i("genui.chart.itemDefault",{n:f+1})):e.data=[]}t.xAxis=e}t.yAxis?typeof t.yAxis=="object"&&!Array.isArray(t.yAxis)&&(t.yAxis.type||(t.yAxis.type="value")):t.yAxis={type:"value"}}if(!t.title)t.title={text:i("genui.chart.title"),left:"left"};else if(typeof t.title=="object"){let e=t.title;e.left||(e.left="left"),e.text||(e.text=i("genui.chart.title")),t.title=e}if(t.tooltip||(t.tooltip={trigger:r==="pie"?"item":"axis"}),!t.legend)s.length>1&&(t.legend={right:0,orient:"vertical"});else if(typeof t.legend=="object"){let e=t.legend;t.legend=e}return r!=="pie"&&!t.grid&&(t.grid={left:"3%",right:"4%",bottom:"3%",containLabel:!0}),t}function O(l,i){let s=null;try{let n=typeof l=="string"?l:l.join("");s=(0,R.parse)(n)}catch(n){return{data:null,error:`Failed to parse JSON: ${n instanceof Error?n.message:String(n)}`}}if(!s||typeof s!="object")return{data:null,error:"Parsed data is not an object"};let t=s.series&&Array.isArray(s.series)&&s.series.length>0,r={table:Array.isArray(s.table)?s.table:void 0},e=null;if(s.echarts?e=s.echarts:t&&(e=s),e){let n=j(e,i);if(n)r.echarts=n;else if(r.table&&r.table.length>0)r.echarts=g(r.table,i);else return{data:null,error:"ECharts configuration is invalid or incomplete. Required: series array with at least one series containing type and data."}}else r.table&&r.table.length>0?r.echarts=g(r.table,i):r.echarts=g([],i);return{data:r,error:null}}var K=l=>{let{children:i}=l,s=v(),t=(0,u.useRef)(null),r=(0,u.useRef)(null),e=(0,u.useRef)(null),[n,o]=(0,u.useState)(null);(0,u.useEffect)(()=>{if(!t.current)return;r.current||(r.current=D(t.current));let a=null;if((typeof i=="string"||Array.isArray(i))&&(a=i),!a){r.current&&r.current.clear(),o(null);return}let{data:c,error:m}=O(a,s);if(m||!c){console.warn("ReactChart failed to parse chart data:",m||"Unknown parse error"),r.current&&r.current.clear(),o(null);return}if(c.table&&Array.isArray(c.table)&&o(c.table),c.echarts)try{r.current.setOption(c.echarts,!0)}catch(d){let A=d instanceof Error?d.message:"Failed to render chart";console.error("Failed to set ECharts option:",d),r.current&&r.current.clear(),o(null)}let h=()=>{r.current&&r.current.resize()};return e.current&&(e.current.disconnect(),e.current=null),t.current&&typeof ResizeObserver<"u"&&(e.current=new ResizeObserver(d=>{requestAnimationFrame(()=>{h()})}),e.current.observe(t.current)),window.addEventListener("resize",h),()=>{e.current&&(e.current.disconnect(),e.current=null),window.removeEventListener("resize",h)}},[i,s]),(0,u.useEffect)(()=>()=>{e.current&&(e.current.disconnect(),e.current=null),r.current&&(r.current.dispose(),r.current=null)},[]);let f=a=>{if(!a||a.length===0)return[];if(Array.isArray(a[0])){let c=a[0];return a.slice(1).map((h,d)=>{let A={};return h.forEach((S,b)=>{A[c[b]||`col_${b}`]=S}),A})}return a};return(0,y.jsxs)(x,{children:[(0,y.jsx)("div",{ref:t,style:{width:"100%",height:"400px",minHeight:"300px"}}),n&&n.length>0&&(0,y.jsx)("div",{style:{marginTop:16},children:(0,y.jsx)(E,{component_key:"chart_table_data",data:{dataSource:f(n),message:s("genui.chart.dataDetails")},interactive:!0,default_open_in_side_app:!0})})]})};export{K as ReactChart};
@@ -1,4 +1,4 @@
1
- import{a as a1,b as c1,d as Bl,n as l1}from"./embed-page-chunk-YJUCDIYK.js";import{a as s1}from"./embed-page-chunk-7TH7FFVA.js";import{j as Ss}from"./embed-page-chunk-IGOT476M.js";import"./embed-page-chunk-QLA2XU73.js";import{q as Dl}from"./embed-page-chunk-IJPRKD63.js";import"./embed-page-chunk-IRP2UOPH.js";import{B as gi,C as n1,D as i1,E as o1,f as t1,g as r1,k as gn}from"./embed-page-chunk-DM5ESF6C.js";import{a as Kg,b as Zg,c as Qg,d as Jg,e as e1}from"./embed-page-chunk-SV2BM3WO.js";import"./embed-page-chunk-S4XZPBRM.js";import{a as Ug}from"./embed-page-chunk-QV7QAJ4N.js";import{a as z9}from"./embed-page-chunk-R5QL57JJ.js";import{c as Vg,d as $9,f as Mo}from"./embed-page-chunk-QBTAJ2YI.js";var f9=Vg((k4e,d9)=>{"use strict";var u9=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;d9.exports=function(e,t){t=t||{};var r=1,n=1;function i(k){var R=k.match(/\n/g);R&&(r+=R.length);var G=k.lastIndexOf(`
1
+ import{a as a1,b as c1,d as Bl,n as l1}from"./embed-page-chunk-V7R2Y72J.js";import{a as s1}from"./embed-page-chunk-7TH7FFVA.js";import{q as Dl}from"./embed-page-chunk-IJPRKD63.js";import{B as gi,C as n1,D as i1,E as o1,f as t1,g as r1,k as gn}from"./embed-page-chunk-DM5ESF6C.js";import{a as Kg,b as Zg,c as Qg,d as Jg,e as e1}from"./embed-page-chunk-SV2BM3WO.js";import"./embed-page-chunk-S4XZPBRM.js";import{j as Ss}from"./embed-page-chunk-IGOT476M.js";import"./embed-page-chunk-QLA2XU73.js";import"./embed-page-chunk-IRP2UOPH.js";import{a as Ug}from"./embed-page-chunk-QV7QAJ4N.js";import{a as z9}from"./embed-page-chunk-R5QL57JJ.js";import{c as Vg,d as $9,f as Mo}from"./embed-page-chunk-QBTAJ2YI.js";var f9=Vg((k4e,d9)=>{"use strict";var u9=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;d9.exports=function(e,t){t=t||{};var r=1,n=1;function i(k){var R=k.match(/\n/g);R&&(r+=R.length);var G=k.lastIndexOf(`
2
2
  `);n=~G?k.length-G:n+k.length}function o(){var k={line:r,column:n};return function(R){return R.position=new s(k),x(),R}}function s(k){this.start=k,this.end={line:r,column:n},this.source=t.source}s.prototype.content=e;var a=[];function c(k){var R=new Error(t.source+":"+r+":"+n+": "+k);if(R.reason=k,R.filename=t.source,R.line=r,R.column=n,R.source=e,t.silent)a.push(R);else throw R}function l(){var k=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:k,parsingErrors:a}}}function u(){return p(/^{\s*/)}function f(){return p(/^}/)}function h(){var k,R=[];for(x(),m(R);e.length&&e.charAt(0)!="}"&&(k=X()||D());)k!==!1&&(R.push(k),m(R));return R}function p(k){var R=k.exec(e);if(R){var G=R[0];return i(G),e=e.slice(G.length),R}}function x(){p(/^\s*/)}function m(k){var R;for(k=k||[];R=g();)R!==!1&&k.push(R);return k}function g(){var k=o();if(!(e.charAt(0)!="/"||e.charAt(1)!="*")){for(var R=2;e.charAt(R)!=""&&(e.charAt(R)!="*"||e.charAt(R+1)!="/");)++R;if(R+=2,e.charAt(R-1)==="")return c("End of comment missing");var G=e.slice(2,R-2);return n+=2,i(G),e=e.slice(R),n+=2,k({type:"comment",comment:G})}}function y(){var k=p(/^([^{]+)/);if(k)return mn(k[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(R){return R.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(R){return R.replace(/\u200C/g,",")})}function b(){var k=o(),R=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(R){if(R=mn(R[0]),!p(/^:\s*/))return c("property missing ':'");var G=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),W=k({type:"declaration",property:R.replace(u9,""),value:G?mn(G[0]).replace(u9,""):""});return p(/^[;\s]*/),W}}function _(){var k=[];if(!u())return c("missing '{'");m(k);for(var R;R=b();)R!==!1&&(k.push(R),m(k));return f()?k:c("missing '}'")}function v(){for(var k,R=[],G=o();k=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)R.push(k[1]),p(/^,\s*/);if(R.length)return G({type:"keyframe",values:R,declarations:_()})}function w(){var k=o(),G=p(/^@([-\w]+)?keyframes\s*/);if(G){var R=G[1],G=p(/^([-\w]+)\s*/);if(!G)return c("@keyframes missing name");var W=G[1];if(!u())return c("@keyframes missing '{'");for(var N,L=m();N=v();)L.push(N),L=L.concat(m());return f()?k({type:"keyframes",name:W,vendor:R,keyframes:L}):c("@keyframes missing '}'")}}function q(){var k=o(),R=p(/^@supports *([^{]+)/);if(R){var G=mn(R[1]);if(!u())return c("@supports missing '{'");var W=m().concat(h());return f()?k({type:"supports",supports:G,rules:W}):c("@supports missing '}'")}}function C(){var k=o(),R=p(/^@host\s*/);if(R){if(!u())return c("@host missing '{'");var G=m().concat(h());return f()?k({type:"host",rules:G}):c("@host missing '}'")}}function S(){var k=o(),R=p(/^@media *([^{]+)/);if(R){var G=mn(R[1]);if(!u())return c("@media missing '{'");var W=m().concat(h());return f()?k({type:"media",media:G,rules:W}):c("@media missing '}'")}}function I(){var k=o(),R=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(R)return k({type:"custom-media",name:mn(R[1]),media:mn(R[2])})}function M(){var k=o(),R=p(/^@page */);if(R){var G=y()||[];if(!u())return c("@page missing '{'");for(var W=m(),N;N=b();)W.push(N),W=W.concat(m());return f()?k({type:"page",selectors:G,declarations:W}):c("@page missing '}'")}}function T(){var k=o(),R=p(/^@([-\w]+)?document *([^{]+)/);if(R){var G=mn(R[1]),W=mn(R[2]);if(!u())return c("@document missing '{'");var N=m().concat(h());return f()?k({type:"document",document:W,vendor:G,rules:N}):c("@document missing '}'")}}function P(){var k=o(),R=p(/^@font-face\s*/);if(R){if(!u())return c("@font-face missing '{'");for(var G=m(),W;W=b();)G.push(W),G=G.concat(m());return f()?k({type:"font-face",declarations:G}):c("@font-face missing '}'")}}var A=H("import"),j=H("charset"),B=H("namespace");function H(k){var R=new RegExp("^@"+k+"\\s*([^;]+);");return function(){var G=o(),W=p(R);if(W){var N={type:k};return N[k]=W[1].trim(),G(N)}}}function X(){if(e[0]=="@")return w()||S()||I()||q()||A()||j()||B()||T()||M()||C()||P()}function D(){var k=o(),R=y();return R?(m(),k({type:"rule",selectors:R,declarations:_()})):c("selector missing")}return Tg(l())};function mn(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Tg(e,t){var r=e&&typeof e.type=="string",n=r?e:t;for(var i in e){var o=e[i];Array.isArray(o)?o.forEach(function(s){Tg(s,n)}):o&&typeof o=="object"&&Tg(o,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}});var _9=Vg((W4e,Lg)=>{"use strict";var kL=Object.prototype.hasOwnProperty,rr="~";function ws(){}Object.create&&(ws.prototype=Object.create(null),new ws().__proto__||(rr=!1));function RL(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function b9(e,t,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new RL(r,n||e,i),s=rr?rr+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],o]:e._events[s].push(o):(e._events[s]=o,e._eventsCount++),e}function El(e,t){--e._eventsCount===0?e._events=new ws:delete e._events[t]}function Yt(){this._events=new ws,this._eventsCount=0}Yt.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)kL.call(r,n)&&t.push(rr?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};Yt.prototype.listeners=function(t){var r=rr?rr+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s};Yt.prototype.listenerCount=function(t){var r=rr?rr+t:t,n=this._events[r];return n?n.fn?1:n.length:0};Yt.prototype.emit=function(t,r,n,i,o,s){var a=rr?rr+t:t;if(!this._events[a])return!1;var c=this._events[a],l=arguments.length,u,f;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,r),!0;case 3:return c.fn.call(c.context,r,n),!0;case 4:return c.fn.call(c.context,r,n,i),!0;case 5:return c.fn.call(c.context,r,n,i,o),!0;case 6:return c.fn.call(c.context,r,n,i,o,s),!0}for(f=1,u=new Array(l-1);f<l;f++)u[f-1]=arguments[f];c.fn.apply(c.context,u)}else{var h=c.length,p;for(f=0;f<h;f++)switch(c[f].once&&this.removeListener(t,c[f].fn,void 0,!0),l){case 1:c[f].fn.call(c[f].context);break;case 2:c[f].fn.call(c[f].context,r);break;case 3:c[f].fn.call(c[f].context,r,n);break;case 4:c[f].fn.call(c[f].context,r,n,i);break;default:if(!u)for(p=1,u=new Array(l-1);p<l;p++)u[p-1]=arguments[p];c[f].fn.apply(c[f].context,u)}}return!0};Yt.prototype.on=function(t,r,n){return b9(this,t,r,n,!1)};Yt.prototype.once=function(t,r,n){return b9(this,t,r,n,!0)};Yt.prototype.removeListener=function(t,r,n,i){var o=rr?rr+t:t;if(!this._events[o])return this;if(!r)return El(this,o),this;var s=this._events[o];if(s.fn)s.fn===r&&(!i||s.once)&&(!n||s.context===n)&&El(this,o);else{for(var a=0,c=[],l=s.length;a<l;a++)(s[a].fn!==r||i&&!s[a].once||n&&s[a].context!==n)&&c.push(s[a]);c.length?this._events[o]=c.length===1?c[0]:c:El(this,o)}return this};Yt.prototype.removeAllListeners=function(t){var r;return t?(r=rr?rr+t:t,this._events[r]&&El(this,r)):(this._events=new ws,this._eventsCount=0),this};Yt.prototype.off=Yt.prototype.removeListener;Yt.prototype.addListener=Yt.prototype.on;Yt.prefixed=rr;Yt.EventEmitter=Yt;typeof Lg<"u"&&(Lg.exports=Yt)});var u1={name:"@antv/infographic",version:"0.2.8",workspaces:["dev","site"],description:"An Infographic Generation and Rendering Framework, bring words to life!",keywords:["antv","infographic","visualization"],repository:"git@github.com:antvis/Infographic.git",license:"MIT",author:"Aarebecca",exports:{".":{types:"./esm/index.d.ts",require:"./lib/index.js",import:"./esm/index.js"},"./jsx-runtime":{types:"./esm/jsx-runtime.d.ts",require:"./lib/jsx-runtime.js",import:"./esm/jsx-runtime.js"},"./jsx-dev-runtime":{types:"./esm/jsx-dev-runtime.d.ts",require:"./lib/jsx-dev-runtime.js",import:"./esm/jsx-dev-runtime.js"},"./ssr":{types:"./lib/ssr/index.d.ts",require:"./lib/ssr/index.js",import:"./esm/ssr/index.js"}},main:"./lib/index.js",jsdelivr:"./dist/infographic.umd.min.js",unpkg:"./dist/infographic.umd.min.js",module:"./esm/index.js",types:"./esm/index.d.ts",files:["lib","esm","dist","src"],scripts:{build:"run-s clean build:esm build:cjs build:umd size","build:cjs":"tsc --module commonjs --outDir lib","build:esm":"tsc --module ESNext --outDir esm","build:site":"npm --prefix site run build:static","build:umd":"vite build","build:watch":"tsc -p tsconfig.json --watch","check:test":"tsc --noEmit -p __tests__",ci:"run-s build test lint",clean:"rimraf esm lib dist tsconfig.tsbuildinfo",dev:"cd dev && npm run dev",format:"prettier --write . --ignore-path ./.gitignore",lint:"run-s lint:root lint:site","lint:root":"eslint . --ext .ts,.tsx --ignore-pattern 'site/**' && npm run check:test","lint:site":"npm --prefix site run lint",prepublishOnly:"npm run ci",size:"size-limit",test:"vitest --run --coverage"},commitlint:{extends:["@commitlint/config-conventional"]},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write"]},prettier:{plugins:["prettier-plugin-organize-imports","prettier-plugin-packagejson"],singleQuote:!0,overrides:[{files:["*.md","*.mdx"],options:{embeddedLanguageFormatting:"off"}}]},dependencies:{"@antv/hierarchy":"^0.7.0","@antv/layout":"^2.0.0-beta.0",css:"^3.0.0",culori:"^4.0.2",d3:"^7.9.0",eventemitter3:"^5.0.1",flru:"^1.0.2",linkedom:"^0.18.12","lodash-es":"^4.17.21",measury:"^0.1.3",roughjs:"^4.6.6","round-polygon":"^0.6.7",tinycolor2:"^1.6.0"},devDependencies:{"@commitlint/cli":"^19.8.1","@commitlint/config-conventional":"^19.8.1","@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-node-resolve":"^16.0.3","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-typescript":"^12.3.0","@size-limit/file":"^11.2.0","@types/css":"^0.0.38","@types/culori":"^4.0.1","@types/d3":"^7.4.3","@types/jsdom":"^21.1.7","@types/lodash-es":"^4.17.12","@types/node":"^24.3.1","@types/tinycolor2":"^1.4.6","@vitest/coverage-v8":"^3.2.4","any-skills":"^0.1.1",csstype:"^3.2.2",eslint:"^9.35.0",globals:"^16.4.0","gzip-size":"^7.0.0",husky:"^9.1.7",jiti:"^2.5.1",jsdom:"^27.0.0","lint-staged":"^16.1.6","npm-run-all":"^4.1.5",prettier:"^3.6.2","prettier-plugin-organize-imports":"^4.2.0","prettier-plugin-packagejson":"^2.5.19",rimraf:"^6.1.0",rollup:"^4.53.2","rollup-plugin-visualizer":"^6.0.5","size-limit":"^11.2.0",typescript:"^5.9.2","typescript-eslint":"^8.43.0",vite:"^7.1.5","vite-node":"^3.2.4","vite-tsconfig-paths":"^5.1.4",vitest:"^3.2.4"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/",tag:"latest"},"size-limit":[{gzip:!0,limit:"500 Kb",path:"dist/infographic.min.js"},{limit:"500 Kb",path:"dist/infographic.min.js"}]};var d1=new Map;function Nl(e,t){d1.set(e,t)}function Gl(e){return d1.get(e)}var Ao={edgeType:"curved",edgeColorMode:"gradient",edgeWidth:2,colorMode:"branch",levelGap:80,nodeGap:18},Lo={edgeType:"curved",edgeWidth:2,edgeColorMode:"gradient",colorMode:"level",levelGap:80,nodeGap:18},f1={type:"lined-text",usePaletteColor:!0,showUnderline:!0,underlineThickness:2},h1={type:"capsule-item"},p1={type:"circular-progress"},m1={type:"rounded-rect-node",positionH:"center"},g1={type:"compact-card"},F9=(e,t)=>({type:"hierarchy-mindmap",...t!==void 0?{edgeAlign:t}:{},...e}),Dr=(e,t,r,n)=>[e,{design:{structure:F9(t,n),item:r}}],x1=Object.fromEntries([Dr("hierarchy-mindmap-branch-gradient-lined-palette",Ao,f1,"bottom"),Dr("hierarchy-mindmap-level-gradient-lined-palette",Lo,f1,"bottom"),Dr("hierarchy-mindmap-branch-gradient-capsule-item",Ao,h1),Dr("hierarchy-mindmap-level-gradient-capsule-item",Lo,h1),Dr("hierarchy-mindmap-branch-gradient-circle-progress",Ao,p1,.4),Dr("hierarchy-mindmap-level-gradient-circle-progress",Lo,p1,.4),Dr("hierarchy-mindmap-branch-gradient-rounded-rect",Ao,m1),Dr("hierarchy-mindmap-level-gradient-rounded-rect",Lo,m1),Dr("hierarchy-mindmap-branch-gradient-compact-card",Ao,g1),Dr("hierarchy-mindmap-level-gradient-compact-card",Lo,g1)]);var y1={"hierarchy-structure":{design:{title:"default",structure:{type:"hierarchy-structure"},item:"simple"}},"hierarchy-structure-mirror":{design:{title:"default",structure:{type:"hierarchy-structure",layerLabelPosition:"right"},item:"simple"}}};var j9={"tech-style":{edgeType:"straight",edgeStyle:"solid",edgeColorMode:"gradient",edgeMarker:"arrow",markerSize:12,edgeCornerRadius:5},"dashed-line":{edgeStyle:"dashed",edgeCornerRadius:10,edgeDashPattern:"10,5",edgeColorMode:"gradient",edgeMarker:"dot",markerSize:6,edgeOffset:6},"distributed-origin":{edgeOrigin:"distributed",edgeOriginPadding:30,edgeMarker:"arrow",edgeCornerRadius:10,markerSize:12,edgeColorMode:"gradient"},"curved-line":{edgeType:"curved",edgeColorMode:"gradient",edgeMarker:"none"},"dashed-arrow":{edgeType:"straight",edgeStyle:"dashed",edgeDashPattern:"8,4",edgeMarker:"arrow",markerSize:10,edgeCornerRadius:0}},D9=["capsule-item","rounded-rect-node","compact-card","badge-card","ribbon-card"],Wl={},b1="hierarchy-tree",B9=[{key:""},{key:"bt",orientation:"bottom-top"},{key:"lr",orientation:"left-right"},{key:"rl",orientation:"right-left"}],N9=(e,t,r)=>e?`${b1}-${e}-${t}-${r}`:`${b1}-${t}-${r}`;for(let e of D9)for(let[t,r]of Object.entries(j9))for(let{key:n,orientation:i}of B9){let o=N9(n,t,e);Wl[o]={design:{structure:{type:"hierarchy-tree",...i?{orientation:i}:{},...r},item:{type:e}}}}var _1={"list-zigzag-up-compact-card":{design:{title:"default",structure:{type:"list-zigzag-up"},items:[{type:"compact-card"}]},themeConfig:{colorPrimary:"#17CA2C"}},"list-zigzag-up-simple":{design:{title:"default",structure:{type:"list-zigzag-up"},items:[{type:"simple",usePaletteColor:!0}]},themeConfig:{colorPrimary:"#17CA2C"}},"list-zigzag-down-compact-card":{design:{title:"default",structure:{type:"list-zigzag-down"},items:[{type:"compact-card"}]},themeConfig:{colorPrimary:"#17CA2C"}},"list-zigzag-down-simple":{design:{title:"default",structure:{type:"list-zigzag-down"},items:[{type:"simple",usePaletteColor:!0}]},themeConfig:{colorPrimary:"#17CA2C"}}};var G9={"simple-circle-node":{type:"simple-circle-node"},"badge-card":{type:"badge-card"},capsule:{type:"capsule-item"},"compact-card":{type:"compact-card"}},Es={type:"relation-dagre-flow",edgeColorMode:"gradient",showArrow:!0,arrowType:"triangle",colorMode:"node"},W9={tb:{...Es,rankdir:"TB",edgeRouting:"orth"},lr:{...Es,rankdir:"LR",edgeRouting:"orth"},"tb-animated":{...Es,rankdir:"TB",edgeCornerRadius:12,edgeRouting:"orth",edgeAnimation:"ant-line",edgeDashPattern:"8,4",edgeAnimationSpeed:1},"lr-animated":{...Es,rankdir:"LR",edgeCornerRadius:12,edgeRouting:"orth",edgeAnimation:"ant-line",edgeDashPattern:"8,4",edgeAnimationSpeed:1}},Xl={},X9=["lr-capsule","tb-capsule"];Object.entries(W9).forEach(([e,t])=>{Object.entries(G9).forEach(([r,n])=>{let i=`${e}-${r}`;if(X9.includes(i))return;let o=`relation-dagre-flow-${i}`;Xl[o]={design:{title:"default",structure:t,item:n}}})});var v1={"sequence-stairs-front-pill-badge":{design:{title:"default",structure:{type:"sequence-stairs-front"},items:[{type:"pill-badge"}]}},"sequence-stairs-front-compact-card":{design:{title:"default",structure:{type:"sequence-stairs-front"},items:[{type:"compact-card"}]}},"sequence-stairs-front-simple":{design:{title:"default",structure:{type:"sequence-stairs-front"},items:[{type:"simple",usePaletteColor:!0}]}}};var w1={"chart-wordcloud-rotate":{design:{structure:{type:"chart-wordcloud"},item:"simple"}},"chart-wordcloud":{design:{structure:{type:"chart-wordcloud",enableRotate:!1},item:"simple"}}};var Y9={"compare-hierarchy-left-right-circle-node-pill-badge":{design:{structure:{type:"compare-hierarchy-left-right",decoration:"split-line",surround:!1,groupGap:-20},title:"default",items:[{type:"circle-node",width:240},"pill-badge"]},themeConfig:{}},"compare-hierarchy-left-right-circle-node-plain-text":{design:{title:"default",structure:{type:"compare-hierarchy-left-right",decoration:"dot-line",flipLeaf:!0,groupGap:-10},items:[{type:"circle-node",width:180},{type:"plain-text"}]}},"list-pyramid-rounded-rect-node":{design:{title:"default",structure:{type:"list-pyramid"},items:[{type:"rounded-rect-node"}]}},"list-pyramid-badge-card":{design:{title:"default",structure:{type:"list-pyramid"},items:[{type:"badge-card"}]}},"list-pyramid-compact-card":{design:{title:"default",structure:{type:"list-pyramid"},items:[{type:"compact-card"}]}},"list-column-done-list":{design:{title:"default",structure:{type:"list-column"},items:[{type:"done-list"}]}},"list-column-vertical-icon-arrow":{design:{title:"default",structure:{type:"list-column",gap:-5,zigzag:!0},items:[{type:"vertical-icon-arrow"}]}},"list-grid-badge-card":{design:{title:"default",structure:{type:"list-grid"},items:[{type:"badge-card"}]}},"list-grid-candy-card-lite":{design:{title:"default",structure:{type:"list-grid"},items:[{type:"candy-card-lite"}]}},"chart-column-simple":{design:{title:"default",structure:{type:"chart-column"},items:[{type:"simple",showIcon:!1,usePaletteColor:!0}]}},"list-grid-circular-progress":{design:{title:"default",structure:{type:"list-grid"},items:[{type:"circular-progress"}]}},"list-grid-compact-card":{design:{title:"default",structure:{type:"list-grid"},items:[{type:"compact-card"}]}},"list-grid-done-list":{design:{title:"default",structure:{type:"list-grid"},items:[{type:"done-list"}]}},"list-grid-horizontal-icon-arrow":{design:{title:"default",structure:{type:"list-grid",gap:0,zigzag:!0},items:[{type:"horizontal-icon-arrow"}]}},"list-grid-progress-card":{design:{title:"default",structure:{type:"list-grid"},items:[{type:"progress-card"}]}},"list-grid-ribbon-card":{design:{title:"default",structure:{type:"list-grid"},items:[{type:"ribbon-card"}]}},"list-grid-simple":{design:{title:"default",structure:{type:"list-grid"},items:[{type:"simple"}]}},"list-row-circular-progress":{design:{title:"default",structure:{type:"list-row"},items:[{type:"circular-progress"}]}},"list-row-horizontal-icon-arrow":{design:{title:"default",structure:{type:"list-row",gap:0,zigzag:!0},items:[{type:"horizontal-icon-arrow"}]}},"relation-circle-circular-progress":{design:{title:"default",structure:{type:"relation-circle"},items:[{type:"circular-progress"}]}},"relation-circle-icon-badge":{design:{title:"default",structure:{type:"relation-circle"},items:[{type:"icon-badge"}]}},"sequence-steps-badge-card":{design:{title:"default",structure:{type:"sequence-steps"},items:[{type:"badge-card"}]}},"sequence-steps-simple":{design:{title:"default",structure:{type:"sequence-steps",gap:10},items:[{type:"simple"}]}},"sequence-timeline-done-list":{design:{title:"default",structure:{type:"sequence-timeline"},items:[{type:"done-list"}]}},"sequence-timeline-plain-text":{design:{title:"default",structure:{type:"sequence-timeline"},items:[{type:"plain-text"}]}},"sequence-timeline-rounded-rect-node":{design:{title:"default",structure:{type:"sequence-timeline"},items:[{type:"rounded-rect-node"}]}},"sequence-ascending-steps":{design:{title:"default",structure:{type:"sequence-ascending-steps",vGap:-46,hGap:-20},items:[{type:"l-corner-card"}]}},"sequence-timeline-simple":{design:{title:"default",structure:{type:"sequence-timeline",gap:20},items:[{type:"simple",positionV:"middle"}]}},"sequence-cylinders-3d-simple":{design:{title:"default",structure:{type:"sequence-cylinders-3d",gapY:20},items:[{type:"simple",showIcon:!1,usePaletteColor:!0}]}},"list-column-simple-vertical-arrow":{design:{title:"default",structure:{type:"list-column",gap:0,zigzag:!0},items:[{type:"simple-vertical-arrow"}]}},"list-row-simple-horizontal-arrow":{design:{title:"default",structure:{type:"list-row",gap:0,zigzag:!0},items:[{type:"simple-horizontal-arrow"}]}},"compare-swot":{design:{title:"default",structure:{type:"compare-hierarchy-row",itemGap:32,itemPadding:40,showColumnBackground:!0,columnBackgroundAlpha:.08},items:[{type:"letter-card",showBottomShade:!1},{type:"plain-text",formatter:e=>`\u25CF ${e}`,usePaletteColor:!0}]}},"compare-hierarchy-row-letter-card-compact-card":{design:{title:"default",structure:{type:"compare-hierarchy-row"},items:[{type:"letter-card"},{type:"compact-card"}]}},"compare-hierarchy-row-letter-card-rounded-rect-node":{design:{title:"default",structure:{type:"compare-hierarchy-row"},items:[{type:"letter-card"},{type:"rounded-rect-node"}]}},"sequence-snake-steps-compact-card":{design:{title:"default",structure:{type:"sequence-snake-steps"},items:[{type:"compact-card"}]}},"sequence-snake-steps-pill-badge":{design:{title:"default",structure:{type:"sequence-snake-steps"},items:[{type:"pill-badge"}]}},"sequence-snake-steps-simple":{design:{title:"default",structure:{type:"sequence-snake-steps"},items:[{type:"simple"}]}},"sequence-color-snake-steps-horizontal-icon-line":{design:{title:"default",structure:{type:"sequence-color-snake-steps"},items:[{type:"horizontal-icon-line"}]}},"sequence-pyramid-simple":{design:{title:"default",structure:{type:"sequence-pyramid"},items:[{type:"simple",showIcon:!1,usePaletteColor:!0}]},themeConfig:{colorPrimary:"#1677ff"}},"sequence-funnel-simple":{design:{title:"default",structure:{type:"sequence-funnel"},items:[{type:"simple",showIcon:!1,usePaletteColor:!0}]},themeConfig:{palette:"#1677ff"}},"list-row-horizontal-icon-line":{design:{title:"default",structure:{type:"list-row",gap:0,zigzag:!0},items:[{type:"horizontal-icon-line"}]}},"list-sector-simple":{design:{title:"default",structure:{type:"list-sector"},items:[{type:"simple"}]}},"list-sector-plain-text":{design:{title:"default",structure:{type:"list-sector"},items:[{type:"plain-text"}]}},"list-sector-half-plain-text":{design:{title:"default",structure:{type:"list-sector",startAngle:-180,endAngle:0},items:[{type:"plain-text"}]}},"quadrant-quarter-simple-card":{design:{title:"default",structure:{type:"quadrant"},items:[{type:"quarter-simple-card"}]}},"quadrant-quarter-circular":{design:{title:"default",structure:{type:"quadrant"},items:[{type:"quarter-circular"}]}},"sequence-roadmap-vertical-plain-text":{design:{title:"default",structure:{type:"sequence-roadmap-vertical"},items:[{type:"plain-text"}]}},"sequence-roadmap-vertical-simple":{design:{title:"default",structure:{type:"sequence-roadmap-vertical"},items:[{type:"simple",showIcon:!1}]}},"sequence-roadmap-vertical-badge-card":{design:{title:"default",structure:{type:"sequence-roadmap-vertical"},items:[{type:"badge-card"}]}},"sequence-roadmap-vertical-pill-badge":{design:{title:"default",structure:{type:"sequence-roadmap-vertical"},items:[{type:"pill-badge"}]}},"sequence-roadmap-vertical-quarter-circular":{design:{title:"default",structure:{type:"sequence-roadmap-vertical"},items:[{type:"quarter-circular"}]}},"sequence-roadmap-vertical-quarter-simple-card":{design:{title:"default",structure:{type:"sequence-roadmap-vertical",flipped:!0},items:[{type:"quarter-simple-card"}]}},"sequence-horizontal-zigzag-simple-illus":{design:{title:"default",structure:{type:"sequence-horizontal-zigzag"},items:[{type:"simple-illus"}]}},"sequence-horizontal-zigzag-horizontal-icon-line":{design:{title:"default",structure:{type:"sequence-horizontal-zigzag"},items:[{type:"horizontal-icon-line"}]}},"sequence-horizontal-zigzag-plain-text":{design:{title:"default",structure:{type:"sequence-horizontal-zigzag"},items:[{type:"plain-text"}]}},"sequence-horizontal-zigzag-simple-horizontal-arrow":{design:{title:"default",structure:{type:"sequence-horizontal-zigzag"},items:[{type:"simple-horizontal-arrow"}]}},"sequence-horizontal-zigzag-simple":{design:{title:"default",structure:{type:"sequence-horizontal-zigzag"},items:[{type:"simple"}]}},"list-row-simple-illus":{design:{title:"default",structure:{type:"list-row"},items:[{type:"simple-illus"}]}},"quadrant-simple-illus":{design:{title:"default",structure:{type:"quadrant"},items:[{type:"simple-illus"}]}},"sequence-color-snake-steps-simple-illus":{design:{title:"default",structure:{type:"sequence-color-snake-steps"},items:[{type:"simple-illus"}]}},"sequence-snake-steps-simple-illus":{design:{title:"default",structure:{type:"sequence-snake-steps"},items:[{type:"simple-illus"}]}},"sequence-steps-simple-illus":{design:{title:"default",structure:{type:"sequence-steps"},items:[{type:"simple-illus"}]}},"sequence-timeline-simple-illus":{design:{title:"default",structure:{type:"sequence-timeline"},items:[{type:"simple-illus",usePaletteColor:!0}]}},"sequence-zigzag-steps-underline-text":{design:{title:"default",structure:{type:"sequence-zigzag-steps"},items:[{type:"underline-text"}]}},"sequence-horizontal-zigzag-underline-text":{design:{title:"default",structure:{type:"sequence-horizontal-zigzag"},items:[{type:"underline-text"}]}},"sequence-roadmap-vertical-underline-text":{design:{title:"default",structure:{type:"sequence-roadmap-vertical"},items:[{type:"underline-text"}]}},"sequence-snake-steps-underline-text":{design:{title:"default",structure:{type:"sequence-snake-steps"},items:[{type:"underline-text"}]}},"sequence-circle-arrows-indexed-card":{design:{title:"default",structure:{type:"sequence-circle-arrows"},items:[{type:"indexed-card"}]}},"sequence-zigzag-pucks-3d-simple":{design:{title:"default",structure:{type:"sequence-zigzag-pucks-3d"},items:[{type:"simple",showIcon:!1,usePaletteColor:!0}]}},"sequence-zigzag-pucks-3d-underline-text":{design:{title:"default",structure:{type:"sequence-zigzag-pucks-3d"},items:[{type:"underline-text"}]}},"sequence-zigzag-pucks-3d-indexed-card":{design:{title:"default",structure:{type:"sequence-zigzag-pucks-3d"},items:[{type:"indexed-card"}]}},"sequence-ascending-stairs-3d-simple":{design:{title:"default",structure:{type:"sequence-ascending-stairs-3d"},items:[{type:"simple",showIcon:!1,usePaletteColor:!0}]}},"sequence-ascending-stairs-3d-underline-text":{design:{title:"default",structure:{type:"sequence-ascending-stairs-3d"},items:[{type:"underline-text"}]}},"sequence-circular-underline-text":{design:{title:"default",structure:{type:"sequence-circular"},items:[{type:"underline-text"}]}},"sequence-circular-simple":{design:{title:"default",structure:{type:"sequence-circular"},items:[{type:"simple",showIcon:!1,usePaletteColor:!0}]}},"sequence-filter-mesh-underline-text":{design:{title:"default",structure:{type:"sequence-filter-mesh"},items:[{type:"underline-text"}]}},"sequence-filter-mesh-simple":{design:{title:"default",structure:{type:"sequence-filter-mesh"},items:[{type:"simple",showIcon:!1,usePaletteColor:!0}]}},"sequence-mountain-underline-text":{design:{title:"default",structure:{type:"sequence-mountain"},items:[{type:"underline-text"}]}},"compare-binary-horizontal-simple-fold":{design:{title:"default",structure:{type:"compare-binary-horizontal",dividerType:"pros-cons-fold"},items:[{type:"simple",iconType:"circle",iconSize:40}]}},"compare-binary-horizontal-underline-text-fold":{design:{title:"default",structure:{type:"compare-binary-horizontal",dividerType:"pros-cons-fold"},items:[{type:"underline-text"}]}},"compare-binary-horizontal-badge-card-fold":{design:{title:"default",structure:{type:"compare-binary-horizontal",dividerType:"pros-cons-fold"},items:[{type:"badge-card"}]}},"compare-binary-horizontal-compact-card-fold":{design:{title:"default",structure:{type:"compare-binary-horizontal",dividerType:"pros-cons-fold"},items:[{type:"compact-card"}]}},"compare-binary-horizontal-simple-arrow":{design:{title:"default",structure:{type:"compare-binary-horizontal",dividerType:"pros-cons-arrow"},items:[{type:"simple",iconType:"circle",iconSize:40}]}},"compare-binary-horizontal-underline-text-arrow":{design:{title:"default",structure:{type:"compare-binary-horizontal",dividerType:"pros-cons-arrow"},items:[{type:"underline-text"}]}},"compare-binary-horizontal-badge-card-arrow":{design:{title:"default",structure:{type:"compare-binary-horizontal",dividerType:"pros-cons-arrow"},items:[{type:"badge-card"}]}},"compare-binary-horizontal-compact-card-arrow":{design:{title:"default",structure:{type:"compare-binary-horizontal",dividerType:"pros-cons-arrow"},items:[{type:"compact-card"}]}},"compare-binary-horizontal-simple-vs":{design:{title:"default",structure:{type:"compare-binary-horizontal",dividerType:"vs"},items:[{type:"simple",iconType:"circle",iconSize:40}]}},"compare-binary-horizontal-underline-text-vs":{design:{title:"default",structure:{type:"compare-binary-horizontal",dividerType:"vs"},items:[{type:"underline-text"}]}},"compare-binary-horizontal-badge-card-vs":{design:{title:"default",structure:{type:"compare-binary-horizontal",dividerType:"vs"},items:[{type:"badge-card"}]}},"compare-binary-horizontal-compact-card-vs":{design:{title:"default",structure:{type:"compare-binary-horizontal",dividerType:"vs"},items:[{type:"compact-card"}]}},"chart-bar-plain-text":{design:{title:"default",structure:{type:"chart-bar"},items:[{type:"plain-text",positionH:"flipped"}]}},"chart-line-plain-text":{design:{title:"default",structure:{type:"chart-line"},items:[{type:"plain-text",lineNumber:2}]}},"chart-pie-plain-text":{design:{title:"default",structure:{type:"chart-pie"},items:[{type:"plain-text"}]}},"chart-pie-compact-card":{design:{title:"default",structure:{type:"chart-pie"},items:[{type:"compact-card"}]}},"chart-pie-pill-badge":{design:{title:"default",structure:{type:"chart-pie"},items:[{type:"pill-badge"}]}},"chart-pie-donut-plain-text":{design:{title:"default",structure:{type:"chart-pie",innerRadius:90},items:[{type:"plain-text"}]}},"chart-pie-donut-compact-card":{design:{title:"default",structure:{type:"chart-pie",innerRadius:90},items:[{type:"compact-card"}]}},"chart-pie-donut-pill-badge":{design:{title:"default",structure:{type:"chart-pie",innerRadius:90},items:[{type:"pill-badge"}]}},...Wl,...x1,...v1,...w1,..._1,...Xl,...y1};Object.entries(Y9).forEach(([e,t])=>{Nl(e,t)});var De=Symbol.for("@antv/infographic/Fragment");function d(e,t={}){return{type:e,props:t}}var E=d;var Is=Symbol.for("@antv/infographic/Defs");function ke(e){return{type:Is,props:e}}function je(e){let{x:t=0,y:r=0,width:n=0,height:i=0}=e;return e.cx??(e.cx=t+n/2),e.cy??(e.cy=r+i/2),e.rx??(e.rx=n/2),e.ry??(e.ry=i/2),{type:"ellipse",props:e}}function O(e){let{x:t=0,y:r=0}=e;return(t||r)&&(e.transform||(e.transform=`translate(${t}, ${r})`)),{type:"g",props:e}}function ae(e){let{x:t,y:r}=e,n={...e};return(t!==void 0||r!==void 0)&&(n.transform=`translate(${t??0}, ${r??0})`),{type:"path",props:n}}function gt({points:e=[],...t}){let{x:r,y:n}=t,i=e.map(({x:a,y:c})=>`${a},${c}`).join(" "),o={...t,points:i};return(r!==void 0||n!==void 0)&&(o.transform=`translate(${r??0}, ${n??0})`+(o.transform||"")),{type:"polygon",props:o}}function we(e){return{type:"rect",props:e}}function Yl(e){return Object.keys(e[0]).reduce((t,r)=>{let n=r;return e.every(i=>i[n]===e[0][n])&&(t[n]=e[0][n]),t},{})}var V9=(e,t)=>{if(typeof e=="number"){if(t===3)return{mode:"rgb",r:(e>>8&15|e>>4&240)/255,g:(e>>4&15|e&240)/255,b:(e&15|e<<4&240)/255};if(t===4)return{mode:"rgb",r:(e>>12&15|e>>8&240)/255,g:(e>>8&15|e>>4&240)/255,b:(e>>4&15|e&240)/255,alpha:(e&15|e<<4&240)/255};if(t===6)return{mode:"rgb",r:(e>>16&255)/255,g:(e>>8&255)/255,b:(e&255)/255};if(t===8)return{mode:"rgb",r:(e>>24&255)/255,g:(e>>16&255)/255,b:(e>>8&255)/255,alpha:(e&255)/255}}},Ts=V9;var U9={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},q1=U9;var K9=e=>Ts(q1[e.toLowerCase()],6),C1=K9;var Z9=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,Q9=e=>{let t;return(t=e.match(Z9))?Ts(parseInt(t[1],16),t[1].length):void 0},S1=Q9;var Zt="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",Dk=`(?:${Zt}|none)`,ti=`${Zt}%`,Bk=`(?:${Zt}%|none)`,ko=`(?:${Zt}%|${Zt})`,J9=`(?:${Zt}%|${Zt}|none)`,E1=`(?:${Zt}(deg|grad|rad|turn)|${Zt})`,Nk=`(?:${Zt}(deg|grad|rad|turn)|${Zt}|none)`,xn="\\s*,\\s*";var Gk=new RegExp("^"+J9+"$");var eq=new RegExp(`^rgba?\\(\\s*${Zt}${xn}${Zt}${xn}${Zt}\\s*(?:,\\s*${ko}\\s*)?\\)$`),tq=new RegExp(`^rgba?\\(\\s*${ti}${xn}${ti}${xn}${ti}\\s*(?:,\\s*${ko}\\s*)?\\)$`),rq=e=>{let t={mode:"rgb"},r;if(r=e.match(eq))r[1]!==void 0&&(t.r=r[1]/255),r[2]!==void 0&&(t.g=r[2]/255),r[3]!==void 0&&(t.b=r[3]/255);else if(r=e.match(tq))r[1]!==void 0&&(t.r=r[1]/100),r[2]!==void 0&&(t.g=r[2]/100),r[3]!==void 0&&(t.b=r[3]/100);else return;return r[4]!==void 0?t.alpha=Math.max(0,Math.min(1,r[4]/100)):r[5]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+r[5]))),t},I1=rq;var nq=(e,t)=>e===void 0?void 0:typeof e!="object"?Qt(e):e.mode!==void 0?e:t?{...e,mode:t}:void 0,T1=nq;var iq=(e="rgb")=>t=>(t=T1(t,e))!==void 0?t.mode===e?t:Rr[t.mode][e]?Rr[t.mode][e](t):e==="rgb"?Rr[t.mode].rgb(t):Rr.rgb[e](Rr[t.mode].rgb(t)):void 0,ri=iq;var Rr={},M1={},Ro=[],Vl={},oq=e=>e,lt=e=>(Rr[e.mode]={...Rr[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(t=>{Rr[t]||(Rr[t]={}),Rr[t][e.mode]=e.fromMode[t]}),e.ranges||(e.ranges={}),e.difference||(e.difference={}),e.channels.forEach(t=>{if(e.ranges[t]===void 0&&(e.ranges[t]=[0,1]),!e.interpolate[t])throw new Error(`Missing interpolator for: ${t}`);typeof e.interpolate[t]=="function"&&(e.interpolate[t]={use:e.interpolate[t]}),e.interpolate[t].fixup||(e.interpolate[t].fixup=oq)}),M1[e.mode]=e,(e.parse||[]).forEach(t=>{A1(t,e.mode)}),ri(e.mode)),Ul=e=>M1[e],A1=(e,t)=>{if(typeof e=="string"){if(!t)throw new Error("'mode' required when 'parser' is a string");Vl[e]=t}else typeof e=="function"&&Ro.indexOf(e)<0&&Ro.push(e)};var Kl=/[^\x00-\x7F]|[a-zA-Z_]/,sq=/[^\x00-\x7F]|[-\w]/,ce={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},Ne=0;function Ms(e){let t=e[Ne],r=e[Ne+1];return t==="-"||t==="+"?/\d/.test(r)||r==="."&&/\d/.test(e[Ne+2]):t==="."?/\d/.test(r):/\d/.test(t)}function Zl(e){if(Ne>=e.length)return!1;let t=e[Ne];if(Kl.test(t))return!0;if(t==="-"){if(e.length-Ne<2)return!1;let r=e[Ne+1];return!!(r==="-"||Kl.test(r))}return!1}var aq={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function Po(e){let t="";if((e[Ne]==="-"||e[Ne]==="+")&&(t+=e[Ne++]),t+=As(e),e[Ne]==="."&&/\d/.test(e[Ne+1])&&(t+=e[Ne++]+As(e)),(e[Ne]==="e"||e[Ne]==="E")&&((e[Ne+1]==="-"||e[Ne+1]==="+")&&/\d/.test(e[Ne+2])?t+=e[Ne++]+e[Ne++]+As(e):/\d/.test(e[Ne+1])&&(t+=e[Ne++]+As(e))),Zl(e)){let r=Ls(e);return r==="deg"||r==="rad"||r==="turn"||r==="grad"?{type:ce.Hue,value:t*aq[r]}:void 0}return e[Ne]==="%"?(Ne++,{type:ce.Percentage,value:+t}):{type:ce.Number,value:+t}}function As(e){let t="";for(;/\d/.test(e[Ne]);)t+=e[Ne++];return t}function Ls(e){let t="";for(;Ne<e.length&&sq.test(e[Ne]);)t+=e[Ne++];return t}function cq(e){let t=Ls(e);return e[Ne]==="("?(Ne++,{type:ce.Function,value:t}):t==="none"?{type:ce.None,value:void 0}:{type:ce.Ident,value:t}}function lq(e=""){let t=e.trim(),r=[],n;for(Ne=0;Ne<t.length;){if(n=t[Ne++],n===`
3
3
  `||n===" "||n===" "){for(;Ne<t.length&&(t[Ne]===`
4
4
  `||t[Ne]===" "||t[Ne]===" ");)Ne++;continue}if(n===",")return;if(n===")"){r.push({type:ce.ParenClose});continue}if(n==="+"){if(Ne--,Ms(t)){r.push(Po(t));continue}return}if(n==="-"){if(Ne--,Ms(t)){r.push(Po(t));continue}if(Zl(t)){r.push({type:ce.Ident,value:Ls(t)});continue}return}if(n==="."){if(Ne--,Ms(t)){r.push(Po(t));continue}return}if(n==="/"){for(;Ne<t.length&&(t[Ne]===`
@@ -1 +1 @@
1
- import{b as Q,c as Se,e as Z,f as xe,g as ve,h as be,i as Te,l as Ce,m as we}from"./embed-page-chunk-5AWYMAAX.js";import{a as ge,b as me,c as ue,d as ke,e as he}from"./embed-page-chunk-SV2BM3WO.js";import"./embed-page-chunk-S4XZPBRM.js";import{a as q,b as Ne}from"./embed-page-chunk-3XPHW2C7.js";import{o as ne,t as re}from"./embed-page-chunk-5QZRLAW2.js";import{l as H}from"./embed-page-chunk-3FNSGFP2.js";import{a as j}from"./embed-page-chunk-QV7QAJ4N.js";import{D as de,E as pe,Ja as _,ea as ye,o as ce,sa as fe}from"./embed-page-chunk-L7GPZSYD.js";import{Ia as R,Ma as ae,Za as A,_ as h,_a as L,aa as ie,bb as se,ua as le,za as B}from"./embed-page-chunk-BUFWD6SE.js";import{a as oe}from"./embed-page-chunk-R5QL57JJ.js";import"./embed-page-chunk-EUOOO2LS.js";import{f as W}from"./embed-page-chunk-QBTAJ2YI.js";var u=W(oe());var m=W(oe());var e=W(j()),{Text:d}=se,{TextArea:ze}=R,Ae=({data:b})=>{let{message:S}=ie.useApp(),n=H(),{token:o}=L.useToken(),{config:D}=re(),{put:T}=q(),K=Se(t=>t.transform[2])>.6,U=ne("__GLOBAL__");if(!b)return null;let{skill:p,onClick:x,onDelete:I}=b;if(!p)return null;let[i,F]=(0,m.useState)(p),k=i.subSkills&&i.subSkills.length>0,M=i.subSkills?.length||0,P=(0,m.useMemo)(()=>Math.min(12+Math.sqrt(M)*10,48),[M]),V=i.metadata&&i.metadata.category||"global",C=(0,m.useMemo)(()=>i.metadata?Object.entries(i.metadata).filter(([t,s])=>t&&s):[],[i.metadata]),$=t=>{if(!t)return"";let s=t instanceof Date?t:new Date(t);return Number.isNaN(s.getTime())?"":s.toLocaleString()},Y=t=>{navigator.clipboard.writeText(t)},[v,w]=(0,m.useState)(!1),[l,r]=(0,m.useState)({...p,id:p.name}),[y,z]=(0,m.useState)(C.map(([t,s])=>({key:t,value:s}))),[G,E]=(0,m.useState)(!1),[X,a]=(0,m.useState)(!1);(0,m.useEffect)(()=>{w(!1),F(p),r({...p,id:p.name}),z(Object.entries(p.metadata||{}).map(([t,s])=>({key:t,value:s})))},[p]);let N=(t,s)=>{if(t==="name"){r(c=>({...c,name:s,id:s}));return}r(c=>({...c,[t]:s}))},J=async t=>{t?.stopPropagation(),t?.preventDefault();try{let s=i.id||i.name;if(!s){S.error(n("chatWorkspace.skillNode.idMissing"));return}await U.skills.delete(s),S.success(n("chatWorkspace.skillNode.deleted")),E(!1),I&&await I()}catch(s){S.error(s?.message||n("chatWorkspace.skillNode.deleteFailed"))}},ee=t=>{z(t);let s=t.reduce((c,f)=>(f.key&&(c[f.key]=f.value),c),{});r(c=>({...c,metadata:s}))},te=(t,s,c)=>{let f=[...y];f[t]={...f[t],[s]:c},ee(f)},Be=()=>{ee([...y,{key:"",value:""}])},Re=async()=>{try{a(!0);let t={"Content-Type":"application/json"};D.apiKey&&(t.Authorization=`Bearer ${D.apiKey}`);let s={name:l.name,description:l.description,license:l.license||void 0,compatibility:l.compatibility||void 0,metadata:l.metadata||void 0,content:l.content||void 0,subSkills:l.subSkills||void 0},c=await T(`/api/skills/${i.id}`,s);if(c.success){S.success(n("chatWorkspace.skillNode.updated"));let f=c.data||l;F(f),r({...f,id:f.name}),z(Object.entries(f.metadata||{}).map(([Me,Ee])=>({key:Me,value:Ee}))),w(!1),x?.(f)}else S.error(c.message||n("chatWorkspace.skillNode.updateFailed"))}catch(t){S.error(t.message||n("chatWorkspace.skillNode.updateError"))}finally{a(!1)}},Ie=(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"row",gap:24},children:[(0,e.jsxs)("div",{style:{flex:"0 0 320px",display:"flex",flexDirection:"column",gap:12},children:[(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,e.jsx)(d,{style:{fontSize:12,color:o.colorTextSecondary},children:n("chatWorkspace.skills.field.description")}),(0,e.jsx)(ze,{value:l.description,onChange:t=>N("description",t.target.value),placeholder:n("chatWorkspace.skills.field.description"),rows:3})]}),(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,e.jsx)(d,{style:{fontSize:12,color:o.colorTextSecondary},children:n("chatWorkspace.skills.field.license")}),(0,e.jsx)(R,{value:l.license,onChange:t=>N("license",t.target.value),placeholder:n("chatWorkspace.skills.field.license")})]}),(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,e.jsx)(d,{style:{fontSize:12,color:o.colorTextSecondary},children:n("chatWorkspace.skills.field.compatibility")}),(0,e.jsx)(R,{value:l.compatibility,onChange:t=>N("compatibility",t.target.value),placeholder:n("chatWorkspace.skills.field.compatibility")})]}),(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[(0,e.jsx)(d,{style:{fontSize:12,color:o.colorTextSecondary,fontWeight:500},children:n("chatWorkspace.skills.field.metadata")}),(0,e.jsx)(h,{size:"small",icon:(0,e.jsx)(_,{}),onClick:Be,children:n("chatWorkspace.skillNode.add")})]}),(0,e.jsxs)(B,{direction:"vertical",size:8,style:{width:"100%"},children:[y.length===0&&(0,e.jsx)(d,{style:{fontSize:11,color:o.colorTextTertiary},children:n("chatWorkspace.skillNode.noMetadata")}),y.map((t,s)=>(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,width:"100%"},children:[(0,e.jsx)(d,{style:{fontSize:11,color:o.colorTextSecondary},children:n("chatWorkspace.skillNode.meta",{index:s+1})}),(0,e.jsxs)(B,{style:{width:"100%"},size:8,wrap:!0,children:[(0,e.jsx)(R,{value:t.key,placeholder:n("chatWorkspace.skillNode.keyPlaceholder"),style:{width:120},onChange:c=>te(s,"key",c.target.value)}),(0,e.jsx)(R,{value:t.value,placeholder:n("chatWorkspace.skillNode.valuePlaceholder"),style:{flex:1,minWidth:160},onChange:c=>te(s,"value",c.target.value)})]})]},s))]})]}),(0,e.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:6,minWidth:400},children:[(0,e.jsx)(d,{style:{fontSize:12,color:o.colorTextSecondary},children:n("chatWorkspace.skills.field.content")}),(0,e.jsx)(ze,{value:l.content,onChange:t=>N("content",t.target.value),placeholder:n("chatWorkspace.skillNode.contentPlaceholder"),rows:30,style:{fontFamily:"monospace",fontSize:13,flex:1,minHeight:600}})]})]}),Fe=(0,e.jsxs)("div",{style:{width:v?960:720,maxHeight:"95vh",overflowY:"auto",padding:24},children:[(0,e.jsx)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",marginBottom:16},children:(0,e.jsxs)("div",{style:{flex:1},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,e.jsx)(d,{strong:!0,style:{fontSize:18,fontWeight:600,color:o.colorText},children:i.name}),(0,e.jsx)(A,{style:{margin:0,fontSize:10,padding:"2px 8px",fontWeight:600},color:"geekblue",children:V.toUpperCase()})]}),(0,e.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6},children:(0,e.jsx)(d,{style:{fontSize:11,color:o.colorTextTertiary,fontFamily:"monospace"},children:`>_ ${i.id}`})})]})}),v?Ie:(0,e.jsxs)(e.Fragment,{children:[i.description&&(0,e.jsx)("div",{style:{marginBottom:16},children:(0,e.jsxs)(d,{style:{fontSize:12,color:o.colorText,lineHeight:1.6,fontStyle:"italic"},children:['"',i.description,'"']})}),C.length>0&&(0,e.jsxs)("div",{style:{marginBottom:16},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,e.jsx)(fe,{style:{fontSize:14,color:o.colorTextSecondary}}),(0,e.jsx)(d,{style:{fontSize:12,color:o.colorTextSecondary,fontWeight:500},children:n("chatWorkspace.skillNode.metadataCount",{count:C.length})})]}),(0,e.jsx)("div",{style:{border:`1px solid ${o.colorBorderSecondary}`,borderRadius:6,overflow:"hidden"},children:C.map(([t,s],c)=>(0,e.jsxs)("div",{style:{display:"flex",alignItems:"stretch",borderBottom:c===C.length-1?"none":`1px solid ${o.colorBorderSecondary}`},children:[(0,e.jsx)("div",{style:{width:140,padding:"8px 10px",background:o.colorFillTertiary,borderRight:`1px solid ${o.colorBorderSecondary}`,fontSize:11,color:o.colorTextSecondary,fontWeight:600,textTransform:"capitalize"},children:t}),(0,e.jsx)("div",{style:{flex:1,padding:"8px 10px",fontSize:11,color:o.colorText,wordBreak:"break-word"},children:s})]},t))})]}),k&&(0,e.jsxs)("div",{style:{marginBottom:16},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,e.jsx)(ce,{style:{fontSize:14,color:o.colorTextSecondary}}),(0,e.jsxs)(d,{style:{fontSize:12,color:o.colorTextSecondary,fontWeight:500},children:["Sub-Skills (",i.subSkills.length,")"]})]}),(0,e.jsx)(B,{size:[8,8],wrap:!0,children:i.subSkills.map((t,s)=>(0,e.jsx)(A,{style:{fontSize:11,padding:"4px 12px",backgroundColor:o.colorFillTertiary,color:o.colorText,border:`1px solid ${o.colorBorderSecondary}`},children:t},s))})]}),(i.license||i.compatibility)&&(0,e.jsx)("div",{style:{marginBottom:16},children:(0,e.jsxs)(B,{size:[8,8],wrap:!0,children:[i.license&&(0,e.jsx)(A,{icon:(0,e.jsx)(pe,{}),style:{margin:0,fontSize:11,padding:"4px 12px",borderRadius:6,backgroundColor:o.colorInfoBg,color:o.colorInfo,border:`1px solid ${o.colorInfoBorder}`,fontWeight:500,lineHeight:"16px"},children:i.license}),i.compatibility&&(0,e.jsx)(A,{style:{margin:0,fontSize:11,padding:"4px 12px",borderRadius:6,backgroundColor:o.colorSuccessBg,color:o.colorSuccess,border:`1px solid ${o.colorSuccessBorder}`,fontWeight:500,lineHeight:"16px",display:"inline-flex",alignItems:"center",gap:4},children:i.compatibility})]})}),(i.createdAt||i.updatedAt)&&(0,e.jsx)("div",{style:{marginBottom:16},children:(0,e.jsxs)(B,{direction:"vertical",size:4,children:[i.createdAt&&(0,e.jsxs)(d,{style:{fontSize:11,color:o.colorTextTertiary,fontFamily:"monospace"},children:["Created: ",$(i.createdAt)]}),i.updatedAt&&(0,e.jsxs)(d,{style:{fontSize:11,color:o.colorTextTertiary,fontFamily:"monospace"},children:["Updated: ",$(i.updatedAt)]})]})}),i.content&&(0,e.jsxs)("div",{style:{marginBottom:0},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,e.jsx)(ye,{style:{fontSize:14,color:o.colorTextSecondary}}),(0,e.jsx)(d,{style:{fontSize:12,color:o.colorTextSecondary,fontWeight:600,letterSpacing:.5},children:n("chatWorkspace.skillNode.contentSection")})]}),(0,e.jsx)("div",{style:{padding:16,background:o.colorFillTertiary,border:`1px solid ${o.colorBorderSecondary}`,borderRadius:6,maxHeight:400,overflowY:"auto"},children:(0,e.jsx)(d,{style:{fontSize:12,color:o.colorText,lineHeight:1.7,whiteSpace:"pre-wrap",fontFamily:"monospace"},children:i.content})})]})]}),(0,e.jsx)(le,{style:{margin:"16px 0"}}),(0,e.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:v?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(h,{block:!0,onClick:()=>{w(!1),r(p)},style:{flex:1},children:n("common.cancel")}),(0,e.jsx)(h,{type:"primary",block:!0,onClick:Re,loading:X,style:{flex:1},children:n("common.save")})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(h,{type:"primary",block:!0,onClick:()=>w(!0),style:{flex:1},children:n("chatWorkspace.skillNode.edit")}),(0,e.jsx)(h,{danger:!0,onClick:t=>{t.stopPropagation(),J(t)},children:n("common.delete")}),(0,e.jsx)(h,{icon:(0,e.jsx)(de,{}),onClick:()=>Y(i.id),title:n("chatWorkspace.skillNode.copyId")})]})})]});return(0,e.jsxs)("div",{style:{position:"relative",padding:4,overflow:"visible"},children:[(0,e.jsx)(Z,{type:"source",position:Q.Top,style:{left:"50%",top:"50%",transform:"translate(-50%, -50%)",background:"transparent",border:"none",width:1,height:1,borderRadius:"50%",pointerEvents:"none"},isConnectable:!1}),(0,e.jsx)(Z,{type:"target",position:Q.Top,style:{left:"50%",top:"50%",transform:"translate(-50%, -50%)",background:"transparent",border:"none",width:1,height:1,borderRadius:"50%",pointerEvents:"none"},isConnectable:!1}),(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",position:"relative"},onClick:()=>E(!0),children:[(0,e.jsx)("div",{style:{width:P,height:P,borderRadius:"50%",background:"#999",flexShrink:0,boxShadow:"0 1px 4px rgba(0,0,0,0.15)",transition:"transform 0.15s ease"},onMouseEnter:t=>{t.currentTarget.style.transform="scale(1.15)"},onMouseLeave:t=>{t.currentTarget.style.transform="scale(1)"}}),K&&(0,e.jsx)(d,{style:{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:4,fontSize:10,color:o.colorTextSecondary,opacity:.45,whiteSpace:"nowrap",pointerEvents:"none",userSelect:"none"},children:i.name})]}),(0,e.jsx)(ae,{open:G,onCancel:()=>{E(!1),w(!1),r({...i,id:i.name})},footer:null,width:v?1e3:760,destroyOnClose:!0,title:null,styles:{body:{padding:0}},children:Fe})]})},We=Ae;var g=W(j()),De=({onNodeClick:b})=>{let S=H(),[n,o,D]=be([]),[T,O,K]=Te([]),[U,p]=(0,u.useState)(!1),[x,I]=(0,u.useState)([]),[i,F]=(0,u.useState)(!1),[k,M]=(0,u.useState)(null),{token:P}=L.useToken(),{get:V}=q(),C=(0,u.useMemo)(()=>({skill:We}),[]),$=(0,u.useMemo)(()=>k===null?n:n.map(l=>{let r=l.id===k||T.some(y=>y.source===k&&y.target===l.id||y.target===k&&y.source===l.id);return{...l,style:{opacity:r?1:.2,transition:"opacity 0.2s ease"}}}),[n,T,k]),Y=(0,u.useMemo)(()=>k===null?T.map(l=>({...l,style:{stroke:"#1677ff",strokeWidth:1.5,opacity:.25,transition:"opacity 0.2s ease"}})):T.map(l=>{let r=l.source===k||l.target===k;return{...l,style:{stroke:"#1677ff",strokeWidth:r?2.5:1,opacity:r?1:.04,transition:"opacity 0.2s ease"}}}),[T,k]),v=async()=>{F(!0);try{let l=await V("/api/skills");l.success&&l.data&&Array.isArray(l.data.records)&&I(l.data.records)}catch(l){console.error("Failed to fetch skills:",l),I([])}finally{F(!1)}};(0,u.useEffect)(()=>{v()},[]),(0,u.useEffect)(()=>{if(!x||x.length===0){o([]),O([]);return}let l=[],r=new Map,y=[];x.forEach(a=>{r.set(a.name,a),a.subSkills&&a.subSkills.length>0&&a.subSkills.forEach(N=>{x.find(J=>J.name===N)&&y.push({source:a.name,target:N})})});let z=x.map(a=>({id:a.name})),G=y.map(a=>({source:a.source,target:a.target})),E=ke(z).force("link",ue(G).id(a=>a.id).distance(80)).force("charge",he().strength(-300)).force("center",ge(0,0)).force("collide",me(30)).stop();for(let a=0;a<300;a++)E.tick();let X=z.map(a=>({id:a.id,type:"skill",data:{skill:r.get(a.id),onClick:()=>b?.(r.get(a.id)),onDelete:v},position:{x:a.x,y:a.y}}));y.forEach(a=>{r.has(a.source)&&r.has(a.target)&&l.push({id:`e${a.source}-${a.target}`,source:a.source,target:a.target,style:{stroke:"#1677ff",strokeWidth:2},type:"straight"})}),o(X),O(l)},[x,o,O,b]);let w=async()=>{await v()};return i?(0,g.jsx)("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",background:"#fafafa"},children:S("chat.skills.loading")}):(0,g.jsxs)("div",{style:{width:"100%",height:"100%",background:"#fafafa",position:"relative"},children:[(0,g.jsxs)(ve,{nodes:$,edges:Y,onNodesChange:D,onEdgesChange:K,onNodeMouseEnter:(l,r)=>M(r.id),onNodeMouseLeave:()=>M(null),nodeTypes:C,fitView:!0,children:[(0,g.jsx)(Ce,{color:"#eee",gap:20}),(0,g.jsx)(we,{})]}),(0,g.jsx)("div",{style:{position:"absolute",top:20,right:20,zIndex:10},children:(0,g.jsx)(h,{type:"primary",size:"large",icon:(0,g.jsx)(_,{}),onClick:()=>p(!0),style:{height:48,width:48,borderRadius:"50%",boxShadow:P.boxShadowTertiary,display:"flex",alignItems:"center",justifyContent:"center",padding:0}})}),(0,g.jsx)(Ne,{open:U,onCancel:()=>p(!1),onSuccess:w})]})},Oe=b=>(0,g.jsx)(xe,{children:(0,g.jsx)(De,{...b})}),rt=Oe;export{rt as default};
1
+ import{b as Q,c as Se,e as Z,f as xe,g as ve,h as be,i as Te,l as Ce,m as we}from"./embed-page-chunk-5AWYMAAX.js";import{a as ge,b as me,c as ue,d as ke,e as he}from"./embed-page-chunk-SV2BM3WO.js";import"./embed-page-chunk-S4XZPBRM.js";import{a as q,b as Ne}from"./embed-page-chunk-5O5IKZOC.js";import{o as ne,t as re}from"./embed-page-chunk-TZPX2O54.js";import{l as H}from"./embed-page-chunk-5EENS2J7.js";import{a as j}from"./embed-page-chunk-QV7QAJ4N.js";import{D as de,E as pe,Ja as _,ea as ye,o as ce,sa as fe}from"./embed-page-chunk-L7GPZSYD.js";import{Ia as R,Ma as ae,Za as A,_ as h,_a as L,aa as ie,bb as se,ua as le,za as B}from"./embed-page-chunk-BUFWD6SE.js";import{a as oe}from"./embed-page-chunk-R5QL57JJ.js";import"./embed-page-chunk-EUOOO2LS.js";import{f as W}from"./embed-page-chunk-QBTAJ2YI.js";var u=W(oe());var m=W(oe());var e=W(j()),{Text:d}=se,{TextArea:ze}=R,Ae=({data:b})=>{let{message:S}=ie.useApp(),n=H(),{token:o}=L.useToken(),{config:D}=re(),{put:T}=q(),K=Se(t=>t.transform[2])>.6,U=ne("__GLOBAL__");if(!b)return null;let{skill:p,onClick:x,onDelete:I}=b;if(!p)return null;let[i,F]=(0,m.useState)(p),k=i.subSkills&&i.subSkills.length>0,M=i.subSkills?.length||0,P=(0,m.useMemo)(()=>Math.min(12+Math.sqrt(M)*10,48),[M]),V=i.metadata&&i.metadata.category||"global",C=(0,m.useMemo)(()=>i.metadata?Object.entries(i.metadata).filter(([t,s])=>t&&s):[],[i.metadata]),$=t=>{if(!t)return"";let s=t instanceof Date?t:new Date(t);return Number.isNaN(s.getTime())?"":s.toLocaleString()},Y=t=>{navigator.clipboard.writeText(t)},[v,w]=(0,m.useState)(!1),[l,r]=(0,m.useState)({...p,id:p.name}),[y,z]=(0,m.useState)(C.map(([t,s])=>({key:t,value:s}))),[G,E]=(0,m.useState)(!1),[X,a]=(0,m.useState)(!1);(0,m.useEffect)(()=>{w(!1),F(p),r({...p,id:p.name}),z(Object.entries(p.metadata||{}).map(([t,s])=>({key:t,value:s})))},[p]);let N=(t,s)=>{if(t==="name"){r(c=>({...c,name:s,id:s}));return}r(c=>({...c,[t]:s}))},J=async t=>{t?.stopPropagation(),t?.preventDefault();try{let s=i.id||i.name;if(!s){S.error(n("chatWorkspace.skillNode.idMissing"));return}await U.skills.delete(s),S.success(n("chatWorkspace.skillNode.deleted")),E(!1),I&&await I()}catch(s){S.error(s?.message||n("chatWorkspace.skillNode.deleteFailed"))}},ee=t=>{z(t);let s=t.reduce((c,f)=>(f.key&&(c[f.key]=f.value),c),{});r(c=>({...c,metadata:s}))},te=(t,s,c)=>{let f=[...y];f[t]={...f[t],[s]:c},ee(f)},Be=()=>{ee([...y,{key:"",value:""}])},Re=async()=>{try{a(!0);let t={"Content-Type":"application/json"};D.apiKey&&(t.Authorization=`Bearer ${D.apiKey}`);let s={name:l.name,description:l.description,license:l.license||void 0,compatibility:l.compatibility||void 0,metadata:l.metadata||void 0,content:l.content||void 0,subSkills:l.subSkills||void 0},c=await T(`/api/skills/${i.id}`,s);if(c.success){S.success(n("chatWorkspace.skillNode.updated"));let f=c.data||l;F(f),r({...f,id:f.name}),z(Object.entries(f.metadata||{}).map(([Me,Ee])=>({key:Me,value:Ee}))),w(!1),x?.(f)}else S.error(c.message||n("chatWorkspace.skillNode.updateFailed"))}catch(t){S.error(t.message||n("chatWorkspace.skillNode.updateError"))}finally{a(!1)}},Ie=(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"row",gap:24},children:[(0,e.jsxs)("div",{style:{flex:"0 0 320px",display:"flex",flexDirection:"column",gap:12},children:[(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,e.jsx)(d,{style:{fontSize:12,color:o.colorTextSecondary},children:n("chatWorkspace.skills.field.description")}),(0,e.jsx)(ze,{value:l.description,onChange:t=>N("description",t.target.value),placeholder:n("chatWorkspace.skills.field.description"),rows:3})]}),(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,e.jsx)(d,{style:{fontSize:12,color:o.colorTextSecondary},children:n("chatWorkspace.skills.field.license")}),(0,e.jsx)(R,{value:l.license,onChange:t=>N("license",t.target.value),placeholder:n("chatWorkspace.skills.field.license")})]}),(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,e.jsx)(d,{style:{fontSize:12,color:o.colorTextSecondary},children:n("chatWorkspace.skills.field.compatibility")}),(0,e.jsx)(R,{value:l.compatibility,onChange:t=>N("compatibility",t.target.value),placeholder:n("chatWorkspace.skills.field.compatibility")})]}),(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[(0,e.jsx)(d,{style:{fontSize:12,color:o.colorTextSecondary,fontWeight:500},children:n("chatWorkspace.skills.field.metadata")}),(0,e.jsx)(h,{size:"small",icon:(0,e.jsx)(_,{}),onClick:Be,children:n("chatWorkspace.skillNode.add")})]}),(0,e.jsxs)(B,{direction:"vertical",size:8,style:{width:"100%"},children:[y.length===0&&(0,e.jsx)(d,{style:{fontSize:11,color:o.colorTextTertiary},children:n("chatWorkspace.skillNode.noMetadata")}),y.map((t,s)=>(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,width:"100%"},children:[(0,e.jsx)(d,{style:{fontSize:11,color:o.colorTextSecondary},children:n("chatWorkspace.skillNode.meta",{index:s+1})}),(0,e.jsxs)(B,{style:{width:"100%"},size:8,wrap:!0,children:[(0,e.jsx)(R,{value:t.key,placeholder:n("chatWorkspace.skillNode.keyPlaceholder"),style:{width:120},onChange:c=>te(s,"key",c.target.value)}),(0,e.jsx)(R,{value:t.value,placeholder:n("chatWorkspace.skillNode.valuePlaceholder"),style:{flex:1,minWidth:160},onChange:c=>te(s,"value",c.target.value)})]})]},s))]})]}),(0,e.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:6,minWidth:400},children:[(0,e.jsx)(d,{style:{fontSize:12,color:o.colorTextSecondary},children:n("chatWorkspace.skills.field.content")}),(0,e.jsx)(ze,{value:l.content,onChange:t=>N("content",t.target.value),placeholder:n("chatWorkspace.skillNode.contentPlaceholder"),rows:30,style:{fontFamily:"monospace",fontSize:13,flex:1,minHeight:600}})]})]}),Fe=(0,e.jsxs)("div",{style:{width:v?960:720,maxHeight:"95vh",overflowY:"auto",padding:24},children:[(0,e.jsx)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",marginBottom:16},children:(0,e.jsxs)("div",{style:{flex:1},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,e.jsx)(d,{strong:!0,style:{fontSize:18,fontWeight:600,color:o.colorText},children:i.name}),(0,e.jsx)(A,{style:{margin:0,fontSize:10,padding:"2px 8px",fontWeight:600},color:"geekblue",children:V.toUpperCase()})]}),(0,e.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6},children:(0,e.jsx)(d,{style:{fontSize:11,color:o.colorTextTertiary,fontFamily:"monospace"},children:`>_ ${i.id}`})})]})}),v?Ie:(0,e.jsxs)(e.Fragment,{children:[i.description&&(0,e.jsx)("div",{style:{marginBottom:16},children:(0,e.jsxs)(d,{style:{fontSize:12,color:o.colorText,lineHeight:1.6,fontStyle:"italic"},children:['"',i.description,'"']})}),C.length>0&&(0,e.jsxs)("div",{style:{marginBottom:16},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,e.jsx)(fe,{style:{fontSize:14,color:o.colorTextSecondary}}),(0,e.jsx)(d,{style:{fontSize:12,color:o.colorTextSecondary,fontWeight:500},children:n("chatWorkspace.skillNode.metadataCount",{count:C.length})})]}),(0,e.jsx)("div",{style:{border:`1px solid ${o.colorBorderSecondary}`,borderRadius:6,overflow:"hidden"},children:C.map(([t,s],c)=>(0,e.jsxs)("div",{style:{display:"flex",alignItems:"stretch",borderBottom:c===C.length-1?"none":`1px solid ${o.colorBorderSecondary}`},children:[(0,e.jsx)("div",{style:{width:140,padding:"8px 10px",background:o.colorFillTertiary,borderRight:`1px solid ${o.colorBorderSecondary}`,fontSize:11,color:o.colorTextSecondary,fontWeight:600,textTransform:"capitalize"},children:t}),(0,e.jsx)("div",{style:{flex:1,padding:"8px 10px",fontSize:11,color:o.colorText,wordBreak:"break-word"},children:s})]},t))})]}),k&&(0,e.jsxs)("div",{style:{marginBottom:16},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,e.jsx)(ce,{style:{fontSize:14,color:o.colorTextSecondary}}),(0,e.jsxs)(d,{style:{fontSize:12,color:o.colorTextSecondary,fontWeight:500},children:["Sub-Skills (",i.subSkills.length,")"]})]}),(0,e.jsx)(B,{size:[8,8],wrap:!0,children:i.subSkills.map((t,s)=>(0,e.jsx)(A,{style:{fontSize:11,padding:"4px 12px",backgroundColor:o.colorFillTertiary,color:o.colorText,border:`1px solid ${o.colorBorderSecondary}`},children:t},s))})]}),(i.license||i.compatibility)&&(0,e.jsx)("div",{style:{marginBottom:16},children:(0,e.jsxs)(B,{size:[8,8],wrap:!0,children:[i.license&&(0,e.jsx)(A,{icon:(0,e.jsx)(pe,{}),style:{margin:0,fontSize:11,padding:"4px 12px",borderRadius:6,backgroundColor:o.colorInfoBg,color:o.colorInfo,border:`1px solid ${o.colorInfoBorder}`,fontWeight:500,lineHeight:"16px"},children:i.license}),i.compatibility&&(0,e.jsx)(A,{style:{margin:0,fontSize:11,padding:"4px 12px",borderRadius:6,backgroundColor:o.colorSuccessBg,color:o.colorSuccess,border:`1px solid ${o.colorSuccessBorder}`,fontWeight:500,lineHeight:"16px",display:"inline-flex",alignItems:"center",gap:4},children:i.compatibility})]})}),(i.createdAt||i.updatedAt)&&(0,e.jsx)("div",{style:{marginBottom:16},children:(0,e.jsxs)(B,{direction:"vertical",size:4,children:[i.createdAt&&(0,e.jsxs)(d,{style:{fontSize:11,color:o.colorTextTertiary,fontFamily:"monospace"},children:["Created: ",$(i.createdAt)]}),i.updatedAt&&(0,e.jsxs)(d,{style:{fontSize:11,color:o.colorTextTertiary,fontFamily:"monospace"},children:["Updated: ",$(i.updatedAt)]})]})}),i.content&&(0,e.jsxs)("div",{style:{marginBottom:0},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,e.jsx)(ye,{style:{fontSize:14,color:o.colorTextSecondary}}),(0,e.jsx)(d,{style:{fontSize:12,color:o.colorTextSecondary,fontWeight:600,letterSpacing:.5},children:n("chatWorkspace.skillNode.contentSection")})]}),(0,e.jsx)("div",{style:{padding:16,background:o.colorFillTertiary,border:`1px solid ${o.colorBorderSecondary}`,borderRadius:6,maxHeight:400,overflowY:"auto"},children:(0,e.jsx)(d,{style:{fontSize:12,color:o.colorText,lineHeight:1.7,whiteSpace:"pre-wrap",fontFamily:"monospace"},children:i.content})})]})]}),(0,e.jsx)(le,{style:{margin:"16px 0"}}),(0,e.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:v?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(h,{block:!0,onClick:()=>{w(!1),r(p)},style:{flex:1},children:n("common.cancel")}),(0,e.jsx)(h,{type:"primary",block:!0,onClick:Re,loading:X,style:{flex:1},children:n("common.save")})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(h,{type:"primary",block:!0,onClick:()=>w(!0),style:{flex:1},children:n("chatWorkspace.skillNode.edit")}),(0,e.jsx)(h,{danger:!0,onClick:t=>{t.stopPropagation(),J(t)},children:n("common.delete")}),(0,e.jsx)(h,{icon:(0,e.jsx)(de,{}),onClick:()=>Y(i.id),title:n("chatWorkspace.skillNode.copyId")})]})})]});return(0,e.jsxs)("div",{style:{position:"relative",padding:4,overflow:"visible"},children:[(0,e.jsx)(Z,{type:"source",position:Q.Top,style:{left:"50%",top:"50%",transform:"translate(-50%, -50%)",background:"transparent",border:"none",width:1,height:1,borderRadius:"50%",pointerEvents:"none"},isConnectable:!1}),(0,e.jsx)(Z,{type:"target",position:Q.Top,style:{left:"50%",top:"50%",transform:"translate(-50%, -50%)",background:"transparent",border:"none",width:1,height:1,borderRadius:"50%",pointerEvents:"none"},isConnectable:!1}),(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",position:"relative"},onClick:()=>E(!0),children:[(0,e.jsx)("div",{style:{width:P,height:P,borderRadius:"50%",background:"#999",flexShrink:0,boxShadow:"0 1px 4px rgba(0,0,0,0.15)",transition:"transform 0.15s ease"},onMouseEnter:t=>{t.currentTarget.style.transform="scale(1.15)"},onMouseLeave:t=>{t.currentTarget.style.transform="scale(1)"}}),K&&(0,e.jsx)(d,{style:{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:4,fontSize:10,color:o.colorTextSecondary,opacity:.45,whiteSpace:"nowrap",pointerEvents:"none",userSelect:"none"},children:i.name})]}),(0,e.jsx)(ae,{open:G,onCancel:()=>{E(!1),w(!1),r({...i,id:i.name})},footer:null,width:v?1e3:760,destroyOnClose:!0,title:null,styles:{body:{padding:0}},children:Fe})]})},We=Ae;var g=W(j()),De=({onNodeClick:b})=>{let S=H(),[n,o,D]=be([]),[T,O,K]=Te([]),[U,p]=(0,u.useState)(!1),[x,I]=(0,u.useState)([]),[i,F]=(0,u.useState)(!1),[k,M]=(0,u.useState)(null),{token:P}=L.useToken(),{get:V}=q(),C=(0,u.useMemo)(()=>({skill:We}),[]),$=(0,u.useMemo)(()=>k===null?n:n.map(l=>{let r=l.id===k||T.some(y=>y.source===k&&y.target===l.id||y.target===k&&y.source===l.id);return{...l,style:{opacity:r?1:.2,transition:"opacity 0.2s ease"}}}),[n,T,k]),Y=(0,u.useMemo)(()=>k===null?T.map(l=>({...l,style:{stroke:"#1677ff",strokeWidth:1.5,opacity:.25,transition:"opacity 0.2s ease"}})):T.map(l=>{let r=l.source===k||l.target===k;return{...l,style:{stroke:"#1677ff",strokeWidth:r?2.5:1,opacity:r?1:.04,transition:"opacity 0.2s ease"}}}),[T,k]),v=async()=>{F(!0);try{let l=await V("/api/skills");l.success&&l.data&&Array.isArray(l.data.records)&&I(l.data.records)}catch(l){console.error("Failed to fetch skills:",l),I([])}finally{F(!1)}};(0,u.useEffect)(()=>{v()},[]),(0,u.useEffect)(()=>{if(!x||x.length===0){o([]),O([]);return}let l=[],r=new Map,y=[];x.forEach(a=>{r.set(a.name,a),a.subSkills&&a.subSkills.length>0&&a.subSkills.forEach(N=>{x.find(J=>J.name===N)&&y.push({source:a.name,target:N})})});let z=x.map(a=>({id:a.name})),G=y.map(a=>({source:a.source,target:a.target})),E=ke(z).force("link",ue(G).id(a=>a.id).distance(80)).force("charge",he().strength(-300)).force("center",ge(0,0)).force("collide",me(30)).stop();for(let a=0;a<300;a++)E.tick();let X=z.map(a=>({id:a.id,type:"skill",data:{skill:r.get(a.id),onClick:()=>b?.(r.get(a.id)),onDelete:v},position:{x:a.x,y:a.y}}));y.forEach(a=>{r.has(a.source)&&r.has(a.target)&&l.push({id:`e${a.source}-${a.target}`,source:a.source,target:a.target,style:{stroke:"#1677ff",strokeWidth:2},type:"straight"})}),o(X),O(l)},[x,o,O,b]);let w=async()=>{await v()};return i?(0,g.jsx)("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",background:"#fafafa"},children:S("chat.skills.loading")}):(0,g.jsxs)("div",{style:{width:"100%",height:"100%",background:"#fafafa",position:"relative"},children:[(0,g.jsxs)(ve,{nodes:$,edges:Y,onNodesChange:D,onEdgesChange:K,onNodeMouseEnter:(l,r)=>M(r.id),onNodeMouseLeave:()=>M(null),nodeTypes:C,fitView:!0,children:[(0,g.jsx)(Ce,{color:"#eee",gap:20}),(0,g.jsx)(we,{})]}),(0,g.jsx)("div",{style:{position:"absolute",top:20,right:20,zIndex:10},children:(0,g.jsx)(h,{type:"primary",size:"large",icon:(0,g.jsx)(_,{}),onClick:()=>p(!0),style:{height:48,width:48,borderRadius:"50%",boxShadow:P.boxShadowTertiary,display:"flex",alignItems:"center",justifyContent:"center",padding:0}})}),(0,g.jsx)(Ne,{open:U,onCancel:()=>p(!1),onSuccess:w})]})},Oe=b=>(0,g.jsx)(xe,{children:(0,g.jsx)(De,{...b})}),rt=Oe;export{rt as default};
@@ -1,4 +1,4 @@
1
- import{a as Ze}from"./embed-page-chunk-NR4M6XSO.js";import{c as qe,d as Ke}from"./embed-page-chunk-HQLSH3FC.js";import{b as Ne,e as Ie,h as He,i as We}from"./embed-page-chunk-5AWYMAAX.js";import"./embed-page-chunk-S4XZPBRM.js";import{C as Ve,D as Ue,E as ue,F as Re,G as Ye,H as Qe,I as Je,K as Xe,L as et,M as tt,N as ot,r as Ge}from"./embed-page-chunk-KWZEITYQ.js";import{g as q,i as _e}from"./embed-page-chunk-54M4265G.js";import"./embed-page-chunk-3XPHW2C7.js";import{l as Ee,o as Oe}from"./embed-page-chunk-5QZRLAW2.js";import{I as Fe,Qa as me,n as ce,ya as pe}from"./embed-page-chunk-F7ZUYG42.js";import{l as j}from"./embed-page-chunk-3FNSGFP2.js";import{a as A}from"./embed-page-chunk-QV7QAJ4N.js";import"./embed-page-chunk-VW3NF5NT.js";import"./embed-page-chunk-Z4Z6VCUZ.js";import"./embed-page-chunk-L7GPZSYD.js";import{Da as W,Ia as Ce,Ja as J,Ma as ze,Sa as le,Za as Me,_ as ae,aa as Be,ba as Le,bb as de,fa as be,va as De}from"./embed-page-chunk-BUFWD6SE.js";import{a as se}from"./embed-page-chunk-R5QL57JJ.js";import"./embed-page-chunk-QOWM3LMZ.js";import"./embed-page-chunk-EUOOO2LS.js";import"./embed-page-chunk-5JDQ456X.js";import{f as T}from"./embed-page-chunk-QBTAJ2YI.js";var n=T(se());var it=T(se());var s=T(A()),Tt=[{key:"pending",color:"#7A7A7A"},{key:"in_progress",color:"#3b82f6"},{key:"failed",color:"#ef4444"},{key:"interrupted",color:"#8b5cf6"},{key:"completed",color:"#22c55e"}],rt={high:"#ef4444",medium:"#f59e0b",low:"#22c55e"};function bt(e){return e==="high"||e==="low"?e:"medium"}function Ct(e,i){let f=typeof e=="string"?new Date(e):e,a=new Date().getTime()-f.getTime(),k=Math.floor(a/1e3),o=Math.floor(k/60),r=Math.floor(o/60),l=Math.floor(r/24);return k<60?i("common.time.justNow"):o<60?i("common.time.minutesAgo",{count:o}):r<24?i("common.time.hoursAgo",{count:r}):l<30?i("common.time.daysAgo",{count:l}):f.toLocaleDateString(i.locale)}var Nt=q(({css:e,token:i})=>({container:e`
1
+ import{a as Ze}from"./embed-page-chunk-RU45VIPM.js";import{c as qe,d as Ke}from"./embed-page-chunk-HQLSH3FC.js";import{b as Ne,e as Ie,h as He,i as We}from"./embed-page-chunk-5AWYMAAX.js";import"./embed-page-chunk-S4XZPBRM.js";import{C as Ve,D as Ue,E as ue,F as Re,G as Ye,H as Qe,I as Je,K as Xe,L as et,M as tt,N as ot,r as Ge}from"./embed-page-chunk-4GCFDWE7.js";import"./embed-page-chunk-5O5IKZOC.js";import{g as q,i as _e}from"./embed-page-chunk-AFYXBC77.js";import{l as Ee,o as Oe}from"./embed-page-chunk-TZPX2O54.js";import{I as Fe,Qa as me,n as ce,ya as pe}from"./embed-page-chunk-F7ZUYG42.js";import{l as j}from"./embed-page-chunk-5EENS2J7.js";import{a as A}from"./embed-page-chunk-QV7QAJ4N.js";import"./embed-page-chunk-VW3NF5NT.js";import"./embed-page-chunk-Z4Z6VCUZ.js";import"./embed-page-chunk-L7GPZSYD.js";import{Da as W,Ia as Ce,Ja as J,Ma as ze,Sa as le,Za as Me,_ as ae,aa as Be,ba as Le,bb as de,fa as be,va as De}from"./embed-page-chunk-BUFWD6SE.js";import{a as se}from"./embed-page-chunk-R5QL57JJ.js";import"./embed-page-chunk-QOWM3LMZ.js";import"./embed-page-chunk-EUOOO2LS.js";import"./embed-page-chunk-5JDQ456X.js";import{f as T}from"./embed-page-chunk-QBTAJ2YI.js";var n=T(se());var it=T(se());var s=T(A()),Tt=[{key:"pending",color:"#7A7A7A"},{key:"in_progress",color:"#3b82f6"},{key:"failed",color:"#ef4444"},{key:"interrupted",color:"#8b5cf6"},{key:"completed",color:"#22c55e"}],rt={high:"#ef4444",medium:"#f59e0b",low:"#22c55e"};function bt(e){return e==="high"||e==="low"?e:"medium"}function Ct(e,i){let f=typeof e=="string"?new Date(e):e,a=new Date().getTime()-f.getTime(),k=Math.floor(a/1e3),o=Math.floor(k/60),r=Math.floor(o/60),l=Math.floor(r/24);return k<60?i("common.time.justNow"):o<60?i("common.time.minutesAgo",{count:o}):r<24?i("common.time.hoursAgo",{count:r}):l<30?i("common.time.daysAgo",{count:l}):f.toLocaleDateString(i.locale)}var Nt=q(({css:e,token:i})=>({container:e`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  height: 100%;
@@ -1 +1 @@
1
- import{k as ue,q as he}from"./embed-page-chunk-54M4265G.js";import{o as oe}from"./embed-page-chunk-5QZRLAW2.js";import{Aa as le,L as ce,La as de,O as se,Wa as Ae}from"./embed-page-chunk-F7ZUYG42.js";import{l as re}from"./embed-page-chunk-3FNSGFP2.js";import{a as ie}from"./embed-page-chunk-QV7QAJ4N.js";import"./embed-page-chunk-L7GPZSYD.js";import{Ma as ae,Oa as C,W as d,Ya as L,Za as S,_ as u,ba as F,bb as c,qa as te,xa as ne,za as h}from"./embed-page-chunk-BUFWD6SE.js";import{a as Pe}from"./embed-page-chunk-R5QL57JJ.js";import"./embed-page-chunk-EUOOO2LS.js";import{f as I}from"./embed-page-chunk-QBTAJ2YI.js";var a=I(Pe());var _=I(Ae());var t=I(ie());function f(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function Ee(r){if(!f(r))return;let e=r.checkpoint;if(f(e)&&typeof e.checkpoint_id=="string")return e.checkpoint_id;let o=r.config;if(f(o)&&f(o.configurable)){let s=o.configurable.checkpoint_id;if(typeof s=="string")return s}}function ze(r){if(!f(r))return;if(typeof r.createdAt=="string")return r.createdAt;let e=r.checkpoint;if(f(e)&&typeof e.ts=="string")return e.ts}function He(r){switch(r){case"pending":return"blue";case"running":return"processing";case"success":return"green";case"error":case"failed":case"timeout":return"red";case"interrupted":return"orange";default:return}}function Fe(r){return r==="pending"||r==="running"}function Le(r){return r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(1)} KB`:`${(r/(1024*1024)).toFixed(2)} MB`}var We=({data:r})=>{let e=re(),o=r?.threadId,s=r?.assistantId,l=oe(s||"__no_assistant__"),D=(0,a.useContext)(ue),{closeSideApp:pe}=he(),[m,ge]=(0,a.useState)(null),[T,ye]=(0,a.useState)(null),[fe,me]=(0,a.useState)([]),[Te,Me]=(0,a.useState)([]),[v,R]=(0,a.useState)(!0),[K,M]=(0,a.useState)(null),[Y,O]=(0,a.useState)(null),[p,J]=(0,a.useState)({}),[b,N]=(0,a.useState)(null),[xe,W]=(0,a.useState)(!1),[ke,B]=(0,a.useState)(""),[we,$]=(0,a.useState)(!1),[Ce,G]=(0,a.useState)(!1),[P,Ie]=(0,a.useState)(null),[U,V]=(0,a.useState)(!1),[A,j]=(0,a.useState)(5),E=(0,a.useRef)(0),x=(0,a.useRef)(0),g=(0,a.useCallback)(async()=>{if(!o||!s){R(!1);return}let n=++E.current;R(!0),J({});let[i,k,X,Z]=await Promise.allSettled([l.getThreadStatus(o),l.getThreadStorage(o),l.getThreadHistory(o,{limit:10}),l.runs.list(o,s)]);if(n!==E.current)return;let w={};i.status==="fulfilled"?ge(i.value):w.status=e("chat.threadMaintenance.statusLoadFailed"),k.status==="fulfilled"?ye(k.value):w.storage=e("chat.threadMaintenance.storageLoadFailed"),X.status==="fulfilled"?me(X.value.flatMap(H=>{let ee=Ee(H);return ee===void 0?[]:[{id:ee,createdAt:ze(H),raw:H}]})):w.history=e("chat.threadMaintenance.historyLoadFailed"),Z.status==="fulfilled"?Me(Z.value):w.runs=e("chat.threadMaintenance.runsLoadFailed"),J(w),R(!1)},[s,l,e,o]);(0,a.useEffect)(()=>(g(),()=>{E.current+=1}),[g]);let Se=async n=>{if(!o)return;let i=++x.current;W(!0),$(!0),B("");try{let k=await l.getThreadStateAtCheckpoint(o,n.id);i===x.current&&B(JSON.stringify(k,null,2))}catch{i===x.current&&B(e("chat.threadMaintenance.stateFailed"))}finally{i===x.current&&$(!1)}},ve=()=>{x.current+=1,W(!1)},Re=async()=>{if(o){G(!0),M(null);try{let n=await l.copyThread(o);Ie(n.id)}catch{M(e("chat.threadMaintenance.copyFailed"))}finally{G(!1)}}},q=async n=>{if(!o)return;V(!0),M(null);let i=Math.min(100,Math.max(1,Math.trunc(A)));j(i);try{if(!(await l.pruneThread(o,n==="delete"?{strategy:n}:{strategy:n,keep:i})).pruned){M(e("chat.threadMaintenance.pruneFailed"));return}if(n==="delete"){pe();return}await g()}catch{M(e("chat.threadMaintenance.pruneFailed"))}finally{V(!1)}},z=(0,a.useCallback)(async(n,i)=>{if(!(!o||!s)){N(n),O(null);try{await l.runs.cancel(o,n,{action:i},s),await g()}catch{O(e("chat.threadMaintenance.runCancelFailed"))}finally{N(null)}}},[s,l,g,e,o]),Q=m?.interrupts??[],be=(0,a.useMemo)(()=>[{title:e("chat.threadMaintenance.runStatus"),dataIndex:"status",render:n=>(0,t.jsx)(S,{color:He(n),children:n})},{title:e("chat.threadMaintenance.runId"),dataIndex:"runId",render:n=>(0,t.jsx)(c.Text,{code:!0,ellipsis:{tooltip:n},style:{maxWidth:180},children:n})},{title:e("chat.threadMaintenance.runCreated"),dataIndex:"createdAt",render:n=>(0,_.default)(n).format("YYYY-MM-DD HH:mm:ss")},{title:e("chat.threadMaintenance.runOwner"),key:"owner",render:(n,i)=>(0,t.jsxs)(h,{size:4,children:[(0,t.jsx)(c.Text,{children:i.owner??"\u2014"}),(0,t.jsx)(c.Text,{type:"secondary",children:"/"}),(0,t.jsx)(c.Text,{type:"secondary",children:i.attempts})]})},{key:"actions",render:(n,i)=>Fe(i.status)?(0,t.jsxs)(h,{size:4,children:[(0,t.jsx)(C,{title:e("chat.threadMaintenance.interruptRunConfirm"),okText:e("chat.threadMaintenance.interruptRun"),cancelText:e("common.cancel"),onConfirm:()=>void z(i.runId,"interrupt"),children:(0,t.jsx)(u,{size:"small",type:"link",loading:b===i.runId,children:e("chat.threadMaintenance.interruptRun")})}),(0,t.jsx)(C,{title:e("chat.threadMaintenance.rollbackRunConfirm"),okText:e("chat.threadMaintenance.rollbackRun"),cancelText:e("common.cancel"),onConfirm:()=>void z(i.runId,"rollback"),children:(0,t.jsx)(u,{size:"small",type:"link",danger:!0,loading:b===i.runId,children:e("chat.threadMaintenance.rollbackRun")})})]}):null}],[z,b,e]),Be=(0,a.useMemo)(()=>[{title:e("chat.threadMaintenance.checkpointId"),dataIndex:"id",render:n=>(0,t.jsx)(c.Text,{code:!0,children:n})},{title:e("chat.threadMaintenance.checkpointTime"),dataIndex:"createdAt",render:n=>n?(0,_.default)(n).format("YYYY-MM-DD HH:mm:ss"):e("chat.threadMaintenance.unknown")},{key:"actions",render:(n,i)=>(0,t.jsx)(u,{size:"small",type:"link",onClick:()=>void Se(i),children:e("chat.threadMaintenance.viewState")})}],[e]);return!o||!s?(0,t.jsx)(d,{type:"warning",showIcon:!0,message:e("chat.threadMaintenance.missingContext")}):(0,t.jsxs)(te,{title:(0,t.jsxs)(h,{children:[(0,t.jsx)(se,{size:16}),e("chat.threadMaintenance.title")]}),extra:(0,t.jsxs)(h,{wrap:!0,children:[(0,t.jsx)(u,{icon:(0,t.jsx)(le,{size:14}),onClick:()=>void g(),loading:v,children:e("common.refresh")}),(0,t.jsx)(u,{icon:(0,t.jsx)(ce,{size:14}),loading:Ce,onClick:()=>void Re(),children:e("chat.threadMaintenance.copy")})]}),children:[(0,t.jsxs)(h,{direction:"vertical",size:14,style:{width:"100%"},children:[K?(0,t.jsx)(d,{type:"error",showIcon:!0,message:K}):null,p.status?(0,t.jsx)(d,{type:"error",showIcon:!0,message:p.status}):null,p.storage?(0,t.jsx)(d,{type:"warning",showIcon:!0,message:p.storage}):null,p.history?(0,t.jsx)(d,{type:"warning",showIcon:!0,message:p.history}):null,p.runs?(0,t.jsx)(d,{type:"warning",showIcon:!0,message:p.runs}):null,P?(0,t.jsx)(d,{type:"success",showIcon:!0,message:e("chat.threadMaintenance.copySuccess",{id:P}),action:D?.selectThread?(0,t.jsx)(u,{size:"small",onClick:()=>D.selectThread(P),children:e("chat.threadMaintenance.switchToCopy")}):null}):null,(0,t.jsxs)(h,{wrap:!0,size:16,children:[(0,t.jsx)(y,{label:e("chat.threadMaintenance.status"),children:(0,t.jsx)(S,{color:m?.status==="idle"?"green":m?.status==="error"?"red":"blue",children:m?.status??e("chat.threadMaintenance.unknown")})}),(0,t.jsx)(y,{label:e("chat.threadMaintenance.pendingMessages"),children:m?.pendingMessages??0}),(0,t.jsx)(y,{label:e("chat.threadMaintenance.storage"),children:T?Le(T.totalBytes):e("chat.threadMaintenance.unknown")}),(0,t.jsx)(y,{label:e("chat.threadMaintenance.checkpoints"),children:T?.checkpoints.count??0}),(0,t.jsx)(y,{label:e("chat.threadMaintenance.channelValues"),children:T?.channelValues.count??0}),(0,t.jsx)(y,{label:e("chat.threadMaintenance.pendingWrites"),children:T?.pendingWrites.count??0})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Text,{strong:!0,children:e("chat.threadMaintenance.interrupts")}),(0,t.jsx)("div",{style:{marginTop:6},children:Q.length===0?(0,t.jsx)(c.Text,{type:"secondary",children:e("chat.threadMaintenance.noInterrupts")}):(0,t.jsx)(h,{wrap:!0,children:Q.map(n=>(0,t.jsxs)(S,{color:"orange",children:[n.type,": ",n.interruptId]},n.interruptId))})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Text,{strong:!0,children:e("chat.threadMaintenance.runs")}),Y?(0,t.jsx)(d,{type:"error",showIcon:!0,message:Y,style:{marginTop:6}}):null,(0,t.jsx)(L,{rowKey:"runId",size:"small",columns:be,dataSource:Te,pagination:!1,loading:v,locale:{emptyText:(0,t.jsx)(F,{description:e("chat.threadMaintenance.noRuns")})}})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Text,{strong:!0,children:e("chat.threadMaintenance.history")}),(0,t.jsx)(L,{rowKey:"id",size:"small",columns:Be,dataSource:fe,pagination:!1,loading:v,locale:{emptyText:(0,t.jsx)(F,{description:e("chat.threadMaintenance.noHistory")})}})]}),(0,t.jsxs)(h,{wrap:!0,children:[(0,t.jsx)(C,{title:e("chat.threadMaintenance.pruneDeleteTitle"),description:e("chat.threadMaintenance.pruneDeleteConfirm"),okText:e("common.delete"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onConfirm:()=>void q("delete"),children:(0,t.jsx)(u,{danger:!0,icon:(0,t.jsx)(de,{size:14}),loading:U,children:e("chat.threadMaintenance.pruneDelete")})}),(0,t.jsx)(ne,{"aria-label":e("chat.threadMaintenance.keepLabel"),min:1,max:100,precision:0,step:1,value:A,onChange:n=>{j(typeof n=="number"?Math.min(100,Math.max(1,Math.trunc(n))):1)}}),(0,t.jsx)(C,{title:e("chat.threadMaintenance.pruneKeepTitle"),description:e("chat.threadMaintenance.pruneKeepConfirm",{count:A}),okText:e("chat.threadMaintenance.pruneKeepLatest"),cancelText:e("common.cancel"),onConfirm:()=>void q("keep_latest"),children:(0,t.jsx)(u,{loading:U,children:e("chat.threadMaintenance.pruneKeepLatest")})})]})]}),(0,t.jsx)(ae,{open:xe,title:e("chat.threadMaintenance.stateTitle"),footer:null,onCancel:ve,width:720,children:we?(0,t.jsx)(c.Text,{children:e("chat.threadMaintenance.loadingState")}):(0,t.jsx)("pre",{style:{maxHeight:"60vh",overflow:"auto",margin:0},children:ke})})]})},y=({label:r,children:e})=>(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Text,{type:"secondary",style:{display:"block",fontSize:12},children:r}),(0,t.jsx)(c.Text,{strong:!0,children:e})]});export{We as ThreadMaintenancePanel};
1
+ import{k as ue,q as he}from"./embed-page-chunk-AFYXBC77.js";import{o as oe}from"./embed-page-chunk-TZPX2O54.js";import{Aa as le,L as ce,La as de,O as se,Wa as Ae}from"./embed-page-chunk-F7ZUYG42.js";import{l as re}from"./embed-page-chunk-5EENS2J7.js";import{a as ie}from"./embed-page-chunk-QV7QAJ4N.js";import"./embed-page-chunk-L7GPZSYD.js";import{Ma as ae,Oa as C,W as d,Ya as L,Za as S,_ as u,ba as F,bb as c,qa as te,xa as ne,za as h}from"./embed-page-chunk-BUFWD6SE.js";import{a as Pe}from"./embed-page-chunk-R5QL57JJ.js";import"./embed-page-chunk-EUOOO2LS.js";import{f as I}from"./embed-page-chunk-QBTAJ2YI.js";var a=I(Pe());var _=I(Ae());var t=I(ie());function f(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function Ee(r){if(!f(r))return;let e=r.checkpoint;if(f(e)&&typeof e.checkpoint_id=="string")return e.checkpoint_id;let o=r.config;if(f(o)&&f(o.configurable)){let s=o.configurable.checkpoint_id;if(typeof s=="string")return s}}function ze(r){if(!f(r))return;if(typeof r.createdAt=="string")return r.createdAt;let e=r.checkpoint;if(f(e)&&typeof e.ts=="string")return e.ts}function He(r){switch(r){case"pending":return"blue";case"running":return"processing";case"success":return"green";case"error":case"failed":case"timeout":return"red";case"interrupted":return"orange";default:return}}function Fe(r){return r==="pending"||r==="running"}function Le(r){return r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(1)} KB`:`${(r/(1024*1024)).toFixed(2)} MB`}var We=({data:r})=>{let e=re(),o=r?.threadId,s=r?.assistantId,l=oe(s||"__no_assistant__"),D=(0,a.useContext)(ue),{closeSideApp:pe}=he(),[m,ge]=(0,a.useState)(null),[T,ye]=(0,a.useState)(null),[fe,me]=(0,a.useState)([]),[Te,Me]=(0,a.useState)([]),[v,R]=(0,a.useState)(!0),[K,M]=(0,a.useState)(null),[Y,O]=(0,a.useState)(null),[p,J]=(0,a.useState)({}),[b,N]=(0,a.useState)(null),[xe,W]=(0,a.useState)(!1),[ke,B]=(0,a.useState)(""),[we,$]=(0,a.useState)(!1),[Ce,G]=(0,a.useState)(!1),[P,Ie]=(0,a.useState)(null),[U,V]=(0,a.useState)(!1),[A,j]=(0,a.useState)(5),E=(0,a.useRef)(0),x=(0,a.useRef)(0),g=(0,a.useCallback)(async()=>{if(!o||!s){R(!1);return}let n=++E.current;R(!0),J({});let[i,k,X,Z]=await Promise.allSettled([l.getThreadStatus(o),l.getThreadStorage(o),l.getThreadHistory(o,{limit:10}),l.runs.list(o,s)]);if(n!==E.current)return;let w={};i.status==="fulfilled"?ge(i.value):w.status=e("chat.threadMaintenance.statusLoadFailed"),k.status==="fulfilled"?ye(k.value):w.storage=e("chat.threadMaintenance.storageLoadFailed"),X.status==="fulfilled"?me(X.value.flatMap(H=>{let ee=Ee(H);return ee===void 0?[]:[{id:ee,createdAt:ze(H),raw:H}]})):w.history=e("chat.threadMaintenance.historyLoadFailed"),Z.status==="fulfilled"?Me(Z.value):w.runs=e("chat.threadMaintenance.runsLoadFailed"),J(w),R(!1)},[s,l,e,o]);(0,a.useEffect)(()=>(g(),()=>{E.current+=1}),[g]);let Se=async n=>{if(!o)return;let i=++x.current;W(!0),$(!0),B("");try{let k=await l.getThreadStateAtCheckpoint(o,n.id);i===x.current&&B(JSON.stringify(k,null,2))}catch{i===x.current&&B(e("chat.threadMaintenance.stateFailed"))}finally{i===x.current&&$(!1)}},ve=()=>{x.current+=1,W(!1)},Re=async()=>{if(o){G(!0),M(null);try{let n=await l.copyThread(o);Ie(n.id)}catch{M(e("chat.threadMaintenance.copyFailed"))}finally{G(!1)}}},q=async n=>{if(!o)return;V(!0),M(null);let i=Math.min(100,Math.max(1,Math.trunc(A)));j(i);try{if(!(await l.pruneThread(o,n==="delete"?{strategy:n}:{strategy:n,keep:i})).pruned){M(e("chat.threadMaintenance.pruneFailed"));return}if(n==="delete"){pe();return}await g()}catch{M(e("chat.threadMaintenance.pruneFailed"))}finally{V(!1)}},z=(0,a.useCallback)(async(n,i)=>{if(!(!o||!s)){N(n),O(null);try{await l.runs.cancel(o,n,{action:i},s),await g()}catch{O(e("chat.threadMaintenance.runCancelFailed"))}finally{N(null)}}},[s,l,g,e,o]),Q=m?.interrupts??[],be=(0,a.useMemo)(()=>[{title:e("chat.threadMaintenance.runStatus"),dataIndex:"status",render:n=>(0,t.jsx)(S,{color:He(n),children:n})},{title:e("chat.threadMaintenance.runId"),dataIndex:"runId",render:n=>(0,t.jsx)(c.Text,{code:!0,ellipsis:{tooltip:n},style:{maxWidth:180},children:n})},{title:e("chat.threadMaintenance.runCreated"),dataIndex:"createdAt",render:n=>(0,_.default)(n).format("YYYY-MM-DD HH:mm:ss")},{title:e("chat.threadMaintenance.runOwner"),key:"owner",render:(n,i)=>(0,t.jsxs)(h,{size:4,children:[(0,t.jsx)(c.Text,{children:i.owner??"\u2014"}),(0,t.jsx)(c.Text,{type:"secondary",children:"/"}),(0,t.jsx)(c.Text,{type:"secondary",children:i.attempts})]})},{key:"actions",render:(n,i)=>Fe(i.status)?(0,t.jsxs)(h,{size:4,children:[(0,t.jsx)(C,{title:e("chat.threadMaintenance.interruptRunConfirm"),okText:e("chat.threadMaintenance.interruptRun"),cancelText:e("common.cancel"),onConfirm:()=>void z(i.runId,"interrupt"),children:(0,t.jsx)(u,{size:"small",type:"link",loading:b===i.runId,children:e("chat.threadMaintenance.interruptRun")})}),(0,t.jsx)(C,{title:e("chat.threadMaintenance.rollbackRunConfirm"),okText:e("chat.threadMaintenance.rollbackRun"),cancelText:e("common.cancel"),onConfirm:()=>void z(i.runId,"rollback"),children:(0,t.jsx)(u,{size:"small",type:"link",danger:!0,loading:b===i.runId,children:e("chat.threadMaintenance.rollbackRun")})})]}):null}],[z,b,e]),Be=(0,a.useMemo)(()=>[{title:e("chat.threadMaintenance.checkpointId"),dataIndex:"id",render:n=>(0,t.jsx)(c.Text,{code:!0,children:n})},{title:e("chat.threadMaintenance.checkpointTime"),dataIndex:"createdAt",render:n=>n?(0,_.default)(n).format("YYYY-MM-DD HH:mm:ss"):e("chat.threadMaintenance.unknown")},{key:"actions",render:(n,i)=>(0,t.jsx)(u,{size:"small",type:"link",onClick:()=>void Se(i),children:e("chat.threadMaintenance.viewState")})}],[e]);return!o||!s?(0,t.jsx)(d,{type:"warning",showIcon:!0,message:e("chat.threadMaintenance.missingContext")}):(0,t.jsxs)(te,{title:(0,t.jsxs)(h,{children:[(0,t.jsx)(se,{size:16}),e("chat.threadMaintenance.title")]}),extra:(0,t.jsxs)(h,{wrap:!0,children:[(0,t.jsx)(u,{icon:(0,t.jsx)(le,{size:14}),onClick:()=>void g(),loading:v,children:e("common.refresh")}),(0,t.jsx)(u,{icon:(0,t.jsx)(ce,{size:14}),loading:Ce,onClick:()=>void Re(),children:e("chat.threadMaintenance.copy")})]}),children:[(0,t.jsxs)(h,{direction:"vertical",size:14,style:{width:"100%"},children:[K?(0,t.jsx)(d,{type:"error",showIcon:!0,message:K}):null,p.status?(0,t.jsx)(d,{type:"error",showIcon:!0,message:p.status}):null,p.storage?(0,t.jsx)(d,{type:"warning",showIcon:!0,message:p.storage}):null,p.history?(0,t.jsx)(d,{type:"warning",showIcon:!0,message:p.history}):null,p.runs?(0,t.jsx)(d,{type:"warning",showIcon:!0,message:p.runs}):null,P?(0,t.jsx)(d,{type:"success",showIcon:!0,message:e("chat.threadMaintenance.copySuccess",{id:P}),action:D?.selectThread?(0,t.jsx)(u,{size:"small",onClick:()=>D.selectThread(P),children:e("chat.threadMaintenance.switchToCopy")}):null}):null,(0,t.jsxs)(h,{wrap:!0,size:16,children:[(0,t.jsx)(y,{label:e("chat.threadMaintenance.status"),children:(0,t.jsx)(S,{color:m?.status==="idle"?"green":m?.status==="error"?"red":"blue",children:m?.status??e("chat.threadMaintenance.unknown")})}),(0,t.jsx)(y,{label:e("chat.threadMaintenance.pendingMessages"),children:m?.pendingMessages??0}),(0,t.jsx)(y,{label:e("chat.threadMaintenance.storage"),children:T?Le(T.totalBytes):e("chat.threadMaintenance.unknown")}),(0,t.jsx)(y,{label:e("chat.threadMaintenance.checkpoints"),children:T?.checkpoints.count??0}),(0,t.jsx)(y,{label:e("chat.threadMaintenance.channelValues"),children:T?.channelValues.count??0}),(0,t.jsx)(y,{label:e("chat.threadMaintenance.pendingWrites"),children:T?.pendingWrites.count??0})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Text,{strong:!0,children:e("chat.threadMaintenance.interrupts")}),(0,t.jsx)("div",{style:{marginTop:6},children:Q.length===0?(0,t.jsx)(c.Text,{type:"secondary",children:e("chat.threadMaintenance.noInterrupts")}):(0,t.jsx)(h,{wrap:!0,children:Q.map(n=>(0,t.jsxs)(S,{color:"orange",children:[n.type,": ",n.interruptId]},n.interruptId))})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Text,{strong:!0,children:e("chat.threadMaintenance.runs")}),Y?(0,t.jsx)(d,{type:"error",showIcon:!0,message:Y,style:{marginTop:6}}):null,(0,t.jsx)(L,{rowKey:"runId",size:"small",columns:be,dataSource:Te,pagination:!1,loading:v,locale:{emptyText:(0,t.jsx)(F,{description:e("chat.threadMaintenance.noRuns")})}})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Text,{strong:!0,children:e("chat.threadMaintenance.history")}),(0,t.jsx)(L,{rowKey:"id",size:"small",columns:Be,dataSource:fe,pagination:!1,loading:v,locale:{emptyText:(0,t.jsx)(F,{description:e("chat.threadMaintenance.noHistory")})}})]}),(0,t.jsxs)(h,{wrap:!0,children:[(0,t.jsx)(C,{title:e("chat.threadMaintenance.pruneDeleteTitle"),description:e("chat.threadMaintenance.pruneDeleteConfirm"),okText:e("common.delete"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onConfirm:()=>void q("delete"),children:(0,t.jsx)(u,{danger:!0,icon:(0,t.jsx)(de,{size:14}),loading:U,children:e("chat.threadMaintenance.pruneDelete")})}),(0,t.jsx)(ne,{"aria-label":e("chat.threadMaintenance.keepLabel"),min:1,max:100,precision:0,step:1,value:A,onChange:n=>{j(typeof n=="number"?Math.min(100,Math.max(1,Math.trunc(n))):1)}}),(0,t.jsx)(C,{title:e("chat.threadMaintenance.pruneKeepTitle"),description:e("chat.threadMaintenance.pruneKeepConfirm",{count:A}),okText:e("chat.threadMaintenance.pruneKeepLatest"),cancelText:e("common.cancel"),onConfirm:()=>void q("keep_latest"),children:(0,t.jsx)(u,{loading:U,children:e("chat.threadMaintenance.pruneKeepLatest")})})]})]}),(0,t.jsx)(ae,{open:xe,title:e("chat.threadMaintenance.stateTitle"),footer:null,onCancel:ve,width:720,children:we?(0,t.jsx)(c.Text,{children:e("chat.threadMaintenance.loadingState")}):(0,t.jsx)("pre",{style:{maxHeight:"60vh",overflow:"auto",margin:0},children:ke})})]})},y=({label:r,children:e})=>(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Text,{type:"secondary",style:{display:"block",fontSize:12},children:r}),(0,t.jsx)(c.Text,{strong:!0,children:e})]});export{We as ThreadMaintenancePanel};
@@ -1,4 +1,4 @@
1
- import{a as ue,c as fe}from"./embed-page-chunk-NGO5C5RH.js";import{a as xe}from"./embed-page-chunk-HQLSH3FC.js";import{a as ie,b as G,e as V,f as U,g as re,h as se,i as ae,k as le,l as de,m as ce,n as pe}from"./embed-page-chunk-5AWYMAAX.js";import"./embed-page-chunk-S4XZPBRM.js";import{j as O}from"./embed-page-chunk-KWZEITYQ.js";import"./embed-page-chunk-54M4265G.js";import{a as j}from"./embed-page-chunk-3XPHW2C7.js";import"./embed-page-chunk-5QZRLAW2.js";import{A as oe,E as $,Pa as ne,g as te,ma as H,y as L}from"./embed-page-chunk-F7ZUYG42.js";import{l as N}from"./embed-page-chunk-3FNSGFP2.js";import{a as D}from"./embed-page-chunk-QV7QAJ4N.js";import"./embed-page-chunk-VW3NF5NT.js";import"./embed-page-chunk-Z4Z6VCUZ.js";import{G as Q,Ma as ee}from"./embed-page-chunk-L7GPZSYD.js";import{Ja as M,Ka as K,Oa as Z,Sa as X,Za as I,ba as P,bb as q,ha as B,ya as J,za as F}from"./embed-page-chunk-BUFWD6SE.js";import{a as Y}from"./embed-page-chunk-R5QL57JJ.js";import"./embed-page-chunk-QOWM3LMZ.js";import"./embed-page-chunk-EUOOO2LS.js";import"./embed-page-chunk-5JDQ456X.js";import{f as T}from"./embed-page-chunk-QBTAJ2YI.js";var s=T(Y());var _=T(xe());var ge=T(Y());var ye=T(D()),me=({steps:t,graphDefinition:o,assistantId:r})=>{let n=(0,ge.useMemo)(()=>fe(o),[o]);return(0,ye.jsx)(ue,{dsl:n,steps:t,assistantId:r})};var e=T(D()),ve=`
1
+ import{a as ue,c as fe}from"./embed-page-chunk-ZVTX7OVB.js";import{a as xe}from"./embed-page-chunk-HQLSH3FC.js";import{a as ie,b as G,e as V,f as U,g as re,h as se,i as ae,k as le,l as de,m as ce,n as pe}from"./embed-page-chunk-5AWYMAAX.js";import"./embed-page-chunk-S4XZPBRM.js";import{j as O}from"./embed-page-chunk-4GCFDWE7.js";import{a as j}from"./embed-page-chunk-5O5IKZOC.js";import"./embed-page-chunk-AFYXBC77.js";import"./embed-page-chunk-TZPX2O54.js";import{A as oe,E as $,Pa as ne,g as te,ma as H,y as L}from"./embed-page-chunk-F7ZUYG42.js";import{l as N}from"./embed-page-chunk-5EENS2J7.js";import{a as D}from"./embed-page-chunk-QV7QAJ4N.js";import"./embed-page-chunk-VW3NF5NT.js";import"./embed-page-chunk-Z4Z6VCUZ.js";import{G as Q,Ma as ee}from"./embed-page-chunk-L7GPZSYD.js";import{Ja as M,Ka as K,Oa as Z,Sa as X,Za as I,ba as P,bb as q,ha as B,ya as J,za as F}from"./embed-page-chunk-BUFWD6SE.js";import{a as Y}from"./embed-page-chunk-R5QL57JJ.js";import"./embed-page-chunk-QOWM3LMZ.js";import"./embed-page-chunk-EUOOO2LS.js";import"./embed-page-chunk-5JDQ456X.js";import{f as T}from"./embed-page-chunk-QBTAJ2YI.js";var s=T(Y());var _=T(xe());var ge=T(Y());var ye=T(D()),me=({steps:t,graphDefinition:o,assistantId:r})=>{let n=(0,ge.useMemo)(()=>fe(o),[o]);return(0,ye.jsx)(ue,{dsl:n,steps:t,assistantId:r})};var e=T(D()),ve=`
2
2
  @keyframes spin {
3
3
  from { transform: rotate(0deg); }
4
4
  to { transform: rotate(360deg); }
@@ -1,3 +1,3 @@
1
- import{a as $e,b as Ue}from"./embed-page-chunk-62CAXPZK.js";import{b as Xe,c as me}from"./embed-page-chunk-NGO5C5RH.js";import"./embed-page-chunk-HQLSH3FC.js";import{f as Ye}from"./embed-page-chunk-5AWYMAAX.js";import"./embed-page-chunk-S4XZPBRM.js";import{T as Ge,j as Ke}from"./embed-page-chunk-KWZEITYQ.js";import{i as te}from"./embed-page-chunk-54M4265G.js";import{a as ne}from"./embed-page-chunk-3XPHW2C7.js";import"./embed-page-chunk-5QZRLAW2.js";import{Ea as q,Ha as fe,I as ce,Ja as qe,O as pe,Ra as ue,Sa as ee,Ta as He,Y as je,_ as Ee,aa as ge,fa as _e,ia as Fe,l as Oe,na as Be,o as de,t as Pe,za as Ne}from"./embed-page-chunk-F7ZUYG42.js";import{l as O}from"./embed-page-chunk-3FNSGFP2.js";import{a as j}from"./embed-page-chunk-QV7QAJ4N.js";import"./embed-page-chunk-VW3NF5NT.js";import"./embed-page-chunk-Z4Z6VCUZ.js";import{Ba as De,G as Te,Ja as le,Ra as Le,sa as Me}from"./embed-page-chunk-L7GPZSYD.js";import{Da as J,Ia as V,Ja as ae,Ma as Q,Oa as Ae,W as ze,_ as $,ba as U,bb as Z,ha as X,qa as Ie}from"./embed-page-chunk-BUFWD6SE.js";import{a as se}from"./embed-page-chunk-R5QL57JJ.js";import"./embed-page-chunk-QOWM3LMZ.js";import"./embed-page-chunk-EUOOO2LS.js";import"./embed-page-chunk-5JDQ456X.js";import{f as I}from"./embed-page-chunk-QBTAJ2YI.js";var i=I(se());var oe=I(se());var P=I(j());function ft(r){let o=r.split(/[\n\r.。;;!!??]+/).filter(Boolean)[0]?.trim()||"";return o=o.replace(/[,,]+$/,"").trim(),o.length>50&&(o=o.slice(0,50)),o||(o=r.slice(0,50).trim()),o}function ut(r){let e=5381;for(let o=0;o<r.length;o++)e=(e<<5)+e+r.charCodeAt(o)>>>0;return e.toString(36).slice(0,6)}var be=({open:r,onCancel:e,onCreated:o})=>{let{post:w}=ne(),v=O(),{trainingProjects:d,loading:u}=te(),[y,p]=(0,oe.useState)(null),[g]=J.useForm(),b=d.find(h=>h.id===y)??d[0]??null;(0,oe.useEffect)(()=>{r&&(g.resetFields(),p(null))},[r,g]);let R=async()=>{if(!b)return;let m=((await g.validateFields()).purpose||"").trim(),A=ft(m),z=`wf-${ut(m+Date.now())}`,E={key:z,name:A,description:m,type:"workflow",prompt:"Complete the assigned task accurately and concisely.",metadata:{trainingProjectId:b?.id},workflowYaml:`name: ${z}
1
+ import{a as $e,b as Ue}from"./embed-page-chunk-ML6AVDQQ.js";import{b as Xe,c as me}from"./embed-page-chunk-ZVTX7OVB.js";import"./embed-page-chunk-HQLSH3FC.js";import{f as Ye}from"./embed-page-chunk-5AWYMAAX.js";import"./embed-page-chunk-S4XZPBRM.js";import{T as Ge,j as Ke}from"./embed-page-chunk-4GCFDWE7.js";import{a as ne}from"./embed-page-chunk-5O5IKZOC.js";import{i as te}from"./embed-page-chunk-AFYXBC77.js";import"./embed-page-chunk-TZPX2O54.js";import{Ea as q,Ha as fe,I as ce,Ja as qe,O as pe,Ra as ue,Sa as ee,Ta as He,Y as je,_ as Ee,aa as ge,fa as _e,ia as Fe,l as Oe,na as Be,o as de,t as Pe,za as Ne}from"./embed-page-chunk-F7ZUYG42.js";import{l as O}from"./embed-page-chunk-5EENS2J7.js";import{a as j}from"./embed-page-chunk-QV7QAJ4N.js";import"./embed-page-chunk-VW3NF5NT.js";import"./embed-page-chunk-Z4Z6VCUZ.js";import{Ba as De,G as Te,Ja as le,Ra as Le,sa as Me}from"./embed-page-chunk-L7GPZSYD.js";import{Da as J,Ia as V,Ja as ae,Ma as Q,Oa as Ae,W as ze,_ as $,ba as U,bb as Z,ha as X,qa as Ie}from"./embed-page-chunk-BUFWD6SE.js";import{a as se}from"./embed-page-chunk-R5QL57JJ.js";import"./embed-page-chunk-QOWM3LMZ.js";import"./embed-page-chunk-EUOOO2LS.js";import"./embed-page-chunk-5JDQ456X.js";import{f as I}from"./embed-page-chunk-QBTAJ2YI.js";var i=I(se());var oe=I(se());var P=I(j());function ft(r){let o=r.split(/[\n\r.。;;!!??]+/).filter(Boolean)[0]?.trim()||"";return o=o.replace(/[,,]+$/,"").trim(),o.length>50&&(o=o.slice(0,50)),o||(o=r.slice(0,50).trim()),o}function ut(r){let e=5381;for(let o=0;o<r.length;o++)e=(e<<5)+e+r.charCodeAt(o)>>>0;return e.toString(36).slice(0,6)}var be=({open:r,onCancel:e,onCreated:o})=>{let{post:w}=ne(),v=O(),{trainingProjects:d,loading:u}=te(),[y,p]=(0,oe.useState)(null),[g]=J.useForm(),b=d.find(h=>h.id===y)??d[0]??null;(0,oe.useEffect)(()=>{r&&(g.resetFields(),p(null))},[r,g]);let R=async()=>{if(!b)return;let m=((await g.validateFields()).purpose||"").trim(),A=ft(m),z=`wf-${ut(m+Date.now())}`,E={key:z,name:A,description:m,type:"workflow",prompt:"Complete the assigned task accurately and concisely.",metadata:{trainingProjectId:b?.id},workflowYaml:`name: ${z}
2
2
  steps: []
3
3
  `};await w("/api/assistants",{id:z,name:A,description:m,graphDefinition:E}),g.resetFields(),o(z,m,b?.id)};return(0,P.jsx)(Q,{title:v("chatConfig.workflow.create.title"),open:r,onCancel:e,onOk:R,okText:v("common.create"),okButtonProps:{disabled:u||!b},destroyOnClose:!0,children:(0,P.jsxs)(J,{form:g,layout:"vertical",initialValues:{purpose:""},children:[(0,P.jsx)(J.Item,{name:"purpose",label:v("chatConfig.workflow.field.purpose"),rules:[{required:!0,message:v("chatConfig.workflow.validation.purposeRequired")}],children:(0,P.jsx)(V.TextArea,{placeholder:v("chatConfig.workflow.field.purposePlaceholder"),rows:4})}),(0,P.jsx)($e,{project:b,value:b?.id??null,onChange:p,loading:u})]})})};var Qe=I(se());var t=I(j()),{Text:ye}=Z;function mt(r){if(!r||typeof r!="object")return null;let e=r;return{modelKey:e.modelKey||e.model||void 0,tools:Array.isArray(e.tools)?e.tools:[],middleware:Array.isArray(e.middleware)?e.middleware.filter(o=>o&&typeof o=="object"&&o.type):[],subAgents:Array.isArray(e.subAgents)?e.subAgents:[],skillCategories:Array.isArray(e.skillCategories)?e.skillCategories:[],runConfig:e.runConfig&&typeof e.runConfig=="object"?e.runConfig:void 0}}var bt={filesystem:(0,t.jsx)(je,{size:12}),code_eval:(0,t.jsx)(qe,{size:12}),browser:(0,t.jsx)(ge,{size:12}),sql:(0,t.jsx)(pe,{size:12}),skill:(0,t.jsx)(fe,{size:12}),http:(0,t.jsx)(Fe,{size:12}),scheduler:(0,t.jsx)(ce,{size:12}),metrics:(0,t.jsx)(Oe,{size:12}),ask_user_to_clarify:(0,t.jsx)(Be,{size:12}),widget:(0,t.jsx)(de,{size:12}),date:(0,t.jsx)(Pe,{size:12}),task:(0,t.jsx)(Ee,{size:12}),custom:(0,t.jsx)(Ne,{size:12}),claw:(0,t.jsx)(q,{size:12}),collection:(0,t.jsx)(_e,{size:12})},yt={filesystem:{bg:"rgba(34,197,94,0.08)",text:"#16a34a",border:"rgba(34,197,94,0.2)"},code_eval:{bg:"rgba(99,102,241,0.08)",text:"#4f46e5",border:"rgba(99,102,241,0.2)"},browser:{bg:"rgba(59,130,246,0.08)",text:"#2563eb",border:"rgba(59,130,246,0.2)"},sql:{bg:"rgba(249,115,22,0.08)",text:"#ea580c",border:"rgba(249,115,22,0.2)"},skill:{bg:"rgba(168,85,247,0.08)",text:"#9333ea",border:"rgba(168,85,247,0.2)"},http:{bg:"rgba(20,184,166,0.08)",text:"#0d9488",border:"rgba(20,184,166,0.2)"},scheduler:{bg:"rgba(245,158,11,0.08)",text:"#d97706",border:"rgba(245,158,11,0.2)"},metrics:{bg:"rgba(236,72,153,0.08)",text:"#db2777",border:"rgba(236,72,153,0.2)"},ask_user_to_clarify:{bg:"rgba(245,158,11,0.08)",text:"#d97706",border:"rgba(245,158,11,0.2)"},widget:{bg:"rgba(20,184,166,0.08)",text:"#0d9488",border:"rgba(20,184,166,0.2)"},date:{bg:"rgba(139,92,246,0.08)",text:"#7c3aed",border:"rgba(139,92,246,0.2)"},task:{bg:"rgba(99,102,241,0.08)",text:"#4f46e5",border:"rgba(99,102,241,0.2)"},custom:{bg:"rgba(107,114,128,0.08)",text:"#4b5563",border:"rgba(107,114,128,0.2)"},claw:{bg:"rgba(107,114,128,0.08)",text:"#4b5563",border:"rgba(107,114,128,0.2)"},collection:{bg:"rgba(6,182,212,0.08)",text:"#0891b2",border:"rgba(6,182,212,0.2)"}},wt={bg:"rgba(107,114,128,0.08)",text:"#4b5563",border:"rgba(107,114,128,0.2)"};function ht(r){let e=r.split(/[_-]+/).filter(Boolean);return e.length===1?e[0].slice(0,2).toUpperCase():e.map(o=>o[0]).join("").toUpperCase().slice(0,2)}var Je=[{bg:"rgba(99,102,241,0.1)",text:"#6366f1"},{bg:"rgba(34,197,94,0.1)",text:"#22c55e"},{bg:"rgba(245,158,11,0.1)",text:"#f59e0b"},{bg:"rgba(59,130,246,0.1)",text:"#3b82f6"},{bg:"rgba(239,68,68,0.1)",text:"#ef4444"},{bg:"rgba(168,85,247,0.1)",text:"#a855f7"},{bg:"rgba(20,184,166,0.1)",text:"#14b8a6"},{bg:"rgba(236,72,153,0.1)",text:"#ec4899"}];function Ve(r){return Je[r%Je.length]}var H=({icon:r,label:e,count:o,children:w})=>(0,t.jsxs)("div",{style:{marginBottom:10},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:6},children:[(0,t.jsx)("span",{style:{color:"#6366f1",display:"flex",alignItems:"center"},children:r}),(0,t.jsx)(ye,{strong:!0,style:{fontSize:11,color:"#52525b",textTransform:"uppercase",letterSpacing:"0.3px"},children:e}),(0,t.jsx)("span",{style:{fontSize:9,fontWeight:600,color:"#a1a1aa",background:"rgba(0,0,0,0.04)",borderRadius:8,padding:"1px 6px",lineHeight:"16px"},children:o})]}),w]}),Ze=({graphDef:r})=>{let e=O(),o=(0,Qe.useMemo)(()=>mt(r),[r]);if(!o)return null;let w=o.middleware.filter(d=>d.enabled!==!1),v=!1;return o.tools.length===0&&w.length===0&&o.subAgents.length===0?null:(0,t.jsx)("div",{style:{pointerEvents:"auto"},children:(0,t.jsxs)("div",{style:{background:"rgba(255,255,255,0.5)",borderRadius:8,width:250,transition:"all 0.25s ease",overflow:"hidden"},children:[(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",background:"rgba(99,102,241,0.02)",borderBottom:"1px solid rgba(0,0,0,0.03)"},children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,t.jsx)("div",{style:{width:24,height:24,borderRadius:6,background:"rgba(99,102,241,0.05)",display:"flex",alignItems:"center",justifyContent:"center",color:"#6366f1"},children:(0,t.jsx)(q,{size:13})}),(0,t.jsx)(ye,{strong:!0,style:{fontSize:12,color:"#1a1a1a"},children:e("chat.environment.title")})]})}),(0,t.jsxs)("div",{style:{padding:"10px 12px 12px",maxHeight:"calc(60vh - 48px)",overflowY:"auto"},children:[o.tools.length>0&&(0,t.jsx)(H,{icon:(0,t.jsx)(He,{size:12}),label:e("chat.environment.tools"),count:o.tools.length,children:(0,t.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:o.tools.map((d,u)=>{let y=Ve(u);return(0,t.jsx)(X,{title:d,placement:"top",children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",borderRadius:6,fontSize:10,fontWeight:500,color:y.text,background:y.bg,cursor:"default",whiteSpace:"nowrap",lineHeight:"16px"},children:[(0,t.jsx)("span",{style:{fontWeight:700,fontSize:9,opacity:.7},children:ht(d)}),(0,t.jsx)("span",{children:d})]})},d)})})}),w.length>0&&(0,t.jsx)(H,{icon:(0,t.jsx)(de,{size:12}),label:e("chat.environment.capabilities"),count:w.length,children:(0,t.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:w.map(d=>{let u=yt[d.type]||wt,y=bt[d.type]||(0,t.jsx)(q,{size:12});return(0,t.jsx)(X,{title:d.name||d.type,placement:"top",children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",borderRadius:6,fontSize:10,fontWeight:500,color:u.text,background:u.bg,border:`1px solid ${u.border}`,cursor:"default",whiteSpace:"nowrap",lineHeight:"16px"},children:[y,(0,t.jsx)("span",{children:d.name||d.type})]})},d.type)})})}),o.subAgents.length>0&&(0,t.jsx)(H,{icon:(0,t.jsx)(ue,{size:12}),label:e("chat.environment.subAgents"),count:o.subAgents.length,children:(0,t.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:o.subAgents.map((d,u)=>{let y=Ve(u+3);return(0,t.jsx)(X,{title:d,placement:"top",children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",borderRadius:6,fontSize:10,fontWeight:500,color:y.text,background:y.bg,cursor:"default",whiteSpace:"nowrap",lineHeight:"16px"},children:[(0,t.jsx)(ue,{size:10}),(0,t.jsx)("span",{children:d})]})},d)})})}),(o.modelKey||o.runConfig)&&(0,t.jsx)(H,{icon:(0,t.jsx)(ce,{size:12}),label:e("chat.environment.runtime"),count:o.modelKey?1:0,children:(0,t.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:[o.modelKey&&(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",borderRadius:6,fontSize:10,fontWeight:500,color:"#4f46e5",background:"rgba(99,102,241,0.08)",border:"1px solid rgba(99,102,241,0.2)",cursor:"default",whiteSpace:"nowrap",lineHeight:"16px"},children:[(0,t.jsx)(q,{size:10}),(0,t.jsx)("span",{children:e("chat.environment.model",{model:o.modelKey})})]}),!!o.runConfig?.databaseKey&&(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",borderRadius:6,fontSize:10,fontWeight:500,color:"#ea580c",background:"rgba(249,115,22,0.08)",border:"1px solid rgba(249,115,22,0.2)",cursor:"default",whiteSpace:"nowrap",lineHeight:"16px"},children:[(0,t.jsx)(pe,{size:10}),(0,t.jsx)("span",{children:e("chat.environment.db",{db:String(o.runConfig?.databaseKey)})})]}),o.skillCategories&&o.skillCategories.length>0&&(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",borderRadius:6,fontSize:10,fontWeight:500,color:"#9333ea",background:"rgba(168,85,247,0.08)",border:"1px solid rgba(168,85,247,0.2)",cursor:"default",whiteSpace:"nowrap",lineHeight:"16px"},children:[(0,t.jsx)(fe,{size:10}),(0,t.jsx)("span",{children:e("chat.environment.skills",{skills:o.skillCategories.join(", ")})})]})]})}),v&&(0,t.jsx)(H,{icon:(0,t.jsx)(ge,{size:12}),label:e("chat.environment.channels"),count:0,children:(0,t.jsx)(ye,{type:"secondary",style:{fontSize:10,fontStyle:"italic"},children:e("chat.environment.noChannels")})})]})]})})};var n=I(j()),{Text:K}=Z,xt=300;function et(r){if(typeof r=="string")try{let e=JSON.parse(r);return e&&typeof e=="object"&&!Array.isArray(e)?e:null}catch{return null}return r&&typeof r=="object"&&!Array.isArray(r)?r:null}function kt(r){let e=null;if(typeof r=="string")try{e=JSON.parse(r)}catch{return null}else r&&typeof r=="object"&&(e=r);if(!e)return null;if(e.type!=="workflow")return console.warn("[extractDSL] type is not 'workflow':",e.type),null;if(typeof e.workflowYaml!="string")return console.warn("[extractDSL] workflowYaml not found or not a string, keys:",Object.keys(e)),null;try{return me(e.workflowYaml)}catch(o){return console.error("[extractDSL] expandWorkflow failed:",o.message,o),null}}function vt({workflows:r,selectedId:e,onSelect:o,onCreate:w,onDelete:v,dsl:d,agentNameMap:u,onSpecClick:y,environmentConfig:p}){let g=O(),b=r.find(f=>f.id===e),[R,h]=(0,i.useState)(!0),[m,A]=(0,i.useState)(""),z=(0,i.useMemo)(()=>{let f=m.trim().toLowerCase();return f?r.filter(C=>C.name.toLowerCase().includes(f)||C.description.toLowerCase().includes(f)):r},[r,m]);(0,i.useEffect)(()=>{e?h(!1):(h(!0),A(""))},[e]);let E=f=>{o(f),h(!1)};return(0,n.jsx)("div",{style:{display:"flex",height:"100%",width:"100%"},children:(0,n.jsxs)("div",{style:{flex:1,position:"relative"},children:[b?(0,n.jsxs)(n.Fragment,{children:[d?(0,n.jsx)(Xe,{dsl:d,agentNameMap:u}):(0,n.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:(0,n.jsx)(ae,{tip:g("chatWorkspace.workflowAutomation.loadingDsl")})}),!R&&(0,n.jsx)("div",{style:{position:"absolute",top:12,left:12,zIndex:10},children:(0,n.jsx)($,{type:"default",icon:(0,n.jsx)(De,{}),onClick:()=>h(!0),style:{width:32,height:32,borderRadius:10,boxShadow:"0 2px 12px rgba(0,0,0,0.08)",border:"1px solid #f0f0f0",background:"rgba(255,255,255,0.95)",color:"#6366f1",display:"flex",alignItems:"center",justifyContent:"center"}})}),(0,n.jsxs)("div",{style:{position:"absolute",top:12,left:R?12:56,zIndex:10,display:"flex",alignItems:"center",gap:6,height:32,padding:"0 14px",background:"rgba(255,255,255,0.95)",borderRadius:10,boxShadow:"0 2px 12px rgba(0,0,0,0.08)",border:"1px solid #f0f0f0"},children:[(0,n.jsx)(ee,{size:16,color:"#6366f1"}),(0,n.jsx)(K,{strong:!0,style:{fontSize:13},children:b.name}),(0,n.jsx)(Me,{style:{color:"#6366f1",cursor:"pointer",fontSize:15},onClick:y})]}),(0,n.jsx)("div",{style:{position:"absolute",top:12,right:12,zIndex:10,display:"flex",alignItems:"center",height:32,padding:"0 14px",background:"rgba(255,255,255,0.95)",borderRadius:10,boxShadow:"0 2px 12px rgba(0,0,0,0.08)",border:"1px solid #f0f0f0"},children:(0,n.jsx)(Ae,{title:g("chatWorkspace.workflowAutomation.deleteTitle"),description:g("chatWorkspace.workflowAutomation.deleteBody"),onConfirm:()=>v(b.id),okText:g("common.delete"),cancelText:g("common.cancel"),okButtonProps:{danger:!0},children:(0,n.jsx)(Te,{style:{color:"#ff4d4f",cursor:"pointer",fontSize:15}})})}),!R&&(0,n.jsx)("div",{style:{position:"absolute",top:52,left:R?12:56,zIndex:20},children:(0,n.jsx)(Ze,{graphDef:p},b.id)})]}):(0,n.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:(0,n.jsx)(U,{description:g("chatWorkspace.workflowAutomation.selectWorkflow")})}),R&&(0,n.jsxs)(n.Fragment,{children:[e&&(0,n.jsx)("div",{onClick:()=>h(!1),style:{position:"absolute",inset:0,zIndex:25,background:"transparent"}}),(0,n.jsxs)(Ie,{size:"small",title:(0,n.jsx)(K,{strong:!0,style:{fontSize:15,color:"#1a1a1a"},children:g("chatWorkspace.workflowAutomation.title")}),extra:(0,n.jsx)($,{type:"text",size:"small",icon:(0,n.jsx)(le,{}),onClick:w,style:{color:"#6366f1"}}),styles:{body:{padding:"12px 16px 16px"},header:{padding:"14px 16px 10px",borderBottom:"1px solid rgba(0,0,0,0.04)"}},style:{position:"absolute",left:16,top:e?56:48,bottom:16,width:300,zIndex:30,borderRadius:16,boxShadow:"0 4px 24px rgba(0,0,0,0.12)",border:"1px solid #f0f0f0",overflow:"auto",background:"rgba(255, 255, 255, 0.92)"},children:[(0,n.jsx)("div",{style:{marginBottom:12},children:(0,n.jsx)(V,{prefix:(0,n.jsx)(Le,{style:{color:"#bbb"}}),placeholder:g("chatWorkspace.workflowAutomation.filterPlaceholder"),value:m,onChange:f=>A(f.target.value),allowClear:!0,size:"small",style:{borderRadius:10,border:"1px solid rgba(0,0,0,0.06)"}})}),z.length===0?(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"32px 16px",color:"#bbb"},children:[(0,n.jsx)(ee,{size:28,style:{marginBottom:10,opacity:.4}}),(0,n.jsx)(K,{type:"secondary",style:{fontSize:13},children:m.trim()?g("chatWorkspace.workflowAutomation.noMatch"):g("chatWorkspace.workflowAutomation.emptyTitle")})]}):z.map(f=>{let C=e===f.id;return(0,n.jsxs)("div",{onClick:()=>E(f.id),style:{display:"flex",alignItems:"center",gap:12,padding:"13px 15px",borderRadius:12,cursor:"pointer",transition:"all 0.2s ease",background:C?"rgba(99, 102, 241, 0.07)":"rgba(255, 255, 255, 0.5)",border:C?"1px solid rgba(99, 102, 241, 0.25)":"1px solid transparent",marginBottom:6},onMouseEnter:S=>{C||(S.currentTarget.style.background="rgba(255, 255, 255, 0.92)",S.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.05)",S.currentTarget.style.transform="translateY(-1px)",S.currentTarget.style.borderColor="rgba(0,0,0,0.06)")},onMouseLeave:S=>{C||(S.currentTarget.style.background="rgba(255, 255, 255, 0.5)",S.currentTarget.style.boxShadow="none",S.currentTarget.style.transform="translateY(0)",S.currentTarget.style.borderColor="transparent")},children:[(0,n.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:38,height:38,borderRadius:10,background:C?"rgba(99, 102, 241, 0.12)":"rgba(0, 0, 0, 0.04)",flexShrink:0,transition:"background 0.2s ease"},children:(0,n.jsx)(ee,{size:18,color:C?"#6366f1":"#888"})}),(0,n.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,n.jsx)(K,{strong:!0,ellipsis:{tooltip:f.name},style:{fontSize:14,color:C?"#6366f1":"#1a1a1a",transition:"color 0.2s ease"},children:f.name}),f.description&&(0,n.jsx)("div",{style:{fontSize:12,color:"#999",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:3,lineHeight:"18px"},children:f.description})]})]},f.id)})]})]})]})})}var Ct=()=>{let r=O(),{get:e,del:o}=ne(),{workspaceId:w,trainingProjects:v,loading:d}=te(),[u,y]=(0,i.useState)([]),[p,g]=(0,i.useState)(null),[b,R]=(0,i.useState)(null),[h,m]=(0,i.useState)(null),[A,z]=(0,i.useState)([]),[E,f]=(0,i.useState)(new Map),C=(0,i.useCallback)(async()=>{try{let s=await e("/api/assistants");if(s.success&&s.data?.records){let c=[],a=new Map;for(let l of s.data.records){if(l.id&&l.name){let x=typeof l.graphDefinition=="object"&&l.graphDefinition!==null?l.graphDefinition:void 0;a.set(l.id,{name:l.name,type:x?.type??"unknown"})}if(l.graphDefinition)if(typeof l.graphDefinition=="string")try{c.push(JSON.parse(l.graphDefinition))}catch{}else typeof l.graphDefinition=="object"&&c.push(l.graphDefinition)}z(c),f(a)}}catch{}},[e]),[S,we]=(0,i.useState)(!0),[re,tt]=(0,i.useState)(420),_=(0,i.useRef)(null),[nt,ot]=(0,i.useState)(!0),[he,xe]=(0,i.useState)(null),[rt,ke]=(0,i.useState)(!1),[ve,F]=(0,i.useState)(!1),[it,Ce]=(0,i.useState)(null),st=(0,i.useMemo)(()=>["create_workflow","update_workflow","validate_workflow","create_agent","update_agent","delete_agent"],[]),T=(0,i.useCallback)(async()=>{let s=await e("/api/assistants");if(s.success&&s.data?.records){let c=s.data.records.filter(a=>(et(a.graphDefinition)??void 0)?.type==="workflow").map(a=>{let l=et(a.graphDefinition)??void 0,x=typeof l?.workflowYaml=="string"?l.workflowYaml:"",B=l?.metadata,N=0;try{N=me(x).nodes.filter(W=>W.type!=="terminal").length}catch{}return{id:a.id,name:a.name,description:a.description||"",type:"workflow",stepCount:N,trainingProjectId:typeof B?.trainingProjectId=="string"?B.trainingProjectId:void 0}});y(c)}xe(null)},[e]),Y=(0,i.useCallback)(async s=>{try{let c=await e(`/api/assistants/${s}`);if(c.success&&c.data){let a=c.data.graphDefinition,l=kt(a);if(R(l),!a)m(null);else if(typeof a=="string")try{m(JSON.parse(a))}catch{m(null)}else m(typeof a=="object"?a:null)}}catch{R(null),m(null)}},[e]);(0,i.useEffect)(()=>{let s=!1;return(async()=>{try{await T(),await C()}catch(a){s||xe(a instanceof Error?a.message:r("chatWorkspace.workflowAutomation.loadFailed"))}finally{s||ot(!1)}})(),()=>{s=!0}},[T]),(0,i.useEffect)(()=>{p?Y(p):R(null)},[p,Y]);let at=(0,i.useCallback)(s=>{s.preventDefault(),_.current={startX:s.clientX,startWidth:re}},[re]);(0,i.useEffect)(()=>{let s=a=>{if(!_.current)return;let l=_.current.startX-a.clientX,x=Math.min(900,Math.max(400,_.current.startWidth+l));tt(x)},c=()=>{_.current=null};return window.addEventListener("mousemove",s),window.addEventListener("mouseup",c),()=>{window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",c)}},[]);let D=(0,i.useRef)(null),Se=(0,i.useRef)({fetchWorkflows:T,fetchDSL:Y});Se.current={fetchWorkflows:T,fetchDSL:Y};let Re=(0,i.useRef)(p);Re.current=p;let lt=(0,i.useCallback)(()=>{D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{D.current=null;let{fetchWorkflows:s,fetchDSL:c}=Se.current;s().catch(l=>{console.warn("Failed to refresh workflows:",l)});let a=Re.current;a&&c(a).catch(l=>{console.warn("Failed to refresh workflow DSL:",l)})},xt)},[]);(0,i.useEffect)(()=>()=>{D.current&&(clearTimeout(D.current),D.current=null)},[]);let dt=(0,i.useCallback)(s=>{g(s)},[]),We=(0,i.useCallback)((s,c,a)=>{F(!1),T().then(()=>{g(s),a&&y(l=>l.map(x=>x.id===s?{...x,trainingProjectId:a}:x)),c&&Ce({requestId:s,content:c})})},[T]),ct=(0,i.useCallback)(async s=>{await o(`/api/assistants/${s}`),p===s&&g(null),await T()},[o,T,p]),L=(0,i.useMemo)(()=>u.find(s=>s.id===p)||null,[u,p]),G=L?.trainingProjectId??v[0]?.id??null,pt=(0,i.useMemo)(()=>p&&L?{id:p,name:L.name,type:"workflow"}:null,[p,L]),gt=(0,i.useMemo)(()=>{let s=b?.nodes.filter(k=>k.type!=="terminal"&&k.ref).map(k=>k.ref).filter((k,W,M)=>M.indexOf(k)===W)??[];if(s.length===0)return h;let c=A.filter(k=>{let W=k.key;return W&&s.includes(W)});if(c.length===0)return h;let a={...h??{}},l=new Set(a.tools??[]),x=[...a.middleware??[]],B=new Set(a.subAgents??[]),N=new Set(x.map(k=>k.type).filter(Boolean));for(let k of c){let W=k;for(let M of W.tools??[])l.add(M);for(let M of W.middleware??[]){let ie=M.type;ie&&!N.has(ie)&&(x.push(M),N.add(ie))}for(let M of W.subAgents??[])B.add(M)}return a.tools=Array.from(l),a.middleware=x,a.subAgents=Array.from(B),a},[b,h,A]);return nt?(0,n.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:(0,n.jsx)(ae,{size:"large",tip:r("chatWorkspace.workflowAutomation.loading")})}):he?(0,n.jsx)(U,{description:he}):u.length===0?(0,n.jsxs)("div",{style:{width:"100%",height:"100%"},children:[(0,n.jsx)(be,{open:ve,onCancel:()=>F(!1),onCreated:We}),(0,n.jsx)(U,{description:r("chatWorkspace.workflowAutomation.noDefinitions"),children:(0,n.jsx)($,{type:"primary",icon:(0,n.jsx)(le,{}),onClick:()=>F(!0),children:r("chatWorkspace.workflowAutomation.createWorkflow")})})]}):(0,n.jsxs)("div",{style:{width:"100%",height:"100%"},children:[(0,n.jsx)(be,{open:ve,onCancel:()=>F(!1),onCreated:We}),(0,n.jsx)(Q,{title:L?.name,open:rt,onCancel:()=>ke(!1),footer:null,width:"85vw",centered:!0,styles:{body:{maxHeight:"calc(85vh - 120px)",overflow:"auto",padding:"12px 24px 24px"}},children:L?.description?(0,n.jsx)(Ke,{content:L.description}):(0,n.jsx)(K,{type:"secondary",children:r("chatWorkspace.workflowAutomation.noDescription")})}),(0,n.jsx)(Ye,{children:(0,n.jsxs)("div",{style:{height:"100%",width:"100%",position:"relative",overflow:"hidden"},children:[v.length===0&&!d&&(0,n.jsx)(ze,{type:"warning",showIcon:!0,style:{position:"absolute",top:48,left:"clamp(16px, 32vw, 332px)",right:16,zIndex:40,margin:0},message:r("governance.learning.noProject"),description:r("governance.learning.noProjectDescription")}),(0,n.jsx)(vt,{workflows:u,selectedId:p,onSelect:dt,onCreate:()=>F(!0),onDelete:ct,dsl:b,agentNameMap:E,onSpecClick:()=>ke(!0),environmentConfig:gt}),!S&&p&&G&&(0,n.jsx)("div",{style:{position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",zIndex:20},children:(0,n.jsx)("div",{onClick:()=>we(!0),style:{writingMode:"vertical-rl",textOrientation:"mixed",padding:"16px 8px",background:"#6366f1",color:"#fff",borderRadius:"8px 0 0 8px",cursor:"pointer",fontSize:12,fontWeight:500,userSelect:"none"},children:r("chatWorkspace.workflowAutomation.copilot")})}),S&&p&&G&&!d&&(0,n.jsxs)("div",{style:{position:"absolute",right:16,top:48,bottom:12,zIndex:15,width:re,borderRadius:16,overflow:"hidden",boxShadow:"0 4px 24px rgba(0,0,0,0.12)"},children:[(0,n.jsx)("div",{onMouseDown:at,style:{position:"absolute",left:0,top:0,bottom:0,width:6,cursor:"ew-resize",zIndex:2,background:"transparent"}}),(0,n.jsx)(Ge,{defaultWorkspaceId:w??void 0,defaultProjectId:G??void 0,children:(0,n.jsx)(Ue,{workflowContext:pt,onClose:()=>we(!1),onToolCompleted:s=>{st.includes(s)&&lt()},initialMessageRequest:it,onInitialMessageSubmitted:s=>Ce(c=>c?.requestId===s?null:c)})},`${w??"default"}:${G??"default"}`)]})]})})]})},Zt=Ct;export{Ct as WorkflowAutomationView,Zt as default};
@@ -0,0 +1 @@
1
+ import"./embed-page-chunk-ESQ5V77Q.js";import{a}from"./embed-page-chunk-W4PSILFT.js";import"./embed-page-chunk-5IG7MZQF.js";import"./embed-page-chunk-R2K4OIQO.js";import"./embed-page-chunk-KGP2RGEC.js";import"./embed-page-chunk-AQ7P7MPQ.js";import"./embed-page-chunk-3IP6ESHH.js";import"./embed-page-chunk-FYBEULVS.js";import"./embed-page-chunk-LDFGGZC6.js";import"./embed-page-chunk-ZZCMWB6F.js";import"./embed-page-chunk-EAUQPBSN.js";import"./embed-page-chunk-GU7JLLYO.js";import"./embed-page-chunk-DIE6AVGX.js";import"./embed-page-chunk-6E33CLHM.js";import"./embed-page-chunk-5DAOHO64.js";import"./embed-page-chunk-UZW2LQZV.js";import"./embed-page-chunk-4SGVKO3D.js";import"./embed-page-chunk-ESAZNCCX.js";import"./embed-page-chunk-PEFXE5Y4.js";import"./embed-page-chunk-HQCMCYUS.js";import"./embed-page-chunk-NMZP7U6I.js";import"./embed-page-chunk-ORPDSJ5S.js";import"./embed-page-chunk-DHGHAGLL.js";import"./embed-page-chunk-UR5VOXA3.js";import"./embed-page-chunk-LL4XKLOG.js";import"./embed-page-chunk-UBWHZLJN.js";import"./embed-page-chunk-4PR66FMJ.js";import"./embed-page-chunk-Z26BSJ5Y.js";import"./embed-page-chunk-TPQGFG2C.js";import"./embed-page-chunk-HWNFA7PS.js";import"./embed-page-chunk-N252QSMT.js";import"./embed-page-chunk-SQ4GANYE.js";import"./embed-page-chunk-H7XTOBKB.js";import"./embed-page-chunk-IHNNPY3P.js";import"./embed-page-chunk-5OTSEOBG.js";import"./embed-page-chunk-5HA2MCVW.js";import"./embed-page-chunk-BBSIPZIJ.js";import"./embed-page-chunk-Q3AOMIJ7.js";import"./embed-page-chunk-JUZFORQA.js";import"./embed-page-chunk-43APLD2U.js";import"./embed-page-chunk-7IYYKQJE.js";import"./embed-page-chunk-ER4O2WLO.js";import"./embed-page-chunk-HNWETJWB.js";import"./embed-page-chunk-IPMWXKCK.js";import"./embed-page-chunk-LLFEIUVK.js";import"./embed-page-chunk-FTXNVWT5.js";import"./embed-page-chunk-TMUCZ7XO.js";import"./embed-page-chunk-BYGKM25Z.js";import"./embed-page-chunk-ZR7ZLGLV.js";import"./embed-page-chunk-M4ACA43K.js";import"./embed-page-chunk-PO2WVZC2.js";import"./embed-page-chunk-CGMYXHWK.js";import"./embed-page-chunk-FSDLV5QO.js";import"./embed-page-chunk-YBPVSBMU.js";import"./embed-page-chunk-GPISFLXW.js";import"./embed-page-chunk-KZWWYO7Z.js";import"./embed-page-chunk-3DDNDQND.js";import"./embed-page-chunk-UIZLGSJE.js";import"./embed-page-chunk-K7I5Z2RN.js";import"./embed-page-chunk-PXADN2PY.js";import"./embed-page-chunk-NNNI4647.js";import"./embed-page-chunk-2YRVPZIU.js";import"./embed-page-chunk-BRF3QA4U.js";import"./embed-page-chunk-Y2JWLZJF.js";import"./embed-page-chunk-NLMEH7HI.js";import"./embed-page-chunk-APIN6IE2.js";import"./embed-page-chunk-66JWK64A.js";import"./embed-page-chunk-EGTJFOFF.js";import"./embed-page-chunk-INGZ5SYE.js";import"./embed-page-chunk-UGCW7PZD.js";import"./embed-page-chunk-WQOZWRIS.js";import"./embed-page-chunk-BIXWOREM.js";import"./embed-page-chunk-CYZTUSN2.js";import"./embed-page-chunk-BO56ESC4.js";import"./embed-page-chunk-SAML73QO.js";import"./embed-page-chunk-FBXKGHOH.js";import"./embed-page-chunk-YNIEMXW5.js";import"./embed-page-chunk-734LUAPQ.js";import"./embed-page-chunk-YPK6G5D7.js";import"./embed-page-chunk-3QOIYWK3.js";import"./embed-page-chunk-7TY2R7O2.js";import"./embed-page-chunk-WCKHIRD5.js";import"./embed-page-chunk-TENLHB44.js";import"./embed-page-chunk-AAU4RSSU.js";import"./embed-page-chunk-J4VBM2JB.js";import"./embed-page-chunk-CIVBRTV6.js";import"./embed-page-chunk-5LZHM64O.js";import"./embed-page-chunk-AB3Q2HOO.js";import"./embed-page-chunk-AEGLPY52.js";import"./embed-page-chunk-JADTV5YD.js";import"./embed-page-chunk-OAUK7LXS.js";import"./embed-page-chunk-QNIB3Q7U.js";import"./embed-page-chunk-XWAJRAFC.js";import"./embed-page-chunk-II6ODJLE.js";import"./embed-page-chunk-Z2GE34ES.js";import"./embed-page-chunk-SMZUIXFD.js";import"./embed-page-chunk-4APB7U5B.js";import"./embed-page-chunk-N7NXBLSR.js";import"./embed-page-chunk-DXVMFTPC.js";import"./embed-page-chunk-O6DJHMEC.js";import"./embed-page-chunk-CZXPKAAI.js";import"./embed-page-chunk-RNOETEGH.js";import"./embed-page-chunk-KQNRWZKR.js";import"./embed-page-chunk-33GTW5LX.js";import"./embed-page-chunk-EY64QEHF.js";import"./embed-page-chunk-NIFSD4XH.js";import"./embed-page-chunk-6633JIZI.js";import"./embed-page-chunk-DYBQVRXS.js";import"./embed-page-chunk-GKA7H24K.js";import"./embed-page-chunk-CUEEKFI2.js";import"./embed-page-chunk-DYPHXOEP.js";import"./embed-page-chunk-Q6ZPKMOZ.js";import"./embed-page-chunk-TPGW6RUI.js";import"./embed-page-chunk-3J7LPOGR.js";import"./embed-page-chunk-447KJWVF.js";import"./embed-page-chunk-IIIA5HUO.js";import"./embed-page-chunk-ANZXYPYQ.js";import"./embed-page-chunk-WUYZIBLV.js";import"./embed-page-chunk-OZUIA6GJ.js";import"./embed-page-chunk-XNZ46IEF.js";import"./embed-page-chunk-4XVBSVFM.js";import"./embed-page-chunk-BDR2AV4C.js";import"./embed-page-chunk-VEYJHY36.js";import"./embed-page-chunk-KM5NL7BL.js";import"./embed-page-chunk-AO6KUNOD.js";import"./embed-page-chunk-XUZKZF3V.js";import"./embed-page-chunk-PJJPSDVD.js";import"./embed-page-chunk-ICJOJGQ6.js";import"./embed-page-chunk-TLWGSINF.js";import"./embed-page-chunk-R5I2GTYT.js";import"./embed-page-chunk-75BP54HX.js";import"./embed-page-chunk-IYK5VAB3.js";import"./embed-page-chunk-DZRJEWQO.js";import"./embed-page-chunk-2GGHQJ6Z.js";import"./embed-page-chunk-IIYOOZDE.js";import"./embed-page-chunk-XYCU2ZON.js";import"./embed-page-chunk-4LC4UT4R.js";import"./embed-page-chunk-HK4QMNL5.js";import"./embed-page-chunk-LMLHHN2B.js";import"./embed-page-chunk-L3RQ76LD.js";import"./embed-page-chunk-T6QXBMXO.js";import"./embed-page-chunk-TYA3PYZB.js";import"./embed-page-chunk-53QS4RRO.js";import"./embed-page-chunk-6VRE3UPC.js";import"./embed-page-chunk-A3QFY3IA.js";import"./embed-page-chunk-YHEFVON2.js";import"./embed-page-chunk-VP2J7NES.js";import"./embed-page-chunk-7I5CUKLE.js";import"./embed-page-chunk-ARRA262W.js";import"./embed-page-chunk-QVHTN5HT.js";import"./embed-page-chunk-KUTM5AGJ.js";import"./embed-page-chunk-GFOWXZE5.js";import"./embed-page-chunk-WYJNNBFP.js";import"./embed-page-chunk-7CW4T6JX.js";import"./embed-page-chunk-UJODN4PG.js";import"./embed-page-chunk-M7F46E23.js";import"./embed-page-chunk-CT5EIC3O.js";import"./embed-page-chunk-B537QK4H.js";import"./embed-page-chunk-AQLFD3FB.js";import"./embed-page-chunk-Q2YEQQJF.js";import"./embed-page-chunk-J7KNZGPV.js";import"./embed-page-chunk-6DD7CBYV.js";import"./embed-page-chunk-342GWWY6.js";import"./embed-page-chunk-4O7YNJLI.js";import"./embed-page-chunk-WNEY2A2R.js";import"./embed-page-chunk-TFSDCDJS.js";import"./embed-page-chunk-R54S6SKK.js";import"./embed-page-chunk-YEHTVTMO.js";import"./embed-page-chunk-RPK5SOLP.js";import"./embed-page-chunk-MEC3JUW7.js";import"./embed-page-chunk-5HNRARTT.js";import"./embed-page-chunk-OEC4EWNI.js";import"./embed-page-chunk-LPXAKW7Q.js";import"./embed-page-chunk-DEHJLLKN.js";import"./embed-page-chunk-6AF3OC6E.js";import"./embed-page-chunk-OJ7436DP.js";import"./embed-page-chunk-QQUV5KZD.js";import"./embed-page-chunk-VNK6MED4.js";import"./embed-page-chunk-NG7LKEPN.js";import"./embed-page-chunk-NMUKLFBY.js";import"./embed-page-chunk-NHOBB2JQ.js";import"./embed-page-chunk-ARM7QQNJ.js";import"./embed-page-chunk-6XNKALVC.js";import"./embed-page-chunk-GSWEZJ66.js";import"./embed-page-chunk-CTC4RKCL.js";import"./embed-page-chunk-M5HO3OG6.js";import"./embed-page-chunk-TIGSOALR.js";import"./embed-page-chunk-NNZA747K.js";import"./embed-page-chunk-G5KW2SOV.js";import"./embed-page-chunk-UCGT4CTV.js";import"./embed-page-chunk-QANF3D34.js";import"./embed-page-chunk-RN7JLKLZ.js";import"./embed-page-chunk-TWU6UJLL.js";import"./embed-page-chunk-FJ3EESJB.js";import"./embed-page-chunk-7BEP247X.js";import"./embed-page-chunk-ZNWEXQQ4.js";import"./embed-page-chunk-UZNSI2X3.js";import"./embed-page-chunk-XPDEOKHX.js";import"./embed-page-chunk-SL4X4KPS.js";import"./embed-page-chunk-2REOJOLY.js";import"./embed-page-chunk-ETY7U4DI.js";import"./embed-page-chunk-ACIRZYZQ.js";import"./embed-page-chunk-TUFYJMMA.js";import"./embed-page-chunk-LRB5IXLV.js";import"./embed-page-chunk-34RH2U7Z.js";import"./embed-page-chunk-LW3LUJEG.js";import"./embed-page-chunk-LH2NUQ2C.js";import"./embed-page-chunk-DQ4UEELI.js";import"./embed-page-chunk-CADGB443.js";import"./embed-page-chunk-NBNJGF7O.js";import"./embed-page-chunk-LJBLK3MD.js";import"./embed-page-chunk-XRRCORI5.js";import"./embed-page-chunk-I5KTSZJX.js";import"./embed-page-chunk-JOJ4VSO5.js";import"./embed-page-chunk-HVN56UNP.js";import"./embed-page-chunk-FMMAQPSK.js";import"./embed-page-chunk-IK2TPQVX.js";import"./embed-page-chunk-XZYJX7MY.js";import"./embed-page-chunk-TSZIWR3X.js";import"./embed-page-chunk-GAF3UVZE.js";import"./embed-page-chunk-6DYN2PCR.js";import"./embed-page-chunk-BXUFKFRH.js";import"./embed-page-chunk-E4OFRMJJ.js";import"./embed-page-chunk-A5CPK26D.js";import"./embed-page-chunk-LJJJJZT7.js";import"./embed-page-chunk-XO5WZF3D.js";import"./embed-page-chunk-77SKWVKH.js";import"./embed-page-chunk-72JNWX43.js";import"./embed-page-chunk-VULBATQG.js";import"./embed-page-chunk-X55NDWBH.js";import"./embed-page-chunk-WDS66MAN.js";import"./embed-page-chunk-IPI53MN3.js";import"./embed-page-chunk-5YNTYDFR.js";import"./embed-page-chunk-QHV7PE5D.js";import"./embed-page-chunk-WAANDEAQ.js";import"./embed-page-chunk-7AKQRM6L.js";import"./embed-page-chunk-ETP6AXEM.js";import"./embed-page-chunk-J5AHS4PO.js";import"./embed-page-chunk-XZ6CLWS2.js";import"./embed-page-chunk-JNXBKMN6.js";import"./embed-page-chunk-ARHDAWDT.js";import"./embed-page-chunk-3WBHNFJP.js";import"./embed-page-chunk-JYEMOI5G.js";import"./embed-page-chunk-ABIN3BPL.js";import"./embed-page-chunk-VUOXEXHU.js";import"./embed-page-chunk-H3HFE6RK.js";import"./embed-page-chunk-SMMEMIZS.js";import"./embed-page-chunk-YFWCKZW7.js";import"./embed-page-chunk-CN3CMET4.js";import"./embed-page-chunk-ESCA5JCS.js";import"./embed-page-chunk-EBXTVXZF.js";import"./embed-page-chunk-IGBRMGDS.js";import"./embed-page-chunk-ISY7S7N6.js";import"./embed-page-chunk-SYAPUMNM.js";import"./embed-page-chunk-4BRWUEYH.js";import"./embed-page-chunk-7Q3EEWYO.js";import"./embed-page-chunk-PLAF2Q2L.js";import"./embed-page-chunk-U32PAI3Y.js";import"./embed-page-chunk-3C32LJTO.js";import"./embed-page-chunk-6G24DMH3.js";import"./embed-page-chunk-LOLMAI3V.js";import"./embed-page-chunk-6NWENUQ7.js";import"./embed-page-chunk-Y4KTS6EE.js";import"./embed-page-chunk-6OKUWTCF.js";import"./embed-page-chunk-JYQTTU7F.js";import"./embed-page-chunk-LWERP7BS.js";import"./embed-page-chunk-FD2PRLMW.js";import"./embed-page-chunk-INUQ73SI.js";import"./embed-page-chunk-2XLPEIWW.js";import"./embed-page-chunk-H7HZ35QN.js";import"./embed-page-chunk-HQUXJKTG.js";import"./embed-page-chunk-4OTU4CRR.js";import"./embed-page-chunk-IFEQPNI2.js";import"./embed-page-chunk-FEOK4OPE.js";import"./embed-page-chunk-JEW2Y2ED.js";import"./embed-page-chunk-FVK265KY.js";import"./embed-page-chunk-FM5K6PQS.js";import"./embed-page-chunk-XAJFFWM3.js";import"./embed-page-chunk-R672RZXS.js";import"./embed-page-chunk-EY7WOIDX.js";import"./embed-page-chunk-G5HXFDFC.js";import"./embed-page-chunk-E7ECPW5G.js";import"./embed-page-chunk-BTZ6QKA5.js";import"./embed-page-chunk-PVL27S2O.js";import"./embed-page-chunk-PKNTJERD.js";import"./embed-page-chunk-3KBA5YLX.js";import"./embed-page-chunk-OPME5GF2.js";import"./embed-page-chunk-SWGBMELE.js";import"./embed-page-chunk-3D3RUB6Q.js";import"./embed-page-chunk-HVTV25TI.js";import"./embed-page-chunk-7ASML425.js";import"./embed-page-chunk-CDFDSWNI.js";import"./embed-page-chunk-ZT2EZUXI.js";import"./embed-page-chunk-QRPDJVB7.js";import"./embed-page-chunk-CUHPLIQJ.js";import"./embed-page-chunk-ORPUVSKY.js";import"./embed-page-chunk-2DKYYWQC.js";import"./embed-page-chunk-HJJHFV6J.js";import"./embed-page-chunk-4C2ZTZLC.js";import"./embed-page-chunk-QBTAJ2YI.js";export{a as refractor};