chatlab-cli 0.26.2 → 0.26.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/{chat-command-BVIG2LCO.mjs → chat-command-D37MMEJ7.mjs} +4 -4
  2. package/dist/{chunk-6AOEMUCM.mjs → chunk-742TAKEP.mjs} +2 -2
  3. package/dist/{chunk-3XFHIQIW.mjs → chunk-D5MWER7N.mjs} +2 -2
  4. package/dist/{chunk-JFSTXSX2.mjs → chunk-GNGZHBKM.mjs} +3 -3
  5. package/dist/{chunk-GTXX72AQ.mjs → chunk-K5SGXTVJ.mjs} +13 -13
  6. package/dist/{chunk-GBQQJJKK.mjs → chunk-QMXNJRTT.mjs} +372 -173
  7. package/dist/chunk-QMXNJRTT.mjs.map +1 -0
  8. package/dist/{chunk-SCE4YL3M.mjs → chunk-RMITK4IC.mjs} +2 -2
  9. package/dist/{chunk-QKQRV7RV.mjs → chunk-VCN64OD6.mjs} +2 -2
  10. package/dist/{chunk-TMZC3SNX.mjs → chunk-YPTJVTVJ.mjs} +1037 -49
  11. package/dist/chunk-YPTJVTVJ.mjs.map +1 -0
  12. package/dist/cli.mjs +3 -3
  13. package/dist/{http-NLFLQDI7.mjs → http-6F6TYWCI.mjs} +8 -8
  14. package/dist/{import-ILK6MGYR.mjs → import-VYPOMSSA.mjs} +4 -4
  15. package/dist/index.mjs +8 -8
  16. package/dist/{mcp-FOLR5XJL.mjs → mcp-AR7L5FA3.mjs} +4 -4
  17. package/dist/{src-OQN3VE73.mjs → src-6S7JPKHX.mjs} +6 -2
  18. package/dist/{stream-import-F5QI2HTO.mjs → stream-import-KZFC3XT2.mjs} +3 -3
  19. package/dist/{update-checker-JIBA7T4U.mjs → update-checker-3N7HQEP2.mjs} +36 -12
  20. package/dist/update-checker-3N7HQEP2.mjs.map +1 -0
  21. package/dist-web/assets/{DebugToolsPanel-CrqULdXp.css → DebugToolsPanel-DzZmSzIU.css} +1 -1
  22. package/dist-web/assets/DebugToolsPanel.vue_vue_type_script_setup_true_lang-BTdqmm0y.js +107 -0
  23. package/dist-web/assets/{MessageExportModal-ttP_JPqO.js → MessageExportModal-CF6yaor7.js} +1 -1
  24. package/dist-web/assets/{electron-BeJHY587.js → electron-DKVw61Ww.js} +1 -1
  25. package/dist-web/assets/{fetch-H4B1CK_T.js → fetch-BC8jyJ_U.js} +1 -1
  26. package/dist-web/assets/{fetch-4s20GRbb.js → fetch-BMdgfBVS.js} +1 -1
  27. package/dist-web/assets/fetch-BQlEQsqi.js +5 -0
  28. package/dist-web/assets/{fetch-DtXUkazy.js → fetch-Bh6HC-IR.js} +1 -1
  29. package/dist-web/assets/{fetch-DBJ7Xkjt.js → fetch-BvVfWR-P.js} +1 -1
  30. package/dist-web/assets/{fetch-DW8r_JmP.js → fetch-CPeSfqsU.js} +1 -1
  31. package/dist-web/assets/fetch-CUw-PUYP.js +1 -0
  32. package/dist-web/assets/{fetch-B7USXx9R.js → fetch-CpYSD089.js} +1 -1
  33. package/dist-web/assets/{fetch-rtQEc8Bu.js → fetch-D2jNBqs8.js} +1 -1
  34. package/dist-web/assets/{fetch-BETFYYe1.js → fetch-DqEMAea3.js} +1 -1
  35. package/dist-web/assets/{index-Dov-rTKE.js → index-BHQnAj6l.js} +1 -1
  36. package/dist-web/assets/{index-CsxrXMkt.js → index-BwzuCu5R.js} +2 -2
  37. package/dist-web/assets/index-CG746E15.js +64 -0
  38. package/dist-web/assets/index-CXoQ_U22.js +173 -0
  39. package/dist-web/assets/index-DqybGdJH.css +1 -0
  40. package/dist-web/assets/{index-CjnMyejM.css → index-HgIuP1Td.css} +1 -1
  41. package/dist-web/assets/{index-CYMTvtEI.js → index-Qh0XLt3R.js} +1 -1
  42. package/dist-web/assets/{index-Dtm2oajn.css → index-R82N2_0b.css} +1 -1
  43. package/dist-web/assets/index-wPAmuQZY.js +11 -0
  44. package/dist-web/assets/{web-1-WNRDnP.js → web-Bx2TiHDk.js} +1 -1
  45. package/dist-web/favicon.ico +0 -0
  46. package/dist-web/index.html +3 -3
  47. package/package.json +1 -1
  48. package/dist/chunk-GBQQJJKK.mjs.map +0 -1
  49. package/dist/chunk-TMZC3SNX.mjs.map +0 -1
  50. package/dist/update-checker-JIBA7T4U.mjs.map +0 -1
  51. package/dist-web/assets/DebugToolsPanel.vue_vue_type_script_setup_true_lang-D9mCNaYM.js +0 -182
  52. package/dist-web/assets/electron-Dbml-SPN.js +0 -1
  53. package/dist-web/assets/fetch-DcEBAz_3.js +0 -1
  54. package/dist-web/assets/fetch-DsCNr_M0.js +0 -1
  55. package/dist-web/assets/index-C2ts-hTr.js +0 -173
  56. package/dist-web/assets/index-DkownpUj.js +0 -163
  57. package/dist-web/assets/index-LCedyGl2.css +0 -1
  58. package/dist-web/assets/index-m7v4PP7r.js +0 -11
  59. /package/dist/{chat-command-BVIG2LCO.mjs.map → chat-command-D37MMEJ7.mjs.map} +0 -0
  60. /package/dist/{chunk-6AOEMUCM.mjs.map → chunk-742TAKEP.mjs.map} +0 -0
  61. /package/dist/{chunk-3XFHIQIW.mjs.map → chunk-D5MWER7N.mjs.map} +0 -0
  62. /package/dist/{chunk-JFSTXSX2.mjs.map → chunk-GNGZHBKM.mjs.map} +0 -0
  63. /package/dist/{chunk-GTXX72AQ.mjs.map → chunk-K5SGXTVJ.mjs.map} +0 -0
  64. /package/dist/{chunk-SCE4YL3M.mjs.map → chunk-RMITK4IC.mjs.map} +0 -0
  65. /package/dist/{chunk-QKQRV7RV.mjs.map → chunk-VCN64OD6.mjs.map} +0 -0
  66. /package/dist/{http-NLFLQDI7.mjs.map → http-6F6TYWCI.mjs.map} +0 -0
  67. /package/dist/{import-ILK6MGYR.mjs.map → import-VYPOMSSA.mjs.map} +0 -0
  68. /package/dist/{mcp-FOLR5XJL.mjs.map → mcp-AR7L5FA3.mjs.map} +0 -0
  69. /package/dist/{src-OQN3VE73.mjs.map → src-6S7JPKHX.mjs.map} +0 -0
  70. /package/dist/{stream-import-F5QI2HTO.mjs.map → stream-import-KZFC3XT2.mjs.map} +0 -0
