n8n-editor-ui
Version:
Workflow Editor UI for n8n
2 lines • 6.82 kB
JavaScript
!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"n8n@2.16.1"}}catch(e){}}(),System.register(["./constants-legacy-2_ytuuS3.js","./constants-legacy-Bi9z6I7b.js"],(function(e,t){var n,o;function r(e,t){const n=new Date(t),o=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(o);r.setDate(r.getDate()-1);const s=new Date(o);s.setDate(s.getDate()-7);const a=new Date(n.getFullYear(),n.getMonth(),n.getDate());return a.getTime()===o.getTime()?"Today":a.getTime()===r.getTime()?"Yesterday":a>=s?"This week":"Older"}function s(e){return{provider:e.provider,model:"n8n"===e?.provider||"custom-agent"===e?.provider?null:e?.model??null,workflowId:"n8n"===e?.provider?e.workflowId:null,agentId:"custom-agent"===e?.provider?e.agentId:null}}function a(e){return"n8n"!==e&&"custom-agent"!==e}function i({enabled:e=!0,allowedModels:t},n){return e&&(0===t.length||t.some((e=>"model"in n&&e.model===n.model)))}return e({C:function(e){if(!e)return[];const t=[];let n="",o={type:"normal"};const r=e.split("\n"),s=()=>{n.trim()&&(t.push(n.trimEnd()),n="")};for(let a=0;a<r.length;a++){const e=r[a],t=a<r.length-1?r[a+1]:"",i=e.trim(),l=/^( {4}|\t)/.test(e),d=/^( {0,3})(`{3,}|~{3,})/.test(e);if("backtick-fence"===o.type){if(d&&i.startsWith("```")){const t=i.match(/^(`+)/);if((t?t[1].length:0)>=o.count){n+=e+"\n",o={type:"normal"},s();continue}}}else if("tilde-fence"===o.type){if(d&&i.startsWith("~~~")){const t=i.match(/^(~+)/);if((t?t[1].length:0)>=o.count){n+=e+"\n",o={type:"normal"},s();continue}}}else if("indented"===o.type)l||""===i||(o={type:"normal"},s());else if(d&&i.startsWith("```")){const e=i.match(/^(`+)/);o={type:"backtick-fence",count:e?e[1].length:0}}else if(d&&i.startsWith("~~~")){const e=i.match(/^(~+)/);o={type:"tilde-fence",count:e?e[1].length:0}}else l&&""!==i&&(s(),o={type:"indented"});if(n+=e+"\n","normal"===o.type){const e=""===i,n=""===t.trim(),o=t.trim().startsWith("#");(e&&n||e&&o)&&s()}}return s(),t},T:function(e){if(null===e.provider)return null;switch(e.provider){case"custom-agent":return e.agentId?{provider:"custom-agent",agentId:e.agentId}:null;case"n8n":return e.workflowId?{provider:"n8n",workflowId:e.workflowId}:null;default:return null===e.model?null:{provider:e.provider,model:e.model}}},_:a,a:function(e,t){return{model:e,name:t?.name||"",description:null,icon:t?.icon??null,createdAt:null,updatedAt:null,metadata:{allowFileUploads:!1,allowedFilesMimeTypes:"",capabilities:{functionCalling:"n8n"!==e.provider},available:!0},groupName:null,groupIcon:null}},c:function(e,t){let n=e;if(t.search.trim()){const e=t.search.toLowerCase();n=n.filter((t=>t.name.toLowerCase().includes(e)))}return n=[...n].sort(((e,n)=>{const o=e[t.sortBy],r=n[t.sortBy],s=o?Date.parse(o):void 0,a=r?Date.parse(r):void 0;return s&&a?a-s:s&&!a?-1:!s&&a?1:0})),n},d:function(e){const[t,o]=e.split("::"),r=n.safeParse(t).data;if(r)return"n8n"===r?{provider:"n8n",workflowId:o}:"custom-agent"===r?{provider:"custom-agent",agentId:o}:{provider:r,model:o}},f:function(e){return"n8n"===e.provider?{name:o,query:{workflowId:e.workflowId}}:"custom-agent"===e.provider?{name:o,query:{agentId:e.agentId}}:{name:o,query:{provider:e.provider,model:e.model}}},h:i,i:function(e,t,n){return{id:t,sessionId:e,type:"ai",name:"AI",content:[],executionId:n?.executionId??null,status:"running",createdAt:(new Date).toISOString(),updatedAt:(new Date).toISOString(),previousMessageId:n?.previousMessageId??null,retryOfMessageId:n?.retryOfMessageId??null,revisionOfMessageId:null,responses:[],alternatives:[],attachments:[],...n?.agent?s(n.agent.model):{provider:null,model:null,workflowId:null,agentId:null}}},l:function(e,t){for(const o of n.options){let n,r=-1/0;const s=a(o)?t[o]:void 0,l=e[o].models.filter((e=>!s||i(s,e.model)));for(const e of l){const t=e.metadata.priority??0;t>r&&(r=t,n=e)}if(n)return n}},m:function(e){const t=new Date,n=new Map;for(const o of e){const e=r(t,o.lastMessageAt??o.updatedAt);n.has(e)||n.set(e,[]),n.get(e).push(o)}return["Today","Yesterday","This week","Older"].flatMap((e=>{const t=n.get(e)??[];return t.length>0?[{group:e,sessions:t.sort(((e,t)=>Date.parse(t.lastMessageAt??t.updatedAt)-Date.parse(e.lastMessageAt??e.updatedAt)))}]:[]}))},n:function(e,t,n){const o=[];let r=!1;for(let a=0;a<t.activeMessageChain.length;a++){const i=t.activeMessageChain[a],l=t.messages[i];l&&(r=r||"running"===l.status,r||n?.sessionId!==e||"ai"!==l.type?o.push(l):n.retryOfMessageId!==i||n.messageId?n.messageId&&a===t.activeMessageChain.length-1?(o.push({...l,status:"running"}),r=!0):o.push(l):(o.push({...l,content:[],status:"running",...s(n.agent.model)}),r=!0))}return o},o:function(e,t,n=!1){return{id:e.sessionId,title:"New Chat",ownerId:"",lastMessageAt:(new Date).toISOString(),credentialId:null,agentName:e.agent.name,agentIcon:e.agent.icon,type:n?"manual":"production",createdAt:(new Date).toISOString(),updatedAt:(new Date).toISOString(),toolIds:t,...s(e.agent.model)}},p:r,r:function(e,t){const n=[];let o=[],r=0;for(const s of e)r+s.size>t&&o.length>0&&(n.push(o),o=[],r=0),o.push(s),r+=s.size;return o.length>0&&n.push(o),n},s:function(e){return e&&(e.includes("text/*")||e.includes("text/markdown"))?`${e},.md`:e},t:async function(e){const t=new FileReader;return await new Promise(((n,o)=>{t.onload=()=>{n({data:t.result.split("base64,")?.[1]??"",mimeType:e.type,fileName:e.name,fileSize:`${e.size} bytes`,fileExtension:e.name.split(".").pop()??"",fileType:e.type.split("/")[0]})},t.onerror=()=>{o(new Error("Failed to convert file to binary data"))},t.readAsDataURL(e)}))},u:s,v:function(e){return a(e?.provider)},w:function(e){return`${e.provider}::${"custom-agent"===e.provider?e.agentId:"n8n"===e.provider?e.workflowId:e.model}`},x:function(e){return!(!e||"waiting"!==e.status)&&e.content.some((e=>"with-buttons"===e.type&&e.blockUserInput))},y:function(e,t){return"n8n"===t.provider?"n8n"===e.model.provider&&e.model.workflowId===t.workflowId:"custom-agent"===t.provider?"custom-agent"===e.model.provider&&e.model.agentId===t.agentId:e.model.provider===t.provider&&e.model.model===t.model}}),{setters:[function(e){n=e.Qr},function(e){o=e.c}],execute:function(){try{t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(n=(new t.Error).stack)&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="70247c44-ac3b-4645-9537-e69f58e1fa0f",t._sentryDebugIdIdentifier="sentry-dbid-70247c44-ac3b-4645-9537-e69f58e1fa0f")}catch(t){}var t,n;e("S",{type:"icon",value:"message-square"}),e("E",{type:"icon",value:"bot"}),e("g",(e=>"success"===e.status&&"ai"!==e.type)),e("b",(e=>"ai"===e.type))}}}));
//# sourceMappingURL=fileUtils-legacy-Dp16LI9C.js.map