4 lines
21 KiB
JavaScript
4 lines
21 KiB
JavaScript
import{ay as pe,P as ie,bK as $e,d as Y,G as g,a as O,c as o,Z as ue,_ as De,cA as de,r as N,cB as ze,bC as Ie,cC as Me,b7 as Re,h as q,u as Be,be as Ee,cb as qe,bc as Ge,ca as Je,cw as Ae,a1 as Fe,B as W,m as be,o as Ue,bk as Ve,U as $,V as z,W as p,Y as _,a2 as X,a3 as M,X as G,$ as J,cp as Qe,a4 as ee,a9 as Ke,a8 as Xe,cD as Ye,cE as He,z as le,ck as Ze,cF as et,cG as tt,R as te,ak as nt,aj as at,aO as st,ah as rt,T as ot,aP as it,aQ as lt,cH as ct,a0 as ut}from"./index-5c24d9cc.js";/* empty css */import{S as dt}from"./index-b19e7d5a.js";import{_ as pt}from"./index-ea65c04c.js";/* empty css */import{_ as vt}from"./index-9849295f.js";var Ne=pe("normal","exception","active","success"),ft=pe("line","circle","dashboard"),gt=pe("default","small"),ae=function(){return{prefixCls:String,type:ie.oneOf(ft),percent:Number,format:{type:Function},status:ie.oneOf(Ne),showInfo:{type:Boolean,default:void 0},strokeWidth:Number,strokeLinecap:String,strokeColor:{type:[String,Object],default:void 0},trailColor:String,width:Number,success:{type:Object,default:function(){return{}}},gapDegree:Number,gapPosition:String,size:ie.oneOf(gt),steps:Number,successPercent:Number,title:String}};function U(i){return!i||i<0?0:i>100?100:i}function ne(i){var e=i.success,r=i.successPercent,a=r;return e&&"progress"in e&&($e(!1,"Progress","`success.progress` is deprecated. Please use `success.percent` instead."),a=e.progress),e&&"percent"in e&&(a=e.percent),a}var ht=["from","to","direction"],mt=function(){return O(O({},ae()),{},{prefixCls:String,direction:{type:String}})},yt=function(e){var r=[];return Object.keys(e).forEach(function(a){var l=parseFloat(a.replace(/%/g,""));isNaN(l)||r.push({key:l,value:e[a]})}),r=r.sort(function(a,l){return a.key-l.key}),r.map(function(a){var l=a.key,f=a.value;return"".concat(f," ").concat(l,"%")}).join(", ")},_t=function(e,r){var a=e.from,l=a===void 0?de.blue:a,f=e.to,c=f===void 0?de.blue:f,v=e.direction,S=v===void 0?r==="rtl"?"to left":"to right":v,u=De(e,ht);if(Object.keys(u).length!==0){var h=yt(u);return{backgroundImage:"linear-gradient(".concat(S,", ").concat(h,")")}}return{backgroundImage:"linear-gradient(".concat(S,", ").concat(l,", ").concat(c,")")}};const kt=Y({compatConfig:{MODE:3},name:"Line",props:mt(),setup:function(e,r){var a=r.slots,l=g(function(){var u=e.strokeColor,h=e.direction;return u&&typeof u!="string"?_t(u,h):{background:u}}),f=g(function(){return e.trailColor?{backgroundColor:e.trailColor}:void 0}),c=g(function(){var u=e.percent,h=e.strokeWidth,d=e.strokeLinecap,s=e.size;return O({width:"".concat(U(u),"%"),height:"".concat(h||(s==="small"?6:8),"px"),borderRadius:d==="square"?0:""},l.value)}),v=g(function(){return ne(e)}),S=g(function(){var u=e.strokeWidth,h=e.size,d=e.strokeLinecap,s=e.success;return{width:"".concat(U(v.value),"%"),height:"".concat(u||(h==="small"?6:8),"px"),borderRadius:d==="square"?0:"",backgroundColor:s==null?void 0:s.strokeColor}});return function(){var u;return o(ue,null,[o("div",{class:"".concat(e.prefixCls,"-outer")},[o("div",{class:"".concat(e.prefixCls,"-inner"),style:f.value},[o("div",{class:"".concat(e.prefixCls,"-bg"),style:c.value},null),v.value!==void 0?o("div",{class:"".concat(e.prefixCls,"-success-bg"),style:S.value},null):null])]),(u=a.default)===null||u===void 0?void 0:u.call(a)])}}});var St={percent:0,prefixCls:"vc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1},bt=function(e){var r=N(null);return ze(function(){var a=Date.now(),l=!1;e.value.forEach(function(f){var c=(f==null?void 0:f.$el)||f;if(c){l=!0;var v=c.style;v.transitionDuration=".3s, .3s, .3s, .06s",r.value&&a-r.value<100&&(v.transitionDuration="0s, 0s")}}),l&&(r.value=Date.now())}),e},Ct={gapDegree:Number,gapPosition:{type:String},percent:{type:[Array,Number]},prefixCls:String,strokeColor:{type:[Object,String,Array]},strokeLinecap:{type:String},strokeWidth:Number,trailColor:String,trailWidth:Number,transition:String},Pt=["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","strokeColor"],Ce=0;function Pe(i){return+i.replace("%","")}function we(i){return Array.isArray(i)?i:[i]}function xe(i,e,r,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,f=arguments.length>5?arguments[5]:void 0,c=50-a/2,v=0,S=-c,u=0,h=-2*c;switch(f){case"left":v=-c,S=0,u=2*c,h=0;break;case"right":v=c,S=0,u=-2*c,h=0;break;case"bottom":S=c,h=2*c;break}var d="M 50,50 m ".concat(v,",").concat(S,`
|
||
a `).concat(c,",").concat(c," 0 1 1 ").concat(u,",").concat(-h,`
|
||
a `).concat(c,",").concat(c," 0 1 1 ").concat(-u,",").concat(h),s=Math.PI*2*c,b={stroke:r,strokeDasharray:"".concat(e/100*(s-l),"px ").concat(s,"px"),strokeDashoffset:"-".concat(l/2+i/100*(s-l),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s"};return{pathString:d,pathStyle:b}}const wt=Y({compatConfig:{MODE:3},name:"VCCircle",props:Ie(Ct,St),setup:function(e){Ce+=1;var r=N(Ce),a=g(function(){return we(e.percent)}),l=g(function(){return we(e.strokeColor)}),f=Me(),c=Re(f,2),v=c[0],S=c[1];bt(S);var u=function(){var d=e.prefixCls,s=e.strokeWidth,b=e.strokeLinecap,C=e.gapDegree,m=e.gapPosition,P=0;return a.value.map(function(x,y){var R=l.value[y]||l.value[l.value.length-1],B=Object.prototype.toString.call(R)==="[object Object]"?"url(#".concat(d,"-gradient-").concat(r.value,")"):"",L=xe(P,x,R,s,C,m),V=L.pathString,E=L.pathStyle;P+=x;var F={key:y,d:V,stroke:B,"stroke-linecap":b,"stroke-width":s,opacity:x===0?0:1,"fill-opacity":"0",class:"".concat(d,"-circle-path"),style:E};return o("path",O({ref:v(y)},F),null)})};return function(){var h=e.prefixCls,d=e.strokeWidth,s=e.trailWidth,b=e.gapDegree,C=e.gapPosition,m=e.trailColor,P=e.strokeLinecap;e.strokeColor;var x=De(e,Pt),y=xe(0,100,m,d,b,C),R=y.pathString,B=y.pathStyle;delete x.percent;var L=l.value.find(function(E){return Object.prototype.toString.call(E)==="[object Object]"}),V={d:R,stroke:m,"stroke-linecap":P,"stroke-width":s||d,"fill-opacity":"0",class:"".concat(h,"-circle-trail"),style:B};return o("svg",O({class:"".concat(h,"-circle"),viewBox:"0 0 100 100"},x),[L&&o("defs",null,[o("linearGradient",{id:"".concat(h,"-gradient-").concat(r.value),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},[Object.keys(L).sort(function(E,F){return Pe(E)-Pe(F)}).map(function(E,F){return o("stop",{key:F,offset:E,"stop-color":L[E]},null)})])]),o("path",V,null),u().reverse()])}}});function xt(i){var e=i.percent,r=i.success,a=i.successPercent,l=U(ne({success:r,successPercent:a}));return[l,U(U(e)-l)]}function $t(i){var e=i.success,r=e===void 0?{}:e,a=i.strokeColor,l=r.strokeColor;return[l||de.green,a||null]}const Dt=Y({compatConfig:{MODE:3},name:"Circle",inheritAttrs:!1,props:ae(),setup:function(e,r){var a=r.slots,l=g(function(){if(e.gapDegree||e.gapDegree===0)return e.gapDegree;if(e.type==="dashboard")return 75}),f=g(function(){var s=e.width||120;return{width:typeof s=="number"?"".concat(s,"px"):s,height:typeof s=="number"?"".concat(s,"px"):s,fontSize:"".concat(s*.15+6,"px")}}),c=g(function(){return e.strokeWidth||6}),v=g(function(){return e.gapPosition||e.type==="dashboard"&&"bottom"||"top"}),S=g(function(){return xt(e)}),u=g(function(){return Object.prototype.toString.call(e.strokeColor)==="[object Object]"}),h=g(function(){return $t({success:e.success,strokeColor:e.strokeColor})}),d=g(function(){var s;return s={},q(s,"".concat(e.prefixCls,"-inner"),!0),q(s,"".concat(e.prefixCls,"-circle-gradient"),u.value),s});return function(){var s;return o("div",{class:d.value,style:f.value},[o(wt,{percent:S.value,strokeWidth:c.value,trailWidth:c.value,strokeColor:h.value,strokeLinecap:e.strokeLinecap,trailColor:e.trailColor,prefixCls:e.prefixCls,gapDegree:l.value,gapPosition:v.value},null),(s=a.default)===null||s===void 0?void 0:s.call(a)])}}});var It=function(){return O(O({},ae()),{},{steps:Number,size:{type:String},strokeColor:String,trailColor:String})};const Nt=Y({compatConfig:{MODE:3},name:"Steps",props:It(),setup:function(e,r){var a=r.slots,l=g(function(){return Math.round(e.steps*((e.percent||0)/100))}),f=g(function(){return e.size==="small"?2:14}),c=g(function(){for(var v=e.steps,S=e.strokeWidth,u=S===void 0?8:S,h=e.strokeColor,d=e.trailColor,s=e.prefixCls,b=[],C=0;C<v;C+=1){var m,P=(m={},q(m,"".concat(s,"-steps-item"),!0),q(m,"".concat(s,"-steps-item-active"),C<=l.value-1),m);b.push(o("div",{key:C,class:P,style:{backgroundColor:C<=l.value-1?h:d,width:"".concat(f.value,"px"),height:"".concat(u,"px")}},null))}return b});return function(){var v;return o("div",{class:"".concat(e.prefixCls,"-steps-outer")},[c.value,(v=a.default)===null||v===void 0?void 0:v.call(a)])}}}),Ot=Y({compatConfig:{MODE:3},name:"AProgress",props:Ie(ae(),{type:"line",percent:0,showInfo:!0,trailColor:null,size:"default",strokeLinecap:"round"}),slots:["format"],setup:function(e,r){var a=r.slots,l=Be("progress",e),f=l.prefixCls,c=l.direction;$e(e.successPercent==null,"Progress","`successPercent` is deprecated. Please use `success.percent` instead.");var v=g(function(){var d,s=e.type,b=e.showInfo,C=e.size,m=f.value;return d={},q(d,m,!0),q(d,"".concat(m,"-").concat(s==="dashboard"&&"circle"||s),!0),q(d,"".concat(m,"-show-info"),b),q(d,"".concat(m,"-").concat(C),C),q(d,"".concat(m,"-rtl"),c.value==="rtl"),d}),S=g(function(){var d=e.percent,s=d===void 0?0:d,b=ne(e);return parseInt(b!==void 0?b.toString():s.toString(),10)}),u=g(function(){var d=e.status;return Ne.indexOf(d)<0&&S.value>=100?"success":d||"normal"}),h=function(){var s=e.showInfo,b=e.format,C=e.type,m=e.percent,P=e.title,x=ne(e);if(!s)return null;var y,R=b||(a==null?void 0:a.format)||function(L){return"".concat(L,"%")},B=C==="line";return b||a!=null&&a.format||u.value!=="exception"&&u.value!=="success"?y=R(U(m),U(x)):u.value==="exception"?y=B?o(Ee,null,null):o(qe,null,null):u.value==="success"&&(y=B?o(Ge,null,null):o(Je,null,null)),o("span",{class:"".concat(f.value,"-text"),title:P===void 0&&typeof y=="string"?y:void 0},[y])};return function(){var d=e.type,s=e.steps,b=e.strokeColor,C=e.title,m=h(),P;d==="line"?P=s?o(Nt,O(O({},e),{},{strokeColor:typeof b=="string"?b:void 0,prefixCls:f.value,steps:s}),{default:function(){return[m]}}):o(kt,O(O({},e),{},{prefixCls:f.value}),{default:function(){return[m]}}):(d==="circle"||d==="dashboard")&&(P=o(Dt,O(O({},e),{},{prefixCls:f.value}),{default:function(){return[m]}}));var x=O(O({},v.value),{},q({},"".concat(f.value,"-status-").concat(u.value),!0));return o("div",{class:x,title:C},[P])}}}),Tt=Ae(Ot);const A=i=>(it("data-v-7e260b96"),i=i(),lt(),i),jt={class:"topic-search"},Wt={class:"toolbar"},Lt={class:"left"},zt={class:"title"},Mt=A(()=>p("span",{class:"icon"},"🧠",-1)),Rt={class:"right"},Bt={key:0,style:{opacity:"0.75"}},Et={class:"label"},qt={class:"label"},Gt={style:{display:"grid",gap:"6px"}},Jt=A(()=>p("span",{style:{"margin-right":"6px"}},"🔑",-1)),At={key:0},Ft=A(()=>p("span",{style:{"margin-right":"6px"}},"🧩",-1)),Ut=A(()=>p("span",{style:{"margin-right":"6px"}},"🐍",-1)),Vt={style:{opacity:"0.85"}},Qt=A(()=>p("span",{style:{"margin-right":"6px"}},"💻",-1)),Kt={key:1,style:{margin:"10px 0 0 0"}},Xt={key:0,style:{"margin-top":"10px"}},Yt={key:1,class:"grid"},Ht=["onClick"],Zt={class:"card-top"},en={class:"card-title line-clamp-1"},tn={class:"card-count"},nn={class:"card-desc line-clamp-2"},an={key:2,class:"empty"},sn={class:"guide"},rn={class:"guide-row"},on=A(()=>p("span",{class:"guide-icon"},"🗂️",-1)),ln={class:"guide-text"},cn={class:"guide-row"},un=A(()=>p("span",{class:"guide-icon"},"🧠",-1)),dn={class:"guide-text"},pn={class:"guide-row"},vn=A(()=>p("span",{class:"guide-icon"},"🔎",-1)),fn={class:"guide-text"},gn={class:"guide-hint"},hn=A(()=>p("span",{class:"guide-icon"},"💡",-1)),mn={key:0,class:"guide-text"},yn={key:1,class:"guide-text"},ce="topic_search_scope",_n=Y({__name:"TopicSearch",props:{tabIdx:{},paneIdx:{}},setup(i){const e=i,r=Fe(),a=N(!1),l=N(.86),f=N(2),c=N(null),v=N(null),S=N("");let u=null;const h=g(()=>{var n;const t=(n=v.value)==null?void 0:n.status;return t==="queued"||t==="running"}),d=g(()=>{var n;const t=String(((n=v.value)==null?void 0:n.stage)||"");return!t||t==="queued"||t==="init"?W("topicSearchJobQueued"):t==="embedding"?W("topicSearchJobStageEmbedding"):t==="clustering"?W("topicSearchJobStageClustering"):t==="titling"?W("topicSearchJobStageTitling"):t==="done"?W("topicSearchJobStageDone"):t==="error"?W("topicSearchJobStageError"):`${W("topicSearchJobStage")}: ${t}`}),s=g(()=>{var T;const t=(T=v.value)==null?void 0:T.progress;if(!t)return 0;const n=Number(t.to_embed??0),k=Number(t.embedded_done??0);if(n<=0)return 0;const w=Math.floor(k/n*100);return Math.max(0,Math.min(100,w))}),b=g(()=>{var n,k,w,T;const t=(n=v.value)==null?void 0:n.progress;if(!t)return"";if(((k=v.value)==null?void 0:k.stage)==="embedding"){const I=Number(t.embedded_done??0),j=Number(t.to_embed??0),re=Number(t.scanned??0),oe=String(t.folder??"");return W("topicSearchJobEmbeddingDesc",[I,j,re,oe])}if(((w=v.value)==null?void 0:w.stage)==="clustering"){const I=Number(t.items_done??0),j=Number(t.items_total??0);return W("topicSearchJobClusteringDesc",[I,j])}if(((T=v.value)==null?void 0:T.stage)==="titling"){const I=Number(t.clusters_done??0),j=Number(t.clusters_total??0);return W("topicSearchJobTitlingDesc",[I,j])}return""}),C=N(""),m=N(!1),P=N(null),x=N(!1),y=N([]),R=N(!1),B=N(!1);let L=null,V="";const E=g(()=>(r.quickMovePaths??[]).filter(n=>{const k=String((n==null?void 0:n.key)??"");return((n==null?void 0:n.types)??[]).includes("preset")&&["cwd","home","desktop"].includes(k)}).map(n=>String((n==null?void 0:n.dir)??"")).filter(Boolean));be(E,t=>{t!=null&&t.length&&(y.value=(y.value??[]).filter(n=>!t.includes(n)))},{immediate:!0});const F=g(()=>(r.quickMovePaths??[]).filter(n=>{const k=String((n==null?void 0:n.key)??"");return!(((n==null?void 0:n.types)??[]).includes("preset")&&["cwd","home","desktop"].includes(k))}).map(n=>({value:n.dir,label:n.zh||n.dir}))),Q=g(()=>(y.value??[]).filter(Boolean).length),H=g(()=>(y.value??[]).filter(Boolean)),ve=g(()=>{var t;return(((t=c.value)==null?void 0:t.clusters)??[]).slice(0,12)}),Oe=async()=>{var k,w,T;if(R.value)return;try{const I=await Ye();r.conf=I}catch{}const t=((k=r.conf)==null?void 0:k.app_fe_setting)||{},n=(w=t==null?void 0:t[ce])==null?void 0:w.folder_paths;Array.isArray(n)&&n.length&&!((T=y.value)!=null&&T.length)&&(y.value=n.map(I=>String(I)).filter(Boolean)),R.value=!0},fe=async()=>{var n,k;if((n=r.conf)!=null&&n.is_readonly||!R.value)return;const t={folder_paths:H.value,updated_at:Date.now()};await He(ce,t),(k=r.conf)!=null&&k.app_fe_setting&&(r.conf.app_fe_setting[ce]=t)},Te=()=>{var n;if((n=r.conf)!=null&&n.is_readonly||!R.value)return;const t=JSON.stringify(H.value);t!==V&&(L&&clearTimeout(L),L=setTimeout(async()=>{B.value=!0;try{await fe(),V=t}finally{B.value=!1}},500))},Z=()=>{u&&(clearInterval(u),u=null)},ge=async()=>{const t=S.value;if(!t)return;const n=await ct(t);v.value=n,n.status==="done"?(Z(),a.value=!1,n.result&&(c.value=n.result)):n.status==="error"&&(Z(),a.value=!1,le.error(n.error||W("topicSearchJobFailed")))},se=async()=>{var t;if(!((t=r.conf)!=null&&t.is_readonly)){if(!Q.value){le.warning(W("topicSearchNeedScope")),x.value=!0;return}Z(),a.value=!0,v.value=null,S.value="";try{await Ze();const n=await et({threshold:l.value,min_cluster_size:f.value,lang:r.lang,folder_paths:H.value});S.value=n.job_id,await ge(),u=setInterval(()=>{ge()},800)}catch(n){throw a.value=!1,n}}},he=async()=>{const t=(C.value||"").trim();if(t){if(!Q.value){le.warning(W("topicSearchNeedScope")),x.value=!0;return}m.value=!0;try{P.value=await tt({query:t,top_k:80,ensure_embed:!0,folder_paths:H.value}),me()}finally{m.value=!1}}},me=()=>{var T;const t=(((T=P.value)==null?void 0:T.results)??[]).map(I=>I.path).filter(Boolean);if(!t.length)return;const n=`Query: ${C.value.trim()}(${t.length})`,k={type:"topic-search-matched-image-grid",name:n,key:Date.now()+te(),id:te(),title:n,paths:t},w=r.tabList[e.tabIdx];w.panes.push(k),w.key=k.key},je=t=>{const n={type:"topic-search-matched-image-grid",name:`${t.title}(${t.size})`,key:Date.now()+te(),id:te(),title:t.title,paths:t.paths},k=r.tabList[e.tabIdx];k.panes.push(n),k.key=n.key};return Ue(()=>{(async()=>(await Oe(),Q.value&&await se()))()}),Ve(()=>{Z()}),be(()=>H.value,()=>{Te()},{deep:!0}),(t,n)=>{var ye,_e,ke,Se;const k=vt,w=nt,T=at,I=pt,j=st,re=Tt,oe=dt,We=rt,Le=ot;return $(),z("div",jt,[p("div",Wt,[p("div",Lt,[p("div",zt,[Mt,p("span",null,_(t.$t("topicSearchTitleExperimental")),1)]),c.value?($(),X(k,{key:0,color:"blue"},{default:M(()=>[G("共 "+_(c.value.count)+" 张",1)]),_:1})):J("",!0),c.value?($(),X(k,{key:1,color:"geekblue"},{default:M(()=>[G("主题 "+_(c.value.clusters.length),1)]),_:1})):J("",!0),c.value?($(),X(k,{key:2,color:"default"},{default:M(()=>[G("噪声 "+_(c.value.noise.length),1)]),_:1})):J("",!0)]),p("div",Rt,[o(w,{onClick:n[0]||(n[0]=D=>x.value=!0)},{default:M(()=>[G(_(t.$t("topicSearchScope"))+" ",1),Q.value?($(),z("span",Bt,"("+_(Q.value)+")",1)):J("",!0)]),_:1}),o(T,{value:C.value,"onUpdate:value":n[1]||(n[1]=D=>C.value=D),style:{width:"min(420px, 72vw)"},placeholder:t.$t("topicSearchQueryPlaceholder"),disabled:m.value,onKeydown:Qe(he,["enter"]),"allow-clear":""},null,8,["value","placeholder","disabled","onKeydown"]),o(w,{loading:m.value,onClick:he},{default:M(()=>[G(_(t.$t("search")),1)]),_:1},8,["loading"]),(_e=(ye=P.value)==null?void 0:ye.results)!=null&&_e.length?($(),X(w,{key:0,onClick:me},{default:M(()=>[G(_(t.$t("topicSearchOpenResults")),1)]),_:1})):J("",!0),p("span",Et,_(t.$t("topicSearchThreshold")),1),o(I,{value:l.value,"onUpdate:value":n[2]||(n[2]=D=>l.value=D),min:.5,max:.99,step:.01},null,8,["value"]),p("span",qt,_(t.$t("topicSearchMinClusterSize")),1),o(I,{value:f.value,"onUpdate:value":n[3]||(n[3]=D=>f.value=D),min:1,max:50,step:1},null,8,["value"]),o(w,{type:"primary",ghost:"",loading:a.value,disabled:(ke=ee(r).conf)==null?void 0:ke.is_readonly,onClick:se},{default:M(()=>[G(_(t.$t("refresh")),1)]),_:1},8,["loading","disabled"])])]),(Se=ee(r).conf)!=null&&Se.is_readonly?($(),X(j,{key:0,type:"warning",message:t.$t("readonlyModeSettingPageDesc"),style:{margin:"12px 0"},"show-icon":""},null,8,["message"])):J("",!0),o(j,{type:"info","show-icon":"",style:{margin:"10px 0 0 0"},message:t.$t("topicSearchRequirementsTitle")},{description:M(()=>[p("div",Gt,[p("div",null,[Jt,p("span",null,_(t.$t("topicSearchRequirementsOpenai")),1)]),ee(Ke)?($(),z("div",At,[Ft,p("span",null,_(t.$t("topicSearchRequirementsDepsDesktop")),1)])):($(),z(ue,{key:1},[p("div",null,[Ut,p("span",null,_(t.$t("topicSearchRequirementsDepsPython")),1)]),p("div",Vt,[Qt,p("span",null,_(t.$t("topicSearchRequirementsInstallCmd")),1)])],64))])]),_:1},8,["message"]),h.value?($(),z("div",Kt,[o(j,{type:"info","show-icon":"",message:d.value,description:b.value},null,8,["message","description"]),o(re,{percent:s.value,size:"small",style:{"margin-top":"8px"}},null,8,["percent"])])):J("",!0),o(oe,{spinning:a.value},{default:M(()=>{var D;return[P.value?($(),z("div",Xt,[o(j,{type:"info",message:t.$t("topicSearchRecallMsg",[P.value.results.length,P.value.count,P.value.top_k]),"show-icon":""},null,8,["message"])])):J("",!0),ve.value.length?($(),z("div",Yt,[($(!0),z(ue,null,Xe(ve.value,K=>($(),z("div",{class:"card",key:K.id,onClick:kn=>je(K)},[p("div",Zt,[p("div",en,_(K.title),1),p("div",tn,_(K.size),1)]),p("div",nn,_(K.sample_prompt),1)],8,Ht))),128))])):($(),z("div",an,[o(j,{type:"info","show-icon":"",message:t.$t("topicSearchGuideTitle"),style:{"margin-bottom":"10px"}},null,8,["message"]),p("div",sn,[p("div",rn,[on,p("span",ln,_(t.$t("topicSearchGuideStep1")),1),o(w,{size:"small",onClick:n[4]||(n[4]=K=>x.value=!0)},{default:M(()=>[G(_(t.$t("topicSearchScope")),1)]),_:1})]),p("div",cn,[un,p("span",dn,_(t.$t("topicSearchGuideStep2")),1),o(w,{size:"small",loading:a.value,disabled:(D=ee(r).conf)==null?void 0:D.is_readonly,onClick:se},{default:M(()=>[G(_(t.$t("refresh")),1)]),_:1},8,["loading","disabled"])]),p("div",pn,[vn,p("span",fn,_(t.$t("topicSearchGuideStep3")),1)]),p("div",gn,[hn,Q.value?($(),z("span",yn,_(t.$t("topicSearchGuideEmptyReasonNoTopics")),1)):($(),z("span",mn,_(t.$t("topicSearchGuideEmptyReasonNoScope")),1))])])]))]}),_:1},8,["spinning"]),o(Le,{visible:x.value,"onUpdate:visible":n[6]||(n[6]=D=>x.value=D),title:t.$t("topicSearchScopeModalTitle"),"mask-closable":!0,onOk:n[7]||(n[7]=()=>{x.value=!1,fe()})},{default:M(()=>[o(j,{type:"info","show-icon":"",message:t.$t("topicSearchScopeTip"),style:{"margin-bottom":"10px"}},null,8,["message"]),B.value?($(),X(j,{key:0,type:"info","show-icon":"",message:t.$t("topicSearchSavingToBackend"),style:{"margin-bottom":"10px"}},null,8,["message"])):J("",!0),o(We,{value:y.value,"onUpdate:value":n[5]||(n[5]=D=>y.value=D),mode:"multiple",style:{width:"100%"},options:F.value,placeholder:t.$t("topicSearchScopePlaceholder"),"max-tag-count":3,getPopupContainer:D=>D.parentElement||D,"allow-clear":""},null,8,["value","options","placeholder","getPopupContainer"])]),_:1},8,["visible","title"])])}}});const $n=ut(_n,[["__scopeId","data-v-7e260b96"]]);export{$n as default};
|