n8n-editor-ui
Version:
Workflow Editor UI for n8n
2 lines • 3.97 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]=`6f71b2b8-05a5-497f-8111-04fc33d4c541`,e._sentryDebugIdIdentifier=`sentry-dbid-6f71b2b8-05a5-497f-8111-04fc33d4c541`)})()}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,Wt as c,X as l,_n as u,bt as d,j as f,ot as p,yt as m}from"./vue.runtime.esm-bundler-C3C09Zii.js";import{at as h}from"./core-Bz5WjPxS.js";import{Ji as g,Xi as _,dt as v}from"./src-XqE2yCpG.js";import{t as y}from"./_plugin-vue_export-helper-CIL7EULb.js";import{Ln as b,Pn as x,Rt as S,fr as C}from"./users.store-xP93bV7X.js";import"./constants-DuQbSl-q.js";import{t as w}from"./settings.store-CAFiYCMH.js";import{t as T}from"./assistant.store-C47L2JfA.js";var E=y(a({__name:`SettingsAIView`,setup(a){let y=h(),E=x(),D=S(),O=b(),k=C(),A=T(),j=w(),M=i(!0),N=o(()=>A.isAssistantEnabled),P=o(()=>j.isAiBuilderEnabled),F=o(()=>j.isAskAiEnabled),I=o(()=>j.isAiDataSharingEnabled),L=o(()=>N.value&&F.value?y.baseText(`settings.ai.description.both`):N.value?y.baseText(`settings.ai.description.assistantOnly`):F.value?y.baseText(`settings.ai.description.askAiOnly`):y.baseText(`settings.ai.description.both`)),R=o(()=>P.value?y.baseText(`settings.ai.confirm.message.builderEnabled`):y.baseText(`settings.ai.confirm.message.builderDisabled`)),z=async e=>{if(typeof e==`boolean`&&!(!e&&await O.confirm(R.value,{title:y.baseText(`settings.ai.confirm.title`),confirmButtonText:y.baseText(`settings.ai.confirm.confirmButtonText`),cancelButtonText:y.baseText(`generic.cancel`)})!==`confirm`))try{await j.updateAiDataSharingSettings(e),E.showMessage({title:y.baseText(`settings.ai.updated.success`),type:`success`}),k.track(`User changed AI Usage settings`,{allow_sending_parameter_values:e})}catch(e){E.showError(e,y.baseText(`settings.ai.updated.error`))}};return l(async()=>{D.set(y.baseText(`settings.ai`))}),(i,a)=>{let o=p(`n8n-html`);return e(),r(`div`,{class:u(i.$style.container),"data-test-id":`ai`},[n(`div`,{class:u(i.$style.header)},[f(c(g),{size:`2xlarge`},{default:m(()=>[t(s(c(y).baseText(`settings.ai`)),1)]),_:1}),d(f(c(_),{size:`small`,color:`text-light`},null,512),[[o,L.value]])],2),n(`div`,{class:u(i.$style.content)},[n(`div`,{class:u(i.$style.checkboxContainer)},[f(c(v),{modelValue:M.value,"onUpdate:modelValue":a[0]||=e=>M.value=e,disabled:!0,label:c(y).baseText(`settings.ai.allowSendingSchema.label`)},null,8,[`modelValue`,`label`]),f(c(_),{class:u(i.$style.checkboxDescription),color:`text-base`},{default:m(()=>[t(s(c(y).baseText(`settings.ai.allowSendingSchema.description`)),1)]),_:1},8,[`class`])],2),n(`div`,{class:u(i.$style.checkboxContainer)},[f(c(v),{"model-value":I.value,label:c(y).baseText(`settings.ai.allowSendingParameterValues.label`),"onUpdate:modelValue":z},null,8,[`model-value`,`label`]),f(c(_),{class:u(i.$style.checkboxDescription),color:`text-base`},{default:m(()=>[t(s(c(y).baseText(`settings.ai.allowSendingParameterValues.description`)),1)]),_:1},8,[`class`])],2)],2),n(`div`,{class:u(i.$style.privacyNote)},[f(c(_),{bold:!0},{default:m(()=>[t(s(c(y).baseText(`settings.ai.privacyNote.heading`)),1)]),_:1}),d(f(c(_),{color:`text-base`},null,512),[[o,c(y).baseText(`settings.ai.privacyNote.content`,{interpolate:{docsLink:`https://docs.n8n.io/manage-cloud/ai-assistant`}})]])],2)],2)}}}),[[`__cssModules`,{$style:{container:`_container_5309p_125`,header:`_header_5309p_131`,content:`_content_5309p_137`,checkboxContainer:`_checkboxContainer_5309p_143`,checkboxDescription:`_checkboxDescription_5309p_154`,notice:`_notice_5309p_157`,privacyNote:`_privacyNote_5309p_162`}}]]);export{E as default};
//# sourceMappingURL=SettingsAIView-CyVOCGgM.js.map