cc-viewer 1.6.169 → 1.6.170
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/assets/App-CfOIPiDq.js +31 -0
- package/dist/assets/{AppHeader-qxiNe89i.css → AppHeader-CD1LoQFH.css} +1 -1
- package/dist/assets/AppHeader.module-DHXM8uX4.js +573 -0
- package/dist/assets/Mobile-IUmfFn7s.js +10 -0
- package/dist/assets/{_baseUniq-43cnlw-r.js → _baseUniq-D6Dbc4N3.js} +1 -1
- package/dist/assets/{arc-BUFs6PQm.js → arc-Be9cFTfb.js} +1 -1
- package/dist/assets/architectureDiagram-Q4EWVU46-DOO5RyJR.js +36 -0
- package/dist/assets/{blockDiagram-DXYQGD6D-DSbymKNU.js → blockDiagram-DXYQGD6D-m-5J34Vp.js} +2 -2
- package/dist/assets/{c4Diagram-AHTNJAMY-DMeT4sOi.js → c4Diagram-AHTNJAMY-BFstdX1h.js} +2 -2
- package/dist/assets/channel-DnAzJ7CN.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-BFxgafgd.js → chunk-4BX2VUAB-DBjN6Nmb.js} +1 -1
- package/dist/assets/{chunk-4TB4RGXK-iBjZne-i.js → chunk-4TB4RGXK-CJ1UBmKy.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-BHoL99Rv.js → chunk-55IACEB6-DcP2Ywaa.js} +1 -1
- package/dist/assets/{chunk-EDXVE4YY-BleRGeR6.js → chunk-EDXVE4YY-C9u_Qu6k.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-xfDsv2e3.js → chunk-FMBD7UC4-P9sUuxuw.js} +1 -1
- package/dist/assets/{chunk-OYMX7WX6-Bd0Q_7rX.js → chunk-OYMX7WX6-DeK8H9Lg.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-CAsA3yuO.js → chunk-QZHKN3VN-Bp_oT86x.js} +1 -1
- package/dist/assets/{chunk-YZCP3GAM-koDLBRDb.js → chunk-YZCP3GAM-CTz-Oe5O.js} +1 -1
- package/dist/assets/classDiagram-6PBFFD2Q-Df444ic1.js +1 -0
- package/dist/assets/classDiagram-v2-HSJHXN6E-Df444ic1.js +1 -0
- package/dist/assets/clone-Bri6E_MA.js +1 -0
- package/dist/assets/cose-bilkent-S5V4N54A-CQVGzNj4.js +1 -0
- package/dist/assets/dagre-KV5264BT-CAHpeAXp.js +4 -0
- package/dist/assets/diagram-5BDNPKRD-D3rGqXSL.js +10 -0
- package/dist/assets/diagram-G4DWMVQ6-K8h5h7VF.js +24 -0
- package/dist/assets/diagram-MMDJMWI5-j720zgiT.js +43 -0
- package/dist/assets/diagram-TYMM5635-CBYSGhBB.js +24 -0
- package/dist/assets/{erDiagram-SMLLAGMA-Dbl3_DA5.js → erDiagram-SMLLAGMA-BQTrA6Tc.js} +2 -2
- package/dist/assets/{flowDiagram-DWJPFMVM-uZ6AjhW3.js → flowDiagram-DWJPFMVM-CZg97aSv.js} +2 -2
- package/dist/assets/ganttDiagram-T4ZO3ILL-DIuv3Au2.js +292 -0
- package/dist/assets/gitGraphDiagram-UUTBAWPF-DvkYDJ0s.js +106 -0
- package/dist/assets/{graph-DMOJ-VX2.js → graph-Lnx__Lyt.js} +1 -1
- package/dist/assets/index-ff2575s8.js +2 -0
- package/dist/assets/infoDiagram-42DDH7IO-C4JMVh3d.js +2 -0
- package/dist/assets/{ishikawaDiagram-UXIWVN3A-CA3nFN3p.js → ishikawaDiagram-UXIWVN3A-CH-O13aW.js} +6 -6
- package/dist/assets/{journeyDiagram-VCZTEJTY-d9xsZ8Yd.js → journeyDiagram-VCZTEJTY-DZqRMmvA.js} +2 -2
- package/dist/assets/{kanban-definition-6JOO6SKY-D3bsT_7v.js → kanban-definition-6JOO6SKY-DLyWnccM.js} +2 -2
- package/dist/assets/{layout-DuO7IWHx.js → layout-CqSp2cTI.js} +1 -1
- package/dist/assets/{linear-B928iyZ_.js → linear-D1mqKDtE.js} +1 -1
- package/dist/assets/mermaid.core-D7FfZh5D.js +308 -0
- package/dist/assets/{min-CgMHjcOo.js → min-BFUJ96qc.js} +1 -1
- package/dist/assets/{mindmap-definition-QFDTVHPH-BkMM9jUI.js → mindmap-definition-QFDTVHPH-xyOCObn4.js} +2 -2
- package/dist/assets/{pieDiagram-DEJITSTG-HgCMufe4.js → pieDiagram-DEJITSTG-D92rKjne.js} +2 -2
- package/dist/assets/{quadrantDiagram-34T5L4WZ-Ced0pZFH.js → quadrantDiagram-34T5L4WZ-Ci04_fEs.js} +4 -4
- package/dist/assets/{requirementDiagram-MS252O5E-BnPPJ2sr.js → requirementDiagram-MS252O5E-CAfBGLcR.js} +4 -4
- package/dist/assets/sankeyDiagram-XADWPNL6-CWG3LA4J.js +10 -0
- package/dist/assets/{sequenceDiagram-FGHM5R23-yrmTmDlx.js → sequenceDiagram-FGHM5R23-CW4og4ZV.js} +2 -2
- package/dist/assets/stateDiagram-FHFEXIEX-NyWK-fZL.js +1 -0
- package/dist/assets/stateDiagram-v2-QKLJ7IA2-LznEMt1C.js +1 -0
- package/dist/assets/{timeline-definition-GMOUNBTQ-CA-9LnCz.js → timeline-definition-GMOUNBTQ-BJ77HEH4.js} +2 -2
- package/dist/assets/vendor-antd--lnyToqQ.js +406 -0
- package/dist/assets/vendor-codemirror-C7imH6Hd.js +46 -0
- package/dist/assets/vendor-highlight-D4ATuRwX.js +3 -0
- package/dist/assets/vendor-markdown-CO-jRjTB.js +60 -0
- package/dist/assets/vendor-qrcode-myYunK0Z.js +9 -0
- package/dist/assets/vendor-react-l0sNRNKZ.js +1 -0
- package/dist/assets/vendor-virtuoso-DDKvHLUv.js +1 -0
- package/dist/assets/vendor-xterm-DWMOrwSy.js +140 -0
- package/dist/assets/{vennDiagram-DHZGUBPP-kjEHn01W.js → vennDiagram-DHZGUBPP-CcaBN0Ep.js} +2 -2
- package/dist/assets/{wardley-RL74JXVD-DBS4ToLP.js → wardley-RL74JXVD-r315WPib.js} +3 -3
- package/dist/assets/{wardleyDiagram-NUSXRM2D-BpgxZLmX.js → wardleyDiagram-NUSXRM2D-DAe4Y5vL.js} +2 -2
- package/dist/assets/{xychartDiagram-5P7HB3ND-D2SogsgK.js → xychartDiagram-5P7HB3ND-CtdbgM2X.js} +2 -2
- package/dist/index.html +3 -1
- package/package.json +1 -1
- package/dist/assets/App-CeymbgbA.js +0 -41
- package/dist/assets/AppHeader.module-DPnQHzzR.js +0 -1178
- package/dist/assets/Mobile-DjnTG4qC.js +0 -10
- package/dist/assets/architectureDiagram-Q4EWVU46-CEqjU2Yr.js +0 -36
- package/dist/assets/channel-Ccy-P4LS.js +0 -1
- package/dist/assets/classDiagram-6PBFFD2Q-DIxbiWjL.js +0 -1
- package/dist/assets/classDiagram-v2-HSJHXN6E-DIxbiWjL.js +0 -1
- package/dist/assets/clone-DdX7TiWD.js +0 -1
- package/dist/assets/cose-bilkent-S5V4N54A-DZf1mwhN.js +0 -1
- package/dist/assets/dagre-KV5264BT-CoyMLIR8.js +0 -4
- package/dist/assets/diagram-5BDNPKRD-Djsx8Om-.js +0 -10
- package/dist/assets/diagram-G4DWMVQ6-IR3Z9SIW.js +0 -24
- package/dist/assets/diagram-MMDJMWI5-TUdlJKCs.js +0 -43
- package/dist/assets/diagram-TYMM5635-dE6LLI4N.js +0 -24
- package/dist/assets/ganttDiagram-T4ZO3ILL-VWPHYnwK.js +0 -292
- package/dist/assets/gitGraphDiagram-UUTBAWPF-DKRLN0f1.js +0 -106
- package/dist/assets/index-CIrnsaQS.js +0 -41
- package/dist/assets/infoDiagram-42DDH7IO-nvzkBgvn.js +0 -2
- package/dist/assets/mermaid.core-CcE8BsIy.js +0 -308
- package/dist/assets/sankeyDiagram-XADWPNL6-d_U14FxJ.js +0 -10
- package/dist/assets/stateDiagram-FHFEXIEX-z6ITJtUk.js +0 -1
- package/dist/assets/stateDiagram-v2-QKLJ7IA2-vbgNYNft.js +0 -1
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
var Ge=Object.defineProperty;var Ze=(s,o,t)=>o in s?Ge(s,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[o]=t;var R=(s,o,t)=>Ze(s,typeof o!="symbol"?o+"":o,t);import{r as b,j as e,R as Xe,i as Ye,a as ue,s as Ke}from"./index-CIrnsaQS.js";import{g as Pe,m as Je,a as Ve,r as ke,K as Q,u as U,C as fe,i as Ie,c as F,b as Me,d as Qe,I as et,_ as tt,f as st,e as z,t as g,h as Oe,j as it,F as lt,k as ot,l as nt,n as at,o as rt,q as ct,s as dt,v as ht,w as r,x as oe,y as K,A as mt,M as ut,z as gt,B as bt,D as ge,E as c,G as xt,H as ft,R as pt,J as jt,L as G,N as vt,O as Se,P as Nt,T as yt,Q as St,S as Ct,U as _t,V as wt,W as be,X as Ce,Y as Tt,Z as _e}from"./AppHeader.module-DPnQHzzR.js";const $t=new Q("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),Lt=new Q("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),Pt=new Q("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),Vt=new Q("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),kt=new Q("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),It=new Q("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),Mt=s=>{const{componentCls:o,iconCls:t,antCls:i,badgeShadowSize:l,textFontSize:h,textFontSizeSM:n,statusSize:f,dotSize:x,textFontWeight:a,indicatorHeight:m,indicatorHeightSM:d,marginXS:N,calc:y}=s,v=`${i}-scroll-number`,w=Ve(s,(_,{darkColor:u})=>({[`&${o} ${o}-color-${_}`]:{background:u,[`&:not(${o}-count)`]:{color:u},"a:hover &":{background:u}}}));return{[o]:Object.assign(Object.assign(Object.assign(Object.assign({},ke(s)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,[`${o}-count`]:{display:"inline-flex",justifyContent:"center",zIndex:s.indicatorZIndex,minWidth:m,height:m,color:s.badgeTextColor,fontWeight:a,fontSize:h,lineHeight:U(m),whiteSpace:"nowrap",textAlign:"center",background:s.badgeColor,borderRadius:y(m).div(2).equal(),boxShadow:`0 0 0 ${U(l)} ${s.badgeShadowColor}`,transition:`background ${s.motionDurationMid}`,a:{color:s.badgeTextColor},"a:hover":{color:s.badgeTextColor},"a:hover &":{background:s.badgeColorHover}},[`${o}-count-sm`]:{minWidth:d,height:d,fontSize:n,lineHeight:U(d),borderRadius:y(d).div(2).equal()},[`${o}-multiple-words`]:{padding:`0 ${U(s.paddingXS)}`,bdi:{unicodeBidi:"plaintext"}},[`${o}-dot`]:{zIndex:s.indicatorZIndex,width:x,minWidth:x,height:x,background:s.badgeColor,borderRadius:"100%",boxShadow:`0 0 0 ${U(l)} ${s.badgeShadowColor}`},[`${o}-count, ${o}-dot, ${v}-custom-component`]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",[`&${t}-spin`]:{animationName:It,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&${o}-status`]:{lineHeight:"inherit",verticalAlign:"baseline",[`${o}-status-dot`]:{position:"relative",top:-1,display:"inline-block",width:f,height:f,verticalAlign:"middle",borderRadius:"50%"},[`${o}-status-success`]:{backgroundColor:s.colorSuccess},[`${o}-status-processing`]:{overflow:"visible",color:s.colorInfo,backgroundColor:s.colorInfo,borderColor:"currentcolor","&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:l,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:$t,animationDuration:s.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},[`${o}-status-default`]:{backgroundColor:s.colorTextPlaceholder},[`${o}-status-error`]:{backgroundColor:s.colorError},[`${o}-status-warning`]:{backgroundColor:s.colorWarning},[`${o}-status-text`]:{marginInlineStart:N,color:s.colorText,fontSize:s.fontSize}}}),w),{[`${o}-zoom-appear, ${o}-zoom-enter`]:{animationName:Lt,animationDuration:s.motionDurationSlow,animationTimingFunction:s.motionEaseOutBack,animationFillMode:"both"},[`${o}-zoom-leave`]:{animationName:Pt,animationDuration:s.motionDurationSlow,animationTimingFunction:s.motionEaseOutBack,animationFillMode:"both"},[`&${o}-not-a-wrapper`]:{[`${o}-zoom-appear, ${o}-zoom-enter`]:{animationName:Vt,animationDuration:s.motionDurationSlow,animationTimingFunction:s.motionEaseOutBack},[`${o}-zoom-leave`]:{animationName:kt,animationDuration:s.motionDurationSlow,animationTimingFunction:s.motionEaseOutBack},[`&:not(${o}-status)`]:{verticalAlign:"middle"},[`${v}-custom-component, ${o}-count`]:{transform:"none"},[`${v}-custom-component, ${v}`]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[v]:{overflow:"hidden",transition:`all ${s.motionDurationMid} ${s.motionEaseOutBack}`,[`${v}-only`]:{position:"relative",display:"inline-block",height:m,transition:`all ${s.motionDurationSlow} ${s.motionEaseOutBack}`,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",[`> p${v}-only-unit`]:{height:m,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},[`${v}-symbol`]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",[`${o}-count, ${o}-dot, ${v}-custom-component`]:{transform:"translate(-50%, -50%)"}}})}},Ee=s=>{const{fontHeight:o,lineWidth:t,marginXS:i,colorBorderBg:l}=s,h=o,n=t,f=s.colorTextLightSolid,x=s.colorError,a=s.colorErrorHover;return Je(s,{badgeFontHeight:h,badgeShadowSize:n,badgeTextColor:f,badgeColor:x,badgeColorHover:a,badgeShadowColor:l,badgeProcessingDuration:"1.2s",badgeRibbonOffset:i,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},Re=s=>{const{fontSize:o,lineHeight:t,fontSizeSM:i,lineWidth:l}=s;return{indicatorZIndex:"auto",indicatorHeight:Math.round(o*t)-2*l,indicatorHeightSM:o,dotSize:i/2,textFontSize:i,textFontSizeSM:i,textFontWeight:"normal",statusSize:i/2}},Ot=Pe("Badge",s=>{const o=Ee(s);return Mt(o)},Re),Et=s=>{const{antCls:o,badgeFontHeight:t,marginXS:i,badgeRibbonOffset:l,calc:h}=s,n=`${o}-ribbon`,f=`${o}-ribbon-wrapper`,x=Ve(s,(a,{darkColor:m})=>({[`&${n}-color-${a}`]:{background:m,color:m}}));return{[f]:{position:"relative"},[n]:Object.assign(Object.assign(Object.assign(Object.assign({},ke(s)),{position:"absolute",top:i,padding:`0 ${U(s.paddingXS)}`,color:s.colorPrimary,lineHeight:U(t),whiteSpace:"nowrap",backgroundColor:s.colorPrimary,borderRadius:s.borderRadiusSM,[`${n}-text`]:{color:s.badgeTextColor},[`${n}-corner`]:{position:"absolute",top:"100%",width:l,height:l,color:"currentcolor",border:`${U(h(l).div(2).equal())} solid`,transform:s.badgeRibbonCornerTransform,transformOrigin:"top",filter:s.badgeRibbonCornerFilter}}),x),{[`&${n}-placement-end`]:{insetInlineEnd:h(l).mul(-1).equal(),borderEndEndRadius:0,[`${n}-corner`]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},[`&${n}-placement-start`]:{insetInlineStart:h(l).mul(-1).equal(),borderEndStartRadius:0,[`${n}-corner`]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}},Rt=Pe(["Badge","Ribbon"],s=>{const o=Ee(s);return Et(o)},Re),Dt=s=>{const{className:o,prefixCls:t,style:i,color:l,children:h,text:n,placement:f="end",rootClassName:x}=s,{getPrefixCls:a,direction:m}=b.useContext(fe),d=a("ribbon",t),N=`${d}-wrapper`,[y,v,w]=Rt(d,N),_=Ie(l,!1),u=F(d,`${d}-placement-${f}`,{[`${d}-rtl`]:m==="rtl",[`${d}-color-${l}`]:_},o),j={},S={};return l&&!_&&(j.background=l,S.color=l),y(b.createElement("div",{className:F(N,x,v,w)},h,b.createElement("div",{className:F(u,v),style:Object.assign(Object.assign({},j),i)},b.createElement("span",{className:`${d}-text`},n),b.createElement("div",{className:`${d}-corner`,style:S}))))},we=s=>{const{prefixCls:o,value:t,current:i,offset:l=0}=s;let h;return l&&(h={position:"absolute",top:`${l}00%`,left:0}),b.createElement("span",{style:h,className:F(`${o}-only-unit`,{current:i})},t)};function At(s,o,t){let i=s,l=0;for(;(i+10)%10!==o;)i+=t,l+=t;return l}const Bt=s=>{const{prefixCls:o,count:t,value:i}=s,l=Number(i),h=Math.abs(t),[n,f]=b.useState(l),[x,a]=b.useState(h),m=()=>{f(l),a(h)};b.useEffect(()=>{const y=setTimeout(m,1e3);return()=>clearTimeout(y)},[l]);let d,N;if(n===l||Number.isNaN(l)||Number.isNaN(n))d=[b.createElement(we,Object.assign({},s,{key:l,current:!0}))],N={transition:"none"};else{d=[];const y=l+10,v=[];for(let j=l;j<=y;j+=1)v.push(j);const w=x<h?1:-1,_=v.findIndex(j=>j%10===n);d=(w<0?v.slice(0,_+1):v.slice(_)).map((j,S)=>{const E=j%10;return b.createElement(we,Object.assign({},s,{key:j,value:E,offset:w<0?S-_:S,current:S===_}))}),N={transform:`translateY(${-At(n,l,w)}00%)`}}return b.createElement("span",{className:`${o}-only`,style:N,onTransitionEnd:m},d)};var zt=function(s,o){var t={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.indexOf(i)<0&&(t[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,i=Object.getOwnPropertySymbols(s);l<i.length;l++)o.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(s,i[l])&&(t[i[l]]=s[i[l]]);return t};const Ft=b.forwardRef((s,o)=>{const{prefixCls:t,count:i,className:l,motionClassName:h,style:n,title:f,show:x,component:a="sup",children:m}=s,d=zt(s,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:N}=b.useContext(fe),y=N("scroll-number",t),v=Object.assign(Object.assign({},d),{"data-show":x,style:n,className:F(y,l,h),title:f});let w=i;if(i&&Number(i)%1===0){const _=String(i).split("");w=b.createElement("bdi",null,_.map((u,j)=>b.createElement(Bt,{prefixCls:y,count:Number(i),value:u,key:_.length-j})))}return n!=null&&n.borderColor&&(v.style=Object.assign(Object.assign({},n),{boxShadow:`0 0 0 1px ${n.borderColor} inset`})),m?Me(m,_=>({className:F(`${y}-custom-component`,_==null?void 0:_.className,h)})):b.createElement(a,Object.assign({},v,{ref:o}),w)});var Wt=function(s,o){var t={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.indexOf(i)<0&&(t[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,i=Object.getOwnPropertySymbols(s);l<i.length;l++)o.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(s,i[l])&&(t[i[l]]=s[i[l]]);return t};const Ht=b.forwardRef((s,o)=>{var t,i,l,h,n;const{prefixCls:f,scrollNumberPrefixCls:x,children:a,status:m,text:d,color:N,count:y=null,overflowCount:v=99,dot:w=!1,size:_="default",title:u,offset:j,style:S,className:E,rootClassName:I,classNames:L,styles:M,showZero:W=!1}=s,H=Wt(s,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:D,direction:T,badge:p}=b.useContext(fe),$=D("badge",f),[B,te,ne]=Ot($),V=y>v?`${v}+`:y,k=V==="0"||V===0||d==="0"||d===0,q=y===null||k&&!W,ae=(m!=null||N!=null)&&q,Be=m!=null||!k,ee=w&&!k,Z=ee?"":V,X=b.useMemo(()=>((Z==null||Z==="")&&(d==null||d==="")||k&&!W)&&!ee,[Z,k,W,ee,d]),pe=b.useRef(y);X||(pe.current=y);const Y=pe.current,je=b.useRef(Z);X||(je.current=Z);const re=je.current,ve=b.useRef(ee);X||(ve.current=ee);const se=b.useMemo(()=>{if(!j)return Object.assign(Object.assign({},p==null?void 0:p.style),S);const A={marginTop:j[1]};return T==="rtl"?A.left=Number.parseInt(j[0],10):A.right=-Number.parseInt(j[0],10),Object.assign(Object.assign(Object.assign({},A),p==null?void 0:p.style),S)},[T,j,S,p==null?void 0:p.style]),ze=u??(typeof Y=="string"||typeof Y=="number"?Y:void 0),Ne=!X&&(d===0?W:!!d&&d!==!0),Fe=Ne?b.createElement("span",{className:`${$}-status-text`},d):null,We=!Y||typeof Y!="object"?void 0:Me(Y,A=>({style:Object.assign(Object.assign({},se),A.style)})),ie=Ie(N,!1),He=F(L==null?void 0:L.indicator,(t=p==null?void 0:p.classNames)===null||t===void 0?void 0:t.indicator,{[`${$}-status-dot`]:ae,[`${$}-status-${m}`]:!!m,[`${$}-color-${N}`]:ie}),ce={};N&&!ie&&(ce.color=N,ce.background=N);const ye=F($,{[`${$}-status`]:ae,[`${$}-not-a-wrapper`]:!a,[`${$}-rtl`]:T==="rtl"},E,I,p==null?void 0:p.className,(i=p==null?void 0:p.classNames)===null||i===void 0?void 0:i.root,L==null?void 0:L.root,te,ne);if(!a&&ae&&(d||Be||!q)){const A=se.color;return B(b.createElement("span",Object.assign({},H,{className:ye,style:Object.assign(Object.assign(Object.assign({},M==null?void 0:M.root),(l=p==null?void 0:p.styles)===null||l===void 0?void 0:l.root),se)}),b.createElement("span",{className:He,style:Object.assign(Object.assign(Object.assign({},M==null?void 0:M.indicator),(h=p==null?void 0:p.styles)===null||h===void 0?void 0:h.indicator),ce)}),Ne&&b.createElement("span",{style:{color:A},className:`${$}-status-text`},d)))}return B(b.createElement("span",Object.assign({ref:o},H,{className:ye,style:Object.assign(Object.assign({},(n=p==null?void 0:p.styles)===null||n===void 0?void 0:n.root),M==null?void 0:M.root)}),a,b.createElement(Qe,{visible:!X,motionName:`${$}-zoom`,motionAppear:!1,motionDeadline:1e3},({className:A})=>{var de,he;const qe=D("scroll-number",x),me=ve.current,Ue=F(L==null?void 0:L.indicator,(de=p==null?void 0:p.classNames)===null||de===void 0?void 0:de.indicator,{[`${$}-dot`]:me,[`${$}-count`]:!me,[`${$}-count-sm`]:_==="small",[`${$}-multiple-words`]:!me&&re&&re.toString().length>1,[`${$}-status-${m}`]:!!m,[`${$}-color-${N}`]:ie});let le=Object.assign(Object.assign(Object.assign({},M==null?void 0:M.indicator),(he=p==null?void 0:p.styles)===null||he===void 0?void 0:he.indicator),se);return N&&!ie&&(le=le||{},le.background=N),b.createElement(Ft,{prefixCls:qe,show:!X,motionClassName:A,className:Ue,count:re,title:ze,style:le,key:"scrollNumber"},We)}),Fe))}),De=Ht;De.Ribbon=Dt;var qt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M793 242H366v-74c0-6.7-7.7-10.4-12.9-6.3l-142 112a8 8 0 000 12.6l142 112c5.2 4.1 12.9.4 12.9-6.3v-74h415v470H175c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h618c35.3 0 64-28.7 64-64V306c0-35.3-28.7-64-64-64z"}}]},name:"rollback",theme:"outlined"},Ut=function(o,t){return b.createElement(et,tt({},o,{ref:t,icon:qt}))},Gt=b.forwardRef(Ut);const Zt="_container_tjqxo_1",Xt="_fileListSection_tjqxo_10",Yt="_header_tjqxo_19",Kt="_headerLeft_tjqxo_28",Jt="_headerTitle_tjqxo_34",Qt="_fileCount_tjqxo_42",es="_closeBtn_tjqxo_50",ts="_changesContainer_tjqxo_66",ss="_changeItem_tjqxo_73",is="_changeItemActive_tjqxo_90",ls="_dirItem_tjqxo_99",os="_dirArrow_tjqxo_110",ns="_dirName_tjqxo_119",as="_status_tjqxo_124",rs="_icon_tjqxo_133",cs="_fileName_tjqxo_142",ds="_diffSection_tjqxo_149",hs="_diffHeader_tjqxo_157",ms="_diffFilePath_tjqxo_167",us="_diffBadge_tjqxo_177",gs="_diffContent_tjqxo_189",bs="_diffPlaceholder_tjqxo_195",xs="_statusText_tjqxo_206",fs="_errorText_tjqxo_213",ps="_emptyText_tjqxo_220",js="_warningText_tjqxo_227",vs="_fileSizeNote_tjqxo_239",Ns="_statusTextItalic_tjqxo_244",ys="_imagePreviewWrap_tjqxo_248",Ss="_imagePreview_tjqxo_248",Cs="_rotated90_tjqxo_264",_s="_repoHeader_tjqxo_269",ws="_repoArrow_tjqxo_288",Ts="_repoArrowExpanded_tjqxo_299",$s="_repoName_tjqxo_303",Ls="_repoBadge_tjqxo_310",C={container:Zt,fileListSection:Xt,header:Yt,headerLeft:Kt,headerTitle:Jt,fileCount:Qt,closeBtn:es,changesContainer:ts,changeItem:ss,changeItemActive:is,dirItem:ls,dirArrow:os,dirName:ns,status:as,icon:rs,fileName:cs,diffSection:ds,diffHeader:hs,diffFilePath:ms,diffBadge:us,diffContent:gs,diffPlaceholder:bs,statusText:xs,errorText:fs,emptyText:ps,warningText:js,fileSizeNote:vs,statusTextItalic:Ns,imagePreviewWrap:ys,imagePreview:Ss,rotated90:Cs,repoHeader:_s,repoArrow:ws,repoArrowExpanded:Ts,repoName:$s,repoBadge:Ls},Ps={M:"#e2c08d",A:"#73c991",D:"#f14c4c",R:"#73c991",C:"#73c991",U:"#e2c08d","?":"#73c991","??":"#73c991"},Vs={"??":"U"},ks={js:"#e8d44d",jsx:"#61dafb",ts:"#3178c6",tsx:"#3178c6",json:"#999",md:"#519aba",css:"#a86fd9",scss:"#cd6799",html:"#e34c26",py:"#3572a5",go:"#00add8",rs:"#dea584"};function Is(s){const o=s.includes(".")?s.split(".").pop().toLowerCase():"",t=ks[o]||"#888";return e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"1.5",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function Ms(){return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"#c09553",stroke:"none",children:e.jsx("path",{d:"M2 6c0-1.1.9-2 2-2h5l2 2h9a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6z"})})}function Te(s){const o={dirs:{},files:[]};for(const t of s){const i=t.file.split("/");let l=o;for(let h=0;h<i.length-1;h++)l.dirs[i[h]]||(l.dirs[i[h]]={dirs:{},files:[]}),l=l.dirs[i[h]];l.files.push({name:i[i.length-1],status:t.status,fullPath:t.file})}return o}function xe({name:s,node:o,depth:t,selectedFile:i,selectedRepo:l,repoPath:h,onFileClick:n}){const f=Object.keys(o.dirs).sort(),x=[...o.files].sort((a,m)=>a.name.localeCompare(m.name));return e.jsxs(e.Fragment,{children:[s&&e.jsxs("div",{className:C.dirItem,style:{paddingLeft:8+t*16},children:[e.jsx("span",{className:C.dirArrow,children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:C.rotated90,children:e.jsx("polyline",{points:"9 6 15 12 9 18"})})}),e.jsx("span",{className:C.icon,children:Ms()}),e.jsx("span",{className:C.dirName,children:s})]}),f.map(a=>e.jsx(xe,{name:a,node:o.dirs[a],depth:s?t+1:t,selectedFile:i,selectedRepo:l,repoPath:h,onFileClick:n},a)),x.map(a=>e.jsxs("div",{className:`${C.changeItem} ${i===a.fullPath&&l===h?C.changeItemActive:""}`,style:{paddingLeft:8+(s?t+1:t)*16},onClick:()=>n&&n(h,a.fullPath),children:[e.jsx("span",{className:C.icon,children:Is(a.name)}),e.jsx("span",{className:C.fileName,children:a.name}),e.jsx("span",{className:C.status,style:{color:Ps[a.status]||"#888"},children:Vs[a.status]||a.status})]},a.fullPath))]})}function Os({visible:s,onClose:o}){const[t,i]=b.useState(null),[l,h]=b.useState(null),[n,f]=b.useState(!0),[x,a]=b.useState(null),[m,d]=b.useState(null),[N,y]=b.useState(new Set),[v,w]=b.useState(null),[_,u]=b.useState(null),[j,S]=b.useState(!1),[E,I]=b.useState(!1),L=b.useRef(!0);b.useEffect(()=>{if(L.current=!0,!!s)return f(!0),h(null),st().then(T=>{L.current&&(i(T),f(!1))}).catch(()=>{L.current&&(h("Failed to load git status"),f(!1))}),()=>{L.current=!1}},[s]),b.useEffect(()=>{if(!x||!m){w(null),u(null);return}S(!0),w(null),u(null);const T=m&&m!=="."?`&repo=${encodeURIComponent(m)}`:"";fetch(z(`/api/git-diff?files=${encodeURIComponent(x)}${T}`)).then(p=>{if(!p.ok)throw new Error(`HTTP ${p.status}`);return p.json()}).then(p=>{L.current&&(p.diffs&&p.diffs[0]?w(p.diffs[0]):u("No diff data available"),S(!1))}).catch(p=>{L.current&&(u(`${g("ui.fileLoadError")}: ${p.message}`),S(!1))})},[x,m]);const M=b.useMemo(()=>t?t.reduce((T,p)=>T+p.changes.length,0):0,[t]),W=!t||t.length<=1,H=(T,p)=>{a(p),d(T)},D=x&&m&&m!=="."?`${m}/${x}`:x;return e.jsxs("div",{className:C.container,children:[e.jsxs("div",{className:C.fileListSection,children:[e.jsxs("div",{className:C.header,children:[e.jsxs("div",{className:C.headerLeft,children:[e.jsx("span",{className:C.headerTitle,children:g("ui.gitChanges")}),e.jsx("span",{className:C.fileCount,children:M})]}),o&&e.jsx("button",{className:C.closeBtn,onClick:o,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsxs("div",{className:C.changesContainer,children:[n&&e.jsx("div",{className:C.statusText,children:"Loading..."}),l&&e.jsx("div",{className:C.errorText,children:l}),!n&&!l&&(!t||t.length===0)&&e.jsx("div",{className:C.emptyText,children:"No changes"}),!n&&!l&&t&&t.map(T=>{const p=N.has(T.path);return W?e.jsx(xe,{name:"",node:Te(T.changes),depth:0,selectedFile:x,selectedRepo:m,repoPath:T.path,onFileClick:H},T.path):e.jsxs(Xe.Fragment,{children:[e.jsxs("div",{className:C.repoHeader,onClick:()=>y($=>{const B=new Set($);return p?B.delete(T.path):B.add(T.path),B}),children:[e.jsx("span",{className:`${C.repoArrow} ${p?"":C.repoArrowExpanded}`,children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"9 6 15 12 9 18"})})}),e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-muted)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),e.jsx("circle",{cx:"18",cy:"6",r:"3"}),e.jsx("circle",{cx:"6",cy:"18",r:"3"}),e.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),e.jsx("span",{className:C.repoName,children:T.name}),e.jsx("span",{className:C.repoBadge,children:T.changes.length})]}),!p&&e.jsx(xe,{name:"",node:Te(T.changes),depth:1,selectedFile:x,selectedRepo:m,repoPath:T.path,onFileClick:H})]},T.path)})]})]}),e.jsx("div",{className:C.diffSection,children:x?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:C.diffHeader,children:[e.jsx("span",{className:C.diffFilePath,children:D}),e.jsx("span",{className:C.diffBadge,children:"DIFF"})]}),e.jsxs("div",{className:C.diffContent,children:[j&&e.jsx("div",{className:C.statusText,children:g("ui.loading")}),_&&e.jsx("div",{className:C.errorText,children:_}),!j&&!_&&v&&e.jsx(e.Fragment,{children:v.is_large?e.jsxs("div",{className:C.warningText,children:[e.jsx("p",{children:g("ui.largeFileWarning")}),e.jsxs("p",{className:C.fileSizeNote,children:[g("ui.fileSize"),": ",(v.size/(1024*1024)).toFixed(2)," MB"]})]}):Oe(x)&&!v.is_deleted?e.jsxs("div",{className:C.imagePreviewWrap,children:[e.jsx("img",{className:C.imagePreview,src:z(`/api/file-raw?path=${encodeURIComponent(D)}`),alt:x,onClick:()=>I(!0)}),E&&e.jsx(it,{src:z(`/api/file-raw?path=${encodeURIComponent(D)}`),alt:x,onClose:()=>I(!1)})]}):v.is_binary?e.jsx("div",{className:`${C.statusText} ${C.statusTextItalic}`,children:g("ui.binaryFileNotice")}):e.jsx(lt,{file_path:x,old_string:v.old_content,new_string:v.new_content})})]})]}):e.jsxs("div",{className:C.diffPlaceholder,children:[e.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"#333",strokeWidth:"1.5",children:[e.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),e.jsx("circle",{cx:"18",cy:"6",r:"3"}),e.jsx("circle",{cx:"6",cy:"18",r:"3"}),e.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),e.jsx("span",{children:g("ui.mobileGitDiffHint")})]})})]})}const Es="_container_1hzyt_1",Rs="_fileListSection_1hzyt_10",Ds="_header_1hzyt_19",As="_headerLeft_1hzyt_28",Bs="_headerTitle_1hzyt_34",zs="_fileCount_1hzyt_42",Fs="_closeBtn_1hzyt_50",Ws="_treeContainer_1hzyt_66",Hs="_treeItem_1hzyt_73",qs="_treeItemActive_1hzyt_90",Us="_treeItemIgnored_1hzyt_99",Gs="_arrow_1hzyt_103",Zs="_arrowExpanded_1hzyt_113",Xs="_icon_1hzyt_117",Ys="_fileName_1hzyt_126",Ks="_contentSection_1hzyt_133",Js="_contentPlaceholder_1hzyt_141",Qs="_statusText_1hzyt_152",ei="_errorText_1hzyt_159",ti="_emptyText_1hzyt_166",P={container:Es,fileListSection:Rs,header:Ds,headerLeft:As,headerTitle:Bs,fileCount:zs,closeBtn:Fs,treeContainer:Ws,treeItem:Hs,treeItemActive:qs,treeItemIgnored:Us,arrow:Gs,arrowExpanded:Zs,icon:Xs,fileName:Ys,contentSection:Ks,contentPlaceholder:Js,statusText:Qs,errorText:ei,emptyText:ti},si={js:"#e8d44d",jsx:"#61dafb",ts:"#3178c6",tsx:"#3178c6",json:"#999",md:"#519aba",css:"#a86fd9",scss:"#cd6799",html:"#e34c26",py:"#3572a5",go:"#00add8",rs:"#dea584"};function ii(s){const o=s.includes(".")?s.split(".").pop().toLowerCase():"",t=si[o]||"#888";return e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"1.5",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function li(){return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"#c09553",stroke:"none",children:e.jsx("path",{d:"M2 6c0-1.1.9-2 2-2h5l2 2h9a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6z"})})}function Ae({item:s,path:o,depth:t,expandedPaths:i,onToggleExpand:l,currentFile:h,onFileClick:n}){const[f,x]=b.useState(null),[a,m]=b.useState(!1),d=o?`${o}/${s.name}`:s.name,N=i.has(d),y=s.type==="directory",v=!y&&h===d,w=s.gitIgnored||!1;b.useEffect(()=>{y&&N&&f===null&&!a&&(m(!0),fetch(z(`/api/files?path=${encodeURIComponent(d)}`)).then(u=>u.ok?u.json():Promise.reject()).then(u=>{x(u),m(!1)}).catch(()=>{m(!1)}))},[N]);const _=b.useCallback(()=>{y?l(d):n(d)},[y,d,l,n]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`${P.treeItem} ${v?P.treeItemActive:""} ${w?P.treeItemIgnored:""}`,style:{paddingLeft:8+t*16},onClick:_,children:[y?e.jsx("span",{className:`${P.arrow} ${N?P.arrowExpanded:""}`,children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"9 6 15 12 9 18"})})}):e.jsx("span",{style:{width:16,flexShrink:0}}),e.jsx("span",{className:P.icon,children:y?li():ii(s.name)}),e.jsx("span",{className:P.fileName,children:s.name}),a&&e.jsx("span",{style:{fontSize:10,color:"var(--text-disabled)"},children:"..."})]}),y&&N&&f&&f.map(u=>e.jsx(Ae,{item:u,path:d,depth:t+1,expandedPaths:i,onToggleExpand:l,currentFile:h,onFileClick:n},u.name))]})}function oi({visible:s,onClose:o,targetFile:t}){const[i,l]=b.useState(null),[h,n]=b.useState(!0),[f,x]=b.useState(null),[a,m]=b.useState(new Set),[d,N]=b.useState(null),y=b.useRef(!0),v=b.useRef(null);b.useEffect(()=>{if(y.current=!0,!s){N(null),m(new Set),v.current=null;return}return n(!0),x(null),fetch(z("/api/files?path=")).then(S=>S.ok?S.json():Promise.reject()).then(S=>{y.current&&(l(S),n(!1))}).catch(()=>{y.current&&(x(g("ui.fileLoadError")),n(!1))}),()=>{y.current=!1}},[s]),b.useEffect(()=>{!t||!s||v.current!==t.file&&(v.current=t.file,N(t.file),t.ancestors&&t.ancestors.length>0&&m(S=>{const E=new Set(S);return t.ancestors.forEach(I=>E.add(I)),E}))},[t,s]);const w=b.useCallback(S=>{m(E=>{const I=new Set(E);return I.has(S)?I.delete(S):I.add(S),I})},[]),_=b.useCallback(S=>{N(S)},[]),u=b.useCallback(()=>{N(null)},[]),j=i?i.length:0;return e.jsxs("div",{className:P.container,children:[e.jsxs("div",{className:P.fileListSection,children:[e.jsxs("div",{className:P.header,children:[e.jsxs("div",{className:P.headerLeft,children:[e.jsx("span",{className:P.headerTitle,children:g("ui.projectFolder")}),e.jsx("span",{className:P.fileCount,children:j})]}),o&&e.jsx("button",{className:P.closeBtn,onClick:o,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsxs("div",{className:P.treeContainer,children:[h&&e.jsx("div",{className:P.statusText,children:g("ui.loading")}),f&&e.jsx("div",{className:P.errorText,children:g("ui.fileLoadError")}),!h&&!f&&(!i||i.length===0)&&e.jsx("div",{className:P.emptyText,children:g("ui.mobileFileExplorerHint")}),!h&&!f&&i&&i.map(S=>e.jsx(Ae,{item:S,path:"",depth:0,expandedPaths:a,onToggleExpand:w,currentFile:d,onFileClick:_},S.name))]})]}),e.jsx("div",{className:P.contentSection,children:d?Oe(d)?e.jsx(ot,{filePath:d,onClose:u}):e.jsx(nt,{filePath:d,onClose:u}):e.jsxs("div",{className:P.contentPlaceholder,children:[e.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:e.jsx("path",{d:"M2 6c0-1.1.9-2 2-2h5l2 2h9a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6z"})}),e.jsx("span",{children:g("ui.mobileFileExplorerHint")})]})})]})}const ni="_container_1bb9n_1",ai="_header_1bb9n_9",ri="_headerTitle_1bb9n_18",ci="_closeBtn_1bb9n_24",di="_content_1bb9n_38",hi="_empty_1bb9n_47",mi="_fixedTable_1bb9n_54",ui="_ellipsisCell_1bb9n_58",gi="_thLeft_1bb9n_65",bi="_colWide_1bb9n_69",xi="_colNarrow_1bb9n_73",O={container:ni,header:ai,headerTitle:ri,closeBtn:ci,content:di,empty:hi,fixedTable:mi,ellipsisCell:ui,thLeft:gi,colWide:bi,colNarrow:xi},fi=["ttl","system_change","tools_change","model_change","msg_truncated","msg_modified","key_change"],$e={ttl:"cacheLoss.ttl",system_change:"cacheLoss.systemChange",tools_change:"cacheLoss.toolsChange",model_change:"cacheLoss.modelChange",msg_truncated:"cacheLoss.msgTruncated",msg_modified:"cacheLoss.msgModified",key_change:"cacheLoss.keyChange"};function pi({requests:s=[],visible:o,onClose:t}){const{byModel:i,models:l,toolStats:h,skillStats:n,cacheStats:f,activeReasons:x,totalCount:a,totalCache:m,hasCacheStats:d,subAgentEntries:N,hasSubAgentStats:y,teammateEntries:v,hasTeammateStats:w,isEmpty:_}=b.useMemo(()=>{const u=at(s),j=Object.keys(u),S=rt(s),E=ct(s),I=dt(s),L=fi.filter(V=>I[V].count>0),M=L.reduce((V,k)=>V+I[k].count,0),W=L.reduce((V,k)=>V+I[k].cacheCreate,0),H=L.length>0,D={},T={};for(let V=0;V<s.length;V++){const k=ht(s[V],s[V+1]);if(k.type==="SubAgent"){const q=k.subType||"Other";D[q]=(D[q]||0)+1}else if(k.type==="Teammate"){const q=k.subType||"Teammate";T[q]=(T[q]||0)+1}}const p=Object.entries(D).sort((V,k)=>k[1]-V[1]),$=p.length>0,B=Object.entries(T).sort((V,k)=>k[1]-V[1]),te=B.length>0,ne=j.length===0&&S.length===0&&!H&&!$&&!te&&E.length===0;return{byModel:u,models:j,toolStats:S,skillStats:E,cacheStats:I,activeReasons:L,totalCount:M,totalCache:W,hasCacheStats:H,subAgentEntries:p,hasSubAgentStats:$,teammateEntries:B,hasTeammateStats:te,isEmpty:ne}},[s]);return o?e.jsxs("div",{className:O.container,children:[e.jsxs("div",{className:O.header,children:[e.jsx("span",{className:O.headerTitle,children:g("ui.tokenStats")}),e.jsx("button",{className:O.closeBtn,onClick:t,children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx("div",{className:O.content,children:_?e.jsx("div",{className:O.empty,children:"—"}):e.jsxs(e.Fragment,{children:[n.length>0&&e.jsxs("div",{className:r.modelCard,children:[e.jsx("div",{className:r.modelName,children:g("ui.skillUsageStats")}),e.jsxs("table",{className:r.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${r.th} ${O.thLeft}`,children:"Skill"}),e.jsx("td",{className:r.th,children:g("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[n.map(([u,j])=>e.jsxs("tr",{className:r.rowBorder,children:[e.jsx("td",{className:r.label,children:u}),e.jsx("td",{className:r.td,children:j})]},u)),n.length>1&&e.jsxs("tr",{className:r.rebuildTotalRow,children:[e.jsx("td",{className:r.label,children:"Total"}),e.jsx("td",{className:r.td,children:n.reduce((u,j)=>u+j[1],0)})]})]})]})]}),y&&e.jsxs("div",{className:r.modelCard,children:[e.jsx("div",{className:r.modelName,children:g("ui.subAgentStats")}),e.jsxs("table",{className:r.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${r.th} ${O.thLeft}`,children:"SubAgent"}),e.jsx("td",{className:r.th,children:g("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[N.map(([u,j])=>e.jsxs("tr",{className:r.rowBorder,children:[e.jsxs("td",{className:r.label,children:[u," ",e.jsx(oe,{doc:`SubAgent-${u}`})]}),e.jsx("td",{className:r.td,children:j})]},u)),N.length>1&&e.jsxs("tr",{className:r.rebuildTotalRow,children:[e.jsx("td",{className:r.label,children:"Total"}),e.jsx("td",{className:r.td,children:N.reduce((u,j)=>u+j[1],0)})]})]})]})]}),w&&e.jsxs("div",{className:r.modelCard,children:[e.jsx("div",{className:r.modelName,children:"Teammate"}),e.jsxs("table",{className:r.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${r.th} ${O.thLeft}`,children:"Name"}),e.jsx("td",{className:r.th,children:g("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[v.map(([u,j])=>e.jsxs("tr",{className:r.rowBorder,children:[e.jsx("td",{className:r.label,children:u}),e.jsx("td",{className:r.td,children:j})]},u)),v.length>1&&e.jsxs("tr",{className:r.rebuildTotalRow,children:[e.jsx("td",{className:r.label,children:"Total"}),e.jsx("td",{className:r.td,children:v.reduce((u,j)=>u+j[1],0)})]})]})]})]}),h.length>0&&e.jsxs("div",{className:r.modelCard,children:[e.jsx("div",{className:r.modelName,children:g("ui.toolUsageStats")}),e.jsxs("table",{className:r.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${r.th} ${O.thLeft}`,children:"Tool"}),e.jsx("td",{className:r.th,children:g("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[h.map(([u,j])=>e.jsxs("tr",{className:r.rowBorder,children:[e.jsxs("td",{className:r.label,children:[u," ",e.jsx(oe,{doc:`Tool-${u}`})]}),e.jsx("td",{className:r.td,children:j})]},u)),h.length>1&&e.jsxs("tr",{className:r.rebuildTotalRow,children:[e.jsx("td",{className:r.label,children:"Total"}),e.jsx("td",{className:r.td,children:h.reduce((u,j)=>u+j[1],0)})]})]})]})]}),d&&e.jsxs("div",{className:r.modelCard,children:[e.jsxs("div",{className:r.modelName,children:["MainAgent",e.jsx(oe,{doc:"MainAgent"})," ",g("ui.cacheRebuildStats"),e.jsx(oe,{doc:"CacheRebuild"})]}),e.jsxs("table",{className:`${r.statsTable} ${O.fixedTable}`,children:[e.jsxs("colgroup",{children:[e.jsx("col",{className:O.colWide}),e.jsx("col",{className:O.colNarrow}),e.jsx("col",{className:O.colNarrow})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${r.th} ${O.thLeft}`,children:g("ui.cacheRebuild.reason")}),e.jsx("td",{className:r.th,children:g("ui.cacheRebuild.count")}),e.jsx("td",{className:r.th,children:g("ui.cacheRebuild.cacheCreate")})]})}),e.jsxs("tbody",{children:[x.map(u=>e.jsxs("tr",{className:r.rowBorder,children:[e.jsx("td",{className:`${r.label} ${O.ellipsisCell}`,title:g(`ui.${$e[u]}`),children:g(`ui.${$e[u]}`)}),e.jsx("td",{className:r.td,children:f[u].count}),e.jsx("td",{className:r.td,children:K(f[u].cacheCreate)})]},u)),x.length>1&&e.jsxs("tr",{className:r.rebuildTotalRow,children:[e.jsx("td",{className:r.label,children:"Total"}),e.jsx("td",{className:r.td,children:a}),e.jsx("td",{className:r.td,children:K(m)})]})]})]})]}),l.map(u=>{const j=i[u],S=j.input+j.cacheCreation+j.cacheRead,E=S>0?(j.cacheRead/S*100).toFixed(1):"0.0";return e.jsxs("div",{className:r.modelCard,children:[e.jsx("div",{className:r.modelName,children:u}),e.jsx("table",{className:r.statsTable,children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{className:r.label,children:"Token"}),e.jsx("td",{className:r.th,children:"input"}),e.jsx("td",{className:r.th,children:"output"})]}),e.jsxs("tr",{className:r.rowBorder,children:[e.jsx("td",{className:r.label}),e.jsx("td",{className:r.td,children:K(S)}),e.jsx("td",{className:r.td,children:K(j.output)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:r.label,children:"Cache"}),e.jsx("td",{className:r.th,children:"create"}),e.jsx("td",{className:r.th,children:"read"})]}),e.jsxs("tr",{className:r.rowBorder,children:[e.jsx("td",{className:r.label}),e.jsx("td",{className:r.td,children:K(j.cacheCreation)}),e.jsx("td",{className:r.td,children:K(j.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:r.label,children:g("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:r.td,children:[E,"%"]})]})]})})]},u)})]})})]}):null}const J=class J extends mt{constructor(t){super(t);R(this,"_handleMobileOpenFile",(t,i)=>{this.state.localLogFile||this.setState({mobileFileExplorerVisible:!0,mobileFileExplorerTarget:{file:t,ancestors:i||[]},mobileGitDiffVisible:!1,mobileTerminalVisible:!1,mobileStatsVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileChatVisible:!1})});R(this,"handleExportPromptsTxt",t=>{if(!t||t.length===0)return;const i=[];for(const f of t){const x=[],a=f.timestamp?new Date(f.timestamp).toLocaleString():"";a&&x.push(`${a}:
|
|
2
|
-
`);const m=(f.segments||[]).filter(d=>d.type==="text").map(d=>d.content);m.length>0&&x.push(m.join(`
|
|
3
|
-
`)),i.push(x.join(`
|
|
4
|
-
`))}if(i.length===0)return;const l=new Blob([i.join(`
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
`)],{type:"text/plain;charset=utf-8"}),h=URL.createObjectURL(l),n=document.createElement("a");n.href=h,n.download=`user-prompts-${new Date().toISOString().slice(0,10)}.txt`,n.click(),URL.revokeObjectURL(h)});R(this,"handlePendingPermission",t=>{this.setState({globalPermission:t})});R(this,"handlePendingPlanApproval",t=>{this.setState({globalPlanApproval:t})});R(this,"handleAutoApproveChange",t=>{this.setState({autoApproveSeconds:t}),fetch(z("/api/preferences"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({autoApproveSeconds:t})}).catch(()=>{})});R(this,"_isInternalDrag",t=>t.dataTransfer.types.includes("text/x-preset-reorder"));R(this,"_onDragOver",t=>{if(t.preventDefault(),this._isInternalDrag(t))return;if(t.target.closest&&t.target.closest("[data-file-explorer]")){this.state.isDragging&&this.setState({isDragging:!1});return}this.state.isDragging||this.setState({isDragging:!0})});R(this,"_onDragLeave",t=>{const i=this._layoutRef.current;i&&!i.contains(t.relatedTarget)&&this.setState({isDragging:!1})});R(this,"_onDrop",t=>{if(t.preventDefault(),this._isInternalDrag(t))return;this.setState({isDragging:!1});const i=Array.from(t.dataTransfer.files);if(!i.length)return;const l=this.state.mobileTerminalVisible;Promise.all(i.map(h=>xt(h).then(n=>({name:h.name,path:n})).catch(n=>(ft.error(`${h.name}: ${n.message}`),null)))).then(h=>{const n=h.filter(Boolean);n.length&&(l?this.setState(f=>({terminalPendingImages:[...f.terminalPendingImages,...n.map(x=>({path:x.path,source:"drop"}))]})):this.setState(f=>({pendingUploadPaths:[...f.pendingUploadPaths||[],...n.map(x=>`"${x.path}"`)]})))})});R(this,"handleUploadPathsConsumed",()=>{this.setState({pendingUploadPaths:[]})});R(this,"_handleTerminalFilePath",t=>{this.setState(i=>({terminalPendingImages:[...i.terminalPendingImages,{path:t,source:"terminal"}]}))});R(this,"_handleRemoveTerminalImage",t=>{this.setState(i=>({terminalPendingImages:i.terminalPendingImages.filter((l,h)=>h!==t)}))});R(this,"_handleClearTerminalImages",()=>{this.setState({terminalPendingImages:[]})});Object.assign(this.state,{mobileMenuVisible:!1,mobileStatsVisible:!1,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileTerminalVisible:!1,mobileFileExplorerVisible:!1,globalPermission:null,globalPlanApproval:null,autoApproveSeconds:0,hasGit:!0,terminalPendingImages:[]}),this._lastContextPercent=0}componentDidMount(){super.componentDidMount(),fetch(z("/api/git-repos")).then(t=>t.ok?t.json():Promise.reject()).then(t=>{var i;(i=t.repos)!=null&&i.length||this.setState({hasGit:!1,mobileGitDiffVisible:!1})}).catch(()=>{fetch(z("/api/git-status")).then(t=>{t.ok||this.setState({hasGit:!1,mobileGitDiffVisible:!1})}).catch(()=>this.setState({hasGit:!1,mobileGitDiffVisible:!1}))}),Ye&&!ue&&window.visualViewport&&(this._onVisualViewportChange=()=>{const t=this._layoutRef.current;if(!t)return;const i=window.visualViewport;t.style.position="fixed",t.style.top=`${i.offsetTop}px`,t.style.height=`${i.height}px`,t.style.width="100%",t.style.left="0"},window.visualViewport.addEventListener("resize",this._onVisualViewportChange),window.visualViewport.addEventListener("scroll",this._onVisualViewportChange),this._onVisualViewportChange()),ue&&(this._mqlWide=window.matchMedia("(min-width: 1400px)"),this._modeSwitchDialog=null,this._onWideChange=t=>{t.matches?this._modeSwitchDialog=ut.confirm({title:g("ui.modeSwitchTitle"),content:g("ui.modeSwitchToFullView"),okText:g("ui.ok"),onOk:()=>{this._modeSwitchDialog=null,Ke("pc")},onCancel:()=>{this._modeSwitchDialog=null}}):this._modeSwitchDialog&&(this._modeSwitchDialog.destroy(),this._modeSwitchDialog=null)},this._mqlWide.addEventListener("change",this._onWideChange))}componentWillUnmount(){this._onVisualViewportChange&&window.visualViewport&&(window.visualViewport.removeEventListener("resize",this._onVisualViewportChange),window.visualViewport.removeEventListener("scroll",this._onVisualViewportChange)),this._mqlWide&&this._mqlWide.removeEventListener("change",this._onWideChange),this._modeSwitchDialog&&(this._modeSwitchDialog.destroy(),this._modeSwitchDialog=null),super.componentWillUnmount()}static parseSegments(t){const i=[],l=/<([a-zA-Z_][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>/g;let h=0,n;for(;(n=l.exec(t))!==null;){const x=t.slice(h,n.index).trim();x&&i.push({type:"text",content:x});const a=n[1];if(h=n.index+n[0].length,J.COMMAND_TAGS.has(a))continue;const m=new RegExp(`^<${a}(?:\\s[^>]*)?>([\\s\\S]*)<\\/${a}>$`),d=n[0].match(m),N=d?d[1].trim():n[0].trim();i.push({type:"system",content:N,label:a})}const f=t.slice(h).trim();return f&&i.push({type:"text",content:f}),i}static extractUserTexts(t){const i=[],l=[];let h=null;for(const n of t)if(n.role==="user"){if(typeof n.content=="string"){const f=n.content.trim();if(!f)continue;if(!gt(f)){if(/Implement the following plan:/i.test(f))continue;i.push(f),l.push(f)}}else if(Array.isArray(n.content)){const{commands:f,textBlocks:x}=bt(n.content);f.length>0&&(h=f[f.length-1]);const a=[];for(const d of x)/Implement the following plan:/i.test((d.text||"").trim())||a.push(d.text.trim());const m=n.content.filter(d=>{var N;return d.type==="text"&&((N=d.text)==null?void 0:N.trim())}).map(d=>d.text.trim());a.length>0&&(i.push(a.join(`
|
|
9
|
-
`)),l.push(m.join(`
|
|
10
|
-
`)))}}return{userMsgs:i,fullTexts:l,slashCmd:h}}extractUserPrompts(t){var f;const i=[],l=new Set;let h=null;const n=t.filter(x=>ge(x));for(let x=0;x<n.length;x++){const a=n[x],m=((f=a.body)==null?void 0:f.messages)||[],d=a.timestamp||"",{userMsgs:N,fullTexts:y,slashCmd:v}=J.extractUserTexts(m);v&&v!=="/compact"&&v!==h&&i.push({type:"prompt",segments:[{type:"text",content:v}],timestamp:d}),h=v;for(let w=0;w<N.length;w++){const _=N[w];if(l.has(_))continue;l.add(_);const u=y[w]||_;i.push({type:"prompt",segments:J.parseSegments(u),timestamp:d})}}return i}renderOriginalPrompt(t){const i=t.segments.filter(l=>l.type==="text");return i.length===0?null:e.jsx("div",{className:c.mobilePromptCard,children:i.map((l,h)=>e.jsx("pre",{className:c.mobilePromptPreText,children:l.content},h))})}render(){var x;const{filteredRequests:t,fileLoading:i,fileLoadingCount:l,mainAgentSessions:h}=this.renderPrepare();if(this.state.workspaceMode)return this.renderWorkspaceMode();const n=!!this._isLocalLog;let f=null;for(let a=t.length-1;a>=0;a--)if(ge(t[a])&&((x=t[a].body)!=null&&x.model)){f=t[a].body.model;break}return e.jsxs("div",{className:c.mobileCLIRoot,ref:this._layoutRef,onDragOver:this._onDragOver,onDragLeave:this._onDragLeave,onDrop:this._onDrop,children:[this.state.isDragging&&e.jsx("div",{className:c.dragOverlay,children:e.jsxs("div",{className:c.dragOverlayContent,children:[e.jsx(pt,{className:c.dragIcon}),e.jsx("p",{children:g("ui.dragDropHint")})]})}),e.jsxs("div",{className:c.mobileCLIHeader,children:[e.jsxs("div",{className:c.mobileCLIHeaderLeft,children:[e.jsx("button",{className:c.mobileMenuBtn,onClick:()=>this.setState(a=>({mobileMenuVisible:!a.mobileMenuVisible})),"aria-label":g("ui.mobileMenu"),children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[e.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),e.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}),ue&&!n?(()=>{var N,y,v;const a=this.state.contextWindow;let m=0;if((a==null?void 0:a.used_percentage)!=null)m=Math.min(100,Math.max(0,Math.round(a.used_percentage/83.5*100)));else if(t.length>0){for(let w=t.length-1;w>=0;w--)if(ge(t[w])&&((y=(N=t[w].response)==null?void 0:N.body)!=null&&y.usage)){const _=t[w].response.body.usage,u=(_.input_tokens||0)+(_.cache_creation_input_tokens||0)+(_.cache_read_input_tokens||0),S=((a==null?void 0:a.context_window_size)||jt(((v=t[w].body)==null?void 0:v.model)||this.state.settingsModel))*.835;S>0&&u>0&&(m=Math.min(100,Math.max(0,Math.round(u/S*100))));break}}m===0&&this._lastContextPercent>0?m=this._lastContextPercent:this._lastContextPercent=m;const d=m>=80?"var(--color-error-light)":m>=60?"var(--color-warning-light)":"var(--color-success)";return e.jsxs("span",{className:c.mobileCtxTag,style:{borderColor:d,color:d},children:[e.jsx("span",{className:c.mobileCtxTagFill,style:{width:`${m}%`,backgroundColor:d}}),e.jsxs("span",{className:c.mobileCtxTagContent,children:[g("ui.liveMonitoring"),this.state.projectName?`: ${this.state.projectName}`:""]})]})})():e.jsxs(e.Fragment,{children:[e.jsx(De,{status:"processing",color:"green"}),e.jsx("span",{className:c.mobileCLIStatusLabel,children:n?g("ui.historyLog",{file:this._localLogFile}):g("ui.liveMonitoring")+(this.state.projectName?`: ${this.state.projectName}`:"")})]})]}),e.jsxs("div",{className:c.mobileCLIHeaderRight,children:[n?e.jsx(G,{type:"text",size:"small",icon:e.jsx(Gt,{}),onClick:()=>history.back(),className:c.mobileNavBtn,children:g("ui.mobileGoBack")}):this.state.hasGit?e.jsx(G,{type:"text",size:"small",icon:e.jsx(vt,{}),onClick:()=>this.setState(a=>({mobileGitDiffVisible:!a.mobileGitDiffVisible,mobileChatVisible:!1,mobileTerminalVisible:!1,mobileStatsVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileFileExplorerVisible:!1})),style:{color:this.state.mobileGitDiffVisible?"var(--color-primary)":"var(--text-tertiary)",fontSize:12},children:this.state.mobileGitDiffVisible?g("ui.mobileGitDiffExit"):g("ui.mobileGitDiffBrowse")}):null,!n&&e.jsx(G,{type:"text",size:"small",icon:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"4 17 10 11 4 5"}),e.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]}),onClick:()=>this.setState(a=>({mobileTerminalVisible:!a.mobileTerminalVisible,mobileGitDiffVisible:!1,mobileStatsVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileFileExplorerVisible:!1})),style:{color:this.state.mobileTerminalVisible?"var(--color-primary)":"var(--text-tertiary)",fontSize:12},children:this.state.mobileTerminalVisible?g("ui.mobileTerminalExit"):g("ui.mobileTerminalBrowse")})]}),this.state.mobileMenuVisible&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:c.mobileMenuOverlay,onClick:()=>this.setState({mobileMenuVisible:!1})}),e.jsxs("div",{className:c.mobileMenuDropdown,children:[e.jsxs("button",{className:c.mobileMenuItem,onClick:()=>{this.setState({mobileMenuVisible:!1,mobileLogMgmtVisible:!0,mobileStatsVisible:!1,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileTerminalVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileFileExplorerVisible:!1}),this.handleImportLocalLogs()},children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"}),e.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),e.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]}),g("ui.logManagement")]}),e.jsxs("button",{className:c.mobileMenuItem,onClick:()=>{this.setState({mobileMenuVisible:!1,mobileStatsVisible:!0,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileTerminalVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileFileExplorerVisible:!1})},children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"7",height:"7"}),e.jsx("rect",{x:"14",y:"3",width:"7",height:"7"}),e.jsx("rect",{x:"3",y:"14",width:"7",height:"7"}),e.jsx("rect",{x:"14",y:"14",width:"7",height:"7"})]}),g("ui.tokenStats")]}),e.jsxs("button",{className:c.mobileMenuItem,onClick:()=>{this.setState({mobileMenuVisible:!1,mobileSettingsVisible:!0,mobileStatsVisible:!1,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileTerminalVisible:!1,mobileLogMgmtVisible:!1,mobilePromptVisible:!1,mobileFileExplorerVisible:!1})},children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),g("ui.settings")]}),!n&&e.jsxs("button",{className:c.mobileMenuItem,onClick:()=>{this.setState({mobileMenuVisible:!1,mobileFileExplorerVisible:!0,mobileStatsVisible:!1,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileTerminalVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1})},children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),g("ui.projectFolder")]}),e.jsxs("button",{className:c.mobileMenuItem,onClick:()=>{this.setState({mobileMenuVisible:!1,mobilePromptVisible:!0,mobileStatsVisible:!1,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileTerminalVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobileFileExplorerVisible:!1})},children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"}),e.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"12",x2:"9",y2:"15"}),e.jsx("line",{x1:"12",y1:"12",x2:"15",y2:"15"})]}),g("ui.userPrompt")]})]})]})]}),e.jsxs("div",{className:c.mobileCLIBody,children:[!n&&e.jsxs(e.Fragment,{children:[i&&e.jsxs("div",{className:c.mobileLoadingOverlay,children:[e.jsx("div",{className:c.mobileLoadingSpinner}),e.jsxs("div",{className:c.mobileLoadingLabel,children:[g("ui.loadingChat"),l>0?` (${l})`:""]})]}),e.jsx(Se,{theme:this.themeConfig,children:e.jsx("div",{className:c.mobileChatInner,children:e.jsx(Nt,{requests:t,mainAgentSessions:h,streamingLatest:this.state.streamingLatest,userProfile:this.state.userProfile,collapseToolResults:this.state.collapseToolResults,expandThinking:this.state.expandThinking,showFullToolContent:this.state.showFullToolContent,showThinkingSummaries:this.state.showThinkingSummaries,onViewRequest:null,scrollToTimestamp:null,onScrollTsDone:()=>{},cliMode:this.state.cliMode,sdkMode:this.state.sdkMode,terminalVisible:this.state.mobileTerminalVisible,mobileChatVisible:!0,fileLoading:this.state.fileLoading,isStreaming:this.state.isStreaming,hasMoreHistory:this.state.hasMoreHistory,loadingMore:this.state.loadingMore,onLoadMoreHistory:()=>this.loadMoreHistory(),loadingSessionId:this.state.loadingSessionId,onLoadSession:a=>this.loadSession(a),onPendingPermission:this.handlePendingPermission,onPendingPlanApproval:this.handlePendingPlanApproval,pendingUploadPaths:this.state.pendingUploadPaths,onUploadPathsConsumed:this.handleUploadPathsConsumed,onMobileOpenFile:this._handleMobileOpenFile})})})]}),!n&&e.jsx("div",{className:`${c.mobileChatOverlay} ${this.state.mobileTerminalVisible?c.mobileChatOverlayVisible:""}`,children:e.jsx(yt,{modelName:f,onFilePath:this._handleTerminalFilePath,pendingImages:this.state.terminalPendingImages,onRemovePendingImage:this._handleRemoveTerminalImage,onClearPendingImages:this._handleClearTerminalImages})}),e.jsx("div",{className:`${c.mobileGitDiffOverlay} ${this.state.mobileGitDiffVisible?c.mobileGitDiffOverlayVisible:""}`,children:e.jsx("div",{className:c.mobileGitDiffInner,children:e.jsx(Os,{visible:this.state.mobileGitDiffVisible,onClose:()=>this.setState({mobileGitDiffVisible:!1})})})}),e.jsx("div",{className:`${c.mobileFileExplorerOverlay} ${this.state.mobileFileExplorerVisible?c.mobileFileExplorerOverlayVisible:""}`,children:e.jsx("div",{className:c.mobileFileExplorerInner,children:e.jsx(oi,{visible:this.state.mobileFileExplorerVisible,onClose:()=>this.setState({mobileFileExplorerVisible:!1,mobileFileExplorerTarget:null}),targetFile:this.state.mobileFileExplorerTarget})})}),e.jsx("div",{className:`${c.mobileStatsOverlay} ${this.state.mobileStatsVisible?c.mobileStatsOverlayVisible:""}`,children:e.jsx("div",{className:c.mobileStatsInner,children:e.jsx(pi,{requests:t,visible:this.state.mobileStatsVisible,onClose:()=>this.setState({mobileStatsVisible:!1})})})}),e.jsxs("div",{className:`${c.mobileLogMgmtOverlay} ${this.state.mobileLogMgmtVisible?c.mobileLogMgmtOverlayVisible:""}`,children:[e.jsxs("div",{className:c.mobileLogMgmtHeader,children:[e.jsxs("span",{className:c.mobileLogMgmtTitle,children:[e.jsx(St,{apiEndpoint:z("/api/open-log-dir"),title:g("ui.openLogDir"),size:14}),g("ui.importLocalLogs")]}),e.jsx("button",{className:c.mobileLogMgmtClose,onClick:()=>this.setState({mobileLogMgmtVisible:!1,selectedLogs:new Set}),children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsxs("div",{className:c.mobileLogMgmtActions,children:[e.jsx(G,{size:"small",type:this.state.selectedLogs.size>=2?"primary":"default",disabled:this.state.selectedLogs.size<2,onClick:this.handleMergeLogs,style:this.state.selectedLogs.size<2?{color:"var(--text-muted)",borderColor:"var(--border-light)"}:void 0,children:g("ui.mergeLogs")}),e.jsx(G,{size:"small",icon:e.jsx(Ct,{}),disabled:this.state.selectedLogs.size===0,onClick:this.handleDeleteLogs,style:this.state.selectedLogs.size===0?{color:"var(--text-muted)",borderColor:"var(--border-light)"}:{color:"var(--color-error-light)",borderColor:"var(--color-error-light)"},children:g("ui.deleteLogs")}),e.jsx(G,{size:"small",icon:e.jsx(_t,{spin:this.state.refreshingStats}),loading:this.state.refreshingStats,onClick:this.handleRefreshStats,children:g("ui.refreshStats")})]}),e.jsx("div",{className:c.mobileLogMgmtBody,children:this.state.localLogsLoading?e.jsx("div",{className:c.spinCenter,children:e.jsx(wt,{})}):(()=>{const a=this.state.localLogs[this.state.currentProject];return!a||a.length===0?e.jsx("div",{className:c.emptyCenter,children:g("ui.noLogs")}):e.jsx(Se,{theme:this.themeConfig,children:e.jsx("div",{className:c.logListContainer,children:this.renderLogTable(a,!0)})})})()})]}),e.jsxs("div",{className:`${c.mobileSettingsOverlay} ${this.state.mobileSettingsVisible?c.mobileSettingsOverlayVisible:""}`,children:[e.jsxs("div",{className:c.mobileLogMgmtHeader,children:[e.jsx("span",{className:c.mobileLogMgmtTitle,children:g("ui.settings")}),e.jsx("button",{className:c.mobileLogMgmtClose,onClick:()=>this.setState({mobileSettingsVisible:!1}),children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsxs("div",{className:c.mobileSettingsBody,children:[e.jsx("div",{className:c.mobileSettingsSectionTitle,children:g("ui.chatDisplaySwitches")}),e.jsxs("div",{className:c.mobileSettingsRow,children:[e.jsx("span",{className:c.mobileSettingsLabel,children:g("ui.collapseToolResults")}),e.jsx(be,{checked:!!this.state.collapseToolResults,onChange:this.handleCollapseToolResultsChange})]}),e.jsxs("div",{className:c.mobileSettingsRow,children:[e.jsx("span",{className:c.mobileSettingsLabel,children:g("ui.expandThinking")}),e.jsx(be,{checked:!!this.state.expandThinking,onChange:this.handleExpandThinkingChange})]}),e.jsxs("div",{className:c.mobileSettingsRow,children:[e.jsx("span",{className:c.mobileSettingsLabel,children:g("ui.showFullToolContent")}),e.jsx(be,{checked:!!this.state.showFullToolContent,onChange:this.handleShowFullToolContentChange})]}),e.jsx("div",{className:c.mobileSettingsSectionTitle,children:g("ui.themeColor")}),e.jsx("div",{className:c.mobileSettingsRow,children:e.jsx(Ce,{size:"small",value:this.state.themeColor||"dark",onChange:this.handleThemeColorChange,options:[{label:g("ui.themeColor.dark"),value:"dark"},{label:g("ui.themeColor.light"),value:"light"}],style:{width:140}})}),e.jsx("div",{className:c.mobileSettingsSectionTitle,children:g("ui.permission.autoApprove.setting")}),e.jsx("div",{className:c.mobileSettingsRow,children:e.jsx(Ce,{size:"small",value:this.state.autoApproveSeconds||0,onChange:this.handleAutoApproveChange,options:[{label:g("ui.permission.autoApprove.off"),value:0},{label:"3s",value:3},{label:"5s",value:5},{label:"10s",value:10},{label:"15s",value:15},{label:"20s",value:20},{label:"30s",value:30},{label:"60s",value:60}],style:{width:100}})})]})]}),e.jsxs("div",{className:`${c.mobilePromptOverlay} ${this.state.mobilePromptVisible?c.mobilePromptOverlayVisible:""}`,children:[e.jsxs("div",{className:c.mobileLogMgmtHeader,children:[e.jsx("span",{className:c.mobileLogMgmtTitle,children:g("ui.userPrompt")}),e.jsx("button",{className:c.mobileLogMgmtClose,onClick:()=>this.setState({mobilePromptVisible:!1}),children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx("div",{className:c.mobilePromptBody,children:(()=>{const a=this.extractUserPrompts(t);return a.length===0?e.jsx("div",{className:c.mobilePromptEmpty,children:g("ui.noPrompt")}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:c.mobilePromptHeader,children:[e.jsxs("span",{className:c.mobilePromptCount,children:[a.length," ",g("ui.promptCountUnit")]}),e.jsx(G,{size:"small",icon:e.jsx(Tt,{}),onClick:()=>this.handleExportPromptsTxt(a),children:g("ui.exportPromptsTxt")})]}),e.jsx("div",{className:c.mobilePromptList,children:a.map((m,d)=>e.jsxs("div",{className:c.mobilePromptItem,children:[m.timestamp&&e.jsx("div",{className:c.mobilePromptTimestamp,children:new Date(m.timestamp).toLocaleString()}),this.renderOriginalPrompt(m)]},d))})]})})()})]})]}),this.state.globalPermission&&e.jsx(_e,{toolName:this.state.globalPermission.permission.toolName,toolInput:this.state.globalPermission.permission.input,requestId:this.state.globalPermission.permission.id,onAllow:this.state.globalPermission.handlers.allow,onAllowSession:this.state.globalPermission.handlers.allowSession,onDeny:this.state.globalPermission.handlers.deny,visible:!0,global:!0,autoApproveSeconds:this.state.autoApproveSeconds,onAutoApproveChange:this.handleAutoApproveChange,modelName:this.state.globalPermission.modelName}),this.state.globalPlanApproval&&e.jsx(_e,{toolName:"ExitPlanMode",toolInput:this.state.globalPlanApproval.plan.input,requestId:this.state.globalPlanApproval.plan.id,onAllow:this.state.globalPlanApproval.handlers.approve,onDeny:a=>this.state.globalPlanApproval.handlers.reject(a,""),visible:!0,global:!0})]})}};R(J,"COMMAND_TAGS",new Set(["command-name","command-message","command-args","local-command-caveat","local-command-stdout"]));let Le=J;export{Le as default};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import{_ as dt,H as ke,X as Ze,l as Se,b as qe,a as Qe,p as Je,q as Ke,g as je,s as _e,y as tr,E as er,F as rr,C as ir,c as Ee,aj as me,aI as pe,i as ar,d as nr,x as or,aJ as sr,aK as hr}from"./mermaid.core-CcE8BsIy.js";import{p as lr}from"./chunk-4BX2VUAB-BFxgafgd.js";import{p as fr}from"./wardley-RL74JXVD-DBS4ToLP.js";import{c as Fe}from"./cytoscape.esm-DxGcaOPV.js";import{g as cr}from"./index-CIrnsaQS.js";import"./AppHeader.module-DPnQHzzR.js";import"./min-CgMHjcOo.js";import"./_baseUniq-43cnlw-r.js";var he={exports:{}},le={exports:{}},fe={exports:{}},gr=fe.exports,Me;function ur(){return Me||(Me=1,(function(R,M){(function(P,L){R.exports=L()})(gr,function(){return(function(A){var P={};function L(g){if(P[g])return P[g].exports;var l=P[g]={i:g,l:!1,exports:{}};return A[g].call(l.exports,l,l.exports,L),l.l=!0,l.exports}return L.m=A,L.c=P,L.i=function(g){return g},L.d=function(g,l,a){L.o(g,l)||Object.defineProperty(g,l,{configurable:!1,enumerable:!0,get:a})},L.n=function(g){var l=g&&g.__esModule?function(){return g.default}:function(){return g};return L.d(l,"a",l),l},L.o=function(g,l){return Object.prototype.hasOwnProperty.call(g,l)},L.p="",L(L.s=28)})([(function(A,P,L){function g(){}g.QUALITY=1,g.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,g.DEFAULT_INCREMENTAL=!1,g.DEFAULT_ANIMATION_ON_LAYOUT=!0,g.DEFAULT_ANIMATION_DURING_LAYOUT=!1,g.DEFAULT_ANIMATION_PERIOD=50,g.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,g.DEFAULT_GRAPH_MARGIN=15,g.NODE_DIMENSIONS_INCLUDE_LABELS=!1,g.SIMPLE_NODE_SIZE=40,g.SIMPLE_NODE_HALF_SIZE=g.SIMPLE_NODE_SIZE/2,g.EMPTY_COMPOUND_NODE_SIZE=40,g.MIN_EDGE_LENGTH=1,g.WORLD_BOUNDARY=1e6,g.INITIAL_WORLD_BOUNDARY=g.WORLD_BOUNDARY/1e3,g.WORLD_CENTER_X=1200,g.WORLD_CENTER_Y=900,A.exports=g}),(function(A,P,L){var g=L(2),l=L(8),a=L(9);function e(f,i,u){g.call(this,u),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=u,this.bendpoints=[],this.source=f,this.target=i}e.prototype=Object.create(g.prototype);for(var r in g)e[r]=g[r];e.prototype.getSource=function(){return this.source},e.prototype.getTarget=function(){return this.target},e.prototype.isInterGraph=function(){return this.isInterGraph},e.prototype.getLength=function(){return this.length},e.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},e.prototype.getBendpoints=function(){return this.bendpoints},e.prototype.getLca=function(){return this.lca},e.prototype.getSourceInLca=function(){return this.sourceInLca},e.prototype.getTargetInLca=function(){return this.targetInLca},e.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},e.prototype.getOtherEndInGraph=function(f,i){for(var u=this.getOtherEnd(f),t=i.getGraphManager().getRoot();;){if(u.getOwner()==i)return u;if(u.getOwner()==t)break;u=u.getOwner().getParent()}return null},e.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=l.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},e.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},A.exports=e}),(function(A,P,L){function g(l){this.vGraphObject=l}A.exports=g}),(function(A,P,L){var g=L(2),l=L(10),a=L(13),e=L(0),r=L(16),f=L(5);function i(t,s,o,c){o==null&&c==null&&(c=s),g.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=l.MIN_VALUE,this.inclusionTreeDepth=l.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new a(s.x,s.y,o.width,o.height):this.rect=new a}i.prototype=Object.create(g.prototype);for(var u in g)i[u]=g[u];i.prototype.getEdges=function(){return this.edges},i.prototype.getChild=function(){return this.child},i.prototype.getOwner=function(){return this.owner},i.prototype.getWidth=function(){return this.rect.width},i.prototype.setWidth=function(t){this.rect.width=t},i.prototype.getHeight=function(){return this.rect.height},i.prototype.setHeight=function(t){this.rect.height=t},i.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},i.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},i.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},i.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},i.prototype.getRect=function(){return this.rect},i.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},i.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},i.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},i.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},i.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},i.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},i.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},i.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},i.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},i.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),h=0;h<c.length;h++)s=c[h],o=s.withChildren(),o.forEach(function(T){t.add(T)});return t},i.prototype.getNoOfChildren=function(){var t=0,s;if(this.child==null)t=1;else for(var o=this.child.getNodes(),c=0;c<o.length;c++)s=o[c],t+=s.getNoOfChildren();return t==0&&(t=1),t},i.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},i.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},i.prototype.scatter=function(){var t,s,o=-e.INITIAL_WORLD_BOUNDARY,c=e.INITIAL_WORLD_BOUNDARY;t=e.WORLD_CENTER_X+r.nextDouble()*(c-o)+o;var h=-e.INITIAL_WORLD_BOUNDARY,T=e.INITIAL_WORLD_BOUNDARY;s=e.WORLD_CENTER_Y+r.nextDouble()*(T-h)+h,this.rect.x=t,this.rect.y=s},i.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),e.NODE_DIMENSIONS_INCLUDE_LABELS){var s=t.getRight()-t.getLeft(),o=t.getBottom()-t.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(s+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>s?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},i.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==l.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},i.prototype.transform=function(t){var s=this.rect.x;s>e.WORLD_BOUNDARY?s=e.WORLD_BOUNDARY:s<-e.WORLD_BOUNDARY&&(s=-e.WORLD_BOUNDARY);var o=this.rect.y;o>e.WORLD_BOUNDARY?o=e.WORLD_BOUNDARY:o<-e.WORLD_BOUNDARY&&(o=-e.WORLD_BOUNDARY);var c=new f(s,o),h=t.inverseTransformPoint(c);this.setLocation(h.x,h.y)},i.prototype.getLeft=function(){return this.rect.x},i.prototype.getRight=function(){return this.rect.x+this.rect.width},i.prototype.getTop=function(){return this.rect.y},i.prototype.getBottom=function(){return this.rect.y+this.rect.height},i.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},A.exports=i}),(function(A,P,L){var g=L(0);function l(){}for(var a in g)l[a]=g[a];l.MAX_ITERATIONS=2500,l.DEFAULT_EDGE_LENGTH=50,l.DEFAULT_SPRING_STRENGTH=.45,l.DEFAULT_REPULSION_STRENGTH=4500,l.DEFAULT_GRAVITY_STRENGTH=.4,l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,l.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,l.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,l.COOLING_ADAPTATION_FACTOR=.33,l.ADAPTATION_LOWER_NODE_LIMIT=1e3,l.ADAPTATION_UPPER_NODE_LIMIT=5e3,l.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,l.MAX_NODE_DISPLACEMENT=l.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,l.CONVERGENCE_CHECK_PERIOD=100,l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,l.MIN_EDGE_LENGTH=1,l.GRID_CALCULATION_CHECK_PERIOD=10,A.exports=l}),(function(A,P,L){function g(l,a){l==null&&a==null?(this.x=0,this.y=0):(this.x=l,this.y=a)}g.prototype.getX=function(){return this.x},g.prototype.getY=function(){return this.y},g.prototype.setX=function(l){this.x=l},g.prototype.setY=function(l){this.y=l},g.prototype.getDifference=function(l){return new DimensionD(this.x-l.x,this.y-l.y)},g.prototype.getCopy=function(){return new g(this.x,this.y)},g.prototype.translate=function(l){return this.x+=l.width,this.y+=l.height,this},A.exports=g}),(function(A,P,L){var g=L(2),l=L(10),a=L(0),e=L(7),r=L(3),f=L(1),i=L(13),u=L(12),t=L(11);function s(c,h,T){g.call(this,T),this.estimatedSize=l.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,h!=null&&h instanceof e?this.graphManager=h:h!=null&&h instanceof Layout&&(this.graphManager=h.graphManager)}s.prototype=Object.create(g.prototype);for(var o in g)s[o]=g[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,h,T){if(h==null&&T==null){var d=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(d)>-1)throw"Node already in graph!";return d.owner=this,this.getNodes().push(d),d}else{var v=c;if(!(this.getNodes().indexOf(h)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(h.owner==T.owner&&h.owner==this))throw"Both owners must be this graph!";return h.owner!=T.owner?null:(v.source=h,v.target=T,v.isInterGraph=!1,this.getEdges().push(v),h.edges.push(v),T!=h&&T.edges.push(v),v)}},s.prototype.remove=function(c){var h=c;if(c instanceof r){if(h==null)throw"Node is null!";if(!(h.owner!=null&&h.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=h.edges.slice(),d,v=T.length,N=0;N<v;N++)d=T[N],d.isInterGraph?this.graphManager.remove(d):d.source.owner.remove(d);var F=this.nodes.indexOf(h);if(F==-1)throw"Node not in owner node list!";this.nodes.splice(F,1)}else if(c instanceof f){var d=c;if(d==null)throw"Edge is null!";if(!(d.source!=null&&d.target!=null))throw"Source and/or target is null!";if(!(d.source.owner!=null&&d.target.owner!=null&&d.source.owner==this&&d.target.owner==this))throw"Source and/or target owner is invalid!";var C=d.source.edges.indexOf(d),G=d.target.edges.indexOf(d);if(!(C>-1&&G>-1))throw"Source and/or target doesn't know this edge!";d.source.edges.splice(C,1),d.target!=d.source&&d.target.edges.splice(G,1);var F=d.source.owner.getEdges().indexOf(d);if(F==-1)throw"Not in owner's edge list!";d.source.owner.getEdges().splice(F,1)}},s.prototype.updateLeftTop=function(){for(var c=l.MAX_VALUE,h=l.MAX_VALUE,T,d,v,N=this.getNodes(),F=N.length,C=0;C<F;C++){var G=N[C];T=G.getTop(),d=G.getLeft(),c>T&&(c=T),h>d&&(h=d)}return c==l.MAX_VALUE?null:(N[0].getParent().paddingLeft!=null?v=N[0].getParent().paddingLeft:v=this.margin,this.left=h-v,this.top=c-v,new u(this.left,this.top))},s.prototype.updateBounds=function(c){for(var h=l.MAX_VALUE,T=-l.MAX_VALUE,d=l.MAX_VALUE,v=-l.MAX_VALUE,N,F,C,G,Z,X=this.nodes,K=X.length,D=0;D<K;D++){var rt=X[D];c&&rt.child!=null&&rt.updateBounds(),N=rt.getLeft(),F=rt.getRight(),C=rt.getTop(),G=rt.getBottom(),h>N&&(h=N),T<F&&(T=F),d>C&&(d=C),v<G&&(v=G)}var n=new i(h,d,T-h,v-d);h==l.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),X[0].getParent().paddingLeft!=null?Z=X[0].getParent().paddingLeft:Z=this.margin,this.left=n.x-Z,this.right=n.x+n.width+Z,this.top=n.y-Z,this.bottom=n.y+n.height+Z},s.calculateBounds=function(c){for(var h=l.MAX_VALUE,T=-l.MAX_VALUE,d=l.MAX_VALUE,v=-l.MAX_VALUE,N,F,C,G,Z=c.length,X=0;X<Z;X++){var K=c[X];N=K.getLeft(),F=K.getRight(),C=K.getTop(),G=K.getBottom(),h>N&&(h=N),T<F&&(T=F),d>C&&(d=C),v<G&&(v=G)}var D=new i(h,d,T-h,v-d);return D},s.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},s.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},s.prototype.calcEstimatedSize=function(){for(var c=0,h=this.nodes,T=h.length,d=0;d<T;d++){var v=h[d];c+=v.calcEstimatedSize()}return c==0?this.estimatedSize=a.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=c/Math.sqrt(this.nodes.length),this.estimatedSize},s.prototype.updateConnected=function(){var c=this;if(this.nodes.length==0){this.isConnected=!0;return}var h=new t,T=new Set,d=this.nodes[0],v,N,F=d.withChildren();for(F.forEach(function(D){h.push(D),T.add(D)});h.length!==0;){d=h.shift(),v=d.getEdges();for(var C=v.length,G=0;G<C;G++){var Z=v[G];if(N=Z.getOtherEndInGraph(d,this),N!=null&&!T.has(N)){var X=N.withChildren();X.forEach(function(D){h.push(D),T.add(D)})}}}if(this.isConnected=!1,T.size>=this.nodes.length){var K=0;T.forEach(function(D){D.owner==c&&K++}),K==this.nodes.length&&(this.isConnected=!0)}},A.exports=s}),(function(A,P,L){var g,l=L(1);function a(e){g=L(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),r=this.layout.newNode(null),f=this.add(e,r);return this.setRootGraph(f),this.rootGraph},a.prototype.add=function(e,r,f,i,u){if(f==null&&i==null&&u==null){if(e==null)throw"Graph is null!";if(r==null)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),e.parent!=null)throw"Already has a parent!";if(r.child!=null)throw"Already has a child!";return e.parent=r,r.child=e,e}else{u=f,i=r,f=e;var t=i.getOwner(),s=u.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,i,u);if(f.isInterGraph=!0,f.source=i,f.target=u,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},a.prototype.remove=function(e){if(e instanceof g){var r=e;if(r.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(r==this.rootGraph||r.parent!=null&&r.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(r.getEdges());for(var i,u=f.length,t=0;t<u;t++)i=f[t],r.remove(i);var s=[];s=s.concat(r.getNodes());var o;u=s.length;for(var t=0;t<u;t++)o=s[t],r.remove(o);r==this.rootGraph&&this.setRootGraph(null);var c=this.graphs.indexOf(r);this.graphs.splice(c,1),r.parent=null}else if(e instanceof l){if(i=e,i==null)throw"Edge is null!";if(!i.isInterGraph)throw"Not an inter-graph edge!";if(!(i.source!=null&&i.target!=null))throw"Source and/or target is null!";if(!(i.source.edges.indexOf(i)!=-1&&i.target.edges.indexOf(i)!=-1))throw"Source and/or target doesn't know this edge!";var c=i.source.edges.indexOf(i);if(i.source.edges.splice(c,1),c=i.target.edges.indexOf(i),i.target.edges.splice(c,1),!(i.source.owner!=null&&i.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(i.source.owner.getGraphManager().edges.indexOf(i)==-1)throw"Not in owner graph manager's edge list!";var c=i.source.owner.getGraphManager().edges.indexOf(i);i.source.owner.getGraphManager().edges.splice(c,1)}},a.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},a.prototype.getGraphs=function(){return this.graphs},a.prototype.getAllNodes=function(){if(this.allNodes==null){for(var e=[],r=this.getGraphs(),f=r.length,i=0;i<f;i++)e=e.concat(r[i].getNodes());this.allNodes=e}return this.allNodes},a.prototype.resetAllNodes=function(){this.allNodes=null},a.prototype.resetAllEdges=function(){this.allEdges=null},a.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},a.prototype.getAllEdges=function(){if(this.allEdges==null){var e=[],r=this.getGraphs();r.length;for(var f=0;f<r.length;f++)e=e.concat(r[f].getEdges());e=e.concat(this.edges),this.allEdges=e}return this.allEdges},a.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},a.prototype.setAllNodesToApplyGravitation=function(e){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=e},a.prototype.getRoot=function(){return this.rootGraph},a.prototype.setRootGraph=function(e){if(e.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=e,e.parent==null&&(e.parent=this.layout.newNode("Root node"))},a.prototype.getLayout=function(){return this.layout},a.prototype.isOneAncestorOfOther=function(e,r){if(!(e!=null&&r!=null))throw"assert failed";if(e==r)return!0;var f=e.getOwner(),i;do{if(i=f.getParent(),i==null)break;if(i==r)return!0;if(f=i.getOwner(),f==null)break}while(!0);f=r.getOwner();do{if(i=f.getParent(),i==null)break;if(i==e)return!0;if(f=i.getOwner(),f==null)break}while(!0);return!1},a.prototype.calcLowestCommonAncestors=function(){for(var e,r,f,i,u,t=this.getAllEdges(),s=t.length,o=0;o<s;o++){if(e=t[o],r=e.source,f=e.target,e.lca=null,e.sourceInLca=r,e.targetInLca=f,r==f){e.lca=r.getOwner();continue}for(i=r.getOwner();e.lca==null;){for(e.targetInLca=f,u=f.getOwner();e.lca==null;){if(u==i){e.lca=u;break}if(u==this.rootGraph)break;if(e.lca!=null)throw"assert failed";e.targetInLca=u.getParent(),u=e.targetInLca.getOwner()}if(i==this.rootGraph)break;e.lca==null&&(e.sourceInLca=i.getParent(),i=e.sourceInLca.getOwner())}if(e.lca==null)throw"assert failed"}},a.prototype.calcLowestCommonAncestor=function(e,r){if(e==r)return e.getOwner();var f=e.getOwner();do{if(f==null)break;var i=r.getOwner();do{if(i==null)break;if(i==f)return i;i=i.getParent().getOwner()}while(!0);f=f.getParent().getOwner()}while(!0);return f},a.prototype.calcInclusionTreeDepths=function(e,r){e==null&&r==null&&(e=this.rootGraph,r=1);for(var f,i=e.getNodes(),u=i.length,t=0;t<u;t++)f=i[t],f.inclusionTreeDepth=r,f.child!=null&&this.calcInclusionTreeDepths(f.child,r+1)},a.prototype.includesInvalidEdge=function(){for(var e,r=[],f=this.edges.length,i=0;i<f;i++)e=this.edges[i],this.isOneAncestorOfOther(e.source,e.target)&&r.push(e);for(var i=0;i<r.length;i++)this.remove(r[i]);return!1},A.exports=a}),(function(A,P,L){var g=L(12);function l(){}l.calcSeparationAmount=function(a,e,r,f){if(!a.intersects(e))throw"assert failed";var i=new Array(2);this.decideDirectionsForOverlappingNodes(a,e,i),r[0]=Math.min(a.getRight(),e.getRight())-Math.max(a.x,e.x),r[1]=Math.min(a.getBottom(),e.getBottom())-Math.max(a.y,e.y),a.getX()<=e.getX()&&a.getRight()>=e.getRight()?r[0]+=Math.min(e.getX()-a.getX(),a.getRight()-e.getRight()):e.getX()<=a.getX()&&e.getRight()>=a.getRight()&&(r[0]+=Math.min(a.getX()-e.getX(),e.getRight()-a.getRight())),a.getY()<=e.getY()&&a.getBottom()>=e.getBottom()?r[1]+=Math.min(e.getY()-a.getY(),a.getBottom()-e.getBottom()):e.getY()<=a.getY()&&e.getBottom()>=a.getBottom()&&(r[1]+=Math.min(a.getY()-e.getY(),e.getBottom()-a.getBottom()));var u=Math.abs((e.getCenterY()-a.getCenterY())/(e.getCenterX()-a.getCenterX()));e.getCenterY()===a.getCenterY()&&e.getCenterX()===a.getCenterX()&&(u=1);var t=u*r[0],s=r[1]/u;r[0]<s?s=r[0]:t=r[1],r[0]=-1*i[0]*(s/2+f),r[1]=-1*i[1]*(t/2+f)},l.decideDirectionsForOverlappingNodes=function(a,e,r){a.getCenterX()<e.getCenterX()?r[0]=-1:r[0]=1,a.getCenterY()<e.getCenterY()?r[1]=-1:r[1]=1},l.getIntersection2=function(a,e,r){var f=a.getCenterX(),i=a.getCenterY(),u=e.getCenterX(),t=e.getCenterY();if(a.intersects(e))return r[0]=f,r[1]=i,r[2]=u,r[3]=t,!0;var s=a.getX(),o=a.getY(),c=a.getRight(),h=a.getX(),T=a.getBottom(),d=a.getRight(),v=a.getWidthHalf(),N=a.getHeightHalf(),F=e.getX(),C=e.getY(),G=e.getRight(),Z=e.getX(),X=e.getBottom(),K=e.getRight(),D=e.getWidthHalf(),rt=e.getHeightHalf(),n=!1,m=!1;if(f===u){if(i>t)return r[0]=f,r[1]=o,r[2]=u,r[3]=X,!1;if(i<t)return r[0]=f,r[1]=T,r[2]=u,r[3]=C,!1}else if(i===t){if(f>u)return r[0]=s,r[1]=i,r[2]=G,r[3]=t,!1;if(f<u)return r[0]=c,r[1]=i,r[2]=F,r[3]=t,!1}else{var p=a.height/a.width,E=e.height/e.width,y=(t-i)/(u-f),I=void 0,w=void 0,S=void 0,W=void 0,x=void 0,q=void 0;if(-p===y?f>u?(r[0]=h,r[1]=T,n=!0):(r[0]=c,r[1]=o,n=!0):p===y&&(f>u?(r[0]=s,r[1]=o,n=!0):(r[0]=d,r[1]=T,n=!0)),-E===y?u>f?(r[2]=Z,r[3]=X,m=!0):(r[2]=G,r[3]=C,m=!0):E===y&&(u>f?(r[2]=F,r[3]=C,m=!0):(r[2]=K,r[3]=X,m=!0)),n&&m)return!1;if(f>u?i>t?(I=this.getCardinalDirection(p,y,4),w=this.getCardinalDirection(E,y,2)):(I=this.getCardinalDirection(-p,y,3),w=this.getCardinalDirection(-E,y,1)):i>t?(I=this.getCardinalDirection(-p,y,1),w=this.getCardinalDirection(-E,y,3)):(I=this.getCardinalDirection(p,y,2),w=this.getCardinalDirection(E,y,4)),!n)switch(I){case 1:W=o,S=f+-N/y,r[0]=S,r[1]=W;break;case 2:S=d,W=i+v*y,r[0]=S,r[1]=W;break;case 3:W=T,S=f+N/y,r[0]=S,r[1]=W;break;case 4:S=h,W=i+-v*y,r[0]=S,r[1]=W;break}if(!m)switch(w){case 1:q=C,x=u+-rt/y,r[2]=x,r[3]=q;break;case 2:x=K,q=t+D*y,r[2]=x,r[3]=q;break;case 3:q=X,x=u+rt/y,r[2]=x,r[3]=q;break;case 4:x=Z,q=t+-D*y,r[2]=x,r[3]=q;break}}return!1},l.getCardinalDirection=function(a,e,r){return a>e?r:1+r%4},l.getIntersection=function(a,e,r,f){if(f==null)return this.getIntersection2(a,e,r);var i=a.x,u=a.y,t=e.x,s=e.y,o=r.x,c=r.y,h=f.x,T=f.y,d=void 0,v=void 0,N=void 0,F=void 0,C=void 0,G=void 0,Z=void 0,X=void 0,K=void 0;return N=s-u,C=i-t,Z=t*u-i*s,F=T-c,G=o-h,X=h*c-o*T,K=N*G-F*C,K===0?null:(d=(C*X-G*Z)/K,v=(F*Z-N*X)/K,new g(d,v))},l.angleOfVector=function(a,e,r,f){var i=void 0;return a!==r?(i=Math.atan((f-e)/(r-a)),r<a?i+=Math.PI:f<e&&(i+=this.TWO_PI)):f<e?i=this.ONE_AND_HALF_PI:i=this.HALF_PI,i},l.doIntersect=function(a,e,r,f){var i=a.x,u=a.y,t=e.x,s=e.y,o=r.x,c=r.y,h=f.x,T=f.y,d=(t-i)*(T-c)-(h-o)*(s-u);if(d===0)return!1;var v=((T-c)*(h-i)+(o-h)*(T-u))/d,N=((u-s)*(h-i)+(t-i)*(T-u))/d;return 0<v&&v<1&&0<N&&N<1},l.findCircleLineIntersections=function(a,e,r,f,i,u,t){var s=(r-a)*(r-a)+(f-e)*(f-e),o=2*((a-i)*(r-a)+(e-u)*(f-e)),c=(a-i)*(a-i)+(e-u)*(e-u)-t*t,h=o*o-4*s*c;if(h>=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),d=(-o-Math.sqrt(o*o-4*s*c))/(2*s),v=null;return T>=0&&T<=1?[T]:d>=0&&d<=1?[d]:v}else return null},l.HALF_PI=.5*Math.PI,l.ONE_AND_HALF_PI=1.5*Math.PI,l.TWO_PI=2*Math.PI,l.THREE_PI=3*Math.PI,A.exports=l}),(function(A,P,L){function g(){}g.sign=function(l){return l>0?1:l<0?-1:0},g.floor=function(l){return l<0?Math.ceil(l):Math.floor(l)},g.ceil=function(l){return l<0?Math.floor(l):Math.ceil(l)},A.exports=g}),(function(A,P,L){function g(){}g.MAX_VALUE=2147483647,g.MIN_VALUE=-2147483648,A.exports=g}),(function(A,P,L){var g=(function(){function i(u,t){for(var s=0;s<t.length;s++){var o=t[s];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(u,o.key,o)}}return function(u,t,s){return t&&i(u.prototype,t),s&&i(u,s),u}})();function l(i,u){if(!(i instanceof u))throw new TypeError("Cannot call a class as a function")}var a=function(u){return{value:u,next:null,prev:null}},e=function(u,t,s,o){return u!==null?u.next=t:o.head=t,s!==null?s.prev=t:o.tail=t,t.prev=u,t.next=s,o.length++,t},r=function(u,t){var s=u.prev,o=u.next;return s!==null?s.next=o:t.head=o,o!==null?o.prev=s:t.tail=s,u.prev=u.next=null,t.length--,u},f=(function(){function i(u){var t=this;l(this,i),this.length=0,this.head=null,this.tail=null,u!=null&&u.forEach(function(s){return t.push(s)})}return g(i,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,s){return e(s.prev,a(t),s,this)}},{key:"insertAfter",value:function(t,s){return e(s,a(t),s.next,this)}},{key:"insertNodeBefore",value:function(t,s){return e(s.prev,t,s,this)}},{key:"insertNodeAfter",value:function(t,s){return e(s,t,s.next,this)}},{key:"push",value:function(t){return e(this.tail,a(t),null,this)}},{key:"unshift",value:function(t){return e(null,a(t),this.head,this)}},{key:"remove",value:function(t){return r(t,this)}},{key:"pop",value:function(){return r(this.tail,this).value}},{key:"popNode",value:function(){return r(this.tail,this)}},{key:"shift",value:function(){return r(this.head,this).value}},{key:"shiftNode",value:function(){return r(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var s=1,o=this.head;s<t;)o=o.next,s++;return o.value}}},{key:"set_object_at",value:function(t,s){if(t<=this.length()){for(var o=1,c=this.head;o<t;)c=c.next,o++;c.value=s}}}]),i})();A.exports=f}),(function(A,P,L){function g(l,a,e){this.x=null,this.y=null,l==null&&a==null&&e==null?(this.x=0,this.y=0):typeof l=="number"&&typeof a=="number"&&e==null?(this.x=l,this.y=a):l.constructor.name=="Point"&&a==null&&e==null&&(e=l,this.x=e.x,this.y=e.y)}g.prototype.getX=function(){return this.x},g.prototype.getY=function(){return this.y},g.prototype.getLocation=function(){return new g(this.x,this.y)},g.prototype.setLocation=function(l,a,e){l.constructor.name=="Point"&&a==null&&e==null?(e=l,this.setLocation(e.x,e.y)):typeof l=="number"&&typeof a=="number"&&e==null&&(parseInt(l)==l&&parseInt(a)==a?this.move(l,a):(this.x=Math.floor(l+.5),this.y=Math.floor(a+.5)))},g.prototype.move=function(l,a){this.x=l,this.y=a},g.prototype.translate=function(l,a){this.x+=l,this.y+=a},g.prototype.equals=function(l){if(l.constructor.name=="Point"){var a=l;return this.x==a.x&&this.y==a.y}return this==l},g.prototype.toString=function(){return new g().constructor.name+"[x="+this.x+",y="+this.y+"]"},A.exports=g}),(function(A,P,L){function g(l,a,e,r){this.x=0,this.y=0,this.width=0,this.height=0,l!=null&&a!=null&&e!=null&&r!=null&&(this.x=l,this.y=a,this.width=e,this.height=r)}g.prototype.getX=function(){return this.x},g.prototype.setX=function(l){this.x=l},g.prototype.getY=function(){return this.y},g.prototype.setY=function(l){this.y=l},g.prototype.getWidth=function(){return this.width},g.prototype.setWidth=function(l){this.width=l},g.prototype.getHeight=function(){return this.height},g.prototype.setHeight=function(l){this.height=l},g.prototype.getRight=function(){return this.x+this.width},g.prototype.getBottom=function(){return this.y+this.height},g.prototype.intersects=function(l){return!(this.getRight()<l.x||this.getBottom()<l.y||l.getRight()<this.x||l.getBottom()<this.y)},g.prototype.getCenterX=function(){return this.x+this.width/2},g.prototype.getMinX=function(){return this.getX()},g.prototype.getMaxX=function(){return this.getX()+this.width},g.prototype.getCenterY=function(){return this.y+this.height/2},g.prototype.getMinY=function(){return this.getY()},g.prototype.getMaxY=function(){return this.getY()+this.height},g.prototype.getWidthHalf=function(){return this.width/2},g.prototype.getHeightHalf=function(){return this.height/2},A.exports=g}),(function(A,P,L){var g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function l(){}l.lastID=0,l.createID=function(a){return l.isPrimitive(a)?a:(a.uniqueID!=null||(a.uniqueID=l.getString(),l.lastID++),a.uniqueID)},l.getString=function(a){return a==null&&(a=l.lastID),"Object#"+a},l.isPrimitive=function(a){var e=typeof a>"u"?"undefined":g(a);return a==null||e!="object"&&e!="function"},A.exports=l}),(function(A,P,L){function g(o){if(Array.isArray(o)){for(var c=0,h=Array(o.length);c<o.length;c++)h[c]=o[c];return h}else return Array.from(o)}var l=L(0),a=L(7),e=L(3),r=L(1),f=L(6),i=L(5),u=L(17),t=L(29);function s(o){t.call(this),this.layoutQuality=l.QUALITY,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=l.DEFAULT_INCREMENTAL,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new a(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,o!=null&&(this.isRemoteUse=o)}s.RANDOM_SEED=1,s.prototype=Object.create(t.prototype),s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},s.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},s.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},s.prototype.newGraphManager=function(){var o=new a(this);return this.graphManager=o,o},s.prototype.newGraph=function(o){return new f(null,this.graphManager,o)},s.prototype.newNode=function(o){return new e(this.graphManager,o)},s.prototype.newEdge=function(o){return new r(null,null,o)},s.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},s.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var o;return this.checkLayoutSuccess()?o=!1:o=this.layout(),l.ANIMATE==="during"?!1:(o&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,o)},s.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},s.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var o=this.graphManager.getAllEdges(),c=0;c<o.length;c++)o[c];for(var h=this.graphManager.getRoot().getNodes(),c=0;c<h.length;c++)h[c];this.update(this.graphManager.getRoot())}},s.prototype.update=function(o){if(o==null)this.update2();else if(o instanceof e){var c=o;if(c.getChild()!=null)for(var h=c.getChild().getNodes(),T=0;T<h.length;T++)update(h[T]);if(c.vGraphObject!=null){var d=c.vGraphObject;d.update(c)}}else if(o instanceof r){var v=o;if(v.vGraphObject!=null){var N=v.vGraphObject;N.update(v)}}else if(o instanceof f){var F=o;if(F.vGraphObject!=null){var C=F.vGraphObject;C.update(F)}}},s.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=l.QUALITY,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=l.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},s.prototype.transform=function(o){if(o==null)this.transform(new i(0,0));else{var c=new u,h=this.graphManager.getRoot().updateLeftTop();if(h!=null){c.setWorldOrgX(o.x),c.setWorldOrgY(o.y),c.setDeviceOrgX(h.x),c.setDeviceOrgY(h.y);for(var T=this.getAllNodes(),d,v=0;v<T.length;v++)d=T[v],d.transform(c)}}},s.prototype.positionNodesRandomly=function(o){if(o==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var c,h,T=o.getNodes(),d=0;d<T.length;d++)c=T[d],h=c.getChild(),h==null||h.getNodes().length==0?c.scatter():(this.positionNodesRandomly(h),c.updateBounds())},s.prototype.getFlatForest=function(){for(var o=[],c=!0,h=this.graphManager.getRoot().getNodes(),T=!0,d=0;d<h.length;d++)h[d].getChild()!=null&&(T=!1);if(!T)return o;var v=new Set,N=[],F=new Map,C=[];for(C=C.concat(h);C.length>0&&c;){for(N.push(C[0]);N.length>0&&c;){var G=N[0];N.splice(0,1),v.add(G);for(var Z=G.getEdges(),d=0;d<Z.length;d++){var X=Z[d].getOtherEnd(G);if(F.get(G)!=X)if(!v.has(X))N.push(X),F.set(X,G);else{c=!1;break}}}if(!c)o=[];else{var K=[].concat(g(v));o.push(K);for(var d=0;d<K.length;d++){var D=K[d],rt=C.indexOf(D);rt>-1&&C.splice(rt,1)}v=new Set,F=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],h=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),d=0;d<o.bendpoints.length;d++){var v=this.newNode(null);v.setRect(new Point(0,0),new Dimension(1,1)),T.add(v);var N=this.newEdge(null);this.graphManager.add(N,h,v),c.add(v),h=v}var N=this.newEdge(null);return this.graphManager.add(N,h,o.target),this.edgeToDummyNodes.set(o,c),o.isInterGraph()?this.graphManager.remove(o):T.remove(o),c},s.prototype.createBendpointsFromDummyNodes=function(){var o=[];o=o.concat(this.graphManager.getAllEdges()),o=[].concat(g(this.edgeToDummyNodes.keys())).concat(o);for(var c=0;c<o.length;c++){var h=o[c];if(h.bendpoints.length>0){for(var T=this.edgeToDummyNodes.get(h),d=0;d<T.length;d++){var v=T[d],N=new i(v.getCenterX(),v.getCenterY()),F=h.bendpoints.get(d);F.x=N.x,F.y=N.y,v.getOwner().remove(v)}this.graphManager.add(h,h.source,h.target)}}},s.transform=function(o,c,h,T){if(h!=null&&T!=null){var d=c;if(o<=50){var v=c/h;d-=(c-v)/50*(50-o)}else{var N=c*T;d+=(N-c)/50*(o-50)}return d}else{var F,C;return o<=50?(F=9*c/500,C=c/10):(F=9*c/50,C=-8*c),F*o+C}},s.findCenterOfTree=function(o){var c=[];c=c.concat(o);var h=[],T=new Map,d=!1,v=null;(c.length==1||c.length==2)&&(d=!0,v=c[0]);for(var N=0;N<c.length;N++){var F=c[N],C=F.getNeighborsList().size;T.set(F,F.getNeighborsList().size),C==1&&h.push(F)}var G=[];for(G=G.concat(h);!d;){var Z=[];Z=Z.concat(G),G=[];for(var N=0;N<c.length;N++){var F=c[N],X=c.indexOf(F);X>=0&&c.splice(X,1);var K=F.getNeighborsList();K.forEach(function(n){if(h.indexOf(n)<0){var m=T.get(n),p=m-1;p==1&&G.push(n),T.set(n,p)}})}h=h.concat(G),(c.length==1||c.length==2)&&(d=!0,v=c[0])}return v},s.prototype.setGraphManager=function(o){this.graphManager=o},A.exports=s}),(function(A,P,L){function g(){}g.seed=1,g.x=0,g.nextDouble=function(){return g.x=Math.sin(g.seed++)*1e4,g.x-Math.floor(g.x)},A.exports=g}),(function(A,P,L){var g=L(5);function l(a,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}l.prototype.getWorldOrgX=function(){return this.lworldOrgX},l.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},l.prototype.getWorldOrgY=function(){return this.lworldOrgY},l.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},l.prototype.getWorldExtX=function(){return this.lworldExtX},l.prototype.setWorldExtX=function(a){this.lworldExtX=a},l.prototype.getWorldExtY=function(){return this.lworldExtY},l.prototype.setWorldExtY=function(a){this.lworldExtY=a},l.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},l.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},l.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},l.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},l.prototype.getDeviceExtX=function(){return this.ldeviceExtX},l.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},l.prototype.getDeviceExtY=function(){return this.ldeviceExtY},l.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},l.prototype.transformX=function(a){var e=0,r=this.lworldExtX;return r!=0&&(e=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/r),e},l.prototype.transformY=function(a){var e=0,r=this.lworldExtY;return r!=0&&(e=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/r),e},l.prototype.inverseTransformX=function(a){var e=0,r=this.ldeviceExtX;return r!=0&&(e=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/r),e},l.prototype.inverseTransformY=function(a){var e=0,r=this.ldeviceExtY;return r!=0&&(e=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/r),e},l.prototype.inverseTransformPoint=function(a){var e=new g(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return e},A.exports=l}),(function(A,P,L){function g(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);s<t.length;s++)o[s]=t[s];return o}else return Array.from(t)}var l=L(15),a=L(4),e=L(0),r=L(8),f=L(9);function i(){l.call(this),this.useSmartIdealEdgeLengthCalculation=a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=a.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=a.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=a.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=a.MAX_ITERATIONS}i.prototype=Object.create(l.prototype);for(var u in l)i[u]=l[u];i.prototype.initParameters=function(){l.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},i.prototype.calcIdealEdgeLengths=function(){for(var t,s,o,c,h,T,d,v=this.getGraphManager().getAllEdges(),N=0;N<v.length;N++)t=v[N],s=t.idealLength,t.isInterGraph&&(c=t.getSource(),h=t.getTarget(),T=t.getSourceInLca().getEstimatedSize(),d=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=T+d-2*e.SIMPLE_NODE_SIZE),o=t.getLca().getInclusionTreeDepth(),t.idealLength+=s*a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(c.getInclusionTreeDepth()+h.getInclusionTreeDepth()-2*o))},i.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>a.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},i.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o<t.length;o++)s=t[o],this.calcSpringForce(s,s.idealLength)},i.prototype.calcRepulsionForces=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,h,T,d=this.getAllNodes(),v;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),v=new Set,o=0;o<d.length;o++)h=d[o],this.calculateRepulsionForceOfANode(h,v,t,s),v.add(h);else for(o=0;o<d.length;o++)for(h=d[o],c=o+1;c<d.length;c++)T=d[c],h.getOwner()==T.getOwner()&&this.calcRepulsionForce(h,T)},i.prototype.calcGravitationalForces=function(){for(var t,s=this.getAllNodesToApplyGravitation(),o=0;o<s.length;o++)t=s[o],this.calcGravitationalForce(t)},i.prototype.moveNodes=function(){for(var t=this.getAllNodes(),s,o=0;o<t.length;o++)s=t[o],s.move()},i.prototype.calcSpringForce=function(t,s){var o=t.getSource(),c=t.getTarget(),h,T,d,v;if(this.uniformLeafNodeSizes&&o.getChild()==null&&c.getChild()==null)t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;h=t.getLength(),h!=0&&(T=t.edgeElasticity*(h-s),d=T*(t.lengthX/h),v=T*(t.lengthY/h),o.springForceX+=d,o.springForceY+=v,c.springForceX-=d,c.springForceY-=v)},i.prototype.calcRepulsionForce=function(t,s){var o=t.getRect(),c=s.getRect(),h=new Array(2),T=new Array(4),d,v,N,F,C,G,Z;if(o.intersects(c)){r.calcSeparationAmount(o,c,h,a.DEFAULT_EDGE_LENGTH/2),G=2*h[0],Z=2*h[1];var X=t.noOfChildren*s.noOfChildren/(t.noOfChildren+s.noOfChildren);t.repulsionForceX-=X*G,t.repulsionForceY-=X*Z,s.repulsionForceX+=X*G,s.repulsionForceY+=X*Z}else this.uniformLeafNodeSizes&&t.getChild()==null&&s.getChild()==null?(d=c.getCenterX()-o.getCenterX(),v=c.getCenterY()-o.getCenterY()):(r.getIntersection(o,c,T),d=T[2]-T[0],v=T[3]-T[1]),Math.abs(d)<a.MIN_REPULSION_DIST&&(d=f.sign(d)*a.MIN_REPULSION_DIST),Math.abs(v)<a.MIN_REPULSION_DIST&&(v=f.sign(v)*a.MIN_REPULSION_DIST),N=d*d+v*v,F=Math.sqrt(N),C=(t.nodeRepulsion/2+s.nodeRepulsion/2)*t.noOfChildren*s.noOfChildren/N,G=C*d/F,Z=C*v/F,t.repulsionForceX-=G,t.repulsionForceY-=Z,s.repulsionForceX+=G,s.repulsionForceY+=Z},i.prototype.calcGravitationalForce=function(t){var s,o,c,h,T,d,v,N;s=t.getOwner(),o=(s.getRight()+s.getLeft())/2,c=(s.getTop()+s.getBottom())/2,h=t.getCenterX()-o,T=t.getCenterY()-c,d=Math.abs(h)+t.getWidth()/2,v=Math.abs(T)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(N=s.getEstimatedSize()*this.gravityRangeFactor,(d>N||v>N)&&(t.gravitationForceX=-this.gravityConstant*h,t.gravitationForceY=-this.gravityConstant*T)):(N=s.getEstimatedSize()*this.compoundGravityRangeFactor,(d>N||v>N)&&(t.gravitationForceX=-this.gravityConstant*h*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},i.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||s},i.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},i.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,s=this.graphManager.getAllNodes(),o=0;o<s.length;o++)t=s[o],t.noOfChildren=t.getNoOfChildren()},i.prototype.calcGrid=function(t){var s=0,o=0;s=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),o=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var c=new Array(s),h=0;h<s;h++)c[h]=new Array(o);for(var h=0;h<s;h++)for(var T=0;T<o;T++)c[h][T]=new Array;return c},i.prototype.addNodeToGrid=function(t,s,o){var c=0,h=0,T=0,d=0;c=parseInt(Math.floor((t.getRect().x-s)/this.repulsionRange)),h=parseInt(Math.floor((t.getRect().width+t.getRect().x-s)/this.repulsionRange)),T=parseInt(Math.floor((t.getRect().y-o)/this.repulsionRange)),d=parseInt(Math.floor((t.getRect().height+t.getRect().y-o)/this.repulsionRange));for(var v=c;v<=h;v++)for(var N=T;N<=d;N++)this.grid[v][N].push(t),t.setGridCoordinates(c,h,T,d)},i.prototype.updateGrid=function(){var t,s,o=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<o.length;t++)s=o[t],this.addNodeToGrid(s,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},i.prototype.calculateRepulsionForceOfANode=function(t,s,o,c){if(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&o||c){var h=new Set;t.surrounding=new Array;for(var T,d=this.grid,v=t.startX-1;v<t.finishX+2;v++)for(var N=t.startY-1;N<t.finishY+2;N++)if(!(v<0||N<0||v>=d.length||N>=d[0].length)){for(var F=0;F<d[v][N].length;F++)if(T=d[v][N][F],!(t.getOwner()!=T.getOwner()||t==T)&&!s.has(T)&&!h.has(T)){var C=Math.abs(t.getCenterX()-T.getCenterX())-(t.getWidth()/2+T.getWidth()/2),G=Math.abs(t.getCenterY()-T.getCenterY())-(t.getHeight()/2+T.getHeight()/2);C<=this.repulsionRange&&G<=this.repulsionRange&&h.add(T)}}t.surrounding=[].concat(g(h))}for(v=0;v<t.surrounding.length;v++)this.calcRepulsionForce(t,t.surrounding[v])},i.prototype.calcRepulsionRange=function(){return 0},A.exports=i}),(function(A,P,L){var g=L(1),l=L(4);function a(r,f,i){g.call(this,r,f,i),this.idealLength=l.DEFAULT_EDGE_LENGTH,this.edgeElasticity=l.DEFAULT_SPRING_STRENGTH}a.prototype=Object.create(g.prototype);for(var e in g)a[e]=g[e];A.exports=a}),(function(A,P,L){var g=L(3),l=L(4);function a(r,f,i,u){g.call(this,r,f,i,u),this.nodeRepulsion=l.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}a.prototype=Object.create(g.prototype);for(var e in g)a[e]=g[e];a.prototype.setGridCoordinates=function(r,f,i,u){this.startX=r,this.finishX=f,this.startY=i,this.finishY=u},A.exports=a}),(function(A,P,L){function g(l,a){this.width=0,this.height=0,l!==null&&a!==null&&(this.height=a,this.width=l)}g.prototype.getWidth=function(){return this.width},g.prototype.setWidth=function(l){this.width=l},g.prototype.getHeight=function(){return this.height},g.prototype.setHeight=function(l){this.height=l},A.exports=g}),(function(A,P,L){var g=L(14);function l(){this.map={},this.keys=[]}l.prototype.put=function(a,e){var r=g.createID(a);this.contains(r)||(this.map[r]=e,this.keys.push(a))},l.prototype.contains=function(a){return g.createID(a),this.map[a]!=null},l.prototype.get=function(a){var e=g.createID(a);return this.map[e]},l.prototype.keySet=function(){return this.keys},A.exports=l}),(function(A,P,L){var g=L(14);function l(){this.set={}}l.prototype.add=function(a){var e=g.createID(a);this.contains(e)||(this.set[e]=a)},l.prototype.remove=function(a){delete this.set[g.createID(a)]},l.prototype.clear=function(){this.set={}},l.prototype.contains=function(a){return this.set[g.createID(a)]==a},l.prototype.isEmpty=function(){return this.size()===0},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAllTo=function(a){for(var e=Object.keys(this.set),r=e.length,f=0;f<r;f++)a.push(this.set[e[f]])},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAll=function(a){for(var e=a.length,r=0;r<e;r++){var f=a[r];this.add(f)}},A.exports=l}),(function(A,P,L){function g(){}g.multMat=function(l,a){for(var e=[],r=0;r<l.length;r++){e[r]=[];for(var f=0;f<a[0].length;f++){e[r][f]=0;for(var i=0;i<l[0].length;i++)e[r][f]+=l[r][i]*a[i][f]}}return e},g.transpose=function(l){for(var a=[],e=0;e<l[0].length;e++){a[e]=[];for(var r=0;r<l.length;r++)a[e][r]=l[r][e]}return a},g.multCons=function(l,a){for(var e=[],r=0;r<l.length;r++)e[r]=l[r]*a;return e},g.minusOp=function(l,a){for(var e=[],r=0;r<l.length;r++)e[r]=l[r]-a[r];return e},g.dotProduct=function(l,a){for(var e=0,r=0;r<l.length;r++)e+=l[r]*a[r];return e},g.mag=function(l){return Math.sqrt(this.dotProduct(l,l))},g.normalize=function(l){for(var a=[],e=this.mag(l),r=0;r<l.length;r++)a[r]=l[r]/e;return a},g.multGamma=function(l){for(var a=[],e=0,r=0;r<l.length;r++)e+=l[r];e*=-1/l.length;for(var f=0;f<l.length;f++)a[f]=e+l[f];return a},g.multL=function(l,a,e){for(var r=[],f=[],i=[],u=0;u<a[0].length;u++){for(var t=0,s=0;s<a.length;s++)t+=-.5*a[s][u]*l[s];f[u]=t}for(var o=0;o<e.length;o++){for(var c=0,h=0;h<e.length;h++)c+=e[o][h]*f[h];i[o]=c}for(var T=0;T<a.length;T++){for(var d=0,v=0;v<a[0].length;v++)d+=a[T][v]*i[v];r[T]=d}return r},A.exports=g}),(function(A,P,L){var g=(function(){function r(f,i){for(var u=0;u<i.length;u++){var t=i[u];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(f,t.key,t)}}return function(f,i,u){return i&&r(f.prototype,i),u&&r(f,u),f}})();function l(r,f){if(!(r instanceof f))throw new TypeError("Cannot call a class as a function")}var a=L(11),e=(function(){function r(f,i){l(this,r),(i!==null||i!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var u=void 0;f instanceof a?u=f.size():u=f.length,this._quicksort(f,0,u-1)}return g(r,[{key:"_quicksort",value:function(i,u,t){if(u<t){var s=this._partition(i,u,t);this._quicksort(i,u,s),this._quicksort(i,s+1,t)}}},{key:"_partition",value:function(i,u,t){for(var s=this._get(i,u),o=u,c=t;;){for(;this.compareFunction(s,this._get(i,c));)c--;for(;this.compareFunction(this._get(i,o),s);)o++;if(o<c)this._swap(i,o,c),o++,c--;else return c}}},{key:"_get",value:function(i,u){return i instanceof a?i.get_object_at(u):i[u]}},{key:"_set",value:function(i,u,t){i instanceof a?i.set_object_at(u,t):i[u]=t}},{key:"_swap",value:function(i,u,t){var s=this._get(i,u);this._set(i,u,this._get(i,t)),this._set(i,t,s)}},{key:"_defaultCompareFunction",value:function(i,u){return u>i}}]),r})();A.exports=e}),(function(A,P,L){function g(){}g.svd=function(l){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=l.length,this.n=l[0].length;var a=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function $t(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St<bt[0];St++)zt.push($t(bt.slice(1)));return zt};return Ct(Tt)})([this.m,a]),this.V=(function(Tt){var Ct=function $t(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St<bt[0];St++)zt.push($t(bt.slice(1)));return zt};return Ct(Tt)})([this.n,this.n]);for(var e=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.n),r=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,i=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),t=0;t<Math.max(i,u);t++){if(t<i){this.s[t]=0;for(var s=t;s<this.m;s++)this.s[t]=g.hypot(this.s[t],l[s][t]);if(this.s[t]!==0){l[t][t]<0&&(this.s[t]=-this.s[t]);for(var o=t;o<this.m;o++)l[o][t]/=this.s[t];l[t][t]+=1}this.s[t]=-this.s[t]}for(var c=t+1;c<this.n;c++){if((function(Tt,Ct){return Tt&&Ct})(t<i,this.s[t]!==0)){for(var h=0,T=t;T<this.m;T++)h+=l[T][t]*l[T][c];h=-h/l[t][t];for(var d=t;d<this.m;d++)l[d][c]+=h*l[d][t]}e[c]=l[t][c]}if((function(Tt,Ct){return Ct})(f,t<i))for(var v=t;v<this.m;v++)this.U[v][t]=l[v][t];if(t<u){e[t]=0;for(var N=t+1;N<this.n;N++)e[t]=g.hypot(e[t],e[N]);if(e[t]!==0){e[t+1]<0&&(e[t]=-e[t]);for(var F=t+1;F<this.n;F++)e[F]/=e[t];e[t+1]+=1}if(e[t]=-e[t],(function(Tt,Ct){return Tt&&Ct})(t+1<this.m,e[t]!==0)){for(var C=t+1;C<this.m;C++)r[C]=0;for(var G=t+1;G<this.n;G++)for(var Z=t+1;Z<this.m;Z++)r[Z]+=e[G]*l[Z][G];for(var X=t+1;X<this.n;X++)for(var K=-e[X]/e[t+1],D=t+1;D<this.m;D++)l[D][X]+=K*r[D]}for(var rt=t+1;rt<this.n;rt++)this.V[rt][t]=e[rt]}}var n=Math.min(this.n,this.m+1);i<this.n&&(this.s[i]=l[i][i]),this.m<n&&(this.s[n-1]=0),u+1<n&&(e[u]=l[u][n-1]),e[n-1]=0;{for(var m=i;m<a;m++){for(var p=0;p<this.m;p++)this.U[p][m]=0;this.U[m][m]=1}for(var E=i-1;E>=0;E--)if(this.s[E]!==0){for(var y=E+1;y<a;y++){for(var I=0,w=E;w<this.m;w++)I+=this.U[w][E]*this.U[w][y];I=-I/this.U[E][E];for(var S=E;S<this.m;S++)this.U[S][y]+=I*this.U[S][E]}for(var W=E;W<this.m;W++)this.U[W][E]=-this.U[W][E];this.U[E][E]=1+this.U[E][E];for(var x=0;x<E-1;x++)this.U[x][E]=0}else{for(var q=0;q<this.m;q++)this.U[q][E]=0;this.U[E][E]=1}}for(var V=this.n-1;V>=0;V--){if((function(Tt,Ct){return Tt&&Ct})(V<u,e[V]!==0))for(var Y=V+1;Y<a;Y++){for(var et=0,z=V+1;z<this.n;z++)et+=this.V[z][V]*this.V[z][Y];et=-et/this.V[V+1][V];for(var O=V+1;O<this.n;O++)this.V[O][Y]+=et*this.V[O][V]}for(var H=0;H<this.n;H++)this.V[H][V]=0;this.V[V][V]=1}for(var $=n-1,_=Math.pow(2,-52),ht=Math.pow(2,-966);n>0;){var Q=void 0,It=void 0;for(Q=n-2;Q>=-1&&Q!==-1;Q--)if(Math.abs(e[Q])<=ht+_*(Math.abs(this.s[Q])+Math.abs(this.s[Q+1]))){e[Q]=0;break}if(Q===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=Q&&Nt!==Q;Nt--){var vt=(Nt!==n?Math.abs(e[Nt]):0)+(Nt!==Q+1?Math.abs(e[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+_*vt){this.s[Nt]=0;break}}Nt===Q?It=3:Nt===n-1?It=1:(It=2,Q=Nt)}switch(Q++,It){case 1:{var it=e[n-2];e[n-2]=0;for(var gt=n-2;gt>=Q;gt--){var mt=g.hypot(this.s[gt],it),At=this.s[gt]/mt,Ot=it/mt;this.s[gt]=mt,gt!==Q&&(it=-Ot*e[gt-1],e[gt-1]=At*e[gt-1]);for(var Et=0;Et<this.n;Et++)mt=At*this.V[Et][gt]+Ot*this.V[Et][n-1],this.V[Et][n-1]=-Ot*this.V[Et][gt]+At*this.V[Et][n-1],this.V[Et][gt]=mt}}break;case 2:{var Dt=e[Q-1];e[Q-1]=0;for(var Rt=Q;Rt<n;Rt++){var Ht=g.hypot(this.s[Rt],Dt),Ut=this.s[Rt]/Ht,Pt=Dt/Ht;this.s[Rt]=Ht,Dt=-Pt*e[Rt],e[Rt]=Ut*e[Rt];for(var Ft=0;Ft<this.m;Ft++)Ht=Ut*this.U[Ft][Rt]+Pt*this.U[Ft][Q-1],this.U[Ft][Q-1]=-Pt*this.U[Ft][Rt]+Ut*this.U[Ft][Q-1],this.U[Ft][Rt]=Ht}}break;case 3:{var Yt=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[n-1]),Math.abs(this.s[n-2])),Math.abs(e[n-2])),Math.abs(this.s[Q])),Math.abs(e[Q])),Vt=this.s[n-1]/Yt,b=this.s[n-2]/Yt,U=e[n-2]/Yt,B=this.s[Q]/Yt,J=e[Q]/Yt,k=((b+Vt)*(b-Vt)+U*U)/2,at=Vt*U*(Vt*U),ct=0;(function(Tt,Ct){return Tt||Ct})(k!==0,at!==0)&&(ct=Math.sqrt(k*k+at),k<0&&(ct=-ct),ct=at/(k+ct));for(var nt=(B+Vt)*(B-Vt)+ct,tt=B*J,j=Q;j<n-1;j++){var ut=g.hypot(nt,tt),wt=nt/ut,pt=tt/ut;j!==Q&&(e[j-1]=ut),nt=wt*this.s[j]+pt*e[j],e[j]=wt*e[j]-pt*this.s[j],tt=pt*this.s[j+1],this.s[j+1]=wt*this.s[j+1];for(var xt=0;xt<this.n;xt++)ut=wt*this.V[xt][j]+pt*this.V[xt][j+1],this.V[xt][j+1]=-pt*this.V[xt][j]+wt*this.V[xt][j+1],this.V[xt][j]=ut;if(ut=g.hypot(nt,tt),wt=nt/ut,pt=tt/ut,this.s[j]=ut,nt=wt*e[j]+pt*this.s[j+1],this.s[j+1]=-pt*e[j]+wt*this.s[j+1],tt=pt*e[j+1],e[j+1]=wt*e[j+1],j<this.m-1)for(var lt=0;lt<this.m;lt++)ut=wt*this.U[lt][j]+pt*this.U[lt][j+1],this.U[lt][j+1]=-pt*this.U[lt][j]+wt*this.U[lt][j+1],this.U[lt][j]=ut}e[n-2]=nt}break;case 4:{if(this.s[Q]<=0){this.s[Q]=this.s[Q]<0?-this.s[Q]:0;for(var ot=0;ot<=$;ot++)this.V[ot][Q]=-this.V[ot][Q]}for(;Q<$&&!(this.s[Q]>=this.s[Q+1]);){var Lt=this.s[Q];if(this.s[Q]=this.s[Q+1],this.s[Q+1]=Lt,Q<this.n-1)for(var ft=0;ft<this.n;ft++)Lt=this.V[ft][Q+1],this.V[ft][Q+1]=this.V[ft][Q],this.V[ft][Q]=Lt;if(Q<this.m-1)for(var st=0;st<this.m;st++)Lt=this.U[st][Q+1],this.U[st][Q+1]=this.U[st][Q],this.U[st][Q]=Lt;Q++}n--}break}}var Xt={U:this.U,V:this.V,S:this.s};return Xt},g.hypot=function(l,a){var e=void 0;return Math.abs(l)>Math.abs(a)?(e=a/l,e=Math.abs(l)*Math.sqrt(1+e*e)):a!=0?(e=l/a,e=Math.abs(a)*Math.sqrt(1+e*e)):e=0,e},A.exports=g}),(function(A,P,L){var g=(function(){function e(r,f){for(var i=0;i<f.length;i++){var u=f[i];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(r,u.key,u)}}return function(r,f,i){return f&&e(r.prototype,f),i&&e(r,i),r}})();function l(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}var a=(function(){function e(r,f){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;l(this,e),this.sequence1=r,this.sequence2=f,this.match_score=i,this.mismatch_penalty=u,this.gap_penalty=t,this.iMax=r.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s<this.iMax;s++){this.grid[s]=new Array(this.jMax);for(var o=0;o<this.jMax;o++)this.grid[s][o]=0}this.tracebackGrid=new Array(this.iMax);for(var c=0;c<this.iMax;c++){this.tracebackGrid[c]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.tracebackGrid[c][h]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return g(e,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var f=1;f<this.jMax;f++)this.grid[0][f]=this.grid[0][f-1]+this.gap_penalty,this.tracebackGrid[0][f]=[!1,!1,!0];for(var i=1;i<this.iMax;i++)this.grid[i][0]=this.grid[i-1][0]+this.gap_penalty,this.tracebackGrid[i][0]=[!1,!0,!1];for(var u=1;u<this.iMax;u++)for(var t=1;t<this.jMax;t++){var s=void 0;this.sequence1[u-1]===this.sequence2[t-1]?s=this.grid[u-1][t-1]+this.match_score:s=this.grid[u-1][t-1]+this.mismatch_penalty;var o=this.grid[u-1][t]+this.gap_penalty,c=this.grid[u][t-1]+this.gap_penalty,h=[s,o,c],T=this.arrayAllMaxIndexes(h);this.grid[u][t]=h[T[0]],this.tracebackGrid[u][t]=[T.includes(0),T.includes(1),T.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var f=[];for(f.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});f[0];){var i=f[0],u=this.tracebackGrid[i.pos[0]][i.pos[1]];u[0]&&f.push({pos:[i.pos[0]-1,i.pos[1]-1],seq1:this.sequence1[i.pos[0]-1]+i.seq1,seq2:this.sequence2[i.pos[1]-1]+i.seq2}),u[1]&&f.push({pos:[i.pos[0]-1,i.pos[1]],seq1:this.sequence1[i.pos[0]-1]+i.seq1,seq2:"-"+i.seq2}),u[2]&&f.push({pos:[i.pos[0],i.pos[1]-1],seq1:"-"+i.seq1,seq2:this.sequence2[i.pos[1]-1]+i.seq2}),i.pos[0]===0&&i.pos[1]===0&&this.alignments.push({sequence1:i.seq1,sequence2:i.seq2}),f.shift()}return this.alignments}},{key:"getAllIndexes",value:function(f,i){for(var u=[],t=-1;(t=f.indexOf(i,t+1))!==-1;)u.push(t);return u}},{key:"arrayAllMaxIndexes",value:function(f){return this.getAllIndexes(f,Math.max.apply(null,f))}}]),e})();A.exports=a}),(function(A,P,L){var g=function(){};g.FDLayout=L(18),g.FDLayoutConstants=L(4),g.FDLayoutEdge=L(19),g.FDLayoutNode=L(20),g.DimensionD=L(21),g.HashMap=L(22),g.HashSet=L(23),g.IGeometry=L(8),g.IMath=L(9),g.Integer=L(10),g.Point=L(12),g.PointD=L(5),g.RandomSeed=L(16),g.RectangleD=L(13),g.Transform=L(17),g.UniqueIDGeneretor=L(14),g.Quicksort=L(25),g.LinkedList=L(11),g.LGraphObject=L(2),g.LGraph=L(6),g.LEdge=L(1),g.LGraphManager=L(7),g.LNode=L(3),g.Layout=L(15),g.LayoutConstants=L(0),g.NeedlemanWunsch=L(27),g.Matrix=L(24),g.SVD=L(26),A.exports=g}),(function(A,P,L){function g(){this.listeners=[]}var l=g.prototype;l.addListener=function(a,e){this.listeners.push({event:a,callback:e})},l.removeListener=function(a,e){for(var r=this.listeners.length;r>=0;r--){var f=this.listeners[r];f.event===a&&f.callback===e&&this.listeners.splice(r,1)}},l.emit=function(a,e){for(var r=0;r<this.listeners.length;r++){var f=this.listeners[r];a===f.event&&f.callback(e)}},A.exports=g})])})})(fe)),fe.exports}var dr=le.exports,Oe;function vr(){return Oe||(Oe=1,(function(R,M){(function(P,L){R.exports=L(ur())})(dr,function(A){return(()=>{var P={45:((a,e,r)=>{var f={};f.layoutBase=r(551),f.CoSEConstants=r(806),f.CoSEEdge=r(767),f.CoSEGraph=r(880),f.CoSEGraphManager=r(578),f.CoSELayout=r(765),f.CoSENode=r(991),f.ConstraintHandler=r(902),a.exports=f}),806:((a,e,r)=>{var f=r(551).FDLayoutConstants;function i(){}for(var u in f)i[u]=f[u];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,a.exports=i}),767:((a,e,r)=>{var f=r(551).FDLayoutEdge;function i(t,s,o){f.call(this,t,s,o)}i.prototype=Object.create(f.prototype);for(var u in f)i[u]=f[u];a.exports=i}),880:((a,e,r)=>{var f=r(551).LGraph;function i(t,s,o){f.call(this,t,s,o)}i.prototype=Object.create(f.prototype);for(var u in f)i[u]=f[u];a.exports=i}),578:((a,e,r)=>{var f=r(551).LGraphManager;function i(t){f.call(this,t)}i.prototype=Object.create(f.prototype);for(var u in f)i[u]=f[u];a.exports=i}),765:((a,e,r)=>{var f=r(551).FDLayout,i=r(578),u=r(880),t=r(991),s=r(767),o=r(806),c=r(902),h=r(551).FDLayoutConstants,T=r(551).LayoutConstants,d=r(551).Point,v=r(551).PointD,N=r(551).DimensionD,F=r(551).Layout,C=r(551).Integer,G=r(551).IGeometry,Z=r(551).LGraph,X=r(551).Transform,K=r(551).LinkedList;function D(){f.call(this),this.toBeTiled={},this.constraints={}}D.prototype=Object.create(f.prototype);for(var rt in f)D[rt]=f[rt];D.prototype.newGraphManager=function(){var n=new i(this);return this.graphManager=n,n},D.prototype.newGraph=function(n){return new u(null,this.graphManager,n)},D.prototype.newNode=function(n){return new t(this.graphManager,n)},D.prototype.newEdge=function(n){return new s(null,null,n)},D.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=h.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=h.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=h.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},D.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/h.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},D.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},D.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return m.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(E){return m.has(E)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},D.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%h.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),m=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(m),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},D.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),m={},p=0;p<n.length;p++){var E=n[p].rect,y=n[p].id;m[y]={id:y,x:E.getCenterX(),y:E.getCenterY(),w:E.width,h:E.height}}return m},D.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var n=!1;if(h.ANIMATE==="during")this.emit("layoutstarted");else{for(;!n;)n=this.tick();this.graphManager.updateBounds()}},D.prototype.moveNodes=function(){for(var n=this.getAllNodes(),m,p=0;p<n.length;p++)m=n[p],m.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var p=0;p<n.length;p++)m=n[p],m.move()},D.prototype.initConstraintVariables=function(){var n=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var m=this.graphManager.getAllNodes(),p=0;p<m.length;p++){var E=m[p];this.idToNodeMap.set(E.id,E)}var y=function O(H){for(var $=H.getChild().getNodes(),_,ht=0,Q=0;Q<$.length;Q++)_=$[Q],_.getChild()==null?n.fixedNodeSet.has(_.id)&&(ht+=100):ht+=O(_);return ht};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function($){n.fixedNodeSet.add($.nodeId)});for(var m=this.graphManager.getAllNodes(),E,p=0;p<m.length;p++)if(E=m[p],E.getChild()!=null){var I=y(E);I>0&&(E.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var w=new Map,S=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){n.fixedNodesOnHorizontal.add(O),n.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p<W.length;p++)this.dummyToNodeForVerticalAlignment.set("dummy"+p,[]),W[p].forEach(function(H){w.set(H,"dummy"+p),n.dummyToNodeForVerticalAlignment.get("dummy"+p).push(H),n.fixedNodeSet.has(H)&&n.fixedNodesOnHorizontal.add("dummy"+p)});if(this.constraints.alignmentConstraint.horizontal)for(var x=this.constraints.alignmentConstraint.horizontal,p=0;p<x.length;p++)this.dummyToNodeForHorizontalAlignment.set("dummy"+p,[]),x[p].forEach(function(H){S.set(H,"dummy"+p),n.dummyToNodeForHorizontalAlignment.get("dummy"+p).push(H),n.fixedNodeSet.has(H)&&n.fixedNodesOnVertical.add("dummy"+p)})}if(o.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(O){var H,$,_;for(_=O.length-1;_>=2*O.length/3;_--)H=Math.floor(Math.random()*(_+1)),$=O[_],O[_]=O[H],O[H]=$;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=w.has(O.left)?w.get(O.left):O.left,$=w.has(O.right)?w.get(O.right):O.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes($)||(n.nodesInRelativeHorizontal.push($),n.nodeToRelativeConstraintMapHorizontal.set($,[]),n.dummyToNodeForVerticalAlignment.has($)?n.nodeToTempPositionMapHorizontal.set($,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get($)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set($,n.idToNodeMap.get($).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:$,gap:O.gap}),n.nodeToRelativeConstraintMapHorizontal.get($).push({left:H,gap:O.gap})}else{var _=S.has(O.top)?S.get(O.top):O.top,ht=S.has(O.bottom)?S.get(O.bottom):O.bottom;n.nodesInRelativeVertical.includes(_)||(n.nodesInRelativeVertical.push(_),n.nodeToRelativeConstraintMapVertical.set(_,[]),n.dummyToNodeForHorizontalAlignment.has(_)?n.nodeToTempPositionMapVertical.set(_,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(_)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(_,n.idToNodeMap.get(_).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(_).push({bottom:ht,gap:O.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:_,gap:O.gap})}});else{var q=new Map,V=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=w.has(O.left)?w.get(O.left):O.left,$=w.has(O.right)?w.get(O.right):O.right;q.has(H)?q.get(H).push($):q.set(H,[$]),q.has($)?q.get($).push(H):q.set($,[H])}else{var _=S.has(O.top)?S.get(O.top):O.top,ht=S.has(O.bottom)?S.get(O.bottom):O.bottom;V.has(_)?V.get(_).push(ht):V.set(_,[ht]),V.has(ht)?V.get(ht).push(_):V.set(ht,[_])}});var Y=function(H,$){var _=[],ht=[],Q=new K,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){_[Nt]=[],ht[Nt]=!1;var gt=it;for(Q.push(gt),It.add(gt),_[Nt].push(gt);Q.length!=0;){gt=Q.shift(),$.has(gt)&&(ht[Nt]=!0);var mt=H.get(gt);mt.forEach(function(At){It.has(At)||(Q.push(At),It.add(At),_[Nt].push(At))})}Nt++}}),{components:_,isFixed:ht}},et=Y(q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=et.components,this.fixedComponentsOnHorizontal=et.isFixed;var z=Y(V,n.fixedNodesOnVertical);this.componentsOnVertical=z.components,this.fixedComponentsOnVertical=z.isFixed}}},D.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(z){var O=n.idToNodeMap.get(z.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var m=this.constraints.alignmentConstraint.vertical,p=0;p<m.length;p++){for(var E=0,y=0;y<m[p].length;y++){if(this.fixedNodeSet.has(m[p][y])){E=0;break}E+=this.idToNodeMap.get(m[p][y]).displacementX}for(var I=E/m[p].length,y=0;y<m[p].length;y++)this.idToNodeMap.get(m[p][y]).displacementX=I}if(this.constraints.alignmentConstraint.horizontal)for(var w=this.constraints.alignmentConstraint.horizontal,p=0;p<w.length;p++){for(var S=0,y=0;y<w[p].length;y++){if(this.fixedNodeSet.has(w[p][y])){S=0;break}S+=this.idToNodeMap.get(w[p][y]).displacementY}for(var W=S/w[p].length,y=0;y<w[p].length;y++)this.idToNodeMap.get(w[p][y]).displacementY=W}}if(this.constraints.relativePlacementConstraint)if(o.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(z){if(!n.fixedNodesOnHorizontal.has(z)){var O=0;n.dummyToNodeForVerticalAlignment.has(z)?O=n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(z)[0]).displacementX:O=n.idToNodeMap.get(z).displacementX,n.nodeToRelativeConstraintMapHorizontal.get(z).forEach(function(H){if(H.right){var $=n.nodeToTempPositionMapHorizontal.get(H.right)-n.nodeToTempPositionMapHorizontal.get(z)-O;$<H.gap&&(O-=H.gap-$)}else{var $=n.nodeToTempPositionMapHorizontal.get(z)-n.nodeToTempPositionMapHorizontal.get(H.left)+O;$<H.gap&&(O+=H.gap-$)}}),n.nodeToTempPositionMapHorizontal.set(z,n.nodeToTempPositionMapHorizontal.get(z)+O),n.dummyToNodeForVerticalAlignment.has(z)?n.dummyToNodeForVerticalAlignment.get(z).forEach(function(H){n.idToNodeMap.get(H).displacementX=O}):n.idToNodeMap.get(z).displacementX=O}}),this.nodesInRelativeVertical.forEach(function(z){if(!n.fixedNodesOnHorizontal.has(z)){var O=0;n.dummyToNodeForHorizontalAlignment.has(z)?O=n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(z)[0]).displacementY:O=n.idToNodeMap.get(z).displacementY,n.nodeToRelativeConstraintMapVertical.get(z).forEach(function(H){if(H.bottom){var $=n.nodeToTempPositionMapVertical.get(H.bottom)-n.nodeToTempPositionMapVertical.get(z)-O;$<H.gap&&(O-=H.gap-$)}else{var $=n.nodeToTempPositionMapVertical.get(z)-n.nodeToTempPositionMapVertical.get(H.top)+O;$<H.gap&&(O+=H.gap-$)}}),n.nodeToTempPositionMapVertical.set(z,n.nodeToTempPositionMapVertical.get(z)+O),n.dummyToNodeForHorizontalAlignment.has(z)?n.dummyToNodeForHorizontalAlignment.get(z).forEach(function(H){n.idToNodeMap.get(H).displacementY=O}):n.idToNodeMap.get(z).displacementY=O}});else{for(var p=0;p<this.componentsOnHorizontal.length;p++){var x=this.componentsOnHorizontal[p];if(this.fixedComponentsOnHorizontal[p])for(var y=0;y<x.length;y++)this.dummyToNodeForVerticalAlignment.has(x[y])?this.dummyToNodeForVerticalAlignment.get(x[y]).forEach(function(H){n.idToNodeMap.get(H).displacementX=0}):this.idToNodeMap.get(x[y]).displacementX=0;else{for(var q=0,V=0,y=0;y<x.length;y++)if(this.dummyToNodeForVerticalAlignment.has(x[y])){var Y=this.dummyToNodeForVerticalAlignment.get(x[y]);q+=Y.length*this.idToNodeMap.get(Y[0]).displacementX,V+=Y.length}else q+=this.idToNodeMap.get(x[y]).displacementX,V++;for(var et=q/V,y=0;y<x.length;y++)this.dummyToNodeForVerticalAlignment.has(x[y])?this.dummyToNodeForVerticalAlignment.get(x[y]).forEach(function(H){n.idToNodeMap.get(H).displacementX=et}):this.idToNodeMap.get(x[y]).displacementX=et}}for(var p=0;p<this.componentsOnVertical.length;p++){var x=this.componentsOnVertical[p];if(this.fixedComponentsOnVertical[p])for(var y=0;y<x.length;y++)this.dummyToNodeForHorizontalAlignment.has(x[y])?this.dummyToNodeForHorizontalAlignment.get(x[y]).forEach(function($){n.idToNodeMap.get($).displacementY=0}):this.idToNodeMap.get(x[y]).displacementY=0;else{for(var q=0,V=0,y=0;y<x.length;y++)if(this.dummyToNodeForHorizontalAlignment.has(x[y])){var Y=this.dummyToNodeForHorizontalAlignment.get(x[y]);q+=Y.length*this.idToNodeMap.get(Y[0]).displacementY,V+=Y.length}else q+=this.idToNodeMap.get(x[y]).displacementY,V++;for(var et=q/V,y=0;y<x.length;y++)this.dummyToNodeForHorizontalAlignment.has(x[y])?this.dummyToNodeForHorizontalAlignment.get(x[y]).forEach(function(Q){n.idToNodeMap.get(Q).displacementY=et}):this.idToNodeMap.get(x[y]).displacementY=et}}}},D.prototype.calculateNodesToApplyGravitationTo=function(){var n=[],m,p=this.graphManager.getGraphs(),E=p.length,y;for(y=0;y<E;y++)m=p[y],m.updateConnected(),m.isConnected||(n=n.concat(m.getNodes()));return n},D.prototype.createBendpoints=function(){var n=[];n=n.concat(this.graphManager.getAllEdges());var m=new Set,p;for(p=0;p<n.length;p++){var E=n[p];if(!m.has(E)){var y=E.getSource(),I=E.getTarget();if(y==I)E.getBendpoints().push(new v),E.getBendpoints().push(new v),this.createDummyNodesForBendpoints(E),m.add(E);else{var w=[];if(w=w.concat(y.getEdgeListToNode(I)),w=w.concat(I.getEdgeListToNode(y)),!m.has(w[0])){if(w.length>1){var S;for(S=0;S<w.length;S++){var W=w[S];W.getBendpoints().push(new v),this.createDummyNodesForBendpoints(W)}}w.forEach(function(x){m.add(x)})}}}if(m.size==n.length)break}},D.prototype.positionNodesRadially=function(n){for(var m=new d(0,0),p=Math.ceil(Math.sqrt(n.length)),E=0,y=0,I=0,w=new v(0,0),S=0;S<n.length;S++){S%p==0&&(I=0,y=E,S!=0&&(y+=o.DEFAULT_COMPONENT_SEPERATION),E=0);var W=n[S],x=F.findCenterOfTree(W);m.x=I,m.y=y,w=D.radialLayout(W,x,m),w.y>E&&(E=Math.floor(w.y)),I=Math.floor(w.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new v(T.WORLD_CENTER_X-w.x/2,T.WORLD_CENTER_Y-w.y/2))},D.radialLayout=function(n,m,p){var E=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);D.branchRadialLayout(m,null,0,359,0,E);var y=Z.calculateBounds(n),I=new X;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var w=0;w<n.length;w++){var S=n[w];S.transform(I)}var W=new v(y.getMaxX(),y.getMaxY());return I.inverseTransformPoint(W)},D.branchRadialLayout=function(n,m,p,E,y,I){var w=(E-p+1)/2;w<0&&(w+=180);var S=(w+p)%360,W=S*G.TWO_PI/360,x=y*Math.cos(W),q=y*Math.sin(W);n.setCenter(x,q);var V=[];V=V.concat(n.getEdges());var Y=V.length;m!=null&&Y--;for(var et=0,z=V.length,O,H=n.getEdgesBetween(m);H.length>1;){var $=H[0];H.splice(0,1);var _=V.indexOf($);_>=0&&V.splice(_,1),z--,Y--}m!=null?O=(V.indexOf(H[0])+1)%z:O=0;for(var ht=Math.abs(E-p)/Y,Q=O;et!=Y;Q=++Q%z){var It=V[Q].getOtherEnd(n);if(It!=m){var Nt=(p+et*ht)%360,vt=(Nt+ht)%360;D.branchRadialLayout(It,n,Nt,vt,y+I,I),et++}}},D.maxDiagonalInTree=function(n){for(var m=C.MIN_VALUE,p=0;p<n.length;p++){var E=n[p],y=E.getDiagonal();y>m&&(m=y)}return m},D.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},D.prototype.groupZeroDegreeMembers=function(){var n=this,m={};this.memberGroups={},this.idToDummyNode={};for(var p=[],E=this.graphManager.getAllNodes(),y=0;y<E.length;y++){var I=E[y],w=I.getParent();this.getNodeDegreeWithChildren(I)===0&&(w.id==null||!this.getToBeTiled(w))&&p.push(I)}for(var y=0;y<p.length;y++){var I=p[y],S=I.getParent().id;typeof m[S]>"u"&&(m[S]=[]),m[S]=m[S].concat(I)}Object.keys(m).forEach(function(W){if(m[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=m[W];var q=m[W][0].getParent(),V=new t(n.graphManager);V.id=x,V.paddingLeft=q.paddingLeft||0,V.paddingRight=q.paddingRight||0,V.paddingBottom=q.paddingBottom||0,V.paddingTop=q.paddingTop||0,n.idToDummyNode[x]=V;var Y=n.getGraphManager().add(n.newGraph(),V),et=q.getChild();et.add(V);for(var z=0;z<m[W].length;z++){var O=m[W][z];et.remove(O),Y.add(O)}}})},D.prototype.clearCompounds=function(){var n={},m={};this.performDFSOnCompounds();for(var p=0;p<this.compoundOrder.length;p++)m[this.compoundOrder[p].id]=this.compoundOrder[p],n[this.compoundOrder[p].id]=[].concat(this.compoundOrder[p].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[p].getChild()),this.compoundOrder[p].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(n,m)},D.prototype.clearZeroDegreeMembers=function(){var n=this,m=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(p){var E=n.idToDummyNode[p];if(m[p]=n.tileNodes(n.memberGroups[p],E.paddingLeft+E.paddingRight),E.rect.width=m[p].width,E.rect.height=m[p].height,E.setCenter(m[p].centerX,m[p].centerY),E.labelMarginLeft=0,E.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var y=E.rect.width,I=E.rect.height;E.labelWidth&&(E.labelPosHorizontal=="left"?(E.rect.x-=E.labelWidth,E.setWidth(y+E.labelWidth),E.labelMarginLeft=E.labelWidth):E.labelPosHorizontal=="center"&&E.labelWidth>y?(E.rect.x-=(E.labelWidth-y)/2,E.setWidth(E.labelWidth),E.labelMarginLeft=(E.labelWidth-y)/2):E.labelPosHorizontal=="right"&&E.setWidth(y+E.labelWidth)),E.labelHeight&&(E.labelPosVertical=="top"?(E.rect.y-=E.labelHeight,E.setHeight(I+E.labelHeight),E.labelMarginTop=E.labelHeight):E.labelPosVertical=="center"&&E.labelHeight>I?(E.rect.y-=(E.labelHeight-I)/2,E.setHeight(E.labelHeight),E.labelMarginTop=(E.labelHeight-I)/2):E.labelPosVertical=="bottom"&&E.setHeight(I+E.labelHeight))}})},D.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var m=this.compoundOrder[n],p=m.id,E=m.paddingLeft,y=m.paddingTop,I=m.labelMarginLeft,w=m.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],m.rect.x,m.rect.y,E,y,I,w)}},D.prototype.repopulateZeroDegreeMembers=function(){var n=this,m=this.tiledZeroDegreePack;Object.keys(m).forEach(function(p){var E=n.idToDummyNode[p],y=E.paddingLeft,I=E.paddingTop,w=E.labelMarginLeft,S=E.labelMarginTop;n.adjustLocations(m[p],E.rect.x,E.rect.y,y,I,w,S)})},D.prototype.getToBeTiled=function(n){var m=n.id;if(this.toBeTiled[m]!=null)return this.toBeTiled[m];var p=n.getChild();if(p==null)return this.toBeTiled[m]=!1,!1;for(var E=p.getNodes(),y=0;y<E.length;y++){var I=E[y];if(this.getNodeDegree(I)>0)return this.toBeTiled[m]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[m]=!1,!1}return this.toBeTiled[m]=!0,!0},D.prototype.getNodeDegree=function(n){n.id;for(var m=n.getEdges(),p=0,E=0;E<m.length;E++){var y=m[E];y.getSource().id!==y.getTarget().id&&(p=p+1)}return p},D.prototype.getNodeDegreeWithChildren=function(n){var m=this.getNodeDegree(n);if(n.getChild()==null)return m;for(var p=n.getChild().getNodes(),E=0;E<p.length;E++){var y=p[E];m+=this.getNodeDegreeWithChildren(y)}return m},D.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},D.prototype.fillCompexOrderByDFS=function(n){for(var m=0;m<n.length;m++){var p=n[m];p.getChild()!=null&&this.fillCompexOrderByDFS(p.getChild().getNodes()),this.getToBeTiled(p)&&this.compoundOrder.push(p)}},D.prototype.adjustLocations=function(n,m,p,E,y,I,w){m+=E+I,p+=y+w;for(var S=m,W=0;W<n.rows.length;W++){var x=n.rows[W];m=S;for(var q=0,V=0;V<x.length;V++){var Y=x[V];Y.rect.x=m,Y.rect.y=p,m+=Y.rect.width+n.horizontalPadding,Y.rect.height>q&&(q=Y.rect.height)}p+=q+n.verticalPadding}},D.prototype.tileCompoundMembers=function(n,m){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(E){var y=m[E];if(p.tiledMemberPack[E]=p.tileNodes(n[E],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[E].width,y.rect.height=p.tiledMemberPack[E].height,y.setCenter(p.tiledMemberPack[E].centerX,p.tiledMemberPack[E].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,w=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(w+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>w?(y.rect.y-=(y.labelHeight-w)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-w)/2):y.labelPosVertical=="bottom"&&y.setHeight(w+y.labelHeight))}})},D.prototype.tileNodes=function(n,m){var p=this.tileNodesByFavoringDim(n,m,!0),E=this.tileNodesByFavoringDim(n,m,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(E),w;return I<y?w=E:w=p,w},D.prototype.getOrgRatio=function(n){var m=n.width,p=n.height,E=m/p;return E<1&&(E=1/E),E},D.prototype.calcIdealRowWidth=function(n,m){var p=o.TILING_PADDING_VERTICAL,E=o.TILING_PADDING_HORIZONTAL,y=n.length,I=0,w=0,S=0;n.forEach(function(z){I+=z.getWidth(),w+=z.getHeight(),z.getWidth()>S&&(S=z.getWidth())});var W=I/y,x=w/y,q=Math.pow(p-E,2)+4*(W+E)*(x+p)*y,V=(E-p+Math.sqrt(q))/(2*(W+E)),Y;m?(Y=Math.ceil(V),Y==V&&Y++):Y=Math.floor(V);var et=Y*(W+E)-E;return S>et&&(et=S),et+=E*2,et},D.prototype.tileNodesByFavoringDim=function(n,m,p){var E=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,w={rows:[],rowWidth:[],rowHeight:[],width:0,height:m,verticalPadding:E,horizontalPadding:y,centerX:0,centerY:0};I&&(w.idealRowWidth=this.calcIdealRowWidth(n,p));var S=function(O){return O.rect.width*O.rect.height},W=function(O,H){return S(H)-S(O)};n.sort(function(z,O){var H=W;return w.idealRowWidth?(H=I,H(z.id,O.id)):H(z,O)});for(var x=0,q=0,V=0;V<n.length;V++){var Y=n[V];x+=Y.getCenterX(),q+=Y.getCenterY()}w.centerX=x/n.length,w.centerY=q/n.length;for(var V=0;V<n.length;V++){var Y=n[V];if(w.rows.length==0)this.insertNodeToRow(w,Y,0,m);else if(this.canAddHorizontal(w,Y.rect.width,Y.rect.height)){var et=w.rows.length-1;w.idealRowWidth||(et=this.getShortestRowIndex(w)),this.insertNodeToRow(w,Y,et,m)}else this.insertNodeToRow(w,Y,w.rows.length,m);this.shiftToLastRow(w)}return w},D.prototype.insertNodeToRow=function(n,m,p,E){var y=E;if(p==n.rows.length){var I=[];n.rows.push(I),n.rowWidth.push(y),n.rowHeight.push(0)}var w=n.rowWidth[p]+m.rect.width;n.rows[p].length>0&&(w+=n.horizontalPadding),n.rowWidth[p]=w,n.width<w&&(n.width=w);var S=m.rect.height;p>0&&(S+=n.verticalPadding);var W=0;S>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=S,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(m)},D.prototype.getShortestRowIndex=function(n){for(var m=-1,p=Number.MAX_VALUE,E=0;E<n.rows.length;E++)n.rowWidth[E]<p&&(m=E,p=n.rowWidth[E]);return m},D.prototype.getLongestRowIndex=function(n){for(var m=-1,p=Number.MIN_VALUE,E=0;E<n.rows.length;E++)n.rowWidth[E]>p&&(m=E,p=n.rowWidth[E]);return m},D.prototype.canAddHorizontal=function(n,m,p){if(n.idealRowWidth){var E=n.rows.length-1,y=n.rowWidth[E];return y+m+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var w=n.rowWidth[I];if(w+n.horizontalPadding+m<=n.width)return!0;var S=0;n.rowHeight[I]<p&&I>0&&(S=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-w>=m+n.horizontalPadding?W=(n.height+S)/(w+m+n.horizontalPadding):W=(n.height+S)/n.width,S=p+n.verticalPadding;var x;return n.width<m?x=(n.height+S)/m:x=(n.height+S)/n.width,x<1&&(x=1/x),W<1&&(W=1/W),W<x},D.prototype.shiftToLastRow=function(n){var m=this.getLongestRowIndex(n),p=n.rowWidth.length-1,E=n.rows[m],y=E[E.length-1],I=y.width+n.horizontalPadding;if(n.width-n.rowWidth[p]>I&&m!=p){E.splice(-1,1),n.rows[p].push(y),n.rowWidth[m]=n.rowWidth[m]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var w=Number.MIN_VALUE,S=0;S<E.length;S++)E[S].height>w&&(w=E[S].height);m>0&&(w+=n.verticalPadding);var W=n.rowHeight[m]+n.rowHeight[p];n.rowHeight[m]=w,n.rowHeight[p]<y.height+n.verticalPadding&&(n.rowHeight[p]=y.height+n.verticalPadding);var x=n.rowHeight[m]+n.rowHeight[p];n.height+=x-W,this.shiftToLastRow(n)}},D.prototype.tilingPreLayout=function(){o.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},D.prototype.tilingPostLayout=function(){o.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},D.prototype.reduceTrees=function(){for(var n=[],m=!0,p;m;){var E=this.graphManager.getAllNodes(),y=[];m=!1;for(var I=0;I<E.length;I++)if(p=E[I],p.getEdges().length==1&&!p.getEdges()[0].isInterGraph&&p.getChild()==null){if(o.PURE_INCREMENTAL){var w=p.getEdges()[0].getOtherEnd(p),S=new N(p.getCenterX()-w.getCenterX(),p.getCenterY()-w.getCenterY());y.push([p,p.getEdges()[0],p.getOwner(),S])}else y.push([p,p.getEdges()[0],p.getOwner()]);m=!0}if(m==!0){for(var W=[],x=0;x<y.length;x++)y[x][0].getEdges().length==1&&(W.push(y[x]),y[x][0].getOwner().remove(y[x][0]));n.push(W),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=n},D.prototype.growTree=function(n){for(var m=n.length,p=n[m-1],E,y=0;y<p.length;y++)E=p[y],this.findPlaceforPrunedNode(E),E[2].add(E[0]),E[2].add(E[1],E[1].source,E[1].target);n.splice(n.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},D.prototype.findPlaceforPrunedNode=function(n){var m,p,E=n[0];if(E==n[1].source?p=n[1].target:p=n[1].source,o.PURE_INCREMENTAL)E.setCenter(p.getCenterX()+n[3].getWidth(),p.getCenterY()+n[3].getHeight());else{var y=p.startX,I=p.finishX,w=p.startY,S=p.finishY,W=0,x=0,q=0,V=0,Y=[W,q,x,V];if(w>0)for(var et=y;et<=I;et++)Y[0]+=this.grid[et][w-1].length+this.grid[et][w].length-1;if(I<this.grid.length-1)for(var et=w;et<=S;et++)Y[1]+=this.grid[I+1][et].length+this.grid[I][et].length-1;if(S<this.grid[0].length-1)for(var et=y;et<=I;et++)Y[2]+=this.grid[et][S+1].length+this.grid[et][S].length-1;if(y>0)for(var et=w;et<=S;et++)Y[3]+=this.grid[y-1][et].length+this.grid[y][et].length-1;for(var z=C.MAX_VALUE,O,H,$=0;$<Y.length;$++)Y[$]<z?(z=Y[$],O=1,H=$):Y[$]==z&&O++;if(O==3&&z==0)Y[0]==0&&Y[1]==0&&Y[2]==0?m=1:Y[0]==0&&Y[1]==0&&Y[3]==0?m=0:Y[0]==0&&Y[2]==0&&Y[3]==0?m=3:Y[1]==0&&Y[2]==0&&Y[3]==0&&(m=2);else if(O==2&&z==0){var _=Math.floor(Math.random()*2);Y[0]==0&&Y[1]==0?_==0?m=0:m=1:Y[0]==0&&Y[2]==0?_==0?m=0:m=2:Y[0]==0&&Y[3]==0?_==0?m=0:m=3:Y[1]==0&&Y[2]==0?_==0?m=1:m=2:Y[1]==0&&Y[3]==0?_==0?m=1:m=3:_==0?m=2:m=3}else if(O==4&&z==0){var _=Math.floor(Math.random()*4);m=_}else m=H;m==0?E.setCenter(p.getCenterX(),p.getCenterY()-p.getHeight()/2-h.DEFAULT_EDGE_LENGTH-E.getHeight()/2):m==1?E.setCenter(p.getCenterX()+p.getWidth()/2+h.DEFAULT_EDGE_LENGTH+E.getWidth()/2,p.getCenterY()):m==2?E.setCenter(p.getCenterX(),p.getCenterY()+p.getHeight()/2+h.DEFAULT_EDGE_LENGTH+E.getHeight()/2):E.setCenter(p.getCenterX()-p.getWidth()/2-h.DEFAULT_EDGE_LENGTH-E.getWidth()/2,p.getCenterY())}},a.exports=D}),991:((a,e,r)=>{var f=r(551).FDLayoutNode,i=r(551).IMath;function u(s,o,c,h){f.call(this,s,o,c,h)}u.prototype=Object.create(f.prototype);for(var t in f)u[t]=f[t];u.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},u.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),h,T=0;T<c.length;T++)h=c[T],h.getChild()==null?(h.displacementX+=s,h.displacementY+=o):h.propogateDisplacementToChildren(s,o)},u.prototype.move=function(){var s=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),s.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},u.prototype.setPred1=function(s){this.pred1=s},u.prototype.getPred1=function(){return pred1},u.prototype.getPred2=function(){return pred2},u.prototype.setNext=function(s){this.next=s},u.prototype.getNext=function(){return next},u.prototype.setProcessed=function(s){this.processed=s},u.prototype.isProcessed=function(){return processed},a.exports=u}),902:((a,e,r)=>{function f(c){if(Array.isArray(c)){for(var h=0,T=Array(c.length);h<c.length;h++)T[h]=c[h];return T}else return Array.from(c)}var i=r(806),u=r(551).LinkedList,t=r(551).Matrix,s=r(551).SVD;function o(){}o.handleConstraints=function(c){var h={};h.fixedNodeConstraint=c.constraints.fixedNodeConstraint,h.alignmentConstraint=c.constraints.alignmentConstraint,h.relativePlacementConstraint=c.constraints.relativePlacementConstraint;for(var T=new Map,d=new Map,v=[],N=[],F=c.getAllNodes(),C=0,G=0;G<F.length;G++){var Z=F[G];Z.getChild()==null&&(d.set(Z.id,C++),v.push(Z.getCenterX()),N.push(Z.getCenterY()),T.set(Z.id,Z))}h.relativePlacementConstraint&&h.relativePlacementConstraint.forEach(function(b){!b.gap&&b.gap!=0&&(b.left?b.gap=i.DEFAULT_EDGE_LENGTH+T.get(b.left).getWidth()/2+T.get(b.right).getWidth()/2:b.gap=i.DEFAULT_EDGE_LENGTH+T.get(b.top).getHeight()/2+T.get(b.bottom).getHeight()/2)});var X=function(U,B){return{x:U.x-B.x,y:U.y-B.y}},K=function(U){var B=0,J=0;return U.forEach(function(k){B+=v[d.get(k)],J+=N[d.get(k)]}),{x:B/U.size,y:J/U.size}},D=function(U,B,J,k,at){function ct(lt,ot){var Lt=new Set(lt),ft=!0,st=!1,Xt=void 0;try{for(var Tt=ot[Symbol.iterator](),Ct;!(ft=(Ct=Tt.next()).done);ft=!0){var $t=Ct.value;Lt.add($t)}}catch(bt){st=!0,Xt=bt}finally{try{!ft&&Tt.return&&Tt.return()}finally{if(st)throw Xt}}return Lt}var nt=new Map;U.forEach(function(lt,ot){nt.set(ot,0)}),U.forEach(function(lt,ot){lt.forEach(function(Lt){nt.set(Lt.id,nt.get(Lt.id)+1)})});var tt=new Map,j=new Map,ut=new u;nt.forEach(function(lt,ot){lt==0?(ut.push(ot),J||(B=="horizontal"?tt.set(ot,d.has(ot)?v[d.get(ot)]:k.get(ot)):tt.set(ot,d.has(ot)?N[d.get(ot)]:k.get(ot)))):tt.set(ot,Number.NEGATIVE_INFINITY),J&&j.set(ot,new Set([ot]))}),J&&at.forEach(function(lt){var ot=[];if(lt.forEach(function(st){J.has(st)&&ot.push(st)}),ot.length>0){var Lt=0;ot.forEach(function(st){B=="horizontal"?(tt.set(st,d.has(st)?v[d.get(st)]:k.get(st)),Lt+=tt.get(st)):(tt.set(st,d.has(st)?N[d.get(st)]:k.get(st)),Lt+=tt.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){J.has(st)||tt.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){B=="horizontal"?ft+=d.has(st)?v[d.get(st)]:k.get(st):ft+=d.has(st)?N[d.get(st)]:k.get(st)}),ft=ft/lt.length,lt.forEach(function(st){tt.set(st,ft)})}});for(var wt=function(){var ot=ut.shift(),Lt=U.get(ot);Lt.forEach(function(ft){if(tt.get(ft.id)<tt.get(ot)+ft.gap)if(J&&J.has(ft.id)){var st=void 0;if(B=="horizontal"?st=d.has(ft.id)?v[d.get(ft.id)]:k.get(ft.id):st=d.has(ft.id)?N[d.get(ft.id)]:k.get(ft.id),tt.set(ft.id,st),st<tt.get(ot)+ft.gap){var Xt=tt.get(ot)+ft.gap-st;j.get(ot).forEach(function(Tt){tt.set(Tt,tt.get(Tt)-Xt)})}}else tt.set(ft.id,tt.get(ot)+ft.gap);nt.set(ft.id,nt.get(ft.id)-1),nt.get(ft.id)==0&&ut.push(ft.id),J&&j.set(ft.id,ct(j.get(ot),j.get(ft.id)))})};ut.length!=0;)wt();if(J){var pt=new Set;U.forEach(function(lt,ot){lt.length==0&&pt.add(ot)});var xt=[];j.forEach(function(lt,ot){if(pt.has(ot)){var Lt=!1,ft=!0,st=!1,Xt=void 0;try{for(var Tt=lt[Symbol.iterator](),Ct;!(ft=(Ct=Tt.next()).done);ft=!0){var $t=Ct.value;J.has($t)&&(Lt=!0)}}catch(St){st=!0,Xt=St}finally{try{!ft&&Tt.return&&Tt.return()}finally{if(st)throw Xt}}if(!Lt){var bt=!1,zt=void 0;xt.forEach(function(St,kt){St.has([].concat(f(lt))[0])&&(bt=!0,zt=kt)}),bt?lt.forEach(function(St){xt[zt].add(St)}):xt.push(new Set(lt))}}}),xt.forEach(function(lt,ot){var Lt=Number.POSITIVE_INFINITY,ft=Number.POSITIVE_INFINITY,st=Number.NEGATIVE_INFINITY,Xt=Number.NEGATIVE_INFINITY,Tt=!0,Ct=!1,$t=void 0;try{for(var bt=lt[Symbol.iterator](),zt;!(Tt=(zt=bt.next()).done);Tt=!0){var St=zt.value,kt=void 0;B=="horizontal"?kt=d.has(St)?v[d.get(St)]:k.get(St):kt=d.has(St)?N[d.get(St)]:k.get(St);var Kt=tt.get(St);kt<Lt&&(Lt=kt),kt>st&&(st=kt),Kt<ft&&(ft=Kt),Kt>Xt&&(Xt=Kt)}}catch(ee){Ct=!0,$t=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw $t}}var ce=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),oe;!(Qt=(oe=Jt.next()).done);Qt=!0){var te=oe.value;tt.set(te,tt.get(te)+ce)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return tt},rt=function(U){var B=0,J=0,k=0,at=0;if(U.forEach(function(j){j.left?v[d.get(j.left)]-v[d.get(j.right)]>=0?B++:J++:N[d.get(j.top)]-N[d.get(j.bottom)]>=0?k++:at++}),B>J&&k>at)for(var ct=0;ct<d.size;ct++)v[ct]=-1*v[ct],N[ct]=-1*N[ct];else if(B>J)for(var nt=0;nt<d.size;nt++)v[nt]=-1*v[nt];else if(k>at)for(var tt=0;tt<d.size;tt++)N[tt]=-1*N[tt]},n=function(U){var B=[],J=new u,k=new Set,at=0;return U.forEach(function(ct,nt){if(!k.has(nt)){B[at]=[];var tt=nt;for(J.push(tt),k.add(tt),B[at].push(tt);J.length!=0;){tt=J.shift();var j=U.get(tt);j.forEach(function(ut){k.has(ut.id)||(J.push(ut.id),k.add(ut.id),B[at].push(ut.id))})}at++}}),B},m=function(U){var B=new Map;return U.forEach(function(J,k){B.set(k,[])}),U.forEach(function(J,k){J.forEach(function(at){B.get(k).push(at),B.get(at.id).push({id:k,gap:at.gap,direction:at.direction})})}),B},p=function(U){var B=new Map;return U.forEach(function(J,k){B.set(k,[])}),U.forEach(function(J,k){J.forEach(function(at){B.get(at.id).push({id:k,gap:at.gap,direction:at.direction})})}),B},E=[],y=[],I=!1,w=!1,S=new Set,W=new Map,x=new Map,q=[];if(h.fixedNodeConstraint&&h.fixedNodeConstraint.forEach(function(b){S.add(b.nodeId)}),h.relativePlacementConstraint&&(h.relativePlacementConstraint.forEach(function(b){b.left?(W.has(b.left)?W.get(b.left).push({id:b.right,gap:b.gap,direction:"horizontal"}):W.set(b.left,[{id:b.right,gap:b.gap,direction:"horizontal"}]),W.has(b.right)||W.set(b.right,[])):(W.has(b.top)?W.get(b.top).push({id:b.bottom,gap:b.gap,direction:"vertical"}):W.set(b.top,[{id:b.bottom,gap:b.gap,direction:"vertical"}]),W.has(b.bottom)||W.set(b.bottom,[]))}),x=m(W),q=n(x)),i.TRANSFORM_ON_CONSTRAINT_HANDLING){if(h.fixedNodeConstraint&&h.fixedNodeConstraint.length>1)h.fixedNodeConstraint.forEach(function(b,U){E[U]=[b.position.x,b.position.y],y[U]=[v[d.get(b.nodeId)],N[d.get(b.nodeId)]]}),I=!0;else if(h.alignmentConstraint)(function(){var b=0;if(h.alignmentConstraint.vertical){for(var U=h.alignmentConstraint.vertical,B=function(tt){var j=new Set;U[tt].forEach(function(pt){j.add(pt)});var ut=new Set([].concat(f(j)).filter(function(pt){return S.has(pt)})),wt=void 0;ut.size>0?wt=v[d.get(ut.values().next().value)]:wt=K(j).x,U[tt].forEach(function(pt){E[b]=[wt,N[d.get(pt)]],y[b]=[v[d.get(pt)],N[d.get(pt)]],b++})},J=0;J<U.length;J++)B(J);I=!0}if(h.alignmentConstraint.horizontal){for(var k=h.alignmentConstraint.horizontal,at=function(tt){var j=new Set;k[tt].forEach(function(pt){j.add(pt)});var ut=new Set([].concat(f(j)).filter(function(pt){return S.has(pt)})),wt=void 0;ut.size>0?wt=v[d.get(ut.values().next().value)]:wt=K(j).y,k[tt].forEach(function(pt){E[b]=[v[d.get(pt)],wt],y[b]=[v[d.get(pt)],N[d.get(pt)]],b++})},ct=0;ct<k.length;ct++)at(ct);I=!0}h.relativePlacementConstraint&&(w=!0)})();else if(h.relativePlacementConstraint){for(var V=0,Y=0,et=0;et<q.length;et++)q[et].length>V&&(V=q[et].length,Y=et);if(V<x.size/2)rt(h.relativePlacementConstraint),I=!1,w=!1;else{var z=new Map,O=new Map,H=[];q[Y].forEach(function(b){W.get(b).forEach(function(U){U.direction=="horizontal"?(z.has(b)?z.get(b).push(U):z.set(b,[U]),z.has(U.id)||z.set(U.id,[]),H.push({left:b,right:U.id})):(O.has(b)?O.get(b).push(U):O.set(b,[U]),O.has(U.id)||O.set(U.id,[]),H.push({top:b,bottom:U.id}))})}),rt(H),w=!1;var $=D(z,"horizontal"),_=D(O,"vertical");q[Y].forEach(function(b,U){y[U]=[v[d.get(b)],N[d.get(b)]],E[U]=[],$.has(b)?E[U][0]=$.get(b):E[U][0]=v[d.get(b)],_.has(b)?E[U][1]=_.get(b):E[U][1]=N[d.get(b)]}),I=!0}}if(I){for(var ht=void 0,Q=t.transpose(E),It=t.transpose(y),Nt=0;Nt<Q.length;Nt++)Q[Nt]=t.multGamma(Q[Nt]),It[Nt]=t.multGamma(It[Nt]);var vt=t.multMat(Q,t.transpose(It)),it=s.svd(vt);ht=t.multMat(it.V,t.transpose(it.U));for(var gt=0;gt<d.size;gt++){var mt=[v[gt],N[gt]],At=[ht[0][0],ht[1][0]],Ot=[ht[0][1],ht[1][1]];v[gt]=t.dotProduct(mt,At),N[gt]=t.dotProduct(mt,Ot)}w&&rt(h.relativePlacementConstraint)}}if(i.ENFORCE_CONSTRAINTS){if(h.fixedNodeConstraint&&h.fixedNodeConstraint.length>0){var Et={x:0,y:0};h.fixedNodeConstraint.forEach(function(b,U){var B={x:v[d.get(b.nodeId)],y:N[d.get(b.nodeId)]},J=b.position,k=X(J,B);Et.x+=k.x,Et.y+=k.y}),Et.x/=h.fixedNodeConstraint.length,Et.y/=h.fixedNodeConstraint.length,v.forEach(function(b,U){v[U]+=Et.x}),N.forEach(function(b,U){N[U]+=Et.y}),h.fixedNodeConstraint.forEach(function(b){v[d.get(b.nodeId)]=b.position.x,N[d.get(b.nodeId)]=b.position.y})}if(h.alignmentConstraint){if(h.alignmentConstraint.vertical)for(var Dt=h.alignmentConstraint.vertical,Rt=function(U){var B=new Set;Dt[U].forEach(function(at){B.add(at)});var J=new Set([].concat(f(B)).filter(function(at){return S.has(at)})),k=void 0;J.size>0?k=v[d.get(J.values().next().value)]:k=K(B).x,B.forEach(function(at){S.has(at)||(v[d.get(at)]=k)})},Ht=0;Ht<Dt.length;Ht++)Rt(Ht);if(h.alignmentConstraint.horizontal)for(var Ut=h.alignmentConstraint.horizontal,Pt=function(U){var B=new Set;Ut[U].forEach(function(at){B.add(at)});var J=new Set([].concat(f(B)).filter(function(at){return S.has(at)})),k=void 0;J.size>0?k=N[d.get(J.values().next().value)]:k=K(B).y,B.forEach(function(at){S.has(at)||(N[d.get(at)]=k)})},Ft=0;Ft<Ut.length;Ft++)Pt(Ft)}h.relativePlacementConstraint&&(function(){var b=new Map,U=new Map,B=new Map,J=new Map,k=new Map,at=new Map,ct=new Set,nt=new Set;if(S.forEach(function(Gt){ct.add(Gt),nt.add(Gt)}),h.alignmentConstraint){if(h.alignmentConstraint.vertical)for(var tt=h.alignmentConstraint.vertical,j=function(yt){B.set("dummy"+yt,[]),tt[yt].forEach(function(Mt){b.set(Mt,"dummy"+yt),B.get("dummy"+yt).push(Mt),S.has(Mt)&&ct.add("dummy"+yt)}),k.set("dummy"+yt,v[d.get(tt[yt][0])])},ut=0;ut<tt.length;ut++)j(ut);if(h.alignmentConstraint.horizontal)for(var wt=h.alignmentConstraint.horizontal,pt=function(yt){J.set("dummy"+yt,[]),wt[yt].forEach(function(Mt){U.set(Mt,"dummy"+yt),J.get("dummy"+yt).push(Mt),S.has(Mt)&&nt.add("dummy"+yt)}),at.set("dummy"+yt,N[d.get(wt[yt][0])])},xt=0;xt<wt.length;xt++)pt(xt)}var lt=new Map,ot=new Map,Lt=function(yt){W.get(yt).forEach(function(Mt){var Zt=void 0,Bt=void 0;Mt.direction=="horizontal"?(Zt=b.get(yt)?b.get(yt):yt,b.get(Mt.id)?Bt={id:b.get(Mt.id),gap:Mt.gap,direction:Mt.direction}:Bt=Mt,lt.has(Zt)?lt.get(Zt).push(Bt):lt.set(Zt,[Bt]),lt.has(Bt.id)||lt.set(Bt.id,[])):(Zt=U.get(yt)?U.get(yt):yt,U.get(Mt.id)?Bt={id:U.get(Mt.id),gap:Mt.gap,direction:Mt.direction}:Bt=Mt,ot.has(Zt)?ot.get(Zt).push(Bt):ot.set(Zt,[Bt]),ot.has(Bt.id)||ot.set(Bt.id,[]))})},ft=!0,st=!1,Xt=void 0;try{for(var Tt=W.keys()[Symbol.iterator](),Ct;!(ft=(Ct=Tt.next()).done);ft=!0){var $t=Ct.value;Lt($t)}}catch(Gt){st=!0,Xt=Gt}finally{try{!ft&&Tt.return&&Tt.return()}finally{if(st)throw Xt}}var bt=m(lt),zt=m(ot),St=n(bt),kt=n(zt),Kt=p(lt),ce=p(ot),Qt=[],jt=[];St.forEach(function(Gt,yt){Qt[yt]=[],Gt.forEach(function(Mt){Kt.get(Mt).length==0&&Qt[yt].push(Mt)})}),kt.forEach(function(Gt,yt){jt[yt]=[],Gt.forEach(function(Mt){ce.get(Mt).length==0&&jt[yt].push(Mt)})});var _t=D(lt,"horizontal",ct,k,Qt),Jt=D(ot,"vertical",nt,at,jt),oe=function(yt){B.get(yt)?B.get(yt).forEach(function(Mt){v[d.get(Mt)]=_t.get(yt)}):v[d.get(yt)]=_t.get(yt)},te=!0,ee=!1,Ne=void 0;try{for(var ge=_t.keys()[Symbol.iterator](),Le;!(te=(Le=ge.next()).done);te=!0){var ue=Le.value;oe(ue)}}catch(Gt){ee=!0,Ne=Gt}finally{try{!te&&ge.return&&ge.return()}finally{if(ee)throw Ne}}var Be=function(yt){J.get(yt)?J.get(yt).forEach(function(Mt){N[d.get(Mt)]=Jt.get(yt)}):N[d.get(yt)]=Jt.get(yt)},de=!0,Ce=!1,Ae=void 0;try{for(var ve=Jt.keys()[Symbol.iterator](),we;!(de=(we=ve.next()).done);de=!0){var ue=we.value;Be(ue)}}catch(Gt){Ce=!0,Ae=Gt}finally{try{!de&&ve.return&&ve.return()}finally{if(Ce)throw Ae}}})()}for(var Yt=0;Yt<F.length;Yt++){var Vt=F[Yt];Vt.getChild()==null&&Vt.setCenter(v[d.get(Vt.id)],N[d.get(Vt.id)])}},a.exports=o}),551:(a=>{a.exports=A})},L={};function g(a){var e=L[a];if(e!==void 0)return e.exports;var r=L[a]={exports:{}};return P[a](r,r.exports,g),r.exports}var l=g(45);return l})()})})(le)),le.exports}var pr=he.exports,De;function yr(){return De||(De=1,(function(R,M){(function(P,L){R.exports=L(vr())})(pr,function(A){return(()=>{var P={658:(a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(e){for(var r=arguments.length,f=Array(r>1?r-1:0),i=1;i<r;i++)f[i-1]=arguments[i];return f.forEach(function(u){Object.keys(u).forEach(function(t){return e[t]=u[t]})}),e}}),548:((a,e,r)=>{var f=(function(){function t(s,o){var c=[],h=!0,T=!1,d=void 0;try{for(var v=s[Symbol.iterator](),N;!(h=(N=v.next()).done)&&(c.push(N.value),!(o&&c.length===o));h=!0);}catch(F){T=!0,d=F}finally{try{!h&&v.return&&v.return()}finally{if(T)throw d}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),i=r(140).layoutBase.LinkedList,u={};u.getTopMostNodes=function(t){for(var s={},o=0;o<t.length;o++)s[t[o].id()]=!0;var c=t.filter(function(h,T){typeof h=="number"&&(h=T);for(var d=h.parent()[0];d!=null;){if(s[d.id()])return!1;d=d.parent()[0]}return!0});return c},u.connectComponents=function(t,s,o,c){var h=new i,T=new Set,d=[],v=void 0,N=void 0,F=void 0,C=!1,G=1,Z=[],X=[],K=function(){var rt=t.collection();X.push(rt);var n=o[0],m=t.collection();m.merge(n).merge(n.descendants().intersection(s)),d.push(n),m.forEach(function(y){h.push(y),T.add(y),rt.merge(y)});for(var p=function(){n=h.shift();var I=t.collection();n.neighborhood().nodes().forEach(function(x){s.intersection(n.edgesWith(x)).length>0&&I.merge(x)});for(var w=0;w<I.length;w++){var S=I[w];if(v=o.intersection(S.union(S.ancestors())),v!=null&&!T.has(v[0])){var W=v.union(v.descendants());W.forEach(function(x){h.push(x),T.add(x),rt.merge(x),o.has(x)&&d.push(x)})}}};h.length!=0;)p();if(rt.forEach(function(y){s.intersection(y.connectedEdges()).forEach(function(I){rt.has(I.source())&&rt.has(I.target())&&rt.merge(I)})}),d.length==o.length&&(C=!0),!C||C&&G>1){N=d[0],F=N.connectedEdges().length,d.forEach(function(y){y.connectedEdges().length<F&&(F=y.connectedEdges().length,N=y)}),Z.push(N.id());var E=t.collection();E.merge(d[0]),d.forEach(function(y){E.merge(y)}),d=[],o=o.difference(E),G++}};do K();while(!C);return c&&Z.length>0&&c.set("dummy"+(c.size+1),Z),X},u.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var v=!0,N=!1,F=void 0;try{for(var C=s.nodeIndexes[Symbol.iterator](),G;!(v=(G=C.next()).done);v=!0){var Z=G.value,X=f(Z,2),K=X[0],D=X[1],rt=o.cy.getElementById(K);if(rt){var n=rt.boundingBox(),m=s.xCoords[D]-n.w/2,p=s.xCoords[D]+n.w/2,E=s.yCoords[D]-n.h/2,y=s.yCoords[D]+n.h/2;m<c&&(c=m),p>h&&(h=p),E<T&&(T=E),y>d&&(d=y)}}}catch(x){N=!0,F=x}finally{try{!v&&C.return&&C.return()}finally{if(N)throw F}}var I=t.x-(h+c)/2,w=t.y-(d+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+w})}else{Object.keys(s).forEach(function(x){var q=s[x],V=q.getRect().x,Y=q.getRect().x+q.getRect().width,et=q.getRect().y,z=q.getRect().y+q.getRect().height;V<c&&(c=V),Y>h&&(h=Y),et<T&&(T=et),z>d&&(d=z)});var S=t.x-(h+c)/2,W=t.y-(d+T)/2;Object.keys(s).forEach(function(x){var q=s[x];q.setCenter(q.getCenterX()+S,q.getCenterY()+W)})}}},u.calcBoundingBox=function(t,s,o,c){for(var h=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,d=Number.MAX_SAFE_INTEGER,v=Number.MIN_SAFE_INTEGER,N=void 0,F=void 0,C=void 0,G=void 0,Z=t.descendants().not(":parent"),X=Z.length,K=0;K<X;K++){var D=Z[K];N=s[c.get(D.id())]-D.width()/2,F=s[c.get(D.id())]+D.width()/2,C=o[c.get(D.id())]-D.height()/2,G=o[c.get(D.id())]+D.height()/2,h>N&&(h=N),T<F&&(T=F),d>C&&(d=C),v<G&&(v=G)}var rt={};return rt.topLeftX=h,rt.topLeftY=d,rt.width=T-h,rt.height=v-d,rt},u.calcParentsWithoutChildren=function(t,s){var o=t.collection();return s.nodes(":parent").forEach(function(c){var h=!1;c.children().forEach(function(T){T.css("display")!="none"&&(h=!0)}),h||o.merge(c)}),o},a.exports=u}),816:((a,e,r)=>{var f=r(548),i=r(140).CoSELayout,u=r(140).CoSENode,t=r(140).layoutBase.PointD,s=r(140).layoutBase.DimensionD,o=r(140).layoutBase.LayoutConstants,c=r(140).layoutBase.FDLayoutConstants,h=r(140).CoSEConstants,T=function(v,N){var F=v.cy,C=v.eles,G=C.nodes(),Z=C.edges(),X=void 0,K=void 0,D=void 0,rt={};v.randomize&&(X=N.nodeIndexes,K=N.xCoords,D=N.yCoords);var n=function(x){return typeof x=="function"},m=function(x,q){return n(x)?x(q):x},p=f.calcParentsWithoutChildren(F,C),E=function W(x,q,V,Y){for(var et=q.length,z=0;z<et;z++){var O=q[z],H=null;O.intersection(p).length==0&&(H=O.children());var $=void 0,_=O.layoutDimensions({nodeDimensionsIncludeLabels:Y.nodeDimensionsIncludeLabels});if(O.outerWidth()!=null&&O.outerHeight()!=null)if(Y.randomize)if(!O.isParent())$=x.add(new u(V.graphManager,new t(K[X.get(O.id())]-_.w/2,D[X.get(O.id())]-_.h/2),new s(parseFloat(_.w),parseFloat(_.h))));else{var ht=f.calcBoundingBox(O,K,D,X);O.intersection(p).length==0?$=x.add(new u(V.graphManager,new t(ht.topLeftX,ht.topLeftY),new s(ht.width,ht.height))):$=x.add(new u(V.graphManager,new t(ht.topLeftX,ht.topLeftY),new s(parseFloat(_.w),parseFloat(_.h))))}else $=x.add(new u(V.graphManager,new t(O.position("x")-_.w/2,O.position("y")-_.h/2),new s(parseFloat(_.w),parseFloat(_.h))));else $=x.add(new u(this.graphManager));if($.id=O.data("id"),$.nodeRepulsion=m(Y.nodeRepulsion,O),$.paddingLeft=parseInt(O.css("padding")),$.paddingTop=parseInt(O.css("padding")),$.paddingRight=parseInt(O.css("padding")),$.paddingBottom=parseInt(O.css("padding")),Y.nodeDimensionsIncludeLabels&&($.labelWidth=O.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,$.labelHeight=O.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,$.labelPosVertical=O.css("text-valign"),$.labelPosHorizontal=O.css("text-halign")),rt[O.data("id")]=$,isNaN($.rect.x)&&($.rect.x=0),isNaN($.rect.y)&&($.rect.y=0),H!=null&&H.length>0){var Q=void 0;Q=V.getGraphManager().add(V.newGraph(),$),W(Q,H,V,Y)}}},y=function(x,q,V){for(var Y=0,et=0,z=0;z<V.length;z++){var O=V[z],H=rt[O.data("source")],$=rt[O.data("target")];if(H&&$&&H!==$&&H.getEdgesBetween($).length==0){var _=q.add(x.newEdge(),H,$);_.id=O.id(),_.idealLength=m(v.idealEdgeLength,O),_.edgeElasticity=m(v.edgeElasticity,O),Y+=_.idealLength,et++}}v.idealEdgeLength!=null&&(et>0?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=Y/et:n(v.idealEdgeLength)?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=v.idealEdgeLength,h.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,h.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,q){q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=q.fixedNodeConstraint),q.alignmentConstraint&&(x.constraints.alignmentConstraint=q.alignmentConstraint),q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=q.relativePlacementConstraint)};v.nestingFactor!=null&&(h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=v.nestingFactor),v.gravity!=null&&(h.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=v.gravity),v.numIter!=null&&(h.MAX_ITERATIONS=c.MAX_ITERATIONS=v.numIter),v.gravityRange!=null&&(h.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=v.gravityRange),v.gravityCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=v.gravityCompound),v.gravityRangeCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=v.gravityRangeCompound),v.initialEnergyOnIncremental!=null&&(h.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=v.initialEnergyOnIncremental),v.tilingCompareBy!=null&&(h.TILING_COMPARE_BY=v.tilingCompareBy),v.quality=="proof"?o.QUALITY=2:o.QUALITY=0,h.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=v.nodeDimensionsIncludeLabels,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!v.randomize,h.ANIMATE=c.ANIMATE=o.ANIMATE=v.animate,h.TILE=v.tile,h.TILING_PADDING_VERTICAL=typeof v.tilingPaddingVertical=="function"?v.tilingPaddingVertical.call():v.tilingPaddingVertical,h.TILING_PADDING_HORIZONTAL=typeof v.tilingPaddingHorizontal=="function"?v.tilingPaddingHorizontal.call():v.tilingPaddingHorizontal,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,h.PURE_INCREMENTAL=!v.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=v.uniformNodeDimensions,v.step=="transformed"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!1),v.step=="enforced"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!1),v.step=="cose"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!0),v.step=="all"&&(v.randomize?h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!0),v.fixedNodeConstraint||v.alignmentConstraint||v.relativePlacementConstraint?h.TREE_REDUCTION_ON_INCREMENTAL=!1:h.TREE_REDUCTION_ON_INCREMENTAL=!0;var w=new i,S=w.newGraphManager();return E(S.addRoot(),f.getTopMostNodes(G),w,v),y(w,S,Z),I(w,v),w.runLayout(),rt};a.exports={coseLayout:T}}),212:((a,e,r)=>{var f=(function(){function v(N,F){for(var C=0;C<F.length;C++){var G=F[C];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(N,G.key,G)}}return function(N,F,C){return F&&v(N.prototype,F),C&&v(N,C),N}})();function i(v,N){if(!(v instanceof N))throw new TypeError("Cannot call a class as a function")}var u=r(658),t=r(548),s=r(657),o=s.spectralLayout,c=r(816),h=c.coseLayout,T=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(N){return 4500},idealEdgeLength:function(N){return 50},edgeElasticity:function(N){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),d=(function(){function v(N){i(this,v),this.options=u({},T,N)}return f(v,[{key:"run",value:function(){var F=this,C=this.options,G=C.cy,Z=C.eles,X=[],K=[],D=void 0,rt=[];C.fixedNodeConstraint&&(!Array.isArray(C.fixedNodeConstraint)||C.fixedNodeConstraint.length==0)&&(C.fixedNodeConstraint=void 0),C.alignmentConstraint&&(C.alignmentConstraint.vertical&&(!Array.isArray(C.alignmentConstraint.vertical)||C.alignmentConstraint.vertical.length==0)&&(C.alignmentConstraint.vertical=void 0),C.alignmentConstraint.horizontal&&(!Array.isArray(C.alignmentConstraint.horizontal)||C.alignmentConstraint.horizontal.length==0)&&(C.alignmentConstraint.horizontal=void 0)),C.relativePlacementConstraint&&(!Array.isArray(C.relativePlacementConstraint)||C.relativePlacementConstraint.length==0)&&(C.relativePlacementConstraint=void 0);var n=C.fixedNodeConstraint||C.alignmentConstraint||C.relativePlacementConstraint;n&&(C.tile=!1,C.packComponents=!1);var m=void 0,p=!1;if(G.layoutUtilities&&C.packComponents&&(m=G.layoutUtilities("get"),m||(m=G.layoutUtilities()),p=!0),Z.nodes().length>0)if(p){var I=t.getTopMostNodes(C.eles.nodes());if(D=t.connectComponents(G,C.eles,I),D.forEach(function(vt){var it=vt.boundingBox();rt.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),C.randomize&&D.forEach(function(vt){C.eles=vt,X.push(o(C))}),C.quality=="default"||C.quality=="proof"){var w=G.collection();if(C.tile){var S=new Map,W=[],x=[],q=0,V={nodeIndexes:S,xCoords:W,yCoords:x},Y=[];if(D.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(gt,mt){w.merge(vt.nodes()[mt]),gt.isParent()||(V.nodeIndexes.set(vt.nodes()[mt].id(),q++),V.xCoords.push(vt.nodes()[0].position().x),V.yCoords.push(vt.nodes()[0].position().y))}),Y.push(it))}),w.length>1){var et=w.boundingBox();rt.push({x:et.x1+et.w/2,y:et.y1+et.h/2}),D.push(w),X.push(V);for(var z=Y.length-1;z>=0;z--)D.splice(Y[z],1),X.splice(Y[z],1),rt.splice(Y[z],1)}}D.forEach(function(vt,it){C.eles=vt,K.push(h(C,X[it])),t.relocateComponent(rt[it],K[it],C)})}else D.forEach(function(vt,it){t.relocateComponent(rt[it],X[it],C)});var O=new Set;if(D.length>1){var H=[],$=Z.filter(function(vt){return vt.css("display")=="none"});D.forEach(function(vt,it){var gt=void 0;if(C.quality=="draft"&&(gt=X[it].nodeIndexes),vt.nodes().not($).length>0){var mt={};mt.edges=[],mt.nodes=[];var At=void 0;vt.nodes().not($).forEach(function(Ot){if(C.quality=="draft")if(!Ot.isParent())At=gt.get(Ot.id()),mt.nodes.push({x:X[it].xCoords[At]-Ot.boundingbox().w/2,y:X[it].yCoords[At]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var Et=t.calcBoundingBox(Ot,X[it].xCoords,X[it].yCoords,gt);mt.nodes.push({x:Et.topLeftX,y:Et.topLeftY,width:Et.width,height:Et.height})}else K[it][Ot.id()]&&mt.nodes.push({x:K[it][Ot.id()].getLeft(),y:K[it][Ot.id()].getTop(),width:K[it][Ot.id()].getWidth(),height:K[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var Et=Ot.source(),Dt=Ot.target();if(Et.css("display")!="none"&&Dt.css("display")!="none")if(C.quality=="draft"){var Rt=gt.get(Et.id()),Ht=gt.get(Dt.id()),Ut=[],Pt=[];if(Et.isParent()){var Ft=t.calcBoundingBox(Et,X[it].xCoords,X[it].yCoords,gt);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(X[it].xCoords[Rt]),Ut.push(X[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,X[it].xCoords,X[it].yCoords,gt);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(X[it].xCoords[Ht]),Pt.push(X[it].yCoords[Ht]);mt.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else K[it][Et.id()]&&K[it][Dt.id()]&&mt.edges.push({startX:K[it][Et.id()].getCenterX(),startY:K[it][Et.id()].getCenterY(),endX:K[it][Dt.id()].getCenterX(),endY:K[it][Dt.id()].getCenterY()})}),mt.nodes.length>0&&(H.push(mt),O.add(it))}});var _=m.packComponents(H,C.randomize).shifts;if(C.quality=="draft")X.forEach(function(vt,it){var gt=vt.xCoords.map(function(At){return At+_[it].dx}),mt=vt.yCoords.map(function(At){return At+_[it].dy});vt.xCoords=gt,vt.yCoords=mt});else{var ht=0;O.forEach(function(vt){Object.keys(K[vt]).forEach(function(it){var gt=K[vt][it];gt.setCenter(gt.getCenterX()+_[ht].dx,gt.getCenterY()+_[ht].dy)}),ht++})}}}else{var E=C.eles.boundingBox();if(rt.push({x:E.x1+E.w/2,y:E.y1+E.h/2}),C.randomize){var y=o(C);X.push(y)}C.quality=="default"||C.quality=="proof"?(K.push(h(C,X[0])),t.relocateComponent(rt[0],K[0],C)):t.relocateComponent(rt[0],X[0],C)}var Q=function(it,gt){if(C.quality=="default"||C.quality=="proof"){typeof it=="number"&&(it=gt);var mt=void 0,At=void 0,Ot=it.data("id");return K.forEach(function(Dt){Ot in Dt&&(mt={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},At=Dt[Ot])}),C.nodeDimensionsIncludeLabels&&(At.labelWidth&&(At.labelPosHorizontal=="left"?mt.x+=At.labelWidth/2:At.labelPosHorizontal=="right"&&(mt.x-=At.labelWidth/2)),At.labelHeight&&(At.labelPosVertical=="top"?mt.y+=At.labelHeight/2:At.labelPosVertical=="bottom"&&(mt.y-=At.labelHeight/2))),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}else{var Et=void 0;return X.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(Et={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}};if(C.quality=="default"||C.quality=="proof"||C.randomize){var It=t.calcParentsWithoutChildren(G,Z),Nt=Z.filter(function(vt){return vt.css("display")=="none"});C.eles=Z.not(Nt),Z.nodes().not(":parent").not(Nt).layoutPositions(F,C,Q),It.length>0&&It.forEach(function(vt){vt.position(Q(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),v})();a.exports=d}),657:((a,e,r)=>{var f=r(548),i=r(140).layoutBase.Matrix,u=r(140).layoutBase.SVD,t=function(o){var c=o.cy,h=o.eles,T=h.nodes(),d=h.nodes(":parent"),v=new Map,N=new Map,F=new Map,C=[],G=[],Z=[],X=[],K=[],D=[],rt=[],n=[],m=void 0,p=1e8,E=1e-9,y=o.piTol,I=o.samplingType,w=o.nodeSeparation,S=void 0,W=function(){for(var U=0,B=0,J=!1;B<S;){U=Math.floor(Math.random()*m),J=!1;for(var k=0;k<B;k++)if(X[k]==U){J=!0;break}if(!J)X[B]=U,B++;else continue}},x=function(U,B,J){for(var k=[],at=0,ct=0,nt=0,tt=void 0,j=[],ut=0,wt=1,pt=0;pt<m;pt++)j[pt]=p;for(k[ct]=U,j[U]=0;ct>=at;){nt=k[at++];for(var xt=C[nt],lt=0;lt<xt.length;lt++)tt=N.get(xt[lt]),j[tt]==p&&(j[tt]=j[nt]+1,k[++ct]=tt);D[nt][B]=j[nt]*w}if(J){for(var ot=0;ot<m;ot++)D[ot][B]<K[ot]&&(K[ot]=D[ot][B]);for(var Lt=0;Lt<m;Lt++)K[Lt]>ut&&(ut=K[Lt],wt=Lt)}return wt},q=function(U){var B=void 0;if(U){B=Math.floor(Math.random()*m);for(var k=0;k<m;k++)K[k]=p;for(var at=0;at<S;at++)X[at]=B,B=x(B,at,U)}else{W();for(var J=0;J<S;J++)x(X[J],J,U)}for(var ct=0;ct<m;ct++)for(var nt=0;nt<S;nt++)D[ct][nt]*=D[ct][nt];for(var tt=0;tt<S;tt++)rt[tt]=[];for(var j=0;j<S;j++)for(var ut=0;ut<S;ut++)rt[j][ut]=D[X[ut]][j]},V=function(){for(var U=u.svd(rt),B=U.S,J=U.U,k=U.V,at=B[0]*B[0]*B[0],ct=[],nt=0;nt<S;nt++){ct[nt]=[];for(var tt=0;tt<S;tt++)ct[nt][tt]=0,nt==tt&&(ct[nt][tt]=B[nt]/(B[nt]*B[nt]+at/(B[nt]*B[nt])))}n=i.multMat(i.multMat(k,ct),i.transpose(J))},Y=function(){for(var U=void 0,B=void 0,J=[],k=[],at=[],ct=[],nt=0;nt<m;nt++)J[nt]=Math.random(),k[nt]=Math.random();J=i.normalize(J),k=i.normalize(k);for(var tt=E,j=E,ut=void 0;;){for(var wt=0;wt<m;wt++)at[wt]=J[wt];if(J=i.multGamma(i.multL(i.multGamma(at),D,n)),U=i.dotProduct(at,J),J=i.normalize(J),tt=i.dotProduct(at,J),ut=Math.abs(tt/j),ut<=1+y&&ut>=1)break;j=tt}for(var pt=0;pt<m;pt++)at[pt]=J[pt];for(j=E;;){for(var xt=0;xt<m;xt++)ct[xt]=k[xt];if(ct=i.minusOp(ct,i.multCons(at,i.dotProduct(at,ct))),k=i.multGamma(i.multL(i.multGamma(ct),D,n)),B=i.dotProduct(ct,k),k=i.normalize(k),tt=i.dotProduct(ct,k),ut=Math.abs(tt/j),ut<=1+y&&ut>=1)break;j=tt}for(var lt=0;lt<m;lt++)ct[lt]=k[lt];G=i.multCons(at,Math.sqrt(Math.abs(U))),Z=i.multCons(ct,Math.sqrt(Math.abs(B)))};f.connectComponents(c,h,f.getTopMostNodes(T),v),d.forEach(function(b){f.connectComponents(c,h,f.getTopMostNodes(b.descendants().intersection(h)),v)});for(var et=0,z=0;z<T.length;z++)T[z].isParent()||N.set(T[z].id(),et++);var O=!0,H=!1,$=void 0;try{for(var _=v.keys()[Symbol.iterator](),ht;!(O=(ht=_.next()).done);O=!0){var Q=ht.value;N.set(Q,et++)}}catch(b){H=!0,$=b}finally{try{!O&&_.return&&_.return()}finally{if(H)throw $}}for(var It=0;It<N.size;It++)C[It]=[];d.forEach(function(b){for(var U=b.children().intersection(h);U.nodes(":childless").length==0;)U=U.nodes()[0].children().intersection(h);var B=0,J=U.nodes(":childless")[0].connectedEdges().length;U.nodes(":childless").forEach(function(k,at){k.connectedEdges().length<J&&(J=k.connectedEdges().length,B=at)}),F.set(b.id(),U.nodes(":childless")[B].id())}),T.forEach(function(b){var U=void 0;b.isParent()?U=N.get(F.get(b.id())):U=N.get(b.id()),b.neighborhood().nodes().forEach(function(B){h.intersection(b.edgesWith(B)).length>0&&(B.isParent()?C[U].push(F.get(B.id())):C[U].push(B.id()))})});var Nt=function(U){var B=N.get(U),J=void 0;v.get(U).forEach(function(k){c.getElementById(k).isParent()?J=F.get(k):J=k,C[B].push(J),C[N.get(J)].push(U)})},vt=!0,it=!1,gt=void 0;try{for(var mt=v.keys()[Symbol.iterator](),At;!(vt=(At=mt.next()).done);vt=!0){var Ot=At.value;Nt(Ot)}}catch(b){it=!0,gt=b}finally{try{!vt&&mt.return&&mt.return()}finally{if(it)throw gt}}m=N.size;var Et=void 0;if(m>2){S=m<o.sampleSize?m:o.sampleSize;for(var Dt=0;Dt<m;Dt++)D[Dt]=[];for(var Rt=0;Rt<S;Rt++)n[Rt]=[];return o.quality=="draft"||o.step=="all"?(q(I),V(),Y(),Et={nodeIndexes:N,xCoords:G,yCoords:Z}):(N.forEach(function(b,U){G.push(c.getElementById(U).position("x")),Z.push(c.getElementById(U).position("y"))}),Et={nodeIndexes:N,xCoords:G,yCoords:Z}),Et}else{var Ht=N.keys(),Ut=c.getElementById(Ht.next().value),Pt=Ut.position(),Ft=Ut.outerWidth();if(G.push(Pt.x),Z.push(Pt.y),m==2){var Yt=c.getElementById(Ht.next().value),Vt=Yt.outerWidth();G.push(Pt.x+Ft/2+Vt/2+o.idealEdgeLength),Z.push(Pt.y)}return Et={nodeIndexes:N,xCoords:G,yCoords:Z},Et}};a.exports={spectralLayout:t}}),579:((a,e,r)=>{var f=r(212),i=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&i(cytoscape),a.exports=i}),140:(a=>{a.exports=A})},L={};function g(a){var e=L[a];if(e!==void 0)return e.exports;var r=L[a]={exports:{}};return P[a](r,r.exports,g),r.exports}var l=g(579);return l})()})})(he)),he.exports}var Er=yr();const mr=cr(Er);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:dt(R=>`${R},${R/2} 0,${R} 0,0`,"L"),R:dt(R=>`0,${R/2} ${R},0 ${R},${R}`,"R"),T:dt(R=>`0,0 ${R},0 ${R/2},${R}`,"T"),B:dt(R=>`${R/2},0 ${R},${R} 0,${R}`,"B")},se={L:dt((R,M)=>R-M+2,"L"),R:dt((R,M)=>R-2,"R"),T:dt((R,M)=>R-M+2,"T"),B:dt((R,M)=>R-2,"B")},Tr=dt(function(R){return Wt(R)?R==="L"?"R":"L":R==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=dt(function(R){const M=R;return M==="L"||M==="R"||M==="T"||M==="B"},"isArchitectureDirection"),Wt=dt(function(R){const M=R;return M==="L"||M==="R"},"isArchitectureDirectionX"),qt=dt(function(R){const M=R;return M==="T"||M==="B"},"isArchitectureDirectionY"),Te=dt(function(R,M){const A=Wt(R)&&qt(M),P=qt(R)&&Wt(M);return A||P},"isArchitectureDirectionXY"),Nr=dt(function(R){const M=R[0],A=R[1],P=Wt(M)&&qt(A),L=qt(M)&&Wt(A);return P||L},"isArchitecturePairXY"),Lr=dt(function(R){return R!=="LL"&&R!=="RR"&&R!=="TT"&&R!=="BB"},"isValidArchitectureDirectionPair"),ye=dt(function(R,M){const A=`${R}${M}`;return Lr(A)?A:void 0},"getArchitectureDirectionPair"),Cr=dt(function([R,M],A){const P=A[0],L=A[1];return Wt(P)?qt(L)?[R+(P==="L"?-1:1),M+(L==="T"?1:-1)]:[R+(P==="L"?-1:1),M]:Wt(L)?[R+(L==="L"?1:-1),M+(P==="T"?1:-1)]:[R,M+(P==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Ar=dt(function(R){return R==="LT"||R==="TL"?[1,1]:R==="BL"||R==="LB"?[1,-1]:R==="BR"||R==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),wr=dt(function(R,M){return Te(R,M)?"bend":Wt(R)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Mr=dt(function(R){return R.type==="service"},"isArchitectureService"),Or=dt(function(R){return R.type==="junction"},"isArchitectureJunction"),be=dt(R=>R.data(),"edgeData"),ie=dt(R=>R.data(),"nodeData"),Dr=rr.architecture,ae,Pe=(ae=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=qe,this.getAccTitle=Qe,this.setDiagramTitle=Je,this.getDiagramTitle=Ke,this.getAccDescription=je,this.setAccDescription=_e,this.clear()}setDiagramId(M){this.diagramId=M}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",tr()}addService({id:M,icon:A,in:P,title:L,iconText:g}){if(this.registeredIds[M]!==void 0)throw new Error(`The service id [${M}] is already in use by another ${this.registeredIds[M]}`);if(P!==void 0){if(M===P)throw new Error(`The service [${M}] cannot be placed within itself`);if(this.registeredIds[P]===void 0)throw new Error(`The service [${M}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[P]==="node")throw new Error(`The service [${M}]'s parent is not a group`)}this.registeredIds[M]="node",this.nodes[M]={id:M,type:"service",icon:A,iconText:g,title:L,edges:[],in:P}}getServices(){return Object.values(this.nodes).filter(Mr)}addJunction({id:M,in:A}){if(this.registeredIds[M]!==void 0)throw new Error(`The junction id [${M}] is already in use by another ${this.registeredIds[M]}`);if(A!==void 0){if(M===A)throw new Error(`The junction [${M}] cannot be placed within itself`);if(this.registeredIds[A]===void 0)throw new Error(`The junction [${M}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[A]==="node")throw new Error(`The junction [${M}]'s parent is not a group`)}this.registeredIds[M]="node",this.nodes[M]={id:M,type:"junction",edges:[],in:A}}getJunctions(){return Object.values(this.nodes).filter(Or)}getNodes(){return Object.values(this.nodes)}getNode(M){return this.nodes[M]??null}addGroup({id:M,icon:A,in:P,title:L}){var g,l,a;if(((g=this.registeredIds)==null?void 0:g[M])!==void 0)throw new Error(`The group id [${M}] is already in use by another ${this.registeredIds[M]}`);if(P!==void 0){if(M===P)throw new Error(`The group [${M}] cannot be placed within itself`);if(((l=this.registeredIds)==null?void 0:l[P])===void 0)throw new Error(`The group [${M}]'s parent does not exist. Please make sure the parent is created before this group`);if(((a=this.registeredIds)==null?void 0:a[P])==="node")throw new Error(`The group [${M}]'s parent is not a group`)}this.registeredIds[M]="group",this.groups[M]={id:M,icon:A,title:L,in:P}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:M,rhsId:A,lhsDir:P,rhsDir:L,lhsInto:g,rhsInto:l,lhsGroup:a,rhsGroup:e,title:r}){if(!Re(P))throw new Error(`Invalid direction given for left hand side of edge ${M}--${A}. Expected (L,R,T,B) got ${String(P)}`);if(!Re(L))throw new Error(`Invalid direction given for right hand side of edge ${M}--${A}. Expected (L,R,T,B) got ${String(L)}`);if(this.nodes[M]===void 0&&this.groups[M]===void 0)throw new Error(`The left-hand id [${M}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[A]===void 0&&this.groups[A]===void 0)throw new Error(`The right-hand id [${A}] does not yet exist. Please create the service/group before declaring an edge to it.`);const f=this.nodes[M].in,i=this.nodes[A].in;if(a&&f&&i&&f==i)throw new Error(`The left-hand id [${M}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(e&&f&&i&&f==i)throw new Error(`The right-hand id [${A}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const u={lhsId:M,lhsDir:P,lhsInto:g,lhsGroup:a,rhsId:A,rhsDir:L,rhsInto:l,rhsGroup:e,title:r};this.edges.push(u),this.nodes[M]&&this.nodes[A]&&(this.nodes[M].edges.push(this.edges[this.edges.length-1]),this.nodes[A].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const M={},A=Object.entries(this.nodes).reduce((e,[r,f])=>(e[r]=f.edges.reduce((i,u)=>{var o,c;const t=(o=this.getNode(u.lhsId))==null?void 0:o.in,s=(c=this.getNode(u.rhsId))==null?void 0:c.in;if(t&&s&&t!==s){const h=wr(u.lhsDir,u.rhsDir);h!=="bend"&&(M[t]??(M[t]={}),M[t][s]=h,M[s]??(M[s]={}),M[s][t]=h)}if(u.lhsId===r){const h=ye(u.lhsDir,u.rhsDir);h&&(i[h]=u.rhsId)}else{const h=ye(u.rhsDir,u.lhsDir);h&&(i[h]=u.lhsId)}return i},{}),e),{}),P=Object.keys(A)[0],L={[P]:1},g=Object.keys(A).reduce((e,r)=>r===P?e:{...e,[r]:1},{}),l=dt(e=>{const r={[e]:[0,0]},f=[e];for(;f.length>0;){const i=f.shift();if(i){L[i]=1,delete g[i];const u=A[i],[t,s]=r[i];Object.entries(u).forEach(([o,c])=>{L[c]||(r[c]=Cr([t,s],o),f.push(c))})}}return r},"BFS"),a=[l(P)];for(;Object.keys(g).length>0;)a.push(l(Object.keys(g)[0]));this.dataStructures={adjList:A,spatialMaps:a,groupAlignments:M}}return this.dataStructures}setElementForId(M,A){this.elements[M]=A}getElementById(M){return this.elements[M]}getConfig(){return er({...Dr,...ir().architecture})}getConfigField(M){return this.getConfig()[M]}},dt(ae,"ArchitectureDB"),ae),xr=dt((R,M)=>{lr(R,M),R.groups.map(A=>M.addGroup(A)),R.services.map(A=>M.addService({...A,type:"service"})),R.junctions.map(A=>M.addJunction({...A,type:"junction"})),R.edges.map(A=>M.addEdge(A))},"populateDb"),Ge={parser:{yy:void 0},parse:dt(async R=>{var P;const M=await fr("architecture",R);Se.debug(M);const A=(P=Ge.parser)==null?void 0:P.yy;if(!(A instanceof Pe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");xr(M,A)},"parse")},Ir=dt(R=>`
|
|
2
|
-
.edge {
|
|
3
|
-
stroke-width: ${R.archEdgeWidth};
|
|
4
|
-
stroke: ${R.archEdgeColor};
|
|
5
|
-
fill: none;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.arrow {
|
|
9
|
-
fill: ${R.archEdgeArrowColor};
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.node-bkg {
|
|
13
|
-
fill: none;
|
|
14
|
-
stroke: ${R.archGroupBorderColor};
|
|
15
|
-
stroke-width: ${R.archGroupBorderWidth};
|
|
16
|
-
stroke-dasharray: 8;
|
|
17
|
-
}
|
|
18
|
-
.node-icon-text {
|
|
19
|
-
display: flex;
|
|
20
|
-
align-items: center;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.node-icon-text > div {
|
|
24
|
-
color: #fff;
|
|
25
|
-
margin: 1px;
|
|
26
|
-
height: fit-content;
|
|
27
|
-
text-align: center;
|
|
28
|
-
overflow: hidden;
|
|
29
|
-
display: -webkit-box;
|
|
30
|
-
-webkit-box-orient: vertical;
|
|
31
|
-
}
|
|
32
|
-
`,"getStyles"),Rr=Ir,re=dt(R=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${R}</g>`,"wrapIcon"),ne={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:re('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:re('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:re('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:re('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:re('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:hr,blank:{body:re("")}}},Sr=dt(async function(R,M,A,P){const L=A.getConfigField("padding"),g=A.getConfigField("iconSize"),l=g/2,a=g/6,e=a/2;await Promise.all(M.edges().map(async r=>{var X,K;const{source:f,sourceDir:i,sourceArrow:u,sourceGroup:t,target:s,targetDir:o,targetArrow:c,targetGroup:h,label:T}=be(r);let{x:d,y:v}=r[0].sourceEndpoint();const{x:N,y:F}=r[0].midpoint();let{x:C,y:G}=r[0].targetEndpoint();const Z=L+4;if(t&&(Wt(i)?d+=i==="L"?-Z:Z:v+=i==="T"?-Z:Z+18),h&&(Wt(o)?C+=o==="L"?-Z:Z:G+=o==="T"?-Z:Z+18),!t&&((X=A.getNode(f))==null?void 0:X.type)==="junction"&&(Wt(i)?d+=i==="L"?l:-l:v+=i==="T"?l:-l),!h&&((K=A.getNode(s))==null?void 0:K.type)==="junction"&&(Wt(o)?C+=o==="L"?l:-l:G+=o==="T"?l:-l),r[0]._private.rscratch){const D=R.insert("g");if(D.insert("path").attr("d",`M ${d},${v} L ${N},${F} L${C},${G} `).attr("class","edge").attr("id",`${P}-${or(f,s,{prefix:"L"})}`),u){const rt=Wt(i)?se[i](d,a):d-e,n=qt(i)?se[i](v,a):v-e;D.insert("polygon").attr("points",Ie[i](a)).attr("transform",`translate(${rt},${n})`).attr("class","arrow")}if(c){const rt=Wt(o)?se[o](C,a):C-e,n=qt(o)?se[o](G,a):G-e;D.insert("polygon").attr("points",Ie[o](a)).attr("transform",`translate(${rt},${n})`).attr("class","arrow")}if(T){const rt=Te(i,o)?"XY":Wt(i)?"X":"Y";let n=0;rt==="X"?n=Math.abs(d-C):rt==="Y"?n=Math.abs(v-G)/1.5:n=Math.abs(d-C)/2;const m=D.append("g");if(await me(m,T,{useHtmlLabels:!1,width:n,classes:"architecture-service-label"},Ee()),m.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),rt==="X")m.attr("transform","translate("+N+", "+F+")");else if(rt==="Y")m.attr("transform","translate("+N+", "+F+") rotate(-90)");else if(rt==="XY"){const p=ye(i,o);if(p&&Nr(p)){const E=m.node().getBoundingClientRect(),[y,I]=Ar(p);m.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*y*I*45})`);const w=m.node().getBoundingClientRect();m.attr("transform",`
|
|
33
|
-
translate(${N}, ${F-E.height/2})
|
|
34
|
-
translate(${y*w.width/2}, ${I*w.height/2})
|
|
35
|
-
rotate(${-1*y*I*45}, 0, ${E.height/2})
|
|
36
|
-
`)}}}}}))},"drawEdges"),Fr=dt(async function(R,M,A,P){const g=A.getConfigField("padding")*.75,l=A.getConfigField("fontSize"),e=A.getConfigField("iconSize")/2;await Promise.all(M.nodes().map(async r=>{const f=ie(r);if(f.type==="group"){const{h:i,w:u,x1:t,y1:s}=r.boundingBox(),o=R.append("rect");o.attr("id",`${P}-group-${f.id}`).attr("x",t+e).attr("y",s+e).attr("width",u).attr("height",i).attr("class","node-bkg");const c=R.append("g");let h=t,T=s;if(f.icon){const d=c.append("g");d.html(`<g>${await pe(f.icon,{height:g,width:g,fallbackPrefix:ne.prefix})}</g>`),d.attr("transform","translate("+(h+e+1)+", "+(T+e+1)+")"),h+=g,T+=l/2-1-2}if(f.label){const d=c.append("g");await me(d,f.label,{useHtmlLabels:!1,width:u,classes:"architecture-service-label"},Ee()),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),d.attr("transform","translate("+(h+e+4)+", "+(T+e+2)+")")}A.setElementForId(f.id,o)}}))},"drawGroups"),br=dt(async function(R,M,A,P){const L=Ee();for(const g of A){const l=M.append("g"),a=R.getConfigField("iconSize");if(g.title){const i=l.append("g");await me(i,g.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},L),i.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),i.attr("transform","translate("+a/2+", "+a+")")}const e=l.append("g");if(g.icon)e.html(`<g>${await pe(g.icon,{height:a,width:a,fallbackPrefix:ne.prefix})}</g>`);else if(g.iconText){e.html(`<g>${await pe("blank",{height:a,width:a,fallbackPrefix:ne.prefix})}</g>`);const t=e.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(ar(g.iconText,L)),s=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/s)};`)}else e.append("path").attr("class","node-bkg").attr("id",`${P}-node-${g.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);l.attr("id",`${P}-service-${g.id}`).attr("class","architecture-service");const{width:r,height:f}=l.node().getBBox();g.width=r,g.height=f,R.setElementForId(g.id,l)}return 0},"drawServices"),Pr=dt(function(R,M,A,P){A.forEach(L=>{const g=M.append("g"),l=R.getConfigField("iconSize");g.append("g").append("rect").attr("id",`${P}-node-${L.id}`).attr("fill-opacity","0").attr("width",l).attr("height",l),g.attr("class","architecture-junction");const{width:e,height:r}=g._groups[0][0].getBBox();g.width=e,g.height=r,R.setElementForId(L.id,g)})},"drawJunctions");sr([{name:ne.prefix,icons:ne}]);Fe.use(mr);function Ue(R,M,A){R.forEach(P=>{M.add({group:"nodes",data:{type:"service",id:P.id,icon:P.icon,label:P.title,parent:P.in,width:A.getConfigField("iconSize"),height:A.getConfigField("iconSize")},classes:"node-service"})})}dt(Ue,"addServices");function Ye(R,M,A){R.forEach(P=>{M.add({group:"nodes",data:{type:"junction",id:P.id,parent:P.in,width:A.getConfigField("iconSize"),height:A.getConfigField("iconSize")},classes:"node-junction"})})}dt(Ye,"addJunctions");function Xe(R,M){M.nodes().map(A=>{const P=ie(A);if(P.type==="group")return;P.x=A.position().x,P.y=A.position().y,R.getElementById(P.id).attr("transform","translate("+(P.x||0)+","+(P.y||0)+")")})}dt(Xe,"positionNodes");function He(R,M){R.forEach(A=>{M.add({group:"nodes",data:{type:"group",id:A.id,icon:A.icon,label:A.title,parent:A.in},classes:"node-group"})})}dt(He,"addGroups");function We(R,M){R.forEach(A=>{const{lhsId:P,rhsId:L,lhsInto:g,lhsGroup:l,rhsInto:a,lhsDir:e,rhsDir:r,rhsGroup:f,title:i}=A,u=Te(A.lhsDir,A.rhsDir)?"segments":"straight",t={id:`${P}-${L}`,label:i,source:P,sourceDir:e,sourceArrow:g,sourceGroup:l,sourceEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%",target:L,targetDir:r,targetArrow:a,targetGroup:f,targetEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%"};M.add({group:"edges",data:t,classes:u})})}dt(We,"addEdges");function Ve(R,M,A){const P=dt((a,e)=>Object.entries(a).reduce((r,[f,i])=>{var s;let u=0;const t=Object.entries(i);if(t.length===1)return r[f]=t[0][1],r;for(let o=0;o<t.length-1;o++)for(let c=o+1;c<t.length;c++){const[h,T]=t[o],[d,v]=t[c];if(((s=A[h])==null?void 0:s[d])===e)r[f]??(r[f]=[]),r[f]=[...r[f],...T,...v];else if(h==="default"||d==="default")r[f]??(r[f]=[]),r[f]=[...r[f],...T,...v];else{const F=`${f}-${u++}`;r[F]=T;const C=`${f}-${u++}`;r[C]=v}}return r},{}),"flattenAlignments"),L=M.map(a=>{const e={},r={};return Object.entries(a).forEach(([f,[i,u]])=>{var s,o,c;const t=((s=R.getNode(f))==null?void 0:s.in)??"default";e[u]??(e[u]={}),(o=e[u])[t]??(o[t]=[]),e[u][t].push(f),r[i]??(r[i]={}),(c=r[i])[t]??(c[t]=[]),r[i][t].push(f)}),{horiz:Object.values(P(e,"horizontal")).filter(f=>f.length>1),vert:Object.values(P(r,"vertical")).filter(f=>f.length>1)}}),[g,l]=L.reduce(([a,e],{horiz:r,vert:f})=>[[...a,...r],[...e,...f]],[[],[]]);return{horizontal:g,vertical:l}}dt(Ve,"getAlignments");function ze(R,M){const A=[],P=dt(g=>`${g[0]},${g[1]}`,"posToStr"),L=dt(g=>g.split(",").map(l=>parseInt(l)),"strToPos");return R.forEach(g=>{const l=Object.fromEntries(Object.entries(g).map(([f,i])=>[P(i),f])),a=[P([0,0])],e={},r={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;a.length>0;){const f=a.shift();if(f){e[f]=1;const i=l[f];if(i){const u=L(f);Object.entries(r).forEach(([t,s])=>{const o=P([u[0]+s[0],u[1]+s[1]]),c=l[o];c&&!e[o]&&(a.push(o),A.push({[xe[t]]:c,[xe[Tr(t)]]:i,gap:1.5*M.getConfigField("iconSize")}))})}}}}),A}dt(ze,"getRelativeConstraints");function $e(R,M,A,P,L,{spatialMaps:g,groupAlignments:l}){return new Promise(a=>{const e=nr("body").append("div").attr("id","cy").attr("style","display:none"),r=Fe({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${L.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${L.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});e.remove(),He(A,r),Ue(R,r,L),Ye(M,r,L),We(P,r);const f=Ve(L,g,l),i=ze(g,L),u=r.layout({name:"fcose",quality:"proof",randomize:L.getConfigField("randomize"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[s,o]=t.connectedNodes(),{parent:c}=ie(s),{parent:h}=ie(o);return c===h?1.5*L.getConfigField("iconSize"):.5*L.getConfigField("iconSize")},edgeElasticity(t){const[s,o]=t.connectedNodes(),{parent:c}=ie(s),{parent:h}=ie(o);return c===h?.45:.001},alignmentConstraint:f,relativePlacementConstraint:i});u.one("layoutstop",()=>{var s;function t(o,c,h,T){let d,v;const{x:N,y:F}=o,{x:C,y:G}=c;v=(T-F+(N-h)*(F-G)/(N-C))/Math.sqrt(1+Math.pow((F-G)/(N-C),2)),d=Math.sqrt(Math.pow(T-F,2)+Math.pow(h-N,2)-Math.pow(v,2));const Z=Math.sqrt(Math.pow(C-N,2)+Math.pow(G-F,2));d=d/Z;let X=(C-N)*(T-F)-(G-F)*(h-N);switch(!0){case X>=0:X=1;break;case X<0:X=-1;break}let K=(C-N)*(h-N)+(G-F)*(T-F);switch(!0){case K>=0:K=1;break;case K<0:K=-1;break}return v=Math.abs(v)*X,d=d*K,{distances:v,weights:d}}dt(t,"getSegmentWeights"),r.startBatch();for(const o of Object.values(r.edges()))if((s=o.data)!=null&&s.call(o)){const{x:c,y:h}=o.source().position(),{x:T,y:d}=o.target().position();if(c!==T&&h!==d){const v=o.sourceEndpoint(),N=o.targetEndpoint(),{sourceDir:F}=be(o),[C,G]=qt(F)?[v.x,N.y]:[N.x,v.y],{weights:Z,distances:X}=t(v,N,C,G);o.style("segment-distances",X),o.style("segment-weights",Z)}}r.endBatch(),u.run()}),u.run(),r.ready(t=>{Se.info("Ready",t),a(r)})})}dt($e,"layoutArchitecture");var Gr=dt(async(R,M,A,P)=>{const L=P.db;L.setDiagramId(M);const g=L.getServices(),l=L.getJunctions(),a=L.getGroups(),e=L.getEdges(),r=L.getDataStructures(),f=ke(M),i=f.append("g");i.attr("class","architecture-edges");const u=f.append("g");u.attr("class","architecture-services");const t=f.append("g");t.attr("class","architecture-groups"),await br(L,u,g,M),Pr(L,u,l,M);const s=await $e(g,l,a,e,L,r);await Sr(i,s,L,M),await Fr(t,s,L,M),Xe(L,s),Ze(void 0,f,L.getConfigField("padding"),L.getConfigField("useMaxWidth"))},"draw"),Ur={draw:Gr},kr={parser:Ge,get db(){return new Pe},renderer:Ur,styles:Rr};export{kr as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ap as o,aq as n}from"./mermaid.core-CcE8BsIy.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-4TB4RGXK-iBjZne-i.js";import{_ as i}from"./mermaid.core-CcE8BsIy.js";import"./chunk-FMBD7UC4-xfDsv2e3.js";import"./chunk-YZCP3GAM-koDLBRDb.js";import"./chunk-55IACEB6-BHoL99Rv.js";import"./chunk-EDXVE4YY-BleRGeR6.js";import"./AppHeader.module-DPnQHzzR.js";import"./index-CIrnsaQS.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-4TB4RGXK-iBjZne-i.js";import{_ as i}from"./mermaid.core-CcE8BsIy.js";import"./chunk-FMBD7UC4-xfDsv2e3.js";import"./chunk-YZCP3GAM-koDLBRDb.js";import"./chunk-55IACEB6-BHoL99Rv.js";import"./chunk-EDXVE4YY-BleRGeR6.js";import"./AppHeader.module-DPnQHzzR.js";import"./index-CIrnsaQS.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram};
|