UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 4.82 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.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]=`0d78c865-6863-448b-b17f-ef085158b158`,e._sentryDebugIdIdentifier=`sentry-dbid-0d78c865-6863-448b-b17f-ef085158b158`)})()}catch{}import{$ as e,C as t,E as n,Ft as r,N as i,S as a,Sn as o,T as s,Wt as c,gt as l,h as u,j as d,w as f}from"./vue.runtime.esm-bundler-D9KLAxvJ.js";import{M as p}from"./_MapCache-CUJwh2qp.js";import{t as m}from"./_plugin-vue_export-helper-Dm3nT7Ps.js";var h={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function g(r,i){return e(),n(`svg`,h,[...i[0]||=[t(`path`,{fill:`currentColor`,d:`M20 6.91L17.09 4L12 9.09L6.91 4L4 6.91L9.09 12L4 17.09L6.91 20L12 14.91L17.09 20L20 17.09L14.91 12z`},null,-1)]])}var _={name:`mdi-closeThick`,render:g},v={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function y(r,i){return e(),n(`svg`,v,[...i[0]||=[t(`path`,{fill:`currentColor`,d:`M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m0 18h12v-8l-4 4l-2-2zM8 9a2 2 0 0 0-2 2a2 2 0 0 0 2 2a2 2 0 0 0 2-2a2 2 0 0 0-2-2`},null,-1)]])}var b={name:`mdi-fileImage`,render:y},x={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function S(r,i){return e(),n(`svg`,x,[...i[0]||=[t(`path`,{fill:`currentColor`,d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zm-1 11h-2v5a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2c.4 0 .7.1 1 .3V11h3zm0-4V3.5L18.5 9z`},null,-1)]])}var C={name:`mdi-fileMusic`,render:S},w={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function T(r,i){return e(),n(`svg`,w,[...i[0]||=[t(`path`,{fill:`currentColor`,d:`M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m9 16v-2H6v2zm3-4v-2H6v2z`},null,-1)]])}var E={name:`mdi-fileText`,render:T},D={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function O(r,i){return e(),n(`svg`,D,[...i[0]||=[t(`path`,{fill:`currentColor`,d:`M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m11 17v-6l-3 2.2V13H7v6h7v-2.2z`},null,-1)]])}var k={name:`mdi-fileVideo`,render:O},A={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function j(r,i){return e(),n(`svg`,A,[...i[0]||=[t(`path`,{fill:`currentColor`,d:`M14 3v2h3.59l-9.83 9.83l1.41 1.41L19 6.41V10h2V3m-2 16H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7h-2z`},null,-1)]])}var M={name:`mdi-openInNew`,render:j},N={class:`chat-file-name`},P=m(i({__name:`ChatFile`,props:{file:{},isRemovable:{type:Boolean},isPreviewable:{type:Boolean},href:{}},emits:[`remove`],setup(r,{emit:i}){let l=r,p=i,m={document:E,audio:C,image:b,video:k},h=a(()=>m[l.file?.type.split(`/`)[0]]||E);function g(){if(l.href){window.open(l.href,`_blank`,`noopener noreferrer`);return}l.isPreviewable&&window.open(URL.createObjectURL(l.file))}function v(){p(`remove`,l.file)}return(i,a)=>(e(),n(`div`,{class:`chat-file`,"data-test-id":`chat-file`,onClick:g},[d(c(h),{class:`chat-icon`}),t(`p`,N,o(r.file.name),1),r.isRemovable?(e(),n(`span`,{key:0,class:`chat-file-delete`,"data-test-id":`chat-file-remove`,onClick:u(v,[`stop`])},[d(c(_))])):r.isPreviewable||r.href?(e(),f(c(M),{key:1,class:`chat-file-preview`})):s(``,!0)]))}}),[[`__scopeId`,`data-v-06c7b5c1`]]);function F(e,{container:t,defaultSize:n,snap:i=!0,minSize:o=0,maxSize:s=e=>e,position:u=`left`,allowCollapse:d,allowFullSize:f}){let m=r(0),h=p(e,-1,{writeDefaults:!1}),g=r(!1),_=r(),v=a(()=>w(o,m.value)),y=a(()=>w(s,m.value)),b=a(()=>{let e=h.value>=0&&h.value<=1?m.value*h.value:-1;if(g.value&&d&&e<30)return 0;if(g.value&&f&&e>m.value-30)return m.value;let t=w(n,m.value);return Number.isNaN(e)||!Number.isFinite(e)||e<0?t:Math.max(v.value,Math.min(i&&Math.abs(t-e)<30?t:e,y.value))});function x(e){return u===`bottom`?e.height:e.width}function S(e){return u===`bottom`?e.offsetHeight:e.offsetWidth}function C(e){return u===`bottom`?e.y:e.x}function w(e,t){return typeof e==`number`?e:e(t)}function T(e){let n=c(t)?.getBoundingClientRect(),r=Math.max(0,u===`bottom`?(n?x(n):0)-C(e):C(e)-(n?C(n):0));g.value=!0,h.value=r/m.value,_.value===void 0&&(_.value=h.value)}function E(){(v.value>0&&b.value<=0||y.value<m.value&&b.value>=m.value)&&(h.value=_.value),_.value=void 0,g.value=!1}return l(()=>c(t),(e,t,n)=>{if(!e)return;let r=new ResizeObserver(()=>{m.value=S(e)});r.observe(e),m.value=S(e),n(()=>r.disconnect())},{immediate:!0}),{isResizing:a(()=>g.value),isCollapsed:a(()=>g.value&&b.value<=0),isFullSize:a(()=>g.value&&b.value>=m.value),size:b,onResize:T,onResizeEnd:E}}export{P as n,F as t}; //# sourceMappingURL=useResizablePanel-CFn0Gfyi.js.map