n8n-editor-ui
Version:
Workflow Editor UI for n8n
5 lines (4 loc) • 4.28 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]=`be14f24d-8164-4af9-b530-5f3b01805a30`,e._sentryDebugIdIdentifier=`sentry-dbid-be14f24d-8164-4af9-b530-5f3b01805a30`)})()}catch{}import{$ as e,E as t,N as n,S as r,T as i,Wt as a,_ as o,_n as s,j as c,rt as l,w as u}from"./vue.runtime.esm-bundler-D9KLAxvJ.js";import{bt as d}from"./_MapCache-CUJwh2qp.js";import{Ii as f,Ot as p}from"./src-wni2AGA3.js";import{t as m}from"./_plugin-vue_export-helper-Dm3nT7Ps.js";import{Tr as h}from"./users.store-BHWXXawf.js";import{t as g}from"./useClipboard-D72kaMkX.js";import{t as _}from"./core-M4qnWLDf.js";import{t as v}from"./VueMarkdown-B-lNBlW1.js";import{n as y,t as b}from"./TextWithHighlights-DREOi4W6.js";var x=p();function S(e){let t=[];function n(n,r){n&&Object.keys(n).map(i=>{t.push({data:n[i][0],inOut:r,type:i,source:e.source,metadata:{executionTime:e.executionTime,startTime:e.startTime,subExecution:e.metadata?.subExecution}})})}return n(e.inputOverride,`input`),n(e.data,`output`),t}function C(e,t){let n=(0,x.escapeHtml)(e);return t?y(n,t).map(e=>e.isMatched?`<mark>${e.content}</mark>`:e.content).join(``):n}function w(e){return t=>{t.renderer.rules.text=(t,n)=>C(t[n].content,e),t.renderer.rules.code_inline=(t,n,r,i,a)=>`<code${a.renderAttrs(t[n])}>${C(t[n].content,e)}</code>`,t.renderer.rules.code_block=(t,n,r,i,a)=>`<pre${a.renderAttrs(t[n])}><code>${C(t[n].content,e)}</code></pre>\n`,t.renderer.rules.fence=(n,r,i,a,o)=>{let s=n[r],c=s.info?t.utils.unescapeAll(s.info).trim():``,l=``,u=``;if(c){let e=c.split(/(\s+)/g);l=e[0],u=e.slice(2).join(``)}let d=i.highlight?.(s.content,l,u)??C(s.content,e);return d.indexOf(`<pre`)===0?d+`
`:`<pre><code${o.renderAttrs(s)}>${d}</code></pre>\n`}}}var T=[`data-content-type`],E=m(n({__name:`RunDataParsedAiContent`,props:{content:{},compact:{type:Boolean,default:!1},search:{},renderType:{}},setup(n){let p=d(),m=g(),{showMessage:y}=h(),x=r(()=>[w(n.search)]);function S(e){try{return JSON.parse(e),!0}catch{return!1}}let C={highlight(e,t){if(t&&_.getLanguage(t))try{return _.highlight(e,{language:t}).value}catch{}}};function E(e){return typeof e==`string`?[/^# .+/gm,/\*{1,2}.+\*{1,2}/g,/\[.+\]\(.+\)/g,/```[\s\S]+```/g].some(t=>t.test(e)):!1}function D(e){return"```json\n"+e+"\n```"}function O(e){return E(e)?e:Array.isArray(e)&&e.length&&typeof e[0]!=`number`?e.map(e=>O(e)).join(`
`).trim():typeof e==`string`?S(e)?D(e):e:D(JSON.stringify(e,null,2))}function k(e){try{m.copy(JSON.stringify(e,void 0,2)),y({title:p.baseText(`generic.copiedToClipboard`),type:`success`})}catch{}}return(r,d)=>(e(),t(`div`,{class:s([r.$style.component,n.compact?r.$style.compact:``])},[(e(!0),t(o,null,l(n.content,({parsedContent:l,raw:d},m)=>(e(),t(`div`,{key:m,class:s(r.$style.contentText),"data-content-type":l?.type},[l&&n.renderType===`rendered`?(e(),t(o,{key:0},[l.type===`json`?(e(),u(a(v),{key:0,source:O(l.data),class:s(r.$style.markdown),options:C,plugins:x.value},null,8,[`source`,`class`,`plugins`])):l.type===`markdown`?(e(),u(a(v),{key:1,source:l.data,class:s(r.$style.markdown),options:C,plugins:x.value},null,8,[`source`,`class`,`plugins`])):l.type===`text`?(e(),u(b,{key:2,class:s(r.$style.runText),content:String(l.data),search:n.search},null,8,[`class`,`content`,`search`])):i(``,!0)],64)):(e(),t(`div`,{key:1,class:s(r.$style.rawContent)},[c(a(f),{variant:`subtle`,size:`small`,class:s(r.$style.copyToClipboard),title:a(p).baseText(`nodeErrorView.copyToClipboard`),icon:`files`,onClick:e=>k(d)},null,8,[`class`,`title`,`onClick`]),c(a(v),{source:O(d),class:s(r.$style.markdown),plugins:x.value},null,8,[`source`,`class`,`plugins`])],2))],10,T))),128))],2))}}),[[`__cssModules`,{$style:{runText:`_runText_1f6ui_125`,markdown:`_markdown_1f6ui_130`,compact:`_compact_1f6ui_153`,copyToClipboard:`_copyToClipboard_1f6ui_161`,rawContent:`_rawContent_1f6ui_171`,contentText:`_contentText_1f6ui_175`}}]]);export{S as n,E as t};
//# sourceMappingURL=RunDataParsedAiContent-DJFEwHfT.js.map