@next-bricks/diagram 0.32.0 → 0.32.1

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 CHANGED
@@ -15,5 +15,5 @@
15
15
  "basic.lock-body-scroll"
16
16
  ]
17
17
  },
18
- "filePath": "bricks/diagram/dist/index.f8ce68c6.js"
18
+ "filePath": "bricks/diagram/dist/index.931e68b8.js"
19
19
  }
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_next_bricks_diagram=self.webpackChunk_next_bricks_diagram||[]).push([[709],{3739:(e,t,r)=>{r.d(t,{c:()=>o});var n=r(8769),a=r.n(n);function o(e){var t,{id:r,type:n,strokeColor:o}=e;switch(n){case"0..1":t=l;break;case"0..N":t=d;break;default:t=i}return a().createElement(t,{id:r,strokeColor:o})}function i(e){var{id:t,strokeColor:r}=e;return a().createElement("marker",{id:t,viewBox:"0 0 6 6",refX:5,refY:3,markerWidth:6,markerHeight:6,orient:"auto-start-reverse",strokeLinejoin:"round"},a().createElement("path",{d:"M 0.5 0.5 L 5.5 3 L 0.5 5.5 z",stroke:r,strokeWidth:1,fill:r}))}function l(e){var{id:t,strokeColor:r}=e;return a().createElement("marker",{id:t,viewBox:"0 0 21 11",refX:.5,refY:5.5,markerWidth:21,markerHeight:11,orient:"auto-start-reverse"},a().createElement("path",{d:"M 5.5 5.5 m 5 0 a 5 5 0 1 0 -10 0 a 5 5 0 1 0 10 0 M 15.5 0.5 V 10.5 M 10.5 5.5 H 20.5",stroke:r,strokeWidth:1,fill:"none"}))}function d(e){var{id:t,strokeColor:r}=e;return a().createElement("marker",{id:t,viewBox:"0 0 21 11",refX:.5,refY:5.5,markerWidth:21,markerHeight:11,orient:"auto-start-reverse"},a().createElement("path",{d:"M 5.5 5.5 m 5 0 a 5 5 0 1 0 -10 0 a 5 5 0 1 0 10 0 M 20.5 0.5 L 10.5 5.5 L 20.5 10.5 M 10.5 5.5 H 20.5",stroke:r,strokeWidth:1,fill:"none"}))}},3188:(e,t,r)=>{r.d(t,{h:()=>a});var n=r(733);function a(e,t,r){if(e===t||(0,n.w)(e,t,0,0))return null;var a,i,l=0,d=0;if(r){var c=t.x-e.x,s=t.y-e.y,u=Math.atan2(s,c);l=r/2*Math.cos(u+Math.PI/2),d=r/2*Math.sin(u+Math.PI/2)}var h=[[e.x+l,e.y+d],[t.x+l,t.y+d]],v=o(e,h),f=o(t,h);return a=v.length>0?v[0]:[e.x,e.y],i=f.length>0?f[0]:[t.x,t.y],[{x:a[0],y:a[1]},{x:i[0],y:i[1]}]}function o(e,t){for(var r=[[e.x-e.width/2,e.y-e.height/2],[e.x+e.width/2,e.y-e.height/2],[e.x+e.width/2,e.y+e.height/2],[e.x-e.width/2,e.y+e.height/2]],n=[],a=0;a<4;a++)n.push([r[a],r[(a+1)%4]]);var o=[];for(var l of n){var d=i(t[0],t[1],l[0],l[1]);d&&o.push(d)}return o}function i(e,t,r,n){var[a,o]=e,[i,l]=t,[d,c]=r,[s,u]=n;if(a===i&&o===l||d===s&&c===u)return null;var h=(u-c)*(i-a)-(s-d)*(l-o);if(0===h)return null;var v=((s-d)*(o-c)-(u-c)*(a-d))/h,f=((i-a)*(o-c)-(l-o)*(a-d))/h;return v<0||v>1||f<0||f>1?null:[a+v*(i-a),o+v*(l-o)]}},733:(e,t,r)=>{function n(e,t,r,n){var o=r?a(e,r):e,i=n?a(t,n):t,l=Math.min(o.x-o.width/2,i.x-i.width/2),d=Math.max(o.x+o.width/2,i.x+i.width/2),c=Math.min(o.y-o.height/2,i.y-i.height/2),s=Math.max(o.y+o.height/2,i.y+i.height/2);return d-l<o.width+i.width&&s-c<o.height+i.height}function a(e,t){return{x:e.x-e.width/2-t,y:e.y-e.height/2-t,width:e.width+2*t,height:e.height+2*t}}r.d(t,{w:()=>n})},8802:(e,t,r)=>{function n(e){if(Array.isArray(e)){var t=e[0],r=e.length>1?e[1]:t;return[t,r,e.length>2?e[2]:t,e.length>3?e[3]:r]}return new Array(4).fill(e)}r.d(t,{D:()=>n})},2830:(e,t,r)=>{r.d(t,{m:()=>A});var n=r(8769),a=r.n(n),o=r(3373),i=r.n(o),l=r(531),d=r(3188);function c(e,t){return e.find((e=>(0,l.N)(e)&&e.id===t))}var s=r(3033);function u(e){var t,r,o,{edge:u,cells:v,lineConfMap:f}=e,m=(0,n.useRef)(null),g=(0,n.useMemo)((()=>c(v,u.source)),[v,u.source]),p=(0,n.useMemo)((()=>c(v,u.target)),[v,u.target]),w=(0,n.useMemo)((()=>f.get(u)),[u,f]),y=(0,n.useMemo)((()=>v.some((e=>(0,l.WW)(e)&&e.source===u.target&&e.target===u.source))?w.parallelGap:0),[v,u,w.parallelGap]),x=(0,n.useMemo)((()=>g&&p&&null!=g.view.x&&null!=p.view.x?(0,d.h)(h(g.view,5),h(p.view,5),y):null),[y,g,p]);if(!x)return null;var k="M".concat(x[0].x," ").concat(x[0].y,"L").concat(x[1].x," ").concat(x[1].y);return a().createElement(a().Fragment,null,a().createElement("path",{d:k,fill:"none",stroke:"transparent",strokeWidth:w.interactStrokeWidth}),a().createElement("path",{ref:m,className:i()("line",{dashed:w.dashed,["".concat(w.dashed?"dashed":"solid","-animation")]:w.animate.useAnimate}),style:{"--time":"".concat(null!==(t=w.animate.duration)&&void 0!==t?t:s.Be,"s"),"--solid-length":null===(r=m.current)||void 0===r||null===(o=r.getTotalLength)||void 0===o?void 0:o.call(r)},d:k,fill:"none",stroke:w.strokeColor,strokeWidth:w.strokeWidth,markerStart:w.showStartArrow?w.markerArrow:"",markerEnd:w.showEndArrow?w.markerArrow:""}),a().createElement("path",{className:"line-active-bg",d:k,fill:"none"}))}function h(e,t){return{x:e.x+e.width/2,y:e.y+e.height/2,width:e.width+t,height:e.height+t}}var v=r(4993),f=r(7410),m=r(1030),g=r(9126);function p(e){var{node:t,degraded:r,degradedNodeLabel:o,defaultNodeBricks:i,onResize:l}=e,d=function(e){var[t,r]=(0,n.useState)(e);return(0,n.useEffect)((()=>{r((t=>(0,m.isEqual)(t,e)?t:e))}),[e]),t}({node:{id:t.id,data:t.data}}),c=t.useBrick,s=(0,n.useRef)(null),u=(0,n.useMemo)((()=>{var e;return r?null:null!=c?c:null==i||null===(e=i.find((e=>(0,f.checkIfByTransform)(e,d))))||void 0===e?void 0:e.useBrick}),[r,c,i,d]),h=(0,n.useMemo)((()=>r?String(f.__secret_internals.legacyDoTransform(d,null!=o?o:"<% DATA.node.id %>")):""),[r,o,d]),p=(0,n.useCallback)((e=>{var r=s.current;r&&(r.disconnect(),s.current=null),e?setTimeout((()=>{var r=new g.A((()=>{l(t.id,[e.offsetWidth,e.offsetHeight])}));r.observe(e),s.current=r})):l(t.id,null)}),[t.id,l]),w=(0,n.useCallback)((e=>{if(e){var r=e.getBBox();l(t.id,[r.width,r.height])}else l(t.id,null)}),[t.id,l]);return u?a().createElement("foreignObject",{width:9999,height:9999,className:"node"},u&&a().createElement(v.ReactUseBrick,{useBrick:u,data:d,refCallback:p})):r?a().createElement("g",{className:"degraded",ref:w},a().createElement("circle",{cx:8,cy:8,r:8}),a().createElement("text",{x:8,y:32},h)):null}function w(e){return"edge"===e.type?(0,m.pick)(e,["type","source","target","data"]):(0,m.pick)(e,["type","id","data"])}function y(e,t){var{action:r,cell:n,scale:a,layout:o,onCellMoving:i,onCellMoved:d,onCellResizing:c,onCellResized:s,onSwitchActiveTarget:u}=t;if(e.stopPropagation(),null==u||u(w(n)),!(0,l.WW)(n)&&("force"!==o&&"dagre"!==o||!(0,l.N)(n))){var h=[e.clientX,e.clientY],v="move"===r?[n.view.x,n.view.y]:[n.view.width,n.view.height],f=!1,m=(e,t)=>{var o,l,u=function(e){return[(e.clientX-h[0])/a,(e.clientY-h[1])/a]}(e);f||(f=u[0]**2+u[1]**2>=9),f&&("move"===r?null===(o=t?d:i)||void 0===o||o({type:n.type,id:n.id,x:v[0]+u[0],y:v[1]+u[1]}):null===(l=t?s:c)||void 0===l||l({type:n.type,id:n.id,width:v[0]+u[0],height:v[1]+u[1]}))},g=e=>{m(e)},p=e=>{m(e,!0),f=!1,document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",p)};document.addEventListener("mousemove",g),document.addEventListener("mouseup",p)}}function x(e){var{cell:t,transform:r,readOnly:o,onCellResizing:i,onCellResized:l,onSwitchActiveTarget:d}=e,c=a().useRef(null);return(0,n.useEffect)((()=>{var e=c.current;if(e&&!o){var n=e=>{y(e,{action:"resize",cell:t,scale:r.k,onCellResizing:i,onCellResized:l,onSwitchActiveTarget:d})};return e.addEventListener("mousedown",n),()=>{e.removeEventListener("mousedown",n)}}}),[t,l,i,d,o,r.k]),a().createElement("g",{className:"decorator-area"},a().createElement("rect",{width:t.view.width,height:t.view.height,className:"area"}),!o&&a().createElement("g",{ref:c,className:"resize-handle",transform:"translate(".concat(t.view.width-20," ").concat(t.view.height-20,")")},a().createElement("rect",{width:20,height:20}),a().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})))}var k=r(9740);function b(e){var t,{cell:r,readOnly:o,onDecoratorTextEditing:l,onDecoratorTextChange:d}=e,c=null!==(t=r.view.text)&&void 0!==t?t:"",[s,u]=(0,n.useState)(c),[h,v]=(0,n.useState)(!1),f=(0,n.useRef)(!1),[m,g]=(0,n.useState)(!1),p=(0,n.useRef)(null),w=(0,n.useCallback)((e=>{o||(e.preventDefault(),e.stopPropagation(),v(!0))}),[o]);(0,n.useEffect)((()=>{var e=p.current;e&&e.textContent!==s&&(e.textContent=s)}),[s]),(0,n.useEffect)((()=>{h&&p.current&&(p.current.focus(),function(e){var t=document.createRange();t.selectNodeContents(e);var r=window.getSelection();r.removeAllRanges(),r.addRange(t)}(p.current)),null==l||l({id:r.id,editing:h})}),[r.id,h,l]),(0,n.useEffect)((()=>{f.current?null==l||l({id:r.id,editing:h}):f.current=!0}),[r.id,h,l]);var y=(0,n.useCallback)((e=>{o||u(e.target.textContent)}),[o]),x=(0,n.useCallback)((()=>{o||(v(!1),g(!0))}),[o]);return(0,n.useEffect)((()=>{m&&(null==d||d({id:r.id,view:(0,k.A)((0,k.A)({},r.view),{},{text:s})}),g(!1))}),[r,s,d,m]),a().createElement("foreignObject",{className:"decorator-text"},a().createElement("div",{className:i()("text-container",{editing:h}),onDoubleClick:w},a().createElement("div",{className:"text",contentEditable:h,ref:p,onInput:y,onBlur:x})))}function E(e){var t,{cell:r,transform:n,readOnly:o,onCellResizing:i,onCellResized:l,onSwitchActiveTarget:d,onDecoratorTextEditing:c,onDecoratorTextChange:s}=e;switch(r.decorator){case"area":t=x;break;case"text":t=b;break;default:return console.error("Unknown decorator: ".concat(r.decorator)),null}return a().createElement(t,{cell:r,transform:n,readOnly:o,onCellResizing:i,onCellResized:l,onSwitchActiveTarget:d,onDecoratorTextEditing:c,onDecoratorTextChange:s})}var C=r(8185);function A(e){var{layout:t,cell:r,cells:o,degraded:d,degradedNodeLabel:c,defaultNodeBricks:s,lineConfMap:h,active:v,readOnly:f,transform:m,unrelatedCells:g,onCellMoving:x,onCellMoved:k,onCellResizing:b,onCellResized:A,onSwitchActiveTarget:z,onCellContextMenu:M,onDecoratorTextEditing:N,onDecoratorTextChange:R,onNodeBrickResize:S,onCellMouseEnter:W,onCellMouseLeave:L}=e,T=(0,n.useRef)(null),D=(0,n.useMemo)((()=>g.some((e=>(0,C.c)(e,r)))),[r,g]);(0,n.useEffect)((()=>{var e=T.current;if(e&&!f){var n=e=>{y(e,{layout:t,action:"move",cell:r,scale:m.k,onCellMoving:x,onCellMoved:k,onSwitchActiveTarget:z})};return e.addEventListener("mousedown",n),()=>{e.removeEventListener("mousedown",n)}}}),[t,r,k,x,z,f,m.k]);var B=(0,n.useCallback)((e=>{f&&"decorator"===r.type||(e.preventDefault(),z(w(r)),M({cell:r,clientX:e.clientX,clientY:e.clientY}))}),[r,M,z,f]),P=(0,n.useCallback)((()=>{null==W||W(r)}),[r,W]),V=(0,n.useCallback)((()=>{null==L||L(r)}),[r,L]);return a().createElement("g",{className:i()("cell",{active:v,faded:D,"read-only":f}),ref:T,transform:"edge"===r.type||null==r.view.x?void 0:"translate(".concat(r.view.x," ").concat(r.view.y,")"),onContextMenu:B,onMouseEnter:P,onMouseLeave:V},(0,l.N)(r)?a().createElement(p,{node:r,degraded:d,degradedNodeLabel:c,defaultNodeBricks:s,onResize:S}):(0,l.WW)(r)?a().createElement(u,{edge:r,cells:o,lineConfMap:h}):(0,l.mH)(r)?a().createElement(E,{cell:r,transform:m,readOnly:f,onCellResizing:b,onCellResized:A,onSwitchActiveTarget:z,onDecoratorTextEditing:N,onDecoratorTextChange:R}):null)}},3033:(e,t,r)=>{r.d(t,{Be:()=>g,CV:()=>n,HP:()=>o,Ie:()=>v,N8:()=>l,Ub:()=>m,VO:()=>h,XV:()=>f,Yt:()=>s,mF:()=>u,pC:()=>p,sS:()=>c,sz:()=>i,w1:()=>d,xc:()=>a});var n=Symbol.for("size-initialized"),a=Symbol.for("layout-initialized"),o=20,i=36,l=100,d=60,c=.5,s=2,u="gray",h=1,v=15,f=!1,m=!0,g=1,p=500},531:(e,t,r)=>{function n(e){return"node"===e.type}function a(e){return"decorator"===e.type}function o(e){return"node"===e.type}function i(e){return"edge"===e.type}function l(e){return"node"===e.type||"edge"===e.type}r.d(t,{N:()=>n,WW:()=>i,mH:()=>a,nv:()=>l,vC:()=>o})},227:(e,t,r)=>{r.d(t,{Y:()=>a});var n=r(8185);function a(e,t,r){var a=[];if(t){var o=new Set;for(var i of e)"edge"===i.type&&i.source===t.source.id&&o.add(i.target);for(var l of e)"node"===l.type?o.has(l.id)&&a.push(l):a.push(l)}else switch(null==r?void 0:r.type){case"node":var d=new Map,c=new Set([r.id]);for(var s of e)"node"===s.type?d.set(s.id,s):"edge"===s.type?s.source===r.id?c.add(s.target):s.target===r.id?c.add(s.source):a.push(s):a.push(s);for(var[u,h]of d)c.has(u)||a.push(h);break;case"edge":for(var v of e)("edge"===v.type?(0,n.c)(v,r):"node"===v.type&&(v.id===r.source||v.id===r.target))||a.push(v);break;case"decorator":for(var f of e)"decorator"===f.type&&f.id===r.id||a.push(f)}return a}},3783:(e,t,r)=>{r.d(t,{C:()=>o});var n=r(9740),a=r(531);function o(e,t){var{defaultNodeSize:r}=t;return(null!=e?e:[]).map((e=>{var t,o;return!(0,a.vC)(e)||void 0!==(null===(t=e.view)||void 0===t?void 0:t.width)&&void 0!==(null===(o=e.view)||void 0===o?void 0:o.height)?e:(0,n.A)((0,n.A)({},e),{},{view:(0,n.A)({width:r[0],height:r[1]},e.view)})}))}},8185:(e,t,r)=>{function n(e,t){return e?!!t&&e.type===t.type&&("node"===e.type||"decorator"===e.type?e.id===t.id:e.source===t.source&&e.target===t.target):!t}r.d(t,{c:()=>n})},908:(e,t,r)=>{r.d(t,{r:()=>a});var n=r(531);function a(e,t){var{canvasWidth:r,canvasHeight:a,scaleRange:o}=t,i=1/0,l=1/0,d=-1/0,c=-1/0,s=!0;for(var u of e)if(!(0,n.WW)(u)){s=!1;var{view:h}=u,v=h.x+h.width,f=h.y+h.height;h.x<i&&(i=h.x),v>d&&(d=v),h.y<l&&(l=h.y),f>c&&(c=f)}var m=d-i,g=c-l,p=o&&!s&&(m>r||g>a)?Math.max(Math.min(r/m,a/g,o[1]),o[0]):1;return{x:s?0:(r-m*p)/2-i*p,y:s?0:(a-g*p)/2-l*p,k:p}}},1083:(e,t,r)=>{r.d(t,{d:()=>d});var n=r(9740),a=r(531),o=r(3033);function i(e,t,r){var n=e.findLastIndex(r)+1;return[...e.slice(0,n),t,...e.slice(n)]}var l,d=(l={cells:(e,t)=>{switch(t.type){case"drop-node":return i(e,t.payload,(e=>!("decorator"===e.type&&"text"===e.decorator)));case"drop-decorator":return"text"===t.payload.decorator?[...e,t.payload]:i(e,t.payload,(e=>"decorator"===e.type&&"area"===e.decorator));case"add-nodes":var r=e.findLastIndex((e=>!("decorator"===e.type&&"text"===e.decorator)))+1;return[...e.slice(0,r),...t.payload,...e.slice(r)];case"add-edge":return i(e,t.payload,(e=>"edge"===e.type||"decorator"===e.type&&"area"===e.decorator));case"move-cell":var{type:l,id:d,x:c,y:s}=t.payload,u=e.findIndex((e=>e.type===l&&e.id===d));if(-1!==u){var h=e[u];return[...e.slice(0,u),(0,n.A)((0,n.A)({},h),{},{view:(0,n.A)((0,n.A)({},h.view),{},{x:c,y:s})}),...e.slice(u+1)]}return e;case"resize-cell":var{type:v,id:f,width:m,height:g}=t.payload,p=e.findIndex((e=>e.type===v&&e.id===f));if(-1!==p){var w=e[p];return[...e.slice(0,p),(0,n.A)((0,n.A)({},w),{},{view:(0,n.A)((0,n.A)({},w.view),{},{width:m,height:g})}),...e.slice(p+1)]}return e;case"update-cells":return t.payload;case"update-node-size":return e.map((e=>(0,a.N)(e)&&e.id===t.payload.id?(0,n.A)((0,n.A)({},e),{},{[o.CV]:!0,view:t.payload.size?(0,n.A)((0,n.A)({},e.view),{},{width:t.payload.size[0],height:t.payload.size[1]}):e.view}):e))}return e}},(e,t)=>Object.fromEntries(Object.entries(l).map((r=>{var[n,a]=r;return[n,a(e[n],t)]}))))},7099:(e,t,r)=>{r.d(t,{Y:()=>f});var n=r(8769),a=r.n(n),o=r(2657),i=r(6768),l=r(198),d=r(8621),c=r(4993),s=r(9575);const u=e=>n.createElement("svg",(0,s.A)({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},e),n.createElement("path",{d:"M12 0a.5.5 0 0 1 .5.5v2.013a9.5 9.5 0 0 1 8.987 8.988L23.5 11.5a.5.5 0 0 1 0 1h-2.013a9.5 9.5 0 0 1-8.987 8.987V23.5a.5.5 0 0 1-1 0v-2.013A9.5 9.5 0 0 1 2.514 12.5H.5a.5.5 0 0 1 0-1h2.013A9.5 9.5 0 0 1 11.5 2.514V.5A.5.5 0 0 1 12 0M3.514 11.5H7.5a.5.5 0 0 1 0 1H3.514a8.5 8.5 0 0 0 7.987 7.986L11.5 16.5a.5.5 0 0 1 1 0v3.986a8.5 8.5 0 0 0 7.986-7.986H16.5a.5.5 0 0 1 0-1h3.986A8.5 8.5 0 0 0 12.5 3.515V7.5a.5.5 0 0 1-1 0V3.514a8.5 8.5 0 0 0-7.986 7.987zm8.486-1a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3"})),h=e=>n.createElement("svg",(0,s.A)({xmlns:"http://www.w3.org/2000/svg",width:128,height:128,className:"icon",viewBox:"0 0 1024 1024"},e),n.createElement("path",{d:"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384"}),n.createElement("path",{d:"M744.448 486.4h-204.8V281.6a25.6 25.6 0 1 0-51.2 0v204.8h-204.8a25.6 25.6 0 0 0 0 51.2h204.8v204.8a25.6 25.6 0 0 0 51.2 0V537.6h204.8a25.6 25.6 0 0 0 0-51.2"})),v=e=>n.createElement("svg",(0,s.A)({xmlns:"http://www.w3.org/2000/svg",width:128,height:128,className:"icon",viewBox:"0 0 1024 1024"},e),n.createElement("path",{d:"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384"}),n.createElement("path",{d:"M744.448 486.4H280.064a25.6 25.6 0 1 0 0 51.2h464.384a25.6 25.6 0 0 0 0-51.2"}));function f(e){var{shadowRoot:t,scale:r,scaleRange:s,onZoomChange:f,onReCenter:m}=e,g=(0,c.useCurrentTheme)(),p=(0,n.useMemo)((()=>(0,d.VC)()),[]),w=(0,n.useRef)(null),y=100*s[0],x=100*s[1],k=100*r,b=(0,n.useMemo)((()=>({formatter:e=>"".concat(e,"%"),placement:"left",getPopupContainer:()=>w.current})),[]),E=(0,n.useCallback)((()=>{f(Math.min(k+5,x))}),[x,f,k]),C=(0,n.useCallback)((()=>{f(Math.max(k-5,y))}),[y,f,k]);return a().createElement(o.Ay,{theme:{algorithm:"dark-v2"===g?i.A.darkAlgorithm:i.A.defaultAlgorithm}},a().createElement(d.N7,{container:t,autoClear:!0,cache:p,hashPriority:"high"},a().createElement("div",{className:"zoom-bar",ref:w},a().createElement("div",{className:"center-button",onClick:m,role:"button"},a().createElement(u,null)),a().createElement("div",{className:"zoom-slider"},a().createElement("div",{className:"zoom-button",role:"button",onClick:E},a().createElement(h,null)),a().createElement(l.A,{min:y,max:x,value:k,step:5,vertical:!0,included:!1,tooltip:b,onChange:f}),a().createElement("div",{className:"zoom-button",role:"button",onClick:C},a().createElement(v,null))))))}},9127:(e,t,r)=>{r.d(t,{C:()=>u});var n=r(9740),a=r(4223),o=r(1030),i=r(7586),l=r.n(i),d=r(8802),c=r(531),s=["nodePadding"];function u(e){var{cells:t,layoutOptions:r}=e,i=(0,n.A)({nodePadding:0,rankdir:"TB",ranksep:50,edgesep:10,nodesep:50},(0,o.pick)(r,["nodePadding","rankdir","ranksep","edgesep","nodesep","align"])),{nodePadding:u}=i,h=(0,a.A)(i,s),v=(0,d.D)(u),f=new(l().graphlib.Graph);for(var m of(f.setGraph(h),f.setDefaultEdgeLabel((function(){return{}})),t))(0,c.N)(m)?f.setNode(m.id,{id:m.id,width:m.view.width+v[1]+v[3],height:m.view.height+v[0]+v[2]}):(0,c.WW)(m)&&f.setEdge(m.source,m.target);return l().layout(f),{getNodeView:e=>f.node(e),nodePaddings:v}}},6170:(e,t,r)=>{r.d(t,{k:()=>v});var n=r(9740),a=r(1030),o=r(6149),i=r(4842),l=r(1945),d=r(9418),c=r(3854),s=r(7931),u=r(531),h=r(8802);function v(e){var{cells:t,layoutOptions:r,center:v,fixedPosition:f}=e,{nodePadding:m,collide:g}=(0,n.A)((0,n.A)({nodePadding:0},(0,a.pick)(r,["nodePadding"])),{},{collide:!1!==(null==r?void 0:r.collide)&&(0,n.A)({radiusDiff:18,strength:1,iterations:1},!0===(null==r?void 0:r.collide)?null:null==r?void 0:r.collide)}),p=(0,h.D)(m),w=[],y=[],x=new Map;for(var k of t)if((0,u.N)(k)){var b=(0,n.A)({id:k.id,width:k.view.width+p[1]+p[3],height:k.view.height+p[0]+p[2]},f?{fx:k.view.x,fy:k.view.y}:null);w.push(b),x.set(b.id,b)}else(0,u.WW)(k)&&y.push({source:k.source,target:k.target});var E=(0,o.A)(y).id((e=>e.id)),C=(0,i.A)(w).force("link",E).force("x",(0,l.A)(null==v?void 0:v[0])).force("y",(0,d.A)(null==v?void 0:v[1])).force("charge",(0,c.A)());return g&&C.force("collide",(0,s.A)().radius((e=>Math.sqrt(e.width**2+e.height**2)/2+g.radiusDiff)).strength(g.strength).iterations(g.iterations)),C.stop(),function(e){e.tick(Math.ceil(Math.log(e.alphaMin())/Math.log(1-e.alphaDecay())))}(C),{getNodeView:e=>x.get(e),nodePaddings:p}}},1819:(e,t,r)=>{r.d(t,{J:()=>o});var n=r(8769),a=r(8185);function o(e){var{cellsRef:t,activeTarget:r,onActiveTargetChange:o}=e,i=null!=r?r:null,[l,d]=(0,n.useState)(i);(0,n.useEffect)((()=>{d((e=>(0,a.c)(e,i)?e:i))}),[i]);var c=(0,n.useRef)(!1);return(0,n.useEffect)((()=>{c.current?o(l):c.current=!0}),[l,o]),(0,n.useEffect)((()=>{if(l){var e=e=>{e.composedPath().indexOf(t.current)<=0&&d(null)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}}}),[l,t]),l}},2361:(e,t,r)=>{r.d(t,{g:()=>h});var n=r(9740),a=r(8769),o=r(7566),i=r(1517),l=r(3033),d=r(531),c=r(908),s=r(6170),u=r(9127);function h(e){var{layout:t,layoutOptions:r,rootRef:h,cells:v,zoomable:f,zoomer:m,scaleRange:g,dispatch:p}=e,[w,y]=(0,a.useState)("force"!==t&&"dagre"!==t),[x,k]=function(e){var{rootRef:t,cells:r,layoutInitialized:n,zoomable:s,zoomer:u,scaleRange:h}=e,[v,f]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{var e=t.current;if(e&&n&&!v&&r.some((e=>(0,d.N)(e)||(0,d.mH)(e)))&&!r.some((e=>(0,d.N)(e)&&!e[l.CV]))){var{k:a,x:m,y:g}=(0,c.r)(r,{canvasWidth:e.clientWidth,canvasHeight:e.clientHeight,scaleRange:s?h:void 0});u.transform((0,o.A)(e),new i.uV(a,m,g)),f(!0)}}),[r,v,n,t,h,s,u]),(0,a.useEffect)((()=>{r.some((e=>(0,d.N)(e)||(0,d.mH)(e)))||f(!1)}),[r]),[v,f]}({rootRef:h,layoutInitialized:w,cells:v,zoomable:f,zoomer:m,scaleRange:g}),b=(0,a.useRef)(null);return(0,a.useEffect)((()=>{if(!v.some((e=>(0,d.N)(e)&&!e[l.CV])))if("force"===t||"dagre"===t){if(e=b.current,a=v.filter(d.nv),(null==e?void 0:e.length)!==a.length||!e.every(((e,t)=>e===a[t]))){var e,a,o,i;({getNodeView:o,nodePaddings:i}="force"===t?(0,s.k)({cells:v,layoutOptions:r}):(0,u.C)({cells:v,layoutOptions:r}));var c=v.map((e=>{if((0,d.N)(e)){var t=o(e.id);return(0,n.A)((0,n.A)({},e),{},{view:(0,n.A)((0,n.A)({},e.view),{},{x:t.x-t.width/2+i[3],y:t.y-t.height/2+i[0]}),[l.xc]:!0})}return e}));b.current=c.filter(d.nv),p({type:"update-cells",payload:c}),k(!1),y(!0)}}else y(!0)}),[v,p,t,r,k]),{centered:x,setCentered:k}}},7531:(e,t,r)=>{r.d(t,{d:()=>c});var n=r(9740),a=r(8769),o=r(7410),i=r(1030),l=r(531),d=r(3033);function c(e){var{cells:t,defaultEdgeLines:r,markerPrefix:c}=e;return(0,a.useMemo)((()=>{var e=[{strokeColor:d.mF}],a=new WeakMap,s=function(t){if((0,l.WW)(t)){var s,u=null!==(s=o.__secret_internals.legacyDoTransform({edge:t},null==r?void 0:r.find((e=>(0,o.checkIfByTransform)(e,{edge:t})))))&&void 0!==s?s:{},h=(0,n.A)({dashed:!1,strokeColor:d.mF,strokeWidth:d.VO,interactStrokeWidth:d.Ie,showStartArrow:d.XV,showEndArrow:d.Ub,animate:{useAnimate:!1,duration:d.Be}},(0,i.omitBy)(u,i.isUndefined));void 0===h.parallelGap&&(h.parallelGap=h.interactStrokeWidth);var v=function(e,t){var r=(0,i.findIndex)(t,e);return-1===r&&(r=t.push(e)-1),r}({strokeColor:h.strokeColor},e);h.markerArrow="url(#".concat(c).concat(v,")"),a.set(t,h)}};for(var u of t)s(u);return[a,e]}),[t,r,c])}},8197:(e,t,r)=>{r.d(t,{H:()=>i});var n=r(8769),a=r(531),o=r(3033);function i(e){var{cells:t,layout:r,centered:i}=e;return(0,n.useMemo)((()=>i&&t.every((e=>!(0,a.N)(e)||e[o.CV]&&("force"!==r&&"dagre"!==r||e[o.xc])))),[t,i,r])}},8091:(e,t,r)=>{r.d(t,{f:()=>l});var n=r(8769),a=r(7566),o=r(1517),i=r(3033);function l(e){var{rootRef:t,zoomable:r,scrollable:l,pannable:d,scaleRange:c,onSwitchActiveTarget:s}=e,[u,h]=(0,n.useState)(!1),[v,f]=(0,n.useState)({k:1,x:0,y:0}),m=(0,n.useMemo)((()=>null!=c?c:[i.sS,i.Yt]),[c]),g=(0,n.useMemo)((()=>(0,o.s_)()),[]);return(0,n.useEffect)((()=>{var e=!1;g.scaleExtent(r?m:[1,1]).on("start",(()=>{e=!1,h(!0)})).on("zoom",(t=>{e=!0,f(t.transform)})).on("end",(()=>{h(!1),e||null==s||s(null)}))}),[s,m,r,g]),(0,n.useEffect)((()=>{var e=t.current;if(e){var n=(0,a.A)(e),o=()=>{n.on(".zoom",null).on(".zoom.custom",null).on("wheel",null)};if(r||l||d)return(r||l)&&n.on("wheel.zoom.custom",(e=>{e.ctrlKey||(e.stopImmediatePropagation(),l&&(e.preventDefault(),g.translateBy(n,e.wheelDeltaX/5,e.wheelDeltaY/5)))})),n.call(g).on("wheel",(e=>e.preventDefault())).on("dblclick.zoom",null).on("mousedown.zoom",null),d||n.on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),o;o()}}),[d,t,l,r,g]),{grabbing:u,transform:v,zoomer:g,scaleRange:m}}},8618:(e,t,r)=>{r.d(t,{A:()=>l});var n=r(6758),a=r.n(n),o=r(935),i=r.n(o)()(a());i.push([e.id,'.zoom-bar{position:absolute;bottom:20px;right:20px;width:40px}.zoom-slider,\n.center-button{width:100%;display:flex;align-items:center;border:1px solid var(--antd-background-color-base);border-radius:var(--larger-border-radius);box-shadow:var(--connected-overlay-shadow);background-color:var(--color-fill-bg-container-4)}.zoom-slider{height:140px;padding:8px 0;flex-direction:column}[role="button"]{cursor:pointer}.center-button{justify-content:center;margin-bottom:8px;height:40px}.center-button:hover{border-color:var(--antd-btn-default-hover-border-color)}.center-button path{fill:var(--antd-link-hover-color)}.center-button:hover path{fill:var(--palette-blue-7)}.zoom-button{font-size:16px;line-height:0}.zoom-button svg{width:1em;height:1em;fill:var(--antd-link-hover-color)}.zoom-slider .ant-slider-vertical{padding-inline:5px}.zoom-slider .ant-slider-vertical .ant-slider-rail{width:2px}.zoom-slider .ant-slider-vertical .ant-slider-handle{width:6px;height:6px;inset-inline-start:3px}.zoom-slider .ant-slider .ant-slider-handle:hover::before,\n.zoom-slider .ant-slider .ant-slider-handle:focus::before,\n.zoom-slider .ant-slider .ant-slider-handle::before{width:10px;height:10px;inset-inline-start:-2px}.zoom-slider .ant-slider .ant-slider-handle:hover::after,\n.zoom-slider .ant-slider .ant-slider-handle:focus::after,\n.zoom-slider .ant-slider .ant-slider-handle::after{width:6px;height:6px;inset-block-start:0;inset-inline-start:0}',""]);const l=i.toString()},3012:(e,t,r)=>{r.d(t,{A:()=>l});var n=r(6758),a=r.n(n),o=r(935),i=r.n(o)()(a());i.push([e.id,"*{box-sizing:border-box}:host{display:block;position:relative;overflow:hidden;--animation-dasharray:48;--stroke-dashoffset:96;--dasharray:4}:host,\n.root{width:100%;height:100%}:host([hidden]){display:none}.root{opacity:0}.root.ready{opacity:1}.root:focus{outline:none}@keyframes dashedAnimation{0%{stroke-dashoffset:var(--stroke-dashoffset)}to{stroke-dashoffset:0}}@keyframes solidAnimation{to{stroke-dashoffset:0}}.solid-animation{stroke-dasharray:var(--solid-length);stroke-dashoffset:var(--solid-length);animation:solidAnimation var(--time) linear infinite}.dashed-animation{animation:dashedAnimation var(--time) linear infinite}.decorator-area .area{fill:rgba(119,141,195,0.1);stroke:none;stroke-width:0}.node,\n.decorator-text{overflow:visible}.cell.active .decorator-area .area,\n.cell.active .line-active-bg{stroke:var(--palette-blue-5);stroke-dasharray:var(--dasharray);stroke-width:1}.cell:not(.read-only){-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-handle{cursor:nwse-resize;opacity:0}.resize-handle rect{fill:transparent;stroke:none}.resize-handle path{fill:none;stroke:var(--palette-gray-5);stroke-width:1.5}.cell.active .decorator-area .resize-handle,\n.decorator-area:hover .resize-handle{opacity:1}.connect-line{pointer-events:none}.connect-line:not(.connecting){display:none}.line.dashed{stroke-dasharray:var(--dasharray)}.cell.active .decorator-text .text-container{outline:1px dashed var(--palette-blue-5)}.decorator-text .text-container{width:-webkit-max-content;width:-moz-max-content;width:max-content;padding:0.5em}.decorator-text .text:focus{outline:none}.cell.faded{opacity:0.3}.cell .node{pointer-events:none}.cell .node > *{pointer-events:auto}.degraded{pointer-events:bounding-box}.degraded circle{fill:rgb(119,141,195)}.degraded text{text-anchor:middle;fill:var(--antd-text-color)}.cell.active .degraded circle,\n.cell.active .degraded text,\n.degraded:hover circle,\n.degraded:hover text{fill:var(--color-brand)}",""]);const l=i.toString()}}]);
2
- //# sourceMappingURL=709.ecbbe43b.js.map
1
+ "use strict";(self.webpackChunk_next_bricks_diagram=self.webpackChunk_next_bricks_diagram||[]).push([[709],{3739:(e,t,r)=>{r.d(t,{c:()=>o});var n=r(8769),a=r.n(n);function o(e){var t,{id:r,type:n,strokeColor:o}=e;switch(n){case"0..1":t=l;break;case"0..N":t=d;break;default:t=i}return a().createElement(t,{id:r,strokeColor:o})}function i(e){var{id:t,strokeColor:r}=e;return a().createElement("marker",{id:t,viewBox:"0 0 6 6",refX:5,refY:3,markerWidth:6,markerHeight:6,orient:"auto-start-reverse",strokeLinejoin:"round"},a().createElement("path",{d:"M 0.5 0.5 L 5.5 3 L 0.5 5.5 z",stroke:r,strokeWidth:1,fill:r}))}function l(e){var{id:t,strokeColor:r}=e;return a().createElement("marker",{id:t,viewBox:"0 0 21 11",refX:.5,refY:5.5,markerWidth:21,markerHeight:11,orient:"auto-start-reverse"},a().createElement("path",{d:"M 5.5 5.5 m 5 0 a 5 5 0 1 0 -10 0 a 5 5 0 1 0 10 0 M 15.5 0.5 V 10.5 M 10.5 5.5 H 20.5",stroke:r,strokeWidth:1,fill:"none"}))}function d(e){var{id:t,strokeColor:r}=e;return a().createElement("marker",{id:t,viewBox:"0 0 21 11",refX:.5,refY:5.5,markerWidth:21,markerHeight:11,orient:"auto-start-reverse"},a().createElement("path",{d:"M 5.5 5.5 m 5 0 a 5 5 0 1 0 -10 0 a 5 5 0 1 0 10 0 M 20.5 0.5 L 10.5 5.5 L 20.5 10.5 M 10.5 5.5 H 20.5",stroke:r,strokeWidth:1,fill:"none"}))}},3188:(e,t,r)=>{r.d(t,{h:()=>a});var n=r(733);function a(e,t,r){if(e===t||(0,n.w)(e,t,0,0))return null;var a,i,l=0,d=0;if(r){var c=t.x-e.x,s=t.y-e.y,u=Math.atan2(s,c);l=r/2*Math.cos(u+Math.PI/2),d=r/2*Math.sin(u+Math.PI/2)}var h=[[e.x+l,e.y+d],[t.x+l,t.y+d]],v=o(e,h),f=o(t,h);return a=v.length>0?v[0]:[e.x,e.y],i=f.length>0?f[0]:[t.x,t.y],[{x:a[0],y:a[1]},{x:i[0],y:i[1]}]}function o(e,t){for(var r=[[e.x-e.width/2,e.y-e.height/2],[e.x+e.width/2,e.y-e.height/2],[e.x+e.width/2,e.y+e.height/2],[e.x-e.width/2,e.y+e.height/2]],n=[],a=0;a<4;a++)n.push([r[a],r[(a+1)%4]]);var o=[];for(var l of n){var d=i(t[0],t[1],l[0],l[1]);d&&o.push(d)}return o}function i(e,t,r,n){var[a,o]=e,[i,l]=t,[d,c]=r,[s,u]=n;if(a===i&&o===l||d===s&&c===u)return null;var h=(u-c)*(i-a)-(s-d)*(l-o);if(0===h)return null;var v=((s-d)*(o-c)-(u-c)*(a-d))/h,f=((i-a)*(o-c)-(l-o)*(a-d))/h;return v<0||v>1||f<0||f>1?null:[a+v*(i-a),o+v*(l-o)]}},733:(e,t,r)=>{function n(e,t,r,n){var o=r?a(e,r):e,i=n?a(t,n):t,l=Math.min(o.x-o.width/2,i.x-i.width/2),d=Math.max(o.x+o.width/2,i.x+i.width/2),c=Math.min(o.y-o.height/2,i.y-i.height/2),s=Math.max(o.y+o.height/2,i.y+i.height/2);return d-l<o.width+i.width&&s-c<o.height+i.height}function a(e,t){return{x:e.x-e.width/2-t,y:e.y-e.height/2-t,width:e.width+2*t,height:e.height+2*t}}r.d(t,{w:()=>n})},8802:(e,t,r)=>{function n(e){if(Array.isArray(e)){var t=e[0],r=e.length>1?e[1]:t;return[t,r,e.length>2?e[2]:t,e.length>3?e[3]:r]}return new Array(4).fill(e)}r.d(t,{D:()=>n})},2830:(e,t,r)=>{r.d(t,{m:()=>A});var n=r(8769),a=r.n(n),o=r(3373),i=r.n(o),l=r(531),d=r(3188);function c(e,t){return e.find((e=>(0,l.N)(e)&&e.id===t))}var s=r(3033);function u(e){var t,r,o,{edge:u,cells:v,lineConfMap:f}=e,m=(0,n.useRef)(null),g=(0,n.useMemo)((()=>c(v,u.source)),[v,u.source]),p=(0,n.useMemo)((()=>c(v,u.target)),[v,u.target]),w=(0,n.useMemo)((()=>f.get(u)),[u,f]),y=(0,n.useMemo)((()=>v.some((e=>(0,l.WW)(e)&&e.source===u.target&&e.target===u.source))?w.parallelGap:0),[v,u,w.parallelGap]),x=(0,n.useMemo)((()=>g&&p&&null!=g.view.x&&null!=p.view.x?(0,d.h)(h(g.view,5),h(p.view,5),y):null),[y,g,p]);if(!x)return null;var k="M".concat(x[0].x," ").concat(x[0].y,"L").concat(x[1].x," ").concat(x[1].y);return a().createElement(a().Fragment,null,a().createElement("path",{d:k,fill:"none",stroke:"transparent",strokeWidth:w.interactStrokeWidth}),a().createElement("path",{ref:m,className:i()("line",{dashed:w.dashed,["".concat(w.dashed?"dashed":"solid","-animation")]:w.animate.useAnimate}),style:{"--time":"".concat(null!==(t=w.animate.duration)&&void 0!==t?t:s.Be,"s"),"--solid-length":null===(r=m.current)||void 0===r||null===(o=r.getTotalLength)||void 0===o?void 0:o.call(r)},d:k,fill:"none",stroke:w.strokeColor,strokeWidth:w.strokeWidth,markerStart:w.showStartArrow?w.markerArrow:"",markerEnd:w.showEndArrow?w.markerArrow:""}),a().createElement("path",{className:"line-active-bg",d:k,fill:"none"}))}function h(e,t){return{x:e.x+e.width/2,y:e.y+e.height/2,width:e.width+t,height:e.height+t}}var v=r(4993),f=r(7410),m=r(1030),g=r(9126);function p(e){var{node:t,degraded:r,degradedNodeLabel:o,defaultNodeBricks:i,onResize:l}=e,d=function(e){var[t,r]=(0,n.useState)(e);return(0,n.useEffect)((()=>{r((t=>(0,m.isEqual)(t,e)?t:e))}),[e]),t}({node:{id:t.id,data:t.data}}),c=t.useBrick,s=(0,n.useRef)(null),u=(0,n.useMemo)((()=>{var e;return r?null:null!=c?c:null==i||null===(e=i.find((e=>(0,f.checkIfByTransform)(e,d))))||void 0===e?void 0:e.useBrick}),[r,c,i,d]),h=(0,n.useMemo)((()=>r?String(f.__secret_internals.legacyDoTransform(d,null!=o?o:"<% DATA.node.id %>")):""),[r,o,d]),p=(0,n.useCallback)((e=>{var r=s.current;r&&(r.disconnect(),s.current=null),e?setTimeout((()=>{var r=new g.A((()=>{l(t.id,[e.offsetWidth,e.offsetHeight])}));r.observe(e),s.current=r})):l(t.id,null)}),[t.id,l]),w=(0,n.useCallback)((e=>{if(e){var r=e.getBBox();l(t.id,[r.width,r.height])}else l(t.id,null)}),[t.id,l]);return u?a().createElement("foreignObject",{width:9999,height:9999,className:"node"},u&&a().createElement(v.ReactUseBrick,{useBrick:u,data:d,refCallback:p})):r?a().createElement("g",{className:"degraded",ref:w},a().createElement("circle",{cx:8,cy:8,r:8}),a().createElement("text",{x:8,y:32},h)):null}function w(e){return"edge"===e.type?(0,m.pick)(e,["type","source","target","data"]):(0,m.pick)(e,["type","id","data"])}function y(e,t){var{action:r,cell:n,scale:a,layout:o,onCellMoving:i,onCellMoved:d,onCellResizing:c,onCellResized:s,onSwitchActiveTarget:u}=t;if(e.stopPropagation(),null==u||u(w(n)),!(0,l.WW)(n)&&("force"!==o&&"dagre"!==o||!(0,l.N)(n))){var h=[e.clientX,e.clientY],v="move"===r?[n.view.x,n.view.y]:[n.view.width,n.view.height],f=!1,m=(e,t)=>{var o,l,u=function(e){return[(e.clientX-h[0])/a,(e.clientY-h[1])/a]}(e);f||(f=u[0]**2+u[1]**2>=9),f&&("move"===r?null===(o=t?d:i)||void 0===o||o({type:n.type,id:n.id,x:v[0]+u[0],y:v[1]+u[1]}):null===(l=t?s:c)||void 0===l||l({type:n.type,id:n.id,width:v[0]+u[0],height:v[1]+u[1]}))},g=e=>{m(e)},p=e=>{m(e,!0),f=!1,document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",p)};document.addEventListener("mousemove",g),document.addEventListener("mouseup",p)}}function x(e){var{cell:t,transform:r,readOnly:o,onCellResizing:i,onCellResized:l,onSwitchActiveTarget:d}=e,c=a().useRef(null);return(0,n.useEffect)((()=>{var e=c.current;if(e&&!o){var n=e=>{y(e,{action:"resize",cell:t,scale:r.k,onCellResizing:i,onCellResized:l,onSwitchActiveTarget:d})};return e.addEventListener("mousedown",n),()=>{e.removeEventListener("mousedown",n)}}}),[t,l,i,d,o,r.k]),a().createElement("g",{className:"decorator-area"},a().createElement("rect",{width:t.view.width,height:t.view.height,className:"area"}),!o&&a().createElement("g",{ref:c,className:"resize-handle",transform:"translate(".concat(t.view.width-20," ").concat(t.view.height-20,")")},a().createElement("rect",{width:20,height:20}),a().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})))}var k=r(9740);function b(e){var t,{cell:r,readOnly:o,onDecoratorTextEditing:l,onDecoratorTextChange:d}=e,c=null!==(t=r.view.text)&&void 0!==t?t:"",[s,u]=(0,n.useState)(c),[h,v]=(0,n.useState)(!1),f=(0,n.useRef)(!1),[m,g]=(0,n.useState)(!1),p=(0,n.useRef)(null),w=(0,n.useCallback)((e=>{o||(e.preventDefault(),e.stopPropagation(),v(!0))}),[o]);(0,n.useEffect)((()=>{var e=p.current;e&&e.textContent!==s&&(e.textContent=s)}),[s]),(0,n.useEffect)((()=>{h&&p.current&&(p.current.focus(),function(e){var t=document.createRange();t.selectNodeContents(e);var r=window.getSelection();r.removeAllRanges(),r.addRange(t)}(p.current)),null==l||l({id:r.id,editing:h})}),[r.id,h,l]),(0,n.useEffect)((()=>{f.current?null==l||l({id:r.id,editing:h}):f.current=!0}),[r.id,h,l]);var y=(0,n.useCallback)((e=>{o||u(e.target.textContent)}),[o]),x=(0,n.useCallback)((()=>{o||(v(!1),g(!0))}),[o]);return(0,n.useEffect)((()=>{m&&(null==d||d({id:r.id,view:(0,k.A)((0,k.A)({},r.view),{},{text:s})}),g(!1))}),[r,s,d,m]),a().createElement("foreignObject",{className:"decorator-text"},a().createElement("div",{className:i()("text-container",{editing:h}),onDoubleClick:w},a().createElement("div",{className:"text",contentEditable:h,ref:p,onInput:y,onBlur:x})))}function E(e){var t,{cell:r,transform:n,readOnly:o,onCellResizing:i,onCellResized:l,onSwitchActiveTarget:d,onDecoratorTextEditing:c,onDecoratorTextChange:s}=e;switch(r.decorator){case"area":t=x;break;case"text":t=b;break;default:return console.error("Unknown decorator: ".concat(r.decorator)),null}return a().createElement(t,{cell:r,transform:n,readOnly:o,onCellResizing:i,onCellResized:l,onSwitchActiveTarget:d,onDecoratorTextEditing:c,onDecoratorTextChange:s})}var C=r(8185);function A(e){var{layout:t,cell:r,cells:o,degraded:d,degradedNodeLabel:c,defaultNodeBricks:s,lineConfMap:h,active:v,readOnly:f,transform:m,unrelatedCells:g,onCellMoving:x,onCellMoved:k,onCellResizing:b,onCellResized:A,onSwitchActiveTarget:z,onCellContextMenu:M,onDecoratorTextEditing:N,onDecoratorTextChange:R,onNodeBrickResize:S,onCellMouseEnter:W,onCellMouseLeave:L}=e,T=(0,n.useRef)(null),D=(0,n.useMemo)((()=>g.some((e=>(0,C.c)(e,r)))),[r,g]);(0,n.useEffect)((()=>{var e=T.current;if(e&&!f){var n=e=>{y(e,{layout:t,action:"move",cell:r,scale:m.k,onCellMoving:x,onCellMoved:k,onSwitchActiveTarget:z})};return e.addEventListener("mousedown",n),()=>{e.removeEventListener("mousedown",n)}}}),[t,r,k,x,z,f,m.k]);var B=(0,n.useCallback)((e=>{f&&"decorator"===r.type||(e.preventDefault(),z(w(r)),M({cell:r,clientX:e.clientX,clientY:e.clientY}))}),[r,M,z,f]),P=(0,n.useCallback)((()=>{null==W||W(r)}),[r,W]),V=(0,n.useCallback)((()=>{null==L||L(r)}),[r,L]);return a().createElement("g",{className:i()("cell",{active:v,faded:D,"read-only":f}),ref:T,transform:"edge"===r.type||null==r.view.x?void 0:"translate(".concat(r.view.x," ").concat(r.view.y,")"),onContextMenu:B,onMouseEnter:P,onMouseLeave:V},(0,l.N)(r)?a().createElement(p,{node:r,degraded:d,degradedNodeLabel:c,defaultNodeBricks:s,onResize:S}):(0,l.WW)(r)?a().createElement(u,{edge:r,cells:o,lineConfMap:h}):(0,l.mH)(r)?a().createElement(E,{cell:r,transform:m,readOnly:f,onCellResizing:b,onCellResized:A,onSwitchActiveTarget:z,onDecoratorTextEditing:N,onDecoratorTextChange:R}):null)}},3033:(e,t,r)=>{r.d(t,{Be:()=>g,CV:()=>n,HP:()=>o,Ie:()=>v,N8:()=>l,Ub:()=>m,VO:()=>h,XV:()=>f,Yt:()=>s,mF:()=>u,pC:()=>p,sS:()=>c,sz:()=>i,w1:()=>d,xc:()=>a});var n=Symbol.for("size-initialized"),a=Symbol.for("layout-initialized"),o=20,i=36,l=100,d=60,c=.5,s=2,u="gray",h=1,v=15,f=!1,m=!0,g=1,p=500},531:(e,t,r)=>{function n(e){return"node"===e.type}function a(e){return"decorator"===e.type}function o(e){return"node"===e.type}function i(e){return"edge"===e.type}function l(e){return"node"===e.type||"edge"===e.type}r.d(t,{N:()=>n,WW:()=>i,mH:()=>a,nv:()=>l,vC:()=>o})},227:(e,t,r)=>{r.d(t,{Y:()=>a});var n=r(8185);function a(e,t,r){var a=[];if(t){var o=new Set;for(var i of e)"edge"===i.type&&i.source===t.source.id&&o.add(i.target);for(var l of e)"node"===l.type?o.has(l.id)&&a.push(l):a.push(l)}else switch(null==r?void 0:r.type){case"node":var d=new Map,c=new Set([r.id]);for(var s of e)"node"===s.type?d.set(s.id,s):"edge"===s.type?s.source===r.id?c.add(s.target):s.target===r.id?c.add(s.source):a.push(s):a.push(s);for(var[u,h]of d)c.has(u)||a.push(h);break;case"edge":for(var v of e)("edge"===v.type?(0,n.c)(v,r):"node"===v.type&&(v.id===r.source||v.id===r.target))||a.push(v);break;case"decorator":for(var f of e)"decorator"===f.type&&f.id===r.id||a.push(f)}return a}},3783:(e,t,r)=>{r.d(t,{C:()=>o});var n=r(9740),a=r(531);function o(e,t){var{defaultNodeSize:r}=t;return(null!=e?e:[]).map((e=>{var t,o;return!(0,a.vC)(e)||void 0!==(null===(t=e.view)||void 0===t?void 0:t.width)&&void 0!==(null===(o=e.view)||void 0===o?void 0:o.height)?e:(0,n.A)((0,n.A)({},e),{},{view:(0,n.A)({width:r[0],height:r[1]},e.view)})}))}},8185:(e,t,r)=>{function n(e,t){return e?!!t&&e.type===t.type&&("node"===e.type||"decorator"===e.type?e.id===t.id:e.source===t.source&&e.target===t.target):!t}r.d(t,{c:()=>n})},908:(e,t,r)=>{r.d(t,{r:()=>a});var n=r(531);function a(e,t){var{canvasWidth:r,canvasHeight:a,scaleRange:o}=t,i=1/0,l=1/0,d=-1/0,c=-1/0,s=!0;for(var u of e)if(!(0,n.WW)(u)){s=!1;var{view:h}=u,v=h.x+h.width,f=h.y+h.height;h.x<i&&(i=h.x),v>d&&(d=v),h.y<l&&(l=h.y),f>c&&(c=f)}var m=d-i,g=c-l,p=o&&!s&&(m>r||g>a)?Math.max(Math.min(r/m,a/g,o[1]),o[0]):1;return{x:s?0:(r-m*p)/2-i*p,y:s?0:(a-g*p)/2-l*p,k:p}}},1083:(e,t,r)=>{r.d(t,{d:()=>d});var n=r(9740),a=r(531),o=r(3033);function i(e,t,r){var n=e.findLastIndex(r)+1;return[...e.slice(0,n),t,...e.slice(n)]}var l,d=(l={cells:(e,t)=>{switch(t.type){case"drop-node":return i(e,t.payload,(e=>!("decorator"===e.type&&"text"===e.decorator)));case"drop-decorator":return"text"===t.payload.decorator?[...e,t.payload]:i(e,t.payload,(e=>"decorator"===e.type&&"area"===e.decorator));case"add-nodes":var r=e.findLastIndex((e=>!("decorator"===e.type&&"text"===e.decorator)))+1;return[...e.slice(0,r),...t.payload,...e.slice(r)];case"add-edge":return i(e,t.payload,(e=>"edge"===e.type||"decorator"===e.type&&"area"===e.decorator));case"move-cell":var{type:l,id:d,x:c,y:s}=t.payload,u=e.findIndex((e=>e.type===l&&e.id===d));if(-1!==u){var h=e[u];return[...e.slice(0,u),(0,n.A)((0,n.A)({},h),{},{view:(0,n.A)((0,n.A)({},h.view),{},{x:c,y:s})}),...e.slice(u+1)]}return e;case"resize-cell":var{type:v,id:f,width:m,height:g}=t.payload,p=e.findIndex((e=>e.type===v&&e.id===f));if(-1!==p){var w=e[p];return[...e.slice(0,p),(0,n.A)((0,n.A)({},w),{},{view:(0,n.A)((0,n.A)({},w.view),{},{width:m,height:g})}),...e.slice(p+1)]}return e;case"update-cells":return t.payload;case"update-node-size":return e.map((e=>(0,a.N)(e)&&e.id===t.payload.id?(0,n.A)((0,n.A)({},e),{},{[o.CV]:!0,view:t.payload.size?(0,n.A)((0,n.A)({},e.view),{},{width:t.payload.size[0],height:t.payload.size[1]}):e.view}):e))}return e}},(e,t)=>Object.fromEntries(Object.entries(l).map((r=>{var[n,a]=r;return[n,a(e[n],t)]}))))},7099:(e,t,r)=>{r.d(t,{Y:()=>f});var n=r(8769),a=r.n(n),o=r(2657),i=r(6768),l=r(198),d=r(8621),c=r(4993),s=r(9575);const u=e=>n.createElement("svg",(0,s.A)({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},e),n.createElement("path",{d:"M12 0a.5.5 0 0 1 .5.5v2.013a9.5 9.5 0 0 1 8.987 8.988L23.5 11.5a.5.5 0 0 1 0 1h-2.013a9.5 9.5 0 0 1-8.987 8.987V23.5a.5.5 0 0 1-1 0v-2.013A9.5 9.5 0 0 1 2.514 12.5H.5a.5.5 0 0 1 0-1h2.013A9.5 9.5 0 0 1 11.5 2.514V.5A.5.5 0 0 1 12 0M3.514 11.5H7.5a.5.5 0 0 1 0 1H3.514a8.5 8.5 0 0 0 7.987 7.986L11.5 16.5a.5.5 0 0 1 1 0v3.986a8.5 8.5 0 0 0 7.986-7.986H16.5a.5.5 0 0 1 0-1h3.986A8.5 8.5 0 0 0 12.5 3.515V7.5a.5.5 0 0 1-1 0V3.514a8.5 8.5 0 0 0-7.986 7.987zm8.486-1a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3"})),h=e=>n.createElement("svg",(0,s.A)({xmlns:"http://www.w3.org/2000/svg",width:128,height:128,className:"icon",viewBox:"0 0 1024 1024"},e),n.createElement("path",{d:"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384"}),n.createElement("path",{d:"M744.448 486.4h-204.8V281.6a25.6 25.6 0 1 0-51.2 0v204.8h-204.8a25.6 25.6 0 0 0 0 51.2h204.8v204.8a25.6 25.6 0 0 0 51.2 0V537.6h204.8a25.6 25.6 0 0 0 0-51.2"})),v=e=>n.createElement("svg",(0,s.A)({xmlns:"http://www.w3.org/2000/svg",width:128,height:128,className:"icon",viewBox:"0 0 1024 1024"},e),n.createElement("path",{d:"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384"}),n.createElement("path",{d:"M744.448 486.4H280.064a25.6 25.6 0 1 0 0 51.2h464.384a25.6 25.6 0 0 0 0-51.2"}));function f(e){var{shadowRoot:t,scale:r,scaleRange:s,onZoomChange:f,onReCenter:m}=e,g=(0,c.useCurrentTheme)(),p=(0,n.useMemo)((()=>(0,d.VC)()),[]),w=(0,n.useRef)(null),y=100*s[0],x=100*s[1],k=100*r,b=(0,n.useMemo)((()=>({formatter:e=>"".concat(e,"%"),placement:"left",getPopupContainer:()=>w.current})),[]),E=(0,n.useCallback)((()=>{f(Math.min(k+5,x))}),[x,f,k]),C=(0,n.useCallback)((()=>{f(Math.max(k-5,y))}),[y,f,k]);return a().createElement(o.Ay,{theme:{algorithm:"dark-v2"===g?i.A.darkAlgorithm:i.A.defaultAlgorithm}},a().createElement(d.N7,{container:t,autoClear:!0,cache:p,hashPriority:"high"},a().createElement("div",{className:"zoom-bar",ref:w},a().createElement("div",{className:"center-button",onClick:m,role:"button"},a().createElement(u,null)),a().createElement("div",{className:"zoom-slider"},a().createElement("div",{className:"zoom-button",role:"button",onClick:E},a().createElement(h,null)),a().createElement(l.A,{min:y,max:x,value:k,step:5,vertical:!0,included:!1,tooltip:b,onChange:f}),a().createElement("div",{className:"zoom-button",role:"button",onClick:C},a().createElement(v,null))))))}},9127:(e,t,r)=>{r.d(t,{C:()=>u});var n=r(9740),a=r(4223),o=r(1030),i=r(7586),l=r.n(i),d=r(8802),c=r(531),s=["nodePadding"];function u(e){var{cells:t,layoutOptions:r}=e,i=(0,n.A)({nodePadding:0,rankdir:"TB",ranksep:50,edgesep:10,nodesep:50},(0,o.pick)(r,["nodePadding","rankdir","ranksep","edgesep","nodesep","align"])),{nodePadding:u}=i,h=(0,a.A)(i,s),v=(0,d.D)(u);if(!t.some(c.N))return{getNodeView:()=>null,nodePaddings:v};var f=new(l().graphlib.Graph);for(var m of(f.setGraph(h),f.setDefaultEdgeLabel((function(){return{}})),t))(0,c.N)(m)?f.setNode(m.id,{id:m.id,width:m.view.width+v[1]+v[3],height:m.view.height+v[0]+v[2]}):(0,c.WW)(m)&&f.setEdge(m.source,m.target);return l().layout(f),{getNodeView:e=>f.node(e),nodePaddings:v}}},6170:(e,t,r)=>{r.d(t,{k:()=>v});var n=r(9740),a=r(1030),o=r(6149),i=r(4842),l=r(1945),d=r(9418),c=r(3854),s=r(7931),u=r(531),h=r(8802);function v(e){var{cells:t,layoutOptions:r,center:v,fixedPosition:f}=e,{nodePadding:m,collide:g}=(0,n.A)((0,n.A)({nodePadding:0},(0,a.pick)(r,["nodePadding"])),{},{collide:!1!==(null==r?void 0:r.collide)&&(0,n.A)({radiusDiff:18,strength:1,iterations:1},!0===(null==r?void 0:r.collide)?null:null==r?void 0:r.collide)}),p=(0,h.D)(m),w=[],y=[],x=new Map;for(var k of t)if((0,u.N)(k)){var b=(0,n.A)({id:k.id,width:k.view.width+p[1]+p[3],height:k.view.height+p[0]+p[2]},f?{fx:k.view.x,fy:k.view.y}:null);w.push(b),x.set(b.id,b)}else(0,u.WW)(k)&&y.push({source:k.source,target:k.target});var E=(0,o.A)(y).id((e=>e.id)),C=(0,i.A)(w).force("link",E).force("x",(0,l.A)(null==v?void 0:v[0])).force("y",(0,d.A)(null==v?void 0:v[1])).force("charge",(0,c.A)());return g&&C.force("collide",(0,s.A)().radius((e=>Math.sqrt(e.width**2+e.height**2)/2+g.radiusDiff)).strength(g.strength).iterations(g.iterations)),C.stop(),function(e){e.tick(Math.ceil(Math.log(e.alphaMin())/Math.log(1-e.alphaDecay())))}(C),{getNodeView:e=>x.get(e),nodePaddings:p}}},1819:(e,t,r)=>{r.d(t,{J:()=>o});var n=r(8769),a=r(8185);function o(e){var{cellsRef:t,activeTarget:r,onActiveTargetChange:o}=e,i=null!=r?r:null,[l,d]=(0,n.useState)(i);(0,n.useEffect)((()=>{d((e=>(0,a.c)(e,i)?e:i))}),[i]);var c=(0,n.useRef)(!1);return(0,n.useEffect)((()=>{c.current?o(l):c.current=!0}),[l,o]),(0,n.useEffect)((()=>{if(l){var e=e=>{e.composedPath().indexOf(t.current)<=0&&d(null)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}}}),[l,t]),l}},2361:(e,t,r)=>{r.d(t,{g:()=>h});var n=r(9740),a=r(8769),o=r(7566),i=r(1517),l=r(3033),d=r(531),c=r(908),s=r(6170),u=r(9127);function h(e){var{layout:t,layoutOptions:r,rootRef:h,cells:v,zoomable:f,zoomer:m,scaleRange:g,dispatch:p}=e,[w,y]=(0,a.useState)("force"!==t&&"dagre"!==t),[x,k]=function(e){var{rootRef:t,cells:r,layoutInitialized:n,zoomable:s,zoomer:u,scaleRange:h}=e,[v,f]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{var e=t.current;if(e&&n&&!v&&r.some((e=>(0,d.N)(e)||(0,d.mH)(e)))&&!r.some((e=>(0,d.N)(e)&&!e[l.CV]))){var{k:a,x:m,y:g}=(0,c.r)(r,{canvasWidth:e.clientWidth,canvasHeight:e.clientHeight,scaleRange:s?h:void 0});u.transform((0,o.A)(e),new i.uV(a,m,g)),f(!0)}}),[r,v,n,t,h,s,u]),(0,a.useEffect)((()=>{r.some((e=>(0,d.N)(e)||(0,d.mH)(e)))||f(!1)}),[r]),[v,f]}({rootRef:h,layoutInitialized:w,cells:v,zoomable:f,zoomer:m,scaleRange:g}),b=(0,a.useRef)(null);return(0,a.useEffect)((()=>{if(!v.some((e=>(0,d.N)(e)&&!e[l.CV])))if("force"===t||"dagre"===t){if(e=b.current,a=v.filter(d.nv),(null==e?void 0:e.length)!==a.length||!e.every(((e,t)=>e===a[t]))){var e,a,o,i;({getNodeView:o,nodePaddings:i}="force"===t?(0,s.k)({cells:v,layoutOptions:r}):(0,u.C)({cells:v,layoutOptions:r}));var c=v.map((e=>{if((0,d.N)(e)){var t=o(e.id);return(0,n.A)((0,n.A)({},e),{},{view:(0,n.A)((0,n.A)({},e.view),{},{x:t.x-t.width/2+i[3],y:t.y-t.height/2+i[0]}),[l.xc]:!0})}return e}));b.current=c.filter(d.nv),p({type:"update-cells",payload:c}),k(!1),y(!0)}}else y(!0)}),[v,p,t,r,k]),{centered:x,setCentered:k}}},7531:(e,t,r)=>{r.d(t,{d:()=>c});var n=r(9740),a=r(8769),o=r(7410),i=r(1030),l=r(531),d=r(3033);function c(e){var{cells:t,defaultEdgeLines:r,markerPrefix:c}=e;return(0,a.useMemo)((()=>{var e=[{strokeColor:d.mF}],a=new WeakMap,s=function(t){if((0,l.WW)(t)){var s,u=null!==(s=o.__secret_internals.legacyDoTransform({edge:t},null==r?void 0:r.find((e=>(0,o.checkIfByTransform)(e,{edge:t})))))&&void 0!==s?s:{},h=(0,n.A)({dashed:!1,strokeColor:d.mF,strokeWidth:d.VO,interactStrokeWidth:d.Ie,showStartArrow:d.XV,showEndArrow:d.Ub,animate:{useAnimate:!1,duration:d.Be}},(0,i.omitBy)(u,i.isUndefined));void 0===h.parallelGap&&(h.parallelGap=h.interactStrokeWidth);var v=function(e,t){var r=(0,i.findIndex)(t,e);return-1===r&&(r=t.push(e)-1),r}({strokeColor:h.strokeColor},e);h.markerArrow="url(#".concat(c).concat(v,")"),a.set(t,h)}};for(var u of t)s(u);return[a,e]}),[t,r,c])}},8197:(e,t,r)=>{r.d(t,{H:()=>i});var n=r(8769),a=r(531),o=r(3033);function i(e){var{cells:t,layout:r,centered:i}=e;return(0,n.useMemo)((()=>i&&t.every((e=>!(0,a.N)(e)||e[o.CV]&&("force"!==r&&"dagre"!==r||e[o.xc])))),[t,i,r])}},8091:(e,t,r)=>{r.d(t,{f:()=>l});var n=r(8769),a=r(7566),o=r(1517),i=r(3033);function l(e){var{rootRef:t,zoomable:r,scrollable:l,pannable:d,scaleRange:c,onSwitchActiveTarget:s}=e,[u,h]=(0,n.useState)(!1),[v,f]=(0,n.useState)({k:1,x:0,y:0}),m=(0,n.useMemo)((()=>null!=c?c:[i.sS,i.Yt]),[c]),g=(0,n.useMemo)((()=>(0,o.s_)()),[]);return(0,n.useEffect)((()=>{var e=!1;g.scaleExtent(r?m:[1,1]).on("start",(()=>{e=!1,h(!0)})).on("zoom",(t=>{e=!0,f(t.transform)})).on("end",(()=>{h(!1),e||null==s||s(null)}))}),[s,m,r,g]),(0,n.useEffect)((()=>{var e=t.current;if(e){var n=(0,a.A)(e),o=()=>{n.on(".zoom",null).on(".zoom.custom",null).on("wheel",null)};if(r||l||d)return(r||l)&&n.on("wheel.zoom.custom",(e=>{e.ctrlKey||(e.stopImmediatePropagation(),l&&(e.preventDefault(),g.translateBy(n,e.wheelDeltaX/5,e.wheelDeltaY/5)))})),n.call(g).on("wheel",(e=>e.preventDefault())).on("dblclick.zoom",null).on("mousedown.zoom",null),d||n.on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),o;o()}}),[d,t,l,r,g]),{grabbing:u,transform:v,zoomer:g,scaleRange:m}}},8618:(e,t,r)=>{r.d(t,{A:()=>l});var n=r(6758),a=r.n(n),o=r(935),i=r.n(o)()(a());i.push([e.id,'.zoom-bar{position:absolute;bottom:20px;right:20px;width:40px}.zoom-slider,\n.center-button{width:100%;display:flex;align-items:center;border:1px solid var(--antd-background-color-base);border-radius:var(--larger-border-radius);box-shadow:var(--connected-overlay-shadow);background-color:var(--color-fill-bg-container-4)}.zoom-slider{height:140px;padding:8px 0;flex-direction:column}[role="button"]{cursor:pointer}.center-button{justify-content:center;margin-bottom:8px;height:40px}.center-button:hover{border-color:var(--antd-btn-default-hover-border-color)}.center-button path{fill:var(--antd-link-hover-color)}.center-button:hover path{fill:var(--palette-blue-7)}.zoom-button{font-size:16px;line-height:0}.zoom-button svg{width:1em;height:1em;fill:var(--antd-link-hover-color)}.zoom-slider .ant-slider-vertical{padding-inline:5px}.zoom-slider .ant-slider-vertical .ant-slider-rail{width:2px}.zoom-slider .ant-slider-vertical .ant-slider-handle{width:6px;height:6px;inset-inline-start:3px}.zoom-slider .ant-slider .ant-slider-handle:hover::before,\n.zoom-slider .ant-slider .ant-slider-handle:focus::before,\n.zoom-slider .ant-slider .ant-slider-handle::before{width:10px;height:10px;inset-inline-start:-2px}.zoom-slider .ant-slider .ant-slider-handle:hover::after,\n.zoom-slider .ant-slider .ant-slider-handle:focus::after,\n.zoom-slider .ant-slider .ant-slider-handle::after{width:6px;height:6px;inset-block-start:0;inset-inline-start:0}',""]);const l=i.toString()},3012:(e,t,r)=>{r.d(t,{A:()=>l});var n=r(6758),a=r.n(n),o=r(935),i=r.n(o)()(a());i.push([e.id,"*{box-sizing:border-box}:host{display:block;position:relative;overflow:hidden;--animation-dasharray:48;--stroke-dashoffset:96;--dasharray:4}:host,\n.root{width:100%;height:100%}:host([hidden]){display:none}.root{opacity:0}.root.ready{opacity:1}.root:focus{outline:none}@keyframes dashedAnimation{0%{stroke-dashoffset:var(--stroke-dashoffset)}to{stroke-dashoffset:0}}@keyframes solidAnimation{to{stroke-dashoffset:0}}.solid-animation{stroke-dasharray:var(--solid-length);stroke-dashoffset:var(--solid-length);animation:solidAnimation var(--time) linear infinite}.dashed-animation{animation:dashedAnimation var(--time) linear infinite}.decorator-area .area{fill:rgba(119,141,195,0.1);stroke:none;stroke-width:0}.node,\n.decorator-text{overflow:visible}.cell.active .decorator-area .area,\n.cell.active .line-active-bg{stroke:var(--palette-blue-5);stroke-dasharray:var(--dasharray);stroke-width:1}.cell:not(.read-only){-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-handle{cursor:nwse-resize;opacity:0}.resize-handle rect{fill:transparent;stroke:none}.resize-handle path{fill:none;stroke:var(--palette-gray-5);stroke-width:1.5}.cell.active .decorator-area .resize-handle,\n.decorator-area:hover .resize-handle{opacity:1}.connect-line{pointer-events:none}.connect-line:not(.connecting){display:none}.line.dashed{stroke-dasharray:var(--dasharray)}.cell.active .decorator-text .text-container{outline:1px dashed var(--palette-blue-5)}.decorator-text .text-container{width:-webkit-max-content;width:-moz-max-content;width:max-content;padding:0.5em}.decorator-text .text:focus{outline:none}.cell.faded{opacity:0.3}.cell .node{pointer-events:none}.cell .node > *{pointer-events:auto}.degraded{pointer-events:bounding-box}.degraded circle{fill:rgb(119,141,195)}.degraded text{text-anchor:middle;fill:var(--antd-text-color)}.cell.active .degraded circle,\n.cell.active .degraded text,\n.degraded:hover circle,\n.degraded:hover text{fill:var(--color-brand)}",""]);const l=i.toString()}}]);
2
+ //# sourceMappingURL=709.29f69a6d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunks/709.29f69a6d.js","mappings":"mKAYO,SAASA,EAAeC,GAIO,IAChCC,GAL0B,GAC9BC,EAAE,KACFC,EAAI,YACJC,GACqBJ,EAGrB,OAAQG,GACN,IAAK,OACHF,EAAYI,EACZ,MACF,IAAK,OACHJ,EAAYK,EACZ,MACF,QACEL,EAAYM,EAGhB,OAAOC,IAAAA,cAACP,EAAS,CAACC,GAAIA,EAAIE,YAAaA,GACzC,CAEA,SAASG,EAAWE,GAGsB,IAHrB,GACnBP,EAAE,YACFE,GACyBK,EACzB,OACED,IAAAA,cAAA,UACEN,GAAIA,EACJQ,QAAQ,UACRC,KAAM,EACNC,KAAM,EACNC,YAAa,EACbC,aAAc,EACdC,OAAO,qBACPC,eAAe,SAEfR,IAAAA,cAAA,QACES,EAAE,gCACFC,OAAQd,EACRe,YAAa,EACbC,KAAMhB,IAId,CAEA,SAASC,EAA6BgB,GAGI,IAHH,GACrCnB,EAAE,YACFE,GACyBiB,EACzB,OACEb,IAAAA,cAAA,UACEN,GAAIA,EACJQ,QAAQ,YACRC,KAAM,GACNC,KAAM,IACNC,YAAa,GACbC,aAAc,GACdC,OAAO,sBAEPP,IAAAA,cAAA,QACES,EAAE,yFACFC,OAAQd,EACRe,YAAa,EACbC,KAAK,SAIb,CAEA,SAASd,EAA8BgB,GAGG,IAHF,GACtCpB,EAAE,YACFE,GACyBkB,EACzB,OACEd,IAAAA,cAAA,UACEN,GAAIA,EACJQ,QAAQ,YACRC,KAAM,GACNC,KAAM,IACNC,YAAa,GACbC,aAAc,GACdC,OAAO,sBAEPP,IAAAA,cAAA,QACES,EAAE,yGACFC,OAAQd,EACRe,YAAa,EACbC,KAAK,SAIb,C,+CCnGO,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,gBAAiB,MACpBA,GAAG,iBAAkB,MAEnBP,GACHQ,EACGD,GAAG,kBAAmB,MACtBA,GAAG,iBAAkB,MACrBA,GAAG,gBAAiB,MAGlBE,EAzCLA,GAZF,CAqDgB,GACf,CAACT,EAAUrC,EAASoC,EAAYnC,EAAUC,IAEtC,CAAEqC,WAAUhQ,YAAW2N,SAAQtH,aACxC,C,kEClIIwK,E,MAA0B,GAA4B,KAE1DA,EAAwBla,KAAK,CAACma,EAAOtd,GAAI,o6CAK2E,KAEpH,QAAeqd,EAAwBE,U,kECTnCF,E,MAA0B,GAA4B,KAE1DA,EAAwBla,KAAK,CAACma,EAAOtd,GAAI,q7DAOO,KAEhD,QAAeqd,EAAwBE,U","sources":["webpack:///./src/diagram/MarkerComponent.tsx","webpack:///./src/diagram/lines/getDirectLinePoints.ts","webpack:///./src/diagram/processors/doTwoNodesOverlap.ts","webpack:///./src/diagram/processors/extractPartialRectTuple.ts","webpack:///./src/draw-canvas/processors/findNode.ts","webpack:///./src/draw-canvas/EdgeComponent.tsx","webpack:///./src/draw-canvas/NodeComponent.tsx","webpack:///./src/draw-canvas/processors/cellToTarget.ts","webpack:///./src/draw-canvas/processors/handleMouseDown.ts","webpack:///./src/draw-canvas/decorators/DecoratorArea.tsx","webpack:///./src/draw-canvas/decorators/DecoratorText.tsx","webpack:///./src/draw-canvas/decorators/index.tsx","webpack:///./src/draw-canvas/CellComponent.tsx","webpack:///./src/draw-canvas/constants.ts","webpack:///./src/draw-canvas/processors/asserts.ts","webpack:///./src/draw-canvas/processors/getUnrelatedCells.ts","webpack:///./src/draw-canvas/processors/initializeCells.ts","webpack:///./src/draw-canvas/processors/sameTarget.ts","webpack:///./src/draw-canvas/processors/transformToCenter.ts","webpack:///./src/draw-canvas/reducers/cells.ts","webpack:///./src/draw-canvas/reducers/index.ts","webpack:///./src/shared/canvas/icons/center.svg","webpack:///./src/shared/canvas/icons/zoom-in.svg","webpack:///./src/shared/canvas/icons/zoom-out.svg","webpack:///./src/shared/canvas/ZoomBarComponent.tsx","webpack:///./src/shared/canvas/dagreLayout.ts","webpack:///./src/shared/canvas/forceLayout.ts","webpack:///./src/shared/canvas/useActiveTarget.ts","webpack:///./src/shared/canvas/useLayout.ts","webpack:///./src/shared/canvas/useAutoCenter.ts","webpack:///./src/shared/canvas/useLineMarkers.ts","webpack:///./src/shared/canvas/useReady.ts","webpack:///./src/shared/canvas/useZoom.ts","webpack:///./src/shared/canvas/ZoomBarComponent.shadow.css","webpack:///./src/shared/canvas/styles.shadow.css"],"sourcesContent":["import React from \"react\";\nimport type { LineMarkerType } from \"./interfaces\";\n\nexport interface MarkerComponentProps extends BaseMarkerComponentProps {\n type: LineMarkerType;\n}\n\nexport interface BaseMarkerComponentProps {\n id: string;\n strokeColor?: string;\n}\n\nexport function MarkerComponent({\n id,\n type,\n strokeColor,\n}: MarkerComponentProps): JSX.Element {\n let Component: (props: BaseMarkerComponentProps) => JSX.Element;\n\n switch (type) {\n case \"0..1\":\n Component = EntityRelationZeroOrOneMarker;\n break;\n case \"0..N\":\n Component = EntityRelationZeroOrManyMarker;\n break;\n default:\n Component = ArrowMarker;\n }\n\n return <Component id={id} strokeColor={strokeColor} />;\n}\n\nfunction ArrowMarker({\n id,\n strokeColor,\n}: BaseMarkerComponentProps): JSX.Element {\n return (\n <marker\n id={id}\n viewBox=\"0 0 6 6\"\n refX={5}\n refY={3}\n markerWidth={6}\n markerHeight={6}\n orient=\"auto-start-reverse\"\n strokeLinejoin=\"round\"\n >\n <path\n d=\"M 0.5 0.5 L 5.5 3 L 0.5 5.5 z\"\n stroke={strokeColor}\n strokeWidth={1}\n fill={strokeColor}\n />\n </marker>\n );\n}\n\nfunction EntityRelationZeroOrOneMarker({\n id,\n strokeColor,\n}: BaseMarkerComponentProps): JSX.Element {\n return (\n <marker\n id={id}\n viewBox=\"0 0 21 11\"\n refX={0.5}\n refY={5.5}\n markerWidth={21}\n markerHeight={11}\n orient=\"auto-start-reverse\"\n >\n <path\n d=\"M 5.5 5.5 m 5 0 a 5 5 0 1 0 -10 0 a 5 5 0 1 0 10 0 M 15.5 0.5 V 10.5 M 10.5 5.5 H 20.5\"\n stroke={strokeColor}\n strokeWidth={1}\n fill=\"none\"\n />\n </marker>\n );\n}\n\nfunction EntityRelationZeroOrManyMarker({\n id,\n strokeColor,\n}: BaseMarkerComponentProps): JSX.Element {\n return (\n <marker\n id={id}\n viewBox=\"0 0 21 11\"\n refX={0.5}\n refY={5.5}\n markerWidth={21}\n markerHeight={11}\n orient=\"auto-start-reverse\"\n >\n <path\n d=\"M 5.5 5.5 m 5 0 a 5 5 0 1 0 -10 0 a 5 5 0 1 0 10 0 M 20.5 0.5 L 10.5 5.5 L 20.5 10.5 M 10.5 5.5 H 20.5\"\n stroke={strokeColor}\n strokeWidth={1}\n fill=\"none\"\n />\n </marker>\n );\n}\n","import type { NodePosition, NodeRect, PositionTuple } from \"../interfaces\";\nimport { doTwoNodesOverlap } from \"../processors/doTwoNodesOverlap\";\n\ntype LineTuple = [start: PositionTuple, end: PositionTuple];\n\nexport function getDirectLinePoints(\n source: NodeRect,\n target: NodeRect,\n parallelGap?: number\n): NodePosition[] | null {\n // Ignore if two nodes are the same.\n // Ignore if two nodes overlap.\n if (source === target || doTwoNodesOverlap(source, target, 0, 0)) {\n return null;\n }\n\n let p0: PositionTuple;\n let p1: PositionTuple;\n\n let xDiff = 0;\n let yDiff = 0;\n\n if (parallelGap) {\n const dx = target.x - source.x;\n const dy = target.y - source.y;\n const angle = Math.atan2(dy, dx);\n xDiff = (parallelGap / 2) * Math.cos(angle + Math.PI / 2);\n yDiff = (parallelGap / 2) * Math.sin(angle + Math.PI / 2);\n }\n\n const line: LineTuple = [\n [source.x + xDiff, source.y + yDiff],\n [target.x + xDiff, target.y + yDiff],\n ];\n const sourceIntersections = getIntersections(source, line);\n const targetIntersections = getIntersections(target, line);\n\n // Todo: handle when more than one intersection\n if (sourceIntersections.length > 0) {\n p0 = sourceIntersections[0];\n } else {\n p0 = [source.x, source.y];\n }\n if (targetIntersections.length > 0) {\n p1 = targetIntersections[0];\n } else {\n p1 = [target.x, target.y];\n }\n\n return [\n { x: p0[0], y: p0[1] },\n { x: p1[0], y: p1[1] },\n ];\n}\n\nfunction getIntersections(rect: NodeRect, line: LineTuple) {\n const vertices: PositionTuple[] = [\n [rect.x - rect.width / 2, rect.y - rect.height / 2],\n [rect.x + rect.width / 2, rect.y - rect.height / 2],\n [rect.x + rect.width / 2, rect.y + rect.height / 2],\n [rect.x - rect.width / 2, rect.y + rect.height / 2],\n ];\n const possibleLines: [start: PositionTuple, end: PositionTuple][] = [];\n for (let i = 0; i < 4; i++) {\n possibleLines.push([vertices[i], vertices[(i + 1) % 4]]);\n }\n const intersections: PositionTuple[] = [];\n for (const item of possibleLines) {\n const intersection = intersect(line[0], line[1], item[0], item[1]);\n if (intersection) {\n intersections.push(intersection);\n }\n }\n return intersections;\n}\n\n// https://paulbourke.net/geometry/pointlineplane/javascript.txt\nfunction intersect(\n [x1, y1]: PositionTuple,\n [x2, y2]: PositionTuple,\n [x3, y3]: PositionTuple,\n [x4, y4]: PositionTuple\n): null | PositionTuple {\n // Check if none of the lines are of length 0\n if ((x1 === x2 && y1 === y2) || (x3 === x4 && y3 === y4)) {\n return null;\n }\n\n const denominator = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n\n // Lines are parallel\n if (denominator === 0) {\n return null;\n }\n\n const ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator;\n const ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denominator;\n\n // is the intersection along the segments\n if (ua < 0 || ua > 1 || ub < 0 || ub > 1) {\n return null;\n }\n\n // Return a object with the x and y coordinates of the intersection\n const x = x1 + ua * (x2 - x1);\n const y = y1 + ua * (y2 - y1);\n\n return [x, y];\n}\n","import type { NodeRect } from \"../interfaces\";\n\nexport function doTwoNodesOverlap(\n a: NodeRect,\n b: NodeRect,\n paddingA: number,\n paddingB: number\n): boolean {\n const A = paddingA ? getNodesWithPadding(a, paddingA) : a;\n const B = paddingB ? getNodesWithPadding(b, paddingB) : b;\n const left = Math.min(A.x - A.width / 2, B.x - B.width / 2);\n const right = Math.max(A.x + A.width / 2, B.x + B.width / 2);\n const top = Math.min(A.y - A.height / 2, B.y - B.height / 2);\n const bottom = Math.max(A.y + A.height / 2, B.y + B.height / 2);\n return right - left < A.width + B.width && bottom - top < A.height + B.height;\n}\n\nfunction getNodesWithPadding(node: NodeRect, padding: number) {\n return {\n x: node.x - node.width / 2 - padding,\n y: node.y - node.height / 2 - padding,\n width: node.width + padding * 2,\n height: node.height + padding * 2,\n };\n}\n","import type { FullRectTuple, PartialRectTuple } from \"../interfaces\";\n\nexport function extractPartialRectTuple(\n value: PartialRectTuple\n): FullRectTuple {\n if (Array.isArray(value)) {\n const v0 = value[0];\n const v1 = value.length > 1 ? value[1]! : v0;\n const v2 = value.length > 2 ? value[2]! : v0;\n const v3 = value.length > 3 ? value[3]! : v1;\n return [v0, v1, v2, v3];\n }\n return new Array(4).fill(value) as FullRectTuple;\n}\n","import type { Cell, NodeCell, NodeId } from \"../interfaces\";\nimport { isNodeCell } from \"./asserts\";\n\nexport function findNode(cells: Cell[], id: NodeId): NodeCell | undefined {\n return cells.find((cell) => isNodeCell(cell) && cell.id === id) as\n | NodeCell\n | undefined;\n}\n","import React, { useMemo, useRef } from \"react\";\nimport classNames from \"classnames\";\nimport type {\n Cell,\n ComputedEdgeLineConf,\n EdgeCell,\n NodeView,\n} from \"./interfaces\";\nimport { getDirectLinePoints } from \"../diagram/lines/getDirectLinePoints\";\nimport type { NodeRect } from \"../diagram/interfaces\";\nimport { findNode } from \"./processors/findNode\";\nimport { isEdgeCell } from \"./processors/asserts\";\nimport { DEFAULT_LINE_INTERACT_ANIMATE_DURATION } from \"./constants\";\n\nexport interface EdgeComponentProps {\n edge: EdgeCell;\n cells: Cell[];\n lineConfMap: WeakMap<EdgeCell, ComputedEdgeLineConf>;\n}\n\nexport function EdgeComponent({\n edge,\n cells,\n lineConfMap,\n}: EdgeComponentProps): JSX.Element | null {\n const pathRef = useRef<SVGPathElement>(null);\n const sourceNode = useMemo(\n () => findNode(cells, edge.source),\n [cells, edge.source]\n );\n const targetNode = useMemo(\n () => findNode(cells, edge.target),\n [cells, edge.target]\n );\n const lineConf = useMemo(() => lineConfMap.get(edge)!, [edge, lineConfMap]);\n\n const parallelGap = useMemo(() => {\n const hasOppositeEdge = cells.some(\n (cell) =>\n isEdgeCell(cell) &&\n cell.source === edge.target &&\n cell.target === edge.source\n );\n return hasOppositeEdge ? lineConf.parallelGap : 0;\n }, [cells, edge, lineConf.parallelGap]);\n\n const padding = 5;\n\n const line = useMemo(\n () =>\n sourceNode &&\n targetNode &&\n sourceNode.view.x != null &&\n targetNode.view.x != null\n ? getDirectLinePoints(\n nodeViewToNodeRect(sourceNode.view, padding),\n nodeViewToNodeRect(targetNode.view, padding),\n parallelGap\n )\n : null,\n [parallelGap, sourceNode, targetNode]\n );\n\n if (!line) {\n // This happens when source or target is not found,\n // or when source or target has not been positioned yet.\n return null;\n }\n const d = `M${line[0].x} ${line[0].y}L${line[1].x} ${line[1].y}`;\n return (\n <>\n <path\n // This `path` is made for expanding interaction area of graph lines.\n d={d}\n fill=\"none\"\n stroke=\"transparent\"\n strokeWidth={lineConf.interactStrokeWidth}\n />\n <path\n ref={pathRef}\n className={classNames(\"line\", {\n dashed: lineConf.dashed,\n [`${lineConf.dashed ? \"dashed\" : \"solid\"}-animation`]:\n lineConf.animate.useAnimate,\n })}\n style={\n {\n \"--time\": `${lineConf.animate.duration ?? DEFAULT_LINE_INTERACT_ANIMATE_DURATION}s`,\n \"--solid-length\": pathRef.current?.getTotalLength?.(),\n } as React.CSSProperties\n }\n d={d}\n fill=\"none\"\n stroke={lineConf.strokeColor}\n strokeWidth={lineConf.strokeWidth}\n markerStart={lineConf.showStartArrow ? lineConf.markerArrow : \"\"}\n markerEnd={lineConf.showEndArrow ? lineConf.markerArrow : \"\"}\n />\n <path className=\"line-active-bg\" d={d} fill=\"none\" />\n </>\n );\n}\n\nfunction nodeViewToNodeRect(view: NodeView, padding: number): NodeRect {\n return {\n x: view.x + view.width / 2,\n y: view.y + view.height / 2,\n width: view.width + padding,\n height: view.height + padding,\n };\n}\n","import React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { ReactUseBrick } from \"@next-core/react-runtime\";\nimport { __secret_internals, checkIfByTransform } from \"@next-core/runtime\";\nimport { isEqual } from \"lodash\";\nimport ResizeObserver from \"resize-observer-polyfill\";\nimport type { NodeBrickCell, NodeBrickConf, NodeCell } from \"./interfaces\";\nimport type { SizeTuple } from \"../diagram/interfaces\";\n\nexport interface NodeComponentProps {\n node: NodeCell;\n degraded: boolean;\n degradedNodeLabel?: string;\n defaultNodeBricks?: NodeBrickConf[];\n onResize(id: string, size: SizeTuple | null): void;\n}\n\nexport function NodeComponent({\n node,\n degraded,\n degradedNodeLabel,\n defaultNodeBricks,\n onResize,\n}: NodeComponentProps): JSX.Element | null {\n const memoizedData = useDeepMemo({ node: { id: node.id, data: node.data } });\n const specifiedUseBrick = (node as NodeBrickCell).useBrick;\n const observerRef = useRef<ResizeObserver | null>(null);\n\n const useBrick = useMemo(() => {\n return degraded\n ? null\n : specifiedUseBrick ??\n defaultNodeBricks?.find((item) =>\n checkIfByTransform(item, memoizedData)\n )?.useBrick;\n }, [degraded, specifiedUseBrick, defaultNodeBricks, memoizedData]);\n\n const label = useMemo<string>(\n () =>\n degraded\n ? String(\n __secret_internals.legacyDoTransform(\n memoizedData,\n degradedNodeLabel ?? \"<% DATA.node.id %>\"\n )\n )\n : \"\",\n [degraded, degradedNodeLabel, memoizedData]\n );\n\n const refCallback = useCallback(\n (element: HTMLElement | null) => {\n const prevObserver = observerRef.current;\n if (prevObserver) {\n prevObserver.disconnect();\n observerRef.current = null;\n }\n if (element) {\n // Todo: correctly wait for `useBrick` in v3 to be rendered (after layout)\n // Wait a macro task to let `useBrick` to be rendered.\n setTimeout(() => {\n const observer = new ResizeObserver(() => {\n onResize(node.id, [element.offsetWidth, element.offsetHeight]);\n });\n observer.observe(element);\n observerRef.current = observer;\n });\n } else {\n onResize(node.id, null);\n }\n },\n [node.id, onResize]\n );\n\n const degradedRefCallBack = useCallback(\n (g: SVGGElement | null) => {\n if (g) {\n // istanbul ignore next\n const size =\n process.env.NODE_ENV === \"test\"\n ? { width: 60, height: 60 }\n : g.getBBox();\n onResize(node.id, [size.width, size.height]);\n } else {\n onResize(node.id, null);\n }\n },\n [node.id, onResize]\n );\n\n return useBrick ? (\n <foreignObject\n // Make a large size to avoid the brick inside to be clipped by the foreignObject.\n width={9999}\n height={9999}\n className=\"node\"\n >\n {useBrick && (\n <ReactUseBrick\n useBrick={useBrick}\n data={memoizedData}\n refCallback={refCallback}\n />\n )}\n </foreignObject>\n ) : degraded ? (\n <g className=\"degraded\" ref={degradedRefCallBack}>\n <circle cx={8} cy={8} r={8} />\n <text x={8} y={32}>\n {label}\n </text>\n </g>\n ) : null;\n}\n\nfunction useDeepMemo<T>(value: T): T {\n const [memoizedValue, setMemoizedValue] = useState(value);\n\n useEffect(() => {\n setMemoizedValue((prev) => (isEqual(prev, value) ? prev : value));\n }, [value]);\n\n return memoizedValue;\n}\n","import { pick } from \"lodash\";\nimport type { ActiveTarget, Cell } from \"../interfaces\";\n\nexport function cellToTarget(cell: Cell): ActiveTarget {\n return cell.type === \"edge\"\n ? pick(cell, [\"type\", \"source\", \"target\", \"data\"])\n : pick(cell, [\"type\", \"id\", \"data\"]);\n}\n","import type { PositionTuple } from \"../../diagram/interfaces\";\nimport type { ActiveTarget, Cell, LayoutType } from \"../interfaces\";\nimport type {\n MoveCellPayload,\n ResizeCellPayload,\n} from \"../reducers/interfaces\";\nimport { isEdgeCell, isNodeCell } from \"./asserts\";\nimport { cellToTarget } from \"./cellToTarget\";\n\nexport function handleMouseDown(\n event: MouseEvent,\n {\n action,\n cell,\n scale,\n layout,\n onCellMoving,\n onCellMoved,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n }: {\n action: \"move\" | \"resize\";\n cell: Cell;\n scale: number;\n layout?: LayoutType;\n onCellMoving?(info: MoveCellPayload): void;\n onCellMoved?(info: MoveCellPayload): void;\n onCellResizing?(info: ResizeCellPayload): void;\n onCellResized?(info: ResizeCellPayload): void;\n onSwitchActiveTarget?(activeTarget: ActiveTarget | null): void;\n }\n) {\n event.stopPropagation();\n // Drag node\n onSwitchActiveTarget?.(cellToTarget(cell));\n\n if (\n isEdgeCell(cell) ||\n ((layout === \"force\" || layout === \"dagre\") && isNodeCell(cell))\n ) {\n return;\n }\n\n const from: PositionTuple = [event.clientX, event.clientY];\n const original =\n action === \"move\"\n ? [cell.view.x, cell.view.y]\n : [cell.view.width, cell.view.height];\n\n function getMovement(e: MouseEvent): PositionTuple {\n return [(e.clientX - from[0]) / scale, (e.clientY - from[1]) / scale];\n }\n\n let moved = false;\n\n const handleMove = (e: MouseEvent, finished?: boolean) => {\n // Respect the scale\n const movement = getMovement(e);\n if (!moved) {\n moved = movement[0] ** 2 + movement[1] ** 2 >= 9;\n }\n // const [x, y] = getNewPosition(movement);\n // adjustCellPosition(x, y);\n if (moved) {\n if (action === \"move\") {\n (finished ? onCellMoved : onCellMoving)?.({\n type: cell.type,\n id: cell.id,\n x: original[0] + movement[0],\n y: original[1] + movement[1],\n });\n } else {\n (finished ? onCellResized : onCellResizing)?.({\n type: cell.type,\n id: cell.id,\n width: original[0] + movement[0],\n height: original[1] + movement[1],\n });\n }\n }\n };\n\n const onMouseMove = (e: MouseEvent) => {\n handleMove(e);\n };\n const onMouseUp = (e: MouseEvent) => {\n handleMove(e, true);\n moved = false;\n document.removeEventListener(\"mousemove\", onMouseMove);\n document.removeEventListener(\"mouseup\", onMouseUp);\n };\n document.addEventListener(\"mousemove\", onMouseMove);\n document.addEventListener(\"mouseup\", onMouseUp);\n}\n","import React, { useEffect } from \"react\";\nimport type { BasicDecoratorProps } from \"../interfaces\";\nimport { handleMouseDown } from \"../processors/handleMouseDown\";\n\nexport function DecoratorArea({\n cell,\n transform,\n readOnly,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n}: BasicDecoratorProps): JSX.Element {\n const resizeHandleRef = React.useRef<SVGGElement>(null);\n\n useEffect(() => {\n const resizeHandle = resizeHandleRef.current;\n if (!resizeHandle || readOnly) {\n return;\n }\n const onMouseDown = (event: MouseEvent) => {\n handleMouseDown(event, {\n action: \"resize\",\n cell,\n scale: transform.k,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n });\n };\n resizeHandle.addEventListener(\"mousedown\", onMouseDown);\n return () => {\n resizeHandle.removeEventListener(\"mousedown\", onMouseDown);\n };\n }, [\n cell,\n onCellResized,\n onCellResizing,\n onSwitchActiveTarget,\n readOnly,\n transform.k,\n ]);\n\n return (\n <g className=\"decorator-area\">\n <rect\n width={cell.view.width}\n height={cell.view.height}\n className=\"area\"\n />\n {!readOnly && (\n <g\n ref={resizeHandleRef}\n className=\"resize-handle\"\n transform={`translate(${cell.view.width - 20} ${cell.view.height - 20})`}\n >\n <rect width={20} height={20} />\n <path d=\"M10 18L18 10 M15 18L18 15\" />\n </g>\n )}\n </g>\n );\n}\n","import React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { BasicDecoratorProps } from \"../interfaces\";\nimport classNames from \"classnames\";\n\nexport type DecoratorTextProps = Pick<\n BasicDecoratorProps,\n \"cell\" | \"readOnly\" | \"onDecoratorTextEditing\" | \"onDecoratorTextChange\"\n>;\n\nexport function DecoratorText({\n cell,\n readOnly,\n onDecoratorTextEditing,\n onDecoratorTextChange,\n}: DecoratorTextProps): JSX.Element {\n const label = cell.view.text ?? \"\";\n const [currentLabel, setCurrentLabel] = useState<string>(label);\n const [editingLabel, setEditingLabel] = useState(false);\n const editingLabelInitialized = useRef(false);\n const [shouldEmitLabelChange, setShouldEmitLabelChange] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n\n const handleEnableEdit = useCallback(\n (e: React.MouseEvent) => {\n if (readOnly) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n setEditingLabel(true);\n },\n [readOnly]\n );\n\n useEffect(() => {\n const element = ref.current;\n if (element && element.textContent !== currentLabel) {\n element.textContent = currentLabel;\n }\n }, [currentLabel]);\n\n useEffect(() => {\n if (editingLabel && ref.current) {\n ref.current.focus();\n selectAllText(ref.current);\n }\n onDecoratorTextEditing?.({ id: cell.id, editing: editingLabel });\n }, [cell.id, editingLabel, onDecoratorTextEditing]);\n\n useEffect(() => {\n if (editingLabelInitialized.current) {\n onDecoratorTextEditing?.({ id: cell.id, editing: editingLabel });\n } else {\n editingLabelInitialized.current = true;\n }\n }, [cell.id, editingLabel, onDecoratorTextEditing]);\n\n const handleInput = useCallback(\n (event: React.FormEvent<HTMLDivElement>) => {\n if (readOnly) {\n return;\n }\n setCurrentLabel((event.target as HTMLDivElement).textContent!);\n },\n [readOnly]\n );\n\n const handleBlur = useCallback(() => {\n if (readOnly) {\n return;\n }\n setEditingLabel(false);\n setShouldEmitLabelChange(true);\n }, [readOnly]);\n\n useEffect(() => {\n if (shouldEmitLabelChange) {\n onDecoratorTextChange?.({\n id: cell.id,\n view: { ...cell.view, text: currentLabel },\n });\n setShouldEmitLabelChange(false);\n }\n }, [cell, currentLabel, onDecoratorTextChange, shouldEmitLabelChange]);\n\n return (\n <foreignObject className=\"decorator-text\">\n <div\n className={classNames(\"text-container\", { editing: editingLabel })}\n onDoubleClick={handleEnableEdit}\n >\n <div\n className=\"text\"\n contentEditable={editingLabel}\n ref={ref}\n onInput={handleInput}\n onBlur={handleBlur}\n />\n </div>\n </foreignObject>\n );\n}\n\nfunction selectAllText(element: HTMLElement) {\n const range = document.createRange();\n range.selectNodeContents(element);\n const selection = window.getSelection()!;\n selection.removeAllRanges();\n selection.addRange(range);\n}\n","import React from \"react\";\nimport type { BasicDecoratorProps } from \"../interfaces\";\nimport { DecoratorArea } from \"./DecoratorArea\";\nimport { DecoratorText } from \"./DecoratorText\";\n\nexport function DecoratorComponent({\n cell,\n transform,\n readOnly,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n onDecoratorTextEditing,\n onDecoratorTextChange,\n}: BasicDecoratorProps): JSX.Element | null {\n let SpecifiedComponent: (props: BasicDecoratorProps) => JSX.Element | null;\n\n switch (cell.decorator) {\n case \"area\":\n SpecifiedComponent = DecoratorArea;\n break;\n case \"text\":\n SpecifiedComponent = DecoratorText;\n break;\n // istanbul ignore next\n default:\n // eslint-disable-next-line no-console\n console.error(`Unknown decorator: ${cell.decorator}`);\n return null;\n }\n\n return (\n <SpecifiedComponent\n cell={cell}\n transform={transform}\n readOnly={readOnly}\n onCellResizing={onCellResizing}\n onCellResized={onCellResized}\n onSwitchActiveTarget={onSwitchActiveTarget}\n onDecoratorTextEditing={onDecoratorTextEditing}\n onDecoratorTextChange={onDecoratorTextChange}\n />\n );\n}\n","import React, { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport classNames from \"classnames\";\nimport type {\n ActiveTarget,\n Cell,\n CellContextMenuDetail,\n ComputedEdgeLineConf,\n DecoratorTextChangeDetail,\n EdgeCell,\n LayoutType,\n NodeBrickConf,\n} from \"./interfaces\";\nimport { isDecoratorCell, isEdgeCell, isNodeCell } from \"./processors/asserts\";\nimport { EdgeComponent } from \"./EdgeComponent\";\nimport { NodeComponent } from \"./NodeComponent\";\nimport { handleMouseDown } from \"./processors/handleMouseDown\";\nimport type { MoveCellPayload, ResizeCellPayload } from \"./reducers/interfaces\";\nimport { DecoratorComponent } from \"./decorators\";\nimport { cellToTarget } from \"./processors/cellToTarget\";\nimport type { SizeTuple, TransformLiteral } from \"../diagram/interfaces\";\nimport { sameTarget } from \"./processors/sameTarget\";\n\nexport interface CellComponentProps {\n layout: LayoutType;\n cell: Cell;\n cells: Cell[];\n degraded: boolean;\n degradedNodeLabel?: string;\n defaultNodeBricks?: NodeBrickConf[];\n transform: TransformLiteral;\n lineConfMap: WeakMap<EdgeCell, ComputedEdgeLineConf>;\n active: boolean;\n readOnly?: boolean;\n unrelatedCells: Cell[];\n onCellMoving?(info: MoveCellPayload): void;\n onCellMoved?(info: MoveCellPayload): void;\n onCellResizing?(info: ResizeCellPayload): void;\n onCellResized?(info: ResizeCellPayload): void;\n onSwitchActiveTarget(target: ActiveTarget | null): void;\n onCellContextMenu(detail: CellContextMenuDetail): void;\n onDecoratorTextEditing?(detail: { id: string; editing: boolean }): void;\n onDecoratorTextChange?(detail: DecoratorTextChangeDetail): void;\n onNodeBrickResize(id: string, size: SizeTuple | null): void;\n onCellMouseEnter?(cell: Cell): void;\n onCellMouseLeave?(cell: Cell): void;\n}\n\nexport function CellComponent({\n layout,\n cell,\n cells,\n degraded,\n degradedNodeLabel,\n defaultNodeBricks,\n lineConfMap,\n active,\n readOnly,\n transform,\n unrelatedCells,\n onCellMoving,\n onCellMoved,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n onCellContextMenu,\n onDecoratorTextEditing,\n onDecoratorTextChange,\n onNodeBrickResize,\n onCellMouseEnter,\n onCellMouseLeave,\n}: CellComponentProps): JSX.Element | null {\n const gRef = useRef<SVGGElement>(null);\n\n const unrelated = useMemo(\n () => unrelatedCells.some((item) => sameTarget(item, cell)),\n [cell, unrelatedCells]\n );\n\n useEffect(() => {\n const g = gRef.current;\n if (!g || readOnly) {\n return;\n }\n const onMouseDown = (event: MouseEvent) => {\n handleMouseDown(event, {\n layout,\n action: \"move\",\n cell,\n scale: transform.k,\n onCellMoving,\n onCellMoved,\n onSwitchActiveTarget,\n });\n };\n g.addEventListener(\"mousedown\", onMouseDown);\n return () => {\n g.removeEventListener(\"mousedown\", onMouseDown);\n };\n }, [\n layout,\n cell,\n onCellMoved,\n onCellMoving,\n onSwitchActiveTarget,\n readOnly,\n transform.k,\n ]);\n\n const handleContextMenu = useCallback(\n (event: React.MouseEvent<SVGGElement>) => {\n if (readOnly && cell.type === \"decorator\") {\n return;\n }\n event.preventDefault();\n onSwitchActiveTarget(cellToTarget(cell));\n onCellContextMenu({\n cell,\n clientX: event.clientX,\n clientY: event.clientY,\n });\n },\n [cell, onCellContextMenu, onSwitchActiveTarget, readOnly]\n );\n\n const handleMouseEnter = useCallback(() => {\n onCellMouseEnter?.(cell);\n }, [cell, onCellMouseEnter]);\n\n const handleMouseLeave = useCallback(() => {\n onCellMouseLeave?.(cell);\n }, [cell, onCellMouseLeave]);\n\n return (\n <g\n className={classNames(\"cell\", {\n active,\n faded: unrelated,\n \"read-only\": readOnly,\n })}\n ref={gRef}\n transform={\n cell.type === \"edge\" || cell.view.x == null\n ? undefined\n : `translate(${cell.view.x} ${cell.view.y})`\n }\n onContextMenu={handleContextMenu}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {isNodeCell(cell) ? (\n <NodeComponent\n node={cell}\n degraded={degraded}\n degradedNodeLabel={degradedNodeLabel}\n defaultNodeBricks={defaultNodeBricks}\n onResize={onNodeBrickResize}\n />\n ) : isEdgeCell(cell) ? (\n <EdgeComponent edge={cell} cells={cells} lineConfMap={lineConfMap} />\n ) : isDecoratorCell(cell) ? (\n <DecoratorComponent\n cell={cell}\n transform={transform}\n readOnly={readOnly}\n onCellResizing={onCellResizing}\n onCellResized={onCellResized}\n onSwitchActiveTarget={onSwitchActiveTarget}\n onDecoratorTextEditing={onDecoratorTextEditing}\n onDecoratorTextChange={onDecoratorTextChange}\n />\n ) : null}\n </g>\n );\n}\n","export const SYMBOL_FOR_SIZE_INITIALIZED = Symbol.for(\"size-initialized\");\nexport const SYMBOL_FOR_LAYOUT_INITIALIZED = Symbol.for(\"layout-initialized\");\nexport const DEFAULT_NODE_SIZE = 20;\nexport const DEFAULT_NODE_GAP = 36;\nexport const DEFAULT_AREA_WIDTH = 100;\nexport const DEFAULT_AREA_HEIGHT = 60;\nexport const DEFAULT_SCALE_RANGE_MIN = 0.5;\nexport const DEFAULT_SCALE_RANGE_MAX = 2;\nexport const DEFAULT_LINE_STROKE_COLOR = \"gray\";\nexport const DEFAULT_LINE_STROKE_WIDTH = 1;\nexport const DEFAULT_LINE_INTERACT_STROKE_WIDTH = 15;\nexport const DEFAULT_LINE_INTERACT_SHOW_START_ARROW = false;\nexport const DEFAULT_LINE_INTERACT_SHOW_END_ARROW = true;\nexport const DEFAULT_LINE_INTERACT_ANIMATE_DURATION = 1;\nexport const DEFAULT_DEGRADED_THRESHOLD = 500;\n","import type {\n Cell,\n DecoratorCell,\n EdgeCell,\n InitialCell,\n InitialNodeCell,\n NodeCell,\n} from \"../interfaces\";\n\nexport function isNodeCell(cell: Cell): cell is NodeCell {\n return cell.type === \"node\";\n}\n\nexport function isDecoratorCell(cell: Cell): cell is DecoratorCell {\n return cell.type === \"decorator\";\n}\n\nexport function isInitialNodeCell(cell: InitialCell): cell is InitialNodeCell {\n return cell.type === \"node\";\n}\n\nexport function isEdgeCell(cell: Cell): cell is EdgeCell {\n return cell.type === \"edge\";\n}\n\nexport function isNodeOrEdgeCell(cell: Cell): cell is NodeCell | EdgeCell {\n return cell.type === \"node\" || cell.type === \"edge\";\n}\n","import type { ActiveTarget, Cell, ConnectLineState } from \"../interfaces\";\nimport { sameTarget } from \"./sameTarget\";\n\nexport function getUnrelatedCells(\n cells: Cell[],\n connectLineState: ConnectLineState | null,\n activeTarget: ActiveTarget | null\n): Cell[] {\n const unrelated: Cell[] = [];\n\n if (connectLineState) {\n const existedTargets = new Set<string>();\n for (const cell of cells) {\n if (cell.type === \"edge\" && cell.source === connectLineState.source.id) {\n existedTargets.add(cell.target);\n }\n }\n for (const cell of cells) {\n switch (cell.type) {\n case \"node\":\n if (existedTargets.has(cell.id)) {\n unrelated.push(cell);\n }\n break;\n default:\n unrelated.push(cell);\n }\n }\n } else {\n switch (activeTarget?.type) {\n case \"node\": {\n const nodesMap = new Map<string, Cell>();\n const relatedNodeIds = new Set<string>([activeTarget.id]);\n for (const cell of cells) {\n if (cell.type === \"node\") {\n nodesMap.set(cell.id, cell);\n } else if (cell.type === \"edge\") {\n if (cell.source === activeTarget.id) {\n relatedNodeIds.add(cell.target);\n } else if (cell.target === activeTarget.id) {\n relatedNodeIds.add(cell.source);\n } else {\n unrelated.push(cell);\n }\n } else {\n unrelated.push(cell);\n }\n }\n for (const [id, cell] of nodesMap) {\n if (!relatedNodeIds.has(id)) {\n unrelated.push(cell);\n }\n }\n break;\n }\n\n case \"edge\":\n for (const cell of cells) {\n if (\n !(cell.type === \"edge\"\n ? sameTarget(cell, activeTarget)\n : cell.type === \"node\" &&\n (cell.id === activeTarget.source ||\n cell.id === activeTarget.target))\n ) {\n unrelated.push(cell);\n }\n }\n break;\n\n case \"decorator\":\n for (const cell of cells) {\n if (cell.type !== \"decorator\" || cell.id !== activeTarget.id) {\n unrelated.push(cell);\n }\n }\n break;\n }\n }\n\n return unrelated;\n}\n","import type { SizeTuple } from \"../../diagram/interfaces\";\nimport type { Cell, InitialCell, NodeCell } from \"../interfaces\";\nimport { isInitialNodeCell } from \"./asserts\";\n\nexport function initializeCells(\n initialCells: InitialCell[] | undefined,\n {\n defaultNodeSize,\n }: {\n defaultNodeSize: SizeTuple;\n }\n): Cell[] {\n const originalCells = initialCells ?? [];\n const finalCells: Cell[] = originalCells.map<Cell>((cell) => {\n if (\n !isInitialNodeCell(cell) ||\n (cell.view?.width !== undefined && cell.view?.height !== undefined)\n ) {\n return cell as NodeCell;\n }\n return {\n ...cell,\n view: {\n width: defaultNodeSize[0],\n height: defaultNodeSize[1],\n ...cell.view,\n },\n } as NodeCell;\n });\n return finalCells;\n}\n","import type {\n ActiveTarget,\n ActiveTargetOfEdge,\n ActiveTargetOfNode,\n} from \"../interfaces\";\n\nexport function sameTarget(\n a: ActiveTarget | null | undefined,\n b: ActiveTarget | null | undefined\n): boolean {\n return a\n ? !!b &&\n a.type === b.type &&\n (a.type === \"node\" || a.type === \"decorator\"\n ? a.id === (b as ActiveTargetOfNode).id\n : a.source === (b as ActiveTargetOfEdge).source &&\n a.target === (b as ActiveTargetOfEdge).target)\n : !b;\n}\n","import type { TransformLiteral } from \"../../diagram/interfaces\";\nimport type { Cell } from \"../interfaces\";\nimport { isEdgeCell } from \"./asserts\";\n\nexport interface TransformToCenterOptions {\n canvasWidth: number;\n canvasHeight: number;\n scaleRange?: [min: number, max: number];\n}\n\nexport function transformToCenter(\n cells: Cell[],\n { canvasWidth, canvasHeight, scaleRange }: TransformToCenterOptions\n): TransformLiteral {\n let left = Infinity;\n let top = Infinity;\n let right = -Infinity;\n let bottom = -Infinity;\n let empty = true;\n for (const cell of cells) {\n if (!isEdgeCell(cell)) {\n empty = false;\n const { view } = cell;\n const r = view.x + view.width;\n const b = view.y + view.height;\n if (view.x < left) {\n left = view.x;\n }\n if (r > right) {\n right = r;\n }\n if (view.y < top) {\n top = view.y;\n }\n if (b > bottom) {\n bottom = b;\n }\n }\n }\n\n const width = right - left;\n const height = bottom - top;\n\n const scale =\n scaleRange && !empty && (width > canvasWidth || height > canvasHeight)\n ? Math.max(\n Math.min(canvasWidth / width, canvasHeight / height, scaleRange[1]),\n scaleRange[0]\n )\n : 1;\n\n const x = empty ? 0 : (canvasWidth - width * scale) / 2 - left * scale;\n const y = empty ? 0 : (canvasHeight - height * scale) / 2 - top * scale;\n\n return { x, y, k: scale };\n}\n","import type { Reducer } from \"react\";\nimport type { DrawCanvasAction } from \"./interfaces\";\nimport type { Cell, NodeCell } from \"../interfaces\";\nimport { isNodeCell } from \"../processors/asserts\";\nimport { SYMBOL_FOR_SIZE_INITIALIZED } from \"../constants\";\n\nexport const cells: Reducer<Cell[], DrawCanvasAction> = (state, action) => {\n switch (action.type) {\n case \"drop-node\":\n return insertCellAfter(\n state,\n action.payload,\n (cell) => !(cell.type === \"decorator\" && cell.decorator === \"text\")\n );\n case \"drop-decorator\": {\n if (action.payload.decorator === \"text\") {\n return [...state, action.payload];\n }\n return insertCellAfter(\n state,\n action.payload,\n (cell) => cell.type === \"decorator\" && cell.decorator === \"area\"\n );\n }\n case \"add-nodes\": {\n const index =\n state.findLastIndex(\n (cell) => !(cell.type === \"decorator\" && cell.decorator === \"text\")\n ) + 1;\n return [\n ...state.slice(0, index),\n ...action.payload,\n ...state.slice(index),\n ];\n }\n case \"add-edge\":\n // Add the edge to just next to the previous last edge or area decorator.\n // If not found, append to the start.\n return insertCellAfter(\n state,\n action.payload,\n (cell) =>\n cell.type === \"edge\" ||\n (cell.type === \"decorator\" && cell.decorator === \"area\")\n );\n case \"move-cell\": {\n const { type, id, x, y } = action.payload;\n const index = state.findIndex(\n (cell) => cell.type === type && cell.id === id\n );\n if (index !== -1) {\n const node = state[index] as NodeCell;\n return [\n ...state.slice(0, index),\n { ...node, view: { ...node.view, x, y } },\n ...state.slice(index + 1),\n ];\n }\n return state;\n }\n case \"resize-cell\": {\n const { type, id, width, height } = action.payload;\n const index = state.findIndex(\n (cell) => cell.type === type && cell.id === id\n );\n if (index !== -1) {\n const node = state[index] as NodeCell;\n return [\n ...state.slice(0, index),\n { ...node, view: { ...node.view, width, height } },\n ...state.slice(index + 1),\n ];\n }\n return state;\n }\n case \"update-cells\":\n return action.payload;\n case \"update-node-size\":\n return state.map((cell) =>\n isNodeCell(cell) && cell.id === action.payload.id\n ? {\n ...cell,\n [SYMBOL_FOR_SIZE_INITIALIZED]: true,\n view: action.payload.size\n ? {\n ...cell.view,\n width: action.payload.size[0],\n height: action.payload.size[1],\n }\n : cell.view,\n }\n : cell\n );\n }\n return state;\n};\n\nfunction insertCellAfter(\n cells: Cell[],\n newCell: Cell,\n after: (cell: Cell) => boolean\n) {\n const index = cells.findLastIndex(after) + 1;\n return [...cells.slice(0, index), newCell, ...cells.slice(index)];\n}\n","import { Reducer } from \"react\";\nimport type { DrawCanvasAction, DrawCanvasState } from \"./interfaces\";\nimport { cells } from \"./cells\";\n\ntype ReducersMapObject<S, A> = {\n [K in keyof S]: Reducer<S[K], A>;\n};\n\nfunction combineReducers<S, A>(\n reducers: ReducersMapObject<S, A>\n): Reducer<S, A> {\n return ((state, action) =>\n Object.fromEntries(\n Object.entries<Reducer<any, A>>(reducers).map(([key, value]) => [\n key,\n value(state[key as keyof S], action),\n ])\n )) as Reducer<S, A>;\n}\n\nexport const rootReducer = combineReducers<DrawCanvasState, DrawCanvasAction>({\n cells,\n});\n","import * as React from \"react\";\nconst SvgCenter = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={24} height={24} viewBox=\"0 0 24 24\" {...props}><path d=\"M12 0a.5.5 0 0 1 .5.5v2.013a9.5 9.5 0 0 1 8.987 8.988L23.5 11.5a.5.5 0 0 1 0 1h-2.013a9.5 9.5 0 0 1-8.987 8.987V23.5a.5.5 0 0 1-1 0v-2.013A9.5 9.5 0 0 1 2.514 12.5H.5a.5.5 0 0 1 0-1h2.013A9.5 9.5 0 0 1 11.5 2.514V.5A.5.5 0 0 1 12 0M3.514 11.5H7.5a.5.5 0 0 1 0 1H3.514a8.5 8.5 0 0 0 7.987 7.986L11.5 16.5a.5.5 0 0 1 1 0v3.986a8.5 8.5 0 0 0 7.986-7.986H16.5a.5.5 0 0 1 0-1h3.986A8.5 8.5 0 0 0 12.5 3.515V7.5a.5.5 0 0 1-1 0V3.514a8.5 8.5 0 0 0-7.986 7.987zm8.486-1a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3\" /></svg>;\nexport default SvgCenter;","import * as React from \"react\";\nconst SvgZoomIn = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={128} height={128} className=\"icon\" viewBox=\"0 0 1024 1024\" {...props}><path d=\"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384\" /><path d=\"M744.448 486.4h-204.8V281.6a25.6 25.6 0 1 0-51.2 0v204.8h-204.8a25.6 25.6 0 0 0 0 51.2h204.8v204.8a25.6 25.6 0 0 0 51.2 0V537.6h204.8a25.6 25.6 0 0 0 0-51.2\" /></svg>;\nexport default SvgZoomIn;","import * as React from \"react\";\nconst SvgZoomOut = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={128} height={128} className=\"icon\" viewBox=\"0 0 1024 1024\" {...props}><path d=\"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384\" /><path d=\"M744.448 486.4H280.064a25.6 25.6 0 1 0 0 51.2h464.384a25.6 25.6 0 0 0 0-51.2\" /></svg>;\nexport default SvgZoomOut;","import React, { useCallback, useMemo, useRef } from \"react\";\nimport { ConfigProvider, Slider, theme } from \"antd\";\nimport { StyleProvider, createCache } from \"@ant-design/cssinjs\";\nimport { useCurrentTheme } from \"@next-core/react-runtime\";\nimport type { RangeTuple } from \"../../diagram/interfaces\";\nimport CenterSVG from \"./icons/center.svg\";\nimport ZoomInSVG from \"./icons/zoom-in.svg\";\nimport ZoomOutSVG from \"./icons/zoom-out.svg\";\n\nexport interface ZoomBarComponentProps {\n shadowRoot: ShadowRoot;\n scale: number;\n scaleRange: RangeTuple;\n onZoomChange(value: number): void;\n onReCenter(): void;\n}\n\nexport function ZoomBarComponent({\n shadowRoot,\n scale,\n scaleRange,\n onZoomChange,\n onReCenter,\n}: ZoomBarComponentProps): JSX.Element | null {\n const currentTheme = useCurrentTheme();\n const cache = useMemo(() => createCache(), []);\n const zoomBarRef = useRef<HTMLDivElement | null>(null);\n const min = scaleRange[0] * 100;\n const max = scaleRange[1] * 100;\n const value = scale * 100;\n const step = 5;\n\n const tooltip = useMemo(() => {\n return {\n formatter: (value: number | undefined) => `${value}%`,\n placement: \"left\" as const,\n getPopupContainer: () => zoomBarRef.current!,\n };\n }, []);\n\n const onZoomIn = useCallback(() => {\n onZoomChange(Math.min(value + step, max));\n }, [max, onZoomChange, value]);\n\n const onZoomOut = useCallback(() => {\n onZoomChange(Math.max(value - step, min));\n }, [min, onZoomChange, value]);\n\n return (\n <ConfigProvider\n theme={{\n algorithm:\n currentTheme === \"dark-v2\"\n ? theme.darkAlgorithm\n : theme.defaultAlgorithm,\n }}\n >\n <StyleProvider\n container={shadowRoot}\n // Auto clear injected styles after unmount\n autoClear\n cache={cache}\n // Set hashPriority to \"high\" to disable `:where()` usage for compatibility\n hashPriority=\"high\"\n >\n <div className=\"zoom-bar\" ref={zoomBarRef}>\n <div className=\"center-button\" onClick={onReCenter} role=\"button\">\n <CenterSVG />\n </div>\n <div className=\"zoom-slider\">\n <div className=\"zoom-button\" role=\"button\" onClick={onZoomIn}>\n <ZoomInSVG />\n </div>\n <Slider\n min={min}\n max={max}\n value={value}\n step={step}\n vertical\n included={false}\n tooltip={tooltip}\n onChange={onZoomChange}\n />\n <div className=\"zoom-button\" role=\"button\" onClick={onZoomOut}>\n <ZoomOutSVG />\n </div>\n </div>\n </div>\n </StyleProvider>\n </ConfigProvider>\n );\n}\n","import { pick } from \"lodash\";\nimport dagre from \"@dagrejs/dagre\";\nimport { extractPartialRectTuple } from \"../../diagram/processors/extractPartialRectTuple\";\nimport type {\n Cell,\n ForceNode,\n LayoutOptionsDagre,\n NodeId,\n NodeView,\n} from \"../../draw-canvas/interfaces\";\nimport { isEdgeCell, isNodeCell } from \"../../draw-canvas/processors/asserts\";\nimport type { FullRectTuple } from \"../../diagram/interfaces\";\n\nexport interface DagreLayoutOptions {\n cells: Cell[];\n layoutOptions?: LayoutOptionsDagre;\n}\n\nexport function dagreLayout({ cells, layoutOptions }: DagreLayoutOptions): {\n getNodeView: (id: NodeId) => NodeView;\n nodePaddings: FullRectTuple;\n} {\n const { nodePadding, ...dagreGraphOptions } = {\n nodePadding: 0,\n rankdir: \"TB\",\n ranksep: 50,\n edgesep: 10,\n nodesep: 50,\n // align: undefined,\n ...pick(layoutOptions, [\n \"nodePadding\",\n \"rankdir\",\n \"ranksep\",\n \"edgesep\",\n \"nodesep\",\n \"align\",\n ]),\n };\n const nodePaddings = extractPartialRectTuple(nodePadding);\n\n if (!cells.some(isNodeCell)) {\n // Dagre cannot render empty nodes\n return {\n getNodeView: () => null!,\n nodePaddings,\n };\n }\n\n const graph = new dagre.graphlib.Graph<ForceNode>();\n graph.setGraph(dagreGraphOptions);\n // Default to assigning a new object as a label for each new edge.\n graph.setDefaultEdgeLabel(function () {\n return {};\n });\n for (const cell of cells) {\n if (isNodeCell(cell)) {\n graph.setNode(cell.id, {\n id: cell.id,\n width: cell.view.width + nodePaddings[1] + nodePaddings[3],\n height: cell.view.height + nodePaddings[0] + nodePaddings[2],\n });\n } else if (isEdgeCell(cell)) {\n graph.setEdge(cell.source, cell.target);\n }\n }\n dagre.layout(graph);\n\n return {\n getNodeView: (id: NodeId) => graph.node(id),\n nodePaddings,\n };\n}\n","import { pick } from \"lodash\";\nimport {\n forceCollide,\n forceLink,\n forceManyBody,\n forceSimulation,\n forceX,\n forceY,\n type Simulation,\n} from \"d3-force\";\nimport type {\n Cell,\n ForceCollideOptions,\n ForceLink,\n ForceNode,\n LayoutOptionsForce,\n NodeId,\n NodeView,\n} from \"../../draw-canvas/interfaces\";\nimport { isEdgeCell, isNodeCell } from \"../../draw-canvas/processors/asserts\";\nimport { extractPartialRectTuple } from \"../../diagram/processors/extractPartialRectTuple\";\nimport type { FullRectTuple, PositionTuple } from \"../../diagram/interfaces\";\n\nexport interface ForceLayoutOptions {\n cells: Cell[];\n layoutOptions?: LayoutOptionsForce;\n center?: PositionTuple;\n fixedPosition?: boolean;\n}\n\nexport function forceLayout({\n cells,\n layoutOptions,\n center,\n fixedPosition,\n}: ForceLayoutOptions): {\n getNodeView: (id: NodeId) => NodeView;\n nodePaddings: FullRectTuple;\n} {\n const { nodePadding, collide } = {\n nodePadding: 0,\n ...pick(layoutOptions, [\"nodePadding\"]),\n collide:\n layoutOptions?.collide !== false\n ? ({\n radiusDiff: 18,\n strength: 1,\n iterations: 1,\n ...(layoutOptions?.collide === true\n ? null\n : (layoutOptions?.collide as ForceCollideOptions)),\n } as Required<ForceCollideOptions>)\n : (false as const),\n };\n const nodePaddings = extractPartialRectTuple(nodePadding);\n const forceNodes: ForceNode[] = [];\n const forceLinks: ForceLink[] = [];\n const nodesMap = new Map<NodeId, ForceNode>();\n for (const cell of cells) {\n if (isNodeCell(cell)) {\n const node: ForceNode = {\n id: cell.id,\n width: cell.view.width + nodePaddings[1] + nodePaddings[3],\n height: cell.view.height + nodePaddings[0] + nodePaddings[2],\n ...(fixedPosition ? { fx: cell.view.x, fy: cell.view.y } : null),\n };\n forceNodes.push(node);\n nodesMap.set(node.id, node);\n } else if (isEdgeCell(cell)) {\n forceLinks.push({ source: cell.source, target: cell.target });\n }\n }\n\n const linkSimulation = forceLink<ForceNode, ForceLink>(forceLinks).id(\n (d) => d.id\n );\n const simulation = forceSimulation<ForceNode, ForceLink>(forceNodes)\n .force(\"link\", linkSimulation)\n .force(\"x\", forceX(center?.[0]))\n .force(\"y\", forceY(center?.[1]))\n .force(\"charge\", forceManyBody());\n\n if (collide) {\n simulation.force(\n \"collide\",\n forceCollide<ForceNode>()\n .radius(\n (d) =>\n Math.sqrt(d.width ** 2 + d.height ** 2) / 2 + collide.radiusDiff\n )\n .strength(collide.strength)\n .iterations(collide.iterations)\n );\n }\n\n simulation.stop();\n manuallyTickToTheEnd(simulation);\n\n return {\n getNodeView: (id: NodeId) => nodesMap.get(id) as NodeView,\n nodePaddings,\n };\n}\n\nfunction manuallyTickToTheEnd(\n simulation: Simulation<ForceNode, ForceLink>\n): void {\n // Manually tick to the end.\n simulation.tick(\n Math.ceil(\n Math.log(simulation.alphaMin()) / Math.log(1 - simulation.alphaDecay())\n )\n );\n}\n","import React, { useEffect, useRef, useState } from \"react\";\nimport type { ActiveTarget } from \"../../draw-canvas/interfaces\";\nimport { sameTarget } from \"../../draw-canvas/processors/sameTarget\";\n\nexport interface UseActiveTargetOptions {\n cellsRef: React.RefObject<SVGGElement>;\n activeTarget?: ActiveTarget | null;\n onActiveTargetChange(target: ActiveTarget | null): void;\n}\n\nexport type UseActiveTargetResult = ActiveTarget | null;\n\nexport function useActiveTarget({\n cellsRef,\n activeTarget: _activeTarget,\n onActiveTargetChange,\n}: UseActiveTargetOptions): UseActiveTargetResult {\n const newActiveTarget = _activeTarget ?? null;\n const [activeTarget, setActiveTarget] = useState<ActiveTarget | null>(\n newActiveTarget\n );\n\n useEffect(() => {\n setActiveTarget((previous) =>\n sameTarget(previous, newActiveTarget) ? previous : newActiveTarget\n );\n }, [newActiveTarget]);\n\n const activeTargetChangeInitialized = useRef(false);\n useEffect(() => {\n if (!activeTargetChangeInitialized.current) {\n activeTargetChangeInitialized.current = true;\n return;\n }\n onActiveTargetChange(activeTarget);\n }, [activeTarget, onActiveTargetChange]);\n\n useEffect(() => {\n if (!activeTarget) {\n return;\n }\n const resetActiveTarget = (e: MouseEvent) => {\n const path = e.composedPath();\n const cellsContainerIndex = path.indexOf(cellsRef.current!);\n // Reset active target to null when clicking outside of the cells container,\n // Or inside the cells container but not on any cell.\n if (cellsContainerIndex <= 0) {\n setActiveTarget(null);\n }\n };\n document.addEventListener(\"click\", resetActiveTarget);\n return () => {\n document.removeEventListener(\"click\", resetActiveTarget);\n };\n }, [activeTarget, cellsRef]);\n\n return activeTarget;\n}\n","import { useEffect, useRef, useState } from \"react\";\nimport type { ZoomBehavior } from \"d3-zoom\";\nimport type {\n Cell,\n LayoutOptions,\n LayoutOptionsForce,\n LayoutOptionsDagre,\n LayoutType,\n NodeId,\n NodeView,\n} from \"../../draw-canvas/interfaces\";\nimport type { FullRectTuple, RangeTuple } from \"../../diagram/interfaces\";\nimport { useAutoCenter } from \"./useAutoCenter\";\nimport {\n isNodeCell,\n isNodeOrEdgeCell,\n} from \"../../draw-canvas/processors/asserts\";\nimport {\n SYMBOL_FOR_LAYOUT_INITIALIZED,\n SYMBOL_FOR_SIZE_INITIALIZED,\n} from \"../../draw-canvas/constants\";\nimport type { DrawCanvasAction } from \"../../draw-canvas/reducers/interfaces\";\nimport { forceLayout } from \"./forceLayout\";\nimport { dagreLayout } from \"./dagreLayout\";\n\nexport interface UseLayoutOptions {\n layout: LayoutType;\n layoutOptions?: LayoutOptions;\n rootRef: React.RefObject<SVGSVGElement>;\n cells: Cell[];\n zoomable?: boolean;\n zoomer: ZoomBehavior<SVGSVGElement, unknown>;\n scaleRange: RangeTuple;\n dispatch: (value: DrawCanvasAction) => void;\n}\n\nexport function useLayout({\n layout,\n layoutOptions,\n rootRef,\n cells,\n zoomable,\n zoomer,\n scaleRange,\n dispatch,\n}: UseLayoutOptions) {\n const [layoutInitialized, setLayoutInitialized] = useState(\n layout !== \"force\" && layout !== \"dagre\"\n );\n\n const [centered, setCentered] = useAutoCenter({\n rootRef,\n layoutInitialized,\n cells,\n zoomable,\n zoomer,\n scaleRange,\n });\n\n const previousLayoutRef = useRef<Cell[] | null>(null);\n\n useEffect(() => {\n // Wait for all nodes to be size-initialized before layout.\n if (\n cells.some(\n (cell) => isNodeCell(cell) && !cell[SYMBOL_FOR_SIZE_INITIALIZED]\n )\n ) {\n return;\n }\n\n if (layout !== \"force\" && layout !== \"dagre\") {\n setLayoutInitialized(true);\n return;\n }\n\n // Do not re-layout if nodes and edges not changed.\n if (\n isSameArray(previousLayoutRef.current, cells.filter(isNodeOrEdgeCell))\n ) {\n return;\n }\n\n let getNodeView: (id: NodeId) => NodeView;\n let nodePaddings: FullRectTuple;\n\n if (layout === \"force\") {\n ({ getNodeView, nodePaddings } = forceLayout({\n cells,\n layoutOptions: layoutOptions as LayoutOptionsForce,\n }));\n } else {\n ({ getNodeView, nodePaddings } = dagreLayout({\n cells,\n layoutOptions: layoutOptions as LayoutOptionsDagre,\n }));\n }\n\n const newCells: Cell[] = cells.map((cell) => {\n if (isNodeCell(cell)) {\n const nodeView = getNodeView(cell.id);\n return {\n ...cell,\n view: {\n ...cell.view,\n x: nodeView.x! - nodeView.width / 2 + nodePaddings[3],\n y: nodeView.y! - nodeView.height / 2 + nodePaddings[0],\n },\n [SYMBOL_FOR_LAYOUT_INITIALIZED]: true,\n };\n }\n return cell;\n });\n previousLayoutRef.current = newCells.filter(isNodeOrEdgeCell);\n dispatch({ type: \"update-cells\", payload: newCells });\n\n setCentered(false);\n setLayoutInitialized(true);\n }, [cells, dispatch, layout, layoutOptions, setCentered]);\n\n return { centered, setCentered };\n}\n\nfunction isSameArray<T = unknown>(a: T[] | null, b: T[]): boolean {\n return a?.length === b.length && a.every((v, i) => v === b[i]);\n}\n","import React, { useEffect, useState } from \"react\";\nimport { select } from \"d3-selection\";\nimport { ZoomTransform, type ZoomBehavior } from \"d3-zoom\";\nimport type { RangeTuple } from \"../../diagram/interfaces\";\nimport { SYMBOL_FOR_SIZE_INITIALIZED } from \"../../draw-canvas/constants\";\nimport type { Cell } from \"../../draw-canvas/interfaces\";\nimport {\n isDecoratorCell,\n isNodeCell,\n} from \"../../draw-canvas/processors/asserts\";\nimport { transformToCenter } from \"../../draw-canvas/processors/transformToCenter\";\n\nexport interface UseAutoCenterOptions {\n rootRef: React.RefObject<SVGSVGElement>;\n cells: Cell[];\n layoutInitialized: boolean;\n zoomable?: boolean;\n zoomer: ZoomBehavior<SVGSVGElement, unknown>;\n scaleRange: RangeTuple;\n}\n\nexport type UseAutoCenterResult = [\n centered: boolean,\n setCentered: React.Dispatch<React.SetStateAction<boolean>>,\n];\n\nexport function useAutoCenter({\n rootRef,\n cells,\n layoutInitialized,\n zoomable,\n zoomer,\n scaleRange,\n}: UseAutoCenterOptions): UseAutoCenterResult {\n const [centered, setCentered] = useState(false);\n\n useEffect(() => {\n const root = rootRef.current;\n if (\n !root ||\n !layoutInitialized ||\n centered ||\n !cells.some((cell) => isNodeCell(cell) || isDecoratorCell(cell)) ||\n cells.some(\n (cell) => isNodeCell(cell) && !cell[SYMBOL_FOR_SIZE_INITIALIZED]\n )\n ) {\n return;\n }\n const { k, x, y } = transformToCenter(cells, {\n canvasWidth: root.clientWidth,\n canvasHeight: root.clientHeight,\n scaleRange: zoomable ? scaleRange : undefined,\n });\n // istanbul ignore next\n if (process.env.NODE_ENV !== \"test\") {\n // jsdom doesn't support svg baseVal yet.\n // https://github.com/jsdom/jsdom/issues/2531\n zoomer.transform(select(root), new ZoomTransform(k, x, y));\n }\n setCentered(true);\n }, [\n cells,\n centered,\n layoutInitialized,\n rootRef,\n scaleRange,\n zoomable,\n zoomer,\n ]);\n\n useEffect(() => {\n // Reset auto centering when nodes and decorators are all removed.\n if (!cells.some((cell) => isNodeCell(cell) || isDecoratorCell(cell))) {\n setCentered(false);\n }\n }, [cells]);\n\n return [centered, setCentered];\n}\n","import { useMemo } from \"react\";\nimport { __secret_internals, checkIfByTransform } from \"@next-core/runtime\";\nimport { findIndex, isUndefined, omitBy } from \"lodash\";\nimport type {\n Cell,\n ComputedEdgeLineConf,\n EdgeCell,\n EdgeLineConf,\n LineMarker,\n} from \"../../draw-canvas/interfaces\";\nimport { isEdgeCell } from \"../../draw-canvas/processors/asserts\";\nimport {\n DEFAULT_LINE_STROKE_COLOR,\n DEFAULT_LINE_STROKE_WIDTH,\n DEFAULT_LINE_INTERACT_STROKE_WIDTH,\n DEFAULT_LINE_INTERACT_SHOW_START_ARROW,\n DEFAULT_LINE_INTERACT_SHOW_END_ARROW,\n DEFAULT_LINE_INTERACT_ANIMATE_DURATION,\n} from \"../../draw-canvas/constants\";\n\nexport interface UseLineMarkersOptions {\n cells: Cell[];\n defaultEdgeLines: EdgeLineConf[] | undefined;\n markerPrefix: string;\n}\n\nexport function useLineMarkers({\n cells,\n defaultEdgeLines,\n markerPrefix,\n}: UseLineMarkersOptions): [\n lineConfMap: WeakMap<EdgeCell, ComputedEdgeLineConf>,\n markers: LineMarker[],\n] {\n return useMemo(() => {\n // Always put the default stroke marker at the first position,\n // since the connecting line will use it.\n const markers: LineMarker[] = [{ strokeColor: DEFAULT_LINE_STROKE_COLOR }];\n const map = new WeakMap<EdgeCell, ComputedEdgeLineConf>();\n for (const cell of cells) {\n if (isEdgeCell(cell)) {\n const computedLineConf =\n __secret_internals.legacyDoTransform(\n { edge: cell },\n defaultEdgeLines?.find((item) =>\n checkIfByTransform(item, { edge: cell })\n )\n ) ?? {};\n const lineConf = {\n dashed: false,\n strokeColor: DEFAULT_LINE_STROKE_COLOR,\n strokeWidth: DEFAULT_LINE_STROKE_WIDTH,\n interactStrokeWidth: DEFAULT_LINE_INTERACT_STROKE_WIDTH,\n showStartArrow: DEFAULT_LINE_INTERACT_SHOW_START_ARROW,\n showEndArrow: DEFAULT_LINE_INTERACT_SHOW_END_ARROW,\n animate: {\n useAnimate: false,\n duration: DEFAULT_LINE_INTERACT_ANIMATE_DURATION,\n },\n ...omitBy(computedLineConf, isUndefined),\n } as ComputedEdgeLineConf;\n if (lineConf.parallelGap === undefined) {\n lineConf.parallelGap = lineConf.interactStrokeWidth;\n }\n const markerEndIndex = addMarker(\n { strokeColor: lineConf.strokeColor },\n markers\n );\n lineConf.markerArrow = `url(#${markerPrefix}${markerEndIndex})`;\n map.set(cell, lineConf);\n }\n }\n return [map, markers];\n }, [cells, defaultEdgeLines, markerPrefix]);\n}\n\nfunction addMarker(marker: LineMarker, markers: LineMarker[]): number {\n let markerIndex = findIndex(markers, marker);\n if (markerIndex === -1) {\n markerIndex = markers.push(marker) - 1;\n }\n return markerIndex;\n}\n","import { useMemo } from \"react\";\nimport type { Cell, LayoutType } from \"../../draw-canvas/interfaces\";\nimport { isNodeCell } from \"../../draw-canvas/processors/asserts\";\nimport {\n SYMBOL_FOR_LAYOUT_INITIALIZED,\n SYMBOL_FOR_SIZE_INITIALIZED,\n} from \"../../draw-canvas/constants\";\n\nexport interface UseReadyOptions {\n cells: Cell[];\n layout: LayoutType;\n centered: boolean;\n}\n\nexport function useReady({ cells, layout, centered }: UseReadyOptions) {\n const ready = useMemo(\n () =>\n centered &&\n cells.every(\n (cell) =>\n !isNodeCell(cell) ||\n (cell[SYMBOL_FOR_SIZE_INITIALIZED] &&\n ((layout !== \"force\" && layout !== \"dagre\") ||\n cell[SYMBOL_FOR_LAYOUT_INITIALIZED]))\n ),\n [cells, centered, layout]\n );\n return ready;\n}\n","import React, { useEffect, useMemo, useState } from \"react\";\nimport { select } from \"d3-selection\";\nimport { zoom, type ZoomBehavior } from \"d3-zoom\";\nimport type { RangeTuple, TransformLiteral } from \"../../diagram/interfaces\";\nimport {\n DEFAULT_SCALE_RANGE_MIN,\n DEFAULT_SCALE_RANGE_MAX,\n} from \"../../draw-canvas/constants\";\nimport type { ActiveTarget } from \"../../draw-canvas/interfaces\";\n\nexport interface UseZoomOptions {\n rootRef: React.RefObject<SVGSVGElement>;\n zoomable?: boolean;\n scrollable?: boolean;\n pannable?: boolean;\n scaleRange?: RangeTuple;\n onSwitchActiveTarget?(target: ActiveTarget | null): void;\n}\n\nexport interface UseZoomResult {\n grabbing: boolean;\n transform: TransformLiteral;\n scaleRange: RangeTuple;\n zoomer: ZoomBehavior<SVGSVGElement, unknown>;\n}\n\nexport function useZoom({\n rootRef,\n zoomable,\n scrollable,\n pannable,\n scaleRange: _scaleRange,\n onSwitchActiveTarget,\n}: UseZoomOptions): UseZoomResult {\n const [grabbing, setGrabbing] = useState(false);\n const [transform, setTransform] = useState<TransformLiteral>({\n k: 1,\n x: 0,\n y: 0,\n });\n\n const scaleRange = useMemo(\n () =>\n _scaleRange ??\n ([DEFAULT_SCALE_RANGE_MIN, DEFAULT_SCALE_RANGE_MAX] as RangeTuple),\n [_scaleRange]\n );\n\n const zoomer = useMemo(() => zoom<SVGSVGElement, unknown>(), []);\n\n // istanbul ignore next: d3-zoom currently hard to test\n useEffect(() => {\n let moved = false;\n zoomer\n .scaleExtent(zoomable ? scaleRange : [1, 1])\n .on(\"start\", () => {\n moved = false;\n setGrabbing(true);\n })\n .on(\"zoom\", (e: { transform: TransformLiteral }) => {\n moved = true;\n setTransform(e.transform);\n })\n .on(\"end\", () => {\n setGrabbing(false);\n if (!moved) {\n onSwitchActiveTarget?.(null);\n }\n });\n }, [onSwitchActiveTarget, scaleRange, zoomable, zoomer]);\n\n // istanbul ignore next: d3-zoom currently hard to test\n useEffect(() => {\n const root = rootRef.current;\n if (!root) {\n return;\n }\n\n const rootSelection = select(root);\n\n const unsetZoom = () => {\n rootSelection\n .on(\".zoom\", null)\n .on(\".zoom.custom\", null)\n .on(\"wheel\", null);\n };\n\n if (!(zoomable || scrollable || pannable)) {\n unsetZoom();\n return;\n }\n\n if (zoomable || scrollable) {\n // Do not override default d3 zoom handler.\n // Only handles *panning*\n rootSelection.on(\n \"wheel.zoom.custom\",\n (e: WheelEvent & { wheelDeltaX: number; wheelDeltaY: number }) => {\n // Mac OS trackpad pinch event is emitted as a wheel.zoom and d3.event.ctrlKey set to true\n if (!e.ctrlKey) {\n // Stop immediate propagation for default d3 zoom handler\n e.stopImmediatePropagation();\n if (scrollable) {\n e.preventDefault();\n zoomer.translateBy(\n rootSelection,\n e.wheelDeltaX / 5,\n e.wheelDeltaY / 5\n );\n }\n }\n // zoomer.scaleBy(rootSelection, Math.pow(2, defaultWheelDelta(e)))\n }\n );\n }\n\n rootSelection\n .call(zoomer)\n .on(\"wheel\", (e: WheelEvent) => e.preventDefault())\n .on(\"dblclick.zoom\", null)\n .on(\"mousedown.zoom\", null);\n\n if (!pannable) {\n rootSelection\n .on(\"touchstart.zoom\", null)\n .on(\"touchmove.zoom\", null)\n .on(\"touchend.zoom\", null);\n }\n\n return unsetZoom;\n }, [pannable, rootRef, scrollable, zoomable, zoomer]);\n\n return { grabbing, transform, zoomer, scaleRange };\n}\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.zoom-bar{position:absolute;bottom:20px;right:20px;width:40px}.zoom-slider,\n.center-button{width:100%;display:flex;align-items:center;border:1px solid var(--antd-background-color-base);border-radius:var(--larger-border-radius);box-shadow:var(--connected-overlay-shadow);background-color:var(--color-fill-bg-container-4)}.zoom-slider{height:140px;padding:8px 0;flex-direction:column}[role=\"button\"]{cursor:pointer}.center-button{justify-content:center;margin-bottom:8px;height:40px}.center-button:hover{border-color:var(--antd-btn-default-hover-border-color)}.center-button path{fill:var(--antd-link-hover-color)}.center-button:hover path{fill:var(--palette-blue-7)}.zoom-button{font-size:16px;line-height:0}.zoom-button svg{width:1em;height:1em;fill:var(--antd-link-hover-color)}.zoom-slider .ant-slider-vertical{padding-inline:5px}.zoom-slider .ant-slider-vertical .ant-slider-rail{width:2px}.zoom-slider .ant-slider-vertical .ant-slider-handle{width:6px;height:6px;inset-inline-start:3px}.zoom-slider .ant-slider .ant-slider-handle:hover::before,\n.zoom-slider .ant-slider .ant-slider-handle:focus::before,\n.zoom-slider .ant-slider .ant-slider-handle::before{width:10px;height:10px;inset-inline-start:-2px}.zoom-slider .ant-slider .ant-slider-handle:hover::after,\n.zoom-slider .ant-slider .ant-slider-handle:focus::after,\n.zoom-slider .ant-slider .ant-slider-handle::after{width:6px;height:6px;inset-block-start:0;inset-inline-start:0}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `*{box-sizing:border-box}:host{display:block;position:relative;overflow:hidden;--animation-dasharray:48;--stroke-dashoffset:96;--dasharray:4}:host,\n.root{width:100%;height:100%}:host([hidden]){display:none}.root{opacity:0}.root.ready{opacity:1}.root:focus{outline:none}@keyframes dashedAnimation{0%{stroke-dashoffset:var(--stroke-dashoffset)}to{stroke-dashoffset:0}}@keyframes solidAnimation{to{stroke-dashoffset:0}}.solid-animation{stroke-dasharray:var(--solid-length);stroke-dashoffset:var(--solid-length);animation:solidAnimation var(--time) linear infinite}.dashed-animation{animation:dashedAnimation var(--time) linear infinite}.decorator-area .area{fill:rgba(119,141,195,0.1);stroke:none;stroke-width:0}.node,\n.decorator-text{overflow:visible}.cell.active .decorator-area .area,\n.cell.active .line-active-bg{stroke:var(--palette-blue-5);stroke-dasharray:var(--dasharray);stroke-width:1}.cell:not(.read-only){-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-handle{cursor:nwse-resize;opacity:0}.resize-handle rect{fill:transparent;stroke:none}.resize-handle path{fill:none;stroke:var(--palette-gray-5);stroke-width:1.5}.cell.active .decorator-area .resize-handle,\n.decorator-area:hover .resize-handle{opacity:1}.connect-line{pointer-events:none}.connect-line:not(.connecting){display:none}.line.dashed{stroke-dasharray:var(--dasharray)}.cell.active .decorator-text .text-container{outline:1px dashed var(--palette-blue-5)}.decorator-text .text-container{width:-webkit-max-content;width:-moz-max-content;width:max-content;padding:0.5em}.decorator-text .text:focus{outline:none}.cell.faded{opacity:0.3}.cell .node{pointer-events:none}.cell .node > *{pointer-events:auto}.degraded{pointer-events:bounding-box}.degraded circle{fill:rgb(119,141,195)}.degraded text{text-anchor:middle;fill:var(--antd-text-color)}.cell.active .degraded circle,\n.cell.active .degraded text,\n.degraded:hover circle,\n.degraded:hover text{fill:var(--color-brand)}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n"],"names":["MarkerComponent","_ref","Component","id","type","strokeColor","EntityRelationZeroOrOneMarker","EntityRelationZeroOrManyMarker","ArrowMarker","React","_ref2","viewBox","refX","refY","markerWidth","markerHeight","orient","strokeLinejoin","d","stroke","strokeWidth","fill","_ref3","_ref4","getDirectLinePoints","source","target","parallelGap","doTwoNodesOverlap","p0","p1","xDiff","yDiff","dx","x","dy","y","angle","Math","atan2","cos","PI","sin","line","sourceIntersections","getIntersections","targetIntersections","length","rect","vertices","width","height","possibleLines","i","push","intersections","item","intersection","intersect","x1","y1","x2","y2","x3","y3","x4","y4","denominator","ua","ub","a","b","paddingA","paddingB","A","getNodesWithPadding","B","left","min","right","max","top","bottom","node","padding","extractPartialRectTuple","value","Array","isArray","v0","v1","findNode","cells","find","cell","isNodeCell","EdgeComponent","_lineConf$animate$dur","_pathRef$current","_pathRef$current$getT","edge","lineConfMap","pathRef","useRef","sourceNode","useMemo","targetNode","lineConf","get","some","isEdgeCell","view","nodeViewToNodeRect","concat","interactStrokeWidth","ref","className","classNames","dashed","animate","useAnimate","style","duration","DEFAULT_LINE_INTERACT_ANIMATE_DURATION","current","getTotalLength","call","markerStart","showStartArrow","markerArrow","markerEnd","showEndArrow","NodeComponent","degraded","degradedNodeLabel","defaultNodeBricks","onResize","memoizedData","memoizedValue","setMemoizedValue","useState","useEffect","prev","isEqual","useDeepMemo","data","specifiedUseBrick","useBrick","observerRef","_defaultNodeBricks$fi","checkIfByTransform","label","String","__secret_internals","legacyDoTransform","refCallback","useCallback","element","prevObserver","disconnect","setTimeout","observer","ResizeObserver","offsetWidth","offsetHeight","observe","degradedRefCallBack","g","size","getBBox","ReactUseBrick","cx","cy","r","cellToTarget","pick","handleMouseDown","event","action","scale","layout","onCellMoving","onCellMoved","onCellResizing","onCellResized","onSwitchActiveTarget","stopPropagation","from","clientX","clientY","original","moved","handleMove","e","finished","movement","getMovement","onMouseMove","onMouseUp","document","removeEventListener","addEventListener","DecoratorArea","transform","readOnly","resizeHandleRef","resizeHandle","onMouseDown","k","DecoratorText","_cell$view$text","onDecoratorTextEditing","onDecoratorTextChange","text","currentLabel","setCurrentLabel","editingLabel","setEditingLabel","editingLabelInitialized","shouldEmitLabelChange","setShouldEmitLabelChange","handleEnableEdit","preventDefault","textContent","focus","range","createRange","selectNodeContents","selection","window","getSelection","removeAllRanges","addRange","selectAllText","editing","handleInput","handleBlur","_objectSpread","onDoubleClick","contentEditable","onInput","onBlur","DecoratorComponent","SpecifiedComponent","decorator","console","error","CellComponent","active","unrelatedCells","onCellContextMenu","onNodeBrickResize","onCellMouseEnter","onCellMouseLeave","gRef","unrelated","sameTarget","handleContextMenu","handleMouseEnter","handleMouseLeave","faded","undefined","onContextMenu","onMouseEnter","onMouseLeave","isDecoratorCell","SYMBOL_FOR_SIZE_INITIALIZED","Symbol","for","SYMBOL_FOR_LAYOUT_INITIALIZED","DEFAULT_NODE_SIZE","DEFAULT_NODE_GAP","DEFAULT_AREA_WIDTH","DEFAULT_AREA_HEIGHT","DEFAULT_SCALE_RANGE_MIN","DEFAULT_SCALE_RANGE_MAX","DEFAULT_LINE_STROKE_COLOR","DEFAULT_LINE_STROKE_WIDTH","DEFAULT_LINE_INTERACT_STROKE_WIDTH","DEFAULT_LINE_INTERACT_SHOW_START_ARROW","DEFAULT_LINE_INTERACT_SHOW_END_ARROW","DEFAULT_DEGRADED_THRESHOLD","isInitialNodeCell","isNodeOrEdgeCell","getUnrelatedCells","connectLineState","activeTarget","existedTargets","Set","add","has","nodesMap","Map","relatedNodeIds","set","initializeCells","initialCells","defaultNodeSize","map","_cell$view","_cell$view2","transformToCenter","canvasWidth","canvasHeight","scaleRange","Infinity","empty","insertCellAfter","newCell","after","index","findLastIndex","slice","reducers","rootReducer","state","payload","findIndex","Object","fromEntries","entries","key","props","_extends","xmlns","ZoomBarComponent","shadowRoot","onZoomChange","onReCenter","currentTheme","useCurrentTheme","cache","createCache","zoomBarRef","tooltip","formatter","placement","getPopupContainer","onZoomIn","onZoomOut","ConfigProvider","theme","algorithm","darkAlgorithm","defaultAlgorithm","StyleProvider","container","autoClear","hashPriority","onClick","role","CenterSVG","ZoomInSVG","Slider","step","vertical","included","onChange","ZoomOutSVG","dagreLayout","layoutOptions","_nodePadding$rankdir$","nodePadding","rankdir","ranksep","edgesep","nodesep","dagreGraphOptions","_objectWithoutProperties","_excluded","nodePaddings","getNodeView","graph","dagre","Graph","setGraph","setDefaultEdgeLabel","setNode","setEdge","forceLayout","center","fixedPosition","collide","radiusDiff","strength","iterations","forceNodes","forceLinks","fx","fy","linkSimulation","forceLink","simulation","forceSimulation","force","forceX","forceY","forceManyBody","forceCollide","radius","sqrt","stop","tick","ceil","log","alphaMin","alphaDecay","manuallyTickToTheEnd","useActiveTarget","cellsRef","_activeTarget","onActiveTargetChange","newActiveTarget","setActiveTarget","previous","activeTargetChangeInitialized","resetActiveTarget","composedPath","indexOf","useLayout","rootRef","zoomable","zoomer","dispatch","layoutInitialized","setLayoutInitialized","centered","setCentered","root","clientWidth","clientHeight","select","ZoomTransform","useAutoCenter","previousLayoutRef","filter","every","v","newCells","nodeView","useLineMarkers","defaultEdgeLines","markerPrefix","markers","WeakMap","_loop","_secret_internals$le","computedLineConf","omitBy","isUndefined","markerEndIndex","marker","markerIndex","addMarker","useReady","useZoom","scrollable","pannable","_scaleRange","grabbing","setGrabbing","setTransform","zoom","scaleExtent","on","rootSelection","unsetZoom","ctrlKey","stopImmediatePropagation","translateBy","wheelDeltaX","wheelDeltaY","___CSS_LOADER_EXPORT___","module","toString"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- (()=>{var e,t,r,n,a,o,l,i,c,d,u,s,f,h,p,m,b,v,g,x,y,P={7934:(e,t,r)=>{Promise.all([r.e(5481),r.e(5145),r.e(8769),r.e(1030),r.e(9929),r.e(8299),r.e(8438),r.e(7410),r.e(4993),r.e(709),r.e(7034),r.e(1728)]).then(r.bind(r,1728))}},k={};function w(e){var t=k[e];if(void 0!==t)return t.exports;var r=k[e]={id:e,loaded:!1,exports:{}};return P[e].call(r.exports,r,r.exports,w),r.loaded=!0,r.exports}w.m=P,w.c=k,w.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return w.d(t,{a:t}),t},w.d=(e,t)=>{for(var r in t)w.o(t,r)&&!w.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},w.f={},w.e=e=>Promise.all(Object.keys(w.f).reduce(((t,r)=>(w.f[r](e,t),t)),[])),w.u=e=>"chunks/"+e+"."+{114:"ff6154a0",709:"ecbbe43b",726:"efcf01a2",1030:"d12d7dee",1045:"c6921aed",1122:"aa791e35",1302:"c06bd17d",1370:"1b4ac3ac",1728:"457b3de4",1860:"4fd60630",1889:"c14b28e6",1940:"788d05b3",1972:"d6fea46c",2052:"fa66eafb",2277:"9a1ded28",2617:"7fdfc9fb",3144:"712fb13e",3171:"9f016ea3",3426:"f1ddd917",3436:"48e0e4dd",3933:"0342d0ab",4041:"58c8ed1f",4208:"bc504ba3",4658:"e875061a",4741:"eda28116",4993:"133e50a4",5145:"f606390f",5250:"f7dfb399",5384:"f1a69526",5399:"e2de915e",5481:"d6977dfc",5552:"8099590c",6314:"a17e6cef",6519:"9c35628c",6688:"714d3e8b",6773:"6ac391fe",7034:"286dd8ae",7058:"f8880fe9",7304:"a2d65f45",7410:"fad5932c",7452:"9d465fb5",7721:"5bd46b7f",7733:"7a82300e",7780:"bbd9990e",7862:"4fd520d3",7920:"cc5f2f6b",8299:"4ca8ac4b",8438:"a7e43856",8442:"026d7b4e",8769:"70cc3f88",8989:"cf6586cc",9259:"7e779e4a",9515:"c8266f33",9559:"2729fe3b",9591:"c5101110",9844:"db90776a",9929:"34c83d45"}[e]+".js",w.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),w.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="@next-bricks/diagram:",w.l=(r,n,a,o)=>{if(e[r])e[r].push(n);else{var l,i;if(void 0!==a)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==r||u.getAttribute("data-webpack")==t+a){l=u;break}}l||(i=!0,(l=document.createElement("script")).charset="utf-8",l.timeout=120,w.nc&&l.setAttribute("nonce",w.nc),l.setAttribute("data-webpack",t+a),l.src=r),e[r]=[n];var s=(t,n)=>{l.onerror=l.onload=null,clearTimeout(f);var a=e[r];if(delete e[r],l.parentNode&&l.parentNode.removeChild(l),a&&a.forEach((e=>e(n))),t)return t(n)},f=setTimeout(s.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=s.bind(null,l.onerror),l.onload=s.bind(null,l.onload),i&&document.head.appendChild(l)}},w.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},w.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{w.S={};var e={},t={};w.I=(r,n)=>{n||(n=[]);var a=t[r];if(a||(a=t[r]={}),!(n.indexOf(a)>=0)){if(n.push(a),e[r])return e[r];w.o(w.S,r)||(w.S[r]={});var o=w.S[r],l="@next-bricks/diagram",i=(e,t,r,n)=>{var a=o[e]=o[e]||{},i=a[t];(!i||!i.loaded&&(!n!=!i.eager?n:l>i.from))&&(a[t]={get:r,from:l,eager:!!n})},c=[];return"default"===r&&(i("@babel/parser","7.24.0",(()=>w.e(6773).then((()=>()=>w(6773))))),i("@easyops-cn/brick-next-pipes","0.6.0",(()=>Promise.all([w.e(4741),w.e(1030),w.e(6688)]).then((()=>()=>w(4741))))),i("@next-core/cook","2.2.13",(()=>Promise.all([w.e(1122),w.e(2617)]).then((()=>()=>w(1122))))),i("@next-core/element","1.2.3",(()=>w.e(1045).then((()=>()=>w(1045))))),i("@next-core/http","1.1.10",(()=>w.e(8989).then((()=>()=>w(8989))))),i("@next-core/i18n","1.0.39",(()=>Promise.all([w.e(8438),w.e(7058),w.e(8442),w.e(5552)]).then((()=>()=>w(5552))))),i("@next-core/inject","1.0.29",(()=>Promise.all([w.e(1030),w.e(9259),w.e(2277)]).then((()=>()=>w(2277))))),i("@next-core/loader","1.5.5",(()=>w.e(5399).then((()=>()=>w(7780))))),i("@next-core/pipes","2.0.17",(()=>w.e(6519).then((()=>()=>w(6519))))),i("@next-core/react-element","1.0.22",(()=>Promise.all([w.e(8769),w.e(9929),w.e(4208),w.e(114)]).then((()=>()=>w(114))))),i("@next-core/react-runtime","1.2.3",(()=>Promise.all([w.e(8769),w.e(1030),w.e(7410),w.e(1972)]).then((()=>()=>w(1972))))),i("@next-core/runtime","1.33.0",(()=>Promise.all([w.e(1860),w.e(1030),w.e(8438),w.e(1302),w.e(7058),w.e(7862),w.e(3436),w.e(7920)]).then((()=>()=>w(1860))))),i("@next-core/supply","2.1.12",(()=>Promise.all([w.e(1030),w.e(9259),w.e(1302),w.e(9559)]).then((()=>()=>w(9559))))),i("@next-core/theme","1.4.8",(()=>Promise.all([w.e(1889),w.e(2052)]).then((()=>()=>w(1889))))),i("@next-core/utils/general","1.6.11",(()=>w.e(7452).then((()=>()=>w(7452))))),i("@next-core/utils/storyboard","1.6.11",(()=>Promise.all([w.e(8438),w.e(7862),w.e(3933)]).then((()=>()=>w(3933))))),i("history","4.10.1",(()=>w.e(5384).then((()=>()=>w(5384))))),i("i18next-browser-languagedetector","7.2.0",(()=>w.e(726).then((()=>()=>w(726))))),i("i18next","22.5.1",(()=>w.e(7304).then((()=>()=>w(7304))))),i("js-yaml","3.14.1",(()=>w.e(9515).then((()=>()=>w(9515))))),i("lodash","4.17.21",(()=>w.e(5250).then((()=>()=>w(5250))))),i("moment/locale/zh-cn.js","2.29.4",(()=>Promise.all([w.e(7721),w.e(9844)]).then((()=>()=>w(1329))))),i("moment","2.29.4",(()=>Promise.all([w.e(7721),w.e(9844)]).then((()=>()=>w(9420))))),i("react-dom","0.0.0-experimental-ee8509801-20230117",(()=>Promise.all([w.e(3144),w.e(8769)]).then((()=>()=>w(3144))))),i("react","0.0.0-experimental-ee8509801-20230117",(()=>w.e(4041).then((()=>()=>w(4041)))))),e[r]=c.length?Promise.all(c).then((()=>e[r]=1)):1}}})(),(()=>{var e;w.g.importScripts&&(e=w.g.location+"");var t=w.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),w.p=e+"../"})(),r=e=>{var t=e=>e.split(".").map((e=>+e==e?+e:e)),r=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=r[1]?t(r[1]):[];return r[2]&&(n.length++,n.push.apply(n,t(r[2]))),r[3]&&(n.push([]),n.push.apply(n,t(r[3]))),n},n=(e,t)=>{e=r(e),t=r(t);for(var n=0;;){if(n>=e.length)return n<t.length&&"u"!=(typeof t[n])[0];var a=e[n],o=(typeof a)[0];if(n>=t.length)return"u"==o;var l=t[n],i=(typeof l)[0];if(o!=i)return"o"==o&&"n"==i||"s"==i||"u"==o;if("o"!=o&&"u"!=o&&a!=l)return a<l;n++}},a=e=>{var t=e[0],r="";if(1===e.length)return"*";if(t+.5){r+=0==t?">=":-1==t?"<":1==t?"^":2==t?"~":t>0?"=":"!=";for(var n=1,o=1;o<e.length;o++)n--,r+="u"==(typeof(i=e[o]))[0]?"-":(n>0?".":"")+(n=2,i);return r}var l=[];for(o=1;o<e.length;o++){var i=e[o];l.push(0===i?"not("+c()+")":1===i?"("+c()+" || "+c()+")":2===i?l.pop()+" "+l.pop():a(i))}return c();function c(){return l.pop().replace(/^\((.+)\)$/,"$1")}},o=(e,t)=>{if(0 in e){t=r(t);var n=e[0],a=n<0;a&&(n=-n-1);for(var l=0,i=1,c=!0;;i++,l++){var d,u,s=i<e.length?(typeof e[i])[0]:"";if(l>=t.length||"o"==(u=(typeof(d=t[l]))[0]))return!c||("u"==s?i>n&&!a:""==s!=a);if("u"==u){if(!c||"u"!=s)return!1}else if(c)if(s==u)if(i<=n){if(d!=e[i])return!1}else{if(a?d>e[i]:d<e[i])return!1;d!=e[i]&&(c=!1)}else if("s"!=s&&"n"!=s){if(a||i<=n)return!1;c=!1,i--}else{if(i<=n||u<s!=a)return!1;c=!1}else"s"!=s&&"n"!=s&&(c=!1,i--)}}var f=[],h=f.pop.bind(f);for(l=1;l<e.length;l++){var p=e[l];f.push(1==p?h()|h():2==p?h()&h():p?o(p,t):!h())}return!!h()},l=(e,t)=>{var r=e[t];return(t=Object.keys(r).reduce(((e,t)=>!e||n(e,t)?t:e),0))&&r[t]},i=(e,t)=>{var r=e[t];return Object.keys(r).reduce(((e,t)=>!e||!r[e].loaded&&n(e,t)?t:e),0)},c=(e,t,r,n)=>"Unsatisfied version "+r+" from "+(r&&e[t][r].from)+" of shared singleton module "+t+" (required "+a(n)+")",d=(e,t,r,n)=>{var a=i(e,r);return o(n,a)||s(c(e,r,a,n)),f(e[r][a])},u=(e,t,r)=>{var a=e[t];return(t=Object.keys(a).reduce(((e,t)=>!o(r,t)||e&&!n(e,t)?e:t),0))&&a[t]},s=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},f=e=>(e.loaded=1,e.get()),p=(h=e=>function(t,r,n,a){var o=w.I(t);return o&&o.then?o.then(e.bind(e,t,w.S[t],r,n,a)):e(t,w.S[t],r,n,a)})(((e,t,r,n)=>t&&w.o(t,r)?f(l(t,r)):n())),m=h(((e,t,r,n,a)=>t&&w.o(t,r)?d(t,0,r,n):a())),b=h(((e,t,r,n,a)=>{var o=t&&w.o(t,r)&&u(t,r,n);return o?f(o):a()})),v={},g={8769:()=>b("default","react",[6,0,0,0,,"experimental-ee8509801-20230117"],(()=>w.e(4041).then((()=>()=>w(4041))))),1030:()=>m("default","lodash",[1,4,17,21],(()=>w.e(5250).then((()=>()=>w(5250))))),9929:()=>b("default","@next-core/element",[1,1,2,3],(()=>w.e(3426).then((()=>()=>w(1045))))),330:()=>m("default","@next-core/theme",[1,1,4,8],(()=>w.e(1889).then((()=>()=>w(1889))))),9938:()=>b("default","@next-core/react-element",[1,1,0,22],(()=>Promise.all([w.e(4208),w.e(7733)]).then((()=>()=>w(114))))),8438:()=>m("default","@next-core/utils/general",[1,1,6,11],(()=>w.e(7452).then((()=>()=>w(7452))))),7410:()=>m("default","@next-core/runtime",[1,1,33,0],(()=>Promise.all([w.e(1860),w.e(8438),w.e(1302),w.e(7058),w.e(7862),w.e(3436)]).then((()=>()=>w(1860))))),4993:()=>b("default","@next-core/react-runtime",[1,1,2,3],(()=>w.e(9591).then((()=>()=>w(1972))))),6237:()=>b("default","react-dom",[0,16,9,0],(()=>w.e(3144).then((()=>()=>w(3144))))),3496:()=>m("default","@next-core/http",[1,1,0,6],(()=>w.e(1370).then((()=>()=>w(8989))))),1204:()=>m("default","js-yaml",[1,3,14,0],(()=>w.e(9515).then((()=>()=>w(9515))))),8297:()=>m("default","moment",[1,2,27,0],(()=>Promise.all([w.e(7721),w.e(9844)]).then((()=>()=>w(9420))))),2617:()=>m("default","@babel/parser",[1,7,24,0],(()=>w.e(6773).then((()=>()=>w(6773))))),7058:()=>m("default","@next-core/i18n",[1,1,0,39],(()=>Promise.all([w.e(8442),w.e(3171)]).then((()=>()=>w(5552))))),2350:()=>m("default","i18next",[1,22,5,1],(()=>w.e(7304).then((()=>()=>w(7304))))),6837:()=>m("default","i18next-browser-languagedetector",[1,7,2,0],(()=>w.e(726).then((()=>()=>w(726))))),9259:()=>m("default","@next-core/pipes",[1,2,0,17],(()=>w.e(6519).then((()=>()=>w(6519))))),161:()=>m("default","@easyops-cn/brick-next-pipes",[2,0,6,0],(()=>Promise.all([w.e(4741),w.e(1030),w.e(6688)]).then((()=>()=>w(4741))))),454:()=>p("default","react-dom",(()=>w.e(3144).then((()=>()=>w(3144))))),9435:()=>b("default","react-dom",[6,0,0,0,,"experimental-ee8509801-20230117"],(()=>w.e(3144).then((()=>()=>w(3144))))),1302:()=>m("default","moment",[1,2,30,1],(()=>Promise.all([w.e(7721),w.e(9844)]).then((()=>()=>w(9420))))),5481:()=>m("default","@next-core/cook",[1,2,2,13],(()=>Promise.all([w.e(1122),w.e(2617)]).then((()=>()=>w(1122))))),50:()=>m("default","@next-core/utils/storyboard",[1,1,6,11],(()=>w.e(6314).then((()=>()=>w(3933))))),2890:()=>m("default","history",[1,4,10,1],(()=>w.e(5384).then((()=>()=>w(5384))))),5290:()=>m("default","@next-core/http",[1,1,1,10],(()=>w.e(1370).then((()=>()=>w(8989))))),5435:()=>m("default","@next-core/inject",[1,1,0,29],(()=>Promise.all([w.e(9259),w.e(4658)]).then((()=>()=>w(2277))))),6036:()=>m("default","moment/locale/zh-cn.js",[1,2,30,1],(()=>Promise.all([w.e(7721),w.e(9844)]).then((()=>()=>w(1329))))),6154:()=>m("default","@next-core/loader",[1,1,5,5],(()=>w.e(7780).then((()=>()=>w(7780))))),7731:()=>m("default","@next-core/supply",[1,2,1,12],(()=>Promise.all([w.e(9259),w.e(1940)]).then((()=>()=>w(9559)))))},x={709:[6237],1030:[1030],1302:[1302],2617:[2617],3436:[50,2890,5290,5435,6036,6154,7731],4208:[454,9435],4993:[4993],6519:[161],6688:[1204,8297],7034:[3496],7058:[7058],7410:[7410],7862:[5481],8299:[330,9938],8438:[8438],8442:[2350,6837],8769:[8769],9259:[9259],9929:[9929]},y={},w.f.consumes=(e,t)=>{w.o(x,e)&&x[e].forEach((e=>{if(w.o(v,e))return t.push(v[e]);if(!y[e]){var r=t=>{v[e]=0,w.m[e]=r=>{delete w.c[e],r.exports=t()}};y[e]=!0;var n=t=>{delete v[e],w.m[e]=r=>{throw delete w.c[e],t}};try{var a=g[e]();a.then?t.push(v[e]=a.then(r).catch(n)):r(a)}catch(e){n(e)}}}))},(()=>{var e={8792:0};w.f.j=(t,r)=>{var n=w.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else if(/^(7(058|410|862)|8(299|438|442|769)|1030|1302|2617|3436|4208|4993|6688|9259|9929)$/.test(t))e[t]=0;else{var a=new Promise(((r,a)=>n=e[t]=[r,a]));r.push(n[2]=a);var o=w.p+w.u(t),l=new Error;w.l(o,(r=>{if(w.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var a=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;l.message="Loading chunk "+t+" failed.\n("+a+": "+o+")",l.name="ChunkLoadError",l.type=a,l.request=o,n[1](l)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,a,[o,l,i]=r,c=0;if(o.some((t=>0!==e[t]))){for(n in l)w.o(l,n)&&(w.m[n]=l[n]);i&&i(w)}for(t&&t(r);c<o.length;c++)a=o[c],w.o(e,a)&&e[a]&&e[a][0](),e[a]=0},r=self.webpackChunk_next_bricks_diagram=self.webpackChunk_next_bricks_diagram||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),w.nc=void 0,w(7934)})();
2
- //# sourceMappingURL=main.0ebe4020.js.map
1
+ (()=>{var e,t,r,n,a,o,l,i,c,d,u,s,f,h,p,m,b,v,g,x,y,P={7934:(e,t,r)=>{Promise.all([r.e(5481),r.e(5145),r.e(8769),r.e(1030),r.e(9929),r.e(8299),r.e(8438),r.e(7410),r.e(4993),r.e(709),r.e(7034),r.e(1728)]).then(r.bind(r,1728))}},k={};function w(e){var t=k[e];if(void 0!==t)return t.exports;var r=k[e]={id:e,loaded:!1,exports:{}};return P[e].call(r.exports,r,r.exports,w),r.loaded=!0,r.exports}w.m=P,w.c=k,w.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return w.d(t,{a:t}),t},w.d=(e,t)=>{for(var r in t)w.o(t,r)&&!w.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},w.f={},w.e=e=>Promise.all(Object.keys(w.f).reduce(((t,r)=>(w.f[r](e,t),t)),[])),w.u=e=>"chunks/"+e+"."+{114:"ff6154a0",709:"29f69a6d",726:"efcf01a2",1030:"d12d7dee",1045:"c6921aed",1122:"aa791e35",1302:"c06bd17d",1370:"1b4ac3ac",1728:"457b3de4",1860:"4fd60630",1889:"c14b28e6",1940:"788d05b3",1972:"d6fea46c",2052:"fa66eafb",2277:"9a1ded28",2617:"7fdfc9fb",3144:"712fb13e",3171:"9f016ea3",3426:"f1ddd917",3436:"48e0e4dd",3933:"0342d0ab",4041:"58c8ed1f",4208:"bc504ba3",4658:"e875061a",4741:"eda28116",4993:"133e50a4",5145:"f606390f",5250:"f7dfb399",5384:"f1a69526",5399:"e2de915e",5481:"d6977dfc",5552:"8099590c",6314:"a17e6cef",6519:"9c35628c",6688:"714d3e8b",6773:"6ac391fe",7034:"286dd8ae",7058:"f8880fe9",7304:"a2d65f45",7410:"fad5932c",7452:"9d465fb5",7721:"5bd46b7f",7733:"7a82300e",7780:"bbd9990e",7862:"4fd520d3",7920:"cc5f2f6b",8299:"4ca8ac4b",8438:"a7e43856",8442:"026d7b4e",8769:"70cc3f88",8989:"cf6586cc",9259:"7e779e4a",9515:"c8266f33",9559:"2729fe3b",9591:"c5101110",9844:"db90776a",9929:"34c83d45"}[e]+".js",w.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),w.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="@next-bricks/diagram:",w.l=(r,n,a,o)=>{if(e[r])e[r].push(n);else{var l,i;if(void 0!==a)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==r||u.getAttribute("data-webpack")==t+a){l=u;break}}l||(i=!0,(l=document.createElement("script")).charset="utf-8",l.timeout=120,w.nc&&l.setAttribute("nonce",w.nc),l.setAttribute("data-webpack",t+a),l.src=r),e[r]=[n];var s=(t,n)=>{l.onerror=l.onload=null,clearTimeout(f);var a=e[r];if(delete e[r],l.parentNode&&l.parentNode.removeChild(l),a&&a.forEach((e=>e(n))),t)return t(n)},f=setTimeout(s.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=s.bind(null,l.onerror),l.onload=s.bind(null,l.onload),i&&document.head.appendChild(l)}},w.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},w.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{w.S={};var e={},t={};w.I=(r,n)=>{n||(n=[]);var a=t[r];if(a||(a=t[r]={}),!(n.indexOf(a)>=0)){if(n.push(a),e[r])return e[r];w.o(w.S,r)||(w.S[r]={});var o=w.S[r],l="@next-bricks/diagram",i=(e,t,r,n)=>{var a=o[e]=o[e]||{},i=a[t];(!i||!i.loaded&&(!n!=!i.eager?n:l>i.from))&&(a[t]={get:r,from:l,eager:!!n})},c=[];return"default"===r&&(i("@babel/parser","7.24.0",(()=>w.e(6773).then((()=>()=>w(6773))))),i("@easyops-cn/brick-next-pipes","0.6.0",(()=>Promise.all([w.e(4741),w.e(1030),w.e(6688)]).then((()=>()=>w(4741))))),i("@next-core/cook","2.2.13",(()=>Promise.all([w.e(1122),w.e(2617)]).then((()=>()=>w(1122))))),i("@next-core/element","1.2.3",(()=>w.e(1045).then((()=>()=>w(1045))))),i("@next-core/http","1.1.10",(()=>w.e(8989).then((()=>()=>w(8989))))),i("@next-core/i18n","1.0.39",(()=>Promise.all([w.e(8438),w.e(7058),w.e(8442),w.e(5552)]).then((()=>()=>w(5552))))),i("@next-core/inject","1.0.29",(()=>Promise.all([w.e(1030),w.e(9259),w.e(2277)]).then((()=>()=>w(2277))))),i("@next-core/loader","1.5.5",(()=>w.e(5399).then((()=>()=>w(7780))))),i("@next-core/pipes","2.0.17",(()=>w.e(6519).then((()=>()=>w(6519))))),i("@next-core/react-element","1.0.22",(()=>Promise.all([w.e(8769),w.e(9929),w.e(4208),w.e(114)]).then((()=>()=>w(114))))),i("@next-core/react-runtime","1.2.3",(()=>Promise.all([w.e(8769),w.e(1030),w.e(7410),w.e(1972)]).then((()=>()=>w(1972))))),i("@next-core/runtime","1.33.0",(()=>Promise.all([w.e(1860),w.e(1030),w.e(8438),w.e(1302),w.e(7058),w.e(7862),w.e(3436),w.e(7920)]).then((()=>()=>w(1860))))),i("@next-core/supply","2.1.12",(()=>Promise.all([w.e(1030),w.e(9259),w.e(1302),w.e(9559)]).then((()=>()=>w(9559))))),i("@next-core/theme","1.4.8",(()=>Promise.all([w.e(1889),w.e(2052)]).then((()=>()=>w(1889))))),i("@next-core/utils/general","1.6.11",(()=>w.e(7452).then((()=>()=>w(7452))))),i("@next-core/utils/storyboard","1.6.11",(()=>Promise.all([w.e(8438),w.e(7862),w.e(3933)]).then((()=>()=>w(3933))))),i("history","4.10.1",(()=>w.e(5384).then((()=>()=>w(5384))))),i("i18next-browser-languagedetector","7.2.0",(()=>w.e(726).then((()=>()=>w(726))))),i("i18next","22.5.1",(()=>w.e(7304).then((()=>()=>w(7304))))),i("js-yaml","3.14.1",(()=>w.e(9515).then((()=>()=>w(9515))))),i("lodash","4.17.21",(()=>w.e(5250).then((()=>()=>w(5250))))),i("moment/locale/zh-cn.js","2.29.4",(()=>Promise.all([w.e(7721),w.e(9844)]).then((()=>()=>w(1329))))),i("moment","2.29.4",(()=>Promise.all([w.e(7721),w.e(9844)]).then((()=>()=>w(9420))))),i("react-dom","0.0.0-experimental-ee8509801-20230117",(()=>Promise.all([w.e(3144),w.e(8769)]).then((()=>()=>w(3144))))),i("react","0.0.0-experimental-ee8509801-20230117",(()=>w.e(4041).then((()=>()=>w(4041)))))),e[r]=c.length?Promise.all(c).then((()=>e[r]=1)):1}}})(),(()=>{var e;w.g.importScripts&&(e=w.g.location+"");var t=w.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),w.p=e+"../"})(),r=e=>{var t=e=>e.split(".").map((e=>+e==e?+e:e)),r=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=r[1]?t(r[1]):[];return r[2]&&(n.length++,n.push.apply(n,t(r[2]))),r[3]&&(n.push([]),n.push.apply(n,t(r[3]))),n},n=(e,t)=>{e=r(e),t=r(t);for(var n=0;;){if(n>=e.length)return n<t.length&&"u"!=(typeof t[n])[0];var a=e[n],o=(typeof a)[0];if(n>=t.length)return"u"==o;var l=t[n],i=(typeof l)[0];if(o!=i)return"o"==o&&"n"==i||"s"==i||"u"==o;if("o"!=o&&"u"!=o&&a!=l)return a<l;n++}},a=e=>{var t=e[0],r="";if(1===e.length)return"*";if(t+.5){r+=0==t?">=":-1==t?"<":1==t?"^":2==t?"~":t>0?"=":"!=";for(var n=1,o=1;o<e.length;o++)n--,r+="u"==(typeof(i=e[o]))[0]?"-":(n>0?".":"")+(n=2,i);return r}var l=[];for(o=1;o<e.length;o++){var i=e[o];l.push(0===i?"not("+c()+")":1===i?"("+c()+" || "+c()+")":2===i?l.pop()+" "+l.pop():a(i))}return c();function c(){return l.pop().replace(/^\((.+)\)$/,"$1")}},o=(e,t)=>{if(0 in e){t=r(t);var n=e[0],a=n<0;a&&(n=-n-1);for(var l=0,i=1,c=!0;;i++,l++){var d,u,s=i<e.length?(typeof e[i])[0]:"";if(l>=t.length||"o"==(u=(typeof(d=t[l]))[0]))return!c||("u"==s?i>n&&!a:""==s!=a);if("u"==u){if(!c||"u"!=s)return!1}else if(c)if(s==u)if(i<=n){if(d!=e[i])return!1}else{if(a?d>e[i]:d<e[i])return!1;d!=e[i]&&(c=!1)}else if("s"!=s&&"n"!=s){if(a||i<=n)return!1;c=!1,i--}else{if(i<=n||u<s!=a)return!1;c=!1}else"s"!=s&&"n"!=s&&(c=!1,i--)}}var f=[],h=f.pop.bind(f);for(l=1;l<e.length;l++){var p=e[l];f.push(1==p?h()|h():2==p?h()&h():p?o(p,t):!h())}return!!h()},l=(e,t)=>{var r=e[t];return(t=Object.keys(r).reduce(((e,t)=>!e||n(e,t)?t:e),0))&&r[t]},i=(e,t)=>{var r=e[t];return Object.keys(r).reduce(((e,t)=>!e||!r[e].loaded&&n(e,t)?t:e),0)},c=(e,t,r,n)=>"Unsatisfied version "+r+" from "+(r&&e[t][r].from)+" of shared singleton module "+t+" (required "+a(n)+")",d=(e,t,r,n)=>{var a=i(e,r);return o(n,a)||s(c(e,r,a,n)),f(e[r][a])},u=(e,t,r)=>{var a=e[t];return(t=Object.keys(a).reduce(((e,t)=>!o(r,t)||e&&!n(e,t)?e:t),0))&&a[t]},s=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},f=e=>(e.loaded=1,e.get()),p=(h=e=>function(t,r,n,a){var o=w.I(t);return o&&o.then?o.then(e.bind(e,t,w.S[t],r,n,a)):e(t,w.S[t],r,n,a)})(((e,t,r,n)=>t&&w.o(t,r)?f(l(t,r)):n())),m=h(((e,t,r,n,a)=>t&&w.o(t,r)?d(t,0,r,n):a())),b=h(((e,t,r,n,a)=>{var o=t&&w.o(t,r)&&u(t,r,n);return o?f(o):a()})),v={},g={8769:()=>b("default","react",[6,0,0,0,,"experimental-ee8509801-20230117"],(()=>w.e(4041).then((()=>()=>w(4041))))),1030:()=>m("default","lodash",[1,4,17,21],(()=>w.e(5250).then((()=>()=>w(5250))))),9929:()=>b("default","@next-core/element",[1,1,2,3],(()=>w.e(3426).then((()=>()=>w(1045))))),330:()=>m("default","@next-core/theme",[1,1,4,8],(()=>w.e(1889).then((()=>()=>w(1889))))),9938:()=>b("default","@next-core/react-element",[1,1,0,22],(()=>Promise.all([w.e(4208),w.e(7733)]).then((()=>()=>w(114))))),8438:()=>m("default","@next-core/utils/general",[1,1,6,11],(()=>w.e(7452).then((()=>()=>w(7452))))),7410:()=>m("default","@next-core/runtime",[1,1,33,0],(()=>Promise.all([w.e(1860),w.e(8438),w.e(1302),w.e(7058),w.e(7862),w.e(3436)]).then((()=>()=>w(1860))))),4993:()=>b("default","@next-core/react-runtime",[1,1,2,3],(()=>w.e(9591).then((()=>()=>w(1972))))),6237:()=>b("default","react-dom",[0,16,9,0],(()=>w.e(3144).then((()=>()=>w(3144))))),3496:()=>m("default","@next-core/http",[1,1,0,6],(()=>w.e(1370).then((()=>()=>w(8989))))),1204:()=>m("default","js-yaml",[1,3,14,0],(()=>w.e(9515).then((()=>()=>w(9515))))),8297:()=>m("default","moment",[1,2,27,0],(()=>Promise.all([w.e(7721),w.e(9844)]).then((()=>()=>w(9420))))),2617:()=>m("default","@babel/parser",[1,7,24,0],(()=>w.e(6773).then((()=>()=>w(6773))))),7058:()=>m("default","@next-core/i18n",[1,1,0,39],(()=>Promise.all([w.e(8442),w.e(3171)]).then((()=>()=>w(5552))))),2350:()=>m("default","i18next",[1,22,5,1],(()=>w.e(7304).then((()=>()=>w(7304))))),6837:()=>m("default","i18next-browser-languagedetector",[1,7,2,0],(()=>w.e(726).then((()=>()=>w(726))))),9259:()=>m("default","@next-core/pipes",[1,2,0,17],(()=>w.e(6519).then((()=>()=>w(6519))))),161:()=>m("default","@easyops-cn/brick-next-pipes",[2,0,6,0],(()=>Promise.all([w.e(4741),w.e(1030),w.e(6688)]).then((()=>()=>w(4741))))),454:()=>p("default","react-dom",(()=>w.e(3144).then((()=>()=>w(3144))))),9435:()=>b("default","react-dom",[6,0,0,0,,"experimental-ee8509801-20230117"],(()=>w.e(3144).then((()=>()=>w(3144))))),1302:()=>m("default","moment",[1,2,30,1],(()=>Promise.all([w.e(7721),w.e(9844)]).then((()=>()=>w(9420))))),5481:()=>m("default","@next-core/cook",[1,2,2,13],(()=>Promise.all([w.e(1122),w.e(2617)]).then((()=>()=>w(1122))))),50:()=>m("default","@next-core/utils/storyboard",[1,1,6,11],(()=>w.e(6314).then((()=>()=>w(3933))))),2890:()=>m("default","history",[1,4,10,1],(()=>w.e(5384).then((()=>()=>w(5384))))),5290:()=>m("default","@next-core/http",[1,1,1,10],(()=>w.e(1370).then((()=>()=>w(8989))))),5435:()=>m("default","@next-core/inject",[1,1,0,29],(()=>Promise.all([w.e(9259),w.e(4658)]).then((()=>()=>w(2277))))),6036:()=>m("default","moment/locale/zh-cn.js",[1,2,30,1],(()=>Promise.all([w.e(7721),w.e(9844)]).then((()=>()=>w(1329))))),6154:()=>m("default","@next-core/loader",[1,1,5,5],(()=>w.e(7780).then((()=>()=>w(7780))))),7731:()=>m("default","@next-core/supply",[1,2,1,12],(()=>Promise.all([w.e(9259),w.e(1940)]).then((()=>()=>w(9559)))))},x={709:[6237],1030:[1030],1302:[1302],2617:[2617],3436:[50,2890,5290,5435,6036,6154,7731],4208:[454,9435],4993:[4993],6519:[161],6688:[1204,8297],7034:[3496],7058:[7058],7410:[7410],7862:[5481],8299:[330,9938],8438:[8438],8442:[2350,6837],8769:[8769],9259:[9259],9929:[9929]},y={},w.f.consumes=(e,t)=>{w.o(x,e)&&x[e].forEach((e=>{if(w.o(v,e))return t.push(v[e]);if(!y[e]){var r=t=>{v[e]=0,w.m[e]=r=>{delete w.c[e],r.exports=t()}};y[e]=!0;var n=t=>{delete v[e],w.m[e]=r=>{throw delete w.c[e],t}};try{var a=g[e]();a.then?t.push(v[e]=a.then(r).catch(n)):r(a)}catch(e){n(e)}}}))},(()=>{var e={8792:0};w.f.j=(t,r)=>{var n=w.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else if(/^(7(058|410|862)|8(299|438|442|769)|1030|1302|2617|3436|4208|4993|6688|9259|9929)$/.test(t))e[t]=0;else{var a=new Promise(((r,a)=>n=e[t]=[r,a]));r.push(n[2]=a);var o=w.p+w.u(t),l=new Error;w.l(o,(r=>{if(w.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var a=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;l.message="Loading chunk "+t+" failed.\n("+a+": "+o+")",l.name="ChunkLoadError",l.type=a,l.request=o,n[1](l)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,a,[o,l,i]=r,c=0;if(o.some((t=>0!==e[t]))){for(n in l)w.o(l,n)&&(w.m[n]=l[n]);i&&i(w)}for(t&&t(r);c<o.length;c++)a=o[c],w.o(e,a)&&e[a]&&e[a][0](),e[a]=0},r=self.webpackChunk_next_bricks_diagram=self.webpackChunk_next_bricks_diagram||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),w.nc=void 0,w(7934)})();
2
+ //# sourceMappingURL=main.865d31e9.js.map