n8n-editor-ui
Version:
Workflow Editor UI for n8n
2 lines • 4.72 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.13.4`}}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]=`aa562a31-ff0c-4394-b77d-8b1c3d76730d`,e._sentryDebugIdIdentifier=`sentry-dbid-aa562a31-ff0c-4394-b77d-8b1c3d76730d`)})()}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,_n as u,gt as d,h as f,j as p,w as m,yt as h}from"./vue.runtime.esm-bundler-D9KLAxvJ.js";import{$ as g,bt as _}from"./_MapCache-CUJwh2qp.js";import{$i as v,Bt as y,Fi as b,Ii as x,Zi as S,i as C,ut as w}from"./src-wni2AGA3.js";import{t as T}from"./_plugin-vue_export-helper-Dm3nT7Ps.js";import{d as E}from"./chat.store-Bg89IR0u.js";import{t as D}from"./ChatAgentAvatar-Dxv-BN__.js";var O=T(a({__name:`ChatAgentCard`,props:{agent:{}},emits:[`edit`,`delete`],setup(r,{emit:i}){let a=i,d=_(),g=o(()=>r.agent.model.provider===`custom-agent`?[{id:`delete`,label:d.baseText(`chatHub.agent.card.menu.delete`)}]:[]),v=o(()=>r.agent.model.provider===`custom-agent`||r.agent.model.provider===`n8n`&&r.agent.metadata.scopes?.includes(`workflow:read`));function b(e){switch(e){case`delete`:a(`delete`);return;case`edit`:a(`edit`)}}return(i,o)=>(e(),m(l(w),{to:l(E)(r.agent.model),class:u(i.$style.card),"data-test-id":`chat-agent-card`},{default:h(()=>[p(D,{agent:r.agent,size:`lg`},null,8,[`agent`]),n(`div`,{class:u(i.$style.content)},[p(l(S),{tag:`h3`,size:`medium`,bold:``,class:u(i.$style.title)},{default:h(()=>[t(s(r.agent.name),1)]),_:1},8,[`class`]),p(l(S),{size:`small`,color:`text-light`,class:u(i.$style.description)},{default:h(()=>[t(s(r.agent.description||l(d).baseText(`chatHub.agent.card.noDescription`)),1)]),_:1},8,[`class`])],2),n(`div`,{class:u(i.$style.actions)},[v.value?(e(),m(l(x),{key:0,variant:`subtle`,icon:`pen`,size:`medium`,title:l(d).baseText(`chatHub.agent.card.button.edit`),onClick:o[0]||=f(e=>a(`edit`),[`prevent`])},null,8,[`title`])):c(``,!0),g.value.length>0?(e(),m(l(y),{key:1,items:g.value,placement:`bottom-end`,onSelect:b,onClick:o[1]||=f(()=>{},[`stop`,`prevent`])},{activator:h(()=>[p(l(x),{variant:`ghost`,icon:`ellipsis-vertical`,size:`medium`,title:l(d).baseText(`chatHub.agent.card.button.moreOptions`),class:u(i.$style.actionDropdownTrigger)},null,8,[`title`,`class`])]),_:1},8,[`items`])):c(``,!0)],2)]),_:1},8,[`to`,`class`]))}}),[[`__cssModules`,{$style:{card:`_card_1ipvo_125`,avatar:`_avatar_1ipvo_141`,content:`_content_1ipvo_145`,badge:`_badge_1ipvo_153`,title:`_title_1ipvo_157`,description:`_description_1ipvo_163`,actions:`_actions_1ipvo_169`,actionDropdownTrigger:`_actionDropdownTrigger_1ipvo_175`}}]]),k=T(a({__name:`ChatAgentSearchSort`,props:{modelValue:{}},emits:[`update:modelValue`],setup(t,{emit:n}){let a=t,s=n,c=_(),f=o(()=>[{label:c.baseText(`chatHub.agents.sort.updatedAt`),value:`updatedAt`},{label:c.baseText(`chatHub.agents.sort.createdAt`),value:`createdAt`}]),m=i(a.modelValue.search),y=g(m,300);d(()=>a.modelValue.search,e=>{e!==m.value&&(m.value=e)}),d(y,e=>{e!==a.modelValue.search&&s(`update:modelValue`,{...a.modelValue,search:e})});function x(e){s(`update:modelValue`,{...a.modelValue,sortBy:e})}return(n,i)=>(e(),r(`div`,{class:u(n.$style.controls)},[p(l(b),{modelValue:m.value,"onUpdate:modelValue":i[0]||=e=>m.value=e,class:u(n.$style.search),size:`medium`,placeholder:l(c).baseText(`chatHub.agents.search.placeholder`),clearable:``},{prefix:h(()=>[p(l(v),{icon:`search`})]),_:1},8,[`modelValue`,`class`,`placeholder`]),p(l(C),{size:`medium`,"model-value":t.modelValue.sortBy,class:u(n.$style.sort),items:f.value,"onUpdate:modelValue":x},null,8,[`model-value`,`class`,`items`])],2))}}),[[`__cssModules`,{$style:{controls:`_controls_yu4uw_125`,search:`_search_yu4uw_131`,sort:`_sort_yu4uw_136`}}]]),A={card:`_card_1139r_125`,skeleton:`_skeleton_1139r_135`,"skeleton-pulse":`_skeleton-pulse_1139r_1`,avatar:`_avatar_1139r_141`,content:`_content_1139r_150`,title:`_title_1139r_158`,description:`_description_1139r_163`,actionButton:`_actionButton_1139r_168`},j={};function M(t,i){return e(),r(`div`,{class:u(t.$style.card)},[n(`div`,{class:u(t.$style.avatar)},null,2),n(`div`,{class:u(t.$style.content)},[n(`div`,{class:u([t.$style.skeleton,t.$style.title])},null,2),n(`div`,{class:u([t.$style.skeleton,t.$style.description])},null,2)],2),n(`div`,{class:u([t.$style.skeleton,t.$style.actionButton])},null,2)],2)}var N=T(j,[[`render`,M],[`__cssModules`,{$style:A}]]);export{k as n,O as r,N as t};
//# sourceMappingURL=SkeletonAgentCard-Cuz4EVTA.js.map