@blueking/ai-blueking 2.2.0-beta.1 → 2.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/standalone/index.es.min.js +8312 -8301
- package/dist/standalone/index.iife.min.js +2 -2
- package/dist/standalone/index.umd.min.js +2 -2
- package/dist/vue2/index.es.min.js +53 -42
- package/dist/vue2/index.iife.min.js +2 -2
- package/dist/vue2/index.umd.min.js +2 -2
- package/dist/vue3/index.iife.min.js +1 -1
- package/package.json +4 -4
|
@@ -3487,12 +3487,12 @@ Input "@" to trigger tool and MCP
|
|
|
3487
3487
|
Use Shift + Enter to enter a new line`:`输入 "/" 唤出 Skill
|
|
3488
3488
|
输入 "\\" 唤出 Prompt
|
|
3489
3489
|
输入 "@" 唤出 工具和 MCP
|
|
3490
|
-
通过 Shift + Enter 进行换行输入`},prompts:{default:()=>[]},resources:{default:()=>[]},sendDisabledTip:{},shortcutId:{},shortcuts:{},skills:{default:()=>[]},supportUpload:{type:Boolean,default:!0},tippyOptions:{}},{cite:{required:!1,default:``},citeModifiers:{}}),emits:(0,t.mergeModels)([`selectShortcut`,`deleteShortcut`,`update:modelValue`],[`update:cite`]),setup(e,{expose:n,emit:r}){let i=(0,t.useTemplateRef)(`aiSlashInputRef`),a=(0,t.useTemplateRef)(`filesRef`),o=(0,t.useModel)(e,`cite`),s=(0,t.shallowRef)(200),l=e,u=r,d=(0,t.ref)(l.defaultUploadFiles||[]),f=(0,t.computed)(()=>l.shortcuts?.find(e=>e.id===l.shortcutId)),p=(0,t.computed)(()=>l.messageStatus&&[Du.Pending,Du.Streaming,Du.Fetching].includes(l.messageStatus)?l.messageStatus:l.modelValue?.length<1||Array.isArray(l.modelValue)&&!r9(l.modelValue).trim()?Du.Disabled:l.messageStatus);(0,t.watchPostEffect)(()=>{let e=l.inputMaxHeight||200;if(d.value.length<1||!a.value){s.value=e;return}s.value=e+(a.value?.clientHeight||0)});let m=async()=>{try{if(l.sendDisabledTip)return;i.value?.cleanup?.();let e;d.value?.length?(e=d.value?.slice().map(e=>({type:Tu.Binary,url:e.url,mimeType:e.file?.type||``,filename:e.file?.name||``})),l.modelValue&&e.push({type:Tu.Text,text:r9(l.modelValue)})):e=typeof l.modelValue==`string`?l.modelValue:r9(l.modelValue),l.onSendMessage?.(e,l.modelValue),d.value=[]}catch(e){console.error(e)}},h=e=>{if(e.key===`Enter`||e.key===`NumpadEnter`){if(e.shiftKey||p.value===Du.Disabled||l.sendDisabledTip||p.value===Du.Fetching||p.value===Du.Streaming||p.value===Du.Pending)return;m()}},g=async()=>{try{l.onStopSending?.()}catch(e){console.error(e)}},_=()=>{o.value=``},v=e=>{u(`selectShortcut`,e)},y=()=>{u(`deleteShortcut`)},b=e=>`${e.name}_${e.size}_${e.lastModified}`,x=(Eye/(1024*1024)).toFixed(1),S=async e=>{if(!l.supportUpload)return;if(d.value.length>=3){e.length>0&&xc({message:_u(e.length,x,xu),theme:`error`});return}let t=new Set(d.value.map(e=>e.file?b(e.file):``)),n=0;for(let r=0;r<e.length;r++){let i=e[r];if(d.value.length>=3){n+=e.length-r;break}let a=b(i);if(t.has(a)){n+=1;continue}if(i.size<=0||i.size>=2516582.4){n+=1;continue}t.add(a);let o={file:i,status:T9.Pending};d.value.push(o),l.onUpload?.(i).then(e=>{if(e&&typeof e==`object`&&`download_url`in e){o.url=e.download_url,o.status=T9.Success;return}o.status=T9.Error}).catch(()=>{o.status=T9.Error})}n>0&&xc({message:_u(n,x,xu),theme:`error`})},C=e=>{d.value=d.value.filter(t=>t.file?t.file!==e.file:t.url?t.url!==e.url:t.filename?t.filename!==e.filename:!0)},w=(e,t)=>{u(`update:modelValue`,e,t)};return n({focus:()=>{i.value?.focus?.()},triggerSendMessage:m}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`chat-input-container`,style:(0,t.normalizeStyle)({"--chat-z-index":(0,t.unref)(yye)})},[(0,t.renderSlot)(n.$slots,`top`),(0,t.renderSlot)(n.$slots,`interrupt`),(0,t.createElementVNode)(`div`,{class:`chat-input`,style:(0,t.normalizeStyle)({maxHeight:s.value+`px`})},[(0,t.renderSlot)(n.$slots,`input-header`,{},()=>[o.value?((0,t.openBlock)(),(0,t.createBlock)(rFt,{key:0,class:`chat-input-cite`,content:o.value,onClose:_},null,8,[`content`])):(0,t.createCommentVNode)(`v-if`,!0)]),(0,t.renderSlot)(n.$slots,`files`,(0,t.normalizeProps)((0,t.guardReactiveProps)({files:d.value})),()=>[d.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`filesRef`,ref:a,class:`chat-input-files`},[(0,t.createVNode)(D9,{files:d.value,onDeleteFile:C},null,8,[`files`])],512)):(0,t.createCommentVNode)(`v-if`,!0)]),(0,t.createVNode)(rIt,{ref_key:`aiSlashInputRef`,ref:i,"model-value":e.modelValue,placeholder:e.placeholder,prompts:e.prompts,resources:e.resources,skills:e.skills,onKeydown:h,"onUpdate:modelValue":w,onUpload:S},null,8,[`model-value`,`placeholder`,`prompts`,`resources`,`skills`]),(0,t.createVNode)(aIt,{"message-state":p.value,"send-disabled-tip":e.sendDisabledTip,"tippy-options":e.tippyOptions,onSendMessage:m,onStopSending:g},{default:(0,t.withCtx)(()=>[e.supportUpload?((0,t.openBlock)(),(0,t.createBlock)(eFt,{key:0,"tippy-options":e.tippyOptions,onUpload:S},null,8,[`tippy-options`])):(0,t.createCommentVNode)(`v-if`,!0),e.supportUpload&&(e.shortcuts?.length||f.value)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,oIt)):(0,t.createCommentVNode)(`v-if`,!0),(0,t.renderSlot)(n.$slots,`attachment`,{},()=>[e.shortcuts&&!f.value?((0,t.openBlock)(),(0,t.createBlock)(Vbe,{key:0,shortcuts:e.shortcuts,onSelectShortcut:v},null,8,[`shortcuts`])):(0,t.createCommentVNode)(`v-if`,!0),f.value?((0,t.openBlock)(),(0,t.createBlock)(Lu,{key:1,class:`selected-shortcut-btn`,shortcut:f.value},{append:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Fu),{onClick:y})]),_:1},8,[`shortcut`])):(0,t.createCommentVNode)(`v-if`,!0)])]),"send-icon":(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`send-icon`)]),_:3},8,[`message-state`,`send-disabled-tip`,`tippy-options`])],4)],4))}}),cIt={class:`chat-input-info-alert`},lIt={class:`chat-input-info-alert__text`},uIt=(0,t.defineComponent)({__name:`input-info-alert`,props:{content:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,cIt,[(0,t.createVNode)((0,t.unref)(ube),{class:`chat-input-info-alert__icon`}),(0,t.createElementVNode)(`span`,lIt,(0,t.toDisplayString)(e.content),1)]))}}),O9=`others`,dIt=e=>e<26?String.fromCharCode(65+e):String(e+1),fIt=e=>{let n=(0,t.computed)(()=>e()?.metadata?.questions??[]),r=(0,t.shallowRef)({}),i=e=>r.value[e],a=(e,t)=>{r.value={...r.value,[e]:t}},o=(0,t.computed)(()=>n.value.length),s=(0,t.computed)(()=>n.value.reduce((e,t,n)=>e+ +!!r.value[n],0)),l=(0,t.computed)(()=>o.value>0&&s.value===o.value),u=()=>n.value.map((e,t)=>r.value[t]??{question:e.question,answer:[]});return{questions:n,answeredCount:s,totalCount:o,completed:l,getAnswer:i,setAnswer:a,buildResolvePayload:()=>({interruptId:e()?.id??``,reason:wu.UserQuestion,status:`resolved`,payload:{answers:u()}}),buildSkipPayload:()=>pIt(e())}},pIt=e=>({interruptId:e?.id??``,reason:wu.UserQuestion,status:`cancelled`,payload:{answers:[]}}),mIt={class:`ai-user-question-answered`},hIt={class:`ai-user-question-answered__header`},gIt={class:`ai-user-question-answered__title-wrap`},_It={class:`ai-user-question-answered__title`},vIt={class:`ai-user-question-answered__status`},yIt={class:`ai-user-question-answered__body`},bIt={class:`ai-user-question-answered__question`},xIt={class:`ai-user-question-answered__question-text`},SIt={key:0,class:`ai-user-question-answered__tag`},CIt=(0,t.defineComponent)({__name:`user-question-answered-card`,props:{answers:{},status:{default:`resolved`}},setup(e){let n=e,r=(0,t.computed)(()=>n.status===`cancelled`?Su(`已取消`):Su(`已回复`));return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,mIt,[(0,t.createElementVNode)(`header`,hIt,[(0,t.createElementVNode)(`div`,gIt,[(0,t.createVNode)((0,t.unref)(lbe),{class:`ai-user-question-answered__help-icon`}),(0,t.createElementVNode)(`span`,_It,(0,t.toDisplayString)((0,t.unref)(Su)(`回答内容`)),1)]),(0,t.createElementVNode)(`span`,vIt,(0,t.toDisplayString)(r.value),1)]),(0,t.createElementVNode)(`div`,yIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.answers,(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:i,class:`ai-user-question-answered__item`},[(0,t.createElementVNode)(`div`,bIt,[(0,t.createElementVNode)(`span`,xIt,(0,t.toDisplayString)(i+1)+`. `+(0,t.toDisplayString)(r.question),1),r.multiSelect===void 0?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,SIt,(0,t.toDisplayString)(r.multiSelect?(0,t.unref)(Su)(`多选`):(0,t.unref)(Su)(`单选`)),1))]),(0,t.createCommentVNode)(` 默认逐条回显选择题答案;业务方可覆盖此 slot 渲染自定义表单的回显 `),(0,t.renderSlot)(n.$slots,`answer`,(0,t.mergeProps)({ref_for:!0},{item:r,index:i,status:e.status}),()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.answer,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`p`,{key:n,class:`ai-user-question-answered__answer`},(0,t.toDisplayString)(e.description||e.label),1))),128))])]))),128))])]))}}),wIt={class:`ai-user-question-option__badge`},TIt=[`placeholder`,`value`],EIt={key:1,class:`ai-user-question-option__text`},DIt=(0,t.defineComponent)({__name:`user-question-option`,props:{option:{},othersText:{},selected:{type:Boolean}},emits:[`confirm`,`select`,`update:othersText`],setup(e,{emit:n}){let r=e,i=n,a=()=>{i(`select`)},o=()=>{r.selected||i(`select`)},s=e=>{let t=e.target.value;i(`update:othersText`,t),r.selected||i(`select`)};return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ai-user-question-option`,{"ai-user-question-option--selected":e.selected,"ai-user-question-option--others":e.option.isOthers}]),onClick:a},[(0,t.createElementVNode)(`span`,wIt,(0,t.toDisplayString)(e.option.letter),1),(0,t.createCommentVNode)(` Others:自定义输入 `),e.option.isOthers?((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:0,class:`ai-user-question-option__input`,placeholder:(0,t.unref)(Su)(`请输入...`),value:e.othersText,onClick:r[0]||=(0,t.withModifiers)(()=>{},[`stop`]),onFocus:o,onInput:s,onKeydown:r[1]||=(0,t.withKeys)((0,t.withModifiers)(e=>i(`confirm`),[`stop`]),[`enter`])},null,40,TIt)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,EIt,(0,t.toDisplayString)(e.option.description),1))],2))}}),OIt={class:`ai-user-question-choice`},kIt=(0,t.defineComponent)({__name:`user-question-choice`,props:{question:{}},emits:[`answer`,`confirm`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.shallowRef)([]),o=(0,t.shallowRef)(``),s=(0,t.computed)(()=>{let e=(r.question.options??[]).filter(e=>e.label!==O9).map((e,t)=>({...e,isOthers:!1,letter:dIt(t)}));return e.push({label:O9,description:``,isOthers:!0,letter:dIt(e.length)}),e}),l=(0,t.computed)(()=>s.value.findIndex(e=>e.isOthers)),u=e=>a.value.includes(e),d=(0,t.computed)(()=>a.value.length?l.value>=0&&a.value.includes(l.value)?o.value.trim().length>0:!0:!1),f=()=>({question:r.question.question,multiSelect:r.question.multiSelect,answer:a.value.map(e=>{let t=s.value[e];return t?.isOthers?{label:O9,description:o.value.trim()}:{label:t?.label??``,description:t?.description??``}})}),p=()=>i(`answer`,d.value?f():void 0),m=e=>{let t=a.value;a.value=r.question.multiSelect?t.includes(e)?t.filter(t=>t!==e):[...t,e]:[e],p()},h=e=>{o.value=e,p()};return(0,t.watch)(()=>r.question,()=>{a.value=[],o.value=``,p()}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,OIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s.value,(e,r)=>((0,t.openBlock)(),(0,t.createBlock)(DIt,{key:r,option:e,"others-text":o.value,selected:u(r),onConfirm:n[0]||=e=>i(`confirm`),onSelect:e=>m(r),"onUpdate:othersText":h},null,8,[`option`,`others-text`,`selected`,`onSelect`]))),128))]))}}),AIt={class:`ai-user-question-card__title-wrap`},jIt={class:`ai-user-question-card__title`},MIt={class:`ai-user-question-card__counter-wrap`},NIt={class:`ai-user-question-card__counter`},PIt={class:`ai-user-question-card__body`},FIt={class:`ai-user-question-card__question-title`},IIt={class:`ai-user-question-card__question-text`},LIt={key:0,class:`ai-user-question-card__tag`},RIt={class:`ai-user-question-card__options`},zIt={class:`ai-user-question-card__footer`},BIt=(0,t.defineComponent)({__name:`user-question-card`,props:{interrupt:{},onResume:{type:Function}},setup(e){let n=e,r=Vu(),i=(0,t.shallowRef)(!1),{questions:a,answeredCount:o,totalCount:s,completed:l,getAnswer:u,setAnswer:d,buildResolvePayload:f,buildSkipPayload:p}=fIt(()=>n.interrupt),m=(0,t.computed)(()=>n.interrupt.metadata?.questions?.[0]?.header||n.interrupt.message||``),h=()=>{i.value=!i.value},g=()=>{i.value&&=!1},_=()=>{l.value&&n.onResume?.(f(),n.interrupt)},v=()=>{n.onResume?.(p(),n.interrupt)};return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{class:(0,t.normalizeClass)([`ai-user-question-card`,{"ai-user-question-card--collapsed":i.value}])},[(0,t.createElementVNode)(`header`,{class:`ai-user-question-card__header`,onClick:g},[(0,t.createElementVNode)(`div`,AIt,[(0,t.createVNode)((0,t.unref)(lbe),{class:`ai-user-question-card__help-icon`}),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,jIt,[(0,t.createTextVNode)((0,t.toDisplayString)(m.value),1)])),[[(0,t.unref)(Hu),{...(0,t.unref)(r)}]]),(0,t.createCommentVNode)(` <span
|
|
3490
|
+
通过 Shift + Enter 进行换行输入`},prompts:{default:()=>[]},resources:{default:()=>[]},sendDisabledTip:{},shortcutId:{},shortcuts:{},skills:{default:()=>[]},supportUpload:{type:Boolean,default:!0},tippyOptions:{}},{cite:{required:!1,default:``},citeModifiers:{}}),emits:(0,t.mergeModels)([`selectShortcut`,`deleteShortcut`,`update:modelValue`],[`update:cite`]),setup(e,{expose:n,emit:r}){let i=(0,t.useTemplateRef)(`aiSlashInputRef`),a=(0,t.useTemplateRef)(`filesRef`),o=(0,t.useModel)(e,`cite`),s=(0,t.shallowRef)(200),l=e,u=r,d=(0,t.ref)(l.defaultUploadFiles||[]),f=(0,t.computed)(()=>l.shortcuts?.find(e=>e.id===l.shortcutId)),p=(0,t.computed)(()=>l.messageStatus&&[Du.Pending,Du.Streaming,Du.Fetching].includes(l.messageStatus)?l.messageStatus:l.modelValue?.length<1||Array.isArray(l.modelValue)&&!r9(l.modelValue).trim()?Du.Disabled:l.messageStatus);(0,t.watchPostEffect)(()=>{let e=l.inputMaxHeight||200;if(d.value.length<1||!a.value){s.value=e;return}s.value=e+(a.value?.clientHeight||0)});let m=async()=>{try{if(l.sendDisabledTip)return;i.value?.cleanup?.();let e;d.value?.length?(e=d.value?.slice().map(e=>({type:Tu.Binary,url:e.url,mimeType:e.file?.type||``,filename:e.file?.name||``})),l.modelValue&&e.push({type:Tu.Text,text:r9(l.modelValue)})):e=typeof l.modelValue==`string`?l.modelValue:r9(l.modelValue),l.onSendMessage?.(e,l.modelValue),d.value=[]}catch(e){console.error(e)}},h=e=>{if(e.key===`Enter`||e.key===`NumpadEnter`){if(e.shiftKey||p.value===Du.Disabled||l.sendDisabledTip||p.value===Du.Fetching||p.value===Du.Streaming||p.value===Du.Pending)return;m()}},g=async()=>{try{l.onStopSending?.()}catch(e){console.error(e)}},_=()=>{o.value=``},v=e=>{u(`selectShortcut`,e)},y=()=>{u(`deleteShortcut`)},b=e=>`${e.name}_${e.size}_${e.lastModified}`,x=(Eye/(1024*1024)).toFixed(1),S=async e=>{if(!l.supportUpload)return;if(d.value.length>=3){e.length>0&&xc({message:_u(e.length,x,xu),theme:`error`});return}let t=new Set(d.value.map(e=>e.file?b(e.file):``)),n=0;for(let r=0;r<e.length;r++){let i=e[r];if(d.value.length>=3){n+=e.length-r;break}let a=b(i);if(t.has(a)){n+=1;continue}if(i.size<=0||i.size>=2516582.4){n+=1;continue}t.add(a);let o={file:i,status:T9.Pending};d.value.push(o),l.onUpload?.(i).then(e=>{if(e&&typeof e==`object`&&`download_url`in e){o.url=e.download_url,o.status=T9.Success;return}o.status=T9.Error}).catch(()=>{o.status=T9.Error})}n>0&&xc({message:_u(n,x,xu),theme:`error`})},C=e=>{d.value=d.value.filter(t=>t.file?t.file!==e.file:t.url?t.url!==e.url:t.filename?t.filename!==e.filename:!0)},w=(e,t)=>{u(`update:modelValue`,e,t)};return n({focus:()=>{i.value?.focus?.()},triggerSendMessage:m}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`chat-input-container`,style:(0,t.normalizeStyle)({"--chat-z-index":(0,t.unref)(yye)})},[(0,t.renderSlot)(n.$slots,`top`),(0,t.renderSlot)(n.$slots,`interrupt`),(0,t.createElementVNode)(`div`,{class:`chat-input`,style:(0,t.normalizeStyle)({maxHeight:s.value+`px`})},[(0,t.renderSlot)(n.$slots,`input-header`,{},()=>[o.value?((0,t.openBlock)(),(0,t.createBlock)(rFt,{key:0,class:`chat-input-cite`,content:o.value,onClose:_},null,8,[`content`])):(0,t.createCommentVNode)(`v-if`,!0)]),(0,t.renderSlot)(n.$slots,`files`,(0,t.normalizeProps)((0,t.guardReactiveProps)({files:d.value})),()=>[d.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`filesRef`,ref:a,class:`chat-input-files`},[(0,t.createVNode)(D9,{files:d.value,onDeleteFile:C},null,8,[`files`])],512)):(0,t.createCommentVNode)(`v-if`,!0)]),(0,t.createVNode)(rIt,{ref_key:`aiSlashInputRef`,ref:i,"model-value":e.modelValue,placeholder:e.placeholder,prompts:e.prompts,resources:e.resources,skills:e.skills,onKeydown:h,"onUpdate:modelValue":w,onUpload:S},null,8,[`model-value`,`placeholder`,`prompts`,`resources`,`skills`]),(0,t.createVNode)(aIt,{"message-state":p.value,"send-disabled-tip":e.sendDisabledTip,"tippy-options":e.tippyOptions,onSendMessage:m,onStopSending:g},{default:(0,t.withCtx)(()=>[e.supportUpload?((0,t.openBlock)(),(0,t.createBlock)(eFt,{key:0,"tippy-options":e.tippyOptions,onUpload:S},null,8,[`tippy-options`])):(0,t.createCommentVNode)(`v-if`,!0),e.supportUpload&&(e.shortcuts?.length||f.value)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,oIt)):(0,t.createCommentVNode)(`v-if`,!0),(0,t.renderSlot)(n.$slots,`attachment`,{},()=>[e.shortcuts&&!f.value?((0,t.openBlock)(),(0,t.createBlock)(Vbe,{key:0,shortcuts:e.shortcuts,onSelectShortcut:v},null,8,[`shortcuts`])):(0,t.createCommentVNode)(`v-if`,!0),f.value?((0,t.openBlock)(),(0,t.createBlock)(Lu,{key:1,class:`selected-shortcut-btn`,shortcut:f.value},{append:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Fu),{onClick:y})]),_:1},8,[`shortcut`])):(0,t.createCommentVNode)(`v-if`,!0)])]),"send-icon":(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`send-icon`)]),_:3},8,[`message-state`,`send-disabled-tip`,`tippy-options`])],4)],4))}}),cIt={class:`chat-input-info-alert`},lIt={class:`chat-input-info-alert__text`},uIt=(0,t.defineComponent)({__name:`input-info-alert`,props:{content:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,cIt,[(0,t.createVNode)((0,t.unref)(ube),{class:`chat-input-info-alert__icon`}),(0,t.createElementVNode)(`span`,lIt,(0,t.toDisplayString)(e.content),1)]))}}),O9=`others`,dIt=e=>e<26?String.fromCharCode(65+e):String(e+1),fIt=e=>{let n=(0,t.computed)(()=>e()?.metadata?.questions??[]),r=(0,t.shallowRef)({}),i=e=>r.value[e],a=(e,t)=>{r.value={...r.value,[e]:t}},o=(0,t.computed)(()=>n.value.length),s=(0,t.computed)(()=>n.value.reduce((e,t,n)=>e+ +!!r.value[n],0)),l=(0,t.computed)(()=>o.value>0&&s.value===o.value),u=()=>n.value.map((e,t)=>r.value[t]??{question:e.question,answer:[]});return{questions:n,answeredCount:s,totalCount:o,completed:l,getAnswer:i,setAnswer:a,buildResolvePayload:()=>({interruptId:e()?.id??``,reason:wu.UserQuestion,status:`resolved`,payload:{answers:u()}}),buildSkipPayload:()=>pIt(e())}},pIt=e=>({interruptId:e?.id??``,reason:wu.UserQuestion,status:`cancelled`,payload:{answers:[]}}),mIt={class:`ai-user-question-answered`},hIt={class:`ai-user-question-answered__header`},gIt={class:`ai-user-question-answered__title-wrap`},_It={class:`ai-user-question-answered__title`},vIt={class:`ai-user-question-answered__status`},yIt={class:`ai-user-question-answered__body`},bIt={class:`ai-user-question-answered__question`},xIt={class:`ai-user-question-answered__question-text`},SIt={key:0,class:`ai-user-question-answered__tag`},CIt=(0,t.defineComponent)({__name:`user-question-answered-card`,props:{answers:{},status:{default:`resolved`}},setup(e){let n=e,r=(0,t.computed)(()=>n.status===`cancelled`?Su(`已取消`):Su(`已回复`));return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,mIt,[(0,t.createElementVNode)(`header`,hIt,[(0,t.createElementVNode)(`div`,gIt,[(0,t.createVNode)((0,t.unref)(lbe),{class:`ai-user-question-answered__help-icon`}),(0,t.createElementVNode)(`span`,_It,(0,t.toDisplayString)((0,t.unref)(Su)(`回答内容`)),1)]),(0,t.createElementVNode)(`span`,vIt,(0,t.toDisplayString)(r.value),1)]),(0,t.createElementVNode)(`div`,yIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.answers,(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:i,class:`ai-user-question-answered__item`},[(0,t.createElementVNode)(`div`,bIt,[(0,t.createElementVNode)(`span`,xIt,(0,t.toDisplayString)(i+1)+`. `+(0,t.toDisplayString)(r.question),1),r.multiSelect===void 0?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,SIt,(0,t.toDisplayString)(r.multiSelect?(0,t.unref)(Su)(`多选`):(0,t.unref)(Su)(`单选`)),1))]),(0,t.createCommentVNode)(` 默认逐条回显选择题答案;业务方可覆盖此 slot 渲染自定义表单的回显 `),(0,t.renderSlot)(n.$slots,`answer`,(0,t.mergeProps)({ref_for:!0},{item:r,index:i,status:e.status}),()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.answer,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`p`,{key:n,class:`ai-user-question-answered__answer`},(0,t.toDisplayString)(e.description||e.label),1))),128))])]))),128))])]))}}),wIt={class:`ai-user-question-option__badge`},TIt=[`placeholder`,`value`],EIt={key:1,class:`ai-user-question-option__text`},DIt=(0,t.defineComponent)({__name:`user-question-option`,props:{option:{},othersText:{},selected:{type:Boolean}},emits:[`confirm`,`select`,`update:othersText`],setup(e,{emit:n}){let r=e,i=n,a=()=>{i(`select`)},o=()=>{r.selected||i(`select`)},s=e=>{let t=e.target.value;i(`update:othersText`,t),r.selected||i(`select`)};return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ai-user-question-option`,{"ai-user-question-option--selected":e.selected,"ai-user-question-option--others":e.option.isOthers}]),onClick:a},[(0,t.createElementVNode)(`span`,wIt,(0,t.toDisplayString)(e.option.letter),1),(0,t.createCommentVNode)(` Others:自定义输入 `),e.option.isOthers?((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:0,class:`ai-user-question-option__input`,placeholder:(0,t.unref)(Su)(`请输入...`),value:e.othersText,onClick:r[0]||=(0,t.withModifiers)(()=>{},[`stop`]),onFocus:o,onInput:s,onKeydown:r[1]||=(0,t.withKeys)((0,t.withModifiers)(e=>i(`confirm`),[`stop`]),[`enter`])},null,40,TIt)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,EIt,(0,t.toDisplayString)(e.option.description),1))],2))}}),OIt={class:`ai-user-question-choice`},kIt=(0,t.defineComponent)({__name:`user-question-choice`,props:{question:{}},emits:[`answer`,`confirm`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.shallowRef)([]),o=(0,t.shallowRef)(``),s=(0,t.computed)(()=>{let e=(r.question.options??[]).filter(e=>e.label!==O9).map((e,t)=>({...e,isOthers:!1,letter:dIt(t)}));return e.push({label:O9,description:``,isOthers:!0,letter:dIt(e.length)}),e}),l=(0,t.computed)(()=>s.value.findIndex(e=>e.isOthers)),u=e=>a.value.includes(e),d=(0,t.computed)(()=>a.value.length?l.value>=0&&a.value.includes(l.value)?o.value.trim().length>0:!0:!1),f=()=>({question:r.question.question,multiSelect:r.question.multiSelect,answer:a.value.map(e=>{let t=s.value[e];return t?.isOthers?{label:O9,description:o.value.trim()}:{label:t?.label??``,description:t?.description??``}})}),p=()=>i(`answer`,d.value?f():void 0),m=e=>{let t=a.value;a.value=r.question.multiSelect?t.includes(e)?t.filter(t=>t!==e):[...t,e]:[e],p()},h=e=>{o.value=e,p()};return(0,t.watch)(()=>r.question,()=>{a.value=[],o.value=``,p()}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,OIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s.value,(e,r)=>((0,t.openBlock)(),(0,t.createBlock)(DIt,{key:r,option:e,"others-text":o.value,selected:u(r),onConfirm:n[0]||=e=>i(`confirm`),onSelect:e=>m(r),"onUpdate:othersText":h},null,8,[`option`,`others-text`,`selected`,`onSelect`]))),128))]))}}),AIt={class:`ai-user-question-card__title-wrap`},jIt={class:`ai-user-question-card__title`},MIt={class:`ai-user-question-card__counter-wrap`},NIt={class:`ai-user-question-card__counter`},PIt={class:`ai-user-question-card__body`},FIt={class:`ai-user-question-card__question-title`},IIt={class:`ai-user-question-card__question-text`},LIt={key:0,class:`ai-user-question-card__tag`},RIt={class:`ai-user-question-card__options`},zIt={class:`ai-user-question-card__footer`},BIt=(0,t.defineComponent)({__name:`user-question-card`,props:{interrupt:{},onResume:{type:Function}},setup(e){let n=e,r=Vu(),i=(0,t.shallowRef)(!1),{questions:a,answeredCount:o,totalCount:s,completed:l,getAnswer:u,setAnswer:d,buildResolvePayload:f,buildSkipPayload:p}=fIt(()=>n.interrupt),m=(0,t.computed)(()=>n.interrupt.metadata?.questions?.[0]?.header||n.interrupt.message||``),h=()=>{i.value=!i.value},g=()=>{i.value&&=!1},_=(0,t.shallowRef)(null),v=()=>{!l.value||_.value!==null||(_.value=`complete`,n.onResume?.(f(),n.interrupt))},y=()=>{_.value===null&&(_.value=`skip`,n.onResume?.(p(),n.interrupt))};return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{class:(0,t.normalizeClass)([`ai-user-question-card`,{"ai-user-question-card--collapsed":i.value}])},[(0,t.createElementVNode)(`header`,{class:`ai-user-question-card__header`,onClick:g},[(0,t.createElementVNode)(`div`,AIt,[(0,t.createVNode)((0,t.unref)(lbe),{class:`ai-user-question-card__help-icon`}),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,jIt,[(0,t.createTextVNode)((0,t.toDisplayString)(m.value),1)])),[[(0,t.unref)(Hu),{...(0,t.unref)(r)}]]),(0,t.createCommentVNode)(` <span
|
|
3491
3491
|
v-if="isCollapsed"
|
|
3492
3492
|
class="ai-user-question-card__tag"
|
|
3493
3493
|
>
|
|
3494
3494
|
{{ headerSelectText }}
|
|
3495
|
-
</span> `)]),(0,t.createElementVNode)(`div`,MIt,[(0,t.createElementVNode)(`span`,NIt,(0,t.toDisplayString)((0,t.unref)(o))+` / `+(0,t.toDisplayString)((0,t.unref)(s)),1),(0,t.createVNode)((0,t.unref)(Zye),{class:`ai-user-question-card__arrow`,style:(0,t.normalizeStyle)({transform:i.value?`rotate(180deg)`:`rotate(-90deg)`}),onClick:(0,t.withModifiers)(h,[`stop`])},null,8,[`style`])])]),(0,t.createCommentVNode)(` 折叠用 v-show 而非 v-if:保留 UserQuestionChoice 及自定义 slot 的勾选态,避免卸载丢失选中 `),(0,t.withDirectives)((0,t.createElementVNode)(`div`,PIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(a),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:r,class:`ai-user-question-card__question`},[(0,t.createElementVNode)(`div`,FIt,[(0,t.createElementVNode)(`span`,IIt,(0,t.toDisplayString)(r+1)+`. `+(0,t.toDisplayString)(n.question),1),n.multiSelect===void 0?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,LIt,(0,t.toDisplayString)(n.multiSelect?(0,t.unref)(Su)(`多选`):(0,t.unref)(Su)(`单选`)),1))]),(0,t.createElementVNode)(`div`,RIt,[(0,t.createCommentVNode)(` 默认渲染选择题;业务方可覆盖此 slot 渲染任意表单,作答有效时通过 setAnswer 回传 `),(0,t.renderSlot)(e.$slots,`question`,(0,t.mergeProps)({ref_for:!0},{question:n,qIndex:r,answer:(0,t.unref)(u)(r),setAnswer:e=>(0,t.unref)(d)(r,e),confirm:_}),()=>[(0,t.createVNode)(kIt,{question:n,onAnswer:e=>(0,t.unref)(d)(r,e),onConfirm:_},null,8,[`question`,`onAnswer`])])])]))),128))],512),[[t.vShow,!i.value]]),(0,t.withDirectives)((0,t.createElementVNode)(`footer`,zIt,[(0,t.createVNode)((0,t.unref)(Go),{class:`ai-user-question-card__complete`,disabled:!(0,t.unref)(l),size:`small`,theme:`primary`,onClick:_},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(dbe),{class:`ai-user-question-card__enter-icon`}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(Su)(`完成`)),1)]),_:1},8,[`disabled`]),(0,t.createVNode)((0,t.unref)(Go),{class:`ai-user-question-card__skip`,size:`small`,text:``,onClick:v},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(fbe),{class:`ai-user-question-card__skip-icon`}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(Su)(`跳过`)),1)]),_:1})],512),[[t.vShow,!i.value]])],2))}}),VIt={class:`ai-delete-confirm`},HIt={class:`ai-delete-confirm__title`},UIt={class:`ai-delete-confirm__desc`},WIt={class:`ai-delete-confirm__actions`},GIt=(0,t.defineComponent)({__name:`delete-tool`,props:{description:{},id:{},name:{},disabled:{type:Boolean},tippyOptions:{}},emits:[`confirm`,`cancel`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.useTemplateRef)(`tippyRef`),o=(0,t.computed)(()=>({id:r.id,name:r.name,description:r.description,disabled:r.disabled,tippyOptions:r.tippyOptions})),s=(0,t.computed)(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...r.tippyOptions||{}})),l=()=>{if(r.disabled)return!1},u=()=>{a.value?.hide?.()},d=()=>{u(),i(`confirm`)},f=()=>{u(),i(`cancel`)};return(0,t.onUnmounted)(()=>{u()}),(e,n)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(mu),(0,t.mergeProps)({ref_key:`tippyRef`,ref:a},s.value,{onShow:l}),{content:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,VIt,[(0,t.createElementVNode)(`div`,HIt,(0,t.toDisplayString)((0,t.unref)(Su)(`确认删除该回答?`)),1),(0,t.createElementVNode)(`div`,UIt,(0,t.toDisplayString)((0,t.unref)(Su)(`删除操作无法撤回,请谨慎操作!`)),1),(0,t.createElementVNode)(`div`,WIt,[(0,t.createVNode)((0,t.unref)(Go),{size:`small`,theme:`danger`,onClick:d},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Su)(`删除`)),1)]),_:1}),(0,t.createVNode)((0,t.unref)(Go),{size:`small`,onClick:f},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Su)(`取消`)),1)]),_:1})])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(Uu,(0,t.normalizeProps)((0,t.guardReactiveProps)(o.value)),null,16)]),_:1},16))}}),KIt={class:`ai-feedback-title`},qIt={class:`ai-feedback-reason-list`},JIt=[`onClick`],YIt={class:`ai-feedback-other`},XIt={class:`ai-feedback-footer`},ZIt=(0,t.defineComponent)({__name:`user-feedback`,props:{loading:{type:Boolean},reasonList:{},title:{}},emits:[`submit`,`cancel`],setup(e,{emit:n}){let r=n,i=(0,t.shallowRef)(``),a=(0,t.shallowRef)([]),o=e=>{a.value.includes(e)?a.value=a.value.filter(t=>t!==e):a.value=[...a.value,e]},s=()=>{r(`submit`,a.value,i.value)},l=()=>{a.value=[],i.value=``,r(`cancel`)};return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`ai-user-feedback`,onMouseenter:r[1]||=(0,t.withModifiers)(()=>{},[`stop`,`prevent`])},[(0,t.createElementVNode)(`div`,KIt,(0,t.toDisplayString)(e.title),1),(0,t.createElementVNode)(`div`,qIt,[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(8,e=>(0,t.createElementVNode)(`div`,{key:e,class:`reason-item ai-skeleton-element`})),64)):((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(e.reasonList,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e,class:(0,t.normalizeClass)([`reason-item`,{"is-active":a.value.includes(e)}]),onClick:t=>o(e)},(0,t.toDisplayString)(e),11,JIt))),128))]),(0,t.createElementVNode)(`div`,YIt,[(0,t.createVNode)((0,t.unref)(ns),{modelValue:i.value,"onUpdate:modelValue":r[0]||=e=>i.value=e,placeholder:(0,t.unref)(Su)(`说出您的想法`),rows:3,type:`textarea`},null,8,[`modelValue`,`placeholder`])]),(0,t.createElementVNode)(`div`,XIt,[(0,t.createVNode)((0,t.unref)(Go),{class:`custom-btn`,disabled:!i.value&&a.value.length===0,size:`small`,theme:`primary`,onClick:s},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Su)(`提交`)),1)]),_:1},8,[`disabled`]),(0,t.createVNode)((0,t.unref)(Go),{class:`custom-btn`,size:`small`,width:`80px`,onClick:l},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Su)(`取消`)),1)]),_:1})])],32))}}),QIt={ref:`messageToolsRef`,class:`message-tools-container`},$It={class:`message-tools`,style:{"margin-right":`8px`}},eLt={key:0,class:`ai-divider`,style:{"margin-right":`8px`}},tLt={class:`message-tools`},nLt=(0,t.defineComponent)({__name:`message-tools`,props:{messageTools:{default:()=>Cye},messageToolsStatus:{},onAction:{},tippyOptions:{},updateTools:{default:()=>Tye}},emits:[`feedback`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.useTemplateRef)(`feedbackTippyRef`),o=(0,t.shallowRef)(!1),s=(0,t.shallowRef)([]),l=(0,t.shallowRef)(null),u=(0,t.computed)(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...r.tippyOptions||{}})),d=async e=>{if(e.id===`like`||e.id===`unlike`){try{o.value=!0,s.value=[],s.value=await r.onAction?.(e)||[]}finally{o.value=!1}return}await r.onAction?.(e)},f=async e=>{await r.onAction?.(e)},p=()=>{a.value?.forEach(e=>e?.hide?.())},m=e=>l.value?l.value===`like`&&e===`like`?`activeLike`:l.value===`unlike`&&e===`unlike`?`activeUnLike`:e:e,h=e=>{let t=m(e);return t===`activeLike`?Su(`取消满意`):t===`activeUnLike`?Su(`取消不满意`):r.updateTools?.find(e=>e.id===t)?.description||``},g=(e,t,n)=>{p(),l.value===e.id?l.value=null:l.value=e.id,i(`feedback`,e,t,n)},_=e=>{if(r.messageToolsStatus===E9.Disabled)return!1;if(l.value&&l.value===e)return l.value=null,!1};return(0,t.onUnmounted)(()=>{p(),s.value=[]}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,QIt,[(0,t.createElementVNode)(`div`,$It,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.messageTools,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.id},[n.id===`delete`?((0,t.openBlock)(),(0,t.createBlock)(GIt,(0,t.mergeProps)({key:0,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(E9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>f(n)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):((0,t.openBlock)(),(0,t.createBlock)(Uu,(0,t.mergeProps)({key:1,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(E9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>d(n)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))]),e.updateTools.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,eLt)):(0,t.createCommentVNode)(`v-if`,!0),(0,t.createElementVNode)(`div`,tLt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.updateTools,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.id},[n.id===`like`||n.id===`unlike`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(mu),(0,t.mergeProps)({key:0,ref_for:!0,ref_key:`feedbackTippyRef`,ref:a},{ref_for:!0},u.value,{onShow:e=>_(n.id)}),{content:(0,t.withCtx)(()=>[(0,t.createVNode)(ZIt,{loading:o.value,"reason-list":s.value,title:n.id===`like`?(0,t.unref)(Su)(`什么原因让你满意?`):(0,t.unref)(Su)(`什么原因让你不满意?`),onCancel:p,onSubmit:(e,t)=>g(n,e,t)},null,8,[`loading`,`reason-list`,`title`,`onSubmit`])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(Uu,(0,t.mergeProps)({ref_for:!0},n,{id:m(n.id),active:l.value===n.id,disabled:e.messageToolsStatus===(0,t.unref)(E9).Disabled,"tippy-options":{...e.tippyOptions,content:h(n.id)},onClick:e=>d(n)}),null,16,[`id`,`active`,`disabled`,`tippy-options`,`onClick`])]),_:2},1040,[`onShow`])):n.id===`delete`?((0,t.openBlock)(),(0,t.createBlock)(GIt,(0,t.mergeProps)({key:1,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(E9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>f(n)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):((0,t.openBlock)(),(0,t.createBlock)(Uu,(0,t.mergeProps)({key:2,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(E9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>d(n)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))])],512))}}),k9=(0,t.defineComponent)({name:`HighlightKeyword`,props:{text:{type:String,required:!0}},setup(e){let n=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=wxe(),i=(0,t.computed)(()=>{if(!e.text||!r?.value)return e.text;let i=r.value.trim();if(!i)return e.text;let a=RegExp(`(${n(i)})`,`ig`),o=e.text?.toString().split(a);return o.length<=1?e.text:o.map(e=>a.test(e)?(0,t.h)(`span`,{class:Dye},e):e)});return()=>(0,t.h)(`span`,i.value)}}),rLt={class:`ai-activity-message`},iLt={class:`ai-activity-message-content`},A9=(0,t.defineComponent)({__name:`activity-layout`,props:(0,t.mergeModels)({activityType:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=(0,t.useModel)(e,`collapsed`);return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,rLt,[(0,t.createElementVNode)(`div`,{class:`ai-activity-message-title`,onClick:i[0]||=e=>n.value=!n.value},[(0,t.renderSlot)(r.$slots,`title`,(0,t.normalizeProps)((0,t.guardReactiveProps)({collapsed:n.value}))),e.activityType===(0,t.unref)(Tu).FlowAgent?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:(0,t.normalizeClass)([`ai-activity-message-title-icon collapsed-icon`,{"is-collapsed":n.value}])},[(0,t.createVNode)((0,t.unref)(Pu))],2))]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,iLt,[(0,t.renderSlot)(r.$slots,`default`)],512),[[t.vShow,!n.value]])]))}}),j9=[{color:`#3A84FF`,icon:null,key:`running`,label:Su(`执行中`),rawStates:[`CREATED`,`LOOP_READY`,`READY`,`RUNNING`,`BLOCKED`,`ROLLING_BACK`,`ROLL_BACK_SUCCESS`]},{color:`#65C389`,icon:Rye,key:`success`,label:Su(`成功`),rawStates:[`FINISHED`]},{color:`#EA3636`,icon:zye,key:`failed`,label:Su(`失败`),rawStates:[`FAILED`,`REVOKED`,`ROLL_BACK_FAILED`]},{color:`#F59500`,icon:Bye,key:`suspended`,label:Su(`挂起`),rawStates:[`SUSPENDED`]},{color:`#4D4F56`,dotColor:`#DCDEE5`,icon:Vye,key:`pending`,label:Su(`待执行`),rawStates:[`PENDING`]},{color:`#5B7290`,icon:Hye,key:`skipped`,label:Su(`跳过`),rawStates:[`SKIPPED`]}],M9=Object.fromEntries(j9.map(e=>[e.key,e])),aLt=Object.fromEntries(j9.flatMap(e=>e.rawStates.map(t=>[t,e.key]))),N9=e=>aLt[e]??`running`,oLt=e=>M9[e].dotColor??M9[e].color,sLt=e=>{let n=M9[e].icon;return n?(0,t.cloneVNode)(n):null},cLt=e=>{let n=(0,t.computed)(()=>Array.isArray(e.value)?e.value:[e.value??{}]),r=(0,t.shallowRef)({}),i=e=>r.value[e.task_id]!==!1;return{isTaskExpanded:i,taskList:n,toggleTaskExpanded:e=>{r.value={...r.value,[e.task_id]:!i(e)}},viewTasks:(0,t.computed)(()=>n.value.map(e=>{let t=Object.values(e.nodes??{}).map(e=>{let t=N9(e.state);return{convergedState:t,dotColor:oLt(t),elapsedTimeText:gye(e.elapsed_time),id:e.id,name:e.name,raw:e,retryable:!!e.retryable,skippable:!!e.skippable}}),n=t.reduce((e,t)=>e+t.raw.elapsed_time,0),r=N9(e.task_state??``);return{convergedState:r,hasConfidence:!!e.has_confidence,confidenceTitle:e.confidence_title,isActive:!!e.is_active,nodes:t,raw:e,stateIcon:sLt(r),taskId:e.task_id,taskName:e.task_name,totalTimeText:gye(n)}})),visibleStats:(0,t.computed)(()=>{let e={};for(let t of j9)e[t.key]=0;for(let t of n.value)for(let[n,r]of Object.entries(t.statistics?.state_counts??{}))e[N9(n)]+=r;return j9.filter(t=>e[t.key]>0).map(t=>({color:t.color,display:e[t.key]>99?`99+`:String(e[t.key]),dotColor:oLt(t.key),key:t.key,label:t.label}))})}},lLt=[{icon:wbe,id:Ou.FlowNodeRetry,label:()=>Su(`重试`),visible:e=>e.convergedState===`failed`&&e.retryable},{icon:fbe,id:Ou.FlowNodeSkip,label:()=>Su(`跳过`),visible:e=>e.convergedState===`failed`&&e.skippable}],uLt=e=>{let{onInterruptResume:t,openNodeDetail:n}=e,r=(e,n,r)=>{t.value?.({payload:{node_id:r.id,task_id:n.task_id},operation:e})};return{getNodeActions:(e,t)=>{let i=lLt.filter(e=>e.visible(t)).map(n=>({icon:n.icon,id:n.id,label:n.label(),run:()=>r(n.id,e.raw,t.raw)}));return i.push({icon:Nu,id:`detail`,label:Su(`详情`),run:()=>n(e.raw,t.raw)}),i}}},dLt={class:`ai-detail-section`},fLt={class:`section-heading`},pLt={class:`section-text`},P9=(0,t.defineComponent)({__name:`detail-section`,props:{title:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,dLt,[(0,t.createElementVNode)(`div`,fLt,[r[0]||=(0,t.createElementVNode)(`span`,{class:`section-bar`},null,-1),(0,t.createElementVNode)(`span`,pLt,(0,t.toDisplayString)(e.title),1)]),(0,t.renderSlot)(n.$slots,`default`)]))}}),mLt={class:`ai-simple-table`},hLt={key:0},gLt=[`colspan`],F9=(0,t.defineComponent)({__name:`simple-table`,props:{columns:{},data:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`table`,mLt,[(0,t.createElementVNode)(`thead`,null,[(0,t.createElementVNode)(`tr`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.columns,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`th`,{key:e.key},(0,t.toDisplayString)(e.label),1))),128))])]),(0,t.createElementVNode)(`tbody`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.data,(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,{key:r},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.columns,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`td`,{key:e.key,class:(0,t.normalizeClass)({"is-break-all":e.breakAll})},(0,t.toDisplayString)(n[e.key]??`--`),3))),128))]))),128)),e.data.length?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,hLt,[(0,t.createElementVNode)(`td`,{class:`is-empty`,colspan:e.columns.length},` -- `,8,gLt)]))])]))}}),_Lt={class:`flow-agent-node-detail`},vLt={class:`detail-title`},yLt={key:1,class:`detail-title-content`},bLt={class:`detail-tab-bar`},xLt=[`onClick`],SLt={class:`detail-body`},CLt={class:`skeleton-section`},wLt={class:`skeleton-section`},TLt={class:`info-form`},ELt={class:`info-label`},DLt={class:`info-value`},OLt={class:`info-row`},kLt={class:`info-label`},ALt={class:`info-value`},jLt={key:0,class:`failure-item`},MLt={key:1,class:`failure-item`},NLt={class:`info-row`},PLt={class:`info-label`},FLt={class:`info-value`},ILt={key:0,class:`skeleton-section`},I9=function(e){return e.Config=`config`,e.Output=`output`,e}(I9||{}),LLt=(0,t.defineComponent)({__name:`flow-agent-node-detail`,props:{data:{},has_confidence:{type:Boolean},loading:{type:Boolean},node_id:{},node_name:{},task_id:{},task_name:{}},setup(e){let n=[{key:I9.Config,label:Su(`节点配置`)},{key:I9.Output,label:Su(`节点输出`)}],r=[{key:`key`,label:Su(`参数名`)},{breakAll:!0,key:`value`,label:Su(`参数值`)}],i=[{key:`name`,label:Su(`名称`)},{key:`description`,label:Su(`变量说明`)},{key:`key`,label:`KEY`}],a=[{key:`key`,label:Su(`参数名`)},{breakAll:!0,key:`value`,label:Su(`参数值`)}],o={forced_fail:xu?`Force Fail`:`强制失败`},s=e,l=(0,t.shallowRef)(I9.Config),u=(0,t.computed)(()=>s.data?.basic_info),d=(0,t.computed)(()=>{let e=u.value;return e?[{label:Su(`流程模板`),value:e.template_name||`--`},{label:Su(`节点名称`),value:e.node_name||`--`},{label:Su(`步骤名称`),value:e.stage_name||`--`},{label:Su(`是否可选`),value:e.optional?Su(`是`):Su(`否`)}]:[]}),f=(0,t.computed)(()=>{let e=u.value;return e?.skippable||e?.auto_retry?.enable}),p=(0,t.computed)(()=>{let e=u.value?.auto_retry;return e?.enable?xu?`In ${e.interval} seconds, auto retry ${e.times} times`:`在 ${e.interval} 秒后,自动重试 ${e.times} 次`:``}),m=(0,t.computed)(()=>{let e=u.value?.timeout_config;if(!e?.enable)return`--`;let t=o[e.action]??e.action;return xu?`Timeout ${e.seconds} seconds later, ${t}`:`超时 ${e.seconds} 秒后则${t}`}),h=(0,t.computed)(()=>Object.entries(s.data?.inputs??{}).map(([e,t])=>({key:e,value:v(t)}))),g=(0,t.computed)(()=>(s.data?.plugin_output??[]).map(e=>({description:e.schema?.description||`--`,name:e.name,key:e.key}))),_=(0,t.computed)(()=>(s.data?.outputs??[]).map(e=>({key:e.key,value:v(e.value)}))),v=e=>e==null?`--`:typeof e==`object`?JSON.stringify(e):String(e);return(o,s)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_Lt,[(0,t.createElementVNode)(`h3`,vLt,[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(Su)(`节点`))+`:`,1),s[0]||=(0,t.createElementVNode)(`span`,{class:`skeleton-title ai-skeleton-element`},null,-1)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,yLt,(0,t.toDisplayString)((0,t.unref)(Su)(`节点`))+`:`+(0,t.toDisplayString)(u.value?.node_name),1)),(0,t.renderSlot)(o.$slots,`locateButton`)]),(0,t.createElementVNode)(`div`,bLt,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(n,e=>(0,t.createElementVNode)(`div`,{key:e.key,class:(0,t.normalizeClass)([`detail-tab`,{"is-active":l.value===e.key}]),onClick:t=>l.value=e.key},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.key===I9.Config?(0,t.unref)(Wye):(0,t.unref)(Nu)),{class:`detail-tab-icon`})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.label),1)],10,xLt)),64))]),(0,t.createElementVNode)(`div`,SLt,[l.value===I9.Config?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`div`,CLt,[s[1]||=(0,t.createElementVNode)(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(6,e=>(0,t.createElementVNode)(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))]),(0,t.createElementVNode)(`div`,wLt,[s[2]||=(0,t.createElementVNode)(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(4,e=>(0,t.createElementVNode)(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createVNode)(P9,{title:(0,t.unref)(Su)(`基础信息`)},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,TLt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(d.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.label,class:`info-row`},[(0,t.createElementVNode)(`div`,ELt,(0,t.toDisplayString)(e.label),1),(0,t.createElementVNode)(`div`,DLt,(0,t.toDisplayString)(e.value),1)]))),128)),(0,t.createElementVNode)(`div`,OLt,[(0,t.createElementVNode)(`div`,kLt,(0,t.toDisplayString)((0,t.unref)(Su)(`失败处理`)),1),(0,t.createElementVNode)(`div`,ALt,[f.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[u.value?.skippable?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,jLt,[s[3]||=(0,t.createElementVNode)(`span`,{class:`tag-badge`},`MS`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(Su)(`手动跳过`))+(0,t.toDisplayString)(u.value?.auto_retry?.enable?`;`:``),1)])):(0,t.createCommentVNode)(`v-if`,!0),u.value?.auto_retry?.enable?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,MLt,[s[4]||=(0,t.createElementVNode)(`span`,{class:`tag-badge`},`AR`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(p.value),1)])):(0,t.createCommentVNode)(`v-if`,!0)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createTextVNode)(`--`)],64))])]),(0,t.createElementVNode)(`div`,NLt,[(0,t.createElementVNode)(`div`,PLt,(0,t.toDisplayString)((0,t.unref)(Su)(`超时控制`)),1),(0,t.createElementVNode)(`div`,FLt,(0,t.toDisplayString)(m.value),1)])])]),_:1},8,[`title`]),(0,t.createVNode)(P9,{title:(0,t.unref)(Su)(`输入参数`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(F9,{columns:r,data:h.value},null,8,[`data`])]),_:1},8,[`title`]),(0,t.createVNode)(P9,{title:(0,t.unref)(Su)(`输出参数`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(F9,{columns:i,data:g.value},null,8,[`data`])]),_:1},8,[`title`])],64))],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ILt,[s[5]||=(0,t.createElementVNode)(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(5,e=>(0,t.createElementVNode)(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])):((0,t.openBlock)(),(0,t.createBlock)(P9,{key:1,title:(0,t.unref)(Su)(`结构化输出`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(F9,{columns:a,data:_.value},null,8,[`data`])]),_:1},8,[`title`]))],64))])]))}}),L9=e=>e.task_id==null?``:`${e.task_id}`,R9=L9,z9=(e,t)=>e.task_id==null?``:`${e.task_id}|${t.id}|${t.name}`,RLt=e=>{let{messageUid:n,taskList:r}=e,i=ixe(),a=exe(),o=(0,t.computed)(()=>i.selectedTab.value?.name??``),s=(0,t.shallowRef)(!1),l=()=>{s.value=!0},u=(0,t.computed)(()=>{if(s.value)return o.value;let e=r.value.find(e=>e.is_active);return e?.task_id==null?o.value:L9(e)}),d=e=>{let t=u.value;return t===L9(e)||t===R9(e)},f=(e,t)=>u.value===z9(e,t),p=(e,t)=>{let r=e.task_id;r!=null&&(l(),i.addCustomTab?.({label:t.name,name:z9(e,t),data:{component:LLt,messageUid:n.value,props:{data:{},loading:!0,node_id:t.id,node_name:t.name,task_id:r,task_name:e.task_name}}}))},m=e=>{let t=e?.task_id;t&&(l(),i.addCustomTab?.({label:Su(`有效证据`),name:R9(e),data:{component:LLt,messageUid:n.value,props:{data:{},has_confidence:e.has_confidence,loading:!0,task_id:t,task_name:e.task_name}}}))};return(0,t.watch)(o,(e,t)=>{t!==void 0&&l()}),(0,t.onMounted)(()=>{a?.value&&m(r.value.find(e=>e.is_active&&e.has_confidence))}),(0,t.onUnmounted)(()=>{if(a?.value)for(let e of r.value){i.removeCustomTab?.(L9(e)),i.removeCustomTab?.(R9(e));for(let t of Object.values(e.nodes??{}))i.removeCustomTab?.(z9(e,t))}}),{displaySelectedTabName:u,isNodeSelected:f,isTaskSelected:d,markUserTabSelection:l,openConfidence:m,openNodeDetail:p}},zLt={class:`ai-activity-message-title-text`},BLt={class:`flow-agent-title-label`},VLt={class:`flow-agent-stat-tooltip`},HLt={class:`flow-agent-stat-tooltip-status`},ULt={class:`flow-agent-stat-tooltip-label`},WLt=[`onClick`],GLt={class:`flow-agent-task-state-icon`},KLt={class:`flow-agent-task-name`},qLt={key:0,class:`flow-agent-task-trailing`},JLt={class:`flow-agent-task-time`},YLt=[`onClick`],XLt={class:`flow-agent-task-nodes`},ZLt={class:`flow-agent-node-status`},QLt=[`title`],$Lt={key:0,class:`flow-agent-node-trailing`},eRt={class:`flow-agent-node-time`},tRt={class:`flow-agent-node-actions`},nRt=[`onClick`],rRt=(0,t.defineComponent)({__name:`flow-agent-content`,props:(0,t.mergeModels)({content:{},messageUid:{},onInterruptResume:{type:Function},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=Vu(),i=(0,t.useModel)(e,`collapsed`),a=Sxe(),o=(0,t.computed)(()=>a.value!==ku.Share),s=(0,t.computed)(()=>n.status===Du.Pending||n.status===Du.Streaming),{isTaskExpanded:l,taskList:u,toggleTaskExpanded:d,viewTasks:f,visibleStats:p}=cLt((0,t.toRef)(n,`content`)),{isNodeSelected:m,isTaskSelected:h,openConfidence:g,openNodeDetail:_}=RLt({messageUid:(0,t.toRef)(n,`messageUid`),taskList:u}),{getNodeActions:v}=uLt({onInterruptResume:(0,t.toRef)(n,`onInterruptResume`),openNodeDetail:_});return(e,n)=>((0,t.openBlock)(),(0,t.createBlock)(A9,{collapsed:i.value,"onUpdate:collapsed":n[0]||=e=>i.value=e,"activity-type":(0,t.unref)(Tu).FlowAgent,class:`flow-agent-activity`},{title:(0,t.withCtx)(()=>[(0,t.createCommentVNode)(` hover 整条执行情况栏展示统计 tooltip(设计稿 annotation) `),(0,t.createVNode)((0,t.unref)(mu),(0,t.mergeProps)({class:`flow-agent-title-bar`,theme:`ai-chat-box-light light`},{...(0,t.unref)(r),tag:`div`,arrow:!0,followCursor:!1,offset:[0,10]}),{content:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,VLt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(p),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.key,class:`flow-agent-stat-tooltip-item`},[(0,t.createElementVNode)(`span`,HLt,[e.key===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`flow-agent-stat-dot`,style:(0,t.normalizeStyle)({borderColor:e.dotColor})},null,4))]),(0,t.createElementVNode)(`span`,ULt,(0,t.toDisplayString)(e.label)+`:`,1),(0,t.createElementVNode)(`span`,{class:`flow-agent-stat-tooltip-count`,style:(0,t.normalizeStyle)({color:e.color})},(0,t.toDisplayString)(e.display),5)]))),128))])]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`ai-activity-message-title-icon`,{"icon-collapsed":i.value}])},[s.value?((0,t.openBlock)(),(0,t.createBlock)(Iu,{key:0,size:12})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Mu),{key:1}))],2),(0,t.createElementVNode)(`span`,zLt,[(0,t.createElementVNode)(`span`,BLt,(0,t.toDisplayString)((0,t.unref)(Su)(`执行情况`))+`:`,1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(p),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e.key,class:`flow-agent-stat-item`},[e.key===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,class:`flow-agent-stat-loading`,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`flow-agent-stat-dot`,style:(0,t.normalizeStyle)({borderColor:e.dotColor})},null,4)),(0,t.createElementVNode)(`span`,{class:`flow-agent-stat-count`,style:(0,t.normalizeStyle)({color:e.color})},(0,t.toDisplayString)(e.display),5)]))),128))])]),_:1},16)]),default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(f),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.taskId,class:`flow-agent-task-group`},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`flow-agent-task-header`,{"has-confidence":e.hasConfidence,"is-selected":(0,t.unref)(h)(e.raw)}])},[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`flow-agent-task-arrow`,{"is-expanded":(0,t.unref)(l)(e.raw)}]),onClick:(0,t.withModifiers)(n=>(0,t.unref)(d)(e.raw),[`stop`])},[(0,t.createVNode)((0,t.unref)(Mu))],10,WLt),(0,t.createElementVNode)(`span`,GLt,[e.convergedState===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.stateIcon),{key:1}))]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,KLt,[(0,t.createVNode)((0,t.unref)(k9),{text:e.taskName},null,8,[`text`])])),[[(0,t.unref)(Hu),{...(0,t.unref)(r)}]]),o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,qLt,[(0,t.createElementVNode)(`span`,JLt,(0,t.toDisplayString)(e.totalTimeText),1),e.hasConfidence?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:`flow-agent-task-action-btn flow-agent-task-confidence-btn`,onClick:(0,t.withModifiers)(n=>(0,t.unref)(g)(e.raw),[`stop`])},[(0,t.createVNode)((0,t.unref)(Nu)),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.confidenceTitle??(0,t.unref)(Su)(`有效证据`)),1)],8,YLt)):(0,t.createCommentVNode)(`v-if`,!0)])):(0,t.createCommentVNode)(`v-if`,!0)],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,XLt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.nodes,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n.id,class:(0,t.normalizeClass)([`flow-agent-node-item`,{"is-selected":(0,t.unref)(m)(e.raw,n.raw)}])},[(0,t.createElementVNode)(`span`,ZLt,[n.convergedState===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`flow-agent-status-dot`,style:(0,t.normalizeStyle)({borderColor:n.dotColor})},null,4))]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{class:`flow-agent-node-name`,title:n.name},[(0,t.createVNode)((0,t.unref)(k9),{text:n.name},null,8,[`text`])],8,QLt)),[[(0,t.unref)(Hu),{...(0,t.unref)(r)}]]),o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,$Lt,[(0,t.createElementVNode)(`span`,eRt,(0,t.toDisplayString)(n.elapsedTimeText),1),(0,t.createElementVNode)(`span`,tRt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(v)(e,n),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e.id,class:`flow-agent-node-action-btn`,onClick:(0,t.withModifiers)(t=>e.run(),[`stop`])},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon))),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.label),1)],8,nRt))),128))])])):(0,t.createCommentVNode)(`v-if`,!0)],2))),128))],512),[[t.vShow,(0,t.unref)(l)(e.raw)]])]))),128))]),_:1},8,[`collapsed`,`activity-type`]))}}),iRt={class:`ai-activity-message-title-icon`},aRt={class:`ai-activity-message-title-text`},oRt={class:`knowledge-rag-content`},sRt=(0,t.defineComponent)({__name:`knowledge-rag-content`,props:(0,t.mergeModels)({content:{},messageUid:{},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=(0,t.useModel)(e,`collapsed`),i=(0,t.computed)(()=>n.status===Du.Pending||n.status===Du.Streaming),a=(0,t.computed)(()=>i.value?Su(`检索中`):Su(`检索完成`));return(n,o)=>((0,t.openBlock)(),(0,t.createBlock)(A9,{collapsed:r.value,"onUpdate:collapsed":o[0]||=e=>r.value=e},{title:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,iRt,[i.value?((0,t.openBlock)(),(0,t.createBlock)(Iu,{key:0})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(ju),{key:1,style:{"font-size":`12px`}}))]),(0,t.createElementVNode)(`span`,aRt,(0,t.toDisplayString)(a.value),1)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,oRt,[(0,t.createVNode)(Z7,{content:e.content?.content||``},null,8,[`content`])]),(0,t.createVNode)(Q7,{content:e.content?.referenceDocument||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),cRt={class:`ai-activity-message-title-icon`},lRt={class:`ai-activity-message-title-text`},uRt=(0,t.defineComponent)({__name:`reference-doc-content`,props:(0,t.mergeModels)({content:{},messageUid:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=(0,t.useModel)(e,`collapsed`),i=(0,t.computed)(()=>{let e=n.content?.length??0;return xu?`Reference ${e} documents as reference`:`引用 ${e} 篇资料作为参考`});return(n,a)=>((0,t.openBlock)(),(0,t.createBlock)(A9,{collapsed:r.value,"onUpdate:collapsed":a[0]||=e=>r.value=e},{title:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,cRt,[(0,t.createVNode)((0,t.unref)(ju),{style:{"font-size":`12px`}})]),(0,t.createElementVNode)(`span`,lRt,(0,t.toDisplayString)(i.value),1)]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(Q7,{content:e.content||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),dRt=(0,t.defineComponent)({__name:`activity-message`,props:(0,t.mergeModels)({activityType:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{},onInterruptResume:{type:Function}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n={[Tu.FlowAgent]:rRt,[Tu.KnowledgeRag]:sRt,[Tu.ReferenceDocument]:uRt},r=e,i=(0,t.useModel)(e,`collapsed`),a=(0,t.computed)(()=>n[r.activityType??``]);return(n,r)=>a.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(a.value),{key:0,collapsed:i.value,"onUpdate:collapsed":r[0]||=e=>i.value=e,content:e.content,"message-uid":e.uid,"on-interrupt-resume":e.onInterruptResume,status:e.status},null,40,[`collapsed`,`content`,`message-uid`,`on-interrupt-resume`,`status`])):(0,t.createCommentVNode)(`v-if`,!0)}}),fRt={class:`toolcall-desc`},pRt={class:`desc-title`},mRt={class:`desc-panel`},hRt={class:`desc-label`},gRt={class:`desc-value`},B9=(0,t.defineComponent)({__name:`desc-panel`,props:{desc:{},title:{}},setup(e){let n=e,r=e=>e==null?``:typeof e==`object`?JSON.stringify(e):String(e),i=(0,t.computed)(()=>{try{return JSON.parse(n.desc||``)}catch{return n.desc}});return(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,fRt,[(0,t.createElementVNode)(`div`,pRt,(0,t.toDisplayString)(e.title),1),(0,t.createElementVNode)(`div`,mRt,[(0,t.createCommentVNode)(` null 的 typeof 为 object,需排除,避免 v-for 异常;键/值统一转字符串以满足 HighlightKeyword `),i.value!==null&&typeof i.value==`object`?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(i.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`desc-panel-item`},[(0,t.createElementVNode)(`span`,hRt,[(0,t.createVNode)((0,t.unref)(k9),{text:String(n)},null,8,[`text`]),a[0]||=(0,t.createTextVNode)(`:`,-1)]),(0,t.createElementVNode)(`span`,gRt,[(0,t.createVNode)((0,t.unref)(k9),{style:{"word-break":`break-all`},text:r(e)},null,8,[`text`])])]))),128)):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(k9),{key:1,style:{wordBreak:`break-all`},text:r(i.value)},null,8,[`text`]))])]))}}),_Rt={class:`tool-message`},vRt=(0,t.defineComponent)({__name:`tool-message`,props:{duration:{},error:{type:[Boolean,String]},toolCallId:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_Rt,[(0,t.createVNode)(B9,{desc:e.content||(typeof e.error==`string`?e.error:void 0),title:(0,t.unref)(Su)(`返回内容`)},null,8,[`desc`,`title`])]))}}),yRt={class:`ai-toolcall-render`},bRt={class:`toolcall-header-title`},xRt={class:`toolcall-status-title`},SRt={key:1,class:`toolcall-duration`},CRt={class:`ai-toolcall-render-content`},wRt=(0,t.defineComponent)({__name:`toolcall-render`,props:{duration:{},status:{},toolCall:{}},setup(e){let n=e,r=(0,t.shallowRef)(!0),i=(0,t.shallowRef)(null),a=Vu(),{keywordMatched:o,keyword:s}=Txe(()=>[n.toolCall?.function.name,n.toolCall?.function.mcpName,n.toolCall?.function.description,n.toolCall?.function.arguments,n.toolCall?.id]),l=(0,t.computed)(()=>i.value===null?s?.value?.trim()?!o.value:r.value:i.value);function u(){r.value=!l.value,i.value=r.value}let d=(0,t.computed)(()=>{let e=n.toolCall?.function.mcpName||``,t=n.toolCall?.function.name||n.toolCall?.id||``;return e?`${e} / ${t}`:t}),f=(0,t.computed)(()=>{switch(n.status){default:case Du.Pending:return Su(`调用中`);case Du.Complete:case Du.Success:return Su(`调用成功`);case Du.Error||n.toolCall?.toolMessage?.error:return Su(`调用失败`)}}),p=(0,t.computed)(()=>{let e=n.duration||n.toolCall?.toolMessage?.duration;return e?hye(e):``});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,yRt,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ai-toolcall-render-header`,`toolcall-status-${e.status}`]),onClick:u},[(0,t.createVNode)((0,t.unref)(Mu),{class:(0,t.normalizeClass)({"is-collapsed":l.value})},null,8,[`class`]),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.toolCall?.function.mcpName?(0,t.unref)(Su)(`调用 MCP:`):(0,t.unref)(Su)(`调用工具:`))+` `,1),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,bRt,[(0,t.createVNode)((0,t.unref)(k9),{text:d.value},null,8,[`text`])])),[[(0,t.unref)(Hu),{...(0,t.unref)(a),text:d.value,appendTo:`parent`}]]),(0,t.createElementVNode)(`span`,xRt,[e.status===(0,t.unref)(Du).Pending||e.status===(0,t.unref)(Du).Streaming?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(0,t.createCommentVNode)(`v-if`,!0),(0,t.createVNode)((0,t.unref)(k9),{text:f.value},null,8,[`text`]),p.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,SRt,` (`+(0,t.toDisplayString)(p.value)+`) `,1)):(0,t.createCommentVNode)(`v-if`,!0)])],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,CRt,[(0,t.createVNode)(B9,{desc:e.toolCall?.function.description,title:(0,t.unref)(Su)(`描述`)},null,8,[`desc`,`title`]),(0,t.createVNode)(B9,{desc:e.toolCall?.function.arguments,title:(0,t.unref)(Su)(`参数`)},null,8,[`desc`,`title`]),e.toolCall?.toolMessage?((0,t.openBlock)(),(0,t.createBlock)(vRt,(0,t.normalizeProps)((0,t.mergeProps)({key:0},e.toolCall.toolMessage)),null,16)):(0,t.createCommentVNode)(`v-if`,!0)],512),[[t.vShow,!l.value]])]))}}),TRt={class:`ai-assistant-message`},ERt={class:`ai-assistant-message-content`},DRt=(0,t.defineComponent)({__name:`assistant-message`,props:{toolCalls:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,TRt,[(0,t.createElementVNode)(`div`,ERt,[(0,t.renderSlot)(n.$slots,`default`,(0,t.normalizeProps)((0,t.guardReactiveProps)({content:e.content})),()=>[(0,t.createVNode)($7,{content:e.content||``,status:e.status,type:(0,t.unref)(Tu).Text},null,8,[`content`,`status`,`type`])])]),e.toolCalls&&e.toolCalls.length>0?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(e.toolCalls,n=>((0,t.openBlock)(),(0,t.createBlock)(wRt,{key:n.id,status:e.status,"tool-call":n},null,8,[`status`,`tool-call`]))),128)):(0,t.createCommentVNode)(`v-if`,!0)]))}}),ORt={class:`info-message`},kRt=(0,t.defineComponent)({__name:`info-message`,props:{content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ORt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Array.isArray(e.content)?e.content:[e.content],(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`info-message-content`},(0,t.toDisplayString)(e),1))),128))]))}}),ARt={class:`ai-tool-approval-card`},jRt={class:`ai-tool-approval-card__header`},MRt={class:`ai-tool-approval-card__title-wrap`},NRt={class:`ai-tool-approval-card__title`},PRt={class:`ai-tool-approval-card__fields`},FRt={class:`ai-tool-approval-card__field`},IRt={class:`ai-tool-approval-card__field`},LRt={class:`ai-tool-approval-card__processor`},RRt={class:`ai-tool-approval-card__processor-text`},zRt={class:`ai-tool-approval-card__actions`},BRt=(0,t.defineComponent)({__name:`tool-approval-card`,props:{interrupt:{},onInterruptResume:{type:Function},readonly:{type:Boolean}},setup(e){let n=e,r=Vu(),{copy:i}=Ru(),a=new Set([Cu.PENDING,Cu.DRAFT]),o=new Set([Cu.ABANDONED,Cu.CANCELLED,Cu.EXPIRED,Cu.REJECTED]),s=(0,t.computed)(()=>n.interrupt.metadata?.ticket??{approvers:[],sn:``,status:Cu.PENDING,submit_time:``,title:``,url:``}),l=(0,t.computed)(()=>a.has(s.value.status)),u=(0,t.computed)(()=>l.value?`pending`:s.value.status),d=(0,t.computed)(()=>l.value?Su(`评审中`):vye[s.value.status]??s.value.status),f=(0,t.computed)(()=>s.value.approvers.filter(Boolean).join(`、`)||Su(`无`)),p=(0,t.computed)(()=>s.value.url||s.value.sn),m=()=>{s.value.url&&window.open(s.value.url,`_blank`,`noopener`)},h=()=>{p.value&&i(p.value)},g=()=>{n.onInterruptResume?.({operation:Ou.ApprovalCancel,payload:{interrupt_id:n.interrupt.id}},n.interrupt)};return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,ARt,[(0,t.createElementVNode)(`header`,jRt,[(0,t.createElementVNode)(`div`,MRt,[i[0]||=(0,t.createElementVNode)(`span`,{class:`ai-tool-approval-card__title-bar`},null,-1),(0,t.createElementVNode)(`span`,NRt,(0,t.toDisplayString)(s.value.title||(0,t.unref)(Su)(`算法方案评审单`)),1),(0,t.withDirectives)((0,t.createVNode)((0,t.unref)(Sbe),{class:(0,t.normalizeClass)([`ai-tool-approval-card__copy-icon`,{"is-disabled":!p.value}]),onClick:h},null,8,[`class`]),[[(0,t.unref)(gu),{...(0,t.unref)(r),content:(0,t.unref)(Su)(`复制单据链接`),theme:`ai-chat-box`,offset:[0,8]}]])]),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`ai-tool-approval-card__status`,`ai-tool-approval-card__status--${u.value}`])},[s.value.status===(0,t.unref)(Cu).APPROVED?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(abe),{key:0,class:`ai-tool-approval-card__status-icon`})):(0,t.unref)(o).has(s.value.status)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(sbe),{key:1,class:`ai-tool-approval-card__status-icon`})):s.value.status===(0,t.unref)(Cu).REVOKED?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(cbe),{key:2,class:(0,t.normalizeClass)([`ai-tool-approval-card__status-icon`,{"ai-tool-approval-card__status-icon--revoked":s.value.status===(0,t.unref)(Cu).REVOKED}])},null,8,[`class`])):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:3,class:`ai-tool-approval-card__status-icon`,mode:`spin`,size:`mini`,theme:`primary`})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(d.value),1)],2)]),(0,t.createElementVNode)(`dl`,PRt,[(0,t.createElementVNode)(`div`,FRt,[(0,t.createElementVNode)(`dt`,null,(0,t.toDisplayString)((0,t.unref)(Su)(`单据编号`)),1),(0,t.createElementVNode)(`dd`,null,(0,t.toDisplayString)(s.value.sn||`--`),1)]),(0,t.createElementVNode)(`div`,IRt,[(0,t.createElementVNode)(`dt`,null,(0,t.toDisplayString)((0,t.unref)(Su)(`提交时间`)),1),(0,t.createElementVNode)(`dd`,null,(0,t.toDisplayString)(s.value.submit_time||`--`),1)])]),(0,t.createElementVNode)(`div`,LRt,[(0,t.createVNode)((0,t.unref)(obe),{class:`ai-tool-approval-card__processor-icon`}),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,RRt,[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Su)(`当前处理人`))+`:`+(0,t.toDisplayString)(f.value),1)])),[[(0,t.unref)(Hu),{...(0,t.unref)(r)}]])]),(0,t.createElementVNode)(`div`,zRt,[(0,t.createVNode)((0,t.unref)(Go),{class:`ai-tool-approval-card__detail`,disabled:!s.value.url,theme:`primary`,onClick:m},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Su)(`查看单据详情`))+` `,1),i[1]||=(0,t.createElementVNode)(`span`,{class:`ai-tool-approval-card__detail-icon`},null,-1)]),_:1},8,[`disabled`]),l.value&&!e.readonly?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Go),{key:0,class:`ai-tool-approval-card__cancel`,outline:``,theme:`primary`,onClick:g},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Su)(`取消审批`)),1)]),_:1})):(0,t.createCommentVNode)(`v-if`,!0)])]))}}),VRt={class:`ai-interrupt-message`},HRt={key:0,class:`ai-interrupt-message__content`},URt={class:`ai-interrupt-message__fallback`},WRt=(0,t.defineComponent)({__name:`interrupt-message`,props:{content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{},onInterruptResume:{type:Function}},setup(e){let n={[wu.AIDevToolApproval]:BRt},r=e=>({id:e.interruptId||e.id||``,reason:wu.AIDevToolApproval,toolCallId:``,metadata:e.payload.metadata}),i={[wu.AIDevToolApproval]:e=>({component:BRt,props:{interrupt:r(e),readonly:!0}}),[wu.UserQuestion]:e=>({component:CIt,props:{answers:e.payload?.answers??[],status:e.status}})},a=new Set([wu.UserQuestion]),o=e,s=(0,t.computed)(()=>o.content?.outcome?.type===`interrupt`?o.content.outcome.interrupts:[]),l=(0,t.computed)(()=>o.content?.message),u=e=>n[e.reason],d=e=>a.has(e.reason),f=(0,t.computed)(()=>{if(o.content?.outcome?.type!==`success`)return;let e=o.content?.result;if(e)return i[e.reason]?.(e)});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,VRt,[l.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,HRt,(0,t.toDisplayString)(l.value),1)):(0,t.createCommentVNode)(`v-if`,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.toolCallId},[u(n)?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(u(n)),{key:0,interrupt:n,"on-interrupt-resume":e.onInterruptResume},null,40,[`interrupt`,`on-interrupt-resume`])):d(n)?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createCommentVNode)(` UserQuestion 的交互浮层渲染在 chat-input 上方,不在会话内渲染 `),(0,t.createElementVNode)(`div`,URt,(0,t.toDisplayString)(n.message||(0,t.unref)(Su)(`暂不支持的中断消息`)),1)],2112))],64))),128)),(0,t.createCommentVNode)(` outcome.success 时按 reason 在会话内回显 resume 结果(审批单 / 已回答内容等) `),f.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(f.value.component),(0,t.normalizeProps)((0,t.mergeProps)({key:1},f.value.props)),(0,t.createSlots)({_:2},[n.$slots.answeredQuestion?{name:`answer`,fn:(0,t.withCtx)(e=>[(0,t.renderSlot)(n.$slots,`answeredQuestion`,(0,t.normalizeProps)((0,t.guardReactiveProps)(e)))]),key:`0`}:void 0]),1040)):(0,t.createCommentVNode)(`v-if`,!0)]))}}),GRt={class:`ai-loading-message`},KRt=(0,t.defineComponent)({__name:`loading-message`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,GRt,[(0,t.createVNode)(Iu,{size:18}),(0,t.renderSlot)(e.$slots,`default`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Su)(`请求中...`)),1)])]))}}),qRt={class:`ai-reasoning-message`},JRt={key:0,class:`ai-reasoning-message-title-icon`},YRt={class:`ai-reasoning-message-title-text`},XRt={class:`ai-reasoning-message-content`},ZRt=(0,t.defineComponent)({__name:`reasoning-message`,props:(0,t.mergeModels)({duration:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=(0,t.useModel)(e,`collapsed`),{stop:i}=(0,t.watch)(()=>n.duration,async e=>{e&&(r.value=!0,await(0,t.nextTick)(),i?.())},{immediate:!0}),a=(0,t.computed)(()=>{switch(n.status){case Du.Pending:return Su(`思考中`);case Du.Success:case Du.Complete:return Su(`已思考完成`)+(n.duration?` (${Su(`耗时`)} :${hye(n.duration)})`:``);case Du.Error:return Su(`思考失败`);default:return Su(`思考中`)}});return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,qRt,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ai-reasoning-message-title`,{"ai-reasoning-message-title-collapsed":r.value,"is-thinking":e.status===(0,t.unref)(Du).Pending||e.status===(0,t.unref)(Du).Streaming,"is-complete":e.status===(0,t.unref)(Du).Complete||e.status===(0,t.unref)(Du).Success,"is-error":e.status===(0,t.unref)(Du).Error}]),onClick:i[0]||=e=>r.value=!r.value},[e.status===(0,t.unref)(Du).Pending||e.status===(0,t.unref)(Du).Streaming?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,JRt,[(0,t.createVNode)(Iu)])):(0,t.createCommentVNode)(`v-if`,!0),(0,t.createElementVNode)(`span`,YRt,(0,t.toDisplayString)(a.value),1),(0,t.createCommentVNode)(` <template v-if="status === MessageStatus.Pending || status === MessageStatus.Streaming">
|
|
3495
|
+
</span> `)]),(0,t.createElementVNode)(`div`,MIt,[(0,t.createElementVNode)(`span`,NIt,(0,t.toDisplayString)((0,t.unref)(o))+` / `+(0,t.toDisplayString)((0,t.unref)(s)),1),(0,t.createVNode)((0,t.unref)(Zye),{class:`ai-user-question-card__arrow`,style:(0,t.normalizeStyle)({transform:i.value?`rotate(180deg)`:`rotate(-90deg)`}),onClick:(0,t.withModifiers)(h,[`stop`])},null,8,[`style`])])]),(0,t.createCommentVNode)(` 折叠用 v-show 而非 v-if:保留 UserQuestionChoice 及自定义 slot 的勾选态,避免卸载丢失选中 `),(0,t.withDirectives)((0,t.createElementVNode)(`div`,PIt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(a),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:r,class:`ai-user-question-card__question`},[(0,t.createElementVNode)(`div`,FIt,[(0,t.createElementVNode)(`span`,IIt,(0,t.toDisplayString)(r+1)+`. `+(0,t.toDisplayString)(n.question),1),n.multiSelect===void 0?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,LIt,(0,t.toDisplayString)(n.multiSelect?(0,t.unref)(Su)(`多选`):(0,t.unref)(Su)(`单选`)),1))]),(0,t.createElementVNode)(`div`,RIt,[(0,t.createCommentVNode)(` 默认渲染选择题;业务方可覆盖此 slot 渲染任意表单,作答有效时通过 setAnswer 回传 `),(0,t.renderSlot)(e.$slots,`question`,(0,t.mergeProps)({ref_for:!0},{question:n,qIndex:r,answer:(0,t.unref)(u)(r),setAnswer:e=>(0,t.unref)(d)(r,e),confirm:v}),()=>[(0,t.createVNode)(kIt,{question:n,onAnswer:e=>(0,t.unref)(d)(r,e),onConfirm:v},null,8,[`question`,`onAnswer`])])])]))),128))],512),[[t.vShow,!i.value]]),(0,t.withDirectives)((0,t.createElementVNode)(`footer`,zIt,[(0,t.createVNode)((0,t.unref)(Go),{class:`ai-user-question-card__complete`,disabled:!(0,t.unref)(l)||_.value===`skip`,loading:_.value===`complete`,size:`small`,theme:`primary`,onClick:v},{default:(0,t.withCtx)(()=>[_.value===`complete`?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(dbe),{key:0,class:`ai-user-question-card__enter-icon`})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(Su)(`完成`)),1)]),_:1},8,[`disabled`,`loading`]),(0,t.createVNode)((0,t.unref)(Go),{class:`ai-user-question-card__skip`,disabled:_.value===`complete`,loading:_.value===`skip`,size:`small`,text:``,onClick:y},{default:(0,t.withCtx)(()=>[_.value===`skip`?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(fbe),{key:0,class:`ai-user-question-card__skip-icon`})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(Su)(`跳过`)),1)]),_:1},8,[`disabled`,`loading`])],512),[[t.vShow,!i.value]])],2))}}),VIt={class:`ai-delete-confirm`},HIt={class:`ai-delete-confirm__title`},UIt={class:`ai-delete-confirm__desc`},WIt={class:`ai-delete-confirm__actions`},GIt=(0,t.defineComponent)({__name:`delete-tool`,props:{description:{},id:{},name:{},disabled:{type:Boolean},tippyOptions:{}},emits:[`confirm`,`cancel`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.useTemplateRef)(`tippyRef`),o=(0,t.computed)(()=>({id:r.id,name:r.name,description:r.description,disabled:r.disabled,tippyOptions:r.tippyOptions})),s=(0,t.computed)(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...r.tippyOptions||{}})),l=()=>{if(r.disabled)return!1},u=()=>{a.value?.hide?.()},d=()=>{u(),i(`confirm`)},f=()=>{u(),i(`cancel`)};return(0,t.onUnmounted)(()=>{u()}),(e,n)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(mu),(0,t.mergeProps)({ref_key:`tippyRef`,ref:a},s.value,{onShow:l}),{content:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,VIt,[(0,t.createElementVNode)(`div`,HIt,(0,t.toDisplayString)((0,t.unref)(Su)(`确认删除该回答?`)),1),(0,t.createElementVNode)(`div`,UIt,(0,t.toDisplayString)((0,t.unref)(Su)(`删除操作无法撤回,请谨慎操作!`)),1),(0,t.createElementVNode)(`div`,WIt,[(0,t.createVNode)((0,t.unref)(Go),{size:`small`,theme:`danger`,onClick:d},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Su)(`删除`)),1)]),_:1}),(0,t.createVNode)((0,t.unref)(Go),{size:`small`,onClick:f},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Su)(`取消`)),1)]),_:1})])])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(Uu,(0,t.normalizeProps)((0,t.guardReactiveProps)(o.value)),null,16)]),_:1},16))}}),KIt={class:`ai-feedback-title`},qIt={class:`ai-feedback-reason-list`},JIt=[`onClick`],YIt={class:`ai-feedback-other`},XIt={class:`ai-feedback-footer`},ZIt=(0,t.defineComponent)({__name:`user-feedback`,props:{loading:{type:Boolean},reasonList:{},title:{}},emits:[`submit`,`cancel`],setup(e,{emit:n}){let r=n,i=(0,t.shallowRef)(``),a=(0,t.shallowRef)([]),o=e=>{a.value.includes(e)?a.value=a.value.filter(t=>t!==e):a.value=[...a.value,e]},s=()=>{r(`submit`,a.value,i.value)},l=()=>{a.value=[],i.value=``,r(`cancel`)};return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`ai-user-feedback`,onMouseenter:r[1]||=(0,t.withModifiers)(()=>{},[`stop`,`prevent`])},[(0,t.createElementVNode)(`div`,KIt,(0,t.toDisplayString)(e.title),1),(0,t.createElementVNode)(`div`,qIt,[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(8,e=>(0,t.createElementVNode)(`div`,{key:e,class:`reason-item ai-skeleton-element`})),64)):((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(e.reasonList,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e,class:(0,t.normalizeClass)([`reason-item`,{"is-active":a.value.includes(e)}]),onClick:t=>o(e)},(0,t.toDisplayString)(e),11,JIt))),128))]),(0,t.createElementVNode)(`div`,YIt,[(0,t.createVNode)((0,t.unref)(ns),{modelValue:i.value,"onUpdate:modelValue":r[0]||=e=>i.value=e,placeholder:(0,t.unref)(Su)(`说出您的想法`),rows:3,type:`textarea`},null,8,[`modelValue`,`placeholder`])]),(0,t.createElementVNode)(`div`,XIt,[(0,t.createVNode)((0,t.unref)(Go),{class:`custom-btn`,disabled:!i.value&&a.value.length===0,size:`small`,theme:`primary`,onClick:s},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Su)(`提交`)),1)]),_:1},8,[`disabled`]),(0,t.createVNode)((0,t.unref)(Go),{class:`custom-btn`,size:`small`,width:`80px`,onClick:l},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Su)(`取消`)),1)]),_:1})])],32))}}),QIt={ref:`messageToolsRef`,class:`message-tools-container`},$It={class:`message-tools`,style:{"margin-right":`8px`}},eLt={key:0,class:`ai-divider`,style:{"margin-right":`8px`}},tLt={class:`message-tools`},nLt=(0,t.defineComponent)({__name:`message-tools`,props:{messageTools:{default:()=>Cye},messageToolsStatus:{},onAction:{},tippyOptions:{},updateTools:{default:()=>Tye}},emits:[`feedback`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.useTemplateRef)(`feedbackTippyRef`),o=(0,t.shallowRef)(!1),s=(0,t.shallowRef)([]),l=(0,t.shallowRef)(null),u=(0,t.computed)(()=>({arrow:!1,interactive:!0,offset:[0,6],theme:`ai-chat-box-light light`,trigger:`click`,appendTo:()=>document.body,...r.tippyOptions||{}})),d=async e=>{if(e.id===`like`||e.id===`unlike`){try{o.value=!0,s.value=[],s.value=await r.onAction?.(e)||[]}finally{o.value=!1}return}await r.onAction?.(e)},f=async e=>{await r.onAction?.(e)},p=()=>{a.value?.forEach(e=>e?.hide?.())},m=e=>l.value?l.value===`like`&&e===`like`?`activeLike`:l.value===`unlike`&&e===`unlike`?`activeUnLike`:e:e,h=e=>{let t=m(e);return t===`activeLike`?Su(`取消满意`):t===`activeUnLike`?Su(`取消不满意`):r.updateTools?.find(e=>e.id===t)?.description||``},g=(e,t,n)=>{p(),l.value===e.id?l.value=null:l.value=e.id,i(`feedback`,e,t,n)},_=e=>{if(r.messageToolsStatus===E9.Disabled)return!1;if(l.value&&l.value===e)return l.value=null,!1};return(0,t.onUnmounted)(()=>{p(),s.value=[]}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,QIt,[(0,t.createElementVNode)(`div`,$It,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.messageTools,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.id},[n.id===`delete`?((0,t.openBlock)(),(0,t.createBlock)(GIt,(0,t.mergeProps)({key:0,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(E9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>f(n)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):((0,t.openBlock)(),(0,t.createBlock)(Uu,(0,t.mergeProps)({key:1,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(E9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>d(n)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))]),e.updateTools.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,eLt)):(0,t.createCommentVNode)(`v-if`,!0),(0,t.createElementVNode)(`div`,tLt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.updateTools,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.id},[n.id===`like`||n.id===`unlike`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(mu),(0,t.mergeProps)({key:0,ref_for:!0,ref_key:`feedbackTippyRef`,ref:a},{ref_for:!0},u.value,{onShow:e=>_(n.id)}),{content:(0,t.withCtx)(()=>[(0,t.createVNode)(ZIt,{loading:o.value,"reason-list":s.value,title:n.id===`like`?(0,t.unref)(Su)(`什么原因让你满意?`):(0,t.unref)(Su)(`什么原因让你不满意?`),onCancel:p,onSubmit:(e,t)=>g(n,e,t)},null,8,[`loading`,`reason-list`,`title`,`onSubmit`])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(Uu,(0,t.mergeProps)({ref_for:!0},n,{id:m(n.id),active:l.value===n.id,disabled:e.messageToolsStatus===(0,t.unref)(E9).Disabled,"tippy-options":{...e.tippyOptions,content:h(n.id)},onClick:e=>d(n)}),null,16,[`id`,`active`,`disabled`,`tippy-options`,`onClick`])]),_:2},1040,[`onShow`])):n.id===`delete`?((0,t.openBlock)(),(0,t.createBlock)(GIt,(0,t.mergeProps)({key:1,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(E9).Disabled,"tippy-options":e.tippyOptions,onConfirm:e=>f(n)}),null,16,[`disabled`,`tippy-options`,`onConfirm`])):((0,t.openBlock)(),(0,t.createBlock)(Uu,(0,t.mergeProps)({key:2,ref_for:!0},n,{disabled:e.messageToolsStatus===(0,t.unref)(E9).Disabled,"tippy-options":e.tippyOptions,onClick:e=>d(n)}),null,16,[`disabled`,`tippy-options`,`onClick`]))],64))),128))])],512))}}),k9=(0,t.defineComponent)({name:`HighlightKeyword`,props:{text:{type:String,required:!0}},setup(e){let n=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=wxe(),i=(0,t.computed)(()=>{if(!e.text||!r?.value)return e.text;let i=r.value.trim();if(!i)return e.text;let a=RegExp(`(${n(i)})`,`ig`),o=e.text?.toString().split(a);return o.length<=1?e.text:o.map(e=>a.test(e)?(0,t.h)(`span`,{class:Dye},e):e)});return()=>(0,t.h)(`span`,i.value)}}),rLt={class:`ai-activity-message`},iLt={class:`ai-activity-message-content`},A9=(0,t.defineComponent)({__name:`activity-layout`,props:(0,t.mergeModels)({activityType:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=(0,t.useModel)(e,`collapsed`);return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,rLt,[(0,t.createElementVNode)(`div`,{class:`ai-activity-message-title`,onClick:i[0]||=e=>n.value=!n.value},[(0,t.renderSlot)(r.$slots,`title`,(0,t.normalizeProps)((0,t.guardReactiveProps)({collapsed:n.value}))),e.activityType===(0,t.unref)(Tu).FlowAgent?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:(0,t.normalizeClass)([`ai-activity-message-title-icon collapsed-icon`,{"is-collapsed":n.value}])},[(0,t.createVNode)((0,t.unref)(Pu))],2))]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,iLt,[(0,t.renderSlot)(r.$slots,`default`)],512),[[t.vShow,!n.value]])]))}}),j9=[{color:`#3A84FF`,icon:null,key:`running`,label:Su(`执行中`),rawStates:[`CREATED`,`LOOP_READY`,`READY`,`RUNNING`,`BLOCKED`,`ROLLING_BACK`,`ROLL_BACK_SUCCESS`]},{color:`#65C389`,icon:Rye,key:`success`,label:Su(`成功`),rawStates:[`FINISHED`]},{color:`#EA3636`,icon:zye,key:`failed`,label:Su(`失败`),rawStates:[`FAILED`,`REVOKED`,`ROLL_BACK_FAILED`]},{color:`#F59500`,icon:Bye,key:`suspended`,label:Su(`挂起`),rawStates:[`SUSPENDED`]},{color:`#4D4F56`,dotColor:`#DCDEE5`,icon:Vye,key:`pending`,label:Su(`待执行`),rawStates:[`PENDING`]},{color:`#5B7290`,icon:Hye,key:`skipped`,label:Su(`跳过`),rawStates:[`SKIPPED`]}],M9=Object.fromEntries(j9.map(e=>[e.key,e])),aLt=Object.fromEntries(j9.flatMap(e=>e.rawStates.map(t=>[t,e.key]))),N9=e=>aLt[e]??`running`,oLt=e=>M9[e].dotColor??M9[e].color,sLt=e=>{let n=M9[e].icon;return n?(0,t.cloneVNode)(n):null},cLt=e=>{let n=(0,t.computed)(()=>Array.isArray(e.value)?e.value:[e.value??{}]),r=(0,t.shallowRef)({}),i=e=>r.value[e.task_id]!==!1;return{isTaskExpanded:i,taskList:n,toggleTaskExpanded:e=>{r.value={...r.value,[e.task_id]:!i(e)}},viewTasks:(0,t.computed)(()=>n.value.map(e=>{let t=Object.values(e.nodes??{}).map(e=>{let t=N9(e.state);return{convergedState:t,dotColor:oLt(t),elapsedTimeText:gye(e.elapsed_time),id:e.id,name:e.name,raw:e,retryable:!!e.retryable,skippable:!!e.skippable}}),n=t.reduce((e,t)=>e+t.raw.elapsed_time,0),r=N9(e.task_state??``);return{convergedState:r,hasConfidence:!!e.has_confidence,confidenceTitle:e.confidence_title,isActive:!!e.is_active,nodes:t,raw:e,stateIcon:sLt(r),taskId:e.task_id,taskName:e.task_name,totalTimeText:gye(n)}})),visibleStats:(0,t.computed)(()=>{let e={};for(let t of j9)e[t.key]=0;for(let t of n.value)for(let[n,r]of Object.entries(t.statistics?.state_counts??{}))e[N9(n)]+=r;return j9.filter(t=>e[t.key]>0).map(t=>({color:t.color,display:e[t.key]>99?`99+`:String(e[t.key]),dotColor:oLt(t.key),key:t.key,label:t.label}))})}},lLt=[{icon:wbe,id:Ou.FlowNodeRetry,label:()=>Su(`重试`),visible:e=>e.convergedState===`failed`&&e.retryable},{icon:fbe,id:Ou.FlowNodeSkip,label:()=>Su(`跳过`),visible:e=>e.convergedState===`failed`&&e.skippable}],uLt=e=>{let{onInterruptResume:t,openNodeDetail:n}=e,r=(e,n,r)=>{t.value?.({payload:{node_id:r.id,task_id:n.task_id},operation:e})};return{getNodeActions:(e,t)=>{let i=lLt.filter(e=>e.visible(t)).map(n=>({icon:n.icon,id:n.id,label:n.label(),run:()=>r(n.id,e.raw,t.raw)}));return i.push({icon:Nu,id:`detail`,label:Su(`详情`),run:()=>n(e.raw,t.raw)}),i}}},dLt={class:`ai-detail-section`},fLt={class:`section-heading`},pLt={class:`section-text`},P9=(0,t.defineComponent)({__name:`detail-section`,props:{title:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,dLt,[(0,t.createElementVNode)(`div`,fLt,[r[0]||=(0,t.createElementVNode)(`span`,{class:`section-bar`},null,-1),(0,t.createElementVNode)(`span`,pLt,(0,t.toDisplayString)(e.title),1)]),(0,t.renderSlot)(n.$slots,`default`)]))}}),mLt={class:`ai-simple-table`},hLt={key:0},gLt=[`colspan`],F9=(0,t.defineComponent)({__name:`simple-table`,props:{columns:{},data:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`table`,mLt,[(0,t.createElementVNode)(`thead`,null,[(0,t.createElementVNode)(`tr`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.columns,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`th`,{key:e.key},(0,t.toDisplayString)(e.label),1))),128))])]),(0,t.createElementVNode)(`tbody`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.data,(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,{key:r},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.columns,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`td`,{key:e.key,class:(0,t.normalizeClass)({"is-break-all":e.breakAll})},(0,t.toDisplayString)(n[e.key]??`--`),3))),128))]))),128)),e.data.length?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,hLt,[(0,t.createElementVNode)(`td`,{class:`is-empty`,colspan:e.columns.length},` -- `,8,gLt)]))])]))}}),_Lt={class:`flow-agent-node-detail`},vLt={class:`detail-title`},yLt={key:1,class:`detail-title-content`},bLt={class:`detail-tab-bar`},xLt=[`onClick`],SLt={class:`detail-body`},CLt={class:`skeleton-section`},wLt={class:`skeleton-section`},TLt={class:`info-form`},ELt={class:`info-label`},DLt={class:`info-value`},OLt={class:`info-row`},kLt={class:`info-label`},ALt={class:`info-value`},jLt={key:0,class:`failure-item`},MLt={key:1,class:`failure-item`},NLt={class:`info-row`},PLt={class:`info-label`},FLt={class:`info-value`},ILt={key:0,class:`skeleton-section`},I9=function(e){return e.Config=`config`,e.Output=`output`,e}(I9||{}),LLt=(0,t.defineComponent)({__name:`flow-agent-node-detail`,props:{data:{},has_confidence:{type:Boolean},loading:{type:Boolean},node_id:{},node_name:{},task_id:{},task_name:{}},setup(e){let n=[{key:I9.Config,label:Su(`节点配置`)},{key:I9.Output,label:Su(`节点输出`)}],r=[{key:`key`,label:Su(`参数名`)},{breakAll:!0,key:`value`,label:Su(`参数值`)}],i=[{key:`name`,label:Su(`名称`)},{key:`description`,label:Su(`变量说明`)},{key:`key`,label:`KEY`}],a=[{key:`key`,label:Su(`参数名`)},{breakAll:!0,key:`value`,label:Su(`参数值`)}],o={forced_fail:xu?`Force Fail`:`强制失败`},s=e,l=(0,t.shallowRef)(I9.Config),u=(0,t.computed)(()=>s.data?.basic_info),d=(0,t.computed)(()=>{let e=u.value;return e?[{label:Su(`流程模板`),value:e.template_name||`--`},{label:Su(`节点名称`),value:e.node_name||`--`},{label:Su(`步骤名称`),value:e.stage_name||`--`},{label:Su(`是否可选`),value:e.optional?Su(`是`):Su(`否`)}]:[]}),f=(0,t.computed)(()=>{let e=u.value;return e?.skippable||e?.auto_retry?.enable}),p=(0,t.computed)(()=>{let e=u.value?.auto_retry;return e?.enable?xu?`In ${e.interval} seconds, auto retry ${e.times} times`:`在 ${e.interval} 秒后,自动重试 ${e.times} 次`:``}),m=(0,t.computed)(()=>{let e=u.value?.timeout_config;if(!e?.enable)return`--`;let t=o[e.action]??e.action;return xu?`Timeout ${e.seconds} seconds later, ${t}`:`超时 ${e.seconds} 秒后则${t}`}),h=(0,t.computed)(()=>Object.entries(s.data?.inputs??{}).map(([e,t])=>({key:e,value:v(t)}))),g=(0,t.computed)(()=>(s.data?.plugin_output??[]).map(e=>({description:e.schema?.description||`--`,name:e.name,key:e.key}))),_=(0,t.computed)(()=>(s.data?.outputs??[]).map(e=>({key:e.key,value:v(e.value)}))),v=e=>e==null?`--`:typeof e==`object`?JSON.stringify(e):String(e);return(o,s)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_Lt,[(0,t.createElementVNode)(`h3`,vLt,[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(Su)(`节点`))+`:`,1),s[0]||=(0,t.createElementVNode)(`span`,{class:`skeleton-title ai-skeleton-element`},null,-1)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,yLt,(0,t.toDisplayString)((0,t.unref)(Su)(`节点`))+`:`+(0,t.toDisplayString)(u.value?.node_name),1)),(0,t.renderSlot)(o.$slots,`locateButton`)]),(0,t.createElementVNode)(`div`,bLt,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(n,e=>(0,t.createElementVNode)(`div`,{key:e.key,class:(0,t.normalizeClass)([`detail-tab`,{"is-active":l.value===e.key}]),onClick:t=>l.value=e.key},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.key===I9.Config?(0,t.unref)(Wye):(0,t.unref)(Nu)),{class:`detail-tab-icon`})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.label),1)],10,xLt)),64))]),(0,t.createElementVNode)(`div`,SLt,[l.value===I9.Config?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`div`,CLt,[s[1]||=(0,t.createElementVNode)(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(6,e=>(0,t.createElementVNode)(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))]),(0,t.createElementVNode)(`div`,wLt,[s[2]||=(0,t.createElementVNode)(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(4,e=>(0,t.createElementVNode)(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createVNode)(P9,{title:(0,t.unref)(Su)(`基础信息`)},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,TLt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(d.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.label,class:`info-row`},[(0,t.createElementVNode)(`div`,ELt,(0,t.toDisplayString)(e.label),1),(0,t.createElementVNode)(`div`,DLt,(0,t.toDisplayString)(e.value),1)]))),128)),(0,t.createElementVNode)(`div`,OLt,[(0,t.createElementVNode)(`div`,kLt,(0,t.toDisplayString)((0,t.unref)(Su)(`失败处理`)),1),(0,t.createElementVNode)(`div`,ALt,[f.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[u.value?.skippable?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,jLt,[s[3]||=(0,t.createElementVNode)(`span`,{class:`tag-badge`},`MS`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(Su)(`手动跳过`))+(0,t.toDisplayString)(u.value?.auto_retry?.enable?`;`:``),1)])):(0,t.createCommentVNode)(`v-if`,!0),u.value?.auto_retry?.enable?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,MLt,[s[4]||=(0,t.createElementVNode)(`span`,{class:`tag-badge`},`AR`,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(p.value),1)])):(0,t.createCommentVNode)(`v-if`,!0)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createTextVNode)(`--`)],64))])]),(0,t.createElementVNode)(`div`,NLt,[(0,t.createElementVNode)(`div`,PLt,(0,t.toDisplayString)((0,t.unref)(Su)(`超时控制`)),1),(0,t.createElementVNode)(`div`,FLt,(0,t.toDisplayString)(m.value),1)])])]),_:1},8,[`title`]),(0,t.createVNode)(P9,{title:(0,t.unref)(Su)(`输入参数`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(F9,{columns:r,data:h.value},null,8,[`data`])]),_:1},8,[`title`]),(0,t.createVNode)(P9,{title:(0,t.unref)(Su)(`输出参数`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(F9,{columns:i,data:g.value},null,8,[`data`])]),_:1},8,[`title`])],64))],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ILt,[s[5]||=(0,t.createElementVNode)(`div`,{class:`skeleton-heading ai-skeleton-element`},null,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(5,e=>(0,t.createElementVNode)(`div`,{key:e,class:`skeleton-row ai-skeleton-element`})),64))])):((0,t.openBlock)(),(0,t.createBlock)(P9,{key:1,title:(0,t.unref)(Su)(`结构化输出`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(F9,{columns:a,data:_.value},null,8,[`data`])]),_:1},8,[`title`]))],64))])]))}}),L9=e=>e.task_id==null?``:`${e.task_id}`,R9=L9,z9=(e,t)=>e.task_id==null?``:`${e.task_id}|${t.id}|${t.name}`,RLt=e=>{let{messageUid:n,taskList:r}=e,i=ixe(),a=exe(),o=(0,t.computed)(()=>i.selectedTab.value?.name??``),s=(0,t.shallowRef)(!1),l=()=>{s.value=!0},u=(0,t.computed)(()=>{if(s.value)return o.value;let e=r.value.find(e=>e.is_active);return e?.task_id==null?o.value:L9(e)}),d=e=>{let t=u.value;return t===L9(e)||t===R9(e)},f=(e,t)=>u.value===z9(e,t),p=(e,t)=>{let r=e.task_id;r!=null&&(l(),i.addCustomTab?.({label:t.name,name:z9(e,t),data:{component:LLt,messageUid:n.value,props:{data:{},loading:!0,node_id:t.id,node_name:t.name,task_id:r,task_name:e.task_name}}}))},m=e=>{let t=e?.task_id;t&&(l(),i.addCustomTab?.({label:Su(`有效证据`),name:R9(e),data:{component:LLt,messageUid:n.value,props:{data:{},has_confidence:e.has_confidence,loading:!0,task_id:t,task_name:e.task_name}}}))};return(0,t.watch)(o,(e,t)=>{t!==void 0&&l()}),(0,t.onMounted)(()=>{a?.value&&m(r.value.find(e=>e.is_active&&e.has_confidence))}),(0,t.onUnmounted)(()=>{if(a?.value)for(let e of r.value){i.removeCustomTab?.(L9(e)),i.removeCustomTab?.(R9(e));for(let t of Object.values(e.nodes??{}))i.removeCustomTab?.(z9(e,t))}}),{displaySelectedTabName:u,isNodeSelected:f,isTaskSelected:d,markUserTabSelection:l,openConfidence:m,openNodeDetail:p}},zLt={class:`ai-activity-message-title-text`},BLt={class:`flow-agent-title-label`},VLt={class:`flow-agent-stat-tooltip`},HLt={class:`flow-agent-stat-tooltip-status`},ULt={class:`flow-agent-stat-tooltip-label`},WLt=[`onClick`],GLt={class:`flow-agent-task-state-icon`},KLt={class:`flow-agent-task-name`},qLt={key:0,class:`flow-agent-task-trailing`},JLt={class:`flow-agent-task-time`},YLt=[`onClick`],XLt={class:`flow-agent-task-nodes`},ZLt={class:`flow-agent-node-status`},QLt=[`title`],$Lt={key:0,class:`flow-agent-node-trailing`},eRt={class:`flow-agent-node-time`},tRt={class:`flow-agent-node-actions`},nRt=[`onClick`],rRt=(0,t.defineComponent)({__name:`flow-agent-content`,props:(0,t.mergeModels)({content:{},messageUid:{},onInterruptResume:{type:Function},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=Vu(),i=(0,t.useModel)(e,`collapsed`),a=Sxe(),o=(0,t.computed)(()=>a.value!==ku.Share),s=(0,t.computed)(()=>n.status===Du.Pending||n.status===Du.Streaming),{isTaskExpanded:l,taskList:u,toggleTaskExpanded:d,viewTasks:f,visibleStats:p}=cLt((0,t.toRef)(n,`content`)),{isNodeSelected:m,isTaskSelected:h,openConfidence:g,openNodeDetail:_}=RLt({messageUid:(0,t.toRef)(n,`messageUid`),taskList:u}),{getNodeActions:v}=uLt({onInterruptResume:(0,t.toRef)(n,`onInterruptResume`),openNodeDetail:_});return(e,n)=>((0,t.openBlock)(),(0,t.createBlock)(A9,{collapsed:i.value,"onUpdate:collapsed":n[0]||=e=>i.value=e,"activity-type":(0,t.unref)(Tu).FlowAgent,class:`flow-agent-activity`},{title:(0,t.withCtx)(()=>[(0,t.createCommentVNode)(` hover 整条执行情况栏展示统计 tooltip(设计稿 annotation) `),(0,t.createVNode)((0,t.unref)(mu),(0,t.mergeProps)({class:`flow-agent-title-bar`,theme:`ai-chat-box-light light`},{...(0,t.unref)(r),tag:`div`,arrow:!0,followCursor:!1,offset:[0,10]}),{content:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,VLt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(p),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.key,class:`flow-agent-stat-tooltip-item`},[(0,t.createElementVNode)(`span`,HLt,[e.key===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`flow-agent-stat-dot`,style:(0,t.normalizeStyle)({borderColor:e.dotColor})},null,4))]),(0,t.createElementVNode)(`span`,ULt,(0,t.toDisplayString)(e.label)+`:`,1),(0,t.createElementVNode)(`span`,{class:`flow-agent-stat-tooltip-count`,style:(0,t.normalizeStyle)({color:e.color})},(0,t.toDisplayString)(e.display),5)]))),128))])]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`ai-activity-message-title-icon`,{"icon-collapsed":i.value}])},[s.value?((0,t.openBlock)(),(0,t.createBlock)(Iu,{key:0,size:12})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Mu),{key:1}))],2),(0,t.createElementVNode)(`span`,zLt,[(0,t.createElementVNode)(`span`,BLt,(0,t.toDisplayString)((0,t.unref)(Su)(`执行情况`))+`:`,1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(p),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e.key,class:`flow-agent-stat-item`},[e.key===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,class:`flow-agent-stat-loading`,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`flow-agent-stat-dot`,style:(0,t.normalizeStyle)({borderColor:e.dotColor})},null,4)),(0,t.createElementVNode)(`span`,{class:`flow-agent-stat-count`,style:(0,t.normalizeStyle)({color:e.color})},(0,t.toDisplayString)(e.display),5)]))),128))])]),_:1},16)]),default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(f),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.taskId,class:`flow-agent-task-group`},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`flow-agent-task-header`,{"has-confidence":e.hasConfidence,"is-selected":(0,t.unref)(h)(e.raw)}])},[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`flow-agent-task-arrow`,{"is-expanded":(0,t.unref)(l)(e.raw)}]),onClick:(0,t.withModifiers)(n=>(0,t.unref)(d)(e.raw),[`stop`])},[(0,t.createVNode)((0,t.unref)(Mu))],10,WLt),(0,t.createElementVNode)(`span`,GLt,[e.convergedState===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.stateIcon),{key:1}))]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,KLt,[(0,t.createVNode)((0,t.unref)(k9),{text:e.taskName},null,8,[`text`])])),[[(0,t.unref)(Hu),{...(0,t.unref)(r)}]]),o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,qLt,[(0,t.createElementVNode)(`span`,JLt,(0,t.toDisplayString)(e.totalTimeText),1),e.hasConfidence?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:`flow-agent-task-action-btn flow-agent-task-confidence-btn`,onClick:(0,t.withModifiers)(n=>(0,t.unref)(g)(e.raw),[`stop`])},[(0,t.createVNode)((0,t.unref)(Nu)),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.confidenceTitle??(0,t.unref)(Su)(`有效证据`)),1)],8,YLt)):(0,t.createCommentVNode)(`v-if`,!0)])):(0,t.createCommentVNode)(`v-if`,!0)],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,XLt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.nodes,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n.id,class:(0,t.normalizeClass)([`flow-agent-node-item`,{"is-selected":(0,t.unref)(m)(e.raw,n.raw)}])},[(0,t.createElementVNode)(`span`,ZLt,[n.convergedState===`running`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`flow-agent-status-dot`,style:(0,t.normalizeStyle)({borderColor:n.dotColor})},null,4))]),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{class:`flow-agent-node-name`,title:n.name},[(0,t.createVNode)((0,t.unref)(k9),{text:n.name},null,8,[`text`])],8,QLt)),[[(0,t.unref)(Hu),{...(0,t.unref)(r)}]]),o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,$Lt,[(0,t.createElementVNode)(`span`,eRt,(0,t.toDisplayString)(n.elapsedTimeText),1),(0,t.createElementVNode)(`span`,tRt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(v)(e,n),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e.id,class:`flow-agent-node-action-btn`,onClick:(0,t.withModifiers)(t=>e.run(),[`stop`])},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon))),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.label),1)],8,nRt))),128))])])):(0,t.createCommentVNode)(`v-if`,!0)],2))),128))],512),[[t.vShow,(0,t.unref)(l)(e.raw)]])]))),128))]),_:1},8,[`collapsed`,`activity-type`]))}}),iRt={class:`ai-activity-message-title-icon`},aRt={class:`ai-activity-message-title-text`},oRt={class:`knowledge-rag-content`},sRt=(0,t.defineComponent)({__name:`knowledge-rag-content`,props:(0,t.mergeModels)({content:{},messageUid:{},status:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=(0,t.useModel)(e,`collapsed`),i=(0,t.computed)(()=>n.status===Du.Pending||n.status===Du.Streaming),a=(0,t.computed)(()=>i.value?Su(`检索中`):Su(`检索完成`));return(n,o)=>((0,t.openBlock)(),(0,t.createBlock)(A9,{collapsed:r.value,"onUpdate:collapsed":o[0]||=e=>r.value=e},{title:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,iRt,[i.value?((0,t.openBlock)(),(0,t.createBlock)(Iu,{key:0})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(ju),{key:1,style:{"font-size":`12px`}}))]),(0,t.createElementVNode)(`span`,aRt,(0,t.toDisplayString)(a.value),1)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,oRt,[(0,t.createVNode)(Z7,{content:e.content?.content||``},null,8,[`content`])]),(0,t.createVNode)(Q7,{content:e.content?.referenceDocument||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),cRt={class:`ai-activity-message-title-icon`},lRt={class:`ai-activity-message-title-text`},uRt=(0,t.defineComponent)({__name:`reference-doc-content`,props:(0,t.mergeModels)({content:{},messageUid:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=(0,t.useModel)(e,`collapsed`),i=(0,t.computed)(()=>{let e=n.content?.length??0;return xu?`Reference ${e} documents as reference`:`引用 ${e} 篇资料作为参考`});return(n,a)=>((0,t.openBlock)(),(0,t.createBlock)(A9,{collapsed:r.value,"onUpdate:collapsed":a[0]||=e=>r.value=e},{title:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,cRt,[(0,t.createVNode)((0,t.unref)(ju),{style:{"font-size":`12px`}})]),(0,t.createElementVNode)(`span`,lRt,(0,t.toDisplayString)(i.value),1)]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(Q7,{content:e.content||[]},null,8,[`content`])]),_:1},8,[`collapsed`]))}}),dRt=(0,t.defineComponent)({__name:`activity-message`,props:(0,t.mergeModels)({activityType:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{},onInterruptResume:{type:Function}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n={[Tu.FlowAgent]:rRt,[Tu.KnowledgeRag]:sRt,[Tu.ReferenceDocument]:uRt},r=e,i=(0,t.useModel)(e,`collapsed`),a=(0,t.computed)(()=>n[r.activityType??``]);return(n,r)=>a.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(a.value),{key:0,collapsed:i.value,"onUpdate:collapsed":r[0]||=e=>i.value=e,content:e.content,"message-uid":e.uid,"on-interrupt-resume":e.onInterruptResume,status:e.status},null,40,[`collapsed`,`content`,`message-uid`,`on-interrupt-resume`,`status`])):(0,t.createCommentVNode)(`v-if`,!0)}}),fRt={class:`toolcall-desc`},pRt={class:`desc-title`},mRt={class:`desc-panel`},hRt={class:`desc-label`},gRt={class:`desc-value`},B9=(0,t.defineComponent)({__name:`desc-panel`,props:{desc:{},title:{}},setup(e){let n=e,r=e=>e==null?``:typeof e==`object`?JSON.stringify(e):String(e),i=(0,t.computed)(()=>{try{return JSON.parse(n.desc||``)}catch{return n.desc}});return(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,fRt,[(0,t.createElementVNode)(`div`,pRt,(0,t.toDisplayString)(e.title),1),(0,t.createElementVNode)(`div`,mRt,[(0,t.createCommentVNode)(` null 的 typeof 为 object,需排除,避免 v-for 异常;键/值统一转字符串以满足 HighlightKeyword `),i.value!==null&&typeof i.value==`object`?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(i.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`desc-panel-item`},[(0,t.createElementVNode)(`span`,hRt,[(0,t.createVNode)((0,t.unref)(k9),{text:String(n)},null,8,[`text`]),a[0]||=(0,t.createTextVNode)(`:`,-1)]),(0,t.createElementVNode)(`span`,gRt,[(0,t.createVNode)((0,t.unref)(k9),{style:{"word-break":`break-all`},text:r(e)},null,8,[`text`])])]))),128)):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(k9),{key:1,style:{wordBreak:`break-all`},text:r(i.value)},null,8,[`text`]))])]))}}),_Rt={class:`tool-message`},vRt=(0,t.defineComponent)({__name:`tool-message`,props:{duration:{},error:{type:[Boolean,String]},toolCallId:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_Rt,[(0,t.createVNode)(B9,{desc:e.content||(typeof e.error==`string`?e.error:void 0),title:(0,t.unref)(Su)(`返回内容`)},null,8,[`desc`,`title`])]))}}),yRt={class:`ai-toolcall-render`},bRt={class:`toolcall-header-title`},xRt={class:`toolcall-status-title`},SRt={key:1,class:`toolcall-duration`},CRt={class:`ai-toolcall-render-content`},wRt=(0,t.defineComponent)({__name:`toolcall-render`,props:{duration:{},status:{},toolCall:{}},setup(e){let n=e,r=(0,t.shallowRef)(!0),i=(0,t.shallowRef)(null),a=Vu(),{keywordMatched:o,keyword:s}=Txe(()=>[n.toolCall?.function.name,n.toolCall?.function.mcpName,n.toolCall?.function.description,n.toolCall?.function.arguments,n.toolCall?.id]),l=(0,t.computed)(()=>i.value===null?s?.value?.trim()?!o.value:r.value:i.value);function u(){r.value=!l.value,i.value=r.value}let d=(0,t.computed)(()=>{let e=n.toolCall?.function.mcpName||``,t=n.toolCall?.function.name||n.toolCall?.id||``;return e?`${e} / ${t}`:t}),f=(0,t.computed)(()=>{switch(n.status){default:case Du.Pending:return Su(`调用中`);case Du.Complete:case Du.Success:return Su(`调用成功`);case Du.Error||n.toolCall?.toolMessage?.error:return Su(`调用失败`)}}),p=(0,t.computed)(()=>{let e=n.duration||n.toolCall?.toolMessage?.duration;return e?hye(e):``});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,yRt,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ai-toolcall-render-header`,`toolcall-status-${e.status}`]),onClick:u},[(0,t.createVNode)((0,t.unref)(Mu),{class:(0,t.normalizeClass)({"is-collapsed":l.value})},null,8,[`class`]),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.toolCall?.function.mcpName?(0,t.unref)(Su)(`调用 MCP:`):(0,t.unref)(Su)(`调用工具:`))+` `,1),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,bRt,[(0,t.createVNode)((0,t.unref)(k9),{text:d.value},null,8,[`text`])])),[[(0,t.unref)(Hu),{...(0,t.unref)(a),text:d.value,appendTo:`parent`}]]),(0,t.createElementVNode)(`span`,xRt,[e.status===(0,t.unref)(Du).Pending||e.status===(0,t.unref)(Du).Streaming?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:0,mode:`spin`,size:`mini`,theme:`primary`})):(0,t.createCommentVNode)(`v-if`,!0),(0,t.createVNode)((0,t.unref)(k9),{text:f.value},null,8,[`text`]),p.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,SRt,` (`+(0,t.toDisplayString)(p.value)+`) `,1)):(0,t.createCommentVNode)(`v-if`,!0)])],2),(0,t.withDirectives)((0,t.createElementVNode)(`div`,CRt,[(0,t.createVNode)(B9,{desc:e.toolCall?.function.description,title:(0,t.unref)(Su)(`描述`)},null,8,[`desc`,`title`]),(0,t.createVNode)(B9,{desc:e.toolCall?.function.arguments,title:(0,t.unref)(Su)(`参数`)},null,8,[`desc`,`title`]),e.toolCall?.toolMessage?((0,t.openBlock)(),(0,t.createBlock)(vRt,(0,t.normalizeProps)((0,t.mergeProps)({key:0},e.toolCall.toolMessage)),null,16)):(0,t.createCommentVNode)(`v-if`,!0)],512),[[t.vShow,!l.value]])]))}}),TRt={class:`ai-assistant-message`},ERt={class:`ai-assistant-message-content`},DRt=(0,t.defineComponent)({__name:`assistant-message`,props:{toolCalls:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,TRt,[(0,t.createElementVNode)(`div`,ERt,[(0,t.renderSlot)(n.$slots,`default`,(0,t.normalizeProps)((0,t.guardReactiveProps)({content:e.content})),()=>[(0,t.createVNode)($7,{content:e.content||``,status:e.status,type:(0,t.unref)(Tu).Text},null,8,[`content`,`status`,`type`])])]),e.toolCalls&&e.toolCalls.length>0?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(e.toolCalls,n=>((0,t.openBlock)(),(0,t.createBlock)(wRt,{key:n.id,status:e.status,"tool-call":n},null,8,[`status`,`tool-call`]))),128)):(0,t.createCommentVNode)(`v-if`,!0)]))}}),ORt={class:`info-message`},kRt=(0,t.defineComponent)({__name:`info-message`,props:{content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ORt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Array.isArray(e.content)?e.content:[e.content],(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:`info-message-content`},(0,t.toDisplayString)(e),1))),128))]))}}),ARt={class:`ai-tool-approval-card`},jRt={class:`ai-tool-approval-card__header`},MRt={class:`ai-tool-approval-card__title-wrap`},NRt={class:`ai-tool-approval-card__title`},PRt={class:`ai-tool-approval-card__fields`},FRt={class:`ai-tool-approval-card__field`},IRt={class:`ai-tool-approval-card__field`},LRt={class:`ai-tool-approval-card__processor`},RRt={class:`ai-tool-approval-card__processor-text`},zRt={class:`ai-tool-approval-card__actions`},BRt=(0,t.defineComponent)({__name:`tool-approval-card`,props:{interrupt:{},onInterruptResume:{type:Function},readonly:{type:Boolean}},setup(e){let n=e,r=Vu(),i=Sxe(),a=(0,t.computed)(()=>i.value===ku.Share),{copy:o}=Ru(),s=new Set([Cu.PENDING,Cu.DRAFT]),l=new Set([Cu.ABANDONED,Cu.CANCELLED,Cu.EXPIRED,Cu.REJECTED]),u=(0,t.computed)(()=>n.interrupt.metadata?.ticket??{approvers:[],sn:``,status:Cu.PENDING,submit_time:``,title:``,url:``}),d=(0,t.computed)(()=>s.has(u.value.status)),f=(0,t.computed)(()=>d.value?`pending`:u.value.status),p=(0,t.computed)(()=>d.value?Su(`评审中`):vye[u.value.status]??u.value.status),m=(0,t.computed)(()=>u.value.approvers.filter(Boolean).join(`、`)||Su(`无`)),h=(0,t.computed)(()=>u.value.url||u.value.sn),g=()=>{u.value.url&&window.open(u.value.url,`_blank`,`noopener`)},_=()=>{h.value&&o(h.value)},v=(0,t.shallowRef)(!1),y=()=>{v.value||(v.value=!0,n.onInterruptResume?.({operation:Ou.ApprovalCancel,payload:{interrupt_id:n.interrupt.id}},n.interrupt))};return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,ARt,[(0,t.createElementVNode)(`header`,jRt,[(0,t.createElementVNode)(`div`,MRt,[i[0]||=(0,t.createElementVNode)(`span`,{class:`ai-tool-approval-card__title-bar`},null,-1),(0,t.createElementVNode)(`span`,NRt,(0,t.toDisplayString)(u.value.title||(0,t.unref)(Su)(`算法方案评审单`)),1),(0,t.withDirectives)((0,t.createVNode)((0,t.unref)(Sbe),{class:(0,t.normalizeClass)([`ai-tool-approval-card__copy-icon`,{"is-disabled":!h.value}]),onClick:_},null,8,[`class`]),[[(0,t.unref)(gu),{...(0,t.unref)(r),content:(0,t.unref)(Su)(`复制单据链接`),theme:`ai-chat-box`,offset:[0,8]}]])]),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`ai-tool-approval-card__status`,`ai-tool-approval-card__status--${f.value}`])},[u.value.status===(0,t.unref)(Cu).APPROVED?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(abe),{key:0,class:`ai-tool-approval-card__status-icon`})):(0,t.unref)(l).has(u.value.status)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(sbe),{key:1,class:`ai-tool-approval-card__status-icon`})):u.value.status===(0,t.unref)(Cu).REVOKED?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(cbe),{key:2,class:(0,t.normalizeClass)([`ai-tool-approval-card__status-icon`,{"ai-tool-approval-card__status-icon--revoked":u.value.status===(0,t.unref)(Cu).REVOKED}])},null,8,[`class`])):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Lo),{key:3,class:`ai-tool-approval-card__status-icon`,mode:`spin`,size:`mini`,theme:`primary`})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(p.value),1)],2)]),(0,t.createElementVNode)(`dl`,PRt,[(0,t.createElementVNode)(`div`,FRt,[(0,t.createElementVNode)(`dt`,null,(0,t.toDisplayString)((0,t.unref)(Su)(`单据编号`)),1),(0,t.createElementVNode)(`dd`,null,(0,t.toDisplayString)(u.value.sn||`--`),1)]),(0,t.createElementVNode)(`div`,IRt,[(0,t.createElementVNode)(`dt`,null,(0,t.toDisplayString)((0,t.unref)(Su)(`提交时间`)),1),(0,t.createElementVNode)(`dd`,null,(0,t.toDisplayString)(u.value.submit_time||`--`),1)])]),(0,t.createElementVNode)(`div`,LRt,[(0,t.createVNode)((0,t.unref)(obe),{class:`ai-tool-approval-card__processor-icon`}),(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`span`,RRt,[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Su)(`当前处理人`))+`:`+(0,t.toDisplayString)(m.value),1)])),[[(0,t.unref)(Hu),{...(0,t.unref)(r)}]])]),(0,t.createElementVNode)(`div`,zRt,[(0,t.createVNode)((0,t.unref)(Go),{class:`ai-tool-approval-card__detail`,disabled:!u.value.url,theme:`primary`,onClick:g},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Su)(`查看单据详情`))+` `,1),i[1]||=(0,t.createElementVNode)(`span`,{class:`ai-tool-approval-card__detail-icon`},null,-1)]),_:1},8,[`disabled`]),d.value&&!e.readonly?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Go),{key:0,class:`ai-tool-approval-card__cancel`,disabled:v.value||a.value,loading:v.value,outline:``,theme:`primary`,onClick:y},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Su)(`取消审批`)),1)]),_:1},8,[`disabled`,`loading`])):(0,t.createCommentVNode)(`v-if`,!0)])]))}}),VRt={class:`ai-interrupt-message`},HRt={key:0,class:`ai-interrupt-message__content`},URt={class:`ai-interrupt-message__fallback`},WRt=(0,t.defineComponent)({__name:`interrupt-message`,props:{content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{},onInterruptResume:{type:Function}},setup(e){let n={[wu.AIDevToolApproval]:BRt},r=e=>({id:e.interruptId||e.id||``,reason:wu.AIDevToolApproval,toolCallId:``,metadata:e.payload.metadata}),i={[wu.AIDevToolApproval]:e=>({component:BRt,props:{interrupt:r(e),readonly:!0}}),[wu.UserQuestion]:e=>({component:CIt,props:{answers:e.payload?.answers??[],status:e.status}})},a=new Set([wu.UserQuestion]),o=e,s=(0,t.computed)(()=>o.content?.outcome?.type===`interrupt`?o.content.outcome.interrupts:[]),l=(0,t.computed)(()=>o.content?.message),u=e=>n[e.reason],d=e=>a.has(e.reason),f=(0,t.computed)(()=>{if(o.content?.outcome?.type!==`success`)return;let e=o.content?.result;if(e)return i[e.reason]?.(e)});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,VRt,[l.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,HRt,(0,t.toDisplayString)(l.value),1)):(0,t.createCommentVNode)(`v-if`,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.toolCallId},[u(n)?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(u(n)),{key:0,interrupt:n,"on-interrupt-resume":e.onInterruptResume},null,40,[`interrupt`,`on-interrupt-resume`])):d(n)?(0,t.createCommentVNode)(`v-if`,!0):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createCommentVNode)(` UserQuestion 的交互浮层渲染在 chat-input 上方,不在会话内渲染 `),(0,t.createElementVNode)(`div`,URt,(0,t.toDisplayString)(n.message||(0,t.unref)(Su)(`暂不支持的中断消息`)),1)],2112))],64))),128)),(0,t.createCommentVNode)(` outcome.success 时按 reason 在会话内回显 resume 结果(审批单 / 已回答内容等) `),f.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(f.value.component),(0,t.normalizeProps)((0,t.mergeProps)({key:1},f.value.props)),(0,t.createSlots)({_:2},[n.$slots.answeredQuestion?{name:`answer`,fn:(0,t.withCtx)(e=>[(0,t.renderSlot)(n.$slots,`answeredQuestion`,(0,t.normalizeProps)((0,t.guardReactiveProps)(e)))]),key:`0`}:void 0]),1040)):(0,t.createCommentVNode)(`v-if`,!0)]))}}),GRt={class:`ai-loading-message`},KRt=(0,t.defineComponent)({__name:`loading-message`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,GRt,[(0,t.createVNode)(Iu,{size:18}),(0,t.renderSlot)(e.$slots,`default`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(Su)(`请求中...`)),1)])]))}}),qRt={class:`ai-reasoning-message`},JRt={key:0,class:`ai-reasoning-message-title-icon`},YRt={class:`ai-reasoning-message-title-text`},XRt={class:`ai-reasoning-message-content`},ZRt=(0,t.defineComponent)({__name:`reasoning-message`,props:(0,t.mergeModels)({duration:{},content:{},id:{},messageId:{},name:{},role:{},status:{},uid:{},property:{}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let n=e,r=(0,t.useModel)(e,`collapsed`),{stop:i}=(0,t.watch)(()=>n.duration,async e=>{e&&(r.value=!0,await(0,t.nextTick)(),i?.())},{immediate:!0}),a=(0,t.computed)(()=>{switch(n.status){case Du.Pending:return Su(`思考中`);case Du.Success:case Du.Complete:return Su(`已思考完成`)+(n.duration?` (${Su(`耗时`)} :${hye(n.duration)})`:``);case Du.Error:return Su(`思考失败`);default:return Su(`思考中`)}});return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,qRt,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ai-reasoning-message-title`,{"ai-reasoning-message-title-collapsed":r.value,"is-thinking":e.status===(0,t.unref)(Du).Pending||e.status===(0,t.unref)(Du).Streaming,"is-complete":e.status===(0,t.unref)(Du).Complete||e.status===(0,t.unref)(Du).Success,"is-error":e.status===(0,t.unref)(Du).Error}]),onClick:i[0]||=e=>r.value=!r.value},[e.status===(0,t.unref)(Du).Pending||e.status===(0,t.unref)(Du).Streaming?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,JRt,[(0,t.createVNode)(Iu)])):(0,t.createCommentVNode)(`v-if`,!0),(0,t.createElementVNode)(`span`,YRt,(0,t.toDisplayString)(a.value),1),(0,t.createCommentVNode)(` <template v-if="status === MessageStatus.Pending || status === MessageStatus.Streaming">
|
|
3496
3496
|
<ContentLoadingIcon
|
|
3497
3497
|
v-for="i in 3"
|
|
3498
3498
|
:key="i"
|