n8n-editor-ui
Version:
Workflow Editor UI for n8n
2 lines • 4.2 kB
JavaScript
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`n8n@2.16.1`}}catch{}})();try{(function(){var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`3f29905a-7607-4263-a78c-d618e6811997`,e._sentryDebugIdIdentifier=`sentry-dbid-3f29905a-7607-4263-a78c-d618e6811997`)})()}catch{}import{$ as e,A as t,C as n,E as r,Ft as i,N as a,S as o,Sn as s,T as c,Wt as l,_ as u,_n as d,gt as f,j as p,rt as m,w as h,yt as g}from"./vue.runtime.esm-bundler-C3C09Zii.js";import{at as _,y as v}from"./core-Bz5WjPxS.js";import{Xi as y,Zi as b,ct as x,lt as S}from"./src-XqE2yCpG.js";import{t as C}from"./_plugin-vue_export-helper-CIL7EULb.js";import{Ln as w,Pn as T,r as E,t as D}from"./users.store-xP93bV7X.js";import"./constants-DuQbSl-q.js";import{d as O,t as k}from"./constants-BVzsnVB6.js";import{t as A}from"./chat.store-mz4IZJ73.js";import{c as j,w as M}from"./fileUtils-D6dhtxVJ.js";import{n as N,r as P,t as F}from"./SkeletonAgentCard-DV0gJkgW.js";import{n as I,t as L}from"./ChatLayout-BF1AmRjI.js";var R=C(a({__name:`ChatPersonalAgentsView`,setup(a){let C=A(),R=E(),z=x(),B=S(),V=T(),H=w(),U=D(),W=v(O),G=_(),K=i({search:``,sortBy:`updatedAt`}),q=typeof z.query.agentId==`string`?z.query.agentId:null,{credentialsByProvider:J}=I(U.currentUserId??`anonymous`),Y=o(()=>C.agentsReady),X=o(()=>C.agents[`custom-agent`].models),Z=o(()=>j(X.value,K.value));function Q(){R.openModalWithData({name:k,data:{credentials:J}})}function $(e){e.provider===`custom-agent`&&(B.replace({query:{agentId:e.agentId}}),R.openModalWithData({name:k,data:{agentId:e.agentId,credentials:J}}))}f(J,e=>{!e||!q||R.openModalWithData({name:k,data:{agentId:q,credentials:e}})},{immediate:!0}),f(()=>R.modalsById[k]?.open,e=>{!e&&z.query.agentId&&B.replace({query:{}})});async function ee(e){if(!(await H.confirm(G.baseText(`chatHub.agents.delete.confirm.message`),G.baseText(`chatHub.agents.delete.confirm.title`),{confirmButtonText:G.baseText(`chatHub.agents.delete.confirm.button`),cancelButtonText:G.baseText(`chatHub.agents.delete.cancel.button`)})!==`confirm`||!J.value))try{await C.deleteCustomAgent(e,J.value),V.showMessage({type:`success`,title:G.baseText(`chatHub.agents.delete.success`)})}catch(e){V.showError(e,G.baseText(`chatHub.agents.delete.error`))}}return f(J,e=>{e&&C.fetchAgents(e,{minLoadingTime:250})},{immediate:!0}),(i,a)=>(e(),h(L,null,{default:g(()=>[n(`div`,{class:d([i.$style.container,{[i.$style.isMobileDevice]:l(W)}])},[n(`div`,{class:d(i.$style.header)},[n(`div`,{class:d(i.$style.headerContent)},[p(l(y),{tag:`h1`,size:`xlarge`,bold:``},{default:g(()=>[t(s(l(G).baseText(`chatHub.personalAgents.title`)),1)]),_:1}),p(l(y),{color:`text-light`},{default:g(()=>[t(s(l(G).baseText(`chatHub.personalAgents.description`)),1)]),_:1})],2),p(l(b),{variant:`solid`,icon:`plus`,size:`medium`,onClick:Q},{default:g(()=>[t(s(l(G).baseText(`chatHub.agents.button.newAgent`)),1)]),_:1})],2),Y.value&&X.value.length>0?(e(),h(N,{key:0,modelValue:K.value,"onUpdate:modelValue":a[0]||=e=>K.value=e},null,8,[`modelValue`])):c(``,!0),Y.value?Z.value.length===0?(e(),r(`div`,{key:2,class:d(i.$style.empty)},[p(l(y),{color:`text-light`,size:`medium`},{default:g(()=>[t(s(X.value.length===0?l(G).baseText(`chatHub.personalAgents.empty.noAgents`):l(G).baseText(`chatHub.personalAgents.empty.noMatch`)),1)]),_:1})],2)):(e(),r(`div`,{key:3,class:d(i.$style.agentsGrid)},[(e(!0),r(u,null,m(Z.value,t=>(e(),r(u,{key:l(M)(t.model)},[t.model.provider===`custom-agent`?(e(),h(P,{key:0,agent:t,onEdit:e=>$(t.model),onDelete:e=>ee(t.model.agentId)},null,8,[`agent`,`onEdit`,`onDelete`])):c(``,!0)],64))),128))],2)):(e(),r(`div`,{key:1,class:d(i.$style.agentsGrid)},[(e(),r(u,null,m(5,e=>p(F,{key:e})),64))],2))],2)]),_:1}))}}),[[`__cssModules`,{$style:{container:`_container_zrzl5_125`,header:`_header_zrzl5_138`,headerContent:`_headerContent_zrzl5_146`,empty:`_empty_zrzl5_152`,agentsGrid:`_agentsGrid_zrzl5_161`}}]]);export{R as default};
//# sourceMappingURL=ChatPersonalAgentsView-BMO2EBQT.js.map