hermes-web-ui 0.5.27 → 0.5.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/js/{ChannelsView-D_Hpf1W2.js → ChannelsView-CuofDTcs.js} +1 -1
- package/dist/client/assets/js/{ChatView-DOr-OoTw.js → ChatView-Cpj8e0uj.js} +1 -1
- package/dist/client/assets/js/{FileRenameModal-DCzKrCtb.js → FileRenameModal-DS3tMLmA.js} +1 -1
- package/dist/client/assets/js/{FilesView-UJ8COV83.js → FilesView-DitPDLfP.js} +1 -1
- package/dist/client/assets/js/{GatewaysView-DoaDCbK0.js → GatewaysView-DEwU6CSA.js} +1 -1
- package/dist/client/assets/js/{GroupChatView-DnI3I50w.js → GroupChatView-B1KWnK4w.js} +1 -1
- package/dist/client/assets/js/{HistoryMessageList-Dppp5myU.js → HistoryMessageList-DVoUuNfX.js} +1 -1
- package/dist/client/assets/js/{HistoryView-Bx31cTqX.js → HistoryView-By-yzPZa.js} +1 -1
- package/dist/client/assets/js/{JobsView-Dwo25w0R.js → JobsView-CCwgRxCj.js} +1 -1
- package/dist/client/assets/js/{KanbanView-B0OXZzdS.js → KanbanView-CHz90gv2.js} +1 -1
- package/dist/client/assets/js/{LoginView-BP1Dbycl.js → LoginView-nCg7jCjW.js} +1 -1
- package/dist/client/assets/js/{LogsView-Bjv7V7F0.js → LogsView-BXG5oQpY.js} +1 -1
- package/dist/client/assets/js/{MarkdownRenderer-CvzCPLnZ.js → MarkdownRenderer-BCFoS7DH.js} +1 -1
- package/dist/client/assets/js/{MemoryView-BZqGsRGv.js → MemoryView-DoVkLerx.js} +1 -1
- package/dist/client/assets/js/{MessageItem-BzZuEzVW.js → MessageItem-BhSU5oee.js} +1 -1
- package/dist/client/assets/js/{ModelsView-Bu2mJnSO.js → ModelsView-BeDBR3tp.js} +1 -1
- package/dist/client/assets/js/{PluginsView-Do42kP51.js → PluginsView-D3w2eLIX.js} +1 -1
- package/dist/client/assets/js/{ProfilesView-rgzlgeY7.js → ProfilesView-DgEhQ263.js} +1 -1
- package/dist/client/assets/js/{SessionListItem-Y4rY8ixs.js → SessionListItem-BKe7QBCc.js} +1 -1
- package/dist/client/assets/js/{SettingRow-5JNu2zcB.js → SettingRow-Cj9O4m9X.js} +1 -1
- package/dist/client/assets/js/{SettingsView-BsJJZ2sv.js → SettingsView-VtbkRWEM.js} +1 -1
- package/dist/client/assets/js/{SkillsUsageView-DmKMulrJ.js → SkillsUsageView-BGvo9h2N.js} +1 -1
- package/dist/client/assets/js/{SkillsView-DrUkFlBB.js → SkillsView-DwsnhtnV.js} +1 -1
- package/dist/client/assets/js/{TerminalView-HQvnFA42.js → TerminalView-BAlxAV-W.js} +1 -1
- package/dist/client/assets/js/{UsageView-DUlZFcoj.js → UsageView-ByfmOWKv.js} +1 -1
- package/dist/client/assets/js/{_plugin-vue_export-helper-ZIsfSgrY.js → _plugin-vue_export-helper-CrLlP_D3.js} +2 -2
- package/dist/client/assets/js/app-CYaCGxZ_.js +1 -0
- package/dist/client/assets/js/{auth-CrqiXkJC.js → auth-hbDI2OUF.js} +1 -1
- package/dist/client/assets/js/{index-JI6E-cKo.js → index-Bzb-xLYu.js} +1 -1
- package/dist/client/assets/js/{models-BR4rntqB.js → models-CDvVG-uE.js} +1 -1
- package/dist/client/assets/js/{session-browser-prefs-DPQy70mA.js → session-browser-prefs-HIgWQY8T.js} +1 -1
- package/dist/client/assets/js/{skills-BZYoszrI.js → skills-BCJOb_4y.js} +1 -1
- package/dist/client/index.html +3 -3
- package/dist/server/index.js +2 -2
- package/package.json +2 -2
- package/dist/client/assets/js/app-BP-u-rQP.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as q}from"./rolldown-runtime-BKwlnUi0.js";import{B as he,F as be,Mt as ke,Nt as B,R as p,Rt as e,U as V,Vt as H,Z as x,_t as _,bt as xe,c as g,ct as P,et as we,gt as qe,ht as Ce,it as v,l as ye,nt as L,ot as I,rt as h,st as t,t as $,tt as w,wt as o,xt as ze,y as He,yt as Se,z as Me,zt as j}from"./ui-vendor-CsTMg6zH.js";import{n as W,r as D}from"./vue-vendor-D8zSB7VM.js";import{n as Q,t as F}from"./_plugin-vue_export-helper-ZIsfSgrY.js";import{c as Te,d as Ae,f as Ue,l as Be,o as de,s as ue,u as Re}from"./index-JI6E-cKo.js";import{n as Ie,t as r}from"./SettingRow-5JNu2zcB.js";var K,Z,J,O,pe,X=q((()=>{V(),$(),W(),K={class:"platform-info"},Z=["innerHTML"],J={class:"platform-name"},O={key:0,class:"platform-card-body"},pe=P({__name:"PlatformCard",props:{name:{},icon:{},config:{},credentials:{},exclusive:{type:Boolean}},setup(S){const s=S,k=B(!0),{t:l}=D(),C=we(()=>{const y=s.credentials;if(!y)return!1;const i=["token","api_key","app_id","client_id","secret","app_secret","client_secret","access_token","bot_id","account_id","enabled"];return[y,y.extra].filter(Boolean).some(M=>i.some(m=>{const f=M[m];return f!=null&&f!==""&&f!==!1}))});return(y,i)=>(_(),v("div",{class:j(["platform-card",{configured:C.value}])},[w("div",{class:"platform-card-header",onClick:i[0]||(i[0]=M=>k.value=!k.value)},[w("div",K,[w("span",{class:"platform-icon",innerHTML:S.icon},null,8,Z),w("span",J,H(S.name),1),t(e(he),{type:C.value?"success":"default",size:"small",round:""},{default:o(()=>[I(H(C.value?e(l)("common.configured"):e(l)("common.notConfigured")),1)]),_:1},8,["type"])]),w("span",{class:j(["expand-icon",{expanded:k.value}])},"▾",2)]),k.value?(_(),v("div",O,[S.exclusive?(_(),L(e(Me),{key:0,type:"warning","show-icon":!0,class:"exclusive-alert"},{default:o(()=>[I(H(e(l)("platform.exclusiveTokenWarning")),1)]),_:1})):h("",!0),xe(y.$slots,"default",{},void 0,!0)])):h("",!0)],2))}})})),Ve=q((()=>{})),me,Pe=q((()=>{X(),X(),Ve(),Q(),me=F(pe,[["__scopeId","data-v-e27ecbbe"]])})),Y,ee,le,ae,fe,te=q((()=>{V(),$(),W(),de(),Be(),Pe(),Ie(),Y={class:"settings-section"},ee={class:"weixin-qr-section"},le={key:1,class:"weixin-qr-loading"},ae={key:2,class:"weixin-qr-hint"},fe=P({__name:"PlatformSettings",setup(S){const s=ue(),k=He(),{t:l}=D(),C=ke({});function y(u,a){return`${u}.${a}`}function i(u,a){return!!C[y(u,a)]}async function M(u,a,z){const c=y(u,a);C[c]=!0;try{await z(),k.success(l("settings.saved"))}catch{k.error(l("settings.saveFailed"))}finally{C[c]=!1}}async function m(u,a,z){M(u,a,()=>s.saveSection(u,z))}async function f(u,a,z){M(u,a,async()=>{await Ae(u,z),await s.fetchSettings()})}function d(u){return s.platforms[u]||{}}function N(u){return u===!0||u==="true"}const E=B(""),T=B(""),b=B("idle");let A=null;async function ge(){b.value="loading",E.value="",T.value="",G();try{const u=await Te();T.value=u.qrcode,E.value=u.qrcode_url,window.open(u.qrcode_url,"_blank"),b.value="waiting",U()}catch(u){b.value="error",k.error(u.message||l("platform.qrFetching"))}}function U(){T.value&&(A=setTimeout(async()=>{try{const u=await Re(T.value);u.status==="wait"?U():u.status==="scaned"?(b.value="scaned",U()):u.status==="expired"?b.value="expired":u.status==="confirmed"&&(b.value="confirmed",await Ue({account_id:u.account_id,token:u.token,base_url:u.base_url}),await s.fetchSettings(),k.success(l("settings.saved")))}catch{U()}},3e3))}function G(){A&&(clearTimeout(A),A=null)}qe(()=>{G()});const ve=[{key:"telegram",name:"Telegram",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.479.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/></svg>'},{key:"discord",name:"Discord",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z"/></svg>'},{key:"slack",name:"Slack",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zm10.122 0a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V5.042zm-1.27 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.27a2.527 2.527 0 0 1 2.523-2.52h6.313A2.528 2.528 0 0 1 24 18.956a2.528 2.528 0 0 1-2.522 2.523h-6.313z"/></svg>'},{key:"whatsapp",name:"WhatsApp",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>'},{key:"matrix",name:"Matrix",icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M.632.55v22.9H2.28V24H0V0h2.28v.55zm7.043 7.26v1.157h.033c.309-.443.683-.784 1.117-1.024.433-.245.936-.365 1.5-.365.54 0 1.033.107 1.48.324.448.217.786.619 1.017 1.205.24-.376.558-.702.956-.98.398-.277.872-.414 1.424-.414.41 0 .784.065 1.122.194.34.13.629.325.87.588.241.263.428.59.56.984.132.393.198.85.198 1.368v5.89h-2.49v-4.893c0-.268-.016-.525-.048-.77a1.627 1.627 0 00-.2-.63 1.028 1.028 0 00-.392-.426 1.294 1.294 0 00-.616-.134c-.277 0-.508.05-.693.15a1.043 1.043 0 00-.43.41 1.768 1.768 0 00-.214.616 4.15 4.15 0 00-.06.74v4.937H9.29v-4.937c0-.25-.01-.498-.032-.742a1.84 1.84 0 00-.166-.638.998.998 0 00-.363-.448 1.206 1.206 0 00-.624-.154c-.26 0-.483.048-.67.144a1.055 1.055 0 00-.436.402 1.744 1.744 0 00-.227.616 4.108 4.108 0 00-.063.74v4.937H5.21V7.81zm15.693 15.64V.55H21.72V0H24v24h-2.28v-.55z"/></svg>'},{key:"feishu",name:"Feishu",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M6.59 3.41a2.25 2.25 0 0 1 3.182 0L13.5 7.14l-3.182 3.182L6.59 7.59a2.25 2.25 0 0 1 0-3.182zm5.303 5.303L15.075 5.53a2.25 2.25 0 0 1 3.182 3.182L15.075 11.894 11.893 8.713zM3.41 6.59a2.25 2.25 0 0 1 3.182 0l3.182 3.182-3.182 3.182a2.25 2.25 0 0 1-3.182-3.182L3.41 6.59zm5.303 5.303L11.894 15.075a2.25 2.25 0 0 1-3.182 3.182L5.53 15.075 8.713 11.893zm5.303-5.303L17.478 9.778a2.25 2.25 0 0 1-3.182 3.182L10.53 10.075l3.182-3.182 0 .023z"/></svg>'},{key:"dingtalk",name:"DingTalk",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M19.76 7.05c-.23-.52-.7-.9-1.26-1.02L5.35 3.2c-.77-.16-1.51.38-1.58 1.16-.22 2.55.17 5.4 1.13 7.66.97 2.29 2.52 4.11 4.45 4.82l-1.28 3.03c-.17.4.24.79.63.59l9.47-4.83c.34-.17.55-.52.55-.9v-3.12c.73-.4 1.22-1.17 1.22-2.06 0-.87-.08-1.73-.18-2.5zm-3.66 5.95-5.19 2.65.76-1.8c.12-.29-.03-.62-.33-.72-2.1-.73-3.56-3.54-3.95-6.73l9.27 2c.04.38.07.76.07 1.15 0 .45-.36.81-.81.81h-2.79c-.35 0-.63.28-.63.63s.28.63.63.63h2.97V13z"/></svg>'},{key:"qqbot",name:"QQBot",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C7.58 2 4 5.27 4 9.31c0 2.3 1.15 4.34 2.95 5.68-.13.58-.48 1.62-1.26 2.53-.24.28-.05.72.32.73 1.72.05 3.02-.68 3.69-1.15.72.16 1.49.25 2.3.25 4.42 0 8-3.27 8-7.31S16.42 2 12 2zm-3.2 7.63c-.63 0-1.14-.55-1.14-1.23s.51-1.23 1.14-1.23 1.14.55 1.14 1.23-.51 1.23-1.14 1.23zm6.4 0c-.63 0-1.14-.55-1.14-1.23s.51-1.23 1.14-1.23 1.14.55 1.14 1.23-.51 1.23-1.14 1.23zM5.5 20.5a.5.5 0 0 1 .5-.5h12a.5.5 0 0 1 0 1H6a.5.5 0 0 1-.5-.5z"/></svg>'},{key:"weixin",name:"Weixin",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>'},{key:"wecom",name:"WeCom",icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>'}];return(u,a)=>{const z=ze("NSpin");return _(),v("section",Y,[(_(),v(x,null,Se(ve,c=>t(me,{key:c.key,name:c.name,icon:c.icon,exclusive:c.exclusive,config:e(s)[c.key],credentials:d(c.key)},{default:o(()=>[c.key==="telegram"?(_(),v(x,{key:0},[t(r,{label:e(l)("platform.botToken"),hint:e(l)("platform.botTokenHint")},{default:o(()=>[t(e(p),{"default-value":d("telegram").token||"",loading:i("telegram","token"),clearable:"",size:"small",class:"input-lg",placeholder:"123456:ABC-DEF...",onChange:a[0]||(a[0]=n=>f("telegram","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionGroup")},{default:o(()=>[t(e(g),{value:e(s).telegram.require_mention,loading:i("telegram","require_mention"),"onUpdate:value":a[1]||(a[1]=n=>m("telegram","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.reactions"),hint:e(l)("platform.reactionsHint")},{default:o(()=>[t(e(g),{value:e(s).telegram.reactions,loading:i("telegram","reactions"),"onUpdate:value":a[2]||(a[2]=n=>m("telegram","reactions",{reactions:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.freeResponseChats"),hint:e(l)("platform.freeResponseChatsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).telegram.free_response_chats||"",loading:i("telegram","free_response_chats"),size:"small",placeholder:"chat_id1,chat_id2",onChange:a[3]||(a[3]=n=>m("telegram","free_response_chats",{free_response_chats:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.mentionPatterns"),hint:e(l)("platform.mentionPatternsHint")},{default:o(()=>[t(e(p),{"default-value":(e(s).telegram.mention_patterns||[]).join(", "),loading:i("telegram","mention_patterns"),size:"small",placeholder:"pattern1, pattern2",onChange:a[4]||(a[4]=n=>m("telegram","mention_patterns",{mention_patterns:n?n.split(",").map(R=>R.trim()):[]}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0),c.key==="discord"?(_(),v(x,{key:1},[t(r,{label:e(l)("platform.botToken"),hint:e(l)("platform.botTokenHint")},{default:o(()=>[t(e(p),{"default-value":d("discord").token||"",loading:i("discord","token"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot token...",onChange:a[5]||(a[5]=n=>f("discord","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionChannel")},{default:o(()=>[t(e(g),{value:e(s).discord.require_mention,loading:i("discord","require_mention"),"onUpdate:value":a[6]||(a[6]=n=>m("discord","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.autoThread"),hint:e(l)("platform.autoThreadHint")},{default:o(()=>[t(e(g),{value:e(s).discord.auto_thread,loading:i("discord","auto_thread"),"onUpdate:value":a[7]||(a[7]=n=>m("discord","auto_thread",{auto_thread:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.reactions"),hint:e(l)("platform.reactionsHint")},{default:o(()=>[t(e(g),{value:e(s).discord.reactions,loading:i("discord","reactions"),"onUpdate:value":a[8]||(a[8]=n=>m("discord","reactions",{reactions:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.freeResponseChannels"),hint:e(l)("platform.freeResponseChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).discord.free_response_channels||"",loading:i("discord","free_response_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:a[9]||(a[9]=n=>m("discord","free_response_channels",{free_response_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.allowedChannels"),hint:e(l)("platform.allowedChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).discord.allowed_channels||"",loading:i("discord","allowed_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:a[10]||(a[10]=n=>m("discord","allowed_channels",{allowed_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.ignoredChannels"),hint:e(l)("platform.ignoredChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).discord.ignored_channels||"",loading:i("discord","ignored_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:a[11]||(a[11]=n=>m("discord","ignored_channels",{ignored_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.noThreadChannels"),hint:e(l)("platform.noThreadChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).discord.no_thread_channels||"",loading:i("discord","no_thread_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:a[12]||(a[12]=n=>m("discord","no_thread_channels",{no_thread_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0),c.key==="slack"?(_(),v(x,{key:2},[t(r,{label:e(l)("platform.botToken"),hint:e(l)("platform.botTokenHint")},{default:o(()=>[t(e(p),{"default-value":d("slack").token||"",loading:i("slack","token"),clearable:"",size:"small",class:"input-lg",placeholder:"xoxb-...",onChange:a[13]||(a[13]=n=>f("slack","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionChannel")},{default:o(()=>[t(e(g),{value:e(s).slack.require_mention,loading:i("slack","require_mention"),"onUpdate:value":a[14]||(a[14]=n=>m("slack","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.allowBots"),hint:e(l)("platform.allowBotsHint")},{default:o(()=>[t(e(g),{value:e(s).slack.allow_bots,loading:i("slack","allow_bots"),"onUpdate:value":a[15]||(a[15]=n=>m("slack","allow_bots",{allow_bots:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.freeResponseChannels"),hint:e(l)("platform.freeResponseChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).slack.free_response_channels||"",loading:i("slack","free_response_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:a[16]||(a[16]=n=>m("slack","free_response_channels",{free_response_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0),c.key==="whatsapp"?(_(),v(x,{key:3},[t(r,{label:e(l)("platform.waEnabled"),hint:e(l)("platform.waEnabledHint")},{default:o(()=>[t(e(g),{value:d("whatsapp").enabled,loading:i("whatsapp","enabled"),"onUpdate:value":a[17]||(a[17]=n=>f("whatsapp","enabled",{enabled:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionGroup")},{default:o(()=>[t(e(g),{value:e(s).whatsapp.require_mention,loading:i("whatsapp","require_mention"),"onUpdate:value":a[18]||(a[18]=n=>m("whatsapp","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.freeResponseChats"),hint:e(l)("platform.freeResponseChatsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).whatsapp.free_response_chats||"",loading:i("whatsapp","free_response_chats"),size:"small",placeholder:"chat_id1,chat_id2",onChange:a[19]||(a[19]=n=>m("whatsapp","free_response_chats",{free_response_chats:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.mentionPatterns"),hint:e(l)("platform.mentionPatternsHint")},{default:o(()=>[t(e(p),{"default-value":(e(s).whatsapp.mention_patterns||[]).join(", "),loading:i("whatsapp","mention_patterns"),size:"small",placeholder:"pattern1, pattern2",onChange:a[20]||(a[20]=n=>m("whatsapp","mention_patterns",{mention_patterns:n?n.split(",").map(R=>R.trim()):[]}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0),c.key==="matrix"?(_(),v(x,{key:4},[t(r,{label:e(l)("platform.accessToken"),hint:e(l)("platform.accessTokenHint")},{default:o(()=>[t(e(p),{"default-value":d("matrix").token||"",loading:i("matrix","token"),clearable:"",size:"small",class:"input-lg",placeholder:"syt_...",onChange:a[21]||(a[21]=n=>f("matrix","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.homeserver"),hint:e(l)("platform.homeserverHint")},{default:o(()=>[t(e(p),{"default-value":d("matrix").extra?.homeserver||"",loading:i("matrix","homeserver"),clearable:"",size:"small",class:"input-lg",placeholder:"https://matrix.org",onChange:a[22]||(a[22]=n=>f("matrix","homeserver",{extra:{...d("matrix").extra,homeserver:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionRoom")},{default:o(()=>[t(e(g),{value:e(s).matrix.require_mention,loading:i("matrix","require_mention"),"onUpdate:value":a[23]||(a[23]=n=>m("matrix","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.autoThread"),hint:e(l)("platform.autoThreadHintRoom")},{default:o(()=>[t(e(g),{value:e(s).matrix.auto_thread,loading:i("matrix","auto_thread"),"onUpdate:value":a[24]||(a[24]=n=>m("matrix","auto_thread",{auto_thread:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.dmMentionThreads"),hint:e(l)("platform.dmMentionThreadsHint")},{default:o(()=>[t(e(g),{value:e(s).matrix.dm_mention_threads,loading:i("matrix","dm_mention_threads"),"onUpdate:value":a[25]||(a[25]=n=>m("matrix","dm_mention_threads",{dm_mention_threads:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.freeResponseRooms"),hint:e(l)("platform.freeResponseRoomsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).matrix.free_response_rooms||"",loading:i("matrix","free_response_rooms"),size:"small",placeholder:"room_id1,room_id2",onChange:a[26]||(a[26]=n=>m("matrix","free_response_rooms",{free_response_rooms:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0),c.key==="feishu"?(_(),v(x,{key:5},[t(r,{label:e(l)("platform.appId"),hint:e(l)("platform.appIdHint")},{default:o(()=>[t(e(p),{"default-value":d("feishu").extra?.app_id||"",loading:i("feishu","app_id"),clearable:"",size:"small",class:"input-lg",placeholder:"cli_...",onChange:a[27]||(a[27]=n=>f("feishu","app_id",{extra:{...d("feishu").extra,app_id:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.appSecret"),hint:e(l)("platform.appSecretHint")},{default:o(()=>[t(e(p),{"default-value":d("feishu").extra?.app_secret||"",loading:i("feishu","app_secret"),clearable:"",size:"small",class:"input-lg",placeholder:"App Secret",onChange:a[28]||(a[28]=n=>f("feishu","app_secret",{extra:{...d("feishu").extra,app_secret:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionGroup")},{default:o(()=>[t(e(g),{value:e(s).feishu.require_mention,loading:i("feishu","require_mention"),"onUpdate:value":a[29]||(a[29]=n=>m("feishu","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.freeResponseChats"),hint:e(l)("platform.freeResponseChatsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).feishu.free_response_chats||"",loading:i("feishu","free_response_chats"),size:"small",placeholder:"chat_id1,chat_id2",onChange:a[30]||(a[30]=n=>m("feishu","free_response_chats",{free_response_chats:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0),c.key==="dingtalk"?(_(),v(x,{key:6},[t(r,{label:e(l)("platform.clientId"),hint:e(l)("platform.clientIdHint")},{default:o(()=>[t(e(p),{"default-value":d("dingtalk").extra?.client_id||"",loading:i("dingtalk","client_id"),clearable:"",size:"small",class:"input-lg",placeholder:"Client ID",onChange:a[31]||(a[31]=n=>f("dingtalk","client_id",{extra:{...d("dingtalk").extra,client_id:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.clientSecret"),hint:e(l)("platform.clientSecretHint")},{default:o(()=>[t(e(p),{"default-value":d("dingtalk").extra?.client_secret||"",loading:i("dingtalk","client_secret"),clearable:"",size:"small",class:"input-lg",placeholder:"Client Secret",onChange:a[32]||(a[32]=n=>f("dingtalk","client_secret",{extra:{...d("dingtalk").extra,client_secret:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.allowAllUsers"),hint:e(l)("platform.allowAllUsersHint")},{default:o(()=>[t(e(g),{value:N(d("dingtalk").allow_all_users),loading:i("dingtalk","allow_all_users"),"onUpdate:value":a[33]||(a[33]=n=>f("dingtalk","allow_all_users",{allow_all_users:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.allowedUsers"),hint:e(l)("platform.allowedUsersHint")},{default:o(()=>[t(e(p),{"default-value":d("dingtalk").allowed_users||"",loading:i("dingtalk","allowed_users"),clearable:"",size:"small",class:"input-lg",placeholder:"user_id1,user_id2",onChange:a[34]||(a[34]=n=>f("dingtalk","allowed_users",{allowed_users:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionGroup")},{default:o(()=>[t(e(g),{value:e(s).dingtalk.require_mention,loading:i("dingtalk","require_mention"),"onUpdate:value":a[35]||(a[35]=n=>m("dingtalk","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.freeResponseChats"),hint:e(l)("platform.freeResponseChatsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).dingtalk.free_response_chats||"",loading:i("dingtalk","free_response_chats"),size:"small",placeholder:"chat_id1,chat_id2",onChange:a[36]||(a[36]=n=>m("dingtalk","free_response_chats",{free_response_chats:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0),c.key==="qqbot"?(_(),v(x,{key:7},[t(r,{label:e(l)("platform.qqAppId"),hint:e(l)("platform.qqAppIdHint")},{default:o(()=>[t(e(p),{"default-value":d("qqbot").extra?.app_id||"",loading:i("qqbot","app_id"),clearable:"",size:"small",class:"input-lg",placeholder:"App ID",onChange:a[37]||(a[37]=n=>f("qqbot","app_id",{extra:{...d("qqbot").extra,app_id:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.qqAppSecret"),hint:e(l)("platform.qqAppSecretHint")},{default:o(()=>[t(e(p),{"default-value":d("qqbot").extra?.client_secret||"",loading:i("qqbot","client_secret"),clearable:"",size:"small",class:"input-lg",placeholder:"App Secret",onChange:a[38]||(a[38]=n=>f("qqbot","client_secret",{extra:{...d("qqbot").extra,client_secret:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.allowedUsers"),hint:e(l)("platform.allowedUsersHint")},{default:o(()=>[t(e(p),{"default-value":d("qqbot").allowed_users||"",loading:i("qqbot","allowed_users"),clearable:"",size:"small",class:"input-lg",placeholder:"openid1,openid2",onChange:a[39]||(a[39]=n=>f("qqbot","allowed_users",{allowed_users:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.allowAllUsers"),hint:e(l)("platform.allowAllUsersHint")},{default:o(()=>[t(e(g),{value:N(d("qqbot").allow_all_users),loading:i("qqbot","allow_all_users"),"onUpdate:value":a[40]||(a[40]=n=>f("qqbot","allow_all_users",{allow_all_users:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.qqMarkdown"),hint:e(l)("platform.qqMarkdownHint")},{default:o(()=>[t(e(g),{value:e(s).qqbot.extra?.markdown_support??!0,loading:i("qqbot","markdown_support"),"onUpdate:value":a[41]||(a[41]=n=>m("qqbot","markdown_support",{extra:{...e(s).qqbot.extra,markdown_support:n}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0),c.key==="weixin"?(_(),v(x,{key:8},[w("div",ee,[b.value==="idle"||b.value==="error"||b.value==="expired"||b.value==="confirmed"?(_(),L(e(be),{key:0,type:"primary",size:"small",onClick:ge},{default:o(()=>[I(H(b.value==="confirmed"?e(l)("platform.qrRelogin"):e(l)("platform.qrLogin")),1)]),_:1})):h("",!0),b.value==="loading"?(_(),v("div",le,[t(z,{size:"small"}),w("span",null,H(e(l)("platform.qrFetching")),1)])):h("",!0),b.value==="waiting"||b.value==="scaned"?(_(),v("div",ae,H(b.value==="scaned"?e(l)("platform.qrScanedHint"):e(l)("platform.qrScanHint")),1)):h("",!0)]),t(r,{label:e(l)("platform.weixinToken"),hint:e(l)("platform.weixinTokenHint")},{default:o(()=>[t(e(p),{"default-value":d("weixin").token||"",loading:i("weixin","token"),clearable:"",size:"small",class:"input-lg",placeholder:"Token",onChange:a[42]||(a[42]=n=>f("weixin","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.accountId"),hint:e(l)("platform.accountIdHint")},{default:o(()=>[t(e(p),{"default-value":d("weixin").extra?.account_id||"",loading:i("weixin","account_id"),clearable:"",size:"small",class:"input-lg",placeholder:"Account ID",onChange:a[43]||(a[43]=n=>f("weixin","account_id",{extra:{...d("weixin").extra,account_id:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0),c.key==="wecom"?(_(),v(x,{key:9},[t(r,{label:e(l)("platform.botId"),hint:e(l)("platform.botIdHint")},{default:o(()=>[t(e(p),{"default-value":d("wecom").extra?.bot_id||"",loading:i("wecom","bot_id"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot ID",onChange:a[44]||(a[44]=n=>f("wecom","bot_id",{extra:{...d("wecom").extra,bot_id:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.appSecret"),hint:e(l)("platform.wecomSecretHint")},{default:o(()=>[t(e(p),{"default-value":d("wecom").extra?.secret||"",loading:i("wecom","secret"),clearable:"",size:"small",class:"input-lg",placeholder:"Secret",onChange:a[45]||(a[45]=n=>f("wecom","secret",{extra:{...d("wecom").extra,secret:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0)]),_:2},1032,["name","icon","exclusive","config","credentials"])),64))])}}})})),Le=q((()=>{})),_e,$e=q((()=>{te(),te(),Le(),Q(),_e=F(fe,[["__scopeId","data-v-cd3880f4"]])})),ne,ie,oe,re,ce,se=q((()=>{V(),$(),W(),de(),$e(),ne={class:"channels-view"},ie={class:"page-header"},oe={class:"header-title"},re={class:"channels-content"},ce=P({__name:"ChannelsView",setup(S){const s=ue(),{t:k}=D();return Ce(()=>{s.fetchSettings()}),(l,C)=>(_(),v("div",ne,[w("header",ie,[w("h2",oe,H(e(k)("sidebar.channels")),1)]),w("div",re,[t(e(ye),{show:e(s).loading||e(s).saving,size:"large",description:e(k)("common.loading")},{default:o(()=>[e(s).loading?h("",!0):(_(),L(_e,{key:0}))]),_:1},8,["show","description"])])]))}})})),We=q((()=>{})),De,Qe=q((()=>{se(),se(),We(),Q(),De=F(ce,[["__scopeId","data-v-e25dbf6c"]])}));Qe();export{De as default};
|
|
1
|
+
import{n as q}from"./rolldown-runtime-BKwlnUi0.js";import{B as he,F as be,Mt as ke,Nt as B,R as p,Rt as e,U as V,Vt as H,Z as x,_t as _,bt as xe,c as g,ct as P,et as we,gt as qe,ht as Ce,it as v,l as ye,nt as L,ot as I,rt as h,st as t,t as $,tt as w,wt as o,xt as ze,y as He,yt as Se,z as Me,zt as j}from"./ui-vendor-CsTMg6zH.js";import{n as W,r as D}from"./vue-vendor-D8zSB7VM.js";import{n as Q,t as F}from"./_plugin-vue_export-helper-CrLlP_D3.js";import{c as Te,d as Ae,f as Ue,l as Be,o as de,s as ue,u as Re}from"./index-Bzb-xLYu.js";import{n as Ie,t as r}from"./SettingRow-Cj9O4m9X.js";var K,Z,J,O,pe,X=q((()=>{V(),$(),W(),K={class:"platform-info"},Z=["innerHTML"],J={class:"platform-name"},O={key:0,class:"platform-card-body"},pe=P({__name:"PlatformCard",props:{name:{},icon:{},config:{},credentials:{},exclusive:{type:Boolean}},setup(S){const s=S,k=B(!0),{t:l}=D(),C=we(()=>{const y=s.credentials;if(!y)return!1;const i=["token","api_key","app_id","client_id","secret","app_secret","client_secret","access_token","bot_id","account_id","enabled"];return[y,y.extra].filter(Boolean).some(M=>i.some(m=>{const f=M[m];return f!=null&&f!==""&&f!==!1}))});return(y,i)=>(_(),v("div",{class:j(["platform-card",{configured:C.value}])},[w("div",{class:"platform-card-header",onClick:i[0]||(i[0]=M=>k.value=!k.value)},[w("div",K,[w("span",{class:"platform-icon",innerHTML:S.icon},null,8,Z),w("span",J,H(S.name),1),t(e(he),{type:C.value?"success":"default",size:"small",round:""},{default:o(()=>[I(H(C.value?e(l)("common.configured"):e(l)("common.notConfigured")),1)]),_:1},8,["type"])]),w("span",{class:j(["expand-icon",{expanded:k.value}])},"▾",2)]),k.value?(_(),v("div",O,[S.exclusive?(_(),L(e(Me),{key:0,type:"warning","show-icon":!0,class:"exclusive-alert"},{default:o(()=>[I(H(e(l)("platform.exclusiveTokenWarning")),1)]),_:1})):h("",!0),xe(y.$slots,"default",{},void 0,!0)])):h("",!0)],2))}})})),Ve=q((()=>{})),me,Pe=q((()=>{X(),X(),Ve(),Q(),me=F(pe,[["__scopeId","data-v-e27ecbbe"]])})),Y,ee,le,ae,fe,te=q((()=>{V(),$(),W(),de(),Be(),Pe(),Ie(),Y={class:"settings-section"},ee={class:"weixin-qr-section"},le={key:1,class:"weixin-qr-loading"},ae={key:2,class:"weixin-qr-hint"},fe=P({__name:"PlatformSettings",setup(S){const s=ue(),k=He(),{t:l}=D(),C=ke({});function y(u,a){return`${u}.${a}`}function i(u,a){return!!C[y(u,a)]}async function M(u,a,z){const c=y(u,a);C[c]=!0;try{await z(),k.success(l("settings.saved"))}catch{k.error(l("settings.saveFailed"))}finally{C[c]=!1}}async function m(u,a,z){M(u,a,()=>s.saveSection(u,z))}async function f(u,a,z){M(u,a,async()=>{await Ae(u,z),await s.fetchSettings()})}function d(u){return s.platforms[u]||{}}function N(u){return u===!0||u==="true"}const E=B(""),T=B(""),b=B("idle");let A=null;async function ge(){b.value="loading",E.value="",T.value="",G();try{const u=await Te();T.value=u.qrcode,E.value=u.qrcode_url,window.open(u.qrcode_url,"_blank"),b.value="waiting",U()}catch(u){b.value="error",k.error(u.message||l("platform.qrFetching"))}}function U(){T.value&&(A=setTimeout(async()=>{try{const u=await Re(T.value);u.status==="wait"?U():u.status==="scaned"?(b.value="scaned",U()):u.status==="expired"?b.value="expired":u.status==="confirmed"&&(b.value="confirmed",await Ue({account_id:u.account_id,token:u.token,base_url:u.base_url}),await s.fetchSettings(),k.success(l("settings.saved")))}catch{U()}},3e3))}function G(){A&&(clearTimeout(A),A=null)}qe(()=>{G()});const ve=[{key:"telegram",name:"Telegram",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.479.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/></svg>'},{key:"discord",name:"Discord",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z"/></svg>'},{key:"slack",name:"Slack",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zm10.122 0a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V5.042zm-1.27 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.27a2.527 2.527 0 0 1 2.523-2.52h6.313A2.528 2.528 0 0 1 24 18.956a2.528 2.528 0 0 1-2.522 2.523h-6.313z"/></svg>'},{key:"whatsapp",name:"WhatsApp",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>'},{key:"matrix",name:"Matrix",icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M.632.55v22.9H2.28V24H0V0h2.28v.55zm7.043 7.26v1.157h.033c.309-.443.683-.784 1.117-1.024.433-.245.936-.365 1.5-.365.54 0 1.033.107 1.48.324.448.217.786.619 1.017 1.205.24-.376.558-.702.956-.98.398-.277.872-.414 1.424-.414.41 0 .784.065 1.122.194.34.13.629.325.87.588.241.263.428.59.56.984.132.393.198.85.198 1.368v5.89h-2.49v-4.893c0-.268-.016-.525-.048-.77a1.627 1.627 0 00-.2-.63 1.028 1.028 0 00-.392-.426 1.294 1.294 0 00-.616-.134c-.277 0-.508.05-.693.15a1.043 1.043 0 00-.43.41 1.768 1.768 0 00-.214.616 4.15 4.15 0 00-.06.74v4.937H9.29v-4.937c0-.25-.01-.498-.032-.742a1.84 1.84 0 00-.166-.638.998.998 0 00-.363-.448 1.206 1.206 0 00-.624-.154c-.26 0-.483.048-.67.144a1.055 1.055 0 00-.436.402 1.744 1.744 0 00-.227.616 4.108 4.108 0 00-.063.74v4.937H5.21V7.81zm15.693 15.64V.55H21.72V0H24v24h-2.28v-.55z"/></svg>'},{key:"feishu",name:"Feishu",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M6.59 3.41a2.25 2.25 0 0 1 3.182 0L13.5 7.14l-3.182 3.182L6.59 7.59a2.25 2.25 0 0 1 0-3.182zm5.303 5.303L15.075 5.53a2.25 2.25 0 0 1 3.182 3.182L15.075 11.894 11.893 8.713zM3.41 6.59a2.25 2.25 0 0 1 3.182 0l3.182 3.182-3.182 3.182a2.25 2.25 0 0 1-3.182-3.182L3.41 6.59zm5.303 5.303L11.894 15.075a2.25 2.25 0 0 1-3.182 3.182L5.53 15.075 8.713 11.893zm5.303-5.303L17.478 9.778a2.25 2.25 0 0 1-3.182 3.182L10.53 10.075l3.182-3.182 0 .023z"/></svg>'},{key:"dingtalk",name:"DingTalk",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M19.76 7.05c-.23-.52-.7-.9-1.26-1.02L5.35 3.2c-.77-.16-1.51.38-1.58 1.16-.22 2.55.17 5.4 1.13 7.66.97 2.29 2.52 4.11 4.45 4.82l-1.28 3.03c-.17.4.24.79.63.59l9.47-4.83c.34-.17.55-.52.55-.9v-3.12c.73-.4 1.22-1.17 1.22-2.06 0-.87-.08-1.73-.18-2.5zm-3.66 5.95-5.19 2.65.76-1.8c.12-.29-.03-.62-.33-.72-2.1-.73-3.56-3.54-3.95-6.73l9.27 2c.04.38.07.76.07 1.15 0 .45-.36.81-.81.81h-2.79c-.35 0-.63.28-.63.63s.28.63.63.63h2.97V13z"/></svg>'},{key:"qqbot",name:"QQBot",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C7.58 2 4 5.27 4 9.31c0 2.3 1.15 4.34 2.95 5.68-.13.58-.48 1.62-1.26 2.53-.24.28-.05.72.32.73 1.72.05 3.02-.68 3.69-1.15.72.16 1.49.25 2.3.25 4.42 0 8-3.27 8-7.31S16.42 2 12 2zm-3.2 7.63c-.63 0-1.14-.55-1.14-1.23s.51-1.23 1.14-1.23 1.14.55 1.14 1.23-.51 1.23-1.14 1.23zm6.4 0c-.63 0-1.14-.55-1.14-1.23s.51-1.23 1.14-1.23 1.14.55 1.14 1.23-.51 1.23-1.14 1.23zM5.5 20.5a.5.5 0 0 1 .5-.5h12a.5.5 0 0 1 0 1H6a.5.5 0 0 1-.5-.5z"/></svg>'},{key:"weixin",name:"Weixin",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>'},{key:"wecom",name:"WeCom",icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>'}];return(u,a)=>{const z=ze("NSpin");return _(),v("section",Y,[(_(),v(x,null,Se(ve,c=>t(me,{key:c.key,name:c.name,icon:c.icon,exclusive:c.exclusive,config:e(s)[c.key],credentials:d(c.key)},{default:o(()=>[c.key==="telegram"?(_(),v(x,{key:0},[t(r,{label:e(l)("platform.botToken"),hint:e(l)("platform.botTokenHint")},{default:o(()=>[t(e(p),{"default-value":d("telegram").token||"",loading:i("telegram","token"),clearable:"",size:"small",class:"input-lg",placeholder:"123456:ABC-DEF...",onChange:a[0]||(a[0]=n=>f("telegram","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionGroup")},{default:o(()=>[t(e(g),{value:e(s).telegram.require_mention,loading:i("telegram","require_mention"),"onUpdate:value":a[1]||(a[1]=n=>m("telegram","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.reactions"),hint:e(l)("platform.reactionsHint")},{default:o(()=>[t(e(g),{value:e(s).telegram.reactions,loading:i("telegram","reactions"),"onUpdate:value":a[2]||(a[2]=n=>m("telegram","reactions",{reactions:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.freeResponseChats"),hint:e(l)("platform.freeResponseChatsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).telegram.free_response_chats||"",loading:i("telegram","free_response_chats"),size:"small",placeholder:"chat_id1,chat_id2",onChange:a[3]||(a[3]=n=>m("telegram","free_response_chats",{free_response_chats:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.mentionPatterns"),hint:e(l)("platform.mentionPatternsHint")},{default:o(()=>[t(e(p),{"default-value":(e(s).telegram.mention_patterns||[]).join(", "),loading:i("telegram","mention_patterns"),size:"small",placeholder:"pattern1, pattern2",onChange:a[4]||(a[4]=n=>m("telegram","mention_patterns",{mention_patterns:n?n.split(",").map(R=>R.trim()):[]}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0),c.key==="discord"?(_(),v(x,{key:1},[t(r,{label:e(l)("platform.botToken"),hint:e(l)("platform.botTokenHint")},{default:o(()=>[t(e(p),{"default-value":d("discord").token||"",loading:i("discord","token"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot token...",onChange:a[5]||(a[5]=n=>f("discord","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionChannel")},{default:o(()=>[t(e(g),{value:e(s).discord.require_mention,loading:i("discord","require_mention"),"onUpdate:value":a[6]||(a[6]=n=>m("discord","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.autoThread"),hint:e(l)("platform.autoThreadHint")},{default:o(()=>[t(e(g),{value:e(s).discord.auto_thread,loading:i("discord","auto_thread"),"onUpdate:value":a[7]||(a[7]=n=>m("discord","auto_thread",{auto_thread:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.reactions"),hint:e(l)("platform.reactionsHint")},{default:o(()=>[t(e(g),{value:e(s).discord.reactions,loading:i("discord","reactions"),"onUpdate:value":a[8]||(a[8]=n=>m("discord","reactions",{reactions:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.freeResponseChannels"),hint:e(l)("platform.freeResponseChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).discord.free_response_channels||"",loading:i("discord","free_response_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:a[9]||(a[9]=n=>m("discord","free_response_channels",{free_response_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.allowedChannels"),hint:e(l)("platform.allowedChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).discord.allowed_channels||"",loading:i("discord","allowed_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:a[10]||(a[10]=n=>m("discord","allowed_channels",{allowed_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.ignoredChannels"),hint:e(l)("platform.ignoredChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).discord.ignored_channels||"",loading:i("discord","ignored_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:a[11]||(a[11]=n=>m("discord","ignored_channels",{ignored_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.noThreadChannels"),hint:e(l)("platform.noThreadChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).discord.no_thread_channels||"",loading:i("discord","no_thread_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:a[12]||(a[12]=n=>m("discord","no_thread_channels",{no_thread_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0),c.key==="slack"?(_(),v(x,{key:2},[t(r,{label:e(l)("platform.botToken"),hint:e(l)("platform.botTokenHint")},{default:o(()=>[t(e(p),{"default-value":d("slack").token||"",loading:i("slack","token"),clearable:"",size:"small",class:"input-lg",placeholder:"xoxb-...",onChange:a[13]||(a[13]=n=>f("slack","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionChannel")},{default:o(()=>[t(e(g),{value:e(s).slack.require_mention,loading:i("slack","require_mention"),"onUpdate:value":a[14]||(a[14]=n=>m("slack","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.allowBots"),hint:e(l)("platform.allowBotsHint")},{default:o(()=>[t(e(g),{value:e(s).slack.allow_bots,loading:i("slack","allow_bots"),"onUpdate:value":a[15]||(a[15]=n=>m("slack","allow_bots",{allow_bots:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.freeResponseChannels"),hint:e(l)("platform.freeResponseChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).slack.free_response_channels||"",loading:i("slack","free_response_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:a[16]||(a[16]=n=>m("slack","free_response_channels",{free_response_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0),c.key==="whatsapp"?(_(),v(x,{key:3},[t(r,{label:e(l)("platform.waEnabled"),hint:e(l)("platform.waEnabledHint")},{default:o(()=>[t(e(g),{value:d("whatsapp").enabled,loading:i("whatsapp","enabled"),"onUpdate:value":a[17]||(a[17]=n=>f("whatsapp","enabled",{enabled:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionGroup")},{default:o(()=>[t(e(g),{value:e(s).whatsapp.require_mention,loading:i("whatsapp","require_mention"),"onUpdate:value":a[18]||(a[18]=n=>m("whatsapp","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.freeResponseChats"),hint:e(l)("platform.freeResponseChatsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).whatsapp.free_response_chats||"",loading:i("whatsapp","free_response_chats"),size:"small",placeholder:"chat_id1,chat_id2",onChange:a[19]||(a[19]=n=>m("whatsapp","free_response_chats",{free_response_chats:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.mentionPatterns"),hint:e(l)("platform.mentionPatternsHint")},{default:o(()=>[t(e(p),{"default-value":(e(s).whatsapp.mention_patterns||[]).join(", "),loading:i("whatsapp","mention_patterns"),size:"small",placeholder:"pattern1, pattern2",onChange:a[20]||(a[20]=n=>m("whatsapp","mention_patterns",{mention_patterns:n?n.split(",").map(R=>R.trim()):[]}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0),c.key==="matrix"?(_(),v(x,{key:4},[t(r,{label:e(l)("platform.accessToken"),hint:e(l)("platform.accessTokenHint")},{default:o(()=>[t(e(p),{"default-value":d("matrix").token||"",loading:i("matrix","token"),clearable:"",size:"small",class:"input-lg",placeholder:"syt_...",onChange:a[21]||(a[21]=n=>f("matrix","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.homeserver"),hint:e(l)("platform.homeserverHint")},{default:o(()=>[t(e(p),{"default-value":d("matrix").extra?.homeserver||"",loading:i("matrix","homeserver"),clearable:"",size:"small",class:"input-lg",placeholder:"https://matrix.org",onChange:a[22]||(a[22]=n=>f("matrix","homeserver",{extra:{...d("matrix").extra,homeserver:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionRoom")},{default:o(()=>[t(e(g),{value:e(s).matrix.require_mention,loading:i("matrix","require_mention"),"onUpdate:value":a[23]||(a[23]=n=>m("matrix","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.autoThread"),hint:e(l)("platform.autoThreadHintRoom")},{default:o(()=>[t(e(g),{value:e(s).matrix.auto_thread,loading:i("matrix","auto_thread"),"onUpdate:value":a[24]||(a[24]=n=>m("matrix","auto_thread",{auto_thread:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.dmMentionThreads"),hint:e(l)("platform.dmMentionThreadsHint")},{default:o(()=>[t(e(g),{value:e(s).matrix.dm_mention_threads,loading:i("matrix","dm_mention_threads"),"onUpdate:value":a[25]||(a[25]=n=>m("matrix","dm_mention_threads",{dm_mention_threads:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.freeResponseRooms"),hint:e(l)("platform.freeResponseRoomsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).matrix.free_response_rooms||"",loading:i("matrix","free_response_rooms"),size:"small",placeholder:"room_id1,room_id2",onChange:a[26]||(a[26]=n=>m("matrix","free_response_rooms",{free_response_rooms:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0),c.key==="feishu"?(_(),v(x,{key:5},[t(r,{label:e(l)("platform.appId"),hint:e(l)("platform.appIdHint")},{default:o(()=>[t(e(p),{"default-value":d("feishu").extra?.app_id||"",loading:i("feishu","app_id"),clearable:"",size:"small",class:"input-lg",placeholder:"cli_...",onChange:a[27]||(a[27]=n=>f("feishu","app_id",{extra:{...d("feishu").extra,app_id:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.appSecret"),hint:e(l)("platform.appSecretHint")},{default:o(()=>[t(e(p),{"default-value":d("feishu").extra?.app_secret||"",loading:i("feishu","app_secret"),clearable:"",size:"small",class:"input-lg",placeholder:"App Secret",onChange:a[28]||(a[28]=n=>f("feishu","app_secret",{extra:{...d("feishu").extra,app_secret:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionGroup")},{default:o(()=>[t(e(g),{value:e(s).feishu.require_mention,loading:i("feishu","require_mention"),"onUpdate:value":a[29]||(a[29]=n=>m("feishu","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.freeResponseChats"),hint:e(l)("platform.freeResponseChatsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).feishu.free_response_chats||"",loading:i("feishu","free_response_chats"),size:"small",placeholder:"chat_id1,chat_id2",onChange:a[30]||(a[30]=n=>m("feishu","free_response_chats",{free_response_chats:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0),c.key==="dingtalk"?(_(),v(x,{key:6},[t(r,{label:e(l)("platform.clientId"),hint:e(l)("platform.clientIdHint")},{default:o(()=>[t(e(p),{"default-value":d("dingtalk").extra?.client_id||"",loading:i("dingtalk","client_id"),clearable:"",size:"small",class:"input-lg",placeholder:"Client ID",onChange:a[31]||(a[31]=n=>f("dingtalk","client_id",{extra:{...d("dingtalk").extra,client_id:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.clientSecret"),hint:e(l)("platform.clientSecretHint")},{default:o(()=>[t(e(p),{"default-value":d("dingtalk").extra?.client_secret||"",loading:i("dingtalk","client_secret"),clearable:"",size:"small",class:"input-lg",placeholder:"Client Secret",onChange:a[32]||(a[32]=n=>f("dingtalk","client_secret",{extra:{...d("dingtalk").extra,client_secret:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.allowAllUsers"),hint:e(l)("platform.allowAllUsersHint")},{default:o(()=>[t(e(g),{value:N(d("dingtalk").allow_all_users),loading:i("dingtalk","allow_all_users"),"onUpdate:value":a[33]||(a[33]=n=>f("dingtalk","allow_all_users",{allow_all_users:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.allowedUsers"),hint:e(l)("platform.allowedUsersHint")},{default:o(()=>[t(e(p),{"default-value":d("dingtalk").allowed_users||"",loading:i("dingtalk","allowed_users"),clearable:"",size:"small",class:"input-lg",placeholder:"user_id1,user_id2",onChange:a[34]||(a[34]=n=>f("dingtalk","allowed_users",{allowed_users:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionGroup")},{default:o(()=>[t(e(g),{value:e(s).dingtalk.require_mention,loading:i("dingtalk","require_mention"),"onUpdate:value":a[35]||(a[35]=n=>m("dingtalk","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.freeResponseChats"),hint:e(l)("platform.freeResponseChatsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).dingtalk.free_response_chats||"",loading:i("dingtalk","free_response_chats"),size:"small",placeholder:"chat_id1,chat_id2",onChange:a[36]||(a[36]=n=>m("dingtalk","free_response_chats",{free_response_chats:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0),c.key==="qqbot"?(_(),v(x,{key:7},[t(r,{label:e(l)("platform.qqAppId"),hint:e(l)("platform.qqAppIdHint")},{default:o(()=>[t(e(p),{"default-value":d("qqbot").extra?.app_id||"",loading:i("qqbot","app_id"),clearable:"",size:"small",class:"input-lg",placeholder:"App ID",onChange:a[37]||(a[37]=n=>f("qqbot","app_id",{extra:{...d("qqbot").extra,app_id:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.qqAppSecret"),hint:e(l)("platform.qqAppSecretHint")},{default:o(()=>[t(e(p),{"default-value":d("qqbot").extra?.client_secret||"",loading:i("qqbot","client_secret"),clearable:"",size:"small",class:"input-lg",placeholder:"App Secret",onChange:a[38]||(a[38]=n=>f("qqbot","client_secret",{extra:{...d("qqbot").extra,client_secret:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.allowedUsers"),hint:e(l)("platform.allowedUsersHint")},{default:o(()=>[t(e(p),{"default-value":d("qqbot").allowed_users||"",loading:i("qqbot","allowed_users"),clearable:"",size:"small",class:"input-lg",placeholder:"openid1,openid2",onChange:a[39]||(a[39]=n=>f("qqbot","allowed_users",{allowed_users:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.allowAllUsers"),hint:e(l)("platform.allowAllUsersHint")},{default:o(()=>[t(e(g),{value:N(d("qqbot").allow_all_users),loading:i("qqbot","allow_all_users"),"onUpdate:value":a[40]||(a[40]=n=>f("qqbot","allow_all_users",{allow_all_users:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.qqMarkdown"),hint:e(l)("platform.qqMarkdownHint")},{default:o(()=>[t(e(g),{value:e(s).qqbot.extra?.markdown_support??!0,loading:i("qqbot","markdown_support"),"onUpdate:value":a[41]||(a[41]=n=>m("qqbot","markdown_support",{extra:{...e(s).qqbot.extra,markdown_support:n}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0),c.key==="weixin"?(_(),v(x,{key:8},[w("div",ee,[b.value==="idle"||b.value==="error"||b.value==="expired"||b.value==="confirmed"?(_(),L(e(be),{key:0,type:"primary",size:"small",onClick:ge},{default:o(()=>[I(H(b.value==="confirmed"?e(l)("platform.qrRelogin"):e(l)("platform.qrLogin")),1)]),_:1})):h("",!0),b.value==="loading"?(_(),v("div",le,[t(z,{size:"small"}),w("span",null,H(e(l)("platform.qrFetching")),1)])):h("",!0),b.value==="waiting"||b.value==="scaned"?(_(),v("div",ae,H(b.value==="scaned"?e(l)("platform.qrScanedHint"):e(l)("platform.qrScanHint")),1)):h("",!0)]),t(r,{label:e(l)("platform.weixinToken"),hint:e(l)("platform.weixinTokenHint")},{default:o(()=>[t(e(p),{"default-value":d("weixin").token||"",loading:i("weixin","token"),clearable:"",size:"small",class:"input-lg",placeholder:"Token",onChange:a[42]||(a[42]=n=>f("weixin","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.accountId"),hint:e(l)("platform.accountIdHint")},{default:o(()=>[t(e(p),{"default-value":d("weixin").extra?.account_id||"",loading:i("weixin","account_id"),clearable:"",size:"small",class:"input-lg",placeholder:"Account ID",onChange:a[43]||(a[43]=n=>f("weixin","account_id",{extra:{...d("weixin").extra,account_id:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0),c.key==="wecom"?(_(),v(x,{key:9},[t(r,{label:e(l)("platform.botId"),hint:e(l)("platform.botIdHint")},{default:o(()=>[t(e(p),{"default-value":d("wecom").extra?.bot_id||"",loading:i("wecom","bot_id"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot ID",onChange:a[44]||(a[44]=n=>f("wecom","bot_id",{extra:{...d("wecom").extra,bot_id:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(l)("platform.appSecret"),hint:e(l)("platform.wecomSecretHint")},{default:o(()=>[t(e(p),{"default-value":d("wecom").extra?.secret||"",loading:i("wecom","secret"),clearable:"",size:"small",class:"input-lg",placeholder:"Secret",onChange:a[45]||(a[45]=n=>f("wecom","secret",{extra:{...d("wecom").extra,secret:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):h("",!0)]),_:2},1032,["name","icon","exclusive","config","credentials"])),64))])}}})})),Le=q((()=>{})),_e,$e=q((()=>{te(),te(),Le(),Q(),_e=F(fe,[["__scopeId","data-v-cd3880f4"]])})),ne,ie,oe,re,ce,se=q((()=>{V(),$(),W(),de(),$e(),ne={class:"channels-view"},ie={class:"page-header"},oe={class:"header-title"},re={class:"channels-content"},ce=P({__name:"ChannelsView",setup(S){const s=ue(),{t:k}=D();return Ce(()=>{s.fetchSettings()}),(l,C)=>(_(),v("div",ne,[w("header",ie,[w("h2",oe,H(e(k)("sidebar.channels")),1)]),w("div",re,[t(e(ye),{show:e(s).loading||e(s).saving,size:"large",description:e(k)("common.loading")},{default:o(()=>[e(s).loading?h("",!0):(_(),L(_e,{key:0}))]),_:1},8,["show","description"])])]))}})})),We=q((()=>{})),De,Qe=q((()=>{se(),se(),We(),Q(),De=F(ce,[["__scopeId","data-v-e25dbf6c"]])}));Qe();export{De as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as V}from"./rolldown-runtime-BKwlnUi0.js";import{Bt as Re,E as Be,F as G,G as dt,J as ct,Nt as p,Q as oo,R as at,Rt as t,S as Ye,St as ee,Tt as Ke,U as ve,Vt as r,X as pt,Y as wt,Z as W,_t as n,c as ao,ct as he,d as $n,et as O,f as io,gt as Je,ht as ye,it as i,k as Mn,l as ro,nt as J,ot as q,pt as xe,q as uo,rt as g,st as x,t as Ne,tt as e,w as it,wt as w,xt as co,y as ft,yt as te,zt as Y}from"./ui-vendor-CsTMg6zH.js";import{n as Se,r as Ce}from"./vue-vendor-D8zSB7VM.js";import{a as vo,c as Xe,d as Tn,l as Qe,n as pe,o as ho,p as vt,t as fe}from"./_plugin-vue_export-helper-
|
|
1
|
+
import{n as V}from"./rolldown-runtime-BKwlnUi0.js";import{Bt as Re,E as Be,F as G,G as dt,J as ct,Nt as p,Q as oo,R as at,Rt as t,S as Ye,St as ee,Tt as Ke,U as ve,Vt as r,X as pt,Y as wt,Z as W,_t as n,c as ao,ct as he,d as $n,et as O,f as io,gt as Je,ht as ye,it as i,k as Mn,l as ro,nt as J,ot as q,pt as xe,q as uo,rt as g,st as x,t as Ne,tt as e,w as it,wt as w,xt as co,y as ft,yt as te,zt as Y}from"./ui-vendor-CsTMg6zH.js";import{n as Se,r as Ce}from"./vue-vendor-D8zSB7VM.js";import{a as vo,c as Xe,d as Tn,l as Qe,n as pe,o as ho,p as vt,t as fe}from"./_plugin-vue_export-helper-CrLlP_D3.js";import{n as ze,t as Ze}from"./app-CYaCGxZ_.js";import{C as po,S as fo,b as mo,h as _o,m as go,n as et,o as yo,p as wo,s as ko,t as tt,w as bo,x as xo,y as Pn}from"./index-Bzb-xLYu.js";import{n as So,t as Co}from"./session-browser-prefs-HIgWQY8T.js";import{a as In,i as ht,n as $o,r as kt,t as bt}from"./SessionListItem-BKe7QBCc.js";import{n as Mo,t as To}from"./clipboard-BqPv71We.js";import{i as Bn,n as Po,r as Ln,t as Io}from"./MessageItem-BhSU5oee.js";import{a as Bo,i as Lo,n as Fo,o as Do,r as Ao,s as Eo,t as Ro}from"./xterm-CN_HBdCu.js";import{_ as zo,a as No,b as Oo,c as Uo,d as Vo,f as qo,g as Ho,h as Wo,i as jo,l as Go,m as Yo,n as Ko,o as Jo,p as Xo,r as Qo,s as Zo,t as ea,u as ta,v as sa,y as la}from"./FileRenameModal-DS3tMLmA.js";var xt,St,Ct,$t,Mt,Tt,Pt,It,Bt,Lt,Fn,Ft=V((()=>{ve(),Ne(),Xe(),xt={class:"folder-picker"},St={key:0,class:"folder-picker-loading"},Ct={key:1,class:"folder-tree"},$t={class:"folder-name"},Mt=["onClick"],Tt=["onClick"],Pt=["onClick"],It={key:0,class:"folder-empty"},Bt={key:2,class:"folder-selected"},Lt={class:"folder-selected-path"},Fn=he({__name:"FolderPicker",props:{modelValue:{}},emits:["update:modelValue"],setup(H,{emit:s}){const v=H,U=s,C=p(!1),a=p(""),b=p([]),M=p(new Set),T=p(new Map),I=p(new Set),S=p(v.modelValue||"");ee(()=>v.modelValue,B=>{S.value=B||""});async function D(B=""){try{return await Qe(`/api/hermes/workspace/folders${B?`?path=${encodeURIComponent(B)}`:""}`)}catch{return null}}ye(async()=>{C.value=!0;const B=await D();B&&(a.value=B.base,b.value=B.folders),C.value=!1});async function F(B){if(M.value.has(B.path)){M.value.delete(B.path),M.value=new Set(M.value);return}if(M.value.add(B.path),M.value=new Set(M.value),!T.value.has(B.path)){I.value.add(B.path),I.value=new Set(I.value);const c=await D(B.path);T.value.set(B.path,c?.folders||[]),T.value=new Map(T.value),I.value.delete(B.path),I.value=new Set(I.value)}}function A(B){const c=`${a.value}/${B.path}`;S.value=c,U("update:modelValue",c)}function E(){S.value=a.value,U("update:modelValue",a.value)}const R=O(()=>{const B=[];function c(d,k){for(const $ of d){const j=M.value.has($.path),P=I.value.has($.path),K=T.value.get($.path);B.push({folder:$,depth:k,isExpanded:j,isLoading:P,hasChildren:K?K.length>0:null}),j&&K&&K.length>0&&c(K,k+1)}}return c(b.value,0),B});return(B,c)=>(n(),i("div",xt,[C.value?(n(),i("div",St,[x(t(ro),{size:"small"})])):(n(),i("div",Ct,[e("div",{class:Y(["folder-item root",{selected:S.value===a.value}]),onClick:E},[c[0]||(c[0]=e("span",{class:"folder-icon"},"📂",-1)),e("span",$t,r(a.value||"/"),1)],2),(n(!0),i(W,null,te(R.value,d=>(n(),i("div",{key:d.folder.path,class:Y(["folder-item",{selected:S.value===`${a.value}/${d.folder.path}`}]),style:Re({paddingLeft:`${12+d.depth*16}px`})},[e("span",{class:"folder-expand",onClick:pt(k=>F(d.folder),["stop"])},[d.isLoading?(n(),i(W,{key:0},[q("⏳")],64)):(n(),i(W,{key:1},[q(r(d.isExpanded?"▼":"▶"),1)],64))],8,Mt),e("span",{class:"folder-icon",onClick:k=>A(d.folder)},"📁",8,Tt),e("span",{class:"folder-name",onClick:k=>A(d.folder)},r(d.folder.name),9,Pt)],6))),128)),(n(!0),i(W,null,te(R.value,d=>(n(),i(W,{key:"empty-"+d.folder.path},[d.isExpanded&&!d.isLoading&&d.hasChildren===!1?(n(),i("div",{key:0,class:"folder-item empty",style:Re({paddingLeft:`${28+d.depth*16}px`})},[...c[1]||(c[1]=[e("span",{class:"folder-empty-text"},"(空)",-1)])],4)):g("",!0)],64))),128)),b.value.length===0&&!C.value?(n(),i("div",It," 暂无工作区文件夹 ")):g("",!0)])),S.value?(n(),i("div",Bt,[c[2]||(c[2]=e("span",{class:"folder-selected-label"},"已选择:",-1)),e("span",Lt,r(S.value),1)])):g("",!0)]))}})})),na=V((()=>{})),Dn,oa=V((()=>{Ft(),Ft(),na(),pe(),Dn=fe(Fn,[["__scopeId","data-v-4399bad5"]])}));async function aa(H,s,v){return(await Qe(`/api/hermes/model-context/${encodeURIComponent(H)}/${encodeURIComponent(s)}`,{method:"PUT",body:JSON.stringify({provider:H,model:s,context_limit:v})})).data}var ia=V((()=>{Xe()})),Dt,At,Et,Rt,zt,Nt,Ot,Ut,Vt,qt,Ht,Wt,jt,Gt,Yt,Kt,Jt,Xt,Qt,Zt,es,An,ts=V((()=>{ve(),tt(),Ze(),Tn(),Pn(),ia(),Ne(),Se(),Ln(),Dt={class:"chat-input-area"},At={class:"input-top-bar"},Et={class:"auto-play-speech-switch"},Rt={key:1,class:"context-bar"},zt={key:0,class:"attachment-previews"},Nt=["src","alt"],Ot={key:1,class:"attachment-file"},Ut={class:"file-name"},Vt={class:"file-size"},qt=["onClick"],Ht=["placeholder"],Wt=["onMousedown","onMouseenter"],jt={class:"slash-command-name"},Gt={key:0,class:"slash-command-args"},Yt={class:"slash-command-desc"},Kt={class:"input-actions"},Jt={class:"context-edit-content"},Xt={style:{"margin-bottom":"16px",color:"#666"}},Qt={style:{"margin-top":"12px","font-size":"12px",color:"#999"}},Zt={style:{display:"flex","justify-content":"flex-end",gap:"8px"}},es=2e5,An=he({__name:"ChatInput",setup(H){const s=et(),{t:v}=Ce(),U=ft(),{toolTraceVisible:C,toggleToolTraceVisible:a}=Bn(),b=p(""),M=p(),T=p(),I=p(),S=p([]),D=p(!1),F=p(0),A=p(!1),E=O(()=>[{name:"usage",args:"",description:v("chat.slashCommands.usage")},{name:"status",args:"",description:v("chat.slashCommands.status")},{name:"abort",args:"",description:v("chat.slashCommands.abort")},{name:"queue",args:v("chat.slashCommandArgs.message"),description:v("chat.slashCommands.queue")},{name:"clear",args:"",description:v("chat.slashCommands.clear")},{name:"clear",args:"--history",insertText:"clear --history",description:v("chat.slashCommands.clearHistory")},{name:"title",args:v("chat.slashCommandArgs.title"),description:v("chat.slashCommands.title")},{name:"compress",args:"",description:v("chat.slashCommands.compress")},{name:"steer",args:v("chat.slashCommandArgs.text"),description:v("chat.slashCommands.steer")},{name:"destroy",args:"",description:v("chat.slashCommands.destroy")}]),R=p(!1),B=p(""),c=p(0),d=O(()=>s.activeSession?.source==="cli"),k=O(()=>{const u=B.value.toLowerCase();return E.value.filter(m=>m.name.includes(u)||m.insertText?.includes(u))}),$=p(null);function j(u){u.preventDefault();const m=M.value;if(!m)return;const y=m.clientHeight,Z=u.clientY;function ge(De){const be=y-(De.clientY-Z);$.value=Math.max(20,Math.min(400,Math.round(be)))}function ke(){document.removeEventListener("mousemove",ge),document.removeEventListener("mouseup",ke),document.body.style.cursor="",document.body.style.userSelect=""}document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",ge),document.addEventListener("mouseup",ke)}const P=p(!1);ye(()=>{const u=localStorage.getItem("autoPlaySpeech");u!==null&&(P.value=u==="true",s.setAutoPlaySpeech(P.value))}),ee(P,u=>{localStorage.setItem("autoPlaySpeech",String(u)),s.setAutoPlaySpeech(u)});const K=O(()=>b.value.trim()||S.value.length>0);function Q(){xe(()=>{T.value&&T.value.querySelector(".active")?.scrollIntoView({block:"nearest",behavior:"instant"})})}function ae(){if(!d.value){R.value=!1;return}const u=M.value;if(!u)return;const m=u.selectionStart,y=b.value.slice(0,m);if(!y.startsWith("/")||y.includes(" ")||y.includes(`
|
|
2
2
|
`)){R.value=!1;return}B.value=y.slice(1),c.value=0,R.value=k.value.length>0}function $e(u){b.value=`/${u.insertText||u.name} `,R.value=!1,xe(()=>{const m=M.value;if(!m)return;const y=b.value.length;m.setSelectionRange(y,y),m.focus()})}const le=p(2e5),re=p(!1),se=p(2e5),me=p(!1);async function oe(){se.value=le.value,re.value=!0}async function Me(){if(!se.value||se.value<=0){U.error(v("chat.contextEditInvalid"));return}me.value=!0;try{const u=ze(),m=u.selectedProvider||"",y=u.selectedModel||"";if(!m||!y){U.error(v("chat.contextEditFailed"));return}await aa(m,y,se.value),le.value=se.value,re.value=!1,U.success(v("chat.contextEditSuccess"))}catch(u){U.error(`${v("chat.contextEditFailed")}: ${u.message||""}`)}finally{me.value=!1}}async function ue(){try{le.value=await _o(vt().activeProfileName||void 0)}catch{le.value=es}}ye(ue),ee(()=>vt().activeProfileName,ue),ee(()=>ze().selectedModel,ue);const ie=O(()=>(s.activeSession?.inputTokens??0)+(s.activeSession?.outputTokens??0)),Te=O(()=>Math.max(0,le.value-ie.value)),ne=O(()=>Math.min(ie.value/le.value*100,100));function de(u){return u>=1e6?(u/1e6).toFixed(1)+"M":u>=1e3?(u/1e3).toFixed(1)+"k":String(u)}function _e(u){if(S.value.find(Z=>Z.name===u.name))return;const m=Date.now().toString(36)+Math.random().toString(36).slice(2,8),y=URL.createObjectURL(u);S.value.push({id:m,name:u.name,type:u.type,size:u.size,url:y,file:u})}function Pe(){I.value?.click()}function we(u){const m=u.target;if(m.files){for(const y of m.files)_e(y);m.value=""}}function h(u){const m=Array.from(u.clipboardData?.items||[]).filter(y=>y.type.startsWith("image/"));if(m.length){u.preventDefault();for(const y of m){const Z=y.getAsFile();if(!Z)continue;const ge=y.type.split("/")[1]||"png";_e(new File([Z],`pasted-${Date.now()}.${ge}`,{type:y.type}))}}}function _(u){u.preventDefault()}function L(u){u.preventDefault(),u.dataTransfer?.types.includes("Files")&&(F.value++,D.value=!0)}function ce(){F.value--,F.value<=0&&(F.value=0,D.value=!1)}function Le(u){u.preventDefault(),F.value=0,D.value=!1;const m=Array.from(u.dataTransfer?.files||[]);if(m.length){for(const y of m)_e(y);M.value?.focus()}}function X(){const u=b.value.trim();!u&&S.value.length===0||(s.sendMessage(u,S.value.length>0?S.value:void 0),b.value="",S.value=[],R.value=!1,M.value&&(M.value.style.height="auto"))}function st(){A.value=!0}function lt(){requestAnimationFrame(()=>{A.value=!1,ae()})}function nt(u){return A.value||u.isComposing||u.keyCode===229}function Oe(u){if(R.value&&k.value.length>0){if(u.key==="ArrowDown"){u.preventDefault(),c.value=(c.value+1)%k.value.length,Q();return}if(u.key==="ArrowUp"){u.preventDefault(),c.value=(c.value-1+k.value.length)%k.value.length,Q();return}if(u.key==="Enter"||u.key==="Tab"){u.preventDefault(),$e(k.value[c.value]);return}if(u.key==="Escape"){u.preventDefault(),R.value=!1;return}}u.key!=="Enter"||u.shiftKey||nt(u)||(u.preventDefault(),X())}function Ie(u){const m=u.target;A.value||ae(),$.value===null&&(m.style.height="auto",m.style.height=Math.min(m.scrollHeight,100)+"px")}function Ue(u){c.value=u}function Fe(u){if(!R.value)return;const m=u.target;!m.closest(".slash-command-dropdown")&&!m.closest(".input-wrapper")&&(R.value=!1)}ye(()=>{document.addEventListener("mousedown",Fe)}),Je(()=>{document.removeEventListener("mousedown",Fe)});function Ve(u){const m=S.value.findIndex(y=>y.id===u);m!==-1&&(URL.revokeObjectURL(S.value[m].url),S.value.splice(m,1))}function ot(u){return u<1024?u+" B":u<1024*1024?(u/1024).toFixed(1)+" KB":(u/(1024*1024)).toFixed(1)+" MB"}function qe(u){return u.startsWith("image/")}return(u,m)=>(n(),i("div",Dt,[e("div",At,[x(t(Be),{trigger:"hover"},{trigger:w(()=>[x(t(G),{quaternary:"",size:"tiny",onClick:Pe,circle:""},{icon:w(()=>[...m[6]||(m[6]=[e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})],-1)])]),_:1})]),default:w(()=>[q(" "+r(t(v)("chat.attachFiles")),1)]),_:1}),e("div",Et,[x(t(Be),{trigger:"hover"},{trigger:w(()=>[...m[7]||(m[7]=[e("div",{class:"switch-label"},[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("polygon",{points:"5 3 19 12 5 21 5 3"})])],-1)])]),default:w(()=>[q(" "+r(t(v)("chat.autoPlaySpeech")),1)]),_:1}),x(t(ao),{size:"small",value:P.value,"onUpdate:value":m[0]||(m[0]=y=>P.value=y),round:!1},null,8,["value"])]),x(t(Be),{trigger:"hover"},{trigger:w(()=>[x(t(G),{quaternary:"",size:"tiny",class:Y(["tool-trace-toggle",{active:t(C)}]),"aria-label":t(C)?t(v)("chat.hideToolCalls"):t(v)("chat.showToolCalls"),onClick:t(a)},{default:w(()=>[...m[8]||(m[8]=[e("svg",{class:"tool-trace-icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"M14.7 6.3a4.5 4.5 0 0 0-5.8 5.8L3.5 17.5a2.1 2.1 0 0 0 3 3l5.4-5.4a4.5 4.5 0 0 0 5.8-5.8l-3 3-3-3 3-3z"})],-1)])]),_:1},8,["class","aria-label","onClick"])]),default:w(()=>[q(" "+r(t(C)?t(v)("chat.hideToolCalls"):t(v)("chat.showToolCalls")),1)]),_:1}),ie.value>0?(n(),i("span",{key:0,class:Y(["context-info",{"context-warning":ne.value>80}])},[q(r(de(ie.value))+" / ",1),x(t(Be),{trigger:"hover"},{trigger:w(()=>[e("span",{class:"context-limit-editable",onClick:oe},r(de(le.value)),1)]),default:w(()=>[e("span",null,r(t(v)("chat.contextClickToEdit")),1)]),_:1}),q(" · "+r(t(v)("chat.contextRemaining"))+" "+r(de(Te.value)),1)],2)):g("",!0),ie.value>0?(n(),i("div",Rt,[e("div",{class:Y(["context-bar-fill",{"context-bar-warn":ne.value>60&&ne.value<=80,"context-bar-danger":ne.value>80}]),style:Re({width:`${ne.value}%`})},null,6)])):g("",!0)]),S.value.length>0?(n(),i("div",zt,[(n(!0),i(W,null,te(S.value,y=>(n(),i("div",{key:y.id,class:Y(["attachment-preview",{image:qe(y.type)}])},[qe(y.type)?(n(),i("img",{key:0,src:y.url,alt:y.name,class:"attachment-thumb"},null,8,Nt)):(n(),i("div",Ot,[m[9]||(m[9]=e("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e("polyline",{points:"14 2 14 8 20 8"})],-1)),e("span",Ut,r(y.name),1),e("span",Vt,r(ot(y.size)),1)])),e("button",{class:"attachment-remove",onClick:Z=>Ve(y.id)},[...m[10]||(m[10]=[e("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,qt)],2))),128))])):g("",!0),e("div",{class:Y(["input-wrapper",{"drag-over":D.value}]),onDragover:_,onDragenter:L,onDragleave:ce,onDrop:Le},[e("input",{ref_key:"fileInputRef",ref:I,type:"file",multiple:"",class:"file-input-hidden",onChange:we},null,544),e("div",{class:"resize-handle",onMousedown:j},null,32),Ke(e("textarea",{ref_key:"textareaRef",ref:M,"onUpdate:modelValue":m[1]||(m[1]=y=>b.value=y),class:"input-textarea",style:Re($.value?{height:$.value+"px"}:{}),placeholder:t(v)("chat.inputPlaceholder"),rows:"1",onKeydown:Oe,onCompositionstart:st,onCompositionend:lt,onInput:Ie,onPaste:h},null,44,Ht),[[uo,b.value]]),x(dt,{name:"dropdown-fade"},{default:w(()=>[R.value&&k.value.length>0?(n(),i("div",{key:0,ref_key:"commandDropdownRef",ref:T,class:"slash-command-dropdown"},[(n(!0),i(W,null,te(k.value,(y,Z)=>(n(),i("div",{key:y.name,class:Y(["slash-command-item",{active:Z===c.value}]),onMousedown:pt(ge=>$e(y),["prevent"]),onMouseenter:ge=>Ue(Z)},[e("span",jt,"/"+r(y.name),1),y.args?(n(),i("span",Gt,r(y.args),1)):g("",!0),e("span",Yt,r(y.description),1)],42,Wt))),128))],512)):g("",!0)]),_:1}),e("div",Kt,[t(s).isStreaming?(n(),J(t(G),{key:0,size:"small",type:"error",disabled:t(s).isAborting,onClick:m[2]||(m[2]=y=>t(s).stopStreaming())},{default:w(()=>[q(r(t(v)("chat.stop")),1)]),_:1},8,["disabled"])):g("",!0),x(t(G),{size:"small",type:"primary",disabled:!K.value,onClick:X},{icon:w(()=>[...m[11]||(m[11]=[e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),e("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})],-1)])]),default:w(()=>[q(" "+r(t(v)("chat.send")),1)]),_:1},8,["disabled"])])],34),x(t(Ye),{show:re.value,"onUpdate:show":m[5]||(m[5]=y=>re.value=y),title:t(v)("chat.contextEditTitle"),"mask-closable":!0,preset:"card",style:{width:"400px"}},{footer:w(()=>[e("div",Zt,[x(t(G),{onClick:m[4]||(m[4]=y=>re.value=!1),disabled:me.value},{default:w(()=>[q(r(t(v)("chat.contextEditCancel")),1)]),_:1},8,["disabled"]),x(t(G),{type:"primary",onClick:Me,loading:me.value},{default:w(()=>[q(r(t(v)("chat.contextEditSave")),1)]),_:1},8,["loading"])])]),default:w(()=>[e("div",Jt,[e("p",Xt,r(t(v)("chat.contextEditDesc")),1),x(t(io),{value:se.value,"onUpdate:value":m[3]||(m[3]=y=>se.value=y),min:1e3,max:1e7,step:1e3,"show-button":!1,placeholder:t(v)("chat.contextEditPlaceholder"),style:{width:"100%"}},{suffix:w(()=>[...m[12]||(m[12]=[e("span",{style:{color:"#999"}},"tokens",-1)])]),_:1},8,["value","placeholder"]),e("div",Qt,r(t(v)("chat.contextEditHint")),1)])]),_:1},8,["show","title"])]))}})})),ra=V((()=>{})),En,ua=V((()=>{ts(),ts(),ra(),pe(),En=fe(An,[["__scopeId","data-v-9e9fc5a6"]])}));async function da(H={}){const s=new URLSearchParams;return H.humanOnly===!1&&s.set("humanOnly","false"),H.source&&s.set("source",H.source),H.limit!=null&&s.set("limit",String(H.limit)),(await Qe(`/api/hermes/sessions/conversations${s.toString()?`?${s.toString()}`:""}`)).sessions}async function ca(H,s={}){const v=new URLSearchParams;s.humanOnly===!1&&v.set("humanOnly","false"),s.source&&v.set("source",s.source);const U=v.toString()?`?${v.toString()}`:"";return Qe(`/api/hermes/sessions/conversations/${encodeURIComponent(H)}/messages${U}`)}var va=V((()=>{Xe()})),ss,ls,ns,os,as,is,rs,us,ds,cs,vs,hs,ps,fs,ms,_s,gs,ys,ws,ks,bs,xs,Rn,Ss=V((()=>{ve(),va(),In(),Ze(),Se(),ss={class:"conversation-monitor"},ls={class:"conversation-monitor__sidebar"},ns={key:0,class:"conversation-monitor__empty"},os={key:1,class:"conversation-monitor__empty"},as=["aria-pressed","onClick"],is={class:"conversation-monitor__session-title-row"},rs={class:"conversation-monitor__session-title"},us={key:0,class:"conversation-monitor__session-live"},ds={class:"conversation-monitor__session-meta"},cs={key:0,class:"conversation-monitor__session-preview"},vs={class:"conversation-monitor__detail"},hs={key:0,class:"conversation-monitor__detail-header"},ps={class:"conversation-monitor__detail-title"},fs={class:"conversation-monitor__detail-meta"},ms=["title"],_s={key:1,class:"conversation-monitor__empty conversation-monitor__empty--error"},gs={key:2,class:"conversation-monitor__empty"},ys={key:3,class:"conversation-monitor__empty"},ws={key:4,class:"conversation-monitor__messages"},ks={class:"conversation-monitor__message-meta"},bs={class:"conversation-monitor__message-content"},xs=15e3,Rn=he({__name:"ConversationMonitorPane",props:{humanOnly:{type:Boolean}},setup(H){const s=H,{t:v}=Ce(),U=ze(),C=p([]),a=p(null),b=p(null),M=p(!1),T=p(!1),I=p("");let S=null,D=0,F=0;const A=O(()=>C.value.find($=>$.id===a.value)||null),E=O(()=>A.value?.model?U.displayModelName(A.value.model,A.value.provider):"");function R($){return v($==="user"?"chat.monitorRoleUser":"chat.monitorRoleAssistant")}function B($){return v("chat.linkedSessions",{count:$})}function c(){D+=1,F+=1}async function d($=!1){const j=++D;$||(M.value=!0,I.value="");try{const P=await da({humanOnly:s.humanOnly});if(j!==D)return;if(C.value=P,!P.length){a.value=null,b.value=null;return}(!a.value||!P.some(K=>K.id===a.value))&&(a.value=P[0].id)}catch(P){if(j!==D||$)return;I.value=P?.message||String(P),C.value=[],a.value=null,b.value=null}finally{!$&&j===D&&(M.value=!1)}}async function k($,j=!1){const P=++F;if(!$){b.value=null;return}const K=s.humanOnly;j||(T.value=!0,I.value="");try{const Q=await ca($,{humanOnly:K});if(P!==F||$!==a.value||K!==s.humanOnly)return;b.value=Q}catch(Q){if(P!==F||j)return;I.value=Q?.message||String(Q),b.value=null}finally{!j&&P===F&&(T.value=!1)}}return ee(a,async $=>{await k($,!1)}),ee(()=>s.humanOnly,async()=>{c(),a.value=null,b.value=null,await d(!1)}),ye(async()=>{await d(!1),S=setInterval(async()=>{await d(!0),a.value&&await k(a.value,!0)},xs)}),Je(()=>{c(),S&&clearInterval(S)}),($,j)=>(n(),i("div",ss,[e("aside",ls,[M.value&&C.value.length===0?(n(),i("div",ns,r(t(v)("common.loading")),1)):C.value.length===0?(n(),i("div",os,r(t(v)("chat.noSessions")),1)):g("",!0),(n(!0),i(W,null,te(C.value,P=>(n(),i("button",{key:P.id,class:Y(["conversation-monitor__session",{active:P.id===a.value}]),"aria-pressed":P.id===a.value,onClick:K=>a.value=P.id},[e("div",is,[e("span",rs,r(P.title||P.preview||P.id),1),P.is_active?(n(),i("span",us,r(t(v)("chat.recentBadge")),1)):g("",!0)]),e("div",ds,r(t(ht)(P.source))+" · "+r(t(kt)(P.last_active)),1),P.preview?(n(),i("div",cs,r(P.preview),1)):g("",!0)],10,as))),128))]),e("section",vs,[A.value?(n(),i("header",hs,[e("div",ps,r(A.value.title||A.value.preview||A.value.id),1),e("div",fs,[e("span",null,r(t(ht)(A.value.source)),1),j[0]||(j[0]=e("span",null,"·",-1)),e("span",{title:A.value.model},r(E.value),9,ms),j[1]||(j[1]=e("span",null,"·",-1)),e("span",null,r(B(A.value.thread_session_count)),1)])])):g("",!0),I.value?(n(),i("div",_s,r(I.value),1)):T.value&&!b.value?(n(),i("div",gs,r(t(v)("common.loading")),1)):!b.value||b.value.messages.length===0?(n(),i("div",ys,r(t(v)("chat.noVisibleMessages")),1)):(n(),i("div",ws,[(n(!0),i(W,null,te(b.value.messages,P=>(n(),i("article",{key:`${P.session_id}-${P.id}`,class:Y(["conversation-monitor__message",`role-${P.role}`])},[e("div",ks,r(R(P.role))+" · "+r(t(kt)(P.timestamp)),1),e("div",bs,r(P.content),1)],2))),128))]))])]))}})})),ha=V((()=>{})),zn,pa=V((()=>{Ss(),Ss(),ha(),pe(),zn=fe(Rn,[["__scopeId","data-v-71fcd8c4"]])})),Nn,fa=V((()=>{Nn="/assets/mp4/thinking-light-BjeGd2gJ.mp4"})),On,ma=V((()=>{On="/assets/mp4/thinking-dark-yYkYRZLs.mp4"})),Cs,$s,Ms,Ts,Ps,Is,Bs,Ls,Fs,Ds,As,Es,Rs,zs,Ns,Os,Us,Vs,qs,Hs,Ws,js,Gs,Ys,Ks,Js,Un,Xs=V((()=>{ve(),bo(),Se(),Po(),tt(),fa(),ma(),fo(),Ln(),Cs={key:0,class:"empty-state"},$s={key:0,class:"streaming-indicator"},Ms=["src"],Ts={key:0,class:"tool-calls-panel"},Ps={key:0,class:"tool-call-item compression-item"},Is={key:0,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},Bs={key:1,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},Ls={class:"tool-call-name"},Fs={key:2,class:"tool-call-spinner"},Ds={key:1,class:"tool-call-item compression-item"},As={key:0,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},Es={key:1,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},Rs={class:"tool-call-name"},zs={key:2,class:"tool-call-spinner"},Ns={class:"tool-call-name"},Os={key:0,class:"tool-call-preview"},Us=["title"],Vs={key:2,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"tool-call-success-icon"},qs={key:3,class:"tool-call-spinner"},Hs={key:4,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"tool-call-error-icon"},Ws={key:0,class:"queue-float-panel"},js={class:"queue-float-header"},Gs={class:"queue-float-list"},Ys={class:"queue-index"},Ks={class:"queue-text"},Js=["title","onClick"],Un=he({__name:"MessageList",setup(H){const s=et(),{t:v}=Ce(),{isDark:U}=po(),{toolTraceVisible:C}=Bn(),a=p();function b(c){return c>=1e6?(c/1e6).toFixed(1)+"M":c>=1e3?(c/1e3).toFixed(1)+"K":String(c)}function M(c){return c<1?`${Math.round(c*1e3)}ms`:c<60?`${Math.round(c*10)/10}s`:`${Math.floor(c/60)}m ${Math.round(c%60)}s`}const T=O(()=>{const c=s.messages;let d=-1;for(let k=c.length-1;k>=0;k--)if(c[k].role==="user"){d=k;break}return[...c.filter((k,$)=>k.role==="tool"&&$>d)].reverse()}),I=O(()=>C.value?T.value.filter(c=>!!c.toolName):[]),S=O(()=>{const c=new Set(T.value.map(d=>d.id));return s.messages.filter(d=>d.role==="tool"?C.value&&!!d.toolName&&!(s.isRunActive&&c.has(d.id)):!(d.role==="assistant"&&d.isStreaming&&!d.content?.trim()&&d.reasoning?.trim()&&T.value.length===0))}),D=O(()=>{const c=s.activeSessionId;return c?s.queuedUserMessages.get(c)||[]:[]});function F(c){const d=s.activeSessionId;d&&s.removeQueuedMessage(d,c)}function A(c){const d=c.replace(/\s+/g," ").trim();return d.length>48?`${d.slice(0,48)}...`:d}function E(c=200){const d=a.value;return d?d.scrollHeight-d.scrollTop-d.clientHeight<c:!0}function R(){xe(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})}function B(c){xe(()=>{const d=document.getElementById(`message-${c}`);d&&d.scrollIntoView({block:"center"})})}return ee(()=>s.activeSessionId,c=>{if(c){if(s.focusMessageId){xe(()=>B(s.focusMessageId));return}xe(()=>R())}},{immediate:!0}),ee(()=>s.focusMessageId,c=>{c&&B(c)}),ee(()=>s.isRunActive,c=>{c&&R()}),ee(()=>s.messages[s.messages.length-1]?.content,()=>{if(s.focusMessageId){B(s.focusMessageId);return}E()&&R()}),ee(T,()=>{if(s.focusMessageId){B(s.focusMessageId);return}E()&&R()}),(c,d)=>(n(),i("div",{ref_key:"listRef",ref:a,class:"message-list"},[t(s).messages.length===0?(n(),i("div",Cs,[d[0]||(d[0]=e("img",{src:"/logo.png",alt:"Hermes",class:"empty-logo"},null,-1)),e("p",null,r(t(v)("chat.emptyState")),1)])):g("",!0),(n(!0),i(W,null,te(S.value,k=>(n(),J(Io,{key:k.id,message:k,highlight:t(s).focusMessageId===k.id},null,8,["message","highlight"]))),128)),x(dt,{name:"fade"},{default:w(()=>[t(s).isRunActive||t(s).abortState?(n(),i("div",$s,[e("video",{src:t(U)?t(On):t(Nn),autoplay:"",loop:"",muted:"",playsinline:"",class:"thinking-video"},null,8,Ms),I.value.length>0||t(s).compressionState||t(s).abortState?(n(),i("div",Ts,[t(s).abortState?(n(),i("div",Ps,[t(s).abortState.aborting?(n(),i("svg",Is,[...d[1]||(d[1]=[e("path",{d:"M10 9v6m4-6v6M5 5h14v14H5z"},null,-1)])])):(n(),i("svg",Bs,[...d[2]||(d[2]=[e("path",{d:"M5 13l4 4L19 7"},null,-1)])])),e("span",Ls,r(t(s).abortState.aborting?"Pausing... waiting for the run to stop and sync":t(s).abortState.synced?"Paused and synced":"Paused"),1),t(s).abortState.aborting?(n(),i("span",Fs)):g("",!0)])):g("",!0),t(s).compressionState?(n(),i("div",Ds,[t(s).compressionState.compressing?(n(),i("svg",As,[...d[3]||(d[3]=[e("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])])):t(s).compressionState.compressed?(n(),i("svg",Es,[...d[4]||(d[4]=[e("path",{d:"M5 13l4 4L19 7"},null,-1)])])):g("",!0),e("span",Rs,r(t(s).compressionState.compressing?`Compressing... (${t(s).compressionState.messageCount} msgs, ~${b(t(s).compressionState.beforeTokens)} tokens)`:t(s).compressionState.compressed?`Compressed ${t(s).compressionState.messageCount} msgs: ~${b(t(s).compressionState.beforeTokens)} → ~${b(t(s).compressionState.afterTokens)} tokens`:"Compression skipped"),1),t(s).compressionState.compressing?(n(),i("span",zs)):g("",!0)])):g("",!0),(n(!0),i(W,null,te(I.value,k=>(n(),i("div",{key:k.id,class:"tool-call-item"},[d[7]||(d[7]=e("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},[e("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"})],-1)),e("span",Ns,r(k.toolName),1),k.toolPreview?(n(),i("span",Os,r(k.toolPreview),1)):g("",!0),k.toolDuration&&k.toolStatus!=="running"?(n(),i("span",{key:1,class:"tool-call-duration",title:c.$t("chat.executionDuration")},r(M(k.toolDuration)),9,Us)):g("",!0),k.toolStatus==="done"?(n(),i("svg",Vs,[...d[5]||(d[5]=[e("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor","fill-opacity":"0.15"},null,-1),e("path",{d:"M8 12L11 15L16 9",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1)])])):g("",!0),k.toolStatus==="running"?(n(),i("span",qs)):g("",!0),k.toolStatus==="error"?(n(),i("svg",Hs,[...d[6]||(d[6]=[e("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor","fill-opacity":"0.15"},null,-1),e("path",{d:"M15 9L9 15M9 9L15 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1)])])):g("",!0)]))),128))])):g("",!0)])):g("",!0)]),_:1}),x(dt,{name:"queue-float"},{default:w(()=>[D.value.length>0?(n(),i("div",Ws,[e("div",js,[d[8]||(d[8]=e("span",{class:"queue-orbit","aria-hidden":"true"},[e("span")],-1)),e("span",null,r(t(v)("chat.messageQueue")),1),e("strong",null,r(D.value.length),1)]),e("div",Gs,[(n(!0),i(W,null,te(D.value,(k,$)=>(n(),i("div",{key:k.id,class:"queue-float-item"},[e("span",Ys,r($+1),1),e("span",Ks,r(A(k.content)),1),e("button",{type:"button",class:"queue-remove",title:t(v)("chat.removeQueuedMessage"),onClick:j=>F(k.id)},[...d[9]||(d[9]=[e("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,Js)]))),128))])])):g("",!0)]),_:1})],512))}})})),_a=V((()=>{})),Vn,ga=V((()=>{Xs(),Xs(),_a(),pe(),Vn=fe(Un,[["__scopeId","data-v-07c2de55"]])})),Qs,Zs,el,tl,sl,ll,nl,ol,al,il,rl,ul,dl,cl,vl,hl,pl,fl,rt,ml,ut,qn,_l=V((()=>{ve(),Eo(),Lo(),Ao(),Ro(),Xe(),Ne(),Se(),Qs={class:"terminal-panel-drawer"},Zs={class:"sidebar-header"},el={class:"sidebar-title"},tl={class:"session-list"},sl={key:0,class:"session-error"},ll={key:1,class:"session-empty"},nl=["onClick"],ol={class:"session-item-content"},al={class:"session-item-title"},il={class:"session-item-meta"},rl={class:"session-item-shell"},ul={key:0,class:"session-item-status"},dl={key:1,class:"session-item-time"},cl={class:"terminal-main"},vl={class:"terminal-header"},hl={key:0,class:"header-session-title"},pl={class:"header-actions"},fl={class:"terminal-container"},rt="hermes_terminal_theme",ml=3,ut=18,qn=he({__name:"TerminalPanel",props:{visible:{type:Boolean}},setup(H){const{t:s}=Ce(),v=ft(),U=H,C={default:{label:"Default",theme:{background:"#1a1a2e",foreground:"#e0e0e0",cursor:"#4cc9f0",cursorAccent:"#1a1a2e",selectionBackground:"rgba(76, 201, 240, 0.3)",black:"#000000",red:"#e06c75",green:"#98c379",yellow:"#e5c07b",blue:"#61afef",magenta:"#c678dd",cyan:"#56b6c2",white:"#abb2bf",brightBlack:"#5c6370",brightRed:"#e06c75",brightGreen:"#98c379",brightYellow:"#e5c07b",brightBlue:"#61afef",brightMagenta:"#c678dd",brightCyan:"#56b6c2",brightWhite:"#ffffff"}},"solarized-dark":{label:"Solarized Dark",theme:{background:"#002b36",foreground:"#839496",cursor:"#93a1a1",cursorAccent:"#002b36",selectionBackground:"rgba(147, 161, 161, 0.3)",black:"#073642",red:"#dc322f",green:"#859900",yellow:"#b58900",blue:"#268bd2",magenta:"#d33682",cyan:"#2aa198",white:"#eee8d5",brightBlack:"#002b36",brightRed:"#cb4b16",brightGreen:"#586e75",brightYellow:"#657b83",brightBlue:"#839496",brightMagenta:"#6c71c4",brightCyan:"#93a1a1",brightWhite:"#fdf6e3"}},"tokyo-night":{label:"Tokyo Night",theme:{background:"#1a1b26",foreground:"#a9b1d6",cursor:"#c0caf5",cursorAccent:"#1a1b26",selectionBackground:"rgba(192, 202, 245, 0.2)",black:"#15161e",red:"#f7768e",green:"#9ece6a",yellow:"#e0af68",blue:"#7aa2f7",magenta:"#bb9af7",cyan:"#7dcfff",white:"#a9b1d6",brightBlack:"#414868",brightRed:"#f7768e",brightGreen:"#9ece6a",brightYellow:"#e0af68",brightBlue:"#7aa2f7",brightMagenta:"#bb9af7",brightCyan:"#7dcfff",brightWhite:"#c0caf5"}},"github-dark":{label:"GitHub Dark",theme:{background:"#0d1117",foreground:"#c9d1d9",cursor:"#58a6ff",cursorAccent:"#0d1117",selectionBackground:"rgba(88, 166, 255, 0.25)",black:"#484f58",red:"#ff7b72",green:"#7ee787",yellow:"#ffa657",blue:"#79c0ff",magenta:"#d2a8ff",cyan:"#a5d6ff",white:"#c9d1d9",brightBlack:"#6e7681",brightRed:"#ffa198",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#58a6ff",brightMagenta:"#bc8cff",brightCyan:"#79c0ff",brightWhite:"#f0f6fc"}}},a=p(null),b=p([]),M=p(null),T=p(localStorage.getItem(rt)||"default"),I=p(null),S=p(!1),D=p(!1);let F=null;const A=new Map;let E=null,R=null,B=null,c=0,d=null,k=0;const $=O(()=>b.value.find(h=>h.id===M.value)||null),j=O(()=>Object.entries(C).map(([h,_])=>({label:_.label,value:h}))),P=O(()=>C[T.value]?.theme.background??"#1a1a2e");function K(){const h=vo(),_=ho(),L=_?_.startsWith("https")?"wss:":"ws:":location.protocol==="https:"?"wss:":"ws:";return _?`${L}//${new URL(_).host}/api/hermes/terminal${h?`?token=${encodeURIComponent(h)}`:""}`:`${L}//${location.host}/api/hermes/terminal${h?`?token=${encodeURIComponent(h)}`:""}`}function Q(){if(c>=ml){I.value=s("terminal.connectionFailed"),S.value=!1;return}const h=K();I.value=null,S.value=!0,c++,F=new WebSocket(h),F.onopen=()=>{S.value=!1,I.value=null},F.onmessage=_=>{const L=typeof _.data=="string"?_.data:"";if(L.charCodeAt(0)===123)try{$e(JSON.parse(L))}catch{}else E?.write(L)},F.onclose=_=>{if(S.value=!1,_.code===1e3||_.code===1003||_.code===1008){I.value=s("terminal.connectionClosed");return}setTimeout(Q,3e3)},F.onerror=_=>{console.error("[Terminal] WebSocket error:",_),I.value=s("terminal.connectionError")}}function ae(h){!F||F.readyState!==WebSocket.OPEN||F.send(typeof h=="string"?h:JSON.stringify(h))}function $e(h){switch(h.type){case"created":c=0,b.value.push({id:h.id,shell:h.shell,pid:h.pid,title:`${h.shell} #${b.value.length+1}`,createdAt:Date.now(),exited:!1}),se(h.id);break;case"exited":{const _=b.value.find(L=>L.id===h.id);_&&(_.exited=!0,M.value===h.id&&E?.write(`\r
|
|
3
3
|
\x1B[90m[${s("terminal.processExited",{code:h.exitCode})}]\x1B[0m\r
|
|
4
4
|
`));break}case"error":v.error(h.message);break}}function le(){ae({type:"create"})}function re(h){let _=A.get(h);if(!_){const L=new Do({cursorBlink:!0,fontSize:14,fontFamily:'Menlo, Monaco, "Courier New", monospace',theme:{...C[T.value].theme}}),ce=new Bo;L.loadAddon(ce),L.loadAddon(new Fo),L.onData(Le=>{F?.readyState===WebSocket.OPEN&&F.send(Le)}),_={term:L,fitAddon:ce,opened:!1},A.set(h,_)}return _}function se(h){if(M.value===h)return;M.value=h;const _=re(h);E=_.term,R=_.fitAddon,oe(),ae({type:"switch",sessionId:h})}function me(h){ae({type:"close",sessionId:h}),b.value=b.value.filter(L=>L.id!==h);const _=A.get(h);_&&(_.term.dispose(),A.delete(h)),M.value===h&&(M.value=b.value.length>0?b.value[0].id:null,E=null,R=null,M.value?se(M.value):(Me(),le()))}function oe(){if(!a.value)return;const h=a.value;for(;h.firstChild;)h.removeChild(h.firstChild);const _=A.get(M.value);if(_){if(!_.opened)_.term.open(h),_.opened=!0;else{const L=_.term.element;L&&h.appendChild(L)}B?.disconnect(),B=new ResizeObserver(()=>{ue(),ie()}),B.observe(a.value),setTimeout(()=>ue(),50),setTimeout(()=>ue(),200)}}function Me(){if(!a.value)return;const h=a.value;for(;h.firstChild;)h.removeChild(h.firstChild)}function ue(){if(R)try{R.fit()}catch{}}function ie(){if(!(!E||!F||F.readyState!==WebSocket.OPEN))try{ae({type:"resize",cols:E.cols,rows:E.rows})}catch{}}function Te(h){if(h.touches.length!==1){d=null,k=0;return}d=h.touches[0].clientY,k=0}function ne(h){if(!E||h.touches.length!==1||d===null)return;const _=h.touches[0].clientY;k+=d-_,d=_;const L=Math.trunc(k/ut);L!==0&&(E.scrollLines(L),k-=L*ut,h.preventDefault())}function de(){d=null,k=0}function _e(h){T.value=h,localStorage.setItem(rt,h);const _=C[h]?.theme;if(_)for(const L of A.values())L.term.options.theme={..._}}function Pe(h){return new Date(h).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}let we=!1;return ee(()=>U.visible,h=>{h&&!we&&!F&&(we=!0,Q())},{immediate:!0}),Je(()=>{Me();for(const h of A.values())h.term.dispose();A.clear(),E=null,R=null,F?.close(),F=null}),(h,_)=>(n(),i("div",Qs,[D.value?(n(),i("div",{key:0,class:"sidebar-overlay",onClick:_[0]||(_[0]=L=>D.value=!1)})):g("",!0),e("div",{class:Y(["terminal-sidebar",{"mobile-visible":D.value}])},[e("div",Zs,[e("span",el,r(t(s)("terminal.sessions")),1),x(t(Be),{trigger:"hover"},{trigger:w(()=>[x(t(G),{quaternary:"",size:"tiny",onClick:le,circle:""},{icon:w(()=>[..._[3]||(_[3]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)])]),_:1})]),default:w(()=>[q(" "+r(t(s)("terminal.newTab")),1)]),_:1})]),e("div",tl,[I.value?(n(),i("div",sl,[_[4]||(_[4]=e("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("circle",{cx:"12",cy:"12",r:"10"}),e("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),e("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})],-1)),e("span",null,r(I.value),1),x(t(G),{size:"tiny",onClick:Q},{default:w(()=>[q(r(t(s)("common.retry")),1)]),_:1})])):b.value.length===0?(n(),i("div",ll,[S.value?(n(),i(W,{key:0},[q(r(t(s)("common.loading")),1)],64)):(n(),i(W,{key:1},[q(r(t(s)("terminal.noSessions")),1)],64))])):g("",!0),(n(!0),i(W,null,te(b.value,L=>(n(),i("button",{key:L.id,class:Y(["session-item",{active:L.id===M.value,exited:L.exited}]),onClick:ce=>se(L.id)},[e("div",ol,[e("span",al,r(L.title),1),e("span",il,[e("span",rl,r(L.shell),1),L.exited?(n(),i("span",ul,r(t(s)("terminal.sessionExited")),1)):(n(),i("span",dl,r(Pe(L.createdAt)),1))])]),b.value.length>1?(n(),J(t($n),{key:0,onPositiveClick:ce=>me(L.id)},{trigger:w(()=>[e("button",{class:"session-item-delete",onClick:_[1]||(_[1]=pt(()=>{},["stop"]))},[..._[5]||(_[5]=[e("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),default:w(()=>[q(" "+r(t(s)("terminal.closeSession")),1)]),_:1},8,["onPositiveClick"])):g("",!0)],10,nl))),128))])],2),e("div",cl,[e("header",vl,[$.value?(n(),i("span",hl,r($.value.title),1)):g("",!0),e("div",pl,[x(t(G),{size:"small",onClick:_[2]||(_[2]=L=>D.value=!D.value),class:"sidebar-toggle"},{icon:w(()=>[..._[6]||(_[6]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e("line",{x1:"9",y1:"3",x2:"9",y2:"21"})],-1)])]),default:w(()=>[q(" "+r(t(s)("terminal.sessions")),1)]),_:1}),x(t(Mn),{value:T.value,options:j.value,size:"small","consistent-menu-width":!1,class:"theme-select","onUpdate:value":_e},null,8,["value","options"]),x(t(G),{size:"small",onClick:le},{icon:w(()=>[..._[7]||(_[7]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)])]),default:w(()=>[q(" "+r(t(s)("terminal.newTab")),1)]),_:1})])]),e("div",fl,[e("div",{ref_key:"terminalRef",ref:a,class:"terminal-xterm",style:Re({backgroundColor:P.value}),onTouchstart:Te,onTouchmove:ne,onTouchend:de,onTouchcancel:de},null,36)])])]))}})})),ya=V((()=>{})),Hn,wa=V((()=>{_l(),_l(),ya(),pe(),Hn=fe(qn,[["__scopeId","data-v-e87bb3e6"]])})),gl,yl,wl,kl,Wn,bl=V((()=>{ve(),la(),Se(),Ne(),sa(),Ho(),Yo(),qo(),ta(),Uo(),Jo(),jo(),Ko(),gl={class:"files-panel-drawer"},yl={class:"files-main-panel"},wl={class:"main-toolbar"},kl={class:"files-content"},Wn=he({__name:"FilesPanel",setup(H){const s=Oo(),{t:v}=Ce(),U=p(null),C=p(!1),a=p(!1),b=p("newFile"),M=p(null),T=p(!1);function I(A,E){U.value?.show(A,E)}function S(){b.value="newFile",M.value=null,a.value=!0}function D(){b.value="newFolder",M.value=null,a.value=!0}function F(A){b.value="rename",M.value=A,a.value=!0}return ye(()=>{s.fetchEntries("")}),(A,E)=>(n(),i("div",gl,[T.value?(n(),i("div",{key:0,class:"sidebar-overlay",onClick:E[0]||(E[0]=R=>T.value=!1)})):g("",!0),e("div",{class:Y(["files-tree-panel",{"mobile-visible":T.value}])},[x(zo)],2),e("div",yl,[e("div",wl,[x(t(G),{size:"small",onClick:E[1]||(E[1]=R=>T.value=!T.value),class:"sidebar-toggle"},{icon:w(()=>[...E[5]||(E[5]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e("line",{x1:"9",y1:"3",x2:"9",y2:"21"})],-1)])]),default:w(()=>[q(" "+r(t(v)("files.fileTree")),1)]),_:1}),x(Xo,{onShowNewFile:S,onShowNewFolder:D,onShowUpload:E[2]||(E[2]=R=>C.value=!0)})]),x(Wo),e("div",kl,[t(s).editingFile?(n(),J(Zo,{key:0})):t(s).previewFile?(n(),J(No,{key:1})):(n(),J(Vo,{key:2,onContextmenuEntry:I}))])]),x(Go,{ref_key:"contextMenuRef",ref:U,onRename:F},null,512),x(Qo,{show:C.value,"onUpdate:show":E[3]||(E[3]=R=>C.value=R)},null,8,["show"]),x(ea,{show:a.value,"onUpdate:show":E[4]||(E[4]=R=>a.value=R),mode:b.value,entry:M.value},null,8,["show","mode","entry"])]))}})})),ka=V((()=>{})),jn,ba=V((()=>{bl(),bl(),ka(),pe(),jn=fe(Wn,[["__scopeId","data-v-efc529cd"]])})),xl,Sl,Cl,$l,Ml,Gn,Tl=V((()=>{ve(),Se(),wa(),ba(),xl={class:"drawer-header"},Sl={class:"drawer-tabs"},Cl={class:"drawer-content"},$l={class:"drawer-pane"},Ml={class:"drawer-pane"},Gn=he({__name:"DrawerPanel",props:{show:{type:Boolean},activeTab:{default:"files"}},emits:["update:show"],setup(H,{emit:s}){const v=H,U=s,{t:C}=Ce(),a=p(v.activeTab);ee(()=>v.activeTab,M=>{M&&(a.value=M)});function b(){U("update:show",!1)}return(M,T)=>(n(),J(oo,{to:"body"},[H.show?(n(),i("div",{key:0,class:"drawer-overlay",onClick:b})):g("",!0),e("div",{class:Y(["drawer-panel",{show:H.show}])},[e("div",xl,[e("div",Sl,[e("button",{class:Y(["tab-button",{active:a.value==="files"}]),onClick:T[0]||(T[0]=I=>a.value="files")},r(t(C)("drawer.files")),3),e("button",{class:Y(["tab-button",{active:a.value==="terminal"}]),onClick:T[1]||(T[1]=I=>a.value="terminal")},r(t(C)("drawer.terminal")),3)]),e("button",{class:"close-button",onClick:b},[...T[2]||(T[2]=[e("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),e("div",Cl,[Ke(e("div",$l,[x(jn)],512),[[ct,a.value==="files"]]),Ke(e("div",Ml,[x(Hn,{visible:a.value==="terminal"&&H.show},null,8,["visible"])],512),[[ct,a.value==="terminal"]])])],2)]))}})})),xa=V((()=>{})),Yn,Sa=V((()=>{Tl(),Tl(),xa(),pe(),Yn=fe(Gn,[["__scopeId","data-v-9e646a0b"]])})),Pl,Il,Bl,Ll,Fl,Dl,Al,El,Rl,zl,Nl,Ol,Ul,Vl,ql,Hl,Wl,jl,Gl,Yl,Kl,Jl,Xl,Ql,Zl,en,tn,sn,ln,nn,on,an,rn,un,dn,cn,vn,hn,pn,fn,mn,_n,gn,yn,wn,kn,bn,Kn,xn=V((()=>{ve(),Pn(),tt(),Ze(),Co(),Ne(),Se(),In(),Mo(),oa(),ua(),pa(),ga(),$o(),Sa(),Pl={class:"chat-panel"},Il={class:"session-list-header"},Bl={key:0,class:"session-list-title"},Ll={class:"session-list-actions"},Fl={key:0,class:"session-scope-note"},Dl={key:1,class:"session-items"},Al={key:0,class:"session-loading"},El={key:1,class:"session-empty"},Rl={class:"session-group-header session-group-header--static"},zl={class:"session-group-label"},Nl={class:"session-group-count"},Ol=["onClick"],Ul={class:"session-group-label"},Vl={class:"session-group-count"},ql={class:"session-model-list"},Hl=["onClick"],Wl={class:"session-model-group-label"},jl={class:"session-model-group-count"},Gl={class:"session-model-group-items"},Yl=["title","onClick"],Kl={class:"session-model-item-label"},Jl={class:"session-model-item-name"},Xl={key:0,class:"session-model-item-id"},Ql={key:0,class:"session-model-badge-preview"},Zl={key:1,class:"session-model-badge-disabled"},en={key:2,class:"session-model-badge-custom"},tn={key:3,class:"session-model-check",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},sn={key:0,class:"session-model-empty"},ln={class:"session-model-custom"},nn={class:"session-model-custom-row"},on={class:"session-model-custom-hint"},an={class:"chat-main"},rn={class:"chat-header"},un={class:"header-left"},dn={class:"header-session-title"},cn={key:1,class:"source-badge"},vn=["title"],hn={class:"header-actions"},pn={key:0,class:"approval-bar"},fn={class:"approval-content"},mn={class:"approval-main"},_n={class:"approval-kicker"},gn={class:"approval-title"},yn={class:"approval-desc"},wn={class:"approval-command"},kn={class:"approval-actions"},bn={class:"drawer-button-wrapper"},Kn=he({__name:"ChatPanel",setup(H){const s=et(),v=ze(),U=So(),C=ft(),{t:a}=Ce(),b=p(!1),M=p("files"),T=p("chat"),I=p(!1),S=p(new Set),D=p(typeof window>"u"||!window.matchMedia("(max-width: 768px)").matches);let F=null;const A=p(!1);function E(o){s.switchSession(o),F?.matches&&(D.value=!1)}function R(o){A.value=o.matches,o.matches&&D.value&&(D.value=!1)}ye(()=>{F=window.matchMedia("(max-width: 768px)"),R(F),F.addEventListener("change",R)}),Je(()=>{F?.removeEventListener("change",R)});const B=p(!1),c=p(""),d=p(null),k=p(null),$=p(new Set(JSON.parse(localStorage.getItem("hermes_collapsed_groups")||"[]")));function j(o){return o==="api_server"?-1:o==="cron"?999:0}function P(o){return[...o].sort((l,z)=>(z.updatedAt||0)-(l.updatedAt||0))}const K=O(()=>P(s.sessions.filter(o=>U.isPinned(o.id)))),Q=O(()=>{const o=new Map;for(const l of s.sessions){if(U.isPinned(l.id))continue;const z=l.source||"";o.has(z)||o.set(z,[]),o.get(z).push(l)}return[...o.keys()].sort((l,z)=>{const f=j(l),N=j(z);return f!==N?f-N:l.localeCompare(z)}).map(l=>({source:l,label:l?ae(l):a("chat.other"),sessions:P(o.get(l))}))});function ae(o){return o==="cli"?"Bridge (beta)":ht(o)}function $e(o){if(!$.value.has(o))$.value=new Set([...$.value,o]);else{$.value=new Set(Q.value.map(z=>z.source).filter(z=>z!==o));const l=Q.value.find(z=>z.source===o);l?.sessions.length&&s.switchSession(l.sessions[0].id)}localStorage.setItem("hermes_collapsed_groups",JSON.stringify([...$.value]))}ee(Q,o=>{if(localStorage.getItem("hermes_collapsed_groups")!==null){const l=s.activeSession?.source;l&&$.value.has(l)&&($.value=new Set([...$.value].filter(z=>z!==l)),localStorage.setItem("hermes_collapsed_groups",JSON.stringify([...$.value])));return}$.value=new Set(o.slice(1).map(l=>l.source)),localStorage.setItem("hermes_collapsed_groups",JSON.stringify([...$.value]))},{once:!0}),ee(()=>[s.sessionsLoaded,...s.sessions.map(o=>o.id)],o=>{const l=o.slice(1);!o[0]||l.length===0||U.pruneMissingSessions(l)},{immediate:!0});const le=O(()=>s.activeSession?.title||a("chat.newChat")),re=O(()=>T.value==="live"?a("chat.liveSessions"):le.value),se=O(()=>T.value==="chat"&&s.activeSession?.source||""),me=O(()=>s.activePendingApproval),oe=O(()=>me.value);function Me(){s.newChat()}function ue(){const o=s.newCliSession();s.switchSession(o.id)}const ie=O(()=>[{label:"API",key:"api_server"},{label:"Bridge (beta)",key:"cli"}]);function Te(o){if(o==="cli"){ue();return}Me()}function ne(o){s.respondApproval(o)}async function de(o){const l=o||s.activeSessionId;l&&(await To(l)?C.success(a("common.copied")):C.error(a("common.copied")+" ✗"))}function _e(o){U.removePinned(o),s.deleteSession(o),C.success(a("chat.sessionDeleted"))}function Pe(){I.value=!I.value,I.value||S.value.clear()}function we(o){S.value.has(o)?S.value.delete(o):S.value.add(o),S.value=new Set(S.value)}function h(o){return S.value.has(o)}async function _(){if(S.value.size===0)return;const o=Array.from(S.value);try{const l=await wo(o);if(l.deleted>0){for(const z of o)U.removePinned(z);await s.loadSessions(),C.success(a("chat.batchDeleteSuccess",{count:l.deleted})),l.failed>0&&C.warning(a("chat.batchDeletePartial",{failed:l.failed}))}else C.error(a("chat.batchDeleteFailed"))}catch{C.error(a("chat.batchDeleteFailed"))}finally{I.value=!1,S.value.clear()}}function L(){S.value.clear();for(const o of s.sessions)o.id!==s.activeSessionId&&S.value.add(o.id);S.value=new Set(S.value)}const ce=O(()=>S.value.size),Le=O(()=>s.sessions.some(o=>o.id!==s.activeSessionId)),X=p(null),st=O(()=>X.value?U.isPinned(X.value):!1),lt=O(()=>X.value&&s.sessions.find(o=>o.id===X.value)||null),nt=O(()=>{const o=[{label:a(st.value?"chat.unpin":"chat.pin"),key:"pin"},{label:a("chat.rename"),key:"rename"},{label:a("chat.setWorkspace"),key:"workspace"}];return lt.value?.source==="cli"&&o.push({label:a("chat.setModel"),key:"model"}),o.push({label:a("chat.export"),key:"export",children:[{label:a("chat.exportFull"),key:"export-full",children:[{label:"JSON",key:"export-full-json"},{label:"TXT",key:"export-full-txt"}]},{label:a("chat.exportCompressed"),key:"export-compressed",children:[{label:"JSON",key:"export-compressed-json"},{label:"TXT",key:"export-compressed-txt"}]}]}),o.push({label:a("chat.copySessionId"),key:"copy-id"}),o});function Oe(o,l){o.preventDefault(),X.value=l,Ie.value=!0,Ue.value=o.clientX,Fe.value=o.clientY}const Ie=p(!1),Ue=p(0),Fe=p(0);function Ve(o){return o==="export-full-json"?{mode:"full",ext:"json"}:o==="export-full-txt"?{mode:"full",ext:"txt"}:o==="export-compressed-json"?{mode:"compressed",ext:"json"}:o==="export-compressed-txt"?{mode:"compressed",ext:"txt"}:null}async function ot(o){if(Ie.value=!1,!!X.value){if(o==="pin"){U.togglePinned(X.value);return}if(o==="copy-id")de(X.value);else if(Ve(o)){const{mode:l,ext:z}=Ve(o),f=l==="compressed"?C.loading(a("chat.exportCompressing"),{duration:0}):null;try{await go(X.value,l,z),f?.destroy(),C.success(a("chat.exportSuccess"))}catch{f?.destroy(),C.error(a("chat.exportFailed"))}}else if(o==="workspace"){const l=s.sessions.find(z=>z.id===X.value);Z.value=X.value,y.value=l?.workspace||"",m.value=!0}else if(o==="model")Zn(X.value);else if(o==="rename"){const l=s.sessions.find(z=>z.id===X.value);d.value=X.value,c.value=l?.title||"",B.value=!0,xe(()=>{k.value?.focus()})}}}function qe(){Ie.value=!1}async function u(){if(!(!d.value||!c.value.trim())){if(await mo(d.value,c.value.trim())){const o=s.sessions.find(l=>l.id===d.value);o&&(o.title=c.value.trim()),s.activeSession?.id===d.value&&(s.activeSession.title=c.value.trim()),C.success(a("chat.renamed"))}else C.error(a("chat.renameFailed"));B.value=!1}}const m=p(!1),y=p(""),Z=p(null);async function ge(){if(Z.value){if(await xo(Z.value,y.value||null)){const o=s.sessions.find(l=>l.id===Z.value);o&&(o.workspace=y.value||null),s.activeSession?.id===Z.value&&(s.activeSession.workspace=y.value||null),C.success(a("chat.workspaceSet"))}else C.error(a("chat.workspaceSetFailed"));m.value=!1}}const ke=p(!1),De=p(null),be=p(""),He=p({}),We=p(""),Ae=p(""),je=p(""),Ge=p(""),Qn=O(()=>v.modelGroups.map(o=>({label:o.label,value:o.provider}))),mt=O(()=>v.modelGroups.map(o=>({...o,models:[...o.models,...(v.customModels[o.provider]||[]).filter(l=>!o.models.includes(l))]}))),_t=O(()=>{const o=be.value.trim().toLowerCase();return o?mt.value.map(l=>({...l,models:l.models.filter(z=>{const f=v.displayModelName(z,l.provider);return z.toLowerCase().includes(o)||f.toLowerCase().includes(o)})})).filter(l=>l.models.length>0||l.label.toLowerCase().includes(o)):mt.value});function Zn(o){const l=s.sessions.find(z=>z.id===o);De.value=o,We.value=l?.model||v.selectedModel||"",Ae.value=l?.provider||v.selectedProvider||"",Ge.value=Ae.value,be.value="",je.value="",He.value={},ke.value=!0}function gt(o){return!!He.value[o]}function eo(o){He.value[o]=!He.value[o]}function to(o,l){return(v.customModels[l]||[]).includes(o)}function so(o,l){return v.displayModelName(o,l)}function lo(o,l){return v.getModelAlias(o,l)}async function yt(o,l){v.modelGroups.find(z=>z.provider===l)?.model_meta?.[o]?.disabled||!De.value||(await s.switchSessionModel(o,l,De.value)?(We.value=o,Ae.value=l,ke.value=!1,C.success(a("chat.modelSet"))):C.error(a("chat.modelSetFailed")))}async function no(){const o=je.value.trim(),l=Ge.value;!o||!l||await yt(o,l)}return(o,l)=>{const z=co("RouterLink");return n(),i("div",Pl,[T.value==="chat"?(n(),i("div",{key:0,class:Y(["session-backdrop",{active:D.value}]),onClick:l[0]||(l[0]=f=>D.value=!1)},null,2)):g("",!0),T.value==="chat"?(n(),i("aside",{key:1,class:Y(["session-list",{collapsed:!D.value}])},[e("div",Il,[D.value?(n(),i("span",Bl,r(t(a)("chat.webUiSessions")),1)):g("",!0),e("div",Ll,[e("button",{class:"session-close-btn",onClick:l[1]||(l[1]=f=>D.value=!1)},[...l[18]||(l[18]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])]),I.value?g("",!0):(n(),J(t(G),{key:0,quaternary:"",size:"tiny",onClick:Pe,title:t(a)("chat.toggleBatchMode")},{icon:w(()=>[...l[19]||(l[19]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"M9 11l3 3L22 4"}),e("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})],-1)])]),_:1},8,["title"])),I.value?(n(),J(t(G),{key:1,quaternary:"",size:"tiny",onClick:L,disabled:!Le.value,title:t(a)("chat.selectAll")},{icon:w(()=>[...l[20]||(l[20]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"M9 11l3 3L22 4"}),e("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})],-1)])]),_:1},8,["disabled","title"])):g("",!0),I.value&&ce.value>0?(n(),J(t($n),{key:2,onPositiveClick:_},{trigger:w(()=>[x(t(G),{quaternary:"",size:"tiny",type:"error"},{icon:w(()=>[...l[21]||(l[21]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("polyline",{points:"3 6 5 6 21 6"}),e("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1)])]),_:1})]),default:w(()=>[q(" "+r(t(a)("chat.confirmBatchDelete",{count:ce.value})),1)]),_:1})):g("",!0),I.value?(n(),J(t(G),{key:3,quaternary:"",size:"tiny",onClick:Pe},{icon:w(()=>[...l[22]||(l[22]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])]),_:1})):g("",!0),x(t(it),{trigger:"click",options:ie.value,onSelect:Te},{default:w(()=>[x(t(G),{quaternary:"",size:"tiny",circle:""},{icon:w(()=>[...l[23]||(l[23]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)])]),_:1})]),_:1},8,["options"])])]),D.value?(n(),i("div",Fl,[e("span",null,r(t(a)("chat.sessionScopeHint")),1),x(z,{class:"session-scope-link",to:{name:"hermes.history"}},{default:w(()=>[q(r(t(a)("chat.openHistory")),1)]),_:1})])):g("",!0),D.value?(n(),i("div",Dl,[t(s).isLoadingSessions&&t(s).sessions.length===0?(n(),i("div",Al,r(t(a)("common.loading")),1)):t(s).sessions.length===0?(n(),i("div",El,r(t(a)("chat.noSessions")),1)):g("",!0),K.value.length>0?(n(),i(W,{key:2},[e("div",Rl,[e("span",zl,r(t(a)("chat.pinned")),1),e("span",Nl,r(K.value.length),1)]),(n(!0),i(W,null,te(K.value,f=>(n(),J(bt,{key:`pinned-${f.id}`,session:f,active:f.id===t(s).activeSessionId,pinned:!0,"can-delete":f.id!==t(s).activeSessionId||t(s).sessions.length>1,streaming:t(s).isSessionLive(f.id),selectable:I.value,selected:h(f.id),onSelect:N=>E(f.id),onContextmenu:N=>Oe(N,f.id),onDelete:N=>_e(f.id),onToggleSelect:N=>we(f.id)},null,8,["session","active","can-delete","streaming","selectable","selected","onSelect","onContextmenu","onDelete","onToggleSelect"]))),128))],64)):g("",!0),(n(!0),i(W,null,te(Q.value,f=>(n(),i(W,{key:f.source},[e("div",{class:"session-group-header",onClick:N=>$e(f.source)},[(n(),i("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",class:Y(["group-chevron",{collapsed:$.value.has(f.source)}])},[...l[24]||(l[24]=[e("polyline",{points:"9 18 15 12 9 6"},null,-1)])],2)),e("span",Ul,r(f.label),1),e("span",Vl,r(f.sessions.length),1)],8,Ol),$.value.has(f.source)?g("",!0):(n(!0),i(W,{key:0},te(f.sessions,N=>(n(),J(bt,{key:N.id,session:N,active:N.id===t(s).activeSessionId,pinned:!1,"can-delete":N.id!==t(s).activeSessionId||t(s).sessions.length>1,streaming:t(s).isSessionLive(N.id),selectable:I.value,selected:h(N.id),onSelect:Ee=>E(N.id),onContextmenu:Ee=>Oe(Ee,N.id),onDelete:Ee=>_e(N.id),onToggleSelect:Ee=>we(N.id)},null,8,["session","active","can-delete","streaming","selectable","selected","onSelect","onContextmenu","onDelete","onToggleSelect"]))),128))],64))),128))])):g("",!0)],2)):g("",!0),x(t(it),{placement:"bottom-start",trigger:"manual",x:Ue.value,y:Fe.value,options:nt.value,show:Ie.value,onSelect:ot,onClickoutside:qe},null,8,["x","y","options","show"]),x(t(Ye),{show:B.value,"onUpdate:show":l[3]||(l[3]=f=>B.value=f),preset:"dialog",title:t(a)("chat.renameSession"),"positive-text":t(a)("common.ok"),"negative-text":t(a)("common.cancel"),onPositiveClick:u},{default:w(()=>[x(t(at),{ref_key:"renameInputRef",ref:k,value:c.value,"onUpdate:value":l[2]||(l[2]=f=>c.value=f),placeholder:t(a)("chat.enterNewTitle"),onKeydown:wt(u,["enter"])},null,8,["value","placeholder"])]),_:1},8,["show","title","positive-text","negative-text"]),x(t(Ye),{show:m.value,"onUpdate:show":l[5]||(l[5]=f=>m.value=f),preset:"dialog",title:t(a)("chat.setWorkspaceTitle"),"positive-text":t(a)("common.ok"),"negative-text":t(a)("common.cancel"),style:{width:"520px"},onPositiveClick:ge},{default:w(()=>[x(Dn,{modelValue:y.value,"onUpdate:modelValue":l[4]||(l[4]=f=>y.value=f)},null,8,["modelValue"])]),_:1},8,["show","title","positive-text","negative-text"]),x(t(Ye),{show:ke.value,"onUpdate:show":l[9]||(l[9]=f=>ke.value=f),preset:"card",title:t(a)("chat.setModelTitle"),style:{width:"min(480px, calc(100vw - 32px))"},"mask-closable":!0},{default:w(()=>[x(t(at),{value:be.value,"onUpdate:value":l[6]||(l[6]=f=>be.value=f),placeholder:t(a)("models.searchPlaceholder"),clearable:"",size:"small",class:"session-model-search"},null,8,["value","placeholder"]),e("div",ql,[(n(!0),i(W,null,te(_t.value,f=>(n(),i("div",{key:f.provider,class:"session-model-group"},[e("div",{class:"session-model-group-header",onClick:N=>eo(f.provider)},[(n(),i("svg",{class:Y(["session-model-group-arrow",{collapsed:gt(f.provider)}]),width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...l[25]||(l[25]=[e("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2)),e("span",Wl,r(f.label),1),e("span",jl,r(f.models.length),1)],8,Hl),Ke(e("div",Gl,[(n(!0),i(W,null,te(f.models,N=>(n(),i("div",{key:N,class:Y(["session-model-item",{active:N===We.value&&f.provider===Ae.value,disabled:!!f.model_meta?.[N]?.disabled}]),title:f.model_meta?.[N]?.disabled?t(a)("models.disabledTooltip"):"",onClick:Ee=>yt(N,f.provider)},[e("span",Kl,[e("span",Jl,r(so(N,f.provider)),1),lo(N,f.provider)?(n(),i("span",Xl,r(t(a)("models.aliasCanonical",{model:N})),1)):g("",!0)]),f.model_meta?.[N]?.preview?(n(),i("span",Ql,r(t(a)("models.previewBadge")),1)):g("",!0),f.model_meta?.[N]?.disabled?(n(),i("span",Zl,r(t(a)("models.disabledBadge")),1)):g("",!0),to(N,f.provider)?(n(),i("span",en,r(t(a)("models.customBadge")),1)):g("",!0),N===We.value&&f.provider===Ae.value?(n(),i("svg",tn,[...l[26]||(l[26]=[e("polyline",{points:"20 6 9 17 4 12"},null,-1)])])):g("",!0)],10,Yl))),128))],512),[[ct,!gt(f.provider)]])]))),128)),_t.value.length===0?(n(),i("div",sn,r(be.value?"No results":"No models"),1)):g("",!0),e("div",ln,[e("div",nn,[x(t(Mn),{value:Ge.value,"onUpdate:value":l[7]||(l[7]=f=>Ge.value=f),options:Qn.value,size:"small",class:"session-model-custom-provider"},null,8,["value","options"]),x(t(at),{value:je.value,"onUpdate:value":l[8]||(l[8]=f=>je.value=f),placeholder:t(a)("models.customModelPlaceholder"),size:"small",class:"session-model-custom-input",onKeydown:wt(no,["enter"])},null,8,["value","placeholder"])]),e("div",on,r(t(a)("models.customModelHint")),1)])])]),_:1},8,["show","title"]),e("div",an,[e("header",rn,[e("div",un,[T.value==="chat"?(n(),J(t(G),{key:0,quaternary:"",size:"small",onClick:l[10]||(l[10]=f=>D.value=!D.value),circle:""},{icon:w(()=>[...l[27]||(l[27]=[e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("rect",{x:"3",y:"3",width:"7",height:"7"}),e("rect",{x:"14",y:"3",width:"7",height:"7"}),e("rect",{x:"3",y:"14",width:"7",height:"7"}),e("rect",{x:"14",y:"14",width:"7",height:"7"})],-1)])]),_:1})):g("",!0),e("span",dn,r(re.value),1),se.value?(n(),i("span",cn,r(ae(se.value)),1)):g("",!0),t(s).activeSession?.workspace?(n(),i("span",{key:2,class:"workspace-badge",title:t(s).activeSession.workspace},"📁 "+r(t(s).activeSession.workspace.split("/").pop()||t(s).activeSession.workspace),9,vn)):g("",!0)]),e("div",hn,[T.value==="chat"?(n(),i(W,{key:0},[x(t(Be),{trigger:"hover"},{trigger:w(()=>[x(t(G),{quaternary:"",size:"small",onClick:l[11]||(l[11]=f=>de()),circle:""},{icon:w(()=>[...l[28]||(l[28]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),e("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})],-1)])]),_:1})]),default:w(()=>[q(" "+r(t(a)("chat.copySessionId")),1)]),_:1}),x(t(it),{trigger:"click",options:ie.value,onSelect:Te},{default:w(()=>[x(t(G),{size:"small",circle:A.value},{icon:w(()=>[...l[29]||(l[29]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)])]),default:w(()=>[A.value?g("",!0):(n(),i(W,{key:0},[q(r(t(a)("chat.newChat")),1)],64))]),_:1},8,["circle"])]),_:1},8,["options"])],64)):g("",!0)])]),T.value==="chat"?(n(),i(W,{key:0},[x(Vn),oe.value?(n(),i("div",pn,[l[30]||(l[30]=e("div",{class:"approval-icon","aria-hidden":"true"},[e("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10"}),e("path",{d:"m9 12 2 2 4-4"})])],-1)),e("div",fn,[e("div",mn,[e("div",_n,r(t(a)("chat.approvalKicker")),1),e("div",gn,r(t(a)("chat.approvalTitle")),1),e("div",yn,r(oe.value.description),1),e("code",wn,r(oe.value.command),1)]),e("div",kn,[oe.value.choices.includes("once")?(n(),J(t(G),{key:0,size:"small",type:"primary",onClick:l[12]||(l[12]=f=>ne("once"))},{default:w(()=>[q(r(t(a)("chat.approvalAllowOnce")),1)]),_:1})):g("",!0),oe.value.choices.includes("session")?(n(),J(t(G),{key:1,size:"small",secondary:"",onClick:l[13]||(l[13]=f=>ne("session"))},{default:w(()=>[q(r(t(a)("chat.approvalAllowSession")),1)]),_:1})):g("",!0),oe.value.choices.includes("always")?(n(),J(t(G),{key:2,size:"small",secondary:"",onClick:l[14]||(l[14]=f=>ne("always"))},{default:w(()=>[q(r(t(a)("chat.approvalAlways")),1)]),_:1})):g("",!0),oe.value.choices.includes("deny")?(n(),J(t(G),{key:3,size:"small",type:"error",secondary:"",onClick:l[15]||(l[15]=f=>ne("deny"))},{default:w(()=>[q(r(t(a)("chat.approvalDeny")),1)]),_:1})):g("",!0)])])])):g("",!0),x(En)],64)):(n(),J(zn,{key:1,"human-only":t(U).humanOnly},null,8,["human-only"]))]),e("div",bn,[e("div",{class:"drawer-button",onClick:l[16]||(l[16]=f=>b.value=!0)},[...l[31]||(l[31]=[e("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e("line",{x1:"9",y1:"3",x2:"9",y2:"21"}),e("line",{x1:"15",y1:"3",x2:"15",y2:"21"})],-1)])])]),x(Yn,{show:b.value,"onUpdate:show":l[17]||(l[17]=f=>b.value=f),"active-tab":M.value},null,8,["show","active-tab"])])}}})})),Ca=V((()=>{})),Jn,$a=V((()=>{xn(),xn(),Ca(),pe(),Jn=fe(Kn,[["__scopeId","data-v-f7f8484f"]])})),Sn,Xn,Cn=V((()=>{ve(),$a(),Ze(),tt(),Tn(),yo(),Sn={class:"chat-view"},Xn=he({__name:"ChatView",setup(H){const s=ze(),v=et(),U=vt(),C=ko();return ye(async()=>{s.loadModels(),await Promise.all([U.fetchProfiles(),C.fetchSettings()]),v.loadSessions()}),(a,b)=>(n(),i("div",Sn,[x(Jn)]))}})})),Ma=V((()=>{})),Ta,Pa=V((()=>{Cn(),Cn(),Ma(),pe(),Ta=fe(Xn,[["__scopeId","data-v-c6869148"]])}));Pa();export{Ta as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as g}from"./rolldown-runtime-BKwlnUi0.js";import{C as Re,F as E,H as pt,I as te,L as _t,Nt as C,R as ft,Rt as e,S as Ne,St as vt,T as mt,U as M,Vt as m,X as ae,Y as ht,Z as qe,_t as b,a as wt,ct as B,et as J,h as H,ht as Ke,it as $,l as gt,mt as yt,nt as N,ot as x,pt as Ft,r as kt,rt as R,st as F,t as U,tt as y,ut as ie,w as bt,wt as h,y as V,yt as Ae}from"./ui-vendor-CsTMg6zH.js";import{d as Ct,n as L,r as P,u as xt}from"./vue-vendor-D8zSB7VM.js";import{a as Ve,c as St,l as q,n as K,o as Je,t as A}from"./_plugin-vue_export-helper-ZIsfSgrY.js";import{An as $t,On as Tt,kn as Et,t as Dt}from"./monaco-editor-EDqig1FP.js";import{n as Mt,t as zt}from"./clipboard-BqPv71We.js";import{c as Xe,n as Bt,s as He,t as Ut}from"./MarkdownRenderer-CvzCPLnZ.js";async function We(i=""){const s=new URLSearchParams;i&&s.set("path",i);const t=s.toString();return q(`/api/hermes/files/list${t?`?${t}`:""}`)}async function se(i){return q(`/api/hermes/files/read?path=${encodeURIComponent(i)}`)}async function le(i,s){await q("/api/hermes/files/write",{method:"PUT",body:JSON.stringify({path:i,content:s})})}async function Lt(i,s=!1){await q("/api/hermes/files/delete",{method:"DELETE",body:JSON.stringify({path:i,recursive:s})})}async function Pt(i,s){await q("/api/hermes/files/rename",{method:"POST",body:JSON.stringify({oldPath:i,newPath:s})})}async function jt(i){await q("/api/hermes/files/mkdir",{method:"POST",body:JSON.stringify({path:i})})}async function It(i,s){await q("/api/hermes/files/copy",{method:"POST",body:JSON.stringify({srcPath:i,destPath:s})})}async function Ot(i,s){const t=Je(),n=new FormData;for(const w of s)n.append("file",w);const a=new URLSearchParams;i&&a.set("path",i);const l=a.toString(),r=`${t}/api/hermes/files/upload${l?`?${l}`:""}`,c={},_=Ve();_&&(c.Authorization=`Bearer ${_}`);const u=await fetch(r,{method:"POST",headers:c,body:n});if(!u.ok){const w=await u.json().catch(()=>({error:`HTTP ${u.status}`}));throw new Error(w.error||`Upload failed: ${u.status}`)}return(await u.json()).files}function Rt(i,s){const t=Je(),n=new URLSearchParams({path:i});s&&n.set("name",s);const a=Ve();return a&&n.set("token",a),`${t}/api/hermes/download?${n.toString()}`}var Y=g((()=>{St()}));function Nt(i){const s=i.split("/").pop()||"";return s==="Dockerfile"?"dockerfile":s==="Makefile"?"makefile":Ge["."+s.split(".").pop()?.toLowerCase()]||"plaintext"}function Z(i){const s=i.lastIndexOf(".");return s>=0?i.slice(s).toLowerCase():""}function Q(i){return Ye.has(Z(i))}function ee(i){const s=Z(i);return s===".md"||s===".markdown"}function G(i){return!new Set([".png",".jpg",".jpeg",".gif",".webp",".bmp",".ico",".zip",".gz",".tar",".7z",".rar",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".mp3",".mp4",".wav",".webm",".avi",".mov",".exe",".dll",".so",".dylib",".bin",".dat",".db",".sqlite"]).has(Z(i))}function X(i,s,t){return!!(i===s||t&&i.startsWith(s+"/"))}var Ge,Ye,z,j=g((()=>{Ct(),M(),Y(),Ge={".js":"javascript",".jsx":"javascript",".ts":"typescript",".tsx":"typescript",".json":"json",".jsonc":"json",".html":"html",".htm":"html",".css":"css",".scss":"scss",".less":"less",".md":"markdown",".markdown":"markdown",".py":"python",".yaml":"yaml",".yml":"yaml",".xml":"xml",".sh":"shell",".bash":"shell",".zsh":"shell",".sql":"sql",".go":"go",".rs":"rust",".java":"java",".c":"c",".h":"c",".cpp":"cpp",".hpp":"cpp",".toml":"ini",".ini":"ini",".env":"ini",".vue":"html",".dockerfile":"dockerfile",".graphql":"graphql",".lua":"lua",".r":"r",".rb":"ruby",".php":"php",".swift":"swift",".kt":"kotlin"},Ye=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".bmp",".ico"]),z=xt("files",()=>{const i=C(""),s=C([]),t=C(!1),n=C("name"),a=C("asc"),l=C(null),r=C(null),c=J(()=>i.value?i.value.split("/").filter(Boolean):[]),_=J(()=>{const o=[...s.value];return o.sort((k,I)=>{if(k.isDir!==I.isDir)return k.isDir?-1:1;let O=0;switch(n.value){case"name":O=k.name.localeCompare(I.name);break;case"size":O=k.size-I.size;break;case"modTime":O=k.modTime.localeCompare(I.modTime);break}return a.value==="asc"?O:-O}),o});async function u(o){o!==void 0&&o!==i.value&&(r.value=null),o!==void 0&&(i.value=o),t.value=!0;try{s.value=(await We(i.value)).entries}catch(k){throw console.error("Failed to fetch files:",k),k}finally{t.value=!1}}function w(o){return u(o)}function S(){const o=i.value.split("/").filter(Boolean);return o.pop(),u(o.join("/"))}async function d(o){const k=await se(o);l.value={path:o,content:k.content,originalContent:k.content,language:Nt(o)}}async function p(){l.value&&(await le(l.value.path,l.value.content),l.value.originalContent=l.value.content)}function f(){l.value=null}async function D(o){if(Q(o.name))r.value={path:o.path,type:"image"};else if(ee(o.name)){const k=await se(o.path);r.value={path:o.path,type:"markdown",content:k.content}}}function T(){r.value=null}async function v(o){const k=i.value?`${i.value}/${o}`:o;await jt(k),await u()}async function W(o){const k=i.value?`${i.value}/${o}`:o;await le(k,""),await u()}async function ot(o){await Lt(o.path,o.isDir),r.value&&X(r.value.path,o.path,o.isDir)&&(r.value=null),l.value&&X(l.value.path,o.path,o.isDir)&&(l.value=null),await u()}async function rt(o,k){const I=o.path.includes("/")?o.path.slice(0,o.path.lastIndexOf("/")):"",O=I?`${I}/${k}`:k;await Pt(o.path,O),r.value&&X(r.value.path,o.path,o.isDir)&&(r.value=null),l.value&&X(l.value.path,o.path,o.isDir)&&(l.value=null),await u()}async function ut(o,k){await It(o.path,k),await u()}async function ct(o){await Ot(i.value,o),await u()}function dt(o){n.value===o?a.value=a.value==="asc"?"desc":"asc":(n.value=o,a.value="asc")}return{currentPath:i,entries:s,loading:t,sortBy:n,sortOrder:a,editingFile:l,previewFile:r,pathSegments:c,sortedEntries:_,hasUnsavedChanges:J(()=>l.value?l.value.content!==l.value.originalContent:!1),fetchEntries:u,navigateTo:w,navigateUp:S,openEditor:d,saveEditor:p,closeEditor:f,openPreview:D,closePreview:T,createDir:v,createFile:W,deleteEntry:ot,renameEntry:rt,copyEntry:ut,uploadFiles:ct,setSort:dt}})})),ne,Ze,oe=g((()=>{M(),U(),L(),j(),Y(),ne={class:"file-tree"},Ze=B({__name:"FileTree",setup(i){const{t:s}=P(),t=z(),n=C([]),a=C([]);async function l(u){try{return(await We(u)).entries.filter(w=>w.isDir).sort((w,S)=>w.name.localeCompare(S.name)).map(w=>({key:w.path,label:w.name,isLeaf:!1}))}catch{return[]}}async function r(u){u.children=await l(u.key)}function c(u){u.length>0&&(a.value=u,t.navigateTo(u[0]))}function _(){a.value=[],t.navigateTo("")}return Ke(async()=>{n.value=await l("")}),(u,w)=>(b(),$("div",ne,[y("div",{class:"tree-header",onClick:_},[w[0]||(w[0]=y("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},[y("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),y("polyline",{points:"9 22 9 12 15 12 15 22"})],-1)),y("span",null,m(e(s)("files.breadcrumbRoot")),1)]),F(e(wt),{data:n.value,"selected-keys":a.value,"on-load":r,"expand-on-click":"","block-line":"","onUpdate:selectedKeys":c},null,8,["data","selected-keys"])]))}})})),qt=g((()=>{})),Kt,da=g((()=>{oe(),oe(),qt(),K(),Kt=A(Ze,[["__scopeId","data-v-7f00b3bc"]])})),re,Qe,ue=g((()=>{M(),L(),U(),j(),re={class:"file-breadcrumb"},Qe=B({__name:"FileBreadcrumb",setup(i){const{t:s}=P(),t=z();function n(a){if(a<0)t.navigateTo("");else{const l=t.pathSegments.slice(0,a+1).join("/");t.navigateTo(l)}}return(a,l)=>(b(),$("div",re,[F(e(_t),null,{default:h(()=>[F(e(te),{onClick:l[0]||(l[0]=r=>n(-1))},{default:h(()=>[x(m(e(s)("files.breadcrumbRoot")),1)]),_:1}),(b(!0),$(qe,null,Ae(e(t).pathSegments,(r,c)=>(b(),N(e(te),{key:c,onClick:_=>n(c)},{default:h(()=>[x(m(r),1)]),_:2},1032,["onClick"]))),128))]),_:1})]))}})})),At=g((()=>{})),Vt,pa=g((()=>{ue(),ue(),At(),K(),Vt=A(Qe,[["__scopeId","data-v-061302de"]])})),ce,et,de=g((()=>{M(),U(),L(),j(),ce={class:"file-toolbar"},et=B({__name:"FileToolbar",emits:["showNewFile","showNewFolder","showUpload"],setup(i,{emit:s}){const{t}=P(),n=V(),a=z(),l=s;async function r(){try{await a.fetchEntries()}catch{n.error(t("files.backendError"))}}return(c,_)=>(b(),$("div",ce,[F(e(H),{size:8,wrap:!0,class:"toolbar-space"},{default:h(()=>[F(e(E),{size:"small",onClick:_[0]||(_[0]=u=>l("showNewFile")),class:"toolbar-btn"},{default:h(()=>[x(m(e(t)("files.newFile")),1)]),_:1}),F(e(E),{size:"small",onClick:_[1]||(_[1]=u=>l("showNewFolder")),class:"toolbar-btn"},{default:h(()=>[x(m(e(t)("files.newFolder")),1)]),_:1}),F(e(E),{size:"small",onClick:_[2]||(_[2]=u=>l("showUpload")),class:"toolbar-btn"},{default:h(()=>[x(m(e(t)("files.upload")),1)]),_:1}),F(e(E),{size:"small",onClick:r,class:"toolbar-btn"},{default:h(()=>[x(m(e(t)("files.refresh")),1)]),_:1})]),_:1})]))}})})),Jt=g((()=>{})),Xt,_a=g((()=>{de(),de(),Jt(),K(),Xt=A(et,[["__scopeId","data-v-64269d74"]])})),pe,_e,fe,ve,me,he,we,ge,ye,Fe,ke,be,tt,Ce=g((()=>{M(),U(),L(),j(),Xe(),pe={class:"file-list"},_e={key:1,class:"file-list-items"},fe={class:"file-list-header"},ve={key:0,class:"sort-indicator"},me={key:0,class:"sort-indicator"},he={key:0,class:"sort-indicator"},we=["onDblclick","onContextmenu"],ge={class:"file-name"},ye={class:"file-icon"},Fe={class:"file-size"},ke={class:"file-date"},be={class:"file-actions"},tt=B({__name:"FileList",emits:["contextmenu-entry"],setup(i,{emit:s}){const{t}=P(),n=V(),a=z(),l=s;function r(d){if(d===0)return"—";const p=["B","KB","MB","GB"];let f=0,D=d;for(;D>=1024&&f<p.length-1;)D/=1024,f++;return`${D.toFixed(f===0?0:1)} ${p[f]}`}function c(d){return d?new Date(d).toLocaleString():"—"}function _(d){return d.isDir?"📁":{yaml:"⚙️",yml:"⚙️",json:"📋",toml:"⚙️",md:"📝",txt:"📄",log:"📄",py:"🐍",js:"📜",ts:"📜",vue:"💚",png:"🖼️",jpg:"🖼️",jpeg:"🖼️",gif:"🖼️",svg:"🖼️",webp:"🖼️",zip:"📦",gz:"📦",tar:"📦",sh:"⚡",bash:"⚡"}[d.name.split(".").pop()?.toLowerCase()||""]||"📄"}function u(d){d.isDir?a.navigateTo(d.path):G(d.name)?a.openEditor(d.path):(Q(d.name)||ee(d.name))&&a.openPreview(d)}function w(d,p){d.preventDefault(),l("contextmenu-entry",d,p)}async function S(d){try{await He(d.path,d.name)}catch(p){n.error(p.message||t("files.backendError"))}}return(d,p)=>(b(),$("div",pe,[F(e(gt),{show:e(a).loading},{default:h(()=>[!e(a).loading&&e(a).sortedEntries.length===0?(b(),N(e(pt),{key:0,description:e(t)("files.emptyDir")},null,8,["description"])):(b(),$("div",_e,[y("div",fe,[y("div",{class:"file-name sort-header",onClick:p[0]||(p[0]=f=>e(a).setSort("name"))},[x(m(e(t)("files.name"))+" ",1),e(a).sortBy==="name"?(b(),$("span",ve,m(e(a).sortOrder==="asc"?"↑":"↓"),1)):R("",!0)]),y("div",{class:"file-size sort-header",onClick:p[1]||(p[1]=f=>e(a).setSort("size"))},[x(m(e(t)("files.size"))+" ",1),e(a).sortBy==="size"?(b(),$("span",me,m(e(a).sortOrder==="asc"?"↑":"↓"),1)):R("",!0)]),y("div",{class:"file-date sort-header",onClick:p[2]||(p[2]=f=>e(a).setSort("modTime"))},[x(m(e(t)("files.modified"))+" ",1),e(a).sortBy==="modTime"?(b(),$("span",he,m(e(a).sortOrder==="asc"?"↑":"↓"),1)):R("",!0)]),p[3]||(p[3]=y("div",{class:"file-actions-placeholder"},null,-1))]),(b(!0),$(qe,null,Ae(e(a).sortedEntries,f=>(b(),$("div",{key:f.path,class:"file-list-row",onDblclick:D=>u(f),onContextmenu:D=>w(D,f)},[y("div",ge,[y("span",ye,m(_(f)),1),y("span",null,m(f.name),1)]),y("div",Fe,m(f.isDir?"—":r(f.size)),1),y("div",ke,m(c(f.modTime)),1),y("div",be,[e(G)(f.name)&&!f.isDir?(b(),N(e(E),{key:0,size:"tiny",quaternary:"",onClick:ae(D=>e(a).openEditor(f.path),["stop"]),title:e(t)("files.edit")},{default:h(()=>[...p[4]||(p[4]=[x("✏️",-1)])]),_:1},8,["onClick","title"])):R("",!0),f.isDir?R("",!0):(b(),N(e(E),{key:1,size:"tiny",quaternary:"",onClick:ae(D=>S(f),["stop"]),title:e(t)("files.download")},{default:h(()=>[...p[5]||(p[5]=[x("⬇️",-1)])]),_:1},8,["onClick","title"]))])],40,we))),128))]))]),_:1},8,["show"])]))}})})),Ht=g((()=>{})),Wt,fa=g((()=>{Ce(),Ce(),Ht(),K(),Wt=A(tt,[["__scopeId","data-v-ab2593c7"]])})),at,xe=g((()=>{M(),U(),L(),j(),Xe(),Mt(),at=B({__name:"FileContextMenu",emits:["rename"],setup(i,{expose:s,emit:t}){const{t:n}=P(),a=V(),l=Re(),r=z(),c=C(!1),_=C(0),u=C(0),w=C(null),S=t;function d(T,v){w.value=v,_.value=T.clientX,u.value=T.clientY,c.value=!1,Ft(()=>{c.value=!0})}function p(){const T=w.value;if(!T)return[];const v=[];return T.isDir?v.push({label:n("files.open"),key:"open"}):(G(T.name)&&v.push({label:n("files.edit"),key:"edit"}),(Q(T.name)||ee(T.name))&&v.push({label:n("files.preview"),key:"preview"}),v.push({label:n("files.download"),key:"download"})),v.push({type:"divider",key:"d1"}),v.push({label:n("files.copyPath"),key:"copyPath"}),v.push({label:n("files.rename"),key:"rename"}),v.push({type:"divider",key:"d2"}),v.push({label:n("files.delete"),key:"delete"}),v}async function f(T){c.value=!1;const v=w.value;if(v)switch(T){case"open":r.navigateTo(v.path);break;case"edit":try{await r.openEditor(v.path)}catch{a.error(n("files.backendError"))}break;case"preview":try{await r.openPreview(v)}catch{a.error(n("files.backendError"))}break;case"download":try{await He(v.path,v.name)}catch(W){a.error(W.message)}break;case"copyPath":await zt(v.path)?a.success(n("files.pathCopied")):a.error(n("files.pathCopied")+" ✗");break;case"rename":S("rename",v);break;case"delete":l.warning({title:n("files.delete"),content:v.isDir?n("files.confirmDeleteDir",{name:v.name}):n("files.confirmDelete",{name:v.name}),positiveText:n("common.delete"),negativeText:n("common.cancel"),onPositiveClick:async()=>{try{await r.deleteEntry(v),a.success(n("files.deleted"))}catch{a.error(n("files.deleteFailed"))}}});break}}function D(){c.value=!1}return s({show:d}),(T,v)=>(b(),N(e(bt),{show:c.value,x:_.value,y:u.value,options:p(),placement:"bottom-start",trigger:"manual",onSelect:f,onClickoutside:D},null,8,["show","x","y","options"]))}})})),Gt,va=g((()=>{xe(),xe(),Gt=at})),Se,$e,Te,it,Ee=g((()=>{M(),U(),L(),j(),Dt(),Se={class:"file-editor"},$e={class:"editor-header"},Te={class:"editor-filename"},it=B({__name:"FileEditor",setup(i){self.MonacoEnvironment={getWorker(w,S){return new Worker(new URL("/assets/editor.worker-DtO216D1.js",""+import.meta.url),{type:"module"})}};const{t:s}=P(),t=V(),n=Re(),a=z(),l=C(null);let r=null;const c=C(!1);Ke(()=>{!l.value||!a.editingFile||(r=$t.create(l.value,{value:a.editingFile.content,language:a.editingFile.language,theme:document.documentElement.classList.contains("dark")?"vs-dark":"vs",minimap:{enabled:!1},fontSize:13,lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on"}),r.onDidChangeModelContent(()=>{a.editingFile&&(a.editingFile.content=r.getValue())}),r.addCommand(Et.CtrlCmd|Tt.KeyS,()=>{_()}))}),yt(()=>{r?.dispose(),r=null});async function _(){c.value=!0;try{await a.saveEditor(),t.success(s("files.saved"))}catch{t.error(s("files.saveFailed"))}finally{c.value=!1}}function u(){a.hasUnsavedChanges?n.warning({title:s("files.unsavedChanges"),positiveText:s("common.ok"),negativeText:s("common.cancel"),onPositiveClick:()=>{a.closeEditor()}}):a.closeEditor()}return(w,S)=>(b(),$("div",Se,[y("div",$e,[y("span",Te,m(e(a).editingFile?.path),1),F(e(H),null,{default:h(()=>[F(e(E),{size:"small",type:"primary",loading:c.value,onClick:_},{default:h(()=>[x(m(e(s)("files.saveFile")),1)]),_:1},8,["loading"]),F(e(E),{size:"small",onClick:u},{default:h(()=>[x(m(e(s)("files.closeEditor")),1)]),_:1})]),_:1})]),y("div",{ref_key:"editorContainer",ref:l,class:"editor-container"},null,512)]))}})})),Yt=g((()=>{})),Zt,ma=g((()=>{Ee(),Ee(),Yt(),K(),Zt=A(it,[["__scopeId","data-v-1ae26b53"]])})),De,Me,ze,Be,Ue,Le,st,Pe=g((()=>{M(),U(),L(),j(),Y(),Bt(),De={key:0,class:"file-preview"},Me={class:"preview-header"},ze={class:"preview-filename"},Be={class:"preview-content"},Ue=["src","alt"],Le={key:1,class:"preview-markdown"},st=B({__name:"FilePreview",setup(i){const{t:s}=P(),t=z();function n(){return t.previewFile?Rt(t.previewFile.path):""}const a=()=>ie("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor"},[ie("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})]);return(l,r)=>e(t).previewFile?(b(),$("div",De,[y("div",Me,[y("span",ze,m(e(t).previewFile.path),1),F(e(E),{size:"small",quaternary:"",onClick:r[0]||(r[0]=c=>e(t).closePreview())},{icon:h(()=>[F(e(mt),null,{default:h(()=>[F(a)]),_:1})]),default:h(()=>[x(" "+m(e(s)("files.closePreview")),1)]),_:1})]),y("div",Be,[e(t).previewFile.type==="image"?(b(),$("img",{key:0,src:n(),class:"preview-image",alt:e(t).previewFile.path},null,8,Ue)):e(t).previewFile.type==="markdown"?(b(),$("div",Le,[F(Ut,{content:e(t).previewFile.content||""},null,8,["content"])])):R("",!0)])])):R("",!0)}})})),Qt=g((()=>{})),ea,ha=g((()=>{Pe(),Pe(),Qt(),K(),ea=A(st,[["__scopeId","data-v-a9f9eb37"]])})),je,lt,Ie=g((()=>{M(),U(),L(),j(),je={class:"upload-dragger"},lt=B({__name:"FileUploadModal",props:{show:{type:Boolean}},emits:["update:show"],setup(i,{emit:s}){const{t}=P(),n=V(),a=z(),l=i,r=s,c=C(!1),_=C([]);function u(d){_.value=d.fileList.map(p=>p.file).filter(p=>p!=null)}async function w(){if(_.value.length!==0){c.value=!0;try{await a.uploadFiles(_.value),n.success(t("files.uploadSuccess",{count:_.value.length})),_.value=[],r("update:show",!1)}catch(d){n.error(d.message||t("files.uploadFailed"))}finally{c.value=!1}}}function S(){_.value=[],r("update:show",!1)}return(d,p)=>(b(),N(e(Ne),{show:l.show,preset:"dialog",title:e(t)("files.upload"),"onUpdate:show":S,style:{width:"500px"}},{action:h(()=>[F(e(H),null,{default:h(()=>[F(e(E),{onClick:S},{default:h(()=>[x(m(e(t)("common.cancel")),1)]),_:1}),F(e(E),{type:"primary",loading:c.value,disabled:_.value.length===0,onClick:w},{default:h(()=>[x(m(e(t)("files.upload"))+" ("+m(_.value.length)+") ",1)]),_:1},8,["loading","disabled"])]),_:1})]),default:h(()=>[F(e(kt),{multiple:"","directory-dnd":"","default-upload":!1,onChange:u},{default:h(()=>[y("div",je,[y("p",null,m(e(t)("files.dragDropHint")),1)])]),_:1})]),_:1},8,["show","title"]))}})})),ta=g((()=>{})),aa,wa=g((()=>{Ie(),Ie(),ta(),K(),aa=A(lt,[["__scopeId","data-v-e54e68b1"]])})),nt,Oe=g((()=>{M(),U(),L(),j(),nt=B({__name:"FileRenameModal",props:{show:{type:Boolean},mode:{},entry:{}},emits:["update:show"],setup(i,{emit:s}){const{t}=P(),n=V(),a=z(),l=i,r=s,c=C(""),_=C(!1);vt(()=>l.show,d=>{d&&(l.mode==="rename"&&l.entry?c.value=l.entry.name:c.value="")});const u=J(()=>{switch(l.mode){case"newFile":return t("files.newFile");case"newFolder":return t("files.newFolder");case"rename":return t("files.rename")}}),w=J(()=>{switch(l.mode){case"newFile":return t("files.newFileName");case"newFolder":return t("files.newFolderName");case"rename":return t("files.renameTo")}});async function S(){if(c.value.trim()){_.value=!0;try{switch(l.mode){case"newFile":await a.createFile(c.value.trim()),n.success(t("files.created"));break;case"newFolder":await a.createDir(c.value.trim()),n.success(t("files.created"));break;case"rename":l.entry&&(await a.renameEntry(l.entry,c.value.trim()),n.success(t("files.renamed")));break}r("update:show",!1)}catch(d){const p=l.mode==="rename"?t("files.renameFailed"):t("files.createFailed");n.error(d.message||p)}finally{_.value=!1}}}return(d,p)=>(b(),N(e(Ne),{show:l.show,preset:"dialog",title:u.value,"onUpdate:show":p[2]||(p[2]=f=>r("update:show",!1)),style:{width:"400px"}},{action:h(()=>[F(e(H),null,{default:h(()=>[F(e(E),{onClick:p[1]||(p[1]=f=>r("update:show",!1))},{default:h(()=>[x(m(e(t)("common.cancel")),1)]),_:1}),F(e(E),{type:"primary",loading:_.value,disabled:!c.value.trim(),onClick:S},{default:h(()=>[x(m(e(t)("common.ok")),1)]),_:1},8,["loading","disabled"])]),_:1})]),default:h(()=>[F(e(ft),{value:c.value,"onUpdate:value":p[0]||(p[0]=f=>c.value=f),placeholder:w.value,onKeydown:ht(S,["enter"]),autofocus:""},null,8,["value","placeholder"])]),_:1},8,["show","title"]))}})})),ia,ga=g((()=>{Oe(),Oe(),ia=nt}));export{Kt as _,ea as a,z as b,ma as c,Wt as d,fa as f,pa as g,Vt as h,wa as i,Gt as l,_a as m,ga as n,ha as o,Xt as p,aa as r,Zt as s,ia as t,va as u,da as v,j as y};
|
|
1
|
+
import{n as g}from"./rolldown-runtime-BKwlnUi0.js";import{C as Re,F as E,H as pt,I as te,L as _t,Nt as C,R as ft,Rt as e,S as Ne,St as vt,T as mt,U as M,Vt as m,X as ae,Y as ht,Z as qe,_t as b,a as wt,ct as B,et as J,h as H,ht as Ke,it as $,l as gt,mt as yt,nt as N,ot as x,pt as Ft,r as kt,rt as R,st as F,t as U,tt as y,ut as ie,w as bt,wt as h,y as V,yt as Ae}from"./ui-vendor-CsTMg6zH.js";import{d as Ct,n as L,r as P,u as xt}from"./vue-vendor-D8zSB7VM.js";import{a as Ve,c as St,l as q,n as K,o as Je,t as A}from"./_plugin-vue_export-helper-CrLlP_D3.js";import{An as $t,On as Tt,kn as Et,t as Dt}from"./monaco-editor-EDqig1FP.js";import{n as Mt,t as zt}from"./clipboard-BqPv71We.js";import{c as Xe,n as Bt,s as He,t as Ut}from"./MarkdownRenderer-BCFoS7DH.js";async function We(i=""){const s=new URLSearchParams;i&&s.set("path",i);const t=s.toString();return q(`/api/hermes/files/list${t?`?${t}`:""}`)}async function se(i){return q(`/api/hermes/files/read?path=${encodeURIComponent(i)}`)}async function le(i,s){await q("/api/hermes/files/write",{method:"PUT",body:JSON.stringify({path:i,content:s})})}async function Lt(i,s=!1){await q("/api/hermes/files/delete",{method:"DELETE",body:JSON.stringify({path:i,recursive:s})})}async function Pt(i,s){await q("/api/hermes/files/rename",{method:"POST",body:JSON.stringify({oldPath:i,newPath:s})})}async function jt(i){await q("/api/hermes/files/mkdir",{method:"POST",body:JSON.stringify({path:i})})}async function It(i,s){await q("/api/hermes/files/copy",{method:"POST",body:JSON.stringify({srcPath:i,destPath:s})})}async function Ot(i,s){const t=Je(),n=new FormData;for(const w of s)n.append("file",w);const a=new URLSearchParams;i&&a.set("path",i);const l=a.toString(),r=`${t}/api/hermes/files/upload${l?`?${l}`:""}`,c={},_=Ve();_&&(c.Authorization=`Bearer ${_}`);const u=await fetch(r,{method:"POST",headers:c,body:n});if(!u.ok){const w=await u.json().catch(()=>({error:`HTTP ${u.status}`}));throw new Error(w.error||`Upload failed: ${u.status}`)}return(await u.json()).files}function Rt(i,s){const t=Je(),n=new URLSearchParams({path:i});s&&n.set("name",s);const a=Ve();return a&&n.set("token",a),`${t}/api/hermes/download?${n.toString()}`}var Y=g((()=>{St()}));function Nt(i){const s=i.split("/").pop()||"";return s==="Dockerfile"?"dockerfile":s==="Makefile"?"makefile":Ge["."+s.split(".").pop()?.toLowerCase()]||"plaintext"}function Z(i){const s=i.lastIndexOf(".");return s>=0?i.slice(s).toLowerCase():""}function Q(i){return Ye.has(Z(i))}function ee(i){const s=Z(i);return s===".md"||s===".markdown"}function G(i){return!new Set([".png",".jpg",".jpeg",".gif",".webp",".bmp",".ico",".zip",".gz",".tar",".7z",".rar",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".mp3",".mp4",".wav",".webm",".avi",".mov",".exe",".dll",".so",".dylib",".bin",".dat",".db",".sqlite"]).has(Z(i))}function X(i,s,t){return!!(i===s||t&&i.startsWith(s+"/"))}var Ge,Ye,z,j=g((()=>{Ct(),M(),Y(),Ge={".js":"javascript",".jsx":"javascript",".ts":"typescript",".tsx":"typescript",".json":"json",".jsonc":"json",".html":"html",".htm":"html",".css":"css",".scss":"scss",".less":"less",".md":"markdown",".markdown":"markdown",".py":"python",".yaml":"yaml",".yml":"yaml",".xml":"xml",".sh":"shell",".bash":"shell",".zsh":"shell",".sql":"sql",".go":"go",".rs":"rust",".java":"java",".c":"c",".h":"c",".cpp":"cpp",".hpp":"cpp",".toml":"ini",".ini":"ini",".env":"ini",".vue":"html",".dockerfile":"dockerfile",".graphql":"graphql",".lua":"lua",".r":"r",".rb":"ruby",".php":"php",".swift":"swift",".kt":"kotlin"},Ye=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".bmp",".ico"]),z=xt("files",()=>{const i=C(""),s=C([]),t=C(!1),n=C("name"),a=C("asc"),l=C(null),r=C(null),c=J(()=>i.value?i.value.split("/").filter(Boolean):[]),_=J(()=>{const o=[...s.value];return o.sort((k,I)=>{if(k.isDir!==I.isDir)return k.isDir?-1:1;let O=0;switch(n.value){case"name":O=k.name.localeCompare(I.name);break;case"size":O=k.size-I.size;break;case"modTime":O=k.modTime.localeCompare(I.modTime);break}return a.value==="asc"?O:-O}),o});async function u(o){o!==void 0&&o!==i.value&&(r.value=null),o!==void 0&&(i.value=o),t.value=!0;try{s.value=(await We(i.value)).entries}catch(k){throw console.error("Failed to fetch files:",k),k}finally{t.value=!1}}function w(o){return u(o)}function S(){const o=i.value.split("/").filter(Boolean);return o.pop(),u(o.join("/"))}async function d(o){const k=await se(o);l.value={path:o,content:k.content,originalContent:k.content,language:Nt(o)}}async function p(){l.value&&(await le(l.value.path,l.value.content),l.value.originalContent=l.value.content)}function f(){l.value=null}async function D(o){if(Q(o.name))r.value={path:o.path,type:"image"};else if(ee(o.name)){const k=await se(o.path);r.value={path:o.path,type:"markdown",content:k.content}}}function T(){r.value=null}async function v(o){const k=i.value?`${i.value}/${o}`:o;await jt(k),await u()}async function W(o){const k=i.value?`${i.value}/${o}`:o;await le(k,""),await u()}async function ot(o){await Lt(o.path,o.isDir),r.value&&X(r.value.path,o.path,o.isDir)&&(r.value=null),l.value&&X(l.value.path,o.path,o.isDir)&&(l.value=null),await u()}async function rt(o,k){const I=o.path.includes("/")?o.path.slice(0,o.path.lastIndexOf("/")):"",O=I?`${I}/${k}`:k;await Pt(o.path,O),r.value&&X(r.value.path,o.path,o.isDir)&&(r.value=null),l.value&&X(l.value.path,o.path,o.isDir)&&(l.value=null),await u()}async function ut(o,k){await It(o.path,k),await u()}async function ct(o){await Ot(i.value,o),await u()}function dt(o){n.value===o?a.value=a.value==="asc"?"desc":"asc":(n.value=o,a.value="asc")}return{currentPath:i,entries:s,loading:t,sortBy:n,sortOrder:a,editingFile:l,previewFile:r,pathSegments:c,sortedEntries:_,hasUnsavedChanges:J(()=>l.value?l.value.content!==l.value.originalContent:!1),fetchEntries:u,navigateTo:w,navigateUp:S,openEditor:d,saveEditor:p,closeEditor:f,openPreview:D,closePreview:T,createDir:v,createFile:W,deleteEntry:ot,renameEntry:rt,copyEntry:ut,uploadFiles:ct,setSort:dt}})})),ne,Ze,oe=g((()=>{M(),U(),L(),j(),Y(),ne={class:"file-tree"},Ze=B({__name:"FileTree",setup(i){const{t:s}=P(),t=z(),n=C([]),a=C([]);async function l(u){try{return(await We(u)).entries.filter(w=>w.isDir).sort((w,S)=>w.name.localeCompare(S.name)).map(w=>({key:w.path,label:w.name,isLeaf:!1}))}catch{return[]}}async function r(u){u.children=await l(u.key)}function c(u){u.length>0&&(a.value=u,t.navigateTo(u[0]))}function _(){a.value=[],t.navigateTo("")}return Ke(async()=>{n.value=await l("")}),(u,w)=>(b(),$("div",ne,[y("div",{class:"tree-header",onClick:_},[w[0]||(w[0]=y("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},[y("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),y("polyline",{points:"9 22 9 12 15 12 15 22"})],-1)),y("span",null,m(e(s)("files.breadcrumbRoot")),1)]),F(e(wt),{data:n.value,"selected-keys":a.value,"on-load":r,"expand-on-click":"","block-line":"","onUpdate:selectedKeys":c},null,8,["data","selected-keys"])]))}})})),qt=g((()=>{})),Kt,da=g((()=>{oe(),oe(),qt(),K(),Kt=A(Ze,[["__scopeId","data-v-7f00b3bc"]])})),re,Qe,ue=g((()=>{M(),L(),U(),j(),re={class:"file-breadcrumb"},Qe=B({__name:"FileBreadcrumb",setup(i){const{t:s}=P(),t=z();function n(a){if(a<0)t.navigateTo("");else{const l=t.pathSegments.slice(0,a+1).join("/");t.navigateTo(l)}}return(a,l)=>(b(),$("div",re,[F(e(_t),null,{default:h(()=>[F(e(te),{onClick:l[0]||(l[0]=r=>n(-1))},{default:h(()=>[x(m(e(s)("files.breadcrumbRoot")),1)]),_:1}),(b(!0),$(qe,null,Ae(e(t).pathSegments,(r,c)=>(b(),N(e(te),{key:c,onClick:_=>n(c)},{default:h(()=>[x(m(r),1)]),_:2},1032,["onClick"]))),128))]),_:1})]))}})})),At=g((()=>{})),Vt,pa=g((()=>{ue(),ue(),At(),K(),Vt=A(Qe,[["__scopeId","data-v-061302de"]])})),ce,et,de=g((()=>{M(),U(),L(),j(),ce={class:"file-toolbar"},et=B({__name:"FileToolbar",emits:["showNewFile","showNewFolder","showUpload"],setup(i,{emit:s}){const{t}=P(),n=V(),a=z(),l=s;async function r(){try{await a.fetchEntries()}catch{n.error(t("files.backendError"))}}return(c,_)=>(b(),$("div",ce,[F(e(H),{size:8,wrap:!0,class:"toolbar-space"},{default:h(()=>[F(e(E),{size:"small",onClick:_[0]||(_[0]=u=>l("showNewFile")),class:"toolbar-btn"},{default:h(()=>[x(m(e(t)("files.newFile")),1)]),_:1}),F(e(E),{size:"small",onClick:_[1]||(_[1]=u=>l("showNewFolder")),class:"toolbar-btn"},{default:h(()=>[x(m(e(t)("files.newFolder")),1)]),_:1}),F(e(E),{size:"small",onClick:_[2]||(_[2]=u=>l("showUpload")),class:"toolbar-btn"},{default:h(()=>[x(m(e(t)("files.upload")),1)]),_:1}),F(e(E),{size:"small",onClick:r,class:"toolbar-btn"},{default:h(()=>[x(m(e(t)("files.refresh")),1)]),_:1})]),_:1})]))}})})),Jt=g((()=>{})),Xt,_a=g((()=>{de(),de(),Jt(),K(),Xt=A(et,[["__scopeId","data-v-64269d74"]])})),pe,_e,fe,ve,me,he,we,ge,ye,Fe,ke,be,tt,Ce=g((()=>{M(),U(),L(),j(),Xe(),pe={class:"file-list"},_e={key:1,class:"file-list-items"},fe={class:"file-list-header"},ve={key:0,class:"sort-indicator"},me={key:0,class:"sort-indicator"},he={key:0,class:"sort-indicator"},we=["onDblclick","onContextmenu"],ge={class:"file-name"},ye={class:"file-icon"},Fe={class:"file-size"},ke={class:"file-date"},be={class:"file-actions"},tt=B({__name:"FileList",emits:["contextmenu-entry"],setup(i,{emit:s}){const{t}=P(),n=V(),a=z(),l=s;function r(d){if(d===0)return"—";const p=["B","KB","MB","GB"];let f=0,D=d;for(;D>=1024&&f<p.length-1;)D/=1024,f++;return`${D.toFixed(f===0?0:1)} ${p[f]}`}function c(d){return d?new Date(d).toLocaleString():"—"}function _(d){return d.isDir?"📁":{yaml:"⚙️",yml:"⚙️",json:"📋",toml:"⚙️",md:"📝",txt:"📄",log:"📄",py:"🐍",js:"📜",ts:"📜",vue:"💚",png:"🖼️",jpg:"🖼️",jpeg:"🖼️",gif:"🖼️",svg:"🖼️",webp:"🖼️",zip:"📦",gz:"📦",tar:"📦",sh:"⚡",bash:"⚡"}[d.name.split(".").pop()?.toLowerCase()||""]||"📄"}function u(d){d.isDir?a.navigateTo(d.path):G(d.name)?a.openEditor(d.path):(Q(d.name)||ee(d.name))&&a.openPreview(d)}function w(d,p){d.preventDefault(),l("contextmenu-entry",d,p)}async function S(d){try{await He(d.path,d.name)}catch(p){n.error(p.message||t("files.backendError"))}}return(d,p)=>(b(),$("div",pe,[F(e(gt),{show:e(a).loading},{default:h(()=>[!e(a).loading&&e(a).sortedEntries.length===0?(b(),N(e(pt),{key:0,description:e(t)("files.emptyDir")},null,8,["description"])):(b(),$("div",_e,[y("div",fe,[y("div",{class:"file-name sort-header",onClick:p[0]||(p[0]=f=>e(a).setSort("name"))},[x(m(e(t)("files.name"))+" ",1),e(a).sortBy==="name"?(b(),$("span",ve,m(e(a).sortOrder==="asc"?"↑":"↓"),1)):R("",!0)]),y("div",{class:"file-size sort-header",onClick:p[1]||(p[1]=f=>e(a).setSort("size"))},[x(m(e(t)("files.size"))+" ",1),e(a).sortBy==="size"?(b(),$("span",me,m(e(a).sortOrder==="asc"?"↑":"↓"),1)):R("",!0)]),y("div",{class:"file-date sort-header",onClick:p[2]||(p[2]=f=>e(a).setSort("modTime"))},[x(m(e(t)("files.modified"))+" ",1),e(a).sortBy==="modTime"?(b(),$("span",he,m(e(a).sortOrder==="asc"?"↑":"↓"),1)):R("",!0)]),p[3]||(p[3]=y("div",{class:"file-actions-placeholder"},null,-1))]),(b(!0),$(qe,null,Ae(e(a).sortedEntries,f=>(b(),$("div",{key:f.path,class:"file-list-row",onDblclick:D=>u(f),onContextmenu:D=>w(D,f)},[y("div",ge,[y("span",ye,m(_(f)),1),y("span",null,m(f.name),1)]),y("div",Fe,m(f.isDir?"—":r(f.size)),1),y("div",ke,m(c(f.modTime)),1),y("div",be,[e(G)(f.name)&&!f.isDir?(b(),N(e(E),{key:0,size:"tiny",quaternary:"",onClick:ae(D=>e(a).openEditor(f.path),["stop"]),title:e(t)("files.edit")},{default:h(()=>[...p[4]||(p[4]=[x("✏️",-1)])]),_:1},8,["onClick","title"])):R("",!0),f.isDir?R("",!0):(b(),N(e(E),{key:1,size:"tiny",quaternary:"",onClick:ae(D=>S(f),["stop"]),title:e(t)("files.download")},{default:h(()=>[...p[5]||(p[5]=[x("⬇️",-1)])]),_:1},8,["onClick","title"]))])],40,we))),128))]))]),_:1},8,["show"])]))}})})),Ht=g((()=>{})),Wt,fa=g((()=>{Ce(),Ce(),Ht(),K(),Wt=A(tt,[["__scopeId","data-v-ab2593c7"]])})),at,xe=g((()=>{M(),U(),L(),j(),Xe(),Mt(),at=B({__name:"FileContextMenu",emits:["rename"],setup(i,{expose:s,emit:t}){const{t:n}=P(),a=V(),l=Re(),r=z(),c=C(!1),_=C(0),u=C(0),w=C(null),S=t;function d(T,v){w.value=v,_.value=T.clientX,u.value=T.clientY,c.value=!1,Ft(()=>{c.value=!0})}function p(){const T=w.value;if(!T)return[];const v=[];return T.isDir?v.push({label:n("files.open"),key:"open"}):(G(T.name)&&v.push({label:n("files.edit"),key:"edit"}),(Q(T.name)||ee(T.name))&&v.push({label:n("files.preview"),key:"preview"}),v.push({label:n("files.download"),key:"download"})),v.push({type:"divider",key:"d1"}),v.push({label:n("files.copyPath"),key:"copyPath"}),v.push({label:n("files.rename"),key:"rename"}),v.push({type:"divider",key:"d2"}),v.push({label:n("files.delete"),key:"delete"}),v}async function f(T){c.value=!1;const v=w.value;if(v)switch(T){case"open":r.navigateTo(v.path);break;case"edit":try{await r.openEditor(v.path)}catch{a.error(n("files.backendError"))}break;case"preview":try{await r.openPreview(v)}catch{a.error(n("files.backendError"))}break;case"download":try{await He(v.path,v.name)}catch(W){a.error(W.message)}break;case"copyPath":await zt(v.path)?a.success(n("files.pathCopied")):a.error(n("files.pathCopied")+" ✗");break;case"rename":S("rename",v);break;case"delete":l.warning({title:n("files.delete"),content:v.isDir?n("files.confirmDeleteDir",{name:v.name}):n("files.confirmDelete",{name:v.name}),positiveText:n("common.delete"),negativeText:n("common.cancel"),onPositiveClick:async()=>{try{await r.deleteEntry(v),a.success(n("files.deleted"))}catch{a.error(n("files.deleteFailed"))}}});break}}function D(){c.value=!1}return s({show:d}),(T,v)=>(b(),N(e(bt),{show:c.value,x:_.value,y:u.value,options:p(),placement:"bottom-start",trigger:"manual",onSelect:f,onClickoutside:D},null,8,["show","x","y","options"]))}})})),Gt,va=g((()=>{xe(),xe(),Gt=at})),Se,$e,Te,it,Ee=g((()=>{M(),U(),L(),j(),Dt(),Se={class:"file-editor"},$e={class:"editor-header"},Te={class:"editor-filename"},it=B({__name:"FileEditor",setup(i){self.MonacoEnvironment={getWorker(w,S){return new Worker(new URL("/assets/editor.worker-DtO216D1.js",""+import.meta.url),{type:"module"})}};const{t:s}=P(),t=V(),n=Re(),a=z(),l=C(null);let r=null;const c=C(!1);Ke(()=>{!l.value||!a.editingFile||(r=$t.create(l.value,{value:a.editingFile.content,language:a.editingFile.language,theme:document.documentElement.classList.contains("dark")?"vs-dark":"vs",minimap:{enabled:!1},fontSize:13,lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on"}),r.onDidChangeModelContent(()=>{a.editingFile&&(a.editingFile.content=r.getValue())}),r.addCommand(Et.CtrlCmd|Tt.KeyS,()=>{_()}))}),yt(()=>{r?.dispose(),r=null});async function _(){c.value=!0;try{await a.saveEditor(),t.success(s("files.saved"))}catch{t.error(s("files.saveFailed"))}finally{c.value=!1}}function u(){a.hasUnsavedChanges?n.warning({title:s("files.unsavedChanges"),positiveText:s("common.ok"),negativeText:s("common.cancel"),onPositiveClick:()=>{a.closeEditor()}}):a.closeEditor()}return(w,S)=>(b(),$("div",Se,[y("div",$e,[y("span",Te,m(e(a).editingFile?.path),1),F(e(H),null,{default:h(()=>[F(e(E),{size:"small",type:"primary",loading:c.value,onClick:_},{default:h(()=>[x(m(e(s)("files.saveFile")),1)]),_:1},8,["loading"]),F(e(E),{size:"small",onClick:u},{default:h(()=>[x(m(e(s)("files.closeEditor")),1)]),_:1})]),_:1})]),y("div",{ref_key:"editorContainer",ref:l,class:"editor-container"},null,512)]))}})})),Yt=g((()=>{})),Zt,ma=g((()=>{Ee(),Ee(),Yt(),K(),Zt=A(it,[["__scopeId","data-v-1ae26b53"]])})),De,Me,ze,Be,Ue,Le,st,Pe=g((()=>{M(),U(),L(),j(),Y(),Bt(),De={key:0,class:"file-preview"},Me={class:"preview-header"},ze={class:"preview-filename"},Be={class:"preview-content"},Ue=["src","alt"],Le={key:1,class:"preview-markdown"},st=B({__name:"FilePreview",setup(i){const{t:s}=P(),t=z();function n(){return t.previewFile?Rt(t.previewFile.path):""}const a=()=>ie("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor"},[ie("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})]);return(l,r)=>e(t).previewFile?(b(),$("div",De,[y("div",Me,[y("span",ze,m(e(t).previewFile.path),1),F(e(E),{size:"small",quaternary:"",onClick:r[0]||(r[0]=c=>e(t).closePreview())},{icon:h(()=>[F(e(mt),null,{default:h(()=>[F(a)]),_:1})]),default:h(()=>[x(" "+m(e(s)("files.closePreview")),1)]),_:1})]),y("div",Be,[e(t).previewFile.type==="image"?(b(),$("img",{key:0,src:n(),class:"preview-image",alt:e(t).previewFile.path},null,8,Ue)):e(t).previewFile.type==="markdown"?(b(),$("div",Le,[F(Ut,{content:e(t).previewFile.content||""},null,8,["content"])])):R("",!0)])])):R("",!0)}})})),Qt=g((()=>{})),ea,ha=g((()=>{Pe(),Pe(),Qt(),K(),ea=A(st,[["__scopeId","data-v-a9f9eb37"]])})),je,lt,Ie=g((()=>{M(),U(),L(),j(),je={class:"upload-dragger"},lt=B({__name:"FileUploadModal",props:{show:{type:Boolean}},emits:["update:show"],setup(i,{emit:s}){const{t}=P(),n=V(),a=z(),l=i,r=s,c=C(!1),_=C([]);function u(d){_.value=d.fileList.map(p=>p.file).filter(p=>p!=null)}async function w(){if(_.value.length!==0){c.value=!0;try{await a.uploadFiles(_.value),n.success(t("files.uploadSuccess",{count:_.value.length})),_.value=[],r("update:show",!1)}catch(d){n.error(d.message||t("files.uploadFailed"))}finally{c.value=!1}}}function S(){_.value=[],r("update:show",!1)}return(d,p)=>(b(),N(e(Ne),{show:l.show,preset:"dialog",title:e(t)("files.upload"),"onUpdate:show":S,style:{width:"500px"}},{action:h(()=>[F(e(H),null,{default:h(()=>[F(e(E),{onClick:S},{default:h(()=>[x(m(e(t)("common.cancel")),1)]),_:1}),F(e(E),{type:"primary",loading:c.value,disabled:_.value.length===0,onClick:w},{default:h(()=>[x(m(e(t)("files.upload"))+" ("+m(_.value.length)+") ",1)]),_:1},8,["loading","disabled"])]),_:1})]),default:h(()=>[F(e(kt),{multiple:"","directory-dnd":"","default-upload":!1,onChange:u},{default:h(()=>[y("div",je,[y("p",null,m(e(t)("files.dragDropHint")),1)])]),_:1})]),_:1},8,["show","title"]))}})})),ta=g((()=>{})),aa,wa=g((()=>{Ie(),Ie(),ta(),K(),aa=A(lt,[["__scopeId","data-v-e54e68b1"]])})),nt,Oe=g((()=>{M(),U(),L(),j(),nt=B({__name:"FileRenameModal",props:{show:{type:Boolean},mode:{},entry:{}},emits:["update:show"],setup(i,{emit:s}){const{t}=P(),n=V(),a=z(),l=i,r=s,c=C(""),_=C(!1);vt(()=>l.show,d=>{d&&(l.mode==="rename"&&l.entry?c.value=l.entry.name:c.value="")});const u=J(()=>{switch(l.mode){case"newFile":return t("files.newFile");case"newFolder":return t("files.newFolder");case"rename":return t("files.rename")}}),w=J(()=>{switch(l.mode){case"newFile":return t("files.newFileName");case"newFolder":return t("files.newFolderName");case"rename":return t("files.renameTo")}});async function S(){if(c.value.trim()){_.value=!0;try{switch(l.mode){case"newFile":await a.createFile(c.value.trim()),n.success(t("files.created"));break;case"newFolder":await a.createDir(c.value.trim()),n.success(t("files.created"));break;case"rename":l.entry&&(await a.renameEntry(l.entry,c.value.trim()),n.success(t("files.renamed")));break}r("update:show",!1)}catch(d){const p=l.mode==="rename"?t("files.renameFailed"):t("files.createFailed");n.error(d.message||p)}finally{_.value=!1}}}return(d,p)=>(b(),N(e(Ne),{show:l.show,preset:"dialog",title:u.value,"onUpdate:show":p[2]||(p[2]=f=>r("update:show",!1)),style:{width:"400px"}},{action:h(()=>[F(e(H),null,{default:h(()=>[F(e(E),{onClick:p[1]||(p[1]=f=>r("update:show",!1))},{default:h(()=>[x(m(e(t)("common.cancel")),1)]),_:1}),F(e(E),{type:"primary",loading:_.value,disabled:!c.value.trim(),onClick:S},{default:h(()=>[x(m(e(t)("common.ok")),1)]),_:1},8,["loading","disabled"])]),_:1})]),default:h(()=>[F(e(ft),{value:c.value,"onUpdate:value":p[0]||(p[0]=f=>c.value=f),placeholder:w.value,onKeydown:ht(S,["enter"]),autofocus:""},null,8,["value","placeholder"])]),_:1},8,["show","title"]))}})})),ia,ga=g((()=>{Oe(),Oe(),ia=nt}));export{Kt as _,ea as a,z as b,ma as c,Wt as d,fa as f,pa as g,Vt as h,wa as i,Gt as l,_a as m,ga as n,ha as o,Xt as p,aa as r,Zt as s,ia as t,va as u,da as v,j as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as f}from"./rolldown-runtime-BKwlnUi0.js";import{Nt as a,Rt as F,U as k,_t as u,ct as N,ht as S,it as U,nt as d,st as l,tt as v}from"./ui-vendor-CsTMg6zH.js";import{n as b,t as B}from"./_plugin-vue_export-helper-
|
|
1
|
+
import{n as f}from"./rolldown-runtime-BKwlnUi0.js";import{Nt as a,Rt as F,U as k,_t as u,ct as N,ht as S,it as U,nt as d,st as l,tt as v}from"./ui-vendor-CsTMg6zH.js";import{n as b,t as B}from"./_plugin-vue_export-helper-CrLlP_D3.js";import{_ as E,a as C,b as T,c as L,d as P,f as I,g as $,h as j,i as q,l as z,m as A,n as D,o as G,p as H,r as J,s as K,t as O,u as Q,v as W,y as X}from"./FileRenameModal-DS3tMLmA.js";var w,m,c,h,M,y=f((()=>{k(),X(),W(),$(),A(),I(),Q(),L(),G(),q(),D(),w={class:"files-view"},m={class:"files-tree-panel"},c={class:"files-main-panel"},h={class:"files-content"},M=N({__name:"FilesView",setup(le){const _=T(),p=a(null),r=a(!1),t=a(!1),i=a("newFile"),n=a(null);function x(s,e){p.value?.show(s,e)}function R(){i.value="newFile",n.value=null,t.value=!0}function V(){i.value="newFolder",n.value=null,t.value=!0}function g(s){i.value="rename",n.value=s,t.value=!0}return S(()=>{_.fetchEntries("")}),(s,e)=>(u(),U("div",w,[v("div",m,[l(E)]),v("div",c,[l(H,{onShowNewFile:R,onShowNewFolder:V,onShowUpload:e[0]||(e[0]=o=>r.value=!0)}),l(j),v("div",h,[F(_).editingFile?(u(),d(K,{key:0})):F(_).previewFile?(u(),d(C,{key:1})):(u(),d(P,{key:2,onContextmenuEntry:x}))])]),l(z,{ref_key:"contextMenuRef",ref:p,onRename:g},null,512),l(J,{show:r.value,"onUpdate:show":e[1]||(e[1]=o=>r.value=o)},null,8,["show"]),l(O,{show:t.value,"onUpdate:show":e[2]||(e[2]=o=>t.value=o),mode:i.value,entry:n.value},null,8,["show","mode","entry"])]))}})})),Y=f((()=>{})),Z,ee=f((()=>{y(),y(),Y(),b(),Z=B(M,[["__scopeId","data-v-4513759a"]])}));ee();export{Z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as d}from"./rolldown-runtime-BKwlnUi0.js";import{B as q,F as E,Nt as h,Rt as s,U as A,Vt as n,Z as L,_t as l,ct as R,ht as U,it as c,l as Z,ot as w,rt as m,st as p,t as H,tt as o,wt as f,y as J,yt as K}from"./ui-vendor-CsTMg6zH.js";import{d as Q,n as W,r as X,u as Y}from"./vue-vendor-D8zSB7VM.js";import{c as aa,l as g,n as ea,t as ta}from"./_plugin-vue_export-helper-
|
|
1
|
+
import{n as d}from"./rolldown-runtime-BKwlnUi0.js";import{B as q,F as E,Nt as h,Rt as s,U as A,Vt as n,Z as L,_t as l,ct as R,ht as U,it as c,l as Z,ot as w,rt as m,st as p,t as H,tt as o,wt as f,y as J,yt as K}from"./ui-vendor-CsTMg6zH.js";import{d as Q,n as W,r as X,u as Y}from"./vue-vendor-D8zSB7VM.js";import{c as aa,l as g,n as ea,t as ta}from"./_plugin-vue_export-helper-CrLlP_D3.js";async function sa(){return(await g("/api/hermes/gateways")).gateways}async function ia(i){return(await g(`/api/hermes/gateways/${i}/start`,{method:"POST"})).gateway}async function na(i){await g(`/api/hermes/gateways/${i}/stop`,{method:"POST"})}var oa=d((()=>{aa()})),F,ra=d((()=>{Q(),A(),oa(),F=Y("gateways",()=>{const i=h([]),e=h(!1);async function u(){e.value=!0;try{const t=await sa();i.value=Array.isArray(t)?t:Object.values(t||{})}finally{e.value=!1}}async function _(t){e.value=!0;try{const r=await ia(t),a=i.value.findIndex(v=>v.profile===t);a>=0?i.value[a]=r:i.value.push(r)}finally{e.value=!1}}async function y(t){e.value=!0;try{await na(t);const r=i.value.find(a=>a.profile===t);r&&(r.running=!1,r.pid=void 0)}finally{e.value=!1}}return{gateways:i,loading:e,fetchStatus:u,start:_,stop:y}})})),V,G,k,x,S,$,C,B,I,N,T,b,D,P,z,M,j,O=d((()=>{A(),H(),W(),ra(),V={class:"gateways-view"},G={class:"page-header"},k={class:"header-title"},x={class:"gateways-content"},S={key:0,class:"empty-state"},$={key:1,class:"gateway-list"},C={class:"gateway-info"},B={class:"gateway-name"},I={class:"gateway-meta"},N={class:"meta-item"},T={key:0,class:"meta-item"},b={key:0,class:"gateway-diagnostics"},D={class:"diag-item"},P={class:"diag-item"},z={class:"diag-item"},M={class:"gateway-actions"},j=R({__name:"GatewaysView",setup(i){const{t:e}=X(),u=J(),_=F();U(()=>{_.fetchStatus()});async function y(t,r){try{r?(await _.stop(t),u.success(`${e("gateways.stopped")}: ${t}`)):(await _.start(t),u.success(`${e("gateways.started")}: ${t}`))}catch(a){u.error(a.message)}}return(t,r)=>(l(),c("div",V,[o("header",G,[o("h2",k,n(s(e)("gateways.title")),1)]),o("div",x,[p(s(Z),{show:s(_).loading,size:"large"},{default:f(()=>[s(_).gateways.length===0?(l(),c("div",S,n(s(e)("common.noData")),1)):(l(),c("div",$,[(l(!0),c(L,null,K(s(_).gateways,a=>(l(),c("div",{key:a.profile,class:"gateway-card"},[o("div",C,[o("div",B,n(a.profile),1),o("div",I,[o("span",N,n(a.host)+":"+n(a.port),1),a.pid?(l(),c("span",T,"PID: "+n(a.pid),1)):m("",!0)]),a.diagnostics?(l(),c("div",b,[o("span",D,n(a.diagnostics.reason),1),o("span",P,"PID: "+n(a.diagnostics.pid_path),1),o("span",z,"Config: "+n(a.diagnostics.config_path),1)])):m("",!0)]),o("div",M,[p(s(q),{type:a.running?"success":"default",size:"small",round:""},{default:f(()=>[w(n(a.running?s(e)("gateways.running"):s(e)("gateways.stopped")),1)]),_:2},1032,["type"]),p(s(E),{size:"small",type:a.running?"warning":"primary",round:"",onClick:v=>y(a.profile,a.running)},{default:f(()=>[w(n(a.running?s(e)("common.stop"):s(e)("common.start")),1)]),_:2},1032,["type","onClick"])])]))),128))]))]),_:1},8,["show"])])]))}})})),_a=d((()=>{})),la,ca=d((()=>{O(),O(),_a(),ea(),la=ta(j,[["__scopeId","data-v-ae0348cb"]])}));ca();export{la as default};
|