hermes-web-ui 0.6.0-beta.2 → 0.6.0
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-9bNGmPOL.js → ChannelsView-CvORJMzg.js} +1 -1
- package/dist/client/assets/js/{ChatView-CrMN1j5u.js → ChatView-DihfBNUf.js} +1 -1
- package/dist/client/assets/js/{FileRenameModal-C4oWOgjw.js → FileRenameModal-DN-U6DZT.js} +1 -1
- package/dist/client/assets/js/{FilesView-pDP8mSTZ.js → FilesView-BxW5kOlO.js} +1 -1
- package/dist/client/assets/js/{GroupChatView-BV3Dxn4i.js → GroupChatView-Cdyg0EOz.js} +1 -1
- package/dist/client/assets/js/{HistoryMessageList-CHk-rOIr.js → HistoryMessageList-S77rD1zj.js} +1 -1
- package/dist/client/assets/js/{HistoryView-RE-m9Yx6.js → HistoryView-DM7qDtZb.js} +1 -1
- package/dist/client/assets/js/{JobsView-BkXCTE4b.js → JobsView-BqylpVBm.js} +1 -1
- package/dist/client/assets/js/{KanbanView-Bwlm-lFI.js → KanbanView-C8uXrTRt.js} +1 -1
- package/dist/client/assets/js/{LoginView-Cil7q9fA.js → LoginView-ISxozFfh.js} +1 -1
- package/dist/client/assets/js/{LogsView-BRXZpNpB.js → LogsView-CtCOjFb5.js} +1 -1
- package/dist/client/assets/js/{MarkdownRenderer-BbsOzYq-.js → MarkdownRenderer-BJbqsrMI.js} +1 -1
- package/dist/client/assets/js/{MemoryView-BeY8xybk.js → MemoryView-Bc-a9i1U.js} +1 -1
- package/dist/client/assets/js/{MessageItem-DWHvbLzg.js → MessageItem-DOA2nFJg.js} +1 -1
- package/dist/client/assets/js/{ModelsView-C33B9WXE.js → ModelsView-CmcXLgHA.js} +1 -1
- package/dist/client/assets/js/{OutlinePanel-CxJshR71.js → OutlinePanel-D2LVzKPs.js} +1 -1
- package/dist/client/assets/js/{PerformanceView-Bcs2X6p5.js → PerformanceView-BIMfq0BU.js} +1 -1
- package/dist/client/assets/js/{PluginsView-ClPgLZw1.js → PluginsView-DfSS_RTl.js} +1 -1
- package/dist/client/assets/js/{ProfilesView-C4kzKN1z.js → ProfilesView-CVh7LT-n.js} +1 -1
- package/dist/client/assets/js/{SettingRow-BAmGrtcn.js → SettingRow-Dt5XWkpQ.js} +1 -1
- package/dist/client/assets/js/{SettingsView-BuKFsiAz.js → SettingsView-hA4C1YcG.js} +1 -1
- package/dist/client/assets/js/{SkillsUsageView-CRcgWp1p.js → SkillsUsageView-_ToBXkb1.js} +1 -1
- package/dist/client/assets/js/{SkillsView-B2j4jJMz.js → SkillsView-DMUkyn3M.js} +1 -1
- package/dist/client/assets/js/{TerminalView-0vvlfSha.js → TerminalView-CS_MwrJD.js} +1 -1
- package/dist/client/assets/js/{UsageView-3v8bYw4Z.js → UsageView-D6o-9cR-.js} +1 -1
- package/dist/client/assets/js/{_plugin-vue_export-helper-B8gz9Iqn.js → _plugin-vue_export-helper-CHoatqkO.js} +2 -2
- package/dist/client/assets/js/{index-Cuk9R8hy.js → index-DpU5R9KV.js} +1 -1
- package/dist/client/assets/js/{models-Of46_lGf.js → models-CDdUhb_e.js} +1 -1
- package/dist/client/assets/js/profiles-CyjgPK1f.js +1 -0
- package/dist/client/assets/js/{session-browser-prefs-IGK7Xpdn.js → session-browser-prefs-C6G-jnbR.js} +1 -1
- package/dist/client/assets/js/{skills-BQ2jtPxK.js → skills-vuknhTFJ.js} +1 -1
- package/dist/client/index.html +3 -3
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/client/assets/js/profiles-DiEn61KW.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as H}from"./rolldown-runtime-BKwlnUi0.js";import{B as Ae,Bt as te,Ct as Be,Ht as S,I as ne,Nt as P,Pt as L,Q as C,Tt as o,V as Pe,W as N,_t as Ie,at as _,bt as Re,c as g,ct as n,gt as Ve,it as b,l as xe,lt as Q,nt as z,rt as F,st as D,t as J,tt as Le,vt as v,xt as De,y as We,z as p,zt as e}from"./ui-vendor-BMwF7QXa.js";import{n as O,r as j}from"./vue-vendor-kBYBtqCg.js";import{n as E,t as G}from"./_plugin-vue_export-helper-B8gz9Iqn.js";import{r as $e,t as Ne}from"./profiles-DiEn61KW.js";import{C as Qe,S as Fe,T as Je,b as we,w as Oe,x as je,y as ye}from"./index-Cuk9R8hy.js";import{n as Ee,t as s}from"./SettingRow-BAmGrtcn.js";var ie,oe,re,se,qe,ue=H((()=>{N(),J(),O(),ie={class:"platform-info"},oe=["innerHTML"],re={class:"platform-name"},se={key:0,class:"platform-card-body"},qe=Q({__name:"PlatformCard",props:{name:{},icon:{},config:{},credentials:{},exclusive:{type:Boolean}},setup(T){const h=T,y=L(!0),{t:a}=j(),U=Le(()=>{const k=h.credentials;if(!k)return!1;const w=["token","api_key","app_id","client_id","secret","app_secret","client_secret","access_token","bot_id","account_id","enabled"];return[k,k.extra].filter(Boolean).some(M=>w.some(A=>{const q=M[A];return q!=null&&q!==""&&q!==!1}))});return(k,w)=>(v(),_("div",{class:te(["platform-card",{configured:U.value}])},[z("div",{class:"platform-card-header",onClick:w[0]||(w[0]=M=>y.value=!y.value)},[z("div",ie,[z("span",{class:"platform-icon",innerHTML:T.icon},null,8,oe),z("span",re,S(T.name),1),n(e(Pe),{type:U.value?"success":"default",size:"small",round:""},{default:o(()=>[D(S(U.value?e(a)("common.configured"):e(a)("common.notConfigured")),1)]),_:1},8,["type"])]),z("span",{class:te(["expand-icon",{expanded:y.value}])},"▾",2)]),y.value?(v(),_("div",se,[T.exclusive?(v(),F(e(Ae),{key:0,type:"warning","show-icon":!0,class:"exclusive-alert"},{default:o(()=>[D(S(e(a)("platform.exclusiveTokenWarning")),1)]),_:1})):b("",!0),De(k.$slots,"default",{},void 0,!0)])):b("",!0)],2))}})})),Ge=H((()=>{})),Ce,Ke=H((()=>{ue(),ue(),Ge(),E(),Ce=G(qe,[["__scopeId","data-v-e27ecbbe"]])})),de,pe,ce,me,fe,ze,ve=H((()=>{N(),J(),O(),ye(),Fe(),Ke(),Ee(),de={class:"settings-section"},pe={class:"weixin-qr-section"},ce={key:1,class:"weixin-qr-loading"},me={key:2,class:"weixin-qr-hint"},fe={class:"platform-actions"},ze=Q({__name:"PlatformSettings",setup(T){const h=we(),y=We(),{t:a}=j(),U=P({}),k=P({}),w=P({}),M=P({}),A=P({});function q(i){return JSON.parse(JSON.stringify(i||{}))}function W(i,l){for(const[m,t]of Object.entries(l))t&&typeof t=="object"&&!Array.isArray(t)?i[m]=W({...i[m]||{}},t):i[m]=t;return i}function d(i){return k[i]||(k[i]=q(h[i])),k[i]}function u(i){return w[i]||(w[i]=q(B(i))),w[i]}function c(i,l){k[i]=W({...d(i)},l),M[i]=!0}function f(i,l){w[i]=W({...u(i)},l),A[i]=!0}function K(i,l){return JSON.stringify(i||{})===JSON.stringify(l||{})}function X(i){return!!M[i]&&!!k[i]&&!K(k[i],h[i])}function Y(i){return!!A[i]&&!!w[i]&&!K(w[i],B(i))}function Se(i){return X(i)||Y(i)}function r(i){return!!U[i]}async function Me(i){U[i]=!0;try{const l=X(i),m=Y(i);l&&await h.saveSection(i,d(i),{restart:!m}),m&&(await Oe(i,u(i)),await h.fetchSettings()),k[i]=q(h[i]),w[i]=q(B(i)),M[i]=!1,A[i]=!1,y.success(a("settings.saved"))}catch(l){y.error(l?.message||a("settings.saveFailed"))}finally{U[i]=!1}}function B(i){return h.platforms[i]||{}}function Z(i){return i===!0||i==="true"}const ee=L(""),I=L(""),x=L("idle");let R=null;async function Te(){x.value="loading",ee.value="",I.value="",le();try{const i=await je();I.value=i.qrcode,ee.value=i.qrcode_url,window.open(i.qrcode_url,"_blank"),x.value="waiting",V()}catch(i){x.value="error",y.error(i.message||a("platform.qrFetching"))}}function V(){I.value&&(R=setTimeout(async()=>{try{const i=await Qe(I.value);i.status==="wait"?V():i.status==="scaned"?(x.value="scaned",V()):i.status==="expired"?x.value="expired":i.status==="confirmed"&&(x.value="confirmed",await Je({account_id:i.account_id,token:i.token,base_url:i.base_url}),await h.fetchSettings(),y.success(a("settings.saved")))}catch{V()}},3e3))}function le(){R&&(clearTimeout(R),R=null)}Ie(()=>{le()});const ae=[{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 Be(()=>ae.map(i=>({key:i.key,config:h[i.key],credentials:B(i.key)})),i=>{for(const l of i)M[l.key]||(k[l.key]=q(l.config)),A[l.key]||(w[l.key]=q(l.credentials))},{deep:!0,immediate:!0}),(i,l)=>(v(),_("section",de,[(v(),_(C,null,Re(ae,m=>n(Ce,{key:m.key,name:m.name,icon:m.icon,exclusive:m.exclusive,config:e(h)[m.key],credentials:B(m.key)},{default:o(()=>[m.key==="telegram"?(v(),_(C,{key:0},[n(s,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:o(()=>[n(e(p),{value:u("telegram").token||"",loading:r("telegram"),clearable:"",size:"small",class:"input-lg",placeholder:"123456:ABC-DEF...","onUpdate:value":l[0]||(l[0]=t=>f("telegram",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:d("telegram").require_mention,loading:r("telegram"),"onUpdate:value":l[1]||(l[1]=t=>c("telegram",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.reactions"),hint:e(a)("platform.reactionsHint")},{default:o(()=>[n(e(g),{value:d("telegram").reactions,loading:r("telegram"),"onUpdate:value":l[2]||(l[2]=t=>c("telegram",{reactions:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(p),{value:d("telegram").free_response_chats||"",loading:r("telegram"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[3]||(l[3]=t=>c("telegram",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.mentionPatterns"),hint:e(a)("platform.mentionPatternsHint")},{default:o(()=>[n(e(p),{value:(d("telegram").mention_patterns||[]).join(", "),loading:r("telegram"),size:"small",placeholder:"pattern1, pattern2","onUpdate:value":l[4]||(l[4]=t=>c("telegram",{mention_patterns:t?t.split(",").map($=>$.trim()):[]}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="discord"?(v(),_(C,{key:1},[n(s,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:o(()=>[n(e(p),{value:u("discord").token||"",loading:r("discord"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot token...","onUpdate:value":l[5]||(l[5]=t=>f("discord",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionChannel")},{default:o(()=>[n(e(g),{value:d("discord").require_mention,loading:r("discord"),"onUpdate:value":l[6]||(l[6]=t=>c("discord",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.autoThread"),hint:e(a)("platform.autoThreadHint")},{default:o(()=>[n(e(g),{value:d("discord").auto_thread,loading:r("discord"),"onUpdate:value":l[7]||(l[7]=t=>c("discord",{auto_thread:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.reactions"),hint:e(a)("platform.reactionsHint")},{default:o(()=>[n(e(g),{value:d("discord").reactions,loading:r("discord"),"onUpdate:value":l[8]||(l[8]=t=>c("discord",{reactions:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChannels"),hint:e(a)("platform.freeResponseChannelsHint")},{default:o(()=>[n(e(p),{value:d("discord").free_response_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[9]||(l[9]=t=>c("discord",{free_response_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowedChannels"),hint:e(a)("platform.allowedChannelsHint")},{default:o(()=>[n(e(p),{value:d("discord").allowed_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[10]||(l[10]=t=>c("discord",{allowed_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.ignoredChannels"),hint:e(a)("platform.ignoredChannelsHint")},{default:o(()=>[n(e(p),{value:d("discord").ignored_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[11]||(l[11]=t=>c("discord",{ignored_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.noThreadChannels"),hint:e(a)("platform.noThreadChannelsHint")},{default:o(()=>[n(e(p),{value:d("discord").no_thread_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[12]||(l[12]=t=>c("discord",{no_thread_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="slack"?(v(),_(C,{key:2},[n(s,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:o(()=>[n(e(p),{value:u("slack").token||"",loading:r("slack"),clearable:"",size:"small",class:"input-lg",placeholder:"xoxb-...","onUpdate:value":l[13]||(l[13]=t=>f("slack",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionChannel")},{default:o(()=>[n(e(g),{value:d("slack").require_mention,loading:r("slack"),"onUpdate:value":l[14]||(l[14]=t=>c("slack",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowBots"),hint:e(a)("platform.allowBotsHint")},{default:o(()=>[n(e(g),{value:d("slack").allow_bots,loading:r("slack"),"onUpdate:value":l[15]||(l[15]=t=>c("slack",{allow_bots:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChannels"),hint:e(a)("platform.freeResponseChannelsHint")},{default:o(()=>[n(e(p),{value:d("slack").free_response_channels||"",loading:r("slack"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[16]||(l[16]=t=>c("slack",{free_response_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="whatsapp"?(v(),_(C,{key:3},[n(s,{label:e(a)("platform.waEnabled"),hint:e(a)("platform.waEnabledHint")},{default:o(()=>[n(e(g),{value:u("whatsapp").enabled,loading:r("whatsapp"),"onUpdate:value":l[17]||(l[17]=t=>f("whatsapp",{enabled:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:d("whatsapp").require_mention,loading:r("whatsapp"),"onUpdate:value":l[18]||(l[18]=t=>c("whatsapp",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(p),{value:d("whatsapp").free_response_chats||"",loading:r("whatsapp"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[19]||(l[19]=t=>c("whatsapp",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.mentionPatterns"),hint:e(a)("platform.mentionPatternsHint")},{default:o(()=>[n(e(p),{value:(d("whatsapp").mention_patterns||[]).join(", "),loading:r("whatsapp"),size:"small",placeholder:"pattern1, pattern2","onUpdate:value":l[20]||(l[20]=t=>c("whatsapp",{mention_patterns:t?t.split(",").map($=>$.trim()):[]}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="matrix"?(v(),_(C,{key:4},[n(s,{label:e(a)("platform.accessToken"),hint:e(a)("platform.accessTokenHint")},{default:o(()=>[n(e(p),{value:u("matrix").token||"",loading:r("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"syt_...","onUpdate:value":l[21]||(l[21]=t=>f("matrix",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.homeserver"),hint:e(a)("platform.homeserverHint")},{default:o(()=>[n(e(p),{value:u("matrix").extra?.homeserver||"",loading:r("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"https://matrix.org","onUpdate:value":l[22]||(l[22]=t=>f("matrix",{extra:{...u("matrix").extra,homeserver:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionRoom")},{default:o(()=>[n(e(g),{value:d("matrix").require_mention,loading:r("matrix"),"onUpdate:value":l[23]||(l[23]=t=>c("matrix",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.autoThread"),hint:e(a)("platform.autoThreadHintRoom")},{default:o(()=>[n(e(g),{value:d("matrix").auto_thread,loading:r("matrix"),"onUpdate:value":l[24]||(l[24]=t=>c("matrix",{auto_thread:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.dmMentionThreads"),hint:e(a)("platform.dmMentionThreadsHint")},{default:o(()=>[n(e(g),{value:d("matrix").dm_mention_threads,loading:r("matrix"),"onUpdate:value":l[25]||(l[25]=t=>c("matrix",{dm_mention_threads:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseRooms"),hint:e(a)("platform.freeResponseRoomsHint")},{default:o(()=>[n(e(p),{value:d("matrix").free_response_rooms||"",loading:r("matrix"),size:"small",placeholder:"room_id1,room_id2","onUpdate:value":l[26]||(l[26]=t=>c("matrix",{free_response_rooms:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="feishu"?(v(),_(C,{key:5},[n(s,{label:e(a)("platform.appId"),hint:e(a)("platform.appIdHint")},{default:o(()=>[n(e(p),{value:u("feishu").extra?.app_id||"",loading:r("feishu"),clearable:"",size:"small",class:"input-lg",placeholder:"cli_...","onUpdate:value":l[27]||(l[27]=t=>f("feishu",{extra:{...u("feishu").extra,app_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.appSecret"),hint:e(a)("platform.appSecretHint")},{default:o(()=>[n(e(p),{value:u("feishu").extra?.app_secret||"",loading:r("feishu"),clearable:"",size:"small",class:"input-lg",placeholder:"App Secret","onUpdate:value":l[28]||(l[28]=t=>f("feishu",{extra:{...u("feishu").extra,app_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:d("feishu").require_mention,loading:r("feishu"),"onUpdate:value":l[29]||(l[29]=t=>c("feishu",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(p),{value:d("feishu").free_response_chats||"",loading:r("feishu"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[30]||(l[30]=t=>c("feishu",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="dingtalk"?(v(),_(C,{key:6},[n(s,{label:e(a)("platform.clientId"),hint:e(a)("platform.clientIdHint")},{default:o(()=>[n(e(p),{value:u("dingtalk").extra?.client_id||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"Client ID","onUpdate:value":l[31]||(l[31]=t=>f("dingtalk",{extra:{...u("dingtalk").extra,client_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.clientSecret"),hint:e(a)("platform.clientSecretHint")},{default:o(()=>[n(e(p),{value:u("dingtalk").extra?.client_secret||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"Client Secret","onUpdate:value":l[32]||(l[32]=t=>f("dingtalk",{extra:{...u("dingtalk").extra,client_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowAllUsers"),hint:e(a)("platform.allowAllUsersHint")},{default:o(()=>[n(e(g),{value:Z(u("dingtalk").allow_all_users),loading:r("dingtalk"),"onUpdate:value":l[33]||(l[33]=t=>f("dingtalk",{allow_all_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowedUsers"),hint:e(a)("platform.allowedUsersHint")},{default:o(()=>[n(e(p),{value:u("dingtalk").allowed_users||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"user_id1,user_id2","onUpdate:value":l[34]||(l[34]=t=>f("dingtalk",{allowed_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:d("dingtalk").require_mention,loading:r("dingtalk"),"onUpdate:value":l[35]||(l[35]=t=>c("dingtalk",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(p),{value:d("dingtalk").free_response_chats||"",loading:r("dingtalk"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[36]||(l[36]=t=>c("dingtalk",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="qqbot"?(v(),_(C,{key:7},[n(s,{label:e(a)("platform.qqAppId"),hint:e(a)("platform.qqAppIdHint")},{default:o(()=>[n(e(p),{value:u("qqbot").extra?.app_id||"",loading:r("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"App ID","onUpdate:value":l[37]||(l[37]=t=>f("qqbot",{extra:{...u("qqbot").extra,app_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.qqAppSecret"),hint:e(a)("platform.qqAppSecretHint")},{default:o(()=>[n(e(p),{value:u("qqbot").extra?.client_secret||"",loading:r("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"App Secret","onUpdate:value":l[38]||(l[38]=t=>f("qqbot",{extra:{...u("qqbot").extra,client_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowedUsers"),hint:e(a)("platform.allowedUsersHint")},{default:o(()=>[n(e(p),{value:u("qqbot").allowed_users||"",loading:r("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"openid1,openid2","onUpdate:value":l[39]||(l[39]=t=>f("qqbot",{allowed_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowAllUsers"),hint:e(a)("platform.allowAllUsersHint")},{default:o(()=>[n(e(g),{value:Z(u("qqbot").allow_all_users),loading:r("qqbot"),"onUpdate:value":l[40]||(l[40]=t=>f("qqbot",{allow_all_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.qqMarkdown"),hint:e(a)("platform.qqMarkdownHint")},{default:o(()=>[n(e(g),{value:d("qqbot").extra?.markdown_support??!0,loading:r("qqbot"),"onUpdate:value":l[41]||(l[41]=t=>c("qqbot",{extra:{...d("qqbot").extra,markdown_support:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="weixin"?(v(),_(C,{key:8},[z("div",pe,[x.value==="idle"||x.value==="error"||x.value==="expired"||x.value==="confirmed"?(v(),F(e(ne),{key:0,type:"primary",size:"small",onClick:Te},{default:o(()=>[D(S(x.value==="confirmed"?e(a)("platform.qrRelogin"):e(a)("platform.qrLogin")),1)]),_:1})):b("",!0),x.value==="loading"?(v(),_("div",ce,[n(e(xe),{size:"small"}),z("span",null,S(e(a)("platform.qrFetching")),1)])):b("",!0),x.value==="waiting"||x.value==="scaned"?(v(),_("div",me,S(x.value==="scaned"?e(a)("platform.qrScanedHint"):e(a)("platform.qrScanHint")),1)):b("",!0)]),n(s,{label:e(a)("platform.weixinToken"),hint:e(a)("platform.weixinTokenHint")},{default:o(()=>[n(e(p),{value:u("weixin").token||"",loading:r("weixin"),clearable:"",size:"small",class:"input-lg",placeholder:"Token","onUpdate:value":l[42]||(l[42]=t=>f("weixin",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.accountId"),hint:e(a)("platform.accountIdHint")},{default:o(()=>[n(e(p),{value:u("weixin").extra?.account_id||"",loading:r("weixin"),clearable:"",size:"small",class:"input-lg",placeholder:"Account ID","onUpdate:value":l[43]||(l[43]=t=>f("weixin",{extra:{...u("weixin").extra,account_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="wecom"?(v(),_(C,{key:9},[n(s,{label:e(a)("platform.botId"),hint:e(a)("platform.botIdHint")},{default:o(()=>[n(e(p),{value:u("wecom").extra?.bot_id||"",loading:r("wecom"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot ID","onUpdate:value":l[44]||(l[44]=t=>f("wecom",{extra:{...u("wecom").extra,bot_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.appSecret"),hint:e(a)("platform.wecomSecretHint")},{default:o(()=>[n(e(p),{value:u("wecom").extra?.secret||"",loading:r("wecom"),clearable:"",size:"small",class:"input-lg",placeholder:"Secret","onUpdate:value":l[45]||(l[45]=t=>f("wecom",{extra:{...u("wecom").extra,secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),z("div",fe,[n(e(ne),{type:"primary",size:"small",loading:r(m.key),disabled:!Se(m.key),onClick:t=>Me(m.key)},{default:o(()=>[D(S(e(a)("common.save")),1)]),_:1},8,["loading","disabled","onClick"])])]),_:2},1032,["name","icon","exclusive","config","credentials"])),64))]))}})})),Xe=H((()=>{})),Ue,Ye=H((()=>{ve(),ve(),Xe(),E(),Ue=G(ze,[["__scopeId","data-v-3287f08c"]])})),ge,_e,he,be,He,ke=H((()=>{N(),J(),O(),ye(),Ne(),Ye(),ge={class:"channels-view"},_e={class:"page-header"},he={class:"header-title"},be={class:"channels-content"},He=Q({__name:"ChannelsView",setup(T){const h=we(),y=$e(),{t:a}=j();async function U(){(!y.activeProfileName||y.profiles.length===0)&&await y.fetchProfiles(),await h.fetchSettings()}return Ve(()=>{U()}),(k,w)=>(v(),_("div",ge,[z("header",_e,[z("h2",he,S(e(a)("sidebar.channels")),1)]),z("div",be,[n(e(xe),{show:e(h).loading||e(h).saving,size:"large",description:e(a)("common.loading")},{default:o(()=>[e(h).loading?b("",!0):(v(),F(Ue,{key:0}))]),_:1},8,["show","description"])])]))}})})),Ze=H((()=>{})),el,ll=H((()=>{ke(),ke(),Ze(),E(),el=G(He,[["__scopeId","data-v-2a2475d5"]])}));ll();export{el as default};
|
|
1
|
+
import{n as H}from"./rolldown-runtime-BKwlnUi0.js";import{B as Ae,Bt as te,Ct as Be,Ht as S,I as ne,Nt as P,Pt as L,Q as C,Tt as o,V as Pe,W as N,_t as Ie,at as _,bt as Re,c as g,ct as n,gt as Ve,it as b,l as xe,lt as Q,nt as z,rt as F,st as D,t as J,tt as Le,vt as v,xt as De,y as We,z as p,zt as e}from"./ui-vendor-BMwF7QXa.js";import{n as O,r as j}from"./vue-vendor-kBYBtqCg.js";import{n as E,t as G}from"./_plugin-vue_export-helper-CHoatqkO.js";import{r as $e,t as Ne}from"./profiles-CyjgPK1f.js";import{C as Qe,S as Fe,T as Je,b as we,w as Oe,x as je,y as ye}from"./index-DpU5R9KV.js";import{n as Ee,t as s}from"./SettingRow-Dt5XWkpQ.js";var ie,oe,re,se,qe,ue=H((()=>{N(),J(),O(),ie={class:"platform-info"},oe=["innerHTML"],re={class:"platform-name"},se={key:0,class:"platform-card-body"},qe=Q({__name:"PlatformCard",props:{name:{},icon:{},config:{},credentials:{},exclusive:{type:Boolean}},setup(T){const h=T,y=L(!0),{t:a}=j(),U=Le(()=>{const k=h.credentials;if(!k)return!1;const w=["token","api_key","app_id","client_id","secret","app_secret","client_secret","access_token","bot_id","account_id","enabled"];return[k,k.extra].filter(Boolean).some(M=>w.some(A=>{const q=M[A];return q!=null&&q!==""&&q!==!1}))});return(k,w)=>(v(),_("div",{class:te(["platform-card",{configured:U.value}])},[z("div",{class:"platform-card-header",onClick:w[0]||(w[0]=M=>y.value=!y.value)},[z("div",ie,[z("span",{class:"platform-icon",innerHTML:T.icon},null,8,oe),z("span",re,S(T.name),1),n(e(Pe),{type:U.value?"success":"default",size:"small",round:""},{default:o(()=>[D(S(U.value?e(a)("common.configured"):e(a)("common.notConfigured")),1)]),_:1},8,["type"])]),z("span",{class:te(["expand-icon",{expanded:y.value}])},"▾",2)]),y.value?(v(),_("div",se,[T.exclusive?(v(),F(e(Ae),{key:0,type:"warning","show-icon":!0,class:"exclusive-alert"},{default:o(()=>[D(S(e(a)("platform.exclusiveTokenWarning")),1)]),_:1})):b("",!0),De(k.$slots,"default",{},void 0,!0)])):b("",!0)],2))}})})),Ge=H((()=>{})),Ce,Ke=H((()=>{ue(),ue(),Ge(),E(),Ce=G(qe,[["__scopeId","data-v-e27ecbbe"]])})),de,pe,ce,me,fe,ze,ve=H((()=>{N(),J(),O(),ye(),Fe(),Ke(),Ee(),de={class:"settings-section"},pe={class:"weixin-qr-section"},ce={key:1,class:"weixin-qr-loading"},me={key:2,class:"weixin-qr-hint"},fe={class:"platform-actions"},ze=Q({__name:"PlatformSettings",setup(T){const h=we(),y=We(),{t:a}=j(),U=P({}),k=P({}),w=P({}),M=P({}),A=P({});function q(i){return JSON.parse(JSON.stringify(i||{}))}function W(i,l){for(const[m,t]of Object.entries(l))t&&typeof t=="object"&&!Array.isArray(t)?i[m]=W({...i[m]||{}},t):i[m]=t;return i}function d(i){return k[i]||(k[i]=q(h[i])),k[i]}function u(i){return w[i]||(w[i]=q(B(i))),w[i]}function c(i,l){k[i]=W({...d(i)},l),M[i]=!0}function f(i,l){w[i]=W({...u(i)},l),A[i]=!0}function K(i,l){return JSON.stringify(i||{})===JSON.stringify(l||{})}function X(i){return!!M[i]&&!!k[i]&&!K(k[i],h[i])}function Y(i){return!!A[i]&&!!w[i]&&!K(w[i],B(i))}function Se(i){return X(i)||Y(i)}function r(i){return!!U[i]}async function Me(i){U[i]=!0;try{const l=X(i),m=Y(i);l&&await h.saveSection(i,d(i),{restart:!m}),m&&(await Oe(i,u(i)),await h.fetchSettings()),k[i]=q(h[i]),w[i]=q(B(i)),M[i]=!1,A[i]=!1,y.success(a("settings.saved"))}catch(l){y.error(l?.message||a("settings.saveFailed"))}finally{U[i]=!1}}function B(i){return h.platforms[i]||{}}function Z(i){return i===!0||i==="true"}const ee=L(""),I=L(""),x=L("idle");let R=null;async function Te(){x.value="loading",ee.value="",I.value="",le();try{const i=await je();I.value=i.qrcode,ee.value=i.qrcode_url,window.open(i.qrcode_url,"_blank"),x.value="waiting",V()}catch(i){x.value="error",y.error(i.message||a("platform.qrFetching"))}}function V(){I.value&&(R=setTimeout(async()=>{try{const i=await Qe(I.value);i.status==="wait"?V():i.status==="scaned"?(x.value="scaned",V()):i.status==="expired"?x.value="expired":i.status==="confirmed"&&(x.value="confirmed",await Je({account_id:i.account_id,token:i.token,base_url:i.base_url}),await h.fetchSettings(),y.success(a("settings.saved")))}catch{V()}},3e3))}function le(){R&&(clearTimeout(R),R=null)}Ie(()=>{le()});const ae=[{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 Be(()=>ae.map(i=>({key:i.key,config:h[i.key],credentials:B(i.key)})),i=>{for(const l of i)M[l.key]||(k[l.key]=q(l.config)),A[l.key]||(w[l.key]=q(l.credentials))},{deep:!0,immediate:!0}),(i,l)=>(v(),_("section",de,[(v(),_(C,null,Re(ae,m=>n(Ce,{key:m.key,name:m.name,icon:m.icon,exclusive:m.exclusive,config:e(h)[m.key],credentials:B(m.key)},{default:o(()=>[m.key==="telegram"?(v(),_(C,{key:0},[n(s,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:o(()=>[n(e(p),{value:u("telegram").token||"",loading:r("telegram"),clearable:"",size:"small",class:"input-lg",placeholder:"123456:ABC-DEF...","onUpdate:value":l[0]||(l[0]=t=>f("telegram",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:d("telegram").require_mention,loading:r("telegram"),"onUpdate:value":l[1]||(l[1]=t=>c("telegram",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.reactions"),hint:e(a)("platform.reactionsHint")},{default:o(()=>[n(e(g),{value:d("telegram").reactions,loading:r("telegram"),"onUpdate:value":l[2]||(l[2]=t=>c("telegram",{reactions:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(p),{value:d("telegram").free_response_chats||"",loading:r("telegram"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[3]||(l[3]=t=>c("telegram",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.mentionPatterns"),hint:e(a)("platform.mentionPatternsHint")},{default:o(()=>[n(e(p),{value:(d("telegram").mention_patterns||[]).join(", "),loading:r("telegram"),size:"small",placeholder:"pattern1, pattern2","onUpdate:value":l[4]||(l[4]=t=>c("telegram",{mention_patterns:t?t.split(",").map($=>$.trim()):[]}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="discord"?(v(),_(C,{key:1},[n(s,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:o(()=>[n(e(p),{value:u("discord").token||"",loading:r("discord"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot token...","onUpdate:value":l[5]||(l[5]=t=>f("discord",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionChannel")},{default:o(()=>[n(e(g),{value:d("discord").require_mention,loading:r("discord"),"onUpdate:value":l[6]||(l[6]=t=>c("discord",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.autoThread"),hint:e(a)("platform.autoThreadHint")},{default:o(()=>[n(e(g),{value:d("discord").auto_thread,loading:r("discord"),"onUpdate:value":l[7]||(l[7]=t=>c("discord",{auto_thread:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.reactions"),hint:e(a)("platform.reactionsHint")},{default:o(()=>[n(e(g),{value:d("discord").reactions,loading:r("discord"),"onUpdate:value":l[8]||(l[8]=t=>c("discord",{reactions:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChannels"),hint:e(a)("platform.freeResponseChannelsHint")},{default:o(()=>[n(e(p),{value:d("discord").free_response_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[9]||(l[9]=t=>c("discord",{free_response_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowedChannels"),hint:e(a)("platform.allowedChannelsHint")},{default:o(()=>[n(e(p),{value:d("discord").allowed_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[10]||(l[10]=t=>c("discord",{allowed_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.ignoredChannels"),hint:e(a)("platform.ignoredChannelsHint")},{default:o(()=>[n(e(p),{value:d("discord").ignored_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[11]||(l[11]=t=>c("discord",{ignored_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.noThreadChannels"),hint:e(a)("platform.noThreadChannelsHint")},{default:o(()=>[n(e(p),{value:d("discord").no_thread_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[12]||(l[12]=t=>c("discord",{no_thread_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="slack"?(v(),_(C,{key:2},[n(s,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:o(()=>[n(e(p),{value:u("slack").token||"",loading:r("slack"),clearable:"",size:"small",class:"input-lg",placeholder:"xoxb-...","onUpdate:value":l[13]||(l[13]=t=>f("slack",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionChannel")},{default:o(()=>[n(e(g),{value:d("slack").require_mention,loading:r("slack"),"onUpdate:value":l[14]||(l[14]=t=>c("slack",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowBots"),hint:e(a)("platform.allowBotsHint")},{default:o(()=>[n(e(g),{value:d("slack").allow_bots,loading:r("slack"),"onUpdate:value":l[15]||(l[15]=t=>c("slack",{allow_bots:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChannels"),hint:e(a)("platform.freeResponseChannelsHint")},{default:o(()=>[n(e(p),{value:d("slack").free_response_channels||"",loading:r("slack"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[16]||(l[16]=t=>c("slack",{free_response_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="whatsapp"?(v(),_(C,{key:3},[n(s,{label:e(a)("platform.waEnabled"),hint:e(a)("platform.waEnabledHint")},{default:o(()=>[n(e(g),{value:u("whatsapp").enabled,loading:r("whatsapp"),"onUpdate:value":l[17]||(l[17]=t=>f("whatsapp",{enabled:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:d("whatsapp").require_mention,loading:r("whatsapp"),"onUpdate:value":l[18]||(l[18]=t=>c("whatsapp",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(p),{value:d("whatsapp").free_response_chats||"",loading:r("whatsapp"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[19]||(l[19]=t=>c("whatsapp",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.mentionPatterns"),hint:e(a)("platform.mentionPatternsHint")},{default:o(()=>[n(e(p),{value:(d("whatsapp").mention_patterns||[]).join(", "),loading:r("whatsapp"),size:"small",placeholder:"pattern1, pattern2","onUpdate:value":l[20]||(l[20]=t=>c("whatsapp",{mention_patterns:t?t.split(",").map($=>$.trim()):[]}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="matrix"?(v(),_(C,{key:4},[n(s,{label:e(a)("platform.accessToken"),hint:e(a)("platform.accessTokenHint")},{default:o(()=>[n(e(p),{value:u("matrix").token||"",loading:r("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"syt_...","onUpdate:value":l[21]||(l[21]=t=>f("matrix",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.homeserver"),hint:e(a)("platform.homeserverHint")},{default:o(()=>[n(e(p),{value:u("matrix").extra?.homeserver||"",loading:r("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"https://matrix.org","onUpdate:value":l[22]||(l[22]=t=>f("matrix",{extra:{...u("matrix").extra,homeserver:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionRoom")},{default:o(()=>[n(e(g),{value:d("matrix").require_mention,loading:r("matrix"),"onUpdate:value":l[23]||(l[23]=t=>c("matrix",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.autoThread"),hint:e(a)("platform.autoThreadHintRoom")},{default:o(()=>[n(e(g),{value:d("matrix").auto_thread,loading:r("matrix"),"onUpdate:value":l[24]||(l[24]=t=>c("matrix",{auto_thread:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.dmMentionThreads"),hint:e(a)("platform.dmMentionThreadsHint")},{default:o(()=>[n(e(g),{value:d("matrix").dm_mention_threads,loading:r("matrix"),"onUpdate:value":l[25]||(l[25]=t=>c("matrix",{dm_mention_threads:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseRooms"),hint:e(a)("platform.freeResponseRoomsHint")},{default:o(()=>[n(e(p),{value:d("matrix").free_response_rooms||"",loading:r("matrix"),size:"small",placeholder:"room_id1,room_id2","onUpdate:value":l[26]||(l[26]=t=>c("matrix",{free_response_rooms:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="feishu"?(v(),_(C,{key:5},[n(s,{label:e(a)("platform.appId"),hint:e(a)("platform.appIdHint")},{default:o(()=>[n(e(p),{value:u("feishu").extra?.app_id||"",loading:r("feishu"),clearable:"",size:"small",class:"input-lg",placeholder:"cli_...","onUpdate:value":l[27]||(l[27]=t=>f("feishu",{extra:{...u("feishu").extra,app_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.appSecret"),hint:e(a)("platform.appSecretHint")},{default:o(()=>[n(e(p),{value:u("feishu").extra?.app_secret||"",loading:r("feishu"),clearable:"",size:"small",class:"input-lg",placeholder:"App Secret","onUpdate:value":l[28]||(l[28]=t=>f("feishu",{extra:{...u("feishu").extra,app_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:d("feishu").require_mention,loading:r("feishu"),"onUpdate:value":l[29]||(l[29]=t=>c("feishu",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(p),{value:d("feishu").free_response_chats||"",loading:r("feishu"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[30]||(l[30]=t=>c("feishu",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="dingtalk"?(v(),_(C,{key:6},[n(s,{label:e(a)("platform.clientId"),hint:e(a)("platform.clientIdHint")},{default:o(()=>[n(e(p),{value:u("dingtalk").extra?.client_id||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"Client ID","onUpdate:value":l[31]||(l[31]=t=>f("dingtalk",{extra:{...u("dingtalk").extra,client_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.clientSecret"),hint:e(a)("platform.clientSecretHint")},{default:o(()=>[n(e(p),{value:u("dingtalk").extra?.client_secret||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"Client Secret","onUpdate:value":l[32]||(l[32]=t=>f("dingtalk",{extra:{...u("dingtalk").extra,client_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowAllUsers"),hint:e(a)("platform.allowAllUsersHint")},{default:o(()=>[n(e(g),{value:Z(u("dingtalk").allow_all_users),loading:r("dingtalk"),"onUpdate:value":l[33]||(l[33]=t=>f("dingtalk",{allow_all_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowedUsers"),hint:e(a)("platform.allowedUsersHint")},{default:o(()=>[n(e(p),{value:u("dingtalk").allowed_users||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"user_id1,user_id2","onUpdate:value":l[34]||(l[34]=t=>f("dingtalk",{allowed_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:d("dingtalk").require_mention,loading:r("dingtalk"),"onUpdate:value":l[35]||(l[35]=t=>c("dingtalk",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(p),{value:d("dingtalk").free_response_chats||"",loading:r("dingtalk"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[36]||(l[36]=t=>c("dingtalk",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="qqbot"?(v(),_(C,{key:7},[n(s,{label:e(a)("platform.qqAppId"),hint:e(a)("platform.qqAppIdHint")},{default:o(()=>[n(e(p),{value:u("qqbot").extra?.app_id||"",loading:r("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"App ID","onUpdate:value":l[37]||(l[37]=t=>f("qqbot",{extra:{...u("qqbot").extra,app_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.qqAppSecret"),hint:e(a)("platform.qqAppSecretHint")},{default:o(()=>[n(e(p),{value:u("qqbot").extra?.client_secret||"",loading:r("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"App Secret","onUpdate:value":l[38]||(l[38]=t=>f("qqbot",{extra:{...u("qqbot").extra,client_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowedUsers"),hint:e(a)("platform.allowedUsersHint")},{default:o(()=>[n(e(p),{value:u("qqbot").allowed_users||"",loading:r("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"openid1,openid2","onUpdate:value":l[39]||(l[39]=t=>f("qqbot",{allowed_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowAllUsers"),hint:e(a)("platform.allowAllUsersHint")},{default:o(()=>[n(e(g),{value:Z(u("qqbot").allow_all_users),loading:r("qqbot"),"onUpdate:value":l[40]||(l[40]=t=>f("qqbot",{allow_all_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.qqMarkdown"),hint:e(a)("platform.qqMarkdownHint")},{default:o(()=>[n(e(g),{value:d("qqbot").extra?.markdown_support??!0,loading:r("qqbot"),"onUpdate:value":l[41]||(l[41]=t=>c("qqbot",{extra:{...d("qqbot").extra,markdown_support:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="weixin"?(v(),_(C,{key:8},[z("div",pe,[x.value==="idle"||x.value==="error"||x.value==="expired"||x.value==="confirmed"?(v(),F(e(ne),{key:0,type:"primary",size:"small",onClick:Te},{default:o(()=>[D(S(x.value==="confirmed"?e(a)("platform.qrRelogin"):e(a)("platform.qrLogin")),1)]),_:1})):b("",!0),x.value==="loading"?(v(),_("div",ce,[n(e(xe),{size:"small"}),z("span",null,S(e(a)("platform.qrFetching")),1)])):b("",!0),x.value==="waiting"||x.value==="scaned"?(v(),_("div",me,S(x.value==="scaned"?e(a)("platform.qrScanedHint"):e(a)("platform.qrScanHint")),1)):b("",!0)]),n(s,{label:e(a)("platform.weixinToken"),hint:e(a)("platform.weixinTokenHint")},{default:o(()=>[n(e(p),{value:u("weixin").token||"",loading:r("weixin"),clearable:"",size:"small",class:"input-lg",placeholder:"Token","onUpdate:value":l[42]||(l[42]=t=>f("weixin",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.accountId"),hint:e(a)("platform.accountIdHint")},{default:o(()=>[n(e(p),{value:u("weixin").extra?.account_id||"",loading:r("weixin"),clearable:"",size:"small",class:"input-lg",placeholder:"Account ID","onUpdate:value":l[43]||(l[43]=t=>f("weixin",{extra:{...u("weixin").extra,account_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="wecom"?(v(),_(C,{key:9},[n(s,{label:e(a)("platform.botId"),hint:e(a)("platform.botIdHint")},{default:o(()=>[n(e(p),{value:u("wecom").extra?.bot_id||"",loading:r("wecom"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot ID","onUpdate:value":l[44]||(l[44]=t=>f("wecom",{extra:{...u("wecom").extra,bot_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.appSecret"),hint:e(a)("platform.wecomSecretHint")},{default:o(()=>[n(e(p),{value:u("wecom").extra?.secret||"",loading:r("wecom"),clearable:"",size:"small",class:"input-lg",placeholder:"Secret","onUpdate:value":l[45]||(l[45]=t=>f("wecom",{extra:{...u("wecom").extra,secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),z("div",fe,[n(e(ne),{type:"primary",size:"small",loading:r(m.key),disabled:!Se(m.key),onClick:t=>Me(m.key)},{default:o(()=>[D(S(e(a)("common.save")),1)]),_:1},8,["loading","disabled","onClick"])])]),_:2},1032,["name","icon","exclusive","config","credentials"])),64))]))}})})),Xe=H((()=>{})),Ue,Ye=H((()=>{ve(),ve(),Xe(),E(),Ue=G(ze,[["__scopeId","data-v-3287f08c"]])})),ge,_e,he,be,He,ke=H((()=>{N(),J(),O(),ye(),Ne(),Ye(),ge={class:"channels-view"},_e={class:"page-header"},he={class:"header-title"},be={class:"channels-content"},He=Q({__name:"ChannelsView",setup(T){const h=we(),y=$e(),{t:a}=j();async function U(){(!y.activeProfileName||y.profiles.length===0)&&await y.fetchProfiles(),await h.fetchSettings()}return Ve(()=>{U()}),(k,w)=>(v(),_("div",ge,[z("header",_e,[z("h2",he,S(e(a)("sidebar.channels")),1)]),z("div",be,[n(e(xe),{show:e(h).loading||e(h).saving,size:"large",description:e(a)("common.loading")},{default:o(()=>[e(h).loading?b("",!0):(v(),F(Ue,{key:0}))]),_:1},8,["show","description"])])]))}})})),Ze=H((()=>{})),el,ll=H((()=>{ke(),ke(),Ze(),E(),el=G(He,[["__scopeId","data-v-2a2475d5"]])}));ll();export{el as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as O}from"./rolldown-runtime-BKwlnUi0.js";import{$ as Do,A as Be,Bt as X,Ct as K,D as ke,Et as tt,Ht as r,I as H,J as Ao,K as kt,Pt as h,Q as W,S as Ue,T as Eo,Tt as y,Vt as Ne,W as ve,X as Et,Y as bt,Z as xt,_t as lt,at as i,bt as ae,c as Ro,ct as b,d as Ka,f as zo,gt as we,it as w,l as Uo,lt as he,mt as be,nt as e,rt as Y,st as q,t as Oe,tt as L,vt as o,y as Ct,z as gt,zt as t}from"./ui-vendor-BMwF7QXa.js";import{c as Xa,n as Ce,o as Ja,r as Se,s as No}from"./vue-vendor-kBYBtqCg.js";import{d as at,l as ot,n as fe,o as Oo,s as qo,t as pe}from"./_plugin-vue_export-helper-
|
|
1
|
+
import{n as O}from"./rolldown-runtime-BKwlnUi0.js";import{$ as Do,A as Be,Bt as X,Ct as K,D as ke,Et as tt,Ht as r,I as H,J as Ao,K as kt,Pt as h,Q as W,S as Ue,T as Eo,Tt as y,Vt as Ne,W as ve,X as Et,Y as bt,Z as xt,_t as lt,at as i,bt as ae,c as Ro,ct as b,d as Ka,f as zo,gt as we,it as w,l as Uo,lt as he,mt as be,nt as e,rt as Y,st as q,t as Oe,tt as L,vt as o,y as Ct,z as gt,zt as t}from"./ui-vendor-BMwF7QXa.js";import{c as Xa,n as Ce,o as Ja,r as Se,s as No}from"./vue-vendor-kBYBtqCg.js";import{d as at,l as ot,n as fe,o as Oo,s as qo,t as pe}from"./_plugin-vue_export-helper-CHoatqkO.js";import{c as nt,l as xe,r as st,t as St}from"./profiles-CyjgPK1f.js";import{A as Vo,H as Ho,L as Qa,M as Go,N as Wo,R as jo,U as Yo,W as Ko,b as Xo,h as it,m as rt,y as Jo,z as Qo}from"./index-DpU5R9KV.js";import{n as Zo,t as en}from"./session-browser-prefs-C6G-jnbR.js";import{n as tn,t as Rt}from"./clipboard-4x9B6X3a.js";import{n as Za,t as eo}from"./useToolTraceVisibility-Cw5ZcA7e.js";import{a as zt,i as sn,n as ln,o as Ut,r as Nt,s as an,t as on}from"./OutlinePanel-D2LVzKPs.js";import{n as nn,t as rn}from"./MessageItem-DOA2nFJg.js";import{a as un,i as dn,n as cn,o as vn,r as hn,s as fn,t as pn}from"./xterm-CN_HBdCu.js";import{_ as mn,a as _n,b as gn,c as yn,d as wn,f as kn,g as bn,h as xn,i as Cn,l as Sn,m as $n,n as Mn,o as Pn,p as Tn,r as In,s as Bn,t as Fn,u as Ln,v as Dn,y as An}from"./FileRenameModal-DN-U6DZT.js";var Ot,qt,Vt,Ht,Gt,Wt,jt,Yt,Kt,Xt,to,Jt=O((()=>{ve(),Oe(),ot(),Ot={class:"folder-picker"},qt={key:0,class:"folder-picker-loading"},Vt={key:1,class:"folder-tree"},Ht={class:"folder-name"},Gt=["onClick"],Wt=["onClick"],jt=["onClick"],Yt={key:0,class:"folder-empty"},Kt={key:2,class:"folder-selected"},Xt={class:"folder-selected-path"},to=he({__name:"FolderPicker",props:{modelValue:{}},emits:["update:modelValue"],setup(V,{emit:s}){const c=V,z=s,D=h(!1),k=h(""),m=h([]),n=h(new Set),T=h(new Map),E=h(new Set),C=h(c.modelValue||"");K(()=>c.modelValue,M=>{C.value=M||""});async function U(M=""){try{return await at(`/api/hermes/workspace/folders${M?`?path=${encodeURIComponent(M)}`:""}`)}catch{return null}}we(async()=>{D.value=!0;const M=await U();M&&(k.value=M.base,m.value=M.folders),D.value=!1});async function B(M){if(n.value.has(M.path)){n.value.delete(M.path),n.value=new Set(n.value);return}if(n.value.add(M.path),n.value=new Set(n.value),!T.value.has(M.path)){E.value.add(M.path),E.value=new Set(E.value);const f=await U(M.path);T.value.set(M.path,f?.folders||[]),T.value=new Map(T.value),E.value.delete(M.path),E.value=new Set(E.value)}}function $(M){const f=`${k.value}/${M.path}`;C.value=f,z("update:modelValue",f)}function A(){C.value=k.value,z("update:modelValue",k.value)}const I=L(()=>{const M=[];function f(v,x){for(const R of v){const G=n.value.has(R.path),P=E.value.has(R.path),j=T.value.get(R.path);M.push({folder:R,depth:x,isExpanded:G,isLoading:P,hasChildren:j?j.length>0:null}),G&&j&&j.length>0&&f(j,x+1)}}return f(m.value,0),M});return(M,f)=>(o(),i("div",Ot,[D.value?(o(),i("div",qt,[b(t(Uo),{size:"small"})])):(o(),i("div",Vt,[e("div",{class:X(["folder-item root",{selected:C.value===k.value}]),onClick:A},[f[0]||(f[0]=e("span",{class:"folder-icon"},"📂",-1)),e("span",Ht,r(k.value||"/"),1)],2),(o(!0),i(W,null,ae(I.value,v=>(o(),i("div",{key:v.folder.path,class:X(["folder-item",{selected:C.value===`${k.value}/${v.folder.path}`}]),style:Ne({paddingLeft:`${12+v.depth*16}px`})},[e("span",{class:"folder-expand",onClick:xt(x=>B(v.folder),["stop"])},[v.isLoading?(o(),i(W,{key:0},[q("⏳")],64)):(o(),i(W,{key:1},[q(r(v.isExpanded?"▼":"▶"),1)],64))],8,Gt),e("span",{class:"folder-icon",onClick:x=>$(v.folder)},"📁",8,Wt),e("span",{class:"folder-name",onClick:x=>$(v.folder)},r(v.folder.name),9,jt)],6))),128)),(o(!0),i(W,null,ae(I.value,v=>(o(),i(W,{key:"empty-"+v.folder.path},[v.isExpanded&&!v.isLoading&&v.hasChildren===!1?(o(),i("div",{key:0,class:"folder-item empty",style:Ne({paddingLeft:`${28+v.depth*16}px`})},[...f[1]||(f[1]=[e("span",{class:"folder-empty-text"},"(空)",-1)])],4)):w("",!0)],64))),128)),m.value.length===0&&!D.value?(o(),i("div",Yt," 暂无工作区文件夹 ")):w("",!0)])),C.value?(o(),i("div",Kt,[f[2]||(f[2]=e("span",{class:"folder-selected-label"},"已选择:",-1)),e("span",Xt,r(C.value),1)])):w("",!0)]))}})})),En=O((()=>{})),so,Rn=O((()=>{Jt(),Jt(),En(),fe(),so=pe(to,[["__scopeId","data-v-4399bad5"]])}));async function zn(V,s,c){return(await at(`/api/hermes/model-context/${encodeURIComponent(V)}/${encodeURIComponent(s)}`,{method:"PUT",body:JSON.stringify({provider:V,model:s,context_limit:c})})).data}var Un=O((()=>{ot()})),Qt,Zt,es,ts,ss,ls,as,os,ns,is,rs,us,ds,cs,vs,hs,fs,ps,ms,_s,gs,lo,ys=O((()=>{ve(),rt(),nt(),St(),Qa(),Un(),Oe(),Ce(),eo(),Qt={class:"chat-input-area"},Zt={class:"input-top-bar"},es={class:"auto-play-speech-switch"},ts={key:1,class:"context-bar"},ss={key:0,class:"attachment-previews"},ls=["src","alt"],as={key:1,class:"attachment-file"},os={class:"file-name"},ns={class:"file-size"},is=["onClick"],rs=["placeholder"],us=["onMousedown","onMouseenter"],ds={class:"slash-command-name"},cs={key:0,class:"slash-command-args"},vs={class:"slash-command-desc"},hs={class:"input-actions"},fs={class:"context-edit-content"},ps={style:{"margin-bottom":"16px",color:"#666"}},ms={style:{"margin-top":"12px","font-size":"12px",color:"#999"}},_s={style:{display:"flex","justify-content":"flex-end",gap:"8px"}},gs=2e5,lo=he({__name:"ChatInput",setup(V){const s=it(),{t:c}=Se(),z=Ct(),{toolTraceVisible:D,toggleToolTraceVisible:k}=Za(),m=h(""),n=h(),T=h(),E=h(),C=h([]),U=h(!1),B=h(0),$=h(!1),A=L(()=>[{name:"usage",args:"",description:c("chat.slashCommands.usage")},{name:"status",args:"",description:c("chat.slashCommands.status")},{name:"abort",args:"",description:c("chat.slashCommands.abort")},{name:"queue",args:c("chat.slashCommandArgs.message"),description:c("chat.slashCommands.queue")},{name:"clear",args:"",description:c("chat.slashCommands.clear")},{name:"clear",args:"--history",insertText:"clear --history",description:c("chat.slashCommands.clearHistory")},{name:"title",args:c("chat.slashCommandArgs.title"),description:c("chat.slashCommands.title")},{name:"compress",args:"",description:c("chat.slashCommands.compress")},{name:"steer",args:c("chat.slashCommandArgs.text"),description:c("chat.slashCommands.steer")},{name:"destroy",args:"",description:c("chat.slashCommands.destroy")}]),I=h(!1),M=h(""),f=h(0),v=L(()=>s.activeSession?.source==="cli"),x=L(()=>{const d=M.value.toLowerCase();return A.value.filter(_=>_.name.includes(d)||_.insertText?.includes(d))}),R=h(null);function G(d){d.preventDefault();const _=n.value;if(!_)return;const S=_.clientHeight,ie=d.clientY;function ye(We){const ft=S-(We.clientY-ie);R.value=Math.max(20,Math.min(400,Math.round(ft)))}function Ge(){document.removeEventListener("mousemove",ye),document.removeEventListener("mouseup",Ge),document.body.style.cursor="",document.body.style.userSelect=""}document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",ye),document.addEventListener("mouseup",Ge)}const P=h(!1);we(()=>{const d=localStorage.getItem("autoPlaySpeech");d!==null&&(P.value=d==="true",s.setAutoPlaySpeech(P.value))}),K(P,d=>{localStorage.setItem("autoPlaySpeech",String(d)),s.setAutoPlaySpeech(d)});const j=L(()=>m.value.trim()||C.value.length>0);function te(){be(()=>{T.value&&T.value.querySelector(".active")?.scrollIntoView({block:"nearest",behavior:"instant"})})}function ue(){if(!v.value){I.value=!1;return}const d=n.value;if(!d)return;const _=d.selectionStart,S=m.value.slice(0,_);if(!S.startsWith("/")||S.includes(" ")||S.includes(`
|
|
2
2
|
`)){I.value=!1;return}M.value=S.slice(1),f.value=0,I.value=x.value.length>0}function $e(d){m.value=`/${d.insertText||d.name} `,I.value=!1,be(()=>{const _=n.value;if(!_)return;const S=m.value.length;_.setSelectionRange(S,S),_.focus()})}const oe=h(2e5),re=h(!1),J=h(2e5),me=h(!1);async function Fe(){J.value=oe.value,re.value=!0}async function Me(){if(!J.value||J.value<=0){z.error(c("chat.contextEditInvalid"));return}me.value=!0;try{const d=s.activeSession?.provider||xe().selectedProvider||"",_=s.activeSession?.model||xe().selectedModel||"";if(!d||!_){z.error(c("chat.contextEditFailed"));return}await zn(d,_,J.value),oe.value=J.value,re.value=!1,z.success(c("chat.contextEditSuccess"))}catch(d){z.error(`${c("chat.contextEditFailed")}: ${d.message||""}`)}finally{me.value=!1}}async function se(){try{const d=s.activeSession;oe.value=await Wo(d?.profile||st().activeProfileName||void 0,d?.provider||void 0,d?.model||void 0)}catch{oe.value=gs}}we(se),K(()=>st().activeProfileName,se),K(()=>xe().selectedProvider,se),K(()=>xe().selectedModel,se),K(()=>s.activeSession?.id,se),K(()=>s.activeSession?.profile,se),K(()=>s.activeSession?.provider,se),K(()=>s.activeSession?.model,se);const Q=L(()=>{const d=s.activeSession?.contextTokens;return typeof d=="number"&&Number.isFinite(d)&&d>0?d:(s.activeSession?.inputTokens??0)+(s.activeSession?.outputTokens??0)}),de=L(()=>Math.max(0,oe.value-Q.value)),Z=L(()=>Math.min(Q.value/oe.value*100,100));function le(d){return d>=1e6?(d/1e6).toFixed(1)+"M":d>=1e3?(d/1e3).toFixed(1)+"k":String(d)}function ne(d){if(C.value.find(ie=>ie.name===d.name))return;const _=Date.now().toString(36)+Math.random().toString(36).slice(2,8),S=URL.createObjectURL(d);C.value.push({id:_,name:d.name,type:d.type,size:d.size,url:S,file:d})}function ce(){E.value?.click()}function _e(d){const _=d.target;if(_.files){for(const S of _.files)ne(S);_.value=""}}function p(d){const _=Array.from(d.clipboardData?.items||[]).filter(S=>S.type.startsWith("image/"));if(_.length){d.preventDefault();for(const S of _){const ie=S.getAsFile();if(!ie)continue;const ye=S.type.split("/")[1]||"png";ne(new File([ie],`pasted-${Date.now()}.${ye}`,{type:S.type}))}}}function g(d){d.preventDefault()}function F(d){d.preventDefault(),d.dataTransfer?.types.includes("Files")&&(B.value++,U.value=!0)}function ge(){B.value--,B.value<=0&&(B.value=0,U.value=!1)}function Pe(d){d.preventDefault(),B.value=0,U.value=!1;const _=Array.from(d.dataTransfer?.files||[]);if(_.length){for(const S of _)ne(S);n.value?.focus()}}function Le(){const d=m.value.trim();!d&&C.value.length===0||(s.sendMessage(d,C.value.length>0?C.value:void 0),m.value="",C.value=[],I.value=!1,n.value&&(n.value.style.height="auto"))}function qe(){$.value=!0}function ut(){requestAnimationFrame(()=>{$.value=!1,ue()})}function dt(d){return $.value||d.isComposing||d.keyCode===229}function ct(d){if(I.value&&x.value.length>0){if(d.key==="ArrowDown"){d.preventDefault(),f.value=(f.value+1)%x.value.length,te();return}if(d.key==="ArrowUp"){d.preventDefault(),f.value=(f.value-1+x.value.length)%x.value.length,te();return}if(d.key==="Enter"||d.key==="Tab"){d.preventDefault(),$e(x.value[f.value]);return}if(d.key==="Escape"){d.preventDefault(),I.value=!1;return}}d.key!=="Enter"||d.shiftKey||dt(d)||(d.preventDefault(),Le())}function Te(d){const _=d.target;$.value||ue(),R.value===null&&(_.style.height="auto",_.style.height=Math.min(_.scrollHeight,100)+"px")}function vt(d){f.value=d}function Ve(d){if(!I.value)return;const _=d.target;!_.closest(".slash-command-dropdown")&&!_.closest(".input-wrapper")&&(I.value=!1)}we(()=>{document.addEventListener("mousedown",Ve)}),lt(()=>{document.removeEventListener("mousedown",Ve)});function ht(d){const _=C.value.findIndex(S=>S.id===d);_!==-1&&(URL.revokeObjectURL(C.value[_].url),C.value.splice(_,1))}function He(d){return d<1024?d+" B":d<1024*1024?(d/1024).toFixed(1)+" KB":(d/(1024*1024)).toFixed(1)+" MB"}function De(d){return d.startsWith("image/")}return(d,_)=>(o(),i("div",Qt,[e("div",Zt,[b(t(ke),{trigger:"hover"},{trigger:y(()=>[b(t(H),{quaternary:"",size:"tiny",onClick:ce,circle:""},{icon:y(()=>[..._[6]||(_[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:y(()=>[q(" "+r(t(c)("chat.attachFiles")),1)]),_:1}),e("div",es,[b(t(ke),{trigger:"hover"},{trigger:y(()=>[..._[7]||(_[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:y(()=>[q(" "+r(t(c)("chat.autoPlaySpeech")),1)]),_:1}),b(t(Ro),{size:"small",value:P.value,"onUpdate:value":_[0]||(_[0]=S=>P.value=S),round:!1},null,8,["value"])]),b(t(ke),{trigger:"hover"},{trigger:y(()=>[b(t(H),{quaternary:"",size:"tiny",class:X(["tool-trace-toggle",{active:t(D)}]),"aria-label":t(D)?t(c)("chat.hideToolCalls"):t(c)("chat.showToolCalls"),onClick:t(k)},{default:y(()=>[..._[8]||(_[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:y(()=>[q(" "+r(t(D)?t(c)("chat.hideToolCalls"):t(c)("chat.showToolCalls")),1)]),_:1}),Q.value>0?(o(),i("span",{key:0,class:X(["context-info",{"context-warning":Z.value>80}])},[q(r(le(Q.value))+" / ",1),b(t(ke),{trigger:"hover"},{trigger:y(()=>[e("span",{class:"context-limit-editable",onClick:Fe},r(le(oe.value)),1)]),default:y(()=>[e("span",null,r(t(c)("chat.contextClickToEdit")),1)]),_:1}),q(" · "+r(t(c)("chat.contextRemaining"))+" "+r(le(de.value)),1)],2)):w("",!0),Q.value>0?(o(),i("div",ts,[e("div",{class:X(["context-bar-fill",{"context-bar-warn":Z.value>60&&Z.value<=80,"context-bar-danger":Z.value>80}]),style:Ne({width:`${Z.value}%`})},null,6)])):w("",!0)]),C.value.length>0?(o(),i("div",ss,[(o(!0),i(W,null,ae(C.value,S=>(o(),i("div",{key:S.id,class:X(["attachment-preview",{image:De(S.type)}])},[De(S.type)?(o(),i("img",{key:0,src:S.url,alt:S.name,class:"attachment-thumb"},null,8,ls)):(o(),i("div",as,[_[9]||(_[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",os,r(S.name),1),e("span",ns,r(He(S.size)),1)])),e("button",{class:"attachment-remove",onClick:ie=>ht(S.id)},[..._[10]||(_[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,is)],2))),128))])):w("",!0),e("div",{class:X(["input-wrapper",{"drag-over":U.value}]),onDragover:g,onDragenter:F,onDragleave:ge,onDrop:Pe},[e("input",{ref_key:"fileInputRef",ref:E,type:"file",multiple:"",class:"file-input-hidden",onChange:_e},null,544),e("div",{class:"resize-handle",onMousedown:G},null,32),tt(e("textarea",{ref_key:"textareaRef",ref:n,"onUpdate:modelValue":_[1]||(_[1]=S=>m.value=S),class:"input-textarea",style:Ne(R.value?{height:R.value+"px"}:{}),placeholder:t(c)("chat.inputPlaceholder"),rows:"1",onKeydown:ct,onCompositionstart:qe,onCompositionend:ut,onInput:Te,onPaste:p},null,44,rs),[[Ao,m.value]]),b(kt,{name:"dropdown-fade"},{default:y(()=>[I.value&&x.value.length>0?(o(),i("div",{key:0,ref_key:"commandDropdownRef",ref:T,class:"slash-command-dropdown"},[(o(!0),i(W,null,ae(x.value,(S,ie)=>(o(),i("div",{key:S.name,class:X(["slash-command-item",{active:ie===f.value}]),onMousedown:xt(ye=>$e(S),["prevent"]),onMouseenter:ye=>vt(ie)},[e("span",ds,"/"+r(S.name),1),S.args?(o(),i("span",cs,r(S.args),1)):w("",!0),e("span",vs,r(S.description),1)],42,us))),128))],512)):w("",!0)]),_:1}),e("div",hs,[t(s).isStreaming?(o(),Y(t(H),{key:0,size:"small",type:"error",disabled:t(s).isAborting,onClick:_[2]||(_[2]=S=>t(s).stopStreaming())},{default:y(()=>[q(r(t(c)("chat.stop")),1)]),_:1},8,["disabled"])):w("",!0),b(t(H),{size:"small",type:"primary",disabled:!j.value,onClick:Le},{icon:y(()=>[..._[11]||(_[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:y(()=>[q(" "+r(t(c)("chat.send")),1)]),_:1},8,["disabled"])])],34),b(t(Ue),{show:re.value,"onUpdate:show":_[5]||(_[5]=S=>re.value=S),title:t(c)("chat.contextEditTitle"),"mask-closable":!0,preset:"card",style:{width:"400px"}},{footer:y(()=>[e("div",_s,[b(t(H),{onClick:_[4]||(_[4]=S=>re.value=!1),disabled:me.value},{default:y(()=>[q(r(t(c)("chat.contextEditCancel")),1)]),_:1},8,["disabled"]),b(t(H),{type:"primary",onClick:Me,loading:me.value},{default:y(()=>[q(r(t(c)("chat.contextEditSave")),1)]),_:1},8,["loading"])])]),default:y(()=>[e("div",fs,[e("p",ps,r(t(c)("chat.contextEditDesc")),1),b(t(zo),{value:J.value,"onUpdate:value":_[3]||(_[3]=S=>J.value=S),min:1e3,max:1e7,step:1e3,"show-button":!1,placeholder:t(c)("chat.contextEditPlaceholder"),style:{width:"100%"}},{suffix:y(()=>[..._[12]||(_[12]=[e("span",{style:{color:"#999"}},"tokens",-1)])]),_:1},8,["value","placeholder"]),e("div",ms,r(t(c)("chat.contextEditHint")),1)])]),_:1},8,["show","title"])]))}})})),Nn=O((()=>{})),ao,On=O((()=>{ys(),ys(),Nn(),fe(),ao=pe(lo,[["__scopeId","data-v-f61c7e4f"]])}));async function qn(V={}){const s=new URLSearchParams;return V.humanOnly===!1&&s.set("humanOnly","false"),V.source&&s.set("source",V.source),V.limit!=null&&s.set("limit",String(V.limit)),(await at(`/api/hermes/sessions/conversations${s.toString()?`?${s.toString()}`:""}`)).sessions}async function Vn(V,s={}){const c=new URLSearchParams;s.humanOnly===!1&&c.set("humanOnly","false"),s.source&&c.set("source",s.source);const z=c.toString()?`?${c.toString()}`:"";return at(`/api/hermes/sessions/conversations/${encodeURIComponent(V)}/messages${z}`)}var Hn=O((()=>{ot()})),ws,ks,bs,xs,Cs,Ss,$s,Ms,Ps,Ts,Is,Bs,Fs,Ls,Ds,As,Es,Rs,zs,Us,Ns,Os,oo,qs=O((()=>{ve(),Hn(),an(),nt(),Ce(),ws={class:"conversation-monitor"},ks={class:"conversation-monitor__sidebar"},bs={key:0,class:"conversation-monitor__empty"},xs={key:1,class:"conversation-monitor__empty"},Cs=["aria-pressed","onClick"],Ss={class:"conversation-monitor__session-title-row"},$s={class:"conversation-monitor__session-title"},Ms={key:0,class:"conversation-monitor__session-live"},Ps={class:"conversation-monitor__session-meta"},Ts={key:0,class:"conversation-monitor__session-preview"},Is={class:"conversation-monitor__detail"},Bs={key:0,class:"conversation-monitor__detail-header"},Fs={class:"conversation-monitor__detail-title"},Ls={class:"conversation-monitor__detail-meta"},Ds=["title"],As={key:1,class:"conversation-monitor__empty conversation-monitor__empty--error"},Es={key:2,class:"conversation-monitor__empty"},Rs={key:3,class:"conversation-monitor__empty"},zs={key:4,class:"conversation-monitor__messages"},Us={class:"conversation-monitor__message-meta"},Ns={class:"conversation-monitor__message-content"},Os=15e3,oo=he({__name:"ConversationMonitorPane",props:{humanOnly:{type:Boolean}},setup(V){const s=V,{t:c}=Se(),z=xe(),D=h([]),k=h(null),m=h(null),n=h(!1),T=h(!1),E=h("");let C=null,U=0,B=0;const $=L(()=>D.value.find(R=>R.id===k.value)||null),A=L(()=>$.value?.model?z.displayModelName($.value.model,$.value.provider):"");function I(R){return c(R==="user"?"chat.monitorRoleUser":"chat.monitorRoleAssistant")}function M(R){return c("chat.linkedSessions",{count:R})}function f(){U+=1,B+=1}async function v(R=!1){const G=++U;R||(n.value=!0,E.value="");try{const P=await qn({humanOnly:s.humanOnly});if(G!==U)return;if(D.value=P,!P.length){k.value=null,m.value=null;return}(!k.value||!P.some(j=>j.id===k.value))&&(k.value=P[0].id)}catch(P){if(G!==U||R)return;E.value=P?.message||String(P),D.value=[],k.value=null,m.value=null}finally{!R&&G===U&&(n.value=!1)}}async function x(R,G=!1){const P=++B;if(!R){m.value=null;return}const j=s.humanOnly;G||(T.value=!0,E.value="");try{const te=await Vn(R,{humanOnly:j});if(P!==B||R!==k.value||j!==s.humanOnly)return;m.value=te}catch(te){if(P!==B||G)return;E.value=te?.message||String(te),m.value=null}finally{!G&&P===B&&(T.value=!1)}}return K(k,async R=>{await x(R,!1)}),K(()=>s.humanOnly,async()=>{f(),k.value=null,m.value=null,await v(!1)}),we(async()=>{await v(!1),C=setInterval(async()=>{await v(!0),k.value&&await x(k.value,!0)},Os)}),lt(()=>{f(),C&&clearInterval(C)}),(R,G)=>(o(),i("div",ws,[e("aside",ks,[n.value&&D.value.length===0?(o(),i("div",bs,r(t(c)("common.loading")),1)):D.value.length===0?(o(),i("div",xs,r(t(c)("chat.noSessions")),1)):w("",!0),(o(!0),i(W,null,ae(D.value,P=>(o(),i("button",{key:P.id,class:X(["conversation-monitor__session",{active:P.id===k.value}]),"aria-pressed":P.id===k.value,onClick:j=>k.value=P.id},[e("div",Ss,[e("span",$s,r(P.title||P.preview||P.id),1),P.is_active?(o(),i("span",Ms,r(t(c)("chat.recentBadge")),1)):w("",!0)]),e("div",Ps,r(t(Ut)(P.source))+" · "+r(t(zt)(P.last_active)),1),P.preview?(o(),i("div",Ts,r(P.preview),1)):w("",!0)],10,Cs))),128))]),e("section",Is,[$.value?(o(),i("header",Bs,[e("div",Fs,r($.value.title||$.value.preview||$.value.id),1),e("div",Ls,[e("span",null,r(t(Ut)($.value.source)),1),G[0]||(G[0]=e("span",null,"·",-1)),e("span",{title:$.value.model},r(A.value),9,Ds),G[1]||(G[1]=e("span",null,"·",-1)),e("span",null,r(M($.value.thread_session_count)),1)])])):w("",!0),E.value?(o(),i("div",As,r(E.value),1)):T.value&&!m.value?(o(),i("div",Es,r(t(c)("common.loading")),1)):!m.value||m.value.messages.length===0?(o(),i("div",Rs,r(t(c)("chat.noVisibleMessages")),1)):(o(),i("div",zs,[(o(!0),i(W,null,ae(m.value.messages,P=>(o(),i("article",{key:`${P.session_id}-${P.id}`,class:X(["conversation-monitor__message",`role-${P.role}`])},[e("div",Us,r(I(P.role))+" · "+r(t(zt)(P.timestamp)),1),e("div",Ns,r(P.content),1)],2))),128))]))])]))}})})),Gn=O((()=>{})),no,Wn=O((()=>{qs(),qs(),Gn(),fe(),no=pe(oo,[["__scopeId","data-v-71fcd8c4"]])})),io,jn=O((()=>{io="/assets/mp4/thinking-light-BjeGd2gJ.mp4"})),ro,Yn=O((()=>{ro="/assets/mp4/thinking-dark-yYkYRZLs.mp4"})),Vs,Hs,Gs,Ws,js,Ys,Ks,Xs,Js,Qs,Zs,el,tl,sl,ll,al,ol,nl,il,rl,ul,dl,cl,vl,hl,fl,uo,pl=O((()=>{ve(),Ko(),Ce(),nn(),rt(),jn(),Yn(),Ho(),eo(),Vs={key:0,class:"empty-state"},Hs={key:0,class:"streaming-indicator"},Gs=["src"],Ws={key:0,class:"tool-calls-panel"},js={key:0,class:"tool-call-item compression-item"},Ys={key:0,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},Ks={key:1,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},Xs={class:"tool-call-name"},Js={key:2,class:"tool-call-spinner"},Qs={key:1,class:"tool-call-item compression-item"},Zs={key:0,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},el={key:1,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},tl={class:"tool-call-name"},sl={key:2,class:"tool-call-spinner"},ll={class:"tool-call-name"},al={key:0,class:"tool-call-preview"},ol=["title"],nl={key:2,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"tool-call-success-icon"},il={key:3,class:"tool-call-spinner"},rl={key:4,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"tool-call-error-icon"},ul={key:0,class:"queue-float-panel"},dl={class:"queue-float-header"},cl={class:"queue-float-list"},vl={class:"queue-index"},hl={class:"queue-text"},fl=["title","onClick"],uo=he({__name:"MessageList",setup(V){const s=it(),{t:c}=Se(),{isDark:z}=Yo(),{toolTraceVisible:D}=Za(),k=h();function m(f){return f>=1e6?(f/1e6).toFixed(1)+"M":f>=1e3?(f/1e3).toFixed(1)+"K":String(f)}function n(f){return f<1?`${Math.round(f*1e3)}ms`:f<60?`${Math.round(f*10)/10}s`:`${Math.floor(f/60)}m ${Math.round(f%60)}s`}const T=L(()=>{const f=s.messages;let v=-1;for(let x=f.length-1;x>=0;x--)if(f[x].role==="user"){v=x;break}return[...f.filter((x,R)=>x.role==="tool"&&R>v)].reverse()}),E=L(()=>T.value.filter(f=>!!f.toolName)),C=L(()=>{const f=new Set(T.value.map(v=>v.id));return s.messages.filter(v=>v.role==="tool"?D.value&&!!v.toolName&&!(s.isRunActive&&f.has(v.id)):!(v.role==="assistant"&&v.isStreaming&&!v.content?.trim()&&v.reasoning?.trim()&&T.value.length===0))}),U=L(()=>{const f=s.activeSessionId;return f?s.queuedUserMessages.get(f)||[]:[]});function B(f){const v=s.activeSessionId;v&&s.removeQueuedMessage(v,f)}function $(f){const v=f.replace(/\s+/g," ").trim();return v.length>48?`${v.slice(0,48)}...`:v}function A(f=200){const v=k.value;return v?v.scrollHeight-v.scrollTop-v.clientHeight<f:!0}function I(){be(()=>{k.value&&(k.value.scrollTop=k.value.scrollHeight)})}function M(f){be(()=>{const v=document.getElementById(`message-${f}`);v&&v.scrollIntoView({block:"center"})})}return K(()=>s.activeSessionId,f=>{if(f){if(s.focusMessageId){be(()=>M(s.focusMessageId));return}be(()=>I())}},{immediate:!0}),K(()=>s.focusMessageId,f=>{f&&M(f)}),K(()=>s.isRunActive,f=>{f&&I()}),K(()=>s.messages[s.messages.length-1]?.content,()=>{if(s.focusMessageId){M(s.focusMessageId);return}A()&&I()}),K(T,()=>{if(s.focusMessageId){M(s.focusMessageId);return}A()&&I()}),(f,v)=>(o(),i("div",{ref_key:"listRef",ref:k,class:"message-list"},[t(s).messages.length===0?(o(),i("div",Vs,[v[0]||(v[0]=e("img",{src:"/logo.png",alt:"Hermes",class:"empty-logo"},null,-1)),e("p",null,r(t(c)("chat.emptyState")),1)])):w("",!0),(o(!0),i(W,null,ae(C.value,x=>(o(),Y(rn,{key:x.id,message:x,highlight:t(s).focusMessageId===x.id},null,8,["message","highlight"]))),128)),b(kt,{name:"fade"},{default:y(()=>[t(s).isRunActive||t(s).abortState?(o(),i("div",Hs,[e("video",{src:t(z)?t(ro):t(io),autoplay:"",loop:"",muted:"",playsinline:"",class:"thinking-video"},null,8,Gs),E.value.length>0||t(s).compressionState||t(s).abortState?(o(),i("div",Ws,[t(s).abortState?(o(),i("div",js,[t(s).abortState.aborting?(o(),i("svg",Ys,[...v[1]||(v[1]=[e("path",{d:"M10 9v6m4-6v6M5 5h14v14H5z"},null,-1)])])):(o(),i("svg",Ks,[...v[2]||(v[2]=[e("path",{d:"M5 13l4 4L19 7"},null,-1)])])),e("span",Xs,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?(o(),i("span",Js)):w("",!0)])):w("",!0),t(s).compressionState?(o(),i("div",Qs,[t(s).compressionState.compressing?(o(),i("svg",Zs,[...v[3]||(v[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?(o(),i("svg",el,[...v[4]||(v[4]=[e("path",{d:"M5 13l4 4L19 7"},null,-1)])])):w("",!0),e("span",tl,r(t(s).compressionState.compressing?`Compressing... (${t(s).compressionState.messageCount} msgs, ~${m(t(s).compressionState.beforeTokens)} tokens)`:t(s).compressionState.compressed?`Compressed ${t(s).compressionState.messageCount} msgs: ~${m(t(s).compressionState.beforeTokens)} → ~${m(t(s).compressionState.afterTokens)} tokens`:"Compression skipped"),1),t(s).compressionState.compressing?(o(),i("span",sl)):w("",!0)])):w("",!0),(o(!0),i(W,null,ae(E.value,x=>(o(),i("div",{key:x.id,class:"tool-call-item"},[v[7]||(v[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",ll,r(x.toolName),1),x.toolPreview?(o(),i("span",al,r(x.toolPreview),1)):w("",!0),x.toolDuration&&x.toolStatus!=="running"?(o(),i("span",{key:1,class:"tool-call-duration",title:f.$t("chat.executionDuration")},r(n(x.toolDuration)),9,ol)):w("",!0),x.toolStatus==="done"?(o(),i("svg",nl,[...v[5]||(v[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)])])):w("",!0),x.toolStatus==="running"?(o(),i("span",il)):w("",!0),x.toolStatus==="error"?(o(),i("svg",rl,[...v[6]||(v[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)])])):w("",!0)]))),128))])):w("",!0)])):w("",!0)]),_:1}),b(kt,{name:"queue-float"},{default:y(()=>[U.value.length>0?(o(),i("div",ul,[e("div",dl,[v[8]||(v[8]=e("span",{class:"queue-orbit","aria-hidden":"true"},[e("span")],-1)),e("span",null,r(t(c)("chat.messageQueue")),1),e("strong",null,r(U.value.length),1)]),e("div",cl,[(o(!0),i(W,null,ae(U.value,(x,R)=>(o(),i("div",{key:x.id,class:"queue-float-item"},[e("span",vl,r(R+1),1),e("span",hl,r($(x.content)),1),e("button",{type:"button",class:"queue-remove",title:t(c)("chat.removeQueuedMessage"),onClick:G=>B(x.id)},[...v[9]||(v[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,fl)]))),128))])])):w("",!0)]),_:1})],512))}})})),Kn=O((()=>{})),co,Xn=O((()=>{pl(),pl(),Kn(),fe(),co=pe(uo,[["__scopeId","data-v-3797adda"]])})),ml,_l,gl,yl,wl,kl,bl,xl,Cl,Sl,$l,Ml,Pl,Tl,Il,Bl,Fl,Ll,yt,Dl,wt,vo,Al=O((()=>{ve(),fn(),dn(),hn(),pn(),ot(),Oe(),Ce(),ml={class:"terminal-panel-drawer"},_l={class:"sidebar-header"},gl={class:"sidebar-title"},yl={class:"session-list"},wl={key:0,class:"session-error"},kl={key:1,class:"session-empty"},bl=["onClick"],xl={class:"session-item-content"},Cl={class:"session-item-title"},Sl={class:"session-item-meta"},$l={class:"session-item-shell"},Ml={key:0,class:"session-item-status"},Pl={key:1,class:"session-item-time"},Tl={class:"terminal-main"},Il={class:"terminal-header"},Bl={key:0,class:"header-session-title"},Fl={class:"header-actions"},Ll={class:"terminal-container"},yt="hermes_terminal_theme",Dl=3,wt=18,vo=he({__name:"TerminalPanel",props:{visible:{type:Boolean}},setup(V){const{t:s}=Se(),c=Ct(),z=V,D={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"}}},k=h(null),m=h([]),n=h(null),T=h(localStorage.getItem(yt)||"default"),E=h(null),C=h(!1),U=h(!1);let B=null;const $=new Map;let A=null,I=null,M=null,f=0,v=null,x=0;const R=L(()=>m.value.find(p=>p.id===n.value)||null),G=L(()=>Object.entries(D).map(([p,g])=>({label:g.label,value:p}))),P=L(()=>D[T.value]?.theme.background??"#1a1a2e");function j(){const p=Oo(),g=qo(),F=g?g.startsWith("https")?"wss:":"ws:":location.protocol==="https:"?"wss:":"ws:";return g?`${F}//${new URL(g).host}/api/hermes/terminal${p?`?token=${encodeURIComponent(p)}`:""}`:`${F}//${location.host}/api/hermes/terminal${p?`?token=${encodeURIComponent(p)}`:""}`}function te(){if(f>=Dl){E.value=s("terminal.connectionFailed"),C.value=!1;return}const p=j();E.value=null,C.value=!0,f++,B=new WebSocket(p),B.onopen=()=>{C.value=!1,E.value=null},B.onmessage=g=>{const F=typeof g.data=="string"?g.data:"";if(F.charCodeAt(0)===123)try{$e(JSON.parse(F))}catch{}else A?.write(F)},B.onclose=g=>{if(C.value=!1,g.code===1e3||g.code===1003||g.code===1008){E.value=s("terminal.connectionClosed");return}setTimeout(te,3e3)},B.onerror=g=>{console.error("[Terminal] WebSocket error:",g),E.value=s("terminal.connectionError")}}function ue(p){!B||B.readyState!==WebSocket.OPEN||B.send(typeof p=="string"?p:JSON.stringify(p))}function $e(p){switch(p.type){case"created":f=0,m.value.push({id:p.id,shell:p.shell,pid:p.pid,title:`${p.shell} #${m.value.length+1}`,createdAt:Date.now(),exited:!1}),J(p.id);break;case"exited":{const g=m.value.find(F=>F.id===p.id);g&&(g.exited=!0,n.value===p.id&&A?.write(`\r
|
|
3
3
|
\x1B[90m[${s("terminal.processExited",{code:p.exitCode})}]\x1B[0m\r
|
|
4
4
|
`));break}case"error":c.error(p.message);break}}function oe(){ue({type:"create"})}function re(p){let g=$.get(p);if(!g){const F=new vn({cursorBlink:!0,fontSize:14,fontFamily:'Menlo, Monaco, "Courier New", monospace',theme:{...D[T.value].theme}}),ge=new un;F.loadAddon(ge),F.loadAddon(new cn),F.onData(Pe=>{B?.readyState===WebSocket.OPEN&&B.send(Pe)}),g={term:F,fitAddon:ge,opened:!1},$.set(p,g)}return g}function J(p){if(n.value===p)return;n.value=p;const g=re(p);A=g.term,I=g.fitAddon,Fe(),ue({type:"switch",sessionId:p})}function me(p){ue({type:"close",sessionId:p}),m.value=m.value.filter(F=>F.id!==p);const g=$.get(p);g&&(g.term.dispose(),$.delete(p)),n.value===p&&(n.value=m.value.length>0?m.value[0].id:null,A=null,I=null,n.value?J(n.value):(Me(),oe()))}function Fe(){if(!k.value)return;const p=k.value;for(;p.firstChild;)p.removeChild(p.firstChild);const g=$.get(n.value);if(g){if(!g.opened)g.term.open(p),g.opened=!0;else{const F=g.term.element;F&&p.appendChild(F)}M?.disconnect(),M=new ResizeObserver(()=>{se(),Q()}),M.observe(k.value),setTimeout(()=>se(),50),setTimeout(()=>se(),200)}}function Me(){if(!k.value)return;const p=k.value;for(;p.firstChild;)p.removeChild(p.firstChild)}function se(){if(I)try{I.fit()}catch{}}function Q(){if(!(!A||!B||B.readyState!==WebSocket.OPEN))try{ue({type:"resize",cols:A.cols,rows:A.rows})}catch{}}function de(p){if(p.touches.length!==1){v=null,x=0;return}v=p.touches[0].clientY,x=0}function Z(p){if(!A||p.touches.length!==1||v===null)return;const g=p.touches[0].clientY;x+=v-g,v=g;const F=Math.trunc(x/wt);F!==0&&(A.scrollLines(F),x-=F*wt,p.preventDefault())}function le(){v=null,x=0}function ne(p){T.value=p,localStorage.setItem(yt,p);const g=D[p]?.theme;if(g)for(const F of $.values())F.term.options.theme={...g}}function ce(p){return new Date(p).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}let _e=!1;return K(()=>z.visible,p=>{p&&!_e&&!B&&(_e=!0,te())},{immediate:!0}),lt(()=>{Me();for(const p of $.values())p.term.dispose();$.clear(),A=null,I=null,B?.close(),B=null}),(p,g)=>(o(),i("div",ml,[U.value?(o(),i("div",{key:0,class:"sidebar-overlay",onClick:g[0]||(g[0]=F=>U.value=!1)})):w("",!0),e("div",{class:X(["terminal-sidebar",{"mobile-visible":U.value}])},[e("div",_l,[e("span",gl,r(t(s)("terminal.sessions")),1),b(t(ke),{trigger:"hover"},{trigger:y(()=>[b(t(H),{quaternary:"",size:"tiny",onClick:oe,circle:""},{icon:y(()=>[...g[3]||(g[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:y(()=>[q(" "+r(t(s)("terminal.newTab")),1)]),_:1})]),e("div",yl,[E.value?(o(),i("div",wl,[g[4]||(g[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(E.value),1),b(t(H),{size:"tiny",onClick:te},{default:y(()=>[q(r(t(s)("common.retry")),1)]),_:1})])):m.value.length===0?(o(),i("div",kl,[C.value?(o(),i(W,{key:0},[q(r(t(s)("common.loading")),1)],64)):(o(),i(W,{key:1},[q(r(t(s)("terminal.noSessions")),1)],64))])):w("",!0),(o(!0),i(W,null,ae(m.value,F=>(o(),i("button",{key:F.id,class:X(["session-item",{active:F.id===n.value,exited:F.exited}]),onClick:ge=>J(F.id)},[e("div",xl,[e("span",Cl,r(F.title),1),e("span",Sl,[e("span",$l,r(F.shell),1),F.exited?(o(),i("span",Ml,r(t(s)("terminal.sessionExited")),1)):(o(),i("span",Pl,r(ce(F.createdAt)),1))])]),m.value.length>1?(o(),Y(t(Ka),{key:0,onPositiveClick:ge=>me(F.id)},{trigger:y(()=>[e("button",{class:"session-item-delete",onClick:g[1]||(g[1]=xt(()=>{},["stop"]))},[...g[5]||(g[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:y(()=>[q(" "+r(t(s)("terminal.closeSession")),1)]),_:1},8,["onPositiveClick"])):w("",!0)],10,bl))),128))])],2),e("div",Tl,[e("header",Il,[R.value?(o(),i("span",Bl,r(R.value.title),1)):w("",!0),e("div",Fl,[b(t(H),{size:"small",onClick:g[2]||(g[2]=F=>U.value=!U.value),class:"sidebar-toggle"},{icon:y(()=>[...g[6]||(g[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:y(()=>[q(" "+r(t(s)("terminal.sessions")),1)]),_:1}),b(t(Be),{value:T.value,options:G.value,size:"small","consistent-menu-width":!1,class:"theme-select","onUpdate:value":ne},null,8,["value","options"]),b(t(H),{size:"small",onClick:oe},{icon:y(()=>[...g[7]||(g[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:y(()=>[q(" "+r(t(s)("terminal.newTab")),1)]),_:1})])]),e("div",Ll,[e("div",{ref_key:"terminalRef",ref:k,class:"terminal-xterm",style:Ne({backgroundColor:P.value}),onTouchstart:de,onTouchmove:Z,onTouchend:le,onTouchcancel:le},null,36)])])]))}})})),Jn=O((()=>{})),ho,Qn=O((()=>{Al(),Al(),Jn(),fe(),ho=pe(vo,[["__scopeId","data-v-e87bb3e6"]])})),El,Rl,zl,Ul,fo,Nl=O((()=>{ve(),An(),Ce(),Oe(),Dn(),bn(),$n(),kn(),Ln(),yn(),Pn(),Cn(),Mn(),El={class:"files-panel-drawer"},Rl={class:"files-main-panel"},zl={class:"main-toolbar"},Ul={class:"files-content"},fo=he({__name:"FilesPanel",setup(V){const s=gn(),{t:c}=Se(),z=h(null),D=h(!1),k=h(!1),m=h("newFile"),n=h(null),T=h(!1);function E($,A){z.value?.show($,A)}function C(){m.value="newFile",n.value=null,k.value=!0}function U(){m.value="newFolder",n.value=null,k.value=!0}function B($){m.value="rename",n.value=$,k.value=!0}return we(()=>{s.fetchEntries("")}),($,A)=>(o(),i("div",El,[T.value?(o(),i("div",{key:0,class:"sidebar-overlay",onClick:A[0]||(A[0]=I=>T.value=!1)})):w("",!0),e("div",{class:X(["files-tree-panel",{"mobile-visible":T.value}])},[b(mn)],2),e("div",Rl,[e("div",zl,[b(t(H),{size:"small",onClick:A[1]||(A[1]=I=>T.value=!T.value),class:"sidebar-toggle"},{icon:y(()=>[...A[5]||(A[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:y(()=>[q(" "+r(t(c)("files.fileTree")),1)]),_:1}),b(Tn,{onShowNewFile:C,onShowNewFolder:U,onShowUpload:A[2]||(A[2]=I=>D.value=!0)})]),b(xn),e("div",Ul,[t(s).editingFile?(o(),Y(Bn,{key:0})):t(s).previewFile?(o(),Y(_n,{key:1})):(o(),Y(wn,{key:2,onContextmenuEntry:E}))])]),b(Sn,{ref_key:"contextMenuRef",ref:z,onRename:B},null,512),b(In,{show:D.value,"onUpdate:show":A[3]||(A[3]=I=>D.value=I)},null,8,["show"]),b(Fn,{show:k.value,"onUpdate:show":A[4]||(A[4]=I=>k.value=I),mode:m.value,entry:n.value},null,8,["show","mode","entry"])]))}})})),Zn=O((()=>{})),po,ei=O((()=>{Nl(),Nl(),Zn(),fe(),po=pe(fo,[["__scopeId","data-v-efc529cd"]])})),Ol,ql,Vl,Hl,Gl,mo,Wl=O((()=>{ve(),Ce(),Qn(),ei(),Ol={class:"drawer-header"},ql={class:"drawer-tabs"},Vl={class:"drawer-content"},Hl={class:"drawer-pane"},Gl={class:"drawer-pane"},mo=he({__name:"DrawerPanel",props:{show:{type:Boolean},activeTab:{default:"files"}},emits:["update:show"],setup(V,{emit:s}){const c=V,z=s,{t:D}=Se(),k=h(c.activeTab);K(()=>c.activeTab,n=>{n&&(k.value=n)});function m(){z("update:show",!1)}return(n,T)=>(o(),Y(Do,{to:"body"},[V.show?(o(),i("div",{key:0,class:"drawer-overlay",onClick:m})):w("",!0),e("div",{class:X(["drawer-panel",{show:V.show}])},[e("div",Ol,[e("div",ql,[e("button",{class:X(["tab-button",{active:k.value==="files"}]),onClick:T[0]||(T[0]=E=>k.value="files")},r(t(D)("drawer.files")),3),e("button",{class:X(["tab-button",{active:k.value==="terminal"}]),onClick:T[1]||(T[1]=E=>k.value="terminal")},r(t(D)("drawer.terminal")),3)]),e("button",{class:"close-button",onClick:m},[...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",Vl,[tt(e("div",Hl,[b(po)],512),[[bt,k.value==="files"]]),tt(e("div",Gl,[b(ho,{visible:k.value==="terminal"&&V.show},null,8,["visible"])],512),[[bt,k.value==="terminal"]])])],2)]))}})})),ti=O((()=>{})),_o,si=O((()=>{Wl(),Wl(),ti(),fe(),_o=pe(mo,[["__scopeId","data-v-9e646a0b"]])})),jl,Yl,Kl,Xl,Jl,Ql,Zl,ea,ta,sa,la,aa,oa,na,ia,ra,ua,da,ca,va,ha,fa,pa,ma,_a,ga,ya,wa,ka,ba,xa,Ca,Sa,$a,Ma,Pa,Ta,Ia,Ba,Fa,La,Da,Aa,Ea,Ra,za,Ua,Na,Oa,qa,Va,Ha,Ga,go,Wa=O((()=>{ve(),Qa(),rt(),nt(),St(),en(),Oe(),Ja(),Ce(),tn(),Rn(),On(),Wn(),Xn(),sn(),si(),ln(),jl={class:"chat-panel"},Yl={class:"session-list-header"},Kl={key:0,class:"session-list-title"},Xl={class:"session-list-actions"},Jl={key:0,class:"session-profile-filter"},Ql={key:1,class:"session-items"},Zl={key:0,class:"session-loading"},ea={key:1,class:"session-empty"},ta={class:"session-group-header session-group-header--static"},sa={class:"session-group-label"},la={class:"session-group-count"},aa={class:"session-model-list"},oa=["onClick"],na={class:"session-model-group-label"},ia={class:"session-model-group-count"},ra={class:"session-model-group-items"},ua=["title","onClick"],da={class:"session-model-item-label"},ca={class:"session-model-item-name"},va={key:0,class:"session-model-item-id"},ha={key:0,class:"session-model-badge-preview"},fa={key:1,class:"session-model-badge-disabled"},pa={key:2,class:"session-model-badge-custom"},ma={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"},_a={key:0,class:"session-model-empty"},ga={class:"session-model-custom"},ya={class:"session-model-custom-row"},wa={class:"session-model-custom-hint"},ka={class:"new-chat-form"},ba={class:"new-chat-field"},xa={class:"new-chat-label"},Ca={class:"new-chat-field"},Sa={class:"new-chat-label"},$a={class:"new-chat-field"},Ma={class:"new-chat-label"},Pa={class:"new-chat-actions"},Ta={class:"chat-main"},Ia={class:"chat-header"},Ba={class:"header-left"},Fa={class:"header-session-title"},La=["title"],Da={class:"header-actions"},Aa={class:"chat-content-wrapper"},Ea={class:"chat-main-content"},Ra={key:0,class:"approval-bar"},za={class:"approval-content"},Ua={class:"approval-main"},Na={class:"approval-kicker"},Oa={class:"approval-title"},qa={class:"approval-desc"},Va={class:"approval-command"},Ha={class:"approval-actions"},Ga={class:"drawer-button-wrapper"},go=he({__name:"ChatPanel",setup(V){const s=it(),c=xe(),z=st(),D=Zo(),k=Xa(),m=Ct(),{t:n}=Se(),T=h(!1),E=h("files"),C=h(!1),U=h("chat"),B=h(!1),$=h(new Set),A=h(!1),I=h(!1),M=h(typeof window>"u"||!window.matchMedia("(max-width: 768px)").matches);let f=null;const v=h(!1);async function x(a){const l=s.sessions.find(u=>u.id===a);await k.push({name:"hermes.session",params:{sessionId:a},query:l?.profile?{profile:l.profile}:void 0}),f?.matches&&(M.value=!1)}function R(a){v.value=a.matches,a.matches&&M.value&&(M.value=!1)}we(()=>{f=window.matchMedia("(max-width: 768px)"),R(f),f.addEventListener("change",R),z.profiles.length===0&&z.fetchProfiles()}),lt(()=>{f?.removeEventListener("change",R)});const G=h(!1),P=h(""),j=h(null),te=h(null),ue=L(()=>s.sessionProfileFilter),$e=L(()=>[{label:n("chat.allProfiles"),value:"__all__"},...z.profiles.map(a=>({label:a.name,value:a.name}))]);async function oe(a){s.sessionProfileFilter=a==="__all__"?null:a,await s.loadSessions(s.sessionProfileFilter)}function re(a){return[...a].sort((l,u)=>(u.updatedAt||0)-(l.updatedAt||0))}const J=L(()=>re(s.sessions.filter(a=>D.isPinned(a.id)))),me=L(()=>re(s.sessions.filter(a=>!D.isPinned(a.id))));K(()=>[s.sessionsLoaded,...s.sessions.map(a=>a.id)],a=>{const l=a.slice(1);!a[0]||l.length===0||D.pruneMissingSessions(l)},{immediate:!0});const Fe=L(()=>s.activeSession?.title||n("chat.newChat")),Me=L(()=>U.value==="live"?n("chat.liveSessions"):Fe.value),se=L(()=>s.activePendingApproval),Q=L(()=>se.value),de=h(!1),Z=h("default"),le=h(""),ne=h(""),ce=h(!1);function _e(a){return c.profileModelGroups.find(l=>l.profile===a)?.groups||[]}function p(a){const l=_e(a),u=c.profileModelGroups.find(ze=>ze.profile===a),N=u?.default_provider||"",mt=u?.default||"",_t=(N?l.find(ze=>ze.provider===N):void 0)||l.find(ze=>ze.models.length>0);return{provider:_t?.provider||"",model:_t?.models.includes(mt)?mt:_t?.models[0]||""}}const g=L(()=>(z.profiles.length>0?z.profiles:[{name:"default"}]).map(a=>({label:a.name,value:a.name}))),F=L(()=>_e(Z.value)),ge=L(()=>F.value.map(a=>({label:a.label||a.provider,value:a.provider}))),Pe=L(()=>{const a=F.value.find(l=>l.provider===le.value);return(a?.models||[]).map(l=>({label:c.displayModelName(l,a?.provider),value:l}))});function Le(){const a=p(Z.value);le.value=a.provider,ne.value=a.model}async function qe(){de.value=!0,ce.value=!0;try{z.profiles.length===0&&await z.fetchProfiles(),c.modelGroups.length===0&&c.profileModelGroups.length===0&&await c.loadModels(),Z.value=z.activeProfileName||z.profiles.find(a=>a.active)?.name||z.profiles[0]?.name||"default",Le()}finally{ce.value=!1}}function ut(a){Z.value=a,Le()}function dt(a){le.value=a,ne.value=Pe.value[0]?.value||""}async function ct(){const a=s.newChat({profile:Z.value,provider:le.value,model:ne.value});await k.push({name:"hermes.session",params:{sessionId:a.id},query:a.profile?{profile:a.profile}:void 0}),de.value=!1}function Te(a){s.respondApproval(a)}function vt(a){return s.sessions.find(l=>l.id===a)?.profile||null}function Ve(a,l){const u=k.resolve({name:"hermes.session",params:{sessionId:a},query:l?{profile:l}:void 0}).href;return`${window.location.origin}${window.location.pathname}${u}`}async function ht(a){const l=a||s.activeSessionId;l&&(await Rt(Ve(l,vt(l)))?m.success(n("common.copied")):m.error(n("common.copied")+" ✗"))}async function He(a){const l=a||s.activeSessionId;l&&(await Rt(l)?m.success(n("common.copied")):m.error(n("common.copied")+" ✗"))}function De(a){D.removePinned(a),s.deleteSession(a),m.success(n("chat.sessionDeleted"))}function d(){I.value||(B.value=!B.value,B.value||($.value.clear(),A.value=!1))}function _(a){I.value||($.value.has(a)?$.value.delete(a):$.value.add(a),$.value=new Set($.value),$.value.size===0&&(A.value=!1))}function S(a){return $.value.has(a)}async function ie(){if($.value.size===0||I.value)return;const a=Array.from($.value);I.value=!0;try{const l=await Vo(a);if(l.deleted>0){for(const u of a)D.removePinned(u);await s.loadSessions(s.sessionProfileFilter),m.success(n("chat.batchDeleteSuccess",{count:l.deleted})),l.failed>0&&m.warning(n("chat.batchDeletePartial",{failed:l.failed}))}else m.error(n("chat.batchDeleteFailed"))}catch{m.error(n("chat.batchDeleteFailed"))}finally{I.value=!1,A.value=!1,B.value=!1,$.value.clear()}}function ye(){return ie(),!1}function Ge(){if(!I.value){$.value.clear();for(const a of s.sessions)a.id!==s.activeSessionId&&$.value.add(a.id);$.value=new Set($.value)}}const We=L(()=>$.value.size),ft=L(()=>s.sessions.some(a=>a.id!==s.activeSessionId)),ee=h(null),ko=L(()=>ee.value?D.isPinned(ee.value):!1),bo=L(()=>ee.value&&s.sessions.find(a=>a.id===ee.value)||null),xo=L(()=>{const a=[{label:n(ko.value?"chat.unpin":"chat.pin"),key:"pin"},{label:n("chat.rename"),key:"rename"},{label:n("chat.setWorkspace"),key:"workspace"}];return bo.value?.source==="cli"&&a.push({label:n("chat.setModel"),key:"model"}),a.push({label:n("chat.export"),key:"export",children:[{label:n("chat.exportFull"),key:"export-full",children:[{label:"JSON",key:"export-full-json"},{label:"TXT",key:"export-full-txt"}]},{label:n("chat.exportCompressed"),key:"export-compressed",children:[{label:"JSON",key:"export-compressed-json"},{label:"TXT",key:"export-compressed-txt"}]}]}),a.push({label:n("chat.copySessionLink"),key:"copy-link"}),a.push({label:n("chat.copySessionId"),key:"copy-id"}),a});function $t(a,l){a.preventDefault(),ee.value=l,je.value=!0,Mt.value=a.clientX,Pt.value=a.clientY}const je=h(!1),Mt=h(0),Pt=h(0);function Tt(a){return a==="export-full-json"?{mode:"full",ext:"json"}:a==="export-full-txt"?{mode:"full",ext:"txt"}:a==="export-compressed-json"?{mode:"compressed",ext:"json"}:a==="export-compressed-txt"?{mode:"compressed",ext:"txt"}:null}async function Co(a){if(je.value=!1,!!ee.value){if(a==="pin"){D.togglePinned(ee.value);return}if(a==="copy-link")ht(ee.value);else if(a==="copy-id")He(ee.value);else if(Tt(a)){const{mode:l,ext:u}=Tt(a),N=l==="compressed"?m.loading(n("chat.exportCompressing"),{duration:0}):null;try{await Go(ee.value,l,u),N?.destroy(),m.success(n("chat.exportSuccess"))}catch{N?.destroy(),m.error(n("chat.exportFailed"))}}else if(a==="workspace"){const l=s.sessions.find(u=>u.id===ee.value);Ae.value=ee.value,Ie.value=l?.workspace||"",Ye.value=!0}else if(a==="model")await Po(ee.value);else if(a==="rename"){const l=s.sessions.find(u=>u.id===ee.value);j.value=ee.value,P.value=l?.title||"",G.value=!0,be(()=>{te.value?.focus()})}}}function So(){je.value=!1}async function It(){if(!(!j.value||!P.value.trim())){if(await jo(j.value,P.value.trim())){const a=s.sessions.find(l=>l.id===j.value);a&&(a.title=P.value.trim()),s.activeSession?.id===j.value&&(s.activeSession.title=P.value.trim()),m.success(n("chat.renamed"))}else m.error(n("chat.renameFailed"));G.value=!1}}const Ye=h(!1),Ie=h(""),Ae=h(null);async function $o(){if(Ae.value){if(await Qo(Ae.value,Ie.value||null)){const a=s.sessions.find(l=>l.id===Ae.value);a&&(a.workspace=Ie.value||null),s.activeSession?.id===Ae.value&&(s.activeSession.workspace=Ie.value||null),m.success(n("chat.workspaceSet"))}else m.error(n("chat.workspaceSetFailed"));Ye.value=!1}}const Ke=h(!1),Xe=h(null),Ee=h(""),Je=h({}),Qe=h(""),Re=h(""),Ze=h(""),et=h(""),Bt=L(()=>s.sessions.find(a=>a.id===Xe.value)?.profile||null),pt=L(()=>Bt.value?_e(Bt.value):[]),Mo=L(()=>pt.value.map(a=>({label:a.label,value:a.provider}))),Ft=L(()=>pt.value.map(a=>({...a,models:[...a.models,...(c.customModels[a.provider]||[]).filter(l=>!a.models.includes(l))]}))),Lt=L(()=>{const a=Ee.value.trim().toLowerCase();return a?Ft.value.map(l=>({...l,models:l.models.filter(u=>{const N=c.displayModelName(u,l.provider);return u.toLowerCase().includes(a)||N.toLowerCase().includes(a)})})).filter(l=>l.models.length>0||l.label.toLowerCase().includes(a)):Ft.value});async function Po(a){c.modelGroups.length===0&&c.profileModelGroups.length===0&&await c.loadModels();const l=s.sessions.find(N=>N.id===a),u=l?.profile?p(l.profile):{provider:"",model:""};Xe.value=a,Qe.value=l?.model||u.model||"",Re.value=l?.provider||u.provider||"",et.value=Re.value,Ee.value="",Ze.value="",Je.value={},Ke.value=!0}function Dt(a){return!!Je.value[a]}function To(a){Je.value[a]=!Je.value[a]}function Io(a,l){return(c.customModels[l]||[]).includes(a)}function Bo(a,l){return c.displayModelName(a,l)}function Fo(a,l){return c.getModelAlias(a,l)}async function At(a,l){pt.value.find(u=>u.provider===l)?.model_meta?.[a]?.disabled||!Xe.value||(await s.switchSessionModel(a,l,Xe.value)?(Qe.value=a,Re.value=l,Ke.value=!1,m.success(n("chat.modelSet"))):m.error(n("chat.modelSetFailed")))}async function Lo(){const a=Ze.value.trim(),l=et.value;!a||!l||await At(a,l)}return(a,l)=>(o(),i("div",jl,[U.value==="chat"?(o(),i("div",{key:0,class:X(["session-backdrop",{active:M.value}]),onClick:l[0]||(l[0]=u=>M.value=!1)},null,2)):w("",!0),U.value==="chat"?(o(),i("aside",{key:1,class:X(["session-list",{collapsed:!M.value}])},[e("div",Yl,[M.value?(o(),i("span",Kl,r(t(n)("chat.webUiSessions")),1)):w("",!0),e("div",Xl,[e("button",{class:"session-close-btn",onClick:l[1]||(l[1]=u=>M.value=!1)},[...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:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])]),B.value?w("",!0):(o(),Y(t(H),{key:0,quaternary:"",size:"tiny",onClick:d,title:t(n)("chat.toggleBatchMode")},{icon:y(()=>[...l[24]||(l[24]=[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"])),B.value?(o(),Y(t(H),{key:1,quaternary:"",size:"tiny",onClick:Ge,disabled:!ft.value||I.value,title:t(n)("chat.selectAll")},{icon:y(()=>[...l[25]||(l[25]=[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"])):w("",!0),B.value&&We.value>0?(o(),Y(t(Ka),{key:2,show:A.value,"onUpdate:show":l[2]||(l[2]=u=>A.value=u),"positive-button-props":{loading:I.value,disabled:I.value},"negative-button-props":{disabled:I.value},onPositiveClick:ye},{trigger:y(()=>[b(t(H),{quaternary:"",size:"tiny",type:"error",loading:I.value,disabled:I.value},{icon:y(()=>[...l[26]||(l[26]=[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},8,["loading","disabled"])]),default:y(()=>[q(" "+r(t(n)("chat.confirmBatchDelete",{count:We.value})),1)]),_:1},8,["show","positive-button-props","negative-button-props"])):w("",!0),B.value?(o(),Y(t(H),{key:3,quaternary:"",size:"tiny",onClick:d,disabled:I.value},{icon:y(()=>[...l[27]||(l[27]=[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},8,["disabled"])):w("",!0),b(t(H),{quaternary:"",size:"tiny",circle:"",onClick:qe},{icon:y(()=>[...l[28]||(l[28]=[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})])]),M.value?(o(),i("div",Jl,[b(t(Be),{value:ue.value||"__all__",options:$e.value,size:"small",loading:t(z).loading,"onUpdate:value":oe},null,8,["value","options","loading"])])):w("",!0),M.value?(o(),i("div",Ql,[t(s).isLoadingSessions&&t(s).sessions.length===0?(o(),i("div",Zl,r(t(n)("common.loading")),1)):t(s).sessions.length===0?(o(),i("div",ea,r(t(n)("chat.noSessions")),1)):w("",!0),J.value.length>0?(o(),i(W,{key:2},[e("div",ta,[e("span",sa,r(t(n)("chat.pinned")),1),e("span",la,r(J.value.length),1)]),(o(!0),i(W,null,ae(J.value,u=>(o(),Y(Nt,{key:`pinned-${u.id}`,session:u,active:u.id===t(s).activeSessionId,pinned:!0,"can-delete":u.id!==t(s).activeSessionId||t(s).sessions.length>1,streaming:t(s).isSessionLive(u.id),selectable:B.value,selected:S(u.id),"show-profile":!0,onSelect:N=>x(u.id),onContextmenu:N=>$t(N,u.id),onDelete:N=>De(u.id),onToggleSelect:N=>_(u.id)},null,8,["session","active","can-delete","streaming","selectable","selected","onSelect","onContextmenu","onDelete","onToggleSelect"]))),128))],64)):w("",!0),(o(!0),i(W,null,ae(me.value,u=>(o(),Y(Nt,{key:u.id,session:u,active:u.id===t(s).activeSessionId,pinned:!1,"can-delete":u.id!==t(s).activeSessionId||t(s).sessions.length>1,streaming:t(s).isSessionLive(u.id),selectable:B.value,selected:S(u.id),"show-profile":!0,onSelect:N=>x(u.id),onContextmenu:N=>$t(N,u.id),onDelete:N=>De(u.id),onToggleSelect:N=>_(u.id)},null,8,["session","active","can-delete","streaming","selectable","selected","onSelect","onContextmenu","onDelete","onToggleSelect"]))),128))])):w("",!0)],2)):w("",!0),b(t(Eo),{placement:"bottom-start",trigger:"manual",x:Mt.value,y:Pt.value,options:xo.value,show:je.value,onSelect:Co,onClickoutside:So},null,8,["x","y","options","show"]),b(t(Ue),{show:G.value,"onUpdate:show":l[4]||(l[4]=u=>G.value=u),preset:"dialog",title:t(n)("chat.renameSession"),"positive-text":t(n)("common.ok"),"negative-text":t(n)("common.cancel"),onPositiveClick:It},{default:y(()=>[b(t(gt),{ref_key:"renameInputRef",ref:te,value:P.value,"onUpdate:value":l[3]||(l[3]=u=>P.value=u),placeholder:t(n)("chat.enterNewTitle"),onKeydown:Et(It,["enter"])},null,8,["value","placeholder"])]),_:1},8,["show","title","positive-text","negative-text"]),b(t(Ue),{show:Ye.value,"onUpdate:show":l[6]||(l[6]=u=>Ye.value=u),preset:"dialog",title:t(n)("chat.setWorkspaceTitle"),"positive-text":t(n)("common.ok"),"negative-text":t(n)("common.cancel"),style:{width:"520px"},onPositiveClick:$o},{default:y(()=>[b(so,{modelValue:Ie.value,"onUpdate:modelValue":l[5]||(l[5]=u=>Ie.value=u)},null,8,["modelValue"])]),_:1},8,["show","title","positive-text","negative-text"]),b(t(Ue),{show:Ke.value,"onUpdate:show":l[10]||(l[10]=u=>Ke.value=u),preset:"card",title:t(n)("chat.setModelTitle"),style:{width:"min(480px, calc(100vw - 32px))"},"mask-closable":!0},{default:y(()=>[b(t(gt),{value:Ee.value,"onUpdate:value":l[7]||(l[7]=u=>Ee.value=u),placeholder:t(n)("models.searchPlaceholder"),clearable:"",size:"small",class:"session-model-search"},null,8,["value","placeholder"]),e("div",aa,[(o(!0),i(W,null,ae(Lt.value,u=>(o(),i("div",{key:u.provider,class:"session-model-group"},[e("div",{class:"session-model-group-header",onClick:N=>To(u.provider)},[(o(),i("svg",{class:X(["session-model-group-arrow",{collapsed:Dt(u.provider)}]),width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...l[29]||(l[29]=[e("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2)),e("span",na,r(u.label),1),e("span",ia,r(u.models.length),1)],8,oa),tt(e("div",ra,[(o(!0),i(W,null,ae(u.models,N=>(o(),i("div",{key:N,class:X(["session-model-item",{active:N===Qe.value&&u.provider===Re.value,disabled:!!u.model_meta?.[N]?.disabled}]),title:u.model_meta?.[N]?.disabled?t(n)("models.disabledTooltip"):"",onClick:mt=>At(N,u.provider)},[e("span",da,[e("span",ca,r(Bo(N,u.provider)),1),Fo(N,u.provider)?(o(),i("span",va,r(t(n)("models.aliasCanonical",{model:N})),1)):w("",!0)]),u.model_meta?.[N]?.preview?(o(),i("span",ha,r(t(n)("models.previewBadge")),1)):w("",!0),u.model_meta?.[N]?.disabled?(o(),i("span",fa,r(t(n)("models.disabledBadge")),1)):w("",!0),Io(N,u.provider)?(o(),i("span",pa,r(t(n)("models.customBadge")),1)):w("",!0),N===Qe.value&&u.provider===Re.value?(o(),i("svg",ma,[...l[30]||(l[30]=[e("polyline",{points:"20 6 9 17 4 12"},null,-1)])])):w("",!0)],10,ua))),128))],512),[[bt,!Dt(u.provider)]])]))),128)),Lt.value.length===0?(o(),i("div",_a,r(Ee.value?"No results":"No models"),1)):w("",!0),e("div",ga,[e("div",ya,[b(t(Be),{value:et.value,"onUpdate:value":l[8]||(l[8]=u=>et.value=u),options:Mo.value,size:"small",class:"session-model-custom-provider"},null,8,["value","options"]),b(t(gt),{value:Ze.value,"onUpdate:value":l[9]||(l[9]=u=>Ze.value=u),placeholder:t(n)("models.customModelPlaceholder"),size:"small",class:"session-model-custom-input",onKeydown:Et(Lo,["enter"])},null,8,["value","placeholder"])]),e("div",wa,r(t(n)("models.customModelHint")),1)])])]),_:1},8,["show","title"]),b(t(Ue),{show:de.value,"onUpdate:show":l[13]||(l[13]=u=>de.value=u),preset:"card",title:t(n)("chat.newChat"),style:{width:"min(440px, calc(100vw - 32px))"},"mask-closable":!0},{footer:y(()=>[e("div",Pa,[b(t(H),{onClick:l[12]||(l[12]=u=>de.value=!1)},{default:y(()=>[q(r(t(n)("common.cancel")),1)]),_:1}),b(t(H),{type:"primary",disabled:!Z.value||!le.value||!ne.value,onClick:ct},{default:y(()=>[q(r(t(n)("chat.newChat")),1)]),_:1},8,["disabled"])])]),default:y(()=>[e("div",ka,[e("label",ba,[e("span",xa,r(t(n)("sidebar.profiles")),1),b(t(Be),{value:Z.value,options:g.value,loading:ce.value||t(z).loading,"onUpdate:value":ut},null,8,["value","options","loading"])]),e("label",Ca,[e("span",Sa,r(t(n)("models.provider")),1),b(t(Be),{value:le.value,options:ge.value,disabled:ce.value,"onUpdate:value":dt},null,8,["value","options","disabled"])]),e("label",$a,[e("span",Ma,r(t(n)("models.models")),1),b(t(Be),{value:ne.value,"onUpdate:value":l[11]||(l[11]=u=>ne.value=u),options:Pe.value,disabled:ce.value||!le.value,filterable:""},null,8,["value","options","disabled"])])])]),_:1},8,["show","title"]),e("div",Ta,[e("header",Ia,[e("div",Ba,[U.value==="chat"?(o(),Y(t(H),{key:0,quaternary:"",size:"small",onClick:l[14]||(l[14]=u=>M.value=!M.value),circle:""},{icon:y(()=>[...l[31]||(l[31]=[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})):w("",!0),e("span",Fa,r(Me.value),1),t(s).activeSession?.workspace?(o(),i("span",{key:1,class:"workspace-badge",title:t(s).activeSession.workspace},"📁 "+r(t(s).activeSession.workspace.split("/").pop()||t(s).activeSession.workspace),9,La)):w("",!0)]),e("div",Da,[U.value==="chat"?(o(),i(W,{key:0},[b(t(ke),{trigger:"hover"},{trigger:y(()=>[b(t(H),{quaternary:"",size:"small",onClick:l[15]||(l[15]=u=>C.value=!C.value),circle:""},{icon:y(()=>[...l[32]||(l[32]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("path",{d:"M3 12h18M3 6h18M3 18h18"})],-1)])]),_:1})]),default:y(()=>[q(" "+r(t(n)("chat.outlineTitle")),1)]),_:1}),b(t(ke),{trigger:"hover"},{trigger:y(()=>[b(t(H),{quaternary:"",size:"small",onClick:l[16]||(l[16]=u=>He()),circle:""},{icon:y(()=>[...l[33]||(l[33]=[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:y(()=>[q(" "+r(t(n)("chat.copySessionId")),1)]),_:1}),b(t(H),{size:"small",circle:v.value,onClick:qe},{icon:y(()=>[...l[34]||(l[34]=[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:y(()=>[v.value?w("",!0):(o(),i(W,{key:0},[q(r(t(n)("chat.newChat")),1)],64))]),_:1},8,["circle"])],64)):w("",!0)])]),U.value==="chat"?(o(),i(W,{key:0},[e("div",Aa,[e("div",Ea,[b(co)]),C.value?(o(),Y(on,{key:0,messages:t(s).messages},null,8,["messages"])):w("",!0)]),Q.value?(o(),i("div",Ra,[l[35]||(l[35]=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",za,[e("div",Ua,[e("div",Na,r(t(n)("chat.approvalKicker")),1),e("div",Oa,r(t(n)("chat.approvalTitle")),1),e("div",qa,r(Q.value.description),1),e("code",Va,r(Q.value.command),1)]),e("div",Ha,[Q.value.choices.includes("once")?(o(),Y(t(H),{key:0,size:"small",type:"primary",onClick:l[17]||(l[17]=u=>Te("once"))},{default:y(()=>[q(r(t(n)("chat.approvalAllowOnce")),1)]),_:1})):w("",!0),Q.value.choices.includes("session")?(o(),Y(t(H),{key:1,size:"small",secondary:"",onClick:l[18]||(l[18]=u=>Te("session"))},{default:y(()=>[q(r(t(n)("chat.approvalAllowSession")),1)]),_:1})):w("",!0),Q.value.choices.includes("always")?(o(),Y(t(H),{key:2,size:"small",secondary:"",onClick:l[19]||(l[19]=u=>Te("always"))},{default:y(()=>[q(r(t(n)("chat.approvalAlways")),1)]),_:1})):w("",!0),Q.value.choices.includes("deny")?(o(),Y(t(H),{key:3,size:"small",type:"error",secondary:"",onClick:l[20]||(l[20]=u=>Te("deny"))},{default:y(()=>[q(r(t(n)("chat.approvalDeny")),1)]),_:1})):w("",!0)])])])):w("",!0),b(ao)],64)):(o(),Y(no,{key:1,"human-only":t(D).humanOnly},null,8,["human-only"]))]),e("div",Ga,[e("div",{class:"drawer-button",onClick:l[21]||(l[21]=u=>T.value=!0)},[...l[36]||(l[36]=[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)])])]),b(_o,{show:T.value,"onUpdate:show":l[22]||(l[22]=u=>T.value=u),"active-tab":E.value},null,8,["show","active-tab"])]))}})})),li=O((()=>{})),yo,ai=O((()=>{Wa(),Wa(),li(),fe(),yo=pe(go,[["__scopeId","data-v-c60e1a36"]])})),ja,wo,Ya=O((()=>{ve(),Ja(),ai(),nt(),rt(),St(),Jo(),ja={class:"chat-view"},wo=he({__name:"ChatView",setup(V){const s=xe(),c=it(),z=st(),D=Xo(),k=No(),m=Xa(),n=L(()=>{const C=k.params.sessionId;return typeof C=="string"&&C.trim()?C:null}),T=L(()=>{const C=k.query.profile;return typeof C=="string"&&C.trim()?C:null});async function E(){await c.loadSessions(T.value,n.value),n.value&&c.activeSessionId!==n.value&&await m.replace({name:"hermes.chat"})}return we(async()=>{s.loadModels(),await Promise.all([z.fetchProfiles(),D.fetchSettings()]),await E()}),K([n,T],async([C])=>{if(c.sessionsLoaded){if(!C){await c.loadSessions(T.value);return}if(!(c.activeSessionId===C&&(!T.value||c.activeSession?.profile===T.value))){if(T.value){await E();return}if(!c.sessions.some(U=>U.id===C)){await m.replace({name:"hermes.chat"});return}await c.switchSession(C)}}}),(C,U)=>(o(),i("div",ja,[b(yo)]))}})})),oi=O((()=>{})),ni,ii=O((()=>{Ya(),Ya(),oi(),fe(),ni=pe(wo,[["__scopeId","data-v-217b7490"]])}));ii();export{ni as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as g}from"./rolldown-runtime-BKwlnUi0.js";import{C as Oe,Ct as _t,E as ft,Ht as h,I as E,L as te,Pt as x,Q as Re,R as vt,S as qe,T as mt,Tt as w,U as ht,W as M,X as wt,Z as ae,a as gt,at as $,bt as Ae,ct as F,dt as ie,gt as Ke,h as J,ht as yt,it as O,l as Ft,lt as P,mt as kt,nt as y,r as bt,rt as R,st as S,t as B,tt as X,vt as b,y as V,z as Ct,zt as e}from"./ui-vendor-BMwF7QXa.js";import{d as xt,n as U,r as L,u as St}from"./vue-vendor-kBYBtqCg.js";import{a as Ve,d as q,l as $t,n as A,o as Xe,s as He,t as K}from"./_plugin-vue_export-helper-B8gz9Iqn.js";import{E as Je,k as We}from"./index-Cuk9R8hy.js";import{An as Tt,On as Et,kn as Dt,t as Mt}from"./monaco-editor-DVKTRnZT.js";import{n as zt,t as Pt}from"./clipboard-4x9B6X3a.js";import{n as Bt,t as Ut}from"./MarkdownRenderer-BbsOzYq-.js";async function Ge(i=""){const l=new URLSearchParams;i&&l.set("path",i);const t=l.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,l){await q("/api/hermes/files/write",{method:"PUT",body:JSON.stringify({path:i,content:l})})}async function Lt(i,l=!1){await q("/api/hermes/files/delete",{method:"DELETE",body:JSON.stringify({path:i,recursive:l})})}async function jt(i,l){await q("/api/hermes/files/rename",{method:"POST",body:JSON.stringify({oldPath:i,newPath:l})})}async function It(i){await q("/api/hermes/files/mkdir",{method:"POST",body:JSON.stringify({path:i})})}async function Nt(i,l){await q("/api/hermes/files/copy",{method:"POST",body:JSON.stringify({srcPath:i,destPath:l})})}async function Ot(i,l){const t=He(),n=new FormData;for(const C of l)n.append("file",C);const a=new URLSearchParams;i&&a.set("path",i);const s=a.toString(),r=`${t}/api/hermes/files/upload${s?`?${s}`:""}`,u={},_=Xe();_&&(u.Authorization=`Bearer ${_}`);const p=Ve();p&&(u["X-Hermes-Profile"]=p);const f=await fetch(r,{method:"POST",headers:u,body:n});if(!f.ok){const C=await f.json().catch(()=>({error:`HTTP ${f.status}`}));throw new Error(C.error||`Upload failed: ${f.status}`)}return(await f.json()).files}function Rt(i,l){const t=He(),n=new URLSearchParams({path:i});l&&n.set("name",l);const a=Ve();a&&n.set("profile",a);const s=Xe();return s&&n.set("token",s),`${t}/api/hermes/download?${n.toString()}`}var Y=g((()=>{$t()}));function qt(i){const l=i.split("/").pop()||"";return l==="Dockerfile"?"dockerfile":l==="Makefile"?"makefile":Ye["."+l.split(".").pop()?.toLowerCase()]||"plaintext"}function Q(i){const l=i.lastIndexOf(".");return l>=0?i.slice(l).toLowerCase():""}function Z(i){return Qe.has(Q(i))}function ee(i){const l=Q(i);return l===".md"||l===".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(Q(i))}function H(i,l,t){return!!(i===l||t&&i.startsWith(l+"/"))}var Ye,Qe,z,j=g((()=>{xt(),M(),Y(),Ye={".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"},Qe=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".bmp",".ico"]),z=St("files",()=>{const i=x(""),l=x([]),t=x(!1),n=x("name"),a=x("asc"),s=x(null),r=x(null),u=X(()=>i.value?i.value.split("/").filter(Boolean):[]),_=X(()=>{const o=[...l.value];return o.sort((k,I)=>{if(k.isDir!==I.isDir)return k.isDir?-1:1;let N=0;switch(n.value){case"name":N=k.name.localeCompare(I.name);break;case"size":N=k.size-I.size;break;case"modTime":N=k.modTime.localeCompare(I.modTime);break}return a.value==="asc"?N:-N}),o});async function p(o){o!==void 0&&o!==i.value&&(r.value=null),o!==void 0&&(i.value=o),t.value=!0;try{l.value=(await Ge(i.value)).entries}catch(k){throw console.error("Failed to fetch files:",k),k}finally{t.value=!1}}function f(o){return p(o)}function C(){const o=i.value.split("/").filter(Boolean);return o.pop(),p(o.join("/"))}async function c(o){const k=await se(o);s.value={path:o,content:k.content,originalContent:k.content,language:qt(o)}}async function d(){s.value&&(await le(s.value.path,s.value.content),s.value.originalContent=s.value.content)}function v(){s.value=null}async function D(o){if(Z(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 m(o){const k=i.value?`${i.value}/${o}`:o;await It(k),await p()}async function W(o){const k=i.value?`${i.value}/${o}`:o;await le(k,""),await p()}async function rt(o){await Lt(o.path,o.isDir),r.value&&H(r.value.path,o.path,o.isDir)&&(r.value=null),s.value&&H(s.value.path,o.path,o.isDir)&&(s.value=null),await p()}async function ut(o,k){const I=o.path.includes("/")?o.path.slice(0,o.path.lastIndexOf("/")):"",N=I?`${I}/${k}`:k;await jt(o.path,N),r.value&&H(r.value.path,o.path,o.isDir)&&(r.value=null),s.value&&H(s.value.path,o.path,o.isDir)&&(s.value=null),await p()}async function ct(o,k){await Nt(o.path,k),await p()}async function dt(o){await Ot(i.value,o),await p()}function pt(o){n.value===o?a.value=a.value==="asc"?"desc":"asc":(n.value=o,a.value="asc")}return{currentPath:i,entries:l,loading:t,sortBy:n,sortOrder:a,editingFile:s,previewFile:r,pathSegments:u,sortedEntries:_,hasUnsavedChanges:X(()=>s.value?s.value.content!==s.value.originalContent:!1),fetchEntries:p,navigateTo:f,navigateUp:C,openEditor:c,saveEditor:d,closeEditor:v,openPreview:D,closePreview:T,createDir:m,createFile:W,deleteEntry:rt,renameEntry:ut,copyEntry:ct,uploadFiles:dt,setSort:pt}})})),ne,Ze,oe=g((()=>{M(),B(),U(),j(),Y(),ne={class:"file-tree"},Ze=P({__name:"FileTree",setup(i){const{t:l}=L(),t=z(),n=x([]),a=x([]);async function s(p){try{return(await Ge(p)).entries.filter(f=>f.isDir).sort((f,C)=>f.name.localeCompare(C.name)).map(f=>({key:f.path,label:f.name,isLeaf:!1}))}catch{return[]}}async function r(p){p.children=await s(p.key)}function u(p){p.length>0&&(a.value=p,t.navigateTo(p[0]))}function _(){a.value=[],t.navigateTo("")}return Ke(async()=>{n.value=await s("")}),(p,f)=>(b(),$("div",ne,[y("div",{class:"tree-header",onClick:_},[f[0]||(f[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,h(e(l)("files.breadcrumbRoot")),1)]),F(e(gt),{data:n.value,"selected-keys":a.value,"on-load":r,"expand-on-click":"","block-line":"","onUpdate:selectedKeys":u},null,8,["data","selected-keys"])]))}})})),At=g((()=>{})),Kt,va=g((()=>{oe(),oe(),At(),A(),Kt=K(Ze,[["__scopeId","data-v-7f00b3bc"]])})),re,et,ue=g((()=>{M(),U(),B(),j(),re={class:"file-breadcrumb"},et=P({__name:"FileBreadcrumb",setup(i){const{t:l}=L(),t=z();function n(a){if(a<0)t.navigateTo("");else{const s=t.pathSegments.slice(0,a+1).join("/");t.navigateTo(s)}}return(a,s)=>(b(),$("div",re,[F(e(vt),null,{default:w(()=>[F(e(te),{onClick:s[0]||(s[0]=r=>n(-1))},{default:w(()=>[S(h(e(l)("files.breadcrumbRoot")),1)]),_:1}),(b(!0),$(Re,null,Ae(e(t).pathSegments,(r,u)=>(b(),R(e(te),{key:u,onClick:_=>n(u)},{default:w(()=>[S(h(r),1)]),_:2},1032,["onClick"]))),128))]),_:1})]))}})})),Vt=g((()=>{})),Xt,ma=g((()=>{ue(),ue(),Vt(),A(),Xt=K(et,[["__scopeId","data-v-061302de"]])})),ce,tt,de=g((()=>{M(),B(),U(),j(),ce={class:"file-toolbar"},tt=P({__name:"FileToolbar",emits:["showNewFile","showNewFolder","showUpload"],setup(i,{emit:l}){const{t}=L(),n=V(),a=z(),s=l;async function r(){try{await a.fetchEntries()}catch{n.error(t("files.backendError"))}}return(u,_)=>(b(),$("div",ce,[F(e(J),{size:8,wrap:!0,class:"toolbar-space"},{default:w(()=>[F(e(E),{size:"small",onClick:_[0]||(_[0]=p=>s("showNewFile")),class:"toolbar-btn"},{default:w(()=>[S(h(e(t)("files.newFile")),1)]),_:1}),F(e(E),{size:"small",onClick:_[1]||(_[1]=p=>s("showNewFolder")),class:"toolbar-btn"},{default:w(()=>[S(h(e(t)("files.newFolder")),1)]),_:1}),F(e(E),{size:"small",onClick:_[2]||(_[2]=p=>s("showUpload")),class:"toolbar-btn"},{default:w(()=>[S(h(e(t)("files.upload")),1)]),_:1}),F(e(E),{size:"small",onClick:r,class:"toolbar-btn"},{default:w(()=>[S(h(e(t)("files.refresh")),1)]),_:1})]),_:1})]))}})})),Ht=g((()=>{})),Jt,ha=g((()=>{de(),de(),Ht(),A(),Jt=K(tt,[["__scopeId","data-v-64269d74"]])})),pe,_e,fe,ve,me,he,we,ge,ye,Fe,ke,be,at,Ce=g((()=>{M(),B(),U(),j(),We(),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"},at=P({__name:"FileList",emits:["contextmenu-entry"],setup(i,{emit:l}){const{t}=L(),n=V(),a=z(),s=l;function r(c){if(c===0)return"—";const d=["B","KB","MB","GB"];let v=0,D=c;for(;D>=1024&&v<d.length-1;)D/=1024,v++;return`${D.toFixed(v===0?0:1)} ${d[v]}`}function u(c){return c?new Date(c).toLocaleString():"—"}function _(c){return c.isDir?"📁":{yaml:"⚙️",yml:"⚙️",json:"📋",toml:"⚙️",md:"📝",txt:"📄",log:"📄",py:"🐍",js:"📜",ts:"📜",vue:"💚",png:"🖼️",jpg:"🖼️",jpeg:"🖼️",gif:"🖼️",svg:"🖼️",webp:"🖼️",zip:"📦",gz:"📦",tar:"📦",sh:"⚡",bash:"⚡"}[c.name.split(".").pop()?.toLowerCase()||""]||"📄"}function p(c){c.isDir?a.navigateTo(c.path):G(c.name)?a.openEditor(c.path):(Z(c.name)||ee(c.name))&&a.openPreview(c)}function f(c,d){c.preventDefault(),s("contextmenu-entry",c,d)}async function C(c){try{await Je(c.path,c.name)}catch(d){n.error(d.message||t("files.backendError"))}}return(c,d)=>(b(),$("div",pe,[F(e(Ft),{show:e(a).loading},{default:w(()=>[!e(a).loading&&e(a).sortedEntries.length===0?(b(),R(e(ht),{key:0,description:e(t)("files.emptyDir")},null,8,["description"])):(b(),$("div",_e,[y("div",fe,[y("div",{class:"file-name sort-header",onClick:d[0]||(d[0]=v=>e(a).setSort("name"))},[S(h(e(t)("files.name"))+" ",1),e(a).sortBy==="name"?(b(),$("span",ve,h(e(a).sortOrder==="asc"?"↑":"↓"),1)):O("",!0)]),y("div",{class:"file-size sort-header",onClick:d[1]||(d[1]=v=>e(a).setSort("size"))},[S(h(e(t)("files.size"))+" ",1),e(a).sortBy==="size"?(b(),$("span",me,h(e(a).sortOrder==="asc"?"↑":"↓"),1)):O("",!0)]),y("div",{class:"file-date sort-header",onClick:d[2]||(d[2]=v=>e(a).setSort("modTime"))},[S(h(e(t)("files.modified"))+" ",1),e(a).sortBy==="modTime"?(b(),$("span",he,h(e(a).sortOrder==="asc"?"↑":"↓"),1)):O("",!0)]),d[3]||(d[3]=y("div",{class:"file-actions-placeholder"},null,-1))]),(b(!0),$(Re,null,Ae(e(a).sortedEntries,v=>(b(),$("div",{key:v.path,class:"file-list-row",onDblclick:D=>p(v),onContextmenu:D=>f(D,v)},[y("div",ge,[y("span",ye,h(_(v)),1),y("span",null,h(v.name),1)]),y("div",Fe,h(v.isDir?"—":r(v.size)),1),y("div",ke,h(u(v.modTime)),1),y("div",be,[e(G)(v.name)&&!v.isDir?(b(),R(e(E),{key:0,size:"tiny",quaternary:"",onClick:ae(D=>e(a).openEditor(v.path),["stop"]),title:e(t)("files.edit")},{default:w(()=>[...d[4]||(d[4]=[S("✏️",-1)])]),_:1},8,["onClick","title"])):O("",!0),v.isDir?O("",!0):(b(),R(e(E),{key:1,size:"tiny",quaternary:"",onClick:ae(D=>C(v),["stop"]),title:e(t)("files.download")},{default:w(()=>[...d[5]||(d[5]=[S("⬇️",-1)])]),_:1},8,["onClick","title"]))])],40,we))),128))]))]),_:1},8,["show"])]))}})})),Wt=g((()=>{})),Gt,wa=g((()=>{Ce(),Ce(),Wt(),A(),Gt=K(at,[["__scopeId","data-v-ab2593c7"]])}));function Yt(i){return i.absolutePath||i.path}var Qt=g((()=>{})),it,xe=g((()=>{M(),B(),U(),j(),We(),zt(),Qt(),it=P({__name:"FileContextMenu",emits:["rename"],setup(i,{expose:l,emit:t}){const{t:n}=L(),a=V(),s=Oe(),r=z(),u=x(!1),_=x(0),p=x(0),f=x(null),C=t;function c(T,m){f.value=m,_.value=T.clientX,p.value=T.clientY,u.value=!1,kt(()=>{u.value=!0})}function d(){const T=f.value;if(!T)return[];const m=[];return T.isDir?m.push({label:n("files.open"),key:"open"}):(G(T.name)&&m.push({label:n("files.edit"),key:"edit"}),(Z(T.name)||ee(T.name))&&m.push({label:n("files.preview"),key:"preview"}),m.push({label:n("files.download"),key:"download"})),m.push({type:"divider",key:"d1"}),m.push({label:n("files.copyPath"),key:"copyPath"}),m.push({label:n("files.rename"),key:"rename"}),m.push({type:"divider",key:"d2"}),m.push({label:n("files.delete"),key:"delete"}),m}async function v(T){u.value=!1;const m=f.value;if(m)switch(T){case"open":r.navigateTo(m.path);break;case"edit":try{await r.openEditor(m.path)}catch{a.error(n("files.backendError"))}break;case"preview":try{await r.openPreview(m)}catch{a.error(n("files.backendError"))}break;case"download":try{await Je(m.path,m.name)}catch(W){a.error(W.message)}break;case"copyPath":await Pt(Yt(m))?a.success(n("files.pathCopied")):a.error(n("files.pathCopied")+" ✗");break;case"rename":C("rename",m);break;case"delete":s.warning({title:n("files.delete"),content:m.isDir?n("files.confirmDeleteDir",{name:m.name}):n("files.confirmDelete",{name:m.name}),positiveText:n("common.delete"),negativeText:n("common.cancel"),onPositiveClick:async()=>{try{await r.deleteEntry(m),a.success(n("files.deleted"))}catch{a.error(n("files.deleteFailed"))}}});break}}function D(){u.value=!1}return l({show:c}),(T,m)=>(b(),R(e(mt),{show:u.value,x:_.value,y:p.value,options:d(),placement:"bottom-start",trigger:"manual",onSelect:v,onClickoutside:D},null,8,["show","x","y","options"]))}})})),Zt,ga=g((()=>{xe(),xe(),Zt=it})),Se,$e,Te,st,Ee=g((()=>{M(),B(),U(),j(),Mt(),Se={class:"file-editor"},$e={class:"editor-header"},Te={class:"editor-filename"},st=P({__name:"FileEditor",setup(i){self.MonacoEnvironment={getWorker(f,C){return new Worker(new URL("/assets/editor.worker-DtO216D1.js",""+import.meta.url),{type:"module"})}};const{t:l}=L(),t=V(),n=Oe(),a=z(),s=x(null);let r=null;const u=x(!1);Ke(()=>{!s.value||!a.editingFile||(r=Tt.create(s.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(Dt.CtrlCmd|Et.KeyS,()=>{_()}))}),yt(()=>{r?.dispose(),r=null});async function _(){u.value=!0;try{await a.saveEditor(),t.success(l("files.saved"))}catch{t.error(l("files.saveFailed"))}finally{u.value=!1}}function p(){a.hasUnsavedChanges?n.warning({title:l("files.unsavedChanges"),positiveText:l("common.ok"),negativeText:l("common.cancel"),onPositiveClick:()=>{a.closeEditor()}}):a.closeEditor()}return(f,C)=>(b(),$("div",Se,[y("div",$e,[y("span",Te,h(e(a).editingFile?.path),1),F(e(J),null,{default:w(()=>[F(e(E),{size:"small",type:"primary",loading:u.value,onClick:_},{default:w(()=>[S(h(e(l)("files.saveFile")),1)]),_:1},8,["loading"]),F(e(E),{size:"small",onClick:p},{default:w(()=>[S(h(e(l)("files.closeEditor")),1)]),_:1})]),_:1})]),y("div",{ref_key:"editorContainer",ref:s,class:"editor-container"},null,512)]))}})})),ea=g((()=>{})),ta,ya=g((()=>{Ee(),Ee(),ea(),A(),ta=K(st,[["__scopeId","data-v-1ae26b53"]])})),De,Me,ze,Pe,Be,Ue,lt,Le=g((()=>{M(),B(),U(),j(),Y(),Bt(),De={key:0,class:"file-preview"},Me={class:"preview-header"},ze={class:"preview-filename"},Pe={class:"preview-content"},Be=["src","alt"],Ue={key:1,class:"preview-markdown"},lt=P({__name:"FilePreview",setup(i){const{t:l}=L(),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(s,r)=>e(t).previewFile?(b(),$("div",De,[y("div",Me,[y("span",ze,h(e(t).previewFile.path),1),F(e(E),{size:"small",quaternary:"",onClick:r[0]||(r[0]=u=>e(t).closePreview())},{icon:w(()=>[F(e(ft),null,{default:w(()=>[F(a)]),_:1})]),default:w(()=>[S(" "+h(e(l)("files.closePreview")),1)]),_:1})]),y("div",Pe,[e(t).previewFile.type==="image"?(b(),$("img",{key:0,src:n(),class:"preview-image",alt:e(t).previewFile.path},null,8,Be)):e(t).previewFile.type==="markdown"?(b(),$("div",Ue,[F(Ut,{content:e(t).previewFile.content||""},null,8,["content"])])):O("",!0)])])):O("",!0)}})})),aa=g((()=>{})),ia,Fa=g((()=>{Le(),Le(),aa(),A(),ia=K(lt,[["__scopeId","data-v-a9f9eb37"]])})),je,nt,Ie=g((()=>{M(),B(),U(),j(),je={class:"upload-dragger"},nt=P({__name:"FileUploadModal",props:{show:{type:Boolean}},emits:["update:show"],setup(i,{emit:l}){const{t}=L(),n=V(),a=z(),s=i,r=l,u=x(!1),_=x([]);function p(c){_.value=c.fileList.map(d=>d.file).filter(d=>d!=null)}async function f(){if(_.value.length!==0){u.value=!0;try{await a.uploadFiles(_.value),n.success(t("files.uploadSuccess",{count:_.value.length})),_.value=[],r("update:show",!1)}catch(c){n.error(c.message||t("files.uploadFailed"))}finally{u.value=!1}}}function C(){_.value=[],r("update:show",!1)}return(c,d)=>(b(),R(e(qe),{show:s.show,preset:"dialog",title:e(t)("files.upload"),"onUpdate:show":C,style:{width:"500px"}},{action:w(()=>[F(e(J),null,{default:w(()=>[F(e(E),{onClick:C},{default:w(()=>[S(h(e(t)("common.cancel")),1)]),_:1}),F(e(E),{type:"primary",loading:u.value,disabled:_.value.length===0,onClick:f},{default:w(()=>[S(h(e(t)("files.upload"))+" ("+h(_.value.length)+") ",1)]),_:1},8,["loading","disabled"])]),_:1})]),default:w(()=>[F(e(bt),{multiple:"","directory-dnd":"","default-upload":!1,onChange:p},{default:w(()=>[y("div",je,[y("p",null,h(e(t)("files.dragDropHint")),1)])]),_:1})]),_:1},8,["show","title"]))}})})),sa=g((()=>{})),la,ka=g((()=>{Ie(),Ie(),sa(),A(),la=K(nt,[["__scopeId","data-v-e54e68b1"]])})),ot,Ne=g((()=>{M(),B(),U(),j(),ot=P({__name:"FileRenameModal",props:{show:{type:Boolean},mode:{},entry:{}},emits:["update:show"],setup(i,{emit:l}){const{t}=L(),n=V(),a=z(),s=i,r=l,u=x(""),_=x(!1);_t(()=>s.show,c=>{c&&(s.mode==="rename"&&s.entry?u.value=s.entry.name:u.value="")});const p=X(()=>{switch(s.mode){case"newFile":return t("files.newFile");case"newFolder":return t("files.newFolder");case"rename":return t("files.rename")}}),f=X(()=>{switch(s.mode){case"newFile":return t("files.newFileName");case"newFolder":return t("files.newFolderName");case"rename":return t("files.renameTo")}});async function C(){if(u.value.trim()){_.value=!0;try{switch(s.mode){case"newFile":await a.createFile(u.value.trim()),n.success(t("files.created"));break;case"newFolder":await a.createDir(u.value.trim()),n.success(t("files.created"));break;case"rename":s.entry&&(await a.renameEntry(s.entry,u.value.trim()),n.success(t("files.renamed")));break}r("update:show",!1)}catch(c){const d=s.mode==="rename"?t("files.renameFailed"):t("files.createFailed");n.error(c.message||d)}finally{_.value=!1}}}return(c,d)=>(b(),R(e(qe),{show:s.show,preset:"dialog",title:p.value,"onUpdate:show":d[2]||(d[2]=v=>r("update:show",!1)),style:{width:"400px"}},{action:w(()=>[F(e(J),null,{default:w(()=>[F(e(E),{onClick:d[1]||(d[1]=v=>r("update:show",!1))},{default:w(()=>[S(h(e(t)("common.cancel")),1)]),_:1}),F(e(E),{type:"primary",loading:_.value,disabled:!u.value.trim(),onClick:C},{default:w(()=>[S(h(e(t)("common.ok")),1)]),_:1},8,["loading","disabled"])]),_:1})]),default:w(()=>[F(e(Ct),{value:u.value,"onUpdate:value":d[0]||(d[0]=v=>u.value=v),placeholder:f.value,onKeydown:wt(C,["enter"]),autofocus:""},null,8,["value","placeholder"])]),_:1},8,["show","title"]))}})})),na,ba=g((()=>{Ne(),Ne(),na=ot}));export{Kt as _,ia as a,z as b,ya as c,Gt as d,wa as f,ma as g,Xt as h,ka as i,Zt as l,ha as m,ba as n,Fa as o,Jt as p,la as r,ta as s,na as t,ga as u,va as v,j as y};
|
|
1
|
+
import{n as g}from"./rolldown-runtime-BKwlnUi0.js";import{C as Oe,Ct as _t,E as ft,Ht as h,I as E,L as te,Pt as x,Q as Re,R as vt,S as qe,T as mt,Tt as w,U as ht,W as M,X as wt,Z as ae,a as gt,at as $,bt as Ae,ct as F,dt as ie,gt as Ke,h as J,ht as yt,it as O,l as Ft,lt as P,mt as kt,nt as y,r as bt,rt as R,st as S,t as B,tt as X,vt as b,y as V,z as Ct,zt as e}from"./ui-vendor-BMwF7QXa.js";import{d as xt,n as U,r as L,u as St}from"./vue-vendor-kBYBtqCg.js";import{a as Ve,d as q,l as $t,n as A,o as Xe,s as He,t as K}from"./_plugin-vue_export-helper-CHoatqkO.js";import{E as Je,k as We}from"./index-DpU5R9KV.js";import{An as Tt,On as Et,kn as Dt,t as Mt}from"./monaco-editor-DVKTRnZT.js";import{n as zt,t as Pt}from"./clipboard-4x9B6X3a.js";import{n as Bt,t as Ut}from"./MarkdownRenderer-BJbqsrMI.js";async function Ge(i=""){const l=new URLSearchParams;i&&l.set("path",i);const t=l.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,l){await q("/api/hermes/files/write",{method:"PUT",body:JSON.stringify({path:i,content:l})})}async function Lt(i,l=!1){await q("/api/hermes/files/delete",{method:"DELETE",body:JSON.stringify({path:i,recursive:l})})}async function jt(i,l){await q("/api/hermes/files/rename",{method:"POST",body:JSON.stringify({oldPath:i,newPath:l})})}async function It(i){await q("/api/hermes/files/mkdir",{method:"POST",body:JSON.stringify({path:i})})}async function Nt(i,l){await q("/api/hermes/files/copy",{method:"POST",body:JSON.stringify({srcPath:i,destPath:l})})}async function Ot(i,l){const t=He(),n=new FormData;for(const C of l)n.append("file",C);const a=new URLSearchParams;i&&a.set("path",i);const s=a.toString(),r=`${t}/api/hermes/files/upload${s?`?${s}`:""}`,u={},_=Xe();_&&(u.Authorization=`Bearer ${_}`);const p=Ve();p&&(u["X-Hermes-Profile"]=p);const f=await fetch(r,{method:"POST",headers:u,body:n});if(!f.ok){const C=await f.json().catch(()=>({error:`HTTP ${f.status}`}));throw new Error(C.error||`Upload failed: ${f.status}`)}return(await f.json()).files}function Rt(i,l){const t=He(),n=new URLSearchParams({path:i});l&&n.set("name",l);const a=Ve();a&&n.set("profile",a);const s=Xe();return s&&n.set("token",s),`${t}/api/hermes/download?${n.toString()}`}var Y=g((()=>{$t()}));function qt(i){const l=i.split("/").pop()||"";return l==="Dockerfile"?"dockerfile":l==="Makefile"?"makefile":Ye["."+l.split(".").pop()?.toLowerCase()]||"plaintext"}function Q(i){const l=i.lastIndexOf(".");return l>=0?i.slice(l).toLowerCase():""}function Z(i){return Qe.has(Q(i))}function ee(i){const l=Q(i);return l===".md"||l===".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(Q(i))}function H(i,l,t){return!!(i===l||t&&i.startsWith(l+"/"))}var Ye,Qe,z,j=g((()=>{xt(),M(),Y(),Ye={".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"},Qe=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".bmp",".ico"]),z=St("files",()=>{const i=x(""),l=x([]),t=x(!1),n=x("name"),a=x("asc"),s=x(null),r=x(null),u=X(()=>i.value?i.value.split("/").filter(Boolean):[]),_=X(()=>{const o=[...l.value];return o.sort((k,I)=>{if(k.isDir!==I.isDir)return k.isDir?-1:1;let N=0;switch(n.value){case"name":N=k.name.localeCompare(I.name);break;case"size":N=k.size-I.size;break;case"modTime":N=k.modTime.localeCompare(I.modTime);break}return a.value==="asc"?N:-N}),o});async function p(o){o!==void 0&&o!==i.value&&(r.value=null),o!==void 0&&(i.value=o),t.value=!0;try{l.value=(await Ge(i.value)).entries}catch(k){throw console.error("Failed to fetch files:",k),k}finally{t.value=!1}}function f(o){return p(o)}function C(){const o=i.value.split("/").filter(Boolean);return o.pop(),p(o.join("/"))}async function c(o){const k=await se(o);s.value={path:o,content:k.content,originalContent:k.content,language:qt(o)}}async function d(){s.value&&(await le(s.value.path,s.value.content),s.value.originalContent=s.value.content)}function v(){s.value=null}async function D(o){if(Z(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 m(o){const k=i.value?`${i.value}/${o}`:o;await It(k),await p()}async function W(o){const k=i.value?`${i.value}/${o}`:o;await le(k,""),await p()}async function rt(o){await Lt(o.path,o.isDir),r.value&&H(r.value.path,o.path,o.isDir)&&(r.value=null),s.value&&H(s.value.path,o.path,o.isDir)&&(s.value=null),await p()}async function ut(o,k){const I=o.path.includes("/")?o.path.slice(0,o.path.lastIndexOf("/")):"",N=I?`${I}/${k}`:k;await jt(o.path,N),r.value&&H(r.value.path,o.path,o.isDir)&&(r.value=null),s.value&&H(s.value.path,o.path,o.isDir)&&(s.value=null),await p()}async function ct(o,k){await Nt(o.path,k),await p()}async function dt(o){await Ot(i.value,o),await p()}function pt(o){n.value===o?a.value=a.value==="asc"?"desc":"asc":(n.value=o,a.value="asc")}return{currentPath:i,entries:l,loading:t,sortBy:n,sortOrder:a,editingFile:s,previewFile:r,pathSegments:u,sortedEntries:_,hasUnsavedChanges:X(()=>s.value?s.value.content!==s.value.originalContent:!1),fetchEntries:p,navigateTo:f,navigateUp:C,openEditor:c,saveEditor:d,closeEditor:v,openPreview:D,closePreview:T,createDir:m,createFile:W,deleteEntry:rt,renameEntry:ut,copyEntry:ct,uploadFiles:dt,setSort:pt}})})),ne,Ze,oe=g((()=>{M(),B(),U(),j(),Y(),ne={class:"file-tree"},Ze=P({__name:"FileTree",setup(i){const{t:l}=L(),t=z(),n=x([]),a=x([]);async function s(p){try{return(await Ge(p)).entries.filter(f=>f.isDir).sort((f,C)=>f.name.localeCompare(C.name)).map(f=>({key:f.path,label:f.name,isLeaf:!1}))}catch{return[]}}async function r(p){p.children=await s(p.key)}function u(p){p.length>0&&(a.value=p,t.navigateTo(p[0]))}function _(){a.value=[],t.navigateTo("")}return Ke(async()=>{n.value=await s("")}),(p,f)=>(b(),$("div",ne,[y("div",{class:"tree-header",onClick:_},[f[0]||(f[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,h(e(l)("files.breadcrumbRoot")),1)]),F(e(gt),{data:n.value,"selected-keys":a.value,"on-load":r,"expand-on-click":"","block-line":"","onUpdate:selectedKeys":u},null,8,["data","selected-keys"])]))}})})),At=g((()=>{})),Kt,va=g((()=>{oe(),oe(),At(),A(),Kt=K(Ze,[["__scopeId","data-v-7f00b3bc"]])})),re,et,ue=g((()=>{M(),U(),B(),j(),re={class:"file-breadcrumb"},et=P({__name:"FileBreadcrumb",setup(i){const{t:l}=L(),t=z();function n(a){if(a<0)t.navigateTo("");else{const s=t.pathSegments.slice(0,a+1).join("/");t.navigateTo(s)}}return(a,s)=>(b(),$("div",re,[F(e(vt),null,{default:w(()=>[F(e(te),{onClick:s[0]||(s[0]=r=>n(-1))},{default:w(()=>[S(h(e(l)("files.breadcrumbRoot")),1)]),_:1}),(b(!0),$(Re,null,Ae(e(t).pathSegments,(r,u)=>(b(),R(e(te),{key:u,onClick:_=>n(u)},{default:w(()=>[S(h(r),1)]),_:2},1032,["onClick"]))),128))]),_:1})]))}})})),Vt=g((()=>{})),Xt,ma=g((()=>{ue(),ue(),Vt(),A(),Xt=K(et,[["__scopeId","data-v-061302de"]])})),ce,tt,de=g((()=>{M(),B(),U(),j(),ce={class:"file-toolbar"},tt=P({__name:"FileToolbar",emits:["showNewFile","showNewFolder","showUpload"],setup(i,{emit:l}){const{t}=L(),n=V(),a=z(),s=l;async function r(){try{await a.fetchEntries()}catch{n.error(t("files.backendError"))}}return(u,_)=>(b(),$("div",ce,[F(e(J),{size:8,wrap:!0,class:"toolbar-space"},{default:w(()=>[F(e(E),{size:"small",onClick:_[0]||(_[0]=p=>s("showNewFile")),class:"toolbar-btn"},{default:w(()=>[S(h(e(t)("files.newFile")),1)]),_:1}),F(e(E),{size:"small",onClick:_[1]||(_[1]=p=>s("showNewFolder")),class:"toolbar-btn"},{default:w(()=>[S(h(e(t)("files.newFolder")),1)]),_:1}),F(e(E),{size:"small",onClick:_[2]||(_[2]=p=>s("showUpload")),class:"toolbar-btn"},{default:w(()=>[S(h(e(t)("files.upload")),1)]),_:1}),F(e(E),{size:"small",onClick:r,class:"toolbar-btn"},{default:w(()=>[S(h(e(t)("files.refresh")),1)]),_:1})]),_:1})]))}})})),Ht=g((()=>{})),Jt,ha=g((()=>{de(),de(),Ht(),A(),Jt=K(tt,[["__scopeId","data-v-64269d74"]])})),pe,_e,fe,ve,me,he,we,ge,ye,Fe,ke,be,at,Ce=g((()=>{M(),B(),U(),j(),We(),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"},at=P({__name:"FileList",emits:["contextmenu-entry"],setup(i,{emit:l}){const{t}=L(),n=V(),a=z(),s=l;function r(c){if(c===0)return"—";const d=["B","KB","MB","GB"];let v=0,D=c;for(;D>=1024&&v<d.length-1;)D/=1024,v++;return`${D.toFixed(v===0?0:1)} ${d[v]}`}function u(c){return c?new Date(c).toLocaleString():"—"}function _(c){return c.isDir?"📁":{yaml:"⚙️",yml:"⚙️",json:"📋",toml:"⚙️",md:"📝",txt:"📄",log:"📄",py:"🐍",js:"📜",ts:"📜",vue:"💚",png:"🖼️",jpg:"🖼️",jpeg:"🖼️",gif:"🖼️",svg:"🖼️",webp:"🖼️",zip:"📦",gz:"📦",tar:"📦",sh:"⚡",bash:"⚡"}[c.name.split(".").pop()?.toLowerCase()||""]||"📄"}function p(c){c.isDir?a.navigateTo(c.path):G(c.name)?a.openEditor(c.path):(Z(c.name)||ee(c.name))&&a.openPreview(c)}function f(c,d){c.preventDefault(),s("contextmenu-entry",c,d)}async function C(c){try{await Je(c.path,c.name)}catch(d){n.error(d.message||t("files.backendError"))}}return(c,d)=>(b(),$("div",pe,[F(e(Ft),{show:e(a).loading},{default:w(()=>[!e(a).loading&&e(a).sortedEntries.length===0?(b(),R(e(ht),{key:0,description:e(t)("files.emptyDir")},null,8,["description"])):(b(),$("div",_e,[y("div",fe,[y("div",{class:"file-name sort-header",onClick:d[0]||(d[0]=v=>e(a).setSort("name"))},[S(h(e(t)("files.name"))+" ",1),e(a).sortBy==="name"?(b(),$("span",ve,h(e(a).sortOrder==="asc"?"↑":"↓"),1)):O("",!0)]),y("div",{class:"file-size sort-header",onClick:d[1]||(d[1]=v=>e(a).setSort("size"))},[S(h(e(t)("files.size"))+" ",1),e(a).sortBy==="size"?(b(),$("span",me,h(e(a).sortOrder==="asc"?"↑":"↓"),1)):O("",!0)]),y("div",{class:"file-date sort-header",onClick:d[2]||(d[2]=v=>e(a).setSort("modTime"))},[S(h(e(t)("files.modified"))+" ",1),e(a).sortBy==="modTime"?(b(),$("span",he,h(e(a).sortOrder==="asc"?"↑":"↓"),1)):O("",!0)]),d[3]||(d[3]=y("div",{class:"file-actions-placeholder"},null,-1))]),(b(!0),$(Re,null,Ae(e(a).sortedEntries,v=>(b(),$("div",{key:v.path,class:"file-list-row",onDblclick:D=>p(v),onContextmenu:D=>f(D,v)},[y("div",ge,[y("span",ye,h(_(v)),1),y("span",null,h(v.name),1)]),y("div",Fe,h(v.isDir?"—":r(v.size)),1),y("div",ke,h(u(v.modTime)),1),y("div",be,[e(G)(v.name)&&!v.isDir?(b(),R(e(E),{key:0,size:"tiny",quaternary:"",onClick:ae(D=>e(a).openEditor(v.path),["stop"]),title:e(t)("files.edit")},{default:w(()=>[...d[4]||(d[4]=[S("✏️",-1)])]),_:1},8,["onClick","title"])):O("",!0),v.isDir?O("",!0):(b(),R(e(E),{key:1,size:"tiny",quaternary:"",onClick:ae(D=>C(v),["stop"]),title:e(t)("files.download")},{default:w(()=>[...d[5]||(d[5]=[S("⬇️",-1)])]),_:1},8,["onClick","title"]))])],40,we))),128))]))]),_:1},8,["show"])]))}})})),Wt=g((()=>{})),Gt,wa=g((()=>{Ce(),Ce(),Wt(),A(),Gt=K(at,[["__scopeId","data-v-ab2593c7"]])}));function Yt(i){return i.absolutePath||i.path}var Qt=g((()=>{})),it,xe=g((()=>{M(),B(),U(),j(),We(),zt(),Qt(),it=P({__name:"FileContextMenu",emits:["rename"],setup(i,{expose:l,emit:t}){const{t:n}=L(),a=V(),s=Oe(),r=z(),u=x(!1),_=x(0),p=x(0),f=x(null),C=t;function c(T,m){f.value=m,_.value=T.clientX,p.value=T.clientY,u.value=!1,kt(()=>{u.value=!0})}function d(){const T=f.value;if(!T)return[];const m=[];return T.isDir?m.push({label:n("files.open"),key:"open"}):(G(T.name)&&m.push({label:n("files.edit"),key:"edit"}),(Z(T.name)||ee(T.name))&&m.push({label:n("files.preview"),key:"preview"}),m.push({label:n("files.download"),key:"download"})),m.push({type:"divider",key:"d1"}),m.push({label:n("files.copyPath"),key:"copyPath"}),m.push({label:n("files.rename"),key:"rename"}),m.push({type:"divider",key:"d2"}),m.push({label:n("files.delete"),key:"delete"}),m}async function v(T){u.value=!1;const m=f.value;if(m)switch(T){case"open":r.navigateTo(m.path);break;case"edit":try{await r.openEditor(m.path)}catch{a.error(n("files.backendError"))}break;case"preview":try{await r.openPreview(m)}catch{a.error(n("files.backendError"))}break;case"download":try{await Je(m.path,m.name)}catch(W){a.error(W.message)}break;case"copyPath":await Pt(Yt(m))?a.success(n("files.pathCopied")):a.error(n("files.pathCopied")+" ✗");break;case"rename":C("rename",m);break;case"delete":s.warning({title:n("files.delete"),content:m.isDir?n("files.confirmDeleteDir",{name:m.name}):n("files.confirmDelete",{name:m.name}),positiveText:n("common.delete"),negativeText:n("common.cancel"),onPositiveClick:async()=>{try{await r.deleteEntry(m),a.success(n("files.deleted"))}catch{a.error(n("files.deleteFailed"))}}});break}}function D(){u.value=!1}return l({show:c}),(T,m)=>(b(),R(e(mt),{show:u.value,x:_.value,y:p.value,options:d(),placement:"bottom-start",trigger:"manual",onSelect:v,onClickoutside:D},null,8,["show","x","y","options"]))}})})),Zt,ga=g((()=>{xe(),xe(),Zt=it})),Se,$e,Te,st,Ee=g((()=>{M(),B(),U(),j(),Mt(),Se={class:"file-editor"},$e={class:"editor-header"},Te={class:"editor-filename"},st=P({__name:"FileEditor",setup(i){self.MonacoEnvironment={getWorker(f,C){return new Worker(new URL("/assets/editor.worker-DtO216D1.js",""+import.meta.url),{type:"module"})}};const{t:l}=L(),t=V(),n=Oe(),a=z(),s=x(null);let r=null;const u=x(!1);Ke(()=>{!s.value||!a.editingFile||(r=Tt.create(s.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(Dt.CtrlCmd|Et.KeyS,()=>{_()}))}),yt(()=>{r?.dispose(),r=null});async function _(){u.value=!0;try{await a.saveEditor(),t.success(l("files.saved"))}catch{t.error(l("files.saveFailed"))}finally{u.value=!1}}function p(){a.hasUnsavedChanges?n.warning({title:l("files.unsavedChanges"),positiveText:l("common.ok"),negativeText:l("common.cancel"),onPositiveClick:()=>{a.closeEditor()}}):a.closeEditor()}return(f,C)=>(b(),$("div",Se,[y("div",$e,[y("span",Te,h(e(a).editingFile?.path),1),F(e(J),null,{default:w(()=>[F(e(E),{size:"small",type:"primary",loading:u.value,onClick:_},{default:w(()=>[S(h(e(l)("files.saveFile")),1)]),_:1},8,["loading"]),F(e(E),{size:"small",onClick:p},{default:w(()=>[S(h(e(l)("files.closeEditor")),1)]),_:1})]),_:1})]),y("div",{ref_key:"editorContainer",ref:s,class:"editor-container"},null,512)]))}})})),ea=g((()=>{})),ta,ya=g((()=>{Ee(),Ee(),ea(),A(),ta=K(st,[["__scopeId","data-v-1ae26b53"]])})),De,Me,ze,Pe,Be,Ue,lt,Le=g((()=>{M(),B(),U(),j(),Y(),Bt(),De={key:0,class:"file-preview"},Me={class:"preview-header"},ze={class:"preview-filename"},Pe={class:"preview-content"},Be=["src","alt"],Ue={key:1,class:"preview-markdown"},lt=P({__name:"FilePreview",setup(i){const{t:l}=L(),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(s,r)=>e(t).previewFile?(b(),$("div",De,[y("div",Me,[y("span",ze,h(e(t).previewFile.path),1),F(e(E),{size:"small",quaternary:"",onClick:r[0]||(r[0]=u=>e(t).closePreview())},{icon:w(()=>[F(e(ft),null,{default:w(()=>[F(a)]),_:1})]),default:w(()=>[S(" "+h(e(l)("files.closePreview")),1)]),_:1})]),y("div",Pe,[e(t).previewFile.type==="image"?(b(),$("img",{key:0,src:n(),class:"preview-image",alt:e(t).previewFile.path},null,8,Be)):e(t).previewFile.type==="markdown"?(b(),$("div",Ue,[F(Ut,{content:e(t).previewFile.content||""},null,8,["content"])])):O("",!0)])])):O("",!0)}})})),aa=g((()=>{})),ia,Fa=g((()=>{Le(),Le(),aa(),A(),ia=K(lt,[["__scopeId","data-v-a9f9eb37"]])})),je,nt,Ie=g((()=>{M(),B(),U(),j(),je={class:"upload-dragger"},nt=P({__name:"FileUploadModal",props:{show:{type:Boolean}},emits:["update:show"],setup(i,{emit:l}){const{t}=L(),n=V(),a=z(),s=i,r=l,u=x(!1),_=x([]);function p(c){_.value=c.fileList.map(d=>d.file).filter(d=>d!=null)}async function f(){if(_.value.length!==0){u.value=!0;try{await a.uploadFiles(_.value),n.success(t("files.uploadSuccess",{count:_.value.length})),_.value=[],r("update:show",!1)}catch(c){n.error(c.message||t("files.uploadFailed"))}finally{u.value=!1}}}function C(){_.value=[],r("update:show",!1)}return(c,d)=>(b(),R(e(qe),{show:s.show,preset:"dialog",title:e(t)("files.upload"),"onUpdate:show":C,style:{width:"500px"}},{action:w(()=>[F(e(J),null,{default:w(()=>[F(e(E),{onClick:C},{default:w(()=>[S(h(e(t)("common.cancel")),1)]),_:1}),F(e(E),{type:"primary",loading:u.value,disabled:_.value.length===0,onClick:f},{default:w(()=>[S(h(e(t)("files.upload"))+" ("+h(_.value.length)+") ",1)]),_:1},8,["loading","disabled"])]),_:1})]),default:w(()=>[F(e(bt),{multiple:"","directory-dnd":"","default-upload":!1,onChange:p},{default:w(()=>[y("div",je,[y("p",null,h(e(t)("files.dragDropHint")),1)])]),_:1})]),_:1},8,["show","title"]))}})})),sa=g((()=>{})),la,ka=g((()=>{Ie(),Ie(),sa(),A(),la=K(nt,[["__scopeId","data-v-e54e68b1"]])})),ot,Ne=g((()=>{M(),B(),U(),j(),ot=P({__name:"FileRenameModal",props:{show:{type:Boolean},mode:{},entry:{}},emits:["update:show"],setup(i,{emit:l}){const{t}=L(),n=V(),a=z(),s=i,r=l,u=x(""),_=x(!1);_t(()=>s.show,c=>{c&&(s.mode==="rename"&&s.entry?u.value=s.entry.name:u.value="")});const p=X(()=>{switch(s.mode){case"newFile":return t("files.newFile");case"newFolder":return t("files.newFolder");case"rename":return t("files.rename")}}),f=X(()=>{switch(s.mode){case"newFile":return t("files.newFileName");case"newFolder":return t("files.newFolderName");case"rename":return t("files.renameTo")}});async function C(){if(u.value.trim()){_.value=!0;try{switch(s.mode){case"newFile":await a.createFile(u.value.trim()),n.success(t("files.created"));break;case"newFolder":await a.createDir(u.value.trim()),n.success(t("files.created"));break;case"rename":s.entry&&(await a.renameEntry(s.entry,u.value.trim()),n.success(t("files.renamed")));break}r("update:show",!1)}catch(c){const d=s.mode==="rename"?t("files.renameFailed"):t("files.createFailed");n.error(c.message||d)}finally{_.value=!1}}}return(c,d)=>(b(),R(e(qe),{show:s.show,preset:"dialog",title:p.value,"onUpdate:show":d[2]||(d[2]=v=>r("update:show",!1)),style:{width:"400px"}},{action:w(()=>[F(e(J),null,{default:w(()=>[F(e(E),{onClick:d[1]||(d[1]=v=>r("update:show",!1))},{default:w(()=>[S(h(e(t)("common.cancel")),1)]),_:1}),F(e(E),{type:"primary",loading:_.value,disabled:!u.value.trim(),onClick:C},{default:w(()=>[S(h(e(t)("common.ok")),1)]),_:1},8,["loading","disabled"])]),_:1})]),default:w(()=>[F(e(Ct),{value:u.value,"onUpdate:value":d[0]||(d[0]=v=>u.value=v),placeholder:f.value,onKeydown:wt(C,["enter"]),autofocus:""},null,8,["value","placeholder"])]),_:1},8,["show","title"]))}})})),na,ba=g((()=>{Ne(),Ne(),na=ot}));export{Kt as _,ia as a,z as b,ya as c,Gt as d,wa as f,ma as g,Xt as h,ka as i,Zt as l,ha as m,ba as n,Fa as o,Jt as p,la as r,ta as s,na as t,ga as u,va as v,j as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as p}from"./rolldown-runtime-BKwlnUi0.js";import{Pt as i,W as N,at as b,ct as t,gt as B,lt as E,nt as f,rt as v,vt as r,zt as w}from"./ui-vendor-BMwF7QXa.js";import{n as P,t as U}from"./_plugin-vue_export-helper-
|
|
1
|
+
import{n as p}from"./rolldown-runtime-BKwlnUi0.js";import{Pt as i,W as N,at as b,ct as t,gt as B,lt as E,nt as f,rt as v,vt as r,zt as w}from"./ui-vendor-BMwF7QXa.js";import{n as P,t as U}from"./_plugin-vue_export-helper-CHoatqkO.js";import{r as C,t as T}from"./profiles-CyjgPK1f.js";import{_ as L,a as z,b as I,c as W,d as $,f as j,g as q,h as A,i as D,l as G,m as H,n as J,o as K,p as O,r as Q,s as X,t as Y,u as Z,v as ee,y as te}from"./FileRenameModal-DN-U6DZT.js";var m,c,h,y,x,M=p((()=>{N(),te(),T(),ee(),q(),H(),j(),Z(),W(),K(),D(),J(),m={class:"files-view"},c={class:"files-tree-panel"},h={class:"files-main-panel"},y={class:"files-content"},x=E({__name:"FilesView",setup(ne){const u=I(),_=C(),F=i(null),d=i(!1),l=i(!1),a=i("newFile"),n=i(null);function g(o,e){F.value?.show(o,e)}function S(){a.value="newFile",n.value=null,l.value=!0}function R(){a.value="newFolder",n.value=null,l.value=!0}function V(o){a.value="rename",n.value=o,l.value=!0}async function k(){(!_.activeProfileName||_.profiles.length===0)&&await _.fetchProfiles(),await u.fetchEntries("")}return B(()=>{k()}),(o,e)=>(r(),b("div",m,[f("div",c,[t(L)]),f("div",h,[t(O,{onShowNewFile:S,onShowNewFolder:R,onShowUpload:e[0]||(e[0]=s=>d.value=!0)}),t(A),f("div",y,[w(u).editingFile?(r(),v(X,{key:0})):w(u).previewFile?(r(),v(z,{key:1})):(r(),v($,{key:2,onContextmenuEntry:g}))])]),t(G,{ref_key:"contextMenuRef",ref:F,onRename:V},null,512),t(Q,{show:d.value,"onUpdate:show":e[1]||(e[1]=s=>d.value=s)},null,8,["show"]),t(Y,{show:l.value,"onUpdate:show":e[2]||(e[2]=s=>l.value=s),mode:a.value,entry:n.value},null,8,["show","mode","entry"])]))}})})),le=p((()=>{})),ie,ae=p((()=>{M(),M(),le(),P(),ie=U(x,[["__scopeId","data-v-89d440cf"]])}));ae();export{ie as default};
|