@next-bricks/diagram 0.33.0 → 0.33.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +1 -1
- package/dist/chunks/5030.d3abbe90.js +2 -0
- package/dist/chunks/5030.d3abbe90.js.map +1 -0
- package/dist/chunks/{5576.0326daa6.js → 5576.4aa3c030.js} +2 -2
- package/dist/chunks/5576.4aa3c030.js.map +1 -0
- package/dist/chunks/eo-display-canvas.1de621b4.js +2 -0
- package/dist/chunks/eo-display-canvas.1de621b4.js.map +1 -0
- package/dist/chunks/{main.106a920a.js → main.01b6daf9.js} +2 -2
- package/dist/chunks/{main.106a920a.js.map → main.01b6daf9.js.map} +1 -1
- package/dist/examples.json +3 -3
- package/dist/index.2de5bb8f.js +2 -0
- package/dist/{index.d47a391d.js.map → index.2de5bb8f.js.map} +1 -1
- package/dist/manifest.json +77 -77
- package/dist-types/shared/canvas/useZoom.d.ts +2 -1
- package/package.json +2 -2
- package/dist/chunks/5030.6b95fdb2.js +0 -2
- package/dist/chunks/5030.6b95fdb2.js.map +0 -1
- package/dist/chunks/5576.0326daa6.js.map +0 -1
- package/dist/chunks/eo-display-canvas.37292aa3.js +0 -2
- package/dist/chunks/eo-display-canvas.37292aa3.js.map +0 -1
- package/dist/index.d47a391d.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_next_bricks_diagram=self.webpackChunk_next_bricks_diagram||[]).push([[5576],{5576:(e,t,n)=>{n.r(t);var a,r,i,o,s,l,c,u,d,h,f,g,p,v,m,b,y,w,k,A,E,C,M,x,N,W,z,T,R,S,L,D,B,O,P,j,I,H,K,Y,U,X,V,_,F,Z,q,J,$,G,Q,ee,te,ne,ae,re=n(4635),ie=n(918),oe=n(1369),se=n(8449),le=n(4521),ce=n(8769),ue=n.n(ce),de=n(9929),he=n(9938),fe=(n(330),n(7566)),ge=n(1517),pe=n(3373),ve=n.n(pe),me=n(1030),be=n(9126),ye=n(8892),we=n(5157),ke=n(8308),Ae=n(6457),Ee=n(9137),Ce=n(2547),Me=n(1803),xe=n(3739),Ne=n(9191),We=n(6671),ze=n(8060),Te=n(2448),Re=n(8657),Se=n(8069),Le=n(1324),De=n(821),Be=n(6753),Oe=n(2673),Pe=n(5987);function je(e,t,n){return n(Ke(e,t))}function Ie(e,t,n){return e.set(Ke(e,t),n),n}function He(e,t){return e.get(Ke(e,t))}function Ke(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var Ye,{defineElement:Ue,property:Xe,event:Ve,method:_e}=(0,de.createDecorators)(),Fe=(0,ce.forwardRef)(Ct),Ze=new WeakMap,qe=new WeakMap,Je=new WeakMap,$e=new WeakMap,Ge=new WeakMap,Qe=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap,at=new WeakMap,rt=new WeakMap,it=new WeakMap,ot=new WeakMap,st=new WeakMap,lt=new WeakMap,ct=new WeakSet,ut=new WeakMap,dt=new WeakMap,ht=new WeakMap,ft=new WeakMap,gt=new WeakMap,pt=new WeakMap,vt=new WeakMap,mt=new WeakMap,bt=new WeakMap,yt=new WeakMap,wt=new WeakMap,kt=new WeakMap,At=new WeakMap;class Et extends he.ReactNextElement{constructor(){super(...arguments),(0,re.A)(this,ct),(0,ie.A)(this,Ze,(a(this),i(this))),(0,ie.A)(this,qe,(o(this),s(this))),(0,ie.A)(this,Je,(l(this),c(this))),(0,ie.A)(this,$e,(u(this),d(this))),(0,ie.A)(this,Ge,(h(this),f(this))),(0,ie.A)(this,Qe,(g(this),p(this))),(0,ie.A)(this,et,(v(this),m(this))),(0,ie.A)(this,tt,(b(this),y(this))),(0,ie.A)(this,nt,(w(this),k(this))),(0,ie.A)(this,at,(A(this),E(this))),(0,ie.A)(this,rt,(C(this),M(this,!0))),(0,ie.A)(this,it,(x(this),N(this,!0))),(0,ie.A)(this,ot,(W(this),z(this,!0))),(0,ie.A)(this,st,(T(this),R(this))),(0,ie.A)(this,lt,(S(this),L(this))),(0,ie.A)(this,ut,(O(this),e=>{je(ct,this,D).emit(e)})),(0,ie.A)(this,dt,P(this)),(0,ie.A)(this,ht,(H(this),e=>{je(ct,this,j).emit(e)})),(0,ie.A)(this,ft,K(this)),(0,ie.A)(this,gt,(X(this),e=>{je(ct,this,Y).emit(e)})),(0,ie.A)(this,pt,V(this)),(0,ie.A)(this,vt,(Z(this),e=>{je(ct,this,_).emit(e)})),(0,ie.A)(this,mt,q(this)),(0,ie.A)(this,bt,(G(this),e=>{je(ct,this,J).emit(e)})),(0,ie.A)(this,yt,Q(this)),(0,ie.A)(this,wt,(ne(this),e=>{je(ct,this,ee).emit(e)})),(0,ie.A)(this,kt,(e=>{(0,Oe.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,ie.A)(this,At,(0,ce.createRef)())}get layout(){return He(Ze,this)}set layout(e){Ie(Ze,this,e)}get nodes(){return He(qe,this)}set nodes(e){Ie(qe,this,e)}get edges(){return He(Je,this)}set edges(e){Ie(Je,this,e)}get nodeBricks(){return He($e,this)}set nodeBricks(e){Ie($e,this,e)}get lines(){return He(Ge,this)}set lines(e){Ie(Ge,this,e)}get layoutOptions(){return He(Qe,this)}set layoutOptions(e){Ie(Qe,this,e)}get activeTarget(){return He(et,this)}set activeTarget(e){Ie(et,this,e)}get disableKeyboardAction(){return He(tt,this)}set disableKeyboardAction(e){Ie(tt,this,e)}get connectNodes(){return He(nt,this)}set connectNodes(e){Ie(nt,this,e)}get dragNodes(){return He(at,this)}set dragNodes(e){Ie(at,this,e)}get zoomable(){return He(rt,this)}set zoomable(e){Ie(rt,this,e)}get scrollable(){return He(it,this)}set scrollable(e){Ie(it,this,e)}get pannable(){return He(ot,this)}set pannable(e){Ie(ot,this,e)}get scaleRange(){return He(st,this)}set scaleRange(e){Ie(st,this,e)}callOnLineLabel(e,t){for(var n,a=arguments.length,r=new Array(a>2?a-2:0),i=2;i<a;i++)r[i-2]=arguments[i];null===(n=He(At,this).current)||void 0===n||n.callOnLineLabel(e,t,...r)}render(){return ue().createElement(Fe,{ref:He(At,this),layout:this.layout,nodes:this.nodes,edges:this.edges,nodeBricks:this.nodeBricks,lines:this.lines,layoutOptions:this.layoutOptions,connectNodes:this.connectNodes,dragNodes:this.dragNodes,activeTarget:this.activeTarget,disableKeyboardAction:this.disableKeyboardAction,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:He(ut,this),onSwitchActiveTarget:He(kt,this),onNodeDelete:He(ht,this),onEdgeDelete:He(gt,this),onLineClick:He(vt,this),onLineDoubleClick:He(bt,this),onNodesConnect:He(wt,this)})}}function Ct(e,t){var{layout:n,nodes:a,edges:r,nodeBricks:i,lines:o,layoutOptions:s,connectNodes:l,dragNodes:c,activeTarget:u,disableKeyboardAction:d,zoomable:h,scrollable:f,pannable:g,scaleRange:p,onActiveTargetChange:v,onSwitchActiveTarget:m,onNodeDelete:b,onEdgeDelete:y,onLineClick:w,onLineDoubleClick:k,onNodesConnect:A}=e,[E,C]=(0,ce.useState)(!1),[M,x]=(0,ce.useState)(0),[N,W]=(0,ce.useState)(null),[z,T]=(0,ce.useState)(!1),[R,S]=(0,ce.useState)(0),[L,D]=(0,ce.useState)(null),[B,O]=(0,ce.useState)([]),[P,j]=(0,ce.useState)(!1),[I,H]=(0,ce.useState)({k:1,x:0,y:0}),K=(0,ce.useRef)(new Map),Y=(0,ce.useRef)(null),U=(0,ce.useRef)(null),[X,V]=(0,ce.useState)(!1),{userViewReady:_,userViewNodesMap:F,saveUserView:Z}=(0,Be._)(null==c?void 0:c.save),[q,J]=(0,ce.useState)([0,0]),[$,G]=(0,ce.useState)(null),[Q,ee]=(0,ce.useState)("initial"),[te,ne]=(0,ce.useState)(null);(0,ce.useImperativeHandle)(t,(()=>({callOnLineLabel(e,t){for(var n,a=arguments.length,r=new Array(a>2?a-2:0),i=2;i<a;i++)r[i-2]=arguments[i];null==L||null===(n=L.get(e))||void 0===n||null===(n=n.firstElementChild)||void 0===n||n[t](...r)}}))),(0,ce.useEffect)((()=>{var e=e=>{(0,Te.P)(e,{nodes:a,nodesRefRepository:N,connectNodes:l,dragNodes:c,scale:I.k,setConnectLineState:G,setConnectLineTo:J,setManualLayoutStatus:ee,setNodeMovement:ne,onSwitchActiveTarget:m,onNodesConnect:A})},t=U.current;return null==t||t.addEventListener("mousedown",e),()=>{null==t||t.removeEventListener("mousedown",e)}}),[a,l,c,I.k,N,A,m]);var{normalizedLines:ae,normalizedLinesMap:re,markers:ie}=(0,ce.useMemo)((()=>(0,Ee.t)(r,o)),[r,o]),oe=(0,ce.useMemo)((()=>ae.flatMap((e=>{var t,n,{line:{text:a,label:r,$id:i},edge:o}=e;return a||r?(r?(t="label",n=[].concat(r)):(t="text",n=[].concat(a)),n.map((e=>{var n;return{[t]:e,id:"".concat(i,"-").concat(null!==(n=e.placement)&&void 0!==n?n:"center"),edge:o}}))):[]}))),[ae]),{nodes:se,edges:le}=(0,Se.o)({layout:n,nodes:a,edges:r,manualLayoutStatus:Q,userViewReady:_,userViewNodesMap:F,nodeMovement:te,nodesRefRepository:N,lineLabelsRefRepository:L,normalizedLinesMap:re,layoutOptions:s,nodesRenderId:M,lineLabelsRenderId:R});(0,ce.useEffect)((()=>{"finished"===Q&&Z(se.map((e=>({id:e.id,x:e.x,y:e.y}))))}),[Q]);var de=(0,ce.useMemo)((()=>(0,Ae.R)(le,se,ae)),[ae,se,le]),he=null!=u?u:null,[pe,De]=(0,ce.useState)(he);(0,ce.useEffect)((()=>{De((e=>(0,Oe.c)(e,he)?e:he))}),[he]);var je=(0,ce.useRef)(!1);(0,ce.useEffect)((()=>{je.current?null==v||v(pe):je.current=!0}),[pe,v]),(0,ce.useEffect)((()=>{var e=Y.current;if(e&&!d){var t=e=>{var t=(0,we.a)(e,{renderedNodes:se,activeTarget:pe});"delete-node"===(null==t?void 0:t.action)?null==b||b(t.node):"delete-edge"===(null==t?void 0:t.action)?null==y||y(t.edge):"switch-active-node"===(null==t?void 0:t.action)&&t.node&&(null==m||m({type:"node",nodeId:t.node.id}))};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}}),[pe,se,d,m,b,y]);var Ie=(0,ce.useCallback)((e=>{e&&(x((e=>e+1)),W(e)),C((t=>t||!!e))}),[]),He=(0,ce.useCallback)((e=>{e&&(S((e=>e+1)),D(e)),T((t=>t||!!e))}),[]),Ke=(0,ce.useMemo)((()=>null!=p?p:[Re.sS,Re.Yt]),[p]),Ye=(0,ce.useMemo)((()=>(0,ge.s_)()),[]);(0,ce.useEffect)((()=>{var e=!1;Ye.scaleExtent(h?Ke:[1,1]).on("start",(()=>{e=!1,j(!0)})).on("zoom",(t=>{e=!0,H(t.transform)})).on("end",(()=>{j(!1),e||null==m||m(null)}))}),[m,Ke,h,Ye]),(0,ce.useEffect)((()=>{var e=Y.current;if(e){var t=(0,fe.A)(e),n=()=>{t.on(".zoom",null).on(".zoom.custom",null).on("wheel",null)};if(h||f||g)return(h||f)&&t.on("wheel.zoom.custom",(e=>{e.ctrlKey||(e.stopImmediatePropagation(),f&&(e.preventDefault(),Ye.translateBy(t,e.wheelDeltaX/5,e.wheelDeltaY/5)))})),t.call(Ye).on("wheel",(e=>e.preventDefault())).on("dblclick.zoom",null),g||t.on("mousedown.zoom",null).on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),n;n()}}),[g,f,h,Ye]),(0,ce.useEffect)((()=>{var e=Y.current;if(0!==se.length&&e&&!X){var{k:t,x:n,y:a}=(0,ke.r)(se,{canvasWidth:e.clientWidth,canvasHeight:e.clientHeight,scaleRange:h?Ke:void 0});Ye.transform((0,fe.A)(e),new ge.uV(t,n,a)),V(!0)}}),[X,se,Ke,h,Ye]);var Ue=(0,ce.useMemo)((()=>"".concat((0,me.uniqueId)("diagram-"),"-")),[]),Xe="".concat(Ue,"line-arrow-"),Ve="".concat(Ue,"mask-"),_e="".concat(Ue,"active-line-");(0,ce.useEffect)((()=>{O((e=>(0,ze.z)(e,de,K.current)))}),[de]);var[Fe,Ze]=ue().useState(new Map);return(0,ce.useEffect)((()=>{if(L){(0,Le.F)(B,L);var e=new be.A((()=>{Ze((0,Pe.G)(B,L))}));for(var t of L.values())e.observe(t);return()=>{e.disconnect()}}}),[R,L,B]),"dagre"!==n&&"force"!==n?ue().createElement("div",null,'Diagram layout not supported: "'.concat(n,'"')):ue().createElement("div",{className:ve()("diagram",{ready:E&&X,grabbing:P,pannable:g}),tabIndex:-1,ref:Y},ue().createElement("svg",{width:"100%",height:"100%",className:"lines"},ue().createElement("defs",null,ie.map(((e,t)=>{var{type:n,strokeColor:a}=e;return ue().createElement(xe.c,{key:t,id:"".concat(Xe).concat(t),type:n,strokeColor:a})})),[...Fe].map((e=>{var[t,n]=e;return ue().createElement(Ne.y,{key:t,lineId:t,rects:n,maskPrefix:Ve,renderedLineLabels:B})})),ue().createElement("marker",{id:"".concat(_e,"start"),viewBox:"0 0 8 8",refX:4,refY:4,markerWidth:8,markerHeight:8,orient:"auto"},ue().createElement("path",{d:"M 0.5 0.5 H 7.5 V 7.5 H 0.5 Z",stroke:"var(--palette-gray-7)",strokeWidth:1,fill:"var(--palette-gray-1)"})),ue().createElement("marker",{id:"".concat(_e,"end"),viewBox:"0 0 14 8",refX:3,refY:4,markerWidth:14,markerHeight:8,orient:"auto"},ue().createElement("path",{d:"M 0.5 1.5 L 5.5 4 L 0.5 6.5 z",stroke:"var(--palette-blue-3)",strokeWidth:1,fill:"var(--palette-blue-3)"}),ue().createElement("path",{d:"M 6.5 0.5 H 13.5 V 7.5 H 6.5 Z",stroke:"var(--palette-gray-7)",strokeWidth:1,fill:"var(--palette-gray-1)"}))),ue().createElement("g",{transform:"translate(".concat(I.x," ").concat(I.y,") scale(").concat(I.k,")")},de.map((e=>ue().createElement(Me.m,{key:e.line.$id,line:e,linePaths:K.current,lineMaskRects:Fe,maskPrefix:Ve,markerPrefix:Xe,activeLineMarkerPrefix:_e,active:"edge"===(null==pe?void 0:pe.type)&&pe.edge.source===e.edge.source&&pe.edge.target===e.edge.target,activeRelated:"node"===(null==pe?void 0:pe.type)&&(e.edge.source===pe.nodeId||e.edge.target===pe.nodeId),onLineClick:w,onLineDoubleClick:k}))))),ue().createElement("div",{className:ve()("line-labels",{ready:z}),style:{left:I.x,top:I.y,transform:"scale(".concat(I.k,")")}},ue().createElement(Ce.d2,{labels:oe,onRendered:He})),ue().createElement("div",{className:"nodes",ref:U,style:{left:I.x,top:I.y,transform:"scale(".concat(I.k,")")}},ue().createElement(ye.p,{nodes:a,nodeBricks:i,onRendered:Ie})),ue().createElement(We.w,{connectLineState:$,connectLineTo:q,markerPrefix:Xe}))}ae=Et,({e:[i,o,s,l,c,u,d,h,f,g,p,v,m,b,y,w,k,A,E,C,M,x,N,W,z,T,R,S,L,D,B,O,P,j,I,H,K,Y,U,X,V,_,F,Z,q,J,$,G,Q,ee,te,ne,a],c:[Ye,r]}=function(e,t,n,a,r,i){var o,s,l,c,u,d,h,f=Symbol.metadata||Symbol.for("Symbol.metadata"),g=Object.defineProperty,p=Object.create,v=[p(null),p(null)],m=t.length;function b(t,n,a){return function(r,i){n&&(i=r,r=e);for(var o=0;o<t.length;o++)i=t[o].apply(r,a?[i]:[]);return a?i:r}}function y(e,t,n,a){if("function"!=typeof e&&(a||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(a?"":" or undefined"));return e}function w(e,t,n,a,r,i,l,c,u,d,h){function f(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var p=[].concat(t[0]),m=t[3],w=!l,k=1===r,A=3===r,E=4===r,C=2===r;function M(t,n,a){return function(r,i){return n&&(i=r,r=e),a&&a(r),x[t].call(r,i)}}if(!w){var x={},N=[],W=A?"get":E||k?"set":"value";if(u?(d||k?x={get:(0,se.A)((function(){return m(this)}),a,"get"),set:function(e){t[4](this,e)}}:x[W]=m,d||(0,se.A)(x[W],a,C?"":W)):d||(x=Object.getOwnPropertyDescriptor(e,a)),!d&&!u){if((s=v[+c][a])&&7!=(s^r))throw new Error("Decorating two elements with the same name ("+x[W].name+") is not supported yet");v[+c][a]=r<3?1:r}}for(var z=e,T=p.length-1;T>=0;T-=n?2:1){var R=p[T],S=n?p[T-1]:void 0,L={},D={kind:["field","accessor","method","getter","setter","class"][r],name:a,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");y(t,"An initializer","be",!0),i.push(t)}.bind(null,L)};if(w)s=R.call(S,z,D),L.v=1,y(s,"class decorators","return")&&(z=s);else if(D.static=c,D.private=u,s=D.access={has:u?h.bind():function(e){return a in e}},E||(s.get=u?C?function(e){return f(e),x.value}:M("get",0,f):function(e){return e[a]}),C||A||(s.set=u?M("set",0,f):function(e,t){e[a]=t}),z=R.call(S,k?{get:x.get,set:x.set}:x[W],D),L.v=1,k){if("object"==typeof z&&z)(s=y(z.get,"accessor.get"))&&(x.get=s),(s=y(z.set,"accessor.set"))&&(x.set=s),(s=y(z.init,"accessor.init"))&&N.unshift(s);else if(void 0!==z)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else y(z,(d?"field":"method")+" decorators","return")&&(d?N.unshift(z):x[W]=z)}return r<2&&l.push(b(N,c,1),b(i,c,0)),d||w||(u?k?l.splice(-1,0,M("get",c),M("set",c)):l.push(C?x[W]:y.call.bind(x[W])):g(e,a,x)),z}function k(e){return g(e,f,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[f]),o=p(null==o?null:o),u=[],d=function(e){e&&u.push(b(e))},(h=function(t,a){for(var i=0;i<n.length;i++){var o=n[i],s=o[1],d=7&s;if((8&s)==t&&!d==a){var h=o[2],f=!!o[3],g=16&s;w(t?e:e.prototype,o,g,f?"#"+h:(0,oe.A)(h),d,d<2?[]:t?c=c||[]:l=l||[],u,!!t,f,a,t&&f?function(t){return(0,le.A)(t)===e}:r)}}})(8,0),h(0,0),h(8,1),h(0,1),d(l),d(c),s=u,m||k(e),{e:s,get c(){var n=[];return m&&[k(e=w(e,[t],0,e.name,5,n)),b(n,1)]}}}(ae,[Ue("eo-diagram",{styleTexts:[De.A]})],[[Xe({type:String}),1,"layout"],[Xe({attribute:!1}),1,"nodes"],[Xe({attribute:!1}),1,"edges"],[Xe({attribute:!1}),1,"nodeBricks"],[Xe({attribute:!1}),1,"lines"],[Xe({attribute:!1}),1,"layoutOptions"],[Xe({attribute:!1}),1,"activeTarget"],[Xe({type:Boolean}),1,"disableKeyboardAction"],[Xe({attribute:!1}),1,"connectNodes"],[Xe({attribute:!1}),1,"dragNodes"],[Xe({type:Boolean}),1,"zoomable"],[Xe({type:Boolean}),1,"scrollable"],[Xe({type:Boolean}),1,"pannable"],[Xe({attribute:!1}),1,"scaleRange"],[Ve({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>He(lt,e),(e,t)=>Ie(lt,e,t)],[Ve({type:"node.delete"}),1,"nodeDelete",e=>He(dt,e),(e,t)=>Ie(dt,e,t)],[Ve({type:"edge.delete"}),1,"edgeDelete",e=>He(ft,e),(e,t)=>Ie(ft,e,t)],[Ve({type:"line.click"}),1,"lineClick",e=>He(pt,e),(e,t)=>Ie(pt,e,t)],[Ve({type:"line.dblclick"}),1,"lineDoubleClick",e=>He(mt,e),(e,t)=>Ie(mt,e,t)],[Ve({type:"nodes.connect"}),1,"connectNodes",e=>He(yt,e),(e,t)=>Ie(yt,e,t)],[_e(),2,"callOnLineLabel"]],0,(e=>At.has((0,le.A)(e))),he.ReactNextElement)),r();var Mt,xt,Nt,Wt,zt,Tt,Rt,St,Lt,Dt,Bt,Ot,Pt,jt,It,Ht=n(3971);function Kt(e,t,n){return n(Xt(e,t))}function Yt(e,t,n){return e.set(Xt(e,t),n),n}function Ut(e,t){return e.get(Xt(e,t))}function Xt(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var Vt,{defineElement:_t,property:Ft,event:Zt,method:qt}=(0,de.createDecorators)(),Jt=(0,ce.forwardRef)(sn),$t=new WeakMap,Gt=new WeakMap,Qt=new WeakMap,en=new WeakSet,tn=new WeakMap,nn=new WeakMap,an=new WeakMap,rn=new WeakMap;class on extends he.ReactNextElement{constructor(){super(...arguments),(0,re.A)(this,en),(0,ie.A)(this,$t,(Mt(this),Nt(this))),(0,ie.A)(this,Gt,(Wt(this),zt(this))),(0,ie.A)(this,Qt,(Tt(this),Rt(this))),(0,ie.A)(this,tn,(Dt(this),e=>{Kt(en,this,St).emit(e)})),(0,ie.A)(this,nn,Bt(this)),(0,ie.A)(this,an,(jt(this),e=>{Kt(en,this,Ot).emit(e)})),(0,ie.A)(this,rn,(0,ce.createRef)())}get label(){return Ut($t,this)}set label(e){Yt($t,this,e)}get type(){return Ut(Gt,this)}set type(e){Yt(Gt,this,e)}enableEditing(){var e;null===(e=Ut(rn,this).current)||void 0===e||e.enableEditing()}render(){return ue().createElement(Jt,{ref:Ut(rn,this),label:this.label,onLabelEditingChange:Ut(tn,this),onLabelChange:Ut(an,this)})}}function sn(e,t){var{label:n,onLabelChange:a,onLabelEditingChange:r}=e,i=null!=n?n:"",[o,s]=(0,ce.useState)(i),[l,c]=(0,ce.useState)(!1),u=(0,ce.useRef)(!1),[d,h]=(0,ce.useState)(!1),f=(0,ce.useRef)(null);(0,ce.useImperativeHandle)(t,(()=>({enableEditing(){c(!0)}}))),(0,ce.useEffect)((()=>{s(i)}),[i]);var g=(0,ce.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),c(!0)}),[]);(0,ce.useEffect)((()=>{var e,t;l&&(null===(e=f.current)||void 0===e||e.focus({preventScroll:!0}),null===(t=f.current)||void 0===t||t.select())}),[l]),(0,ce.useEffect)((()=>{u.current?null==r||r(l):u.current=!0}),[l,r]);var p=(0,ce.useCallback)((e=>{s(e.target.value)}),[]),v=(0,ce.useCallback)((e=>{var t,n=e.key||e.keyCode||e.which;"Enter"!==n&&13!==n||null===(t=f.current)||void 0===t||t.blur()}),[]),m=(0,ce.useCallback)((()=>{c(!1),h(!0)}),[]);(0,ce.useEffect)((()=>{d&&(null==a||a(o),h(!1))}),[o,a,d]);var b=(0,ce.useCallback)((e=>{e.stopPropagation()}),[]);return ue().createElement("div",{className:ve()("label",{editing:l,empty:!o}),onDoubleClick:b,onMouseDown:b},ue().createElement("input",{className:"label-input",value:o,ref:f,onChange:p,onKeyDown:v,onBlur:m}),ue().createElement("div",{className:"label-text",onDoubleClick:g},o))}It=on,({e:[Nt,Wt,zt,Tt,Rt,St,Lt,Dt,Bt,Ot,Pt,jt,Mt],c:[Vt,xt]}=function(e,t,n,a,r,i){var o,s,l,c,u,d,h,f=Symbol.metadata||Symbol.for("Symbol.metadata"),g=Object.defineProperty,p=Object.create,v=[p(null),p(null)],m=t.length;function b(t,n,a){return function(r,i){n&&(i=r,r=e);for(var o=0;o<t.length;o++)i=t[o].apply(r,a?[i]:[]);return a?i:r}}function y(e,t,n,a){if("function"!=typeof e&&(a||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(a?"":" or undefined"));return e}function w(e,t,n,a,r,i,l,c,u,d,h){function f(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var p=[].concat(t[0]),m=t[3],w=!l,k=1===r,A=3===r,E=4===r,C=2===r;function M(t,n,a){return function(r,i){return n&&(i=r,r=e),a&&a(r),x[t].call(r,i)}}if(!w){var x={},N=[],W=A?"get":E||k?"set":"value";if(u?(d||k?x={get:(0,se.A)((function(){return m(this)}),a,"get"),set:function(e){t[4](this,e)}}:x[W]=m,d||(0,se.A)(x[W],a,C?"":W)):d||(x=Object.getOwnPropertyDescriptor(e,a)),!d&&!u){if((s=v[+c][a])&&7!=(s^r))throw new Error("Decorating two elements with the same name ("+x[W].name+") is not supported yet");v[+c][a]=r<3?1:r}}for(var z=e,T=p.length-1;T>=0;T-=n?2:1){var R=p[T],S=n?p[T-1]:void 0,L={},D={kind:["field","accessor","method","getter","setter","class"][r],name:a,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");y(t,"An initializer","be",!0),i.push(t)}.bind(null,L)};if(w)s=R.call(S,z,D),L.v=1,y(s,"class decorators","return")&&(z=s);else if(D.static=c,D.private=u,s=D.access={has:u?h.bind():function(e){return a in e}},E||(s.get=u?C?function(e){return f(e),x.value}:M("get",0,f):function(e){return e[a]}),C||A||(s.set=u?M("set",0,f):function(e,t){e[a]=t}),z=R.call(S,k?{get:x.get,set:x.set}:x[W],D),L.v=1,k){if("object"==typeof z&&z)(s=y(z.get,"accessor.get"))&&(x.get=s),(s=y(z.set,"accessor.set"))&&(x.set=s),(s=y(z.init,"accessor.init"))&&N.unshift(s);else if(void 0!==z)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else y(z,(d?"field":"method")+" decorators","return")&&(d?N.unshift(z):x[W]=z)}return r<2&&l.push(b(N,c,1),b(i,c,0)),d||w||(u?k?l.splice(-1,0,M("get",c),M("set",c)):l.push(C?x[W]:y.call.bind(x[W])):g(e,a,x)),z}function k(e){return g(e,f,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[f]),o=p(null==o?null:o),u=[],d=function(e){e&&u.push(b(e))},(h=function(t,a){for(var i=0;i<n.length;i++){var o=n[i],s=o[1],d=7&s;if((8&s)==t&&!d==a){var h=o[2],f=!!o[3],g=16&s;w(t?e:e.prototype,o,g,f?"#"+h:(0,oe.A)(h),d,d<2?[]:t?c=c||[]:l=l||[],u,!!t,f,a,t&&f?function(t){return(0,le.A)(t)===e}:r)}}})(8,0),h(0,0),h(8,1),h(0,1),d(l),d(c),s=u,m||k(e),{e:s,get c(){var n=[];return m&&[k(e=w(e,[t],0,e.name,5,n)),b(n,1)]}}}(It,[_t("diagram.editable-label",{styleTexts:[Ht.A]})],[[Ft(),1,"label"],[Ft({render:!1}),1,"type"],[Zt({type:"label.editing.change"}),1,"labelEditingChange",e=>Ut(Qt,e),(e,t)=>Yt(Qt,e,t)],[Zt({type:"label.change"}),1,"labelChange",e=>Ut(nn,e),(e,t)=>Yt(nn,e,t)],[qt(),2,"enableEditing"]],0,(e=>rn.has((0,le.A)(e))),he.ReactNextElement)),xt();var ln=n(4223),cn=n(9740),un=n(6330),dn=n(8438),hn=n(5748),fn=n(531),gn=n(8185),pn=n(2830);function vn(e){var{connectLineState:t,transform:n,markerEnd:a,onConnect:r}=e,[i,o]=(0,ce.useState)(null);return(0,ce.useEffect)((()=>{t&&o(t.from)}),[t]),(0,ce.useEffect)((()=>{if(t){var e=e=>{o([(e.clientX-n.x-t.offset[0])/n.k,(e.clientY-n.y-t.offset[1])/n.k])},a=e=>{e.stopPropagation()},i=e=>{e.stopPropagation(),s(),r(t,[(e.clientX-n.x-t.offset[0])/n.k,(e.clientY-n.y-t.offset[1])/n.k])},s=()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mousedown",a,{capture:!0}),document.removeEventListener("click",i,{capture:!0}),o(null)};return document.addEventListener("mousemove",e),document.addEventListener("mousedown",a,{capture:!0}),document.addEventListener("click",i,{capture:!0}),s}}),[t,r,n]),ue().createElement("path",{className:ve()("connect-line",{connecting:!!t&&i&&(i[0]-t.from[0])**2+(i[1]-t.from[1])**2>25}),d:t&&i?"M".concat(t.from.join(" "),"L").concat(i.join(" ")):"",fill:"none",stroke:"gray",strokeWidth:1,markerEnd:"url(#".concat(a,")")})}var mn,bn,yn,wn,kn,An,En,Cn,Mn,xn,Nn,Wn,zn,Tn,Rn,Sn,Ln,Dn,Bn,On,Pn,jn,In,Hn,Kn,Yn,Un,Xn,Vn,_n,Fn,Zn,qn,Jn,$n,Gn,Qn,ea,ta,na,aa,ra,ia,oa,sa,la,ca,ua,da,ha,fa,ga,pa,va,ma,ba,ya,wa,ka,Aa,Ea,Ca,Ma,xa,Na,Wa,za,Ta=n(3783),Ra=n(2098),Sa=n(227),La=n(3033),Da=n(8091),Ba=n(1819),Oa=n(7099),Pa=n(1484),ja=n(8197),Ia=n(7531),Ha=n(3012),Ka=n(8618),Ya=["shouldReCenter"];function Ua(e,t,n){return n(_a(e,t))}function Xa(e,t,n){return e.set(_a(e,t),n),n}function Va(e,t){return e.get(_a(e,t))}function _a(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var Fa,Za=(0,dn.unwrapProvider)("basic.lock-body-scroll"),{defineElement:qa,property:Ja,method:$a,event:Ga}=(0,de.createDecorators)(),Qa=ue().forwardRef(Br),er=new WeakMap,tr=new WeakMap,nr=new WeakMap,ar=new WeakMap,rr=new WeakMap,ir=new WeakMap,or=new WeakMap,sr=new WeakMap,lr=new WeakMap,cr=new WeakMap,ur=new WeakMap,dr=new WeakMap,hr=new WeakMap,fr=new WeakMap,gr=new WeakMap,pr=new WeakSet,vr=new WeakMap,mr=new WeakMap,br=new WeakMap,yr=new WeakMap,wr=new WeakMap,kr=new WeakMap,Ar=new WeakMap,Er=new WeakMap,Cr=new WeakMap,Mr=new WeakMap,xr=new WeakMap,Nr=new WeakMap,Wr=new WeakMap,zr=new WeakMap,Tr=new WeakMap,Rr=new WeakMap,Sr=new WeakMap;class Lr extends he.ReactNextElement{constructor(){super(...arguments),(0,re.A)(this,pr),(0,ie.A)(this,er,(mn(this),yn(this))),(0,ie.A)(this,tr,(wn(this),kn(this))),(0,ie.A)(this,nr,(An(this),En(this))),(0,ie.A)(this,ar,(Cn(this),Mn(this,[La.HP,La.HP]))),(0,ie.A)(this,rr,(xn(this),Nn(this))),(0,ie.A)(this,ir,(Wn(this),zn(this))),(0,ie.A)(this,or,(Tn(this),Rn(this))),(0,ie.A)(this,sr,(Sn(this),Ln(this))),(0,ie.A)(this,lr,(Dn(this),Bn(this))),(0,ie.A)(this,cr,(On(this),Pn(this))),(0,ie.A)(this,ur,(jn(this),In(this,!0))),(0,ie.A)(this,dr,(Hn(this),Kn(this,!0))),(0,ie.A)(this,hr,(Yn(this),Un(this,!0))),(0,ie.A)(this,fr,(Xn(this),Vn(this))),(0,ie.A)(this,gr,(_n(this),Fn(this))),(0,ie.A)(this,vr,(Jn(this),e=>{Ua(pr,this,Zn).emit(e)})),(0,ie.A)(this,mr,(e=>{(0,gn.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,ie.A)(this,br,$n(this)),(0,ie.A)(this,yr,(ea(this),ta(this))),(0,ie.A)(this,wr,(ra(this),e=>{Ua(pr,this,na).emit(e),"node"===e.type&&Ua(pr,this,Gn).emit(e)})),(0,ie.A)(this,kr,ia(this)),(0,ie.A)(this,Ar,(la(this),e=>{Ua(pr,this,oa).emit(e)})),(0,ie.A)(this,Er,ca(this)),(0,ie.A)(this,Cr,(ha(this),fa(this))),(0,ie.A)(this,Mr,(va(this),e=>{Ua(pr,this,ga).emit(e),"node"===e.type&&Ua(pr,this,ua).emit(e)})),(0,ie.A)(this,xr,ma(this)),(0,ie.A)(this,Nr,(wa(this),e=>{Ua(pr,this,ba).emit(e)})),(0,ie.A)(this,Wr,ka(this)),(0,ie.A)(this,zr,(Ca(this),e=>{Ua(pr,this,Aa).emit(e)})),(0,ie.A)(this,Tr,Ma(this)),(0,ie.A)(this,Rr,(Wa(this),e=>{Ua(pr,this,xa).emit(e)})),(0,ie.A)(this,Sr,(0,ce.createRef)())}get cells(){return Va(er,this)}set cells(e){Xa(er,this,e)}get layout(){return Va(tr,this)}set layout(e){Xa(tr,this,e)}get layoutOptions(){return Va(nr,this)}set layoutOptions(e){Xa(nr,this,e)}get defaultNodeSize(){return Va(ar,this)}set defaultNodeSize(e){Xa(ar,this,e)}get defaultNodeBricks(){return Va(rr,this)}set defaultNodeBricks(e){Xa(rr,this,e)}get degradedThreshold(){return Va(ir,this)}set degradedThreshold(e){Xa(ir,this,e)}get degradedNodeLabel(){return Va(or,this)}set degradedNodeLabel(e){Xa(or,this,e)}get defaultEdgeLines(){return Va(sr,this)}set defaultEdgeLines(e){Xa(sr,this,e)}get activeTarget(){return Va(lr,this)}set activeTarget(e){Xa(lr,this,e)}get fadeUnrelatedCells(){return Va(cr,this)}set fadeUnrelatedCells(e){Xa(cr,this,e)}get zoomable(){return Va(ur,this)}set zoomable(e){Xa(ur,this,e)}get scrollable(){return Va(dr,this)}set scrollable(e){Xa(dr,this,e)}get pannable(){return Va(hr,this)}set pannable(e){Xa(hr,this,e)}get scaleRange(){return Va(fr,this)}set scaleRange(e){Xa(fr,this,e)}dropNode(e){var t=this;return(0,un.A)((function*(){var n,a,{id:r,position:i,size:o,data:s,useBrick:l}=e;if(null===(n=(a=document).elementsFromPoint)||void 0===n||null===(n=n.call(a,i[0],i[1]))||void 0===n?void 0:n.includes(t)){var c,u,d,h=t.getBoundingClientRect(),f=Va(Sr,t).current.getTransform(),g={type:"node",id:r,view:(0,cn.A)((0,cn.A)({},"force"===t.layout||"dagre"===t.layout?null:{x:(i[0]-h.left-f.x)/f.k,y:(i[1]-h.top-f.y)/f.k}),{},{width:null!==(c=null==o?void 0:o[0])&&void 0!==c?c:t.defaultNodeSize[0],height:null!==(u=null==o?void 0:o[1])&&void 0!==u?u:t.defaultNodeSize[0]}),data:s,useBrick:l};return null===(d=Va(Sr,t).current)||void 0===d||d.dropNode(g),g}return null}))()}dropDecorator(e){var t=this;return(0,un.A)((function*(){var n,a,{position:r,decorator:i,text:o}=e;if(null===(n=(a=document).elementsFromPoint)||void 0===n||null===(n=n.call(a,r[0],r[1]))||void 0===n?void 0:n.includes(t)){var s,l=t.getBoundingClientRect(),c=Va(Sr,t).current.getTransform(),u={type:"decorator",decorator:i,id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),view:{x:(r[0]-l.left-c.x)/c.k,y:(r[1]-l.top-c.y)/c.k,width:La.N8,height:La.w1,text:o}};return null===(s=Va(Sr,t).current)||void 0===s||s.dropDecorator(u),u}return null}))()}addNodes(e){var t=this;return(0,un.A)((function*(){if(0===e.length)return[];var n=e.map((e=>{var n,a,{size:r,useBrick:i,id:o,data:s}=e;return{type:"node",id:o,data:s,view:{width:null!==(n=null==r?void 0:r[0])&&void 0!==n?n:t.defaultNodeSize[0],height:null!==(a=null==r?void 0:r[1])&&void 0!==a?a:t.defaultNodeSize[0]},useBrick:i}}));return Va(Sr,t).current.addNodes(n,{defaultNodeSize:t.defaultNodeSize,canvasWidth:t.clientWidth,canvasHeight:t.clientHeight})}))()}addEdge(e){var t=this;return(0,un.A)((function*(){var n,{source:a,target:r,data:i}=e,o={type:"edge",source:a,target:r,data:i};return null===(n=Va(Sr,t).current)||void 0===n||n.addEdge(o),o}))()}manuallyConnectNodes(e){return Va(Sr,this).current.manuallyConnectNodes(e)}updateCells(e,t){var n=this;return(0,un.A)((function*(){yield _a(pr,n,Dr).call(n);var{updated:a}=Va(Sr,n).current.updateCells(e,(0,cn.A)((0,cn.A)({},t),{},{defaultNodeSize:n.defaultNodeSize,canvasWidth:n.clientWidth,canvasHeight:n.clientHeight}));return{updated:a}}))()}disconnectedCallback(){super.disconnectedCallback(),Za(this,!1)}render(){return ue().createElement(Qa,{host:this,ref:Va(Sr,this),layout:this.layout,layoutOptions:this.layoutOptions,cells:this.cells,defaultNodeSize:this.defaultNodeSize,defaultNodeBricks:this.defaultNodeBricks,defaultEdgeLines:this.defaultEdgeLines,degradedThreshold:this.degradedThreshold,degradedNodeLabel:this.degradedNodeLabel,activeTarget:this.activeTarget,fadeUnrelatedCells:this.fadeUnrelatedCells,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:Va(vr,this),onSwitchActiveTarget:Va(mr,this),onCellMove:Va(wr,this),onCellResize:Va(Ar,this),onCellDelete:Va(Mr,this),onCellContextMenu:Va(Nr,this),onDecoratorTextChange:Va(zr,this),onScaleChange:Va(Rr,this)})}}function Dr(){return new Promise((e=>{var t=()=>{Va(Sr,this).current?e():setTimeout(t,10)};t()}))}function Br(e,t){var{host:n,layout:a,layoutOptions:r,cells:i,defaultNodeSize:o,defaultNodeBricks:s,defaultEdgeLines:l,degradedThreshold:c,degradedNodeLabel:u,activeTarget:d,fadeUnrelatedCells:h,zoomable:f,scrollable:g,pannable:p,scaleRange:v,onActiveTargetChange:m,onSwitchActiveTarget:b,onCellMove:y,onCellResize:w,onCellDelete:k,onCellContextMenu:A,onDecoratorTextChange:E,onScaleChange:C}=e,[{cells:M,layoutKey:x},N]=(0,ce.useReducer)(hn.d,i,(e=>({cells:(0,Ta.C)(e,{defaultNodeSize:o}),layoutKey:0}))),W=(0,ce.useMemo)((()=>M.filter(fn.N).length>=(null!=c?c:La.pC)),[M,c]),z=(0,ce.useRef)(null),T=(0,ce.useRef)(null),R=(0,ce.useRef)(null),[S,L]=(0,ce.useState)([]),{grabbing:D,transform:B,zoomer:O,scaleRange:P}=(0,Da.f)({rootRef:z,zoomable:f,scrollable:g,pannable:p,scaleRange:v,onSwitchActiveTarget:b});(0,ce.useEffect)((()=>{C(B.k)}),[C,B.k]);var[j,I]=(0,ce.useState)(null),{centered:H,setCentered:K,getNextLayoutKey:Y}=(0,Pa.g)({layout:a,layoutOptions:r,rootRef:z,cells:M,zoomable:f,zoomer:O,scaleRange:P,layoutKey:x,dispatch:N});(0,ce.useImperativeHandle)(t,(()=>({dropNode(e){K(!0),N({type:"drop-node",payload:e})},dropDecorator(e){K(!0),N({type:"drop-decorator",payload:e})},addNodes(e,t){var{defaultNodeSize:n,canvasWidth:r,canvasHeight:i}=t,o=M.findLastIndex((e=>!("decorator"===e.type&&"text"===e.decorator)))+1,s=[...M.slice(0,o),...e,...M.slice(o)],{cells:l,updated:c,shouldReCenter:u}=(0,Ra.L)({cells:s,layout:a,previousCells:M,defaultNodeSize:n,canvasWidth:r,canvasHeight:i,scaleRange:P,transform:B});return u&&K(!1),N({type:"update-cells",payload:l}),c.filter((t=>e.includes(t)))},addEdge(e){N({type:"add-edge",payload:e})},updateCells(e,t){var n=(0,Ra.L)((0,cn.A)((0,cn.A)({},t),{},{layout:a,previousCells:M,cells:e,scaleRange:P,transform:B})),{shouldReCenter:r}=n,i=(0,ln.A)(n,Ya);return r&&K(!1),N({type:"update-cells",payload:i.cells}),i},getTransform:()=>B,manuallyConnectNodes(e){var t=M.find((t=>(0,fn.N)(t)&&t.id===e));if(t){var n=z.current.getBoundingClientRect();return I({source:t,from:[t.view.x+t.view.width/2,t.view.y+t.view.height/2],offset:[n.left,n.top]}),new Promise(((e,t)=>{R.current={resolve:e,reject:t}}))}return Promise.reject(null)}})),[M,a,P,K,B]);var U=(0,ce.useCallback)(((e,t)=>{for(var n,a=0;a<M.length;a++){var r=M[a];if((0,fn.N)(r)&&r.id!==e.source.id&&r.view.x<t[0]&&r.view.x+r.view.width>t[0]&&r.view.y<t[1]&&r.view.y+r.view.height>t[1]){var i;null===(i=R.current)||void 0===i||i.resolve({source:e.source,target:r});break}}null===(n=R.current)||void 0===n||n.reject(null),I(null)}),[M]);(0,ce.useEffect)((()=>{Za(n,!!j)}),[j,n]);var X=(0,Ba.J)({cellsRef:T,activeTarget:d,onActiveTargetChange:m}),[V,_]=(0,ce.useState)([]);(0,ce.useEffect)((()=>{var e=h?(0,Sa.Y)(M,j,X):[];_((t=>0===t.length&&0===e.length?t:e))}),[X,M,j,h]),(0,ce.useEffect)((()=>{var e=z.current;if(e&&!(S.length>0)){var t=e=>{var t=function(e,t){var{cells:n,activeTarget:a}=t,r=n.find((e=>(0,gn.c)(e,a)));if(r)switch(e.key||e.keyCode||e.which){case"Backspace":case 8:case"Delete":case 46:return e.preventDefault(),e.stopPropagation(),{action:"delete-cell",cell:r}}}(e,{cells:M,activeTarget:X});"delete-cell"===(null==t?void 0:t.action)&&k(t.cell)};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}}),[X,M,S.length,k]);var F=(0,ce.useMemo)((()=>"".concat((0,me.uniqueId)("diagram-"),"-")),[]),Z="".concat(F,"line-arrow-"),q=(0,ce.useCallback)((e=>{N({type:"move-cell",payload:e})}),[]),J=(0,ce.useCallback)((e=>{N({type:"move-cell",payload:e}),y(e)}),[y]),$=(0,ce.useCallback)((e=>{N({type:"resize-cell",payload:e})}),[]),G=(0,ce.useCallback)((e=>{N({type:"resize-cell",payload:e}),w(e)}),[w]),Q=(0,ce.useCallback)((e=>{var{id:t,editing:n}=e;L(n?e=>e.includes(t)?e:[...e,t]:e=>e.filter((e=>e!==t)))}),[]),ee=(0,ce.useCallback)(((e,t)=>{var n=Y();N({type:"update-node-size",payload:{id:e,size:t},layoutKey:n})}),[Y]),te=(0,ce.useCallback)((e=>{O.scaleTo((0,fe.A)(z.current),e/100)}),[O]),ne=(0,ce.useCallback)((()=>{K(!1)}),[K]),[ae,re]=(0,Ia.d)({cells:M,defaultEdgeLines:l,markerPrefix:Z}),ie=(0,ja.H)({cells:M,layout:a,centered:H});return ue().createElement(ue().Fragment,null,ue().createElement("svg",{width:"100%",height:"100%",ref:z,className:ve()("root",{grabbing:D,pannable:p,ready:ie}),tabIndex:-1},ue().createElement("defs",null,re.map(((e,t)=>ue().createElement(xe.c,{key:t,id:"".concat(Z).concat(t),type:"arrow",strokeColor:e.strokeColor})))),ue().createElement("g",{transform:"translate(".concat(B.x," ").concat(B.y,") scale(").concat(B.k,")")},ue().createElement("g",{className:"cells",ref:T},M.map((e=>ue().createElement(pn.m,{key:"".concat(e.type,":").concat("edge"===e.type?"".concat(e.source,"~").concat(e.target):e.id),layout:a,cell:e,cells:M,degraded:W,degradedNodeLabel:u,defaultNodeBricks:s,transform:B,lineConfMap:ae,active:(0,gn.c)(X,e),unrelatedCells:V,onCellMoving:q,onCellMoved:J,onCellResizing:$,onCellResized:G,onSwitchActiveTarget:b,onCellContextMenu:A,onDecoratorTextChange:E,onDecoratorTextEditing:Q,onNodeBrickResize:ee})))),ue().createElement(vn,{connectLineState:j,transform:B,markerEnd:"".concat(Z,"0"),onConnect:U}))),ue().createElement(Oa.Y,{shadowRoot:n.shadowRoot,scale:B.k,scaleRange:P,onZoomChange:te,onReCenter:ne}))}za=Lr,({e:[yn,wn,kn,An,En,Cn,Mn,xn,Nn,Wn,zn,Tn,Rn,Sn,Ln,Dn,Bn,On,Pn,jn,In,Hn,Kn,Yn,Un,Xn,Vn,_n,Fn,Zn,qn,Jn,$n,Gn,Qn,ea,ta,na,aa,ra,ia,oa,sa,la,ca,ua,da,ha,fa,ga,pa,va,ma,ba,ya,wa,ka,Aa,Ea,Ca,Ma,xa,Na,Wa,mn],c:[Fa,bn]}=function(e,t,n,a,r,i){var o,s,l,c,u,d,h,f=Symbol.metadata||Symbol.for("Symbol.metadata"),g=Object.defineProperty,p=Object.create,v=[p(null),p(null)],m=t.length;function b(t,n,a){return function(r,i){n&&(i=r,r=e);for(var o=0;o<t.length;o++)i=t[o].apply(r,a?[i]:[]);return a?i:r}}function y(e,t,n,a){if("function"!=typeof e&&(a||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(a?"":" or undefined"));return e}function w(e,t,n,a,r,i,l,c,u,d,h){function f(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var p=[].concat(t[0]),m=t[3],w=!l,k=1===r,A=3===r,E=4===r,C=2===r;function M(t,n,a){return function(r,i){return n&&(i=r,r=e),a&&a(r),x[t].call(r,i)}}if(!w){var x={},N=[],W=A?"get":E||k?"set":"value";if(u?(d||k?x={get:(0,se.A)((function(){return m(this)}),a,"get"),set:function(e){t[4](this,e)}}:x[W]=m,d||(0,se.A)(x[W],a,C?"":W)):d||(x=Object.getOwnPropertyDescriptor(e,a)),!d&&!u){if((s=v[+c][a])&&7!=(s^r))throw new Error("Decorating two elements with the same name ("+x[W].name+") is not supported yet");v[+c][a]=r<3?1:r}}for(var z=e,T=p.length-1;T>=0;T-=n?2:1){var R=p[T],S=n?p[T-1]:void 0,L={},D={kind:["field","accessor","method","getter","setter","class"][r],name:a,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");y(t,"An initializer","be",!0),i.push(t)}.bind(null,L)};if(w)s=R.call(S,z,D),L.v=1,y(s,"class decorators","return")&&(z=s);else if(D.static=c,D.private=u,s=D.access={has:u?h.bind():function(e){return a in e}},E||(s.get=u?C?function(e){return f(e),x.value}:M("get",0,f):function(e){return e[a]}),C||A||(s.set=u?M("set",0,f):function(e,t){e[a]=t}),z=R.call(S,k?{get:x.get,set:x.set}:x[W],D),L.v=1,k){if("object"==typeof z&&z)(s=y(z.get,"accessor.get"))&&(x.get=s),(s=y(z.set,"accessor.set"))&&(x.set=s),(s=y(z.init,"accessor.init"))&&N.unshift(s);else if(void 0!==z)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else y(z,(d?"field":"method")+" decorators","return")&&(d?N.unshift(z):x[W]=z)}return r<2&&l.push(b(N,c,1),b(i,c,0)),d||w||(u?k?l.splice(-1,0,M("get",c),M("set",c)):l.push(C?x[W]:y.call.bind(x[W])):g(e,a,x)),z}function k(e){return g(e,f,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[f]),o=p(null==o?null:o),u=[],d=function(e){e&&u.push(b(e))},(h=function(t,a){for(var i=0;i<n.length;i++){var o=n[i],s=o[1],d=7&s;if((8&s)==t&&!d==a){var h=o[2],f=!!o[3],g=16&s;w(t?e:e.prototype,o,g,f?"#"+h:(0,oe.A)(h),d,d<2?[]:t?c=c||[]:l=l||[],u,!!t,f,a,t&&f?function(t){return(0,le.A)(t)===e}:r)}}})(8,0),h(0,0),h(8,1),h(0,1),d(l),d(c),s=u,m||k(e),{e:s,get c(){var n=[];return m&&[k(e=w(e,[t],0,e.name,5,n)),b(n,1)]}}}(za,[qa("eo-draw-canvas",{styleTexts:[Ha.A,Ka.A]})],[[Ja({attribute:!1}),1,"cells"],[Ja({type:String}),1,"layout"],[Ja({attribute:!1}),1,"layoutOptions"],[Ja({attribute:!1}),1,"defaultNodeSize"],[Ja({attribute:!1}),1,"defaultNodeBricks"],[Ja({type:Number}),1,"degradedThreshold"],[Ja({attribute:!1}),1,"degradedNodeLabel"],[Ja({attribute:!1}),1,"defaultEdgeLines"],[Ja({attribute:!1}),1,"activeTarget"],[Ja({type:Boolean}),1,"fadeUnrelatedCells"],[Ja({type:Boolean}),1,"zoomable"],[Ja({type:Boolean}),1,"scrollable"],[Ja({type:Boolean}),1,"pannable"],[Ja({attribute:!1}),1,"scaleRange"],[Ga({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>Va(gr,e),(e,t)=>Xa(gr,e,t)],[Ga({type:"node.move"}),1,"nodeMoveEvent",e=>Va(br,e),(e,t)=>Xa(br,e,t)],[Ga({type:"cell.move"}),1,"cellMoveEvent",e=>Va(yr,e),(e,t)=>Xa(yr,e,t)],[Ga({type:"cell.resize"}),1,"cellResizeEvent",e=>Va(kr,e),(e,t)=>Xa(kr,e,t)],[Ga({type:"node.delete"}),1,"nodeDelete",e=>Va(Er,e),(e,t)=>Xa(Er,e,t)],[Ga({type:"cell.delete"}),1,"cellDelete",e=>Va(Cr,e),(e,t)=>Xa(Cr,e,t)],[Ga({type:"cell.contextmenu"}),1,"cellContextMenu",e=>Va(xr,e),(e,t)=>Xa(xr,e,t)],[Ga({type:"decorator.text.change"}),1,"decoratorTextChange",e=>Va(Wr,e),(e,t)=>Xa(Wr,e,t)],[Ga({type:"scale.change"}),1,"scaleChange",e=>Va(Tr,e),(e,t)=>Xa(Tr,e,t)],[$a(),2,"dropNode"],[$a(),2,"dropDecorator"],[$a(),2,"addNodes"],[$a(),2,"addEdge"],[$a(),2,"manuallyConnectNodes"],[$a(),2,"updateCells"]],0,(e=>Sr.has((0,le.A)(e))),he.ReactNextElement)),bn();var Or,Pr,jr,Ir,Hr,Kr,Yr,Ur,Xr,Vr,_r,Fr,Zr,qr,Jr,$r,Gr,Qr,ei,ti,ni=n(497);function ai(e,t,n){return n(oi(e,t))}function ri(e,t,n){return e.set(oi(e,t),n),n}function ii(e,t){return e.get(oi(e,t))}function oi(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var si,li,ci,ui,di,hi,fi,gi,pi,vi,mi,bi,yi,wi,ki,Ai,Ei,Ci,Mi,xi,Ni,Wi,zi,Ti,Ri,Si,Li,Di,Bi,Oi,Pi,ji,Ii,Hi,Ki,Yi,Ui,Xi,Vi,_i,Fi,Zi,qi,{defineElement:Ji,property:$i,event:Gi}=(0,de.createDecorators)(),Qi=new WeakMap,eo=new WeakMap,to=new WeakMap,no=new WeakMap,ao=new WeakSet,ro=new WeakMap,io=new WeakMap,oo=new WeakMap,so=new WeakMap,lo=new WeakMap;class co extends he.ReactNextElement{constructor(){super(...arguments),(0,re.A)(this,ao),(0,ie.A)(this,Qi,Pr(this)),(0,ie.A)(this,eo,(jr(this),Ir(this))),(0,ie.A)(this,to,(Hr(this),Kr(this))),(0,ie.A)(this,no,(Yr(this),Ur(this))),(0,ie.A)(this,ro,(_r(this),e=>{ai(ao,this,Xr).emit(e)})),(0,ie.A)(this,io,Fr(this)),(0,ie.A)(this,oo,(Jr(this),e=>{ai(ao,this,Zr).emit(e)})),(0,ie.A)(this,so,$r(this)),(0,ie.A)(this,lo,(ei(this),e=>{ai(ao,this,Gr).emit(e)}))}get usage(){return ii(Qi,this)}set usage(e){ri(Qi,this,e)}get status(){return ii(eo,this)}set status(e){ri(eo,this,e)}get decorator(){return ii(to,this)}set decorator(e){ri(to,this,e)}render(){return ue().createElement(uo,{usage:this.usage,onDragStart:ii(ro,this),onDragMove:ii(oo,this),onDragEnd:ii(lo,this)})}}function uo(e){var{usage:t,onDragStart:n,onDragMove:a,onDragEnd:r}=e,i=(0,ce.useCallback)((e=>{if("library"===t){e.stopPropagation(),e.preventDefault();var i=[e.clientX,e.clientY],o=!1,s=e=>{o||(o=(e.clientX-i[0])**2+(e.clientY-i[1])**2>=9)&&(null==n||n([e.clientX,e.clientY])),o&&(null==a||a([e.clientX,e.clientY]))},l=e=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",l),o&&(null==r||r([e.clientX,e.clientY]))};document.addEventListener("mousemove",s),document.addEventListener("mouseup",l)}}),[r,a,n,t]);return ue().createElement("div",{onMouseDown:i},ue().createElement("slot",null))}function ho(e,t,n){return n(po(e,t))}function fo(e,t,n){return e.set(po(e,t),n),n}function go(e,t){return e.get(po(e,t))}function po(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}ti=co,({e:[Pr,jr,Ir,Hr,Kr,Yr,Ur,Xr,Vr,_r,Fr,Zr,qr,Jr,$r,Gr,Qr,ei],c:[si,Or]}=function(e,t,n,a,r,i){var o,s,l,c,u,d,h,f=Symbol.metadata||Symbol.for("Symbol.metadata"),g=Object.defineProperty,p=Object.create,v=[p(null),p(null)],m=t.length;function b(t,n,a){return function(r,i){n&&(i=r,r=e);for(var o=0;o<t.length;o++)i=t[o].apply(r,a?[i]:[]);return a?i:r}}function y(e,t,n,a){if("function"!=typeof e&&(a||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(a?"":" or undefined"));return e}function w(e,t,n,a,r,i,l,c,u,d,h){function f(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var p=[].concat(t[0]),m=t[3],w=!l,k=1===r,A=3===r,E=4===r,C=2===r;function M(t,n,a){return function(r,i){return n&&(i=r,r=e),a&&a(r),x[t].call(r,i)}}if(!w){var x={},N=[],W=A?"get":E||k?"set":"value";if(u?(d||k?x={get:(0,se.A)((function(){return m(this)}),a,"get"),set:function(e){t[4](this,e)}}:x[W]=m,d||(0,se.A)(x[W],a,C?"":W)):d||(x=Object.getOwnPropertyDescriptor(e,a)),!d&&!u){if((s=v[+c][a])&&7!=(s^r))throw new Error("Decorating two elements with the same name ("+x[W].name+") is not supported yet");v[+c][a]=r<3?1:r}}for(var z=e,T=p.length-1;T>=0;T-=n?2:1){var R=p[T],S=n?p[T-1]:void 0,L={},D={kind:["field","accessor","method","getter","setter","class"][r],name:a,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");y(t,"An initializer","be",!0),i.push(t)}.bind(null,L)};if(w)s=R.call(S,z,D),L.v=1,y(s,"class decorators","return")&&(z=s);else if(D.static=c,D.private=u,s=D.access={has:u?h.bind():function(e){return a in e}},E||(s.get=u?C?function(e){return f(e),x.value}:M("get",0,f):function(e){return e[a]}),C||A||(s.set=u?M("set",0,f):function(e,t){e[a]=t}),z=R.call(S,k?{get:x.get,set:x.set}:x[W],D),L.v=1,k){if("object"==typeof z&&z)(s=y(z.get,"accessor.get"))&&(x.get=s),(s=y(z.set,"accessor.set"))&&(x.set=s),(s=y(z.init,"accessor.init"))&&N.unshift(s);else if(void 0!==z)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else y(z,(d?"field":"method")+" decorators","return")&&(d?N.unshift(z):x[W]=z)}return r<2&&l.push(b(N,c,1),b(i,c,0)),d||w||(u?k?l.splice(-1,0,M("get",c),M("set",c)):l.push(C?x[W]:y.call.bind(x[W])):g(e,a,x)),z}function k(e){return g(e,f,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[f]),o=p(null==o?null:o),u=[],d=function(e){e&&u.push(b(e))},(h=function(t,a){for(var i=0;i<n.length;i++){var o=n[i],s=o[1],d=7&s;if((8&s)==t&&!d==a){var h=o[2],f=!!o[3],g=16&s;w(t?e:e.prototype,o,g,f?"#"+h:(0,oe.A)(h),d,d<2?[]:t?c=c||[]:l=l||[],u,!!t,f,a,t&&f?function(t){return(0,le.A)(t)===e}:r)}}})(8,0),h(0,0),h(8,1),h(0,1),d(l),d(c),s=u,m||k(e),{e:s,get c(){var n=[];return m&&[k(e=w(e,[t],0,e.name,5,n)),b(n,1)]}}}(ti,[Ji("diagram.experimental-node",{styleTexts:[ni.A]})],[[$i(),1,"usage"],[$i({type:String,render:!1}),1,"status"],[$i({type:String}),1,"decorator"],[Gi({type:"drag.start"}),1,"dragStartEvent",e=>ii(no,e),(e,t)=>ri(no,e,t)],[Gi({type:"drag.move"}),1,"dragMoveEvent",e=>ii(io,e),(e,t)=>ri(io,e,t)],[Gi({type:"drag.end"}),1,"dragEndEvent",e=>ii(so,e),(e,t)=>ri(so,e,t)]],0,(e=>lo.has((0,le.A)(e))),he.ReactNextElement)),Or();var vo,{defineElement:mo,property:bo,event:yo}=(0,de.createDecorators)(),wo=new WeakMap,ko=new WeakMap,Ao=new WeakMap,Eo=new WeakMap,Co=new WeakMap,Mo=new WeakMap,xo=new WeakMap,No=new WeakMap,Wo=new WeakMap,zo=new WeakMap,To=new WeakMap,Ro=new WeakMap,So=new WeakMap,Lo=new WeakMap,Do=new WeakMap,Bo=new WeakSet,Oo=new WeakMap,Po=new WeakMap,jo=new WeakMap,Io=new WeakMap,Ho=new WeakMap,Ko=new WeakMap;class Yo extends he.ReactNextElement{constructor(){super(...arguments),(0,re.A)(this,Bo),(0,ie.A)(this,wo,ci(this)),(0,ie.A)(this,ko,(ui(this),di(this))),(0,ie.A)(this,Ao,(hi(this),fi(this))),(0,ie.A)(this,Eo,(gi(this),pi(this,[La.HP,La.HP]))),(0,ie.A)(this,Co,(vi(this),mi(this))),(0,ie.A)(this,Mo,(bi(this),yi(this))),(0,ie.A)(this,xo,(wi(this),ki(this))),(0,ie.A)(this,No,(Ai(this),Ei(this))),(0,ie.A)(this,Wo,(Ci(this),Mi(this))),(0,ie.A)(this,zo,(xi(this),Ni(this))),(0,ie.A)(this,To,(Wi(this),zi(this,!0))),(0,ie.A)(this,Ro,(Ti(this),Ri(this,!0))),(0,ie.A)(this,So,(Si(this),Li(this,!0))),(0,ie.A)(this,Lo,(Di(this),Bi(this))),(0,ie.A)(this,Do,(Oi(this),Pi(this))),(0,ie.A)(this,Oo,(Hi(this),e=>{ho(Bo,this,ji).emit(e)})),(0,ie.A)(this,Po,(e=>{(0,gn.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,ie.A)(this,jo,Ki(this)),(0,ie.A)(this,Io,(Xi(this),e=>{ho(Bo,this,Yi).emit(e)})),(0,ie.A)(this,Ho,Vi(this)),(0,ie.A)(this,Ko,(Zi(this),e=>{ho(Bo,this,_i).emit(e)}))}get cells(){return go(wo,this)}set cells(e){fo(wo,this,e)}get layout(){return go(ko,this)}set layout(e){fo(ko,this,e)}get layoutOptions(){return go(Ao,this)}set layoutOptions(e){fo(Ao,this,e)}get defaultNodeSize(){return go(Eo,this)}set defaultNodeSize(e){fo(Eo,this,e)}get defaultNodeBricks(){return go(Co,this)}set defaultNodeBricks(e){fo(Co,this,e)}get degradedThreshold(){return go(Mo,this)}set degradedThreshold(e){fo(Mo,this,e)}get degradedNodeLabel(){return go(xo,this)}set degradedNodeLabel(e){fo(xo,this,e)}get defaultEdgeLines(){return go(No,this)}set defaultEdgeLines(e){fo(No,this,e)}get activeTarget(){return go(Wo,this)}set activeTarget(e){fo(Wo,this,e)}get fadeUnrelatedCells(){return go(zo,this)}set fadeUnrelatedCells(e){fo(zo,this,e)}get zoomable(){return go(To,this)}set zoomable(e){fo(To,this,e)}get scrollable(){return go(Ro,this)}set scrollable(e){fo(Ro,this,e)}get pannable(){return go(So,this)}set pannable(e){fo(So,this,e)}get scaleRange(){return go(Lo,this)}set scaleRange(e){fo(Lo,this,e)}render(){return ue().createElement(Uo,{shadowRoot:this.shadowRoot,cells:this.cells,layout:this.layout,layoutOptions:this.layoutOptions,defaultNodeSize:this.defaultNodeSize,defaultNodeBricks:this.defaultNodeBricks,defaultEdgeLines:this.defaultEdgeLines,degradedThreshold:this.degradedThreshold,degradedNodeLabel:this.degradedNodeLabel,activeTarget:this.activeTarget,fadeUnrelatedCells:this.fadeUnrelatedCells,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:go(Oo,this),onSwitchActiveTarget:go(Po,this),onCellContextMenu:go(Io,this),onCellClick:go(Ko,this)})}}function Uo(e){var{shadowRoot:t,cells:n,layout:a,layoutOptions:r,defaultNodeSize:i,defaultNodeBricks:o,defaultEdgeLines:s,degradedThreshold:l,degradedNodeLabel:c,activeTarget:u,fadeUnrelatedCells:d,zoomable:h,scrollable:f,pannable:g,scaleRange:p,onActiveTargetChange:v,onSwitchActiveTarget:m,onCellContextMenu:b,onCellClick:y}=e,[{cells:w,layoutKey:k},A]=(0,ce.useReducer)(hn.d,n,(e=>({cells:(0,Ta.C)(e,{defaultNodeSize:i}),layoutKey:1}))),E=(0,ce.useMemo)((()=>w.filter(fn.N).length>=(null!=l?l:La.pC)),[w,l]),C=(0,ce.useRef)(null),M=(0,ce.useRef)(null),{grabbing:x,transform:N,zoomer:W,scaleRange:z}=(0,Da.f)({rootRef:C,zoomable:h,scrollable:f,pannable:g,scaleRange:p,onSwitchActiveTarget:m}),{centered:T,setCentered:R,getNextLayoutKey:S}=(0,Pa.g)({layout:a,layoutOptions:r,rootRef:C,cells:w,zoomable:h,zoomer:W,scaleRange:z,layoutKey:k,dispatch:A}),L=(0,ce.useCallback)((()=>{R(!1)}),[R]),D=(0,ce.useRef)(n);(0,ce.useEffect)((()=>{if(n!==D.current){D.current=n;var e=(0,Ra.L)({canvasWidth:t.host.clientWidth,canvasHeight:t.host.clientHeight,defaultNodeSize:i,layout:a,previousCells:w,cells:n,scaleRange:z,transform:N});A({type:"update-cells",payload:e.cells})}}),[w,i,n,a,z,t,N]);var B=(0,Ba.J)({cellsRef:M,activeTarget:u,onActiveTargetChange:v}),O=(0,ce.useMemo)((()=>"".concat((0,me.uniqueId)("diagram-"),"-")),[]),P="".concat(O,"line-arrow-"),j=(0,ce.useCallback)(((e,t)=>{A({type:"update-node-size",payload:{id:e,size:t},layoutKey:S()})}),[S]),[I,H]=(0,ce.useState)(null),K=(0,ce.useCallback)((e=>{H(e)}),[]),Y=(0,ce.useCallback)((e=>{H((t=>t===e?null:t))}),[]),[U,X]=(0,ce.useState)([]);(0,ce.useEffect)((()=>{var e=d?(0,Sa.Y)(w,null,I):[];X((t=>0===t.length&&0===e.length?t:e))}),[w,d,I]);var V=(0,ce.useCallback)((e=>{W.scaleTo((0,fe.A)(C.current),e/100)}),[W]),[_,F]=(0,Ia.d)({cells:w,defaultEdgeLines:s,markerPrefix:P}),Z=(0,ja.H)({cells:w,layout:a,centered:T});return ue().createElement(ue().Fragment,null,ue().createElement("svg",{width:"100%",height:"100%",ref:C,className:ve()("root",{grabbing:x,pannable:g,ready:Z}),tabIndex:-1},ue().createElement("defs",null,F.map(((e,t)=>ue().createElement(xe.c,{key:t,id:"".concat(P).concat(t),type:"arrow",strokeColor:e.strokeColor})))),ue().createElement("g",{transform:"translate(".concat(N.x," ").concat(N.y,") scale(").concat(N.k,")")},ue().createElement("g",{className:"cells",ref:M},w.map((e=>ue().createElement(pn.m,{key:"".concat(e.type,":").concat((0,fn.WW)(e)?"".concat(e.source,"~").concat(e.target):e.id),layout:void 0,cell:e,cells:w,degraded:E,degradedNodeLabel:c,defaultNodeBricks:o,lineConfMap:_,transform:N,active:(0,gn.c)(B,e),readOnly:!0,unrelatedCells:U,onSwitchActiveTarget:m,onCellContextMenu:b,onCellClick:y,onNodeBrickResize:j,onCellMouseEnter:d&&(0,fn.N)(e)?K:void 0,onCellMouseLeave:d&&(0,fn.N)(e)?Y:void 0})))))),ue().createElement(Oa.Y,{shadowRoot:t,scale:N.k,scaleRange:z,onZoomChange:V,onReCenter:L}))}qi=Yo,({e:[ci,ui,di,hi,fi,gi,pi,vi,mi,bi,yi,wi,ki,Ai,Ei,Ci,Mi,xi,Ni,Wi,zi,Ti,Ri,Si,Li,Di,Bi,Oi,Pi,ji,Ii,Hi,Ki,Yi,Ui,Xi,Vi,_i,Fi,Zi],c:[vo,li]}=function(e,t,n,a,r,i){var o,s,l,c,u,d,h,f=Symbol.metadata||Symbol.for("Symbol.metadata"),g=Object.defineProperty,p=Object.create,v=[p(null),p(null)],m=t.length;function b(t,n,a){return function(r,i){n&&(i=r,r=e);for(var o=0;o<t.length;o++)i=t[o].apply(r,a?[i]:[]);return a?i:r}}function y(e,t,n,a){if("function"!=typeof e&&(a||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(a?"":" or undefined"));return e}function w(e,t,n,a,r,i,l,c,u,d,h){function f(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var p=[].concat(t[0]),m=t[3],w=!l,k=1===r,A=3===r,E=4===r,C=2===r;function M(t,n,a){return function(r,i){return n&&(i=r,r=e),a&&a(r),x[t].call(r,i)}}if(!w){var x={},N=[],W=A?"get":E||k?"set":"value";if(u?(d||k?x={get:(0,se.A)((function(){return m(this)}),a,"get"),set:function(e){t[4](this,e)}}:x[W]=m,d||(0,se.A)(x[W],a,C?"":W)):d||(x=Object.getOwnPropertyDescriptor(e,a)),!d&&!u){if((s=v[+c][a])&&7!=(s^r))throw new Error("Decorating two elements with the same name ("+x[W].name+") is not supported yet");v[+c][a]=r<3?1:r}}for(var z=e,T=p.length-1;T>=0;T-=n?2:1){var R=p[T],S=n?p[T-1]:void 0,L={},D={kind:["field","accessor","method","getter","setter","class"][r],name:a,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");y(t,"An initializer","be",!0),i.push(t)}.bind(null,L)};if(w)s=R.call(S,z,D),L.v=1,y(s,"class decorators","return")&&(z=s);else if(D.static=c,D.private=u,s=D.access={has:u?h.bind():function(e){return a in e}},E||(s.get=u?C?function(e){return f(e),x.value}:M("get",0,f):function(e){return e[a]}),C||A||(s.set=u?M("set",0,f):function(e,t){e[a]=t}),z=R.call(S,k?{get:x.get,set:x.set}:x[W],D),L.v=1,k){if("object"==typeof z&&z)(s=y(z.get,"accessor.get"))&&(x.get=s),(s=y(z.set,"accessor.set"))&&(x.set=s),(s=y(z.init,"accessor.init"))&&N.unshift(s);else if(void 0!==z)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else y(z,(d?"field":"method")+" decorators","return")&&(d?N.unshift(z):x[W]=z)}return r<2&&l.push(b(N,c,1),b(i,c,0)),d||w||(u?k?l.splice(-1,0,M("get",c),M("set",c)):l.push(C?x[W]:y.call.bind(x[W])):g(e,a,x)),z}function k(e){return g(e,f,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[f]),o=p(null==o?null:o),u=[],d=function(e){e&&u.push(b(e))},(h=function(t,a){for(var i=0;i<n.length;i++){var o=n[i],s=o[1],d=7&s;if((8&s)==t&&!d==a){var h=o[2],f=!!o[3],g=16&s;w(t?e:e.prototype,o,g,f?"#"+h:(0,oe.A)(h),d,d<2?[]:t?c=c||[]:l=l||[],u,!!t,f,a,t&&f?function(t){return(0,le.A)(t)===e}:r)}}})(8,0),h(0,0),h(8,1),h(0,1),d(l),d(c),s=u,m||k(e),{e:s,get c(){var n=[];return m&&[k(e=w(e,[t],0,e.name,5,n)),b(n,1)]}}}(qi,[mo("eo-display-canvas",{styleTexts:[Ha.A,Ka.A]})],[[bo({attribute:!1}),1,"cells"],[bo({type:String}),1,"layout"],[bo({attribute:!1}),1,"layoutOptions"],[bo({attribute:!1}),1,"defaultNodeSize"],[bo({attribute:!1}),1,"defaultNodeBricks"],[bo({type:Number}),1,"degradedThreshold"],[bo({attribute:!1}),1,"degradedNodeLabel"],[bo({attribute:!1}),1,"defaultEdgeLines"],[bo({attribute:!1}),1,"activeTarget"],[bo({type:Boolean}),1,"fadeUnrelatedCells"],[bo({type:Boolean}),1,"zoomable"],[bo({type:Boolean}),1,"scrollable"],[bo({type:Boolean}),1,"pannable"],[bo({attribute:!1}),1,"scaleRange"],[yo({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>go(Do,e),(e,t)=>fo(Do,e,t)],[yo({type:"cell.contextmenu"}),1,"cellContextMenu",e=>go(jo,e),(e,t)=>fo(jo,e,t)],[yo({type:"cell.click"}),1,"cellClick",e=>go(Ho,e),(e,t)=>fo(Ho,e,t)]],0,(e=>Ko.has((0,le.A)(e))),he.ReactNextElement)),li()},3971:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(6758),r=n.n(a),i=n(935),o=n.n(i)()(r());o.push([e.id,':host{display:block;--local-label-line-height:inherit;--local-label-font-size:inherit;--local-label-color:inherit;--local-label-font-weight:inherit}:host([hidden]){display:none}:host([type="line"]){--local-label-line-height:18px;--local-label-font-size:11px;--local-label-color:var(--color-secondary-text);--local-label-font-weight:400}*{box-sizing:border-box}.label{max-width:168px;margin:-3px}.label-text,\n.label-input{width:100%;height:24px;padding:3px;border:none;line-height:var(--local-label-line-height);font-size:var(--local-label-font-size);color:var(--local-label-color);font-weight:var(--local-label-font-weight);text-align:center;font-family:inherit;cursor:text;-webkit-user-select:text;-moz-user-select:text;user-select:text}.label-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.label.editing .label-text,\n.label.empty:not(.editing) .label-text,\n.label:not(.editing) .label-input{display:none}',""]);const s=o.toString()},497:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(6758),r=n.n(a),i=n(935),o=n.n(i)()(r());o.push([e.id,'*{box-sizing:border-box}:host{display:block;border:1px solid var(--palette-gray-5);cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([hidden]){display:none}:host([usage="dragging"]){opacity:0.75;position:fixed}:host(:not([usage="library"])){background:var(--palette-gray-3);width:60px;height:60px}:host([usage="library"]){width:180px;height:30px;margin-bottom:10px}div{width:100%;height:100%;display:flex;align-items:center;justify-content:center}:host(:not([usage="dragging"]):not([usage="library"]):hover),\n:host([status="highlighted"]){color:var(--palette-blue-5);background:var(--palette-blue-1);border-color:1px solid var(--palette-blue-4)}:host([status="faded"]){opacity:0.3}:host([decorator="area"]){width:100px;height:60px;background:rgba(119,141,195,0.1);border:none}:host([decorator="text"]){width:auto;height:auto;background:none;border:none}',""]);const s=o.toString()}}]);
|
|
2
|
-
//# sourceMappingURL=5576.
|
|
1
|
+
"use strict";(self.webpackChunk_next_bricks_diagram=self.webpackChunk_next_bricks_diagram||[]).push([[5576],{5576:(e,t,n)=>{n.r(t);var a,r,i,o,s,l,c,u,d,h,f,g,p,v,m,b,y,w,k,A,E,C,M,x,N,W,z,T,R,S,L,D,B,O,P,j,I,H,K,Y,U,X,V,_,F,Z,q,J,$,G,Q,ee,te,ne,ae,re=n(4635),ie=n(918),oe=n(1369),se=n(8449),le=n(4521),ce=n(8769),ue=n.n(ce),de=n(9929),he=n(9938),fe=(n(330),n(7566)),ge=n(1517),pe=n(3373),ve=n.n(pe),me=n(1030),be=n(9126),ye=n(8892),we=n(5157),ke=n(8308),Ae=n(6457),Ee=n(9137),Ce=n(2547),Me=n(1803),xe=n(3739),Ne=n(9191),We=n(6671),ze=n(8060),Te=n(2448),Re=n(8657),Se=n(8069),Le=n(1324),De=n(821),Be=n(6753),Oe=n(2673),Pe=n(5987);function je(e,t,n){return n(Ke(e,t))}function Ie(e,t,n){return e.set(Ke(e,t),n),n}function He(e,t){return e.get(Ke(e,t))}function Ke(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var Ye,{defineElement:Ue,property:Xe,event:Ve,method:_e}=(0,de.createDecorators)(),Fe=(0,ce.forwardRef)(Ct),Ze=new WeakMap,qe=new WeakMap,Je=new WeakMap,$e=new WeakMap,Ge=new WeakMap,Qe=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap,at=new WeakMap,rt=new WeakMap,it=new WeakMap,ot=new WeakMap,st=new WeakMap,lt=new WeakMap,ct=new WeakSet,ut=new WeakMap,dt=new WeakMap,ht=new WeakMap,ft=new WeakMap,gt=new WeakMap,pt=new WeakMap,vt=new WeakMap,mt=new WeakMap,bt=new WeakMap,yt=new WeakMap,wt=new WeakMap,kt=new WeakMap,At=new WeakMap;class Et extends he.ReactNextElement{constructor(){super(...arguments),(0,re.A)(this,ct),(0,ie.A)(this,Ze,(a(this),i(this))),(0,ie.A)(this,qe,(o(this),s(this))),(0,ie.A)(this,Je,(l(this),c(this))),(0,ie.A)(this,$e,(u(this),d(this))),(0,ie.A)(this,Ge,(h(this),f(this))),(0,ie.A)(this,Qe,(g(this),p(this))),(0,ie.A)(this,et,(v(this),m(this))),(0,ie.A)(this,tt,(b(this),y(this))),(0,ie.A)(this,nt,(w(this),k(this))),(0,ie.A)(this,at,(A(this),E(this))),(0,ie.A)(this,rt,(C(this),M(this,!0))),(0,ie.A)(this,it,(x(this),N(this,!0))),(0,ie.A)(this,ot,(W(this),z(this,!0))),(0,ie.A)(this,st,(T(this),R(this))),(0,ie.A)(this,lt,(S(this),L(this))),(0,ie.A)(this,ut,(O(this),e=>{je(ct,this,D).emit(e)})),(0,ie.A)(this,dt,P(this)),(0,ie.A)(this,ht,(H(this),e=>{je(ct,this,j).emit(e)})),(0,ie.A)(this,ft,K(this)),(0,ie.A)(this,gt,(X(this),e=>{je(ct,this,Y).emit(e)})),(0,ie.A)(this,pt,V(this)),(0,ie.A)(this,vt,(Z(this),e=>{je(ct,this,_).emit(e)})),(0,ie.A)(this,mt,q(this)),(0,ie.A)(this,bt,(G(this),e=>{je(ct,this,J).emit(e)})),(0,ie.A)(this,yt,Q(this)),(0,ie.A)(this,wt,(ne(this),e=>{je(ct,this,ee).emit(e)})),(0,ie.A)(this,kt,(e=>{(0,Oe.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,ie.A)(this,At,(0,ce.createRef)())}get layout(){return He(Ze,this)}set layout(e){Ie(Ze,this,e)}get nodes(){return He(qe,this)}set nodes(e){Ie(qe,this,e)}get edges(){return He(Je,this)}set edges(e){Ie(Je,this,e)}get nodeBricks(){return He($e,this)}set nodeBricks(e){Ie($e,this,e)}get lines(){return He(Ge,this)}set lines(e){Ie(Ge,this,e)}get layoutOptions(){return He(Qe,this)}set layoutOptions(e){Ie(Qe,this,e)}get activeTarget(){return He(et,this)}set activeTarget(e){Ie(et,this,e)}get disableKeyboardAction(){return He(tt,this)}set disableKeyboardAction(e){Ie(tt,this,e)}get connectNodes(){return He(nt,this)}set connectNodes(e){Ie(nt,this,e)}get dragNodes(){return He(at,this)}set dragNodes(e){Ie(at,this,e)}get zoomable(){return He(rt,this)}set zoomable(e){Ie(rt,this,e)}get scrollable(){return He(it,this)}set scrollable(e){Ie(it,this,e)}get pannable(){return He(ot,this)}set pannable(e){Ie(ot,this,e)}get scaleRange(){return He(st,this)}set scaleRange(e){Ie(st,this,e)}callOnLineLabel(e,t){for(var n,a=arguments.length,r=new Array(a>2?a-2:0),i=2;i<a;i++)r[i-2]=arguments[i];null===(n=He(At,this).current)||void 0===n||n.callOnLineLabel(e,t,...r)}render(){return ue().createElement(Fe,{ref:He(At,this),layout:this.layout,nodes:this.nodes,edges:this.edges,nodeBricks:this.nodeBricks,lines:this.lines,layoutOptions:this.layoutOptions,connectNodes:this.connectNodes,dragNodes:this.dragNodes,activeTarget:this.activeTarget,disableKeyboardAction:this.disableKeyboardAction,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:He(ut,this),onSwitchActiveTarget:He(kt,this),onNodeDelete:He(ht,this),onEdgeDelete:He(gt,this),onLineClick:He(vt,this),onLineDoubleClick:He(bt,this),onNodesConnect:He(wt,this)})}}function Ct(e,t){var{layout:n,nodes:a,edges:r,nodeBricks:i,lines:o,layoutOptions:s,connectNodes:l,dragNodes:c,activeTarget:u,disableKeyboardAction:d,zoomable:h,scrollable:f,pannable:g,scaleRange:p,onActiveTargetChange:v,onSwitchActiveTarget:m,onNodeDelete:b,onEdgeDelete:y,onLineClick:w,onLineDoubleClick:k,onNodesConnect:A}=e,[E,C]=(0,ce.useState)(!1),[M,x]=(0,ce.useState)(0),[N,W]=(0,ce.useState)(null),[z,T]=(0,ce.useState)(!1),[R,S]=(0,ce.useState)(0),[L,D]=(0,ce.useState)(null),[B,O]=(0,ce.useState)([]),[P,j]=(0,ce.useState)(!1),[I,H]=(0,ce.useState)({k:1,x:0,y:0}),K=(0,ce.useRef)(new Map),Y=(0,ce.useRef)(null),U=(0,ce.useRef)(null),[X,V]=(0,ce.useState)(!1),{userViewReady:_,userViewNodesMap:F,saveUserView:Z}=(0,Be._)(null==c?void 0:c.save),[q,J]=(0,ce.useState)([0,0]),[$,G]=(0,ce.useState)(null),[Q,ee]=(0,ce.useState)("initial"),[te,ne]=(0,ce.useState)(null);(0,ce.useImperativeHandle)(t,(()=>({callOnLineLabel(e,t){for(var n,a=arguments.length,r=new Array(a>2?a-2:0),i=2;i<a;i++)r[i-2]=arguments[i];null==L||null===(n=L.get(e))||void 0===n||null===(n=n.firstElementChild)||void 0===n||n[t](...r)}}))),(0,ce.useEffect)((()=>{var e=e=>{(0,Te.P)(e,{nodes:a,nodesRefRepository:N,connectNodes:l,dragNodes:c,scale:I.k,setConnectLineState:G,setConnectLineTo:J,setManualLayoutStatus:ee,setNodeMovement:ne,onSwitchActiveTarget:m,onNodesConnect:A})},t=U.current;return null==t||t.addEventListener("mousedown",e),()=>{null==t||t.removeEventListener("mousedown",e)}}),[a,l,c,I.k,N,A,m]);var{normalizedLines:ae,normalizedLinesMap:re,markers:ie}=(0,ce.useMemo)((()=>(0,Ee.t)(r,o)),[r,o]),oe=(0,ce.useMemo)((()=>ae.flatMap((e=>{var t,n,{line:{text:a,label:r,$id:i},edge:o}=e;return a||r?(r?(t="label",n=[].concat(r)):(t="text",n=[].concat(a)),n.map((e=>{var n;return{[t]:e,id:"".concat(i,"-").concat(null!==(n=e.placement)&&void 0!==n?n:"center"),edge:o}}))):[]}))),[ae]),{nodes:se,edges:le}=(0,Se.o)({layout:n,nodes:a,edges:r,manualLayoutStatus:Q,userViewReady:_,userViewNodesMap:F,nodeMovement:te,nodesRefRepository:N,lineLabelsRefRepository:L,normalizedLinesMap:re,layoutOptions:s,nodesRenderId:M,lineLabelsRenderId:R});(0,ce.useEffect)((()=>{"finished"===Q&&Z(se.map((e=>({id:e.id,x:e.x,y:e.y}))))}),[Q]);var de=(0,ce.useMemo)((()=>(0,Ae.R)(le,se,ae)),[ae,se,le]),he=null!=u?u:null,[pe,De]=(0,ce.useState)(he);(0,ce.useEffect)((()=>{De((e=>(0,Oe.c)(e,he)?e:he))}),[he]);var je=(0,ce.useRef)(!1);(0,ce.useEffect)((()=>{je.current?null==v||v(pe):je.current=!0}),[pe,v]),(0,ce.useEffect)((()=>{var e=Y.current;if(e&&!d){var t=e=>{var t=(0,we.a)(e,{renderedNodes:se,activeTarget:pe});"delete-node"===(null==t?void 0:t.action)?null==b||b(t.node):"delete-edge"===(null==t?void 0:t.action)?null==y||y(t.edge):"switch-active-node"===(null==t?void 0:t.action)&&t.node&&(null==m||m({type:"node",nodeId:t.node.id}))};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}}),[pe,se,d,m,b,y]);var Ie=(0,ce.useCallback)((e=>{e&&(x((e=>e+1)),W(e)),C((t=>t||!!e))}),[]),He=(0,ce.useCallback)((e=>{e&&(S((e=>e+1)),D(e)),T((t=>t||!!e))}),[]),Ke=(0,ce.useMemo)((()=>null!=p?p:[Re.sS,Re.Yt]),[p]),Ye=(0,ce.useMemo)((()=>(0,ge.s_)()),[]);(0,ce.useEffect)((()=>{var e=!1;Ye.scaleExtent(h?Ke:[1,1]).on("start",(()=>{e=!1,j(!0)})).on("zoom",(t=>{e=!0,H(t.transform)})).on("end",(()=>{j(!1),e||null==m||m(null)}))}),[m,Ke,h,Ye]),(0,ce.useEffect)((()=>{var e=Y.current;if(e){var t=(0,fe.A)(e),n=()=>{t.on(".zoom",null).on(".zoom.custom",null).on("wheel",null)};if(h||f||g)return(h||f)&&t.on("wheel.zoom.custom",(e=>{e.ctrlKey||(e.stopImmediatePropagation(),f&&(e.preventDefault(),Ye.translateBy(t,e.wheelDeltaX/5,e.wheelDeltaY/5)))})),t.call(Ye).on("wheel",(e=>e.preventDefault())).on("dblclick.zoom",null),g||t.on("mousedown.zoom",null).on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),n;n()}}),[g,f,h,Ye]),(0,ce.useEffect)((()=>{var e=Y.current;if(0!==se.length&&e&&!X){var{k:t,x:n,y:a}=(0,ke.r)(se,{canvasWidth:e.clientWidth,canvasHeight:e.clientHeight,scaleRange:h?Ke:void 0});Ye.transform((0,fe.A)(e),new ge.uV(t,n,a)),V(!0)}}),[X,se,Ke,h,Ye]);var Ue=(0,ce.useMemo)((()=>"".concat((0,me.uniqueId)("diagram-"),"-")),[]),Xe="".concat(Ue,"line-arrow-"),Ve="".concat(Ue,"mask-"),_e="".concat(Ue,"active-line-");(0,ce.useEffect)((()=>{O((e=>(0,ze.z)(e,de,K.current)))}),[de]);var[Fe,Ze]=ue().useState(new Map);return(0,ce.useEffect)((()=>{if(L){(0,Le.F)(B,L);var e=new be.A((()=>{Ze((0,Pe.G)(B,L))}));for(var t of L.values())e.observe(t);return()=>{e.disconnect()}}}),[R,L,B]),"dagre"!==n&&"force"!==n?ue().createElement("div",null,'Diagram layout not supported: "'.concat(n,'"')):ue().createElement("div",{className:ve()("diagram",{ready:E&&X,grabbing:P,pannable:g}),tabIndex:-1,ref:Y},ue().createElement("svg",{width:"100%",height:"100%",className:"lines"},ue().createElement("defs",null,ie.map(((e,t)=>{var{type:n,strokeColor:a}=e;return ue().createElement(xe.c,{key:t,id:"".concat(Xe).concat(t),type:n,strokeColor:a})})),[...Fe].map((e=>{var[t,n]=e;return ue().createElement(Ne.y,{key:t,lineId:t,rects:n,maskPrefix:Ve,renderedLineLabels:B})})),ue().createElement("marker",{id:"".concat(_e,"start"),viewBox:"0 0 8 8",refX:4,refY:4,markerWidth:8,markerHeight:8,orient:"auto"},ue().createElement("path",{d:"M 0.5 0.5 H 7.5 V 7.5 H 0.5 Z",stroke:"var(--palette-gray-7)",strokeWidth:1,fill:"var(--palette-gray-1)"})),ue().createElement("marker",{id:"".concat(_e,"end"),viewBox:"0 0 14 8",refX:3,refY:4,markerWidth:14,markerHeight:8,orient:"auto"},ue().createElement("path",{d:"M 0.5 1.5 L 5.5 4 L 0.5 6.5 z",stroke:"var(--palette-blue-3)",strokeWidth:1,fill:"var(--palette-blue-3)"}),ue().createElement("path",{d:"M 6.5 0.5 H 13.5 V 7.5 H 6.5 Z",stroke:"var(--palette-gray-7)",strokeWidth:1,fill:"var(--palette-gray-1)"}))),ue().createElement("g",{transform:"translate(".concat(I.x," ").concat(I.y,") scale(").concat(I.k,")")},de.map((e=>ue().createElement(Me.m,{key:e.line.$id,line:e,linePaths:K.current,lineMaskRects:Fe,maskPrefix:Ve,markerPrefix:Xe,activeLineMarkerPrefix:_e,active:"edge"===(null==pe?void 0:pe.type)&&pe.edge.source===e.edge.source&&pe.edge.target===e.edge.target,activeRelated:"node"===(null==pe?void 0:pe.type)&&(e.edge.source===pe.nodeId||e.edge.target===pe.nodeId),onLineClick:w,onLineDoubleClick:k}))))),ue().createElement("div",{className:ve()("line-labels",{ready:z}),style:{left:I.x,top:I.y,transform:"scale(".concat(I.k,")")}},ue().createElement(Ce.d2,{labels:oe,onRendered:He})),ue().createElement("div",{className:"nodes",ref:U,style:{left:I.x,top:I.y,transform:"scale(".concat(I.k,")")}},ue().createElement(ye.p,{nodes:a,nodeBricks:i,onRendered:Ie})),ue().createElement(We.w,{connectLineState:$,connectLineTo:q,markerPrefix:Xe}))}ae=Et,({e:[i,o,s,l,c,u,d,h,f,g,p,v,m,b,y,w,k,A,E,C,M,x,N,W,z,T,R,S,L,D,B,O,P,j,I,H,K,Y,U,X,V,_,F,Z,q,J,$,G,Q,ee,te,ne,a],c:[Ye,r]}=function(e,t,n,a,r,i){var o,s,l,c,u,d,h,f=Symbol.metadata||Symbol.for("Symbol.metadata"),g=Object.defineProperty,p=Object.create,v=[p(null),p(null)],m=t.length;function b(t,n,a){return function(r,i){n&&(i=r,r=e);for(var o=0;o<t.length;o++)i=t[o].apply(r,a?[i]:[]);return a?i:r}}function y(e,t,n,a){if("function"!=typeof e&&(a||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(a?"":" or undefined"));return e}function w(e,t,n,a,r,i,l,c,u,d,h){function f(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var p=[].concat(t[0]),m=t[3],w=!l,k=1===r,A=3===r,E=4===r,C=2===r;function M(t,n,a){return function(r,i){return n&&(i=r,r=e),a&&a(r),x[t].call(r,i)}}if(!w){var x={},N=[],W=A?"get":E||k?"set":"value";if(u?(d||k?x={get:(0,se.A)((function(){return m(this)}),a,"get"),set:function(e){t[4](this,e)}}:x[W]=m,d||(0,se.A)(x[W],a,C?"":W)):d||(x=Object.getOwnPropertyDescriptor(e,a)),!d&&!u){if((s=v[+c][a])&&7!=(s^r))throw new Error("Decorating two elements with the same name ("+x[W].name+") is not supported yet");v[+c][a]=r<3?1:r}}for(var z=e,T=p.length-1;T>=0;T-=n?2:1){var R=p[T],S=n?p[T-1]:void 0,L={},D={kind:["field","accessor","method","getter","setter","class"][r],name:a,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");y(t,"An initializer","be",!0),i.push(t)}.bind(null,L)};if(w)s=R.call(S,z,D),L.v=1,y(s,"class decorators","return")&&(z=s);else if(D.static=c,D.private=u,s=D.access={has:u?h.bind():function(e){return a in e}},E||(s.get=u?C?function(e){return f(e),x.value}:M("get",0,f):function(e){return e[a]}),C||A||(s.set=u?M("set",0,f):function(e,t){e[a]=t}),z=R.call(S,k?{get:x.get,set:x.set}:x[W],D),L.v=1,k){if("object"==typeof z&&z)(s=y(z.get,"accessor.get"))&&(x.get=s),(s=y(z.set,"accessor.set"))&&(x.set=s),(s=y(z.init,"accessor.init"))&&N.unshift(s);else if(void 0!==z)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else y(z,(d?"field":"method")+" decorators","return")&&(d?N.unshift(z):x[W]=z)}return r<2&&l.push(b(N,c,1),b(i,c,0)),d||w||(u?k?l.splice(-1,0,M("get",c),M("set",c)):l.push(C?x[W]:y.call.bind(x[W])):g(e,a,x)),z}function k(e){return g(e,f,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[f]),o=p(null==o?null:o),u=[],d=function(e){e&&u.push(b(e))},(h=function(t,a){for(var i=0;i<n.length;i++){var o=n[i],s=o[1],d=7&s;if((8&s)==t&&!d==a){var h=o[2],f=!!o[3],g=16&s;w(t?e:e.prototype,o,g,f?"#"+h:(0,oe.A)(h),d,d<2?[]:t?c=c||[]:l=l||[],u,!!t,f,a,t&&f?function(t){return(0,le.A)(t)===e}:r)}}})(8,0),h(0,0),h(8,1),h(0,1),d(l),d(c),s=u,m||k(e),{e:s,get c(){var n=[];return m&&[k(e=w(e,[t],0,e.name,5,n)),b(n,1)]}}}(ae,[Ue("eo-diagram",{styleTexts:[De.A]})],[[Xe({type:String}),1,"layout"],[Xe({attribute:!1}),1,"nodes"],[Xe({attribute:!1}),1,"edges"],[Xe({attribute:!1}),1,"nodeBricks"],[Xe({attribute:!1}),1,"lines"],[Xe({attribute:!1}),1,"layoutOptions"],[Xe({attribute:!1}),1,"activeTarget"],[Xe({type:Boolean}),1,"disableKeyboardAction"],[Xe({attribute:!1}),1,"connectNodes"],[Xe({attribute:!1}),1,"dragNodes"],[Xe({type:Boolean}),1,"zoomable"],[Xe({type:Boolean}),1,"scrollable"],[Xe({type:Boolean}),1,"pannable"],[Xe({attribute:!1}),1,"scaleRange"],[Ve({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>He(lt,e),(e,t)=>Ie(lt,e,t)],[Ve({type:"node.delete"}),1,"nodeDelete",e=>He(dt,e),(e,t)=>Ie(dt,e,t)],[Ve({type:"edge.delete"}),1,"edgeDelete",e=>He(ft,e),(e,t)=>Ie(ft,e,t)],[Ve({type:"line.click"}),1,"lineClick",e=>He(pt,e),(e,t)=>Ie(pt,e,t)],[Ve({type:"line.dblclick"}),1,"lineDoubleClick",e=>He(mt,e),(e,t)=>Ie(mt,e,t)],[Ve({type:"nodes.connect"}),1,"connectNodes",e=>He(yt,e),(e,t)=>Ie(yt,e,t)],[_e(),2,"callOnLineLabel"]],0,(e=>At.has((0,le.A)(e))),he.ReactNextElement)),r();var Mt,xt,Nt,Wt,zt,Tt,Rt,St,Lt,Dt,Bt,Ot,Pt,jt,It,Ht=n(3971);function Kt(e,t,n){return n(Xt(e,t))}function Yt(e,t,n){return e.set(Xt(e,t),n),n}function Ut(e,t){return e.get(Xt(e,t))}function Xt(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var Vt,{defineElement:_t,property:Ft,event:Zt,method:qt}=(0,de.createDecorators)(),Jt=(0,ce.forwardRef)(sn),$t=new WeakMap,Gt=new WeakMap,Qt=new WeakMap,en=new WeakSet,tn=new WeakMap,nn=new WeakMap,an=new WeakMap,rn=new WeakMap;class on extends he.ReactNextElement{constructor(){super(...arguments),(0,re.A)(this,en),(0,ie.A)(this,$t,(Mt(this),Nt(this))),(0,ie.A)(this,Gt,(Wt(this),zt(this))),(0,ie.A)(this,Qt,(Tt(this),Rt(this))),(0,ie.A)(this,tn,(Dt(this),e=>{Kt(en,this,St).emit(e)})),(0,ie.A)(this,nn,Bt(this)),(0,ie.A)(this,an,(jt(this),e=>{Kt(en,this,Ot).emit(e)})),(0,ie.A)(this,rn,(0,ce.createRef)())}get label(){return Ut($t,this)}set label(e){Yt($t,this,e)}get type(){return Ut(Gt,this)}set type(e){Yt(Gt,this,e)}enableEditing(){var e;null===(e=Ut(rn,this).current)||void 0===e||e.enableEditing()}render(){return ue().createElement(Jt,{ref:Ut(rn,this),label:this.label,onLabelEditingChange:Ut(tn,this),onLabelChange:Ut(an,this)})}}function sn(e,t){var{label:n,onLabelChange:a,onLabelEditingChange:r}=e,i=null!=n?n:"",[o,s]=(0,ce.useState)(i),[l,c]=(0,ce.useState)(!1),u=(0,ce.useRef)(!1),[d,h]=(0,ce.useState)(!1),f=(0,ce.useRef)(null);(0,ce.useImperativeHandle)(t,(()=>({enableEditing(){c(!0)}}))),(0,ce.useEffect)((()=>{s(i)}),[i]);var g=(0,ce.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),c(!0)}),[]);(0,ce.useEffect)((()=>{var e,t;l&&(null===(e=f.current)||void 0===e||e.focus({preventScroll:!0}),null===(t=f.current)||void 0===t||t.select())}),[l]),(0,ce.useEffect)((()=>{u.current?null==r||r(l):u.current=!0}),[l,r]);var p=(0,ce.useCallback)((e=>{s(e.target.value)}),[]),v=(0,ce.useCallback)((e=>{var t,n=e.key||e.keyCode||e.which;"Enter"!==n&&13!==n||null===(t=f.current)||void 0===t||t.blur()}),[]),m=(0,ce.useCallback)((()=>{c(!1),h(!0)}),[]);(0,ce.useEffect)((()=>{d&&(null==a||a(o),h(!1))}),[o,a,d]);var b=(0,ce.useCallback)((e=>{e.stopPropagation()}),[]);return ue().createElement("div",{className:ve()("label",{editing:l,empty:!o}),onDoubleClick:b,onMouseDown:b},ue().createElement("input",{className:"label-input",value:o,ref:f,onChange:p,onKeyDown:v,onBlur:m}),ue().createElement("div",{className:"label-text",onDoubleClick:g},o))}It=on,({e:[Nt,Wt,zt,Tt,Rt,St,Lt,Dt,Bt,Ot,Pt,jt,Mt],c:[Vt,xt]}=function(e,t,n,a,r,i){var o,s,l,c,u,d,h,f=Symbol.metadata||Symbol.for("Symbol.metadata"),g=Object.defineProperty,p=Object.create,v=[p(null),p(null)],m=t.length;function b(t,n,a){return function(r,i){n&&(i=r,r=e);for(var o=0;o<t.length;o++)i=t[o].apply(r,a?[i]:[]);return a?i:r}}function y(e,t,n,a){if("function"!=typeof e&&(a||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(a?"":" or undefined"));return e}function w(e,t,n,a,r,i,l,c,u,d,h){function f(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var p=[].concat(t[0]),m=t[3],w=!l,k=1===r,A=3===r,E=4===r,C=2===r;function M(t,n,a){return function(r,i){return n&&(i=r,r=e),a&&a(r),x[t].call(r,i)}}if(!w){var x={},N=[],W=A?"get":E||k?"set":"value";if(u?(d||k?x={get:(0,se.A)((function(){return m(this)}),a,"get"),set:function(e){t[4](this,e)}}:x[W]=m,d||(0,se.A)(x[W],a,C?"":W)):d||(x=Object.getOwnPropertyDescriptor(e,a)),!d&&!u){if((s=v[+c][a])&&7!=(s^r))throw new Error("Decorating two elements with the same name ("+x[W].name+") is not supported yet");v[+c][a]=r<3?1:r}}for(var z=e,T=p.length-1;T>=0;T-=n?2:1){var R=p[T],S=n?p[T-1]:void 0,L={},D={kind:["field","accessor","method","getter","setter","class"][r],name:a,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");y(t,"An initializer","be",!0),i.push(t)}.bind(null,L)};if(w)s=R.call(S,z,D),L.v=1,y(s,"class decorators","return")&&(z=s);else if(D.static=c,D.private=u,s=D.access={has:u?h.bind():function(e){return a in e}},E||(s.get=u?C?function(e){return f(e),x.value}:M("get",0,f):function(e){return e[a]}),C||A||(s.set=u?M("set",0,f):function(e,t){e[a]=t}),z=R.call(S,k?{get:x.get,set:x.set}:x[W],D),L.v=1,k){if("object"==typeof z&&z)(s=y(z.get,"accessor.get"))&&(x.get=s),(s=y(z.set,"accessor.set"))&&(x.set=s),(s=y(z.init,"accessor.init"))&&N.unshift(s);else if(void 0!==z)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else y(z,(d?"field":"method")+" decorators","return")&&(d?N.unshift(z):x[W]=z)}return r<2&&l.push(b(N,c,1),b(i,c,0)),d||w||(u?k?l.splice(-1,0,M("get",c),M("set",c)):l.push(C?x[W]:y.call.bind(x[W])):g(e,a,x)),z}function k(e){return g(e,f,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[f]),o=p(null==o?null:o),u=[],d=function(e){e&&u.push(b(e))},(h=function(t,a){for(var i=0;i<n.length;i++){var o=n[i],s=o[1],d=7&s;if((8&s)==t&&!d==a){var h=o[2],f=!!o[3],g=16&s;w(t?e:e.prototype,o,g,f?"#"+h:(0,oe.A)(h),d,d<2?[]:t?c=c||[]:l=l||[],u,!!t,f,a,t&&f?function(t){return(0,le.A)(t)===e}:r)}}})(8,0),h(0,0),h(8,1),h(0,1),d(l),d(c),s=u,m||k(e),{e:s,get c(){var n=[];return m&&[k(e=w(e,[t],0,e.name,5,n)),b(n,1)]}}}(It,[_t("diagram.editable-label",{styleTexts:[Ht.A]})],[[Ft(),1,"label"],[Ft({render:!1}),1,"type"],[Zt({type:"label.editing.change"}),1,"labelEditingChange",e=>Ut(Qt,e),(e,t)=>Yt(Qt,e,t)],[Zt({type:"label.change"}),1,"labelChange",e=>Ut(nn,e),(e,t)=>Yt(nn,e,t)],[qt(),2,"enableEditing"]],0,(e=>rn.has((0,le.A)(e))),he.ReactNextElement)),xt();var ln=n(4223),cn=n(9740),un=n(6330),dn=n(8438),hn=n(5748),fn=n(531),gn=n(8185),pn=n(2830);function vn(e){var{connectLineState:t,transform:n,markerEnd:a,onConnect:r}=e,[i,o]=(0,ce.useState)(null);return(0,ce.useEffect)((()=>{t&&o(t.from)}),[t]),(0,ce.useEffect)((()=>{if(t){var e=e=>{o([(e.clientX-n.x-t.offset[0])/n.k,(e.clientY-n.y-t.offset[1])/n.k])},a=e=>{e.stopPropagation()},i=e=>{e.stopPropagation(),s(),r(t,[(e.clientX-n.x-t.offset[0])/n.k,(e.clientY-n.y-t.offset[1])/n.k])},s=()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mousedown",a,{capture:!0}),document.removeEventListener("click",i,{capture:!0}),o(null)};return document.addEventListener("mousemove",e),document.addEventListener("mousedown",a,{capture:!0}),document.addEventListener("click",i,{capture:!0}),s}}),[t,r,n]),ue().createElement("path",{className:ve()("connect-line",{connecting:!!t&&i&&(i[0]-t.from[0])**2+(i[1]-t.from[1])**2>25}),d:t&&i?"M".concat(t.from.join(" "),"L").concat(i.join(" ")):"",fill:"none",stroke:"gray",strokeWidth:1,markerEnd:"url(#".concat(a,")")})}var mn,bn,yn,wn,kn,An,En,Cn,Mn,xn,Nn,Wn,zn,Tn,Rn,Sn,Ln,Dn,Bn,On,Pn,jn,In,Hn,Kn,Yn,Un,Xn,Vn,_n,Fn,Zn,qn,Jn,$n,Gn,Qn,ea,ta,na,aa,ra,ia,oa,sa,la,ca,ua,da,ha,fa,ga,pa,va,ma,ba,ya,wa,ka,Aa,Ea,Ca,Ma,xa,Na,Wa,za,Ta=n(3783),Ra=n(2098),Sa=n(227),La=n(3033),Da=n(8091),Ba=n(1819),Oa=n(7099),Pa=n(1484),ja=n(8197),Ia=n(7531),Ha=n(3012),Ka=n(8618),Ya=["shouldReCenter"];function Ua(e,t,n){return n(_a(e,t))}function Xa(e,t,n){return e.set(_a(e,t),n),n}function Va(e,t){return e.get(_a(e,t))}function _a(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var Fa,Za=(0,dn.unwrapProvider)("basic.lock-body-scroll"),{defineElement:qa,property:Ja,method:$a,event:Ga}=(0,de.createDecorators)(),Qa=ue().forwardRef(Br),er=new WeakMap,tr=new WeakMap,nr=new WeakMap,ar=new WeakMap,rr=new WeakMap,ir=new WeakMap,or=new WeakMap,sr=new WeakMap,lr=new WeakMap,cr=new WeakMap,ur=new WeakMap,dr=new WeakMap,hr=new WeakMap,fr=new WeakMap,gr=new WeakMap,pr=new WeakSet,vr=new WeakMap,mr=new WeakMap,br=new WeakMap,yr=new WeakMap,wr=new WeakMap,kr=new WeakMap,Ar=new WeakMap,Er=new WeakMap,Cr=new WeakMap,Mr=new WeakMap,xr=new WeakMap,Nr=new WeakMap,Wr=new WeakMap,zr=new WeakMap,Tr=new WeakMap,Rr=new WeakMap,Sr=new WeakMap;class Lr extends he.ReactNextElement{constructor(){super(...arguments),(0,re.A)(this,pr),(0,ie.A)(this,er,(mn(this),yn(this))),(0,ie.A)(this,tr,(wn(this),kn(this))),(0,ie.A)(this,nr,(An(this),En(this))),(0,ie.A)(this,ar,(Cn(this),Mn(this,[La.HP,La.HP]))),(0,ie.A)(this,rr,(xn(this),Nn(this))),(0,ie.A)(this,ir,(Wn(this),zn(this))),(0,ie.A)(this,or,(Tn(this),Rn(this))),(0,ie.A)(this,sr,(Sn(this),Ln(this))),(0,ie.A)(this,lr,(Dn(this),Bn(this))),(0,ie.A)(this,cr,(On(this),Pn(this))),(0,ie.A)(this,ur,(jn(this),In(this,!0))),(0,ie.A)(this,dr,(Hn(this),Kn(this,!0))),(0,ie.A)(this,hr,(Yn(this),Un(this,!0))),(0,ie.A)(this,fr,(Xn(this),Vn(this))),(0,ie.A)(this,gr,(_n(this),Fn(this))),(0,ie.A)(this,vr,(Jn(this),e=>{Ua(pr,this,Zn).emit(e)})),(0,ie.A)(this,mr,(e=>{(0,gn.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,ie.A)(this,br,$n(this)),(0,ie.A)(this,yr,(ea(this),ta(this))),(0,ie.A)(this,wr,(ra(this),e=>{Ua(pr,this,na).emit(e),"node"===e.type&&Ua(pr,this,Gn).emit(e)})),(0,ie.A)(this,kr,ia(this)),(0,ie.A)(this,Ar,(la(this),e=>{Ua(pr,this,oa).emit(e)})),(0,ie.A)(this,Er,ca(this)),(0,ie.A)(this,Cr,(ha(this),fa(this))),(0,ie.A)(this,Mr,(va(this),e=>{Ua(pr,this,ga).emit(e),"node"===e.type&&Ua(pr,this,ua).emit(e)})),(0,ie.A)(this,xr,ma(this)),(0,ie.A)(this,Nr,(wa(this),e=>{Ua(pr,this,ba).emit(e)})),(0,ie.A)(this,Wr,ka(this)),(0,ie.A)(this,zr,(Ca(this),e=>{Ua(pr,this,Aa).emit(e)})),(0,ie.A)(this,Tr,Ma(this)),(0,ie.A)(this,Rr,(Wa(this),e=>{Ua(pr,this,xa).emit(e)})),(0,ie.A)(this,Sr,(0,ce.createRef)())}get cells(){return Va(er,this)}set cells(e){Xa(er,this,e)}get layout(){return Va(tr,this)}set layout(e){Xa(tr,this,e)}get layoutOptions(){return Va(nr,this)}set layoutOptions(e){Xa(nr,this,e)}get defaultNodeSize(){return Va(ar,this)}set defaultNodeSize(e){Xa(ar,this,e)}get defaultNodeBricks(){return Va(rr,this)}set defaultNodeBricks(e){Xa(rr,this,e)}get degradedThreshold(){return Va(ir,this)}set degradedThreshold(e){Xa(ir,this,e)}get degradedNodeLabel(){return Va(or,this)}set degradedNodeLabel(e){Xa(or,this,e)}get defaultEdgeLines(){return Va(sr,this)}set defaultEdgeLines(e){Xa(sr,this,e)}get activeTarget(){return Va(lr,this)}set activeTarget(e){Xa(lr,this,e)}get fadeUnrelatedCells(){return Va(cr,this)}set fadeUnrelatedCells(e){Xa(cr,this,e)}get zoomable(){return Va(ur,this)}set zoomable(e){Xa(ur,this,e)}get scrollable(){return Va(dr,this)}set scrollable(e){Xa(dr,this,e)}get pannable(){return Va(hr,this)}set pannable(e){Xa(hr,this,e)}get scaleRange(){return Va(fr,this)}set scaleRange(e){Xa(fr,this,e)}dropNode(e){var t=this;return(0,un.A)((function*(){var n,a,{id:r,position:i,size:o,data:s,useBrick:l}=e;if(null===(n=(a=document).elementsFromPoint)||void 0===n||null===(n=n.call(a,i[0],i[1]))||void 0===n?void 0:n.includes(t)){var c,u,d,h=t.getBoundingClientRect(),f=Va(Sr,t).current.getTransform(),g={type:"node",id:r,view:(0,cn.A)((0,cn.A)({},"force"===t.layout||"dagre"===t.layout?null:{x:(i[0]-h.left-f.x)/f.k,y:(i[1]-h.top-f.y)/f.k}),{},{width:null!==(c=null==o?void 0:o[0])&&void 0!==c?c:t.defaultNodeSize[0],height:null!==(u=null==o?void 0:o[1])&&void 0!==u?u:t.defaultNodeSize[0]}),data:s,useBrick:l};return null===(d=Va(Sr,t).current)||void 0===d||d.dropNode(g),g}return null}))()}dropDecorator(e){var t=this;return(0,un.A)((function*(){var n,a,{position:r,decorator:i,text:o}=e;if(null===(n=(a=document).elementsFromPoint)||void 0===n||null===(n=n.call(a,r[0],r[1]))||void 0===n?void 0:n.includes(t)){var s,l=t.getBoundingClientRect(),c=Va(Sr,t).current.getTransform(),u={type:"decorator",decorator:i,id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),view:{x:(r[0]-l.left-c.x)/c.k,y:(r[1]-l.top-c.y)/c.k,width:La.N8,height:La.w1,text:o}};return null===(s=Va(Sr,t).current)||void 0===s||s.dropDecorator(u),u}return null}))()}addNodes(e){var t=this;return(0,un.A)((function*(){if(0===e.length)return[];var n=e.map((e=>{var n,a,{size:r,useBrick:i,id:o,data:s}=e;return{type:"node",id:o,data:s,view:{width:null!==(n=null==r?void 0:r[0])&&void 0!==n?n:t.defaultNodeSize[0],height:null!==(a=null==r?void 0:r[1])&&void 0!==a?a:t.defaultNodeSize[0]},useBrick:i}}));return Va(Sr,t).current.addNodes(n,{defaultNodeSize:t.defaultNodeSize,canvasWidth:t.clientWidth,canvasHeight:t.clientHeight})}))()}addEdge(e){var t=this;return(0,un.A)((function*(){var n,{source:a,target:r,data:i}=e,o={type:"edge",source:a,target:r,data:i};return null===(n=Va(Sr,t).current)||void 0===n||n.addEdge(o),o}))()}manuallyConnectNodes(e){return Va(Sr,this).current.manuallyConnectNodes(e)}updateCells(e,t){var n=this;return(0,un.A)((function*(){yield _a(pr,n,Dr).call(n);var{updated:a}=Va(Sr,n).current.updateCells(e,(0,cn.A)((0,cn.A)({},t),{},{defaultNodeSize:n.defaultNodeSize,canvasWidth:n.clientWidth,canvasHeight:n.clientHeight}));return{updated:a}}))()}disconnectedCallback(){super.disconnectedCallback(),Za(this,!1)}render(){return ue().createElement(Qa,{host:this,ref:Va(Sr,this),layout:this.layout,layoutOptions:this.layoutOptions,cells:this.cells,defaultNodeSize:this.defaultNodeSize,defaultNodeBricks:this.defaultNodeBricks,defaultEdgeLines:this.defaultEdgeLines,degradedThreshold:this.degradedThreshold,degradedNodeLabel:this.degradedNodeLabel,activeTarget:this.activeTarget,fadeUnrelatedCells:this.fadeUnrelatedCells,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:Va(vr,this),onSwitchActiveTarget:Va(mr,this),onCellMove:Va(wr,this),onCellResize:Va(Ar,this),onCellDelete:Va(Mr,this),onCellContextMenu:Va(Nr,this),onDecoratorTextChange:Va(zr,this),onScaleChange:Va(Rr,this)})}}function Dr(){return new Promise((e=>{var t=()=>{Va(Sr,this).current?e():setTimeout(t,10)};t()}))}function Br(e,t){var{host:n,layout:a,layoutOptions:r,cells:i,defaultNodeSize:o,defaultNodeBricks:s,defaultEdgeLines:l,degradedThreshold:c,degradedNodeLabel:u,activeTarget:d,fadeUnrelatedCells:h,zoomable:f,scrollable:g,pannable:p,scaleRange:v,onActiveTargetChange:m,onSwitchActiveTarget:b,onCellMove:y,onCellResize:w,onCellDelete:k,onCellContextMenu:A,onDecoratorTextChange:E,onScaleChange:C}=e,[{cells:M,layoutKey:x},N]=(0,ce.useReducer)(hn.d,i,(e=>({cells:(0,Ta.C)(e,{defaultNodeSize:o}),layoutKey:0}))),W=(0,ce.useMemo)((()=>M.filter(fn.N).length>=(null!=c?c:La.pC)),[M,c]),z=(0,ce.useRef)(null),T=(0,ce.useRef)(null),R=(0,ce.useRef)(null),[S,L]=(0,ce.useState)([]),{grabbing:D,transform:B,zoomer:O,scaleRange:P}=(0,Da.f)({rootRef:z,zoomable:f,scrollable:g,pannable:p,scaleRange:v,onSwitchActiveTarget:b});(0,ce.useEffect)((()=>{C(B.k)}),[C,B.k]);var[j,I]=(0,ce.useState)(null),{centered:H,setCentered:K,getNextLayoutKey:Y}=(0,Pa.g)({layout:a,layoutOptions:r,rootRef:z,cells:M,zoomable:f,zoomer:O,scaleRange:P,layoutKey:x,dispatch:N});(0,ce.useImperativeHandle)(t,(()=>({dropNode(e){K(!0),N({type:"drop-node",payload:e})},dropDecorator(e){K(!0),N({type:"drop-decorator",payload:e})},addNodes(e,t){var{defaultNodeSize:n,canvasWidth:r,canvasHeight:i}=t,o=M.findLastIndex((e=>!("decorator"===e.type&&"text"===e.decorator)))+1,s=[...M.slice(0,o),...e,...M.slice(o)],{cells:l,updated:c,shouldReCenter:u}=(0,Ra.L)({cells:s,layout:a,previousCells:M,defaultNodeSize:n,canvasWidth:r,canvasHeight:i,scaleRange:P,transform:B});return u&&K(!1),N({type:"update-cells",payload:l}),c.filter((t=>e.includes(t)))},addEdge(e){N({type:"add-edge",payload:e})},updateCells(e,t){var n=(0,Ra.L)((0,cn.A)((0,cn.A)({},t),{},{layout:a,previousCells:M,cells:e,scaleRange:P,transform:B})),{shouldReCenter:r}=n,i=(0,ln.A)(n,Ya);return r&&K(!1),N({type:"update-cells",payload:i.cells}),i},getTransform:()=>B,manuallyConnectNodes(e){var t=M.find((t=>(0,fn.N)(t)&&t.id===e));if(t){var n=z.current.getBoundingClientRect();return I({source:t,from:[t.view.x+t.view.width/2,t.view.y+t.view.height/2],offset:[n.left,n.top]}),new Promise(((e,t)=>{R.current={resolve:e,reject:t}}))}return Promise.reject(null)}})),[M,a,P,K,B]);var U=(0,ce.useCallback)(((e,t)=>{for(var n,a=0;a<M.length;a++){var r=M[a];if((0,fn.N)(r)&&r.id!==e.source.id&&r.view.x<t[0]&&r.view.x+r.view.width>t[0]&&r.view.y<t[1]&&r.view.y+r.view.height>t[1]){var i;null===(i=R.current)||void 0===i||i.resolve({source:e.source,target:r});break}}null===(n=R.current)||void 0===n||n.reject(null),I(null)}),[M]);(0,ce.useEffect)((()=>{Za(n,!!j)}),[j,n]);var X=(0,Ba.J)({cellsRef:T,activeTarget:d,onActiveTargetChange:m}),[V,_]=(0,ce.useState)([]);(0,ce.useEffect)((()=>{var e=h?(0,Sa.Y)(M,j,X):[];_((t=>0===t.length&&0===e.length?t:e))}),[X,M,j,h]),(0,ce.useEffect)((()=>{var e=z.current;if(e&&!(S.length>0)){var t=e=>{var t=function(e,t){var{cells:n,activeTarget:a}=t,r=n.find((e=>(0,gn.c)(e,a)));if(r)switch(e.key||e.keyCode||e.which){case"Backspace":case 8:case"Delete":case 46:return e.preventDefault(),e.stopPropagation(),{action:"delete-cell",cell:r}}}(e,{cells:M,activeTarget:X});"delete-cell"===(null==t?void 0:t.action)&&k(t.cell)};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}}),[X,M,S.length,k]);var F=(0,ce.useMemo)((()=>"".concat((0,me.uniqueId)("diagram-"),"-")),[]),Z="".concat(F,"line-arrow-"),q=(0,ce.useCallback)((e=>{N({type:"move-cell",payload:e})}),[]),J=(0,ce.useCallback)((e=>{N({type:"move-cell",payload:e}),y(e)}),[y]),$=(0,ce.useCallback)((e=>{N({type:"resize-cell",payload:e})}),[]),G=(0,ce.useCallback)((e=>{N({type:"resize-cell",payload:e}),w(e)}),[w]),Q=(0,ce.useCallback)((e=>{var{id:t,editing:n}=e;L(n?e=>e.includes(t)?e:[...e,t]:e=>e.filter((e=>e!==t)))}),[]),ee=(0,ce.useCallback)(((e,t)=>{var n=Y();N({type:"update-node-size",payload:{id:e,size:t},layoutKey:n})}),[Y]),te=(0,ce.useCallback)((e=>{O.scaleTo((0,fe.A)(z.current),e/100)}),[O]),ne=(0,ce.useCallback)((()=>{K(!1)}),[K]),[ae,re]=(0,Ia.d)({cells:M,defaultEdgeLines:l,markerPrefix:Z}),ie=(0,ja.H)({cells:M,layout:a,centered:H});return ue().createElement(ue().Fragment,null,ue().createElement("svg",{width:"100%",height:"100%",ref:z,className:ve()("root",{grabbing:D,pannable:p,ready:ie}),tabIndex:-1},ue().createElement("defs",null,re.map(((e,t)=>ue().createElement(xe.c,{key:t,id:"".concat(Z).concat(t),type:"arrow",strokeColor:e.strokeColor})))),ue().createElement("g",{transform:"translate(".concat(B.x," ").concat(B.y,") scale(").concat(B.k,")")},ue().createElement("g",{className:"cells",ref:T},M.map((e=>ue().createElement(pn.m,{key:"".concat(e.type,":").concat("edge"===e.type?"".concat(e.source,"~").concat(e.target):e.id),layout:a,cell:e,cells:M,degraded:W,degradedNodeLabel:u,defaultNodeBricks:s,transform:B,lineConfMap:ae,active:(0,gn.c)(X,e),unrelatedCells:V,onCellMoving:q,onCellMoved:J,onCellResizing:$,onCellResized:G,onSwitchActiveTarget:b,onCellContextMenu:A,onDecoratorTextChange:E,onDecoratorTextEditing:Q,onNodeBrickResize:ee})))),ue().createElement(vn,{connectLineState:j,transform:B,markerEnd:"".concat(Z,"0"),onConnect:U}))),ue().createElement(Oa.Y,{shadowRoot:n.shadowRoot,scale:B.k,scaleRange:P,onZoomChange:te,onReCenter:ne}))}za=Lr,({e:[yn,wn,kn,An,En,Cn,Mn,xn,Nn,Wn,zn,Tn,Rn,Sn,Ln,Dn,Bn,On,Pn,jn,In,Hn,Kn,Yn,Un,Xn,Vn,_n,Fn,Zn,qn,Jn,$n,Gn,Qn,ea,ta,na,aa,ra,ia,oa,sa,la,ca,ua,da,ha,fa,ga,pa,va,ma,ba,ya,wa,ka,Aa,Ea,Ca,Ma,xa,Na,Wa,mn],c:[Fa,bn]}=function(e,t,n,a,r,i){var o,s,l,c,u,d,h,f=Symbol.metadata||Symbol.for("Symbol.metadata"),g=Object.defineProperty,p=Object.create,v=[p(null),p(null)],m=t.length;function b(t,n,a){return function(r,i){n&&(i=r,r=e);for(var o=0;o<t.length;o++)i=t[o].apply(r,a?[i]:[]);return a?i:r}}function y(e,t,n,a){if("function"!=typeof e&&(a||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(a?"":" or undefined"));return e}function w(e,t,n,a,r,i,l,c,u,d,h){function f(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var p=[].concat(t[0]),m=t[3],w=!l,k=1===r,A=3===r,E=4===r,C=2===r;function M(t,n,a){return function(r,i){return n&&(i=r,r=e),a&&a(r),x[t].call(r,i)}}if(!w){var x={},N=[],W=A?"get":E||k?"set":"value";if(u?(d||k?x={get:(0,se.A)((function(){return m(this)}),a,"get"),set:function(e){t[4](this,e)}}:x[W]=m,d||(0,se.A)(x[W],a,C?"":W)):d||(x=Object.getOwnPropertyDescriptor(e,a)),!d&&!u){if((s=v[+c][a])&&7!=(s^r))throw new Error("Decorating two elements with the same name ("+x[W].name+") is not supported yet");v[+c][a]=r<3?1:r}}for(var z=e,T=p.length-1;T>=0;T-=n?2:1){var R=p[T],S=n?p[T-1]:void 0,L={},D={kind:["field","accessor","method","getter","setter","class"][r],name:a,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");y(t,"An initializer","be",!0),i.push(t)}.bind(null,L)};if(w)s=R.call(S,z,D),L.v=1,y(s,"class decorators","return")&&(z=s);else if(D.static=c,D.private=u,s=D.access={has:u?h.bind():function(e){return a in e}},E||(s.get=u?C?function(e){return f(e),x.value}:M("get",0,f):function(e){return e[a]}),C||A||(s.set=u?M("set",0,f):function(e,t){e[a]=t}),z=R.call(S,k?{get:x.get,set:x.set}:x[W],D),L.v=1,k){if("object"==typeof z&&z)(s=y(z.get,"accessor.get"))&&(x.get=s),(s=y(z.set,"accessor.set"))&&(x.set=s),(s=y(z.init,"accessor.init"))&&N.unshift(s);else if(void 0!==z)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else y(z,(d?"field":"method")+" decorators","return")&&(d?N.unshift(z):x[W]=z)}return r<2&&l.push(b(N,c,1),b(i,c,0)),d||w||(u?k?l.splice(-1,0,M("get",c),M("set",c)):l.push(C?x[W]:y.call.bind(x[W])):g(e,a,x)),z}function k(e){return g(e,f,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[f]),o=p(null==o?null:o),u=[],d=function(e){e&&u.push(b(e))},(h=function(t,a){for(var i=0;i<n.length;i++){var o=n[i],s=o[1],d=7&s;if((8&s)==t&&!d==a){var h=o[2],f=!!o[3],g=16&s;w(t?e:e.prototype,o,g,f?"#"+h:(0,oe.A)(h),d,d<2?[]:t?c=c||[]:l=l||[],u,!!t,f,a,t&&f?function(t){return(0,le.A)(t)===e}:r)}}})(8,0),h(0,0),h(8,1),h(0,1),d(l),d(c),s=u,m||k(e),{e:s,get c(){var n=[];return m&&[k(e=w(e,[t],0,e.name,5,n)),b(n,1)]}}}(za,[qa("eo-draw-canvas",{styleTexts:[Ha.A,Ka.A]})],[[Ja({attribute:!1}),1,"cells"],[Ja({type:String}),1,"layout"],[Ja({attribute:!1}),1,"layoutOptions"],[Ja({attribute:!1}),1,"defaultNodeSize"],[Ja({attribute:!1}),1,"defaultNodeBricks"],[Ja({type:Number}),1,"degradedThreshold"],[Ja({attribute:!1}),1,"degradedNodeLabel"],[Ja({attribute:!1}),1,"defaultEdgeLines"],[Ja({attribute:!1}),1,"activeTarget"],[Ja({type:Boolean}),1,"fadeUnrelatedCells"],[Ja({type:Boolean}),1,"zoomable"],[Ja({type:Boolean}),1,"scrollable"],[Ja({type:Boolean}),1,"pannable"],[Ja({attribute:!1}),1,"scaleRange"],[Ga({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>Va(gr,e),(e,t)=>Xa(gr,e,t)],[Ga({type:"node.move"}),1,"nodeMoveEvent",e=>Va(br,e),(e,t)=>Xa(br,e,t)],[Ga({type:"cell.move"}),1,"cellMoveEvent",e=>Va(yr,e),(e,t)=>Xa(yr,e,t)],[Ga({type:"cell.resize"}),1,"cellResizeEvent",e=>Va(kr,e),(e,t)=>Xa(kr,e,t)],[Ga({type:"node.delete"}),1,"nodeDelete",e=>Va(Er,e),(e,t)=>Xa(Er,e,t)],[Ga({type:"cell.delete"}),1,"cellDelete",e=>Va(Cr,e),(e,t)=>Xa(Cr,e,t)],[Ga({type:"cell.contextmenu"}),1,"cellContextMenu",e=>Va(xr,e),(e,t)=>Xa(xr,e,t)],[Ga({type:"decorator.text.change"}),1,"decoratorTextChange",e=>Va(Wr,e),(e,t)=>Xa(Wr,e,t)],[Ga({type:"scale.change"}),1,"scaleChange",e=>Va(Tr,e),(e,t)=>Xa(Tr,e,t)],[$a(),2,"dropNode"],[$a(),2,"dropDecorator"],[$a(),2,"addNodes"],[$a(),2,"addEdge"],[$a(),2,"manuallyConnectNodes"],[$a(),2,"updateCells"]],0,(e=>Sr.has((0,le.A)(e))),he.ReactNextElement)),bn();var Or,Pr,jr,Ir,Hr,Kr,Yr,Ur,Xr,Vr,_r,Fr,Zr,qr,Jr,$r,Gr,Qr,ei,ti,ni=n(497);function ai(e,t,n){return n(oi(e,t))}function ri(e,t,n){return e.set(oi(e,t),n),n}function ii(e,t){return e.get(oi(e,t))}function oi(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var si,li,ci,ui,di,hi,fi,gi,pi,vi,mi,bi,yi,wi,ki,Ai,Ei,Ci,Mi,xi,Ni,Wi,zi,Ti,Ri,Si,Li,Di,Bi,Oi,Pi,ji,Ii,Hi,Ki,Yi,Ui,Xi,Vi,_i,Fi,Zi,qi,{defineElement:Ji,property:$i,event:Gi}=(0,de.createDecorators)(),Qi=new WeakMap,eo=new WeakMap,to=new WeakMap,no=new WeakMap,ao=new WeakSet,ro=new WeakMap,io=new WeakMap,oo=new WeakMap,so=new WeakMap,lo=new WeakMap;class co extends he.ReactNextElement{constructor(){super(...arguments),(0,re.A)(this,ao),(0,ie.A)(this,Qi,Pr(this)),(0,ie.A)(this,eo,(jr(this),Ir(this))),(0,ie.A)(this,to,(Hr(this),Kr(this))),(0,ie.A)(this,no,(Yr(this),Ur(this))),(0,ie.A)(this,ro,(_r(this),e=>{ai(ao,this,Xr).emit(e)})),(0,ie.A)(this,io,Fr(this)),(0,ie.A)(this,oo,(Jr(this),e=>{ai(ao,this,Zr).emit(e)})),(0,ie.A)(this,so,$r(this)),(0,ie.A)(this,lo,(ei(this),e=>{ai(ao,this,Gr).emit(e)}))}get usage(){return ii(Qi,this)}set usage(e){ri(Qi,this,e)}get status(){return ii(eo,this)}set status(e){ri(eo,this,e)}get decorator(){return ii(to,this)}set decorator(e){ri(to,this,e)}render(){return ue().createElement(uo,{usage:this.usage,onDragStart:ii(ro,this),onDragMove:ii(oo,this),onDragEnd:ii(lo,this)})}}function uo(e){var{usage:t,onDragStart:n,onDragMove:a,onDragEnd:r}=e,i=(0,ce.useCallback)((e=>{if("library"===t){e.stopPropagation(),e.preventDefault();var i=[e.clientX,e.clientY],o=!1,s=e=>{o||(o=(e.clientX-i[0])**2+(e.clientY-i[1])**2>=9)&&(null==n||n([e.clientX,e.clientY])),o&&(null==a||a([e.clientX,e.clientY]))},l=e=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",l),o&&(null==r||r([e.clientX,e.clientY]))};document.addEventListener("mousemove",s),document.addEventListener("mouseup",l)}}),[r,a,n,t]);return ue().createElement("div",{onMouseDown:i},ue().createElement("slot",null))}function ho(e,t,n){return n(po(e,t))}function fo(e,t,n){return e.set(po(e,t),n),n}function go(e,t){return e.get(po(e,t))}function po(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}ti=co,({e:[Pr,jr,Ir,Hr,Kr,Yr,Ur,Xr,Vr,_r,Fr,Zr,qr,Jr,$r,Gr,Qr,ei],c:[si,Or]}=function(e,t,n,a,r,i){var o,s,l,c,u,d,h,f=Symbol.metadata||Symbol.for("Symbol.metadata"),g=Object.defineProperty,p=Object.create,v=[p(null),p(null)],m=t.length;function b(t,n,a){return function(r,i){n&&(i=r,r=e);for(var o=0;o<t.length;o++)i=t[o].apply(r,a?[i]:[]);return a?i:r}}function y(e,t,n,a){if("function"!=typeof e&&(a||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(a?"":" or undefined"));return e}function w(e,t,n,a,r,i,l,c,u,d,h){function f(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var p=[].concat(t[0]),m=t[3],w=!l,k=1===r,A=3===r,E=4===r,C=2===r;function M(t,n,a){return function(r,i){return n&&(i=r,r=e),a&&a(r),x[t].call(r,i)}}if(!w){var x={},N=[],W=A?"get":E||k?"set":"value";if(u?(d||k?x={get:(0,se.A)((function(){return m(this)}),a,"get"),set:function(e){t[4](this,e)}}:x[W]=m,d||(0,se.A)(x[W],a,C?"":W)):d||(x=Object.getOwnPropertyDescriptor(e,a)),!d&&!u){if((s=v[+c][a])&&7!=(s^r))throw new Error("Decorating two elements with the same name ("+x[W].name+") is not supported yet");v[+c][a]=r<3?1:r}}for(var z=e,T=p.length-1;T>=0;T-=n?2:1){var R=p[T],S=n?p[T-1]:void 0,L={},D={kind:["field","accessor","method","getter","setter","class"][r],name:a,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");y(t,"An initializer","be",!0),i.push(t)}.bind(null,L)};if(w)s=R.call(S,z,D),L.v=1,y(s,"class decorators","return")&&(z=s);else if(D.static=c,D.private=u,s=D.access={has:u?h.bind():function(e){return a in e}},E||(s.get=u?C?function(e){return f(e),x.value}:M("get",0,f):function(e){return e[a]}),C||A||(s.set=u?M("set",0,f):function(e,t){e[a]=t}),z=R.call(S,k?{get:x.get,set:x.set}:x[W],D),L.v=1,k){if("object"==typeof z&&z)(s=y(z.get,"accessor.get"))&&(x.get=s),(s=y(z.set,"accessor.set"))&&(x.set=s),(s=y(z.init,"accessor.init"))&&N.unshift(s);else if(void 0!==z)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else y(z,(d?"field":"method")+" decorators","return")&&(d?N.unshift(z):x[W]=z)}return r<2&&l.push(b(N,c,1),b(i,c,0)),d||w||(u?k?l.splice(-1,0,M("get",c),M("set",c)):l.push(C?x[W]:y.call.bind(x[W])):g(e,a,x)),z}function k(e){return g(e,f,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[f]),o=p(null==o?null:o),u=[],d=function(e){e&&u.push(b(e))},(h=function(t,a){for(var i=0;i<n.length;i++){var o=n[i],s=o[1],d=7&s;if((8&s)==t&&!d==a){var h=o[2],f=!!o[3],g=16&s;w(t?e:e.prototype,o,g,f?"#"+h:(0,oe.A)(h),d,d<2?[]:t?c=c||[]:l=l||[],u,!!t,f,a,t&&f?function(t){return(0,le.A)(t)===e}:r)}}})(8,0),h(0,0),h(8,1),h(0,1),d(l),d(c),s=u,m||k(e),{e:s,get c(){var n=[];return m&&[k(e=w(e,[t],0,e.name,5,n)),b(n,1)]}}}(ti,[Ji("diagram.experimental-node",{styleTexts:[ni.A]})],[[$i(),1,"usage"],[$i({type:String,render:!1}),1,"status"],[$i({type:String}),1,"decorator"],[Gi({type:"drag.start"}),1,"dragStartEvent",e=>ii(no,e),(e,t)=>ri(no,e,t)],[Gi({type:"drag.move"}),1,"dragMoveEvent",e=>ii(io,e),(e,t)=>ri(io,e,t)],[Gi({type:"drag.end"}),1,"dragEndEvent",e=>ii(so,e),(e,t)=>ri(so,e,t)]],0,(e=>lo.has((0,le.A)(e))),he.ReactNextElement)),Or();var vo,{defineElement:mo,property:bo,event:yo}=(0,de.createDecorators)(),wo=new WeakMap,ko=new WeakMap,Ao=new WeakMap,Eo=new WeakMap,Co=new WeakMap,Mo=new WeakMap,xo=new WeakMap,No=new WeakMap,Wo=new WeakMap,zo=new WeakMap,To=new WeakMap,Ro=new WeakMap,So=new WeakMap,Lo=new WeakMap,Do=new WeakMap,Bo=new WeakSet,Oo=new WeakMap,Po=new WeakMap,jo=new WeakMap,Io=new WeakMap,Ho=new WeakMap,Ko=new WeakMap;class Yo extends he.ReactNextElement{constructor(){super(...arguments),(0,re.A)(this,Bo),(0,ie.A)(this,wo,ci(this)),(0,ie.A)(this,ko,(ui(this),di(this))),(0,ie.A)(this,Ao,(hi(this),fi(this))),(0,ie.A)(this,Eo,(gi(this),pi(this,[La.HP,La.HP]))),(0,ie.A)(this,Co,(vi(this),mi(this))),(0,ie.A)(this,Mo,(bi(this),yi(this))),(0,ie.A)(this,xo,(wi(this),ki(this))),(0,ie.A)(this,No,(Ai(this),Ei(this))),(0,ie.A)(this,Wo,(Ci(this),Mi(this))),(0,ie.A)(this,zo,(xi(this),Ni(this))),(0,ie.A)(this,To,(Wi(this),zi(this,!0))),(0,ie.A)(this,Ro,(Ti(this),Ri(this,!0))),(0,ie.A)(this,So,(Si(this),Li(this,!0))),(0,ie.A)(this,Lo,(Di(this),Bi(this))),(0,ie.A)(this,Do,(Oi(this),Pi(this))),(0,ie.A)(this,Oo,(Hi(this),e=>{ho(Bo,this,ji).emit(e)})),(0,ie.A)(this,Po,(e=>{(0,gn.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,ie.A)(this,jo,Ki(this)),(0,ie.A)(this,Io,(Xi(this),e=>{ho(Bo,this,Yi).emit(e)})),(0,ie.A)(this,Ho,Vi(this)),(0,ie.A)(this,Ko,(Zi(this),e=>{ho(Bo,this,_i).emit(e)}))}get cells(){return go(wo,this)}set cells(e){fo(wo,this,e)}get layout(){return go(ko,this)}set layout(e){fo(ko,this,e)}get layoutOptions(){return go(Ao,this)}set layoutOptions(e){fo(Ao,this,e)}get defaultNodeSize(){return go(Eo,this)}set defaultNodeSize(e){fo(Eo,this,e)}get defaultNodeBricks(){return go(Co,this)}set defaultNodeBricks(e){fo(Co,this,e)}get degradedThreshold(){return go(Mo,this)}set degradedThreshold(e){fo(Mo,this,e)}get degradedNodeLabel(){return go(xo,this)}set degradedNodeLabel(e){fo(xo,this,e)}get defaultEdgeLines(){return go(No,this)}set defaultEdgeLines(e){fo(No,this,e)}get activeTarget(){return go(Wo,this)}set activeTarget(e){fo(Wo,this,e)}get fadeUnrelatedCells(){return go(zo,this)}set fadeUnrelatedCells(e){fo(zo,this,e)}get zoomable(){return go(To,this)}set zoomable(e){fo(To,this,e)}get scrollable(){return go(Ro,this)}set scrollable(e){fo(Ro,this,e)}get pannable(){return go(So,this)}set pannable(e){fo(So,this,e)}get scaleRange(){return go(Lo,this)}set scaleRange(e){fo(Lo,this,e)}render(){return ue().createElement(Uo,{shadowRoot:this.shadowRoot,cells:this.cells,layout:this.layout,layoutOptions:this.layoutOptions,defaultNodeSize:this.defaultNodeSize,defaultNodeBricks:this.defaultNodeBricks,defaultEdgeLines:this.defaultEdgeLines,degradedThreshold:this.degradedThreshold,degradedNodeLabel:this.degradedNodeLabel,activeTarget:this.activeTarget,fadeUnrelatedCells:this.fadeUnrelatedCells,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:go(Oo,this),onSwitchActiveTarget:go(Po,this),onCellContextMenu:go(Io,this),onCellClick:go(Ko,this)})}}function Uo(e){var{shadowRoot:t,cells:n,layout:a,layoutOptions:r,defaultNodeSize:i,defaultNodeBricks:o,defaultEdgeLines:s,degradedThreshold:l,degradedNodeLabel:c,activeTarget:u,fadeUnrelatedCells:d,zoomable:h,scrollable:f,pannable:g,scaleRange:p,onActiveTargetChange:v,onSwitchActiveTarget:m,onCellContextMenu:b,onCellClick:y}=e,[{cells:w,layoutKey:k},A]=(0,ce.useReducer)(hn.d,n,(e=>({cells:(0,Ta.C)(e,{defaultNodeSize:i}),layoutKey:1}))),E=(0,ce.useMemo)((()=>w.filter(fn.N).length>=(null!=l?l:La.pC)),[w,l]),C=(0,ce.useRef)(null),M=(0,ce.useRef)(null),{grabbing:x,transform:N,zoomer:W,scaleRange:z}=(0,Da.f)({rootRef:C,zoomable:h,scrollable:f,pannable:g,draggable:!0,scaleRange:p,onSwitchActiveTarget:m}),{centered:T,setCentered:R,getNextLayoutKey:S}=(0,Pa.g)({layout:a,layoutOptions:r,rootRef:C,cells:w,zoomable:h,zoomer:W,scaleRange:z,layoutKey:k,dispatch:A}),L=(0,ce.useCallback)((()=>{R(!1)}),[R]),D=(0,ce.useRef)(n);(0,ce.useEffect)((()=>{if(n!==D.current){D.current=n;var e=(0,Ra.L)({canvasWidth:t.host.clientWidth,canvasHeight:t.host.clientHeight,defaultNodeSize:i,layout:a,previousCells:w,cells:n,scaleRange:z,transform:N});A({type:"update-cells",payload:e.cells})}}),[w,i,n,a,z,t,N]);var B=(0,Ba.J)({cellsRef:M,activeTarget:u,onActiveTargetChange:v}),O=(0,ce.useMemo)((()=>"".concat((0,me.uniqueId)("diagram-"),"-")),[]),P="".concat(O,"line-arrow-"),j=(0,ce.useCallback)(((e,t)=>{A({type:"update-node-size",payload:{id:e,size:t},layoutKey:S()})}),[S]),[I,H]=(0,ce.useState)(null),K=(0,ce.useCallback)((e=>{H(e)}),[]),Y=(0,ce.useCallback)((e=>{H((t=>t===e?null:t))}),[]),[U,X]=(0,ce.useState)([]);(0,ce.useEffect)((()=>{var e=d?(0,Sa.Y)(w,null,I):[];X((t=>0===t.length&&0===e.length?t:e))}),[w,d,I]);var V=(0,ce.useCallback)((e=>{W.scaleTo((0,fe.A)(C.current),e/100)}),[W]),[_,F]=(0,Ia.d)({cells:w,defaultEdgeLines:s,markerPrefix:P}),Z=(0,ja.H)({cells:w,layout:a,centered:T});return ue().createElement(ue().Fragment,null,ue().createElement("svg",{width:"100%",height:"100%",ref:C,className:ve()("root",{grabbing:x,pannable:g,ready:Z}),tabIndex:-1},ue().createElement("defs",null,F.map(((e,t)=>ue().createElement(xe.c,{key:t,id:"".concat(P).concat(t),type:"arrow",strokeColor:e.strokeColor})))),ue().createElement("g",{transform:"translate(".concat(N.x," ").concat(N.y,") scale(").concat(N.k,")")},ue().createElement("g",{className:"cells",ref:M},w.map((e=>ue().createElement(pn.m,{key:"".concat(e.type,":").concat((0,fn.WW)(e)?"".concat(e.source,"~").concat(e.target):e.id),layout:void 0,cell:e,cells:w,degraded:E,degradedNodeLabel:c,defaultNodeBricks:o,lineConfMap:_,transform:N,active:(0,gn.c)(B,e),readOnly:!0,unrelatedCells:U,onSwitchActiveTarget:m,onCellContextMenu:b,onCellClick:y,onNodeBrickResize:j,onCellMouseEnter:d&&(0,fn.N)(e)?K:void 0,onCellMouseLeave:d&&(0,fn.N)(e)?Y:void 0})))))),ue().createElement(Oa.Y,{shadowRoot:t,scale:N.k,scaleRange:z,onZoomChange:V,onReCenter:L}))}qi=Yo,({e:[ci,ui,di,hi,fi,gi,pi,vi,mi,bi,yi,wi,ki,Ai,Ei,Ci,Mi,xi,Ni,Wi,zi,Ti,Ri,Si,Li,Di,Bi,Oi,Pi,ji,Ii,Hi,Ki,Yi,Ui,Xi,Vi,_i,Fi,Zi],c:[vo,li]}=function(e,t,n,a,r,i){var o,s,l,c,u,d,h,f=Symbol.metadata||Symbol.for("Symbol.metadata"),g=Object.defineProperty,p=Object.create,v=[p(null),p(null)],m=t.length;function b(t,n,a){return function(r,i){n&&(i=r,r=e);for(var o=0;o<t.length;o++)i=t[o].apply(r,a?[i]:[]);return a?i:r}}function y(e,t,n,a){if("function"!=typeof e&&(a||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(a?"":" or undefined"));return e}function w(e,t,n,a,r,i,l,c,u,d,h){function f(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var p=[].concat(t[0]),m=t[3],w=!l,k=1===r,A=3===r,E=4===r,C=2===r;function M(t,n,a){return function(r,i){return n&&(i=r,r=e),a&&a(r),x[t].call(r,i)}}if(!w){var x={},N=[],W=A?"get":E||k?"set":"value";if(u?(d||k?x={get:(0,se.A)((function(){return m(this)}),a,"get"),set:function(e){t[4](this,e)}}:x[W]=m,d||(0,se.A)(x[W],a,C?"":W)):d||(x=Object.getOwnPropertyDescriptor(e,a)),!d&&!u){if((s=v[+c][a])&&7!=(s^r))throw new Error("Decorating two elements with the same name ("+x[W].name+") is not supported yet");v[+c][a]=r<3?1:r}}for(var z=e,T=p.length-1;T>=0;T-=n?2:1){var R=p[T],S=n?p[T-1]:void 0,L={},D={kind:["field","accessor","method","getter","setter","class"][r],name:a,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");y(t,"An initializer","be",!0),i.push(t)}.bind(null,L)};if(w)s=R.call(S,z,D),L.v=1,y(s,"class decorators","return")&&(z=s);else if(D.static=c,D.private=u,s=D.access={has:u?h.bind():function(e){return a in e}},E||(s.get=u?C?function(e){return f(e),x.value}:M("get",0,f):function(e){return e[a]}),C||A||(s.set=u?M("set",0,f):function(e,t){e[a]=t}),z=R.call(S,k?{get:x.get,set:x.set}:x[W],D),L.v=1,k){if("object"==typeof z&&z)(s=y(z.get,"accessor.get"))&&(x.get=s),(s=y(z.set,"accessor.set"))&&(x.set=s),(s=y(z.init,"accessor.init"))&&N.unshift(s);else if(void 0!==z)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else y(z,(d?"field":"method")+" decorators","return")&&(d?N.unshift(z):x[W]=z)}return r<2&&l.push(b(N,c,1),b(i,c,0)),d||w||(u?k?l.splice(-1,0,M("get",c),M("set",c)):l.push(C?x[W]:y.call.bind(x[W])):g(e,a,x)),z}function k(e){return g(e,f,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[f]),o=p(null==o?null:o),u=[],d=function(e){e&&u.push(b(e))},(h=function(t,a){for(var i=0;i<n.length;i++){var o=n[i],s=o[1],d=7&s;if((8&s)==t&&!d==a){var h=o[2],f=!!o[3],g=16&s;w(t?e:e.prototype,o,g,f?"#"+h:(0,oe.A)(h),d,d<2?[]:t?c=c||[]:l=l||[],u,!!t,f,a,t&&f?function(t){return(0,le.A)(t)===e}:r)}}})(8,0),h(0,0),h(8,1),h(0,1),d(l),d(c),s=u,m||k(e),{e:s,get c(){var n=[];return m&&[k(e=w(e,[t],0,e.name,5,n)),b(n,1)]}}}(qi,[mo("eo-display-canvas",{styleTexts:[Ha.A,Ka.A]})],[[bo({attribute:!1}),1,"cells"],[bo({type:String}),1,"layout"],[bo({attribute:!1}),1,"layoutOptions"],[bo({attribute:!1}),1,"defaultNodeSize"],[bo({attribute:!1}),1,"defaultNodeBricks"],[bo({type:Number}),1,"degradedThreshold"],[bo({attribute:!1}),1,"degradedNodeLabel"],[bo({attribute:!1}),1,"defaultEdgeLines"],[bo({attribute:!1}),1,"activeTarget"],[bo({type:Boolean}),1,"fadeUnrelatedCells"],[bo({type:Boolean}),1,"zoomable"],[bo({type:Boolean}),1,"scrollable"],[bo({type:Boolean}),1,"pannable"],[bo({attribute:!1}),1,"scaleRange"],[yo({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>go(Do,e),(e,t)=>fo(Do,e,t)],[yo({type:"cell.contextmenu"}),1,"cellContextMenu",e=>go(jo,e),(e,t)=>fo(jo,e,t)],[yo({type:"cell.click"}),1,"cellClick",e=>go(Ho,e),(e,t)=>fo(Ho,e,t)]],0,(e=>Ko.has((0,le.A)(e))),he.ReactNextElement)),li()},3971:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(6758),r=n.n(a),i=n(935),o=n.n(i)()(r());o.push([e.id,':host{display:block;--local-label-line-height:inherit;--local-label-font-size:inherit;--local-label-color:inherit;--local-label-font-weight:inherit}:host([hidden]){display:none}:host([type="line"]){--local-label-line-height:18px;--local-label-font-size:11px;--local-label-color:var(--color-secondary-text);--local-label-font-weight:400}*{box-sizing:border-box}.label{max-width:168px;margin:-3px}.label-text,\n.label-input{width:100%;height:24px;padding:3px;border:none;line-height:var(--local-label-line-height);font-size:var(--local-label-font-size);color:var(--local-label-color);font-weight:var(--local-label-font-weight);text-align:center;font-family:inherit;cursor:text;-webkit-user-select:text;-moz-user-select:text;user-select:text}.label-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.label.editing .label-text,\n.label.empty:not(.editing) .label-text,\n.label:not(.editing) .label-input{display:none}',""]);const s=o.toString()},497:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(6758),r=n.n(a),i=n(935),o=n.n(i)()(r());o.push([e.id,'*{box-sizing:border-box}:host{display:block;border:1px solid var(--palette-gray-5);cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([hidden]){display:none}:host([usage="dragging"]){opacity:0.75;position:fixed}:host(:not([usage="library"])){background:var(--palette-gray-3);width:60px;height:60px}:host([usage="library"]){width:180px;height:30px;margin-bottom:10px}div{width:100%;height:100%;display:flex;align-items:center;justify-content:center}:host(:not([usage="dragging"]):not([usage="library"]):hover),\n:host([status="highlighted"]){color:var(--palette-blue-5);background:var(--palette-blue-1);border-color:1px solid var(--palette-blue-4)}:host([status="faded"]){opacity:0.3}:host([decorator="area"]){width:100px;height:60px;background:rgba(119,141,195,0.1);border:none}:host([decorator="text"]){width:auto;height:auto;background:none;border:none}',""]);const s=o.toString()}}]);
|
|
2
|
+
//# sourceMappingURL=5576.4aa3c030.js.map
|