@vue-flow/node-resizer
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -43,4 +43,4 @@ import type { NodeResizerProps, ResizeDragEvent, ResizeEventParams } from './types' | ||
export default _default | ||
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
declare type __VLS_TypePropsToRuntimeProps<T> = { | ||
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
type __VLS_TypePropsToRuntimeProps<T> = { | ||
[K in keyof T]-?: {} extends Pick<T, K> | ||
@@ -55,3 +55,3 @@ ? { | ||
} | ||
declare type __VLS_WithDefaults<P, D> = { | ||
type __VLS_WithDefaults<P, D> = { | ||
[K in keyof Pick<P, keyof P>]: K extends keyof D | ||
@@ -58,0 +58,0 @@ ? P[K] & { |
import type { ResizeControlProps, ResizeDragEvent, ResizeEventParams } from './types' | ||
import type { ResizeControlVariant } from './types' | ||
declare const _default: { | ||
new (...args: any[]): { | ||
$: import('vue').ComponentInternalInstance | ||
$data: {} | ||
$props: Partial<{ | ||
minWidth: number | ||
minHeight: number | ||
variant: ResizeControlVariant | ||
}> & | ||
Omit< | ||
Readonly< | ||
import('vue').ExtractPropTypes< | ||
__VLS_WithDefaults< | ||
__VLS_TypePropsToRuntimeProps<ResizeControlProps>, | ||
{ | ||
variant: ResizeControlVariant | ||
minWidth: number | ||
minHeight: number | ||
} | ||
> | ||
> | ||
> & { | ||
onResizeStart?: ((data: { event: ResizeDragEvent; params: ResizeEventParams }) => any) | undefined | ||
onResize?: ((data: { event: ResizeDragEvent; params: ResizeEventParams }) => any) | undefined | ||
onResizeEnd?: ((data: { event: ResizeDragEvent; params: ResizeEventParams }) => any) | undefined | ||
} & import('vue').VNodeProps & | ||
import('vue').AllowedComponentProps & | ||
import('vue').ComponentCustomProps, | ||
'minWidth' | 'minHeight' | 'variant' | ||
> | ||
$attrs: { | ||
[x: string]: unknown | ||
} | ||
$refs: { | ||
[x: string]: unknown | ||
} | ||
$slots: Readonly<{ | ||
[name: string]: import('vue').Slot | undefined | ||
}> | ||
$root: | ||
| import('vue').ComponentPublicInstance< | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
false, | ||
import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}> | ||
> | ||
| null | ||
$parent: | ||
| import('vue').ComponentPublicInstance< | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
false, | ||
import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}> | ||
> | ||
| null | ||
$emit: (( | ||
event: 'resizeStart', | ||
data: { | ||
event: ResizeDragEvent | ||
params: ResizeEventParams | ||
}, | ||
) => void) & | ||
(( | ||
event: 'resize', | ||
data: { | ||
event: ResizeDragEvent | ||
params: ResizeEventParams | ||
}, | ||
) => void) & | ||
(( | ||
event: 'resizeEnd', | ||
data: { | ||
event: ResizeDragEvent | ||
params: ResizeEventParams | ||
}, | ||
) => void) | ||
$el: any | ||
$options: import('vue').ComponentOptionsBase< | ||
Readonly< | ||
import('vue').ExtractPropTypes< | ||
__VLS_WithDefaults< | ||
__VLS_TypePropsToRuntimeProps<ResizeControlProps>, | ||
{ | ||
variant: ResizeControlVariant | ||
minWidth: number | ||
minHeight: number | ||
} | ||
> | ||
> | ||
> & { | ||
onResizeStart?: ((data: { event: ResizeDragEvent; params: ResizeEventParams }) => any) | undefined | ||
onResize?: ((data: { event: ResizeDragEvent; params: ResizeEventParams }) => any) | undefined | ||
onResizeEnd?: ((data: { event: ResizeDragEvent; params: ResizeEventParams }) => any) | undefined | ||
}, | ||
{}, | ||
unknown, | ||
{}, | ||
{}, | ||
import('vue').ComponentOptionsMixin, | ||
import('vue').ComponentOptionsMixin, | ||
declare const _default: __VLS_WithTemplateSlots< | ||
import('vue').DefineComponent< | ||
__VLS_WithDefaults< | ||
__VLS_TypePropsToRuntimeProps<ResizeControlProps>, | ||
{ | ||
resizeStart: (data: { event: ResizeDragEvent; params: ResizeEventParams }) => void | ||
} & { | ||
resize: (data: { event: ResizeDragEvent; params: ResizeEventParams }) => void | ||
} & { | ||
resizeEnd: (data: { event: ResizeDragEvent; params: ResizeEventParams }) => void | ||
}, | ||
string, | ||
{ | ||
variant: ResizeControlVariant | ||
minWidth: number | ||
minHeight: number | ||
variant: ResizeControlVariant | ||
} | ||
>, | ||
{}, | ||
unknown, | ||
{}, | ||
{}, | ||
import('vue').ComponentOptionsMixin, | ||
import('vue').ComponentOptionsMixin, | ||
{ | ||
resizeStart: (data: { event: ResizeDragEvent; params: ResizeEventParams }) => void | ||
} & { | ||
resize: (data: { event: ResizeDragEvent; params: ResizeEventParams }) => void | ||
} & { | ||
resizeEnd: (data: { event: ResizeDragEvent; params: ResizeEventParams }) => void | ||
}, | ||
string, | ||
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, | ||
Readonly< | ||
import('vue').ExtractPropTypes< | ||
__VLS_WithDefaults< | ||
__VLS_TypePropsToRuntimeProps<ResizeControlProps>, | ||
{ | ||
variant: ResizeControlVariant | ||
minWidth: number | ||
minHeight: number | ||
} | ||
> | ||
> | ||
> & { | ||
beforeCreate?: ((() => void) | (() => void)[]) | undefined | ||
created?: ((() => void) | (() => void)[]) | undefined | ||
beforeMount?: ((() => void) | (() => void)[]) | undefined | ||
mounted?: ((() => void) | (() => void)[]) | undefined | ||
beforeUpdate?: ((() => void) | (() => void)[]) | undefined | ||
updated?: ((() => void) | (() => void)[]) | undefined | ||
activated?: ((() => void) | (() => void)[]) | undefined | ||
deactivated?: ((() => void) | (() => void)[]) | undefined | ||
beforeDestroy?: ((() => void) | (() => void)[]) | undefined | ||
beforeUnmount?: ((() => void) | (() => void)[]) | undefined | ||
destroyed?: ((() => void) | (() => void)[]) | undefined | ||
unmounted?: ((() => void) | (() => void)[]) | undefined | ||
renderTracked?: (((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[]) | undefined | ||
renderTriggered?: (((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[]) | undefined | ||
errorCaptured?: | ||
| ( | ||
| (( | ||
err: unknown, | ||
instance: | ||
| import('vue').ComponentPublicInstance< | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
false, | ||
import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}> | ||
> | ||
| null, | ||
info: string, | ||
) => boolean | void) | ||
| (( | ||
err: unknown, | ||
instance: | ||
| import('vue').ComponentPublicInstance< | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
{}, | ||
false, | ||
import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}> | ||
> | ||
| null, | ||
info: string, | ||
) => boolean | void)[] | ||
) | ||
| undefined | ||
} | ||
$forceUpdate: () => void | ||
$nextTick: typeof import('vue').nextTick | ||
$watch( | ||
source: string | Function, | ||
cb: Function, | ||
options?: import('vue').WatchOptions<boolean> | undefined, | ||
): import('vue').WatchStopHandle | ||
} & Readonly< | ||
import('vue').ExtractPropTypes< | ||
__VLS_WithDefaults< | ||
__VLS_TypePropsToRuntimeProps<ResizeControlProps>, | ||
{ | ||
variant: ResizeControlVariant | ||
minWidth: number | ||
minHeight: number | ||
} | ||
> | ||
> | ||
> & { | ||
onResizeStart?: ((data: { event: ResizeDragEvent; params: ResizeEventParams }) => any) | undefined | ||
onResize?: ((data: { event: ResizeDragEvent; params: ResizeEventParams }) => any) | undefined | ||
onResizeEnd?: ((data: { event: ResizeDragEvent; params: ResizeEventParams }) => any) | undefined | ||
} & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties | ||
__isFragment?: undefined | ||
__isTeleport?: undefined | ||
__isSuspense?: undefined | ||
} & import('vue').ComponentOptionsBase< | ||
Readonly< | ||
import('vue').ExtractPropTypes< | ||
__VLS_WithDefaults< | ||
__VLS_TypePropsToRuntimeProps<ResizeControlProps>, | ||
{ | ||
variant: ResizeControlVariant | ||
minWidth: number | ||
minHeight: number | ||
} | ||
> | ||
> | ||
> & { | ||
onResizeStart?: ((data: { event: ResizeDragEvent; params: ResizeEventParams }) => any) | undefined | ||
onResize?: ((data: { event: ResizeDragEvent; params: ResizeEventParams }) => any) | undefined | ||
onResizeEnd?: ((data: { event: ResizeDragEvent; params: ResizeEventParams }) => any) | undefined | ||
}, | ||
{}, | ||
unknown, | ||
{}, | ||
{}, | ||
import('vue').ComponentOptionsMixin, | ||
import('vue').ComponentOptionsMixin, | ||
}, | ||
{ | ||
minWidth: number | ||
minHeight: number | ||
variant: ResizeControlVariant | ||
} | ||
>, | ||
{ | ||
resizeStart: (data: { event: ResizeDragEvent; params: ResizeEventParams }) => void | ||
} & { | ||
resize: (data: { event: ResizeDragEvent; params: ResizeEventParams }) => void | ||
} & { | ||
resizeEnd: (data: { event: ResizeDragEvent; params: ResizeEventParams }) => void | ||
}, | ||
string, | ||
{ | ||
minWidth: number | ||
minHeight: number | ||
variant: ResizeControlVariant | ||
default: (_: {}) => any | ||
} | ||
> & | ||
import('vue').VNodeProps & | ||
import('vue').AllowedComponentProps & | ||
import('vue').ComponentCustomProps & | ||
(new () => { | ||
$slots: { | ||
default: (_: {}) => any | ||
} | ||
}) | ||
> | ||
export default _default | ||
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
declare type __VLS_TypePropsToRuntimeProps<T> = { | ||
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
type __VLS_TypePropsToRuntimeProps<T> = { | ||
[K in keyof T]-?: {} extends Pick<T, K> | ||
@@ -267,3 +66,3 @@ ? { | ||
} | ||
declare type __VLS_WithDefaults<P, D> = { | ||
type __VLS_WithDefaults<P, D> = { | ||
[K in keyof Pick<P, keyof P>]: K extends keyof D | ||
@@ -275,1 +74,6 @@ ? P[K] & { | ||
} | ||
type __VLS_WithTemplateSlots<T, S> = T & { | ||
new (): { | ||
$slots: S | ||
} | ||
} |
@@ -27,4 +27,4 @@ import type { ResizeControlLineProps, ResizeDragEvent, ResizeEventParams } from './types' | ||
export default _default | ||
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
declare type __VLS_TypePropsToRuntimeProps<T> = { | ||
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
type __VLS_TypePropsToRuntimeProps<T> = { | ||
[K in keyof T]-?: {} extends Pick<T, K> | ||
@@ -31,0 +31,0 @@ ? { |
@@ -43,4 +43,4 @@ import type { D3DragEvent, SubjectPosition } from 'd3-drag' | ||
} | ||
export declare type ControlLinePosition = 'top' | 'bottom' | 'left' | 'right' | ||
export declare type ControlPosition = ControlLinePosition | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | ||
export type ControlLinePosition = 'top' | 'bottom' | 'left' | 'right' | ||
export type ControlPosition = ControlLinePosition | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | ||
export declare enum ResizeControlVariant { | ||
@@ -66,2 +66,2 @@ Line = 'line', | ||
} | ||
export declare type ResizeDragEvent = D3DragEvent<HTMLDivElement, null, SubjectPosition> | ||
export type ResizeDragEvent = D3DragEvent<HTMLDivElement, null, SubjectPosition> |
@@ -1,1 +0,1 @@ | ||
var vueFlowNodeResizer=function(F,f,K){"use strict";const An="";var G=(t=>(t.Line="line",t.Handle="handle",t))(G||{}),J="http://www.w3.org/1999/xhtml";const rt={svg:"http://www.w3.org/2000/svg",xhtml:J,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function it(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),rt.hasOwnProperty(e)?{space:rt[e],local:t}:t}function Et(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===J&&e.documentElement.namespaceURI===J?e.createElement(t):e.createElementNS(n,t)}}function zt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function ot(t){var e=it(t);return(e.local?zt:Et)(e)}function Nt(){}function st(t){return t==null?Nt:function(){return this.querySelector(t)}}function Pt(t){typeof t!="function"&&(t=st(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],l=o.length,s=r[i]=new Array(l),a,c,h=0;h<l;++h)(a=o[h])&&(c=t.call(a,a.__data__,h,o))&&("__data__"in a&&(c.__data__=a.__data__),s[h]=c);return new x(r,this._parents)}function Rt(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function kt(){return[]}function Vt(t){return t==null?kt:function(){return this.querySelectorAll(t)}}function Tt(t){return function(){return Rt(t.apply(this,arguments))}}function Bt(t){typeof t=="function"?t=Tt(t):t=Vt(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var l=e[o],s=l.length,a,c=0;c<s;++c)(a=l[c])&&(r.push(t.call(a,a.__data__,c,l)),i.push(a));return new x(r,i)}function Ft(t){return function(){return this.matches(t)}}function lt(t){return function(e){return e.matches(t)}}var Lt=Array.prototype.find;function Mt(t){return function(){return Lt.call(this.children,t)}}function It(){return this.firstElementChild}function Xt(t){return this.select(t==null?It:Mt(typeof t=="function"?t:lt(t)))}var Yt=Array.prototype.filter;function Ht(){return Array.from(this.children)}function Dt(t){return function(){return Yt.call(this.children,t)}}function Ot(t){return this.selectAll(t==null?Ht:Dt(typeof t=="function"?t:lt(t)))}function qt(t){typeof t!="function"&&(t=Ft(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],l=o.length,s=r[i]=[],a,c=0;c<l;++c)(a=o[c])&&t.call(a,a.__data__,c,o)&&s.push(a);return new x(r,this._parents)}function ut(t){return new Array(t.length)}function Wt(){return new x(this._enter||this._groups.map(ut),this._parents)}function H(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}H.prototype={constructor:H,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Ut(t){return function(){return t}}function $t(t,e,n,r,i,o){for(var l=0,s,a=e.length,c=o.length;l<c;++l)(s=e[l])?(s.__data__=o[l],r[l]=s):n[l]=new H(t,o[l]);for(;l<a;++l)(s=e[l])&&(i[l]=s)}function Kt(t,e,n,r,i,o,l){var s,a,c=new Map,h=e.length,m=o.length,g=new Array(h),b;for(s=0;s<h;++s)(a=e[s])&&(g[s]=b=l.call(a,a.__data__,s,e)+"",c.has(b)?i[s]=a:c.set(b,a));for(s=0;s<m;++s)b=l.call(t,o[s],s,o)+"",(a=c.get(b))?(r[s]=a,a.__data__=o[s],c.delete(b)):n[s]=new H(t,o[s]);for(s=0;s<h;++s)(a=e[s])&&c.get(g[s])===a&&(i[s]=a)}function Gt(t){return t.__data__}function Jt(t,e){if(!arguments.length)return Array.from(this,Gt);var n=e?Kt:$t,r=this._parents,i=this._groups;typeof t!="function"&&(t=Ut(t));for(var o=i.length,l=new Array(o),s=new Array(o),a=new Array(o),c=0;c<o;++c){var h=r[c],m=i[c],g=m.length,b=Qt(t.call(h,h&&h.__data__,c,r)),y=b.length,P=s[c]=new Array(y),R=l[c]=new Array(y),I=a[c]=new Array(g);n(h,m,P,R,I,b,e);for(var S=0,A=0,u,p;S<y;++S)if(u=P[S]){for(S>=A&&(A=S+1);!(p=R[A])&&++A<y;);u._next=p||null}}return l=new x(l,r),l._enter=s,l._exit=a,l}function Qt(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Zt(){return new x(this._exit||this._groups.map(ut),this._parents)}function jt(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function te(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,l=Math.min(i,o),s=new Array(i),a=0;a<l;++a)for(var c=n[a],h=r[a],m=c.length,g=s[a]=new Array(m),b,y=0;y<m;++y)(b=c[y]||h[y])&&(g[y]=b);for(;a<i;++a)s[a]=n[a];return new x(s,this._parents)}function ee(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],l;--i>=0;)(l=r[i])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}function ne(t){t||(t=re);function e(m,g){return m&&g?t(m.__data__,g.__data__):!m-!g}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var l=n[o],s=l.length,a=i[o]=new Array(s),c,h=0;h<s;++h)(c=l[h])&&(a[h]=c);a.sort(e)}return new x(i,this._parents).order()}function re(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ie(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function oe(){return Array.from(this)}function se(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var l=r[i];if(l)return l}return null}function le(){let t=0;for(const e of this)++t;return t}function ue(){return!this.node()}function ae(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,l=i.length,s;o<l;++o)(s=i[o])&&t.call(s,s.__data__,o,i);return this}function ce(t){return function(){this.removeAttribute(t)}}function fe(t){return function(){this.removeAttributeNS(t.space,t.local)}}function he(t,e){return function(){this.setAttribute(t,e)}}function de(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function pe(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function ge(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function me(t,e){var n=it(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?fe:ce:typeof e=="function"?n.local?ge:pe:n.local?de:he)(n,e))}function at(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ye(t){return function(){this.style.removeProperty(t)}}function _e(t,e,n){return function(){this.style.setProperty(t,e,n)}}function ve(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function we(t,e,n){return arguments.length>1?this.each((e==null?ye:typeof e=="function"?ve:_e)(t,e,n==null?"":n)):be(this.node(),t)}function be(t,e){return t.style.getPropertyValue(e)||at(t).getComputedStyle(t,null).getPropertyValue(e)}function Se(t){return function(){delete this[t]}}function Ce(t,e){return function(){this[t]=e}}function xe(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Ae(t,e){return arguments.length>1?this.each((e==null?Se:typeof e=="function"?xe:Ce)(t,e)):this.node()[t]}function ct(t){return t.trim().split(/^|\s+/)}function Q(t){return t.classList||new ft(t)}function ft(t){this._node=t,this._names=ct(t.getAttribute("class")||"")}ft.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function ht(t,e){for(var n=Q(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function dt(t,e){for(var n=Q(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Ee(t){return function(){ht(this,t)}}function ze(t){return function(){dt(this,t)}}function Ne(t,e){return function(){(e.apply(this,arguments)?ht:dt)(this,t)}}function Pe(t,e){var n=ct(t+"");if(arguments.length<2){for(var r=Q(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Ne:e?Ee:ze)(n,e))}function Re(){this.textContent=""}function ke(t){return function(){this.textContent=t}}function Ve(t){return function(){var e=t.apply(this,arguments);this.textContent=e==null?"":e}}function Te(t){return arguments.length?this.each(t==null?Re:(typeof t=="function"?Ve:ke)(t)):this.node().textContent}function Be(){this.innerHTML=""}function Fe(t){return function(){this.innerHTML=t}}function Le(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e==null?"":e}}function Me(t){return arguments.length?this.each(t==null?Be:(typeof t=="function"?Le:Fe)(t)):this.node().innerHTML}function Ie(){this.nextSibling&&this.parentNode.appendChild(this)}function Xe(){return this.each(Ie)}function Ye(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function He(){return this.each(Ye)}function De(t){var e=typeof t=="function"?t:ot(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Oe(){return null}function qe(t,e){var n=typeof t=="function"?t:ot(t),r=e==null?Oe:typeof e=="function"?e:st(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function We(){var t=this.parentNode;t&&t.removeChild(this)}function Ue(){return this.each(We)}function $e(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ke(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ge(t){return this.select(t?Ke:$e)}function Je(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Qe(t){return function(e){t.call(this,e,this.__data__)}}function Ze(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function je(t){return function(){var e=this.__on;if(!!e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function tn(t,e,n){return function(){var r=this.__on,i,o=Qe(e);if(r){for(var l=0,s=r.length;l<s;++l)if((i=r[l]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function en(t,e,n){var r=Ze(t+""),i,o=r.length,l;if(arguments.length<2){var s=this.node().__on;if(s){for(var a=0,c=s.length,h;a<c;++a)for(i=0,h=s[a];i<o;++i)if((l=r[i]).type===h.type&&l.name===h.name)return h.value}return}for(s=e?tn:je,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function pt(t,e,n){var r=at(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function nn(t,e){return function(){return pt(this,t,e)}}function rn(t,e){return function(){return pt(this,t,e.apply(this,arguments))}}function on(t,e){return this.each((typeof e=="function"?rn:nn)(t,e))}function*sn(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,l;i<o;++i)(l=r[i])&&(yield l)}var ln=[null];function x(t,e){this._groups=t,this._parents=e}function un(){return this}x.prototype={constructor:x,select:Pt,selectAll:Bt,selectChild:Xt,selectChildren:Ot,filter:qt,data:Jt,enter:Wt,exit:Zt,join:jt,merge:te,selection:un,order:ee,sort:ne,call:ie,nodes:oe,node:se,size:le,empty:ue,each:ae,attr:me,style:we,property:Ae,classed:Pe,text:Te,html:Me,raise:Xe,lower:He,append:De,insert:qe,remove:Ue,clone:Ge,datum:Je,on:en,dispatch:on,[Symbol.iterator]:sn};function L(t){return typeof t=="string"?new x([[document.querySelector(t)]],[document.documentElement]):new x([[t]],ln)}function an(t){let e;for(;e=t.sourceEvent;)t=e;return t}function gt(t,e){if(t=an(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}var cn={value:()=>{}};function mt(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new D(n)}function D(t){this._=t}function fn(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}D.prototype=mt.prototype={constructor:D,on:function(t,e){var n=this._,r=fn(t+"",n),i,o=-1,l=r.length;if(arguments.length<2){for(;++o<l;)if((i=(t=r[o]).type)&&(i=hn(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<l;)if(i=(t=r[o]).type)n[i]=yt(n[i],t.name,e);else if(e==null)for(i in n)n[i]=yt(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new D(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function hn(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function yt(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=cn,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}const dn={passive:!1},M={capture:!0,passive:!1};function Z(t){t.stopImmediatePropagation()}function N(t){t.preventDefault(),t.stopImmediatePropagation()}function pn(t){var e=t.document.documentElement,n=L(t).on("dragstart.drag",N,M);"onselectstart"in e?n.on("selectstart.drag",N,M):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function gn(t,e){var n=t.document.documentElement,r=L(t).on("dragstart.drag",null);e&&(r.on("click.drag",N,M),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const O=t=>()=>t;function j(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:l,y:s,dx:a,dy:c,dispatch:h}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}j.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function mn(t){return!t.ctrlKey&&!t.button}function yn(){return this.parentNode}function _n(t,e){return e==null?{x:t.x,y:t.y}:e}function vn(){return navigator.maxTouchPoints||"ontouchstart"in this}function wn(){var t=mn,e=yn,n=_n,r=vn,i={},o=mt("start","drag","end"),l=0,s,a,c,h,m=0;function g(u){u.on("mousedown.drag",b).filter(r).on("touchstart.drag",R).on("touchmove.drag",I,dn).on("touchend.drag touchcancel.drag",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(u,p){if(!(h||!t.call(this,u,p))){var d=A(this,e.call(this,u,p),u,p,"mouse");!d||(L(u.view).on("mousemove.drag",y,M).on("mouseup.drag",P,M),pn(u.view),Z(u),c=!1,s=u.clientX,a=u.clientY,d("start",u))}}function y(u){if(N(u),!c){var p=u.clientX-s,d=u.clientY-a;c=p*p+d*d>m}i.mouse("drag",u)}function P(u){L(u.view).on("mousemove.drag mouseup.drag",null),gn(u.view,c),N(u),i.mouse("end",u)}function R(u,p){if(!!t.call(this,u,p)){var d=u.changedTouches,_=e.call(this,u,p),v=d.length,C,E;for(C=0;C<v;++C)(E=A(this,_,u,p,d[C].identifier,d[C]))&&(Z(u),E("start",u,d[C]))}}function I(u){var p=u.changedTouches,d=p.length,_,v;for(_=0;_<d;++_)(v=i[p[_].identifier])&&(N(u),v("drag",u,p[_]))}function S(u){var p=u.changedTouches,d=p.length,_,v;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),_=0;_<d;++_)(v=i[p[_].identifier])&&(Z(u),v("end",u,p[_]))}function A(u,p,d,_,v,C){var E=o.copy(),w=gt(C||d,p),z,k,V;if((V=n.call(u,new j("beforestart",{sourceEvent:d,target:g,identifier:v,active:l,x:w[0],y:w[1],dx:0,dy:0,dispatch:E}),_))!=null)return z=V.x-w[0]||0,k=V.y-w[1]||0,function et(T,X,q){var Y=w,B;switch(T){case"start":i[v]=et,B=l++;break;case"end":delete i[v],--l;case"drag":w=gt(q||X,p),B=l;break}E.call(T,u,new j(T,{sourceEvent:X,subject:V,target:g,identifier:v,active:B,x:w[0]+z,y:w[1]+k,dx:w[0]-Y[0],dy:w[1]-Y[1],dispatch:E}),_)}}return g.filter=function(u){return arguments.length?(t=typeof u=="function"?u:O(!!u),g):t},g.container=function(u){return arguments.length?(e=typeof u=="function"?u:O(u),g):e},g.subject=function(u){return arguments.length?(n=typeof u=="function"?u:O(u),g):n},g.touchable=function(u){return arguments.length?(r=typeof u=="function"?u:O(!!u),g):r},g.on=function(){var u=o.on.apply(o,arguments);return u===o?g:u},g.clickDistance=function(u){return arguments.length?(m=(u=+u)*u,g):Math.sqrt(m)},g}const tt=f.defineComponent({__name:"ResizeControl",props:{nodeId:null,color:null,minWidth:{default:10},minHeight:{default:10},position:null,variant:{default:"handle"}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=t,r={width:0,height:0,x:0,y:0},i={...r,pointerX:0,pointerY:0},o=f.inject(K.NodeIdInjection,null),l=f.ref(),s=f.computed(()=>typeof n.nodeId=="string"?n.nodeId:o),{findNode:a,emits:c}=K.useVueFlow(),h=f.ref(i),m=f.ref(r),g=K.useGetPointerPosition(),b=f.computed(()=>n.variant==="line"?"right":"bottom-right"),y=f.computed(()=>{var S;return(S=n.position)!=null?S:b.value});f.watchEffect(S=>{if(!l.value||!s.value)return;const A=L(l.value),u=wn().on("start",p=>{var C,E,w,z;const d=a(s.value),{xSnapped:_,ySnapped:v}=g(p);m.value={width:(C=d==null?void 0:d.dimensions.width)!=null?C:0,height:(E=d==null?void 0:d.dimensions.height)!=null?E:0,x:(w=d==null?void 0:d.position.x)!=null?w:0,y:(z=d==null?void 0:d.position.y)!=null?z:0},h.value={...m.value,pointerX:_,pointerY:v},e("resizeStart",{event:p,params:m.value})}).on("drag",p=>{const{xSnapped:d,ySnapped:_}=g(p),v=a(s.value),C=y.value.includes("right")||y.value.includes("left"),E=y.value.includes("bottom")||y.value.includes("top"),w=y.value.includes("left"),z=y.value.includes("top");if(v){const k=[],{pointerX:V,pointerY:et,width:T,height:X,x:q,y:Y}=h.value,{x:B,y:_t,width:Cn,height:xn}=m.value,vt=Math.floor(C?d-V:0),wt=Math.floor(E?_-et:0),W=Math.max(T+(w?-vt:vt),n.minWidth),U=Math.max(X+(z?-wt:wt),n.minHeight),bt=W!==Cn,St=U!==xn;if(w||z){const $=w?q-(W-T):q,Ct=z?Y-(U-X):Y,xt=$!==B&&bt,At=Ct!==_t&&St;if(xt||At){const nt={id:v.id,type:"position",from:v.position,position:{x:xt?$:B,y:At?Ct:_t}};k.push(nt),m.value.x=nt.position.x,m.value.y=nt.position.y}}if(bt||St){const $={id:s.value,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:W,height:U}};k.push($),m.value.width=W,m.value.height=U}e("resize",{event:p,params:m.value}),c.nodesChange(k)}}).on("end",p=>{const d={id:s.value,type:"dimensions",resizing:!1};e("resizeEnd",{event:p,params:m.value}),c.nodesChange([d])});A.call(u),S(()=>{A.on(".drag",null)})});const P=f.computed(()=>y.value.split("-")),R=f.computed(()=>n.variant==="line"?"borderColor":"backgroundColor"),I=f.computed(()=>n.color?{[R.value]:n.color}:{});return(S,A)=>(f.openBlock(),f.createElementBlock("div",{ref_key:"resizeControlRef",ref:l,class:f.normalizeClass(["vue-flow__resize-control nodrag",[...f.unref(P),t.variant]]),style:f.normalizeStyle(f.unref(I))},[f.renderSlot(S.$slots,"default")],6))}}),bn={name:"NodeResizer",inheritAttrs:!1},Sn=f.defineComponent({...bn,props:{nodeId:null,color:null,handleClassName:null,handleStyle:null,lineClassName:null,lineStyle:null,isVisible:{type:Boolean,default:!0},minWidth:null,minHeight:null},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=["top-left","top-right","bottom-left","bottom-right"],r=["top","right","bottom","left"];return(i,o)=>(f.openBlock(),f.createElementBlock(f.Fragment,null,[(f.openBlock(),f.createElementBlock(f.Fragment,null,f.renderList(r,l=>f.createVNode(tt,{key:l,class:f.normalizeClass(t.lineClassName),style:f.normalizeStyle(t.lineStyle),"node-id":t.nodeId,position:l,variant:f.unref(G).Line,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,onResizeStart:o[0]||(o[0]=s=>e("resizeStart",s)),onResize:o[1]||(o[1]=s=>e("resize",s)),onResizeEnd:o[2]||(o[2]=s=>e("resizeEnd",s))},null,8,["class","style","node-id","position","variant","color","min-width","min-height"])),64)),(f.openBlock(),f.createElementBlock(f.Fragment,null,f.renderList(n,l=>f.createVNode(tt,{key:l,class:f.normalizeClass(t.lineClassName),style:f.normalizeStyle(t.lineStyle),"node-id":t.nodeId,position:l,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,onResizeStart:o[3]||(o[3]=s=>e("resizeStart",s)),onResize:o[4]||(o[4]=s=>e("resize",s)),onResizeEnd:o[5]||(o[5]=s=>e("resizeEnd",s))},null,8,["class","style","node-id","position","color","min-width","min-height"])),64))],64))}});return F.NodeResizeControl=tt,F.NodeResizer=Sn,F.ResizeControlVariant=G,Object.defineProperties(F,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),F}({},Vue,VueFlow); | ||
var vueFlowNodeResizer=function(B,f,G){"use strict";const An="";var F=(t=>(t.Line="line",t.Handle="handle",t))(F||{}),J="http://www.w3.org/1999/xhtml";const rt={svg:"http://www.w3.org/2000/svg",xhtml:J,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function it(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),rt.hasOwnProperty(e)?{space:rt[e],local:t}:t}function Et(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===J&&e.documentElement.namespaceURI===J?e.createElement(t):e.createElementNS(n,t)}}function zt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function ot(t){var e=it(t);return(e.local?zt:Et)(e)}function Nt(){}function st(t){return t==null?Nt:function(){return this.querySelector(t)}}function Pt(t){typeof t!="function"&&(t=st(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],l=o.length,s=r[i]=new Array(l),a,c,h=0;h<l;++h)(a=o[h])&&(c=t.call(a,a.__data__,h,o))&&("__data__"in a&&(c.__data__=a.__data__),s[h]=c);return new S(r,this._parents)}function Rt(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function kt(){return[]}function Vt(t){return t==null?kt:function(){return this.querySelectorAll(t)}}function Lt(t){return function(){return Rt(t.apply(this,arguments))}}function Tt(t){typeof t=="function"?t=Lt(t):t=Vt(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var l=e[o],s=l.length,a,c=0;c<s;++c)(a=l[c])&&(r.push(t.call(a,a.__data__,c,l)),i.push(a));return new S(r,i)}function Bt(t){return function(){return this.matches(t)}}function lt(t){return function(e){return e.matches(t)}}var Ft=Array.prototype.find;function Mt(t){return function(){return Ft.call(this.children,t)}}function It(){return this.firstElementChild}function Xt(t){return this.select(t==null?It:Mt(typeof t=="function"?t:lt(t)))}var Yt=Array.prototype.filter;function Ht(){return Array.from(this.children)}function Dt(t){return function(){return Yt.call(this.children,t)}}function Ot(t){return this.selectAll(t==null?Ht:Dt(typeof t=="function"?t:lt(t)))}function qt(t){typeof t!="function"&&(t=Bt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],l=o.length,s=r[i]=[],a,c=0;c<l;++c)(a=o[c])&&t.call(a,a.__data__,c,o)&&s.push(a);return new S(r,this._parents)}function ut(t){return new Array(t.length)}function Wt(){return new S(this._enter||this._groups.map(ut),this._parents)}function D(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}D.prototype={constructor:D,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Ut(t){return function(){return t}}function $t(t,e,n,r,i,o){for(var l=0,s,a=e.length,c=o.length;l<c;++l)(s=e[l])?(s.__data__=o[l],r[l]=s):n[l]=new D(t,o[l]);for(;l<a;++l)(s=e[l])&&(i[l]=s)}function Kt(t,e,n,r,i,o,l){var s,a,c=new Map,h=e.length,m=o.length,g=new Array(h),w;for(s=0;s<h;++s)(a=e[s])&&(g[s]=w=l.call(a,a.__data__,s,e)+"",c.has(w)?i[s]=a:c.set(w,a));for(s=0;s<m;++s)w=l.call(t,o[s],s,o)+"",(a=c.get(w))?(r[s]=a,a.__data__=o[s],c.delete(w)):n[s]=new D(t,o[s]);for(s=0;s<h;++s)(a=e[s])&&c.get(g[s])===a&&(i[s]=a)}function Gt(t){return t.__data__}function Jt(t,e){if(!arguments.length)return Array.from(this,Gt);var n=e?Kt:$t,r=this._parents,i=this._groups;typeof t!="function"&&(t=Ut(t));for(var o=i.length,l=new Array(o),s=new Array(o),a=new Array(o),c=0;c<o;++c){var h=r[c],m=i[c],g=m.length,w=Qt(t.call(h,h&&h.__data__,c,r)),y=w.length,N=s[c]=new Array(y),P=l[c]=new Array(y),X=a[c]=new Array(g);n(h,m,N,P,X,w,e);for(var C=0,x=0,u,p;C<y;++C)if(u=N[C]){for(C>=x&&(x=C+1);!(p=P[x])&&++x<y;);u._next=p||null}}return l=new S(l,r),l._enter=s,l._exit=a,l}function Qt(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Zt(){return new S(this._exit||this._groups.map(ut),this._parents)}function jt(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function te(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,l=Math.min(i,o),s=new Array(i),a=0;a<l;++a)for(var c=n[a],h=r[a],m=c.length,g=s[a]=new Array(m),w,y=0;y<m;++y)(w=c[y]||h[y])&&(g[y]=w);for(;a<i;++a)s[a]=n[a];return new S(s,this._parents)}function ee(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],l;--i>=0;)(l=r[i])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}function ne(t){t||(t=re);function e(m,g){return m&&g?t(m.__data__,g.__data__):!m-!g}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var l=n[o],s=l.length,a=i[o]=new Array(s),c,h=0;h<s;++h)(c=l[h])&&(a[h]=c);a.sort(e)}return new S(i,this._parents).order()}function re(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ie(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function oe(){return Array.from(this)}function se(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var l=r[i];if(l)return l}return null}function le(){let t=0;for(const e of this)++t;return t}function ue(){return!this.node()}function ae(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,l=i.length,s;o<l;++o)(s=i[o])&&t.call(s,s.__data__,o,i);return this}function ce(t){return function(){this.removeAttribute(t)}}function fe(t){return function(){this.removeAttributeNS(t.space,t.local)}}function he(t,e){return function(){this.setAttribute(t,e)}}function de(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function pe(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function ge(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function me(t,e){var n=it(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?fe:ce:typeof e=="function"?n.local?ge:pe:n.local?de:he)(n,e))}function at(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ye(t){return function(){this.style.removeProperty(t)}}function _e(t,e,n){return function(){this.style.setProperty(t,e,n)}}function ve(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function we(t,e,n){return arguments.length>1?this.each((e==null?ye:typeof e=="function"?ve:_e)(t,e,n??"")):be(this.node(),t)}function be(t,e){return t.style.getPropertyValue(e)||at(t).getComputedStyle(t,null).getPropertyValue(e)}function Se(t){return function(){delete this[t]}}function Ce(t,e){return function(){this[t]=e}}function xe(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Ae(t,e){return arguments.length>1?this.each((e==null?Se:typeof e=="function"?xe:Ce)(t,e)):this.node()[t]}function ct(t){return t.trim().split(/^|\s+/)}function Q(t){return t.classList||new ft(t)}function ft(t){this._node=t,this._names=ct(t.getAttribute("class")||"")}ft.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function ht(t,e){for(var n=Q(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function dt(t,e){for(var n=Q(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Ee(t){return function(){ht(this,t)}}function ze(t){return function(){dt(this,t)}}function Ne(t,e){return function(){(e.apply(this,arguments)?ht:dt)(this,t)}}function Pe(t,e){var n=ct(t+"");if(arguments.length<2){for(var r=Q(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Ne:e?Ee:ze)(n,e))}function Re(){this.textContent=""}function ke(t){return function(){this.textContent=t}}function Ve(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Le(t){return arguments.length?this.each(t==null?Re:(typeof t=="function"?Ve:ke)(t)):this.node().textContent}function Te(){this.innerHTML=""}function Be(t){return function(){this.innerHTML=t}}function Fe(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Me(t){return arguments.length?this.each(t==null?Te:(typeof t=="function"?Fe:Be)(t)):this.node().innerHTML}function Ie(){this.nextSibling&&this.parentNode.appendChild(this)}function Xe(){return this.each(Ie)}function Ye(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function He(){return this.each(Ye)}function De(t){var e=typeof t=="function"?t:ot(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Oe(){return null}function qe(t,e){var n=typeof t=="function"?t:ot(t),r=e==null?Oe:typeof e=="function"?e:st(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function We(){var t=this.parentNode;t&&t.removeChild(this)}function Ue(){return this.each(We)}function $e(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ke(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ge(t){return this.select(t?Ke:$e)}function Je(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Qe(t){return function(e){t.call(this,e,this.__data__)}}function Ze(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function je(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function tn(t,e,n){return function(){var r=this.__on,i,o=Qe(e);if(r){for(var l=0,s=r.length;l<s;++l)if((i=r[l]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function en(t,e,n){var r=Ze(t+""),i,o=r.length,l;if(arguments.length<2){var s=this.node().__on;if(s){for(var a=0,c=s.length,h;a<c;++a)for(i=0,h=s[a];i<o;++i)if((l=r[i]).type===h.type&&l.name===h.name)return h.value}return}for(s=e?tn:je,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function pt(t,e,n){var r=at(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function nn(t,e){return function(){return pt(this,t,e)}}function rn(t,e){return function(){return pt(this,t,e.apply(this,arguments))}}function on(t,e){return this.each((typeof e=="function"?rn:nn)(t,e))}function*sn(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,l;i<o;++i)(l=r[i])&&(yield l)}var ln=[null];function S(t,e){this._groups=t,this._parents=e}function un(){return this}S.prototype={constructor:S,select:Pt,selectAll:Tt,selectChild:Xt,selectChildren:Ot,filter:qt,data:Jt,enter:Wt,exit:Zt,join:jt,merge:te,selection:un,order:ee,sort:ne,call:ie,nodes:oe,node:se,size:le,empty:ue,each:ae,attr:me,style:we,property:Ae,classed:Pe,text:Le,html:Me,raise:Xe,lower:He,append:De,insert:qe,remove:Ue,clone:Ge,datum:Je,on:en,dispatch:on,[Symbol.iterator]:sn};function M(t){return typeof t=="string"?new S([[document.querySelector(t)]],[document.documentElement]):new S([[t]],ln)}function an(t){let e;for(;e=t.sourceEvent;)t=e;return t}function gt(t,e){if(t=an(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}var cn={value:()=>{}};function mt(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new O(n)}function O(t){this._=t}function fn(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}O.prototype=mt.prototype={constructor:O,on:function(t,e){var n=this._,r=fn(t+"",n),i,o=-1,l=r.length;if(arguments.length<2){for(;++o<l;)if((i=(t=r[o]).type)&&(i=hn(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<l;)if(i=(t=r[o]).type)n[i]=yt(n[i],t.name,e);else if(e==null)for(i in n)n[i]=yt(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new O(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function hn(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function yt(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=cn,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}const dn={passive:!1},I={capture:!0,passive:!1};function Z(t){t.stopImmediatePropagation()}function z(t){t.preventDefault(),t.stopImmediatePropagation()}function pn(t){var e=t.document.documentElement,n=M(t).on("dragstart.drag",z,I);"onselectstart"in e?n.on("selectstart.drag",z,I):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function gn(t,e){var n=t.document.documentElement,r=M(t).on("dragstart.drag",null);e&&(r.on("click.drag",z,I),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const q=t=>()=>t;function j(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:l,y:s,dx:a,dy:c,dispatch:h}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}j.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function mn(t){return!t.ctrlKey&&!t.button}function yn(){return this.parentNode}function _n(t,e){return e??{x:t.x,y:t.y}}function vn(){return navigator.maxTouchPoints||"ontouchstart"in this}function wn(){var t=mn,e=yn,n=_n,r=vn,i={},o=mt("start","drag","end"),l=0,s,a,c,h,m=0;function g(u){u.on("mousedown.drag",w).filter(r).on("touchstart.drag",P).on("touchmove.drag",X,dn).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(u,p){if(!(h||!t.call(this,u,p))){var d=x(this,e.call(this,u,p),u,p,"mouse");d&&(M(u.view).on("mousemove.drag",y,I).on("mouseup.drag",N,I),pn(u.view),Z(u),c=!1,s=u.clientX,a=u.clientY,d("start",u))}}function y(u){if(z(u),!c){var p=u.clientX-s,d=u.clientY-a;c=p*p+d*d>m}i.mouse("drag",u)}function N(u){M(u.view).on("mousemove.drag mouseup.drag",null),gn(u.view,c),z(u),i.mouse("end",u)}function P(u,p){if(t.call(this,u,p)){var d=u.changedTouches,_=e.call(this,u,p),v=d.length,A,E;for(A=0;A<v;++A)(E=x(this,_,u,p,d[A].identifier,d[A]))&&(Z(u),E("start",u,d[A]))}}function X(u){var p=u.changedTouches,d=p.length,_,v;for(_=0;_<d;++_)(v=i[p[_].identifier])&&(z(u),v("drag",u,p[_]))}function C(u){var p=u.changedTouches,d=p.length,_,v;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),_=0;_<d;++_)(v=i[p[_].identifier])&&(Z(u),v("end",u,p[_]))}function x(u,p,d,_,v,A){var E=o.copy(),b=gt(A||d,p),R,k,V;if((V=n.call(u,new j("beforestart",{sourceEvent:d,target:g,identifier:v,active:l,x:b[0],y:b[1],dx:0,dy:0,dispatch:E}),_))!=null)return R=V.x-b[0]||0,k=V.y-b[1]||0,function et(L,Y,W){var H=b,T;switch(L){case"start":i[v]=et,T=l++;break;case"end":delete i[v],--l;case"drag":b=gt(W||Y,p),T=l;break}E.call(L,u,new j(L,{sourceEvent:Y,subject:V,target:g,identifier:v,active:T,x:b[0]+R,y:b[1]+k,dx:b[0]-H[0],dy:b[1]-H[1],dispatch:E}),_)}}return g.filter=function(u){return arguments.length?(t=typeof u=="function"?u:q(!!u),g):t},g.container=function(u){return arguments.length?(e=typeof u=="function"?u:q(u),g):e},g.subject=function(u){return arguments.length?(n=typeof u=="function"?u:q(u),g):n},g.touchable=function(u){return arguments.length?(r=typeof u=="function"?u:q(!!u),g):r},g.on=function(){var u=o.on.apply(o,arguments);return u===o?g:u},g.clickDistance=function(u){return arguments.length?(m=(u=+u)*u,g):Math.sqrt(m)},g}const tt=f.defineComponent({__name:"ResizeControl",props:{nodeId:null,color:null,minWidth:{default:10},minHeight:{default:10},position:null,variant:{default:"handle"}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=t,r={width:0,height:0,x:0,y:0},i={...r,pointerX:0,pointerY:0},o=f.inject(G.NodeIdInjection,null),l=f.ref(),s=f.computed(()=>typeof n.nodeId=="string"?n.nodeId:o),{findNode:a,emits:c}=G.useVueFlow(),h=f.ref(i),m=f.ref(r),g=G.useGetPointerPosition(),w=f.computed(()=>n.variant===F.Line?"right":"bottom-right"),y=f.computed(()=>n.position??w.value);f.watchEffect(C=>{if(!l.value||!s.value)return;const x=M(l.value),u=wn().on("start",p=>{const d=a(s.value),{xSnapped:_,ySnapped:v}=g(p);m.value={width:(d==null?void 0:d.dimensions.width)??0,height:(d==null?void 0:d.dimensions.height)??0,x:(d==null?void 0:d.position.x)??0,y:(d==null?void 0:d.position.y)??0},h.value={...m.value,pointerX:_,pointerY:v},e("resizeStart",{event:p,params:m.value})}).on("drag",p=>{const{xSnapped:d,ySnapped:_}=g(p),v=a(s.value),A=y.value.includes("right")||y.value.includes("left"),E=y.value.includes("bottom")||y.value.includes("top"),b=y.value.includes("left"),R=y.value.includes("top");if(v){const k=[],{pointerX:V,pointerY:et,width:L,height:Y,x:W,y:H}=h.value,{x:T,y:_t,width:Cn,height:xn}=m.value,vt=Math.floor(A?d-V:0),wt=Math.floor(E?_-et:0),U=Math.max(L+(b?-vt:vt),n.minWidth),$=Math.max(Y+(R?-wt:wt),n.minHeight),bt=U!==Cn,St=$!==xn;if(b||R){const K=b?W-(U-L):W,Ct=R?H-($-Y):H,xt=K!==T&&bt,At=Ct!==_t&&St;if(xt||At){const nt={id:v.id,type:"position",from:v.position,position:{x:xt?K:T,y:At?Ct:_t}};k.push(nt),m.value.x=nt.position.x,m.value.y=nt.position.y}}if(bt||St){const K={id:s.value,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:U,height:$}};k.push(K),m.value.width=U,m.value.height=$}e("resize",{event:p,params:m.value}),c.nodesChange(k)}}).on("end",p=>{const d={id:s.value,type:"dimensions",resizing:!1};e("resizeEnd",{event:p,params:m.value}),c.nodesChange([d])});x.call(u),C(()=>{x.on(".drag",null)})});const N=f.computed(()=>y.value.split("-")),P=f.computed(()=>n.variant===F.Line?"borderColor":"backgroundColor"),X=f.computed(()=>n.color?{[P.value]:n.color}:{});return(C,x)=>(f.openBlock(),f.createElementBlock("div",{ref_key:"resizeControlRef",ref:l,class:f.normalizeClass(["vue-flow__resize-control nodrag",[...f.unref(N),t.variant]]),style:f.normalizeStyle(f.unref(X))},[f.renderSlot(C.$slots,"default")],6))}}),bn={name:"NodeResizer",inheritAttrs:!1},Sn=f.defineComponent({...bn,props:{nodeId:null,color:null,handleClassName:null,handleStyle:null,lineClassName:null,lineStyle:null,isVisible:{type:Boolean,default:!0},minWidth:null,minHeight:null},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=["top-left","top-right","bottom-left","bottom-right"],r=["top","right","bottom","left"];return(i,o)=>(f.openBlock(),f.createElementBlock(f.Fragment,null,[(f.openBlock(),f.createElementBlock(f.Fragment,null,f.renderList(r,l=>f.createVNode(tt,{key:l,class:f.normalizeClass(t.lineClassName),style:f.normalizeStyle(t.lineStyle),"node-id":t.nodeId,position:l,variant:f.unref(F).Line,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,onResizeStart:o[0]||(o[0]=s=>e("resizeStart",s)),onResize:o[1]||(o[1]=s=>e("resize",s)),onResizeEnd:o[2]||(o[2]=s=>e("resizeEnd",s))},null,8,["class","style","node-id","position","variant","color","min-width","min-height"])),64)),(f.openBlock(),f.createElementBlock(f.Fragment,null,f.renderList(n,l=>f.createVNode(tt,{key:l,class:f.normalizeClass(t.lineClassName),style:f.normalizeStyle(t.lineStyle),"node-id":t.nodeId,position:l,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,onResizeStart:o[3]||(o[3]=s=>e("resizeStart",s)),onResize:o[4]||(o[4]=s=>e("resize",s)),onResizeEnd:o[5]||(o[5]=s=>e("resizeEnd",s))},null,8,["class","style","node-id","position","color","min-width","min-height"])),64))],64))}});return B.NodeResizeControl=tt,B.NodeResizer=Sn,B.ResizeControlVariant=F,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"}),B}({},Vue,VueFlow); |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("vue"),G=require("@vue-flow/core");var tt=(t=>(t.Line="line",t.Handle="handle",t))(tt||{}),Q="http://www.w3.org/1999/xhtml";const ct={svg:"http://www.w3.org/2000/svg",xhtml:Q,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function dt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),ct.hasOwnProperty(e)?{space:ct[e],local:t}:t}function zt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Q&&e.documentElement.namespaceURI===Q?e.createElement(t):e.createElementNS(n,t)}}function Nt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function pt(t){var e=dt(t);return(e.local?Nt:zt)(e)}function Pt(){}function gt(t){return t==null?Pt:function(){return this.querySelector(t)}}function Rt(t){typeof t!="function"&&(t=gt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],l=o.length,s=r[i]=new Array(l),a,c,h=0;h<l;++h)(a=o[h])&&(c=t.call(a,a.__data__,h,o))&&("__data__"in a&&(c.__data__=a.__data__),s[h]=c);return new C(r,this._parents)}function kt(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Tt(){return[]}function Bt(t){return t==null?Tt:function(){return this.querySelectorAll(t)}}function Vt(t){return function(){return kt(t.apply(this,arguments))}}function Lt(t){typeof t=="function"?t=Vt(t):t=Bt(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var l=e[o],s=l.length,a,c=0;c<s;++c)(a=l[c])&&(r.push(t.call(a,a.__data__,c,l)),i.push(a));return new C(r,i)}function Mt(t){return function(){return this.matches(t)}}function mt(t){return function(e){return e.matches(t)}}var Ft=Array.prototype.find;function It(t){return function(){return Ft.call(this.children,t)}}function Xt(){return this.firstElementChild}function Yt(t){return this.select(t==null?Xt:It(typeof t=="function"?t:mt(t)))}var Ht=Array.prototype.filter;function Dt(){return Array.from(this.children)}function Ot(t){return function(){return Ht.call(this.children,t)}}function qt(t){return this.selectAll(t==null?Dt:Ot(typeof t=="function"?t:mt(t)))}function Wt(t){typeof t!="function"&&(t=Mt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],l=o.length,s=r[i]=[],a,c=0;c<l;++c)(a=o[c])&&t.call(a,a.__data__,c,o)&&s.push(a);return new C(r,this._parents)}function yt(t){return new Array(t.length)}function Ut(){return new C(this._enter||this._groups.map(yt),this._parents)}function U(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}U.prototype={constructor:U,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function $t(t){return function(){return t}}function Kt(t,e,n,r,i,o){for(var l=0,s,a=e.length,c=o.length;l<c;++l)(s=e[l])?(s.__data__=o[l],r[l]=s):n[l]=new U(t,o[l]);for(;l<a;++l)(s=e[l])&&(i[l]=s)}function Gt(t,e,n,r,i,o,l){var s,a,c=new Map,h=e.length,m=o.length,g=new Array(h),b;for(s=0;s<h;++s)(a=e[s])&&(g[s]=b=l.call(a,a.__data__,s,e)+"",c.has(b)?i[s]=a:c.set(b,a));for(s=0;s<m;++s)b=l.call(t,o[s],s,o)+"",(a=c.get(b))?(r[s]=a,a.__data__=o[s],c.delete(b)):n[s]=new U(t,o[s]);for(s=0;s<h;++s)(a=e[s])&&c.get(g[s])===a&&(i[s]=a)}function Jt(t){return t.__data__}function Qt(t,e){if(!arguments.length)return Array.from(this,Jt);var n=e?Gt:Kt,r=this._parents,i=this._groups;typeof t!="function"&&(t=$t(t));for(var o=i.length,l=new Array(o),s=new Array(o),a=new Array(o),c=0;c<o;++c){var h=r[c],m=i[c],g=m.length,b=Zt(t.call(h,h&&h.__data__,c,r)),y=b.length,N=s[c]=new Array(y),P=l[c]=new Array(y),L=a[c]=new Array(g);n(h,m,N,P,L,b,e);for(var S=0,A=0,u,p;S<y;++S)if(u=N[S]){for(S>=A&&(A=S+1);!(p=P[A])&&++A<y;);u._next=p||null}}return l=new C(l,r),l._enter=s,l._exit=a,l}function Zt(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function jt(){return new C(this._exit||this._groups.map(yt),this._parents)}function te(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function ee(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,l=Math.min(i,o),s=new Array(i),a=0;a<l;++a)for(var c=n[a],h=r[a],m=c.length,g=s[a]=new Array(m),b,y=0;y<m;++y)(b=c[y]||h[y])&&(g[y]=b);for(;a<i;++a)s[a]=n[a];return new C(s,this._parents)}function ne(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],l;--i>=0;)(l=r[i])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}function re(t){t||(t=ie);function e(m,g){return m&&g?t(m.__data__,g.__data__):!m-!g}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var l=n[o],s=l.length,a=i[o]=new Array(s),c,h=0;h<s;++h)(c=l[h])&&(a[h]=c);a.sort(e)}return new C(i,this._parents).order()}function ie(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function oe(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function se(){return Array.from(this)}function le(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var l=r[i];if(l)return l}return null}function ue(){let t=0;for(const e of this)++t;return t}function ae(){return!this.node()}function ce(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,l=i.length,s;o<l;++o)(s=i[o])&&t.call(s,s.__data__,o,i);return this}function fe(t){return function(){this.removeAttribute(t)}}function he(t){return function(){this.removeAttributeNS(t.space,t.local)}}function de(t,e){return function(){this.setAttribute(t,e)}}function pe(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ge(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function me(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function ye(t,e){var n=dt(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?he:fe:typeof e=="function"?n.local?me:ge:n.local?pe:de)(n,e))}function vt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ve(t){return function(){this.style.removeProperty(t)}}function _e(t,e,n){return function(){this.style.setProperty(t,e,n)}}function we(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function be(t,e,n){return arguments.length>1?this.each((e==null?ve:typeof e=="function"?we:_e)(t,e,n==null?"":n)):Se(this.node(),t)}function Se(t,e){return t.style.getPropertyValue(e)||vt(t).getComputedStyle(t,null).getPropertyValue(e)}function xe(t){return function(){delete this[t]}}function Ce(t,e){return function(){this[t]=e}}function Ae(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Ee(t,e){return arguments.length>1?this.each((e==null?xe:typeof e=="function"?Ae:Ce)(t,e)):this.node()[t]}function _t(t){return t.trim().split(/^|\s+/)}function et(t){return t.classList||new wt(t)}function wt(t){this._node=t,this._names=_t(t.getAttribute("class")||"")}wt.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function bt(t,e){for(var n=et(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function St(t,e){for(var n=et(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function ze(t){return function(){bt(this,t)}}function Ne(t){return function(){St(this,t)}}function Pe(t,e){return function(){(e.apply(this,arguments)?bt:St)(this,t)}}function Re(t,e){var n=_t(t+"");if(arguments.length<2){for(var r=et(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Pe:e?ze:Ne)(n,e))}function ke(){this.textContent=""}function Te(t){return function(){this.textContent=t}}function Be(t){return function(){var e=t.apply(this,arguments);this.textContent=e==null?"":e}}function Ve(t){return arguments.length?this.each(t==null?ke:(typeof t=="function"?Be:Te)(t)):this.node().textContent}function Le(){this.innerHTML=""}function Me(t){return function(){this.innerHTML=t}}function Fe(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e==null?"":e}}function Ie(t){return arguments.length?this.each(t==null?Le:(typeof t=="function"?Fe:Me)(t)):this.node().innerHTML}function Xe(){this.nextSibling&&this.parentNode.appendChild(this)}function Ye(){return this.each(Xe)}function He(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function De(){return this.each(He)}function Oe(t){var e=typeof t=="function"?t:pt(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function qe(){return null}function We(t,e){var n=typeof t=="function"?t:pt(t),r=e==null?qe:typeof e=="function"?e:gt(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Ue(){var t=this.parentNode;t&&t.removeChild(this)}function $e(){return this.each(Ue)}function Ke(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ge(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Je(t){return this.select(t?Ge:Ke)}function Qe(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ze(t){return function(e){t.call(this,e,this.__data__)}}function je(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function tn(t){return function(){var e=this.__on;if(!!e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function en(t,e,n){return function(){var r=this.__on,i,o=Ze(e);if(r){for(var l=0,s=r.length;l<s;++l)if((i=r[l]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function nn(t,e,n){var r=je(t+""),i,o=r.length,l;if(arguments.length<2){var s=this.node().__on;if(s){for(var a=0,c=s.length,h;a<c;++a)for(i=0,h=s[a];i<o;++i)if((l=r[i]).type===h.type&&l.name===h.name)return h.value}return}for(s=e?en:tn,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function xt(t,e,n){var r=vt(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function rn(t,e){return function(){return xt(this,t,e)}}function on(t,e){return function(){return xt(this,t,e.apply(this,arguments))}}function sn(t,e){return this.each((typeof e=="function"?on:rn)(t,e))}function*ln(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,l;i<o;++i)(l=r[i])&&(yield l)}var un=[null];function C(t,e){this._groups=t,this._parents=e}function an(){return this}C.prototype={constructor:C,select:Rt,selectAll:Lt,selectChild:Yt,selectChildren:qt,filter:Wt,data:Qt,enter:Ut,exit:jt,join:te,merge:ee,selection:an,order:ne,sort:re,call:oe,nodes:se,node:le,size:ue,empty:ae,each:ce,attr:ye,style:be,property:Ee,classed:Re,text:Ve,html:Ie,raise:Ye,lower:De,append:Oe,insert:We,remove:$e,clone:Je,datum:Qe,on:nn,dispatch:sn,[Symbol.iterator]:ln};function I(t){return typeof t=="string"?new C([[document.querySelector(t)]],[document.documentElement]):new C([[t]],un)}function cn(t){let e;for(;e=t.sourceEvent;)t=e;return t}function ft(t,e){if(t=cn(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}var fn={value:()=>{}};function Ct(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new W(n)}function W(t){this._=t}function hn(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}W.prototype=Ct.prototype={constructor:W,on:function(t,e){var n=this._,r=hn(t+"",n),i,o=-1,l=r.length;if(arguments.length<2){for(;++o<l;)if((i=(t=r[o]).type)&&(i=dn(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<l;)if(i=(t=r[o]).type)n[i]=ht(n[i],t.name,e);else if(e==null)for(i in n)n[i]=ht(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new W(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function dn(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function ht(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=fn,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}const pn={passive:!1},X={capture:!0,passive:!1};function J(t){t.stopImmediatePropagation()}function V(t){t.preventDefault(),t.stopImmediatePropagation()}function gn(t){var e=t.document.documentElement,n=I(t).on("dragstart.drag",V,X);"onselectstart"in e?n.on("selectstart.drag",V,X):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function mn(t,e){var n=t.document.documentElement,r=I(t).on("dragstart.drag",null);e&&(r.on("click.drag",V,X),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const q=t=>()=>t;function Z(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:l,y:s,dx:a,dy:c,dispatch:h}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}Z.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function yn(t){return!t.ctrlKey&&!t.button}function vn(){return this.parentNode}function _n(t,e){return e==null?{x:t.x,y:t.y}:e}function wn(){return navigator.maxTouchPoints||"ontouchstart"in this}function bn(){var t=yn,e=vn,n=_n,r=wn,i={},o=Ct("start","drag","end"),l=0,s,a,c,h,m=0;function g(u){u.on("mousedown.drag",b).filter(r).on("touchstart.drag",P).on("touchmove.drag",L,pn).on("touchend.drag touchcancel.drag",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(u,p){if(!(h||!t.call(this,u,p))){var d=A(this,e.call(this,u,p),u,p,"mouse");!d||(I(u.view).on("mousemove.drag",y,X).on("mouseup.drag",N,X),gn(u.view),J(u),c=!1,s=u.clientX,a=u.clientY,d("start",u))}}function y(u){if(V(u),!c){var p=u.clientX-s,d=u.clientY-a;c=p*p+d*d>m}i.mouse("drag",u)}function N(u){I(u.view).on("mousemove.drag mouseup.drag",null),mn(u.view,c),V(u),i.mouse("end",u)}function P(u,p){if(!!t.call(this,u,p)){var d=u.changedTouches,v=e.call(this,u,p),_=d.length,x,E;for(x=0;x<_;++x)(E=A(this,v,u,p,d[x].identifier,d[x]))&&(J(u),E("start",u,d[x]))}}function L(u){var p=u.changedTouches,d=p.length,v,_;for(v=0;v<d;++v)(_=i[p[v].identifier])&&(V(u),_("drag",u,p[v]))}function S(u){var p=u.changedTouches,d=p.length,v,_;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),v=0;v<d;++v)(_=i[p[v].identifier])&&(J(u),_("end",u,p[v]))}function A(u,p,d,v,_,x){var E=o.copy(),w=ft(x||d,p),z,R,k;if((k=n.call(u,new Z("beforestart",{sourceEvent:d,target:g,identifier:_,active:l,x:w[0],y:w[1],dx:0,dy:0,dispatch:E}),v))!=null)return z=k.x-w[0]||0,R=k.y-w[1]||0,function $(T,M,Y){var F=w,B;switch(T){case"start":i[_]=$,B=l++;break;case"end":delete i[_],--l;case"drag":w=ft(Y||M,p),B=l;break}E.call(T,u,new Z(T,{sourceEvent:M,subject:k,target:g,identifier:_,active:B,x:w[0]+z,y:w[1]+R,dx:w[0]-F[0],dy:w[1]-F[1],dispatch:E}),v)}}return g.filter=function(u){return arguments.length?(t=typeof u=="function"?u:q(!!u),g):t},g.container=function(u){return arguments.length?(e=typeof u=="function"?u:q(u),g):e},g.subject=function(u){return arguments.length?(n=typeof u=="function"?u:q(u),g):n},g.touchable=function(u){return arguments.length?(r=typeof u=="function"?u:q(!!u),g):r},g.on=function(){var u=o.on.apply(o,arguments);return u===o?g:u},g.clickDistance=function(u){return arguments.length?(m=(u=+u)*u,g):Math.sqrt(m)},g}const j=f.defineComponent({__name:"ResizeControl",props:{nodeId:null,color:null,minWidth:{default:10},minHeight:{default:10},position:null,variant:{default:"handle"}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=t,r={width:0,height:0,x:0,y:0},i={...r,pointerX:0,pointerY:0},o=f.inject(G.NodeIdInjection,null),l=f.ref(),s=f.computed(()=>typeof n.nodeId=="string"?n.nodeId:o),{findNode:a,emits:c}=G.useVueFlow(),h=f.ref(i),m=f.ref(r),g=G.useGetPointerPosition(),b=f.computed(()=>n.variant==="line"?"right":"bottom-right"),y=f.computed(()=>{var S;return(S=n.position)!=null?S:b.value});f.watchEffect(S=>{if(!l.value||!s.value)return;const A=I(l.value),u=bn().on("start",p=>{var x,E,w,z;const d=a(s.value),{xSnapped:v,ySnapped:_}=g(p);m.value={width:(x=d==null?void 0:d.dimensions.width)!=null?x:0,height:(E=d==null?void 0:d.dimensions.height)!=null?E:0,x:(w=d==null?void 0:d.position.x)!=null?w:0,y:(z=d==null?void 0:d.position.y)!=null?z:0},h.value={...m.value,pointerX:v,pointerY:_},e("resizeStart",{event:p,params:m.value})}).on("drag",p=>{const{xSnapped:d,ySnapped:v}=g(p),_=a(s.value),x=y.value.includes("right")||y.value.includes("left"),E=y.value.includes("bottom")||y.value.includes("top"),w=y.value.includes("left"),z=y.value.includes("top");if(_){const R=[],{pointerX:k,pointerY:$,width:T,height:M,x:Y,y:F}=h.value,{x:B,y:nt,width:At,height:Et}=m.value,rt=Math.floor(x?d-k:0),it=Math.floor(E?v-$:0),H=Math.max(T+(w?-rt:rt),n.minWidth),D=Math.max(M+(z?-it:it),n.minHeight),ot=H!==At,st=D!==Et;if(w||z){const O=w?Y-(H-T):Y,lt=z?F-(D-M):F,ut=O!==B&&ot,at=lt!==nt&&st;if(ut||at){const K={id:_.id,type:"position",from:_.position,position:{x:ut?O:B,y:at?lt:nt}};R.push(K),m.value.x=K.position.x,m.value.y=K.position.y}}if(ot||st){const O={id:s.value,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:H,height:D}};R.push(O),m.value.width=H,m.value.height=D}e("resize",{event:p,params:m.value}),c.nodesChange(R)}}).on("end",p=>{const d={id:s.value,type:"dimensions",resizing:!1};e("resizeEnd",{event:p,params:m.value}),c.nodesChange([d])});A.call(u),S(()=>{A.on(".drag",null)})});const N=f.computed(()=>y.value.split("-")),P=f.computed(()=>n.variant==="line"?"borderColor":"backgroundColor"),L=f.computed(()=>n.color?{[P.value]:n.color}:{});return(S,A)=>(f.openBlock(),f.createElementBlock("div",{ref_key:"resizeControlRef",ref:l,class:f.normalizeClass(["vue-flow__resize-control nodrag",[...f.unref(N),t.variant]]),style:f.normalizeStyle(f.unref(L))},[f.renderSlot(S.$slots,"default")],6))}}),Sn={name:"NodeResizer",inheritAttrs:!1},xn=f.defineComponent({...Sn,props:{nodeId:null,color:null,handleClassName:null,handleStyle:null,lineClassName:null,lineStyle:null,isVisible:{type:Boolean,default:!0},minWidth:null,minHeight:null},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=["top-left","top-right","bottom-left","bottom-right"],r=["top","right","bottom","left"];return(i,o)=>(f.openBlock(),f.createElementBlock(f.Fragment,null,[(f.openBlock(),f.createElementBlock(f.Fragment,null,f.renderList(r,l=>f.createVNode(j,{key:l,class:f.normalizeClass(t.lineClassName),style:f.normalizeStyle(t.lineStyle),"node-id":t.nodeId,position:l,variant:f.unref(tt).Line,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,onResizeStart:o[0]||(o[0]=s=>e("resizeStart",s)),onResize:o[1]||(o[1]=s=>e("resize",s)),onResizeEnd:o[2]||(o[2]=s=>e("resizeEnd",s))},null,8,["class","style","node-id","position","variant","color","min-width","min-height"])),64)),(f.openBlock(),f.createElementBlock(f.Fragment,null,f.renderList(n,l=>f.createVNode(j,{key:l,class:f.normalizeClass(t.lineClassName),style:f.normalizeStyle(t.lineStyle),"node-id":t.nodeId,position:l,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,onResizeStart:o[3]||(o[3]=s=>e("resizeStart",s)),onResize:o[4]||(o[4]=s=>e("resize",s)),onResizeEnd:o[5]||(o[5]=s=>e("resizeEnd",s))},null,8,["class","style","node-id","position","color","min-width","min-height"])),64))],64))}});exports.NodeResizeControl=j;exports.NodeResizer=xn;exports.ResizeControlVariant=tt; | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("vue"),J=require("@vue-flow/core");var I=(t=>(t.Line="line",t.Handle="handle",t))(I||{}),Z="http://www.w3.org/1999/xhtml";const ct={svg:"http://www.w3.org/2000/svg",xhtml:Z,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function dt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),ct.hasOwnProperty(e)?{space:ct[e],local:t}:t}function zt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Z&&e.documentElement.namespaceURI===Z?e.createElement(t):e.createElementNS(n,t)}}function Nt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function pt(t){var e=dt(t);return(e.local?Nt:zt)(e)}function Pt(){}function gt(t){return t==null?Pt:function(){return this.querySelector(t)}}function Rt(t){typeof t!="function"&&(t=gt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],l=o.length,s=r[i]=new Array(l),a,c,h=0;h<l;++h)(a=o[h])&&(c=t.call(a,a.__data__,h,o))&&("__data__"in a&&(c.__data__=a.__data__),s[h]=c);return new S(r,this._parents)}function kt(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Lt(){return[]}function Tt(t){return t==null?Lt:function(){return this.querySelectorAll(t)}}function Bt(t){return function(){return kt(t.apply(this,arguments))}}function Vt(t){typeof t=="function"?t=Bt(t):t=Tt(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var l=e[o],s=l.length,a,c=0;c<s;++c)(a=l[c])&&(r.push(t.call(a,a.__data__,c,l)),i.push(a));return new S(r,i)}function Ft(t){return function(){return this.matches(t)}}function mt(t){return function(e){return e.matches(t)}}var Mt=Array.prototype.find;function It(t){return function(){return Mt.call(this.children,t)}}function Xt(){return this.firstElementChild}function Yt(t){return this.select(t==null?Xt:It(typeof t=="function"?t:mt(t)))}var Ht=Array.prototype.filter;function Dt(){return Array.from(this.children)}function Ot(t){return function(){return Ht.call(this.children,t)}}function qt(t){return this.selectAll(t==null?Dt:Ot(typeof t=="function"?t:mt(t)))}function Wt(t){typeof t!="function"&&(t=Ft(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],l=o.length,s=r[i]=[],a,c=0;c<l;++c)(a=o[c])&&t.call(a,a.__data__,c,o)&&s.push(a);return new S(r,this._parents)}function yt(t){return new Array(t.length)}function Ut(){return new S(this._enter||this._groups.map(yt),this._parents)}function $(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}$.prototype={constructor:$,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function $t(t){return function(){return t}}function Kt(t,e,n,r,i,o){for(var l=0,s,a=e.length,c=o.length;l<c;++l)(s=e[l])?(s.__data__=o[l],r[l]=s):n[l]=new $(t,o[l]);for(;l<a;++l)(s=e[l])&&(i[l]=s)}function Gt(t,e,n,r,i,o,l){var s,a,c=new Map,h=e.length,m=o.length,g=new Array(h),w;for(s=0;s<h;++s)(a=e[s])&&(g[s]=w=l.call(a,a.__data__,s,e)+"",c.has(w)?i[s]=a:c.set(w,a));for(s=0;s<m;++s)w=l.call(t,o[s],s,o)+"",(a=c.get(w))?(r[s]=a,a.__data__=o[s],c.delete(w)):n[s]=new $(t,o[s]);for(s=0;s<h;++s)(a=e[s])&&c.get(g[s])===a&&(i[s]=a)}function Jt(t){return t.__data__}function Qt(t,e){if(!arguments.length)return Array.from(this,Jt);var n=e?Gt:Kt,r=this._parents,i=this._groups;typeof t!="function"&&(t=$t(t));for(var o=i.length,l=new Array(o),s=new Array(o),a=new Array(o),c=0;c<o;++c){var h=r[c],m=i[c],g=m.length,w=Zt(t.call(h,h&&h.__data__,c,r)),y=w.length,z=s[c]=new Array(y),N=l[c]=new Array(y),V=a[c]=new Array(g);n(h,m,z,N,V,w,e);for(var x=0,C=0,u,p;x<y;++x)if(u=z[x]){for(x>=C&&(C=x+1);!(p=N[C])&&++C<y;);u._next=p||null}}return l=new S(l,r),l._enter=s,l._exit=a,l}function Zt(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function jt(){return new S(this._exit||this._groups.map(yt),this._parents)}function te(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function ee(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,l=Math.min(i,o),s=new Array(i),a=0;a<l;++a)for(var c=n[a],h=r[a],m=c.length,g=s[a]=new Array(m),w,y=0;y<m;++y)(w=c[y]||h[y])&&(g[y]=w);for(;a<i;++a)s[a]=n[a];return new S(s,this._parents)}function ne(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],l;--i>=0;)(l=r[i])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}function re(t){t||(t=ie);function e(m,g){return m&&g?t(m.__data__,g.__data__):!m-!g}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var l=n[o],s=l.length,a=i[o]=new Array(s),c,h=0;h<s;++h)(c=l[h])&&(a[h]=c);a.sort(e)}return new S(i,this._parents).order()}function ie(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function oe(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function se(){return Array.from(this)}function le(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var l=r[i];if(l)return l}return null}function ue(){let t=0;for(const e of this)++t;return t}function ae(){return!this.node()}function ce(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,l=i.length,s;o<l;++o)(s=i[o])&&t.call(s,s.__data__,o,i);return this}function fe(t){return function(){this.removeAttribute(t)}}function he(t){return function(){this.removeAttributeNS(t.space,t.local)}}function de(t,e){return function(){this.setAttribute(t,e)}}function pe(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ge(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function me(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function ye(t,e){var n=dt(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?he:fe:typeof e=="function"?n.local?me:ge:n.local?pe:de)(n,e))}function vt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ve(t){return function(){this.style.removeProperty(t)}}function _e(t,e,n){return function(){this.style.setProperty(t,e,n)}}function we(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function be(t,e,n){return arguments.length>1?this.each((e==null?ve:typeof e=="function"?we:_e)(t,e,n??"")):Se(this.node(),t)}function Se(t,e){return t.style.getPropertyValue(e)||vt(t).getComputedStyle(t,null).getPropertyValue(e)}function xe(t){return function(){delete this[t]}}function Ce(t,e){return function(){this[t]=e}}function Ae(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Ee(t,e){return arguments.length>1?this.each((e==null?xe:typeof e=="function"?Ae:Ce)(t,e)):this.node()[t]}function _t(t){return t.trim().split(/^|\s+/)}function et(t){return t.classList||new wt(t)}function wt(t){this._node=t,this._names=_t(t.getAttribute("class")||"")}wt.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function bt(t,e){for(var n=et(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function St(t,e){for(var n=et(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function ze(t){return function(){bt(this,t)}}function Ne(t){return function(){St(this,t)}}function Pe(t,e){return function(){(e.apply(this,arguments)?bt:St)(this,t)}}function Re(t,e){var n=_t(t+"");if(arguments.length<2){for(var r=et(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Pe:e?ze:Ne)(n,e))}function ke(){this.textContent=""}function Le(t){return function(){this.textContent=t}}function Te(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Be(t){return arguments.length?this.each(t==null?ke:(typeof t=="function"?Te:Le)(t)):this.node().textContent}function Ve(){this.innerHTML=""}function Fe(t){return function(){this.innerHTML=t}}function Me(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Ie(t){return arguments.length?this.each(t==null?Ve:(typeof t=="function"?Me:Fe)(t)):this.node().innerHTML}function Xe(){this.nextSibling&&this.parentNode.appendChild(this)}function Ye(){return this.each(Xe)}function He(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function De(){return this.each(He)}function Oe(t){var e=typeof t=="function"?t:pt(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function qe(){return null}function We(t,e){var n=typeof t=="function"?t:pt(t),r=e==null?qe:typeof e=="function"?e:gt(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Ue(){var t=this.parentNode;t&&t.removeChild(this)}function $e(){return this.each(Ue)}function Ke(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ge(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Je(t){return this.select(t?Ge:Ke)}function Qe(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ze(t){return function(e){t.call(this,e,this.__data__)}}function je(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function tn(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function en(t,e,n){return function(){var r=this.__on,i,o=Ze(e);if(r){for(var l=0,s=r.length;l<s;++l)if((i=r[l]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function nn(t,e,n){var r=je(t+""),i,o=r.length,l;if(arguments.length<2){var s=this.node().__on;if(s){for(var a=0,c=s.length,h;a<c;++a)for(i=0,h=s[a];i<o;++i)if((l=r[i]).type===h.type&&l.name===h.name)return h.value}return}for(s=e?en:tn,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function xt(t,e,n){var r=vt(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function rn(t,e){return function(){return xt(this,t,e)}}function on(t,e){return function(){return xt(this,t,e.apply(this,arguments))}}function sn(t,e){return this.each((typeof e=="function"?on:rn)(t,e))}function*ln(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,l;i<o;++i)(l=r[i])&&(yield l)}var un=[null];function S(t,e){this._groups=t,this._parents=e}function an(){return this}S.prototype={constructor:S,select:Rt,selectAll:Vt,selectChild:Yt,selectChildren:qt,filter:Wt,data:Qt,enter:Ut,exit:jt,join:te,merge:ee,selection:an,order:ne,sort:re,call:oe,nodes:se,node:le,size:ue,empty:ae,each:ce,attr:ye,style:be,property:Ee,classed:Re,text:Be,html:Ie,raise:Ye,lower:De,append:Oe,insert:We,remove:$e,clone:Je,datum:Qe,on:nn,dispatch:sn,[Symbol.iterator]:ln};function X(t){return typeof t=="string"?new S([[document.querySelector(t)]],[document.documentElement]):new S([[t]],un)}function cn(t){let e;for(;e=t.sourceEvent;)t=e;return t}function ft(t,e){if(t=cn(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}var fn={value:()=>{}};function Ct(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new U(n)}function U(t){this._=t}function hn(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}U.prototype=Ct.prototype={constructor:U,on:function(t,e){var n=this._,r=hn(t+"",n),i,o=-1,l=r.length;if(arguments.length<2){for(;++o<l;)if((i=(t=r[o]).type)&&(i=dn(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<l;)if(i=(t=r[o]).type)n[i]=ht(n[i],t.name,e);else if(e==null)for(i in n)n[i]=ht(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new U(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function dn(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function ht(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=fn,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}const pn={passive:!1},Y={capture:!0,passive:!1};function Q(t){t.stopImmediatePropagation()}function B(t){t.preventDefault(),t.stopImmediatePropagation()}function gn(t){var e=t.document.documentElement,n=X(t).on("dragstart.drag",B,Y);"onselectstart"in e?n.on("selectstart.drag",B,Y):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function mn(t,e){var n=t.document.documentElement,r=X(t).on("dragstart.drag",null);e&&(r.on("click.drag",B,Y),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const W=t=>()=>t;function j(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:l,y:s,dx:a,dy:c,dispatch:h}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}j.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function yn(t){return!t.ctrlKey&&!t.button}function vn(){return this.parentNode}function _n(t,e){return e??{x:t.x,y:t.y}}function wn(){return navigator.maxTouchPoints||"ontouchstart"in this}function bn(){var t=yn,e=vn,n=_n,r=wn,i={},o=Ct("start","drag","end"),l=0,s,a,c,h,m=0;function g(u){u.on("mousedown.drag",w).filter(r).on("touchstart.drag",N).on("touchmove.drag",V,pn).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(u,p){if(!(h||!t.call(this,u,p))){var d=C(this,e.call(this,u,p),u,p,"mouse");d&&(X(u.view).on("mousemove.drag",y,Y).on("mouseup.drag",z,Y),gn(u.view),Q(u),c=!1,s=u.clientX,a=u.clientY,d("start",u))}}function y(u){if(B(u),!c){var p=u.clientX-s,d=u.clientY-a;c=p*p+d*d>m}i.mouse("drag",u)}function z(u){X(u.view).on("mousemove.drag mouseup.drag",null),mn(u.view,c),B(u),i.mouse("end",u)}function N(u,p){if(t.call(this,u,p)){var d=u.changedTouches,v=e.call(this,u,p),_=d.length,A,E;for(A=0;A<_;++A)(E=C(this,v,u,p,d[A].identifier,d[A]))&&(Q(u),E("start",u,d[A]))}}function V(u){var p=u.changedTouches,d=p.length,v,_;for(v=0;v<d;++v)(_=i[p[v].identifier])&&(B(u),_("drag",u,p[v]))}function x(u){var p=u.changedTouches,d=p.length,v,_;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),v=0;v<d;++v)(_=i[p[v].identifier])&&(Q(u),_("end",u,p[v]))}function C(u,p,d,v,_,A){var E=o.copy(),b=ft(A||d,p),P,R,k;if((k=n.call(u,new j("beforestart",{sourceEvent:d,target:g,identifier:_,active:l,x:b[0],y:b[1],dx:0,dy:0,dispatch:E}),v))!=null)return P=k.x-b[0]||0,R=k.y-b[1]||0,function K(L,F,H){var M=b,T;switch(L){case"start":i[_]=K,T=l++;break;case"end":delete i[_],--l;case"drag":b=ft(H||F,p),T=l;break}E.call(L,u,new j(L,{sourceEvent:F,subject:k,target:g,identifier:_,active:T,x:b[0]+P,y:b[1]+R,dx:b[0]-M[0],dy:b[1]-M[1],dispatch:E}),v)}}return g.filter=function(u){return arguments.length?(t=typeof u=="function"?u:W(!!u),g):t},g.container=function(u){return arguments.length?(e=typeof u=="function"?u:W(u),g):e},g.subject=function(u){return arguments.length?(n=typeof u=="function"?u:W(u),g):n},g.touchable=function(u){return arguments.length?(r=typeof u=="function"?u:W(!!u),g):r},g.on=function(){var u=o.on.apply(o,arguments);return u===o?g:u},g.clickDistance=function(u){return arguments.length?(m=(u=+u)*u,g):Math.sqrt(m)},g}const tt=f.defineComponent({__name:"ResizeControl",props:{nodeId:null,color:null,minWidth:{default:10},minHeight:{default:10},position:null,variant:{default:"handle"}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=t,r={width:0,height:0,x:0,y:0},i={...r,pointerX:0,pointerY:0},o=f.inject(J.NodeIdInjection,null),l=f.ref(),s=f.computed(()=>typeof n.nodeId=="string"?n.nodeId:o),{findNode:a,emits:c}=J.useVueFlow(),h=f.ref(i),m=f.ref(r),g=J.useGetPointerPosition(),w=f.computed(()=>n.variant===I.Line?"right":"bottom-right"),y=f.computed(()=>n.position??w.value);f.watchEffect(x=>{if(!l.value||!s.value)return;const C=X(l.value),u=bn().on("start",p=>{const d=a(s.value),{xSnapped:v,ySnapped:_}=g(p);m.value={width:(d==null?void 0:d.dimensions.width)??0,height:(d==null?void 0:d.dimensions.height)??0,x:(d==null?void 0:d.position.x)??0,y:(d==null?void 0:d.position.y)??0},h.value={...m.value,pointerX:v,pointerY:_},e("resizeStart",{event:p,params:m.value})}).on("drag",p=>{const{xSnapped:d,ySnapped:v}=g(p),_=a(s.value),A=y.value.includes("right")||y.value.includes("left"),E=y.value.includes("bottom")||y.value.includes("top"),b=y.value.includes("left"),P=y.value.includes("top");if(_){const R=[],{pointerX:k,pointerY:K,width:L,height:F,x:H,y:M}=h.value,{x:T,y:nt,width:At,height:Et}=m.value,rt=Math.floor(A?d-k:0),it=Math.floor(E?v-K:0),D=Math.max(L+(b?-rt:rt),n.minWidth),O=Math.max(F+(P?-it:it),n.minHeight),ot=D!==At,st=O!==Et;if(b||P){const q=b?H-(D-L):H,lt=P?M-(O-F):M,ut=q!==T&&ot,at=lt!==nt&&st;if(ut||at){const G={id:_.id,type:"position",from:_.position,position:{x:ut?q:T,y:at?lt:nt}};R.push(G),m.value.x=G.position.x,m.value.y=G.position.y}}if(ot||st){const q={id:s.value,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:D,height:O}};R.push(q),m.value.width=D,m.value.height=O}e("resize",{event:p,params:m.value}),c.nodesChange(R)}}).on("end",p=>{const d={id:s.value,type:"dimensions",resizing:!1};e("resizeEnd",{event:p,params:m.value}),c.nodesChange([d])});C.call(u),x(()=>{C.on(".drag",null)})});const z=f.computed(()=>y.value.split("-")),N=f.computed(()=>n.variant===I.Line?"borderColor":"backgroundColor"),V=f.computed(()=>n.color?{[N.value]:n.color}:{});return(x,C)=>(f.openBlock(),f.createElementBlock("div",{ref_key:"resizeControlRef",ref:l,class:f.normalizeClass(["vue-flow__resize-control nodrag",[...f.unref(z),t.variant]]),style:f.normalizeStyle(f.unref(V))},[f.renderSlot(x.$slots,"default")],6))}}),Sn={name:"NodeResizer",inheritAttrs:!1},xn=f.defineComponent({...Sn,props:{nodeId:null,color:null,handleClassName:null,handleStyle:null,lineClassName:null,lineStyle:null,isVisible:{type:Boolean,default:!0},minWidth:null,minHeight:null},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=["top-left","top-right","bottom-left","bottom-right"],r=["top","right","bottom","left"];return(i,o)=>(f.openBlock(),f.createElementBlock(f.Fragment,null,[(f.openBlock(),f.createElementBlock(f.Fragment,null,f.renderList(r,l=>f.createVNode(tt,{key:l,class:f.normalizeClass(t.lineClassName),style:f.normalizeStyle(t.lineStyle),"node-id":t.nodeId,position:l,variant:f.unref(I).Line,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,onResizeStart:o[0]||(o[0]=s=>e("resizeStart",s)),onResize:o[1]||(o[1]=s=>e("resize",s)),onResizeEnd:o[2]||(o[2]=s=>e("resizeEnd",s))},null,8,["class","style","node-id","position","variant","color","min-width","min-height"])),64)),(f.openBlock(),f.createElementBlock(f.Fragment,null,f.renderList(n,l=>f.createVNode(tt,{key:l,class:f.normalizeClass(t.lineClassName),style:f.normalizeStyle(t.lineStyle),"node-id":t.nodeId,position:l,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,onResizeStart:o[3]||(o[3]=s=>e("resizeStart",s)),onResize:o[4]||(o[4]=s=>e("resize",s)),onResizeEnd:o[5]||(o[5]=s=>e("resizeEnd",s))},null,8,["class","style","node-id","position","color","min-width","min-height"])),64))],64))}});exports.NodeResizeControl=tt;exports.NodeResizer=xn;exports.ResizeControlVariant=I; |
{ | ||
"name": "@vue-flow/node-resizer", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"private": false, | ||
@@ -25,3 +25,3 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"@vue-flow/core": "^1.0.0", | ||
"@vue-flow/core": "^1.12.2", | ||
"vue": "^3.2.37" | ||
@@ -36,8 +36,8 @@ }, | ||
"@types/d3-selection": "^3.0.3", | ||
"@vitejs/plugin-vue": "^3.2.0", | ||
"unplugin-auto-import": "^0.12.0", | ||
"vite": "^3.2.5", | ||
"vite-plugin-vue-type-imports": "0.2.0", | ||
"vue-tsc": "^1.0.11", | ||
"@vue-flow/core": "1.10.3" | ||
"@vitejs/plugin-vue": "^4.0.0", | ||
"unplugin-auto-import": "^0.12.1", | ||
"vite": "^4.0.4", | ||
"vite-plugin-vue-type-imports": "^0.2.4", | ||
"vue-tsc": "^1.0.24", | ||
"@vue-flow/core": "1.12.3" | ||
}, | ||
@@ -44,0 +44,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
85983
1405