File: /www/server/panel/BTPanel/static/js/index-legacy5.js
!function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function n(e){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?t(Object(a),!0).forEach(function(t){o(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function o(t,n,o){return(n=function(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var a=o.call(t,n||"default");if("object"!=e(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}(n))in t?Object.defineProperty(t,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[n]=o,t}function a(t){if(null!=t){var n=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],o=0;if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}}}throw new TypeError(e(t)+" is not iterable")}function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=u(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,a=function(){};return{s:a,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,r=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){r=!0,i=e},f:function(){try{l||null==n.return||n.return()}finally{if(r)throw i}}}}function l(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function i(n,o,a,i){var l=o&&o.prototype instanceof u?o:u,c=Object.create(l.prototype);return r(c,"_invoke",function(n,o,a){var i,l,r,u=0,c=a||[],d=!1,p={p:0,n:0,v:e,a:v,f:v.bind(e,4),d:function(t,n){return i=t,l=0,r=e,p.n=n,s}};function v(n,o){for(l=n,r=o,t=0;!d&&u&&!a&&t<c.length;t++){var a,i=c[t],v=p.p,f=i[2];n>3?(a=f===o)&&(r=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=v&&((a=n<2&&v<i[1])?(l=0,p.v=o,p.n=i[1]):v<f&&(a=n<3||i[0]>o||o>f)&&(i[4]=n,i[5]=o,p.n=f,l=0))}if(a||n>1)return s;throw d=!0,o}return function(a,c,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&v(c,f),l=c,r=f;(t=l<2?e:r)||!d;){i||(l?l<3?(l>1&&(p.n=-1),v(l,r)):p.n=r:p.v=r);try{if(u=2,i){if(l||(a="next"),t=i[a]){if(!(t=t.call(i,r)))throw TypeError("iterator result is not an object");if(!t.done)return t;r=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(r=TypeError("The iterator does not provide a '"+a+"' method"),l=1);i=e}else if((t=(d=p.n<0)?r:n.call(o,p))!==s)break}catch(t){i=e,l=1,r=t}finally{u=1}}return{value:t,done:d}}}(n,a,i),!0),c}var s={};function u(){}function c(){}function d(){}t=Object.getPrototypeOf;var p=[][o]?t(t([][o]())):(r(t={},o,function(){return this}),t),v=d.prototype=u.prototype=Object.create(p);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,r(e,a,"GeneratorFunction")),e.prototype=Object.create(v),e}return c.prototype=d,r(v,"constructor",d),r(d,"constructor",c),c.displayName="GeneratorFunction",r(d,a,"GeneratorFunction"),r(v),r(v,a,"Generator"),r(v,o,function(){return this}),r(v,"toString",function(){return"[object Generator]"}),(l=function(){return{w:i,m:f}})()}function r(e,t,n,o){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}r=function(e,t,n,o){function i(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},r(e,t,n,o)}function s(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||u(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function d(e,t,n,o,a,i,l){try{var r=e[i](l),s=r.value}catch(e){return void n(e)}r.done?t(s):Promise.resolve(s).then(o,a)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(o,a){var i=e.apply(t,n);function l(e){d(i,o,a,l,r,"next",e)}function r(e){d(i,o,a,l,r,"throw",e)}l(void 0)})}}System.register(["./base-lib-legacy.js?v=1777008528","./utils-lib-legacy.js?v=1777008528","./chat-utils-legacy.js?v=1777008528","./index-legacy3.js?v=1777008528","./ai-legacy.js?v=1777008528","./useController-legacy23.js?v=1777008528","./__commonjsHelpers__-legacy.js?v=1777008528","./marked.esm-legacy.js?v=1777008528","./index-legacy119.js?v=1777008528","./index-legacy116.js?v=1777008528"],function(e,t){"use strict";var o,r,u,c,d,v,f,g,h,y,m,C,w,k,x,b,_,S,L,T,M,P,B,A,I,R,E,U,D,O,q,N,F,H,Z,z,j,W,V,$,G,Q,K,J,X,Y,ee,te,ne,oe,ae,ie,le,re,se,ue,ce;return{setters:[function(e){o=e.c,r=e.j,u=e.k,c=e.q,d=e.F,v=e.B,f=e.L,g=e.s,h=e.R,y=e.A,m=e.r,C=e.g,w=e.p,k=e.y,x=e.J,b=e.K,_=e.x,S=e.C,L=e.e,T=e.v,M=e.bm,P=e.b3,B=e.n,A=e.o,I=e.a8,R=e.M,E=e.w,U=e.aW,D=e.az,O=e.b,q=e.Q},function(e){N=e.w,F=e.cZ,H=e.M,Z=e.k,z=e.R,j=e.jA,W=e.c},function(e){V=e.p,$=e.i,G=e.f,Q=e.a,K=e.r,J=e.b,X=e.s},function(e){Y=e.w},function(e){ee=e.p,te=e.q,ne=e.d,oe=e.k,ae=e.n,ie=e.r},function(e){le=e.f,re=e.g,se=e.i,ue=e.p,ce=e.j},null,null,null,null],execute:function(){var t={class:"history-panel-header"},de={class:"history-list"},pe={key:0,class:"history-empty"},ve=["onClick"],fe={class:"history-item-title"},ge={class:"history-item-time"},he=["onClick"],ye=o({__name:"ChatSidebar",props:{conversations:{},currentConversationId:{},panelVisible:{type:Boolean},getTimeAgo:{type:Function},isSending:{type:Boolean}},emits:["showPanel","hidePanel","startHideTimer","clearHideTimer","loadConversation","deleteConversation"],setup:function(e,n){var o=n.emit;function a(){return(a=p(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,N({title:"删除对话",content:"确定要删除这个对话吗?",type:"default top-index"});case 1:o("deleteConversation",t);case 2:return e.a(2)}},e)}))).apply(this,arguments)}return function(n,o){return r(),u("div",{class:f(["history-panel",{"show-panel":e.panelVisible}]),onMouseenter:o[1]||(o[1]=function(e){return n.$emit("clearHideTimer")}),onMouseleave:o[2]||(o[2]=function(e){return n.$emit("startHideTimer")})},[c("div",t,[o[4]||(o[4]=c("h4",null,"历史对话",-1)),c("button",{class:"close-panel-btn",onClick:o[0]||(o[0]=function(e){return n.$emit("hidePanel")})},s(o[3]||(o[3]=[c("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),c("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])))]),c("div",de,[0===e.conversations.length?(r(),u("div",pe,s(o[5]||(o[5]=[c("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[c("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})],-1),c("div",{class:"empty-title"},"暂无历史对话",-1),c("div",{class:"empty-desc"},"开始新对话后会显示在这里",-1)])))):(r(!0),u(d,{key:1},v(e.conversations,function(t){return r(),u("div",{key:t.id,class:f(["history-item",{active:t.id===e.currentConversationId}]),onClick:function(e){return n.$emit("loadConversation",t.id,t.sessions_dir)}},[c("div",fe,g(t.title),1),c("div",ge,g(e.getTimeAgo(new Date(t.updatedAt))),1),c("button",{class:"history-item-delete",title:"删除对话",onClick:h(function(e){return function(e){return a.apply(this,arguments)}(t.id)},["stop"])},s(o[6]||(o[6]=[y('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-b33e478a><polyline points="3 6 5 6 21 6" data-v-b33e478a></polyline><path d="M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2" data-v-b33e478a></path><line x1="10" y1="11" x2="10" y2="17" data-v-b33e478a></line><line x1="14" y1="11" x2="14" y2="17" data-v-b33e478a></line></svg>',1)])),8,he)],10,ve)}),128))])],34)}}}),me=F(ye,[["__scopeId","data-v-b33e478a"]]),Ce=m(!1),we=m("");function ke(e){return e.contentBlocks&&e.contentBlocks.length>0?e.contentBlocks.filter(function(e){return"message"===e.type}).map(function(e){return e.content}).join("\n"):"string"==typeof e.content?e.content:""}function xe(e){if("string"==typeof e.content)return e.content;if(Array.isArray(e.content)){var t=e.content.find(function(e){return"text"===e.type});return(null==t?void 0:t.text)||""}return""}function be(e){return Array.isArray(e.content)?e.content.filter(function(e){return"image_url"===e.type}).map(function(e){var t;return(null===(t=e.image_url)||void 0===t?void 0:t.url)||""}).filter(function(e){return e}):[]}function _e(e){e.collapsed=!e.collapsed}function Se(e){e.collapsed=!e.collapsed}function Le(e){we.value=e,Ce.value=!0}function Te(){Ce.value=!1,we.value=""}var Me={class:"user-message-wrapper"},Pe={class:"message-content user-message-content"},Be={key:0,class:"user-images"},Ae=["src","onClick"],Ie=["innerHTML"],Re={class:"message-actions user-actions"},Ee=["disabled"],Ue={class:"message-body"},De=["onClick"],Oe=["innerHTML"],qe=["onClick"],Ne={key:0,class:"tool-icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Fe={key:1,class:"tool-icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},He={key:2,class:"tool-icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Ze={key:0,class:"tool-icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},ze={key:1,class:"tool-icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},je={class:"tool-name"},We={key:0,class:"tool-call-description"},Ve={class:"tool-call-details"},$e={key:0,class:"todo-list"},Ge={class:"todo-status-icon"},Qe={key:0,class:"todo-icon-spin",width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},Ke={key:1,width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},Je={key:2,width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},Xe={key:3,width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Ye={class:"todo-description"},et={class:"tool-call-args"},tt={key:0,class:"tool-result-content"},nt=["innerHTML"],ot={key:2,class:"continue-section"},at={key:3,class:"message-actions"},it=["disabled"],lt=["disabled"],rt=["src"],st=o({__name:"MessageItem",props:{msg:{},isSending:{type:Boolean},isLastAssistant:{type:Boolean},isLast:{type:Boolean},assistantName:{}},emits:["copy","regenerate","delete","toggleThink","continue"],setup:function(e,t){var n=t.emit,o=e,a=n,i=C(function(){return e=o.msg,t=!!o.isLast,!("assistant"!==e.role||!t)&&ke(e).includes("max_tool_iterations");var e,t});function l(e){return K(e,(t=o.msg,Array.isArray(t.content)?t.content.filter(function(e){return"file"===e.type&&e.source&&e.path}).map(function(e){return{value:e.source.value,path:e.path,start:e.source.start,end:e.source.end}}):[]),function(e){return Array.isArray(e.content)?e.content.filter(function(e){return"site"===e.type&&e.source&&e.name}).map(function(e){return{value:e.source.value,name:e.name,start:e.source.start,end:e.source.end}}):[]}(o.msg));var t}function p(){var e=ke(o.msg);a("copy",e)}function m(){a("copy",xe(o.msg))}return function(t,n){return r(),u("div",{class:f(["message",e.msg.role])},["user"===e.msg.role?(r(),u(d,{key:0},[c("div",Me,[c("div",Pe,[w(be)(e.msg).length>0?(r(),u("div",Be,[(r(!0),u(d,null,v(w(be)(e.msg),function(e,t){return r(),u("img",{key:t,src:e,alt:"图片",class:"user-image",onClick:function(t){return w(Le)(e)}},null,8,Ae)}),128))])):k("",!0),w(xe)(e.msg)?(r(),u("div",{key:1,innerHTML:l(w(xe)(e.msg))},null,8,Ie)):k("",!0)]),c("div",Re,[c("button",{class:"message-action-btn",title:"复制",onClick:m},s(n[7]||(n[7]=[c("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),c("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})],-1)]))),c("button",{class:"message-action-btn",title:"删除",disabled:o.isSending,onClick:n[0]||(n[0]=function(e){return t.$emit("delete")})},s(n[8]||(n[8]=[y('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-3a31ed57><polyline points="3 6 5 6 21 6" data-v-3a31ed57></polyline><path d="M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2" data-v-3a31ed57></path><line x1="10" y1="11" x2="10" y2="17" data-v-3a31ed57></line><line x1="14" y1="11" x2="14" y2="17" data-v-3a31ed57></line></svg>',1)])),8,Ee)])]),n[9]||(n[9]=c("div",{class:"message-avatar user-avatar"},[c("span",{class:"avatar-text"},"ME")],-1))],64)):"assistant"===e.msg.role?(r(),u(d,{key:1},[n[27]||(n[27]=c("div",{class:"message-avatar assistant-avatar"},[c("span",{class:"avatar-text"},[c("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 17 24",width:"36.000000",height:"49.000000",fill:"none",customFrame:"#000000"},[c("defs",null,[c("clipPath",{id:"clipPath_0"},[c("rect",{width:"13.000000",height:"13.000000",x:"3.175781",y:"12.000000",fill:"rgb(255,255,255)"})]),c("linearGradient",{id:"paint_linear_5",x1:"9.67578125",x2:"9.67578125",y1:"12.2714844",y2:"25",gradientUnits:"userSpaceOnUse"},[c("stop",{"stop-color":"rgb(207,86,255)",offset:"0","stop-opacity":"1"}),c("stop",{"stop-color":"rgb(139,136,240)",offset:"1","stop-opacity":"1"})]),c("linearGradient",{id:"paint_linear_6",x1:"9.5",x2:"9.5",y1:"14",y2:"24",gradientUnits:"userSpaceOnUse"},[c("stop",{"stop-color":"rgb(207,86,255)",offset:"0","stop-opacity":"1"}),c("stop",{"stop-color":"rgb(139,136,240)",offset:"1","stop-opacity":"1"})]),c("clipPath",{id:"clipPath_1"},[c("rect",{width:"7.000000",height:"7.000000",x:"6.175781",y:"4.000000",fill:"rgb(255,255,255)"})]),c("linearGradient",{id:"paint_linear_7",x1:"9.68390274",x2:"9.68390274",y1:"4.32434082",y2:"10.6896744",gradientUnits:"userSpaceOnUse"},[c("stop",{"stop-color":"rgb(255,192,8)",offset:"0","stop-opacity":"1"}),c("stop",{"stop-color":"rgb(255,222,124)",offset:"1","stop-opacity":"1"})]),c("linearGradient",{id:"paint_linear_8",x1:"1.98535156",x2:"1.98535156",y1:"0",y2:"3.97070312",gradientUnits:"userSpaceOnUse"},[c("stop",{"stop-color":"rgb(255,15,0)",offset:"0","stop-opacity":"1"}),c("stop",{"stop-color":"rgb(255,15,0)",offset:"1","stop-opacity":"0"})]),c("linearGradient",{id:"paint_linear_9",x1:"1.98339844",x2:"1.98339844",y1:"0",y2:"3.96679688",gradientUnits:"userSpaceOnUse"},[c("stop",{"stop-color":"rgb(0,136,255)",offset:"0","stop-opacity":"1"}),c("stop",{"stop-color":"rgb(0,136,255)",offset:"1","stop-opacity":"0"})]),c("linearGradient",{id:"paint_linear_10",x1:"1",x2:"1",y1:"0",y2:"2",gradientUnits:"userSpaceOnUse"},[c("stop",{"stop-color":"rgb(0,255,129)",offset:"0","stop-opacity":"1"}),c("stop",{"stop-color":"rgb(0,255,129)",offset:"1","stop-opacity":"0"})])]),c("g",{id:"组合 286"},[c("g",{id:"svg 155",opacity:"0","clip-path":"url(#clipPath_0)",customFrame:"url(#clipPath_0)"},[c("rect",{id:"svg 155",width:"13.000000",height:"13.000000",x:"3.175781",y:"12.000000"}),c("path",{id:"合并",d:"M10.2174 13.6896C10.3837 13.5406 10.4883 13.3245 10.4883 13.084C10.4883 12.9289 10.4439 12.777 10.3603 12.6463C10.2767 12.5156 10.1575 12.4115 10.0166 12.3464C9.87581 12.2814 9.71929 12.258 9.56558 12.279C9.41188 12.3 9.26741 12.3646 9.14925 12.4652C9.0311 12.5657 8.94419 12.698 8.89882 12.8463C8.85344 12.9947 8.85148 13.1529 8.89318 13.3024C8.93487 13.4518 9.01848 13.5862 9.13411 13.6896L9.13411 14.709L6.42578 14.709C6.14053 14.709 5.86031 14.7841 5.61328 14.9267C5.36625 15.0693 5.16111 15.2745 5.01849 15.5215C4.87587 15.7685 4.80078 16.0488 4.80078 16.334L4.80078 21.7507C4.80078 22.0359 4.87587 22.3161 5.01849 22.5632C5.16111 22.8102 5.36625 23.0153 5.61328 23.158C5.86031 23.3006 6.14053 23.3757 6.42578 23.3757L12.9258 23.3757C13.211 23.3757 13.4912 23.3006 13.7383 23.158C13.9853 23.0153 14.1904 22.8102 14.3331 22.5632C14.4757 22.3161 14.5508 22.0359 14.5508 21.7507L14.5508 16.334C14.5508 16.0488 14.4757 15.7685 14.3331 15.5215C14.1904 15.2745 13.9853 15.0693 13.7383 14.9267C13.4912 14.7841 13.211 14.709 12.9258 14.709L10.2174 14.709L10.2174 13.6896ZM4.25911 17.4173L3.17578 17.4173L3.17578 20.6673L4.25911 20.6673L4.25911 17.4173ZM15.0924 17.4173L16.1758 17.4173L16.1758 20.6673L15.0924 20.6673L15.0924 17.4173ZM8.52836 19.6997C8.38954 19.8005 8.22236 19.8548 8.05078 19.8548C7.8792 19.8548 7.71202 19.8005 7.57321 19.6997C7.43439 19.5988 7.33107 19.4566 7.27805 19.2934C7.22503 19.1302 7.22503 18.9544 7.27805 18.7913C7.33107 18.6281 7.43439 18.4859 7.57321 18.385C7.71202 18.2842 7.8792 18.2298 8.05078 18.2298C8.22236 18.2298 8.38954 18.2842 8.52836 18.385C8.66717 18.4859 8.77049 18.6281 8.82351 18.7913C8.87654 18.9544 8.87654 19.1302 8.82351 19.2934C8.77049 19.4566 8.66717 19.5988 8.52836 19.6997ZM11.5519 18.2696C11.715 18.3226 11.8573 18.4259 11.9581 18.5648C12.059 18.7036 12.1133 18.8708 12.1133 19.0423C12.1133 19.2139 12.059 19.3811 11.9581 19.5199C11.8573 19.6587 11.715 19.762 11.5519 19.8151C11.3887 19.8681 11.2129 19.8681 11.0497 19.8151C10.8865 19.762 10.7443 19.6587 10.6435 19.5199C10.5426 19.3811 10.4883 19.2139 10.4883 19.0423C10.4883 18.8708 10.5426 18.7036 10.6435 18.5648C10.7443 18.4259 10.8865 18.3226 11.0497 18.2696C11.2129 18.2166 11.3887 18.2166 11.5519 18.2696ZM13.1758 24.5C13.1758 24.2239 12.9519 24 12.6758 24L6.67578 24C6.39964 24 6.17578 24.2239 6.17578 24.5C6.17578 24.7761 6.39964 25 6.67578 25L12.6758 25C12.9519 25 13.1758 24.7761 13.1758 24.5Z",fill:"url(#paint_linear_5)","fill-rule":"evenodd"})]),c("g",{id:"组合 302"},[c("path",{id:"合并",d:"M11.3235 14.9659C11.6203 14.7183 11.61 14.0359 11.858 14.0093C12.4372 13.9472 13.1075 14.188 12.5669 14.9628C12.386 15.2222 12.0044 15.5484 11.5768 15.8676C11.7643 15.8935 11.9503 15.9222 12.1341 15.9532C12.9111 15.3147 14.3915 14.1808 14.9377 14.3283C15.4628 14.4701 15.1245 15.7963 14.8697 16.5908C15.9414 16.9049 16.6428 17.1837 16.6428 17.1837C16.6428 17.1837 17 18.2593 15.214 18.6192C14.6008 18.7427 14.7913 18.9199 15.2188 19.3176C15.422 19.5067 15.6788 19.7456 15.9284 20.0523C16.683 20.9798 17 22.5628 17 22.5628L14.857 21.8466L15.5712 22.9217L14.4998 22.9213L14.8569 23.9986L14.1426 23.2806L13.5384 23.9984L12.7146 23.9975L6.29425 23.9974L6.28544 23.9989L5.46131 23.9971L4.85743 23.282L4.14314 24L4.50021 22.9227L3.4288 22.9231L4.14295 21.848L2 22.5642C2 22.5642 2.31699 20.9812 3.07164 20.0537C3.32118 19.747 3.57798 19.5081 3.78121 19.319C4.20873 18.9213 4.39916 18.7441 3.78601 18.6206C1.99995 18.2607 2.35723 17.1851 2.35723 17.1851C2.35723 17.1851 3.05857 16.9063 4.13026 16.5922C3.87555 15.7977 3.53719 14.4715 4.06231 14.3297C4.60851 14.1822 6.08893 15.3161 6.86593 15.9546C7.0497 15.9236 7.23569 15.8949 7.42319 15.869C6.99561 15.5498 6.61404 15.2236 6.43307 14.9642C5.89247 14.1894 6.56276 13.9487 7.14196 14.0107C7.38998 14.0373 7.3797 14.7197 7.6765 14.9673C7.89071 15.1461 7.89864 15.0288 7.9076 14.8963C7.91522 14.7836 7.92357 14.66 8.06005 14.698C8.35707 14.7807 8.51548 14.8066 8.51968 15.0414C8.5217 15.1545 8.48678 15.2615 8.45302 15.365C8.41677 15.4761 8.38186 15.583 8.39545 15.6892C8.39935 15.7196 8.40974 15.7426 8.42535 15.7609C8.74972 15.7364 9.07491 15.7225 9.39745 15.7218C9.78695 15.7156 10.1814 15.7297 10.5746 15.7595C10.5903 15.7412 10.6006 15.7182 10.6045 15.6878C10.6181 15.5816 10.5832 15.4747 10.547 15.3636C10.5132 15.2601 10.4783 15.1531 10.4803 15.04C10.4845 14.8052 10.6429 14.7793 10.9399 14.6966C11.0764 14.6586 11.0848 14.7822 11.0924 14.8949C11.1014 15.0274 11.1093 15.1447 11.3235 14.9659Z",fill:"url(#paint_linear_6)","fill-rule":"evenodd"}),c("ellipse",{id:"椭圆 85",rx:"0.576923",ry:"0.579347",cx:"7.19215727",cy:"21.531496",fill:"rgb(255,255,255)"}),c("ellipse",{id:"椭圆 86",rx:"0.576923",ry:"0.579347",cx:"11.8076363",cy:"21.531496",fill:"rgb(255,255,255)"}),c("path",{id:"椭圆 87",d:"M8.47187 21.8046C8.27093 21.6029 7.99841 21.4895 7.71425 21.4895C7.43009 21.4895 7.15757 21.6029 6.95664 21.8046C6.7557 22.0064 6.64282 22.2801 6.64282 22.5654L6.95076 22.5654C6.95076 22.3621 7.0312 22.1671 7.17438 22.0233C7.31757 21.8795 7.51176 21.7987 7.71425 21.7987C7.91674 21.7987 8.11094 21.8795 8.25412 22.0233C8.3973 22.1671 8.47774 22.3621 8.47774 22.5654L8.78568 22.5654C8.78568 22.2801 8.6728 22.0064 8.47187 21.8046Z",opacity:"0",fill:"rgb(255,255,255)","fill-rule":"evenodd"}),c("path",{id:"椭圆 88",d:"M12.0434 21.8046C11.8425 21.6029 11.5699 21.4895 11.2858 21.4895C11.0016 21.4895 10.7291 21.6029 10.5282 21.8046C10.3272 22.0064 10.2144 22.2801 10.2144 22.5654L10.5223 22.5654C10.5223 22.3621 10.6027 22.1671 10.7459 22.0233C10.8891 21.8795 11.0833 21.7987 11.2858 21.7987C11.4883 21.7987 11.6825 21.8795 11.8257 22.0233C11.9688 22.1671 12.0493 22.3621 12.0493 22.5654L12.3572 22.5654C12.3572 22.2801 12.2443 22.0064 12.0434 21.8046Z",opacity:"0",fill:"rgb(255,255,255)","fill-rule":"evenodd"}),c("path",{id:"矢量 2577",d:"M9.49975 22.1108L9.50002 22.8831L10.0769 23.2692M9.50002 22.8831L8.9231 23.2695",stroke:"rgb(255,255,255)","stroke-linecap":"round","stroke-width":"0.200000"})]),c("g",{id:"svg 154","clip-path":"url(#clipPath_1)",customFrame:"url(#clipPath_1)",class:"lightbulb-glow"},[c("rect",{id:"svg 154",width:"7.000000",height:"7.000000",x:"6.175781",y:"4.000000"}),c("path",{id:"矢量 2565",d:"M7.59674 7.16634C7.59674 7.07301 7.60374 6.97967 7.6154 6.89101L6.91074 6.89101C6.80107 6.89101 6.7124 6.97734 6.7124 7.08467C6.7124 7.19201 6.80107 7.27834 6.91074 7.27834L7.59907 7.27834C7.59674 7.24101 7.59674 7.20367 7.59674 7.16634ZM7.58274 8.86967C7.50574 8.94667 7.50574 9.06801 7.58274 9.14501C7.65974 9.21967 7.78574 9.21967 7.86274 9.14501L8.2244 8.79034C8.14274 8.69934 8.0564 8.59901 7.97707 8.48467L7.58274 8.86967ZM8.0844 5.78967C8.16607 5.68701 8.25707 5.59367 8.3574 5.50734L7.86507 5.02434C7.78807 4.94734 7.66207 4.94734 7.58507 5.02434C7.50807 5.09901 7.50807 5.22267 7.58507 5.29967L8.0844 5.78967ZM10.1891 10.3187L9.18107 10.3187C9.07607 10.3187 8.99207 10.4027 8.99207 10.503C8.99207 10.6057 9.07607 10.6897 9.18107 10.6897L10.1891 10.6897C10.2941 10.6897 10.3781 10.6057 10.3781 10.503C10.3781 10.4003 10.2917 10.3187 10.1891 10.3187ZM9.68507 5.16667L9.68974 5.16667C9.75507 5.16667 9.81807 5.17134 9.88107 5.17601L9.88107 4.51801C9.88107 4.41067 9.7924 4.32434 9.68274 4.32434C9.57307 4.32434 9.4844 4.41067 9.4844 4.51801L9.4844 5.17601C9.5474 5.16901 9.61274 5.16667 9.67574 5.16667L9.68507 5.16667ZM11.2857 5.78967L11.7851 5.29967C11.8621 5.22501 11.8621 5.10134 11.7851 5.02434C11.7081 4.94734 11.5821 4.94734 11.5051 5.02434L11.0127 5.50734C11.1107 5.59367 11.2017 5.68701 11.2857 5.78967ZM11.3884 8.48234C11.3067 8.59901 11.2227 8.69701 11.1411 8.78801L11.5027 9.14267C11.5797 9.21734 11.7057 9.21734 11.7827 9.14267C11.8597 9.06567 11.8597 8.94434 11.7827 8.86734L11.3884 8.48234ZM10.1891 9.84967L9.18107 9.84967C9.07607 9.84967 8.99207 9.93134 8.99207 10.0363C8.99207 10.139 9.07607 10.2207 9.18107 10.2207L10.1891 10.2207C10.2941 10.2207 10.3781 10.1367 10.3781 10.0363C10.3781 9.93134 10.2917 9.84967 10.1891 9.84967ZM12.4571 6.89101L11.7524 6.89101C11.7641 6.98201 11.7711 7.07301 11.7711 7.16634C11.7711 7.20367 11.7711 7.24101 11.7687 7.27834L12.4571 7.27834C12.5667 7.27834 12.6554 7.19201 12.6554 7.08467C12.6531 6.97734 12.5667 6.89101 12.4571 6.89101ZM11.4934 7.16634C11.4934 6.76501 11.3581 6.39401 11.1271 6.09534C10.9264 5.83401 10.6511 5.62867 10.3337 5.50967L10.3361 5.50034L10.2007 5.46067C10.0957 5.43034 9.98607 5.40934 9.8764 5.39767L9.86007 5.39534C9.8064 5.39067 9.7504 5.38601 9.68974 5.38601L9.6804 5.38601C9.62207 5.38601 9.56607 5.39067 9.51007 5.39534L9.49373 5.39767C9.38407 5.40934 9.2744 5.43034 9.1694 5.46067L9.03873 5.49801L9.04107 5.50734C8.7214 5.62867 8.44607 5.83401 8.24307 6.09534C8.0144 6.39401 7.87674 6.76501 7.87674 7.16634C7.87674 7.45567 7.92807 7.69134 8.0074 7.88734C8.1264 8.18134 8.30607 8.37967 8.45307 8.53134C8.5254 8.60601 8.59074 8.67134 8.63274 8.72501C8.67707 8.78101 8.69807 8.82301 8.70507 8.85567C8.73773 9.02134 8.74007 9.22901 8.74007 9.28034L8.74007 9.29667C8.74007 9.53467 8.93607 9.72601 9.17873 9.72601L9.5194 9.72601L9.5194 8.04601L9.0294 7.55834C8.96873 7.50001 8.96873 7.40201 9.0294 7.34367C9.09007 7.28534 9.18573 7.28534 9.24407 7.34367L9.67107 7.76834L10.0981 7.34367C10.1587 7.28534 10.2544 7.28534 10.3127 7.34367C10.3734 7.40201 10.3734 7.50001 10.3127 7.55834L9.82273 8.04601L9.82273 9.72367L10.1914 9.72367C10.4341 9.72367 10.6301 9.53001 10.6301 9.29434L10.6301 9.28034C10.6301 9.22901 10.6324 9.01901 10.6651 8.85567C10.6697 8.83234 10.6791 8.80667 10.7001 8.77401C10.7351 8.71801 10.8004 8.64801 10.8821 8.56634C11.0034 8.44034 11.1574 8.28167 11.2811 8.05767C11.4047 7.83601 11.4934 7.54434 11.4934 7.16634Z",fill:"url(#paint_linear_7)","fill-rule":"nonzero"})]),c("g",{class:"star-animate star-1"},[c("path",{id:"星形 13",d:"M2.52162 1.44908L3.9707 1.98535L2.52162 2.52162L1.98535 3.9707L1.44908 2.52162L2.22045e-16 1.98535L1.44908 1.44908L1.98535 0L2.52162 1.44908Z",fill:"url(#paint_linear_8)","fill-rule":"evenodd",transform:"matrix(0.930482,0.366337,-0.366337,0.930482,12.6309,0)"})]),c("g",{class:"star-animate star-2"},[c("path",{id:"星形 12",d:"M2.51914 1.44765L3.9668 1.9834L2.51914 2.51914L1.9834 3.9668L1.44765 2.51914L2.22045e-16 1.9834L1.44765 1.44765L1.9834 0L2.51914 1.44765Z",fill:"url(#paint_linear_9)","fill-rule":"evenodd",transform:"matrix(0.96896,-0.247217,0.247217,0.96896,0,8.04492)"})]),c("g",{class:"star-animate star-3"},[c("path",{id:"星形 11",d:"M1.27011 0.729885L2 1L1.27011 1.27011L1 2L0.729885 1.27011L1.11022e-16 1L0.729885 0.729885L1 0L1.27011 0.729885Z",fill:"url(#paint_linear_10)","fill-rule":"evenodd",transform:"matrix(0.891472,0.453075,-0.453075,0.891472,15.082,10)"})])])])])],-1)),c("div",Ue,[e.msg.contentBlocks&&e.msg.contentBlocks.length>0?(r(!0),u(d,{key:0},v(e.msg.contentBlocks,function(e,t){return r(),u(d,{key:t},["think"===e.type?(r(),u("div",{key:0,class:f(["think-section",{collapsed:e.collapsed}])},[c("div",{class:"think-title",onClick:function(t){return w(_e)(e)}},s(n[10]||(n[10]=[y('<svg class="think-toggle-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-3a31ed57><polyline points="6 9 12 15 18 9" data-v-3a31ed57></polyline></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-3a31ed57><circle cx="12" cy="12" r="10" data-v-3a31ed57></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" data-v-3a31ed57></path><line x1="12" y1="17" x2="12.01" y2="17" data-v-3a31ed57></line></svg> 思考过程 ',3)])),8,De),x(c("div",{class:"think-content"},g(e.content),513),[[b,!e.collapsed]])],2)):"message"===e.type?(r(),u("div",{key:1,class:"message-content",innerHTML:w(V)(e.content)},null,8,Oe)):"tool_call"===e.type?(r(),u("div",{key:2,class:f(["tool-call-card",{completed:"TodoWrite"===e.tool?w($)(e):"completed"===e.status,collapsed:e.collapsed,"todo-card":"TodoWrite"===e.tool}])},[c("div",{class:"tool-call-header",onClick:function(t){return w(Se)(e)}},[n[16]||(n[16]=c("svg",{class:"tool-toggle-icon",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("polyline",{points:"6 9 12 15 18 9"})],-1)),"TodoWrite"===e.tool?(r(),u(d,{key:0},["calling"===e.status?(r(),u("svg",Ne,s(n[11]||(n[11]=[c("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"},null,-1)])))):w($)(e)?(r(),u("svg",Fe,s(n[12]||(n[12]=[c("polyline",{points:"20 6 9 17 4 12"},null,-1)])))):(r(),u("svg",He,s(n[13]||(n[13]=[y('<line x1="8" y1="6" x2="21" y2="6" data-v-3a31ed57></line><line x1="8" y1="12" x2="21" y2="12" data-v-3a31ed57></line><line x1="8" y1="18" x2="21" y2="18" data-v-3a31ed57></line><line x1="3" y1="6" x2="3.01" y2="6" data-v-3a31ed57></line><line x1="3" y1="12" x2="3.01" y2="12" data-v-3a31ed57></line><line x1="3" y1="18" x2="3.01" y2="18" data-v-3a31ed57></line>',6)]))))],64)):(r(),u(d,{key:1},["calling"===e.status?(r(),u("svg",Ze,s(n[14]||(n[14]=[c("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"},null,-1)])))):(r(),u("svg",ze,s(n[15]||(n[15]=[c("polyline",{points:"20 6 9 17 4 12"},null,-1)]))))],64)),c("span",je,[_(g("TodoWrite"===e.tool?"任务计划":e.tool)+" ",1),e.description?(r(),u("div",We,g(e.description),1)):k("",!0)]),"TodoWrite"===e.tool?(r(),u("span",{key:2,class:f(["tool-badge",{success:w($)(e)}])},g("calling"===e.status?"更新中":w($)(e)?"已完成":"进行中"),3)):(r(),u("span",{key:3,class:f(["tool-badge",{success:"completed"===e.status}])},g("calling"===e.status?"调用中":"完成"),3))],8,qe),x(c("div",Ve,["TodoWrite"===e.tool&&e.todoItems&&e.todoItems.length>0?(r(),u("div",$e,[(r(!0),u(d,null,v(e.todoItems,function(e){return r(),u("div",{key:e.id,class:f(["todo-item","todo-"+e.status])},[c("span",Ge,["in_progress"===e.status?(r(),u("svg",Qe,s(n[17]||(n[17]=[c("path",{d:"M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83"},null,-1)])))):"completed"===e.status?(r(),u("svg",Ke,s(n[18]||(n[18]=[c("polyline",{points:"20 6 9 17 4 12"},null,-1)])))):"cancelled"===e.status?(r(),u("svg",Je,s(n[19]||(n[19]=[c("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1),c("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)])))):(r(),u("svg",Xe,s(n[20]||(n[20]=[c("circle",{cx:"12",cy:"12",r:"9"},null,-1)]))))]),c("span",Ye,g(e.content||e.description),1)],2)}),128))])):(r(),u(d,{key:1},[c("div",et,[n[21]||(n[21]=c("div",{class:"tool-args-label"},"参数:",-1)),c("code",null,g(w(G)(e.args)),1)]),e.result?(r(),u("div",tt,[n[22]||(n[22]=c("div",{class:"tool-result-label"},"结果:",-1)),_(" "+g(w(Q)(e.result)),1)])):k("",!0)],64))],512),[[b,!e.collapsed]])],2)):k("",!0)],64)}),128)):(r(),u("div",{key:1,class:"message-content",innerHTML:w(V)(w(ke)(e.msg))},null,8,nt)),i.value?(r(),u("div",ot,[c("button",{class:"continue-btn",onClick:n[1]||(n[1]=function(e){return a("continue")})},s(n[23]||(n[23]=[c("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("polyline",{points:"23 4 23 10 17 10"}),c("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})],-1),_(" 继续 ",-1)])))])):k("",!0),"assistant"===e.msg.role&&e.msg.content?(r(),u("div",at,[c("button",{class:"message-action-btn",title:"复制",disabled:o.isSending,onClick:p},s(n[24]||(n[24]=[c("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),c("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})],-1)])),8,it),e.isLastAssistant?(r(),u("button",{key:0,class:"message-action-btn",title:"重新生成",disabled:o.isSending,onClick:n[2]||(n[2]=function(e){return t.$emit("regenerate")})},s(n[25]||(n[25]=[c("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("path",{d:"M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0118.8-4.3M22 12.5a10 10 0 01-18.8 4.2"})],-1)])),8,lt)):k("",!0),c("button",{class:"message-action-btn",title:"删除",onClick:n[3]||(n[3]=function(e){return t.$emit("delete")})},s(n[26]||(n[26]=[y('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-3a31ed57><polyline points="3 6 5 6 21 6" data-v-3a31ed57></polyline><path d="M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2" data-v-3a31ed57></path><line x1="10" y1="11" x2="10" y2="17" data-v-3a31ed57></line><line x1="14" y1="11" x2="14" y2="17" data-v-3a31ed57></line></svg>',1)])))])):k("",!0)])],64)):k("",!0),(r(),S(P,{to:"body"},[L(M,{name:"preview-fade"},{default:T(function(){return[w(Ce)?(r(),u("div",{key:0,class:"image-preview-overlay",onClick:n[6]||(n[6]=function(){return w(Te)&&w(Te).apply(void 0,arguments)})},[c("img",{src:w(we),alt:"预览图片",class:"image-preview-full",onClick:n[4]||(n[4]=h(function(){},["stop"]))},null,8,rt),c("button",{class:"image-preview-close",onClick:n[5]||(n[5]=function(){return w(Te)&&w(Te).apply(void 0,arguments)})},s(n[28]||(n[28]=[c("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),c("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])))])):k("",!0)]}),_:1})]))],2)}}}),ut=F(st,[["__scopeId","data-v-3a31ed57"]]),ct=m(null),dt=m(!1),pt=m(!1),vt=m(!0),ft=null;function gt(){pt.value||(vt.value=function(){if(!ct.value)return!0;var e=ct.value,t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return n-t-o<150}(),dt.value=!0,ft&&clearTimeout(ft),ft=setTimeout(function(){dt.value=!1},500))}function ht(){dt.value||vt.value&&B(function(){ct.value&&(pt.value=!0,vt.value=!0,ct.value.scrollTo({top:ct.value.scrollHeight,behavior:"smooth"}),setTimeout(function(){pt.value=!1},500))})}function yt(){dt.value=!1,vt.value=!0,B(function(){ct.value&&(pt.value=!0,ct.value.scrollTo({top:ct.value.scrollHeight,behavior:"smooth"}),setTimeout(function(){pt.value=!1},500))})}function mt(e){return Ct.apply(this,arguments)}function Ct(){return(Ct=p(l().m(function e(t){var n,o;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!navigator.clipboard){e.n=2;break}return e.n=1,navigator.clipboard.writeText(t);case 1:e.n=3;break;case 2:(n=document.createElement("textarea")).value=t,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n);case 3:H.request({status:!0,msg:"复制成功"}),e.n=5;break;case 4:e.p=4,o=e.v,H.request({status:!1,msg:"复制失败"}),console.error("复制失败:",o);case 5:return e.a(2)}},e,null,[[0,4]])}))).apply(this,arguments)}function wt(e){e.collapsed=!e.collapsed}function kt(e){e.collapsed=!e.collapsed}var xt={key:0,class:"welcome-message"},bt={class:"suggestion-cards"},_t=["onClick"],St={key:1,class:"message assistant"},Lt={class:"message-body"},Tt=["onClick"],Mt=["innerHTML"],Pt=["onClick"],Bt={class:"tool-name"},At={key:0,class:"tool-call-description"},It={class:"tool-call-details"},Rt={key:0,class:"todo-list"},Et={class:"todo-status-icon"},Ut={key:0,class:"todo-icon-spin",width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},Dt={key:1,width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},Ot={key:2,width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},qt={key:3,width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Nt={class:"todo-description"},Ft={class:"tool-call-args"},Ht={key:0,class:"tool-result-content"},Zt={key:2,class:"typing-indicator"},zt=o({__name:"ChatMain",props:{messages:{},isTyping:{type:Boolean},streamingContentBlocks:{},streamingThinkCollapsed:{type:Boolean},suggestions:{},assistantName:{},isSending:{type:Boolean}},emits:["update:streamingThinkCollapsed","suggestionClick","regenerate","deleteMessage","continue"],setup:function(e,t){var n=t.expose,o=(t.emit,e);function a(e){return function(e,t){for(var n=e.length-1;n>=0;n--)if("assistant"===e[n].role)return n===t;return!1}(o.messages,e)}return A(function(){ct.value&&ct.value.addEventListener("scroll",gt,{passive:!0})}),I(function(){return ct.value&&ct.value.removeEventListener("scroll",gt),void(ft&&clearTimeout(ft))}),n({scrollToBottom:ht,forceScrollToBottom:yt}),function(t,n){return r(),u("div",{class:"chat-messages",ref_key:"chatMessagesRef",ref:ct},[0===e.messages.length?(r(),u("div",xt,[n[1]||(n[1]=c("h2",null,"有什么我能帮你的吗?",-1)),c("div",bt,[(r(!0),u(d,null,v(e.suggestions,function(e,n){return r(),u("div",{key:n,class:"suggestion-card-container"},[c("button",{class:"suggestion-card",onClick:function(n){return t.$emit("suggestionClick",e)}},g(e.question),9,_t)])}),128))])])):k("",!0),(r(!0),u(d,null,v(e.messages,function(i,l){return r(),S(ut,{key:l,msg:i,isSending:e.isSending,isLastAssistant:a(l),isLast:l===e.messages.length-1,assistantName:e.assistantName,onCopy:w(mt),onRegenerate:function(e){return t.$emit("regenerate",l)},onDelete:function(e){return t.$emit("deleteMessage",l)},onToggleThink:function(e){return function(e){!function(e,t){var n=e[t];n&&n.contentBlocks&&n.contentBlocks.forEach(function(e){"think"===e.type&&(e.collapsed=!e.collapsed)})}(o.messages,e)}(l)},onContinue:n[0]||(n[0]=function(e){return t.$emit("continue")})},null,8,["msg","isSending","isLastAssistant","isLast","assistantName","onCopy","onRegenerate","onDelete","onToggleThink"])}),128)),e.streamingContentBlocks.length>0?(r(),u("div",St,[n[10]||(n[10]=c("div",{class:"message-avatar assistant-avatar"},[c("span",{class:"avatar-text"},[c("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 17 24",width:"36.000000",height:"49.000000",fill:"none",customFrame:"#000000"},[c("defs",null,[c("clipPath",{id:"clipPath_0"},[c("rect",{width:"13.000000",height:"13.000000",x:"3.175781",y:"12.000000",fill:"rgb(255,255,255)"})]),c("linearGradient",{id:"paint_linear_5",x1:"9.67578125",x2:"9.67578125",y1:"12.2714844",y2:"25",gradientUnits:"userSpaceOnUse"},[c("stop",{"stop-color":"rgb(207,86,255)",offset:"0","stop-opacity":"1"}),c("stop",{"stop-color":"rgb(139,136,240)",offset:"1","stop-opacity":"1"})]),c("linearGradient",{id:"paint_linear_6",x1:"9.5",x2:"9.5",y1:"14",y2:"24",gradientUnits:"userSpaceOnUse"},[c("stop",{"stop-color":"rgb(207,86,255)",offset:"0","stop-opacity":"1"}),c("stop",{"stop-color":"rgb(139,136,240)",offset:"1","stop-opacity":"1"})]),c("clipPath",{id:"clipPath_1"},[c("rect",{width:"7.000000",height:"7.000000",x:"6.175781",y:"4.000000",fill:"rgb(255,255,255)"})]),c("linearGradient",{id:"paint_linear_7",x1:"9.68390274",x2:"9.68390274",y1:"4.32434082",y2:"10.6896744",gradientUnits:"userSpaceOnUse"},[c("stop",{"stop-color":"rgb(255,192,8)",offset:"0","stop-opacity":"1"}),c("stop",{"stop-color":"rgb(255,222,124)",offset:"1","stop-opacity":"1"})]),c("linearGradient",{id:"paint_linear_8",x1:"1.98535156",x2:"1.98535156",y1:"0",y2:"3.97070312",gradientUnits:"userSpaceOnUse"},[c("stop",{"stop-color":"rgb(255,15,0)",offset:"0","stop-opacity":"1"}),c("stop",{"stop-color":"rgb(255,15,0)",offset:"1","stop-opacity":"0"})]),c("linearGradient",{id:"paint_linear_9",x1:"1.98339844",x2:"1.98339844",y1:"0",y2:"3.96679688",gradientUnits:"userSpaceOnUse"},[c("stop",{"stop-color":"rgb(0,136,255)",offset:"0","stop-opacity":"1"}),c("stop",{"stop-color":"rgb(0,136,255)",offset:"1","stop-opacity":"0"})]),c("linearGradient",{id:"paint_linear_10",x1:"1",x2:"1",y1:"0",y2:"2",gradientUnits:"userSpaceOnUse"},[c("stop",{"stop-color":"rgb(0,255,129)",offset:"0","stop-opacity":"1"}),c("stop",{"stop-color":"rgb(0,255,129)",offset:"1","stop-opacity":"0"})])]),c("g",{id:"组合 286"},[c("g",{id:"svg 155",opacity:"0","clip-path":"url(#clipPath_0)",customFrame:"url(#clipPath_0)"},[c("rect",{id:"svg 155",width:"13.000000",height:"13.000000",x:"3.175781",y:"12.000000"}),c("path",{id:"合并",d:"M10.2174 13.6896C10.3837 13.5406 10.4883 13.3245 10.4883 13.084C10.4883 12.9289 10.4439 12.777 10.3603 12.6463C10.2767 12.5156 10.1575 12.4115 10.0166 12.3464C9.87581 12.2814 9.71929 12.258 9.56558 12.279C9.41188 12.3 9.26741 12.3646 9.14925 12.4652C9.0311 12.5657 8.94419 12.698 8.89882 12.8463C8.85344 12.9947 8.85148 13.1529 8.89318 13.3024C8.93487 13.4518 9.01848 13.5862 9.13411 13.6896L9.13411 14.709L6.42578 14.709C6.14053 14.709 5.86031 14.7841 5.61328 14.9267C5.36625 15.0693 5.16111 15.2745 5.01849 15.5215C4.87587 15.7685 4.80078 16.0488 4.80078 16.334L4.80078 21.7507C4.80078 22.0359 4.87587 22.3161 5.01849 22.5632C5.16111 22.8102 5.36625 23.0153 5.61328 23.158C5.86031 23.3006 6.14053 23.3757 6.42578 23.3757L12.9258 23.3757C13.211 23.3757 13.4912 23.3006 13.7383 23.158C13.9853 23.0153 14.1904 22.8102 14.3331 22.5632C14.4757 22.3161 14.5508 22.0359 14.5508 21.7507L14.5508 16.334C14.5508 16.0488 14.4757 15.7685 14.3331 15.5215C14.1904 15.2745 13.9853 15.0693 13.7383 14.9267C13.4912 14.7841 13.211 14.709 12.9258 14.709L10.2174 14.709L10.2174 13.6896ZM4.25911 17.4173L3.17578 17.4173L3.17578 20.6673L4.25911 20.6673L4.25911 17.4173ZM15.0924 17.4173L16.1758 17.4173L16.1758 20.6673L15.0924 20.6673L15.0924 17.4173ZM8.52836 19.6997C8.38954 19.8005 8.22236 19.8548 8.05078 19.8548C7.8792 19.8548 7.71202 19.8005 7.57321 19.6997C7.43439 19.5988 7.33107 19.4566 7.27805 19.2934C7.22503 19.1302 7.22503 18.9544 7.27805 18.7913C7.33107 18.6281 7.43439 18.4859 7.57321 18.385C7.71202 18.2842 7.8792 18.2298 8.05078 18.2298C8.22236 18.2298 8.38954 18.2842 8.52836 18.385C8.66717 18.4859 8.77049 18.6281 8.82351 18.7913C8.87654 18.9544 8.87654 19.1302 8.82351 19.2934C8.77049 19.4566 8.66717 19.5988 8.52836 19.6997ZM11.5519 18.2696C11.715 18.3226 11.8573 18.4259 11.9581 18.5648C12.059 18.7036 12.1133 18.8708 12.1133 19.0423C12.1133 19.2139 12.059 19.3811 11.9581 19.5199C11.8573 19.6587 11.715 19.762 11.5519 19.8151C11.3887 19.8681 11.2129 19.8681 11.0497 19.8151C10.8865 19.762 10.7443 19.6587 10.6435 19.5199C10.5426 19.3811 10.4883 19.2139 10.4883 19.0423C10.4883 18.8708 10.5426 18.7036 10.6435 18.5648C10.7443 18.4259 10.8865 18.3226 11.0497 18.2696C11.2129 18.2166 11.3887 18.2166 11.5519 18.2696ZM13.1758 24.5C13.1758 24.2239 12.9519 24 12.6758 24L6.67578 24C6.39964 24 6.17578 24.2239 6.17578 24.5C6.17578 24.7761 6.39964 25 6.67578 25L12.6758 25C12.9519 25 13.1758 24.7761 13.1758 24.5Z",fill:"url(#paint_linear_5)","fill-rule":"evenodd"})]),c("g",{id:"组合 302"},[c("path",{id:"合并",d:"M11.3235 14.9659C11.6203 14.7183 11.61 14.0359 11.858 14.0093C12.4372 13.9472 13.1075 14.188 12.5669 14.9628C12.386 15.2222 12.0044 15.5484 11.5768 15.8676C11.7643 15.8935 11.9503 15.9222 12.1341 15.9532C12.9111 15.3147 14.3915 14.1808 14.9377 14.3283C15.4628 14.4701 15.1245 15.7963 14.8697 16.5908C15.9414 16.9049 16.6428 17.1837 16.6428 17.1837C16.6428 17.1837 17 18.2593 15.214 18.6192C14.6008 18.7427 14.7913 18.9199 15.2188 19.3176C15.422 19.5067 15.6788 19.7456 15.9284 20.0523C16.683 20.9798 17 22.5628 17 22.5628L14.857 21.8466L15.5712 22.9217L14.4998 22.9213L14.8569 23.9986L14.1426 23.2806L13.5384 23.9984L12.7146 23.9975L6.29425 23.9974L6.28544 23.9989L5.46131 23.9971L4.85743 23.282L4.14314 24L4.50021 22.9227L3.4288 22.9231L4.14295 21.848L2 22.5642C2 22.5642 2.31699 20.9812 3.07164 20.0537C3.32118 19.747 3.57798 19.5081 3.78121 19.319C4.20873 18.9213 4.39916 18.7441 3.78601 18.6206C1.99995 18.2607 2.35723 17.1851 2.35723 17.1851C2.35723 17.1851 3.05857 16.9063 4.13026 16.5922C3.87555 15.7977 3.53719 14.4715 4.06231 14.3297C4.60851 14.1822 6.08893 15.3161 6.86593 15.9546C7.0497 15.9236 7.23569 15.8949 7.42319 15.869C6.99561 15.5498 6.61404 15.2236 6.43307 14.9642C5.89247 14.1894 6.56276 13.9487 7.14196 14.0107C7.38998 14.0373 7.3797 14.7197 7.6765 14.9673C7.89071 15.1461 7.89864 15.0288 7.9076 14.8963C7.91522 14.7836 7.92357 14.66 8.06005 14.698C8.35707 14.7807 8.51548 14.8066 8.51968 15.0414C8.5217 15.1545 8.48678 15.2615 8.45302 15.365C8.41677 15.4761 8.38186 15.583 8.39545 15.6892C8.39935 15.7196 8.40974 15.7426 8.42535 15.7609C8.74972 15.7364 9.07491 15.7225 9.39745 15.7218C9.78695 15.7156 10.1814 15.7297 10.5746 15.7595C10.5903 15.7412 10.6006 15.7182 10.6045 15.6878C10.6181 15.5816 10.5832 15.4747 10.547 15.3636C10.5132 15.2601 10.4783 15.1531 10.4803 15.04C10.4845 14.8052 10.6429 14.7793 10.9399 14.6966C11.0764 14.6586 11.0848 14.7822 11.0924 14.8949C11.1014 15.0274 11.1093 15.1447 11.3235 14.9659Z",fill:"url(#paint_linear_6)","fill-rule":"evenodd"}),c("ellipse",{id:"椭圆 85",rx:"0.576923",ry:"0.579347",cx:"7.19215727",cy:"21.531496",fill:"rgb(255,255,255)"}),c("ellipse",{id:"椭圆 86",rx:"0.576923",ry:"0.579347",cx:"11.8076363",cy:"21.531496",fill:"rgb(255,255,255)"}),c("path",{id:"椭圆 87",d:"M8.47187 21.8046C8.27093 21.6029 7.99841 21.4895 7.71425 21.4895C7.43009 21.4895 7.15757 21.6029 6.95664 21.8046C6.7557 22.0064 6.64282 22.2801 6.64282 22.5654L6.95076 22.5654C6.95076 22.3621 7.0312 22.1671 7.17438 22.0233C7.31757 21.8795 7.51176 21.7987 7.71425 21.7987C7.91674 21.7987 8.11094 21.8795 8.25412 22.0233C8.3973 22.1671 8.47774 22.3621 8.47774 22.5654L8.78568 22.5654C8.78568 22.2801 8.6728 22.0064 8.47187 21.8046Z",opacity:"0",fill:"rgb(255,255,255)","fill-rule":"evenodd"}),c("path",{id:"椭圆 88",d:"M12.0434 21.8046C11.8425 21.6029 11.5699 21.4895 11.2858 21.4895C11.0016 21.4895 10.7291 21.6029 10.5282 21.8046C10.3272 22.0064 10.2144 22.2801 10.2144 22.5654L10.5223 22.5654C10.5223 22.3621 10.6027 22.1671 10.7459 22.0233C10.8891 21.8795 11.0833 21.7987 11.2858 21.7987C11.4883 21.7987 11.6825 21.8795 11.8257 22.0233C11.9688 22.1671 12.0493 22.3621 12.0493 22.5654L12.3572 22.5654C12.3572 22.2801 12.2443 22.0064 12.0434 21.8046Z",opacity:"0",fill:"rgb(255,255,255)","fill-rule":"evenodd"}),c("path",{id:"矢量 2577",d:"M9.49975 22.1108L9.50002 22.8831L10.0769 23.2692M9.50002 22.8831L8.9231 23.2695",stroke:"rgb(255,255,255)","stroke-linecap":"round","stroke-width":"0.200000"})]),c("g",{id:"svg 154","clip-path":"url(#clipPath_1)",customFrame:"url(#clipPath_1)",class:"lightbulb-glow"},[c("rect",{id:"svg 154",width:"7.000000",height:"7.000000",x:"6.175781",y:"4.000000"}),c("path",{id:"矢量 2565",d:"M7.59674 7.16634C7.59674 7.07301 7.60374 6.97967 7.6154 6.89101L6.91074 6.89101C6.80107 6.89101 6.7124 6.97734 6.7124 7.08467C6.7124 7.19201 6.80107 7.27834 6.91074 7.27834L7.59907 7.27834C7.59674 7.24101 7.59674 7.20367 7.59674 7.16634ZM7.58274 8.86967C7.50574 8.94667 7.50574 9.06801 7.58274 9.14501C7.65974 9.21967 7.78574 9.21967 7.86274 9.14501L8.2244 8.79034C8.14274 8.69934 8.0564 8.59901 7.97707 8.48467L7.58274 8.86967ZM8.0844 5.78967C8.16607 5.68701 8.25707 5.59367 8.3574 5.50734L7.86507 5.02434C7.78807 4.94734 7.66207 4.94734 7.58507 5.02434C7.50807 5.09901 7.50807 5.22267 7.58507 5.29967L8.0844 5.78967ZM10.1891 10.3187L9.18107 10.3187C9.07607 10.3187 8.99207 10.4027 8.99207 10.503C8.99207 10.6057 9.07607 10.6897 9.18107 10.6897L10.1891 10.6897C10.2941 10.6897 10.3781 10.6057 10.3781 10.503C10.3781 10.4003 10.2917 10.3187 10.1891 10.3187ZM9.68507 5.16667L9.68974 5.16667C9.75507 5.16667 9.81807 5.17134 9.88107 5.17601L9.88107 4.51801C9.88107 4.41067 9.7924 4.32434 9.68274 4.32434C9.57307 4.32434 9.4844 4.41067 9.4844 4.51801L9.4844 5.17601C9.5474 5.16901 9.61274 5.16667 9.67574 5.16667L9.68507 5.16667ZM11.2857 5.78967L11.7851 5.29967C11.8621 5.22501 11.8621 5.10134 11.7851 5.02434C11.7081 4.94734 11.5821 4.94734 11.5051 5.02434L11.0127 5.50734C11.1107 5.59367 11.2017 5.68701 11.2857 5.78967ZM11.3884 8.48234C11.3067 8.59901 11.2227 8.69701 11.1411 8.78801L11.5027 9.14267C11.5797 9.21734 11.7057 9.21734 11.7827 9.14267C11.8597 9.06567 11.8597 8.94434 11.7827 8.86734L11.3884 8.48234ZM10.1891 9.84967L9.18107 9.84967C9.07607 9.84967 8.99207 9.93134 8.99207 10.0363C8.99207 10.139 9.07607 10.2207 9.18107 10.2207L10.1891 10.2207C10.2941 10.2207 10.3781 10.1367 10.3781 10.0363C10.3781 9.93134 10.2917 9.84967 10.1891 9.84967ZM12.4571 6.89101L11.7524 6.89101C11.7641 6.98201 11.7711 7.07301 11.7711 7.16634C11.7711 7.20367 11.7711 7.24101 11.7687 7.27834L12.4571 7.27834C12.5667 7.27834 12.6554 7.19201 12.6554 7.08467C12.6531 6.97734 12.5667 6.89101 12.4571 6.89101ZM11.4934 7.16634C11.4934 6.76501 11.3581 6.39401 11.1271 6.09534C10.9264 5.83401 10.6511 5.62867 10.3337 5.50967L10.3361 5.50034L10.2007 5.46067C10.0957 5.43034 9.98607 5.40934 9.8764 5.39767L9.86007 5.39534C9.8064 5.39067 9.7504 5.38601 9.68974 5.38601L9.6804 5.38601C9.62207 5.38601 9.56607 5.39067 9.51007 5.39534L9.49373 5.39767C9.38407 5.40934 9.2744 5.43034 9.1694 5.46067L9.03873 5.49801L9.04107 5.50734C8.7214 5.62867 8.44607 5.83401 8.24307 6.09534C8.0144 6.39401 7.87674 6.76501 7.87674 7.16634C7.87674 7.45567 7.92807 7.69134 8.0074 7.88734C8.1264 8.18134 8.30607 8.37967 8.45307 8.53134C8.5254 8.60601 8.59074 8.67134 8.63274 8.72501C8.67707 8.78101 8.69807 8.82301 8.70507 8.85567C8.73773 9.02134 8.74007 9.22901 8.74007 9.28034L8.74007 9.29667C8.74007 9.53467 8.93607 9.72601 9.17873 9.72601L9.5194 9.72601L9.5194 8.04601L9.0294 7.55834C8.96873 7.50001 8.96873 7.40201 9.0294 7.34367C9.09007 7.28534 9.18573 7.28534 9.24407 7.34367L9.67107 7.76834L10.0981 7.34367C10.1587 7.28534 10.2544 7.28534 10.3127 7.34367C10.3734 7.40201 10.3734 7.50001 10.3127 7.55834L9.82273 8.04601L9.82273 9.72367L10.1914 9.72367C10.4341 9.72367 10.6301 9.53001 10.6301 9.29434L10.6301 9.28034C10.6301 9.22901 10.6324 9.01901 10.6651 8.85567C10.6697 8.83234 10.6791 8.80667 10.7001 8.77401C10.7351 8.71801 10.8004 8.64801 10.8821 8.56634C11.0034 8.44034 11.1574 8.28167 11.2811 8.05767C11.4047 7.83601 11.4934 7.54434 11.4934 7.16634Z",fill:"url(#paint_linear_7)","fill-rule":"nonzero"})]),c("g",{class:"star-animate star-1"},[c("path",{id:"星形 13",d:"M2.52162 1.44908L3.9707 1.98535L2.52162 2.52162L1.98535 3.9707L1.44908 2.52162L2.22045e-16 1.98535L1.44908 1.44908L1.98535 0L2.52162 1.44908Z",fill:"url(#paint_linear_8)","fill-rule":"evenodd",transform:"matrix(0.930482,0.366337,-0.366337,0.930482,12.6309,0)"})]),c("g",{class:"star-animate star-2"},[c("path",{id:"星形 12",d:"M2.51914 1.44765L3.9668 1.9834L2.51914 2.51914L1.9834 3.9668L1.44765 2.51914L2.22045e-16 1.9834L1.44765 1.44765L1.9834 0L2.51914 1.44765Z",fill:"url(#paint_linear_9)","fill-rule":"evenodd",transform:"matrix(0.96896,-0.247217,0.247217,0.96896,0,8.04492)"})]),c("g",{class:"star-animate star-3"},[c("path",{id:"星形 11",d:"M1.27011 0.729885L2 1L1.27011 1.27011L1 2L0.729885 1.27011L1.11022e-16 1L0.729885 0.729885L1 0L1.27011 0.729885Z",fill:"url(#paint_linear_10)","fill-rule":"evenodd",transform:"matrix(0.891472,0.453075,-0.453075,0.891472,15.082,10)"})])])])])],-1)),c("div",Lt,[(r(!0),u(d,null,v(e.streamingContentBlocks,function(e,t){return r(),u(d,{key:t},["think"===e.type?(r(),u("div",{key:0,class:f(["think-section",{collapsed:e.collapsed}])},[c("div",{class:"think-title",onClick:function(t){return w(wt)(e)}},s(n[2]||(n[2]=[y('<svg class="think-toggle-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-4a4775cd><polyline points="6 9 12 15 18 9" data-v-4a4775cd></polyline></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-4a4775cd><circle cx="12" cy="12" r="10" data-v-4a4775cd></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" data-v-4a4775cd></path><line x1="12" y1="17" x2="12.01" y2="17" data-v-4a4775cd></line></svg> 思考过程 ',3)])),8,Tt),x(c("div",{class:"think-content"},g(e.content),513),[[b,!e.collapsed]])],2)):"message"===e.type?(r(),u("div",{key:1,class:"message-content",innerHTML:e.renderedHtml||w(V)(e.content)},null,8,Mt)):"tool_call"===e.type?(r(),u("div",{key:2,class:f(["tool-call-card",{completed:"TodoWrite"===e.tool?w($)(e):"completed"===e.status,collapsed:e.collapsed,"todo-card":"TodoWrite"===e.tool}])},[c("div",{class:"tool-call-header",onClick:function(t){return w(kt)(e)}},[n[3]||(n[3]=c("svg",{class:"tool-toggle-icon",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("polyline",{points:"6 9 12 15 18 9"})],-1)),c("span",Bt,[_(g("TodoWrite"===e.tool?"任务计划":e.tool)+" ",1),e.description?(r(),u("div",At,g(e.description),1)):k("",!0)]),"TodoWrite"===e.tool?(r(),u("span",{key:0,class:f(["tool-badge",{success:w($)(e)}])},g("calling"===e.status?"更新中":w($)(e)?"已完成":"进行中"),3)):(r(),u("span",{key:1,class:f(["tool-badge",{success:"completed"===e.status}])},g("calling"===e.status?"调用中":"完成"),3))],8,Pt),x(c("div",It,["TodoWrite"===e.tool&&e.todoItems&&e.todoItems.length>0?(r(),u("div",Rt,[(r(!0),u(d,null,v(e.todoItems,function(e){return r(),u("div",{key:e.id,class:f(["todo-item","todo-"+e.status])},[c("span",Et,["in_progress"===e.status?(r(),u("svg",Ut,s(n[4]||(n[4]=[c("path",{d:"M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83"},null,-1)])))):"completed"===e.status?(r(),u("svg",Dt,s(n[5]||(n[5]=[c("polyline",{points:"20 6 9 17 4 12"},null,-1)])))):"cancelled"===e.status?(r(),u("svg",Ot,s(n[6]||(n[6]=[c("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1),c("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)])))):(r(),u("svg",qt,s(n[7]||(n[7]=[c("circle",{cx:"12",cy:"12",r:"9"},null,-1)]))))]),c("span",Nt,g(e.content||e.description),1)],2)}),128))])):(r(),u(d,{key:1},[c("div",Ft,[n[8]||(n[8]=c("div",{class:"tool-args-label"},"参数:",-1)),c("code",null,g(w(G)(e.args)),1)]),e.result?(r(),u("div",Ht,[n[9]||(n[9]=c("div",{class:"tool-result-label"},"结果:",-1)),_(" "+g(w(Q)(e.result)),1)])):k("",!0)],64))],512),[[b,!e.collapsed]])],2)):k("",!0)],64)}),128))])])):k("",!0),e.isTyping?(r(),u("div",Zt,s(n[11]||(n[11]=[c("div",{class:"typing-dots"},[c("div",{class:"typing-dot"}),c("div",{class:"typing-dot"}),c("div",{class:"typing-dot"})],-1)])))):k("",!0)],512)}}}),jt=F(zt,[["__scopeId","data-v-4a4775cd"]]),Wt={class:"popover-header"},Vt={class:"tool-search-bar"},$t=["value"],Gt={class:"popover-content"},Qt={key:0,class:"popover-loading"},Kt={key:1,class:"tool-search-empty"},Jt={key:2,class:"tool-list"},Xt=["onClick"],Yt=["onClick"],en={class:"tool-info"},tn={class:"tool-name"},nn={key:0,class:"risk-badge"},on=o({__name:"ToolSelectPopover",props:{showToolPopover:{type:Boolean},toolPopoverPosition:{},toolsLoading:{type:Boolean},toolSearchQuery:{},groupedTools:{},isToolSelected:{type:Function},isCategoryAllSelected:{type:Function},isCategoryPartialSelected:{type:Function}},emits:["update:showToolPopover","update:toolSearchQuery","toggleToolSelection","toggleCategorySelection"],setup:function(e,t){var n=t.emit;function o(e){var t=e.target;n("update:toolSearchQuery",t.value)}return function(t,a){return r(),S(M,{name:"popover-fade"},{default:T(function(){return[e.showToolPopover?(r(),u("div",{key:0,class:"custom-popover",style:R(e.toolPopoverPosition)},[c("div",Wt,[a[3]||(a[3]=c("span",{class:"popover-title"},"选择工具",-1)),c("button",{class:"popover-close",onClick:a[0]||(a[0]=function(e){return n("update:showToolPopover",!1)})},s(a[2]||(a[2]=[c("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),c("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])))]),c("div",Vt,[a[5]||(a[5]=c("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",class:"tool-search-icon"},[c("circle",{cx:"11",cy:"11",r:"8"}),c("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),c("input",{class:"tool-search-input",value:e.toolSearchQuery,onInput:o,placeholder:"搜索工具名称...",type:"text"},null,40,$t),e.toolSearchQuery?(r(),u("button",{key:0,class:"tool-search-clear",onClick:a[1]||(a[1]=h(function(e){return n("update:toolSearchQuery","")},["stop"]))},s(a[4]||(a[4]=[c("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),c("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])))):k("",!0)]),c("div",Gt,[e.toolsLoading?(r(),u("div",Qt,s(a[6]||(a[6]=[c("div",{class:"loading-spinner"},null,-1),c("span",null,"加载中...",-1)])))):0===Object.keys(e.groupedTools).length?(r(),u("div",Kt," 未找到匹配的工具 ")):(r(),u("div",Jt,[(r(!0),u(d,null,v(e.groupedTools,function(t,o){return r(),u(d,{key:o},[c("div",{class:"tool-category",onClick:function(e){return n("toggleCategorySelection",t)}},[c("span",null,g(o),1),c("div",{class:f(["category-switch",{active:e.isCategoryAllSelected(t),partial:e.isCategoryPartialSelected(t)}])},s(a[7]||(a[7]=[c("div",{class:"category-switch-slider"},null,-1)])),2)],8,Xt),(r(!0),u(d,null,v(t,function(t){return r(),u("div",{key:t.id,class:"tool-item",onClick:function(e){return n("toggleToolSelection",t)}},[c("div",en,[c("span",tn,g(t.name),1),t.risk_level&&"low"!==t.risk_level?(r(),u("span",nn," 风险 ")):k("",!0)]),c("div",{class:f(["tool-switch",{active:e.isToolSelected(t.id)}])},s(a[8]||(a[8]=[c("div",{class:"tool-switch-slider"},null,-1)])),2)],8,Yt)}),128))],64)}),128))]))])],4)):k("",!0)]}),_:1})}}}),an=F(on,[["__scopeId","data-v-5c2c8682"]]),ln={class:"popover-header"},rn={class:"popover-content"},sn=o({__name:"UploadPopover",props:{showUploadPopover:{type:Boolean},uploadPopoverPosition:{}},emits:["update:showUploadPopover","selectLocalFile","selectLocalDir","selectServerFile"],setup:function(e,t){var n=t.emit;return function(t,o){return r(),S(M,{name:"popover-fade"},{default:T(function(){return[e.showUploadPopover?(r(),u("div",{key:0,class:"custom-popover upload-popover",style:R(e.uploadPopoverPosition)},[c("div",ln,[o[5]||(o[5]=c("span",{class:"popover-title"},"上传文件",-1)),c("button",{class:"popover-close",onClick:o[0]||(o[0]=function(e){return n("update:showUploadPopover",!1)})},s(o[4]||(o[4]=[c("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),c("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])))]),c("div",rn,[c("div",{class:"upload-option",onClick:o[1]||(o[1]=function(e){return n("selectLocalFile")})},s(o[6]||(o[6]=[c("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"}),c("polyline",{points:"17 8 12 3 7 8"}),c("line",{x1:"12",y1:"3",x2:"12",y2:"15"})],-1),c("span",null,"本地文件上传",-1)]))),c("div",{class:"upload-option",onClick:o[2]||(o[2]=function(e){return n("selectLocalDir")})},s(o[7]||(o[7]=[c("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("path",{d:"M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z"})],-1),c("span",null,"本地目录上传",-1)]))),c("div",{class:"upload-option",onClick:o[3]||(o[3]=function(e){return n("selectServerFile")})},s(o[8]||(o[8]=[c("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2.18",ry:"2.18"}),c("line",{x1:"7",y1:"2",x2:"7",y2:"22"}),c("line",{x1:"17",y1:"2",x2:"17",y2:"22"}),c("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),c("line",{x1:"2",y1:"7",x2:"7",y2:"7"}),c("line",{x1:"2",y1:"17",x2:"7",y2:"17"}),c("line",{x1:"17",y1:"17",x2:"22",y2:"17"}),c("line",{x1:"17",y1:"7",x2:"22",y2:"7"})],-1),c("span",null,"从服务器选择",-1)])))])],4)):k("",!0)]}),_:1})}}}),un=F(sn,[["__scopeId","data-v-0d592f1b"]]),cn=o({__name:"AtPopover",props:{showAtPopover:{type:Boolean},atPopoverPosition:{},atSelectedIndex:{}},emits:["update:atSelectedIndex","selectServerFile","selectSite"],setup:function(e,t){var n=t.emit;function o(){n("update:atSelectedIndex",0),n("selectServerFile")}function a(){n("update:atSelectedIndex",1),n("selectSite")}return function(t,i){return r(),S(M,{name:"popover-fade"},{default:T(function(){return[e.showAtPopover?(r(),u("div",{key:0,class:"at-mention-popover",style:R(e.atPopoverPosition)},[c("div",{class:f(["at-mention-option",{active:0===e.atSelectedIndex}]),onClick:o,onMouseenter:i[0]||(i[0]=function(e){return n("update:atSelectedIndex",0)})},s(i[2]||(i[2]=[c("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2.18",ry:"2.18"}),c("line",{x1:"7",y1:"2",x2:"7",y2:"22"}),c("line",{x1:"17",y1:"2",x2:"17",y2:"22"}),c("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),c("line",{x1:"2",y1:"7",x2:"7",y2:"7"}),c("line",{x1:"2",y1:"17",x2:"7",y2:"17"}),c("line",{x1:"17",y1:"17",x2:"22",y2:"17"}),c("line",{x1:"17",y1:"7",x2:"22",y2:"7"})],-1),c("span",null,"从服务器选择文件",-1),c("span",{class:"at-mention-hint"},"按 Enter 选择",-1)])),34),c("div",{class:f(["at-mention-option",{active:1===e.atSelectedIndex}]),onClick:a,onMouseenter:i[1]||(i[1]=function(e){return n("update:atSelectedIndex",1)})},s(i[3]||(i[3]=[c("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("circle",{cx:"12",cy:"12",r:"10"}),c("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),c("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})],-1),c("span",null,"选择网站",-1),c("span",{class:"at-mention-hint"},"按 Enter 选择",-1)])),34)],4)):k("",!0)]}),_:1})}}}),dn=F(cn,[["__scopeId","data-v-590232cb"]]),pn={key:0,class:"site-search-loading"},vn={key:1,class:"site-search-empty"},fn=["onClick","onMouseenter"],gn={class:"site-name"},hn={class:"site-type-badge"},yn=o({__name:"SiteSearchPopover",props:{showSiteSearchPopover:{type:Boolean},atPopoverPosition:{},siteSearchLoading:{type:Boolean},siteSearchResults:{},siteSelectedIndex:{}},emits:["update:siteSelectedIndex","selectSite"],setup:function(e,t){var n=t.emit;return function(t,o){return r(),S(M,{name:"popover-fade"},{default:T(function(){return[e.showSiteSearchPopover?(r(),u("div",{key:0,class:"at-mention-popover site-search-popover",style:R(e.atPopoverPosition)},[o[2]||(o[2]=c("div",{class:"site-search-tip"},"输入自动搜索域名",-1)),e.siteSearchLoading?(r(),u("div",pn,s(o[0]||(o[0]=[c("span",null,"搜索中...",-1)])))):0===e.siteSearchResults.length?(r(),u("div",vn,s(o[1]||(o[1]=[c("span",null,"无匹配网站",-1)])))):(r(!0),u(d,{key:2},v(e.siteSearchResults,function(t,o){return r(),u("div",{key:t.name,class:f(["site-search-item",{active:o===e.siteSelectedIndex}]),onClick:function(e){return function(e){n("update:siteSelectedIndex",e),n("selectSite")}(o)},onMouseenter:function(e){return n("update:siteSelectedIndex",o)}},[c("span",{class:f(["site-status-dot",{online:"1"===t.status}])},null,2),c("span",gn,g(t.name),1),c("span",hn,g(t.project_type),1)],42,fn)}),128))],4)):k("",!0)]}),_:1})}}}),mn=F(yn,[["__scopeId","data-v-ac53de71"]]);function Cn(e,t){var n=m(null),o=m(null),r=m(null),u=m(null),c=m(null),d=m(null),v=m(""),f=m(!1),g=m(""),h=m({top:"0px",left:"0px"}),y=m([]),w=m([]),k=m([]),x=m([]),b=m(!1),_=m(!1),S=m(""),L=m({bottom:"0px",left:"0px"}),T=m({bottom:"0px",left:"0px"}),M=m({bottom:"0px",left:"0px"}),P=m(!1),A=m({bottom:"0px",left:"0px",width:"0px"}),I=m(null),R=m(null),U=m(0),D=m(null),O=m(!1),q=m([]),N=m(!1),F=m(0),Z=null;E(function(){return e.inputMessage},function(e){n.value&&n.value.textContent!==e&&(n.value.textContent=e)}),E(function(){return e.showModelPopover},function(e){e&&B(function(){T.value=he(o.value)})}),E(function(){return e.showToolPopover},function(e){e?B(function(){M.value=he(r.value)}):v.value=""});var z=C(function(){return e.selectedTools.slice(0,5)}),j=C(function(){return e.selectedTools.slice(5)}),W=C(function(){var t=v.value.trim().toLowerCase(),n=e.toolsList.filter(function(e){return e.show}),o=t?n.filter(function(e){return e.name.toLowerCase().includes(t)}):n,a={};return o.forEach(function(e){var t=e.category||"其他";a[t]||(a[t]=[]),a[t].push(e)}),a});function V(){n.value&&(n.value.style.height="auto",n.value.style.height="".concat(Math.min(n.value.scrollHeight,120),"px"),P.value&&$())}function $(){var e=document.querySelector(".chat-main"),t=null==e?void 0:e.getBoundingClientRect();if(t){var n=document.querySelector(".chat-input-wrapper"),o=null==n?void 0:n.getBoundingClientRect();if(o){A.value={bottom:"".concat(o.bottom-o.top+45,"px"),left:"".concat(o.left-t.left,"px"),width:"".concat(o.width,"px")}}}}function G(){P.value=!1,Y({type:"all",path:"/",change:function(e){Q(e)}},{customClass:"top-index"})}function Q(e){if(n.value){var o=e.split("/").pop()||e,a=Date.now().toString(),i=document.createElement("span");if(i.className="file-tag truncate",i.contentEditable="false",i.dataset.id=a,i.dataset.path=e,i.textContent="@".concat(o),R.value&&null!==I.value){var l=R.value,r=l.textContent||"",s=I.value;if("@"===r[s]){var u=r.substring(0,s),c=r.substring(s+1);l.textContent=u+c;var d=document.createRange();d.setStart(l,s),d.setEnd(l,s),d.insertNode(i);var p=document.createTextNode(" ");d.setStartAfter(i),d.insertNode(p),d.setStartAfter(p),d.collapse(!0);var v=window.getSelection();v&&(v.removeAllRanges(),v.addRange(d)),w.value.push({id:a,path:e,name:o}),I.value=null,R.value=null,t("update:inputMessage",n.value.textContent||""),B(function(){return V()})}else pe(e)}else pe(e)}}function K(){var e;if(P.value=!1,R.value&&null!==I.value){var o=R.value,a=o.textContent||"",i=I.value;if("@"===a[i]){var l=a.substring(0,i),r=a.substring(i+1);o.textContent="".concat(l,"@site:").concat(r);var s=window.getSelection();if(s){var u=document.createRange(),c=i+6;u.setStart(o,Math.min(c,o.textContent.length)),u.collapse(!0),s.removeAllRanges(),s.addRange(u)}}O.value=!0,F.value=0,$(),te(""),t("update:inputMessage",(null===(e=n.value)||void 0===e?void 0:e.textContent)||"")}}function te(e){Z&&clearTimeout(Z),Z=setTimeout(function(){!function(e){ne.apply(this,arguments)}(e)},300)}function ne(){return(ne=p(l().m(function e(t){var n,o;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return N.value=!0,e.p=1,e.n=2,ee({name:t,limit:5});case 2:n=e.v,(o=n.data).status?(q.value=o.data||[],F.value=0):q.value=[],e.n=4;break;case 3:e.p=3,e.v,q.value=[];case 4:return e.p=4,N.value=!1,e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}))).apply(this,arguments)}function oe(){if(0!==q.value.length){var e=q.value[F.value];e&&(O.value=!1,Z&&(clearTimeout(Z),Z=null),function(e){if(!n.value)return;var o=Date.now().toString(),a="@site:".concat(e),i=document.createElement("span");if(i.className="site-tag truncate",i.contentEditable="false",i.dataset.id=o,i.dataset.name=e,i.textContent=a,R.value&&null!==I.value){var l=R.value,r=l.textContent||"",s=I.value,u=s+1;for("@site:"===r.substring(s,s+6)&&(u=s+6);u<r.length&&" "!==r[u]&&" "!==r[u];)u++;var c=r.substring(0,s),d=r.substring(u);l.textContent=c+d;var p=document.createRange();p.setStart(l,s),p.collapse(!0),p.insertNode(i);var v=document.createTextNode(" ");p.setStartAfter(i),p.insertNode(v),p.setStartAfter(v),p.collapse(!0);var f=window.getSelection();f&&(f.removeAllRanges(),f.addRange(p))}else{n.value.focus();var g=window.getSelection();if(g&&g.rangeCount>0){var h=g.getRangeAt(0);if(n.value.contains(h.commonAncestorContainer)){h.deleteContents(),h.insertNode(i);var y=document.createTextNode(" ");h.setStartAfter(i),h.insertNode(y),h.setStartAfter(y),h.collapse(!0),g.removeAllRanges(),g.addRange(h)}else{n.value.appendChild(i);var m=document.createTextNode(" ");n.value.appendChild(m),de()}}else{n.value.appendChild(i);var C=document.createTextNode(" ");n.value.appendChild(C),de()}}k.value.push({id:o,name:e}),I.value=null,R.value=null,t("update:inputMessage",n.value.textContent||""),B(function(){return V()})}(e.name))}}function ae(){return(ae=p(l().m(function e(t){var n,o,a,i,r,s,u,c,d,p,v,f,g,h,y,m,C,w;return l().w(function(e){for(;;)switch(e.n){case 0:if(b.value=!1,o=null===(n=t.dataTransfer)||void 0===n?void 0:n.items){e.n=1;break}return e.a(2);case 1:a=[],i=[],r=0,s=Array.from(o);case 2:if(!(r<s.length)){e.n=9;break}if("file"===(c=s[r]).kind){e.n=3;break}return e.a(3,8);case 3:if(!(d=null===(u=c.webkitGetAsEntry)||void 0===u?void 0:u.call(c))){e.n=7;break}if(!d.isDirectory){e.n=5;break}return e.n=4,ie(d);case 4:(p=e.v).files.length>0&&i.push(p),e.n=6;break;case 5:d.isFile&&(v=c.getAsFile())&&a.push(v);case 6:e.n=8;break;case 7:(f=c.getAsFile())&&a.push(f);case 8:r++,e.n=2;break;case 9:for(g=0,h=a;g<h.length;g++)(y=h[g]).type.startsWith("image/")?le(y):re(y);for(m=0,C=i;m<C.length;m++)(w=C[m]).files.length>0&&se(w.files,w.name);case 10:return e.a(2)}},e)}))).apply(this,arguments)}function ie(e){return new Promise(function(t){var n=[],o=e.name,r=function(e){e.readEntries(function(){var u=p(l().m(function u(c){var d,p,v,f;return l().w(function(u){for(;;)switch(u.p=u.n){case 0:if(0!==c.length){u.n=1;break}return t({files:n,name:o}),u.a(2);case 1:d=i(c),u.p=2,v=l().m(function e(){var t,o,a,i;return l().w(function(e){for(;;)switch(e.n){case 0:if(!(t=p.value).isFile){e.n=2;break}return o=t,e.n=1,new Promise(function(e){o.file(e)});case 1:a=e.v,n.push(a),e.n=4;break;case 2:if(!t.isDirectory){e.n=4;break}return e.n=3,ie(t);case 3:i=e.v,n.push.apply(n,s(i.files));case 4:return e.a(2)}},e)}),d.s();case 3:if((p=d.n()).done){u.n=5;break}return u.d(a(v()),4);case 4:u.n=3;break;case 5:u.n=7;break;case 6:u.p=6,f=u.v,d.e(f);case 7:return u.p=7,d.f(),u.f(7);case 8:r(e);case 9:return u.a(2)}},u,null,[[2,6,7,8]])}));return function(e){return u.apply(this,arguments)}}())};r(e.createReader())})}function le(e){if(e.size>5242880)H.error("图片大小不能超过 5MB,当前文件大小: ".concat((e.size/1024/1024).toFixed(2),"MB"));else{var t=new FileReader;t.onload=function(e){var t,n=null===(t=e.target)||void 0===t?void 0:t.result;n&&y.value.push(n)},t.readAsDataURL(e)}}function re(e){if(e.size>10485760)H.error("文件大小不能超过 10MB,当前文件大小: ".concat((e.size/1024/1024).toFixed(2),"MB"));else{var t=Date.now().toString(),n=X(e.name);x.value.push({id:t,name:n,size:e.size,uploaded:0,status:"uploading"});var o="/www/server/panel/plugin/bt_agent/upload",a=function(i){var l=Math.min(e.size,i+2097152),r=new FormData;r.append("f_path",o),r.append("f_name",n),r.append("f_size",e.size.toString()),r.append("f_start",i.toString()),r.append("blob",e.slice(i,l)),fetch("/files?action=upload",{method:"POST",body:r}).then(function(e){return e.json()}).then(function(i){if("number"==typeof i){var l=x.value.find(function(e){return e.id===t});return l&&(l.uploaded=i),void a(i)}if(i.status){var r=x.value.find(function(e){return e.id===t});return r&&(r.status="success",r.uploaded=e.size),pe("".concat(o,"/").concat(n)),void setTimeout(function(){x.value=x.value.filter(function(e){return e.id!==t})},500)}var s=x.value.find(function(e){return e.id===t});s&&(s.status="error"),H.error("文件上传失败:".concat(i.msg||"未知错误"))}).catch(function(){var e=x.value.find(function(e){return e.id===t});e&&(e.status="error"),H.error("文件上传出现问题!")})};a(0)}}function se(e,t){return ue.apply(this,arguments)}function ue(){return(ue=p(l().m(function e(t,n){var o,a,r,s,u,c,d,p,v,f,g;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:o=Date.now().toString(),a="".concat("/www/server/panel/plugin/bt_agent/upload","/").concat(X(n)),r={id:o,name:"".concat(n,"/ (").concat(t.length," 个文件)"),size:t.reduce(function(e,t){return e+t.size},0),uploaded:0,status:"uploading"},x.value.push(r),s=0,u=[],c=i(t),e.p=1,c.s();case 2:if((d=c.n()).done){e.n=7;break}return p=d.value,e.p=3,e.n=4,ce(p,a);case 4:v=e.v,u.push(v),s+=p.size,r.uploaded=s,e.n=6;break;case 5:e.p=5,f=e.v,console.error("上传文件 ".concat(p.name," 失败:"),f);case 6:e.n=2;break;case 7:e.n=9;break;case 8:e.p=8,g=e.v,c.e(g);case 9:return e.p=9,c.f(),e.f(9);case 10:r.status="success",r.uploaded=r.size,ve(a,n,u),setTimeout(function(){x.value=x.value.filter(function(e){return e.id!==o})},500);case 11:return e.a(2)}},e,null,[[3,5],[1,8,9,10]])}))).apply(this,arguments)}function ce(e,t){return new Promise(function(n,o){var a=X(e.name),i=function(l){var r=Math.min(e.size,l+2097152),s=new FormData;s.append("f_path",t),s.append("f_name",a),s.append("f_size",e.size.toString()),s.append("f_start",l.toString()),s.append("blob",e.slice(l,r)),fetch("/files?action=upload",{method:"POST",body:s}).then(function(e){return e.json()}).then(function(e){"number"!=typeof e?e.status?n("".concat(t,"/").concat(a)):o(new Error(e.msg||"上传失败")):i(e)}).catch(function(e){o(e)})};i(0)})}function de(){if(n.value){var e=window.getSelection();if(e){var t=document.createRange();t.selectNodeContents(n.value),t.collapse(!1),e.removeAllRanges(),e.addRange(t)}}}function pe(e){if(n.value){var o=e.split("/").pop()||e,a=Date.now().toString(),i=document.createElement("span");if(i.className="file-tag truncate",i.contentEditable="false",i.dataset.id=a,i.dataset.path=e,i.textContent="@".concat(o),n.value.focus(),D.value&&n.value.contains(D.value.commonAncestorContainer)){var l=window.getSelection();l&&(l.removeAllRanges(),l.addRange(D.value)),D.value=null}var r=window.getSelection();if(r)if(r.rangeCount>0){var s=r.getRangeAt(0);if(n.value.contains(s.commonAncestorContainer)){s.deleteContents(),s.insertNode(i);var u=document.createTextNode(" ");s.setStartAfter(i),s.insertNode(u),s.setStartAfter(u),s.collapse(!0),r.removeAllRanges(),r.addRange(s)}else{n.value.appendChild(i);var c=document.createTextNode(" ");n.value.appendChild(c),de()}}else{n.value.appendChild(i);var d=document.createTextNode(" ");n.value.appendChild(d),de()}else{n.value.appendChild(i);var p=document.createTextNode(" ");n.value.appendChild(p),de()}w.value.push({id:a,path:e,name:o}),t("update:inputMessage",n.value.textContent||""),B(function(){return V()})}}function ve(e,o,a){if(n.value){var i=Date.now().toString(),l=document.createElement("span");if(l.className="file-tag dir-tag truncate",l.contentEditable="false",l.dataset.id=i,l.dataset.path=e,l.dataset.files=JSON.stringify(a),l.dataset.isDir="true",l.textContent="@".concat(o,"/"),n.value.focus(),D.value&&n.value.contains(D.value.commonAncestorContainer)){var r=window.getSelection();r&&(r.removeAllRanges(),r.addRange(D.value)),D.value=null}var s=window.getSelection();if(s)if(s.rangeCount>0){var u=s.getRangeAt(0);if(n.value.contains(u.commonAncestorContainer)){u.deleteContents(),u.insertNode(l);var c=document.createTextNode(" ");u.setStartAfter(l),u.insertNode(c),u.setStartAfter(c),u.collapse(!0),s.removeAllRanges(),s.addRange(u)}else{n.value.appendChild(l);var d=document.createTextNode(" ");n.value.appendChild(d),de()}}else{n.value.appendChild(l);var p=document.createTextNode(" ");n.value.appendChild(p),de()}else{n.value.appendChild(l);var v=document.createTextNode(" ");n.value.appendChild(v),de()}w.value.push({id:i,path:e,name:"".concat(o,"/"),isDir:!0,files:a}),t("update:inputMessage",n.value.textContent||""),B(function(){return V()})}}function fe(t){return e.selectedTools.some(function(e){return e.id===t})}function ge(e){return e.length>0&&e.every(function(e){return fe(e.id)})}function he(e){if(!e)return{bottom:"0px",left:"0px"};var t=e.getBoundingClientRect(),n=window.innerHeight-t.top+8,o=t.left;return o+350>window.innerWidth-8&&(o=window.innerWidth-350-8),o<8&&(o=8),{bottom:"".concat(n,"px"),left:"".concat(o,"px")}}return{editorRef:n,modelBtnRef:o,toolBtnRef:r,uploadBtnRef:u,fileInputRef:c,dirInputRef:d,toolSearchQuery:v,toolTooltipVisible:f,toolTooltipText:g,toolTooltipPosition:h,pendingImages:y,uploadingFiles:x,isDragOver:b,previewVisible:_,previewUrl:S,showAtPopover:P,atPopoverPosition:A,atSelectedIndex:U,showSiteSearchPopover:O,siteSearchResults:q,siteSearchLoading:N,siteSelectedIndex:F,uploadPopoverPosition:L,modelPopoverPosition:T,toolPopoverPosition:M,visibleTools:z,overflowTools:j,groupedTools:W,updateToolSearchQuery:function(e){v.value=e},updateAtSelectedIndex:function(e){U.value=e},updateSiteSelectedIndex:function(e){F.value=e},autoResizeTextarea:V,handleInput:function(e){var o=e.target,a=o.innerHTML.replace(/\s| /g,"");"<br>"!==a&&"<div><br></div>"!==a&&"<p><br></p>"!==a||(o.innerText=""),t("update:inputMessage",o.textContent||""),B(function(){V()}),function(){if(!n.value)return;var e=window.getSelection();if(!e||0===e.rangeCount)return void(P.value=!1);var t=e.getRangeAt(0),o=t.startContainer;if(o.nodeType!==Node.TEXT_NODE)return void(P.value=!1);var a=o.textContent||"",i=t.startOffset;if(i>0&&"@"===a[i-1])return O.value?void(P.value=!1):(I.value=i-1,R.value=o,U.value=0,O.value=!1,P.value=!0,void $());P.value=!1,O.value||(I.value=null,R.value=null)}(),function(){if(!n.value||!O.value)return;var e=window.getSelection();if(!e||0===e.rangeCount)return void(O.value=!1);var t=e.getRangeAt(0),o=t.startContainer;if(o.nodeType!==Node.TEXT_NODE)return void(O.value=!1);var a=o.textContent||"",i=t.startOffset,l="@site:",r=a.indexOf(l);if(-1!==r&&i>r){return void te(a.substring(r+l.length))}O.value=!1}()},handleBlur:function(){var e,t=window.getSelection();if(t&&0!==t.rangeCount){var o=t.getRangeAt(0);null!==(e=n.value)&&void 0!==e&&e.contains(o.commonAncestorContainer)&&(D.value=o.cloneRange())}},handleFocus:function(){var e=document.getElementById("tool-tooltip"),t=localStorage.getItem("showToolTooltip");e&&!t&&(e.classList.add("show"),localStorage.setItem("showToolTooltip","true"),setTimeout(function(){e.classList.remove("show")},3e3))},handlePaste:function(e){var t,n=null===(t=e.clipboardData)||void 0===t?void 0:t.items;if(n){var o,a=i(n);try{for(a.s();!(o=a.n()).done;){var l=o.value;if(l.type.startsWith("image/")){e.preventDefault();var r=l.getAsFile();r&&le(r);break}}}catch(s){a.e(s)}finally{a.f()}}},handleKeydown:function(e){if(!e.isComposing){if(P.value){if("ArrowUp"===e.key)return e.preventDefault(),void(U.value=0===U.value?1:0);if("ArrowDown"===e.key)return e.preventDefault(),void(U.value=1===U.value?0:1);if("Enter"===e.key&&!e.shiftKey)return e.preventDefault(),void(0===U.value?G():K());if("Escape"===e.key)return P.value=!1,I.value=null,void(R.value=null)}if(O.value){if("Enter"===e.key&&!e.shiftKey)return e.preventDefault(),void oe();if("ArrowUp"===e.key)return e.preventDefault(),void(F.value=F.value>0?F.value-1:q.value.length-1);if("ArrowDown"===e.key)return e.preventDefault(),void(F.value=F.value<q.value.length-1?F.value+1:0);if("Escape"===e.key)return void(O.value=!1)}"Enter"!==e.key||e.shiftKey||(e.preventDefault(),t("sendMessage")),"Backspace"===e.key&&function(){if(!n.value)return;B(function(){var e,t=(null===(e=n.value)||void 0===e?void 0:e.querySelectorAll(".file-tag"))||[],o=new Set;t.forEach(function(e){var t=e.dataset.id;t&&o.add(t)}),w.value=w.value.filter(function(e){return o.has(e.id)})})}()}},handleDragOver:function(e){var t;null!==(t=e.dataTransfer)&&void 0!==t&&t.types.includes("Files")&&(b.value=!0)},handleDragLeave:function(e){var t=e.currentTarget;t&&!t.contains(e.relatedTarget)&&(b.value=!1)},handleDrop:function(e){return ae.apply(this,arguments)},previewImage:function(e){S.value=e,_.value=!0},closePreview:function(){_.value=!1,S.value=""},removeImage:function(e){y.value.splice(e,1)},toggleUploadPopover:function(n){n.stopPropagation(),t("update:showToolPopover",!1),t("update:showModelPopover",!1);var o=!e.showUploadPopover;t("update:showUploadPopover",o),o&&B(function(){L.value=he(u.value)})},selectLocalFile:function(){var e;t("update:showUploadPopover",!1),null===(e=c.value)||void 0===e||e.click()},selectLocalDir:function(){var e;t("update:showUploadPopover",!1),null===(e=d.value)||void 0===e||e.click()},selectServerFile:function(){t("update:showUploadPopover",!1),Y({type:"all",path:"/",change:function(e){Q(e)}},{customClass:"top-index"})},handleFileSelect:function(e){var t=e.target,n=t.files;if(n){for(var o=0,a=Array.from(n);o<a.length;o++){var i=a[o];i.type.startsWith("image/")?le(i):re(i)}t.value=""}},handleDirSelect:function(e){var t=e.target,n=t.files;if(n&&0!==n.length){var o=n[0].webkitRelativePath.split("/")[0],a=Array.from(n).filter(function(e){return!e.type.startsWith("image/")});if(0===a.length)return H.error("目录中没有可上传的文件(图片文件不支持目录上传)"),void(t.value="");se(a,o),t.value=""}},toggleModelPopover:function(n){n.stopPropagation(),t("update:showToolPopover",!1),t("update:showUploadPopover",!1);var a=!e.showModelPopover;t("update:showModelPopover",a),a&&B(function(){T.value=he(o.value)})},toggleToolPopover:function(n){n.stopPropagation(),t("update:showUploadPopover",!1);var o=!e.showToolPopover;t("update:showToolPopover",o),o&&B(function(){M.value=he(r.value)})},isToolSelected:fe,isCategoryAllSelected:ge,isCategoryPartialSelected:function(e){var t=e.filter(function(e){return fe(e.id)}).length;return t>0&&t<e.length},toggleCategorySelection:function(e){var n=ge(e),o=e.filter(function(e){var t=fe(e.id);return n?t:!t});t("batchToggleTools",o,!n)},formatDescription:function(e){return e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\\n/g,"<br>").replace(/\n/g,"<br>"):""},formatFileSize:J,handleAtSelectServerFile:G,handleAtSelectSite:K,handleSiteSelect:oe,getPendingImages:function(){return s(y.value)},clearImages:function(){y.value=[]},getTextContent:function(){var e;return(null===(e=n.value)||void 0===e?void 0:e.innerText)||""},getPendingFiles:function(){return s(w.value)},getPendingSites:function(){return s(k.value)},clearAll:function(){n.value&&(n.value.innerHTML=""),y.value=[],w.value=[],k.value=[]},focus:function(){var e;null===(e=n.value)||void 0===e||e.focus()}}}var wn={class:"chat-input-container"},kn={key:0,class:"selected-tools-tags"},xn={class:"tool-tag-name"},bn=["onClick"],_n={key:0,class:"tool-tag tool-tag-overflow"},Sn={class:"tool-tag-name"},Ln={class:"tool-overflow-tooltip"},Tn=["onClick"],Mn={key:1,class:"image-preview-container"},Pn=["src","onClick"],Bn=["onClick"],An={key:2,class:"upload-progress-container"},In={class:"upload-file-info"},Rn={class:"upload-file-name"},En={class:"upload-file-size"},Un={class:"upload-progress-bar"},Dn={class:"input-toolbar"},On={style:{position:"relative"}},qn={t:"1775718327975",style:{width:"16px",height:"16px"},viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4752"},Nn=["title"],Fn={style:{position:"relative"}},Hn=["title"],Zn={key:0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},zn={key:1,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor"},jn={class:"popover-header"},Wn={class:"popover-content"},Vn={key:0,class:"popover-loading"},$n={key:1,class:"model-list"},Gn=["onClick"],Qn={class:"model-name"},Kn={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Jn=["innerHTML"],Xn=["src"],Yn=o({__name:"ChatInput",props:{inputMessage:{},selectedTools:{},modelsList:{},currentModel:{},toolsList:{},showModelPopover:{type:Boolean},showToolPopover:{type:Boolean},showUploadPopover:{type:Boolean},modelsLoading:{type:Boolean},toolsLoading:{type:Boolean},isSending:{type:Boolean},webSearchEnabled:{type:Boolean},smartMode:{type:Boolean}},emits:["update:inputMessage","update:showModelPopover","update:showToolPopover","update:showUploadPopover","update:webSearchEnabled","update:smartMode","sendMessage","stopMessage","removeSelectedTool","selectModel","toggleToolSelection","batchToggleTools","openSettings"],setup:function(e,t){var n=t.expose,o=t.emit,a=Cn(e,o),i=a.editorRef,l=a.modelBtnRef,p=a.toolBtnRef,y=a.uploadBtnRef,m=a.fileInputRef,C=a.dirInputRef,x=a.toolSearchQuery,b=a.toolTooltipVisible,_=a.toolTooltipText,B=a.toolTooltipPosition,A=a.pendingImages,I=a.uploadingFiles,E=a.isDragOver,U=a.previewVisible,D=a.previewUrl,O=a.showAtPopover,q=a.atPopoverPosition,N=a.atSelectedIndex,F=a.showSiteSearchPopover,H=a.siteSearchResults,Z=a.siteSearchLoading,z=a.siteSelectedIndex,j=a.uploadPopoverPosition,W=a.modelPopoverPosition,V=a.toolPopoverPosition,$=a.visibleTools,G=a.overflowTools,Q=a.groupedTools,K=a.updateToolSearchQuery,J=a.updateAtSelectedIndex,X=a.updateSiteSelectedIndex,Y=a.autoResizeTextarea,ee=a.handleInput,te=a.handleBlur,ne=a.handleFocus,oe=a.handlePaste,ae=a.handleKeydown,ie=a.handleDragOver,le=a.handleDragLeave,re=a.handleDrop,se=a.previewImage,ue=a.closePreview,ce=a.removeImage,de=a.toggleUploadPopover,pe=a.selectLocalFile,ve=a.selectLocalDir,fe=a.selectServerFile,ge=a.handleFileSelect,he=a.handleDirSelect,ye=a.toggleModelPopover,me=a.toggleToolPopover,Ce=a.isToolSelected,we=a.isCategoryAllSelected,ke=a.isCategoryPartialSelected,xe=a.toggleCategorySelection,be=a.formatDescription,_e=a.formatFileSize,Se=a.handleAtSelectServerFile,Le=a.handleAtSelectSite,Te=a.handleSiteSelect;return n({autoResizeTextarea:Y,getPendingImages:a.getPendingImages,clearImages:a.clearImages,getTextContent:a.getTextContent,getPendingFiles:a.getPendingFiles,getPendingSites:a.getPendingSites,clearAll:a.clearAll,focus:a.focus}),function(t,n){return r(),u("div",wn,[c("div",{class:f(["chat-input-wrapper",{"drag-over":w(E)}]),onDragover:n[11]||(n[11]=h(function(){return w(ie)&&w(ie).apply(void 0,arguments)},["prevent"])),onDragleave:n[12]||(n[12]=function(){return w(le)&&w(le).apply(void 0,arguments)}),onDrop:n[13]||(n[13]=h(function(){return w(re)&&w(re).apply(void 0,arguments)},["prevent"]))},[e.selectedTools.length>0&&!e.smartMode?(r(),u("div",kn,[(r(!0),u(d,null,v(w($),function(e){return r(),u("div",{key:e.id,class:"tool-tag"},[c("span",xn,g(e.name),1),c("button",{class:"tool-tag-remove",onClick:function(n){return t.$emit("removeSelectedTool",e.id)},title:"移除工具"},s(n[23]||(n[23]=[c("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),c("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])),8,bn)])}),128)),w(G).length>0?(r(),u("div",_n,[c("span",Sn,"+"+g(w(G).length),1),c("div",Ln,[(r(!0),u(d,null,v(w(G),function(e){return r(),u("div",{key:e.id,class:"tool-overflow-item"},[c("span",null,g(e.name),1),c("button",{class:"tool-tag-remove",onClick:function(n){return t.$emit("removeSelectedTool",e.id)},title:"移除工具"},s(n[24]||(n[24]=[c("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),c("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])),8,Tn)])}),128))])])):k("",!0)])):k("",!0),w(A).length>0?(r(),u("div",Mn,[(r(!0),u(d,null,v(w(A),function(e,t){return r(),u("div",{key:t,class:"image-preview-item"},[c("img",{src:e,alt:"预览图片",class:"image-preview-thumb",onClick:function(t){return w(se)(e)}},null,8,Pn),c("button",{class:"image-preview-remove",onClick:h(function(e){return w(ce)(t)},["stop"]),title:"移除图片"},s(n[25]||(n[25]=[c("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),c("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])),8,Bn)])}),128))])):k("",!0),w(I).length>0?(r(),u("div",An,[(r(!0),u(d,null,v(w(I),function(e){return r(),u("div",{key:e.id,class:f(["upload-progress-item",{error:"error"===e.status,success:"success"===e.status}])},[c("div",In,[n[26]||(n[26]=c("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),c("polyline",{points:"14 2 14 8 20 8"})],-1)),c("span",Rn,g(e.name),1),c("span",En,"("+g(w(_e)(e.uploaded))+"/"+g(w(_e)(e.size))+")",1)]),c("div",Un,[c("div",{class:"upload-progress-fill",style:R({width:"".concat(e.uploaded/e.size*100,"%")})},null,4)])],2)}),128))])):k("",!0),c("div",{ref_key:"editorRef",ref:i,class:"chat-input",contenteditable:"true",onInput:n[0]||(n[0]=function(){return w(ee)&&w(ee).apply(void 0,arguments)}),onBlur:n[1]||(n[1]=function(){return w(te)&&w(te).apply(void 0,arguments)}),onFocus:n[2]||(n[2]=function(){return w(ne)&&w(ne).apply(void 0,arguments)}),onPaste:n[3]||(n[3]=function(){return w(oe)&&w(oe).apply(void 0,arguments)}),onKeydown:n[4]||(n[4]=function(){return w(ae)&&w(ae).apply(void 0,arguments)}),"aria-label":"输入框","data-placeholder":"输入消息,按 Shift + Enter 换行,@ 打开引用菜单,可拖拽上传文件,可粘贴图片,按 Enter 发送"},null,544),c("div",Dn,[c("div",On,[c("button",{ref_key:"uploadBtnRef",ref:y,class:"toolbar-button !p-[.5rem]",style:{padding:"0"},onClick:n[5]||(n[5]=function(){return w(de)&&w(de).apply(void 0,arguments)}),title:"上传文件"},[(r(),u("svg",qn,s(n[27]||(n[27]=[c("path",{d:"M924.672 126.976q36.864 36.864 54.784 82.432t17.92 93.696-17.92 93.696-54.784 82.432l-392.192 389.12q-36.864 36.864-90.624 61.44t-113.664 28.672-122.368-16.384-115.712-73.728q-52.224-52.224-72.704-113.152t-16.384-121.344 28.16-113.664 60.928-90.112l348.16-345.088q9.216-9.216 27.136-4.608t27.136 13.824q8.192 9.216 13.312 27.136t-4.096 27.136l-347.136 344.064q-27.648 27.648-46.08 64.512t-21.504 78.848 12.288 84.992 55.296 82.944q35.84 35.84 79.36 50.688t86.528 12.288 81.92-18.944 66.56-44.032l391.168-388.096q27.648-27.648 39.424-57.344t11.264-58.88-13.824-56.832-36.864-51.2q-44.032-43.008-98.816-40.448t-110.08 57.856l-353.28 351.232q-23.552 23.552-23.04 52.224t18.944 47.104q22.528 22.528 51.712 18.432t47.616-22.528l320.512-318.464q9.216-9.216 27.136-4.608t27.136 13.824 14.336 27.136-4.096 27.136l-321.536 318.464q-36.864 36.864-70.656 51.2t-63.488 12.8-55.296-15.872-47.104-34.816q-17.408-16.384-31.232-41.984t-15.872-56.32 10.752-65.536 49.664-70.656q18.432-18.432 32.768-33.792 12.288-13.312 23.04-23.552t11.776-11.264l285.696-284.672q36.864-36.864 80.384-57.856t88.576-24.064 88.576 12.288 80.384 52.224z","p-id":"4753",fill:"var(--el-color-text-secondary)"},null,-1)]))))],512)]),c("button",{ref_key:"modelBtnRef",ref:l,class:"toolbar-button",onClick:n[6]||(n[6]=function(){return w(ye)&&w(ye).apply(void 0,arguments)}),title:"切换模型"},[n[28]||(n[28]=c("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("circle",{cx:"12",cy:"12",r:"3"}),c("path",{d:"M12 1v6m0 6v6m5.2-14.2l-4.2 4.2m0 6l4.2 4.2M23 12h-6m-6 0H1m14.2 5.2l-4.2-4.2m0-6l-4.2-4.2"})],-1)),c("span",null,g(e.currentModel||"选择模型"),1)],512),c("button",{class:f(["toolbar-button",{"toolbar-button-active":e.smartMode}]),onClick:n[7]||(n[7]=function(n){return t.$emit("update:smartMode",!e.smartMode)}),title:e.smartMode?"智能模式已开启,AI将自动判断是否使用工具和联网搜索":"智能模式已关闭,可手动选择工具和联网搜索"},[n[29]||(n[29]=c("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),c("path",{d:"M2 17l10 5 10-5"}),c("path",{d:"M2 12l10 5 10-5"})],-1)),c("span",null,g((e.smartMode,"智能模式")),1)],10,Nn),e.smartMode?k("",!0):(r(),u(d,{key:0},[c("div",Fn,[c("button",{ref_key:"toolBtnRef",ref:p,class:"toolbar-button",onClick:n[8]||(n[8]=function(){return w(me)&&w(me).apply(void 0,arguments)}),title:"使用工具"},[n[30]||(n[30]=c("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("path",{d:"M14.7 6.3a1 1 0 000 1.4l1.6 1.6a1 1 0 001.4 0l3.77-3.77a6 6 0 01-7.94 7.94l-6.91 6.91a2.12 2.12 0 01-3-3l6.91-6.91a6 6 0 017.94-7.94l-3.76 3.76z"})],-1)),c("span",null,"使用工具"+g(e.selectedTools.length>0?" (".concat(e.selectedTools.length,")"):""),1)],512)]),c("button",{class:f(["toolbar-button",{"toolbar-button-active":e.webSearchEnabled}]),onClick:n[9]||(n[9]=function(n){return t.$emit("update:webSearchEnabled",!e.webSearchEnabled)}),title:"联网搜索"},s(n[31]||(n[31]=[c("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("circle",{cx:"12",cy:"12",r:"10"}),c("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),c("path",{d:"M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z"})],-1),c("span",null,"联网搜索",-1)])),2)],64)),c("button",{class:f(["send-button",{"stop-button":e.isSending}]),onClick:n[10]||(n[10]=function(n){return e.isSending?t.$emit("stopMessage"):t.$emit("sendMessage")}),title:e.isSending?"停止生成":"发送消息"},[e.isSending?(r(),u("svg",zn,s(n[33]||(n[33]=[c("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"},null,-1)])))):(r(),u("svg",Zn,s(n[32]||(n[32]=[c("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"},null,-1)]))))],10,Hn)])],34),n[39]||(n[39]=c("div",{class:"ai-disclaimer"}," 内容由 AI 生成,仅供参考,您据此所作判断及操作均由您自行承担责任。 ",-1)),L(M,{name:"popover-fade"},{default:T(function(){return[e.showModelPopover?(r(),u("div",{key:0,class:"custom-popover",style:R(w(W))},[c("div",jn,[n[35]||(n[35]=c("span",{class:"popover-title"},"选择模型",-1)),c("button",{class:"popover-close",onClick:n[14]||(n[14]=function(e){return t.$emit("update:showModelPopover",!1)})},s(n[34]||(n[34]=[c("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),c("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])))]),c("div",Wn,[e.modelsLoading?(r(),u("div",Vn,s(n[36]||(n[36]=[c("div",{class:"loading-spinner"},null,-1),c("span",null,"加载中...",-1)])))):(r(),u("div",$n,[(r(!0),u(d,null,v(e.modelsList,function(o){return r(),u("div",{key:o,class:f(["model-item",{active:e.currentModel===o}]),onClick:function(e){return t.$emit("selectModel",o)}},[c("span",Qn,g(o),1),e.currentModel===o?(r(),u("svg",Kn,s(n[37]||(n[37]=[c("polyline",{points:"20 6 9 17 4 12"},null,-1)])))):k("",!0)],10,Gn)}),128))]))])],4)):k("",!0)]}),_:1}),L(an,{showToolPopover:e.showToolPopover,toolPopoverPosition:w(V),toolsLoading:e.toolsLoading,toolSearchQuery:w(x),groupedTools:w(Q),isToolSelected:w(Ce),isCategoryAllSelected:w(we),isCategoryPartialSelected:w(ke),"onUpdate:showToolPopover":n[15]||(n[15]=function(e){return t.$emit("update:showToolPopover",e)}),"onUpdate:toolSearchQuery":w(K),onToggleToolSelection:n[16]||(n[16]=function(e){return t.$emit("toggleToolSelection",e)}),onToggleCategorySelection:w(xe)},null,8,["showToolPopover","toolPopoverPosition","toolsLoading","toolSearchQuery","groupedTools","isToolSelected","isCategoryAllSelected","isCategoryPartialSelected","onUpdate:toolSearchQuery","onToggleCategorySelection"]),L(un,{showUploadPopover:e.showUploadPopover,uploadPopoverPosition:w(j),"onUpdate:showUploadPopover":n[17]||(n[17]=function(e){return t.$emit("update:showUploadPopover",e)}),onSelectLocalFile:w(pe),onSelectLocalDir:w(ve),onSelectServerFile:w(fe)},null,8,["showUploadPopover","uploadPopoverPosition","onSelectLocalFile","onSelectLocalDir","onSelectServerFile"]),L(dn,{showAtPopover:w(O),atPopoverPosition:w(q),atSelectedIndex:w(N),"onUpdate:atSelectedIndex":w(J),onSelectServerFile:w(Se),onSelectSite:w(Le)},null,8,["showAtPopover","atPopoverPosition","atSelectedIndex","onUpdate:atSelectedIndex","onSelectServerFile","onSelectSite"]),L(mn,{showSiteSearchPopover:w(F),atPopoverPosition:w(q),siteSearchLoading:w(Z),siteSearchResults:w(H),siteSelectedIndex:w(z),"onUpdate:siteSelectedIndex":w(X),onSelectSite:w(Te)},null,8,["showSiteSearchPopover","atPopoverPosition","siteSearchLoading","siteSearchResults","siteSelectedIndex","onUpdate:siteSelectedIndex","onSelectSite"]),c("input",{ref_key:"fileInputRef",ref:m,type:"file",multiple:"",style:{display:"none"},onChange:n[18]||(n[18]=function(){return w(ge)&&w(ge).apply(void 0,arguments)})},null,544),c("input",{ref_key:"dirInputRef",ref:C,type:"file",webkitdirectory:"",directory:"",multiple:"",style:{display:"none"},onChange:n[19]||(n[19]=function(){return w(he)&&w(he).apply(void 0,arguments)})},null,544),L(M,{name:"tooltip-fade"},{default:T(function(){return[w(b)&&e.showToolPopover?(r(),u("div",{key:0,class:"tool-tooltip",style:R(w(B))},[c("div",{class:"tool-tooltip-content",innerHTML:w(be)(w(_))},null,8,Jn)],4)):k("",!0)]}),_:1}),(r(),S(P,{to:"body"},[L(M,{name:"preview-fade"},{default:T(function(){return[w(U)?(r(),u("div",{key:0,class:"image-preview-overlay",onClick:n[22]||(n[22]=function(){return w(ue)&&w(ue).apply(void 0,arguments)})},[c("img",{src:w(D),alt:"预览图片",class:"image-preview-full",onClick:n[20]||(n[20]=h(function(){},["stop"]))},null,8,Xn),c("button",{class:"image-preview-close",onClick:n[21]||(n[21]=function(){return w(ue)&&w(ue).apply(void 0,arguments)})},s(n[38]||(n[38]=[c("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),c("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])))])):k("",!0)]}),_:1})]))])}}}),eo=F(Yn,[["__scopeId","data-v-a746516b"]]),to=m(!1),no=m(null),oo=m(null),ao="linear-gradient(to right, #C2C63E 40%, #29A73A 70%)",io=C(function(){return{background:"var(--el-fill-color-dark)"}}),lo=C(function(){if(!oo.value)return"0%";var e=(oo.value.daily_total-oo.value.daily_used)/oo.value.daily_total*100;return"".concat(Math.max(Math.min(e,100),0),"%")}),ro=C(function(){if(!oo.value)return"0%";var e=(oo.value.extra_total-oo.value.extra_used)/oo.value.extra_total*100;return"".concat(Math.max(Math.min(e,100),0),"%")}),so=C(function(){return no.value?no.value.skills.filter(function(e){return e.enabled}):[]});function uo(){return co.apply(this,arguments)}function co(){return(co=p(l().m(function e(){var t,n,o,a,i;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(to.value=!0,e.p=1,le.value&&0!==le.value.length){e.n=2;break}return e.n=2,re();case 2:return e.n=3,te({sessions_dir:"skill_agent_sessions,aics_sessions"});case 3:o=e.v,a=null!==(t=null===(n=o.data)||void 0===n?void 0:n.data)&&void 0!==t?t:o.data,i=a.map(function(e){var t=le.value.find(function(t){return t.id===e.skill_agent_id});return{name:(null==t?void 0:t.name)||e.skill_agent_id,description:e.title,enabled:!0,session_id:e.session_id,sessions_dir:e.sessions_dir,skill_agent_id:e.skill_agent_id,time_str:e.time_str,preset_questions:(null==t?void 0:t.preset_questions)||[]}}),no.value={total:i.length,enabled:i.length,disabled:0,skills:i},e.n=5;break;case 4:e.p=4,e.v;case 5:return e.p=5,to.value=!1,e.f(5);case 6:return e.a(2)}},e,null,[[1,4,5,6]])}))).apply(this,arguments)}function po(e,t,n){t||((0,se().createNewConversation)(),n(e))}function vo(e){return fo.apply(this,arguments)}function fo(){return(fo=p(l().m(function e(t){var n,o,a,i,r,s,u;return l().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,uo();case 1:if(n=se(),o=n.currentAssistantId,a=n.currentAssistantName,i=o.value,r=a.value,!i||!r){e.n=2;break}return s=le.value.find(function(e){return e.id===i}),u=(null==s?void 0:s.preset_questions)||[],po({name:r,description:"新会话",enabled:!0,session_id:Date.now().toString(),sessions_dir:"skill_agent_sessions",skill_agent_id:i,time_str:"",preset_questions:u},!1,t),e.a(2);case 2:return e.a(2)}},e)}))).apply(this,arguments)}function go(e,t,n,o,a,i){var l,r=le.value.find(function(e){return e.id===t}),s=(null==r?void 0:r.preset_questions)||[],u={name:e||"AI助手",description:"新会话",enabled:!0,session_id:a||Date.now().toString(),sessions_dir:"skill_agent_sessions",skill_agent_id:t,time_str:"",preset_questions:s};null===(l=no.value)||void 0===l||l.skills.unshift(u),no.value.total+=1,no.value.enabled+=1,po(u,n,o)}function ho(){return ho=p(l().m(function e(t,n,o){var a,i,r,s,u;return l().w(function(e){for(;;)switch(e.n){case 0:if(!n){e.n=1;break}return e.a(2);case 1:return e.n=2,N({title:"删除消息",content:"删除后,聊天记录不可恢复,是否继续?"});case 2:if(a=se(),i=a.currentConversationId,r=a.currentTimeStr,s=a.currentAssistantName,u=a.currentAssistantId,t.time_str){e.n=3;break}return go("","",!1,o),uo(),e.a(2);case 3:Z({request:ne({session_id:t.session_id||"",sessions_dir:t.sessions_dir||""}),message:!0,success:function(){var e=p(l().m(function e(n){return l().w(function(e){for(;;)switch(e.n){case 0:if(!n.status||i.value!==t.session_id){e.n=1;break}go("","",!1,o),uo(),e.n=3;break;case 1:return e.n=2,vo(o);case 2:""===r.value&&go(s.value||"",u.value||"",!1,o);case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()});case 4:return e.a(2)}},e)})),ho.apply(this,arguments)}function yo(e,t){var n=function(e){var t,n,o,a,i;(i=null===(t=e.detail)||void 0===t?void 0:t.data)&&null!==(n=i.data)&&void 0!==n&&n.daily_quota&&(oo.value={daily_used:i.data.daily_quota.used,daily_total:i.data.daily_quota.total,extra_used:(null===(o=i.data.daily_quota.common_packages)||void 0===o?void 0:o.used_count)||0,extra_total:(null===(a=i.data.daily_quota.common_packages)||void 0===a?void 0:a.total_count)||0})},o=function(n){return function(e,t,n){var o=e.detail;o&&go(o.name,o.skill_agent_id,t,n,o.session_id)}(n,e(),t)},a=function(e){uo()};return window.addEventListener("update-sidebar-info",n),window.addEventListener("create-new-chat",o),window.addEventListener("update-sidebar-list",a),{onQuotaUpdate:n,onCreateNewChat:o,onUpdateList:a}}var mo={class:"list-content"},Co={class:"list-header"},wo={class:"header-title"},ko={key:0,class:"loading-state"},xo={key:1,class:"empty-state"},bo={key:2,class:"assistant-items"},_o=["onClick"],So={class:"assistant-icon"},Lo={key:0,width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 15.0001 14",fill:"none",customFrame:"#000000"},To={class:"assistant-info"},Mo={class:"assistant-name"},Po={class:"assistant-desc"},Bo=["onClick"],Ao={key:3,class:"quota-section"},Io={key:0,class:"quota-item"},Ro={class:"quota-top"},Eo={class:"quota-value"},Uo={class:"quota-progress"},Do={key:1,class:"quota-item"},Oo={class:"quota-top"},qo={class:"quota-value"},No={class:"quota-progress"},Fo=o({__name:"AssistantList",props:{currentAssistant:{},currentConversationId:{},collapsed:{type:Boolean},isSending:{type:Boolean}},emits:["select","create"],setup:function(e,t){var n=t.emit,o=e,a=n,i=C(function(){return o.currentConversationId});function l(e){a("select",e)}function p(e){return function(e,t,n){return ho.apply(this,arguments)}(e,!!o.isSending,l)}function m(){o.isSending||a("create")}var x=null;return A(function(){vo(l),x=yo(function(){return!!o.isSending},l)}),I(function(){var e;x&&(e=x,window.removeEventListener("update-sidebar-info",e.onQuotaUpdate),window.removeEventListener("create-new-chat",e.onCreateNewChat),window.removeEventListener("update-sidebar-list",e.onUpdateList),x=null)}),function(t,n){var a=U,C=D;return r(),u("div",{class:f(["assistant-list",{collapsed:e.collapsed}])},[c("div",mo,[c("div",Co,[c("span",wo,[n[1]||(n[1]=_(" 会话列表 ",-1)),L(a,{effect:"dark",content:"新建会话",placement:"top","open-delay":500,"hide-after":0},{default:T(function(){return[(r(),u("svg",{class:f(["add-svg",{"!cursor-not-allowed":o.isSending}]),onClick:m,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 16 16",width:"20.000000",height:"20.000000",fill:"none"},s(n[0]||(n[0]=[c("rect",{id:"添加-方-L 1",width:"16.000000",height:"16.000000",x:"0.000000",y:"0.000000"},null,-1),c("path",{id:"矢量 2553",d:"M8.50001 5.33301C8.50001 5.22742 8.46658 5.12454 8.40452 5.03911C8.34245 4.95369 8.25494 4.89011 8.15452 4.85748C8.05409 4.82485 7.94592 4.82485 7.8455 4.85748C7.74508 4.89011 7.65756 4.95369 7.5955 5.03912C7.53343 5.12454 7.50001 5.22742 7.50001 5.33301L7.50001 7.50001L5.33301 7.50001C5.22742 7.50001 5.12454 7.53343 5.03912 7.5955C4.95369 7.65756 4.89011 7.74508 4.85748 7.8455C4.82485 7.94592 4.82485 8.05409 4.85748 8.15452C4.89011 8.25494 4.95369 8.34245 5.03911 8.40452C5.12454 8.46658 5.22742 8.50001 5.33301 8.50001L7.50001 8.50001L7.50001 10.667C7.50001 10.7726 7.53343 10.8755 7.5955 10.9609C7.65756 11.0463 7.74508 11.1099 7.8455 11.1425C7.94592 11.1752 8.05409 11.1752 8.15452 11.1425C8.25494 11.1099 8.34245 11.0463 8.40452 10.9609C8.46658 10.8755 8.50001 10.7726 8.50001 10.667L8.50001 8.50001L10.667 8.50001C10.7726 8.50001 10.8755 8.46658 10.9609 8.40452C11.0463 8.34245 11.1099 8.25494 11.1425 8.15452C11.1752 8.05409 11.1752 7.94592 11.1425 7.8455C11.1099 7.74508 11.0463 7.65756 10.9609 7.5955C10.8755 7.53343 10.7726 7.50001 10.667 7.50001L8.50001 7.50001L8.50001 5.33301Z",fill:"var(--el-color-text-primary)","fill-rule":"nonzero"},null,-1),c("path",{id:"矢量 2553",d:"M8.40452 5.03911C8.34245 4.95369 8.25494 4.89011 8.15452 4.85748C8.05409 4.82485 7.94592 4.82485 7.8455 4.85748C7.74508 4.89011 7.65756 4.95369 7.5955 5.03912C7.53343 5.12454 7.50001 5.22742 7.50001 5.33301L7.50001 7.50001L5.33301 7.50001C5.22742 7.50001 5.12454 7.53343 5.03912 7.5955C4.95369 7.65756 4.89011 7.74508 4.85748 7.8455C4.82485 7.94592 4.82485 8.05409 4.85748 8.15452C4.89011 8.25494 4.95369 8.34245 5.03911 8.40452C5.12454 8.46658 5.22742 8.50001 5.33301 8.50001L7.50001 8.50001L7.50001 10.667C7.50001 10.7726 7.53343 10.8755 7.5955 10.9609C7.65756 11.0463 7.74508 11.1099 7.8455 11.1425C7.94592 11.1752 8.05409 11.1752 8.15452 11.1425C8.25494 11.1099 8.34245 11.0463 8.40452 10.9609C8.46658 10.8755 8.50001 10.7726 8.50001 10.667L8.50001 8.50001L10.667 8.50001C10.7726 8.50001 10.8755 8.46658 10.9609 8.40452C11.0463 8.34245 11.1099 8.25494 11.1425 8.15452C11.1752 8.05409 11.1752 7.94592 11.1425 7.8455C11.1099 7.74508 11.0463 7.65756 10.9609 7.5955C10.8755 7.53343 10.7726 7.50001 10.667 7.50001L8.50001 7.50001L8.50001 5.33301C8.50001 5.22742 8.46658 5.12454 8.40452 5.03911Z","fill-rule":"nonzero",stroke:"var(--el-color-text-primary)","stroke-width":"0.300000"},null,-1),c("path",{id:"矢量 2554",d:"M8.03799 1.16699L7.96199 1.16699C6.50199 1.16699 5.35399 1.16699 4.45899 1.28699C3.54099 1.40999 2.81299 1.66899 2.24099 2.24099C1.66799 2.81299 1.41099 3.54099 1.28699 4.45899C1.16699 5.35399 1.16699 6.50099 1.16699 7.96199L1.16699 8.03799C1.16699 9.49799 1.16699 10.646 1.28699 11.541C1.40999 12.459 1.66799 13.187 2.24099 13.759C2.81299 14.331 3.54099 14.589 4.45899 14.713C5.35399 14.833 6.50099 14.833 7.96199 14.833L8.03799 14.833C9.49799 14.833 10.646 14.833 11.541 14.713C12.459 14.59 13.187 14.332 13.759 13.759C14.331 13.187 14.589 12.459 14.713 11.541C14.833 10.646 14.833 9.49899 14.833 8.03799L14.833 7.96199C14.833 6.50199 14.833 5.35399 14.713 4.45899C14.59 3.54099 14.332 2.81299 13.759 2.24099C13.187 1.66799 12.459 1.41099 11.541 1.28699C10.646 1.16699 9.49899 1.16699 8.03799 1.16699L8.03799 1.16699ZM2.94799 2.94699C3.30299 2.59199 3.78499 2.38699 4.59199 2.27799C5.41299 2.16799 6.49299 2.16699 7.99999 2.16699C9.50699 2.16699 10.587 2.16699 11.408 2.27799C12.215 2.38699 12.697 2.59199 13.052 2.94799C13.408 3.30299 13.613 3.78499 13.722 4.59199C13.832 5.41299 13.833 6.49299 13.833 7.99999C13.833 9.50699 13.833 10.587 13.722 11.408C13.613 12.215 13.408 12.697 13.052 13.052C12.697 13.408 12.215 13.613 11.408 13.722C10.587 13.832 9.50699 13.833 7.99999 13.833C6.49299 13.833 5.41299 13.833 4.59199 13.722C3.78499 13.613 3.30299 13.408 2.94799 13.052C2.59199 12.697 2.38699 12.215 2.27799 11.408C2.16799 10.587 2.16699 9.50699 2.16699 7.99999C2.16699 6.49299 2.16699 5.41299 2.27799 4.59199C2.38699 3.78499 2.59199 3.30299 2.94799 2.94799L2.94799 2.94699Z",fill:"var(--el-color-text-primary)","fill-rule":"nonzero"},null,-1),c("path",{id:"矢量 2554",d:"M7.96199 1.16699C6.50199 1.16699 5.35399 1.16699 4.45899 1.28699C3.54099 1.40999 2.81299 1.66899 2.24099 2.24099C1.66799 2.81299 1.41099 3.54099 1.28699 4.45899C1.16699 5.35399 1.16699 6.50099 1.16699 7.96199L1.16699 8.03799C1.16699 9.49799 1.16699 10.646 1.28699 11.541C1.40999 12.459 1.66799 13.187 2.24099 13.759C2.81299 14.331 3.54099 14.589 4.45899 14.713C5.35399 14.833 6.50099 14.833 7.96199 14.833L8.03799 14.833C9.49799 14.833 10.646 14.833 11.541 14.713C12.459 14.59 13.187 14.332 13.759 13.759C14.331 13.187 14.589 12.459 14.713 11.541C14.833 10.646 14.833 9.49899 14.833 8.03799L14.833 7.96199C14.833 6.50199 14.833 5.35399 14.713 4.45899C14.59 3.54099 14.332 2.81299 13.759 2.24099C13.187 1.66799 12.459 1.41099 11.541 1.28699C10.646 1.16699 9.49899 1.16699 8.03799 1.16699L8.03799 1.16699L7.96199 1.16699ZM4.59199 2.27799C5.41299 2.16799 6.49299 2.16699 7.99999 2.16699C9.50699 2.16699 10.587 2.16699 11.408 2.27799C12.215 2.38699 12.697 2.59199 13.052 2.94799C13.408 3.30299 13.613 3.78499 13.722 4.59199C13.832 5.41299 13.833 6.49299 13.833 7.99999C13.833 9.50699 13.833 10.587 13.722 11.408C13.613 12.215 13.408 12.697 13.052 13.052C12.697 13.408 12.215 13.613 11.408 13.722C10.587 13.832 9.50699 13.833 7.99999 13.833C6.49299 13.833 5.41299 13.833 4.59199 13.722C3.78499 13.613 3.30299 13.408 2.94799 13.052C2.59199 12.697 2.38699 12.215 2.27799 11.408C2.16799 10.587 2.16699 9.50699 2.16699 7.99999C2.16699 6.49299 2.16699 5.41299 2.27799 4.59199C2.38699 3.78499 2.59199 3.30299 2.94799 2.94799L2.94799 2.94699C3.30299 2.59199 3.78499 2.38699 4.59199 2.27799Z","fill-rule":"nonzero",stroke:"var(--el-color-text-primary)","stroke-width":"0.300000"},null,-1)])),2))]}),_:1})])]),w(to)?(r(),u("div",ko,s(n[2]||(n[2]=[c("svg",{class:"spinning",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c("path",{d:"M21 12a9 9 0 11-6.219-8.56"})],-1),c("span",null,"加载中...",-1)])))):w(no)&&w(no).skills.length?(r(),u("div",bo,[(r(!0),u(d,null,v(w(so),function(e){return r(),u("div",{key:e.session_id,class:f(["assistant-item",{active:i.value===e.session_id,"!cursor-not-allowed":o.isSending}]),onClick:function(t){return function(e){po(e,!!o.isSending,l)}(e)}},[c("div",So,[i.value===e.session_id?(r(),u("svg",Lo,s(n[3]||(n[3]=[y('<defs data-v-7ac52f9b><linearGradient id="paint_linear_0" x1="3.00110435" x2="12.1424131" y1="0" y2="1.30177629" gradientUnits="userSpaceOnUse" data-v-7ac52f9b><stop stop-color="rgb(194,198,62)" offset="0" stop-opacity="1" data-v-7ac52f9b></stop><stop stop-color="rgb(41,167,58)" offset="1" stop-opacity="1" data-v-7ac52f9b></stop></linearGradient><linearGradient id="paint_linear_1" x1="11.4636259" x2="15.1201496" y1="9.33251953" y2="9.85323048" gradientUnits="userSpaceOnUse" data-v-7ac52f9b><stop stop-color="rgb(194,198,62)" offset="0" stop-opacity="1" data-v-7ac52f9b></stop><stop stop-color="rgb(41,167,58)" offset="1" stop-opacity="1" data-v-7ac52f9b></stop></linearGradient></defs><g id="组合 217" data-v-7ac52f9b><path id="星形 1" d="M7.52048 4.25843L11.8422 5.83439L7.52048 7.41034L5.9211 11.6688L4.32172 7.41034L8.88178e-16 5.83438L4.32172 4.25843L5.9211 0L7.52048 4.25843Z" fill="url(#paint_linear_0)" fill-rule="evenodd" data-v-7ac52f9b></path><path id="星形 2" d="M13.2714 11.0359L15.0001 11.6663L13.2714 12.2967L12.6316 14L11.9919 12.2967L10.2632 11.6663L11.9919 11.0359L12.6316 9.33252L13.2714 11.0359Z" fill="url(#paint_linear_1)" fill-rule="evenodd" data-v-7ac52f9b></path></g>',2)])))):k("",!0)]),c("div",To,[c("div",Mo,g(e.name||"AI助手"),1),c("div",Po,g(e.time_str||w(z)((new Date).getTime())),1)]),c("div",{class:f(["assistant-delete",{"!cursor-not-allowed":o.isSending}]),onClick:h(function(t){return p(e)},["stop"])},s(n[4]||(n[4]=[c("i",{class:"svgtofont-el-close-bold"},null,-1)])),10,Bo)],10,_o)}),128))])):(r(),u("div",xo,[L(C,{description:"暂无可用会话"})])),w(oo)?(r(),u("div",Ao,[w(oo).daily_total>0?(r(),u("div",Io,[c("div",Ro,[n[5]||(n[5]=c("span",{class:"quota-label"},"每日免费额度",-1)),c("span",Eo,"剩"+g(w(oo).daily_total-w(oo).daily_used)+"次",1)]),c("div",Uo,[c("div",{class:"progress-bar",style:R(w(io))},[c("div",{class:"progress-fill",style:R({width:w(lo),background:w(ao)})},null,4)],4)])])):k("",!0),w(oo).extra_total>0?(r(),u("div",Do,[c("div",Oo,[n[6]||(n[6]=c("span",{class:"quota-label"},"资源包额度",-1)),c("span",qo,"剩"+g(w(oo).extra_total-w(oo).extra_used)+"次",1)]),c("div",No,[c("div",{class:"progress-bar shiny-progress",style:R(w(io))},[c("div",{class:"progress-fill",style:R({width:w(ro),background:w(ao)})},null,4)],4)])])):k("",!0)])):k("",!0)])],2)}}}),Ho=F(Fo,[["__scopeId","data-v-7ac52f9b"]]);function Zo(e){var t=W().mainHeight,o=se(),r=o.inputMessage,u=o.currentMessages,c=o.conversations,d=o.currentConversationId,v=o.currentSkillAgentId,f=o.currentSessionDir,g=o.currentTimeStr,h=o.currentAssistantName,y=o.currentAssistantPresetQuestions,w=o.historyPanelVisible,k=o.isTyping,x=o.isSending,b=o.streamingContentBlocks,_=o.streamingThinkCollapsed,S=o.modelsList,L=o.currentModel,T=o.toolsList,M=o.selectedTools,P=o.showModelPopover,A=o.showToolPopover,I=o.showUploadPopover,R=o.modelsLoading,U=o.toolsLoading,D=o.webSearchEnabled,O=o.smartMode,q=o.saveConversation,F=o.loadConversation,H=o.deleteConversation,Z=o.createNewConversation,z=o.getTimeAgo,V=function(){var e=null;function t(){return(t=p(l().m(function t(o,a,r,s,u,c,d,p,v,f,g,h,y,m,C){var w,k,x,b,_,S,L,T,M,P,B,A,I,R,E,U,D,O,q,N,F,H,Z;return l().w(function(t){for(;;)switch(t.p=t.n){case 0:return e&&e.abort(),e=new AbortController,w=e.signal,t.p=1,x=Date.now(),b=window.vite_public_proxy_key||"",j(String(x).concat(j(b))),t.n=2,fetch("".concat("","/mod/agent/com/chat").concat(""),{method:"POST",headers:{"Content-Type":"application/json","x-http-token":window.vite_public_request_token},body:JSON.stringify(n(n({message:"string"==typeof o?o:JSON.stringify(o),model:r},d?{web_search:!0,tools:u.map(function(e){return e.id})}:n({tools:s.map(function(e){return e.id})},c?{web_search:!0}:{})),{},{session_id:a},p?{skill_agent_id:p,sessions_dir:"skill_agent_sessions"}:{prompt_id:"agent_aics"})),signal:w});case 2:if(_=t.v,S=null===(k=_.body)||void 0===k?void 0:k.getReader()){t.n=3;break}throw new Error("无法获取响应流");case 3:L=new TextDecoder("utf-8");case 4:return t.n=5,S.read();case 5:if(T=t.v,M=T.done,P=T.value,!M){t.n=6;break}return t.a(3,26);case 6:B=L.decode(P,{stream:!0}),A=B.split("\n"),I=void 0,R={onThink:h,onChunk:v,onError:g,onComplete:f,onToolCall:y,onToolResult:m,onMetaInfo:C},E=i(A),t.p=7,E.s();case 8:if((U=E.n()).done){t.n=22;break}if(""!==(D=(D=U.value).replace(/\r$/,""))){t.n=9;break}return t.a(3,21);case 9:if(!D.startsWith("event:")){t.n=19;break}H=D.slice(6).trim(),t.n="message_think"===H?10:"message"===H?11:"tool_call"===H?12:"tool_result"===H?13:"meta_info"===H?14:"message_end"===H?15:"error"===H?16:"usage"===H?17:18;break;case 10:return I="onThink",t.a(3,18);case 11:return I="onChunk",t.a(3,18);case 12:return I="onToolCall",t.a(3,18);case 13:return I="onToolResult",t.a(3,18);case 14:return I="onMetaInfo",t.a(3,18);case 15:return f(),t.a(3,18);case 16:return I="onError",t.a(3,18);case 17:return I="",t.a(3,18);case 18:t.n=21;break;case 19:if(!D.startsWith("data:")){t.n=21;break}if(((O=D.slice(5).slice(1)).startsWith('"')&&O.endsWith('"')||O.startsWith("'")&&O.endsWith("'"))&&(O=O.slice(1,-1)),I){t.n=20;break}return t.a(3,21);case 20:if("onToolCall"===I||"onToolResult"===I||"onMetaInfo"===I)try{N=JSON.parse(O),null===(q=R[I])||void 0===q||q.call(R,N)}catch(l){}else O=O.replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t"),null===(F=R[I])||void 0===F||F.call(R,O);case 21:t.n=8;break;case 22:t.n=24;break;case 23:t.p=23,Z=t.v,E.e(Z);case 24:return t.p=24,E.f(),t.f(24);case 25:t.n=4;break;case 26:e=null,t.n=29;break;case 27:if(t.p=27,"AbortError"!==t.v.name){t.n=28;break}return e=null,t.a(2);case 28:g("抱歉,连接AI服务时出现错误,请稍后再试。"),e=null;case 29:return t.a(2)}},t,null,[[7,23,24,25],[1,27]])}))).apply(this,arguments)}return{getAIResponseStream:function(e,n,o,a,i,l,r,s,u,c,d,p,v,f,g){return t.apply(this,arguments)},abortCurrentRequest:function(){e&&(e.abort(),e=null)}}}(),$=V.getAIResponseStream,G=V.abortCurrentRequest,Q=null,K=null,J=m(!1),X=m(!1),Y=m({system_prompt:"",api_base_url:"",api_key:"",models:[],embedding:{embedding_api_key:"",embedding_base_url:"",embedding_model_name:""},rag:{sliding_window_size:10,rag_trigger_threshold:3,rag_retrieval_count:10,rag_final_count:5},agent:{max_tool_iterations:10,temperature:1,top_p:1},default_headers:{},questions:[]}),ee=C(function(){return y.value.length>0?y.value.map(function(e){return{question:e,tools:[]}}):Y.value.questions||[]}),te=null,ne=null;function le(){k.value=!1,ne&&clearTimeout(ne),ne=setTimeout(function(){x.value&&(k.value=!0)},3e3)}function re(){ne&&(clearTimeout(ne),ne=null),k.value=!1}function de(e){return{onChunk:function(e){le();var t=b.value[b.value.length-1];t&&"message"===t.type?t.content+=e:b.value.push({type:"message",content:e}),b.value.some(function(e){return"think"===e.type})&&(_.value=!0),B(function(){var e;return null===(e=Q)||void 0===e?void 0:e.scrollToBottom()})},onComplete:function(){if(re(),b.value.length>0){b.value.forEach(function(e){"think"===e.type&&(e.collapsed=!0)});var t=window.__temp_ai_msg_id;delete window.__temp_ai_msg_id;var n={role:"assistant",content:"",time:(new Date).toISOString(),contentBlocks:s(b.value),id:t};void 0!==e?u.value.splice(e,0,n):u.value.push(n)}b.value=[],x.value=!1,q(),ye(),B(function(){var e;return null===(e=Q)||void 0===e?void 0:e.scrollToBottom()})},onError:function(t){re(),b.value.forEach(function(e){"think"===e.type&&(e.collapsed=!0)}),b.value.push({type:"message",content:t});var n={role:"assistant",content:"",time:(new Date).toISOString(),contentBlocks:s(b.value)};void 0!==e?u.value.splice(e,0,n):u.value.push(n),b.value=[],x.value=!1,q(),ye()},onThink:function(e){le();var t=b.value[b.value.length-1];t&&"think"===t.type?t.content+=e:(b.value.forEach(function(e){"think"===e.type&&(e.collapsed=!0)}),b.value.push({type:"think",content:e,collapsed:!1})),B(function(){var e;return null===(e=Q)||void 0===e?void 0:e.scrollToBottom()})},onToolCall:function(e){le();var t=function(){try{return JSON.parse(e.args).description}catch(t){return}}();if("TodoWrite"===e.tool){var n=ue(e.args);if(n&&n.length>0){var o=b.value.findIndex(function(e){return"tool_call"===e.type&&"TodoWrite"===e.tool});-1!==o&&b.value.splice(o,1),b.value.push({type:"tool_call",tool:e.tool,args:e.args,id:e.id,status:"calling",collapsed:!1,todoItems:n,description:t})}}else{var a=b.value.find(function(t){return"tool_call"===t.type&&t.id===e.id});a&&"tool_call"===a.type?(a.args=e.args,a.status="calling",t&&(a.description=t)):b.value.push({type:"tool_call",tool:e.tool,args:e.args,id:e.id,status:"calling",collapsed:!0,description:t})}B(function(){var e;return null===(e=Q)||void 0===e?void 0:e.scrollToBottom()})},onToolResult:function(e){le();var t=b.value.find(function(t){return"tool_call"===t.type&&t.id===e.id});if(t&&"tool_call"===t.type&&(t.result=e.result,t.status="completed","TodoWrite"===t.tool)){var n=ce(e.result);n&&(t.todoItems=n)}B(function(){var e;return null===(e=Q)||void 0===e?void 0:e.scrollToBottom()})},onMetaInfo:function(e,t){void 0!==t&&u.value[t]&&(u.value[t].id=e.user_msg_id),window.__temp_ai_msg_id=e.ai_msg_id}}}function pe(){return ve.apply(this,arguments)}function ve(){return(ve=p(l().m(function e(){var t,n,o,s,c,p,f,g,h,y,m,C,w,S,P,A,I,R,E,U,q,N,F,H,Z,z;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(p=r.value,f=(null===(t=K)||void 0===t?void 0:t.getPendingImages())||[],g=(null===(n=K)||void 0===n?void 0:n.getPendingFiles())||[],h=null===(o=K)||void 0===o?void 0:o.getPendingSites(),(p||0!==f.length||0!==g.length||0!==((null==h?void 0:h.length)||0))&&!x.value){e.n=1;break}return e.a(2);case 1:d.value||(d.value=Date.now().toString()),x.value=!0,r.value="",null===(s=K)||void 0===s||s.clearAll(),B(function(){var e;null===(e=K)||void 0===e||e.autoResizeTextarea()}),y=[],p&&y.push({type:"text",text:p}),m=new Set,C=i(g),e.p=2,S=l().m(function e(){var t,n,o,a,i,r;return l().w(function(e){for(;;)switch(e.n){case 0:o=w.value,a="@"+o.name,i=y.find(function(e){var t;return"file"===e.type&&"source"in e&&(null===(t=e.source)||void 0===t?void 0:t.value)===a}),-1!==(r=p.indexOf(a,null!==(t=null==i||null===(n=i.source)||void 0===n?void 0:n.end)&&void 0!==t?t:0))&&(y.push({type:"file",source:{value:a,start:r,end:r+a.length},path:o.path}),m.add(a));case 1:return e.a(2)}},e)}),C.s();case 3:if((w=C.n()).done){e.n=5;break}return e.d(a(S()),4);case 4:e.n=3;break;case 5:e.n=7;break;case 6:e.p=6,z=e.v,C.e(z);case 7:return e.p=7,C.f(),e.f(7);case 8:P=i(h||[]);try{for(P.s();!(A=P.n()).done;)I=A.value,R="@site:".concat(I.name),-1!==(E=p.indexOf(R))&&y.push({type:"site",source:{value:R,start:E,end:E+R.length},name:I.name})}catch(j){P.e(j)}finally{P.f()}if(f.length>0){U=i(f);try{for(U.s();!(q=U.n()).done;)N=q.value,y.push({type:"image_url",image_url:{url:N}})}catch(j){U.e(j)}finally{U.f()}}return F=y,H=u.value.length,u.value.push({role:"user",content:F,time:(new Date).toISOString()}),k.value=!0,null===(c=Q)||void 0===c||c.forceScrollToBottom(),b.value=[],_.value=!1,window.dispatchEvent(new CustomEvent("update-sidebar-list")),Z=de(),e.n=9,$(F,d.value,L.value,M.value,T.value,D.value,O.value,v.value,Z.onChunk,Z.onComplete,Z.onError,Z.onThink,Z.onToolCall,Z.onToolResult,function(e){return Z.onMetaInfo(e,H)});case 9:return e.a(2)}},e,null,[[2,6,7,8]])}))).apply(this,arguments)}function fe(){return fe=p(l().m(function e(t){var n,o,a;return l().w(function(e){for(;;)switch(e.n){case 0:n="",o=t-1;case 1:if(!(o>=0)){e.n=3;break}if("user"!==u.value[o].role){e.n=2;break}return n=u.value[o].content,e.a(3,3);case 2:o--,e.n=1;break;case 3:if(n){e.n=4;break}return e.a(2);case 4:return u.value.splice(t,1),k.value=!0,x.value=!0,b.value=[],_.value=!1,a=de(t),e.n=5,$(n,d.value||Date.now().toString(),L.value,M.value,T.value,D.value,O.value,v.value,a.onChunk,a.onComplete,a.onError,a.onThink,a.onToolCall,a.onToolResult,function(e){window.__temp_ai_msg_id_regen=e.ai_msg_id});case 5:return e.a(2)}},e)})),fe.apply(this,arguments)}function ge(e){return he.apply(this,arguments)}function he(){return(he=p(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(h.value=t.name,v.value=t.skill_agent_id,g.value=t.time_str||"",t.time_str){e.n=1;break}y.value=t.preset_questions||[],d.value=t.session_id,f.value=t.sessions_dir||"",e.n=2;break;case 1:return y.value=[],f.value=t.sessions_dir||"",e.n=2,F(t.session_id,t.sessions_dir||"");case 2:B(function(){var e;null===(e=Q)||void 0===e||e.forceScrollToBottom()});case 3:return e.a(2)}},e)}))).apply(this,arguments)}function ye(){return me.apply(this,arguments)}function me(){return(me=p(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.n){case 0:return window.dispatchEvent(new CustomEvent("update-sidebar-list")),e.n=1,oe({type:""});case 1:(n=e.v).data&&null!==(t=n.data.data)&&void 0!==t&&t.daily_quota&&window.dispatchEvent(new CustomEvent("update-sidebar-info",{detail:{data:n.data}}));case 2:return e.a(2)}},e)}))).apply(this,arguments)}function Ce(e){var t,n,o,a,i,l,r,s,u,c,d,p;e&&e.config&&(Y.value={system_prompt:e.config.system_prompt||"",api_base_url:e.config.api_base_url||"",api_key:e.config.api_key||"",models:e.config.models||[],embedding:{embedding_api_key:(null===(t=e.config.embedding)||void 0===t?void 0:t.embedding_api_key)||"",embedding_base_url:(null===(n=e.config.embedding)||void 0===n?void 0:n.embedding_base_url)||"",embedding_model_name:(null===(o=e.config.embedding)||void 0===o?void 0:o.embedding_model_name)||""},rag:{sliding_window_size:(null===(a=e.config.rag)||void 0===a?void 0:a.sliding_window_size)||10,rag_trigger_threshold:(null===(i=e.config.rag)||void 0===i?void 0:i.rag_trigger_threshold)||3,rag_retrieval_count:(null===(l=e.config.rag)||void 0===l?void 0:l.rag_retrieval_count)||10,rag_final_count:(null===(r=e.config.rag)||void 0===r?void 0:r.rag_final_count)||5},agent:{max_tool_iterations:(null===(s=e.config.agent)||void 0===s?void 0:s.max_tool_iterations)||10,temperature:null!==(u=null===(c=e.config.agent)||void 0===c?void 0:c.temperature)&&void 0!==u?u:1,top_p:null!==(d=null===(p=e.config.agent)||void 0===p?void 0:p.top_p)&&void 0!==d?d:1},default_headers:e.config.default_headers||{}},S.value=e.config.models||[],S.value.length>0&&(L.value=e.config.default_model||S.value[0]));e&&e.questions&&(Y.value.questions=e.questions)}function we(){return we=p(l().m(function e(t){var n,o,a;return l().w(function(e){for(;;)switch(e.n){case 0:return n=u.value[t],o=function(){var e=p(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(n.id&&d.value){e.n=1;break}return u.value.splice(t,1),q(),0===u.value.length&&Z(),e.a(2);case 1:return e.n=2,ie({session_id:d.value,sessions_dir:f.value||"aics_sessions",id:n.id});case 2:e.v.status&&(u.value.splice(t,1),q(),0===u.value.length&&Z());case 3:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),a=n.id?"删除后,聊天记录不可恢复,对话内的文件也将被彻底删除":"是否删除该条消息?",e.n=1,N({title:"删除消息",content:a});case 1:return e.n=2,o();case 2:return e.a(2)}},e)})),we.apply(this,arguments)}function ke(){w.value=!1}function xe(){te&&(clearTimeout(te),te=null)}function be(){return(be=p(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.n){case 0:return ke(),e.n=1,F(t);case 1:null===(n=Q)||void 0===n||n.forceScrollToBottom();case 2:return e.a(2)}},e)}))).apply(this,arguments)}function _e(){return _e=p(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.n){case 0:(n=M.value.findIndex(function(e){return e.id===t.id}))>-1?M.value.splice(n,1):M.value.push(t);case 1:return e.a(2)}},e)})),_e.apply(this,arguments)}function Se(e){var t=e.target;t.closest(".custom-popover")||t.closest(".toolbar-button")||(P.value=!1,A.value=!1,I.value=!1)}function Le(){return(Le=p(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.n){case 0:return X.value=!1,e.n=1,ae();case 1:(n=e.v).data&&Array.isArray(null===(t=n.data)||void 0===t?void 0:t.data)&&(T.value=n.data.data||[]);case 2:return e.a(2)}},e)}))).apply(this,arguments)}function Te(){return(Te=p(l().m(function e(t){return l().w(function(e){for(;;)if(0===e.n)return e.a(2)},e)}))).apply(this,arguments)}function Me(){return(Me=p(l().m(function e(t,n){var o,a,i;return l().w(function(e){for(;;)switch(e.n){case 0:return Q=t,K=n,document.addEventListener("click",Se),e.n=1,oe({type:""});case 1:return(a=e.v).status&&(Ce(a.data.data),window.dispatchEvent(new CustomEvent("update-sidebar-info",{detail:{data:a.data}}))),U.value=!0,e.n=2,ae();case 2:(i=e.v).data&&Array.isArray(null===(o=i.data)||void 0===o?void 0:o.data)&&(T.value=i.data.data||[]),U.value=!1;case 3:return e.a(2)}},e)}))).apply(this,arguments)}return E(function(){return e.path},function(){setTimeout(function(){var e;null===(e=Q)||void 0===e||e.forceScrollToBottom()},300)},{immediate:!0}),{mainHeight:t,inputMessage:r,currentMessages:u,conversations:c,currentConversationId:d,currentAssistantName:h,historyPanelVisible:w,isTyping:k,isSending:x,streamingContentBlocks:b,streamingThinkCollapsed:_,modelsList:S,currentModel:L,toolsList:T,selectedTools:M,showModelPopover:P,showToolPopover:A,showUploadPopover:I,modelsLoading:R,toolsLoading:U,webSearchEnabled:D,smartMode:O,assistantCollapsed:J,settingsDrawerVisible:X,globalConfig:Y,computedSuggestions:ee,getTimeAgo:z,sendMessage:pe,regenerateMessage:function(e){return fe.apply(this,arguments)},stopMessage:function(){G(),re(),x.value=!1,b.value.length>0&&(b.value.forEach(function(e){"think"===e.type&&(e.collapsed=!0)}),u.value.push({role:"assistant",content:"",time:(new Date).toISOString(),contentBlocks:s(b.value)})),b.value=[],ye()},handleSelectAssistant:ge,toggleAssistantCollapse:function(){J.value=!J.value},createNewChat:function(){if(0!==u.value.length){var e=v.value,t=h.value,n=(new Date).getTime().toString();Z(),ge({name:t,session_id:n,skill_agent_id:e||""}),window.dispatchEvent(new CustomEvent("create-new-chat",{detail:{name:t,session_id:n,skill_agent_id:e||""}}))}},handleDeleteMessage:function(e){return we.apply(this,arguments)},handleSuggestionClick:function(e){if(r.value=e.question,e.tools&&e.tools.length>0){var t=e.tools.map(function(e){return T.value.find(function(t){return t.id===e})}).filter(function(e){return void 0!==e});M.value=t}B(function(){var e;null===(e=K)||void 0===e||e.autoResizeTextarea()})},handleContinue:function(){x.value||(r.value="继续",B(function(){pe()}))},showHistoryPanel:function(){xe(),w.value=!0},hideHistoryPanel:ke,startHideTimer:function(){te=setTimeout(function(){ke()},200)},clearHideTimer:xe,handleLoadConversation:function(e){return be.apply(this,arguments)},selectModel:function(e){L.value=e,P.value=!1},toggleToolSelection:function(e){return _e.apply(this,arguments)},batchToggleTools:function(e,t){if(t)e.forEach(function(e){M.value.some(function(t){return t.id===e.id})||M.value.push(e)});else{var n=new Set(e.map(function(e){return e.id}));M.value=M.value.filter(function(e){return!n.has(e.id)})}},removeSelectedTool:function(e){var t=M.value.findIndex(function(t){return t.id===e});t>-1&&M.value.splice(t,1)},closeSettingsDrawer:function(){return Le.apply(this,arguments)},handleSaveConfig:function(e){return Te.apply(this,arguments)},saveConversation:q,loadConversation:F,deleteConversation:H,createNewConversation:Z,init:function(e,t){return Me.apply(this,arguments)},cleanup:function(){document.removeEventListener("click",Se),G(),re(),ye(),b.value=[],P.value=!1,A.value=!1,I.value=!1,x.value=!1}}}var zo={class:"assistant-wrapper"},jo={class:"chat-header"},Wo={class:"chat-header-left"},Vo={class:"assistant-name"},$o=o({__name:"index",setup:function(e){var t=O(),n=m(null),o=m(null),a=Zo(t),i=a.mainHeight,l=a.inputMessage,d=a.currentMessages,p=a.conversations,v=a.currentConversationId,h=a.currentAssistantName,y=a.historyPanelVisible,C=a.isTyping,k=a.isSending,x=a.streamingContentBlocks,b=a.streamingThinkCollapsed,_=a.modelsList,S=a.currentModel,M=a.toolsList,P=a.selectedTools,B=a.showModelPopover,E=a.showToolPopover,D=a.showUploadPopover,N=a.modelsLoading,F=a.toolsLoading,H=a.webSearchEnabled,Z=a.smartMode,z=a.assistantCollapsed,j=a.computedSuggestions,W=a.getTimeAgo,V=a.sendMessage,$=a.regenerateMessage,G=a.stopMessage,Q=a.handleSelectAssistant,K=a.toggleAssistantCollapse,J=a.createNewChat,X=a.handleDeleteMessage,Y=a.handleSuggestionClick,ee=a.handleContinue,te=a.showHistoryPanel,ne=a.hideHistoryPanel,oe=a.startHideTimer,ae=a.clearHideTimer,ie=a.handleLoadConversation,le=a.selectModel,re=a.toggleToolSelection,se=a.batchToggleTools,ue=a.removeSelectedTool;return A(function(){return a.init(n.value,o.value)}),I(function(){return a.cleanup()}),function(e,t){var a=U;return r(),u("div",{class:"ai-chat-page",style:R({"min-height":w(i)-120+"px","max-height":w(i)-120+"px"})},[c("div",zo,[L(Ho,{currentAssistant:w(h),currentConversationId:w(v),collapsed:w(z),isSending:w(k),onSelect:w(Q),onCreate:w(J)},null,8,["currentAssistant","currentConversationId","collapsed","isSending","onSelect","onCreate"])]),c("div",{class:f(["chat-main",{"assistant-collapsed":w(z)}])},[c("div",jo,[c("div",Wo,[c("div",{class:f(["assistant-collapse-btn",{"is-collapsed":w(z)}]),onClick:t[0]||(t[0]=function(){return w(K)&&w(K).apply(void 0,arguments)})},[L(a,{effect:"dark",content:w(z)?"展开助手列表":"折叠助手列表",placement:"top","open-delay":500,"hide-after":0},{default:T(function(){return s(t[8]||(t[8]=[c("svg",{t:"1775554157975",class:"w-[2.2rem] h-[2.2rem]",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1655",width:"200",height:"200"},[c("path",{d:"M341.333333 298.666667H213.333333v469.333333h640V298.666667H384v469.333333H341.333333V298.666667z m554.666667-42.666667v554.666667H170.666667V256h725.333333z",fill:"var(--el-color-text-primary)","p-id":"1656"})],-1)]))}),_:1},8,["content"])],2),c("span",Vo,g(w(h)||"AI助手"),1)]),t[9]||(t[9]=c("div",{class:"chat-header-right"},null,-1))]),L(me,{conversations:w(p),currentConversationId:w(v),panelVisible:w(y),getTimeAgo:w(W),isSending:w(k),onShowPanel:w(te),onHidePanel:w(ne),onStartHideTimer:w(oe),onClearHideTimer:w(ae),onLoadConversation:w(ie)},null,8,["conversations","currentConversationId","panelVisible","getTimeAgo","isSending","onShowPanel","onHidePanel","onStartHideTimer","onClearHideTimer","onLoadConversation"]),L(jt,{ref_key:"chatMainRef",ref:n,messages:w(d),isTyping:w(C),isSending:w(k),streamingContentBlocks:w(x),streamingThinkCollapsed:w(b),suggestions:w(j),assistantName:w(h),"onUpdate:streamingThinkCollapsed":t[1]||(t[1]=function(e){return b.value=e}),onSuggestionClick:w(Y),onRegenerate:w($),onDeleteMessage:w(X),onContinue:w(ee)},null,8,["messages","isTyping","isSending","streamingContentBlocks","streamingThinkCollapsed","suggestions","assistantName","onSuggestionClick","onRegenerate","onDeleteMessage","onContinue"]),L(eo,{ref_key:"chatInputRef",ref:o,inputMessage:w(l),"onUpdate:inputMessage":t[2]||(t[2]=function(e){return q(l)?l.value=e:null}),showModelPopover:w(B),"onUpdate:showModelPopover":t[3]||(t[3]=function(e){return q(B)?B.value=e:null}),showToolPopover:w(E),"onUpdate:showToolPopover":t[4]||(t[4]=function(e){return q(E)?E.value=e:null}),showUploadPopover:w(D),"onUpdate:showUploadPopover":t[5]||(t[5]=function(e){return q(D)?D.value=e:null}),webSearchEnabled:w(H),"onUpdate:webSearchEnabled":t[6]||(t[6]=function(e){return q(H)?H.value=e:null}),smartMode:w(Z),"onUpdate:smartMode":t[7]||(t[7]=function(e){return q(Z)?Z.value=e:null}),currentModel:w(S),selectedTools:w(P),modelsList:w(_),toolsList:w(M),modelsLoading:w(N),toolsLoading:w(F),isSending:w(k),onSendMessage:w(V),onStopMessage:w(G),onRemoveSelectedTool:w(ue),onSelectModel:w(le),onToggleToolSelection:w(re),onBatchToggleTools:w(se)},null,8,["inputMessage","showModelPopover","showToolPopover","showUploadPopover","webSearchEnabled","smartMode","currentModel","selectedTools","modelsList","toolsList","modelsLoading","toolsLoading","isSending","onSendMessage","onStopMessage","onRemoveSelectedTool","onSelectModel","onToggleToolSelection","onBatchToggleTools"])],2)],4)}}});e("default",F($o,[["__scopeId","data-v-0f521143"]]))}}})}();