UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

5 lines (4 loc) 4.35 kB
(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]=`3d20d156-8113-4b0a-88ff-1d98770e41c2`,e._sentryDebugIdIdentifier=`sentry-dbid-3d20d156-8113-4b0a-88ff-1d98770e41c2`)})()}catch{}import{o as e}from"./chunk-CACdhNlC.js";import{$ as t,E as n,N as r,S as i,T as a,Wt as o,_ as s,_n as c,j as l,rt as u,w as d}from"./vue.runtime.esm-bundler-C3C09Zii.js";import{at as f}from"./core-Bz5WjPxS.js";import{Mi as p}from"./src-XqE2yCpG.js";import{u as m}from"./get-BjzKP_3k.js";import{t as h}from"./_plugin-vue_export-helper-CIL7EULb.js";import{Pn as g}from"./users.store-xP93bV7X.js";import{t as _}from"./useClipboard-D2UtD35U.js";import{t as v}from"./core-C9AM0zn8.js";import{t as y}from"./VueMarkdown-DVUSZtee.js";import{n as b,t as x}from"./TextWithHighlights-D5CTCqWK.js";var S=e(m(),1);function C(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 w(e,t){let n=(0,S.escapeHtml)(e);return t?b(n,t).map(e=>e.isMatched?`<mark>${e.content}</mark>`:e.content).join(``):n}function T(e){return t=>{t.renderer.rules.text=(t,n)=>w(t[n].content,e),t.renderer.rules.code_inline=(t,n,r,i,a)=>`<code${a.renderAttrs(t[n])}>${w(t[n].content,e)}</code>`,t.renderer.rules.code_block=(t,n,r,i,a)=>`<pre${a.renderAttrs(t[n])}><code>${w(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)??w(s.content,e);return d.indexOf(`<pre`)===0?d+` `:`<pre><code${o.renderAttrs(s)}>${d}</code></pre>\n`}}}var E=[`data-content-type`],D=h(r({__name:`RunDataParsedAiContent`,props:{content:{},compact:{type:Boolean,default:!1},search:{},renderType:{}},setup(e){let r=f(),m=_(),{showMessage:h}=g(),b=i(()=>[T(e.search)]);function S(e){try{return JSON.parse(e),!0}catch{return!1}}let C={highlight(e,t){if(t&&v.getLanguage(t))try{return v.highlight(e,{language:t}).value}catch{}}};function w(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 w(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)),h({title:r.baseText(`generic.copiedToClipboard`),type:`success`})}catch{}}return(i,f)=>(t(),n(`div`,{class:c([i.$style.component,e.compact?i.$style.compact:``])},[(t(!0),n(s,null,u(e.content,({parsedContent:u,raw:f},m)=>(t(),n(`div`,{key:m,class:c(i.$style.contentText),"data-content-type":u?.type},[u&&e.renderType===`rendered`?(t(),n(s,{key:0},[u.type===`json`?(t(),d(o(y),{key:0,source:O(u.data),class:c(i.$style.markdown),options:C,plugins:b.value},null,8,[`source`,`class`,`plugins`])):u.type===`markdown`?(t(),d(o(y),{key:1,source:u.data,class:c(i.$style.markdown),options:C,plugins:b.value},null,8,[`source`,`class`,`plugins`])):u.type===`text`?(t(),d(x,{key:2,class:c(i.$style.runText),content:String(u.data),search:e.search},null,8,[`class`,`content`,`search`])):a(``,!0)],64)):(t(),n(`div`,{key:1,class:c(i.$style.rawContent)},[l(o(p),{variant:`subtle`,size:`small`,class:c(i.$style.copyToClipboard),title:o(r).baseText(`nodeErrorView.copyToClipboard`),icon:`files`,onClick:e=>k(f)},null,8,[`class`,`title`,`onClick`]),l(o(y),{source:O(f),class:c(i.$style.markdown),plugins:b.value},null,8,[`source`,`class`,`plugins`])],2))],10,E))),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{C as n,D as t}; //# sourceMappingURL=RunDataParsedAiContent-CGPqqyeV.js.map