mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2025-06-18 15:49:16 +08:00
11 lines
234 KiB
JavaScript
11 lines
234 KiB
JavaScript
import{o as yo}from"./mobx-preact@3.0.0_mobx@5.15.7_preact@10.25.4-SwmSNyX5.js";import{u as x,x as K,g as Wn,b as Gr,n as Zr}from"./preact@10.25.4-CrjB-ZC0.js";import{a as k,c as C,m as Fr,g as Zn,n as sr,p as Kt,f as W,t as bt,b as St,d as Ht,i as Qt,e as ht,s as go,h as _o,j as Vr,k as gr,l as mo,o as Vn,q as xo,r as Eo,u as Kr,v as Mo,w as Kn,x as Oo,y as So}from"./lodash-es@4.17.21-UVJw7vmf.js";import{c as wo,t as mt,i as qn,s as Ao,o as E,a as F,b as m,r as Po}from"./mobx@5.15.7-DLDjekon.js";import{v as To}from"./uuid@9.0.1-CtRu48qb.js";import{c as Do}from"./classnames@2.5.1-8E8W9FZl.js";import{M as No}from"./mousetrap@1.6.5-CGKHClW8.js";import{d as bo}from"./mobx-utils@5.6.2_mobx@5.15.7-CmgHUCcI.js";var Co=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]]);return t},_e;(function(n){function e(t){var r=Co(t,[]),o=t.container;if(!o)throw new Error("Ensure the container of LogicFlow is specified and valid.");return k({},n.defaults,r)}n.get=e})(_e||(_e={}));(function(n){n.defaults={background:!1,grid:!1,textEdit:!0,snapline:!0,outline:!1,disabledTools:[]}})(_e||(_e={}));var qr={node:!1,edge:!1},Lo={node:!0,edge:!0},jo=function(n){return!n||typeof n=="boolean"?n===!0?C(Lo):C(qr):Fr(C(qr),n)},Ro=function(){return Zn(window,"navigator.userAgent","").match(/MSIE|Trident/)!==null};function et(n){try{return JSON.parse(JSON.stringify(n))}catch{return n}}var Jr=200,Io=9999,Bo=10,X;(function(n){n[n.DEFAULT=1]="DEFAULT",n[n.TEXT_EDIT=2]="TEXT_EDIT",n[n.SHOW_MENU=3]="SHOW_MENU",n[n.ALLOW_CONNECT=4]="ALLOW_CONNECT",n[n.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT"})(X||(X={}));var $;(function(n){n.NODE="node",n.EDGE="edge",n.GRAPH="graph"})($||($={}));var j;(function(n){n.NODE="node",n.CIRCLE_NODE="circle-node",n.POLYGON_NODE="polygon-node",n.RECT_NODE="rect-node",n.TEXT_NODE="text-node",n.ELLIPSE_NODE="ellipse-node",n.DIAMOND_NODE="diamond-node",n.HTML_NODE="html-node",n.CUSTOM_HTML_NODE="custom-html-node",n.EDGE="edge",n.LINE_EDGE="line-edge",n.POLYLINE_EDGE="polyline-edge",n.BEZIER_EDGE="bezier-edge",n.GRAPH="graph"})(j||(j={}));var T;(function(n){n.ELEMENT_CLICK="element:click",n.NODE_ADD="node:add",n.NODE_DELETE="node:delete",n.NODE_CLICK="node:click",n.NODE_DBCLICK="node:dbclick",n.NODE_GROUP_COPY="node:group-copy-add",n.NODE_DND_ADD="node:dnd-add",n.NODE_DND_DRAG="node:dnd-drag",n.NODE_MOUSEDOWN="node:mousedown",n.NODE_DRAGSTART="node:dragstart",n.NODE_DRAG="node:drag",n.NODE_DROP="node:drop",n.NODE_MOUSEUP="node:mouseup",n.NODE_MOUSEMOVE="node:mousemove",n.NODE_MOUSEENTER="node:mouseenter",n.NODE_MOUSELEAVE="node:mouseleave",n.NODE_CONTEXTMENU="node:contextmenu",n.NODE_ROTATE="node:rotate",n.NODE_RESIZE="node:resize",n.NODE_FOCUS="node:focus",n.NODE_BLUR="node:blur",n.NODE_PROPERTIES_CHANGE="node:properties-change",n.NODE_PROPERTIES_DELETE="node:properties-delete",n.EDGE_ADD="edge:add",n.EDGE_DELETE="edge:delete",n.EDGE_CLICK="edge:click",n.EDGE_DBCLICK="edge:dbclick",n.EDGE_FOCUS="edge:focus",n.EDGE_BLUR="edge:blur",n.EDGE_MOUSEENTER="edge:mouseenter",n.EDGE_MOUSELEAVE="edge:mouseleave",n.EDGE_CONTEXTMENU="edge:contextmenu",n.EDGE_ADJUST="edge:adjust",n.EDGE_EXCHANGE_NODE="edge:exchange-node",n.ANCHOR_DRAGSTART="anchor:dragstart",n.ANCHOR_DRAG="anchor:drag",n.ANCHOR_DROP="anchor:drop",n.ANCHOR_DRAGEND="anchor:dragend",n.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",n.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",n.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",n.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",n.ADJUST_POINT_DRAG="adjustPoint:drag",n.ADJUST_POINT_DROP="adjustPoint:drop",n.ADJUST_POINT_DRAGEND="adjustPoint:dragend",n.BLANK_MOUSEDOWN="blank:mousedown",n.BLANK_DRAGSTART="blank:dragstart",n.BLANK_DRAG="blank:drag",n.BLANK_DROP="blank:drop",n.BLANK_MOUSEMOVE="blank:mousemove",n.BLANK_MOUSEUP="blank:mouseup",n.BLANK_CLICK="blank:click",n.BLANK_CONTEXTMENU="blank:contextmenu",n.SELECTION_MOUSEDOWN="selection:mousedown",n.SELECTION_DRAGSTART="selection:dragstart",n.SELECTION_DRAG="selection:drag",n.SELECTION_DROP="selection:drop",n.SELECTION_MOUSEMOVE="selection:mousemove",n.SELECTION_MOUSEUP="selection:mouseup",n.SELECTION_CONTEXTMENU="selection:contextmenu",n.CONNECTION_NOT_ALLOWED="connection:not-allowed",n.TEXT_MOUSEDOWN="text:mousedown",n.TEXT_DRAGSTART="text:dragstart",n.TEXT_DRAG="text:drag",n.TEXT_DROP="text:drop",n.TEXT_CLICK="text:click",n.TEXT_DBCLICK="text:dbclick",n.TEXT_BLUR="text:blur",n.TEXT_MOUSEMOVE="text:mousemove",n.TEXT_MOUSEUP="text:mouseup",n.TEXT_FOCUS="text:focus",n.TEXT_ADD="text:add",n.TEXT_UPDATE="text:update",n.TEXT_CLEAR="text:clear",n.LABEL_MOUSEDOWN="label:mousedown",n.LABEL_DRAGSTART="label:dragstart",n.LABEL_DRAG="label:drag",n.LABEL_DROP="label:drop",n.LABEL_CLICK="label:click",n.LABEL_DBCLICK="label:dbclick",n.LABEL_BLUR="label:blur",n.LABEL_MOUSEMOVE="label:mousemove",n.LABEL_MOUSEUP="label:mouseup",n.LABEL_FOCUS="label:focus",n.LABEL_ADD="label:add",n.LABEL_UPDATE="label:update",n.LABEL_CLEAR="label:clear",n.LABEL_DELETE="label:delete",n.LABEL_SHOULD_ADD="label:should-add",n.LABEL_BATCH_ADD="label:batch-add",n.LABEL_SHOULD_UPDATE="label:should-update",n.LABEL_SHOULD_DELETE="label:should-delete",n.LABEL_BATCH_DELETE="label:batch-delete",n.LABEL_NOT_ALLOWED_ADD="label:not-allowed-add",n.HISTORY_CHANGE="history:change",n.GRAPH_TRANSFORM="graph:transform",n.GRAPH_RENDERED="graph:rendered",n.GRAPH_UPDATED="graph:updated"})(T||(T={}));var pt;(function(n){n[n.DEFAULT=0]="DEFAULT",n[n.INCREASE=1]="INCREASE"})(pt||(pt={}));var G;(function(n){n.HORIZONTAL="horizontal",n.VERTICAL="vertical"})(G||(G={}));var st;(function(n){n.TEXT="text",n.LABEL="label"})(st||(st={}));var Xo=0,Mt=function(){function n(e){var t=e.onDragStart,r=t===void 0?sr:t,o=e.onDragging,i=o===void 0?sr:o,a=e.onDragEnd,s=a===void 0?sr:a,l=e.eventType,d=l===void 0?"":l,u=e.eventCenter,f=e.step,c=f===void 0?1:f,h=e.isStopPropagation,y=h===void 0?!0:h,p=e.model,g=e.data,v=this;this.isDragging=!1,this.isStartDragging=!1,this.startX=0,this.startY=0,this.sumDeltaX=0,this.sumDeltaY=0,this.handleMouseDown=function(_){var M,S,O=window==null?void 0:window.document;if(_.button===Xo){v.isStopPropagation&&_.stopPropagation(),v.isStartDragging=!0,v.startX=_.clientX,v.startY=_.clientY,O.addEventListener("mousemove",v.handleMouseMove,!1),O.addEventListener("mouseup",v.handleMouseUp,!1);var w=(M=v.model)===null||M===void 0?void 0:M.getData();(S=v.eventCenter)===null||S===void 0||S.emit(T["".concat(v.eventType,"_MOUSEDOWN")],{e:_,data:v.data||w}),v.startTime=new Date().getTime()}},this.handleMouseMove=function(_){var M,S;if(v.isStopPropagation&&_.stopPropagation(),!!v.isStartDragging&&(v.sumDeltaX+=_.clientX-v.startX,v.sumDeltaY+=_.clientY-v.startY,v.startX=_.clientX,v.startY=_.clientY,v.step<=1||Math.abs(v.sumDeltaX)>v.step||Math.abs(v.sumDeltaY)>v.step)){var O=v.sumDeltaX%v.step,w=v.sumDeltaY%v.step,A=v.sumDeltaX-O,b=v.sumDeltaY-w;v.sumDeltaX=O,v.sumDeltaY=w;var R=(M=v.model)===null||M===void 0?void 0:M.getData();v.isDragging||((S=v.eventCenter)===null||S===void 0||S.emit(T["".concat(v.eventType,"_DRAGSTART")],{e:_,data:v.data||R}),v.onDragStart({event:_})),v.isDragging=!0,Promise.resolve().then(function(){var L,z;v.onDragging({deltaX:A,deltaY:b,event:_}),(L=v.eventCenter)===null||L===void 0||L.emit(T["".concat(v.eventType,"_MOUSEMOVE")],{deltaX:A,deltaY:b,e:_,data:v.data||R}),(z=v.eventCenter)===null||z===void 0||z.emit(T["".concat(v.eventType,"_DRAG")],{e:_,data:v.data||R})})}},this.handleMouseUp=function(_){var M=window.document;v.isStartDragging=!1,v.isStopPropagation&&_.stopPropagation(),Promise.resolve().then(function(){var S,O,w;M.removeEventListener("mousemove",v.handleMouseMove,!1),M.removeEventListener("mouseup",v.handleMouseUp,!1);var A=(S=v.model)===null||S===void 0?void 0:S.getData();(O=v.eventCenter)===null||O===void 0||O.emit(T["".concat(v.eventType,"_MOUSEUP")],{e:_,data:v.data||A}),v.isDragging&&(v.isDragging=!1,v.onDragEnd({event:_}),(w=v.eventCenter)===null||w===void 0||w.emit(T["".concat(v.eventType,"_DROP")],{e:_,data:v.data||A}))})},this.cancelDrag=function(){var _=window==null?void 0:window.document;_.removeEventListener("mousemove",v.handleMouseMove,!1),_.removeEventListener("mouseup",v.handleMouseUp,!1),v.onDragEnd({event:void 0}),v.isDragging=!1},this.destroy=function(){v.isStartDragging&&v.cancelDrag()},this.onDragStart=r,this.onDragging=i,this.onDragEnd=s,this.step=c,this.isStopPropagation=y,this.eventType=d,this.eventCenter=u,this.model=p,this.data=g}return n.prototype.setStep=function(e){this.step=e},n.prototype.setModel=function(e){this.model=e},n}(),Yo=function(n){var e=n.x,t=n.y,r=n.width,o=n.height;return{x:e-r/2,y:t-o/2,x1:e+r/2,y1:t+o/2}},Ho=function(n){var e=n.startPoint,t=n.endPoint,r=(e.x+t.x)/2,o=(e.y+t.y)/2,i=Math.abs(e.x-t.x)+10,a=Math.abs(e.y-t.y)+10;return{x:r-i/2,y:o-a/2,x1:r+i/2,y1:o+a/2}},ko=function(n){var e=n.points,t=kt(e),r=Ee(t,8),o=r.x,i=r.y,a=r.width,s=r.height;return{x:o-a/2,y:i-s/2,x1:o+a/2,y1:i+s/2}},zo=function(n){var e=n.path,t=$r(e),r=Ee(t,8),o=r.x,i=r.y,a=r.width,s=r.height;return{x:o-a/2,y:i-s/2,x1:o+a/2,y1:i+s/2}},Go=function(n){if(n.modelType===j.LINE_EDGE)return Ho(n);if(n.modelType===j.POLYLINE_EDGE)return ko(n);if(n.modelType===j.BEZIER_EDGE)return zo(n)},Fo=function(n,e,t,r){var o=(e.y-n.y)*(r.x-t.x)-(n.x-e.x)*(t.y-r.y);if(o===0)return!1;var i=((e.x-n.x)*(r.x-t.x)*(t.y-n.y)+(e.y-n.y)*(r.x-t.x)*n.x-(r.y-t.y)*(e.x-n.x)*t.x)/o,a=-((e.y-n.y)*(r.y-t.y)*(t.x-n.x)+(e.x-n.x)*(r.y-t.y)*n.y-(r.x-t.x)*(e.y-n.y)*t.y)/o;return(i-n.x)*(i-e.x)<=0&&(a-n.y)*(a-e.y)<=0&&(i-t.x)*(i-r.x)<=0&&(a-t.y)*(a-r.y)<=0?{x:i,y:a}:!1},me=function(n,e,t){var r=n.x,o=n.y,i=e.x,a=e.y,s=t.x,l=t.y,d=(l-a)/(s-i),u=a-d*i;return(r>=i&&r<=s||r<=i&&r>=s)&&(o>=a&&o<=l||o<=a&&o>=l)&&Math.abs(o-d*r-u)<Number.EPSILON},xe=function(n){var e=n.start,t=n.end,r=n.offset,o=n.verticalLength,i=n.type,a={leftX:0,leftY:0,rightX:0,rightY:0},s=Math.atan((t.y-e.y)/(t.x-e.x)),l=Math.atan(r/o),d=Math.sqrt(o*o+r*r);return i==="start"?t.x>=e.x?(a.leftX=e.x+d*Math.sin(s+l),a.leftY=e.y-d*Math.cos(s+l),a.rightX=e.x-d*Math.sin(s-l),a.rightY=e.y+d*Math.cos(s-l)):(a.leftX=e.x-d*Math.sin(s+l),a.leftY=e.y+d*Math.cos(s+l),a.rightX=e.x+d*Math.sin(s-l),a.rightY=e.y-d*Math.cos(s-l)):i==="end"&&(t.x>=e.x?(a.leftX=t.x+d*Math.sin(s-l),a.leftY=t.y-d*Math.cos(s-l),a.rightX=t.x-d*Math.sin(s+l),a.rightY=t.y+d*Math.cos(s+l)):(a.leftX=t.x-d*Math.sin(s-l),a.leftY=t.y+d*Math.cos(s-l),a.rightX=t.x+d*Math.sin(s+l),a.rightY=t.y-d*Math.cos(s+l))),a},qt=function(){return qt=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},qt.apply(this,arguments)},at=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},Dt=function(n,e,t){if(t||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return n.concat(i||Array.prototype.slice.call(e))},$o=function(n,e){return Math.abs(n.centerX-e.centerX)*2<n.width+e.width&&Math.abs(n.centerY-e.centerY)*2<n.height+e.height},_r=function(n){var e=[],t={};return n.forEach(function(r){var o="".concat(r.x,"-").concat(r.y);r.id=o,t[o]=r}),Object.keys(t).forEach(function(r){e.push(t[r])}),e},Ge=function(n,e){return n.width===0&&n.height===0?n:{x:n.x,y:n.y,centerX:n.centerX,centerY:n.centerY,minX:n.minX-e,minY:n.minY-e,maxX:n.maxX+e,maxY:n.maxY+e,height:n.height+2*e,width:n.width+2*e}},Uo=function(n,e){var t=Math.abs(n.x-e.centerX),r=Math.abs(n.y-e.centerY);return t/e.width>r/e.height?G.HORIZONTAL:G.VERTICAL},Fe=function(n,e,t){var r=Uo(t,e);return r===G.HORIZONTAL?{x:t.x>n.centerX?n.maxX:n.minX,y:t.y}:{x:t.x,y:t.y>n.centerY?n.maxY:n.minY}},Qr=function(n,e){var t=Math.min(n.minX,e.minX),r=Math.min(n.minY,e.minY),o=Math.max(n.maxX,e.maxX),i=Math.max(n.maxY,e.maxY);return{x:(t+o)/2,y:(r+i)/2,centerX:(t+o)/2,centerY:(r+i)/2,minX:t,minY:r,maxX:o,maxY:i,height:i-r,width:o-t}},Ee=function(n,e){n===void 0&&(n=[]);var t=[],r=[];n.forEach(function(u){t.push(u.x),r.push(u.y)});var o=Math.min.apply(Math,Dt([],at(t),!1)),i=Math.max.apply(Math,Dt([],at(t),!1)),a=Math.min.apply(Math,Dt([],at(r),!1)),s=Math.max.apply(Math,Dt([],at(r),!1)),l=i-o,d=s-a;return e&&(l+=e,d+=e),{centerX:(o+i)/2,centerY:(a+s)/2,maxX:i,maxY:s,minX:o,minY:a,x:(o+i)/2,y:(a+s)/2,height:d,width:l}},$e=function(n){var e=n.minX,t=n.minY,r=n.maxX,o=n.maxY;return[{x:e,y:t},{x:r,y:t},{x:r,y:o},{x:e,y:o}]},Ne=function(n,e){var t=n.x,r=n.y;return t<e.minX||t>e.maxX||r<e.minY||r>e.maxY},Wo=function(n,e){return e<n.minX||e>n.maxX?[]:[{x:e,y:n.minY},{x:e,y:n.maxY}]},Zo=function(n,e){return e<n.minY||e>n.maxY?[]:[{x:n.minX,y:e},{x:n.maxX,y:e}]},Vo=function(n,e){return Dt(Dt([],at(Wo(n,e.x)),!1),at(Zo(n,e.y)),!1)},mr=function(n,e){return Math.abs(n.x-e.x)+Math.abs(n.y-e.y)},Ko=function(n,e){var t=-2,r=0;return e.forEach(function(o){o&&(n.x===o.x&&(r+=t),n.y===o.y&&(r+=t))}),r},tn=function(n,e,t,r,o){return mr(n,e)+mr(n,t)+Ko(n,[e,t,r,o])},Jn=function(n,e,t,r,o){o||(o=0),n.unshift(e[r]),t[r]&&t[r]!==r&&o<=100&&Jn(n,e,t,t[r],o+1)},qo=function(n,e){var t=n.indexOf(e);t>-1&&n.splice(t,1)},ie=function(n,e,t,r){var o=e.x-n.x,i=e.y-n.y,a=r.x-t.x,s=r.y-t.y,l=(-i*(n.x-t.x)+o*(n.y-t.y))/(-a*i+o*s),d=(a*(n.y-t.y)-s*(n.x-t.x))/(-a*i+o*s);return l>=0&&l<=1&&d>=0&&d<=1},en=function(n,e,t){if(t.width===0&&t.height===0)return!1;var r=at($e(t),4),o=r[0],i=r[1],a=r[2],s=r[3];return ie(n,e,o,i)||ie(n,e,o,s)||ie(n,e,i,a)||ie(n,e,a,s)},Jo=function(n,e,t,r){var o=[];return n.forEach(function(i){i!==e&&(i.x===e.x||i.y===e.y)&&!en(i,e,t)&&!en(i,e,r)&&o.push(i)}),_r(o)},Qo=function(n,e,t,r,o,i,a){var s=[],l=[e],d={},u={},f={};e.id&&(u[e.id]=0,f[e.id]=tn(e,t,e));var c={};n.forEach(function(p){p.id&&(c[p.id]=p)});for(var h=function(){var p,g=1/0;if(l.forEach(function(_){_.id&&f[_.id]<g&&(g=f[_.id],p=_)}),p===t&&t.id){var v=[];return Jn(v,c,d,t.id),{value:v}}if(!p)return{value:[e,t]};qo(l,p),s.push(p),Jo(n,p,r,o).forEach(function(_){if(s.indexOf(_)===-1&&(l.indexOf(_)===-1&&l.push(_),p!=null&&p.id&&(_!=null&&_.id))){var M=f[p.id]+mr(p,_);if(u[_.id]&&M>=u[_.id])return;d[_.id]=p.id,u[_.id]=M,f[_.id]=u[_.id]+tn(_,t,e,i,a)}})};l.length;){var y=h();if(typeof y=="object")return y.value}return[e,t]},rn=function(n){return rt(n)},Qn=function(n){for(var e=1;e<n.length-1;){var t=n[e-1],r=n[e],o=n[e+1];t.x===r.x&&r.x===o.x||t.y===r.y&&r.y===o.y?n.splice(e,1):e++}return n},nn=function(n,e,t,r,o){var i=rn(t),a=rn(r),s=Ge(i,o),l=Ge(a,o),d=Fe(s,i,n),u=Fe(l,a,e);if($o(s,l)){var f=ei(n,e,d,u);return Dt(Dt([n,d],at(f),!1),[u,e],!1)}var c=Ee([d,u]),h=Qr(s,c),y=Qr(l,c),p=[];p=p.concat($e(h)),p=p.concat($e(y));var g={x:(n.x+e.x)/2,y:(n.y+e.y)/2};[c,h,y].forEach(function(_){p=p.concat(Vo(_,g).filter(function(M){return Ne(M,s)&&Ne(M,l)}))}),[{x:d.x,y:u.y},{x:u.x,y:d.y}].forEach(function(_){Ne(_,s)&&Ne(_,l)&&p.push(_)}),p.unshift(d),p.push(u),p=_r(p);var v=Qo(p,d,u,i,a,n,e);return v.unshift(n),v.push(e),v.length>2&&(v=Qn(v)),_r(v)},ti=function(n){if(n.length===1){var e=at(n,1),t=e[0];return[t,t]}else{for(var r=n[0],o=n[1],i=vt(r.x,r.y,o.x,o.y),a=1;a<n.length-1;a++){var s=n[a],l=n[a+1],d=vt(s.x,s.y,l.x,l.y);d>i&&(i=d,r=s,o=l)}return[r,o]}},on=function(n,e,t){var r=Nt(n,t),o=Nt(e,t);return r&&o},an=function(n,e,t){var r=Nt(n,t),o=Nt(e,t),i=r&&o,a=r||o;return!i&&a},sn=function(n,e,t){for(var r=void 0,o=rt(t),i=$e(o),a=0;a<i.length;a++){var s=ie(n,e,i[a],i[(a+1)%i.length]);s&&(r=[i[a],i[(a+1)%i.length]])}if(r)return Fo(n,e,r[0],r[1])},Ue=function(n,e){var t=void 0;return n.x===e.x?t=G.VERTICAL:n.y===e.y&&(t=G.HORIZONTAL),t},kt=function(n){var e=n.split(" "),t=[];return e&&e.forEach(function(r){var o=at(r.split(","),2),i=o[0],a=o[1];t.push({x:Number(i),y:Number(a)})}),t},ei=function(n,e,t,r){var o=[],i=Ue(n,t),a=Ue(e,r);if(i===a)n.y===t.y?(o.push({x:t.x,y:(t.y+r.y)/2}),o.push({x:r.x,y:(t.y+r.y)/2})):(o.push({x:(t.x+r.x)/2,y:t.y}),o.push({x:(t.x+r.x)/2,y:r.y}));else{var s={x:t.x,y:r.y},l=me(s,n,t),d=me(s,e,r);if(l||d)s={x:r.x,y:t.y};else{var u=ln(s,n,t),f=ln(s,e,r);u&&f&&(s={x:r.x,y:t.y})}o.push(s)}return o},ln=function(n,e,t){return n.x===e.x&&n.x===t.x||n.y===e.y&&n.y===t.y},to=function(n){if(!n)return 0;for(var e=0,t=0;t<n.length;t++){var r=n.charCodeAt(t);n.match(/[A-Z]/)?e+=1.5:r>=1&&r<=126||r>=65376&&r<=65439?e+=1:e+=2}return e},ri=function(n){var e=n.start,t=n.end,r;if(e.x===t.x&&e.y===t.y)r="";else{var o={start:e,end:t,offset:10,verticalLength:5},i=xe(qt(qt({},o),{type:"start"})),a=xe(qt(qt({},o),{type:"end"}));r="M".concat(i.leftX," ").concat(i.leftY,`
|
||
L`).concat(i.rightX," ").concat(i.rightY,`
|
||
L`).concat(a.rightX," ").concat(a.rightY,`
|
||
L`).concat(a.leftX," ").concat(a.leftY," z")}return{d:r,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},dn=function(n){var e=n.start,t=n.end,r=n.sourceNode,o=n.targetNode,i=n.offset,a=rt(r),s=rt(o),l=Ge(a,i),d=Ge(s,i),u=Fe(l,a,e),f=Fe(d,s,t);return{sNext:u,ePre:f}},$r=function(n){var e=n.replace(/M/g,"").replace(/C/g,",").split(","),t=be(e[0]),r=be(e[1]),o=be(e[2]),i=be(e[3]);return[t,r,o,i]},be=function(n){var e=at(n.replace(/(^\s*)/g,"").split(" "),2),t=e[0],r=e[1];return{x:+t,y:+r}},un=function(n,e){var t=at(n,4),r=t[0],o=t[1],i=t[2],a=t[3],s=Hi(r,o,i,a,e);return[s,n[3]]},eo=function(n,e){for(var t=n.x,r=n.y,o=kt(e),i=Number.MAX_SAFE_INTEGER,a,s=[],l=0;l<o.length;l++)s.push({start:o[l],end:o[(l+1)%o.length]});if(s.forEach(function(c){var h=c.start,y=c.end;if(h.x===y.x){var p={x:h.x,y:r},g=me(p,h,y);if(g){var v=Math.abs(h.x-t);v<i&&(i=v,a=p)}}else if(h.y===y.y){var p={x:t,y:h.y},g=me(p,h,y);if(g){var v=Math.abs(h.y-r);v<i&&(i=v,a=p)}}}),!a){var d=s[0],u=d.start,f=d.end;a={x:u.x+(f.x-u.x)/2,y:u.y+(f.y-u.y)/2}}return a},ni=function(n){return Kt(n,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},fn=function(n,e){return Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2))};function oi(n,e){return typeof e!="function"?function(t,r,o){return Object.assign({type:n.edgeType},o)}:function(t,r,o){var i=e(t,r,o);return i?typeof i=="string"?Object.assign({},o,{type:i}):Object.assign({type:i},o):{type:n.edgeType}}}var ii=function(n){var e=n.rows,t=n.rowsLength,r=n.fontSize,o=0;return W(e,function(i){var a=to(i);o=a>o?a:o}),{width:Math.ceil(o/2)*r+r/4,height:t*(r+2)+r/4}},$t=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},Ce=function(n,e,t){if(t||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return n.concat(i||Array.prototype.slice.call(e))};function te(n,e,t){return t&&e*Math.round(n/e)||n}function ai(n,e,t){if(!n)return[];var r=Math.min.apply(Math,Ce([],$t(n.map(function(p){return p[0]})),!1)),o=Math.max.apply(Math,Ce([],$t(n.map(function(p){return p[0]})),!1)),i=Math.min.apply(Math,Ce([],$t(n.map(function(p){return p[1]})),!1)),a=Math.max.apply(Math,Ce([],$t(n.map(function(p){return p[1]})),!1)),s=-r,l=-i,d=n.map(function(p){var g=$t(p,2),v=g[0],_=g[1];return[v+s,_+l]}),u=o-r,f=a-i,c=e?e/u:1,h=t?t/f:1,y=Math.min(c,h);return d.map(function(p){var g=$t(p,2),v=g[0],_=g[1];return[v*y,_*y]})}var lr=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},dr=function(n,e,t){var r=lr(n,2),o=r[0],i=r[1],a=lr(e,2),s=a[0],l=a[1],d=lr(t,2),u=d[0],f=d[1];return o>s&&o<u&&i>l&&i<f},ro=function(n,e){var t=e.multipleSelectKey,r=!1;switch(t){case"meta":r=n.metaKey;break;case"alt":r=n.altKey;break;case"shift":r=n.shiftKey;break;case"ctrl":r=n.ctrlKey;break;default:r=!1;break}return r},Ur=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();function cn(n,e){return n instanceof Q&&e instanceof Q}var no=function(n){Ur(e,n);function e(t,r,o){var i=n.call(this,3)||this;return i[0]=t,i[1]=r,i[2]=o,i.x=t,i.y=r,i.z=o,Object.setPrototypeOf(i,e.prototype),i}return e.prototype.add=function(t){if(cn(this,t))return new Q(this.x+t.x,this.y+t.y);var r=this.z+t.z;return new xr((this.x+t.x)/r,(this.y+t.y)/r)},e.prototype.subtract=function(t){if(cn(this,t))return new Q(this.x-t.x,this.y-t.y);var r=this.z-t.z;return r===0?new Q(this.x-t.x,this.y-t.y):new xr((this.x-t.x)/r,(this.y-t.y)/r)},e}(Array),Q=function(n){Ur(e,n);function e(t,r,o){var i=n.call(this,t,r,o??0)||this;return Object.setPrototypeOf(i,e.prototype),i}return e.prototype.toString=function(){return"Vector"},e.prototype.dot=function(t){var r=this;return t.reduce(function(o,i,a){return o+i*r[a]})},e.prototype.cross=function(t){return new e(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)},e.prototype.getLength=function(){return Math.hypot(this.x,this.y)},e.prototype.normalize=function(){var t=this.getLength();return new e(this.x/t,this.y/t)},e.prototype.crossZ=function(t){return this.x*t.y-this.y*t.x},e.prototype.angle=function(t){var r=this.crossZ(t),o=Math.acos(this.normalize().dot(t.normalize()));return r>=0?o:-o},e}(no),xr=function(n){Ur(e,n);function e(t,r){var o=n.call(this,t,r,1)||this;return Object.setPrototypeOf(o,e.prototype),o}return e.prototype.toString=function(){return"Point"},e}(no),tr=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Ut=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},ur=function(n,e,t){if(t||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return n.concat(i||Array.prototype.slice.call(e))},er=function(n){tr(e,n);function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var o=n.call(this,t.length)||this;return o.fill(new Array(3)),t.forEach(function(i,a){o[a]=i}),o.columns=t[0].length,o.rows=t.length,Object.setPrototypeOf(o,e.prototype),o}return e.prototype.getRow=function(t){return this[t]},e.prototype.getColumn=function(t){return ur([],Ut(this.map(function(r){return r[t]})),!1)},e.prototype.transpose=function(){for(var t=[],r=0;r<this.columns;r++)t.push(this.getColumn(r));return new(e.bind.apply(e,ur([void 0],Ut(t),!1)))},e.prototype.cross=function(t){var r=new Array(this.rows).fill("").map(function(){return[]});if(this.columns===t.rows)for(var o=0;o<this.rows;o++)for(var i=this.getRow(o),a=function(l){var d=t.getColumn(l);r[o][l]=i.reduce(function(u,f,c){return u+f*d[c]},0)},s=0;s<t.columns;s++)a(s);return new(e.bind.apply(e,ur([void 0],Ut(r),!1)))},e.prototype.to2D=function(){return this.map(function(t){return[t[0],t[1]]})},e.prototype.toPoints=function(){return this.map(function(t){return new xr(t[0],t[1])})},e.prototype.toString=function(){var t=Ut(this[0],2),r=t[0],o=t[1],i=Ut(this[1],2),a=i[0],s=i[1],l=Ut(this[2],2),d=l[0],u=l[1];return"matrix(".concat(r," ").concat(o," ").concat(a," ").concat(s," ").concat(d," ").concat(u,")")},e.prototype.translate=function(t,r){return this.cross(new rr(t,r))},e.prototype.rotate=function(t){return this.cross(new si(t))},e.prototype.scale=function(t,r){return this.cross(new li(t,r))},e}(Array),si=function(n){tr(e,n);function e(t){var r=n.call(this,new Q(+Math.cos(t).toFixed(2),+Math.sin(t).toFixed(2),0),new Q(-Math.sin(t).toFixed(2),+Math.cos(t).toFixed(2),0),new Q(0,0,1))||this;return Object.setPrototypeOf(r,e.prototype),r}return e.prototype.inverse=function(){return this.transpose()},e}(er),li=function(n){tr(e,n);function e(t,r){var o=n.call(this,new Q(t,0,0),new Q(0,r,0),new Q(0,0,1))||this;return o.sx=t,o.sy=r,Object.setPrototypeOf(o,e.prototype),o}return e.prototype.inverse=function(){return new e(1/this.sx,1/this.sy)},e}(er),rr=function(n){tr(e,n);function e(t,r){var o=n.call(this,new Q(1,0,0),new Q(0,1,0),new Q(t,r,1))||this;return o.tx=t,o.ty=r,Object.setPrototypeOf(o,e.prototype),o}return e.prototype.inverse=function(){return new e(-this.tx,-this.ty)},e}(er);wo({});var We=function(){return We=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},We.apply(this,arguments)},Er=function(n){var e=n.anchors;return e},Ze=function(n,e){for(var t=e.nodes,r,o=t.length-1;o>=0;o--){var i=t[o],a=fi(n,i);if(a){var s=i.getTargetAnchor(n);if(s){var l={node:i,anchorIndex:s.index,anchor:s.anchor};(!r||di(i,r.node,e))&&(r=l)}}}return r},di=function(n,e,t){return n.zIndex>e.zIndex?!0:t.nodesMap[n.id].index>t.nodesMap[e.id].index},ui=function(n,e){for(var t=Er(e),r,o=Number.MAX_SAFE_INTEGER,i=0;i<t.length;i++){var a=vt(n.x,n.y,t[i].x,t[i].y);a<o&&(o=a,r={index:i,anchor:We(We({},t[i]),{x:t[i].x,y:t[i].y,id:t[i].id})})}return r},vt=function(n,e,t,r){return Math.hypot(n-t,e-r)},Nt=function(n,e){var t=!1,r=0,o=rt(e);return n.x>=o.minX-r&&n.x<=o.maxX+r&&n.y>=o.minY-r&&n.y<=o.maxY+r&&(t=!0),t},fi=function(n,e){var t=!1,r=5,o=rt(e);return n.x>=o.minX-r&&n.x<=o.maxX+r&&n.y>=o.minY-r&&n.y<=o.maxY+r&&(t=!0),t},rt=function(n){var e=n.x,t=n.y,r=n.width,o=n.height;return{minX:e-r/2,minY:t-o/2,maxX:e+r/2,maxY:t+o/2,x:e,y:t,width:r,height:o,centerX:e,centerY:t}},ci=function(n){var e=n,t=e.x,r=e.y,o=e.width,i=e.height,a=e.radius;return[{x:t-o/2+a,y:r-i/2+a,r:a},{x:t+o/2-a,y:r-i/2+a,r:a},{x:t-o/2+a,y:r+i/2-a,r:a},{x:t+o/2-a,y:r+i/2-a,r:a}]},pn=function(n,e,t){var r=ci(t),o,i=Number.MAX_SAFE_INTEGER;return r.forEach(function(a){var s=vt(n.x,n.y,a.x,a.y);s<i&&(i=s,o=a)}),Mr(n,e,o)},Mr=function(n,e,t){var r,o=t.x,i=t.y,a=t.r;if(e===G.HORIZONTAL){var s=o-Math.sqrt(a*a-(n.y-i)*(n.y-i)),l=o+Math.sqrt(a*a-(n.y-i)*(n.y-i)),d=Math.abs(s-n.x)<Math.abs(l-n.x)?s:l;r={x:d,y:n.y}}else if(e===G.VERTICAL){var u=i-Math.sqrt(a*a-(n.x-o)*(n.x-o)),f=i+Math.sqrt(a*a-(n.x-o)*(n.x-o)),c=Math.abs(u-n.y)<Math.abs(f-n.y)?u:f;r={x:n.x,y:c}}return r},hn=function(n,e){var t=e,r=!1,o=t.x,i=t.y,a=t.width,s=t.height,l=t.radius,d={minX:o-a/2+l,maxX:o+a/2-l,minY:i-s/2+l,maxY:i+s/2-l};return n.y===i+s/2||n.y===i-s/2?r=n.x>d.minX&&n.x<d.maxX:(n.x===o+a/2||n.x===o-a/2)&&(r=n.y>d.minY&&n.y<d.maxY),r},vn=function(n,e,t){var r,o=t,i=o.x,a=o.y,s=o.rx,l=o.ry;if(e===G.HORIZONTAL){var d=i-Math.sqrt(s*s-(n.y-a)*(n.y-a)*s*s/(l*l)),u=i+Math.sqrt(s*s-(n.y-a)*(n.y-a)*s*s/(l*l)),f=Math.abs(d-n.x)<Math.abs(u-n.x)?d:u;r={x:f,y:n.y}}else if(e===G.VERTICAL){var c=a-Math.sqrt(l*l-(n.x-i)*(n.x-i)*l*l/(s*s)),h=a+Math.sqrt(l*l-(n.x-i)*(n.x-i)*l*l/(s*s)),y=Math.abs(c-n.y)<Math.abs(h-n.y)?c:h;r={x:n.x,y}}return r},Le=function(n,e,t){for(var r=t.pointsPosition,o=Number.MAX_SAFE_INTEGER,i,a=[],s=0;s<r.length;s++)a.push({start:r[s],end:r[(s+1)%r.length]});return a.forEach(function(l){var d=l.start,u=l.end,f=d,c=u;d.x>u.x&&(f=u,c=d);var h={x:n.x,y:n.y};if(f.x===c.x&&e===G.HORIZONTAL&&(h={x:f.x,y:n.y}),f.y===c.y&&e===G.VERTICAL&&(h={x:n.x,y:f.y}),f.x!==c.x&&f.y!==c.y){var y=(c.y-f.y)/(c.x-f.x),p=(f.x*c.y-c.x*f.y)/(f.x-c.x);e===G.HORIZONTAL?h={x:(n.y-p)/y,y:n.y}:e===G.VERTICAL&&(h={x:n.x,y:y*n.x+p})}var g=me(h,d,u);if(g){var v=vt(h.x,h.y,n.x,n.y);v<o&&(o=v,i=h)}}),i},pi=function(n){var e=Kt(n,["id","type","x","y","text","label","properties","virtual","rotate","resizable","rotatable"]);return e},yn=function(n,e,t,r){var o=n.x,i=n.y;return e.x>n.x?o=n.x+t/2:e.x<n.x&&(o=n.x-t/2),e.y>n.y?i=n.y+r/2:e.y<n.y&&(i=n.y-r/2),{x:o,y:i}},oo=function(n){var e=n.rows,t=n.style,r=n.rowsLength,o=n.className,i=document.createElement("div");i.className=o,i.style.fontSize="".concat(t.fontSize),i.style.width="".concat(t.width),i.style.lineHeight="".concat(t.lineHeight),i.style.padding="".concat(t.padding),t.fontFamily&&(i.style.fontFamily="".concat(t.fontFamily)),r>1?e.forEach(function(s){var l=document.createElement("div");l.textContent=s,i.appendChild(l)}):i.textContent=e[0],document.body.appendChild(i);var a=i.clientHeight;return document.body.removeChild(i),a},gn=function(n){var e=n.rows,t=n.rowsLength,r=n.fontSize,o=0;return e&&e.forEach(function(i){var a=to(i);o=a>o?a:o}),{width:Math.ceil(o/2)*r+r/4,height:t*(r+2)+r/4}},Ve=function(n){return typeof n!="object"?{isAllPass:!!n,msg:n?"":"不允许连接"}:n},Yt=function(){return To()},se=new Map,io=function(n){var e=Yt();function t(){n();var o=se.get(e);if(o){var i=window.requestAnimationFrame(t);se.set(e,i)}}var r=window.requestAnimationFrame(t);return se.set(e,r),e},Ke=function(n){var e=se.get(n);e&&(window.cancelAnimationFrame(e),se.delete(n))},Me=function(){return Me=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Me.apply(this,arguments)},hi=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i};function ao(n){var e=n.x,t=e===void 0?0:e,r=n.y,o=r===void 0?0:r,i=n.value,a=n.fontSize,s=a===void 0?12:a,l=n.fill,d=l===void 0?"currentColor":l,u=n.overflowMode,f=u===void 0?"default":u,c=n.textWidth,h=c===void 0?void 0:c,y=n.model,p={x:t,y:o,fill:d,fontSize:s,textAnchor:"middle",dominantBaseline:"central"};if(W(bt(n),function(O){var w=hi(O,2),A=w[0],b=w[1];typeof b!="object"&&(p[A]=b)}),i){var g=String(i).split(/[\r\n]/g),v=g.length;if(f!=="default"){var _=y.BaseType,M=y.modelType;if(_===$.NODE&&M!==j.TEXT_NODE||_===$.EDGE&&h)return vi(n)}if(v>1){var S=g.map(function(O,w){var A=s+2,b=(w-(v-1)/2)*A;return x("tspan",{className:"lf-text-tspan",x:t,y:o+b,children:O})});return x("text",Me({},p,{children:S}))}return x("text",Me({},p,{children:i}))}return null}function vi(n){var e=n.x,t=n.y,r=n.value,o=n.model,i=n.textWidth,a=n.fontSize,s=a===void 0?12:a,l=n.lineHeight,d=n.fontFamily,u=d===void 0?"":d,f=n.wrapPadding,c=f===void 0?"0, 0":f,h=n.overflowMode,y=o.width,p=o.height,g=o.textHeight,v=i||y,_=String(r).split(/[\r\n]/g),M=_.length,S=oo({rows:_,style:{fontSize:"".concat(s,"px"),width:"".concat(v,"px"),fontFamily:u,lineHeight:l,padding:c},rowsLength:M,className:"lf-get-text-height"}),O=p>S?p:S;g&&(O=g);var w=h==="ellipsis";return w&&(O=s+2),x("g",{children:x("foreignObject",{width:v,height:O,x:e-v/2,y:t-O/2,style:{overflow:"visible",textAlign:"left"},children:x("div",{className:"lf-node-text-auto-wrap",style:{minHeight:O,width:v,padding:c},children:x("div",{className:w?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:w?_.join(""):"",style:Me({},n),children:_.map(function(A){return x("div",{className:"lf-node-text--auto-wrap-inner",children:A})})})})})})}var Or=function(){return Or=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Or.apply(this,arguments)},yi=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i};function ee(n){var e={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return W(bt(n),function(t){var r=yi(t,2),o=r[0],i=r[1];(o==="style"||typeof i!="object")&&(e[o]=i)}),x("line",Or({},e))}var Sr=function(){return Sr=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Sr.apply(this,arguments)},gi=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i};function Et(n){var e=n.x,t=n.y,r=n.width,o=n.height,i=n.className,a=n.strokeWidth,s=n.radius,l=s===void 0?0:s,d=e-r/2,u=t-o/2,f={};return f["stroke-width"]=a,W(bt(n),function(c){var h=gi(c,2),y=h[0],p=h[1];typeof p!="object"&&(f[y]=p)}),i?f.className="lf-basic-shape ".concat(i):f.className="lf-basic-shape",l&&(f.rx=l,f.ry=l),f.x=d,f.y=u,x("rect",Sr({},f))}var wr=function(){return wr=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},wr.apply(this,arguments)},_i=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i};function Oe(n){var e={d:""};return W(bt(n),function(t){var r=_i(t,2),o=r[0],i=r[1];(o==="style"||typeof i!="object")&&(e[o]=i)}),x("path",wr({},e))}var Ar=function(){return Ar=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Ar.apply(this,arguments)},mi=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i};function re(n){var e=n.x,t=e===void 0?0:e,r=n.y,o=r===void 0?0:r,i=n.r,a=i===void 0?4:i,s=n.className,l={cx:t,cy:o,r:a,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return W(bt(n),function(d){var u=mi(d,2),f=u[0],c=u[1];typeof c!="object"&&(l[f]=c)}),s?l.className="lf-basic-shape ".concat(s):l.className="lf-basic-shape",x("circle",Ar({},l))}var Pr=function(){return Pr=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Pr.apply(this,arguments)},xi=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i};function Ei(n){var e=n.x,t=e===void 0?0:e,r=n.y,o=r===void 0?0:r,i=n.rx,a=i===void 0?4:i,s=n.ry,l=s===void 0?4:s,d=n.className,u={cx:t,cy:o,rx:a,ry:l,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return W(bt(n),function(f){var c=xi(f,2),h=c[0],y=c[1];typeof y!="object"&&(u[h]=y)}),d?u.className="lf-basic-shape ".concat(d):u.className="lf-basic-shape",x("ellipse",Pr({},u))}var Tr=function(){return Tr=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Tr.apply(this,arguments)},Mi=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i};function so(n){var e=n.points,t=e===void 0?[]:e,r=n.className,o={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};return W(bt(n),function(i){var a=Mi(i,2),s=a[0],l=a[1];typeof l!="object"&&(o[s]=l)}),r?o.classNmae="lf-basic-shape ".concat(r):o.className="lf-basic-shape",o.points=t.map(function(i){return i.join(",")}).join(" "),x("polygon",Tr({},o))}var Dr=function(){return Dr=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Dr.apply(this,arguments)},Oi=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i};function Si(n){var e=n.className,t={points:"",fill:"none"};return W(bt(n),function(r){var o=Oi(r,2),i=o[0],a=o[1];(i==="style"||typeof a!="object")&&(t[i]=a)}),e&&(t.className="".concat(e)),x("polyline",Dr({},t))}var lo=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Se=function(){return Se=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Se.apply(this,arguments)},wi=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]]);return t},Ai=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},H;(function(n){n[n.LEFT_TOP=0]="LEFT_TOP",n[n.RIGHT_TOP=1]="RIGHT_TOP",n[n.RIGHT_BOTTOM=2]="RIGHT_BOTTOM",n[n.LEFT_BOTTOM=3]="LEFT_BOTTOM"})(H||(H={}));var Pi=function(n){lo(e,n);function e(t){var r=n.call(this)||this;r.updateEdgePointByAnchors=function(){var s=r.nodeModel,l=s.id,d=s.anchors,u=r.graphModel.getNodeEdges(l);W(u,function(f){if(f.sourceNodeId===l){var c=Ht(d,function(h){return h.id===f.sourceAnchorId});c&&f.updateStartPoint({x:c.x,y:c.y})}else if(f.targetNodeId===l){var c=Ht(d,function(y){return y.id===f.targetAnchorId});c&&f.updateEndPoint({x:c.x,y:c.y})}})},r.triggerResizeEvent=function(s,l,d,u,f,c){r.graphModel.eventCenter.emit(T.NODE_RESIZE,{preData:s,data:l,deltaX:d,deltaY:u,index:f,model:c})},r.recalcResizeInfo=function(s,l,d,u,f){d===void 0&&(d=1),u===void 0&&(u=!1),f===void 0&&(f=!1);var c=C(l),h=c.deltaX,y=c.deltaY,p=c.width,g=c.height,v=c.PCTResizeInfo;if(v){var _=4,M=0,S=0;switch(s){case H.LEFT_TOP:S=(h*-1-y)/_;break;case H.RIGHT_TOP:S=(h-y)/_;break;case H.RIGHT_BOTTOM:S=(h+y)/_;break;case H.LEFT_BOTTOM:S=(h*-1+y)/_;break}S!==0&&(M=Math.round(S/v.ResizeBasis.basisHeight*1e5)/1e3),v.ResizePCT.widthPCT=Math.max(Math.min(v.ResizePCT.widthPCT+M,v.ScaleLimit.maxScaleLimit),v.ScaleLimit.minScaleLimit),v.ResizePCT.heightPCT=Math.max(Math.min(v.ResizePCT.heightPCT+M,v.ScaleLimit.maxScaleLimit),v.ScaleLimit.minScaleLimit);var O=Math.round(v.ResizePCT.widthPCT*v.ResizeBasis.basisWidth/100),w=Math.round(v.ResizePCT.heightPCT*v.ResizeBasis.basisHeight/100);switch(s){case H.LEFT_TOP:h=p-O,y=g-w;break;case H.RIGHT_TOP:h=O-p,y=g-w;break;case H.RIGHT_BOTTOM:h=O-p,y=w-g;break;case H.LEFT_BOTTOM:h=p-O,y=w-g;break}return c}switch(s){case H.LEFT_TOP:c.width=u?p:p-h*d,c.height=f?g:g-y*d;break;case H.RIGHT_TOP:c.width=u?p:p+h*d,c.height=f?g:g-y*d;break;case H.RIGHT_BOTTOM:c.width=u?p:p+h*d,c.height=f?g:g+y*d;break;case H.LEFT_BOTTOM:c.width=u?p:p-h*d,c.height=f?g:g+y*d;break}return c},r.resizeNode=function(s){var l=s.deltaX,d=s.deltaY,u=r.index,f=r.props,c=f.model,h=f.graphModel,y=f.x,p=f.y;Ii({x:y,y:p,deltaX:l,deltaY:d,index:u,nodeModel:c,graphModel:h,cancelCallback:function(){r.dragHandler.cancelDrag()}})},r.onDragging=function(s){var l=s.deltaX,d=s.deltaY,u=r.graphModel.transformModel,f=Ai(u.fixDeltaXY(l,d),2),c=f[0],h=f[1];r.resizeNode({deltaX:c,deltaY:h})},r.onDragEnd=function(){var s=r.nodeModel.x,l=r.nodeModel.y;r.nodeModel.moveTo(s,l),r.updateEdgePointByAnchors()};var o=t.index,i=t.model,a=t.graphModel;return r.index=o,r.nodeModel=i,r.graphModel=a,r.dragHandler=new Mt({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:a.gridSize}),r}return e.prototype.componentWillUnmount=function(){this.dragHandler.destroy()},e.prototype.render=function(){var t=this.props,r=t.x,o=t.y,i=t.direction,a=t.model,s=a.getResizeControlStyle(),l=s.width,d=s.height,u=wi(s,["width","height"]);return x("g",{className:"lf-resize-control lf-resize-control-".concat(i),children:[x(Et,Se({className:"lf-resize-control-content",x:r,y:o,width:l??7,height:d??7},u)),x(Et,{className:"lf-resize-control-content",x:r,y:o,width:25,height:25,fill:"transparent",stroke:"transparent",onMouseDown:this.dragHandler.handleMouseDown})]})},e}(K),Ti=function(n){lo(e,n);function e(){return n.call(this)||this}return e.prototype.getResizeControl=function(){var t=this.props,r=t.model,o=t.graphModel,i=rt(r),a=i.minX,s=i.minY,l=i.maxX,d=i.maxY,u=[{index:H.LEFT_TOP,direction:"nw",x:a,y:s},{index:H.RIGHT_TOP,direction:"ne",x:l,y:s},{index:H.RIGHT_BOTTOM,direction:"se",x:l,y:d},{index:H.LEFT_BOTTOM,direction:"sw",x:a,y:d}];return St(u,function(f){return x(Pi,Se({},f,{model:r,graphModel:o}))})},e.prototype.getResizeOutline=function(){var t=this.props.model,r=t.x,o=t.y,i=t.width,a=t.height,s=t.getResizeOutlineStyle();return x(Et,Se({},s,{x:r,y:o,width:i,height:a}))},e.prototype.render=function(){return x("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})},e}(K);function Di(n,e){var t=n.x,r=n.y,o=e.x,i=e.y,a={x:t+(o-t)/2,y:r+(i-r)/2};return a}function ae(n,e,t){var r=Ni(t),o=n.x-e.x,i=n.y-e.y,a=o*Math.cos(r)-i*Math.sin(r)+e.x,s=o*Math.sin(r)+i*Math.cos(r)+e.y;return{x:a,y:s}}function Ni(n){return n*Math.PI/180}function bi(n){return n/Math.PI*180}function Ci(n,e,t,r,o,i,a,s,l){s===void 0&&(s=!1),l===void 0&&(l=!1);var d=e.deltaX,u=e.deltaY,f=e.width,c=e.height,h=bi(t),y={x:r,y:o},p={x:i,y:a},g=ae(y,p,h),v={x:g.x+d,y:g.y+u},_=Bi(g,v,p,h,s,l,f,c),M=_.width,S=_.height,O=_.center;return e.width=M*n,e.height=S*n,e.deltaX=(O.x-p.x)*2,e.deltaY=(O.y-p.y)*2,e}var Li=function(n,e,t,r,o,i,a,s,l,d){t===void 0&&(t=1),r===void 0&&(r=!1),o===void 0&&(o=!1),i===void 0&&(i=0);var u=C(e),f=u.deltaX,c=u.deltaY,h=u.width,y=u.height,p=u.PCTResizeInfo;if(p){var g=4,v=0,_=0;switch(n){case H.LEFT_TOP:_=(f*-1-c)/g;break;case H.RIGHT_TOP:_=(f-c)/g;break;case H.RIGHT_BOTTOM:_=(f+c)/g;break;case H.LEFT_BOTTOM:_=(f*-1+c)/g;break}_!==0&&(v=Math.round(_/p.ResizeBasis.basisHeight*1e5)/1e3),p.ResizePCT.widthPCT=Math.max(Math.min(p.ResizePCT.widthPCT+v,p.ScaleLimit.maxScaleLimit),p.ScaleLimit.minScaleLimit),p.ResizePCT.heightPCT=Math.max(Math.min(p.ResizePCT.heightPCT+v,p.ScaleLimit.maxScaleLimit),p.ScaleLimit.minScaleLimit);var M=Math.round(p.ResizePCT.widthPCT*p.ResizeBasis.basisWidth/100),S=Math.round(p.ResizePCT.heightPCT*p.ResizeBasis.basisHeight/100);switch(n){case H.LEFT_TOP:f=h-M,c=y-S;break;case H.RIGHT_TOP:f=M-h,c=y-S;break;case H.RIGHT_BOTTOM:f=M-h,c=S-y;break;case H.LEFT_BOTTOM:f=h-M,c=S-y;break}return u}if(i%(2*Math.PI)!==0&&a!==void 0&&s!==void 0)return Ci(t,u,i,a,s,l,d,r,o);switch(n){case H.LEFT_TOP:u.width=r?h:h-f*t,u.height=o?y:y-c*t;break;case H.RIGHT_TOP:u.width=r?h:h+f*t,u.height=o?y:y-c*t;break;case H.RIGHT_BOTTOM:u.width=r?h:h+f*t,u.height=o?y:y+c*t;break;case H.LEFT_BOTTOM:u.width=r?h:h-f*t,u.height=o?y:y+c*t;break}return u},ji=function(n,e){var t=n.id,r=n.anchors,o=e.getNodeEdges(t);W(o,function(i){if(i.sourceNodeId===t){var a=Ht(r,function(s){return s.id===i.sourceAnchorId});a&&i.updateStartPoint({x:a.x,y:a.y})}else if(i.targetNodeId===t){var a=Ht(r,function(l){return l.id===i.targetAnchorId});a&&i.updateEndPoint({x:a.x,y:a.y})}})},Ri=function(n,e,t,r,o,i,a){a.eventCenter.emit(T.NODE_RESIZE,{preData:n,data:e,deltaX:t,deltaY:r,index:o,model:i})},Ii=function(n){var e=n.x,t=n.y,r=n.deltaX,o=n.deltaY,i=n.index,a=n.nodeModel,s=n.graphModel,l=n.cancelCallback,d=a.r,u=a.rx,f=a.ry,c=a.width,h=a.height,y=a.PCTResizeInfo,p=a.minWidth,g=a.minHeight,v=a.maxWidth,_=a.maxHeight,M=a.rotate,S=a.x,O=a.y,w=p===v,A=g===_,b={width:d||u||c,height:d||f||h,deltaX:r,deltaY:o,PCTResizeInfo:y},R=d||u&&f?1/2:1,L=e,z=t,I=Li(i,b,R,w,A,M,L,z,S,O);if(I.width<p||I.width>v||I.height<g||I.height>_){l==null||l();return}(M%(2*Math.PI)==0||y||L===void 0||z===void 0)&&(I.deltaX=w?0:I.deltaX,I.deltaY=A?0:I.deltaY);var U=a.getData(),Y=a.resize(I);U.x===Y.x&&U.y===Y.y||(ji(a,s),Ri(U,Y,r,o,i,a,s))};function Bi(n,e,t,r,o,i,a,s){o===void 0&&(o=!1),i===void 0&&(i=!1);var l={x:t.x-(n.x-t.x),y:t.y-(n.y-t.y)},d=Di(l,e),u=ae(e,d,-r),f=ae(l,d,-r);if(o){var c=Math.abs(u.x-f.x),h=c-a;d.x>u.x?d.x=d.x+h/2:d.x=d.x-h/2}if(i){var y=Math.abs(u.y-f.y),p=y-s;d.y>u.y?d.y=d.y+p/2:d.y=d.y-p/2}if(o||i){var g=ae(f,d,r),v=g.x-l.x,_=g.y-l.y;d.x=d.x-v,d.y=d.y-_,f=ae(l,d,-r),u={x:d.x-(f.x-d.x),y:d.y-(f.y-d.y)}}var M=Math.abs(u.x-f.x),S=Math.abs(u.y-f.y);return o&&(M=a),i&&(S=s),{width:M,height:S,center:d}}var Xi=100,Yi={x:1,y:0};function Hi(n,e,t,r,o){for(var i=function(h){if(h<0||h>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:n.x*Math.pow(1-h,3)+3*e.x*h*Math.pow(1-h,2)+3*t.x*Math.pow(h,2)*(1-h)+r.x*Math.pow(h,3),y:n.y*Math.pow(1-h,3)+3*e.y*h*Math.pow(1-h,2)+3*t.y*Math.pow(h,2)*(1-h)+r.y*Math.pow(h,3)}},a=0,s=2,l=r.x,d=r.y,u=r;a<o&&s<50;){u=i(1-s/Xi);var f=u.x,c=u.y;a=vt(l,d,f,c),s++}return u}function ki(n,e){return n.x*e.y-n.y*e.x}function zi(n,e){var t=[n.x,n.y,n.z],r=[e.x,e.y,e.z];return r.reduce(function(o,i,a){return o+i*t[a]})}function Gi(n,e){var t=ki(n,e),r=Math.acos(zi(_n(n),_n(e)));return t>=0?r:-r}function _n(n){var e=Math.hypot(n.x,n.y);return{x:n.x/e,y:n.y/e,z:0}}function Fi(n){return Gi(Yi,n)}function $i(n){return n*(180/Math.PI)}var Ui={baseNode:{fill:"#fff",stroke:"#000",strokeWidth:2},baseEdge:{stroke:"#000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000",fill:"#fff",r:4,hover:{r:10,fill:"#949494",fillOpacity:.5,stroke:"#949494"}},anchorLine:{stroke:"#000",strokeWidth:2,strokeDasharray:"3,2"},nodeText:{color:"#000",overflowMode:"default",fontSize:12,lineHeight:1.2},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#fff"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",fillOpacity:1,stroke:"#949494"}},arrow:{offset:10,verticalLength:5},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#fff",stroke:"#949494",strokeWidth:2},outline:{fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeAnimation:{stroke:"red",strokeDasharray:"10,10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5},resizeControl:{width:7,height:7,fill:"#fff",stroke:"#000"},resizeOutline:{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},uo=function(n){var e=C(Ui);return n&&(e=Fr(e,n)),e},Wi=uo,Zi=1e3,Vi=999,Wr=function(){return++Zi},Ki=function(){return--Vi},V=function(){return V=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},V.apply(this,arguments)},D=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},nr=function(){function n(e,t){var r;this.BaseType=$.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.textMode=st.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.points="",this.pointsList=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.isAnimation=!1,this.isShowAdjustPoint=!1,this.zIndex=0,this.state=X.DEFAULT,this.modelType=j.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=t,this.properties=(r=e.properties)!==null&&r!==void 0?r:{},this.initEdgeData(e),this.setAttributes()}return n.prototype.initEdgeData=function(e){if(e.properties||(e.properties={}),!e.id){var t=this.graphModel.idGenerator,r=t&&t(e.type),o=this.createId();e.id=o||r||Yt()}this.arrowConfig.markerEnd="url(#marker-end-".concat(e.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(e.id,")");var i=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=i,k(this,ni(e));var a=this.graphModel.overlapMode;a===pt.INCREASE&&(this.zIndex=e.zIndex||Wr()),this.setAnchors(),this.initPoints(),this.formatText(e)},n.prototype.setAttributes=function(){},n.prototype.createId=function(){return null},n.prototype.getEdgeStyle=function(){return V(V({},this.graphModel.theme.baseEdge),this.style)},n.prototype.getAdjustPointStyle=function(){return V({},this.graphModel.theme.edgeAdjust)},n.prototype.getTextStyle=function(){var e=this.graphModel.theme.edgeText;return C(e)},n.prototype.getEdgeAnimationStyle=function(){var e=this.graphModel.theme.edgeAnimation;return C(e)},n.prototype.getArrowStyle=function(){var e=this.getEdgeStyle(),t=this.getEdgeAnimationStyle(),r=this.graphModel.theme.arrow,o=this.isAnimation?t.stroke:e.stroke;return V(V(V({},e),{fill:o,stroke:o}),r)},n.prototype.getOutlineStyle=function(){var e=this.graphModel,t=e.theme.outline;return C(t)},n.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(n.prototype,"sourceNode",{get:function(){var e,t;return(t=(e=this.graphModel)===null||e===void 0?void 0:e.nodesMap[this.sourceNodeId])===null||t===void 0?void 0:t.model},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetNode",{get:function(){var e,t;return(t=(e=this.graphModel)===null||e===void 0?void 0:e.nodesMap[this.targetNodeId])===null||t===void 0?void 0:t.model},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),n.prototype.getBeginAnchor=function(e,t,r){var o,i,a=Er(e);if(r){if(o=Ht(a,function(s){return s.id===r}),o)return o;console.warn("未在节点上找到指定的起点锚点".concat(r,",已使用默认锚点作为起点"))}return a.forEach(function(s){var l=fn(s,t);(i===void 0||l<i)&&(i=l,o=s)}),o},n.prototype.getEndAnchor=function(e,t){var r=this,o,i,a=Er(e);if(t){if(o=Ht(a,function(s){return s.id===t}),o)return o;console.warn("未在节点上找到指定的终点锚点".concat(t,",已使用默认锚点作为终点"))}return a.forEach(function(s){if(r.startPoint){var l=fn(s,r.startPoint);(i===void 0||l<i)&&(i=l,o=s)}}),o},n.prototype.getProperties=function(){return mt(this.properties)},n.prototype.getData=function(){var e=this.properties;qn(e)&&(e=mt(e));var t={id:this.id,type:this.type,properties:e,sourceNodeId:this.sourceNodeId,targetNodeId:this.targetNodeId,sourceAnchorId:this.sourceAnchorId,targetAnchorId:this.targetAnchorId,startPoint:k({},this.startPoint),endPoint:k({},this.endPoint)};this.graphModel.overlapMode===pt.INCREASE&&(t.zIndex=this.zIndex);var r=this.text,o=r.x,i=r.y,a=r.value;return a&&(t.text={x:o,y:i,value:a}),t},n.prototype.getHistoryData=function(){return this.getData()},n.prototype.setProperty=function(e,t){Ao(this.properties,e,et(t)),this.setAttributes()},n.prototype.deleteProperty=function(e){delete this.properties[e],this.setAttributes()},n.prototype.setProperties=function(e){this.properties=V(V({},mt(this.properties)),et(e)),this.setAttributes()},n.prototype.changeEdgeId=function(e){var t=this.arrowConfig,r=t.markerEnd,o=t.markerStart;o&&o==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(e,")")),r&&r==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(e,")")),this.id=e},n.prototype.setStyle=function(e,t){var r;this.style=V(V({},this.style),(r={},r[e]=et(t),r))},n.prototype.setStyles=function(e){this.style=V(V({},this.style),et(e))},n.prototype.updateStyles=function(e){this.style=V({},et(e))},n.prototype.setTextMode=function(e){this.textMode=e},n.prototype.formatText=function(e){var t,r,o,i=this.graphModel.editConfigModel,a=i.edgeTextDraggable,s=i.edgeTextEdit,l=this.textPosition,d=l.x,u=l.y,f=e.text,c={value:"",x:d,y:u,draggable:a,editable:s};f&&(typeof f=="string"?c=V(V({},c),{value:f}):(c=V(V({},c),{x:(t=f.x)!==null&&t!==void 0?t:d,y:(r=f.y)!==null&&r!==void 0?r:u,value:(o=f.value)!==null&&o!==void 0?o:""}),Qt(f.draggable)||(c.draggable=f.draggable),Qt(f.editable)||(c.editable=f.editable))),this.text=c},n.prototype.resetTextPosition=function(){var e=this.textPosition,t=e.x,r=e.y;this.text.x=t,this.text.y=r},n.prototype.moveText=function(e,t){var r=this.text,o=r.x,i=r.y,a=r.value,s=r.draggable,l=r.editable;this.text={value:a,editable:l,draggable:s,x:o+e,y:i+t}},n.prototype.setText=function(e){e&&k(this.text,e)},n.prototype.updateText=function(e){this.text=V(V({},mt(this.text)),{value:e})},n.prototype.setAnchors=function(){if(!this.sourceAnchorId||!this.startPoint){var e=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId);if(!e)throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:e.x,y:e.y}),this.sourceAnchorId||(this.sourceAnchorId=e.id)}if(!this.targetAnchorId||!this.endPoint){var e=this.getEndAnchor(this.targetNode,this.targetAnchorId);if(!e)throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:e.x,y:e.y}),this.targetAnchorId||(this.targetAnchorId=e.id)}},n.prototype.setSelected=function(e){e===void 0&&(e=!0),this.isSelected=e},n.prototype.setHovered=function(e){e===void 0&&(e=!0),this.isHovered=e},n.prototype.setHitable=function(e){e===void 0&&(e=!0),this.isHitable=e},n.prototype.setHittable=function(e){e===void 0&&(e=!0),this.isHittable=e},n.prototype.openEdgeAnimation=function(){this.isAnimation=!0},n.prototype.closeEdgeAnimation=function(){this.isAnimation=!1},n.prototype.setElementState=function(e,t){this.state=e,this.additionStateData=t},n.prototype.updateStartPoint=function(e){this.startPoint=e},n.prototype.moveStartPoint=function(e,t){this.startPoint&&(this.startPoint.x+=e,this.startPoint.y+=t)},n.prototype.updateEndPoint=function(e){this.endPoint=e},n.prototype.moveEndPoint=function(e,t){this.endPoint&&(this.endPoint.x+=e,this.endPoint.y+=t)},n.prototype.setZIndex=function(e){e===void 0&&(e=0),this.zIndex=e},n.prototype.initPoints=function(){},n.prototype.updateAttributes=function(e){k(this,e)},n.prototype.getAdjustStart=function(){return this.startPoint},n.prototype.getAdjustEnd=function(){return this.endPoint},n.prototype.updateAfterAdjustStartAndEnd=function(e){var t=e.startPoint,r=e.endPoint;this.updateStartPoint({x:t.x,y:t.y}),this.updateEndPoint({x:r.x,y:r.y})},n.BaseType=$.EDGE,D([E],n.prototype,"type",void 0),D([E],n.prototype,"sourceNodeId",void 0),D([E],n.prototype,"targetNodeId",void 0),D([E],n.prototype,"startPoint",void 0),D([E],n.prototype,"endPoint",void 0),D([E],n.prototype,"textMode",void 0),D([E],n.prototype,"text",void 0),D([E],n.prototype,"properties",void 0),D([E],n.prototype,"points",void 0),D([E],n.prototype,"pointsList",void 0),D([E],n.prototype,"isSelected",void 0),D([E],n.prototype,"isHovered",void 0),D([E],n.prototype,"isHitable",void 0),D([E],n.prototype,"isHittable",void 0),D([E],n.prototype,"draggable",void 0),D([E],n.prototype,"visible",void 0),D([E],n.prototype,"isAnimation",void 0),D([E],n.prototype,"isShowAdjustPoint",void 0),D([E],n.prototype,"zIndex",void 0),D([E],n.prototype,"state",void 0),D([E],n.prototype,"style",void 0),D([E],n.prototype,"arrowConfig",void 0),D([F],n.prototype,"sourceNode",null),D([F],n.prototype,"targetNode",null),D([F],n.prototype,"textPosition",null),D([m],n.prototype,"setProperty",null),D([m],n.prototype,"deleteProperty",null),D([m],n.prototype,"setProperties",null),D([m],n.prototype,"changeEdgeId",null),D([m],n.prototype,"setStyle",null),D([m],n.prototype,"setStyles",null),D([m],n.prototype,"updateStyles",null),D([m],n.prototype,"setTextMode",null),D([m],n.prototype,"formatText",null),D([m],n.prototype,"resetTextPosition",null),D([m],n.prototype,"moveText",null),D([m],n.prototype,"setText",null),D([m],n.prototype,"updateText",null),D([m],n.prototype,"setAnchors",null),D([m],n.prototype,"setSelected",null),D([m],n.prototype,"setHovered",null),D([m],n.prototype,"setHitable",null),D([m],n.prototype,"setHittable",null),D([m],n.prototype,"openEdgeAnimation",null),D([m],n.prototype,"closeEdgeAnimation",null),D([m],n.prototype,"setElementState",null),D([m],n.prototype,"updateStartPoint",null),D([m],n.prototype,"moveStartPoint",null),D([m],n.prototype,"updateEndPoint",null),D([m],n.prototype,"moveEndPoint",null),D([m],n.prototype,"setZIndex",null),D([m],n.prototype,"initPoints",null),D([m],n.prototype,"updateAttributes",null),D([m],n.prototype,"getAdjustStart",null),D([m],n.prototype,"getAdjustEnd",null),D([m],n.prototype,"updateAfterAdjustStartAndEnd",null),n}(),qi=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),It=function(){return It=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},It.apply(this,arguments)},dt=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},fr=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},mn=function(n){qi(e,n);function e(t,r){var o=n.call(this,t,r)||this;return o.modelType=j.BEZIER_EDGE,o.path="",o.initEdgeData(t),o.setAttributes(),o}return e.prototype.initEdgeData=function(t){this.offset=100,n.prototype.initEdgeData.call(this,t)},e.prototype.getEdgeStyle=function(){var t=this.graphModel.theme.bezier,r=n.prototype.getEdgeStyle.call(this),o=this.properties.style,i=o===void 0?{}:o;return It(It(It({},r),C(t)),C(i))},e.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var t=0,r=0;return this.pointsList.forEach(function(o){var i=o.x,a=o.y;t+=i,r+=a}),{x:t/this.pointsList.length,y:r/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e.prototype.getData=function(){var t=n.prototype.getData.call(this),r=this.pointsList.map(function(o){var i=o.x,a=o.y;return{x:i,y:a}});return It(It({},t),{pointsList:r})},e.prototype.getControls=function(){var t=this.startPoint,r=this.endPoint,o=dn({start:t,end:r,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset});return o},e.prototype.getPath=function(t){var r=fr(t,4),o=r[0],i=r[1],a=r[2],s=r[3];return"M ".concat(o.x," ").concat(o.y,`
|
||
C `).concat(i.x," ").concat(i.y,`,
|
||
`).concat(a.x," ").concat(a.y,`,
|
||
`).concat(s.x," ").concat(s.y)},e.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var t=this.getControls(),r=t.sNext,o=t.ePre;this.updatePath(r,o)},e.prototype.updatePath=function(t,r){t=C(t),r=C(r);var o={x:this.startPoint.x,y:this.startPoint.y},i={x:this.endPoint.x,y:this.endPoint.y};if(!t||!r){var a=this.getControls();t=a.sNext,r=a.ePre}this.pointsList=[o,t,r,i],this.path=this.getPath(this.pointsList)},e.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},e.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveStartPoint=function(t,r){this.startPoint.x+=t,this.startPoint.y+=r;var o=fr(this.pointsList,3),i=o[1],a=o[2];i.x+=t,i.y+=r,this.updatePath(i,a)},e.prototype.moveEndPoint=function(t,r){this.endPoint.x+=t,this.endPoint.y+=r;var o=fr(this.pointsList,3),i=o[1],a=o[2];a.x+=t,a.y+=r,this.updatePath(i,a)},e.prototype.updateAdjustAnchor=function(t,r){var o;r==="sNext"?this.pointsList[1]=t:r==="ePre"&&(this.pointsList[2]=t),this.path=this.getPath(this.pointsList),!((o=this.text)===null||o===void 0)&&o.value&&this.setText(k({},this.text,this.textPosition))},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(t){var r=t.startPoint,o=t.endPoint,i=t.sourceNode,a=t.targetNode,s=dn({start:r,end:o,sourceNode:i,targetNode:a,offset:this.offset}),l=s.sNext,d=s.ePre;this.pointsList=[r,l,d,o],this.initPoints()},dt([E],e.prototype,"path",void 0),dt([m],e.prototype,"initPoints",null),dt([m],e.prototype,"updatePoints",null),dt([m],e.prototype,"updateStartPoint",null),dt([m],e.prototype,"updateEndPoint",null),dt([m],e.prototype,"moveStartPoint",null),dt([m],e.prototype,"moveEndPoint",null),dt([m],e.prototype,"updateAdjustAnchor",null),dt([m],e.prototype,"getAdjustStart",null),dt([m],e.prototype,"getAdjustEnd",null),dt([m],e.prototype,"updateAfterAdjustStartAndEnd",null),e}(nr),Ji=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),le=function(){return le=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},le.apply(this,arguments)},xn=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},Qi=function(n,e,t){if(t||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return n.concat(i||Array.prototype.slice.call(e))},En=function(n){Ji(e,n);function e(){var t=n.apply(this,Qi([],xn(arguments),!1))||this;return t.modelType=j.LINE_EDGE,t}return e.prototype.getEdgeStyle=function(){var t=this.graphModel.theme.line,r=n.prototype.getEdgeStyle.call(this),o=this.properties.style,i=o===void 0?{}:o;return le(le(le({},r),C(t)),C(i))},e.prototype.initEdgeData=function(t){n.prototype.initEdgeData.call(this,t),this.points=this.getPath([this.startPoint,this.endPoint])},e.prototype.getPath=function(t){var r=xn(t,2),o=r[0],i=r[1];return"".concat(o.x,",").concat(o.y," ").concat(i.x,",").concat(i.y)},e.prototype.getTextPosition=function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e}(nr),ta=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),de=function(){return de=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},de.apply(this,arguments)},tt=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},Mn=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},ea=function(n,e,t){if(t||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return n.concat(i||Array.prototype.slice.call(e))},On=function(n){ta(e,n);function e(){var t=n.apply(this,ea([],Mn(arguments),!1))||this;return t.modelType=j.POLYLINE_EDGE,t.draggingPointList=[],t}return e.prototype.initEdgeData=function(t){this.offset=30,t.pointsList&&(this.pointsList=t.pointsList),n.prototype.initEdgeData.call(this,t)},e.prototype.getEdgeStyle=function(){var t=this.graphModel.theme.polyline,r=n.prototype.getEdgeStyle.call(this),o=this.properties.style,i=o===void 0?{}:o;return de(de(de({},r),C(t)),C(i))},e.prototype.getTextPosition=function(){var t,r=(t=this.text)===null||t===void 0?void 0:t.value;if(this.dbClickPosition&&!r){var o=this.dbClickPosition,i=o.x,a=o.y;return{x:i,y:a}}var s=kt(this.points),l=Mn(ti(s),2),d=l[0],u=l[1];return{x:(d.x+u.x)/2,y:(d.y+u.y)/2}},e.prototype.getAfterAnchor=function(t,r,o){var i,a;return o.forEach(function(s){var l;t===G.HORIZONTAL?l=Math.abs(r.y-s.y):t===G.VERTICAL&&(l=Math.abs(r.x-s.x)),(!a||a>l)&&(a=l,i=s)}),i},e.prototype.getCrossPoint=function(t,r,o){var i;return t===G.HORIZONTAL?i={x:o.x,y:r.y}:t===G.VERTICAL&&(i={x:r.x,y:o.y}),i},e.prototype.removeCrossPoints=function(t,r,o){var i=o.map(function(v){return v});if(t===1){var a=i[t],s=i[r],l=i[t-1],d=on(l,a,this.sourceNode);if(d){var u=an(a,s,this.sourceNode);if(u){var f=sn(a,s,this.sourceNode);f&&(i[t]=f,i.splice(t-1,1),t--,r--)}}else{var c=this.sourceNode.anchors;c.forEach(function(v){if(v.x===l.x&&v.x===a.x||v.y===l.y&&v.y===a.y){var _=vt(v.x,v.y,a.x,a.y),M=vt(l.x,l.y,a.x,a.y);_<M&&(i[t-1]=v)}})}}if(r===o.length-2){var h=i[t],y=i[r],p=i[r+1],g=on(y,p,this.targetNode);if(g){var u=an(h,y,this.targetNode);if(u){var f=sn(h,y,this.targetNode);f&&(i[r]=f,i.splice(r+1,1))}}else{var c=this.targetNode.anchors;c.forEach(function(_){if(_.x===p.x&&_.x===y.x||_.y===p.y&&_.y===y.y){var M=vt(_.x,_.y,y.x,y.y),S=vt(p.x,p.y,y.x,y.y);M<S&&(i[r+1]=_)}})}}return i},e.prototype.getDraggingPoints=function(t,r,o,i,a){var s=a.map(function(u){return u}),l=this.getAfterAnchor(t,o,i),d=this.getCrossPoint(t,o,l);return r==="start"?(s.unshift(d),s.unshift(l)):(s.push(d),s.push(l)),s},e.prototype.updateCrossPoints=function(t){var r=t.map(function(_){return _}),o=t[0],i=t[1],a=t[r.length-2],s=t[r.length-1],l=this,d=l.sourceNode,u=l.targetNode,f=d.modelType,c=u.modelType,h=Ue(o,i),y=r[0];switch(f){case j.RECT_NODE:if(d.radius!==0){var p=hn(o,d);p||(y=pn(o,h,d))}break;case j.CIRCLE_NODE:y=Mr(o,h,d);break;case j.ELLIPSE_NODE:y=vn(o,h,d);break;case j.DIAMOND_NODE:y=Le(o,h,d);break;case j.POLYGON_NODE:y=Le(o,h,d);break}y&&(r[0]=y);var g=Ue(a,s),v=r[r.length-1];switch(c){case j.RECT_NODE:if(u.radius!==0){var p=hn(s,u);p||(v=pn(s,g,u))}break;case j.CIRCLE_NODE:v=Mr(s,g,u);break;case j.ELLIPSE_NODE:v=vn(s,g,u);break;case j.DIAMOND_NODE:v=Le(s,g,u);break;case j.POLYGON_NODE:v=Le(s,g,u);break}return v&&(r[r.length-1]=v),r},e.prototype.updatePath=function(t){this.pointsList=t,this.points=this.getPath(this.pointsList)},e.prototype.getData=function(){var t=n.prototype.getData.call(this),r=this.pointsList.map(function(o){var i=o.x,a=o.y;return{x:i,y:a}});return Object.assign({},t,{pointsList:r})},e.prototype.getPath=function(t){return t.map(function(r){return"".concat(r.x,",").concat(r.y)}).join(" ")},e.prototype.initPoints=function(){this.pointsList.length>0?this.points=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var t=nn({x:this.startPoint.x,y:this.startPoint.y},{x:this.endPoint.x,y:this.endPoint.y},this.sourceNode,this.targetNode,this.offset||0);this.pointsList=t,this.points=t.map(function(r){return"".concat(r.x,",").concat(r.y)}).join(" ")},e.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveStartPoint=function(t,r){this.startPoint.x+=t,this.startPoint.y+=r,this.updatePoints()},e.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveEndPoint=function(t,r){this.endPoint.x+=t,this.endPoint.y+=r,this.updatePoints()},e.prototype.updatePointsList=function(t,r){this.pointsList.forEach(function(a){a.x+=t,a.y+=r});var o=this.pointsList[0];this.startPoint=Object.assign({},o);var i=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},i),this.initPoints()},e.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map(function(t){return t})},e.prototype.dragAppendSimple=function(t,r){var o;this.isDragging=!0;var i=t.start,a=t.end,s=t.startIndex,l=t.endIndex,d=t.direction,u=this.pointsList,f=u;return d===G.HORIZONTAL?(u[s]={x:i.x,y:i.y+r.y},u[l]={x:a.x,y:a.y+r.y},f=this.pointsList.map(function(c){return c})):d===G.VERTICAL&&(u[s]={x:i.x+r.x,y:i.y},u[l]={x:a.x+r.x,y:a.y},f=this.pointsList.map(function(c){return c})),this.updatePointsAfterDrag(f),this.draggingPointList=f,!((o=this.text)===null||o===void 0)&&o.value&&this.setText(k({},this.text,this.textPosition)),{start:k({},u[s]),end:k({},u[l]),startIndex:s,endIndex:l,direction:d}},e.prototype.dragAppend=function(t,r){var o;this.isDragging=!0;var i=t.start,a=t.end,s=t.startIndex,l=t.endIndex,d=t.direction,u=this.pointsList;if(d===G.HORIZONTAL){u[s]={x:i.x,y:i.y+r.y},u[l]={x:a.x,y:a.y+r.y};var f=this.pointsList.map(function(g){return g});if(s!==0&&l!==this.pointsList.length-1&&(f=this.removeCrossPoints(s,l,f)),s===0){var c={x:i.x,y:i.y+r.y},h=Nt(c,this.sourceNode);if(!h){var y=this.sourceNode.anchors;f=this.getDraggingPoints(d,"start",c,y,f)}}if(l===this.pointsList.length-1){var p={x:a.x,y:a.y+r.y},h=Nt(p,this.targetNode);if(!h){var y=this.targetNode.anchors;f=this.getDraggingPoints(d,"end",p,y,f)}}this.updatePointsAfterDrag(f),this.draggingPointList=f}else if(d===G.VERTICAL){u[s]={x:i.x+r.x,y:i.y},u[l]={x:a.x+r.x,y:a.y};var f=this.pointsList.map(function(v){return v});if(s!==0&&l!==this.pointsList.length-1&&(f=this.removeCrossPoints(s,l,f)),s===0){var c={x:i.x+r.x,y:i.y},h=Nt(c,this.sourceNode);if(!h){var y=this.sourceNode.anchors;f=this.getDraggingPoints(d,"start",c,y,f)}}if(l===this.pointsList.length-1){var p={x:a.x+r.x,y:a.y},h=Nt(p,this.targetNode);if(!h){var y=this.targetNode.anchors;f=this.getDraggingPoints(d,"end",p,y,f)}}this.updatePointsAfterDrag(f),this.draggingPointList=f}return!((o=this.text)===null||o===void 0)&&o.value&&this.setText(k({},this.text,this.textPosition)),{start:k({},u[s]),end:k({},u[l]),startIndex:s,endIndex:l,direction:d}},e.prototype.dragAppendEnd=function(){if(this.draggingPointList){var t=Qn(kt(this.points));this.pointsList=t.map(function(i){return i}),this.draggingPointList=[];var r=t[0];this.startPoint=k({},r);var o=t[t.length-1];this.endPoint=k({},o)}this.isDragging=!1},e.prototype.updatePointsAfterDrag=function(t){var r=this.updateCrossPoints(t);this.points=r.map(function(o){return"".concat(o.x,",").concat(o.y)}).join(" ")},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(t){var r=t.startPoint,o=t.endPoint,i=t.sourceNode,a=t.targetNode;this.pointsList=nn({x:r.x,y:r.y},{x:o.x,y:o.y},i,a,this.offset||0),this.initPoints()},tt([E],e.prototype,"dbClickPosition",void 0),tt([m],e.prototype,"initPoints",null),tt([m],e.prototype,"updatePoints",null),tt([m],e.prototype,"updateStartPoint",null),tt([m],e.prototype,"moveStartPoint",null),tt([m],e.prototype,"updateEndPoint",null),tt([m],e.prototype,"moveEndPoint",null),tt([m],e.prototype,"updatePointsList",null),tt([m],e.prototype,"dragAppendStart",null),tt([m],e.prototype,"dragAppendSimple",null),tt([m],e.prototype,"dragAppend",null),tt([m],e.prototype,"dragAppendEnd",null),tt([m],e.prototype,"updatePointsAfterDrag",null),tt([m],e.prototype,"getAdjustStart",null),tt([m],e.prototype,"getAdjustEnd",null),tt([m],e.prototype,"updateAfterAdjustStartAndEnd",null),e}(nr),q=function(){return q=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},q.apply(this,arguments)},N=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},Sn=function(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ra=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},Ct=function(){function n(e,t){var r;this.BaseType=$.NODE,this.id="",this.type="",this.x=0,this.y=0,this.textMode=st.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this._width=100,this._height=80,this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.anchorsOffset=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isShowAnchor=!1,this.isDragging=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.rotatable=!0,this.resizable=!0,this.zIndex=1,this.state=X.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=j.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.resizeRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=t,this.properties=(r=e.properties)!==null&&r!==void 0?r:{},this.initNodeData(e),this.setAttributes()}return Object.defineProperty(n.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e;var t=this,r=t.x,o=r===void 0?0:r,i=t.y,a=i===void 0?0:i;this.transform=new rr(-o,-a).rotate(e).translate(o,a).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),n.prototype.initNodeData=function(e){if(e.properties||(e.properties={}),!e.id){var t=this.graphModel.idGenerator,r=t&&t(e.type),o=this.createId();e.id=o||r||Yt()}this.formatText(e),k(this,pi(e));var i=this.graphModel.overlapMode;i===pt.INCREASE&&(this.zIndex=e.zIndex||Wr())},n.prototype.setAttributes=function(){},n.prototype.createId=function(){return null},n.prototype.setTextMode=function(e){this.textMode=e},n.prototype.formatText=function(e){var t,r,o,i=this.graphModel.editConfigModel,a=i.nodeTextDraggable,s=i.nodeTextEdit,l=e.x,d=e.y,u=e.text,f={value:"",x:l,y:d,draggable:a,editable:s};u&&(typeof u=="string"?f.value=u:(f=q(q({},f),{x:(t=u.x)!==null&&t!==void 0?t:l,y:(r=u.y)!==null&&r!==void 0?r:d,value:(o=u.value)!==null&&o!==void 0?o:""}),Qt(u.draggable)||(f.draggable=u.draggable),Qt(u.editable)||(f.editable=u.editable))),e.text=f},n.prototype.resize=function(e){var t=e.width,r=e.height,o=e.deltaX,i=e.deltaY,a=this.isAllowResizeNode(o,i,t,r);return a?(this.move(o/2,i/2),this.width=t,this.height=r,this.setProperties({width:t,height:r}),this.getData()):this.getData()},n.prototype.proportionalResize=function(){},n.prototype.getData=function(){var e=this.text,t=e.x,r=e.y,o=e.value,i=this.properties;qn(i)&&(i=mt(i)),ht(i.width)&&(i.width=this.width),ht(i.height)&&(i.height=this.height);var a={id:this.id,type:this.type,x:this.x,y:this.y,properties:i};return this.rotate&&(a.rotate=this.rotate),this.graphModel.overlapMode===pt.INCREASE&&(a.zIndex=this.zIndex),o&&(a.text={x:t,y:r,value:o}),a},n.prototype.getHistoryData=function(){return this.getData()},n.prototype.getProperties=function(){return mt(this.properties)},n.prototype.getOuterGAttributes=function(){return{className:""}},n.prototype.getNodeStyle=function(){return q(q({},this.graphModel.theme.baseNode),this.style)},n.prototype.getTextStyle=function(){var e=this.graphModel.theme.nodeText,t=this.properties.textStyle,r=t===void 0?{}:t;return q(q({},C(e)),C(r))},n.prototype.getRotateControlStyle=function(){var e=this.graphModel.theme.rotateControl;return C(e)},n.prototype.getResizeControlStyle=function(){var e=this.graphModel.theme.resizeControl;return C(e)},n.prototype.getResizeOutlineStyle=function(){var e=this.graphModel.theme.resizeOutline;return C(e)},n.prototype.getAnchorStyle=function(e){var t=this.graphModel.theme.anchor;return C(t)},n.prototype.getAnchorLineStyle=function(e){var t=this.graphModel.theme.anchorLine;return C(t)},n.prototype.getOutlineStyle=function(){var e=this.graphModel.theme.outline;return C(e)},n.prototype.isAllowConnectedAsSource=function(e,t,r,o){var i=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var a=!0,s="",l=0;l<i.length;l++){var d=i[l];if(!d.validate.call(this,this,e,t,r,o)){a=!1,s=d.message;break}}return{isAllPass:a,msg:s}},n.prototype.getConnectedSourceRules=function(){return this.sourceRules},n.prototype.isAllowConnectedAsTarget=function(e,t,r,o){var i=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var a=!0,s="",l=0;l<i.length;l++){var d=i[l];if(!d.validate.call(this,e,this,t,r,o)){a=!1,s=d.message;break}}return{isAllPass:a,msg:s}},n.prototype.isAllowMoveNode=function(e,t){var r,o,i=!0,a=!0,s=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var l=Sn(s),d=l.next();!d.done;d=l.next()){var u=d.value,f=u(this,e,t);if(!f)return!1;if(typeof f=="object"){var c=f;if(!c.x&&!c.y)return!1;i=i&&c.x,a=a&&c.y}}}catch(h){r={error:h}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}return{x:i,y:a}},n.prototype.getConnectedTargetRules=function(){return this.targetRules},n.prototype.getAnchorsByOffset=function(){var e=this,t=e.anchorsOffset,r=e.id,o=e.x,i=e.y;return t&&t.length>0?t.map(function(a,s){return a.length?(a=a,{id:"".concat(r,"_").concat(s),x:o+a[0],y:i+a[1]}):(a=a,q(q({},a),{x:o+a.x,y:i+a.y,id:a.id||"".concat(r,"_").concat(s)}))}):this.getDefaultAnchor()},n.prototype.getDefaultAnchor=function(){return[]},n.prototype.getTargetAnchor=function(e){return ui(e,this)},n.prototype.getBounds=function(){return{minX:this.x-this.width/2,minY:this.y-this.height/2,maxX:this.x+this.width/2,maxY:this.y+this.height/2}},Object.defineProperty(n.prototype,"anchors",{get:function(){var e=this.getAnchorsByOffset(),t=this,r=t.x,o=t.y,i=t.rotate;return e.forEach(function(a){var s=a.x,l=a.y,d=ra(new er([s,l,1]).translate(-r,-o).rotate(i).translate(r,o)[0],2),u=d[0],f=d[1];a.x=u,a.y=f}),e},enumerable:!1,configurable:!0}),n.prototype.getAnchorInfo=function(e){if(!ht(e))for(var t=0;t<this.anchors.length;t++){var r=this.anchors[t];if(r.id===e)return r}},n.prototype.addNodeMoveRules=function(e){this.moveRules.includes(e)||this.moveRules.push(e)},n.prototype.isAllowMoveByXORY=function(e,t,r){var o,i;if(r)o=!0,i=!0;else{var a=this.isAllowMoveNode(e,t);typeof a=="boolean"?(o=a,i=a):(o=a.x,i=a.y)}return{isAllowMoveX:o,isAllowMoveY:i}},n.prototype.move=function(e,t,r){r===void 0&&(r=!1);var o=this.isAllowMoveByXORY(e,t,r),i=o.isAllowMoveX,a=o.isAllowMoveY;return i&&(this.x=this.x+e,this.text&&this.moveText(e,0)),a&&(this.y=this.y+t,this.text&&this.moveText(0,t)),(i||a)&&(this.rotate=this._rotate),i||a},n.prototype.getMoveDistance=function(e,t,r){r===void 0&&(r=!1);var o=this.isAllowMoveByXORY(e,t,r),i=o.isAllowMoveX,a=o.isAllowMoveY,s=0,l=0;return i&&e&&(this.x=this.x+e,this.text&&this.moveText(e,0),s=e),a&&t&&(this.y=this.y+t,this.text&&this.moveText(0,t),l=t),[s,l]},n.prototype.moveTo=function(e,t,r){r===void 0&&(r=!1);var o=e-this.x,i=t-this.y;return!r&&!this.isAllowMoveNode(o,i)?!1:(this.text&&this.moveText(o,i),this.x=e,this.y=t,!0)},n.prototype.moveText=function(e,t){var r=this.text,o=r.x,i=r.y,a=r.value,s=r.draggable,l=r.editable;this.text={value:a,editable:l,draggable:s,x:o+e,y:i+t}},n.prototype.updateText=function(e){this.text=q(q({},mt(this.text)),{value:e})},n.prototype.addNodeResizeRules=function(e){this.resizeRules.includes(e)||this.resizeRules.push(e)},n.prototype.isAllowResizeNode=function(e,t,r,o){var i,a,s=this.resizeRules.concat(this.graphModel.nodeResizeRules);try{for(var l=Sn(s),d=l.next();!d.done;d=l.next()){var u=d.value,f=u(this,e,t,r,o);if(!f)return!1}}catch(c){i={error:c}}finally{try{d&&!d.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}return!0},n.prototype.setSelected=function(e){e===void 0&&(e=!0),this.isSelected=e},n.prototype.setHovered=function(e){e===void 0&&(e=!0),this.isHovered=e,this.setIsShowAnchor(e)},n.prototype.setIsShowAnchor=function(e){e===void 0&&(e=!0),this.isShowAnchor=e},n.prototype.setRotatable=function(e){e===void 0&&(e=!0),this.rotatable=e},n.prototype.setResizable=function(e){e===void 0&&(e=!0),this.resizable=e},n.prototype.setHitable=function(e){e===void 0&&(e=!0),this.isHitable=e},n.prototype.setHittable=function(e){e===void 0&&(e=!0),this.isHittable=e},n.prototype.setElementState=function(e,t){this.state=e,this.additionStateData=t},n.prototype.updateProperties=function(e,t){var r=mt(this.properties);this.properties=e,this.setAttributes(),this.graphModel.eventCenter.emit(T.NODE_PROPERTIES_CHANGE,{id:this.id,keys:t,preProperties:r,properties:e})},n.prototype.setProperty=function(e,t){var r=mt(this.properties),o=C(r);go(o,e,et(t)),this.updateProperties(o,[e])},n.prototype.setProperties=function(e){var t=mt(this.properties),r=q(q({},t),et(e)),o=[];_o(e,function(i,a){(Vr(t,a)&&t[a]!==i||!Vr(t,a))&&o.push(a)}),this.updateProperties(r,o)},n.prototype.deleteProperty=function(e){delete this.properties[e],this.setAttributes()},n.prototype.setStyle=function(e,t){var r;this.style=q(q({},this.style),(r={},r[e]=et(t),r))},n.prototype.setStyles=function(e){this.style=q(q({},this.style),et(e))},n.prototype.updateStyles=function(e){this.style=q({},et(e))},n.prototype.setZIndex=function(e){e===void 0&&(e=1),this.zIndex=e},n.prototype.updateAttributes=function(e){k(this,e)},n.BaseType=$.NODE,N([E],n.prototype,"type",void 0),N([E],n.prototype,"x",void 0),N([E],n.prototype,"y",void 0),N([E],n.prototype,"textMode",void 0),N([E],n.prototype,"text",void 0),N([E],n.prototype,"properties",void 0),N([E],n.prototype,"_width",void 0),N([E],n.prototype,"_height",void 0),N([E],n.prototype,"anchorsOffset",void 0),N([E],n.prototype,"isSelected",void 0),N([E],n.prototype,"isHovered",void 0),N([E],n.prototype,"isShowAnchor",void 0),N([E],n.prototype,"isDragging",void 0),N([E],n.prototype,"isHitable",void 0),N([E],n.prototype,"isHittable",void 0),N([E],n.prototype,"draggable",void 0),N([E],n.prototype,"visible",void 0),N([E],n.prototype,"rotatable",void 0),N([E],n.prototype,"resizable",void 0),N([E],n.prototype,"zIndex",void 0),N([E],n.prototype,"state",void 0),N([E],n.prototype,"autoToFront",void 0),N([E],n.prototype,"style",void 0),N([E],n.prototype,"transform",void 0),N([E],n.prototype,"_rotate",void 0),N([F],n.prototype,"incoming",null),N([F],n.prototype,"outgoing",null),N([m],n.prototype,"setTextMode",null),N([m],n.prototype,"addNodeMoveRules",null),N([m],n.prototype,"move",null),N([m],n.prototype,"getMoveDistance",null),N([m],n.prototype,"moveTo",null),N([m],n.prototype,"moveText",null),N([m],n.prototype,"updateText",null),N([m],n.prototype,"addNodeResizeRules",null),N([m],n.prototype,"setSelected",null),N([m],n.prototype,"setHovered",null),N([m],n.prototype,"setIsShowAnchor",null),N([m],n.prototype,"setRotatable",null),N([m],n.prototype,"setResizable",null),N([m],n.prototype,"setHitable",null),N([m],n.prototype,"setHittable",null),N([m],n.prototype,"setElementState",null),N([m],n.prototype,"setProperty",null),N([m],n.prototype,"setProperties",null),N([m],n.prototype,"deleteProperty",null),N([m],n.prototype,"setStyle",null),N([m],n.prototype,"setStyles",null),N([m],n.prototype,"updateStyles",null),N([m],n.prototype,"setZIndex",null),N([m],n.prototype,"updateAttributes",null),n}(),na=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ue=function(){return ue=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},ue.apply(this,arguments)},cr=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},wn=function(n){na(e,n);function e(t,r){var o=n.call(this,t,r)||this;return o.modelType=j.CIRCLE_NODE,o.r=50,o.initNodeData(t),o.setAttributes(),o}return Object.defineProperty(e.prototype,"width",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),e.prototype.setAttributes=function(){n.prototype.setAttributes.call(this);var t=this.properties.r;t&&(this.r=t)},e.prototype.getNodeStyle=function(){var t=n.prototype.getNodeStyle.call(this),r=this.graphModel.theme.circle,o=this.properties.style,i=o===void 0?{}:o;return ue(ue(ue({},t),C(r)),C(i))},e.prototype.getDefaultAnchor=function(){var t=this,r=t.x,o=t.y,i=t.r;return[{x:r,y:o-i,id:"".concat(this.id,"_0")},{x:r+i,y:o,id:"".concat(this.id,"_1")},{x:r,y:o+i,id:"".concat(this.id,"_2")},{x:r-i,y:o,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(t){var r=t.width,o=t.deltaX,i=t.deltaY;return this.move(o/2,i/2),this.r=r,this.setProperties({r}),this.getData()},cr([E],e.prototype,"r",void 0),cr([F],e.prototype,"width",null),cr([F],e.prototype,"height",null),e}(Ct),oa=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),fe=function(){return fe=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},fe.apply(this,arguments)},Wt=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},je=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},An=function(n){oa(e,n);function e(t,r){var o=n.call(this,t,r)||this;return o.modelType=j.DIAMOND_NODE,o.rx=30,o.ry=50,o.initNodeData(t),o.setAttributes(),o}return e.prototype.setAttributes=function(){n.prototype.setAttributes.call(this);var t=this.properties,r=t.rx,o=t.ry;r&&(this.rx=r),o&&(this.ry=o)},e.prototype.getNodeStyle=function(){var t=n.prototype.getNodeStyle.call(this),r=this.graphModel.theme.diamond,o=this.properties.style,i=o===void 0?{}:o;return fe(fe(fe({},t),C(r)),C(i))},Object.defineProperty(e.prototype,"points",{get:function(){var t=this,r=t.x,o=t.y,i=t.rx,a=t.ry;return[[r,o-a],[r+i,o],[r,o+a],[r-i,o]]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointsPosition",{get:function(){return St(this.points,function(t){var r=je(t,2),o=r[0],i=r[1];return{x:o,y:i}})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return W(this.points,function(o){var i=je(o,1),a=i[0];a<t&&(t=a),a>r&&(r=a)}),r-t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return W(this.points,function(o){var i=je(o,2),a=i[1];a<t&&(t=a),a>r&&(r=a)}),r-t},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this;return St(this.points,function(r,o){var i=je(r,2),a=i[0],s=i[1];return{x:a,y:s,id:"".concat(t.id,"_").concat(o)}})},e.prototype.resize=function(t){var r=t.width,o=t.height,i=t.deltaX,a=t.deltaY;return this.move(i/2,a/2),this.rx=r,this.ry=o,this.setProperties({rx:r,ry:o}),this.getData()},Wt([E],e.prototype,"rx",void 0),Wt([E],e.prototype,"ry",void 0),Wt([F],e.prototype,"points",null),Wt([F],e.prototype,"pointsPosition",null),Wt([F],e.prototype,"width",null),Wt([F],e.prototype,"height",null),e}(Ct),ia=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ce=function(){return ce=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},ce.apply(this,arguments)},Re=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},Pn=function(n){ia(e,n);function e(t,r){var o=n.call(this,t,r)||this;return o.modelType=j.ELLIPSE_NODE,o.rx=30,o.ry=45,o.initNodeData(t),o.setAttributes(),o}return e.prototype.setAttributes=function(){n.prototype.setAttributes.call(this);var t=this.properties,r=t.rx,o=t.ry;r&&(this.rx=r),o&&(this.ry=o)},e.prototype.getNodeStyle=function(){var t=n.prototype.getNodeStyle.call(this),r=this.graphModel.theme.ellipse,o=this.properties.style,i=o===void 0?{}:o;return ce(ce(ce({},t),C(r)),C(i))},Object.defineProperty(e.prototype,"width",{get:function(){return this.rx*2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.ry*2},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this,r=t.x,o=t.y,i=t.rx,a=t.ry;return[{x:r,y:o-a,id:"".concat(this.id,"_0")},{x:r+i,y:o,id:"".concat(this.id,"_1")},{x:r,y:o+a,id:"".concat(this.id,"_2")},{x:r-i,y:o,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(t){var r=t.width,o=t.height,i=t.deltaX,a=t.deltaY;return this.move(i/2,a/2),this.rx=r,this.ry=o,this.setProperties({rx:r,ry:o}),this.getData()},Re([E],e.prototype,"rx",void 0),Re([E],e.prototype,"ry",void 0),Re([F],e.prototype,"width",null),Re([F],e.prototype,"height",null),e}(Ct),aa=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),pe=function(){return pe=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},pe.apply(this,arguments)},Ie=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},Be=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},Tn=function(n){aa(e,n);function e(t,r){var o=n.call(this,t,r)||this;return o.modelType=j.POLYGON_NODE,o.points=[[50,0],[100,50],[50,100],[0,50]],o.initNodeData(t),o.setAttributes(),o}return e.prototype.setAttributes=function(){n.prototype.setAttributes.call(this);var t=this.properties,r=t.points,o=t.width,i=t.height,a=r||this.points;this.points=ai(a,o,i)},e.prototype.getNodeStyle=function(){var t=n.prototype.getNodeStyle.call(this),r=this.graphModel.theme.polygon,o=this.properties.style,i=o===void 0?{}:o;return pe(pe(pe({},t),C(r)),C(i))},Object.defineProperty(e.prototype,"pointsPosition",{get:function(){var t=this,r=t.x,o=t.y,i=t.width,a=t.height;return this.points.map(function(s){return{x:s[0]+r-i/2,y:s[1]+o-a/2}})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(o){var i=Be(o,1),a=i[0];a<t&&(t=a),a>r&&(r=a)}),r-t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(o){var i=Be(o,2),a=i[1];a<t&&(t=a),a>r&&(r=a)}),r-t},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this,r=this,o=r.x,i=r.y,a=r.width,s=r.height,l=r.points;return l.map(function(d,u){var f=Be(d,2),c=f[0],h=f[1];return{x:o+c-a/2,y:i+h-s/2,id:"".concat(t.id,"_").concat(u)}})},e.prototype.resize=function(t){var r=this,o=t.width,i=t.height,a=t.deltaX,s=t.deltaY;this.move(a/2,s/2);var l=St(this.points,function(d){var u=Be(d,2),f=u[0],c=u[1];return[f*o/r.width,c*i/r.height]});return this.points=l,this.properties.points=l,this.getData()},Ie([E],e.prototype,"points",void 0),Ie([F],e.prototype,"pointsPosition",null),Ie([F],e.prototype,"width",null),Ie([F],e.prototype,"height",null),e}(Ct),sa=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),he=function(){return he=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},he.apply(this,arguments)},la=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},Dn=function(n){sa(e,n);function e(t,r){var o=n.call(this,t,r)||this;return o.modelType=j.RECT_NODE,o.radius=0,o.initNodeData(t),o.setAttributes(),o}return e.prototype.setAttributes=function(){n.prototype.setAttributes.call(this);var t=this.properties,r=t.width,o=t.height,i=t.radius;ht(r)||(this.width=r),ht(o)||(this.height=o),ht(i)||(this.radius=i)},e.prototype.getDefaultAnchor=function(){var t=this,r=t.x,o=t.y,i=t.width,a=t.height;return[{x:r,y:o-a/2,id:"".concat(this.id,"_0")},{x:r+i/2,y:o,id:"".concat(this.id,"_1")},{x:r,y:o+a/2,id:"".concat(this.id,"_2")},{x:r-i/2,y:o,id:"".concat(this.id,"_3")}]},e.prototype.getNodeStyle=function(){var t=n.prototype.getNodeStyle.call(this),r=this.graphModel.theme.rect,o=this.properties.style,i=o===void 0?{}:o;return he(he(he({},t),C(r)),C(i))},la([E],e.prototype,"radius",void 0),e}(Ct),da=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ve=function(){return ve=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},ve.apply(this,arguments)},Nn=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},ua=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},fa=function(n,e,t){if(t||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return n.concat(i||Array.prototype.slice.call(e))},bn=function(n){da(e,n);function e(){var t=n.apply(this,fa([],ua(arguments),!1))||this;return t.modelType=j.TEXT_NODE,t}return e.prototype.getTextStyle=function(){var t=n.prototype.getTextStyle.call(this),r=this.graphModel.theme.text,o=this.properties.textStyle;return ve(ve(ve({},t),C(r)),C(o))},Object.defineProperty(e.prototype,"width",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),r=this.getTextStyle().fontSize,o=gn({rows:t,fontSize:r,rowsLength:t.length}).width;return o},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),r=this.getTextStyle().fontSize,o=gn({rows:t,fontSize:r,rowsLength:t.length}).height;return o},enumerable:!1,configurable:!0}),Nn([F],e.prototype,"width",null),Nn([F],e.prototype,"height",null),e}(Ct),ca=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Cn=function(n){ca(e,n);function e(t,r){var o=n.call(this,t,r)||this;return o.modelType=j.HTML_NODE,o.setAttributes(),o}return e.prototype.setAttributes=function(){n.prototype.setAttributes.call(this);var t=this.properties,r=t.width,o=t.height;r&&(this.width=r),o&&(this.height=o)},e.prototype.getDefaultAnchor=function(){var t=this,r=t.x,o=t.y,i=t.width,a=t.height;return[{x:r,y:o-a/2,id:"".concat(this.id,"_0")},{x:r+i/2,y:o,id:"".concat(this.id,"_1")},{x:r,y:o+a/2,id:"".concat(this.id,"_2")},{x:r-i/2,y:o,id:"".concat(this.id,"_3")}]},e}(Ct),B=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},pa={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotate:!1,allowResize:!1,nodeSelectedOutline:!0,textEdit:!1,nodeTextEdit:!1,edgeTextEdit:!1,textDraggable:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},Xe=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","snapGrid","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustEdgeStart","adjustEdgeEnd","adjustNodePosition","hideAnchors","allowRotate","allowResize","autoExpand","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","textEdit","nodeTextEdit","edgeTextEdit","textDraggable","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","textMode","nodeTextMode","edgeTextMode","nodeTextMultiple","edgeTextMultiple","nodeTextVertical","edgeTextVertical"],ha=function(){function n(e){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopMoveGraph=!1,this.stopScrollGraph=!1,this.snapGrid=!1,this.textMode=st.TEXT,this.textEdit=!0,this.textDraggable=!1,this.nodeTextEdit=!0,this.nodeTextDraggable=!1,this.nodeTextMultiple=!1,this.nodeTextVertical=!1,this.nodeTextMode=st.TEXT,this.edgeTextMode=st.TEXT,this.edgeTextEdit=!0,this.edgeTextDraggable=!1,this.edgeTextMultiple=!1,this.edgeTextVertical=!1,this.hideAnchors=!1,this.allowRotate=!1,this.allowResize=!1,this.hoverOutline=!0,this.nodeSelectedOutline=!0,this.adjustNodePosition=!0,this.autoExpand=!1,this.adjustEdge=!0,this.adjustEdgeMiddle=!1,this.adjustEdgeStartAndEnd=!1,this.adjustEdgeStart=!1,this.adjustEdgeEnd=!1,this.edgeSelectedOutline=!0,this.multipleSelectKey="",k(this,this.computeConfig(e))}return n.prototype.updateEditConfig=function(e){var t=this.computeConfig(e);k(this,t)},n.prototype.computeConfig=function(e){var t=e.isSilentMode,r=e.textDraggable,o=e.textMode,i=e.textEdit,a=e.adjustEdgeStartAndEnd,s={};if(t===!1&&k(s,this.stagedConfig),t===!0&&t!==this.isSilentMode){var l=Kt(pa,Xe);this.stagedConfig=Kt(this,Xe),k(s,l)}Qt(i)||k(s,{nodeTextEdit:i,edgeTextEdit:i}),Qt(r)||k(s,{nodeTextDraggable:r,edgeTextDraggable:r}),o&&k(s,{nodeTextMode:o,edgeTextMode:o}),gr(a)&&k(s,{adjustEdgeStart:a,adjustEdgeEnd:a});var d=Kt(e,Xe);return k(s,d)},n.prototype.updateTextMode=function(e){this.textMode=e,this.edgeTextMode=e,this.nodeTextMode=e},n.prototype.getConfig=function(){return Kt(this,Xe)},B([E],n.prototype,"isSilentMode",void 0),B([E],n.prototype,"stopZoomGraph",void 0),B([E],n.prototype,"stopMoveGraph",void 0),B([E],n.prototype,"stopScrollGraph",void 0),B([E],n.prototype,"snapGrid",void 0),B([E],n.prototype,"textMode",void 0),B([E],n.prototype,"textEdit",void 0),B([E],n.prototype,"textDraggable",void 0),B([E],n.prototype,"nodeTextEdit",void 0),B([E],n.prototype,"nodeTextDraggable",void 0),B([E],n.prototype,"nodeTextMultiple",void 0),B([E],n.prototype,"nodeTextVertical",void 0),B([E],n.prototype,"nodeTextMode",void 0),B([E],n.prototype,"edgeTextMode",void 0),B([E],n.prototype,"edgeTextEdit",void 0),B([E],n.prototype,"edgeTextDraggable",void 0),B([E],n.prototype,"edgeTextMultiple",void 0),B([E],n.prototype,"edgeTextVertical",void 0),B([E],n.prototype,"hideAnchors",void 0),B([E],n.prototype,"allowRotate",void 0),B([E],n.prototype,"allowResize",void 0),B([E],n.prototype,"hoverOutline",void 0),B([E],n.prototype,"nodeSelectedOutline",void 0),B([E],n.prototype,"adjustNodePosition",void 0),B([E],n.prototype,"autoExpand",void 0),B([E],n.prototype,"adjustEdge",void 0),B([E],n.prototype,"adjustEdgeMiddle",void 0),B([E],n.prototype,"adjustEdgeStartAndEnd",void 0),B([E],n.prototype,"adjustEdgeStart",void 0),B([E],n.prototype,"adjustEdgeEnd",void 0),B([E],n.prototype,"edgeSelectedOutline",void 0),B([m],n.prototype,"updateEditConfig",null),B([m],n.prototype,"updateTextMode",null),n}(),va="*",ya=function(){function n(){this._events={}}return n.prototype.on=function(e,t,r){var o=this;e==null||e.split(",").forEach(function(i){i=i.trim(),o._events[i]||(o._events[i]=[]),o._events[i].push({callback:t,once:!!r})})},n.prototype.once=function(e,t){var r=this;e==null||e.split(",").forEach(function(o){o=o.trim(),r.on(o,t,!0)})},n.prototype.emit=function(e,t){var r=this;e==null||e.split(",").forEach(function(o){var i=r._events[o]||[],a=r._events[va]||[],s=function(l){for(var d=l.length,u=0;u<d;u++)if(l[u]){var f=l[u],c=f.callback,h=f.once;h&&(l.splice(u,1),l.length===0&&delete r._events[o],d--,u--),c.apply(r,[t])}};s(i),s(a)})},n.prototype.off=function(e,t){var r=this;e||(this._events={}),e.split(",").forEach(function(o){if(!t)delete r._events[o];else{for(var i=r._events[o]||[],a=i.length,s=0;s<a;s++)i[s].callback===t&&(i.splice(s,1),a--,s--);i.length===0&&delete r._events[o]}})},n.prototype.getEvents=function(){return this._events},n.prototype.destroy=function(){this._events={}},n}(),ga=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Nr=function(){return Nr=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Nr.apply(this,arguments)},_a=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},ma=function(n){ga(e,n);function e(t){var r=n.call(this)||this;r.stepScrollX=0,r.stepScrollY=0,r.onDragging=function(s){var l=s.deltaX,d=s.deltaY;r.setState({isDragging:!0});var u=r.props.graphModel,f=u.transformModel,c=u.editConfigModel;c.stopMoveGraph!==!0&&f.translate(l,d)},r.onDragEnd=function(){r.setState({isDragging:!1})},r.zoomHandler=function(s){var l=r.props,d=l.graphModel,u=d.editConfigModel,f=d.transformModel,c=d.gridSize,h=l.graphModel,y=s.deltaX,p=s.deltaY,g=u.stopScrollGraph,v=u.stopZoomGraph;if(!g&&!s.ctrlKey&&!s.metaKey){if(s.preventDefault(),r.stepScrollX+=y,r.stepScrollY+=p,Math.abs(r.stepScrollX)>=c){var _=r.stepScrollX%c,M=r.stepScrollX-_;f.translate(-M*f.SCALE_X,0),r.stepScrollX=_}if(Math.abs(r.stepScrollY)>=c){var S=r.stepScrollY%c,O=r.stepScrollY-S;f.translate(0,-O*f.SCALE_Y),r.stepScrollY=S}return}if(!v){s.preventDefault();var w=h.getPointByClient({x:s.clientX,y:s.clientY}),A=w.canvasOverlayPosition,b=A.x,R=A.y;f.zoom(s.deltaY<0,[b,R])}},r.clickHandler=function(s){var l=s.target;if(l.getAttribute("name")==="canvas-overlay"){var d=r.props.graphModel,u=d.selectElements;u.size>0&&d.clearSelectElements(),d.eventCenter.emit(T.BLANK_CLICK,{e:s})}},r.handleContextMenu=function(s){var l=s.target;if(l.getAttribute("name")==="canvas-overlay"){s.preventDefault();var d=r.props.graphModel,u=d.getPointByClient({x:s.clientX,y:s.clientY});d.eventCenter.emit(T.BLANK_CONTEXTMENU,{e:s,position:u})}},r.mouseDownHandler=function(s){var l=r.props.graphModel,d=l.eventCenter,u=l.editConfigModel,f=l.transformModel.SCALE_X,c=l.gridSize,h=u.adjustEdge,y=u.adjustNodePosition,p=u.stopMoveGraph,g=s.target,v=!h&&!y;(g.getAttribute("name")==="canvas-overlay"||v)&&(p!==!0?(r.stepDrag.setStep(c*f),r.stepDrag.handleMouseDown(s)):d.emit(T.BLANK_MOUSEDOWN,{e:s}),r.clickHandler(s))};var o=t.graphModel,i=o.gridSize,a=o.eventCenter;return r.stepDrag=new Mt({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:i,eventType:"BLANK",isStopPropagation:!1,eventCenter:a,model:void 0}),r.state={isDragging:!1},r}return e.prototype.render=function(){var t=this.props.graphModel.transformModel,r=t.getTransformStyle().transform,o=this.props,i=o.children,a=o.dnd,s=this.state.isDragging;return x("svg",Nr({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:s?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},a.eventMap(),{children:x("g",{transform:r,children:i})}))},e=_a([ot],e),e}(K),fo=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),we=function(){return we=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},we.apply(this,arguments)},xa=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},Ea=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},Ln=function(n){fo(e,n);function e(){var t=n.call(this)||this;return t.onDragging=function(r){var o=r.event,i=t.props,a=i.graphModel,s=i.bezierModel,l=i.type,d=a.getPointByClient({x:o.clientX,y:o.clientY}).canvasOverlayPosition,u=d.x,f=d.y;s.updateAdjustAnchor({x:u,y:f},l),a.eventCenter.emit(T.EDGE_ADJUST,{data:s.getData()})},t.onDragEnd=function(){var r=t.props.bezierModel;r.isDragging=!1},t.dragHandler=new Mt({onDragging:t.onDragging,onDragEnd:t.onDragEnd}),t}return e.prototype.render=function(){var t=this,r=this.props.position,o=r.x,i=r.y,a=this.props.bezierModel,s=a.getEdgeStyle().adjustAnchor;return x(re,we({className:"lf-bezier-adjust-anchor",x:o,y:i},s,{onMouseDown:function(l){t.dragHandler.handleMouseDown(l)}}))},e}(K),Ma=function(n){fo(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getBezierAdjust=function(t,r){var o=t.path,i=t.id,a=$r(o),s=Ea(a,4),l=s[0],d=s[1],u=s[2],f=s[3],c=t.getEdgeStyle().adjustLine,h=[];return h.push(x(ee,we({x1:l.x,y1:l.y,x2:d.x,y2:d.y},c))),h.push(x(Ln,{position:d,bezierModel:t,graphModel:r,type:"sNext"},"".concat(i,"_ePre"))),h.push(x(ee,we({x1:f.x,y1:f.y,x2:u.x,y2:u.y},c))),h.push(x(Ln,{position:u,bezierModel:t,graphModel:r,type:"ePre"},"".concat(i,"_sNext"))),h},e.prototype.selectedBezierEdge=function(){for(var t=this.props.graphModel,r=t.edges,o=[],i=0;i<r.length;i++){var a=r[i];a.isSelected&&a.modelType===j.BEZIER_EDGE&&a.draggable&&o.push(this.getBezierAdjust(a,t))}return o},e.prototype.render=function(){return x("g",{className:"lf-bezier-adjust",children:this.selectedBezierEdge()})},e=xa([ot],e),e}(K),Oa=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Sa=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},wa=function(n){Oa(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(){var t=this.props.background;return x("div",{className:"lf-background",children:x("div",{style:mo(t)?t:{},className:"lf-background-area"})})},e=Sa([ot],e),e}(K),Aa=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Pa=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},qe=function(n){Aa(e,n);function e(t){var r=n.call(this,t)||this;return r.id=Yt(),r.gridOptions=r.props.graphModel.grid,r}return e.prototype.renderDot=function(){var t=this.gridOptions,r=t.config,o=t.size,i=o===void 0?1:o,a=t.visible,s=r??{},l=s.color,d=s.thickness,u=d===void 0?2:d,f=Math.min(Math.max(2,u),i/4),c=a?1:0;return x("g",{fill:l,opacity:c,children:[x("circle",{cx:0,cy:0,r:f/2}),x("circle",{cx:0,cy:i,r:f/2}),x("circle",{cx:i,cy:0,r:f/2}),x("circle",{cx:i,cy:i,r:f/2})]})},e.prototype.renderMesh=function(){var t=this.gridOptions,r=t.config,o=t.size,i=o===void 0?1:o,a=t.visible,s=r??{},l=s.color,d=s.thickness,u=d===void 0?1:d,f=Math.min(Math.max(1,u),i/2),c="M 0 0 H ".concat(i," V ").concat(i," H 0 Z"),h=a?1:0;return x("path",{d:c,stroke:l,strokeWidth:f/2,opacity:h,fill:"transparent"})},e.prototype.render=function(){var t=this.props.graphModel.transformModel,r=this.gridOptions,o=r.type,i=r.size,a=i===void 0?1:i,s=t.SCALE_X,l=t.SKEW_Y,d=t.SKEW_X,u=t.SCALE_Y,f=t.TRANSLATE_X,c=t.TRANSLATE_Y,h=[s,l,d,u,f,c].join(","),y="matrix(".concat(h,")");return x("div",{className:"lf-grid",children:x("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",children:[x("defs",{children:x("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:y,x:"0",y:"0",width:a,height:a,children:[o==="dot"&&this.renderDot(),o==="mesh"&&this.renderMesh()]})}),x("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})]})})},e=Pa([ot],e),e}(K);(function(n){n.defaultProps={size:Bo,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}};function e(t){var r=C(n.defaultProps);return typeof t=="number"?k(r,{size:t}):typeof t=="boolean"?k(r,{visible:t}):k(r,t)}n.getGridOptions=e})(qe||(qe={}));var Ta=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Da=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},Na=function(n){Ta(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(){var t=this.props.graphModel.transformModel,r=t.getTransformStyle().transform,o=this.props.children;return x("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay",children:x("g",{transform:r,children:o})})},e=Da([ot],e),e}(K),ba=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),wt=function(){return wt=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},wt.apply(this,arguments)},Ca=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},La=function(n){ba(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getNodesOutline=function(){var t=this.props.graphModel,r=t.nodes,o=t.editConfigModel,i=o.hoverOutline,a=o.nodeSelectedOutline,s=[];return r.forEach(function(l){if(l.isHovered||l.isSelected){var d=l.isHovered,u=l.isSelected,f=l.x,c=l.y,h=l.width,y=l.height;if(a&&u||i&&d){var p=l.getOutlineStyle(),g={};if(Object.keys(p).forEach(function(_){_!=="hover"&&(g[_]=p[_])}),d){var v=p.hover;g=wt(wt({},g),v)}s.push(x(Et,wt({transform:l.transform,className:"lf-outline-node",x:f,y:c,width:h+10,height:y+10},g)))}}}),s},e.prototype.getEdgeOutline=function(){for(var t=this.props.graphModel,r=t.edges,o=t.editConfigModel,i=o.edgeSelectedOutline,a=o.hoverOutline,s=[],l=0;l<r.length;l++){var d=r[l];(i&&d.isSelected||a&&d.isHovered)&&(d.modelType===j.LINE_EDGE?s.push(this.getLineOutline(d)):d.modelType===j.POLYLINE_EDGE?s.push(this.getPolylineOutline(d)):d.modelType===j.BEZIER_EDGE&&s.push(this.getBezierOutline(d)))}return s},e.prototype.getLineOutline=function(t){var r=t.startPoint,o=t.endPoint,i=(r.x+o.x)/2,a=(r.y+o.y)/2,s=Math.abs(r.x-o.x)+10,l=Math.abs(r.y-o.y)+10,d=t.getOutlineStyle();return x(Et,wt({className:"lf-outline-edge",x:i,y:a,width:s,height:l},d))},e.prototype.getPolylineOutline=function(t){var r=t.points,o=kt(r),i=Ee(o,8),a=i.x,s=i.y,l=i.width,d=i.height,u=t.getOutlineStyle();return x(Et,wt({className:"lf-outline",x:a,y:s,width:l,height:d},u))},e.prototype.getBezierOutline=function(t){var r=t.path,o=$r(r),i=Ee(o,8),a=i.x,s=i.y,l=i.width,d=i.height,u=t.getOutlineStyle();return x(Et,wt({className:"lf-outline",x:a,y:s,width:l,height:d},u))},e.prototype.render=function(){return x("g",{className:"lf-outline",children:[this.getNodesOutline(),this.getEdgeOutline()]})},e=Ca([ot],e),e}(K),ja=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),At=function(){return At=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},At.apply(this,arguments)},Ra=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},Ia=function(n){ja(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(){var t=this.props.snaplineModel,r=t??{},o=r.position,i=r.isShowHorizontal,a=r.isShowVertical,s=t==null?void 0:t.getStyle(),l=o??{},d=l.x,u=d===void 0?0:d,f=l.y,c=f===void 0?0:f,h=At(At({x1:-1e5,y1:c,x2:1e5,y2:c},s),{stroke:i?s==null?void 0:s.stroke:"none"}),y=At(At({x1:u,y1:-1e5,x2:u,y2:1e5},s),{stroke:a?s==null?void 0:s.stroke:"none"});return x("g",{className:"lf-snapline",children:[x(ee,At({},h)),x(ee,At({},y))]})},e=Ra([ot],e),e}(K),Ba=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Xa=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},Ya=function(n){Ba(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.componentDidMount=function(){this.triggerToolRender()},e.prototype.componentDidUpdate=function(){this.triggerToolRender()},e.prototype.getTools=function(){var t=this.props,r=t.tool,o=t.graphModel,i=o.textEditElement,a=r.getTools(),s=a.map(function(l){return Wn(l,{textEditElement:i,graphModel:o,lf:r.instance})});return r.components=s,s},e.prototype.triggerToolRender=function(){var t=this.props,r=t.tool,o=t.graphModel,i=document.querySelector("#ToolOverlay_".concat(o.flowId)),a=r.getInstance();a.components.forEach(function(s){return s(a,i)}),a.components=[]},e.prototype.render=function(){var t=this.props.graphModel;return x("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(t.flowId),children:this.getTools()})},e=Xa([ot],e),e}(K),Pt=function(){return Pt=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Pt.apply(this,arguments)},P=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},Ha=function(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},J=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},it=function(n,e,t){if(t||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return n.concat(i||Array.prototype.slice.call(e))},ka=function(){function n(e){var t=this,r,o;this.modelMap=new Map,this.nodeModelMap=new Map,this.edgeModelMap=new Map,this.elementsModelMap=new Map,this.nodeMoveRules=[],this.nodeResizeRules=[],this.nodes=[],this.edges=[],this.overlapMode=pt.DEFAULT,this.gridSize=1,this.partial=!1,this.waitCleanEffects=[];var i=e.container,a=e.partial,s=e.background,l=s===void 0?{}:s,d=e.grid,u=e.idGenerator,f=e.edgeGenerator,c=e.animation,h=e.customTrajectory;this.rootEl=i,this.partial=!!a,this.background=l,typeof d=="object"&&e.snapGrid&&(this.gridSize=d.size||1),this.theme=uo(e.style),this.grid=qe.getGridOptions(d??!1),this.edgeType=e.edgeType||"polyline",this.animation=jo(c),this.overlapMode=e.overlapMode||pt.DEFAULT,this.width=(r=e.width)!==null&&r!==void 0?r:this.rootEl.getBoundingClientRect().width,this.isContainerWidth=ht(e.width),this.height=(o=e.height)!==null&&o!==void 0?o:this.rootEl.getBoundingClientRect().height,this.isContainerHeight=ht(e.height);var y=new ResizeObserver(Vn(function(p){var g,v;try{for(var _=Ha(p),M=_.next();!M.done;M=_.next()){var S=M.value;S.target===t.rootEl&&(t.resize(),t.eventCenter.emit("graph:resize",{target:t.rootEl,contentRect:S.contentRect}))}}catch(O){g={error:O}}finally{try{M&&!M.done&&(v=_.return)&&v.call(_)}finally{if(g)throw g.error}}},16));y.observe(this.rootEl),this.waitCleanEffects.push(function(){y.disconnect()}),this.eventCenter=new ya,this.editConfigModel=new ha(e),this.transformModel=new Fa(this.eventCenter,e),this.flowId=Yt(),this.idGenerator=u,this.edgeGenerator=oi(this,f),this.customTrajectory=h}return Object.defineProperty(n.prototype,"nodesMap",{get:function(){return this.nodes.reduce(function(e,t,r){return e[t.id]={index:r,model:t},e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"edgesMap",{get:function(){return this.edges.reduce(function(e,t,r){return e[t.id]={index:r,model:t},e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"modelsMap",{get:function(){return it(it([],J(this.nodes),!1),J(this.edges),!1).reduce(function(e,t){return e[t.id]=t,e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sortElements",{get:function(){for(var e=it(it([],J(this.nodes),!1),J(this.edges),!1).sort(function(s,l){return s.zIndex-l.zIndex}),t=[],r=[-200,-200],o=[this.width+Jr,this.height+Jr],i=0;i<e.length;i++){var a=e[i];a.visible&&(!this.partial||a.isSelected||this.isElementInArea(a,r,o,!1,!1))&&t.push(a)}return t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"textEditElement",{get:function(){var e=this.nodes.find(function(r){return r.state===X.TEXT_EDIT}),t=this.edges.find(function(r){return r.state===X.TEXT_EDIT});return e||t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selectElements",{get:function(){var e=new Map;return this.nodes.forEach(function(t){t.isSelected&&e.set(t.id,t)}),this.edges.forEach(function(t){t.isSelected&&e.set(t.id,t)}),e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selectNodes",{get:function(){var e=[];return this.nodes.forEach(function(t){t.isSelected&&e.push(t)}),e},enumerable:!1,configurable:!0}),n.prototype.getAreaElement=function(e,t,r,o,i){var a=this;r===void 0&&(r=!0),o===void 0&&(o=!0),i===void 0&&(i=!1);var s=[];return W(it(it([],J(this.nodes),!1),J(this.edges),!1),function(l){var d=a.isElementInArea(l,e,t,r,o);(!i||l.visible)&&d&&s.push(l)}),s},n.prototype.getModel=function(e){return this.modelMap.get(e)},n.prototype.getNodeModelById=function(e){var t;return this.fakeNode&&e===this.fakeNode.id?this.fakeNode:(t=this.nodesMap[e])===null||t===void 0?void 0:t.model},n.prototype.getPointByClient=function(e){var t=e.x,r=e.y,o=this.rootEl.getBoundingClientRect(),i={x:t-o.left,y:r-o.top},a=J(this.transformModel.HtmlPointToCanvasPoint([i.x,i.y]),2),s=a[0],l=a[1],d={x:s,y:l};return{domOverlayPosition:i,canvasOverlayPosition:d}},n.prototype.isElementInArea=function(e,t,r,o,i){var a;if(o===void 0&&(o=!0),i===void 0&&(i=!0),e.BaseType===$.NODE){e=e;for(var s=rt(e),l=s.minX,d=s.minY,u=s.maxX,f=s.maxY,c=[{x:l,y:d},{x:u,y:d},{x:u,y:f},{x:l,y:f}],h=i,y=0;y<c.length;y++){var p=c[y],g=p.x,v=p.y;if(a=J(this.transformModel.CanvasPointToHtmlPoint([g,v]),2),g=a[0],v=a[1],dr([g,v],t,r)!==i){h=!i;break}}return h}if(e.BaseType===$.EDGE){e=e;var _=e.startPoint,M=e.endPoint,S=this.transformModel.CanvasPointToHtmlPoint([_.x,_.y]),O=this.transformModel.CanvasPointToHtmlPoint([M.x,M.y]),w=dr(S,t,r),A=dr(O,t,r);return o?w&&A:w||A}return!1},n.prototype.graphDataToModel=function(e){var t=this;if(!e){this.clearData();return}if(this.elementsModelMap.clear(),this.nodeModelMap.clear(),this.edgeModelMap.clear(),e.nodes?this.nodes=St(e.nodes,function(o){var i=t.getModelAfterSnapToGrid(o);return t.elementsModelMap.set(i.id,i),t.nodeModelMap.set(i.id,i),i}):this.nodes=[],e.edges){var r=this.edgeType;this.edges=St(e.edges,function(o){var i,a=t.getModel((i=o.type)!==null&&i!==void 0?i:r);if(!a)throw new Error("找不到".concat(o.type,"对应的边。"));var s=new a(o,t);return t.edgeModelMap.set(s.id,s),t.elementsModelMap.set(s.id,s),s})}else this.edges=[]},n.prototype.modelToGraphData=function(){var e=[];this.edges.forEach(function(r){var o=r.getData();o&&!r.virtual&&e.push(o)});var t=[];return this.nodes.forEach(function(r){var o=r.getData();o&&!r.virtual&&t.push(o)}),{nodes:t,edges:e}},n.prototype.modelToHistoryData=function(){for(var e=!1,t=[],r=0;r<this.nodes.length;r++){var o=this.nodes[r];if(o.isDragging){e=!0;break}else t.push(o.getHistoryData())}if(e)return!1;for(var i=!1,a=[],s=0;s<this.edges.length;s++){var l=this.edges[s];if(l.isDragging){i=!0;break}else a.push(l.getHistoryData())}return i?!1:{nodes:t,edges:a}},n.prototype.getEdgeModelById=function(e){var t;return(t=this.edgesMap[e])===null||t===void 0?void 0:t.model},n.prototype.getElement=function(e){return this.modelsMap[e]},n.prototype.getNodeEdges=function(e){for(var t=[],r=0;r<this.edges.length;r++){var o=this.edges[r],i=o.sourceNodeId===e,a=o.targetNodeId===e;(i||a)&&t.push(o)}return t},n.prototype.getSelectElements=function(e){e===void 0&&(e=!0);var t=this.selectElements,r={nodes:[],edges:[]};return t.forEach(function(o){if(o.BaseType===$.NODE&&r.nodes.push(o.getData()),o.BaseType===$.EDGE){var i=o.getData(),a=t.get(i.sourceNodeId)&&t.get(i.targetNodeId);(e||a)&&r.edges.push(i)}}),r},n.prototype.updateAttributes=function(e,t){var r=this.getElement(e);r==null||r.updateAttributes(t)},n.prototype.changeNodeId=function(e,t){return t||(t=Yt()),this.nodesMap[t]?(console.warn("当前流程图已存在节点".concat(t,", 修改失败")),""):this.nodesMap[e]?(this.edges.forEach(function(r){r.sourceNodeId===e&&(r.sourceNodeId=t),r.targetNodeId===e&&(r.targetNodeId=t)}),this.nodesMap[e].model.id=t,this.nodesMap[t]=this.nodesMap[e],t):(console.warn("当前流程图找不到节点".concat(e,", 修改失败")),"")},n.prototype.changeEdgeId=function(e,t){return t||(t=Yt()),this.edgesMap[t]?(console.warn("当前流程图已存在边: ".concat(t,", 修改失败")),""):this.edgesMap[e]?(this.edges.forEach(function(r){r.id===e&&r.changeEdgeId(t)}),t):(console.warn("当前流程图找不到边: ".concat(t,", 修改失败")),"")},n.prototype.getTextModel=function(e){var t=this.editConfigModel,r=t.textMode,o=t.nodeTextMode,i=t.edgeTextMode;if(e.BaseType===$.NODE)return e.textMode||o||r||st.TEXT;if(e.BaseType===$.EDGE)return e.textMode||i||r||st.TEXT},n.prototype.setTextMode=function(e,t){this.editConfigModel.updateEditConfig({textMode:e})},n.prototype.setFakeNode=function(e){this.fakeNode=e},n.prototype.removeFakeNode=function(){this.fakeNode=null},n.prototype.setModel=function(e,t){return this.modelMap.set(e,t)},n.prototype.toFront=function(e){var t,r,o,i=((t=this.nodesMap[e])===null||t===void 0?void 0:t.model)||((r=this.edgesMap[e])===null||r===void 0?void 0:r.model);i&&(this.overlapMode===pt.DEFAULT&&((o=this.topElement)===null||o===void 0||o.setZIndex(),i.setZIndex(Io),this.topElement=i),this.overlapMode===pt.INCREASE&&this.setElementZIndex(e,"top"))},n.prototype.setElementZIndex=function(e,t){var r,o,i=((r=this.nodesMap[e])===null||r===void 0?void 0:r.model)||((o=this.edgesMap[e])===null||o===void 0?void 0:o.model);if(i){var a=void 0;typeof t=="number"?a=t:(t==="top"&&(a=Wr()),t==="bottom"&&(a=Ki())),i.setZIndex(a)}},n.prototype.deleteNode=function(e){var t=this.nodesMap[e].model,r=t.getData();this.deleteEdgeBySource(e),this.deleteEdgeByTarget(e),this.nodes.splice(this.nodesMap[e].index,1),this.eventCenter.emit(T.NODE_DELETE,{data:r,model:t})},n.prototype.addNode=function(e,t,r){t===void 0&&(t=T.NODE_ADD);var o=et(e),i=o.id;i&&this.nodesMap[i]&&delete o.id;var a=this.getModelAfterSnapToGrid(o);this.nodes.push(a);var s=a.getData(),l={data:s};return r&&(l.e=r),this.eventCenter.emit(t,l),a},n.prototype.getModelAfterSnapToGrid=function(e){var t=this.getModel(e.type),r=this.editConfigModel.snapGrid;if(!t)throw new Error("找不到".concat(e.type,"对应的节点,请确认是否已注册此类型节点。"));var o=e.x,i=e.y;o&&i&&(e.x=te(o,this.gridSize,r),e.y=te(i,this.gridSize,r),typeof e.text=="object"&&e.text!==null&&(e.text.x+=e.x-o,e.text.y+=e.y-i));var a=new t(e,this);return this.nodeModelMap.set(a.id,a),this.elementsModelMap.set(a.id,a),a},n.prototype.cloneNode=function(e){var t=this.getNodeModelById(e),r=t==null?void 0:t.getData();if(r){r.x+=30,r.y+=30,r.id="",typeof r.text=="object"&&r.text!==null&&(r.text.x+=30,r.text.y+=30);var o=this.addNode(r);return o.setSelected(!0),t==null||t.setSelected(!1),o.getData()}},n.prototype.moveNode=function(e,t,r,o){var i;o===void 0&&(o=!1);var a=this.nodesMap[e];if(!a){console.warn("不存在id为".concat(e,"的节点"));return}var s=a.model;i=J(s.getMoveDistance(t,r,o),2),t=i[0],r=i[1],this.moveEdge(e,t,r)},n.prototype.moveNode2Coordinate=function(e,t,r,o){o===void 0&&(o=!1);var i=this.nodesMap[e];if(!i){console.warn("不存在id为".concat(e,"的节点"));return}var a=i.model,s=a.x,l=a.y,d=t-s,u=r-l;this.moveNode(e,d,u,o)},n.prototype.editText=function(e){this.setElementStateById(e,X.TEXT_EDIT)},n.prototype.addEdge=function(e){var t=et(e),r=t.type;r||(r=this.edgeType),t.id&&this.edgesMap[t.id]&&delete t.id;var o=this.getModel(r);if(!o)throw new Error("找不到".concat(r,"对应的边,请确认是否已注册此类型边。"));var i=new o(Pt(Pt({},t),{type:r}),this);this.edgeModelMap.set(i.id,i),this.elementsModelMap.set(i.id,i);var a=i.getData();return this.edges.push(i),this.eventCenter.emit(T.EDGE_ADD,{data:a}),i},n.prototype.moveEdge=function(e,t,r){for(var o=0;o<this.edges.length;o++){var i=this.edges[o],a=i.textPosition,s=a.x,l=a.y,d=this.edges[o].sourceNodeId===e,u=this.edges[o].targetNodeId===e;d&&i.moveStartPoint(t,r),u&&i.moveEndPoint(t,r),(d||u)&&this.handleEdgeTextMove(i,s,l)}},n.prototype.handleEdgeTextMove=function(e,t,r){var o;if(e.customTextPosition){e.resetTextPosition();return}if(e.modelType===j.POLYLINE_EDGE&&(!((o=e.text)===null||o===void 0)&&o.value)){var i=e.text,a=eo(i,e.points);e.moveText(a.x-i.x,a.y-i.y)}var s=e.textPosition,l=s.x,d=s.y;e.moveText(l-t,d-r)},n.prototype.deleteEdgeBySourceAndTarget=function(e,t){for(var r=0;r<this.edges.length;r++)if(this.edges[r].sourceNodeId===e&&this.edges[r].targetNodeId===t){var o=this.edges[r].getData();this.edges.splice(r,1),r--,this.eventCenter.emit(T.EDGE_DELETE,{data:o})}},n.prototype.deleteEdgeById=function(e){var t=this.edgesMap[e];if(t){var r=this.edgesMap[e].index,o=this.edgesMap[e].model.getData();this.edges.splice(r,1),this.eventCenter.emit(T.EDGE_DELETE,{data:o})}},n.prototype.deleteEdgeBySource=function(e){for(var t=0;t<this.edges.length;t++)if(this.edges[t].sourceNodeId===e){var r=this.edges[t].getData();this.edges.splice(t,1),t--,this.eventCenter.emit(T.EDGE_DELETE,{data:r})}},n.prototype.deleteEdgeByTarget=function(e){for(var t=0;t<this.edges.length;t++)if(this.edges[t].targetNodeId===e){var r=this.edges[t].getData();this.edges.splice(t,1),t--,this.eventCenter.emit(T.EDGE_DELETE,{data:r})}},n.prototype.setElementStateById=function(e,t,r){this.nodes.forEach(function(o){o.id===e?o.setElementState(t,r):o.setElementState(X.DEFAULT)}),this.edges.forEach(function(o){o.id===e?o.setElementState(t,r):o.setElementState(X.DEFAULT)})},n.prototype.updateText=function(e,t){var r=Ht(it(it([],J(this.nodes),!1),J(this.edges),!1),function(o){return o.id===e});r==null||r.updateText(t)},n.prototype.selectNodeById=function(e,t){var r;t===void 0&&(t=!1),t||this.clearSelectElements();var o=(r=this.nodesMap[e])===null||r===void 0?void 0:r.model;o==null||o.setSelected(!0)},n.prototype.selectEdgeById=function(e,t){var r;t===void 0&&(t=!1),t||this.clearSelectElements();var o=(r=this.edgesMap[e])===null||r===void 0?void 0:r.model;o==null||o.setSelected(!0)},n.prototype.selectElementById=function(e,t){t===void 0&&(t=!1),t||this.clearSelectElements();var r=this.getElement(e);r==null||r.setSelected(!0)},n.prototype.clearSelectElements=function(){var e;this.selectElements.forEach(function(t){t==null||t.setSelected(!1)}),this.selectElements.clear(),this.overlapMode===pt.DEFAULT&&((e=this.topElement)===null||e===void 0||e.setZIndex())},n.prototype.moveNodes=function(e,t,r,o){var i,a,s,l=this;o===void 0&&(o=!1);for(var d=e.reduce(function(M,S){var O,w=(O=l.nodesMap[S])===null||O===void 0?void 0:O.model;return w&&(M[S]=w.getMoveDistance(t,r,o)),M},{}),u=0;u<this.edges.length;u++){var f=this.edges[u],c=f.textPosition,h=c.x,y=c.y,p=d[f.sourceNodeId],g=d[f.targetNodeId],v=void 0,_=void 0;p&&g&&f.modelType===j.POLYLINE_EDGE?(i=J(p,2),v=i[0],_=i[1],f.updatePointsList(v,_)):(p&&(a=J(p,2),v=a[0],_=a[1],f.moveStartPoint(v,_)),g&&(s=J(g,2),v=s[0],_=s[1],f.moveEndPoint(v,_))),(p||g)&&this.handleEdgeTextMove(f,h,y)}},n.prototype.addNodeMoveRules=function(e){this.nodeMoveRules.includes(e)||this.nodeMoveRules.push(e)},n.prototype.addNodeResizeRules=function(e){this.nodeResizeRules.includes(e)||this.nodeResizeRules.push(e)},n.prototype.setDefaultEdgeType=function(e){this.edgeType=e},n.prototype.changeNodeType=function(e,t){var r=this.getNodeModelById(e);if(!r){console.warn("找不到id为".concat(e,"的节点"));return}var o=r.getData();o.type=t;var i=this.getModel(t);if(!i)throw new Error("找不到".concat(t,"对应的节点,请确认是否已注册此类型节点。"));var a=new i(o,this);this.nodes.splice(this.nodesMap[e].index,1,a);var s=this.getNodeEdges(e);s.forEach(function(l){if(l.sourceNodeId===e){var d=yn(a,l.startPoint,a.width,a.height);l.updateStartPoint(d)}if(l.targetNodeId===e){var d=yn(a,l.endPoint,a.width,a.height);l.updateEndPoint(d)}})},n.prototype.changeEdgeType=function(e,t){var r=this.getEdgeModelById(e);if(!r){console.warn("找不到id为".concat(e,"的边"));return}if(r.type!==t){var o=r.getData();o.type=t;var i=this.getModel(t);if(!i)throw new Error("找不到".concat(t,"对应的节点,请确认是否已注册此类型节点。"));delete o.pointsList;var a=new i(o,this);this.edges.splice(this.edgesMap[e].index,1,a)}},n.prototype.getNodeIncomingEdge=function(e){var t=[];return this.edges.forEach(function(r){r.targetNodeId===e&&t.push(r)}),t},n.prototype.getNodeOutgoingEdge=function(e){var t=[];return this.edges.forEach(function(r){r.sourceNodeId===e&&t.push(r)}),t},n.prototype.getAnchorIncomingEdge=function(e){var t=[];return this.edges.forEach(function(r){r.targetAnchorId===e&&t.push(r)}),t},n.prototype.getAnchorOutgoingEdge=function(e){var t=[];return this.edges.forEach(function(r){r.sourceAnchorId===e&&t.push(r)}),t},n.prototype.getNodeIncomingNode=function(e){var t=this,r=[];return this.edges.forEach(function(o){var i;o.targetNodeId===e&&r.push((i=t.nodesMap[o.sourceNodeId])===null||i===void 0?void 0:i.model)}),r},n.prototype.getNodeOutgoingNode=function(e){var t=this,r=[];return this.edges.forEach(function(o){o.sourceNodeId===e&&r.push(t.nodesMap[o.targetNodeId].model)}),r},n.prototype.setTheme=function(e){this.theme=Wi(Pt(Pt({},this.theme),e))},n.prototype.updateGridOptions=function(e){Fr(this.grid,e)},n.prototype.updateGridSize=function(e){this.gridSize=e},n.prototype.updateBackgroundOptions=function(e){gr(e)||gr(this.background)?this.background=e:this.background=Pt(Pt({},this.background),e)},n.prototype.resize=function(e,t){this.width=e??this.rootEl.getBoundingClientRect().width,this.isContainerWidth=ht(e),this.height=t??this.rootEl.getBoundingClientRect().height,this.isContainerHeight=ht(t),(!this.width||!this.height)&&console.warn("渲染画布的时候无法获取画布宽高,请确认在container已挂载到DOM。@see https://github.com/didi/LogicFlow/issues/675")},n.prototype.clearData=function(){this.nodes=[],this.edges=[],this.edgeModelMap.clear(),this.nodeModelMap.clear(),this.elementsModelMap.clear()},n.prototype.getVirtualRectSize=function(){var e=this.nodes,t=[],r=[];e.forEach(function(c){var h=c.x,y=c.y,p=c.width,g=c.height,v=c.getNodeStyle().strokeWidth,_=v===void 0?0:v,M=h+p/2+_,S=h-p/2-_,O=y+g/2+_,w=y-g/2-_;t=t.concat([M,S].filter(function(A){return!Number.isNaN(A)})),r=r.concat([O,w].filter(function(A){return!Number.isNaN(A)}))});var o=Math.min.apply(Math,it([],J(t),!1)),i=Math.max.apply(Math,it([],J(t),!1)),a=Math.min.apply(Math,it([],J(r),!1)),s=Math.max.apply(Math,it([],J(r),!1)),l=i-o||0,d=s-a||0,u=o+l/2,f=a+d/2;return{width:l,height:d,x:u,y:f}},n.prototype.translateCenter=function(){var e=this,t=e.nodes,r=e.width,o=e.height,i=e.rootEl,a=e.transformModel;if(t.length){var s=r||i.clientWidth,l=o||i.clientHeight,d=this.getVirtualRectSize(),u=d.x,f=d.y;a.focusOn(u,f,s,l)}},n.prototype.fitView=function(e,t){e===void 0&&(e=20),t===void 0&&(t=20);var r=this,o=r.nodes,i=r.width,a=r.height,s=r.rootEl,l=r.transformModel;if(o.length){var d=i||s.clientWidth,u=a||s.clientHeight,f=this.getVirtualRectSize(),c=f.width,h=f.height,y=f.x,p=f.y,g=(c+t)/d,v=(h+e)/u,_=1/Math.max(g,v),M=[d/2,u/2];l.zoom(_,M),l.focusOn(y,p,d,u)}},n.prototype.openEdgeAnimation=function(e){var t=this.getEdgeModelById(e);t==null||t.openEdgeAnimation()},n.prototype.closeEdgeAnimation=function(e){var t=this.getEdgeModelById(e);t==null||t.closeEdgeAnimation()},n.prototype.getPartial=function(){return this.partial},n.prototype.setPartial=function(e){this.partial=e},n.prototype.destroy=function(){try{this.waitCleanEffects.forEach(function(e){e()})}catch(e){console.warn("error on destroy GraphModel",e)}this.waitCleanEffects.length=0,this.eventCenter.destroy()},P([E],n.prototype,"width",void 0),P([E],n.prototype,"height",void 0),P([E],n.prototype,"grid",void 0),P([E],n.prototype,"edgeType",void 0),P([E],n.prototype,"nodes",void 0),P([E],n.prototype,"edges",void 0),P([E],n.prototype,"fakeNode",void 0),P([E],n.prototype,"overlapMode",void 0),P([E],n.prototype,"background",void 0),P([E],n.prototype,"gridSize",void 0),P([E],n.prototype,"transformModel",void 0),P([E],n.prototype,"editConfigModel",void 0),P([E],n.prototype,"partial",void 0),P([F],n.prototype,"nodesMap",null),P([F],n.prototype,"edgesMap",null),P([F],n.prototype,"modelsMap",null),P([F],n.prototype,"sortElements",null),P([F],n.prototype,"textEditElement",null),P([F],n.prototype,"selectElements",null),P([F],n.prototype,"selectNodes",null),P([m],n.prototype,"setTextMode",null),P([m],n.prototype,"setFakeNode",null),P([m],n.prototype,"removeFakeNode",null),P([m],n.prototype,"setModel",null),P([m],n.prototype,"toFront",null),P([m],n.prototype,"setElementZIndex",null),P([m],n.prototype,"deleteNode",null),P([m],n.prototype,"addNode",null),P([m],n.prototype,"cloneNode",null),P([m],n.prototype,"moveNode",null),P([m],n.prototype,"moveNode2Coordinate",null),P([m],n.prototype,"editText",null),P([m],n.prototype,"addEdge",null),P([m],n.prototype,"moveEdge",null),P([m],n.prototype,"deleteEdgeBySourceAndTarget",null),P([m],n.prototype,"deleteEdgeById",null),P([m],n.prototype,"deleteEdgeBySource",null),P([m],n.prototype,"deleteEdgeByTarget",null),P([m],n.prototype,"setElementStateById",null),P([m],n.prototype,"updateText",null),P([m],n.prototype,"selectNodeById",null),P([m],n.prototype,"selectEdgeById",null),P([m],n.prototype,"selectElementById",null),P([m],n.prototype,"clearSelectElements",null),P([m],n.prototype,"moveNodes",null),P([m],n.prototype,"setDefaultEdgeType",null),P([m],n.prototype,"changeNodeType",null),P([m],n.prototype,"changeEdgeType",null),P([m],n.prototype,"getNodeIncomingEdge",null),P([m],n.prototype,"getNodeOutgoingEdge",null),P([m],n.prototype,"getAnchorIncomingEdge",null),P([m],n.prototype,"getAnchorOutgoingEdge",null),P([m],n.prototype,"getNodeIncomingNode",null),P([m],n.prototype,"getNodeOutgoingNode",null),P([m],n.prototype,"setTheme",null),P([m],n.prototype,"resize",null),P([m],n.prototype,"clearData",null),P([m],n.prototype,"translateCenter",null),P([m],n.prototype,"fitView",null),P([m],n.prototype,"openEdgeAnimation",null),P([m],n.prototype,"closeEdgeAnimation",null),P([m],n.prototype,"setPartial",null),n}(),Bt=function(){return Bt=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Bt.apply(this,arguments)},oe=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},za=function(){function n(e){this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=e}return n.prototype.getStyle=function(){return Bt({},this.graphModel.theme.snapline)},n.prototype.getCenterSnapLine=function(e,t){for(var r=e.x,o=e.y,i=!1,a=!1,s=0;s<t.length;s++){var l=t[s];if(l.id!==e.id&&(r===l.x&&(i=!0),o===l.y&&(a=!0),i&&a))break}return{isShowVertical:i,isShowHorizontal:a,position:{x:r,y:o}}},n.prototype.getHorizontalSnapline=function(e,t){var r=!1,o=0,i=e.id,a;if(i){var s=this.graphModel.fakeNode;if(s&&s.id===i)a=rt(s);else{var l=this.graphModel.getNodeModelById(i);l&&(a=rt(l))}}for(var d=0;d<t.length;d++){var u=t[d];if(u.id!==e.id){var f=rt(u);if(f.minY===(a==null?void 0:a.minY)||f.maxY===(a==null?void 0:a.minY)){r=!0,o=a.minY;break}if(f.minY===(a==null?void 0:a.maxY)||f.maxY===(a==null?void 0:a.maxY)){r=!0,o=a.maxY;break}}}return{isShowHorizontal:r,isShowVertical:this.isShowVertical,position:Bt(Bt({},this.position),{y:o})}},n.prototype.getVerticalSnapline=function(e,t){var r=!1,o=0,i=e.id,a;if(i){var s=this.graphModel.fakeNode;if(s&&s.id===i)a=rt(s);else{var l=this.graphModel.getNodeModelById(i);l&&(a=rt(l))}}for(var d=0;d<t.length;d++){var u=t[d];if(u.id!==e.id){var f=rt(u);if(f.minX===(a==null?void 0:a.minX)||f.maxX===(a==null?void 0:a.minX)){r=!0,o=a.minX;break}if(f.minX===(a==null?void 0:a.maxX)||f.maxX===(a==null?void 0:a.maxX)){r=!0,o=a.maxX;break}}}return{isShowHorizontal:this.isShowHorizontal,isShowVertical:r,position:Bt(Bt({},this.position),{x:o})}},n.prototype.getSnapLinePosition=function(e,t){var r=this.getCenterSnapLine(e,t),o=r.isShowHorizontal,i=r.isShowVertical;if(!o){var a=this.getHorizontalSnapline(e,t);a.isShowHorizontal&&(r.isShowHorizontal=a.isShowHorizontal,r.position.y=a.position.y)}if(!i){var s=this.getVerticalSnapline(e,t);s.isShowVertical&&(r.isShowVertical=s.isShowVertical,r.position.x=s.position.x)}return r},n.prototype.setSnaplineInfo=function(e){var t=e.isShowHorizontal,r=e.isShowVertical,o=e.position;this.position=o,this.isShowHorizontal=t,this.isShowVertical=r},n.prototype.clearSnapline=function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1},n.prototype.setNodeSnapLine=function(e){var t=this.graphModel.nodes,r=this.getSnapLinePosition(e,t);this.setSnaplineInfo(r)},oe([E],n.prototype,"isShowHorizontal",void 0),oe([E],n.prototype,"isShowVertical",void 0),oe([E],n.prototype,"position",void 0),oe([m],n.prototype,"clearSnapline",null),oe([m],n.prototype,"setNodeSnapLine",null),n}(),ut=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},Zt=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},Ga={false:[-1/0,-1/0,1/0,1/0],true:[-1/0,-1/0,1/0,1/0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},Fa=function(){function n(e,t){this.MINI_SCALE_SIZE=.2,this.MAX_SCALE_SIZE=16,this.SCALE_X=1,this.SKEW_Y=0,this.SKEW_X=0,this.SCALE_Y=1,this.TRANSLATE_X=0,this.TRANSLATE_Y=0,this.ZOOM_SIZE=.04,this.translateLimitMinX=-1/0,this.translateLimitMinY=-1/0,this.translateLimitMaxX=1/0,this.translateLimitMaxY=1/0,this.eventCenter=e;var r=t.stopMoveGraph,o=r===void 0?!1:r;this.updateTranslateLimits(o)}return n.prototype.setZoomMiniSize=function(e){this.MINI_SCALE_SIZE=e},n.prototype.setZoomMaxSize=function(e){this.MAX_SCALE_SIZE=e},n.prototype.HtmlPointToCanvasPoint=function(e){var t=Zt(e,2),r=t[0],o=t[1];return[(r-this.TRANSLATE_X)/this.SCALE_X,(o-this.TRANSLATE_Y)/this.SCALE_Y]},n.prototype.CanvasPointToHtmlPoint=function(e){var t=Zt(e,2),r=t[0],o=t[1];return[r*this.SCALE_X+this.TRANSLATE_X,o*this.SCALE_Y+this.TRANSLATE_Y]},n.prototype.moveCanvasPointByHtml=function(e,t,r){var o=Zt(e,2),i=o[0],a=o[1];return[i+t/this.SCALE_X,a+r/this.SCALE_Y]},n.prototype.fixDeltaXY=function(e,t){return[e/this.SCALE_X,t/this.SCALE_Y]},n.prototype.getTransformStyle=function(){var e=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(e,")")}},n.prototype.zoom=function(e,t){e===void 0&&(e=!1);var r=this.SCALE_X,o=this.SCALE_Y;return typeof e=="number"?(r=e,o=e):e?(r+=this.ZOOM_SIZE,o+=this.ZOOM_SIZE):(r-=this.ZOOM_SIZE,o-=this.ZOOM_SIZE),r<this.MINI_SCALE_SIZE||r>this.MAX_SCALE_SIZE?"".concat(this.SCALE_X*100,"%"):(t&&(this.TRANSLATE_X-=(r-this.SCALE_X)*t[0],this.TRANSLATE_Y-=(o-this.SCALE_Y)*t[1]),this.SCALE_X=r,this.SCALE_Y=o,this.emitGraphTransform("zoom"),"".concat(this.SCALE_X*100,"%"))},n.prototype.emitGraphTransform=function(e){this.eventCenter.emit(T.GRAPH_TRANSFORM,{type:e,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})},n.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},n.prototype.translate=function(e,t){this.TRANSLATE_X+e<=this.translateLimitMaxX&&this.TRANSLATE_X+e>=this.translateLimitMinX&&(this.TRANSLATE_X+=e),this.TRANSLATE_Y+t<=this.translateLimitMaxY&&this.TRANSLATE_Y+t>=this.translateLimitMinY&&(this.TRANSLATE_Y+=t),this.emitGraphTransform("translate")},n.prototype.focusOn=function(e,t,r,o){var i=Zt(this.CanvasPointToHtmlPoint([e,t]),2),a=i[0],s=i[1],l=Zt([r/2-a,o/2-s],2),d=l[0],u=l[1];this.TRANSLATE_X+=d,this.TRANSLATE_Y+=u,this.emitGraphTransform("focusOn")},n.prototype.updateTranslateLimits=function(e){var t;t=Zt(Array.isArray(e)&&e.length===4?e:Ga[e.toString()],4),this.translateLimitMinX=t[0],this.translateLimitMinY=t[1],this.translateLimitMaxX=t[2],this.translateLimitMaxY=t[3]},ut([E],n.prototype,"SCALE_X",void 0),ut([E],n.prototype,"SKEW_Y",void 0),ut([E],n.prototype,"SKEW_X",void 0),ut([E],n.prototype,"SCALE_Y",void 0),ut([E],n.prototype,"TRANSLATE_X",void 0),ut([E],n.prototype,"TRANSLATE_Y",void 0),ut([E],n.prototype,"ZOOM_SIZE",void 0),ut([m],n.prototype,"zoom",null),ut([m],n.prototype,"resetZoom",null),ut([m],n.prototype,"translate",null),ut([m],n.prototype,"focusOn",null),n}(),$a=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Ua=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},Wa=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},Za=function(n,e,t){if(t||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return n.concat(i||Array.prototype.slice.call(e))},Va=function(n){$a(e,n);function e(){var t=n.apply(this,Za([],Wa(arguments),!1))||this;return t.handleResize=function(){var r=t.props,o=r.graphModel,i=r.options,a=o.width,s=o.height,l=o.isContainerWidth,d=o.isContainerHeight,u=a,f=s,c=!1;l&&(u=void 0,c=!0),d&&(f=void 0,c=!0),c&&o.resize(u,f),i.width=a,i.height=s},t.throttleResize=xo(t.handleResize,200),t}return e.prototype.componentDidMount=function(){window.addEventListener("resize",this.throttleResize)},e.prototype.componentDidUpdate=function(){var t=this.props.graphModel.modelToGraphData();this.props.graphModel.eventCenter.emit(T.GRAPH_UPDATED,{data:t})},e.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.throttleResize)},e.prototype.getComponent=function(t,r,o){o===void 0&&(o="canvas-overlay");var i=this.props.getView,a=i(t.type);return a?x(a,{model:t,graphModel:r,overlay:o},t.id):null},e.prototype.render=function(){var t=this,r=this.props,o=r.graphModel,i=r.tool,a=r.options,s=r.dnd,l=r.snaplineModel,d={};a.width&&(d.width="".concat(o.width,"px")),a.height&&(d.height="".concat(o.height,"px"));var u=o.fakeNode,f=o.editConfigModel,c=o.background,h=f.adjustEdge;return x("div",{className:"lf-graph","flow-id":o.flowId,style:d,children:[x(ma,{graphModel:o,dnd:s,children:[x("g",{className:"lf-base",children:St(o.sortElements,function(y){return t.getComponent(y,o)})}),u?this.getComponent(u,o):""]}),x(Na,{graphModel:o,children:[x(La,{graphModel:o}),h?x(Ma,{graphModel:o}):"",a.snapline!==!1?x(Ia,{snaplineModel:l}):""]}),x(Ya,{graphModel:o,tool:i}),c&&x(wa,{background:c}),x(qe,{graphModel:o})]})},e=Ua([ot],e),e}(K),Ka=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),_t=function(){return _t=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},_t.apply(this,arguments)},qa=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},Ja=function(n){Ka(e,n);function e(){var t=n.call(this)||this;return t.onDragStart=function(r){var o=r.event,i=t.props,a=i.anchorData,s=i.nodeModel,l=i.graphModel;l.selectNodeById(s.id),s.autoToFront&&l.toFront(s.id),l.eventCenter.emit(T.ANCHOR_DRAGSTART,{data:a,e:o,nodeModel:s}),t.setState({startX:a.x,startY:a.y,endX:a.x,endY:a.y})},t.onDragging=function(r){var o=r.event,i=t.props,a=i.graphModel,s=i.nodeModel,l=i.anchorData,d=a.transformModel,u=a.eventCenter,f=a.width,c=a.height,h=a.editConfigModel,y=h.autoExpand,p=h.stopMoveGraph;if(o){var g=o.clientX,v=o.clientY,_=a.getPointByClient({x:g,y:v}),M=_.domOverlayPosition,S=M.x,O=M.y,w=_.canvasOverlayPosition,A=w.x,b=w.y;t.t&&Ke(t.t);var R=[],L=10;S<10?R=[L,0]:S+10>f?R=[-10,0]:O<10?R=[0,L]:O+10>c&&(R=[0,-10]),t.setState({endX:A,endY:b,dragging:!0}),t.moveAnchorEnd(A,b),R.length>0&&!p&&y&&(t.t=io(function(){var z=qa(R,2),I=z[0],U=z[1];d.translate(I,U);var Y=t.state,Z=Y.endX,lt=Y.endY;t.setState({endX:Z-I,endY:lt-U}),t.moveAnchorEnd(Z-I,lt-U)})),u.emit(T.ANCHOR_DRAG,{data:l,e:o,nodeModel:s})}},t.onDragEnd=function(r){var o=r.event;t.t&&Ke(t.t);var i=t.checkEnd(o);t.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),t.sourceRuleResults.clear(),t.targetRuleResults.clear();var a=t.props,s=a.graphModel,l=a.nodeModel,d=a.anchorData;s.eventCenter.emit(T.ANCHOR_DRAGEND,{data:d,e:o,nodeModel:l,edgeModel:i??void 0})},t.checkEnd=function(r){var o,i=t.props,a=i.graphModel,s=i.nodeModel,l=i.anchorData,d=l.x,u=l.y,f=l.id,c=t.state,h=c.endX,y=c.endY,p=c.dragging,g=Ze({x:h,y},a);if(t.preTargetNode&&t.preTargetNode.state!==X.DEFAULT&&t.preTargetNode.setElementState(X.DEFAULT),!!p&&g&&g.node){var v=g.node,_=g.anchor.id,M="".concat(s.id,"_").concat(v.id,"_").concat(_,"_").concat(f),S=t.sourceRuleResults.get(M)||{},O=S.isAllPass,w=S.msg,A=t.targetRuleResults.get(M)||{},b=A.isAllPass,R=A.msg;if(O&&b){v.setElementState(X.DEFAULT);var L=a.getNodeModelById(g.node.id),z=(o=a.edgeGenerator)===null||o===void 0?void 0:o.call(a,s.getData(),L==null?void 0:L.getData()),I=a.addEdge(_t(_t({},z),{sourceNodeId:s.id,sourceAnchorId:f,startPoint:{x:d,y:u},targetNodeId:g.node.id,targetAnchorId:g.anchor.id,endPoint:{x:g.anchor.x,y:g.anchor.y}})),U=t.props.anchorData;return a.eventCenter.emit(T.ANCHOR_DROP,{data:U,e:r,nodeModel:s,edgeModel:I}),I}var Y=v.getData();return a.eventCenter.emit(T.CONNECTION_NOT_ALLOWED,{data:Y,msg:R||w||"不允许添加连线"}),null}},t.sourceRuleResults=new Map,t.targetRuleResults=new Map,t.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},t.dragHandler=new Mt({onDragStart:t.onDragStart,onDragging:t.onDragging,onDragEnd:t.onDragEnd}),t}return e.prototype.getAnchorShape=function(){var t=this.props,r=t.anchorData,o=t.style,i=t.node,a=i.getAnchorShape(r);if(a)return a;var s=r.x,l=r.y,d=_t(_t({},o),o==null?void 0:o.hover);return x("g",{children:[x(re,_t({className:"lf-node-anchor-hover"},d,{x:s,y:l})),x(re,_t({className:"lf-node-anchor"},o,{x:s,y:l}))]})},Object.defineProperty(e.prototype,"customTrajectory",{get:function(){var t=this.props.graphModel.customTrajectory;return t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relateEdges",{get:function(){var t=this.props,r=t.graphModel,o=r.getAnchorIncomingEdge,i=r.getAnchorOutgoingEdge,a=t.anchorData.id;return{incomingEdgeList:o(a),outgoingEdgeList:i(a)}},enumerable:!1,configurable:!0}),e.prototype.moveAnchorEnd=function(t,r){var o,i,a=this.props,s=a.graphModel,l=a.nodeModel,d=a.anchorData,u=Ze({x:t,y:r},s);if(u){var f=u.node,c=u.anchor.id;if(this.preTargetNode&&this.preTargetNode!==u.node&&this.preTargetNode.setElementState(X.DEFAULT),d.id===c)return;this.preTargetNode=f;var h="".concat(l.id,"_").concat(f.id,"_").concat(c,"_").concat(d.id);if(!this.targetRuleResults.has(h)){var y=u.anchor,p=l.isAllowConnectedAsSource(f,d,y),g=f.isAllowConnectedAsTarget(l,d,y);this.sourceRuleResults.set(h,Ve(p)),this.targetRuleResults.set(h,Ve(g))}var v=((o=this.sourceRuleResults.get(h))!==null&&o!==void 0?o:{}).isAllPass,_=((i=this.targetRuleResults.get(h))!==null&&i!==void 0?i:{}).isAllPass;v&&_?f.setElementState(X.ALLOW_CONNECT):f.setElementState(X.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==X.DEFAULT&&this.preTargetNode.setElementState(X.DEFAULT)},e.prototype.isShowLine=function(){var t=this.state,r=t.startX,o=t.startY,i=t.endX,a=t.endY,s=vt(r,o,i,a);return s>10},e.prototype.render=function(){var t=this,r=this.state,o=r.startX,i=r.startY,a=r.endX,s=r.endY,l=this.props,d=l.anchorData.edgeAddable,u=l.edgeStyle;return x("g",{className:"lf-anchor",children:[x("g",{onMouseDown:function(f){d!==!1&&t.dragHandler.handleMouseDown(f)},children:this.getAnchorShape()}),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(_t({sourcePoint:{x:o,y:i},targetPoint:{x:a,y:s}},u)):x(ee,_t({x1:o,y1:i,x2:a,y2:s},u,{"pointer-events":"none"})))]})},e}(K),Qa=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),br=function(){return br=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},br.apply(this,arguments)},ts=function(n){Qa(e,n);function e(t){var r=n.call(this,t)||this;return r.style={},r.onDragging=function(o){var i,a=o.event,s=r.props,l=s.graphModel,d=s.nodeModel,u=s.eventCenter,f=l.selectNodes,c=d.x,h=d.y,y=a.clientX,p=a.clientY,g=l.getPointByClient({x:y,y:p}).canvasOverlayPosition,v=g.x,_=g.y,M=new Q(v-c,_-h),S=((i=r.normal)===null||i===void 0?void 0:i.angle(M))-r.defaultAngle,O=new rr(-c,-h).rotate(S).translate(c,h).toString();d.transform=O,d.rotate=S;var w=St(f,function(b){return b.id});w.indexOf(d.id)===-1&&(w=[d.id]);var A=Eo(w,function(b,R){var L=l.getNodeModelById(R);return b[R]=L==null?void 0:L.getMoveDistance(0,0,!1),b},{});w.forEach(function(b){var R=l.getNodeEdges(b);R.forEach(function(L){if(A[L.sourceNodeId]){var z=l.getNodeModelById(L.sourceNodeId),I=z.anchors.find(function(U){return U.id===L.sourceAnchorId});L.updateStartPoint(I)}if(A[L.targetNodeId]){var z=l.getNodeModelById(L.targetNodeId),I=z.anchors.find(function(Z){return Z.id===L.targetAnchorId});L.updateEndPoint(I)}})}),u.emit(T.NODE_ROTATE,{e:a,model:d,data:d.getData()})},r.style=t.style,r.stepperDrag=new Mt({onDragging:r.onDragging}),r}return e.prototype.render=function(){var t=this,r=this.props.nodeModel,o=r.x,i=r.y,a=r.width,s=r.height,l=o+a/2+20,d=i-s/2-20;return this.normal=new Q(1,0),this.defaultAngle=this.normal.angle(new Q(l-o,d-i)),r.defaultAngle=this.defaultAngle,x("g",{className:"lf-rotate-control",children:x("g",{onMouseDown:function(u){t.stepperDrag.handleMouseDown(u)},children:x(re,br({},this.style,{cx:l,cy:d}))})})},e}(K),es=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Cr=function(){return Cr=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Cr.apply(this,arguments)},rs=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},co=function(n){es(e,n);function e(t){var r=n.call(this)||this;r.mouseDownHandler=function(i){var a=r.props,s=a.draggable,l=a.model,d=a.graphModel,u=d.editConfigModel.nodeTextDraggable;(s??u)&&(i.stopPropagation(),r.stepperDrag.model=l,r.stepperDrag.handleMouseDown(i))},r.onDragging=function(i){var a=i.deltaX,s=i.deltaY,l=r.props,d=l.model,u=l.graphModel.transformModel;if(a||s){var f=rs(u.fixDeltaXY(a,s),2),c=f[0],h=f[1];d.moveText(c,h)}},r.dbClickHandler=function(){var i=r.props,a=i.editable,s=i.graphModel.eventCenter,l=i.model;a&&l.setElementState(X.TEXT_EDIT),s.emit(T.TEXT_DBCLICK,{data:l.text,model:l})};var o=t.draggable;return r.stepperDrag=new Mt({onDragging:r.onDragging,step:1,eventType:"TEXT",isStopPropagation:o}),r}return e.prototype.getShape=function(){var t=this.props,r=t.model,o=t.graphModel,i=o.editConfigModel,a=r.text,s=a.value,l=a.x,d=a.y,u=a.editable,f=a.draggable,c={x:l,y:d,className:"",value:s},h=r.getTextStyle(),y=i.nodeTextDraggable||f;return x(ao,Cr({},c,h,{className:Do({"lf-element-text":u,"lf-text-draggable":!u&&y,"lf-text-disabled":!u&&!y}),model:r}))},e.prototype.render=function(){var t=this.props.model.text;if(t)return x("g",{onMouseDown:this.mouseDownHandler,onDblClick:this.dbClickHandler,children:this.getShape()})},e}(K),ns=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ft=function(){return ft=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},ft.apply(this,arguments)},Ye=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},os=function(n){ns(e,n);function e(t){var r=n.call(this,t)||this;return r.setHoverOn=function(){r.setState({isHovered:!0})},r.setHoverOff=function(){r.setState({isHovered:!1})},r.state={isHovered:!1},r}return e.prototype.getBackground=function(){var t=this.state.isHovered,r=this.props.model,o=r.text,i=r.getTextStyle(),a=i.background||{};if(t&&i.hover&&i.hover.background&&(a=ft(ft({},a),i.hover.background)),o!=null&&o.value&&(a==null?void 0:a.fill)!=="transparent"){var s=i.fontSize,l=i.textWidth,d=i.lineHeight,u=i.overflowMode,f=a.wrapPadding,c=o==null?void 0:o.value.split(/[\r\n]/g),h=c.length,y=o.x,p=o.y,g={};if(u==="autoWrap"&&l){var v=oo({rows:c,style:{fontSize:"".concat(s,"px"),width:"".concat(l,"px"),lineHeight:d,padding:f},rowsLength:h,className:"lf-get-text-height"});g=ft(ft({},a),{x:y,y:p,width:l,height:v})}else{var _=ii({rows:c,rowsLength:h,fontSize:s}),M=_.width,S=_.height;if(u==="ellipsis"&&(M=l,S=s+2),typeof a.wrapPadding=="string"){var O=a.wrapPadding.split(",").filter(function(nt){return nt.trim()}).map(function(nt){return parseFloat(nt.trim())});if(O.length>0&&O.length<=4){if(O.length===1){var w=Ye(O,1),A=w[0];O=[A,A,A,A]}else if(O.length===2){var b=Ye(O,2),R=b[0],L=b[1];O=[R,L,R,L]}else if(O.length===3){var z=Ye(O,3),I=z[0],L=z[1],U=z[2];O=[I,L,U,L]}var Y=Ye(O,4),Z=Y[0],lt=Y[1],jt=Y[2],Rt=Y[3];M+=lt+Rt,S+=Z+jt,y=y+(lt-Rt)/2,p=p+(jt-Z)/2}}g=ft(ft({},a),{x:y-1,y:p-1,width:M,height:S})}return x(Et,ft({},g))}return null},e.prototype.getShape=function(){var t=this.props.model,r=t.text,o=r.x,i=r.y,a=r.value;if(!a)return null;var s=t.getTextStyle(),l=ft({x:o,y:i,value:a,model:t,className:"lf-element-text"},s);return x("g",{className:"lf-line-text",onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getBackground(),x(ao,ft({},l))]})},e}(co),is=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Je=function(){return Je=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Je.apply(this,arguments)},as=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]]);return t},He=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},Lt=function(n){is(e,n);function e(t){var r=n.call(this)||this;r.onDragStart=function(l){var d=l.event,u=r.props,f=u.model,c=u.graphModel;if(d){var h=c.getPointByClient({x:d.clientX,y:d.clientY}).canvasOverlayPosition,y=h.x,p=h.y;r.moveOffset={dx:f.x-y,dy:f.y-p}}},r.onDragging=function(l){var d,u,f,c,h=l.event,y=r.props,p=y.model,g=y.graphModel,v=g.editConfigModel,_=v.stopMoveGraph,M=v.autoExpand,S=v.snapGrid,O=g.transformModel,w=g.selectNodes,A=g.width,b=g.height,R=g.gridSize;p.isDragging=!0;var L=h,z=L.clientX,I=L.clientY,U=g.getPointByClient({x:z,y:I}).canvasOverlayPosition,Y=U.x,Z=U.y,lt=He(O.CanvasPointToHtmlPoint([Y,Z]),2),jt=lt[0],Rt=lt[1];if(Y=Y+((u=(d=r.moveOffset)===null||d===void 0?void 0:d.dx)!==null&&u!==void 0?u:0),Z=Z+((c=(f=r.moveOffset)===null||f===void 0?void 0:f.dy)!==null&&c!==void 0?c:0),Y=te(Y,R,S),Z=te(Z,R,S),!A||!b){g.moveNode2Coordinate(p.id,Y,Z);return}var nt=jt<0||Rt<0||jt>A||Rt>b;if(!(M&&!_&&nt)){var yt=He(O.CanvasPointToHtmlPoint([Y-p.width/2,Z-p.height/2]),2),ne=yt[0],ir=yt[1],Ae=He(O.CanvasPointToHtmlPoint([Y+p.width/2,Z+p.height/2]),2),ar=Ae[0],po=Ae[1],Pe=Math.max(R,20),zt=[];ne<0?zt=[Pe,0]:ar>g.width?zt=[-Pe,0]:ir<0?zt=[0,Pe]:po>g.height&&(zt=[0,-Pe]),r.t&&Ke(r.t),p.transform=new rr(-Y,-Z).rotate(p.rotate).translate(Y,Z).toString();var Te=w.map(function(De){return De.id});Te.indexOf(p.id)===-1&&(Te=[p.id]),zt.length>0&&!_&&M?r.t=io(function(){var De=He(zt,2),Gt=De[0],Ft=De[1];O.translate(Gt??0,Ft??0);var ho=-(Gt??0)/O.SCALE_X,vo=-(Ft??0)/O.SCALE_X;g.moveNodes(Te,ho,vo)}):g.moveNodes(Te,Y-p.x,Z-p.y)}},r.onDragEnd=function(){r.t&&Ke(r.t);var l=r.props.model;l.isDragging=!1},r.onMouseOut=function(l){Ro()&&r.setHoverOff(l)},r.handleMouseUp=function(){var l=r.props.model;r.mouseUpDrag=l.isDragging},r.handleClick=function(l){var d=r.mouseUpDrag===!1;if(r.startTime){var u=r.props,f=u.model,c=u.graphModel;if(d){var h=f.getData(),y=c.getPointByClient({x:l.clientX,y:l.clientY}),p={data:h,e:l,position:y,isSelected:!1,isMultiple:!1},g=l.button===2,v=l.detail===2;if(!g){var _=c.editConfigModel,M=ro(l,_);p.isMultiple=M,f.isSelected&&!v&&M?(p.isSelected=!1,f.setSelected(!1)):(c.selectNodeById(f.id,M),p.isSelected=!0,_.isSilentMode||r.toFront()),v?(_.nodeTextEdit&&f.text.editable&&_.textMode===st.TEXT&&(f.setSelected(!1),c.setElementStateById(f.id,X.TEXT_EDIT)),c.eventCenter.emit(T.NODE_DBCLICK,p)):(c.eventCenter.emit(T.ELEMENT_CLICK,p),c.eventCenter.emit(T.NODE_CLICK,p))}}}},r.handleContextMenu=function(l){l.preventDefault();var d=r.props,u=d.model,f=d.graphModel,c=f.editConfigModel,h=u.getData(),y=f.getPointByClient({x:l.clientX,y:l.clientY});f.setElementStateById(u.id,X.SHOW_MENU,y.domOverlayPosition),u.isSelected||f.selectNodeById(u.id),f.eventCenter.emit(T.NODE_CONTEXTMENU,{data:h,e:l,position:y}),c.isSilentMode||r.toFront()},r.handleMouseDown=function(l){var d=r.props,u=d.model,f=d.graphModel;r.startTime=new Date().getTime();var c=f.editConfigModel;c.adjustNodePosition&&u.draggable&&r.stepDrag&&r.stepDrag.handleMouseDown(l)},r.handleFocus=function(){var l=r.props,d=l.model,u=l.graphModel;u.eventCenter.emit(T.NODE_FOCUS,{data:d.getData()})},r.handleBlur=function(){var l=r.props,d=l.model,u=l.graphModel;u.eventCenter.emit(T.NODE_BLUR,{data:d.getData()})},r.setHoverOn=function(l){var d=r.props,u=d.model,f=d.graphModel;if(!u.isHovered){var c=u.getData();u.setHovered(!0),f.eventCenter.emit(T.NODE_MOUSEENTER,{data:c,e:l})}},r.setHoverOff=function(l){var d=r.props,u=d.model,f=d.graphModel,c=u.getData();u.isHovered&&(u.setHovered(!1),f.eventCenter.emit(T.NODE_MOUSELEAVE,{data:c,e:l}))};var o=t.graphModel,i=o.gridSize,a=o.eventCenter,s=t.model;return r.stepDrag=new Mt({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:i,eventType:"NODE",isStopPropagation:!1,eventCenter:a,model:s}),r.modelDisposer=Po(function(){return r.props},function(l){l&&l.model&&r.stepDrag.setModel(l.model)}),r}return e.prototype.componentWillUnmount=function(){this.modelDisposer&&this.modelDisposer(),this.render.$mobx&&this.render.$mobx.dispose()},e.prototype.componentDidMount=function(){},e.prototype.componentDidUpdate=function(){},e.prototype.getAnchorShape=function(t){return null},e.prototype.getAnchors=function(){var t=this,r=this.props,o=r.model,i=r.graphModel,a=o.isSelected,s=o.isHitable,l=o.isDragging,d=o.isShowAnchor;return s&&(a||d)&&!l?St(o.anchors,function(u,f){var c=o.getAnchorLineStyle(u),h=o.getAnchorStyle(u);return x(Ja,{anchorData:u,node:t,style:h,edgeStyle:c,anchorIndex:f,nodeModel:o,graphModel:i,setHoverOff:t.setHoverOff})}):[]},e.prototype.getRotateControl=function(){var t=this.props,r=t.model,o=t.graphModel,i=o.editConfigModel,a=i.isSilentMode,s=i.allowRotate,l=r.isSelected,d=r.isHitable,u=r.rotatable,f=r.isHovered,c=s&&u,h=r.getRotateControlStyle();if(!a&&d&&(l||f)&&c)return x(ts,{graphModel:o,nodeModel:r,eventCenter:o.eventCenter,style:h})},e.prototype.getResizeControl=function(){var t=this.props,r=t.model,o=t.graphModel,i=o.editConfigModel,a=i.isSilentMode,s=i.allowResize,l=r.isSelected,d=r.isHitable,u=r.resizable,f=r.isHovered,c=s&&u,h=r.getResizeControlStyle();return!a&&d&&(l||f)&&c?x(Ti,{style:h,model:r,graphModel:o}):null},e.prototype.getText=function(){var t,r=this.props,o=r.model,i=r.graphModel,a=i.editConfigModel;if(a.nodeTextMode!==st.TEXT||o.state===X.TEXT_EDIT)return null;if(o.text){var s=!1;return a.nodeTextDraggable&&o.text.draggable&&(s=!0),x(co,{editable:a.nodeTextEdit&&((t=o.text.editable)!==null&&t!==void 0?t:!0),model:o,graphModel:i,draggable:s})}return null},e.prototype.getStateClassName=function(){var t=this.props.model,r=t.state,o=t.isDragging,i=t.isSelected,a="lf-node";switch(r){case X.ALLOW_CONNECT:a+=" lf-node-allow";break;case X.NOT_ALLOW_CONNECT:a+=" lf-node-not-allow";break;default:a+=" lf-node-default";break}return o&&(a+=" lf-dragging"),i&&(a+=" lf-node-selected"),a},e.prototype.toFront=function(){var t=this.props,r=t.model,o=t.graphModel;r.autoToFront&&o.toFront(r.id)},e.prototype.render=function(){var t=this.props,r=t.model,o=t.graphModel,i=o.editConfigModel,a=i.hideAnchors,s=i.adjustNodePosition,l=i.allowRotate,d=i.allowResize,u=o.gridSize,f=o.transformModel.SCALE_X,c=r.isHitable,h=r.draggable,y=r.transform,p=r.getOuterGAttributes(),g=p.className,v=g===void 0?"":g,_=as(p,["className"]),M=x("g",{className:"lf-node-content",children:[x("g",{transform:y,children:[this.getShape(),this.getText(),l&&this.getRotateControl(),d&&this.getResizeControl()]}),!a&&this.getAnchors()]}),S;return c?(s&&h&&this.stepDrag.setStep(u*f),S=x("g",Je({className:"".concat(this.getStateClassName()," ").concat(v),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu,onFocus:this.handleFocus,onBlur:this.handleBlur},_,{children:M}))):S=x("g",Je({className:"".concat(this.getStateClassName()," ").concat(v)},_,{children:M})),S},e.isObserved=!1,e}(K),ss=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Lr=function(){return Lr=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Lr.apply(this,arguments)},jn=function(n){ss(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getShape=function(){var t=this.props.model,r=t.getNodeStyle();return x(Et,Lr({},r,{x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius}))},e}(Lt),ls=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),jr=function(){return jr=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},jr.apply(this,arguments)},Rn=function(n){ls(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getShape=function(){var t=this.props.model,r=t.x,o=t.y,i=t.r,a=t.getNodeStyle();return x(re,jr({},a,{x:r,y:o,r:i}))},e}(Lt),ds=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Qe=function(){return Qe=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Qe.apply(this,arguments)},In=function(n){ds(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getShape=function(){var t=this.props.model,r=t,o=r.x,i=r.y,a=r.width,s=r.height,l=r.points,d=t.getNodeStyle(),u={transform:"matrix(1 0 0 1 ".concat(o-a/2," ").concat(i-s/2,")")};return x("g",Qe({},u,{children:x(so,Qe({},d,{points:l,x:o,y:i}))}))},e}(Lt),us=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Rr=function(){return Rr=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Rr.apply(this,arguments)},Bn=function(n){us(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getShape=function(){var t=this.props.model,r=t.getNodeStyle();return x("g",{children:x(so,Rr({},r,{points:t.points,x:t.x,y:t.y}))})},e}(Lt),fs=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Ir=function(){return Ir=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Ir.apply(this,arguments)},Xn=function(n){fs(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getShape=function(){var t=this.props.model,r=t.getNodeStyle();return x(Ei,Ir({},r,{x:t.x,y:t.y,rx:t.rx,ry:t.ry}))},e}(Lt),cs=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ye=function(){return ye=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},ye.apply(this,arguments)},Yn=function(n){cs(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getBackground=function(){var t=this.props.model,r=t.getTextStyle(),o=t.width,i=t.height,a=t.x,s=t.y,l=ye(ye({},r.background),{x:a,y:s,width:o,height:i});return x(Et,ye({},l))},e.prototype.getResizeControl=function(){return null},e.prototype.getShape=function(){return x("g",{children:this.getBackground()})},e}(Lt),ps=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Br=function(){return Br=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Br.apply(this,arguments)},hs=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},vs=function(n,e,t){if(t||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return n.concat(i||Array.prototype.slice.call(e))},Hn=function(n){ps(e,n);function e(){var t=n.apply(this,vs([],hs(arguments),!1))||this;return t.ref=Gr(),t}return Object.defineProperty(e.prototype,"rootEl",{get:function(){return this.ref.current},enumerable:!1,configurable:!0}),e.prototype.setHtml=function(t){t.appendChild(document.createElement("div"))},e.prototype.confirmUpdate=function(t){this.setHtml(t)},e.prototype.shouldUpdate=function(){return this.preProperties&&this.preProperties===this.currentProperties?!1:(this.preProperties=this.currentProperties,!0)},e.prototype.componentDidMount=function(){this.shouldUpdate()&&this.rootEl&&this.setHtml(this.rootEl)},e.prototype.componentDidUpdate=function(){this.shouldUpdate()&&this.rootEl&&this.confirmUpdate(this.rootEl)},e.prototype.componentWillUnmount=function(){n.prototype.componentWillUnmount.call(this),this.rootEl.innerHTML=""},e.prototype.getShape=function(){var t=this.props.model,r=t.x,o=t.y,i=t.height,a=t.width,s=t.getNodeStyle();return this.currentProperties=JSON.stringify(t.properties),x("foreignObject",Br({},s,{x:r-a/2,y:o-i/2,width:a,height:i,ref:this.ref}))},e}(Lt),ys=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ct=function(){return ct=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},ct.apply(this,arguments)},gs=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]]);return t},_s=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},xt;(function(n){n.SOURCE="SOURCE",n.TARGET="TARGET"})(xt||(xt={}));var kn=function(n){ys(e,n);function e(t){var r=n.call(this)||this;r.handleMouseDown=function(l){r.stepDrag&&r.stepDrag.handleMouseDown(l)},r.onDragStart=function(){var l=r.props,d=l.x,u=l.y,f=l.edgeModel,c=f.startPoint,h=f.endPoint,y=f.pointsList;r.oldEdge={startPoint:c,endPoint:h,pointsList:y},r.setState({endX:d,endY:u,dragging:!0})},r.onDragging=function(l){var d=l.deltaX,u=l.deltaY,f=r.state,c=f.endX,h=f.endY,y=r.props,p=y.graphModel,g=y.type,v=p.transformModel,_=p.editConfigModel,M=_s(v.moveCanvasPointByHtml([c,h],d,u),2),S=M[0],O=M[1];r.setState({endX:S,endY:O,dragging:!0});var w=r.props.edgeModel,A=Ze({x:c,y:h},p);if(A&&A.node&&r.isAllowAdjust(A).pass){var b=w.startPoint,R=w.endPoint,L=w.sourceNode,z=w.targetNode,I=g===xt.SOURCE?{startPoint:{x:A.anchor.x,y:A.anchor.y},endPoint:{x:R.x,y:R.y},sourceNode:A.node,targetNode:z}:{startPoint:{x:b.x,y:b.y},endPoint:{x:A.anchor.x,y:A.anchor.y},sourceNode:L,targetNode:A.node};w.updateAfterAdjustStartAndEnd(I)}else g===xt.SOURCE?w.updateStartPoint({x:S,y:O}):w.updateEndPoint({x:S,y:O});w.text.value&&_.adjustEdge&&w.setText(Object.assign({},w.text,w.textPosition))},r.onDragEnd=function(l){var d,u,f,c=l.event;try{r.setState({dragging:!1});var h=r.props,y=h.graphModel,p=h.edgeModel,g=h.type,v=r.state,_=v.endX,M=v.endY,S=v.dragging,O=Ze({x:_,y:M},y);if(!S)return;var w=!1,A=void 0;if(O&&O.node){var b=r.isAllowAdjust(O),R=b.pass,L=b.msg,z=b.newTargetNode;if(R){var I=p.getData(),U=I.text,Y=I.sourceAnchorId,Z=Y===void 0?"":Y,lt=I.targetAnchorId,jt=lt===void 0?"":lt,Rt=gs(I,["text","sourceAnchorId","targetAnchorId"]);if(A=ct(ct({sourceAnchorId:Z,targetAnchorId:jt},Rt),{text:(U==null?void 0:U.value)||""}),g===xt.SOURCE){var nt=y.getNodeModelById(O.node.id),yt=y.getNodeModelById(p.targetNodeId),ne=(d=y.edgeGenerator)===null||d===void 0?void 0:d.call(y,nt==null?void 0:nt.getData(),yt==null?void 0:yt.getData(),A);A=ct(ct({},ne),{sourceNodeId:O.node.id,sourceAnchorId:O.anchor.id,startPoint:{x:O.anchor.x,y:O.anchor.y},targetNodeId:p.targetNodeId,endPoint:ct({},p.endPoint)}),p.sourceNodeId===O.node.id&&p.sourceAnchorId===O.anchor.id&&(w=!0)}else if(g===xt.TARGET){var nt=y.getNodeModelById(p.sourceNodeId),yt=y.getNodeModelById(O.node.id),ne=(u=y.edgeGenerator)===null||u===void 0?void 0:u.call(y,nt==null?void 0:nt.getData(),yt==null?void 0:yt.getData(),A);A=ct(ct({},ne),{sourceNodeId:p.sourceNodeId,startPoint:ct({},p.startPoint),targetNodeId:O.node.id,targetAnchorId:O.anchor.id,endPoint:{x:O.anchor.x,y:O.anchor.y}}),p.targetNodeId===O.node.id&&p.targetAnchorId===O.anchor.id&&(w=!0)}}else{w=!0;var ir=z.getData();y.eventCenter.emit(T.CONNECTION_NOT_ALLOWED,{data:ir,msg:L})}}else w=!0;if(w)r.recoveryEdge();else{var Ae=p.getData();y.deleteEdgeById(p.id);var ar=y.addEdge(ct({},A));y.eventCenter.emit(T.EDGE_EXCHANGE_NODE,{data:{newEdge:ar.getData(),oldEdge:Ae}})}(f=r.preTargetNode)===null||f===void 0||f.setElementState(X.DEFAULT)}finally{var y=r.props.graphModel;y.eventCenter.emit(T.ADJUST_POINT_DRAGEND,{e:c,data:r.stepDragData})}},r.recoveryEdge=function(){var l=r.props.edgeModel,d=r.oldEdge,u=d.startPoint,f=d.endPoint,c=d.pointsList;l.updateStartPoint(u),l.updateEndPoint(f),l.modelType!==j.LINE_EDGE&&(l.pointsList=c??[],l.initPoints())},r.getAdjustPointStyle=function(){var l=r.props.graphModel.theme,d=l.edgeAdjust;return d},r.state={dragging:!1,endX:0,endY:0},r.targetRuleResults=new Map,r.sourceRuleResults=new Map;var o=t.type,i=t.edgeModel,a=t.graphModel,s=a.eventCenter;return r.stepDragData={type:o,edgeData:i.getData()},r.stepDrag=new Mt({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:s,data:r.stepDragData}),r}return e.prototype.isAllowAdjust=function(t){var r=this.props,o=r.edgeModel,i=o.id,a=o.sourceNode,s=o.targetNode,l=o.sourceAnchorId,d=o.targetAnchorId,u=r.type,f,c,h,y;if(u===xt.SOURCE?(f=t.node,c=s,h=t.anchor,y=s.getAnchorInfo(d)):(f=a,c=t.node,y=t.anchor,h=a.getAnchorInfo(l)),this.preTargetNode&&this.preTargetNode!==t.node&&this.preTargetNode.setElementState(X.DEFAULT),this.preTargetNode=t.node,y.id===h.id)return{pass:!1,msg:"",newTargetNode:c};var p="".concat(f.id,"_").concat(c.id,"_").concat(h.id,"_").concat(y.id);if(!this.targetRuleResults.has(p)){var g=f.isAllowConnectedAsSource(c,h,y,i),v=c.isAllowConnectedAsTarget(f,h,y,i);this.sourceRuleResults.set(p,Ve(g)),this.targetRuleResults.set(p,Ve(v))}var _=this.sourceRuleResults.get(p),M=_.isAllPass,S=_.msg,O=this.targetRuleResults.get(p),w=O.isAllPass,A=O.msg,b=M&&w?X.ALLOW_CONNECT:X.NOT_ALLOW_CONNECT;return u===xt.SOURCE?f.setElementState(b):c.setElementState(b),{pass:M&&w,msg:A||S,newTargetNode:c}},e.prototype.render=function(){var t=this.props,r=t.x,o=t.y,i=t.getAdjustPointShape,a=t.edgeModel,s=this.state.dragging;return x("g",{pointerEvents:s?"none":"",onMouseDown:this.handleMouseDown,children:s?"":i(r,o,a)})},e}(K),ms=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Xr=function(){return Xr=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Xr.apply(this,arguments)};(function(n){ms(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getArrowAttributes=function(){var t=this.props,r=t.arrowInfo,o=t.style,i=r.start,a=r.end,s={start:i,end:a,offset:o.offset,verticalLength:o.verticalLength,type:"end"},l=xe(s),d=l.leftX,u=l.leftY,f=l.rightX,c=l.rightY;return Xr({d:"M".concat(d," ").concat(u," L").concat(a.x," ").concat(a.y," L").concat(f," ").concat(c," z")},o)},e.prototype.getShape=function(){var t=this.getArrowAttributes(),r=t.d,o=t.strokeWidth,i=t.stroke,a=t.fill;return x(Oe,{d:r,fill:a,strokeWidth:o,stroke:i})},e.prototype.render=function(){return x("g",{className:"lf-arrow",children:this.getShape()})},e})(K);var xs=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ge=function(){return ge=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},ge.apply(this,arguments)},Es=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},or=function(n){xs(e,n);function e(){var t=n.call(this)||this;return t.textRef=Gr(),t.handleHover=function(r,o){var i=t.props,a=i.model,s=i.graphModel.eventCenter;a.setHovered(r);var l=r?T.EDGE_MOUSEENTER:T.EDGE_MOUSELEAVE,d=a.getData();s.emit(l,{data:d,e:o})},t.setHoverOn=function(r){var o=t.props.model.isHovered;o||(t.textRef&&t.textRef.current&&t.textRef.current.setHoverOn(),t.handleHover(!0,r))},t.setHoverOff=function(r){var o=t.props.model.isHovered;o&&(t.textRef&&t.textRef.current&&t.textRef.current.setHoverOff(),t.handleHover(!1,r))},t.handleContextMenu=function(r){r.preventDefault(),t.contextMenuTime=new Date().getTime(),t.clickTimer&&clearTimeout(t.clickTimer);var o=t.props,i=o.model,a=o.graphModel,s=a.editConfigModel,l=a.getPointByClient({x:r.clientX,y:r.clientY});a.setElementStateById(i.id,X.SHOW_MENU,l.domOverlayPosition),s.isSilentMode||t.toFront(),i.isSelected||a.selectEdgeById(i.id);var d=i==null?void 0:i.getData();a.eventCenter.emit(T.EDGE_CONTEXTMENU,{data:d,e:r,position:l})},t.handleMouseDown=function(r){r.stopPropagation(),t.startTime=new Date().getTime()},t.handleMouseUp=function(){var r=t.props.model;t.mouseUpDrag=r.isDragging},t.handleClick=function(r){if(t.startTime&&!t.mouseUpDrag){var o=r.button===2;if(!o){var i=r.detail===2,a=t.props,s=a.model,l=a.graphModel,d=s==null?void 0:s.getData(),u=l.getPointByClient({x:r.clientX,y:r.clientY});if(i){var f=l.editConfigModel,c=l.textEditElement,h=s.id,y=s.text,p=s.modelType;if(c&&c.id===h&&l.setElementStateById(h,X.DEFAULT),f.edgeTextEdit&&y.editable&&(s.setSelected(!1),l.setElementStateById(h,X.TEXT_EDIT)),p===j.POLYLINE_EDGE){var g=s,v=l.getPointByClient({x:r.x,y:r.y}).canvasOverlayPosition,_=v.x,M=v.y;g.dbClickPosition=eo({x:_,y:M},g.points)}l.eventCenter.emit(T.EDGE_DBCLICK,{data:d,e:r,position:u})}else l.eventCenter.emit(T.ELEMENT_CLICK,{data:d,e:r,position:u}),l.eventCenter.emit(T.EDGE_CLICK,{data:d,e:r,position:u});var S=l.editConfigModel;l.selectEdgeById(s.id,ro(r,S)),S.isSilentMode||t.toFront()}}},t.handleFocus=function(){var r=t.props,o=r.model,i=r.graphModel;i.eventCenter.emit(T.EDGE_FOCUS,{data:o.getData()})},t.handleBlur=function(){var r=t.props,o=r.model,i=r.graphModel;i.eventCenter.emit(T.EDGE_BLUR,{data:o.getData()})},t}return e.prototype.getShape=function(){return x("g",{children:this.getEdge()})},e.prototype.getTextStyle=function(){},e.prototype.getText=function(){var t,r=this.props,o=r.model,i=r.graphModel,a=i.editConfigModel;if(a.edgeTextMode!==st.TEXT||o.state===X.TEXT_EDIT)return null;if(o.text){var s=!1;return a.edgeTextDraggable&&o.text.draggable&&(s=!0),x(os,{ref:this.textRef,editable:a.edgeTextEdit&&((t=o.text.editable)!==null&&t!==void 0?t:!0),model:o,graphModel:i,draggable:s})}return null},e.prototype.getArrowInfo=function(){var t=this.props.model,r=t.startPoint,o=t.endPoint,i=t.isSelected,a=this.state.hover;return{start:r,end:o,hover:a,isSelected:i}},e.prototype.getLastTwoPoints=function(){var t=this.props.model,r=t.startPoint,o=t.endPoint;return[r,o]},e.prototype.getArrowStyle=function(){return console.error("getArrowStyle is deprecated in 1.2.0, please use model.getArrowStyle"),null},e.prototype.getArrow=function(){var t=this.props.model,r=t.id,o=t.getArrowStyle(),i=o.refY,a=i===void 0?0:i,s=o.refX,l=s===void 0?2:s,d=Es(this.getLastTwoPoints(),2),u=d[0],f=d[1],c="auto";return u!==null&&f!==null&&(c=$i(Fi({x:f.x-u.x,y:f.y-u.y}))),x("g",{children:x("defs",{children:[x("marker",{id:"marker-start-".concat(r),refX:-l,refY:a,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse",children:this.getStartArrow()}),x("marker",{id:"marker-end-".concat(r),refX:l,refY:a,overflow:"visible",orient:c,markerUnits:"userSpaceOnUse",children:this.getEndArrow()})]})})},e.prototype.getStartArrow=function(){return x("path",{})},e.prototype.getEndArrow=function(){var t=this.props.model,r=t.getArrowStyle(),o=r.stroke,i=r.strokeWidth,a=r.offset,s=r.verticalLength;return x("path",{stroke:o,fill:o,strokeWidth:i,transform:"rotate(180)",d:"M 0 0 L ".concat(a," -").concat(s," L ").concat(a," ").concat(s," Z")})},e.prototype.getAdjustPointShape=function(t,r,o){var i=o.getAdjustPointStyle();return x(re,ge({className:"lf-edge-adjust-point"},i,{x:t,y:r}))},e.prototype.getAdjustPoints=function(){var t=this.props,r=t.model,o=t.graphModel,i=o.editConfigModel,a=i.adjustEdgeStartAndEnd,s=i.adjustEdgeStart,l=i.adjustEdgeEnd,d=r.getAdjustStart(),u=r.getAdjustEnd();return x("g",{children:[a&&s&&x(kn,ge({type:xt.SOURCE},d,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:r,graphModel:o})),a&&l&&x(kn,ge({type:xt.TARGET},u,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:r,graphModel:o}))]})},e.prototype.getAnimation=function(){console.error("getAnimation is deprecated in 1.2.0, please use model.getEdgeAnimationStyle")},e.prototype.getAppendWidth=function(){return x("g",{})},e.prototype.getAppend=function(){return x("g",{className:"lf-edge-append",children:this.getAppendWidth()})},e.prototype.getEdge=function(){return null},e.prototype.toFront=function(){var t=this.props,r=t.graphModel,o=t.model;r.toFront(o.id)},e.prototype.render=function(){var t=this.props.model,r=t.isSelected,o=t.isHitable,i=t.isShowAdjustPoint;return x("g",{children:[x("g",{className:["lf-edge",!o&&"pointer-none",r&&"lf-edge-selected"].filter(Boolean).join(" "),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onContextMenu:this.handleContextMenu,onMouseOver:this.setHoverOn,onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,onFocus:this.handleFocus,onBlur:this.handleBlur,children:[this.getShape(),this.getAppend(),this.getText(),this.getArrow()]}),i&&r?this.getAdjustPoints():""]})},e.isObserved=!1,e}(K),Ms=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Yr=function(){return Yr=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Yr.apply(this,arguments)},Os=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},zn=function(n){Ms(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getEdge=function(){var t=this.props.model,r=t.getEdgeStyle(),o=t,i=o.path,a=o.isAnimation,s=o.arrowConfig,l=t.getEdgeAnimationStyle(),d=l.strokeDasharray,u=l.stroke,f=l.strokeDashoffset,c=l.animationName,h=l.animationDuration,y=l.animationIterationCount,p=l.animationTimingFunction,g=l.animationDirection;return x(Oe,Yr({d:i},r,s,a?{strokeDasharray:d,stroke:u,style:{strokeDashoffset:f,animationName:c,animationDuration:h,animationIterationCount:y,animationTimingFunction:p,animationDirection:g}}:{}))},e.prototype.getAppendWidth=function(){var t=this.props.model.path;return x(Oe,{d:t,strokeWidth:10,stroke:"transparent",fill:"none"})},e.prototype.getArrowInfo=function(){var t=this.props.model,r=this.state.hover,o=t.isSelected,i=t.getArrowStyle().offset,a=t.pointsList.map(function(f){return{x:f.x,y:f.y}}),s=Os(un(a,i),2),l=s[0],d=s[1],u={start:l,end:d,hover:r,isSelected:o};return u},e.prototype.getLastTwoPoints=function(){var t=this.props.model,r=t.getArrowStyle().offset,o=t.pointsList.map(function(i){return{x:i.x,y:i.y}});return un(o,r)},e}(or),Ss=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Hr=function(){return Hr=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Hr.apply(this,arguments)},Gn=function(n){Ss(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getEdge=function(){var t=this.props.model,r=t.startPoint,o=t.endPoint,i=t.isAnimation,a=t.arrowConfig,s=t.getEdgeStyle(),l=t.getEdgeAnimationStyle(),d=l.strokeDasharray,u=l.stroke,f=l.strokeDashoffset,c=l.animationName,h=l.animationDuration,y=l.animationIterationCount,p=l.animationTimingFunction,g=l.animationDirection;return x(ee,Hr({},s,{x1:r.x,y1:r.y,x2:o.x,y2:o.y},a,i?{strokeDasharray:d,stroke:u,style:{strokeDashoffset:f,animationName:c,animationDuration:h,animationIterationCount:y,animationTimingFunction:p,animationDirection:g}}:{}))},e.prototype.getAppendWidth=function(){var t=this.props.model,r=t.startPoint,o=t.endPoint,i={start:r,end:o},a=ri(i),s=a.d,l=a.strokeWidth,d=a.fill,u=a.strokeDasharray,f=a.stroke;return x(Oe,{d:s,fill:d,strokeWidth:l,stroke:f,strokeDasharray:u})},e}(or),ws=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Xt=function(){return Xt=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Xt.apply(this,arguments)},As=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},Fn=function(n){ws(e,n);function e(){var t=n.call(this)||this;return t.onDragStart=function(){var r=t.props.model;r.dragAppendStart(),t.isShowAdjustPointTemp=r.isShowAdjustPoint,r.isShowAdjustPoint=!1},t.onDragging=function(r){var o=r.deltaX,i=r.deltaY,a=t.props,s=a.model,l=a.graphModel;t.isDragging=!0;var d=l.transformModel,u=l.editConfigModel,f=As(d.fixDeltaXY(o,i),2),c=f[0],h=f[1],y=s,p=u.adjustEdgeMiddle;p?t.appendInfo=y.dragAppendSimple(t.appendInfo,{x:c,y:h}):t.appendInfo=y.dragAppend(t.appendInfo,{x:c,y:h})},t.onDragEnd=function(){var r,o=t.props,i=o.model,a=o.graphModel.eventCenter,s=i;s.dragAppendEnd(),t.isDragging=!1,s.isShowAdjustPoint=(r=t.isShowAdjustPointTemp)!==null&&r!==void 0?r:!1,t.appendInfo=void 0,a.emit(T.EDGE_ADJUST,{data:s.getData()})},t.beforeDragStart=function(r,o){o.draggable&&t.drag.handleMouseDown(r),t.appendInfo=o},t.drag=new Mt({onDragStart:t.onDragStart,onDragging:t.onDragging,onDragEnd:t.onDragEnd,isStopPropagation:!1}),t}return e.prototype.getEdge=function(){var t=this.props.model,r=t.points,o=t.isAnimation,i=t.arrowConfig,a=t.getEdgeStyle(),s=t.getEdgeAnimationStyle(),l=s.strokeDasharray,d=s.stroke,u=s.strokeDashoffset,f=s.animationName,c=s.animationDuration,h=s.animationIterationCount,y=s.animationTimingFunction,p=s.animationDirection;return x(Si,Xt({points:r},a,i,o?{strokeDasharray:l,stroke:d,style:{strokeDashoffset:u,animationName:f,animationDuration:c,animationIterationCount:h,animationTimingFunction:y,animationDirection:p}}:{}))},e.prototype.getArrowInfo=function(){var t=this.props.model,r=t.points,o=t.isSelected,i=this.state.hover,a=kt(r),s=a[0],l=a[0];return a.length>=2&&(s=a[a.length-2],l=a[a.length-1]),{start:s,end:l,hover:i,isSelected:o}},e.prototype.getLastTwoPoints=function(){var t=this.props.model,r=t.points,o=kt(r),i=o[0],a=o[0];return o.length>=2&&(i=o[o.length-2],a=o[o.length-1]),[i,a]},e.prototype.getAppendAttributes=function(t){var r=t.start,o=t.end,i;if(r.x===o.x&&r.y===o.y)i="";else{var a={start:r,end:o,offset:10,verticalLength:5},s=xe(Xt(Xt({},a),{type:"start"})),l=xe(Xt(Xt({},a),{type:"end"}));i="M".concat(s.leftX," ").concat(s.leftY,`
|
||
L`).concat(s.rightX," ").concat(s.rightY,`
|
||
L`).concat(l.rightX," ").concat(l.rightY,`
|
||
L`).concat(l.leftX," ").concat(l.leftY," z")}return{d:i,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},e.prototype.getAppendShape=function(t){var r=this.getAppendAttributes(t),o=r.d,i=r.strokeWidth,a=r.fill,s=r.strokeDasharray,l=r.stroke;return x(Oe,{d:o,fill:a,strokeWidth:i,stroke:l,strokeDasharray:s})},e.prototype.getAppendWidth=function(){for(var t=this,r=this.props,o=r.model,i=r.graphModel,a=o.pointsList,s=o.draggable,l=[],d=a.length,u=function(h){var y="lf-polyline-append",p={start:{x:a[h].x,y:a[h].y},end:{x:a[h+1].x,y:a[h+1].y},startIndex:h,endIndex:h+1,direction:G.HORIZONTAL,draggable:!0},g=x("g",{className:y,children:f.getAppendShape(p)}),v=i.editConfigModel,_=v.adjustEdge,M=v.adjustEdgeMiddle;if(_&&s){var S=p.startIndex,O=p.endIndex,w=M&&(S===0||O===d-1);p.draggable=!w,p.start.x===p.end.x?(p.draggable&&(y+="-ew-resize"),p.direction=G.VERTICAL):p.start.y===p.end.y&&(p.draggable&&(y+="-ns-resize"),p.direction=G.HORIZONTAL),g=x("g",{className:f.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(A){return t.beforeDragStart(A,p)},children:x("g",{className:y,children:f.getAppendShape(p)})})}l.push(g)},f=this,c=0;c<d-1;c++)u(c);return x("g",{children:l})},e}(or),Jt=function(){return Jt=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Jt.apply(this,arguments)},Ps=function(){function n(e){var t=this;this.nodeConfig=null,this.fakeNode=null,this.stopDrag=function(){t.nodeConfig=null,window.document.removeEventListener("mouseup",t.stopDrag)},this.dragEnter=function(o){!t.nodeConfig||t.fakeNode||(t.fakeNode=t.lf.createFakeNode(Jt(Jt({},t.nodeConfig),t.clientToLocalPoint({x:o.clientX,y:o.clientY}))))},this.onDragOver=function(o){if(o.preventDefault(),t.fakeNode){var i=t.clientToLocalPoint({x:o.clientX,y:o.clientY}),a=i.x,s=i.y;t.fakeNode.moveTo(a,s);var l=t.fakeNode.getData();t.lf.setNodeSnapLine(l),t.lf.graphModel.eventCenter.emit(T.NODE_DND_DRAG,{data:l,e:o})}return!1},this.onDragLeave=function(){t.fakeNode&&(t.lf.removeNodeSnapLine(),t.lf.graphModel.removeFakeNode(),t.fakeNode=null)},this.onDrop=function(o){!t.lf.graphModel||!o||!t.nodeConfig||(t.lf.addNode(Jt(Jt({},t.nodeConfig),t.clientToLocalPoint({x:o.clientX,y:o.clientY})),T.NODE_DND_ADD,o),o.preventDefault(),o.stopPropagation(),t.nodeConfig=null,t.lf.removeNodeSnapLine(),t.lf.graphModel.removeFakeNode(),t.fakeNode=null)};var r=e.lf;this.lf=r}return n.prototype.clientToLocalPoint=function(e){var t=e.x,r=e.y,o=Zn(this.lf.options,["grid","size"]),i=this.lf.graphModel.getPointByClient({x:t,y:r}),a=i.canvasOverlayPosition,s=a.x,l=a.y,d=this.lf.graphModel.editConfigModel.snapGrid;return{x:te(s,o,d),y:te(l,o,d)}},n.prototype.startDrag=function(e){var t=this.lf.graphModel.editConfigModel;t!=null&&t.isSilentMode||(this.nodeConfig=e,window.document.addEventListener("mouseup",this.stopDrag))},n.prototype.eventMap=function(){return{onMouseEnter:this.dragEnter,onMouseOver:this.dragEnter,onMouseMove:this.onDragOver,onMouseLeave:this.onDragLeave,onMouseUp:this.onDrop}},n}();function Ts(n,e){n.on("node:mousemove",function(t){var r=t.data;e.setNodeSnapLine(r)}),n.on("node:mouseup",function(){e.clearSnapline()})}var Ds=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Ot=function(){return Ot=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Ot.apply(this,arguments)},Ns=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},bs=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},Cs=function(n){Ds(e,n);function e(t){var r=n.call(this,t)||this;return r.ref=Gr(),r.__prevText={type:"",text:"",id:""},r.keyupHandler=function(o){var i=r.props.graphModel.textEditElement;o.key==="Enter"&&o.altKey&&(i==null||i.setElementState(X.DEFAULT))},r.inputHandler=function(o){var i=o.target.innerText,a=r.props.graphModel.textEditElement;a&&(r.__prevText={type:a.type,text:i.replace(/(\r\n)+$|(\n)+$/,""),id:a.id})},r.keydownHandler=function(o){o.stopPropagation()},r.state={style:{left:0,top:0}},r}return e.getDerivedStateFromProps=function(t){var r,o=t.textEditElement,i=t.graphModel,a=i.transformModel,s=i.theme,l=s.inputText,d;if(o){if(!(!((r=o.text)===null||r===void 0)&&r.value)&&o.BaseType===$.EDGE){var u=o.text,f=o.textPosition,c=f.x,h=f.y;u.x=c,u.y=h,o.setText(u)}var y={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(o.BaseType===$.EDGE){var p=s.edgeText,g=p.overflowMode,v=p.lineHeight,_=p.wrapPadding,M=p.textWidth;M&&g==="autoWrap"&&(d=Ot(Ot({},y),{width:M,minWidth:M,lineHeight:v,padding:_}))}else if(o.BaseType===$.NODE){var S=s.nodeText,g=S.overflowMode,v=S.lineHeight,_=S.wrapPadding,M=S.textWidth,O=o.width,w=o.modelType,A=o.textWidth,b=A||M||O;(w!==j.TEXT_NODE&&g==="autoWrap"||w===j.TEXT_NODE&&M)&&(d=Ot(Ot({},y),{width:b,minWidth:b,lineHeight:v,padding:_}))}var R=o.text,L=R.x,z=R.y,I=bs(a.CanvasPointToHtmlPoint([L,z]),2),U=I[0],Y=I[1];return{style:Ot(Ot({left:U,top:Y},d),l)}}return null},e.prototype.componentDidUpdate=function(){var t=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),this.__prevText.id!==""){var r=this.__prevText,o=r.text,i=r.id;t.updateText(i,o),t.eventCenter.emit(T.TEXT_UPDATE,{data:Ot({},this.__prevText)}),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}},e.prototype.placeCaretAtEnd=function(t){if(window.getSelection!==void 0&&document.createRange!==void 0){var r=document.createRange();r.selectNodeContents(t),r.collapse(!1);var o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(r)}},e.prototype.render=function(){var t,r=this.props.graphModel.textEditElement,o=this.state.style;return r?x("div",{contentEditable:!0,className:"lf-text-input",style:o,ref:this.ref,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler,children:(t=r.text)===null||t===void 0?void 0:t.value},r.id):null},e.toolName="text-edit-tool",e=Ns([ot],e),e}(K),Ls=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),js=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},pr=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},Rs=function(n,e,t){if(t||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return n.concat(i||Array.prototype.slice.call(e))},Is=function(n){Ls(e,n);function e(t){var r=n.call(this,t)||this;r.handleMouseDown=function(s){r.stepDrag.handleMouseDown(s)},r.handleWheelEvent=function(s){var l,d;s.preventDefault();var u=s.deltaX,f=s.deltaY,c=s.clientX,h=s.clientY,y=s.ctrlKey,p=new WheelEvent("wheel",{deltaX:u,deltaY:f,clientX:c,clientY:h,ctrlKey:y});(d=(l=r.props.lf.container)===null||l===void 0?void 0:l.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))===null||d===void 0||d.dispatchEvent(p)},r.onDragging=function(s){var l=s.deltaX,d=s.deltaY,u=r.props,f=u.graphModel,c=u.lf,h=c.getTransform(),y=h.SCALE_X,p=h.SCALE_Y,g=f.getSelectElements(!0);f.moveNodes(g.nodes.map(function(v){return v.id}),l/y,d/p)},r.handleContextMenu=function(s){s.preventDefault();var l=r.props,d=l.graphModel,u=l.graphModel,f=u.eventCenter,c=u.selectElements,h=d.getPointByClient({x:s.clientX,y:s.clientY}),y={nodes:[],edges:[]},p=Rs([],pr(c.values()),!1);p.forEach(function(g){g.BaseType===$.NODE&&y.nodes.push(g.getData()),g.BaseType===$.EDGE&&y.edges.push(g.getData())}),f.emit(T.SELECTION_CONTEXTMENU,{data:y,e:s,position:h})};var o=t.graphModel,i=o.gridSize,a=o.eventCenter;return r.stepDrag=new Mt({onDragging:r.onDragging,step:i,eventType:"SELECTION",eventCenter:a}),r}return e.prototype.render=function(){var t,r,o=this.props.graphModel,i=o.selectElements,a=o.transformModel,s=this.props.lf.getTransform(),l=s.SCALE_X,d=s.SCALE_Y;if(!(i.size<=1)){var u=Number.MAX_SAFE_INTEGER,f=Number.MAX_SAFE_INTEGER,c=Number.MIN_SAFE_INTEGER,h=Number.MIN_SAFE_INTEGER;i.forEach(function(p){var g;p.BaseType===$.NODE&&(g=Yo(p)),p.BaseType===$.EDGE&&(g=Go(p)),g!==void 0&&(u=Math.min(u,g.x),f=Math.min(f,g.y),c=Math.max(c,g.x1),h=Math.max(h,g.y1))}),t=pr(a.CanvasPointToHtmlPoint([u,f]),2),u=t[0],f=t[1],r=pr(a.CanvasPointToHtmlPoint([c,h]),2),c=r[0],h=r[1];var y={left:"".concat(u-20*l/2,"px"),top:"".concat(f-20*d/2,"px"),width:"".concat(c-u+20*l,"px"),height:"".concat(h-f+20*d,"px"),"border-width":"".concat(2*l,"px")};return x("div",{className:"lf-multiple-select",style:y,onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}},e.toolName="multiple-select-tool",e=js([ot],e),e}(K),hr=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},Bs=[Cs,Is],Xs=function(){function n(e){var t=this;this.toolMap=new Map,this.disabledToolMap=new Map,this.instance=e,W(Bs,function(i){t.isDisabled(i.toolName)||t.registerTool(i.toolName,i)});var r=e.graphModel,o=r.eventCenter;o.on("".concat(T.GRAPH_TRANSFORM,",").concat(T.NODE_CLICK,",").concat(T.BLANK_CLICK," "),function(){var i,a=r.textEditElement,s=r.editConfigModel,l=s.edgeTextEdit,d=s.nodeTextEdit;(l||d)&&a&&((i=r.textEditElement)===null||i===void 0||i.setElementState(X.DEFAULT))})}return n.prototype.isDisabled=function(e){var t;return((t=this.instance.options.disabledTools)===null||t===void 0?void 0:t.indexOf(e))!==-1},n.prototype.registerTool=function(e,t){this.toolMap.set(e,t)},n.prototype.disableTool=function(e){var t=this.toolMap.get(e);if(t)return this.disabledToolMap.set(e,t),this.toolMap.delete(e),!0;throw new Error("禁用失败,不存在名为 ${tool} 的工具")},n.prototype.enableTool=function(e){var t=this.disabledToolMap.get(e);if(t)return this.toolMap.set(e,t),this.disabledToolMap.delete(e),!0;throw new Error("不存在名为 ${tool} 的工具")},n.prototype.getTools=function(){return Array.from(this.toolMap.values())},n.prototype.getInstance=function(){return this.instance},n.prototype.destroy=function(){this.toolMap.clear(),this.disabledToolMap.clear()},hr([E],n.prototype,"toolMap",void 0),hr([m],n.prototype,"disableTool",null),hr([m],n.prototype,"enableTool",null),n}(),kr=function(){return kr=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},kr.apply(this,arguments)},Ys=function(){function n(e){this.undos=[],this.redos=[],this.callbacks=[],this.stopWatch=null,this.curData=null,this.maxSize=50,this.waitTime=100,this.eventCenter=e}return n.prototype.add=function(e){Kr(Mo(this.undos),e)||(this.undos.push(e),Kr(this.curData,e)||(this.redos=[]),this.eventCenter.emit(T.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undoAble(),redoAble:this.redoAble()}}),this.undos.length>this.maxSize&&this.undos.shift())},n.prototype.undoAble=function(){return this.undos.length>1},n.prototype.undo=function(){if(this.undoAble()){var e=this.undos.pop();this.redos.push(e);var t=this.undos.pop();return this.curData=C(t),t}},n.prototype.redoAble=function(){return this.redos.length>0},n.prototype.redo=function(){if(this.redoAble()){var e=this.redos.pop();return this.curData=C(e),e}},n.prototype.watch=function(e){var t=this;this.stopWatch&&this.stopWatch(),this.undos.push(e.modelToGraphData()),this.stopWatch=bo(e,Vn(function(){var r=e.modelToHistoryData();r&&t.add(kr({},r))},this.waitTime))},n.prototype.destroy=function(){this.undos=[],this.redos=[],this.curData=null,this.stopWatch&&this.stopWatch()},n}();var gt=null;function $n(n,e){return n.x+=e,n.y+=e,Kn(n.text)||(n.text.x+=e,n.text.y+=e),n}function Un(n,e){return n.startPoint&&(n.startPoint.x+=e,n.startPoint.y+=e),n.endPoint&&(n.endPoint.x+=e,n.endPoint.y+=e),n.pointsList&&n.pointsList.length>0&&n.pointsList.forEach(function(t){t.x+=e,t.y+=e}),Kn(n.text)||(n.text.x+=e,n.text.y+=e),n}var Vt=40,ke=40;function Hs(n,e){var t=n.keyboard,r=t.options.keyboard;t.on(["cmd + c","ctrl + c"],function(){if(ke=Vt,!(r!=null&&r.enabled)||e.textEditElement)return!0;var o=n.options.guards,i=e.getSelectElements(!1),a=o&&o.beforeClone?o.beforeClone(i):!0;return!a||i.nodes.length===0&&i.edges.length===0?(gt=null,!0):(gt=i,gt.nodes.forEach(function(s){return $n(s,Vt)}),gt.edges.forEach(function(s){return Un(s,Vt)}),!1)}),t.on(["cmd + v","ctrl + v"],function(){if(!(r!=null&&r.enabled)||e.textEditElement)return!0;if(gt&&(gt.nodes||gt.edges)){n.clearSelectElements();var o=n.addElements(gt,ke);if(!o)return!0;o.nodes.forEach(function(i){return n.selectElementById(i.id,!0)}),o.edges.forEach(function(i){return n.selectElementById(i.id,!0)}),gt.nodes.forEach(function(i){return $n(i,Vt)}),gt.edges.forEach(function(i){return Un(i,Vt)}),ke=ke+Vt}return!1}),t.on(["cmd + z","ctrl + z"],function(){return!(r!=null&&r.enabled)||e.textEditElement?!0:(n.undo(),!1)}),t.on(["cmd + y","ctrl + y"],function(){return!(r!=null&&r.enabled)||e.textEditElement?!0:(n.redo(),!1)}),t.on(["backspace"],function(){if(!(r!=null&&r.enabled)||e.textEditElement)return!0;var o=e.getSelectElements(!0);return n.clearSelectElements(),o.edges.forEach(function(i){return i.id&&n.deleteEdge(i.id)}),o.nodes.forEach(function(i){return i.id&&n.deleteNode(i.id)}),!1})}var ks=function(){function n(e){e.keyboard||(e.keyboard={enabled:!1}),this.options=e;var t=e.lf;this.target=t.container,this.mousetrap=new No(this.target),e.keyboard.enabled&&!t.options.isSilentMode&&this.enable(!0)}return n.prototype.initShortcuts=function(){var e=this,t,r=((t=this.options.keyboard)!==null&&t!==void 0?t:{}).shortcuts;if(r)if(Oo(r))r.forEach(function(s){var l=s.keys,d=s.callback,u=s.action;return e.on(l,d,u)});else{var o=r.keys,i=r.callback,a=r.action;this.on(o,i,a)}},n.prototype.on=function(e,t,r){this.mousetrap.bind(this.getKeys(e),t,r)},Object.defineProperty(n.prototype,"disabled",{get:function(){var e,t;return((t=(e=this.options)===null||e===void 0?void 0:e.keyboard)===null||t===void 0?void 0:t.enabled)!==!0},enumerable:!1,configurable:!0}),n.prototype.off=function(e,t){this.mousetrap.unbind(this.getKeys(e),t)},n.prototype.enable=function(e){(this.disabled||e)&&(this.options.keyboard&&(this.options.keyboard.enabled=!0),this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))},n.prototype.disable=function(){this.disabled||(this.options.keyboard&&(this.options.keyboard.enabled=!1),this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))},n.prototype.destroy=function(){this.mousetrap.reset()},n.prototype.getKeys=function(e){var t=this;return(Array.isArray(e)?e:[e]).map(function(r){return t.formatKey(r)})},n.prototype.formatKey=function(e){return e.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")},n}(),Tt=function(){return Tt=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},Tt.apply(this,arguments)},ze=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i},vr=function(n,e,t){if(t||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return n.concat(i||Array.prototype.slice.call(e))},yr=Symbol("plugin registered by Logicflow.use"),zr=function(){function n(e){var t=this,r;this.viewMap=new Map,this.components=[],this.extension={},this.setView=function(d,u){return t.viewMap.set(d,u)},this.getView=function(d){return t.viewMap.get(d)};var o=_e.get(e),i=o.container,a=o.width,s=o.height;this.options=o,this.container=this.initContainer(i,a,s),this.graphModel=new ka(Tt(Tt({},o),{container:this.container})),this.plugins=(r=o.plugins)!==null&&r!==void 0?r:[];var l=this.graphModel.eventCenter;this.tool=new Xs(this),this.dnd=new Ps({lf:this}),this.history=new Ys(l),this.keyboard=new ks({lf:this,keyboard:o.keyboard}),o.snapline!==!1&&(this.snaplineModel=new za(this.graphModel),Ts(l,this.snaplineModel)),o.isSilentMode||(Hs(this,this.graphModel),this.keyboard.initShortcuts()),this.defaultRegister(),this.installPlugins(o.disabledPlugins)}return n.prototype.initContainer=function(e,t,r){var o=document.createElement("div");return o.style.position="relative",o.style.width=t?"".concat(t,"px"):"100%",o.style.height=r?"".concat(r,"px"):"100%",e.innerHTML="",e.appendChild(o),o},Object.defineProperty(n.prototype,Symbol.toStringTag,{get:function(){return n.toStringTag},enumerable:!1,configurable:!0}),n.prototype.register=function(e,t,r){if(r===void 0&&(r=!0),typeof e!="string"){this.registerElement(e);return}var o={BaseEdge:or,BaseEdgeModel:nr,BaseNode:Lt,BaseNodeModel:Ct,RectNode:jn,RectNodeModel:Dn,CircleNode:Rn,CircleNodeModel:wn,PolygonNode:In,PolygonNodeModel:Tn,TextNode:Yn,TextNodeModel:bn,LineEdge:Gn,LineEdgeModel:En,DiamondNode:Bn,DiamondNodeModel:An,PolylineEdge:Fn,PolylineEdgeModel:On,BezierEdge:zn,BezierEdgeModel:mn,EllipseNode:Xn,EllipseNodeModel:Pn,HtmlNode:Hn,HtmlNodeModel:Cn,h:Wn,type:e};if(this.viewMap.forEach(function(d){var u=d.extendKey;u&&(o[u]=d)}),this.graphModel.modelMap.forEach(function(d){var u=d.extendKey;u&&(o[u]=d)}),t){var i=t(o),a=i.view,s=i.model,l=a;r&&!l.isObserved&&(l.isObserved=!0,l=ot(l)),this.setView(e,l),this.graphModel.setModel(e,s)}},n.prototype.registerElement=function(e){var t=e.view;e.isObserverView!==!1&&!t.isObserved&&(t.isObserved=!0,t=ot(t)),this.setView(e.type,t),this.graphModel.setModel(e.type,e.model)},n.prototype.batchRegister=function(e){var t=this;e===void 0&&(e=[]),W(e,function(r){t.registerElement(r)})},n.prototype.defaultRegister=function(){var e=[{type:"rect",view:jn,model:Dn},{type:"circle",view:Rn,model:wn},{type:"polygon",view:In,model:Tn},{type:"text",view:Yn,model:bn},{type:"ellipse",view:Xn,model:Pn},{type:"diamond",view:Bn,model:An},{type:"html",view:Hn,model:Cn},{type:"line",view:Gn,model:En},{type:"polyline",view:Fn,model:On},{type:"bezier",view:zn,model:mn}];this.batchRegister(e)},n.prototype.addNode=function(e,t,r){return t===void 0&&(t=T.NODE_ADD),this.graphModel.addNode(e,t,r)},n.prototype.deleteNode=function(e){var t=this.graphModel.getNodeModelById(e);if(!t)return!1;var r=t.getData(),o=this.options.guards,i=o!=null&&o.beforeDelete?o.beforeDelete(r):!0;return i&&this.graphModel.deleteNode(e),i},n.prototype.cloneNode=function(e){var t=this.graphModel.getNodeModelById(e),r=t==null?void 0:t.getData();if(r){var o=this.options.guards,i=o!=null&&o.beforeClone?o.beforeClone(r):!0;if(i)return this.graphModel.cloneNode(e)}},n.prototype.changeNodeId=function(e,t){return this.graphModel.changeNodeId(e,t)},n.prototype.changeNodeType=function(e,t){this.graphModel.changeNodeType(e,t)},n.prototype.getNodeModelById=function(e){return this.graphModel.getNodeModelById(e)},n.prototype.getNodeDataById=function(e){var t=this.getNodeModelById(e);return t==null?void 0:t.getData()},n.prototype.getNodeIncomingEdge=function(e){return this.graphModel.getNodeIncomingEdge(e)},n.prototype.getNodeOutgoingEdge=function(e){return this.graphModel.getNodeOutgoingEdge(e)},n.prototype.getNodeIncomingNode=function(e){return this.graphModel.getNodeIncomingNode(e)},n.prototype.getNodeOutgoingNode=function(e){return this.graphModel.getNodeOutgoingNode(e)},n.prototype.createFakeNode=function(e){var t=this.graphModel.modelMap.get(e.type);if(!t)return console.warn("不存在为".concat(e.type,"类型的节点")),null;var r=new t(Tt(Tt({},e),{virtual:!0}),this.graphModel);return this.graphModel.setFakeNode(r),r},n.prototype.removeFakeNode=function(){this.graphModel.removeFakeNode()},n.prototype.setNodeSnapLine=function(e){var t;(t=this.snaplineModel)===null||t===void 0||t.setNodeSnapLine(e)},n.prototype.removeNodeSnapLine=function(){var e;(e=this.snaplineModel)===null||e===void 0||e.clearSnapline()},n.prototype.setDefaultEdgeType=function(e){this.graphModel.setDefaultEdgeType(e)},n.prototype.addEdge=function(e){return this.graphModel.addEdge(e)},n.prototype.getEdgeDataById=function(e){var t=this.getEdgeModelById(e);return t==null?void 0:t.getData()},n.prototype.getEdgeModelById=function(e){return this.graphModel.getEdgeModelById(e)},n.prototype.getEdgeModels=function(e){var t=e.sourceNodeId,r=e.targetNodeId,o=[],i=this.graphModel.edges;return t&&r?W(i,function(a){a.sourceNodeId===t&&a.targetNodeId===r&&o.push(a)}):t?W(i,function(a){a.sourceNodeId===t&&o.push(a)}):r&&W(i,function(a){a.targetNodeId===r&&o.push(a)}),o},n.prototype.changeEdgeId=function(e,t){return this.graphModel.changeEdgeId(e,t)},n.prototype.changeEdgeType=function(e,t){this.graphModel.changeEdgeType(e,t)},n.prototype.deleteEdge=function(e){var t=this.graphModel.getEdgeModelById(e);if(!t)return!1;var r=t.getData(),o=this.options.guards,i=o!=null&&o.beforeDelete?o.beforeDelete(r):!0;return i&&this.graphModel.deleteEdgeById(e),i},n.prototype.deleteEdgeByNodeId=function(e){var t=e.sourceNodeId,r=e.targetNodeId;t&&r?this.graphModel.deleteEdgeBySourceAndTarget(t,r):t?this.graphModel.deleteEdgeBySource(t):r&&this.graphModel.deleteEdgeByTarget(r)},n.prototype.getNodeEdges=function(e){return this.graphModel.getNodeEdges(e)},n.prototype.addElements=function(e,t){var r=this,o=e.nodes,i=e.edges;t===void 0&&(t=40);var a={},s={nodes:[],edges:[]};return W(o,function(l){var d=l.id,u=r.addNode(l);d&&(a[d]=u.id),s.nodes.push(u)}),W(i,function(l){var d=l.sourceNodeId,u=l.targetNodeId;a[d]&&(d=a[d]),a[u]&&(u=a[u]);var f=r.graphModel.addEdge(Tt(Tt({},l),{sourceNodeId:d,targetNodeId:u}));s.edges.push(f)}),s},n.prototype.selectElementById=function(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),this.graphModel.selectElementById(e,t),!t&&r&&this.graphModel.toFront(e)},n.prototype.getSelectElements=function(e){return e===void 0&&(e=!0),this.graphModel.getSelectElements(e)},n.prototype.clearSelectElements=function(){this.graphModel.clearSelectElements()},n.prototype.getModelById=function(e){return this.graphModel.getElement(e)},n.prototype.getDataById=function(e){var t;return(t=this.graphModel.getElement(e))===null||t===void 0?void 0:t.getData()},n.prototype.deleteElement=function(e){var t,r,o,i=this.getModelById(e);if(!i)return!1;var a=(t={},t[$.NODE]=this.deleteNode,t[$.EDGE]=this.deleteEdge,t);return(o=(r=a[i.BaseType])===null||r===void 0?void 0:r.call(this,e))!==null&&o!==void 0?o:!1},n.prototype.setElementZIndex=function(e,t){return this.graphModel.setElementZIndex(e,t)},n.prototype.getAreaElement=function(e,t,r,o,i){return r===void 0&&(r=!0),o===void 0&&(o=!0),i===void 0&&(i=!1),this.graphModel.getAreaElement(e,t,r,o,i).map(function(a){return a.getData()})},n.prototype.setProperties=function(e,t){var r;(r=this.graphModel.getElement(e))===null||r===void 0||r.setProperties(et(t))},n.prototype.getProperties=function(e){var t;return(t=this.graphModel.getElement(e))===null||t===void 0?void 0:t.getProperties()},n.prototype.deleteProperty=function(e,t){var r;(r=this.graphModel.getElement(e))===null||r===void 0||r.deleteProperty(t)},n.prototype.updateAttributes=function(e,t){this.graphModel.updateAttributes(e,t)},n.prototype.editText=function(e){this.graphModel.editText(e)},n.prototype.updateText=function(e,t){this.graphModel.updateText(e,t)},n.prototype.updateEditConfig=function(e){var t=this.graphModel,r=t.editConfigModel,o=t.transformModel,i=r.snapGrid;if(r.updateEditConfig(e),(e==null?void 0:e.stopMoveGraph)!==void 0&&o.updateTranslateLimits(e.stopMoveGraph),e!=null&&e.isSilentMode?this.keyboard.disable():this.keyboard.enable(!0),!ht(e==null?void 0:e.snapGrid)&&e.snapGrid!==i){var a=this.graphModel.grid.size,s=a===void 0?1:a;this.graphModel.updateGridSize(e.snapGrid?s:1)}},n.prototype.getEditConfig=function(){return this.graphModel.editConfigModel.getConfig()},n.prototype.setTheme=function(e){this.graphModel.setTheme(e)},n.prototype.focusByElement=function(e){var t=void 0,r=this.getNodeModelById(e);if(r){var o=r.getData(),i=o.x,a=o.y;t={x:i,y:a}}var s=this.getEdgeModelById(e);if(s){var l=s.textPosition,i=l.x,a=l.y;t={x:i,y:a}}t&&this.focusByCoordinate(t)},n.prototype.focusByCoordinate=function(e){var t=this.graphModel,r=t.transformModel,o=t.width,i=t.height,a=e.x,s=e.y;r.focusOn(a,s,o,i)},n.prototype.focusOn=function(e){if(typeof e=="string")this.focusByElement(e);else if("x"in e&&"y"in e)this.focusByCoordinate(e);else{var t=e.id,r=e.coordinate;t&&this.focusByElement(t),r&&this.focusByCoordinate(r)}},n.prototype.resize=function(e,t){this.graphModel.resize(e,t),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height},n.prototype.toFront=function(e){this.graphModel.toFront(e)},n.prototype.getPointByClient=function(e,t){if(typeof e=="object")return this.graphModel.getPointByClient(e);if(typeof t=="number")return this.graphModel.getPointByClient({x:e,y:t})},n.prototype.getGraphData=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.getGraphRawData();return this.adapterOut?this.adapterOut.apply(this,vr([r],ze(e),!1)):r},n.prototype.getGraphRawData=function(){return this.graphModel.modelToGraphData()},n.prototype.clearData=function(){this.graphModel.clearData(),this.render({})},n.prototype.renderRawData=function(e){this.graphModel.graphDataToModel(et(e)),this.options.history!==!1&&this.history.watch(this.graphModel),Zr(x(Va,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(T.GRAPH_RENDERED,{data:this.graphModel.modelToGraphData(),graphModel:this.graphModel})},n.prototype.render=function(e){var t=C(e);this.adapterIn&&(t=this.adapterIn(t)),this.renderRawData(t)},n.prototype.undo=function(){if(this.history.undoAble()){var e=et(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(e)}},n.prototype.redo=function(){if(this.history.redoAble()){var e=et(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(e)}},n.prototype.zoom=function(e,t){var r=this.graphModel.transformModel;return r.zoom(e,t)},n.prototype.resetZoom=function(){var e=this.graphModel.transformModel;e.resetZoom()},n.prototype.setZoomMiniSize=function(e){var t=this.graphModel.transformModel;t.setZoomMiniSize(e)},n.prototype.setZoomMaxSize=function(e){var t=this.graphModel.transformModel;t.setZoomMaxSize(e)},n.prototype.getTransform=function(){var e=this.graphModel.transformModel,t=e.SCALE_X,r=e.SCALE_Y,o=e.TRANSLATE_X,i=e.TRANSLATE_Y;return{SCALE_X:t,SCALE_Y:r,TRANSLATE_X:o,TRANSLATE_Y:i}},n.prototype.translate=function(e,t){var r=this.graphModel.transformModel;r.translate(e,t)},n.prototype.resetTranslate=function(){var e=this.graphModel.transformModel,t=e.TRANSLATE_X,r=e.TRANSLATE_Y;this.translate(-t,-r)},n.prototype.translateCenter=function(){this.graphModel.translateCenter()},n.prototype.fitView=function(e,t){t===void 0&&(t=e),this.graphModel.fitView(e,t)},n.prototype.openEdgeAnimation=function(e){this.graphModel.openEdgeAnimation(e)},n.prototype.closeEdgeAnimation=function(e){this.graphModel.closeEdgeAnimation(e)},n.prototype.on=function(e,t){this.graphModel.eventCenter.on(e,t)},n.prototype.off=function(e,t){this.graphModel.eventCenter.off(e,t)},n.prototype.once=function(e,t){this.graphModel.eventCenter.once(e,t)},n.prototype.emit=function(e,t){this.graphModel.eventCenter.emit(e,t)},n.use=function(e,t){var r,o=e.pluginName;if(!o)throw new Error("请给插件指定 pluginName!");this.extensions.set(o,(r={},r[yr]=yr,r.extension=e,r.props=t,r))},n.prototype.installPlugins=function(e){var t=this;e===void 0&&(e=[]);var r=Array.from(n.extensions,function(i){var a=ze(i,2),s=a[1];return s}),o=vr(vr([],ze(this.plugins),!1),ze(r),!1);W(o,function(i){var a,s;yr in i?(a=i.extension,s=i.props):a=i;var l=a==null?void 0:a.pluginName;So(e,l)===-1&&t.installPlugin(a,s)})},n.prototype.installPlugin=function(e,t){var r,o;if("pluginName"in e&&"install"in e){var i=e.pluginName,a=e.install,s=e.render;i&&(a&&a.call(e,this,n),s&&this.components.push(s.bind(e)),this.extension[i]=e);return}var l=e,d=l.pluginName,u=new l({lf:this,LogicFlow:n,props:t,options:(o=(r=this.options.pluginsOptions)===null||r===void 0?void 0:r[d])!==null&&o!==void 0?o:{}});u.render&&this.components.push(u.render.bind(u)),this.extension[d]=u},n.prototype.destroy=function(){this.clearData(),Zr(null,this.container),this.keyboard.destroy(),this.graphModel.destroy(),this.tool.destroy(),this.history.destroy()},n.extensions=new Map,n}();(function(n){n.toStringTag="LF.".concat(n.name)})(zr||(zr={}));const Ks=zr;function ot(n){return yo(n)}export{Ks as L};
|