@@ -0,0 +1,64 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/EChartWordcloud-B_YisOW5.js","assets/vendor-echarts-wordcloud-B1kQMklB.js","assets/vendor-echarts-CITQeskI.js","assets/vendor-zrender-DFl4U2Oe.js","assets/vendor-reka-ui-mMvma1EP.js","assets/MessageExportModal-CF6yaor7.js","assets/vendor-nuxt-ui-Zy8txNdC.js","assets/index-wPAmuQZY.js","assets/vendor-snapdom-XnBoh1gd.js","assets/index-HgIuP1Td.css"])))=>i.map(i=>d[i]);
2
+ import{_ as Ue}from"./vendor-snapdom-XnBoh1gd.js";import{k as Qe,g as he,b as re,l as Ze,a as Ie,j as Fe,c as Xe,e as Be,_ as et,n as tt,D as at,u as st,d as ot}from"./vendor-nuxt-ui-Zy8txNdC.js";import{b as S,d as pe,F as Se,p as H,G as o,P as k,Q,a5 as a,Z as W,a3 as X,T as u,O as He,J as nt,H as I,a0 as ve,h as $,w as O,u as e,K as T,L as f,U as D,R as G,bI as We,a9 as je,bJ as lt,au as Oe,bF as Ee,n as we,bD as Te,i as De}from"./vendor-reka-ui-mMvma1EP.js";import{p as it,u as ee,k as Me,T as le,j as K,q as rt,r as Pe,_ as Ve,t as ct,e as ut,b as dt,s as mt}from"./index-wPAmuQZY.js";import{_ as te,a as q,g as qe,b as vt,c as se,d as ne,e as ht,f as Ce,h as pt,i as Ne,j as gt,u as ft,k as yt,l as xt,m as bt,n as kt,o as _t,p as wt,q as $t,r as Ct,s as It,t as St,v as Tt,w as Mt,x as Vt,y as Rt,z as Dt,C as Nt,A as Lt,B as At,D as zt,E as Ut}from"./DebugToolsPanel.vue_vue_type_script_setup_true_lang-BTdqmm0y.js";import"./vendor-echarts-wordcloud-B1kQMklB.js";import{u as Ge,i as Ft,j as Ye,k as Bt,m as Ke,n as Je,o as Ht,p as Wt,q as jt}from"./vendor-echarts-CITQeskI.js";import{a as Le}from"./index-Qh0XLt3R.js";import"./vendor-zrender-DFl4U2Oe.js";function Ot(h,s={}){const{threshold:t=300,containerSelector:l=".overflow-y-auto",scrollLockDuration:m=800}=s,c=S(h[0]?.id||"");let v=!1;const p=S(null);let d=null;function y(){if(v)return;const i=[];h.forEach(r=>{const _=document.getElementById(r.id);if(_){const b=_.getBoundingClientRect();i.push({id:r.id,top:Math.round(b.top)})}});let n=0;for(let r=0;r<i.length;r++){if(i[r].top>t){n=Math.max(0,r-1);break}n=r}c.value=h[n]?.id||""}function g(i){const n=document.getElementById(i);n&&(c.value=i,v=!0,n.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout(()=>{v=!1,y()},m))}return pe(()=>{d=p.value?.closest(l)||null,d&&(d.addEventListener("scroll",y,{passive:!0}),y())}),Se(()=>{d&&d.removeEventListener("scroll",y)}),{contentRef:p,activeAnchor:c,scrollToAnchor:g,updateActiveAnchor:y}}const Et={class:"sticky top-24 space-y-6"},Pt={class:"border-l border-gray-200 dark:border-gray-800"},qt=["onClick"],Gt=H({__name:"PageAnchorsNav",props:{anchors:{},activeAnchor:{},width:{default:"w-44"},hideOnMobile:{type:Boolean,default:!0}},emits:["click"],setup(h,{emit:s}){const t=s;function l(m){t("click",m)}return(m,c)=>(o(),k("div",{class:Q([h.width,"shrink-0",h.hideOnMobile?"hidden lg:block":""])},[a("div",Et,[a("nav",null,[a("div",Pt,[(o(!0),k(W,null,X(h.anchors,v=>(o(),k("button",{key:v.id,class:Q(["-ml-px block border-l-2 py-1.5 pl-4 text-left text-sm transition-colors",[h.activeAnchor===v.id?"border-pink-500 font-medium text-pink-600 dark:text-pink-400":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"]]),onClick:p=>l(v.id)},u(v.label),11,qt))),128))])]),He(m.$slots,"default")])],2))}}),ie=H({__name:"TopNSelect",props:{modelValue:{default:10},modelModifiers:{}},emits:["update:modelValue"],setup(h){const s=nt(h,"modelValue"),t=[{label:"Top 5",value:5},{label:"Top 10",value:10},{label:"Top 20",value:20},{label:"Top 30",value:30},{label:"Top 50",value:50},{label:"Top 100",value:100}];return(l,m)=>{const c=Qe;return o(),I(c,{modelValue:s.value,"onUpdate:modelValue":m[0]||(m[0]=v=>s.value=v),items:t,"value-key":"value",class:"w-25"},null,8,["modelValue"])}}}),ce=H({__name:"ScrollableChart",props:{contentHeight:{},maxHeightVh:{default:60},paddingClass:{default:"px-3 py-2"}},setup(h){const s=h,t=$(()=>typeof window>"u"?500:Math.round(window.innerHeight*s.maxHeightVh/100)),l=$(()=>s.contentHeight>t.value),m=$(()=>({maxHeight:`${s.maxHeightVh}vh`,overflowY:l.value?"auto":"hidden"}));return(c,v)=>(o(),k("div",{class:Q(h.paddingClass),style:ve(m.value)},[He(c.$slots,"default")],6))}}),Yt=H({__name:"EChartGraph",props:{data:{},height:{default:400},layout:{default:"circular"},directed:{type:Boolean,default:!1}},setup(h,{expose:s}){Ge([Ft,Ye,Bt,Ke]);const t=h,l=$(()=>typeof t.height=="number"?`${t.height}px`:t.height),m=it(),c=S(null);let v=null;const p=["#ee4567","#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#9a60b4","#fc8452","#3ba272","#ea7ccc","#6e7074","#546570"],d=$(()=>{const x=new Set;return t.data.nodes.filter(w=>x.has(w.name)?!1:(x.add(w.name),!0))}),y=$(()=>{const x=new Map;return d.value.forEach((w,C)=>{x.set(w.name,p[C%p.length])}),x});function g(x,w){return w<=0?1:1+x/w*5}const i=$(()=>{const x=t.data.maxLinkValue||Math.max(...t.data.links.map(w=>w.value||1),1);return{tooltip:{trigger:"item",backgroundColor:m.value?"rgba(30, 30, 30, 0.9)":"rgba(255, 255, 255, 0.95)",borderColor:m.value?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)",textStyle:{color:m.value?"#e5e7eb":"#374151"},formatter:w=>w.dataType==="node"?`<b>${w.data.name}</b><br/>消息数: ${w.data.value||0}`:w.dataType==="edge"?`${w.data.source} → ${w.data.target}<br/>艾特次数: ${w.data.value||0}`:""},animationDuration:1e3,animationDurationUpdate:500,animationEasingUpdate:"quinticInOut",series:[{type:"graph",layout:t.layout,circular:t.layout==="circular"?{rotateLabel:!0}:void 0,force:t.layout==="force"?{repulsion:300,gravity:.1,edgeLength:[80,200],friction:.6}:void 0,roam:!0,scaleLimit:{min:.3,max:3},draggable:!0,label:{show:!0,position:"right",formatter:"{b}",color:m.value?"#e5e7eb":"#374151",fontSize:11,fontWeight:500},edgeSymbol:t.directed?["none","arrow"]:["none","none"],edgeSymbolSize:t.directed?[0,10]:[0,0],lineStyle:{curveness:.3,opacity:.5},emphasis:{focus:"adjacency",label:{show:!0,fontSize:13,fontWeight:600},lineStyle:{width:4,opacity:.9},itemStyle:{shadowBlur:15,shadowColor:"rgba(0, 0, 0, 0.3)"}},data:d.value.map(w=>{const C=y.value.get(w.name)||p[0];return{name:w.name,value:w.value,symbolSize:w.symbolSize||30,label:{show:t.layout==="circular"?!0:(w.symbolSize||30)>30},itemStyle:{color:C,borderColor:"#fff",borderWidth:2,shadowBlur:5,shadowColor:`${C}66`}}}),links:t.data.links.filter(w=>y.value.has(w.source)&&y.value.has(w.target)).map(w=>{const C=y.value.get(w.source)||p[0];return{source:w.source,target:w.target,value:w.value,lineStyle:{color:C,width:g(w.value||1,x)}}})}]}});function n(){c.value&&(v=Je(c.value,m.value?"dark":void 0,{renderer:"canvas"}),v.setOption({backgroundColor:"transparent",...i.value}))}function r(){v&&v.setOption({backgroundColor:"transparent",...i.value},{notMerge:!0})}function _(){v?.resize()}function b(){v&&v.dispatchAction({type:"restore"})}return s({resetView:b}),O([()=>t.data,()=>t.layout,()=>t.directed,m],()=>{v?r():n()},{deep:!0}),pe(()=>{n(),window.addEventListener("resize",_)}),Se(()=>{window.removeEventListener("resize",_),v?.dispose()}),(x,w)=>(o(),k("div",{ref_key:"chartRef",ref:c,style:ve({height:l.value,width:"100%"})},null,4))}}),Kt={class:"px-3 py-2"},ye=H({__name:"EChartRank",props:{members:{},title:{},description:{},topN:{default:10},unit:{default:"条"},height:{default:"auto"},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(h){const s=h,t=$(()=>s.members.slice(0,s.topN)),l=$(()=>{if(s.height!=="auto")return s.height;const p=t.value.length*36;return Math.max(p+30,180)}),m={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ee4567"},{offset:1,color:"#f7758c"}]};function c(p,d=8){return p.length<=d?p:p.slice(0,d)+"…"}const v=$(()=>{const p=[...t.value].reverse(),d=p.map(n=>c(n.name)),y=p.map(n=>n.value),g=Math.max(...y,1),i=p.map(n=>({value:n.value,itemStyle:{color:m,borderRadius:[0,4,4,0]}}));return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"},formatter:n=>{const r=n[0];if(!r)return"";const _=t.value.length-1-r.dataIndex,b=t.value[_];return`
3
+ <div style="padding: 4px 8px;">
4
+ <div style="font-weight: bold; margin-bottom: 4px;">${b.name}</div>
5
+ <div>${b.value} ${s.unit} (${b.percentage}%)</div>
6
+ </div>
7
+ `}},grid:{left:110,right:70,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:g*1.1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:d,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(n,r)=>{const b=t.value.length-1-r+1;return`${b===1?"🥇":b===2?"🥈":b===3?"🥉":`${b}.`} ${n}`}}},series:[{type:"bar",data:i,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:n=>{const r=t.value.length-1-n.dataIndex;return`${t.value[r].value} ${s.unit}`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(238, 69, 103, 0.3)"}}}]}});return(p,d)=>h.bare?(o(),I(e(ce),{key:0,"content-height":l.value,"max-height-vh":h.maxHeightVh},{default:T(()=>[f(te,{option:v.value,height:l.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),I(e(q),{key:1,title:h.title,description:h.description,scrollable:"","max-height-vh":h.maxHeightVh},{default:T(()=>[a("div",Kt,[f(te,{option:v.value,height:l.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),Jt={class:"divide-y divide-gray-100 dark:divide-gray-800"},Qt={key:0,class:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-linear-to-br from-pink-100 to-rose-100 text-sm font-medium text-pink-600 dark:from-pink-900/30 dark:to-rose-900/30 dark:text-pink-400"},Zt={class:"w-32 shrink-0"},Xt={class:"wrap-break-word font-medium text-gray-900 dark:text-white"},ea={class:"flex flex-1 items-center"},ta={class:"h-2 w-full overflow-hidden rounded-full bg-gray-100 dark:bg-gray-800"},aa={class:"flex shrink-0 items-baseline gap-2 whitespace-nowrap"},sa={class:"text-lg font-bold text-gray-900 dark:text-white"},oa={class:"text-sm text-gray-500"},Ae=H({__name:"RankList",props:{members:{},showAvatar:{type:Boolean,default:!1},rankLimit:{default:0},unit:{}},setup(h){const{t:s}=ee(),t=h,l=$(()=>t.unit||s("views.charts.rankList.unit")),m=$(()=>t.rankLimit>0?t.members.slice(0,t.rankLimit):t.members);function c(v){if(m.value.length===0)return 0;const p=m.value[0].value;return p===0?0:Math.round(m.value[v].value/p*100)}return(v,p)=>(o(),k("div",Jt,[(o(!0),k(W,null,X(m.value,(d,y)=>(o(),k("div",{key:d.id,class:"flex items-center gap-3 px-5 py-3 transition-colors hover:bg-gray-50 dark:hover:bg-gray-800/50"},[a("div",{class:Q(["flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm font-bold",e(qe)(y)])},u(y+1),3),h.showAvatar?(o(),k("div",Qt,u(d.name.slice(0,1)),1)):D("",!0),a("div",Zt,[a("p",Xt,u(d.name),1)]),a("div",ea,[a("div",ta,[a("div",{class:Q(["h-full rounded-full bg-linear-to-r transition-all",e(vt)(y)]),style:ve({width:`${c(y)}%`})},null,6)])]),a("div",aa,[a("span",sa,u(d.value),1),a("span",oa,u(l.value)+" ("+u(d.percentage)+"%)",1)])]))),128))]))}}),na={class:"flex items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-800"},la={class:"font-semibold text-gray-900 whitespace-nowrap dark:text-white"},ia={key:0,class:"mt-1 text-sm text-gray-500 dark:text-gray-400"},ra={class:"no-capture flex items-center gap-1"},ca={class:"flex w-full items-center justify-between border-b border-gray-200 px-6 py-4 dark:border-gray-700"},ua={class:"flex items-center gap-2"},da={class:"text-lg font-semibold text-gray-900 whitespace-nowrap dark:text-white"},ma={class:"text-sm text-gray-500"},va={class:"max-h-[60vh] p-4 overflow-y-auto"},ze=H({__name:"RankListPro",props:{members:{},title:{},description:{},topN:{default:10},unit:{}},setup(h){const{t:s}=ee(),t=h,l=S(!1),m=S(null),c=S(null),v=$(()=>t.members.slice(0,t.topN)),p=$(()=>t.members.length>t.topN);return(d,y)=>{const g=re,i=he;return o(),k("div",{ref_key:"cardRef",ref:m,class:"rounded-xl border border-gray-200 bg-white shadow-sm dark:border-gray-800 dark:bg-gray-900"},[a("div",na,[a("div",null,[a("h3",la,u(h.title),1),h.description?(o(),k("p",ia,u(h.description),1)):D("",!0)]),a("div",ra,[f(Le,{size:"xs",type:"element","target-element":m.value},null,8,["target-element"]),f(i,{open:l.value,"onUpdate:open":y[0]||(y[0]=n=>l.value=n),ui:{content:"md:w-full max-w-3xl"}},{content:T(()=>[a("div",{ref_key:"modalBodyRef",ref:c,class:"section-content flex flex-col"},[a("div",ca,[a("div",ua,[a("h3",da,u(h.title),1),a("span",ma," ("+u(e(s)("views.charts.rankListPro.memberCount",{count:h.members.length}))+") ",1)]),f(Le,{size:"xs",type:"element","target-element":c.value},null,8,["target-element"])]),a("div",va,[f(Ae,{members:h.members,unit:h.unit},null,8,["members","unit"])])],512)]),default:T(()=>[p.value?(o(),I(g,{key:0,icon:"i-heroicons-list-bullet",variant:"ghost"},{default:T(()=>[G(u(e(s)("views.charts.rankListPro.fullRanking")),1)]),_:1})):D("",!0)]),_:1},8,["open"])])]),f(Ae,{members:v.value,unit:h.unit},null,8,["members","unit"])],512)}}}),ha={class:"main-content mx-auto max-w-6xl py-6"},pa={class:"mb-4 flex items-center justify-end gap-4"},ga={class:"text-xs text-gray-500 dark:text-gray-400"},fa={key:0,class:"grid grid-cols-2 gap-6"},ya={class:"mb-3 text-center"},xa={class:"text-base font-semibold text-gray-900 dark:text-white"},ba={class:"flex flex-wrap gap-2"},ka=["title","onClick"],_a={class:"text-xs opacity-50"},wa={key:1,class:"grid grid-cols-2 gap-6"},$a={class:"mb-3 text-center"},Ca={class:"text-base font-semibold text-gray-900 dark:text-white"},Ia={class:"relative w-full",style:{"aspect-ratio":"4 / 3"}},Sa={class:"mt-4 text-center text-xs text-gray-500 dark:text-gray-400"},Ta=H({__name:"CatchphraseTab",props:{sessionId:{},timeFilter:{}},setup(h){const s=We(()=>Ue(()=>import("./EChartWordcloud-B_YisOW5.js"),__vite__mapDeps([0,1,2,3,4]))),{t}=ee(),l=Me(),m=h,c=S(null),v=S(!1),p=S("list"),d=S(30),y=$(()=>[{label:t("quotes.catchphrase.viewMode.list"),value:"list"},{label:t("quotes.catchphrase.viewMode.wordcloud"),value:"wordcloud"}]),g=[{label:"10",value:10},{label:"30",value:30},{label:"50",value:50},{label:"100",value:100}],i=$(()=>c.value&&c.value.members.length>0),n=$(()=>{if(!c.value)return[];const M=d.value;return console.log("[CatchphraseTab] displayMembers recompute, topN:",M,"type:",typeof M),c.value.members.map(L=>{const F=L.catchphrases.slice(0,M);return console.log("[CatchphraseTab]",L.name,"total:",L.catchphrases.length,"display:",F.length),{...L,catchphrases:F}})}),r=$(()=>n.value.map(M=>({name:M.name,data:{words:M.catchphrases.map(L=>({word:L.content,count:L.count}))}}))),_=[{bg:"bg-amber-50 dark:bg-amber-900/20",text:"text-amber-700 dark:text-amber-400",badge:"bg-amber-100 dark:bg-amber-800/40 text-amber-600 dark:text-amber-300"},{bg:"bg-slate-50 dark:bg-slate-800/40",text:"text-slate-600 dark:text-slate-300",badge:"bg-slate-100 dark:bg-slate-700/60 text-slate-500 dark:text-slate-400"},{bg:"bg-orange-50 dark:bg-orange-900/15",text:"text-orange-600 dark:text-orange-400",badge:"bg-orange-100 dark:bg-orange-800/30 text-orange-500 dark:text-orange-300"}];function b(M){return M<_.length?_[M]:{bg:"bg-gray-50 dark:bg-gray-800/30",text:"text-gray-600 dark:text-gray-400",badge:"bg-gray-100 dark:bg-gray-700/40 text-gray-500 dark:text-gray-400"}}function x(M,L=20){return M.length<=L?M:M.slice(0,L)+"..."}async function w(){if(m.sessionId){v.value=!0;try{c.value=await K().getCatchphraseAnalysis(m.sessionId,m.timeFilter),console.log("[CatchphraseTab] API result: members:",c.value?.members.length,"per-member catchphrases:",c.value?.members.map(M=>({name:M.name,count:M.catchphrases.length})))}catch(M){console.error("Failed to load catchphrase analysis:",M)}finally{v.value=!1}}}function C(M){l.openChatRecordDrawer({keywords:[M]})}return O(d,(M,L)=>{console.log("[CatchphraseTab] topN changed:",L,"->",M,"type:",typeof M)}),O(()=>[m.sessionId,m.timeFilter],()=>{w()},{immediate:!0,deep:!0}),(M,L)=>(o(),k("div",ha,[v.value?(o(),I(e(se),{key:0,text:e(t)("quotes.catchphrase.loading")},null,8,["text"])):i.value?(o(),k(W,{key:2},[a("div",pa,[a("span",ga,u(e(t)("quotes.catchphrase.topN")),1),f(e(le),{modelValue:d.value,"onUpdate:modelValue":L[0]||(L[0]=F=>d.value=F),size:"xs",items:g},null,8,["modelValue"]),L[2]||(L[2]=a("div",{class:"h-4 w-px bg-gray-200 dark:bg-gray-700"},null,-1)),f(e(le),{modelValue:p.value,"onUpdate:modelValue":L[1]||(L[1]=F=>p.value=F),size:"xs",items:y.value},null,8,["modelValue","items"])]),p.value==="list"?(o(),k("div",fa,[(o(!0),k(W,null,X(n.value,F=>(o(),k("div",{key:F.memberId},[a("div",ya,[a("span",xa,u(F.name),1)]),a("div",ba,[(o(!0),k(W,null,X(F.catchphrases,(A,z)=>(o(),k("div",{key:z,class:Q(["inline-flex cursor-pointer items-center gap-1.5 rounded-full px-3 py-1.5 transition-opacity hover:opacity-75",b(z).bg]),title:A.content,onClick:B=>C(A.content)},[z<3?(o(),k("span",{key:0,class:Q(["flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-[10px] font-bold",b(z).badge])},u(z+1),3)):D("",!0),a("span",{class:Q(["text-sm font-medium",b(z).text])},u(x(A.content)),3),a("span",_a,u(e(t)("quotes.catchphrase.times",{count:A.count})),1)],10,ka))),128))])]))),128))])):(o(),k("div",wa,[(o(!0),k(W,null,X(r.value,F=>(o(),k("div",{key:F.name},[a("div",$a,[a("span",Ca,u(F.name),1)]),a("div",Ia,[F.data.words.length===0?(o(),I(e(ne),{key:0,text:e(t)("quotes.catchphrase.empty.title"),class:"h-full"},null,8,["text"])):(o(),I(e(s),{key:1,data:F.data,height:"100%","max-words":d.value,"color-scheme":"default","size-scale":1,loading:v.value,onWordClick:C},null,8,["data","max-words","loading"]))])]))),128))])),a("p",Sa,u(e(t)("quotes.catchphrase.stats.clickHint")),1)],64)):(o(),I(e(ne),{key:1,text:e(t)("quotes.catchphrase.empty.title")},null,8,["text"]))]))}}),Ma={class:"main-content mx-auto max-w-3xl p-6"},Va={class:"flex items-center gap-3"},Ra={class:"shrink-0 text-lg font-bold text-pink-600"},Da={class:"flex flex-1 items-center gap-1 overflow-hidden text-sm"},Na={class:"shrink-0 font-medium text-gray-900 dark:text-white whitespace-nowrap"},La=["title"],Aa={class:"flex shrink-0 items-center gap-2 text-xs text-gray-500"},za=H({__name:"HotRepeatTab",props:{sessionId:{},timeFilter:{}},setup(h){const{t:s}=ee(),t=h,l=Me(),m=S(null),c=S(!1);async function v(){if(t.sessionId){c.value=!0;try{m.value=await K().getRepeatAnalysis(t.sessionId,t.timeFilter)}catch(y){console.error("Failed to load repeat analysis:",y)}finally{c.value=!1}}}function p(y,g=30){return y.length<=g?y:y.slice(0,g)+"..."}function d(y){l.openChatRecordDrawer({scrollToMessageId:y.firstMessageId,highlightKeywords:[y.content]})}return O(()=>[t.sessionId,t.timeFilter],()=>{v()},{immediate:!0,deep:!0}),(y,g)=>{const i=re;return o(),k("div",Ma,[c.value?(o(),I(e(se),{key:0,text:e(s)("quotes.hotRepeat.loading")},null,8,["text"])):m.value&&m.value.hotContents.length>0?(o(),I(e(ht),{key:1,items:m.value.hotContents,title:e(s)("quotes.hotRepeat.title"),description:e(s)("quotes.hotRepeat.description"),"top-n":50,"count-template":e(s)("quotes.hotRepeat.countTemplate")},{item:T(({item:n,index:r})=>[a("div",Va,[a("span",{class:Q(["flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",e(qe)(r)])},u(r+1),3),a("span",Ra,u(e(s)("quotes.hotRepeat.people",{count:n.maxChainLength})),1),a("div",Da,[a("span",Na,u(n.originatorName)+u(e(s)("quotes.hotRepeat.colon")),1),a("span",{class:"truncate text-gray-600 dark:text-gray-400",title:n.content},u(p(n.content)),9,La)]),a("div",Aa,[a("span",null,u(e(s)("quotes.hotRepeat.times",{count:n.count})),1),g[0]||(g[0]=a("span",{class:"text-gray-300 dark:text-gray-600"},"|",-1)),a("span",null,u(e(Ce)(n.lastTs)),1),f(i,{icon:"i-heroicons-chat-bubble-left-right",color:"neutral",variant:"ghost",size:"xs",title:e(s)("quotes.hotRepeat.viewChat"),onClick:je(_=>d(n),["stop"])},null,8,["title","onClick"])])])]),_:1},8,["items","title","description","count-template"])):(o(),I(e(q),{key:2,title:e(s)("quotes.hotRepeat.title")},{default:T(()=>[f(e(ne),{text:e(s)("quotes.hotRepeat.empty")},null,8,["text"])]),_:1},8,["title"]))])}}}),Ua={class:"main-content mx-auto max-w-[920px] space-y-6 p-6"},Fa={class:"grid grid-cols-1 gap-6 lg:grid-cols-2"},Ba={class:"p-5"},Ha={class:"p-5"},Wa=H({__name:"OverviewTab",props:{session:{},memberActivity:{},topMembers:{},bottomMembers:{},messageTypes:{},hourlyActivity:{},dailyActivity:{},timeRange:{},selectedYear:{},filteredMessageCount:{},filteredMemberCount:{},timeFilter:{}},setup(h){const{t:s}=ee(),t=h,{dailyChartData:l}=ft(()=>t.dailyActivity),m=$(()=>({labels:t.messageTypes.map(v=>yt(v.type,s)),values:t.messageTypes.map(v=>v.count)})),c=$(()=>{const v=[...t.memberActivity].sort((i,n)=>n.messageCount-i.messageCount),p=v.slice(0,10),d=v.slice(10).reduce((i,n)=>i+n.messageCount,0),y=p.map(i=>i.name),g=p.map(i=>i.messageCount);return d>0&&(y.push(s("analysis.overview.others")),g.push(d)),{labels:y,values:g}});return(v,p)=>(o(),k("div",Ua,[f(pt,{session:h.session,"daily-activity":h.dailyActivity,"message-types":h.messageTypes,"hourly-activity":h.hourlyActivity,"time-range":h.timeRange,"selected-year":h.selectedYear,"filtered-message-count":h.filteredMessageCount,"time-filter":h.timeFilter},null,8,["session","daily-activity","message-types","hourly-activity","time-range","selected-year","filtered-message-count","time-filter"]),a("div",Fa,[f(e(q),{title:e(s)("analysis.overview.messageTypeDistribution"),"show-divider":!1},{default:T(()=>[a("div",Ba,[f(e(Ne),{data:m.value,height:280},null,8,["data"])])]),_:1},8,["title"]),f(e(q),{title:e(s)("analysis.overview.memberDistribution"),"show-divider":!1},{default:T(()=>[a("div",Ha,[f(e(Ne),{data:c.value,height:280},null,8,["data"])])]),_:1},8,["title"])]),f(gt,{"daily-activity":h.dailyActivity,"daily-chart-data":e(l)},null,8,["daily-activity","daily-chart-data"])]))}}),ja={class:"flex items-center gap-3"},Oa={key:1,class:"py-8 text-center text-sm text-gray-400"},Ea=H({__name:"ActivityRank",props:{sessionId:{},memberActivity:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(h){const s=h,t=S(null),l=S(null),m=S(!1),c=S("activity"),v=S(s.globalTopN??10);O(()=>s.globalTopN,b=>{b!==void 0&&(v.value=b)});async function p(){if(s.sessionId){m.value=!0;try{const b=K(),[x,w]=await Promise.all([b.getDragonKingAnalysis(s.sessionId,s.timeFilter),b.getCheckInAnalysis(s.sessionId,s.timeFilter)]);t.value=x,l.value=w}catch(b){console.error("加载活跃数据失败:",b)}finally{m.value=!1}}}const d=$(()=>s.memberActivity.map(b=>({id:b.memberId.toString(),name:b.name,value:b.messageCount,percentage:b.percentage}))),y=$(()=>t.value?t.value.rank.map(b=>({id:b.memberId.toString(),name:b.name,value:b.count,percentage:b.percentage})):[]),g=$(()=>l.value?l.value.loyaltyRank.map(b=>({id:b.memberId.toString(),name:b.name,value:b.totalDays,percentage:b.percentage})):[]),i=$(()=>{switch(c.value){case"activity":return d.value;case"dragon":return y.value;case"loyalty":return g.value;default:return d.value}}),n=$(()=>{switch(c.value){case"activity":return"条";case"dragon":case"loyalty":return"天";default:return"条"}}),r=$(()=>{switch(c.value){case"activity":return"🏆 活跃榜 - 发言数量";case"dragon":return"🏆 活跃榜 - 龙王";case"loyalty":return"🏆 活跃榜 - 累计发言";default:return"🏆 活跃榜"}}),_=$(()=>{switch(c.value){case"activity":return"按消息发送数量排名";case"dragon":return`每天发言最多的人+1(共 ${t.value?.totalDays??0} 天)`;case"loyalty":return`累计发言天数排名(共 ${l.value?.totalDays??0} 天)`;default:return""}});return O(()=>[s.sessionId,s.timeFilter],()=>p(),{immediate:!0,deep:!0}),(b,x)=>(o(),I(e(q),{title:r.value,description:_.value},{headerRight:T(()=>[a("div",ja,[h.showTopNSelect?(o(),I(e(ie),{key:0,modelValue:v.value,"onUpdate:modelValue":x[0]||(x[0]=w=>v.value=w)},null,8,["modelValue"])):D("",!0),f(e(le),{modelValue:c.value,"onUpdate:modelValue":x[1]||(x[1]=w=>c.value=w),items:[{label:"发言数量",value:"activity"},{label:"龙王",value:"dragon"},{label:"累计发言",value:"loyalty"}],size:"sm"},null,8,["modelValue"])])]),default:T(()=>[m.value&&(c.value==="dragon"||c.value==="loyalty")?(o(),I(e(se),{key:0,text:"正在加载数据..."})):(o(),k(W,{key:1},[i.value.length>0?(o(),I(e(ye),{key:0,members:i.value,title:r.value,unit:n.value,"top-n":v.value,bare:""},null,8,["members","title","unit","top-n"])):(o(),k("div",Oa,"暂无数据"))],64))]),_:1},8,["title","description"]))}}),Pa={key:0},qa={key:0,class:"flex items-center justify-center gap-6 border-t border-gray-100 px-5 py-3 dark:border-gray-800"},Ga={class:"px-3 py-2"},Ya=H({__name:"EChartStreakRank",props:{items:{},title:{},description:{},topN:{default:10},mode:{default:"max"},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(h){const s=h,t=$(()=>s.mode==="current"?s.items.filter(g=>g.currentStreak>0).sort((g,i)=>i.currentStreak-g.currentStreak).slice(0,s.topN):s.items.slice(0,s.topN)),l=$(()=>{const g=t.value.length*36;return Math.max(g+30,180)}),m={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ee4567"},{offset:1,color:"#f7758c"}]},c={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#f97316"},{offset:1,color:"#fb923c"}]};function v(g,i=8){return g.length<=i?g:g.slice(0,i)+"…"}function p(g,i){return`${g} ~ ${i}`}function d(g){return s.mode==="current"?g.currentStreak:g.maxStreak}const y=$(()=>{const g=[...t.value].reverse(),i=g.map(b=>v(b.name)),n=g.map(b=>d(b)),r=Math.max(...n,1),_=g.map(b=>({value:d(b),itemStyle:{color:s.mode==="current"||b.currentStreak>0?c:m,borderRadius:[0,4,4,0]}}));return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"},formatter:b=>{const x=b[0];if(!x)return"";const w=t.value.length-1-x.dataIndex,C=t.value[w];if(s.mode==="current")return`
8
+ <div style="padding: 4px 8px;">
9
+ <div style="font-weight: bold; margin-bottom: 6px;">${C.name}</div>
10
+ <div style="color: #fb923c;">🔥 当前连续 <b>${C.currentStreak}</b> 天</div>
11
+ <div style="margin-top: 4px; font-size: 12px; color: #9ca3af;">最长记录: ${C.maxStreak} 天</div>
12
+ </div>
13
+ `;let M=`
14
+ <div style="padding: 4px 8px;">
15
+ <div style="font-weight: bold; margin-bottom: 6px;">${C.name}</div>
16
+ <div style="margin-bottom: 4px;">🔥 最长连续: <b>${C.maxStreak}</b> 天</div>
17
+ <div style="font-size: 12px; color: #9ca3af;">${p(C.maxStreakStart,C.maxStreakEnd)}</div>
18
+ `;return C.currentStreak>0&&(M+=`<div style="margin-top: 6px; color: #fb923c;">🔥 当前连续 ${C.currentStreak} 天</div>`),M+="</div>",M}},grid:{left:110,right:70,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:r*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:i,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(b,x)=>{const C=t.value.length-1-x+1;return`${C===1?"🥇":C===2?"🥈":C===3?"🥉":`${C}.`} ${b}`}}},series:[{type:"bar",data:_,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:b=>{const x=t.value.length-1-b.dataIndex,w=t.value[x],C=d(w),M=s.mode==="current"||w.currentStreak>0?" 🔥":"";return`${C} 天${M}`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(249, 115, 22, 0.3)"}}}]}});return(g,i)=>h.bare?(o(),k("div",Pa,[f(e(ce),{"content-height":l.value,"max-height-vh":h.maxHeightVh},{default:T(()=>[f(e(te),{option:y.value,height:l.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"]),h.mode==="max"?(o(),k("div",qa,[...i[0]||(i[0]=[lt('<div class="flex items-center gap-1.5"><div class="h-3 w-6 rounded bg-linear-to-r from-orange-500 to-orange-400"></div><span class="text-xs text-gray-500">当前连续中 🔥</span></div><div class="flex items-center gap-1.5"><div class="h-3 w-6 rounded bg-linear-to-r from-pink-500 to-pink-400"></div><span class="text-xs text-gray-500">已中断</span></div>',2)])])):D("",!0)])):(o(),I(e(q),{key:1,title:h.title,description:h.description,scrollable:"","max-height-vh":h.maxHeightVh},Oe({default:T(()=>[a("div",Ga,[f(e(te),{option:y.value,height:l.value},null,8,["option","height"])])]),_:2},[h.mode==="max"?{name:"footer",fn:T(()=>[i[1]||(i[1]=a("div",{class:"flex items-center justify-center gap-6 border-t border-gray-100 px-5 py-3 dark:border-gray-800"},[a("div",{class:"flex items-center gap-1.5"},[a("div",{class:"h-3 w-6 rounded bg-linear-to-r from-orange-500 to-orange-400"}),a("span",{class:"text-xs text-gray-500"},"当前连续中 🔥")]),a("div",{class:"flex items-center gap-1.5"},[a("div",{class:"h-3 w-6 rounded bg-linear-to-r from-pink-500 to-pink-400"}),a("span",{class:"text-xs text-gray-500"},"已中断")])],-1))]),key:"0"}:void 0]),1032,["title","description","max-height-vh"]))}}),Ka={class:"px-3 py-2"},Ja=H({__name:"EChartBattleRank",props:{battles:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(h){const s=h,t=$(()=>s.battles.slice(0,s.topN)),l=$(()=>{const p=t.value.length*36;return Math.max(p+30,180)}),m={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ee4567"},{offset:1,color:"#f7758c"}]};function c(p){return`${p.participantCount} 人参战`}const v=$(()=>{const p=[...t.value].reverse(),d=p.map(n=>c(n)),y=p.map(n=>n.totalImages),g=Math.max(...y,1),i=p.map(n=>({value:n.totalImages,itemStyle:{color:m,borderRadius:[0,4,4,0]}}));return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.85)",borderColor:"transparent",textStyle:{color:"#fff",fontSize:12},extraCssText:"max-width: 300px;",formatter:n=>{const r=n[0];if(!r)return"";const _=t.value.length-1-r.dataIndex,b=t.value[_],x=b.participants.slice(0,5).map(C=>`<span style="color: #d1d5db;">${C.name}</span> <b>${C.imageCount}</b>张`).join("、"),w=b.participants.length>5?`、+${b.participants.length-5}`:"";return`
19
+ <div style="padding: 6px 8px;">
20
+ <div style="font-weight: bold; margin-bottom: 8px; font-size: 13px;">
21
+ ⚔️ ${Ce(b.startTime)}
22
+ </div>
23
+ <div style="margin-bottom: 6px;">
24
+ <span style="color: #9ca3af;">参战人数:</span> <b>${b.participantCount}</b> 人
25
+ </div>
26
+ <div style="margin-bottom: 8px;">
27
+ <span style="color: #9ca3af;">总图片数:</span> <b style="color: #f472b6;">${b.totalImages}</b> 张
28
+ </div>
29
+ <div style="border-top: 1px solid #374151; padding-top: 6px; font-size: 11px;">
30
+ ${x}${w}
31
+ </div>
32
+ </div>
33
+ `}},grid:{left:95,right:125,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:g*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:d,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:11,color:"#4b5563",margin:12,formatter:(n,r)=>{const b=t.value.length-1-r+1;return`${b===1?"🥇":b===2?"🥈":b===3?"🥉":`${b}.`} ${n}`}}},series:[{type:"bar",data:i,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:n=>{const r=t.value.length-1-n.dataIndex,_=t.value[r],b=Ce(_.startTime);return`${_.totalImages} 张 (${b})`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(238, 69, 103, 0.3)"}}}]}});return(p,d)=>h.bare?(o(),I(e(ce),{key:0,"content-height":l.value,"max-height-vh":h.maxHeightVh},{default:T(()=>[f(e(te),{option:v.value,height:l.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),I(e(q),{key:1,title:h.title,description:h.description,scrollable:"","max-height-vh":h.maxHeightVh},{default:T(()=>[a("div",Ka,[f(e(te),{option:v.value,height:l.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),Qa={class:"px-3 py-2"},Za=H({__name:"EChartTimeRank",props:{items:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(h){const s=h,t=$(()=>s.items.slice(0,s.topN)),l=$(()=>{const d=t.value.length*36;return Math.max(d+30,180)}),m={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#f59e0b"},{offset:1,color:"#fbbf24"}]};function c(d,y=8){return d.length<=y?d:d.slice(0,y)+"…"}function v(d){return(d/1e3).toFixed(2)+"s"}const p=$(()=>{if(t.value.length===0)return{};const d=[...t.value].reverse(),y=d.map(n=>c(n.name)),g=t.value[0].avgTimeDiff,i=d.map(n=>({value:Math.round(g/n.avgTimeDiff*100),itemStyle:{color:m,borderRadius:[0,4,4,0]}}));return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"},formatter:n=>{const r=n[0];if(!r)return"";const _=t.value.length-1-r.dataIndex,b=t.value[_];return`
34
+ <div style="padding: 4px 8px;">
35
+ <div style="font-weight: bold; margin-bottom: 6px;">${b.name}</div>
36
+ <div style="margin-bottom: 4px;">⚡️ 平均反应时间: <b>${v(b.avgTimeDiff)}</b></div>
37
+ <div style="font-size: 12px; color: #9ca3af;">参与复读 ${b.count} 次</div>
38
+ </div>
39
+ `}},grid:{left:110,right:100,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:105,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:y,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(n,r)=>{const b=t.value.length-1-r+1;return`${b===1?"🥇":b===2?"🥈":b===3?"🥉":`${b}.`} ${n}`}}},series:[{type:"bar",data:i,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:n=>{const r=t.value.length-1-n.dataIndex,_=t.value[r];return`${v(_.avgTimeDiff)} · ${_.count}次`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(245, 158, 11, 0.3)"}}}]}});return(d,y)=>h.bare?(o(),I(e(ce),{key:0,"content-height":l.value,"max-height-vh":h.maxHeightVh},{default:T(()=>[f(e(te),{option:p.value,height:l.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),I(e(q),{key:1,title:h.title,description:h.description,scrollable:"","max-height-vh":h.maxHeightVh},{default:T(()=>[a("div",Qa,[f(e(te),{option:p.value,height:l.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),Xa={class:"flex items-center gap-3"},es={class:"px-3 py-2"},ts=H({__name:"EChartDivingRank",props:{items:{},showTopNSelect:{type:Boolean,default:!0},maxHeightVh:{default:60},globalTopN:{}},setup(h){const s=h,t=S("desc"),l=S(s.globalTopN??10);O(()=>s.globalTopN,n=>{n!==void 0&&(l.value=n)});const m=$(()=>[...s.items].sort((r,_)=>t.value==="desc"?_.daysSinceLastMessage-r.daysSinceLastMessage:r.daysSinceLastMessage-_.daysSinceLastMessage).slice(0,l.value)),c=$(()=>t.value==="desc"?"🤿 潜水榜 - 潜水最久":"🤿 潜水榜 - 最近冒泡"),v=$(()=>t.value==="desc"?"距离上次发言时间最久的成员":"最近发言过的成员"),p=$(()=>{const n=m.value.length*36;return Math.max(n+30,180)}),d={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#06b6d4"},{offset:1,color:"#22d3ee"}]};function y(n,r=8){return n.length<=r?n:n.slice(0,r)+"…"}function g(n){return n===0?"今天":n===1?"昨天":`${n} 天前`}const i=$(()=>{if(m.value.length===0)return{};const n=[...m.value].reverse(),r=n.map(x=>y(x.name)),_=Math.max(...m.value.map(x=>x.daysSinceLastMessage),1),b=n.map(x=>({value:x.daysSinceLastMessage,itemStyle:{color:d,borderRadius:[0,4,4,0]}}));return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"},formatter:x=>{const w=x[0];if(!w)return"";const C=m.value.length-1-w.dataIndex,M=m.value[C];return`
40
+ <div style="padding: 4px 8px;">
41
+ <div style="font-weight: bold; margin-bottom: 6px;">${M.name}</div>
42
+ <div style="margin-bottom: 4px;">🤿 ${g(M.daysSinceLastMessage)}</div>
43
+ <div style="font-size: 12px; color: #9ca3af;">最后发言: ${xt(M.lastMessageTs)}</div>
44
+ </div>
45
+ `}},grid:{left:110,right:100,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:_*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:r,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(x,w)=>{const M=m.value.length-1-w+1;return`${M===1?"🥇":M===2?"🥈":M===3?"🥉":`${M}.`} ${x}`}}},series:[{type:"bar",data:b,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:x=>{const w=m.value.length-1-x.dataIndex,C=m.value[w];return g(C.daysSinceLastMessage)},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(0, 0, 0, 0.2)"}}}]}});return(n,r)=>(o(),I(e(q),{title:c.value,description:v.value,scrollable:"","max-height-vh":h.maxHeightVh},{headerRight:T(()=>[a("div",Xa,[h.showTopNSelect?(o(),I(e(ie),{key:0,modelValue:l.value,"onUpdate:modelValue":r[0]||(r[0]=_=>l.value=_)},null,8,["modelValue"])):D("",!0),f(e(le),{modelValue:t.value,"onUpdate:modelValue":r[1]||(r[1]=_=>t.value=_),items:[{label:"潜水最久",value:"desc"},{label:"最近冒泡",value:"asc"}],size:"sm"},null,8,["modelValue"])])]),default:T(()=>[a("div",es,[f(e(te),{option:i.value,height:p.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),as={class:"px-3 py-2"},ss=H({__name:"EChartConsecutiveRank",props:{items:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(h){const s=h,t=$(()=>[...s.items].sort((d,y)=>y.maxConsecutiveDays-d.maxConsecutiveDays).slice(0,s.topN)),l=$(()=>{const d=t.value.length*36;return Math.max(d+30,180)}),m={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#f97316"},{offset:1,color:"#fb923c"}]},c={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ec4899"},{offset:1,color:"#f472b6"}]};function v(d,y=8){return d.length<=y?d:d.slice(0,y)+"…"}const p=$(()=>{if(t.value.length===0)return{};const d=[...t.value].reverse(),y=d.map(i=>v(i.name)),g=Math.max(...t.value.map(i=>i.maxConsecutiveDays),1);return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.85)",borderColor:"transparent",textStyle:{color:"#fff",fontSize:12},formatter:i=>{if(!i||i.length===0)return"";const n=i[0].dataIndex,r=t.value.length-1-n,_=t.value[r];let b=`
46
+ <div style="padding: 6px 8px;">
47
+ <div style="font-weight: bold; margin-bottom: 6px;">${_.name}</div>
48
+ <div>最长连续: <b style="color: #f472b6;">${_.maxConsecutiveDays}</b> 天</div>
49
+ `;return _.currentStreak>0&&(b+=`<div style="color: #f97316;">🔥 当前连续 ${_.currentStreak} 天</div>`),b+="</div>",b}},legend:{show:!1},grid:{left:110,right:75,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:g*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:y,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(i,n)=>{const _=t.value.length-1-n+1;return`${_===1?"🥇":_===2?"🥈":_===3?"🥉":`${_}.`} ${i}`}}},series:[{name:"当前连续",type:"bar",data:d.map(i=>({value:i.currentStreak>0?i.maxConsecutiveDays:0,itemStyle:{color:m,borderRadius:[0,4,4,0]}})),barWidth:18,barGap:"-100%",label:{show:!0,position:"right",distance:8,formatter:i=>{const n=t.value.length-1-i.dataIndex,r=t.value[n];return r.currentStreak>0?`${r.maxConsecutiveDays} 天`:""},fontSize:11,fontWeight:500,color:"#6b7280"}},{name:"已中断",type:"bar",data:d.map(i=>({value:i.currentStreak===0?i.maxConsecutiveDays:0,itemStyle:{color:c,borderRadius:[0,4,4,0]}})),barWidth:18,label:{show:!0,position:"right",distance:8,formatter:i=>{const n=t.value.length-1-i.dataIndex,r=t.value[n];return r.currentStreak===0?`${r.maxConsecutiveDays} 天`:""},fontSize:11,fontWeight:500,color:"#6b7280"}}]}});return(d,y)=>h.bare?(o(),I(e(ce),{key:0,"content-height":l.value,"max-height-vh":h.maxHeightVh},{default:T(()=>[f(e(te),{option:p.value,height:l.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),I(e(q),{key:1,title:h.title,description:h.description,scrollable:"","max-height-vh":h.maxHeightVh},{default:T(()=>[a("div",as,[f(e(te),{option:p.value,height:l.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),os={class:"px-3 py-2"},ns=H({__name:"EChartNightOwlRank",props:{items:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(h){const s=h,t=$(()=>s.items.slice(0,s.topN)),l=$(()=>{const p=t.value.length*36;return Math.max(p+50,200)}),m={h23:"#8b5cf6",h0:"#3b82f6",h1:"#06b6d4",h2:"#f59e0b",h3to4:"#ef4444"};function c(p,d=8){return p.length<=d?p:p.slice(0,d)+"…"}const v=$(()=>{if(t.value.length===0)return{};const p=[...t.value].reverse(),d=p.map(g=>c(g.name)),y=Math.max(...t.value.map(g=>g.totalNightMessages),1);return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.85)",borderColor:"transparent",textStyle:{color:"#fff",fontSize:12},formatter:g=>{if(!g||g.length===0)return"";const i=g[0].dataIndex,n=t.value.length-1-i,r=t.value[n],_=r.hourlyBreakdown;return`
50
+ <div style="padding: 6px 8px;">
51
+ <div style="font-weight: bold; margin-bottom: 6px;">${r.name}</div>
52
+ <div style="margin-bottom: 4px;">
53
+ 称号: <b style="color: #f472b6;">${r.title}</b>
54
+ </div>
55
+ <div style="margin-bottom: 6px;">总发言: <b>${r.totalNightMessages}</b> 条</div>
56
+ <div style="border-top: 1px solid #374151; padding-top: 6px;">
57
+ <div><span style="color: ${m.h23};">●</span> 23点: ${_.h23} 条</div>
58
+ <div><span style="color: ${m.h0};">●</span> 0点: ${_.h0} 条</div>
59
+ <div><span style="color: ${m.h1};">●</span> 1点: ${_.h1} 条</div>
60
+ <div><span style="color: ${m.h2};">●</span> 2点: ${_.h2} 条</div>
61
+ <div><span style="color: ${m.h3to4};">●</span> 3-4点: ${_.h3to4} 条</div>
62
+ </div>
63
+ </div>
64
+ `}},legend:{show:!0,bottom:0,itemWidth:12,itemHeight:12,textStyle:{color:"#6b7280",fontSize:10}},grid:{left:110,right:70,top:15,bottom:35,containLabel:!1},xAxis:{type:"value",max:y*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:d,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(g,i)=>{const r=t.value.length-1-i+1;return`${r===1?"🥇":r===2?"🥈":r===3?"🥉":`${r}.`} ${g}`}}},series:[{name:"23点",type:"bar",stack:"total",data:p.map(g=>g.hourlyBreakdown.h23),itemStyle:{color:m.h23},barWidth:18},{name:"0点",type:"bar",stack:"total",data:p.map(g=>g.hourlyBreakdown.h0),itemStyle:{color:m.h0},barWidth:18},{name:"1点",type:"bar",stack:"total",data:p.map(g=>g.hourlyBreakdown.h1),itemStyle:{color:m.h1},barWidth:18},{name:"2点",type:"bar",stack:"total",data:p.map(g=>g.hourlyBreakdown.h2),itemStyle:{color:m.h2},barWidth:18},{name:"3-4点",type:"bar",stack:"total",data:p.map(g=>g.hourlyBreakdown.h3to4),itemStyle:{color:m.h3to4,borderRadius:[0,4,4,0]},barWidth:18,label:{show:!0,position:"right",distance:8,formatter:g=>{const i=t.value.length-1-g.dataIndex;return`${t.value[i].totalNightMessages} 条`},fontSize:11,fontWeight:500,color:"#6b7280"}}]}});return(p,d)=>h.bare?(o(),I(e(ce),{key:0,"content-height":l.value,"max-height-vh":h.maxHeightVh},{default:T(()=>[f(e(te),{option:v.value,height:l.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),I(e(q),{key:1,title:h.title,description:h.description,scrollable:"","max-height-vh":h.maxHeightVh},{default:T(()=>[a("div",os,[f(e(te),{option:v.value,height:l.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),ls={id:"streak-rank",class:"scroll-mt-24"},is={class:"flex items-center gap-3"},rs=H({__name:"CheckInRank",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(h){const s=h,t=S(null),l=S(!1),m=S("max"),c=S(s.globalTopN??10);O(()=>s.globalTopN,g=>{g!==void 0&&(c.value=g)});const v=$(()=>m.value==="max"?"🔥 火花榜 - 最长连续":"🔥 火花榜 - 当前连续"),p=$(()=>m.value==="max"?"历史最长连续发言天数":"正在持续连续发言的成员"),d=$(()=>t.value?t.value.streakRank.some(g=>g.currentStreak>0):!1);async function y(){if(s.sessionId){l.value=!0;try{t.value=await K().getCheckInAnalysis(s.sessionId,s.timeFilter)}catch(g){console.error("加载打卡分析失败:",g)}finally{l.value=!1}}}return O(()=>[s.sessionId,s.timeFilter],()=>{y()},{immediate:!0,deep:!0}),(g,i)=>(o(),k("div",ls,[l.value?(o(),I(e(se),{key:0,text:"正在分析数据..."})):t.value&&t.value.streakRank.length>0?(o(),I(e(q),{key:1,title:v.value,description:p.value},{headerRight:T(()=>[a("div",is,[h.showTopNSelect?(o(),I(e(ie),{key:0,modelValue:c.value,"onUpdate:modelValue":i[0]||(i[0]=n=>c.value=n)},null,8,["modelValue"])):D("",!0),d.value?(o(),I(e(le),{key:1,modelValue:m.value,"onUpdate:modelValue":i[1]||(i[1]=n=>m.value=n),items:[{label:"最长连续",value:"max"},{label:"当前连续",value:"current"}],size:"sm"},null,8,["modelValue"])):D("",!0)])]),default:T(()=>[f(e(Ya),{items:t.value.streakRank,title:v.value,mode:m.value,"top-n":c.value,bare:""},null,8,["items","title","mode","top-n"])]),_:1},8,["title","description"])):(o(),I(e(q),{key:2,title:"🔥 火花榜"},{default:T(()=>[f(e(ne),{text:"暂无连续发言数据"})]),_:1}))]))}}),cs={class:"flex items-center gap-3"},us={key:1,class:"py-8 text-center text-sm text-gray-400"},ds={key:1,class:"py-8 text-center text-sm text-gray-400"},ms=H({__name:"MemeBattleRank",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(h){const s=h,t=S(null),l=S(!1),m=S("count"),c=S(s.globalTopN??10);O(()=>s.globalTopN,r=>{r!==void 0&&(c.value=r)});async function v(){if(s.sessionId){l.value=!0;try{t.value=await K().getMemeBattleAnalysis(s.sessionId,s.timeFilter)}catch(r){console.error("加载斗图分析失败:",r)}finally{l.value=!1}}}const p=$(()=>t.value?t.value.rankByCount.map(r=>({id:r.memberId.toString(),name:r.name,value:r.count,percentage:r.percentage})):[]),d=$(()=>t.value?t.value.rankByImageCount.map(r=>({id:r.memberId.toString(),name:r.name,value:r.count,percentage:r.percentage})):[]),y=$(()=>m.value==="count"?p.value:d.value),g=$(()=>m.value==="count"?"场":"张"),i=$(()=>{switch(m.value){case"battle":return"⚔️ 斗图榜 - 史诗级战役";case"count":return"⚔️ 斗图榜 - 按场次";case"image":return"⚔️ 斗图榜 - 按图量";default:return"⚔️ 斗图榜"}}),n=$(()=>{switch(m.value){case"battle":return"记录最激烈的斗图大战";case"count":return"参与斗图次数最多的人";case"image":return"在斗图中发送图片最多的人";default:return""}});return O(()=>[s.sessionId,s.timeFilter],()=>v(),{immediate:!0,deep:!0}),(r,_)=>l.value?(o(),I(e(se),{key:0,text:"正在统计斗图数据..."})):t.value?(o(),I(e(q),{key:1,title:i.value,description:n.value},{headerRight:T(()=>[a("div",cs,[h.showTopNSelect?(o(),I(e(ie),{key:0,modelValue:c.value,"onUpdate:modelValue":_[0]||(_[0]=b=>c.value=b)},null,8,["modelValue"])):D("",!0),f(e(le),{modelValue:m.value,"onUpdate:modelValue":_[1]||(_[1]=b=>m.value=b),items:[{label:"按场次",value:"count"},{label:"按图量",value:"image"},{label:"史诗级战役",value:"battle"}],size:"sm"},null,8,["modelValue"])])]),default:T(()=>[m.value==="battle"?(o(),k(W,{key:0},[t.value.topBattles.length>0?(o(),I(e(Ja),{key:0,battles:t.value.topBattles,title:"","top-n":c.value,bare:""},null,8,["battles","top-n"])):(o(),k("div",us,"暂无史诗级战役数据"))],64)):(o(),k(W,{key:1},[y.value.length>0?(o(),I(e(ye),{key:0,members:y.value,title:i.value,unit:g.value,"top-n":c.value,bare:""},null,8,["members","title","unit","top-n"])):(o(),k("div",ds,"暂无斗图数据"))],64))]),_:1},8,["title","description"])):D("",!0)}}),vs={class:"space-y-6"},hs={class:"flex items-center gap-3"},ps={class:"flex items-center gap-3"},gs={key:1,class:"px-3 py-2"},fs=H({__name:"RepeatSection",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(h){const s=h,t=S(null),l=S(!1),m=S("originator"),c=S("fastest"),v=S(s.globalTopN??10),p=S(s.globalTopN??10);O(()=>s.globalTopN,C=>{C!==void 0&&(v.value=C,p.value=C)});async function d(){if(s.sessionId){l.value=!0;try{t.value=await K().getRepeatAnalysis(s.sessionId,s.timeFilter)}catch(C){console.error("加载复读分析失败:",C)}finally{l.value=!1}}}const y=$(()=>t.value?t.value.originators.map(C=>({id:C.memberId.toString(),name:C.name,value:C.count,percentage:C.percentage})):[]),g=$(()=>t.value?t.value.initiators.map(C=>({id:C.memberId.toString(),name:C.name,value:C.count,percentage:C.percentage})):[]),i=$(()=>t.value?t.value.breakers.map(C=>({id:C.memberId.toString(),name:C.name,value:C.count,percentage:C.percentage})):[]),n=$(()=>{switch(m.value){case"originator":return y.value;case"initiator":return g.value;case"breaker":return i.value;default:return y.value}}),r=$(()=>{switch(m.value){case"originator":return"🔁 复读榜 - 被复读";case"initiator":return"🔁 复读榜 - 挑起";case"breaker":return"🔁 复读榜 - 打断";default:return"🔁 复读榜"}}),_=$(()=>{switch(m.value){case"originator":return"发出的消息被别人复读的次数";case"initiator":return"第二个发送相同消息、带起节奏的人";case"breaker":return"终结复读链的人";default:return""}}),b=$(()=>{if(!t.value)return{labels:[],values:[]};const C=t.value.chainLengthDistribution;return{labels:C.map(M=>`${M.length}人`),values:C.map(M=>M.count)}}),x=$(()=>c.value==="fastest"?"📊 复读统计 - 最快反应":"📊 复读统计 - 链长分布"),w=$(()=>{if(c.value==="fastest")return"平均复读反应时间(至少参与5次复读)";const C=t.value?.totalRepeatChains??0,M=t.value?.avgChainLength??0;return`共 ${C} 次复读,平均 ${M} 人参与`});return O(()=>[s.sessionId,s.timeFilter],()=>d(),{immediate:!0,deep:!0}),(C,M)=>(o(),k("div",vs,[l.value?(o(),I(e(se),{key:0,text:"正在分析复读数据..."})):t.value&&t.value.totalRepeatChains>0?(o(),k(W,{key:1},[f(e(q),{title:r.value,description:_.value},{headerRight:T(()=>[a("div",hs,[h.showTopNSelect?(o(),I(e(ie),{key:0,modelValue:v.value,"onUpdate:modelValue":M[0]||(M[0]=L=>v.value=L)},null,8,["modelValue"])):D("",!0),f(e(le),{modelValue:m.value,"onUpdate:modelValue":M[1]||(M[1]=L=>m.value=L),items:[{label:"被复读",value:"originator"},{label:"挑起",value:"initiator"},{label:"打断",value:"breaker"}],size:"sm"},null,8,["modelValue"])])]),default:T(()=>[n.value.length>0?(o(),I(e(ye),{key:0,members:n.value,title:r.value,unit:"次","top-n":v.value,bare:""},null,8,["members","title","top-n"])):(o(),I(e(ne),{key:1,text:"暂无数据"}))]),_:1},8,["title","description"]),f(e(q),{title:x.value,description:w.value},{headerRight:T(()=>[a("div",ps,[h.showTopNSelect&&c.value==="fastest"?(o(),I(e(ie),{key:0,modelValue:p.value,"onUpdate:modelValue":M[2]||(M[2]=L=>p.value=L)},null,8,["modelValue"])):D("",!0),f(e(le),{modelValue:c.value,"onUpdate:modelValue":M[3]||(M[3]=L=>c.value=L),items:[{label:"最快反应",value:"fastest"},{label:"链长分布",value:"distribution"}],size:"sm"},null,8,["modelValue"])])]),default:T(()=>[c.value==="fastest"?(o(),k(W,{key:0},[t.value.fastestRepeaters&&t.value.fastestRepeaters.length>0?(o(),I(e(Za),{key:0,items:t.value.fastestRepeaters,"top-n":p.value,title:"",bare:""},null,8,["items","top-n"])):(o(),I(e(ne),{key:1,text:"暂无最快复读数据"}))],64)):(o(),k("div",gs,[b.value.labels.length>0?(o(),I(e(bt),{key:0,data:b.value,height:200},null,8,["data"])):(o(),I(e(ne),{key:1,text:"暂无分布数据"}))]))]),_:1},8,["title","description"])],64)):(o(),I(e(q),{key:2,title:"🔁 复读榜"},{default:T(()=>[f(e(ne),{text:"该群组暂无复读记录"})]),_:1}))]))}}),ys=H({__name:"DivingRank",props:{sessionId:{},timeFilter:{},globalTopN:{}},setup(h){const s=h,t=S(null),l=S(!1);async function m(){if(s.sessionId){l.value=!0;try{t.value=await K().getDivingAnalysis(s.sessionId,s.timeFilter)}catch(c){console.error("加载潜水分析失败:",c)}finally{l.value=!1}}}return O(()=>[s.sessionId,s.timeFilter],()=>m(),{immediate:!0,deep:!0}),(c,v)=>l.value?(o(),I(e(se),{key:0,text:"正在统计潜水数据..."})):t.value&&t.value.rank.length>0?(o(),I(e(ts),{key:1,items:t.value.rank,"global-top-n":h.globalTopN},null,8,["items","global-top-n"])):D("",!0)}}),xs={class:"space-y-6"},bs={class:"flex items-center gap-3"},ks={key:1,class:"py-8 text-center text-sm text-gray-400"},_s={key:1,class:"py-8 text-center text-sm text-gray-400"},ws={class:"flex items-center gap-3"},$s={key:1,class:"py-8 text-center text-sm text-gray-400"},Cs=H({__name:"NightOwlRank",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(h){const s=h,t=S(null),l=S(!1),m=S("first"),c=S("distribution"),v=S(s.globalTopN??10),p=S(s.globalTopN??10);O(()=>s.globalTopN,x=>{x!==void 0&&(v.value=x,p.value=x)});async function d(){if(s.sessionId){l.value=!0;try{t.value=await K().getNightOwlAnalysis(s.sessionId,s.timeFilter)}catch(x){console.error("加载出勤分析失败:",x)}finally{l.value=!1}}}const y=$(()=>t.value?t.value.lastSpeakerRank.map(x=>({id:String(x.memberId),name:x.name,value:x.count,percentage:x.percentage})):[]),g=$(()=>t.value?t.value.firstSpeakerRank.map(x=>({id:String(x.memberId),name:x.name,value:x.count,percentage:x.percentage})):[]),i=$(()=>m.value==="last"?y.value:g.value),n=$(()=>m.value==="last"?"⏰ 出勤排行 - 最晚下班":"⏰ 出勤排行 - 最早上班"),r=$(()=>{const x=t.value?.totalDays??0;return m.value==="last"?`每天最后一个发言的人(共 ${x} 天)`:`每天第一个发言的人(共 ${x} 天)`}),_=$(()=>c.value==="distribution"?"🦉 修仙统计 - 发言分布":"🦉 修仙统计 - 连续记录"),b=$(()=>c.value==="distribution"?"深夜时段(23:00-05:00)各时段发言分布":"连续在深夜时段发言的天数");return O(()=>[s.sessionId,s.timeFilter],()=>d(),{immediate:!0,deep:!0}),(x,w)=>(o(),k("div",xs,[l.value?(o(),I(e(se),{key:0,text:"正在加载出勤分析..."})):t.value?(o(),k(W,{key:1},[f(e(q),{title:_.value,description:b.value},{headerRight:T(()=>[a("div",bs,[h.showTopNSelect?(o(),I(e(ie),{key:0,modelValue:v.value,"onUpdate:modelValue":w[0]||(w[0]=C=>v.value=C)},null,8,["modelValue"])):D("",!0),f(e(le),{modelValue:c.value,"onUpdate:modelValue":w[1]||(w[1]=C=>c.value=C),items:[{label:"发言分布",value:"distribution"},{label:"连续记录",value:"consecutive"}],size:"sm"},null,8,["modelValue"])])]),default:T(()=>[c.value==="distribution"?(o(),k(W,{key:0},[t.value.nightOwlRank.length>0?(o(),I(e(ns),{key:0,items:t.value.nightOwlRank,"top-n":v.value,title:"",bare:""},null,8,["items","top-n"])):(o(),k("div",ks,"暂无深夜发言数据"))],64)):(o(),k(W,{key:1},[t.value.consecutiveRecords.length>0?(o(),I(e(ss),{key:0,items:t.value.consecutiveRecords,"top-n":v.value,title:"",bare:""},null,8,["items","top-n"])):(o(),k("div",_s,"暂无连续记录"))],64))]),_:1},8,["title","description"]),f(e(q),{title:n.value,description:r.value},{headerRight:T(()=>[a("div",ws,[h.showTopNSelect?(o(),I(e(ie),{key:0,modelValue:p.value,"onUpdate:modelValue":w[2]||(w[2]=C=>p.value=C)},null,8,["modelValue"])):D("",!0),f(e(le),{modelValue:m.value,"onUpdate:modelValue":w[3]||(w[3]=C=>m.value=C),items:[{label:"最早上班",value:"first"},{label:"最晚下班",value:"last"}],size:"sm"},null,8,["modelValue"])])]),default:T(()=>[i.value.length>0?(o(),I(e(ye),{key:0,members:i.value,title:n.value,"top-n":p.value,unit:"次",bare:""},null,8,["members","title","top-n"])):(o(),k("div",$s,"暂无数据"))]),_:1},8,["title","description"])],64)):D("",!0)]))}}),Is={class:"main-content min-w-0 flex-1 px-8 mx-auto max-w-3xl space-y-6"},Ss={class:"mb-8 mt-4"},Ts={class:"text-5xl tracking-wider",style:{"font-weight":"800",background:"linear-gradient(to right, #f59e0b, #ec4899, #9333ea)","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}},Ms={id:"activity-rank",class:"scroll-mt-24"},Vs={id:"meme-battle",class:"scroll-mt-24"},Rs={id:"repeat",class:"scroll-mt-24"},Ds={id:"night-owl",class:"scroll-mt-24"},Ns={id:"diving",class:"scroll-mt-24"},Ls={class:"border-l border-gray-200 pl-4 dark:border-gray-800"},As=H({__name:"RankingView",props:{sessionId:{},timeFilter:{}},setup(h){const s=h,t=S([]),l=S([]);async function m(){if(!s.sessionId)return;const n=K(),[r,_]=await Promise.all([n.getMemberActivity(s.sessionId,s.timeFilter),n.getAvailableYears(s.sessionId)]);t.value=r,l.value=_}O(()=>[s.sessionId,s.timeFilter],()=>m(),{immediate:!0,deep:!0});const c=$(()=>{if(s.timeFilter?.startTs&&s.timeFilter?.endTs){const n=new Date(s.timeFilter.startTs*1e3).getFullYear(),r=new Date(s.timeFilter.endTs*1e3).getFullYear();return n===r?`${n} 赛季`:`${n}-${r} 赛季`}if(l.value.length>0){const n=[...l.value].sort((b,x)=>b-x),r=n[0],_=n[n.length-1];return r===_?`${r} 赛季`:`${r}-${_} 赛季`}return"全部赛季"}),v=$(()=>({startTs:s.timeFilter?.startTs,endTs:s.timeFilter?.endTs})),p=[{id:"activity-rank",label:"🏆 活跃榜"},{id:"streak-rank",label:"🔥 火花榜"},{id:"meme-battle",label:"⚔️ 斗图榜"},{id:"repeat",label:"🔁 复读榜"},{id:"night-owl",label:"⏰ 出勤榜"},{id:"diving",label:"🤿 潜水榜"}],{contentRef:d,activeAnchor:y,scrollToAnchor:g}=Ot(p,{threshold:350}),i=S(10);return(n,r)=>(o(),k("div",{ref_key:"contentRef",ref:d,class:"flex gap-6 p-6"},[a("div",Is,[a("div",Ss,[a("h1",Ts," 🏆 "+u(c.value),1),r[1]||(r[1]=a("p",{class:"mt-4 text-sm text-gray-500 dark:text-gray-400"},"各榜单前三名请找群主领取奖励 🎁",-1))]),a("div",Ms,[f(e(Ea),{"session-id":s.sessionId,"member-activity":t.value,"time-filter":v.value,"global-top-n":i.value},null,8,["session-id","member-activity","time-filter","global-top-n"])]),f(e(rs),{"session-id":s.sessionId,"time-filter":v.value,"global-top-n":i.value},null,8,["session-id","time-filter","global-top-n"]),a("div",Vs,[f(e(ms),{"session-id":s.sessionId,"time-filter":v.value,"global-top-n":i.value},null,8,["session-id","time-filter","global-top-n"])]),a("div",Rs,[f(e(fs),{"session-id":s.sessionId,"time-filter":v.value,"global-top-n":i.value},null,8,["session-id","time-filter","global-top-n"])]),a("div",Ds,[f(e(Cs),{"session-id":s.sessionId,"time-filter":v.value,"global-top-n":i.value},null,8,["session-id","time-filter","global-top-n"])]),a("div",Ns,[f(e(ys),{"session-id":s.sessionId,"time-filter":v.value,"global-top-n":i.value},null,8,["session-id","time-filter","global-top-n"])]),r[2]||(r[2]=a("div",{class:"h-48 no-capture"},null,-1))]),f(e(Gt),{anchors:p,"active-anchor":e(y),onClick:e(g)},{default:T(()=>[a("div",Ls,[r[3]||(r[3]=a("div",{class:"text-xs text-gray-400 mb-2"},"显示数量",-1)),f(e(ie),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=_=>i.value=_)},null,8,["modelValue"])])]),_:1},8,["active-anchor","onClick"])],512))}}),zs={class:"flex h-full flex-col"},Us={class:"flex items-center justify-end px-4 py-2"},Fs={class:"flex items-center gap-4"},Bs={class:"flex items-center gap-2"},Hs={class:"text-xs text-gray-400"},Ws={class:"flex items-center gap-2"},js={class:"text-xs text-gray-400"},Os={class:"flex-1 min-h-0 relative"},Es={key:0,class:"absolute inset-0 flex items-center justify-center"},Ps={key:0,class:"h-full"},qs={class:"absolute bottom-2 left-1/2 -translate-x-1/2 rounded-full bg-gray-100/80 px-3 py-1 text-xs text-gray-500 backdrop-blur-sm dark:bg-gray-800/80 dark:text-gray-400"},Gs={key:1,class:"flex h-full items-center justify-center text-gray-400"},Ys={class:"text-center"},Ks={class:"mt-2 text-sm"},Js=H({__name:"InteractionView",props:{sessionId:{},timeFilter:{}},setup(h){const s=h,{t}=ee(),l=S(!0),m=S({nodes:[],links:[],maxLinkValue:0}),c=S("circular"),v=S(!1),p=S(null);function d(){p.value?.resetView()}async function y(){if(s.sessionId){l.value=!0;try{const g=await K().getMentionGraph(s.sessionId,s.timeFilter);m.value={nodes:g.nodes,links:g.links,maxLinkValue:g.maxLinkValue}}catch(g){console.error("[chart-interaction] 加载互动关系图数据失败:",g)}finally{l.value=!1}}}return O(()=>[s.sessionId,s.timeFilter],()=>{y()},{immediate:!0,deep:!0}),(g,i)=>{const n=re,r=Ee("UButtonGroup"),_=Ze,b=Ie;return o(),k("div",zs,[a("div",Us,[a("div",Fs,[a("div",Bs,[a("span",Hs,u(e(t)("views.interaction.layout"))+":",1),f(r,{size:"xs"},{default:T(()=>[f(n,{color:c.value==="circular"?"primary":"neutral",variant:c.value==="circular"?"solid":"ghost",onClick:i[0]||(i[0]=x=>c.value="circular")},{default:T(()=>[G(u(e(t)("views.interaction.circular")),1)]),_:1},8,["color","variant"]),f(n,{color:c.value==="force"?"primary":"neutral",variant:c.value==="force"?"solid":"ghost",onClick:i[1]||(i[1]=x=>c.value="force")},{default:T(()=>[G(u(e(t)("views.interaction.force")),1)]),_:1},8,["color","variant"])]),_:1})]),a("div",Ws,[a("span",js,u(e(t)("views.interaction.directed"))+":",1),f(_,{modelValue:v.value,"onUpdate:modelValue":i[2]||(i[2]=x=>v.value=x),size:"xs"},null,8,["modelValue"])]),f(n,{size:"xs",color:"neutral",variant:"ghost",icon:"i-heroicons-arrow-path",onClick:d},{default:T(()=>[G(u(e(t)("views.interaction.reset")),1)]),_:1})])]),a("div",Os,[l.value?(o(),k("div",Es,[f(b,{name:"i-heroicons-arrow-path",class:"h-8 w-8 animate-spin text-pink-500"})])):(o(),k(W,{key:1},[m.value.nodes.length>0?(o(),k("div",Ps,[f(e(Yt),{ref_key:"graphRef",ref:p,data:m.value,layout:c.value,directed:v.value,height:"100%"},null,8,["data","layout","directed"]),a("div",qs,u(e(t)("views.interaction.graphHint",{nodes:m.value.nodes.length,links:m.value.links.length})),1)])):(o(),k("div",Gs,[a("div",Ys,[f(b,{name:"i-heroicons-user-group",class:"mx-auto h-10 w-10 text-gray-300 dark:text-gray-600"}),a("p",Ks,u(e(t)("views.interaction.noInteraction")),1)])]))],64))])])}}}),Qs={class:"main-content mx-auto max-w-[920px] space-y-6 p-6"},Zs={class:"grid grid-cols-1 gap-6 lg:grid-cols-2"},Xs={class:"grid grid-cols-1 gap-6 lg:grid-cols-2"},eo={class:"divide-y divide-gray-100 dark:divide-gray-800"},to={class:"flex flex-1 items-center gap-2"},ao=["onClick"],so={class:"flex items-center gap-1 text-pink-500"},oo={class:"text-xs"},no=["onClick"],lo={class:"shrink-0 text-right text-sm text-gray-500"},io={key:0,class:"text-red-500"},ro={key:1},co={class:"divide-y divide-gray-100 dark:divide-gray-800"},uo={class:"flex flex-1 items-center gap-2"},mo=["onClick"],vo={class:"flex items-center gap-1"},ho={class:"text-xs text-gray-400"},po={class:"text-xs text-gray-400"},go=["onClick"],fo={class:"shrink-0 text-right"},yo={class:"text-lg font-bold text-pink-600"},xo={class:"ml-1 text-sm text-gray-500"},bo={key:0,class:"p-5"},ko={class:"mb-4 text-lg font-semibold text-gray-900 dark:text-white"},_o={key:0,class:"mb-4"},wo={class:"mb-2 text-sm font-medium text-gray-700 dark:text-gray-300"},$o={class:"space-y-2"},Co={class:"text-sm font-medium text-gray-900 dark:text-white"},Io={class:"text-xs text-gray-500"},So={key:1},To={class:"mb-2 text-sm font-medium text-gray-700 dark:text-gray-300"},Mo={class:"space-y-2"},Vo={class:"text-sm font-medium text-gray-900 dark:text-white"},Ro={class:"text-xs text-gray-500"},Do={class:"mt-4 flex justify-end"},No=H({__name:"Relationships",props:{sessionId:{},timeFilter:{}},setup(h){const{t:s}=ee(),t=h,l=S(null),m=S(!1),c=S(null),v=S(!1);async function p(){if(t.sessionId){m.value=!0;try{l.value=await K().getMentionAnalysis(t.sessionId,t.timeFilter)}catch(i){console.error("加载 @ 互动分析失败:",i)}finally{m.value=!1}}}const d=$(()=>l.value?l.value.topMentioners.map(i=>({id:i.memberId.toString(),name:i.name,value:i.count,percentage:i.percentage})):[]),y=$(()=>l.value?l.value.topMentioned.map(i=>({id:i.memberId.toString(),name:i.name,value:i.count,percentage:i.percentage})):[]);function g(i){if(!l.value)return;const n=l.value.memberDetails.find(r=>r.memberId===i);n&&(c.value=n,v.value=!0)}return O(()=>[t.sessionId,t.timeFilter],()=>{p()},{immediate:!0,deep:!0}),(i,n)=>{const r=Fe,_=re,b=he;return o(),k("div",Qs,[m.value?(o(),I(e(se),{key:0,text:e(s)("members.relationships.loading")},null,8,["text"])):l.value&&l.value.totalMentions>0?(o(),k(W,{key:1},[a("div",Zs,[d.value.length>0?(o(),I(e(ze),{key:0,members:d.value,title:e(s)("members.relationships.topMentioners"),description:e(s)("members.relationships.totalMentions",{count:l.value.totalMentions}),unit:e(s)("members.relationships.times")},null,8,["members","title","description","unit"])):D("",!0),y.value.length>0?(o(),I(e(ze),{key:1,members:y.value,title:e(s)("members.relationships.topMentioned"),description:e(s)("members.relationships.popularMember"),unit:e(s)("members.relationships.times")},null,8,["members","title","description","unit"])):D("",!0)]),a("div",Xs,[l.value.oneWay.length>0?(o(),I(e(q),{key:0,class:"hidden",title:e(s)("members.relationships.oneWay.title"),description:e(s)("members.relationships.oneWay.description",{count:l.value.oneWay.length})},{default:T(()=>[a("div",eo,[(o(!0),k(W,null,X(l.value.oneWay.slice(0,10),(x,w)=>(o(),k("div",{key:w,class:"flex items-center gap-4 px-5 py-3 transition-colors hover:bg-gray-50 dark:hover:bg-gray-800/50"},[a("span",{class:Q(["flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",w===0?"bg-pink-100 text-pink-600 dark:bg-pink-900/30 dark:text-pink-400":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-500"])},u(w+1),3),a("div",to,[a("button",{class:"font-medium text-gray-900 hover:text-pink-600 dark:text-white dark:hover:text-pink-600",onClick:C=>g(x.fromMemberId)},u(x.fromName),9,ao),a("div",so,[n[2]||(n[2]=a("span",{class:"text-lg"},"→",-1)),a("span",oo,u(x.fromToCount)+"次",1)]),a("button",{class:"font-medium text-gray-900 hover:text-pink-600 dark:text-white dark:hover:text-pink-600",onClick:C=>g(x.toMemberId)},u(x.toName),9,no)]),a("div",lo,[x.toFromCount===0?(o(),k("span",io,u(e(s)("members.relationships.oneWay.neverRespond")),1)):(o(),k("span",ro,u(e(s)("members.relationships.oneWay.reverse",{count:x.toFromCount})),1))]),f(r,{color:"pink",variant:"soft",size:"xs"},{default:T(()=>[G(u(e(s)("members.relationships.oneWay.ratio",{value:Math.round(x.ratio*100)})),1)]),_:2},1024)]))),128))])]),_:1},8,["title","description"])):D("",!0),l.value.twoWay.length>0?(o(),I(e(q),{key:1,title:e(s)("members.relationships.twoWay.title"),description:e(s)("members.relationships.twoWay.description",{count:l.value.twoWay.length})},{default:T(()=>[a("div",co,[(o(!0),k(W,null,X(l.value.twoWay.slice(0,10),(x,w)=>(o(),k("div",{key:w,class:"flex items-center gap-4 px-5 py-3 transition-colors hover:bg-gray-50 dark:hover:bg-gray-800/50"},[a("span",{class:Q(["flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",w===0?"bg-linear-to-r from-pink-400 to-red-400 text-white":w===1?"bg-linear-to-r from-pink-300 to-red-300 text-white":w===2?"bg-linear-to-r from-pink-200 to-red-200 text-pink-700":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-500"])},u(w+1),3),a("div",uo,[a("button",{class:"font-medium text-gray-900 hover:text-pink-600 dark:text-white dark:hover:text-pink-600",onClick:C=>g(x.member1Id)},u(x.member1Name),9,mo),a("div",vo,[a("span",ho,u(x.member1To2),1),n[3]||(n[3]=a("span",{class:"text-lg text-pink-500"},"⇄",-1)),a("span",po,u(x.member2To1),1)]),a("button",{class:"font-medium text-gray-900 hover:text-pink-600 dark:text-white dark:hover:text-pink-600",onClick:C=>g(x.member2Id)},u(x.member2Name),9,go)]),a("div",fo,[a("span",yo,u(x.total),1),a("span",xo,u(e(s)("members.relationships.twoWay.interactions")),1)]),f(r,{color:x.balance>=.7?"green":x.balance>=.5?"blue":"gray",variant:"soft",size:"xs"},{default:T(()=>[G(u(e(s)("members.relationships.twoWay.balance",{value:Math.round(x.balance*100)})),1)]),_:2},1032,["color"])]))),128))])]),_:1},8,["title","description"])):D("",!0)])],64)):m.value?D("",!0):(o(),I(e(q),{key:2,title:e(s)("members.relationships.emptyTitle")},{default:T(()=>[f(e(ne),{text:e(s)("members.relationships.empty")},null,8,["text"])]),_:1},8,["title"])),f(b,{open:v.value,"onUpdate:open":n[1]||(n[1]=x=>v.value=x)},{content:T(()=>[c.value?(o(),k("div",bo,[a("h3",ko,u(e(s)("members.relationships.modal.title",{name:c.value.name})),1),c.value.topMentioned.length>0?(o(),k("div",_o,[a("h4",wo,u(e(s)("members.relationships.modal.topMentioned")),1),a("div",$o,[(o(!0),k(W,null,X(c.value.topMentioned,(x,w)=>(o(),k("div",{key:w,class:"flex items-center gap-3 rounded-lg bg-gray-50 px-3 py-2 dark:bg-gray-800"},[a("span",Co,u(x.toName),1),a("span",Io,u(e(s)("members.relationships.modal.timesCount",{count:x.count})),1)]))),128))])])):D("",!0),c.value.topMentioners.length>0?(o(),k("div",So,[a("h4",To,u(e(s)("members.relationships.modal.topMentioners")),1),a("div",Mo,[(o(!0),k(W,null,X(c.value.topMentioners,(x,w)=>(o(),k("div",{key:w,class:"flex items-center gap-3 rounded-lg bg-gray-50 px-3 py-2 dark:bg-gray-800"},[a("span",Vo,u(x.fromName),1),a("span",Ro,u(e(s)("members.relationships.modal.timesCount",{count:x.count})),1)]))),128))])])):D("",!0),a("div",Do,[f(_,{variant:"soft",onClick:n[0]||(n[0]=x=>v.value=!1)},{default:T(()=>[G(u(e(s)("members.relationships.modal.close")),1)]),_:1})])])):D("",!0)]),_:1},8,["open"])])}}}),Lo={class:"mx-auto max-w-[920px] p-4 h-full"},Ao={class:"flex h-full flex-col rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-sm overflow-hidden"},zo={class:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800/50"},Uo={class:"flex items-center gap-3"},Fo={class:"flex items-center gap-3"},Bo={class:"p-3 w-64"},Ho={class:"text-sm font-medium mb-3"},Wo={class:"space-y-3"},jo={class:"text-xs text-gray-500 mb-1 block"},Oo={class:"text-xs text-gray-400 mt-1"},Eo={class:"text-xs text-gray-500 mb-1 block"},Po={class:"text-xs text-gray-400 mt-1"},qo={class:"flex-1 min-h-0 overflow-hidden"},Go={key:0,class:"h-full flex items-center justify-center"},Yo={key:1,class:"h-full flex items-center justify-center"},Ko={class:"text-center text-gray-400"},Jo={key:2,class:"h-full"},Qo={key:3,class:"h-full flex overflow-hidden"},Zo={class:"w-64 border-r border-gray-200 dark:border-gray-700 flex flex-col overflow-hidden"},Xo={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},en={class:"text-sm font-medium flex items-center gap-2"},tn={class:"flex-1 overflow-y-auto"},an=["onClick"],sn={class:"flex items-center justify-between"},on={class:"text-sm truncate"},nn={class:"text-xs text-gray-400"},ln={class:"flex-1 overflow-hidden flex flex-col"},rn={key:0,class:"flex-1 flex items-center justify-center"},cn={class:"text-center text-gray-400"},un={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center gap-3"},dn={class:"w-10 h-10 rounded-full flex items-center justify-center text-white font-bold bg-primary-500"},mn={class:"font-medium"},vn={class:"text-xs text-gray-400"},hn={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},pn={class:"text-sm font-medium flex items-center gap-2"},gn={class:"flex-1 overflow-y-auto"},fn={key:0,class:"p-4 text-center text-gray-400"},yn={class:"flex items-center gap-3"},xn={class:"flex-1 min-w-0"},bn={class:"text-sm font-medium truncate"},kn={class:"flex items-center gap-3 mt-0.5 text-xs text-gray-400"},_n={class:"w-20 h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"},wn={key:4,class:"h-full flex flex-col overflow-hidden"},$n={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},Cn={class:"text-sm font-medium flex items-center gap-2"},In={class:"flex-1 overflow-y-auto"},Sn={class:"flex items-center gap-3"},Tn={class:"flex-1 min-w-0"},Mn={class:"flex items-center gap-2 text-sm"},Vn={class:"font-medium truncate"},Rn={class:"font-medium truncate"},Dn={class:"flex items-center gap-3 mt-1 text-xs text-gray-400"},Nn={class:"w-24 h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"},Ln={key:0,class:"px-4 py-2 border-t border-gray-200 dark:border-gray-700 text-xs text-gray-400 flex items-center gap-4 bg-gray-50 dark:bg-gray-800/50"},An=H({__name:"ClusterView",props:{sessionId:{},timeFilter:{}},setup(h){Ge([Ht,Ye,Wt,jt,Ke]);const s=h,{t}=ee(),l=rt(),m=$(()=>l.value==="dark"),c=S(!0),v=S(null),p=S("matrix"),d=S(null),y=S({lookAhead:3,decaySeconds:120,topEdges:150}),g=S(null);let i=null;async function n(){if(s.sessionId){c.value=!0;try{v.value=await K().getClusterGraph(s.sessionId,s.timeFilter,{lookAhead:y.value.lookAhead,decaySeconds:y.value.decaySeconds,topEdges:y.value.topEdges})}catch(A){console.error("[chart-cluster] 加载小团体关系数据失败:",A),v.value=null}finally{c.value=!1}}}const r=$(()=>{if(!v.value||v.value.nodes.length===0)return null;const{nodes:A,links:z,maxLinkValue:B}=v.value,P=[...A].sort((R,Y)=>Y.messageCount-R.messageCount).slice(0,20).map(R=>R.name),Z=new Map;for(const R of z)Z.set(`${R.source}-${R.target}`,R.value),Z.set(`${R.target}-${R.source}`,R.value);const J=[];for(let R=0;R<P.length;R++)for(let Y=0;Y<P.length;Y++)if(R===Y)J.push([R,Y,-1]);else{const ue=Z.get(`${P[R]}-${P[Y]}`)||0;J.push([R,Y,ue])}return{names:P,data:J,maxValue:B}});function _(){if(!r.value)return{graphic:{type:"text",style:{text:t("views.cluster.noData"),fill:"#999"}}};const{names:A,data:z,maxValue:B}=r.value;return{tooltip:{position:"top",formatter:ae=>{const[P,Z,J]=ae.data;return J<0?`${A[P]}`:J===0?`${A[P]} ↔ ${A[Z]}<br/>暂无关系数据`:`${A[P]} ↔ ${A[Z]}<br/>临近度: ${J.toFixed(2)}`}},grid:{left:120,right:40,top:40,bottom:120},xAxis:{type:"category",data:A,splitArea:{show:!0},axisLabel:{rotate:45,fontSize:10,color:m.value?"#ccc":"#333"}},yAxis:{type:"category",data:A,splitArea:{show:!0},axisLabel:{fontSize:10,color:m.value?"#ccc":"#333"}},visualMap:{min:0,max:B||1,calculable:!0,orient:"horizontal",left:"center",bottom:10,inRange:{color:m.value?["#1a1a2e","#16213e","#0f3460","#e94560"]:["#f7f7f7","#fce4ec","#f8bbd9","#ee4567"]},textStyle:{color:m.value?"#ccc":"#333"}},series:[{type:"heatmap",data:z.filter(ae=>ae[2]>=0),label:{show:!1},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}],backgroundColor:"transparent"}}const b=$(()=>v.value?[...v.value.nodes].sort((A,z)=>z.messageCount-A.messageCount):[]),x=$(()=>!v.value||d.value===null?null:v.value.nodes.find(A=>A.id===d.value)||null),w=$(()=>{if(!v.value||!x.value)return[];const A=x.value.name,z=[];for(const B of v.value.links)B.source===A?z.push({otherName:B.target,value:B.value,coOccurrenceCount:B.coOccurrenceCount}):B.target===A&&z.push({otherName:B.source,value:B.value,coOccurrenceCount:B.coOccurrenceCount});return z.sort((B,ae)=>ae.value-B.value),z}),C=$(()=>v.value?v.value.links.slice(0,50):[]);function M(){i&&p.value==="matrix"&&i.setOption(_(),{notMerge:!0})}function L(){g.value&&(i=Je(g.value,m.value?"dark":void 0),M())}function F(){i?.resize()}return O(p,async(A,z)=>{z==="matrix"&&i&&(i.dispose(),i=null),A==="matrix"&&(await we(),L())}),O([v,()=>m.value],()=>{p.value==="matrix"&&M()},{deep:!0}),O(c,async(A,z)=>{z&&!A&&p.value==="matrix"&&(i&&(i.dispose(),i=null),await we(),L())}),O(()=>[s.sessionId,s.timeFilter],()=>n(),{immediate:!0,deep:!0}),pe(()=>{window.addEventListener("resize",F),p.value==="matrix"&&we(()=>L())}),Se(()=>{window.removeEventListener("resize",F),i?.dispose(),i=null}),(A,z)=>{const B=re,ae=Ee("UButtonGroup"),P=Be,Z=Xe,J=Ie;return o(),k("div",Lo,[a("div",Ao,[a("div",zo,[a("div",Uo,[f(ae,{size:"xs"},{default:T(()=>[f(B,{color:p.value==="matrix"?"primary":"neutral",variant:p.value==="matrix"?"solid":"ghost",onClick:z[0]||(z[0]=R=>p.value="matrix")},{default:T(()=>[G(u(e(t)("views.cluster.matrixView")),1)]),_:1},8,["color","variant"]),f(B,{color:p.value==="member"?"primary":"neutral",variant:p.value==="member"?"solid":"ghost",onClick:z[1]||(z[1]=R=>p.value="member")},{default:T(()=>[G(u(e(t)("views.cluster.memberView")),1)]),_:1},8,["color","variant"]),f(B,{color:p.value==="circle"?"primary":"neutral",variant:p.value==="circle"?"solid":"ghost",onClick:z[2]||(z[2]=R=>p.value="circle")},{default:T(()=>[G(u(e(t)("views.cluster.rankingView")),1)]),_:1},8,["color","variant"])]),_:1})]),a("div",Fo,[f(Z,null,{content:T(()=>[a("div",Bo,[a("h4",Ho,u(e(t)("views.cluster.modelSettings")),1),a("div",Wo,[a("div",null,[a("label",jo,u(e(t)("views.cluster.lookAhead")),1),f(P,{modelValue:y.value.lookAhead,"onUpdate:modelValue":z[3]||(z[3]=R=>y.value.lookAhead=R),modelModifiers:{number:!0},type:"number",min:1,max:10,size:"xs",placeholder:"1-10"},null,8,["modelValue"]),a("p",Oo,u(e(t)("views.cluster.lookAheadDesc")),1)]),a("div",null,[a("label",Eo,u(e(t)("views.cluster.decaySeconds")),1),f(P,{modelValue:y.value.decaySeconds,"onUpdate:modelValue":z[4]||(z[4]=R=>y.value.decaySeconds=R),modelModifiers:{number:!0},type:"number",min:30,max:3600,size:"xs",placeholder:"30-3600"},null,8,["modelValue"]),a("p",Po,u(e(t)("views.cluster.decaySecondsDesc")),1)]),f(B,{size:"xs",color:"primary",class:"w-full mt-2",onClick:n},{default:T(()=>[G(u(e(t)("views.cluster.applySettings")),1)]),_:1})])])]),default:T(()=>[f(B,{variant:"ghost",size:"xs",icon:"i-heroicons-adjustments-horizontal"})]),_:1}),f(B,{variant:"ghost",size:"xs",icon:"i-heroicons-arrow-path",onClick:n})])]),a("div",qo,[c.value?(o(),k("div",Go,[f(J,{name:"i-heroicons-arrow-path",class:"w-6 h-6 animate-spin text-gray-400"})])):!v.value||v.value.nodes.length===0?(o(),k("div",Yo,[a("div",Ko,[f(J,{name:"i-heroicons-user-group",class:"w-12 h-12 mx-auto mb-2 opacity-50"}),a("p",null,u(e(t)("views.cluster.noData")),1)])])):p.value==="matrix"?(o(),k("div",Jo,[a("div",{ref_key:"chartRef",ref:g,class:"w-full h-full"},null,512)])):p.value==="member"?(o(),k("div",Qo,[a("div",Zo,[a("div",Xo,[a("h3",en,[f(J,{name:"i-heroicons-users",class:"w-4 h-4"}),G(" "+u(e(t)("views.cluster.selectMember")),1)])]),a("div",tn,[(o(!0),k(W,null,X(b.value,R=>(o(),k("div",{key:R.id,class:Q(["px-4 py-2 cursor-pointer border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50",{"bg-primary-50 dark:bg-primary-900/30":d.value===R.id}]),onClick:Y=>d.value=R.id},[a("div",sn,[a("span",on,u(R.name),1),a("span",nn,u(R.messageCount),1)])],10,an))),128))])]),a("div",ln,[x.value?(o(),k(W,{key:1},[a("div",un,[a("div",dn,u(x.value.name.charAt(0)),1),a("div",null,[a("div",mn,u(x.value.name),1),a("div",vn,u(e(t)("views.cluster.msgCount"))+": "+u(x.value.messageCount)+" | "+u(e(t)("views.cluster.relationCount"))+": "+u(w.value.length),1)])]),a("div",hn,[a("h3",pn,[f(J,{name:"i-heroicons-heart",class:"w-4 h-4 text-pink-500"}),G(" "+u(e(t)("views.cluster.relationsByIntimacy")),1)])]),a("div",gn,[w.value.length===0?(o(),k("div",fn,u(e(t)("views.cluster.noRelations")),1)):D("",!0),(o(!0),k(W,null,X(w.value,(R,Y)=>(o(),k("div",{key:R.otherName,class:"px-4 py-3 border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50"},[a("div",yn,[a("span",{class:Q(["w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold",Y<3?"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-400"])},u(Y+1),3),a("div",xn,[a("div",bn,u(R.otherName),1),a("div",kn,[a("span",null,u(e(t)("views.cluster.intimacy"))+": "+u((R.value*100).toFixed(0))+"%",1),a("span",null,u(e(t)("views.cluster.coOccurrence"))+": "+u(R.coOccurrenceCount)+u(e(t)("views.cluster.times")),1)])]),a("div",_n,[a("div",{class:"h-full bg-linear-to-r from-pink-400 to-pink-600",style:ve({width:`${w.value[0]?.value?R.value/w.value[0].value*100:0}%`})},null,4)])])]))),128))])],64)):(o(),k("div",rn,[a("div",cn,[f(J,{name:"i-heroicons-cursor-arrow-rays",class:"w-12 h-12 mx-auto mb-2 opacity-50"}),a("p",null,u(e(t)("views.cluster.selectMemberHint")),1)])]))])])):(o(),k("div",wn,[a("div",$n,[a("h3",Cn,[f(J,{name:"i-heroicons-trophy",class:"w-4 h-4 text-yellow-500"}),G(" "+u(e(t)("views.cluster.interactionRanking")),1)])]),a("div",In,[(o(!0),k(W,null,X(C.value,(R,Y)=>(o(),k("div",{key:Y,class:"px-4 py-3 border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50"},[a("div",Sn,[a("span",{class:Q(["w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold",Y<3?"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-400"])},u(Y+1),3),a("div",Tn,[a("div",Mn,[a("span",Vn,u(R.source),1),z[5]||(z[5]=a("span",{class:"text-gray-400"},"↔",-1)),a("span",Rn,u(R.target),1)]),a("div",Dn,[a("span",null,u(e(t)("views.cluster.score"))+": "+u(R.value.toFixed(2)),1),a("span",null,u(e(t)("views.cluster.coOccurrence"))+": "+u(R.coOccurrenceCount)+u(e(t)("views.cluster.times")),1)])]),a("div",Nn,[a("div",{class:"h-full bg-linear-to-r from-yellow-400 to-orange-500",style:ve({width:`${C.value[0]?.value?R.value/C.value[0].value*100:0}%`})},null,4)])])]))),128))])]))]),v.value?(o(),k("div",Ln,[a("span",null,u(e(t)("views.cluster.totalMembers"))+": "+u(v.value.stats.totalMembers),1),a("span",null,u(e(t)("views.cluster.totalMessages"))+": "+u(v.value.stats.totalMessages.toLocaleString()),1),a("span",null,u(e(t)("views.cluster.involvedMembers"))+": "+u(v.value.stats.involvedMembers),1),a("span",null,u(e(t)("views.cluster.edgeCount"))+": "+u(v.value.stats.edgeCount),1)])):D("",!0)])])}}}),zn={class:"flex h-full flex-col"},Un={class:"min-h-0 flex-1 overflow-y-auto"},Fn=H({__name:"GroupRelationships",props:{sessionId:{},timeFilter:{}},setup(h){const{t:s}=ee(),t=h,l=S("mention-graph"),m=$(()=>[{id:"mention-graph",label:s("analysis.subTabs.groupRelationships.mentionGraph"),icon:"i-heroicons-arrows-right-left"},{id:"mention-ranking",label:s("analysis.subTabs.groupRelationships.mentionRanking"),icon:"i-heroicons-heart"},{id:"proximity",label:s("analysis.subTabs.groupRelationships.proximity"),icon:"i-heroicons-user-group"}]);return(c,v)=>(o(),k("div",zn,[f(e(Pe),{modelValue:l.value,"onUpdate:modelValue":v[0]||(v[0]=p=>l.value=p),items:m.value,"persist-key":"groupRelationshipsTab",size:"sm"},null,8,["modelValue","items"]),a("div",Un,[f(Te,{name:"fade",mode:"out-in"},{default:T(()=>[l.value==="mention-graph"?(o(),I(Js,{key:0,"session-id":t.sessionId,"time-filter":t.timeFilter},null,8,["session-id","time-filter"])):l.value==="mention-ranking"?(o(),I(No,{key:1,"session-id":t.sessionId,"time-filter":t.timeFilter},null,8,["session-id","time-filter"])):l.value==="proximity"?(o(),I(An,{key:2,"session-id":t.sessionId,"time-filter":t.timeFilter},null,8,["session-id","time-filter"])):D("",!0)]),_:1})])]))}}),Bn=Ve(Fn,[["__scopeId","data-v-531340f2"]]),Hn={class:"flex h-full flex-col"},Wn={class:"flex-1 min-h-0 overflow-y-auto"},jn=H({__name:"ViewTab",props:{sessionId:{},sessionName:{},timeFilter:{}},setup(h){const{t:s,locale:t}=ee(),l=h,m=$(()=>{const d=[{id:"type-analysis",label:s("analysis.subTabs.view.typeAnalysis"),icon:"i-heroicons-chart-pie"},{id:"time-analysis",label:s("analysis.subTabs.view.timeAnalysis"),icon:"i-heroicons-clock"},{id:"topic",label:s("analysis.subTabs.view.topic"),icon:"i-heroicons-cloud"},{id:"group-relationships",label:s("analysis.subTabs.view.groupRelationships"),icon:"i-heroicons-heart"},{id:"hot-repeat",label:s("analysis.subTabs.quotes.hotRepeat"),icon:"i-heroicons-fire"},{id:"catchphrase",label:s("analysis.subTabs.quotes.catchphrase"),icon:"i-heroicons-chat-bubble-bottom-center-text"}];return ct("groupRanking",t.value)&&d.splice(2,0,{id:"ranking",label:s("analysis.subTabs.view.ranking"),icon:"i-heroicons-trophy"}),d}),c=S("type-analysis"),v=S(null),p=$(()=>({...l.timeFilter,memberId:v.value}));return(d,y)=>(o(),k("div",Hn,[f(e(Pe),{modelValue:c.value,"onUpdate:modelValue":y[1]||(y[1]=g=>c.value=g),items:m.value,"persist-key":"groupViewTab"},{right:T(()=>[c.value!=="topic"?(o(),I(kt,{key:0,modelValue:v.value,"onUpdate:modelValue":y[0]||(y[0]=g=>v.value=g),"session-id":l.sessionId},null,8,["modelValue","session-id"])):D("",!0)]),_:1},8,["modelValue","items"]),a("div",Wn,[f(Te,{name:"fade",mode:"out-in"},{default:T(()=>[c.value==="type-analysis"?(o(),I(_t,{key:0,"session-id":l.sessionId,"session-name":l.sessionName,"time-filter":p.value},null,8,["session-id","session-name","time-filter"])):c.value==="time-analysis"?(o(),I(wt,{key:1,"session-id":l.sessionId,"session-name":l.sessionName,"time-filter":p.value},null,8,["session-id","session-name","time-filter"])):c.value==="topic"?(o(),I(e($t),{key:2,"session-id":l.sessionId,"time-filter":l.timeFilter},null,8,["session-id","time-filter"])):c.value==="group-relationships"?(o(),I(Bn,{key:3,"session-id":l.sessionId,"time-filter":p.value},null,8,["session-id","time-filter"])):c.value==="ranking"?(o(),I(As,{key:4,"session-id":l.sessionId,"time-filter":p.value},null,8,["session-id","time-filter"])):c.value==="hot-repeat"?(o(),I(e(za),{key:5,"session-id":l.sessionId,"time-filter":l.timeFilter},null,8,["session-id","time-filter"])):c.value==="catchphrase"?(o(),I(e(Ta),{key:6,"session-id":l.sessionId,"time-filter":l.timeFilter},null,8,["session-id","time-filter"])):D("",!0)]),_:1})])]))}}),On=Ve(jn,[["__scopeId","data-v-ab94305e"]]),En={key:0,class:"mb-6"},Pn={class:"flex items-center gap-3"},qn={class:"text-xl font-bold text-gray-900 dark:text-white"},Gn={class:"text-sm text-gray-500 dark:text-gray-400"},Yn={class:"mb-4 flex flex-wrap items-center justify-between gap-3"},Kn={class:"flex items-center gap-2"},Jn={class:"text-xs text-gray-500 dark:text-gray-400"},Qn={key:0,class:"flex h-60 items-center justify-center"},Zn={key:1,class:"flex h-60 flex-col items-center justify-center"},Xn={class:"text-gray-500 dark:text-gray-400"},el={key:2,class:"flex min-h-0 flex-1 flex-col"},tl={class:"w-full"},al={class:"sticky top-0 bg-gray-50 dark:bg-gray-800"},sl={class:"text-left text-xs font-medium uppercase text-gray-500 dark:text-gray-400"},ol={class:"px-4 py-4"},nl={class:"px-4 py-4"},ll={class:"px-4 py-4"},il={class:"w-64 px-4 py-4"},rl={class:"inline-flex items-center gap-1.5"},cl={class:"px-4 py-4 text-right"},ul={class:"divide-y divide-gray-200 dark:divide-gray-700"},dl={class:"px-4 py-4"},ml={class:"px-4 py-4"},vl={class:"flex items-center gap-2"},hl=["src","alt"],pl={key:1,class:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-pink-400 to-pink-600 text-xs font-medium text-white"},gl={class:"text-sm font-medium text-gray-900 dark:text-white"},fl={class:"ml-1 text-sm text-gray-500 dark:text-gray-400"},yl={class:"px-4 py-4"},xl={key:0,class:"text-sm font-medium text-gray-900 dark:text-white"},bl={key:1,class:"text-sm text-gray-400 dark:text-gray-500"},kl={class:"px-4 py-4"},_l={class:"text-sm font-semibold text-gray-900 dark:text-white"},wl={class:"px-4 py-4"},$l={class:"max-w-xs"},Cl={key:0,class:"absolute right-2 top-1/2 -translate-y-1/2"},Il={class:"px-4 py-4 text-right"},Sl={key:0,class:"flex items-center justify-between border-t border-gray-200 px-6 py-4 dark:border-gray-700"},Tl={class:"text-sm text-gray-500 dark:text-gray-400"},Ml={class:"flex items-center gap-2"},Vl={class:"text-sm font-medium text-gray-600 dark:text-gray-300"},Rl={class:"p-6 text-center"},Dl={class:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30"},Nl={class:"mb-2 text-lg font-semibold text-gray-900 dark:text-white"},Ll={class:"mb-6 text-sm text-gray-500 dark:text-gray-400"},Al={class:"flex justify-center gap-3"},zl={class:"p-6"},Ul={class:"mb-4 flex items-center gap-3"},Fl={class:"flex h-10 w-10 items-center justify-center rounded-full bg-amber-100 dark:bg-amber-900/30"},Bl={class:"text-lg font-semibold text-gray-900 dark:text-white"},Hl={class:"mb-2 text-sm text-gray-600 dark:text-gray-400"},Wl={class:"mb-6 text-xs text-amber-700 dark:text-amber-300"},jl={class:"flex justify-end gap-2"},$e=20,Ol=H({__name:"MemberList",props:{sessionId:{},showHeader:{type:Boolean,default:!0}},emits:["data-changed"],setup(h,{emit:s}){const{t}=ee(),l=h,m=s,c=S([]),v=S([]),p=S(!1),d=S(""),y=S(null),g=S(!1),i=S(new Set),n=S(!1),r=S(!1),_=S(1),b=S(0),x=S(0),w=S("desc"),C=S(null);let M=null;function L(N){return N.groupNickname||N.accountName||N.platformId}function F(N){return L(N).slice(0,1)}const A=$(()=>v.value.filter(N=>i.value.has(N.id))),z=$(()=>A.value.length===2),B=$(()=>{if(A.value.length!==2)return null;const[N,U]=A.value;return U.messageCount>N.messageCount||U.messageCount===N.messageCount&&U.id<N.id?{primary:U,secondary:N}:{primary:N,secondary:U}});function ae(){w.value=w.value==="desc"?"asc":"desc",_.value=1,P()}async function P(){if(l.sessionId){p.value=!0;try{const N=await K().getMembersPaginated(l.sessionId,{page:_.value,pageSize:$e,search:d.value.trim(),sortOrder:w.value});c.value=N.items,b.value=N.total,x.value=N.totalPages}catch(N){console.error("加载成员列表失败:",N)}finally{p.value=!1}}}async function Z(){if(l.sessionId)try{v.value=await K().getMembers(l.sessionId)}catch(N){console.error("加载所有成员失败:",N)}}async function J(N,U){const V=JSON.parse(JSON.stringify(U)),de=JSON.stringify(N.aliases),oe=JSON.stringify(V);if(de!==oe){C.value=N.id;try{if(await K().updateMemberAliases(l.sessionId,N.id,V)){const me=c.value.findIndex(ke=>ke.id===N.id);me!==-1&&(c.value[me]={...c.value[me],aliases:V})}}catch(j){console.error("保存别名失败:",j)}finally{C.value=null}}}function R(N){y.value=N}function Y(){y.value=null}async function ue(){if(y.value){g.value=!0;try{await K().deleteMember(l.sessionId,y.value.id)&&(await P(),await Z(),m("data-changed"))}catch(N){console.error("删除成员失败:",N)}finally{g.value=!1,y.value=null}}}function ge(N){const U=new Set(i.value);U.has(N)?U.delete(N):U.add(N),i.value=U}function xe(){z.value&&(n.value=!0)}function fe(){i.value=new Set}async function be(){if(B.value){r.value=!0;try{await K().mergeMembers(l.sessionId,B.value.primary.id,B.value.secondary.id)&&(n.value=!1,fe(),await P(),await Z(),m("data-changed"))}catch(N){console.error("合并成员失败:",N)}finally{r.value=!1}}}return O(d,()=>{_.value=1,M&&clearTimeout(M),M=setTimeout(()=>{P()},300)}),O(_,()=>{P()}),O(()=>l.sessionId,()=>{d.value="",_.value=1,fe(),P(),Z()},{immediate:!0}),pe(()=>{P(),Z()}),(N,U)=>{const V=re,de=Be,oe=Ie,j=et,me=tt,ke=at,Re=he;return o(),k("div",{class:Q(["main-content",l.showHeader?"max-w-5xl p-6":"flex h-full max-w-none flex-col overflow-hidden p-4"])},[l.showHeader?(o(),k("div",En,[a("div",Pn,[a("div",null,[a("h2",qn,u(e(t)("members.list.title")),1),a("p",Gn,u(e(t)("members.list.description",{count:b.value})),1)])])])):D("",!0),f(Ct,{class:"mb-6","session-id":h.sessionId,members:v.value,"chat-type":"group"},null,8,["session-id","members"]),a("div",Yn,[f(de,{modelValue:d.value,"onUpdate:modelValue":U[1]||(U[1]=E=>d.value=E),placeholder:e(t)("members.list.searchPlaceholder"),icon:"i-heroicons-magnifying-glass",class:"w-full md:w-100"},Oe({_:2},[d.value?{name:"trailing",fn:T(()=>[f(V,{icon:"i-heroicons-x-mark",variant:"link",color:"neutral",size:"xs",onClick:U[0]||(U[0]=E=>d.value="")})]),key:"0"}:void 0]),1032,["modelValue","placeholder"]),a("div",Kn,[a("span",Jn,u(e(t)("members.list.mergeSelectedCount",{count:i.value.size})),1),f(V,{icon:"i-heroicons-link",size:"sm",color:"primary",disabled:!z.value,onClick:xe},{default:T(()=>[G(u(e(t)("members.list.mergeSelected")),1)]),_:1},8,["disabled"])])]),a("div",{class:Q(["rounded-xl border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-900",l.showHeader?"":"flex min-h-0 flex-1 flex-col"])},[p.value?(o(),k("div",Qn,[f(oe,{name:"i-heroicons-arrow-path",class:"h-8 w-8 animate-spin text-pink-500"})])):c.value.length===0?(o(),k("div",Zn,[f(oe,{name:"i-heroicons-user-group",class:"mb-3 h-12 w-12 text-gray-300 dark:text-gray-600"}),a("p",Xn,u(d.value?e(t)("members.list.noMatch"):e(t)("members.list.empty")),1)])):(o(),k("div",el,[a("div",{class:Q(["max-h-[500px] overflow-y-auto",l.showHeader?"":"max-h-none min-h-0 flex-1"])},[a("table",tl,[a("thead",al,[a("tr",sl,[U[7]||(U[7]=a("th",{class:"w-12 px-4 py-4"},null,-1)),a("th",ol,u(e(t)("members.list.table.accountName")),1),a("th",nl,u(e(t)("members.list.table.groupNickname")),1),a("th",ll,[a("button",{class:"flex items-center gap-1.5 hover:text-gray-700 dark:hover:text-gray-200",onClick:ae},[G(u(e(t)("members.list.table.messageCount"))+" ",1),f(oe,{name:w.value==="desc"?"i-heroicons-arrow-down":"i-heroicons-arrow-up",class:"h-3.5 w-3.5"},null,8,["name"])])]),a("th",il,[a("div",rl,[a("span",null,u(e(t)("members.list.table.customAlias")),1),f(j,{text:e(t)("members.list.tip"),popper:{placement:"top"}},{default:T(()=>[f(oe,{name:"i-heroicons-question-mark-circle",class:"h-4 w-4 text-gray-400 dark:text-gray-500"})]),_:1},8,["text"])])]),a("th",cl,u(e(t)("members.list.table.actions")),1)])]),a("tbody",ul,[(o(!0),k(W,null,X(c.value,E=>(o(),k("tr",{key:E.id,class:"hover:bg-gray-50 dark:hover:bg-gray-800/50"},[a("td",dl,[f(me,{"model-value":i.value.has(E.id),onClick:je(_e=>ge(E.id),["stop"])},null,8,["model-value","onClick"])]),a("td",ml,[a("div",vl,[E.avatar?(o(),k("img",{key:0,src:E.avatar,alt:L(E),class:"h-8 w-8 shrink-0 rounded-full object-cover"},null,8,hl)):(o(),k("div",pl,u(F(E)),1)),a("div",null,[a("span",gl,u(E.accountName||"-"),1),a("span",fl,"("+u(E.platformId)+")",1)])])]),a("td",yl,[E.groupNickname?(o(),k("span",xl,u(E.groupNickname),1)):(o(),k("span",bl,"-"))]),a("td",kl,[a("span",_l,u(E.messageCount.toLocaleString()),1)]),a("td",wl,[a("div",$l,[f(ke,{"model-value":E.aliases,placeholder:e(t)("members.list.aliasPlaceholder"),class:"w-80","onUpdate:modelValue":_e=>J(E,_e)},null,8,["model-value","placeholder","onUpdate:modelValue"]),C.value===E.id?(o(),k("div",Cl,[f(oe,{name:"i-heroicons-arrow-path",class:"h-4 w-4 animate-spin text-pink-500"})])):D("",!0)])]),a("td",Il,[f(V,{label:e(t)("members.list.delete"),size:"xs",onClick:_e=>R(E)},null,8,["label","onClick"])])]))),128))])])],2),x.value>1?(o(),k("div",Sl,[a("p",Tl,u(e(t)("members.list.pagination",{start:(_.value-1)*$e+1,end:Math.min(_.value*$e,b.value),total:b.value})),1),a("div",Ml,[f(V,{icon:"i-heroicons-chevron-left",variant:"outline",size:"sm",disabled:_.value===1||p.value,onClick:U[2]||(U[2]=E=>_.value--)},null,8,["disabled"]),a("span",Vl,u(_.value)+" / "+u(x.value),1),f(V,{icon:"i-heroicons-chevron-right",variant:"outline",size:"sm",disabled:_.value>=x.value||p.value,onClick:U[3]||(U[3]=E=>_.value++)},null,8,["disabled"])])])):D("",!0)]))],2),f(Re,{open:!!y.value,ui:{content:"max-w-sm"},"onUpdate:open":U[4]||(U[4]=E=>y.value=null)},{content:T(()=>[a("div",Rl,[a("div",Dl,[f(oe,{name:"i-heroicons-exclamation-triangle",class:"h-7 w-7 text-red-500"})]),a("h3",Nl,u(e(t)("members.list.modal.title")),1),a("p",Ll,u(e(t)("members.list.modal.content",{name:y.value?L(y.value):"",count:y.value?.messageCount.toLocaleString()})),1),a("div",Al,[f(V,{variant:"outline",onClick:Y},{default:T(()=>[G(u(e(t)("members.list.modal.cancel")),1)]),_:1}),f(V,{color:"error",loading:g.value,onClick:ue},{default:T(()=>[G(u(e(t)("members.list.modal.confirm")),1)]),_:1},8,["loading"])])])]),_:1},8,["open"]),f(Re,{open:n.value,ui:{content:"max-w-md"},"onUpdate:open":U[6]||(U[6]=E=>n.value=E)},{content:T(()=>[a("div",zl,[a("div",Ul,[a("div",Fl,[f(oe,{name:"i-heroicons-link",class:"h-5 w-5 text-amber-600 dark:text-amber-400"})]),a("h3",Bl,u(e(t)("members.list.mergeModal.title")),1)]),a("p",Hl,u(e(t)("members.list.mergeModal.content",{source:B.value?L(B.value.secondary):"",sourceCount:B.value?B.value.secondary.messageCount.toLocaleString():"0",target:B.value?L(B.value.primary):"",targetCount:B.value?B.value.primary.messageCount.toLocaleString():"0"})),1),a("p",Wl,u(e(t)("members.list.mergeModal.hint")),1),a("div",jl,[f(V,{variant:"outline",disabled:r.value,onClick:U[5]||(U[5]=E=>n.value=!1)},{default:T(()=>[G(u(e(t)("members.list.mergeModal.cancel")),1)]),_:1},8,["disabled"]),f(V,{color:"primary",loading:r.value,onClick:be},{default:T(()=>[G(u(e(t)("members.list.mergeModal.confirm")),1)]),_:1},8,["loading"])])])]),_:1},8,["open"])],2)}}}),El={class:"main-content max-w-5xl p-6"},Pl={class:"mb-4 text-sm text-gray-500 dark:text-gray-400 no-capture"},ql={key:0,class:"divide-y divide-gray-100 dark:divide-gray-800"},Gl={class:"w-32 shrink-0 pt-0.5 font-medium text-gray-900 dark:text-white"},Yl={class:"flex flex-1 flex-wrap items-center gap-2"},Kl={class:"flex items-center gap-1.5 rounded-lg bg-gray-50 px-3 py-1.5 dark:bg-gray-800"},Jl={class:"text-xs text-gray-400"},Ql={key:0,class:"text-gray-300 dark:text-gray-600"},Zl=H({__name:"NicknameHistory",props:{sessionId:{}},setup(h){const{t:s}=ee(),t=h,l=S([]),m=S([]),c=S(!1);function v(y){return y.groupNickname||y.accountName||y.platformId}async function p(){if(t.sessionId)try{l.value=await K().getMembers(t.sessionId)}catch(y){console.error("加载成员列表失败:",y)}}async function d(){if(!t.sessionId||l.value.length===0)return;c.value=!0;const y=[];try{const g=l.value.map(n=>K().getMemberNameHistory(t.sessionId,n.id)),i=await Promise.all(g);l.value.forEach((n,r)=>{const _=i[r];_.length>2&&y.push({memberId:n.id,name:v(n),history:_})}),m.value=y}catch(g){console.error("加载昵称变更记录失败:",g)}finally{c.value=!1}}return O(()=>t.sessionId,async()=>{await p()},{immediate:!0}),O(()=>l.value.length,()=>{l.value.length>0&&d()}),pe(async()=>{l.value.length===0&&await p()}),(y,g)=>{const i=Fe;return o(),k("div",El,[a("p",Pl,u(e(s)("members.nicknameHistory.note")),1),f(e(q),{title:e(s)("members.nicknameHistory.title"),description:c.value?e(s)("members.nicknameHistory.loading"):m.value.length>0?e(s)("members.nicknameHistory.hasChanges",{count:m.value.length}):e(s)("members.nicknameHistory.noChanges")},{default:T(()=>[!c.value&&m.value.length>0?(o(),k("div",ql,[(o(!0),k(W,null,X(m.value,n=>(o(),k("div",{key:n.memberId,class:"flex items-start gap-3 px-5 py-3"},[a("div",Gl,u(n.name),1),a("div",Yl,[(o(!0),k(W,null,X(n.history,(r,_)=>(o(),k(W,{key:_},[a("div",Kl,[a("span",{class:Q(["text-sm",r.endTs===null?"font-semibold text-pink-600":"text-gray-700 dark:text-gray-300"])},u(r.name),3),r.endTs===null?(o(),I(i,{key:0,color:"primary",variant:"soft",size:"xs"},{default:T(()=>[G(u(e(s)("members.nicknameHistory.current")),1)]),_:1})):D("",!0),a("span",Jl,"("+u(e(It)(r.startTs,r.endTs))+")",1)]),_<n.history.length-1?(o(),k("span",Ql,"→")):D("",!0)],64))),128))])]))),128))])):c.value?(o(),I(e(se),{key:2,text:e(s)("members.nicknameHistory.loadingText")},null,8,["text"])):(o(),I(e(ne),{key:1,text:e(s)("members.nicknameHistory.empty")},null,8,["text"]))]),_:1},8,["title","description"])])}}}),Xl={class:"flex h-full flex-col overflow-hidden bg-white dark:bg-gray-900"},ei={class:"flex flex-none items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-700"},ti={class:"text-lg font-semibold text-gray-900 dark:text-white"},ai={class:"flex-1 overflow-auto"},si=H({__name:"NicknameHistoryEntry",props:{sessionId:{}},setup(h){const{t:s}=ee(),t=h,l=S(!1);return(m,c)=>{const v=re,p=he;return o(),k(W,null,[f(v,{variant:"ghost",icon:"i-heroicons-clock",size:"sm",onClick:c[0]||(c[0]=d=>l.value=!0)},{default:T(()=>[G(u(e(s)("analysis.subTabs.member.nicknameHistory")),1)]),_:1}),t.sessionId?(o(),I(p,{key:0,open:l.value,"onUpdate:open":c[2]||(c[2]=d=>l.value=d),ui:{content:"max-w-6xl h-[85vh]"}},{content:T(()=>[a("div",Xl,[a("div",ei,[a("h2",ti,u(e(s)("analysis.subTabs.member.nicknameHistory")),1),f(v,{variant:"ghost",icon:"i-heroicons-x-mark",size:"sm",onClick:c[1]||(c[1]=d=>l.value=!1)})]),a("div",ai,[f(Zl,{"session-id":t.sessionId},null,8,["session-id"])])])]),_:1},8,["open"])):D("",!0)],64)}}}),oi={class:"flex h-full flex-col bg-white dark:bg-gray-900",style:{"padding-top":"var(--titlebar-area-height)"}},ni={class:"relative flex-1 overflow-y-auto"},li={class:"h-full"},ii={key:2,class:"flex h-full items-center justify-center"},ri={class:"text-gray-500"},ci={class:"flex h-full flex-col overflow-hidden bg-white dark:bg-gray-900"},ui={class:"flex flex-none items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-700"},di={class:"text-lg font-semibold text-gray-900 dark:text-white"},mi={class:"text-sm text-gray-500 dark:text-gray-400"},vi={class:"flex items-center gap-2"},hi={class:"flex-1 overflow-hidden"},pi=H({__name:"index",setup(h){const s=We(()=>Ue(()=>import("./MessageExportModal-CF6yaor7.js"),__vite__mapDeps([5,6,4,7,8,9]))),{t}=ee(),l=st(),m=ot(),c=ut(),v=Me(),p=dt(),{currentSessionId:d}=mt(c),y=S(!1),g=S(!1),i=S(!1),n=S(!1),r=S(!1);function _(){v.openChatRecordDrawer({})}const b=[{id:"overview",labelKey:"analysis.tabs.overview",icon:"i-heroicons-chart-pie"},{id:"view",labelKey:"analysis.tabs.view",icon:"i-heroicons-presentation-chart-bar"},{id:"ai-chat",labelKey:"analysis.tabs.aiChat",icon:"i-heroicons-chat-bubble-left-ellipsis"},{id:"lab",labelKey:"analysis.tabs.lab",icon:"i-heroicons-beaker"}],x=$(()=>p.debugMode?[...b,{id:"debug",labelKey:"analysis.tabs.debug",icon:"i-heroicons-bug-ant"}]:b),w=$(()=>x.value.map(U=>U.id)),{activeTab:C,isLoading:M,isInitialLoad:L,session:F,memberActivity:A,hourlyActivity:z,dailyActivity:B,messageTypes:ae,timeRangeValue:P,fullTimeRange:Z,availableYears:J,timeFilter:R,selectedYearForOverview:Y,initialTimeState:ue,loadData:ge}=St({route:l,router:m,currentSessionId:d,selectSession:c.selectSession,defaultTab:p.defaultSessionTab,validTabIds:w.value}),xe=$(()=>A.value.slice(0,3)),fe=$(()=>A.value.length<=1?[]:[...A.value].sort((U,V)=>U.messageCount-V.messageCount).slice(0,1)),be=$(()=>A.value.reduce((U,V)=>U+V.messageCount,0)),N=$(()=>A.value.filter(U=>U.messageCount>0).length);return(U,V)=>{const de=re,oe=he;return o(),k("div",oi,[e(L)?(o(),I(se,{key:0,variant:"page",text:e(t)("analysis.groupChat.loading")},null,8,["text"])):e(F)?(o(),k(W,{key:1},[f(Tt,{"active-tab":e(C),"onUpdate:activeTab":V[0]||(V[0]=j=>De(C)?C.value=j:null),"time-range-value":e(P),"onUpdate:timeRangeValue":V[1]||(V[1]=j=>De(P)?P.value=j:null),title:e(F).name,avatar:e(F).groupAvatar,icon:"i-heroicons-chat-bubble-left-right","icon-class":"bg-primary-600 text-white dark:bg-primary-500 dark:text-white",tabs:x.value,"current-session-id":e(d),"initial-time-state":e(ue),onOpenIncrementalImport:V[2]||(V[2]=j=>i.value=!0),onOpenMemberManagement:V[3]||(V[3]=j=>r.value=!0),onOpenChatRecord:_,"onUpdate:fullRange":V[4]||(V[4]=j=>Z.value=j),"onUpdate:availableYears":V[5]||(V[5]=j=>J.value=j)},null,8,["active-tab","time-range-value","title","avatar","tabs","current-session-id","initial-time-state"]),a("div",ni,[e(M)?(o(),I(se,{key:0,variant:"overlay"})):D("",!0),a("div",li,[f(Te,{name:"tab-slide",mode:"out-in"},{default:T(()=>[e(C)==="overview"?(o(),I(Wa,{key:"overview-"+e(d),session:e(F),"member-activity":e(A),"top-members":xe.value,"bottom-members":fe.value,"message-types":e(ae),"hourly-activity":e(z),"daily-activity":e(B),"time-range":e(Z),"selected-year":e(Y),"filtered-message-count":be.value,"filtered-member-count":N.value,"time-filter":e(R)},null,8,["session","member-activity","top-members","bottom-members","message-types","hourly-activity","daily-activity","time-range","selected-year","filtered-message-count","filtered-member-count","time-filter"])):e(C)==="view"?(o(),I(On,{key:"view-"+e(d),"session-id":e(d),"session-name":e(F).name,"time-filter":e(R)},null,8,["session-id","session-name","time-filter"])):e(C)==="ai-chat"?(o(),I(e(Nt),{key:"ai-chat-"+e(d),"session-id":e(d),"session-name":e(F).name,"chat-type":"group"},null,8,["session-id","session-name"])):e(C)==="memory"?(o(),I(Lt,{key:"memory-"+e(d),"session-id":e(d),"session-name":e(F).name},null,8,["session-id","session-name"])):e(C)==="lab"?(o(),I(At,{key:"lab-"+e(d),"session-id":e(d),"session-name":e(F).name,"time-filter":e(R),"chat-type":"group",mode:"sql-only"},null,8,["session-id","session-name","time-filter"])):e(C)==="debug"?(o(),I(e(zt),{key:"debug-"+e(d),"session-id":e(d)},null,8,["session-id"])):D("",!0)]),_:1})])]),f(Mt,{onOpenIncrementalImport:V[6]||(V[6]=j=>i.value=!0),onOpenSessionIndex:V[7]||(V[7]=j=>y.value=!0),onOpenMemberManagement:V[8]||(V[8]=j=>r.value=!0),onOpenChatRecord:_,onOpenMessageExport:V[9]||(V[9]=j=>n.value=!0)}),e(p).debugMode?(o(),I(Ut,{key:0})):D("",!0)],64)):(o(),k("div",ii,[a("p",ri,u(e(t)("analysis.groupChat.loadError")),1)])),e(d)&&e(F)&&e(F).messageCount>0?(o(),I(Vt,{key:3,modelValue:y.value,"onUpdate:modelValue":V[10]||(V[10]=j=>y.value=j),"session-id":e(d),"message-count":e(F).messageCount},null,8,["modelValue","session-id","message-count"])):D("",!0),e(d)&&e(F)&&!y.value?(o(),I(Rt,{key:4,modelValue:g.value,"onUpdate:modelValue":V[11]||(V[11]=j=>g.value=j),"session-id":e(d),"chat-type":"group","auto-check":""},null,8,["modelValue","session-id"])):D("",!0),e(d)&&e(F)?(o(),I(Dt,{key:5,modelValue:i.value,"onUpdate:modelValue":V[12]||(V[12]=j=>i.value=j),"session-id":e(d),"session-name":e(F).name,onImported:V[13]||(V[13]=()=>{e(ge)(),e(c).loadSessions()})},null,8,["modelValue","session-id","session-name"])):D("",!0),e(d)?(o(),I(e(s),{key:6,modelValue:n.value,"onUpdate:modelValue":V[14]||(V[14]=j=>n.value=j)},null,8,["modelValue"])):D("",!0),e(d)?(o(),I(oe,{key:7,open:r.value,"onUpdate:open":V[16]||(V[16]=j=>r.value=j),ui:{content:"max-w-6xl h-[85vh]"}},{content:T(()=>[a("div",ci,[a("div",ui,[a("div",null,[a("h2",di,u(e(t)("analysis.tooltip.memberManagement")),1),a("p",mi,u(e(t)("members.list.description",{count:e(F)?.memberCount??0})),1)]),a("div",vi,[f(si,{"session-id":e(d)},null,8,["session-id"]),f(de,{variant:"ghost",icon:"i-heroicons-x-mark",size:"sm",onClick:V[15]||(V[15]=j=>r.value=!1)})])]),a("div",hi,[f(Ol,{"session-id":e(d),"show-header":!1,onDataChanged:e(ge)},null,8,["session-id","onDataChanged"])])])]),_:1},8,["open"])):D("",!0)])}}}),Ci=Ve(pi,[["__scopeId","data-v-1452caf7"]]);export{Ci as default};