project-athena 0.1.0
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/LICENSE +21 -0
- package/README.md +247 -0
- package/dist/cli.js +8614 -0
- package/dist/cli.js.map +1 -0
- package/dist/web/assets/Editor-DmFaONG7.js +39 -0
- package/dist/web/assets/_basePickBy-QJXUw_pr.js +1 -0
- package/dist/web/assets/_baseUniq-DR4vVjyC.js +1 -0
- package/dist/web/assets/abnfDiagram-O67JEVCF-BEaDGLKl.js +1 -0
- package/dist/web/assets/arc-DgcGdgmL.js +1 -0
- package/dist/web/assets/architecture-7GRP2DOG-CHNxu4zI.js +1 -0
- package/dist/web/assets/architectureDiagram-NJMV4G6O-Cr_YqU4C.js +36 -0
- package/dist/web/assets/array-BifhSqXX.js +1 -0
- package/dist/web/assets/blockDiagram-BEXU5L5S-NA64lNxM.js +140 -0
- package/dist/web/assets/c4Diagram-YGBWAQC7-C9OZTI8T.js +38 -0
- package/dist/web/assets/channel-D_T5GGJX.js +1 -0
- package/dist/web/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
- package/dist/web/assets/chunk-3FUC2YCW-PivwegVV.js +2 -0
- package/dist/web/assets/chunk-5DYCD2WN-DH_dVKgx.js +1 -0
- package/dist/web/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
- package/dist/web/assets/chunk-742MDFTN-DTR6iTOw.js +1 -0
- package/dist/web/assets/chunk-7INBJB4K-XeJOzIDQ.js +62 -0
- package/dist/web/assets/chunk-7M6MHVWA-Bn-cXg0l.js +213 -0
- package/dist/web/assets/chunk-7PRAP22T-CPe5zfLc.js +1 -0
- package/dist/web/assets/chunk-DUW6YSOI-Dgx8z5s3.js +1 -0
- package/dist/web/assets/chunk-FOHPRMQF-DzxwRta7.js +161 -0
- package/dist/web/assets/chunk-GTNCS2PH-DSn-mpqy.js +88 -0
- package/dist/web/assets/chunk-GWA4HPMP-DE4DJkth.js +1 -0
- package/dist/web/assets/chunk-J5ZVWO5B-oDCd-gWO.js +1 -0
- package/dist/web/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
- package/dist/web/assets/chunk-MBY4JIJT-9uaOqseW.js +72 -0
- package/dist/web/assets/chunk-NETBCI7D-bxqe7jPe.js +1 -0
- package/dist/web/assets/chunk-O7XYJQB3-CjZQSnt8.js +126 -0
- package/dist/web/assets/chunk-UA2S7LBM-BfYbPxwY.js +1 -0
- package/dist/web/assets/chunk-WEXAMYUT-CT8bG5L7.js +1 -0
- package/dist/web/assets/chunk-XXDRQBXY-BvKO0v-W.js +1 -0
- package/dist/web/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- package/dist/web/assets/chunk-Z7XXMR3K-CHWuLoFG.js +10 -0
- package/dist/web/assets/chunk-ZIGJFQKS-C6SOqBs6.js +2 -0
- package/dist/web/assets/classDiagram-v2-NBCMYWYE-CrSxkUNF.js +217 -0
- package/dist/web/assets/cose-bilkent-JH36ORCC-COXSdE6a.js +1 -0
- package/dist/web/assets/cynefin-OW5HDTMX-CMbTYwga.js +1 -0
- package/dist/web/assets/cynefinDiagram-VND7K2PF-B8wb03CF.js +62 -0
- package/dist/web/assets/cytoscape.esm-Yq6u8L66.js +321 -0
- package/dist/web/assets/dagre-6A5THRUB-Bz-BHtjW.js +4 -0
- package/dist/web/assets/defaultLocale-BFoDCU3G.js +1 -0
- package/dist/web/assets/diagram-22UHCM2B-C9M-mcex.js +200 -0
- package/dist/web/assets/diagram-3UASUU5V-q18RgATq.js +24 -0
- package/dist/web/assets/diagram-ATOU4E4O-zywdDXPc.js +3 -0
- package/dist/web/assets/diagram-CDSNMT55-BGMdofKO.js +30 -0
- package/dist/web/assets/diagram-MLGK6HIB-BdT0J6Xl.js +24 -0
- package/dist/web/assets/diagram-MPIPVDR6-BXdFmdOp.js +41 -0
- package/dist/web/assets/dist-B_J_HbC0.js +1 -0
- package/dist/web/assets/ebnfDiagram-ZINNZB2B-B7Mz8zd0.js +1 -0
- package/dist/web/assets/elk-276RUBZZ-CQ4lVw-r.js +27 -0
- package/dist/web/assets/erDiagram-OPXOYQCR-DmmZBLvC.js +99 -0
- package/dist/web/assets/eventmodeling-NTZA5JFV-BgPhBkRf.js +1 -0
- package/dist/web/assets/flowDiagram-KWPJA3E3-C3wNriu7.js +1 -0
- package/dist/web/assets/ganttDiagram-FUAMR5RP-B0egPzgH.js +292 -0
- package/dist/web/assets/gitGraph-4MIJSDKK-BdShI4JY.js +1 -0
- package/dist/web/assets/gitGraphDiagram-X574FWY7-jwG6nUmP.js +106 -0
- package/dist/web/assets/graphlib-C9Tl7QrK.js +1 -0
- package/dist/web/assets/index-BSiW3yI1.js +45 -0
- package/dist/web/assets/index-DKE3ojTe.css +1 -0
- package/dist/web/assets/info-A6RAGUB7-Hm3KO-lX.js +1 -0
- package/dist/web/assets/infoDiagram-VRGFBTTK-CdcggvNW.js +2 -0
- package/dist/web/assets/init-C-OQMol4.js +1 -0
- package/dist/web/assets/ishikawaDiagram-OU5B5YK6-C8x3tV6X.js +70 -0
- package/dist/web/assets/journeyDiagram-ZHPQQLJL-CLXIkiwl.js +139 -0
- package/dist/web/assets/kanban-definition-PNTS6WVX-P94klDAy.js +89 -0
- package/dist/web/assets/katex-ZlcWpGUi.js +257 -0
- package/dist/web/assets/line-DtGZCXZs.js +1 -0
- package/dist/web/assets/linear-BUnzfXgk.js +1 -0
- package/dist/web/assets/mermaid-parser.core-Du2mcMMx.js +7 -0
- package/dist/web/assets/mermaid.core-B4zgSyXF.js +44 -0
- package/dist/web/assets/mindmap-definition-NLK3R4M7-C0EF7lWr.js +96 -0
- package/dist/web/assets/ordinal-BDEzSJ7C.js +1 -0
- package/dist/web/assets/packet-AYTQ26CC-SJ1tKR5t.js +1 -0
- package/dist/web/assets/path-fybaL0A-.js +1 -0
- package/dist/web/assets/pegDiagram-GJSIUBJH-Dek_S7Z0.js +1 -0
- package/dist/web/assets/pie-WAS4IAKB-C0wgWLu4.js +1 -0
- package/dist/web/assets/pieDiagram-5QR66LMP-Dy1jV_P-.js +39 -0
- package/dist/web/assets/quadrantDiagram-O4NWA36T-Df6Jl4OG.js +7 -0
- package/dist/web/assets/radar-RG4KPBEZ-BCtk017a.js +1 -0
- package/dist/web/assets/railroad-74A4TZTK-_ZAooQok.js +1 -0
- package/dist/web/assets/railroad-abnf-HS5TGJTU-Bacbbg7g.js +1 -0
- package/dist/web/assets/railroad-ebnf-LZEXJU2U-Cb23oOsU.js +1 -0
- package/dist/web/assets/railroad-peg-WCYAUIDC-EPh5LyCw.js +1 -0
- package/dist/web/assets/railroadDiagram-XR7U4H2S-DNraioKj.js +1 -0
- package/dist/web/assets/requirementDiagram-PLB6GJNP-C09s8xl6.js +84 -0
- package/dist/web/assets/rolldown-runtime-Dd_uD5pT.js +1 -0
- package/dist/web/assets/rough.esm-Dy-Kn_BL.js +1 -0
- package/dist/web/assets/sankeyDiagram-IPEJSGJF-cwVwdash.js +40 -0
- package/dist/web/assets/sequenceDiagram-PO4LG4MO-Uz6m2m-d.js +169 -0
- package/dist/web/assets/sizeCapture-INFHLROL-3uHXrFqA.js +1 -0
- package/dist/web/assets/src-oBChb5qS.js +1 -0
- package/dist/web/assets/stateDiagram-v2-GCMORJYK-DASY_MN7.js +291 -0
- package/dist/web/assets/swimlanes-2SLR337P-DjbxDj0Z.js +1 -0
- package/dist/web/assets/swimlanesDiagram-TC7HE7FX-Bv90z5my.js +8 -0
- package/dist/web/assets/timeline-definition-EJHVYXUP-Dffxj5AG.js +120 -0
- package/dist/web/assets/treeView-Q6P3EWNA-CXAvuG6A.js +1 -0
- package/dist/web/assets/treemap-WGGIJYW6-D_BSE2GX.js +1 -0
- package/dist/web/assets/usecaseDiagram-POWQR4AR-CKcfbpDB.js +328 -0
- package/dist/web/assets/vennDiagram-UO4OBE2U-DkJknm_I.js +34 -0
- package/dist/web/assets/wardley-WFR3VGLG-Drx6WB-t.js +1 -0
- package/dist/web/assets/wardleyDiagram-VNRHLVJA-fdjd5am3.js +78 -0
- package/dist/web/assets/xychartDiagram-PMCCYNJV-DCWTWMv0.js +7 -0
- package/dist/web/favicon.svg +1 -0
- package/dist/web/index.html +17 -0
- package/package.json +77 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-oBChb5qS.js";import{x as n}from"./chunk-O7XYJQB3-CjZQSnt8.js";import"./chunk-ZIGJFQKS-C6SOqBs6.js";import"./chunk-742MDFTN-DTR6iTOw.js";import"./chunk-MBY4JIJT-9uaOqseW.js";import"./chunk-7PRAP22T-CPe5zfLc.js";import{c as r}from"./chunk-7INBJB4K-XeJOzIDQ.js";import{a as i,i as a,n as o}from"./chunk-5DYCD2WN-DH_dVKgx.js";import{a as s,i as c,l}from"./chunk-Z7XXMR3K-CHWuLoFG.js";import{A as u,B as d,C as f,F as p,H as m,J as h,K as g,L as ee,M as _,U as te,W as ne,Y as re,_ as ie,a as v,at as ae,c as y,ct as b,d as oe,dt as se,ft as ce,g as le,h as ue,k as de,l as fe,lt as x,m as pe,mt as me,n as S,o as C,ot as he,p as ge,q as _e,r as w,rt as T,st as ve,tt as ye,ut as E}from"./_baseUniq-DR4vVjyC.js";import{S as be,_ as xe,a as Se,b as Ce,c as we,d as Te,g as D,h as O,i as k,l as Ee,m as De,n as Oe,o as A,p as ke,r as Ae,s as j,t as je,u as Me,v as Ne,w as Pe,x as Fe,y as Ie}from"./_basePickBy-QJXUw_pr.js";import{t as M}from"./graphlib-C9Tl7QrK.js";import{r as Le}from"./chunk-UA2S7LBM-BfYbPxwY.js";import{c as Re,i as ze,n as N,o as Be,r as Ve,s as He,t as Ue}from"./chunk-3FUC2YCW-PivwegVV.js";function We(e){return ye(h(e,void 0,O),e+``)}var Ge=`[object Object]`,Ke=Function.prototype,qe=Object.prototype,Je=Ke.toString,Ye=qe.hasOwnProperty,Xe=Je.call(Object);function Ze(e){if(!se(e)||ce(e)!=Ge)return!1;var t=De(e);if(t===null)return!0;var n=Ye.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Je.call(n)==Xe}var Qe=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function $e(e){return Qe.test(e)}var et=1,tt=4;function nt(e){return Ee(e,et|tt)}var rt=function(){return me.Date.now()};function it(e,t,n){(n!==void 0&&!re(e[t],n)||n===void 0&&!(t in e))&&Fe(e,t,n)}function at(e,t){if((t!==`constructor`||typeof e[t]!=`function`)&&t!=`__proto__`)return e[t]}function ot(e){return Ie(e,D(e))}function st(e,t,n,r,i,a,o){var s=at(e,n),c=at(t,n),l=o.get(c);if(l){it(e,n,l);return}var u=a?a(s,c,n+``,e,t,o):void 0,f=u===void 0;if(f){var p=b(c),m=!p&&te(c),h=!p&&!m&&d(c);u=c,p||m||h?b(s)?u=s:oe(s)?u=be(s):m?(f=!1,u=ke(c,!0)):h?(f=!1,u=Te(c,!0)):u=[]:Ze(c)||ne(c)?(u=s,ne(s)?u=ot(s):(!ve(s)||ae(s))&&(u=Me(c))):f=!1}f&&(o.set(c,u),i(u,c,r,a,o),o.delete(c)),it(e,n,u)}function ct(e,t,n,r,i){e!==t&&pe(t,function(a,o){if(i||=new de,ve(a))st(e,t,o,n,ct,r,i);else{var s=r?r(at(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),it(e,o,s)}},D)}function lt(e,t){return e==null?e:pe(e,fe(t),D)}function ut(e,t){return e&&ge(e,fe(t))}function dt(e,t){return e>t}function ft(e,t){return e<t}function P(e,t){var n={};return t=ue(t,3),ge(e,function(e,r,i){Fe(n,r,t(e,r,i))}),n}function F(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(s===void 0?o===o&&!E(o):n(o,s)))var s=o,c=a}return c}function I(e){return e&&e.length?F(e,he,dt):void 0}var L=xe(function(e,t,n){ct(e,t,n)});function R(e){return e&&e.length?F(e,he,ft):void 0}function z(e,t){return e&&e.length?F(e,ue(t,2),ft):void 0}function pt(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function mt(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=E(e),o=t!==void 0,s=t===null,c=t===t,l=E(t);if(!s&&!l&&!a&&e>t||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!c)return-1}return 0}function ht(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=mt(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function gt(e,t,n){t=t.length?x(t,function(e){return b(e)?function(t){return _(t,e.length===1?e[0]:e)}:e}):[he];var r=-1;return t=x(t,m(ue)),pt(Se(e,function(e,n,i){return{criteria:x(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return ht(e,t,n)})}var _t=le(`length`),vt=`\\ud800-\\udfff`,yt=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,bt=`\\ufe0e\\ufe0f`,xt=`[`+vt+`]`,B=`[`+yt+`]`,V=`\\ud83c[\\udffb-\\udfff]`,St=`(?:`+B+`|`+V+`)`,Ct=`[^`+vt+`]`,wt=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Tt=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Et=`\\u200d`,Dt=St+`?`,Ot=`[`+bt+`]?`,kt=`(?:`+Et+`(?:`+[Ct,wt,Tt].join(`|`)+`)`+Ot+Dt+`)*`,At=Ot+Dt+kt,jt=`(?:`+[Ct+B+`?`,B,wt,Tt,xt].join(`|`)+`)`,Mt=RegExp(V+`(?=`+V+`)|`+jt+At,`g`);function Nt(e){for(var t=Mt.lastIndex=0;Mt.test(e);)++t;return t}function Pt(e){return $e(e)?Nt(e):_t(e)}function Ft(e,t){return je(e,t,function(t,n){return ie(e,n)})}var H=We(function(e,t){return e==null?{}:Ft(e,t)}),It=Math.ceil,Lt=Math.max;function Rt(e,t,n,r){for(var i=-1,a=Lt(It((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function zt(e){return function(t,n,r){return r&&typeof r!=`number`&&Ne(t,n,r)&&(n=r=void 0),t=Pe(t),n===void 0?(n=t,t=0):n=Pe(n),r=r===void 0?t<n?1:-1:Pe(r),Rt(t,n,r,e)}}var U=zt(),Bt=`[object Map]`,Vt=`[object Set]`;function Ht(e){if(e==null)return 0;if(g(e))return Oe(e)?Pt(e):e.length;var t=f(e);return t==Bt||t==Vt?e.size:ee(e).length}var W=_e(function(e,t){if(e==null)return[];var n=t.length;return n>1&&Ne(e,t[0],t[1])?t=[]:n>2&&Ne(t[0],t[1],t[2])&&(t=[t[0]]),gt(e,u(t,1),[])}),Ut=0;function G(e){var t=++Ut;return p(e)+t}function Wt(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r<i;){var s=r<a?t[r]:void 0;n(o,e[r],s)}return o}function Gt(e,t){return Wt(e||[],t||[],Ce)}var Kt=class{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return qt(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&qt(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,Jt)),n=n._prev;return`[`+e.join(`, `)+`]`}};function qt(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Jt(e,t){if(e!==`_next`&&e!==`_prev`)return t}var Yt=T(1);function Xt(e,t){if(e.nodeCount()<=1)return[];var n=Qt(e,t||Yt),r=Zt(n.graph,n.buckets,n.zeroIdx);return O(k(r,function(t){return e.outEdges(t.v,t.w)}))}function Zt(e,t,n){for(var r=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)K(e,t,n,o);for(;o=i.dequeue();)K(e,t,n,o);if(e.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){r=r.concat(K(e,t,n,o,!0));break}}}return r}function K(e,t,n,r,i){var a=i?[]:void 0;return y(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,q(t,n,s)}),y(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,q(t,n,o)}),e.removeNode(r.v),a}function Qt(e,t){var n=new M,r=0,i=0;y(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),y(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=U(i+r+3).map(function(){return new Kt}),o=r+1;return y(n.nodes(),function(e){q(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function q(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function $t(e){var t=e.graph().acyclicer===`greedy`?Xt(e,n(e)):en(e);y(t,function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,G(`rev`))});function n(e){return function(t){return e.edge(t).weight}}}function en(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,y(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return y(e.nodes(),i),t}function tn(e){y(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function J(e,t,n,r){var i;do i=G(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function nn(e){var t=new M().setGraph(e.graph());return y(e.nodes(),function(n){t.setNode(n,e.node(n))}),y(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function rn(e){var t=new M({multigraph:e.isMultigraph()}).setGraph(e.graph());return y(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),y(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function an(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function Y(e){var t=k(U(ln(e)+1),function(){return[]});return y(e.nodes(),function(n){var r=e.node(n),i=r.rank;w(i)||(t[i][r.order]=n)}),t}function on(e){var t=R(k(e.nodes(),function(t){return e.node(t).rank}));y(e.nodes(),function(n){var r=e.node(n);Ae(r,`rank`)&&(r.rank-=t)})}function sn(e){var t=R(k(e.nodes(),function(t){return e.node(t).rank})),n=[];y(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;y(n,function(t,n){w(t)&&n%i!==0?--r:r&&y(t,function(t){e.node(t).rank+=r})})}function cn(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),J(e,`border`,i,t)}function ln(e){return I(k(e.nodes(),function(t){var n=e.node(t).rank;if(!w(n))return n}))}function un(e,t){var n={lhs:[],rhs:[]};return y(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function dn(e,t){var n=rt();try{return t()}finally{console.log(e+` time: `+(rt()-n)+`ms`)}}function fn(e,t){return t()}function pn(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&y(r,t),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)mn(e,`borderLeft`,`_bl`,n,i,a),mn(e,`borderRight`,`_br`,n,i,a)}}y(e.children(),t)}function mn(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=J(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function hn(e){var t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&_n(e)}function gn(e){var t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&yn(e),(t===`lr`||t===`rl`)&&(xn(e),_n(e))}function _n(e){y(e.nodes(),function(t){vn(e.node(t))}),y(e.edges(),function(t){vn(e.edge(t))})}function vn(e){var t=e.width;e.width=e.height,e.height=t}function yn(e){y(e.nodes(),function(t){bn(e.node(t))}),y(e.edges(),function(t){var n=e.edge(t);y(n.points,bn),Object.prototype.hasOwnProperty.call(n,`y`)&&bn(n)})}function bn(e){e.y=-e.y}function xn(e){y(e.nodes(),function(t){Sn(e.node(t))}),y(e.edges(),function(t){var n=e.edge(t);y(n.points,Sn),Object.prototype.hasOwnProperty.call(n,`x`)&&Sn(n)})}function Sn(e){var t=e.x;e.x=e.y,e.y=t}function Cn(e){e.graph().dummyChains=[],y(e.edges(),function(t){wn(e,t)})}function wn(e,t){var n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a!==r+1){e.removeEdge(t);var l=void 0,u,d=0;for(++r;r<a;++d,++r)s.points=[],l={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},u=J(e,`edge`,l,`_d`),r===c&&(l.width=s.width,l.height=s.height,l.dummy=`edge-label`,l.labelpos=s.labelpos),e.setEdge(n,u,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(u),n=u;e.setEdge(n,i,{weight:s.weight},o)}}function Tn(e){y(e.graph().dummyChains,function(t){var n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function En(e){var t={};function n(r){var i=e.node(r);if(Object.prototype.hasOwnProperty.call(t,r))return i.rank;t[r]=!0;var a=R(k(e.outEdges(r),function(t){return n(t.w)-e.edge(t).minlen}));return(a===1/0||a==null)&&(a=0),i.rank=a}y(e.sources(),n)}function X(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function Dn(e){var t=new M({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,a;On(t,e)<r;)i=kn(t,e),a=t.hasNode(i.v)?X(e,i):-X(e,i),An(t,e,a);return t}function On(e,t){function n(r){y(t.nodeEdges(r),function(i){var a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!X(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return y(e.nodes(),n),e.nodeCount()}function kn(e,t){return z(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return X(t,n)})}function An(e,t,n){y(e.nodes(),function(e){t.node(e).rank+=n})}T(1),T(1),jn.CycleException=Z;function jn(e){var t={},n={},r=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new Z;Object.prototype.hasOwnProperty.call(t,a)||(n[a]=!0,t[a]=!0,y(e.predecessors(a),i),delete n[a],r.push(a))}if(y(e.sinks(),i),Ht(t)!==e.nodeCount())throw new Z;return r}function Z(){}Z.prototype=Error();function Mn(e,t,n){b(t)||(t=[t]);var r=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return y(t,function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);Nn(e,t,n===`post`,a,r,i)}),i}function Nn(e,t,n,r,i,a){Object.prototype.hasOwnProperty.call(r,t)||(r[t]=!0,n||a.push(t),y(i(t),function(t){Nn(e,t,n,r,i,a)}),n&&a.push(t))}function Pn(e,t){return Mn(e,t,`post`)}function Fn(e,t){return Mn(e,t,`pre`)}Q.initLowLimValues=$,Q.initCutValues=In,Q.calcCutValue=Rn,Q.leaveEdge=Bn,Q.enterEdge=Vn,Q.exchangeEdges=Hn;function Q(e){e=nn(e),En(e);var t=Dn(e);$(t),In(t,e);for(var n,r;n=Bn(t);)r=Vn(t,e,n),Hn(t,e,n,r)}function In(e,t){var n=Pn(e,e.nodes());n=n.slice(0,n.length-1),y(n,function(n){Ln(e,t,n)})}function Ln(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=Rn(e,t,n)}function Rn(e,t,n){var r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;return a||=(i=!1,t.edge(r,n)),o=a.weight,y(t.nodeEdges(n),function(a){var s=a.v===n,c=s?a.w:a.v;if(c!==r){var l=s===i,u=t.edge(a).weight;if(o+=l?u:-u,Wn(e,n,c)){var d=e.edge(n,c).cutvalue;o+=l?-d:d}}}),o}function $(e,t){arguments.length<2&&(t=e.nodes()[0]),zn(e,{},1,t)}function zn(e,t,n,r,i){var a=n,o=e.node(r);return t[r]=!0,y(e.neighbors(r),function(i){Object.prototype.hasOwnProperty.call(t,i)||(n=zn(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function Bn(e){return A(e.edges(),function(t){return e.edge(t).cutvalue<0})}function Vn(e,t,n){var r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);var a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),z(C(t.edges(),function(t){return c===Gn(e,e.node(t.v),s)&&c!==Gn(e,e.node(t.w),s)}),function(e){return X(t,e)})}function Hn(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),$(e),In(e,t),Un(e,t)}function Un(e,t){var n=Fn(e,A(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),y(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function Wn(e,t,n){return e.hasEdge(t,n)}function Gn(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function Kn(e){switch(e.graph().ranker){case`network-simplex`:Yn(e);break;case`tight-tree`:Jn(e);break;case`longest-path`:qn(e);break;default:Yn(e)}}var qn=En;function Jn(e){En(e),Dn(e)}function Yn(e){Q(e)}function Xn(e){var t=J(e,`root`,{},`_root`),n=Qn(e),r=I(v(n))-1,i=2*r+1;e.graph().nestingRoot=t,y(e.edges(),function(t){e.edge(t).minlen*=i});var a=$n(e)+1;y(e.children(),function(o){Zn(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function Zn(e,t,n,r,i,a,o){var s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}var c=cn(e,`_bt`),l=cn(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,y(s,function(s){Zn(e,t,n,r,i,a,s);var u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}function Qn(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&y(a,function(e){n(e,i+1)}),t[r]=i}return y(e.children(),function(e){n(e,1)}),t}function $n(e){return S(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function er(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,y(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}function tr(e,t,n){var r={},i;y(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function nr(e,t,n){var r=rr(e),i=new M({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return y(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),y(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=w(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,`minRank`)&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function rr(e){for(var t;e.hasNode(t=G(`_root`)););return t}function ir(e,t){for(var n=0,r=1;r<t.length;++r)n+=ar(e,t[r-1],t[r]);return n}function ar(e,t,n){for(var r=Gt(n,k(n,function(e,t){return t})),i=O(k(t,function(t){return W(k(e.outEdges(t),function(t){return{pos:r[t.w],weight:e.edge(t).weight}}),`pos`)})),a=1;a<n.length;)a<<=1;var o=2*a-1;--a;var s=k(Array(o),function(){return 0}),c=0;return y(i.forEach(function(e){var t=e.pos+a;s[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n})),c}function or(e){var t={},n=C(e.nodes(),function(t){return!e.children(t).length}),r=I(k(n,function(t){return e.node(t).rank})),i=k(U(r+1),function(){return[]});function a(n){Ae(t,n)||(t[n]=!0,i[e.node(n).rank].push(n),y(e.successors(n),a))}var o=W(n,function(t){return e.node(t).rank});return y(o,a),i}function sr(e,t){return k(t,function(t){var n=e.inEdges(t);if(n.length){var r=S(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}})}function cr(e,t){var n={};return y(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};w(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),y(t.edges(),function(e){var t=n[e.v],r=n[e.w];!w(t)&&!w(r)&&(r.indegree++,t.out.push(n[e.w]))}),lr(C(n,function(e){return!e.indegree}))}function lr(e){var t=[];function n(e){return function(t){t.merged||(w(t.barycenter)||w(e.barycenter)||t.barycenter>=e.barycenter)&&ur(e,t)}}function r(t){return function(n){n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),y(i.in.reverse(),n(i)),y(i.out,r(i))}return k(C(t,function(e){return!e.merged}),function(e){return H(e,[`vs`,`i`,`barycenter`,`weight`])})}function ur(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function dr(e,t){var n=un(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=W(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(pr(!!t)),c=fr(a,i,c),y(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=fr(a,i,c)});var l={vs:O(a)};return s&&(l.barycenter=o/s,l.weight=s),l}function fr(e,t,n){for(var r;t.length&&(r=j(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function pr(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}function mr(e,t,n,r){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=C(i,function(e){return e!==o&&e!==s}));var l=sr(e,i);y(l,function(t){if(e.children(t.v).length){var i=mr(e,t.v,n,r);c[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&gr(t,i)}});var u=cr(l,n);hr(u,c);var d=dr(u,r);if(o&&(d.vs=O([o,d.vs,s]),e.predecessors(o).length)){var f=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function hr(e,t){y(e,function(e){e.vs=O(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function gr(e,t){w(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function _r(e){var t=ln(e),n=vr(e,U(1,t+1),`inEdges`),r=vr(e,U(t-1,-1,-1),`outEdges`),i=or(e);br(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){yr(s%2?n:r,s%4>=2),i=Y(e);var l=ir(e,i);l<a&&(c=0,o=nt(i),a=l)}br(e,o)}function vr(e,t,n){return k(t,function(t){return nr(e,t,n)})}function yr(e,t){var n=new M;y(e,function(e){var r=e.graph().root,i=mr(e,r,n,t);y(i.vs,function(t,n){e.node(t).order=n}),tr(e,n,i.vs)})}function br(e,t){y(t,function(t){y(t,function(t,n){e.node(t).order=n})})}function xr(e){var t=Cr(e);y(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,a=Sr(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(n,l),n=e.successors(n)[0]}})}function Sr(e,t,n,r){var i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c=n,l;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Cr(e){var t={},n=0;function r(i){var a=n;y(e.children(i),r),t[i]={low:a,lim:n++}}return y(e.children(),r),t}function wr(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=j(r);return y(r,function(t,c){var l=Er(e,t),u=l?e.node(l).order:o;(l||t===s)&&(y(r.slice(a,c+1),function(t){y(e.predecessors(t),function(r){var a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&Dr(n,r,t)})}),a=c+1,i=u)}),r}return S(t,r),n}function Tr(e,t){var n={};function r(t,r,i,a,o){var s;y(U(r,i),function(r){s=t[r],e.node(s).dummy&&y(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&Dr(n,t,s)})})}function i(t,n){var i=-1,a,o=0;return y(n,function(s,c){if(e.node(s).dummy===`border`){var l=e.predecessors(s);l.length&&(a=e.node(l[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return S(t,i),n}function Er(e,t){if(e.node(t).dummy)return A(e.predecessors(t),function(t){return e.node(t).dummy})}function Dr(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Or(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function kr(e,t,n,r){var i={},a={},o={};return y(t,function(e){y(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),y(t,function(e){var t=-1;y(e,function(e){var s=r(e);if(s.length){s=W(s,function(e){return o[e]});for(var c=(s.length-1)/2,l=Math.floor(c),u=Math.ceil(c);l<=u;++l){var d=s[l];a[e]===e&&t<o[d]&&!Or(n,e,d)&&(a[d]=e,a[e]=i[e]=i[d],t=o[d])}}})}),{root:i,align:a}}function Ar(e,t,n,r,i){var a={},o=jr(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){for(var n=o.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}function l(e){a[e]=o.inEdges(e).reduce(function(e,t){return Math.max(e,a[t.v]+o.edge(t))},0)}function u(t){var n=o.outEdges(t).reduce(function(e,t){return Math.min(e,a[t.w]-o.edge(t))},1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),y(r,function(e){a[e]=a[n[e]]}),a}function jr(e,t,n,r){var i=new M,a=e.graph(),o=Ir(a.nodesep,a.edgesep,r);return y(t,function(t){var r;y(t,function(t){var a=n[t];if(i.setNode(a),r){var s=n[r],c=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),c||0))}r=t})}),i}function Mr(e,t){return z(v(t),function(t){var n=-1/0,r=1/0;return lt(t,function(t,i){var a=Lr(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}function Nr(e,t){var n=v(t),r=R(n),i=I(n);y([`u`,`d`],function(n){y([`l`,`r`],function(a){var o=n+a,s=e[o],c;if(s!==t){var l=v(s);c=a===`l`?r-R(l):i-I(l),c&&(e[o]=P(s,function(e){return e+c}))}})})}function Pr(e,t){return P(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var i=W(k(e,r));return(i[1]+i[2])/2})}function Fr(e){var t=Y(e),n=L(wr(e,t),Tr(e,t)),r={},i;return y([`u`,`d`],function(a){i=a===`u`?t:v(t).reverse(),y([`l`,`r`],function(t){t===`r`&&(i=k(i,function(e){return v(e).reverse()}));var o=(a===`u`?e.predecessors:e.successors).bind(e),s=kr(e,i,n,o),c=Ar(e,i,s.root,s.align,t===`r`);t===`r`&&(c=P(c,function(e){return-e})),r[a+t]=c})}),Nr(r,Mr(e,r)),Pr(r,e.graph().align)}function Ir(e,t,n){return function(r,i,a){var o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.prototype.hasOwnProperty.call(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.prototype.hasOwnProperty.call(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),l=0,c}}function Lr(e,t){return e.node(t).width}function Rr(e){e=rn(e),zr(e),ut(Fr(e),function(t,n){e.node(n).x=t})}function zr(e){var t=Y(e),n=e.graph().ranksep,r=0;y(t,function(t){var i=I(k(t,function(t){return e.node(t).height}));y(t,function(t){e.node(t).y=r+i/2}),r+=i+n})}function Br(e,t){var n=t&&t.debugTiming?dn:fn;n(`layout`,()=>{var t=n(` buildLayoutGraph`,()=>Zr(e));n(` runLayout`,()=>Vr(t,n)),n(` updateInputGraph`,()=>Hr(e,t))})}function Vr(e,t){t(` makeSpaceForEdgeLabels`,()=>Qr(e)),t(` removeSelfEdges`,()=>si(e)),t(` acyclic`,()=>$t(e)),t(` nestingGraph.run`,()=>Xn(e)),t(` rank`,()=>Kn(rn(e))),t(` injectEdgeLabelProxies`,()=>$r(e)),t(` removeEmptyRanks`,()=>sn(e)),t(` nestingGraph.cleanup`,()=>er(e)),t(` normalizeRanks`,()=>on(e)),t(` assignRankMinMax`,()=>ei(e)),t(` removeEdgeLabelProxies`,()=>ti(e)),t(` normalize.run`,()=>Cn(e)),t(` parentDummyChains`,()=>xr(e)),t(` addBorderSegments`,()=>pn(e)),t(` order`,()=>_r(e)),t(` insertSelfEdges`,()=>ci(e)),t(` adjustCoordinateSystem`,()=>hn(e)),t(` position`,()=>Rr(e)),t(` positionSelfEdges`,()=>li(e)),t(` removeBorderNodes`,()=>oi(e)),t(` normalize.undo`,()=>Tn(e)),t(` fixupEdgeLabelCoords`,()=>ii(e)),t(` undoCoordinateSystem`,()=>gn(e)),t(` translateGraph`,()=>ni(e)),t(` assignNodeIntersects`,()=>ri(e)),t(` reversePoints`,()=>ai(e)),t(` acyclic.undo`,()=>tn(e))}function Hr(e,t){y(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),y(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Ur=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],Wr={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},Gr=[`acyclicer`,`ranker`,`rankdir`,`align`],Kr=[`width`,`height`],qr={width:0,height:0},Jr=[`minlen`,`weight`,`width`,`height`,`labeloffset`],Yr={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Xr=[`labelpos`];function Zr(e){var t=new M({multigraph:!0,compound:!0}),n=di(e.graph());return t.setGraph(L({},Wr,ui(n,Ur),H(n,Gr))),y(e.nodes(),function(n){var r=di(e.node(n));t.setNode(n,we(ui(r,Kr),qr)),t.setParent(n,e.parent(n))}),y(e.edges(),function(n){var r=di(e.edge(n));t.setEdge(n,L({},Yr,ui(r,Jr),H(r,Xr)))}),t}function Qr(e){var t=e.graph();t.ranksep/=2,y(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function $r(e){y(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);J(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function ei(e){var t=0;y(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=I(t,r.maxRank))}),e.graph().maxRank=t}function ti(e){y(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function ni(e){var t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){var a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}y(e.nodes(),function(t){c(e.node(t))}),y(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,`x`)&&c(n)}),t-=o,r-=s,y(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),y(e.edges(),function(n){var i=e.edge(n);y(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,`x`)&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function ri(e){y(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(an(r,a)),n.points.push(an(i,o))})}function ii(e){y(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function ai(e){y(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function oi(e){y(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(j(n.borderLeft)),o=e.node(j(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),y(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}function si(e){y(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function ci(e){var t=Y(e);y(t,function(t){var n=0;y(t,function(t,r){var i=e.node(t);i.order=r+n,y(i.selfEdges,function(t){J(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function li(e){y(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function ui(e,t){return P(H(e,t),Number)}function di(e){var t={};return y(e,function(e,n){t[n.toLowerCase()]=e}),t}var fi=e((e,t,n)=>Math.max(t,Math.min(n,e)),`clamp`),pi=e((e=`TB`)=>{switch(e){case`BT`:return`bottom`;case`LR`:return`right`;case`RL`:return`left`;default:return`top`}},`getDefaultSelfLoopSide`),mi=e(e=>e===`flowchart`||e===`flowchart-v2`||e===`stateDiagram`||e===`er`||e===`classDiagram`,`shouldMergeSelfLoopSegments`),hi=[`x`,`y`,`width`,`height`,`labelBBox`,`intersect`,`calcIntersect`,`diff`,`clusterNode`],gi=e((e,t,n,r,i)=>{let a=[],o=new Set;if(n.forEach(({start:e,end:t})=>{e!==r&&o.add(e),t!==r&&o.add(t)}),o.forEach(t=>{let n=e.node(t);typeof n?.x==`number`&&typeof n?.y==`number`&&a.push(n)}),a.length===0&&n.forEach(({edge:e})=>{(e.points??[]).forEach(e=>{typeof e?.x==`number`&&typeof e?.y==`number`&&a.push(e)})}),a.length===0)return pi(i);let s=a.reduce((e,t)=>({x:e.x+t.x/a.length,y:e.y+t.y/a.length}),{x:0,y:0}),c=s.x-t.x,l=s.y-t.y;return Math.abs(c)>Math.abs(l)?c>0?`right`:`left`:Math.abs(l)>0?l>0?`bottom`:`top`:pi(i)},`getSelfLoopSide`),_i=e((e,t=`top`,n=0,r=0)=>{let i=e.x,a=e.y-n,o=e.width/2,s=e.height/2,c=Math.max(36,Math.min(100,e.width*.8)),l=fi(Math.max(r,e.width*.35),36,c),u=fi(Math.min(e.width,e.height)*.45,24,48);switch(t){case`bottom`:{let e=a+s;return[{x:i-l/2,y:e},{x:i-l/2,y:e+u},{x:i+l/2,y:e+u},{x:i+l/2,y:e}]}case`right`:{let e=i+o;return[{x:e,y:a-l/2},{x:e+u,y:a-l/2},{x:e+u,y:a+l/2},{x:e,y:a+l/2}]}case`left`:{let e=i-o;return[{x:e,y:a-l/2},{x:e-u,y:a-l/2},{x:e-u,y:a+l/2},{x:e,y:a+l/2}]}default:{let e=a-s;return[{x:i-l/2,y:e},{x:i-l/2,y:e-u},{x:i+l/2,y:e-u},{x:i+l/2,y:e}]}}},`getSelfLoopPoints`),vi=e((e,t,n=`top`,r=0,i={})=>{let a=e.x,o=e.y-r,s=i.width??0,c=i.height??0;switch(n){case`bottom`:return{x:a,y:Math.max(...t.map(e=>e.y))+c/2+4};case`right`:return{x:Math.max(...t.map(e=>e.x))+s/2+4,y:o};case`left`:return{x:Math.min(...t.map(e=>e.x))-s/2-4,y:o};default:return{x:a,y:Math.min(...t.map(e=>e.y))-c/2-4}}},`getSelfLoopLabelPosition`),yi=e((e,t=0,{mergeSelfLoops:n=!0}={})=>{let r=new Map,i=[],a=e.graph()?.rankdir;return e.edges().forEach(t=>{let a=e.edge(t);if(n&&a.selfLoop){let e=a.selfLoop.id;r.has(e)||r.set(e,[]),r.get(e).push({edge:a,start:t.v,end:t.w})}else i.push({edge:a,start:t.v,end:t.w})}),r.forEach(n=>{if(n.length!==3){n.forEach(e=>i.push(e));return}n.sort((e,t)=>e.edge.selfLoop.order-t.edge.selfLoop.order);let[r,o,s]=n,c=r.edge.originalEdge??o.edge.originalEdge??s.edge.originalEdge??o.edge,l=e.node(c.start);if(!l){n.forEach(e=>i.push(e));return}let u={width:o.edge.width,height:o.edge.height},d=gi(e,l,n,c.start,a),f=_i(l,d,t,u.width??0),p=vi(l,f,d,t,u),m={...o.edge,...c,id:c.id,points:f,start:c.start,end:c.end,x:p.x,y:p.y,width:u.width,height:u.height,labelStyle:o.edge.labelStyle,fromCluster:r.edge.fromCluster??o.edge.fromCluster??s.edge.fromCluster,toCluster:r.edge.toCluster??o.edge.toCluster??s.edge.toCluster};delete m.selfLoop,delete m.originalEdge,i.push({edge:m,start:m.start,end:m.end})}),i},`getEdgesToRender`),bi=e(async({element:n,graph:a,diagramType:c,id:l,parentCluster:u,siteConfig:d})=>{let f=a.graph().rankdir;t.trace(`Dir in recursive render - dir:`,f);let{clusters:p,edgePaths:m,edgeLabels:h,nodes:g,rootGroups:ee}=ze(n,{edgePathsClass:`edgePaths`});a.nodes()?t.info(`Recursive render XXX`,a.nodes()):t.info(`No nodes found for`,a),a.edges().length>0&&t.info(`Recursive edges`,a.edge(a.edges()[0]));let _=mi(c);await Promise.all(a.nodes().map(async function(e){let n=a.node(e);if(u!==void 0){let n=JSON.parse(JSON.stringify(u.clusterData));t.trace(`Setting data for parent cluster XXX
|
|
2
|
+
Node.id = `,e,`
|
|
3
|
+
data=`,n.height,`
|
|
4
|
+
Parent cluster`,u.height),a.setNode(u.id,n),a.parent(e)||(t.trace(`Setting parent`,e,u.id),a.setParent(e,u.id,n))}if(t.info(`(Insert) Node XXX`+e+`: `+JSON.stringify(a.node(e))),n?.clusterNode){t.info(`Cluster identified XBX`,e,n.width,a.node(e));let{ranksep:o,nodesep:s}=a.graph();n.graph.setGraph({...n.graph.graph(),ranksep:o+25,nodesep:s});let u=await Di({element:g,graph:n.graph,diagramType:c,id:l,parentCluster:a.node(e),siteConfig:d}),f=u.elem;r(n,f),n.diff=u.diff||0,t.info(`New compound node after recursive render XAX`,e,`width`,n.width,`height`,n.height),i(f,n)}else a.children(e).length>0?(t.trace(`Cluster - the non recursive path XBX`,e,n.id,n,n.width,`Graph:`,a),t.trace(Be(n.id,a)),N.set(n.id,{id:Be(n.id,a),node:n})):(t.trace(`Node - the non recursive path XAX`,e,g,a.node(e),f),await He(g,a.node(e),{config:d,dir:f}))})),await e(async()=>{let e=a.edges().map(async function(e){let n=a.edge(e.v,e.w,e.name);if(t.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(e)),t.info(`Edge `+e.v+` -> `+e.w+`: `,e,` `,JSON.stringify(a.edge(e))),t.info(`Fix`,N,`ids:`,e.v,e.w,`Translating: `,N.get(e.v),N.get(e.w)),_&&n.selfLoop){if(n.selfLoop.order!==1)return;let e={...n.originalEdge,...n,id:n.selfLoop.id,startLabelLeft:n.originalEdge?.startLabelLeft??n.startLabelLeft,startLabelRight:n.originalEdge?.startLabelRight??n.startLabelRight,endLabelLeft:n.originalEdge?.endLabelLeft??n.endLabelLeft,endLabelRight:n.originalEdge?.endLabelRight??n.endLabelRight};await s(h,e),n.width=e.width,n.height=e.height,n.labelStyle=e.labelStyle;return}await s(h,n)});await Promise.all(e)},`processEdges`)();let{subGraphTitleTotalMargin:te}=o(d);return{elem:ee,graph:a,groups:{clusters:p,edgePaths:m,edgeLabels:h,nodes:g,rootGroups:ee},diagramType:c,id:l,mergeSelfLoops:_,subGraphTitleTotalMargin:te}},`measureDagreGraph`),xi=e(e=>{t.info(`############################################# XXX`),t.info(`### Layout ### XXX`),t.info(`############################################# XXX`),Br(e)},`runDagreGraphLayout`),Si=e((e,t,n)=>{let r=e.node(t);if(!r)return;let i={...r};return r?.clusterNode?i.y=(r.y??0)+n:e.children(t).length>0?i.height=(r.height??0)+n:i.y=(r.y??0)+n/2,i},`normalizeDagreNode`),Ci=e((e,t)=>{hi.forEach(n=>{t[n]!==void 0&&(e[n]=t[n])})},`applyDagreNodeLayout`),wi=e((e,t,n,r)=>({...e,start:e.start??t,end:e.end??n,points:(e.points??[]).map(e=>({...e,y:typeof e.y==`number`?e.y+r:e.y}))}),`normalizeDagreEdge`),Ti=e((e,t)=>{let{graph:n,mergeSelfLoops:r,subGraphTitleTotalMargin:i=0}=t,a=new Map(e.nodes.map(e=>[e.id,e]));Re(n).forEach(e=>{let t=Si(n,e,i);if(!t)return;Ci(n.node(e),t);let r=a.get(e);r&&Ci(r,t)});let o=i/2;return e.edges=yi(n,o,{mergeSelfLoops:r}).map(({edge:e,start:t,end:n})=>wi(e,t,n,o)),e},`applyDagreLayoutResult`),Ei=e(async({elem:e,graph:n,groups:{clusters:r,edgePaths:i},diagramType:o,id:s,mergeSelfLoops:u,subGraphTitleTotalMargin:d})=>{let f=0;await Promise.all(Re(n).map(async function(e){let i=n.node(e);if(t.info(`Position XBX => `+e+`: (`+i.x,`,`+i.y,`) width: `,i.width,` height: `,i.height),i?.clusterNode)i.y+=d,t.info(`A tainted cluster node XBX1`,e,i.id,i.width,i.height,i.x,i.y,n.parent(e)),N.get(i.id).node=i,a(i);else if(n.children(e).length>0){t.info(`A pure cluster node XBX1`,e,i.id,i.x,i.y,i.width,i.height,n.parent(e)),i.height+=d,n.node(i.parentId);let a=i?.padding/2||0,o=i?.labelBBox?.height||0,s=o-a||0;t.debug(`OffsetY`,s,`labelHeight`,o,`halfPadding`,a),await Le(r,i),N.get(i.id).node=i}else{let e=n.node(i.parentId);i.y+=d/2,t.info(`A regular node XBX1 - using the padding`,i.id,`parent`,i.parentId,i.width,i.height,i.x,i.y,`offsetY`,i.offsetY,`parent`,e,e?.offsetY,i),a(i)}}));let p=d/2;return yi(n,p,{mergeSelfLoops:u}).forEach(function({edge:e,start:r,end:a}){t.info(`Edge `+r+` -> `+a+`: `+JSON.stringify(e),e),e.points.forEach(e=>e.y+=p);let u=n.node(r),d=n.node(a),f=c(i,e,N,o,u,d,s);l(e,f)}),n.nodes().forEach(function(e){let r=n.node(e);t.info(e,r.type,r.diff),r.isGroup&&(f=r.diff)}),t.warn(`Returning from recursive render XAX`,e,f),{elem:e,diff:f}},`paintDagreLayoutCore`),Di=e(async e=>{let t=await bi(e);return xi(t.graph),await Ei(t)},`renderDagreSubgraph`),Oi=e(e=>{let n=new M({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(e=>{n.setNode(e.id,{...e}),e.parentId&&n.setParent(e.id,e.parentId)}),t.debug(`Edges:`,e.edges),e.edges.forEach(e=>{if(e.start===e.end){let t=e.start,r=t+`---`+t+`---1`,i=t+`---`+t+`---2`,a=n.node(t);n.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:``,label:``,padding:0,shape:`labelRect`,style:``,width:10,height:10}),n.setParent(r,a.parentId),n.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:``,padding:0,shape:`labelRect`,label:``,style:``,width:10,height:10}),n.setParent(i,a.parentId);let o=structuredClone(e),s=structuredClone(e),c=structuredClone(e),l=structuredClone(e);s.originalEdge=o,s.selfLoop={id:o.id,order:0},c.originalEdge=o,c.selfLoop={id:o.id,order:1},l.originalEdge=o,l.selfLoop={id:o.id,order:2},s.label=``,s.arrowTypeEnd=`none`,s.endLabelLeft=``,s.endLabelRight=``,s.startLabelLeft=``,s.id=t+`-cyclic-special-1`,c.startLabelRight=``,c.startLabelLeft=``,c.endLabelLeft=``,c.endLabelRight=``,c.arrowTypeStart=`none`,c.arrowTypeEnd=`none`,c.id=t+`-cyclic-special-mid`,l.label=``,l.startLabelRight=``,l.startLabelLeft=``,l.arrowTypeStart=`none`,a.isGroup&&(s.fromCluster=t,l.toCluster=t),l.id=t+`-cyclic-special-2`,l.arrowTypeStart=`none`,n.setEdge(t,r,s,t+`-cyclic-special-0`),n.setEdge(r,i,c,t+`-cyclic-special-1`),n.setEdge(i,t,l,t+`-cyclic-special-2`)}else n.setEdge(e.start,e.end,{...e},e.id)}),Ue(n),{graph:n}},`prepareLayoutForDagre`),ki=e(async(e,{element:t,preparedLayout:r})=>{let i=r??Oi(e),a=n(),o=await bi({element:t,graph:i.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:a});return i.measuredLayout=o,o},`measureDagreLayout`),Ai=e((e,t)=>{let n=t.preparedLayout?.measuredLayout;if(!n)throw Error(`runDagreLayoutCore requires measureDagreLayout to run first`);return xi(n.graph),Ti(e,n),n},`runDagreLayoutCore`),ji=Ve({prepareLayout:Oi,measureLayout:ki,runLayoutCore:Ai,paintOptions:{clusterDb:N,getNodes:e((e,{measure:t})=>Re(t.graph).map(e=>t.graph.node(e)).filter(Boolean),`getDagrePaintNodes`),getEdgeNode:e((e,t,{measure:n})=>e?n.graph.node(e):void 0,`getDagreEdgeNode`),skipNode:e((e,{measure:t})=>!t.graph.hasNode(e.id),`skipNode`),isCluster:e((e,{measure:t})=>t.graph.hasNode(e.id)&&(t.graph.children(e.id)??[]).length>0,`isCluster`)}});export{Ti as applyDagreLayoutResult,yi as getEdgesToRender,ki as measureDagreLayout,Oi as prepareLayoutForDagre,ji as render,Ai as runDagreLayoutCore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function t(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function n(e){return e=t(Math.abs(e)),e?e[1]:NaN}function r(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function i(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(e){if(!(t=a.exec(e)))throw Error(`invalid format: `+e);var t;return new s({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}o.prototype=s.prototype;function s(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}s.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function c(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}var l;function u(e,n){var r=t(e,n);if(!r)return l=void 0,e.toPrecision(n);var i=r[0],a=r[1],o=a-(l=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,s=i.length;return o===s?i:o>s?i+Array(o-s+1).join(`0`):o>0?i.slice(0,o)+`.`+i.slice(o):`0.`+Array(1-o).join(`0`)+t(e,Math.max(0,n+o-1))[0]}function d(e,n){var r=t(e,n);if(!r)return e+``;var i=r[0],a=r[1];return a<0?`0.`+Array(-a).join(`0`)+i:i.length>a+1?i.slice(0,a+1)+`.`+i.slice(a+1):i+Array(a-i.length+2).join(`0`)}var f={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:e,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>d(e*100,t),r:d,s:u,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function p(e){return e}var m=Array.prototype.map,h=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function g(e){var t=e.grouping===void 0||e.thousands===void 0?p:r(m.call(e.grouping,Number),e.thousands+``),a=e.currency===void 0?``:e.currency[0]+``,s=e.currency===void 0?``:e.currency[1]+``,u=e.decimal===void 0?`.`:e.decimal+``,d=e.numerals===void 0?p:i(m.call(e.numerals,String)),g=e.percent===void 0?`%`:e.percent+``,_=e.minus===void 0?`−`:e.minus+``,v=e.nan===void 0?`NaN`:e.nan+``;function y(e,n){e=o(e);var r=e.fill,i=e.align,p=e.sign,m=e.symbol,y=e.zero,b=e.width,x=e.comma,S=e.precision,C=e.trim,w=e.type;w===`n`?(x=!0,w=`g`):f[w]||(S===void 0&&(S=12),C=!0,w=`g`),(y||r===`0`&&i===`=`)&&(y=!0,r=`0`,i=`=`);var T=(n&&n.prefix!==void 0?n.prefix:``)+(m===`$`?a:m===`#`&&/[boxX]/.test(w)?`0`+w.toLowerCase():``),E=(m===`$`?s:/[%p]/.test(w)?g:``)+(n&&n.suffix!==void 0?n.suffix:``),D=f[w],O=/[defgprs%]/.test(w);S=S===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function k(e){var n=T,a=E,o,s,f;if(w===`c`)a=D(e)+a,e=``;else{e=+e;var m=e<0||1/e<0;if(e=isNaN(e)?v:D(Math.abs(e),S),C&&(e=c(e)),m&&+e==0&&p!==`+`&&(m=!1),n=(m?p===`(`?p:_:p===`-`||p===`(`?``:p)+n,a=(w===`s`&&!isNaN(e)&&l!==void 0?h[8+l/3]:``)+a+(m&&p===`(`?`)`:``),O){for(o=-1,s=e.length;++o<s;)if(f=e.charCodeAt(o),48>f||f>57){a=(f===46?u+e.slice(o+1):e.slice(o))+a,e=e.slice(0,o);break}}}x&&!y&&(e=t(e,1/0));var g=n.length+e.length+a.length,k=g<b?Array(b-g+1).join(r):``;switch(x&&y&&(e=t(k+e,k.length?b-a.length:1/0),k=``),i){case`<`:e=n+e+a+k;break;case`=`:e=n+k+e+a;break;case`^`:e=k.slice(0,g=k.length>>1)+n+e+a+k.slice(g);break;default:e=k+n+e+a}return d(e)}return k.toString=function(){return e+``},k}function b(e,t){var r=Math.max(-8,Math.min(8,Math.floor(n(t)/3)))*3,i=10**-r,a=y((e=o(e),e.type=`f`,e),{suffix:h[8+r/3]});return function(e){return a(i*e)}}return{format:y,formatPrefix:b}}var _,v,y;b({thousands:`,`,grouping:[3],currency:[`$`,``]});function b(e){return _=g(e),v=_.format,y=_.formatPrefix,_}export{n as i,y as n,o as r,v as t};
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import{n as e}from"./index-BSiW3yI1.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n,p as r}from"./src-oBChb5qS.js";import{G as i,H as a,U as o,a as s,d as c,it as l,q as u,s as d,v as f,w as p,x as m,y as h}from"./chunk-O7XYJQB3-CjZQSnt8.js";import{t as g}from"./channel-D_T5GGJX.js";import{c as _,g as v}from"./chunk-ZIGJFQKS-C6SOqBs6.js";import"./chunk-742MDFTN-DTR6iTOw.js";import"./chunk-MBY4JIJT-9uaOqseW.js";import{t as y}from"./chunk-5VM5RSS4-ZNzvKenW.js";import"./chunk-7PRAP22T-CPe5zfLc.js";import{i as b,n as x,o as S,r as C}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import{a as w}from"./chunk-7INBJB4K-XeJOzIDQ.js";import"./chunk-5DYCD2WN-DH_dVKgx.js";import"./chunk-Z7XXMR3K-CHWuLoFG.js";import{t as T}from"./chunk-GWA4HPMP-DE4DJkth.js";import{t as E}from"./chunk-XXDRQBXY-BvKO0v-W.js";import{t as D}from"./chunk-WEXAMYUT-CT8bG5L7.js";import"./chunk-UA2S7LBM-BfYbPxwY.js";import{i as O,n as k,r as A,t as j}from"./mermaid.core-B4zgSyXF.js";var M={SHAPE_UNSUPPORTED:`SHAPE_UNSUPPORTED`,SHAPE_REMOVED:`SHAPE_REMOVED`,EDGE_OPERATOR_UNSUPPORTED:`EDGE_OPERATOR_UNSUPPORTED`,REFERENCE_EDGE_LABEL_REJECTED:`REFERENCE_EDGE_LABEL_REJECTED`,CONNECTOR_REF_UNRESOLVED:`CONNECTOR_REF_UNRESOLVED`,CONNECTOR_REF_NOT_A_CONNECTOR:`CONNECTOR_REF_NOT_A_CONNECTOR`,METADATA_KEY_MISAPPLIED:`METADATA_KEY_MISAPPLIED`,DUPLICATE_ID_NODE:`DUPLICATE_ID_NODE`,RESERVED_SYNTHETIC_ID:`RESERVED_SYNTHETIC_ID`,CONTAINMENT_VIOLATION:`CONTAINMENT_VIOLATION`,EDGE_SEMANTIC_CONTRADICTION:`EDGE_SEMANTIC_CONTRADICTION`,FLOW_NO_INPUT:`FLOW_NO_INPUT`},N=new Set([M.SHAPE_UNSUPPORTED,M.SHAPE_REMOVED,M.CONTAINMENT_VIOLATION]);new Set(Object.values(M).filter(e=>!N.has(e)));var P=new Map([[`task`,`roundedRect`],[`tool`,`subroutine`],[`input`,`lean-right`],[`decision`,`diamond`],[`refdoc`,`lin-doc`],[`action`,`hexagon`],[`round`,`rect`]]),ee=new Set(`doc.stadium.terminal.circle.trapezoid.inv_trapezoid.inv-trapezoid.doublecircle.double-circle.typeDeclaration.procs.lean_left.lean-left.in-out.cylinder.ellipse.odd.tag-rect.tagged-rectangle.delay.half-rounded-rectangle.lin-rect.lined-rectangle.win-pane.window-pane.curv-trap.curved-trapezoid`.split(`.`)),te=new Set([`roundedRect`,`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`lean-right`,`diamond`,`lin-doc`,`lined-document`,`hexagon`,`hex`,`connector`,`collapsedGroup`]),F=`roundedRect`;function I(e){return e&&(P.get(e)??e)}t(I,`resolveShapeAlias`);function ne(e,t){for(let r of e)if(!r.isGroup){if((!r.shape||r.shape===`squareRect`||r.shape===`rect`)&&(r.shape=F),ee.has(r.shape)){let e=`shape "${r.shape}" was removed in v0.8.1, using "${F}"`;t?.emitError?t.emitError(`SHAPE_REMOVED`,e,{nodeId:r.id}):n.warn(`agentflow: ${e}`),r.shape=F;continue}if(!te.has(r.shape)){let e=`shape "${r.shape}" is not supported, using "${F}"`;t?.emitWarning?t.emitWarning(`SHAPE_UNSUPPORTED`,e,{nodeId:r.id}):n.warn(`agentflow: ${e}`),r.shape=F}}}t(ne,`normaliseNodeShapes`);var L=new Map([[`tool`,0],[`task`,1],[`decision`,2],[`input`,3],[`refdoc`,4],[`connector`,5],[`action`,6]]),R=L.size,z=t(e=>`af-kind-${e}`,`kindClass`),B=[...L.keys()],V=t(e=>Math.max(1,e-R),`containerSlotCount`),H=t((e,t)=>{let n=R+e%V(t);return t>0?n%t:n},`containerSlot`);function re(e,t,n){let r=m().themeVariables?.borderColorArray,i=Array.isArray(r)?r.length:0,a=n.size;for(let r of e??[]){if(r.isGroup||r.shape===`collapsedGroup`){r.colorIndex=H(n.get(String(r.id))??a++,i);continue}let e=t(String(r.id));e&&L.has(e)&&(r.cssClasses=`${r.cssClasses??``} ${z(e)}`.replace(/\s+/g,` `).trim())}}t(re,`assignColorSlots`);var ie=`agentflow-`,ae=new Set([`shape`,`view`,`icon`,`img`,`form`,`pos`,`w`,`h`,`class`,`style`,`labelType`]),oe=new Set([`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`tool`]),se={flow:`flowGroup`};function ce(e){if(Array.isArray(e))return e.map(e=>ce(e));if(typeof e!=`object`||!e)return e;let t={};for(let n of Object.keys(e))n!==`__proto__`&&n!==`constructor`&&n!==`prototype`&&(t[n]=ce(e[n]));return t}t(ce,`stripPrototypeKeys`);function le(e){let t=!1,n=!1,r=0,i,a=[];for(let o of e.split(`
|
|
2
|
+
`)){if(i!==void 0){let e=o.length-o.trimStart().length;if(o.trim()===``||e>i){a.push(o);continue}i=void 0}let e=-1;for(let i=0;i<o.length;i++){let a=o[i];if(n)a===`\\`?i++:a===`"`&&(n=!1);else if(t)a===`'`&&(t=!1);else if(a===`"`)n=!0;else if(a===`'`)t=!0;else if(a===`#`&&(i===0||o[i-1]===` `||o[i-1]===` `)){e=i;break}else a===`[`||a===`{`?r++:(a===`]`||a===`}`)&&(r=Math.max(0,r-1))}if(t||n||r>0){a.push(o);continue}let s=e>=0?o.slice(0,e):o,c=e>=0?o.slice(e):``;if(/:\s*[>|][\d+-]*\s*$/.test(s)){i=o.length-o.trimStart().length,a.push(o);continue}a.push(s.replace(/,([\t ]*)$/,`$1`)+c)}return a.join(`
|
|
3
|
+
`)}t(le,`stripLineTrailingCommas`);var ue=class{constructor(){this.vertexCounter=0,this.config=m(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId=``,this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=o,this.setAccDescription=a,this.setDiagramTitle=u,this.getAccTitle=h,this.getAccDescription=f,this.getDiagramTitle=p,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen(`gen-2`)}static{t(this,`AgentFlowDB`)}sanitizeText(e){return d.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let t of this.vertices.values())if(t.id===e)return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,t,n,r,i,a,o={},s,c){if(!e||e.trim().length===0)return;let l;if(s!==void 0){let e;e=s.includes(`
|
|
4
|
+
`)?s+`
|
|
5
|
+
`:`{
|
|
6
|
+
`+s+`
|
|
7
|
+
}`;try{l=k(e,{schema:j})??{}}catch(e){let t=s.includes(`
|
|
8
|
+
`)?le(s):s;if(t!==s)try{l=k(t+`
|
|
9
|
+
`,{schema:j})??{}}catch{this.rethrowMetadataYamlError(e,s,c)}else this.rethrowMetadataYamlError(e,s,c)}l=ce(l)}let u;if(l&&typeof l.shape==`string`){let e=l;u=e.shape;let t=I(u);t&&t!==u&&(e.shape=t)}let d=this.subGraphLookup.get(e);if(d&&l){d.metadata={...d.metadata,...l};return}let f=this.connectors.get(e);if(f&&l){f.metadata={...f.metadata,...l};return}if(e===`connectors`)return;let p=this.edges.find(t=>t.id===e);if(p){let e=l;e?.animate!==void 0&&(p.animate=e.animate),e?.animation!==void 0&&(p.animation=e.animation),e?.curve!==void 0&&(p.interpolate=e.curve),l&&(p.metadata={...p.metadata,...l});return}let h,g=this.vertices.get(e);if(g===void 0&&(g={id:e,labelType:`text`,domId:ie+e+`-`+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,g)),this.vertexCounter++,t===void 0?g.text===void 0&&(g.text=e):(this.config=m(),h=this.sanitizeText(t.text.trim()),g.labelType=t.type,h.startsWith(`"`)&&h.endsWith(`"`)&&(h=h.substring(1,h.length-1)),g.text=h),n!==void 0&&(g.type=n),r?.forEach(e=>{g.styles.push(e)}),i?.forEach(e=>{g.classes.push(e)}),a!==void 0&&(g.dir=a),g.props===void 0?g.props=o:o!==void 0&&Object.assign(g.props,o),l){if(g.metadata={...g.metadata,...l},l.shape){let e=u??l.shape;if(typeof e!=`string`)throw this.positionedShapeError(`No such shape: ${JSON.stringify(e)}.`,c);if(e!==e.toLowerCase()||e.includes(`_`))throw this.positionedShapeError(`No such shape: ${e}. Shape names should be lowercase.`,c);if(!w(l.shape))throw this.positionedShapeError(`No such shape: ${l.shape}.`,c);g.type=l?.shape}l?.label&&(g.text=this.sanitizeText(l.label),g.labelType=this.sanitizeNodeLabelType(l?.labelType))}}positionedShapeError(e,t){let n=Error(e);if(!t)return n;let r=t.first_line+this.frontmatterLineOffset;return Object.assign(n,{hash:{text:``,token:null,line:r-1,loc:{first_line:r,last_line:t.last_line+this.frontmatterLineOffset,first_column:t.first_column,last_column:t.last_column},expected:[]}}),n}rethrowMetadataYamlError(e,n,r){let i=e;if(!i||i.name!==`YAMLException`||!i.mark||!r)throw e;let a;try{let e=!n.includes(`
|
|
10
|
+
`),o=e?`{
|
|
11
|
+
`+n+`
|
|
12
|
+
}`:n+`
|
|
13
|
+
`,s=r.first_line+this.frontmatterLineOffset,c=r.first_column+2,l=t((t,n)=>e?{line:s,column:c+(t===1?n:0)}:{line:s+t,column:t===0?c+n:n},`toSource`),u=l(i.mark.line,i.mark.column),d=i.reason??(i.message??``).split(`
|
|
14
|
+
`)[0].replace(/\s*\(\d+:\d+\)\s*$/,``),f=o.split(`
|
|
15
|
+
`),p=[];if(e)p.push(1);else for(let e=i.mark.line-1;e<=i.mark.line+1;e++)e<0||e>=f.length||(e!==f.length-1||f[e]!==``||e===i.mark.line)&&p.push(e);let m=Math.max(...p.map(e=>String(l(e,0).line).length)),h=[];for(let e of p){let t=l(e,0).line,n=` ${String(t).padStart(m)} | `;h.push(n+f[e].replace(/\t/g,`→`)),e===i.mark.line&&h.push(`-`.repeat(n.length+i.mark.column)+`^`)}a={message:`${d} (${u.line}:${u.column+1})
|
|
16
|
+
|
|
17
|
+
${h.join(`
|
|
18
|
+
`)}`,markLine:u.line-1,markColumn:u.column,hash:{text:``,token:null,line:u.line-1,loc:{first_line:u.line,last_line:u.line,first_column:u.column,last_column:u.column+1},expected:[]}}}catch{}throw a&&(i.message=a.message,i.mark.line=a.markLine,i.mark.column=a.markColumn,i.hash=a.hash),i}addSingleLink(e,t,r,i){let a={start:e,end:t,type:void 0,text:``,labelType:`text`,classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};n.info(`abc78 Got edge...`,a);let o=r.text;if(o!==void 0&&(a.text=this.sanitizeText(o.text.trim()),a.text.startsWith(`"`)&&a.text.endsWith(`"`)&&(a.text=a.text.substring(1,a.text.length-1)),a.labelType=this.sanitizeNodeLabelType(o.type)),r!==void 0&&(a.type=r.type,a.stroke=r.stroke,a.length=r.length>10?10:r.length,r.edgeSemantic&&(a.edgeSemantic=r.edgeSemantic)),i&&!this.edges.some(e=>e.id===i))a.id=i,a.isUserDefinedId=!0;else{let e=this.edges.filter(e=>e.start===a.start&&e.end===a.end);a.id=e.length===0?_(a.start,a.end,{counter:0,prefix:`L`}):_(a.start,a.end,{counter:e.length+1,prefix:`L`})}if(this.edges.length<(this.config.maxEdges??500))n.info(`Pushing edge...`),this.edges.push(a);else throw Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
|
|
19
|
+
|
|
20
|
+
Initialize mermaid with maxEdges set to a higher number to allow more edges.
|
|
21
|
+
You cannot set this config via configuration inside the diagram as it is a secure config.
|
|
22
|
+
You have to call mermaid.initialize.`)}isLinkData(e){return typeof e==`object`&&!!e&&`id`in e&&typeof e.id==`string`}addLink(e,t,r){let i=this.isLinkData(r)?r.id.replace(`@`,``):void 0;n.info(`addLink`,e,t,i);for(let n of e)for(let a of t){let o=n===e[e.length-1],s=a===t[0];o&&s?this.addSingleLink(n,a,r,i):this.addSingleLink(n,a,r,void 0)}}updateLinkInterpolate(e,t){e.forEach(e=>{if(e==="default"){this.edges.defaultInterpolate=t;return}if(typeof e==`number`&&e>=this.edges.length)throw Error(`The index ${e} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);this.edges[e].interpolate=t})}updateLink(e,t){e.forEach(e=>{if(typeof e==`number`&&e>=this.edges.length)throw Error(`The index ${e} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);e==="default"?this.edges.defaultStyle=t:(this.edges[e].style=t,(this.edges[e]?.style?.length??0)>0&&!this.edges[e]?.style?.some(e=>e?.startsWith(`fill`))&&this.edges[e]?.style?.push(`fill:none`))})}addClass(e,t){let n=t.join().replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);e.split(`,`).forEach(e=>{let t=this.classes.get(e);t===void 0&&(t={id:e,styles:[],textStyles:[]},this.classes.set(e,t)),n?.forEach(e=>{if(/color/.exec(e)){let n=e.replace(`fill`,`bgFill`);t.textStyles.push(n)}t.styles.push(e)})})}setDirection(e){this.direction=e.trim(),/.*</.exec(this.direction)&&(this.direction=`RL`),/.*\^/.exec(this.direction)&&(this.direction=`BT`),/.*>/.exec(this.direction)&&(this.direction=`LR`),/.*v/.exec(this.direction)&&(this.direction=`TB`),this.direction===`TD`&&(this.direction=`TB`)}setClass(e,t){for(let n of e.split(`,`)){let e=this.vertices.get(n);e&&e.classes.push(t);let r=this.edges.find(e=>e.id===n);r&&r.classes.push(t);let i=this.subGraphLookup.get(n);i&&i.classes.push(t)}}setTooltip(e,t){if(t!==void 0){t=this.sanitizeText(t);for(let n of e.split(`,`))this.tooltips.set(this.version===`gen-1`?this.lookUpDomId(n):n,t)}}setClickFun(e,t,n){if(m().securityLevel!==`loose`||t===void 0)return;let r=[];if(typeof n==`string`){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e<r.length;e++){let t=r[e].trim();t.startsWith(`"`)&&t.endsWith(`"`)&&(t=t.substr(1,t.length-2)),r[e]=t}}r.length===0&&r.push(e);let i=this.vertices.get(e);i&&(i.haveCallback=!0,this.funs.push(()=>{let n=this.lookUpDomId(e),i=document.querySelector(`[id="${n}"]`);i!==null&&i.addEventListener(`click`,()=>{v.runFunc(t,...r)},!1)}))}setLink(e,t,n){e.split(`,`).forEach(e=>{let r=this.vertices.get(e);r!==void 0&&(r.link=v.formatUrl(t,this.config),r.linkTarget=n)}),this.setClass(e,`clickable`)}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,t,n){e.split(`,`).forEach(e=>{this.setClickFun(e,t,n)}),this.setClass(e,`clickable`)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}isToolDefinition(e){return oe.has(e.type)}getTools(){let e=[];for(let t of this.vertices.values())this.isToolDefinition(t)&&e.push(t);return e}getClasses(){return this.classes}setupToolTips(t){let n=T();r(t).select(`svg`).selectAll(`g.node`).on(`mouseover`,t=>{let i=r(t.currentTarget),a=i.attr(`title`);if(a===null)return;let o=t.currentTarget?.getBoundingClientRect();n.transition().duration(200).style(`opacity`,`.9`),n.text(i.attr(`title`)).style(`left`,window.scrollX+o.left+(o.right-o.left)/2+`px`).style(`top`,window.scrollY+o.bottom+`px`),n.html(e.sanitize(a)),i.classed(`hover`,!0)}).on(`mouseout`,e=>{n.transition().duration(500).style(`opacity`,0),r(e.currentTarget).classed(`hover`,!1)})}clear(e=`gen-2`){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=m(),this.diagramId=``,this.vertexCounter=0,this.direction=void 0,this.secCount=-1,this.posCrossRef=[],this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,s()}setGen(e){this.version=e||`gen-2`}defaultStyle(){return`fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;`}addSubGraph(e,r,i,a){let o=e?.text?.trim(),s=i?.text;e===i&&i?.text&&/\s/.exec(i.text)&&(o=void 0);let c=t(e=>{let t={boolean:{},number:{},string:{}},n=[],r;return{nodeList:e.filter(function(e){let i=typeof e;return e.stmt&&e.stmt===`dir`?(r=e.value,!1):e.trim()===``?!1:i in t?t[i].hasOwnProperty(e)?!1:t[i][e]=!0:!n.includes(e)&&n.push(e)}),dir:r}},`uniq`)(r.flat()),l=c.nodeList,u=c.dir,d=m().flowchart??{};if(u??=d.inheritDir?this.getDirection()??m().direction??void 0:void 0,this.version===`gen-1`)for(let e=0;e<l.length;e++)l[e]=this.lookUpDomId(l[e]);o??=`subGraph`+this.subCount,s||=``,s=this.sanitizeText(s),this.subCount+=1;let f={id:o,nodes:l.filter(e=>e!==o&&!this.globalNodes.has(e)),title:s.trim(),classes:[],dir:u,labelType:this.sanitizeNodeLabelType(i?.type),type:a??`flow`};n.info(`Adding`,f.id,f.nodes,f.dir),f.nodes=this.makeUniq(f,this.subGraphs).nodes;let p=this.getPosForId(o);if(p!==-1){let e=this.subGraphs[p];for(let t of f.nodes)e.nodes.includes(t)||e.nodes.push(t);f.title&&(e.title=f.title),f.dir&&(e.dir=f.dir),f.type&&(e.type=f.type),this.subGraphLookup.set(o,e)}else this.subGraphs.push(f),this.subGraphLookup.set(o,f);return o}addGlobal(e){for(let t of e.flat()){if(typeof t!=`string`)continue;let e=t.trim();e!==``&&this.globalNodes.add(e)}for(let e of this.subGraphs)e.nodes=e.nodes.filter(e=>!this.globalNodes.has(e))}getPosForId(e){for(let[t,n]of this.subGraphs.entries())if(n.id===e)return t;return-1}indexNodes2(e,t){let n=this.subGraphs[t].nodes;if(this.secCount+=1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=t,this.subGraphs[t].id===e)return{result:!0,count:0};let r=0,i=1;for(;r<n.length;){let t=this.getPosForId(n[r]);if(t>=0){let n=this.indexNodes2(e,t);if(n.result)return{result:!0,count:i+n.count};i+=n.count}r+=1}return{result:!1,count:i}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2(`none`,this.subGraphs.length-1)}addConnector(e,t){let n=e?.text?.trim();if(!n)return``;let r=t?.text?.trim()??``,i=r.length>0?this.sanitizeText(r):n,a=this.connectors.get(n);return a?r.length>0&&(a.text=i):(a={id:n,labelType:`text`,domId:ie+n+`-`+this.vertexCounter,styles:[],classes:[],isConnector:!0,text:i},this.connectors.set(n,a),this.vertices.set(n,a),this.vertexCounter++),n}getSubGraphs(){return this.subGraphs}getConnectors(){return[...this.connectors.values()]}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}computeEdgeSemantic(e,t){if(e===`arrow_point`&&t===`normal`)return`sequence`;if(e===`arrow_cross`&&t===`normal`)return`failure`;if(e===`arrow_open`&&t===`dotted`)return`reference`}destructStartLink(e){let t=e.trim(),n=`normal`;return t.includes(`.`)&&(n=`dotted`),{type:`arrow_open`,stroke:n}}countChar(e,t){let n=t.length,r=0;for(let i=0;i<n;++i)t[i]===e&&++r;return r}destructEndLink(e){let t=e.trim(),n=t.slice(0,-1),r=`arrow_open`;switch(t.slice(-1)){case`x`:r=`arrow_cross`;break;case`>`:r=`arrow_point`;break;case`-`:case`.`:r=`arrow_open`,n=t}let i=`normal`,a=n.length-1,o=this.countChar(`.`,n);return o>0&&(i=`dotted`,a=o),{type:r,stroke:i,length:a}}destructLink(e,t){let n=this.destructEndLink(e),r;return t?(r=this.destructStartLink(t),r.stroke===n.stroke?(r.type=n.type,r.length=n.length,{...r,edgeSemantic:this.computeEdgeSemantic(r.type,r.stroke)}):{type:`INVALID`,stroke:`INVALID`}):{...n,edgeSemantic:this.computeEdgeSemantic(n.type,n.stroke)}}exists(e,t){for(let n of e)if(n.nodes.includes(t))return!0;return!1}makeUniq(e,t){let n=[];return e.nodes.forEach((r,i)=>{this.exists(t,r)||n.push(e.nodes[i])}),{nodes:n}}getTypeFromVertex(e){let t=typeof e.type==`string`?I(e.type):e.type;switch(t){case`square`:case void 0:return`squareRect`;case`round`:return`roundedRect`;case`ellipse`:return`ellipse`;default:return t}}findNode(e,t){return e.find(e=>e.id===t)}destructEdgeType(e){let t=`none`,n=`arrow_point`;switch(e){case`arrow_point`:case`arrow_circle`:case`arrow_cross`:case`arrow_hierarchy`:n=e;break;case`double_arrow_point`:case`double_arrow_circle`:case`double_arrow_cross`:t=e.replace(`double_`,``),n=t}return{arrowTypeStart:t,arrowTypeEnd:n}}addNodeFromVertex(e,t,n,r,i,a){let o=n.get(e.id),s=r.get(e.id)??!1,c=this.findNode(t,e.id);if(c)c.cssStyles=e.styles,c.cssCompiledStyles=this.getCompiledStyles(e.classes),c.cssClasses=e.classes.join(` `);else{let n={id:e.id,label:e.text,labelType:e.labelType,labelStyle:``,parentId:o,padding:i.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles([`default`,`node`,...e.classes]),cssClasses:`default `+e.classes.join(` `),dir:e.dir,domId:e.domId,look:a,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),metadata:e.metadata};s?t.push({...n,isGroup:!0,shape:`rect`}):t.push({...n,isGroup:!1,shape:this.getTypeFromVertex(e),wrappingWidth:i.agentflow?.wrappingWidth,minWidth:i.agentflow?.minNodeWidth})}}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}runPostParseValidators(){this.postParseValidationRun||=!0}getData(){this.runPostParseValidators();let e=m(),n=[],r=[],i=this.getSubGraphs(),a=new Map,o=new Map,s=new Set,c=new Map,l=t((e,t,n=new Set)=>{if(n.has(e))return;n.add(e);let r=this.subGraphLookup.get(e);if(r)for(let e of r.nodes)e===t||n.has(e)||(s.add(e),c.set(e,t),l(e,t,n))},`collectDescendants`);for(let e of i)e.metadata?.view===`collapsed`&&!s.has(e.id)&&l(e.id,e.id);let u=t((e,t)=>{let n=new Set,r=t;for(;r!==void 0&&!n.has(r);){if(r===e)return!0;n.add(r),r=a.get(r)}return!1},`wouldCloseContainmentCycle`);for(let e=i.length-1;e>=0;e--){let t=i[e];if(!s.has(t.id)){t.nodes.length>0&&o.set(t.id,!0);for(let e of t.nodes){if(u(e,t.id)){this.emitWarning(M.CONTAINMENT_VIOLATION,`Container "${t.id}" cannot contain "${e}" because "${e}" already contains it. The nesting that would close the loop is dropped.`,{nodeId:e});continue}a.set(e,t.id)}}}for(let t=i.length-1;t>=0;t--){let r=i[t];if(!s.has(r.id)){if(r.metadata?.view===`collapsed`){let t={...r.metadata,containerType:r.type};n.push({id:r.id,label:r.title,labelStyle:``,labelType:r.labelType,parentId:a.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssClasses:r.classes.join(` `),shape:`collapsedGroup`,dir:r.dir,isGroup:!1,look:e.look,metadata:t})}else n.push({id:r.id,label:r.title,labelStyle:``,labelType:r.labelType,parentId:a.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssClasses:r.classes.join(` `),shape:se[r.type??`flow`],dir:r.dir,isGroup:!0,look:e.look,metadata:r.metadata})}}this.getVertices().forEach(t=>{s.has(t.id)||this.addNodeFromVertex(t,n,a,o,e,e.look||`classic`)});let d=this.getEdges();d.forEach((t,n)=>{let i=c.get(t.start)??t.start,a=c.get(t.end)??t.end;if(i===a&&t.start!==t.end)return;let{arrowTypeStart:o,arrowTypeEnd:s}=this.destructEdgeType(t.type),l=[...d.defaultStyle??[]];t.style&&l.push(...t.style);let u={id:_(i,a,{counter:n,prefix:`L`},t.id),isUserDefinedId:t.isUserDefinedId,start:i,end:a,type:t.type??`normal`,label:t.text,labelType:t.labelType,labelpos:`c`,thickness:t.stroke,minlen:t.length,classes:t?.stroke===`invisible`?``:`edge-thickness-normal edge-pattern-solid flowchart-link`,arrowTypeStart:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:o,arrowTypeEnd:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:s,arrowheadStyle:`fill: #333`,cssCompiledStyles:this.getCompiledStyles(t.classes),labelStyle:l,style:l,pattern:t.stroke,look:e.look,animate:t.animate,animation:t.animation,curve:t.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve,metadata:t.metadata};r.push(u)}),ne(n,this);let f=new Map,p=new Map;for(let e of i){let t=a.get(e.id);t!==void 0&&p.set(t,[...p.get(t)??[],e.id])}let h=0,g=t(e=>{if(!f.has(e)){f.set(e,h++);for(let t of p.get(e)??[])g(t)}},`walkContainers`);for(let e of i)a.get(e.id)===void 0&&g(e.id);let v=new Set(this.getConnectors().map(e=>e.id));return re(n,e=>{if(v.has(e))return`connector`;let t=this.vertices.get(e);return t?this.deriveVertexKind(t,I(t.type)):void 0},f),{nodes:n,edges:r,other:{},config:e,connectors:this.getConnectors()}}defaultConfig(){return c.flowchart}deriveVertexKind(e,t){return this.isToolDefinition(e)?`tool`:t===`hexagon`||t===`hex`?`action`:t===`lean-right`||t===`lean_right`?`input`:t===`lin-doc`||t===`lined-document`?`refdoc`:t===`diamond`?`decision`:`task`}getSemanticModel(){this.runPostParseValidators();let e=new Set(this.subGraphs.map(e=>e.id)),t=[],n=[];for(let[r,i]of this.vertices){if(e.has(r))continue;if(i.isConnector){let e={id:r};if(i.text!==void 0&&i.text!==r&&(e.title=i.text),i.metadata&&Object.keys(i.metadata).length>0){let t={};for(let[e,n]of Object.entries(i.metadata))ae.has(e)||(t[e]=n);Object.keys(t).length>0&&(e.metadata=t)}n.push(e);continue}let a={id:r};i.text!==void 0&&(a.label=i.text);let o=typeof i.type==`string`?I(i.type):i.type;if(o!==void 0&&(a.shape=o),a.vertexKind=this.deriveVertexKind(i,o),i.metadata&&Object.keys(i.metadata).length>0){let e={};for(let[t,n]of Object.entries(i.metadata))ae.has(t)||(e[t]=n);Object.keys(e).length>0&&(a.metadata=e)}t.push(a)}let r={vertices:t,edges:this.edges.map(e=>{let t={start:e.start,end:e.end};return e.id!==void 0&&(t.id=e.id),typeof e.text==`string`&&e.text.length>0&&(t.label=e.text),e.type!==void 0&&(t.type=e.type),e.stroke!==void 0&&(t.stroke=e.stroke),e.edgeSemantic!==void 0&&(t.edgeSemantic=e.edgeSemantic),e.length!==void 0&&(t.length=e.length),e.metadata&&Object.keys(e.metadata).length>0&&(t.metadata={...e.metadata}),t}),subGraphs:this.subGraphs.map(e=>{let t={id:e.id,nodes:[...e.nodes]};if(e.type!==void 0&&(t.type=e.type),e.title!==void 0&&(t.title=e.title),e.dir!==void 0&&(t.direction=e.dir),e.metadata&&Object.keys(e.metadata).length>0){let n={};for(let[t,r]of Object.entries(e.metadata))ae.has(t)||(n[t]=r);Object.keys(n).length>0&&(t.metadata=n)}return t}),connectors:n,diagnostics:this.diagnostics};return this.direction!==void 0&&(r.direction=this.direction),r}setFrontmatterLineOffset(e){this.frontmatterLineOffset=e??0}toElementPosition(e){let t=e?.first_line??0,n=e?.first_column??0,r=e?.last_line??t,i=e?.last_column??n,[a,o]=e?.range??[0,0];return{startLine:t+this.frontmatterLineOffset,startColumn:n,endLine:r+this.frontmatterLineOffset,endColumn:i,startIndex:a,endIndex:o}}pushMapping(e,t,n){if(!e)return;let r={id:e,type:t,position:this.toElementPosition(n)};return this.elementMappings.push(r),r}addVertexMapping(e,t,n,r){let i=this.pushMapping(e,`vertex`,r);i&&n==null&&this.bareVertexMappings.add(i)}extendVertexMapping(e,t){if(!e||!t)return;let n=this.toElementPosition(t);for(let t=this.elementMappings.length-1;t>=0;t--){let r=this.elementMappings[t];if(r.type===`vertex`&&r.id===e){this.bareVertexMappings.has(r)&&(r.type=`attachment`,this.bareVertexMappings.delete(r)),(n.endLine>r.position.endLine||n.endLine===r.position.endLine&&n.endColumn>r.position.endColumn)&&(r.position.endLine=n.endLine,r.position.endColumn=n.endColumn,r.position.endIndex=n.endIndex);return}}this.pushMapping(e,`attachment`,t)}addEdgeMapping(e,t,n,r){let i=Array.isArray(t)?t.map(e=>typeof e==`string`?e:e?.id??``).filter(Boolean):[],a=i.length>0?i.join(`>`):`edge`;this.pushMapping(a,`edge`,r)}addSubgraphMapping(e,t,n,r){let i=(typeof e==`string`?e:e?.text)??``,a=this.toElementPosition(n),o=r?this.toElementPosition(r):a;i&&this.elementMappings.push({id:i,type:`subgraph`,position:{startLine:a.startLine,startColumn:a.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:a.startIndex,endIndex:o.endIndex}})}addConnectorMapping(e,t,n,r){let i=e?.text?.trim()??``;if(!i)return;let a=this.toElementPosition(n),o=r?this.toElementPosition(r):a;this.elementMappings.push({id:i,type:`connector`,position:{startLine:a.startLine,startColumn:a.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:a.startIndex,endIndex:o.endIndex}})}getElementMappings(){return[...this.elementMappings]}getElementById(e){return this.elementMappings.find(t=>t.id===e)}getElementsOnLine(e){return this.elementMappings.filter(t=>e>=t.position.startLine&&e<=t.position.endLine)}getElementAtPosition(e,n){let r=this.elementMappings.filter(t=>{let{startLine:r,startColumn:i,endLine:a,endColumn:o}=t.position;return!(e<r||e>a||e===r&&n<i||e===a&&n>o)});if(r.length===0)return;let i=t(({position:e})=>[e.endLine-e.startLine,e.endColumn-e.startColumn],`span`);return r.reduce((e,t)=>{let[n,r]=i(e),[a,o]=i(t);return a===n?o<r?t:e:a<n?t:e})}getMappingStats(){let e=0,t=0,n=0,r=0,i=0;for(let a of this.elementMappings)a.type===`vertex`?e++:a.type===`edge`?t++:a.type===`subgraph`?n++:a.type===`connector`?r++:a.type===`attachment`&&i++;return{vertices:e,edges:t,subgraphs:n,connectors:r,attachments:i,totalElements:this.elementMappings.length}}emitDiagnostic(e,t,r,i){let a=i?.nodeId??i?.edgeId,o=a?this.getElementById(a):void 0,s={id:e,severity:t,message:r,...i?.nodeId?{nodeId:i.nodeId}:{},...i?.edgeId&&!i?.nodeId?{edgeId:i.edgeId}:{},...o?{position:o.position}:{}};if(this.diagnostics.some(e=>e.id===s.id&&e.severity===s.severity&&e.message===s.message&&e.nodeId===s.nodeId&&e.edgeId===s.edgeId))return;this.diagnostics.push(s);let c=`agentflow[${e}]: ${r}`;t===`error`?n.error(c):n.warn(c)}emitWarning(e,t,n){this.emitDiagnostic(e,`warning`,t,n)}emitError(e,t,n){this.emitDiagnostic(e,`error`,t,n)}getDiagnostics(){return[...this.diagnostics]}},de={getClasses:t(function(e,t){return t.db.getClasses()},`getClasses`),draw:t(async function(e,t,r,i){n.debug(`Drawing agentflow diagram`,t);let{securityLevel:a,agentflow:o,layout:s}=m();i.db.setDiagramId(t),n.debug(`Before getData: `);let c=i.db.getData();n.debug(`Data: `,c);let l=E(t,a),u=i.db.getDirection();c.type=i.type,c.layoutAlgorithm=A(s),c.layoutAlgorithm===`dagre`&&s===`elk`&&n.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),c.direction=u,c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,c.markers=[`point`,`circle`,`cross`,`hierarchy`],c.diagramId=t,n.debug(`REF1:`,c),await O(c,l);let d=o?.diagramPadding??8;v.insertTitle(l,`agentflowTitleText`,o?.titleTopMargin??0,i.db.getDiagramTitle()),D(l,d,`agentflow`,o?.useMaxWidth??!0)},`draw`)},fe=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,5],r=[1,4],i=[1,3],a=[1,6],o=[1,8,9,10,11,12,28,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],s=[2,2],c=[1,15],l=[1,16],u=[1,17],d=[1,18],f=[1,19],p=[1,26],m=[1,27],h=[1,28],g=[1,30],_=[1,31],v=[1,32],y=[1,55],b=[1,54],x=[1,34],S=[1,35],C=[1,36],w=[1,37],T=[1,38],E=[1,50],D=[1,52],O=[1,48],k=[1,53],A=[1,49],j=[1,56],M=[1,51],N=[1,57],P=[1,58],ee=[1,39],te=[1,40],F=[1,41],I=[1,42],ne=[1,43],L=[1,64],R=[1,8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],z=[1,70],B=[1,68],V=[1,67],H=[1,69],re=[8,9,10,12,78,80,81],ie=[1,88],ae=[1,101],oe=[1,106],se=[1,105],ce=[1,102],le=[1,98],ue=[1,104],de=[1,100],fe=[1,107],pe=[1,103],me=[1,108],he=[1,99],ge=[8,9,10,11,12,43,78,80,81],U=[8,9,10,11,12,43,49,78,80,81],W=[8,9,10,11,12,30,43,47,49,51,53,55,57,59,61,63,66,68,70,71,73,78,80,81,92,105,108,109,112,114,117,118,119],_e=[8,9,10,12,47,63,78,80,81,92,105,108,109,112,114,117,118,119],ve=[47,63,92,105,108,109,112,114,117,118,119],ye=[1,131],be=[1,132],xe=[1,134],Se=[1,133],Ce=[47,63,65,77,92,105,108,109,112,114,117,118,119],we=[1,143],Te=[1,157],Ee=[1,158],De=[1,159],Oe=[1,162],ke=[1,161],Ae=[1,160],je=[1,145],Me=[1,147],Ne=[1,151],Pe=[1,139],Fe=[1,140],Ie=[1,152],Le=[1,153],Re=[1,154],ze=[1,155],Be=[1,156],Ve=[1,163],He=[1,164],Ue=[1,141],We=[1,142],Ge=[1,149],Ke=[1,144],qe=[1,148],Je=[1,146],Ye=[8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],Xe=[1,168],Ze=[1,170],G=[8,9,10,12],K=[8,9,10,11,12,15,47,63,92,108,109,112,114,117,118,119],q=[1,190],J=[1,186],Y=[1,187],X=[1,191],Z=[1,188],Q=[1,189],Qe=[80,119,122],$=[8,9,10,11,12,13,15,28,30,33,35,36,43,47,63,78,87,88,89,90,91,92,93,108,112,114,117,118,119],$e=[11,109],et=[32,52,54,56,58,60,65,67,69,70,72,74,119,120,121],tt=[1,269],nt=[1,267],rt=[1,271],it=[1,265],at=[1,266],ot=[1,268],st=[1,270],ct=[1,272],lt=[1,292],ut=[8,9,10,12,109],dt=[8,9,10,11,12,63,87,108,109,112,113,114,115],ft={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,COMMENT:8,SEMI:9,NEWLINE:10,SPACE:11,EOF:12,GRAPH:13,NODIR:14,DIR:15,FirstStmtSeparator:16,ending:17,endToken:18,spaceList:19,spaceListNewline:20,vertexStatement:21,separator:22,styleStatement:23,linkStyleStatement:24,classDefStatement:25,classStatement:26,clickStatement:27,flow:28,textNoTags:29,SQS:30,text:31,SQE:32,end:33,shapeData:34,global:35,connector:36,direction:37,acc_title:38,acc_title_value:39,acc_descr:40,acc_descr_value:41,acc_descr_multiline_value:42,SHAPE_DATA:43,link:44,node:45,styledVertex:46,AMP:47,vertex:48,STYLE_SEPARATOR:49,idString:50,DOUBLECIRCLESTART:51,DOUBLECIRCLEEND:52,PS:53,PE:54,"(-":55,"-)":56,STADIUMSTART:57,STADIUMEND:58,SUBROUTINESTART:59,SUBROUTINEEND:60,VERTEX_WITH_PROPS_START:61,"NODE_STRING[field]":62,COLON:63,"NODE_STRING[value]":64,PIPE:65,CYLINDERSTART:66,CYLINDEREND:67,DIAMOND_START:68,DIAMOND_STOP:69,TAGEND:70,TRAPSTART:71,TRAPEND:72,INVTRAPSTART:73,INVTRAPEND:74,linkStatement:75,arrowText:76,TESTSTR:77,START_LINK:78,edgeText:79,LINK:80,LINK_ID:81,edgeTextToken:82,STR:83,MD_STR:84,textToken:85,keywords:86,STYLE:87,LINKSTYLE:88,CLASSDEF:89,CLASS:90,CLICK:91,DOWN:92,UP:93,textNoTagsToken:94,stylesOpt:95,"idString[vertex]":96,"idString[class]":97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,"STR[link]":102,"STR[tooltip]":103,alphaNum:104,DEFAULT:105,numList:106,INTERPOLATE:107,NUM:108,COMMA:109,style:110,styleComponent:111,NODE_STRING:112,UNIT:113,BRKT:114,PCT:115,idStringToken:116,MINUS:117,MULT:118,UNICODE_TEXT:119,TEXT:120,TAGSTART:121,EDGE_TEXT:122,alphaNumToken:123,direction_tb:124,direction_bt:125,direction_rl:126,direction_lr:127,direction_td:128,$accept:0,$end:1},terminals_:{2:`error`,8:`COMMENT`,9:`SEMI`,10:`NEWLINE`,11:`SPACE`,12:`EOF`,13:`GRAPH`,14:`NODIR`,15:`DIR`,28:`flow`,30:`SQS`,32:`SQE`,33:`end`,35:`global`,36:`connector`,38:`acc_title`,39:`acc_title_value`,40:`acc_descr`,41:`acc_descr_value`,42:`acc_descr_multiline_value`,43:`SHAPE_DATA`,47:`AMP`,49:`STYLE_SEPARATOR`,51:`DOUBLECIRCLESTART`,52:`DOUBLECIRCLEEND`,53:`PS`,54:`PE`,55:`(-`,56:`-)`,57:`STADIUMSTART`,58:`STADIUMEND`,59:`SUBROUTINESTART`,60:`SUBROUTINEEND`,61:`VERTEX_WITH_PROPS_START`,62:`NODE_STRING[field]`,63:`COLON`,64:`NODE_STRING[value]`,65:`PIPE`,66:`CYLINDERSTART`,67:`CYLINDEREND`,68:`DIAMOND_START`,69:`DIAMOND_STOP`,70:`TAGEND`,71:`TRAPSTART`,72:`TRAPEND`,73:`INVTRAPSTART`,74:`INVTRAPEND`,77:`TESTSTR`,78:`START_LINK`,80:`LINK`,81:`LINK_ID`,83:`STR`,84:`MD_STR`,87:`STYLE`,88:`LINKSTYLE`,89:`CLASSDEF`,90:`CLASS`,91:`CLICK`,92:`DOWN`,93:`UP`,96:`idString[vertex]`,97:`idString[class]`,98:`CALLBACKNAME`,99:`CALLBACKARGS`,100:`HREF`,101:`LINK_TARGET`,102:`STR[link]`,103:`STR[tooltip]`,105:`DEFAULT`,107:`INTERPOLATE`,108:`NUM`,109:`COMMA`,112:`NODE_STRING`,113:`UNIT`,114:`BRKT`,115:`PCT`,117:`MINUS`,118:`MULT`,119:`UNICODE_TEXT`,120:`TEXT`,121:`TAGSTART`,122:`EDGE_TEXT`,124:`direction_tb`,125:`direction_bt`,126:`direction_rl`,127:`direction_lr`,128:`direction_td`},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,2],[4,3],[17,2],[17,1],[18,1],[18,1],[18,1],[16,1],[16,1],[16,2],[16,1],[20,2],[20,2],[20,2],[20,1],[20,1],[20,1],[19,2],[19,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,10],[7,6],[7,7],[7,4],[7,4],[7,7],[7,8],[7,4],[7,5],[7,1],[7,2],[7,2],[7,1],[22,1],[22,1],[22,1],[22,1],[34,2],[34,1],[21,4],[21,3],[21,4],[21,2],[21,2],[21,1],[45,1],[45,6],[45,5],[46,1],[46,3],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,8],[48,4],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,4],[48,4],[48,1],[44,2],[44,3],[44,3],[44,1],[44,3],[44,4],[79,1],[79,2],[79,1],[79,1],[75,1],[75,2],[76,3],[31,1],[31,2],[31,1],[31,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[29,1],[29,2],[29,1],[29,1],[25,5],[26,5],[27,2],[27,4],[27,3],[27,5],[27,3],[27,5],[27,5],[27,7],[27,2],[27,4],[27,2],[27,4],[27,4],[27,6],[23,5],[24,5],[24,5],[24,9],[24,9],[24,7],[24,7],[106,1],[106,3],[95,1],[95,3],[110,1],[110,2],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[85,1],[85,1],[85,1],[85,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[82,1],[82,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[50,1],[50,2],[104,1],[104,2],[37,1],[37,1],[37,1],[37,1],[37,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 2:this.$=[];break;case 3:(!Array.isArray(a[s])||a[s].length>0)&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 198:this.$=a[s];break;case 5:case 33:case 34:case 35:case 36:case 37:this.$=[];break;case 13:r.setDirection(`TB`),this.$=`TB`;break;case 14:r.setDirection(a[s-1]),this.$=a[s-1];break;case 32:this.$=a[s-1].nodes;break;case 38:this.$=r.addSubGraph(a[s-6],a[s-1],a[s-4],`flow`),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-6],a[s-4],o[s-8],o[s]);break;case 39:this.$=r.addSubGraph(a[s-7],a[s-1],a[s-5],`flow`),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-3],o[s-3]),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-7],a[s-5],o[s-9],o[s]);break;case 40:this.$=r.addSubGraph(a[s-3],a[s-1],{text:``,type:`text`},`flow`),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-3],{text:``,type:`text`},o[s-5],o[s]);break;case 41:this.$=r.addSubGraph(a[s-4],a[s-1],{text:``,type:`text`},`flow`),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-3],o[s-3]),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-4],{text:``,type:`text`},o[s-6],o[s]);break;case 42:this.$=r.addSubGraph(void 0,a[s-1],void 0,`flow`),r.addSubgraphMapping&&r.addSubgraphMapping(void 0,void 0,o[s-3],o[s]);break;case 43:r.addGlobal(a[s-1]),this.$=[];break;case 44:this.$=r.addConnector(a[s-4],a[s-2]),r.addConnectorMapping&&r.addConnectorMapping(a[s-4],a[s-2],o[s-6],o[s]);break;case 45:this.$=r.addConnector(a[s-5],a[s-3]),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-1],o[s-1]),r.addConnectorMapping&&r.addConnectorMapping(a[s-5],a[s-3],o[s-7],o[s]);break;case 46:this.$=r.addConnector(a[s-1],{text:``,type:`text`}),r.addConnectorMapping&&r.addConnectorMapping(a[s-1],{text:``,type:`text`},o[s-3],o[s]);break;case 47:this.$=r.addConnector(a[s-2],{text:``,type:`text`}),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-1],o[s-1]),r.addConnectorMapping&&r.addConnectorMapping(a[s-2],{text:``,type:`text`},o[s-4],o[s]);break;case 49:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 50:case 51:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 56:this.$=a[s-1]+a[s];break;case 57:this.$=a[s];break;case 58:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s],o[s]),r.extendVertexMapping&&r.extendVertexMapping(a[s-1][a[s-1].length-1],o[s]),r.addLink(a[s-3].stmt,a[s-1],a[s-2]),r.addEdgeMapping&&r.addEdgeMapping(a[s-3].stmt,a[s-1],a[s-2],this._$),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 59:r.addLink(a[s-2].stmt,a[s],a[s-1]),r.addEdgeMapping&&r.addEdgeMapping(a[s-2].stmt,a[s],a[s-1],this._$),this.$={stmt:a[s],nodes:a[s].concat(a[s-2].nodes)};break;case 60:r.addLink(a[s-3].stmt,a[s-1],a[s-2]),r.addEdgeMapping&&r.addEdgeMapping(a[s-3].stmt,a[s-1],a[s-2],this._$),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 61:this.$={stmt:a[s-1],nodes:a[s-1]};break;case 62:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s],o[s]),r.extendVertexMapping&&r.extendVertexMapping(a[s-1][a[s-1].length-1],o[s]),this.$={stmt:a[s-1],nodes:a[s-1],shapeData:a[s]};break;case 63:this.$={stmt:a[s],nodes:a[s]};break;case 64:this.$=[a[s]];break;case 65:r.addVertex(a[s-5][a[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s-4],o[s-4]),r.extendVertexMapping&&r.extendVertexMapping(a[s-5][a[s-5].length-1],o[s-4]),this.$=a[s-5].concat(a[s]);break;case 66:this.$=a[s-4].concat(a[s]);break;case 67:this.$=a[s];break;case 68:this.$=a[s-2],r.setClass(a[s-2],a[s]);break;case 69:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`square`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`square`,this._$);break;case 70:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`doublecircle`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`doublecircle`,this._$);break;case 71:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`circle`),r.addVertexMapping&&r.addVertexMapping(a[s-5],a[s-2],`circle`,this._$);break;case 72:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`ellipse`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`ellipse`,this._$);break;case 73:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`stadium`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`stadium`,this._$);break;case 74:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`subroutine`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`subroutine`,this._$);break;case 75:this.$=a[s-7],r.addVertex(a[s-7],a[s-1],`rect`,void 0,void 0,void 0,Object.fromEntries([[a[s-5],a[s-3]]])),r.addVertexMapping&&r.addVertexMapping(a[s-7],a[s-1],`rect`,this._$);break;case 76:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`cylinder`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`cylinder`,this._$);break;case 77:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`round`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`round`,this._$);break;case 78:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`diamond`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`diamond`,this._$);break;case 79:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`hexagon`),r.addVertexMapping&&r.addVertexMapping(a[s-5],a[s-2],`hexagon`,this._$);break;case 80:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`odd`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`odd`,this._$);break;case 81:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`trapezoid`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`trapezoid`,this._$);break;case 82:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`inv_trapezoid`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`inv_trapezoid`,this._$);break;case 83:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_right`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`lean_right`,this._$);break;case 84:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_left`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`lean_left`,this._$);break;case 85:this.$=a[s],r.addVertex(a[s]),r.addVertexMapping&&r.addVertexMapping(a[s],void 0,void 0,this._$);break;case 86:a[s-1].text=a[s],this.$=a[s-1];break;case 87:case 88:a[s-2].text=a[s-1],this.$=a[s-2];break;case 89:this.$=a[s];break;case 90:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic,text:a[s-1]};break;case 91:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic,text:a[s-1],id:a[s-3]};break;case 92:this.$={text:a[s],type:`text`};break;case 93:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 94:this.$={text:a[s],type:`string`};break;case 95:this.$={text:a[s],type:`markdown`};break;case 96:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic};break;case 97:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic,id:a[s-1]};break;case 98:this.$=a[s-1];break;case 99:this.$={text:a[s],type:`text`};break;case 100:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 101:this.$={text:a[s],type:`string`};break;case 102:case 119:this.$={text:a[s],type:`markdown`};break;case 116:this.$={text:a[s],type:`text`};break;case 117:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 118:this.$={text:a[s],type:`text`};break;case 120:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 121:this.$=a[s-4],r.setClass(a[s-2],a[s]);break;case 122:case 130:this.$=a[s-1],r.setClickEvent(a[s-1],a[s]);break;case 123:case 131:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 124:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 125:this.$=a[s-4],r.setClickEvent(a[s-4],a[s-3],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 126:this.$=a[s-2],r.setLink(a[s-2],a[s]);break;case 127:this.$=a[s-4],r.setLink(a[s-4],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 128:this.$=a[s-4],r.setLink(a[s-4],a[s-2],a[s]);break;case 129:this.$=a[s-6],r.setLink(a[s-6],a[s-4],a[s]),r.setTooltip(a[s-6],a[s-2]);break;case 132:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 133:this.$=a[s-3],r.setLink(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 134:this.$=a[s-3],r.setLink(a[s-3],a[s-2],a[s]);break;case 135:this.$=a[s-5],r.setLink(a[s-5],a[s-4],a[s]),r.setTooltip(a[s-5],a[s-2]);break;case 136:this.$=a[s-4],r.addVertex(a[s-2],void 0,void 0,a[s]);break;case 137:this.$=a[s-4],r.updateLink([a[s-2]],a[s]);break;case 138:this.$=a[s-4],r.updateLink(a[s-2],a[s]);break;case 139:this.$=a[s-8],r.updateLinkInterpolate([a[s-6]],a[s-2]),r.updateLink([a[s-6]],a[s]);break;case 140:this.$=a[s-8],r.updateLinkInterpolate(a[s-6],a[s-2]),r.updateLink(a[s-6],a[s]);break;case 141:this.$=a[s-6],r.updateLinkInterpolate([a[s-4]],a[s]);break;case 142:this.$=a[s-6],r.updateLinkInterpolate(a[s-4],a[s]);break;case 143:case 145:this.$=[a[s]];break;case 144:case 146:a[s-2].push(a[s]),this.$=a[s-2];break;case 148:this.$=a[s-1]+a[s];break;case 196:this.$=a[s];break;case 197:this.$=a[s-1]+``+a[s];break;case 199:this.$=a[s-1]+``+a[s];break;case 200:this.$={stmt:`dir`,value:`TB`};break;case 201:this.$={stmt:`dir`,value:`BT`};break;case 202:this.$={stmt:`dir`,value:`RL`};break;case 203:this.$={stmt:`dir`,value:`LR`};break;case 204:this.$={stmt:`dir`,value:`TD`}}},`anonymous`),table:[{3:1,4:2,8:n,10:r,11:i,13:a},{1:[3]},e(o,s,{5:7}),{4:8,8:n,10:r,11:i,13:a},{4:9,8:n,10:r,11:i,13:a},{4:10,8:n,10:r,11:i,13:a},{14:[1,11],15:[1,12]},{1:[2,1],6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(o,[2,10]),e(o,[2,11]),e(o,[2,12]),e(o,[2,13]),{8:[1,63],9:[1,60],10:[1,61],11:L,16:59,19:62},e(R,[2,3]),e(R,[2,4]),e(R,[2,5]),e(R,[2,6]),e(R,[2,7]),e(R,[2,8]),e(R,[2,9]),{8:z,9:B,10:V,12:H,22:65,44:66,75:71,78:[1,72],80:[1,74],81:[1,73]},{8:z,9:B,10:V,12:H,22:75},{8:z,9:B,10:V,12:H,22:76},{8:z,9:B,10:V,12:H,22:77},{8:z,9:B,10:V,12:H,22:78},{8:z,9:B,10:V,12:H,22:79},{8:z,9:B,10:V,11:[1,80],12:H,22:81},{8:z,9:B,10:V,12:H,22:82},{11:[1,83]},e(R,[2,48]),{39:[1,84]},{41:[1,85]},e(R,[2,51]),e(re,[2,63],{19:86,34:87,11:L,43:ie}),{11:[1,89]},{11:[1,90]},{11:[1,91]},{11:[1,92]},{15:ae,47:oe,63:se,83:[1,96],92:ce,98:[1,93],100:[1,94],104:95,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he,123:97},e(R,[2,200]),e(R,[2,201]),e(R,[2,202]),e(R,[2,203]),e(R,[2,204]),e(ge,[2,64]),e(ge,[2,67],{49:[1,109]}),e(U,[2,85],{116:122,30:[1,110],47:y,51:[1,111],53:[1,112],55:[1,113],57:[1,114],59:[1,115],61:[1,116],63:b,66:[1,117],68:[1,118],70:[1,119],71:[1,120],73:[1,121],92:E,105:D,108:O,109:k,112:A,114:j,117:M,118:N,119:P}),e(W,[2,196]),e(W,[2,157]),e(W,[2,158]),e(W,[2,159]),e(W,[2,160]),e(W,[2,161]),e(W,[2,162]),e(W,[2,163]),e(W,[2,164]),e(W,[2,165]),e(W,[2,166]),e(W,[2,167]),e(o,[2,14]),e(o,[2,20]),e(o,[2,21]),{10:[1,123]},e(o,[2,23]),e(_e,[2,31],{19:124,11:L}),e(R,[2,32]),{45:125,46:44,47:y,48:45,50:46,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(R,[2,52]),e(R,[2,53]),e(R,[2,54]),e(R,[2,55]),e(ve,[2,89],{76:126,65:[1,128],77:[1,127]}),{79:129,82:130,83:ye,84:be,119:xe,122:Se},{78:[1,135],80:[1,136]},e(Ce,[2,96]),e(R,[2,33]),e(R,[2,34]),e(R,[2,35]),e(R,[2,36]),e(R,[2,37]),{11:we,13:Te,15:Ee,28:De,29:137,33:Oe,35:ke,36:Ae,47:je,63:Me,78:Ne,83:Pe,84:Fe,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:138,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},e(Ye,s,{5:165}),e(Ye,s,{5:166}),{11:we,13:Te,15:Ee,28:De,29:167,33:Oe,35:ke,36:Ae,47:je,63:Me,78:Ne,83:Pe,84:Fe,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:138,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},e(R,[2,49]),e(R,[2,50]),e(re,[2,61],{47:Xe}),e(re,[2,62],{19:169,11:L,43:Ze}),e(ge,[2,57]),{47:y,50:171,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{105:[1,172],106:173,108:[1,174]},{47:y,50:175,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{47:y,50:176,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(G,[2,122],{11:[1,177],99:[1,178]}),{83:[1,179]},e(G,[2,130],{123:181,11:[1,180],15:ae,47:oe,63:se,92:ce,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he}),e(G,[2,132],{11:[1,182]}),e(K,[2,198]),e(K,[2,185]),e(K,[2,186]),e(K,[2,187]),e(K,[2,188]),e(K,[2,189]),e(K,[2,190]),e(K,[2,191]),e(K,[2,192]),e(K,[2,193]),e(K,[2,194]),e(K,[2,195]),{47:y,50:183,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{31:184,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:192,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:194,53:[1,193],70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:195,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:196,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:197,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{112:[1,198]},{31:199,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:200,68:[1,201],70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:202,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:203,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:204,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(W,[2,197]),e(o,[2,22]),e(_e,[2,30]),e(re,[2,59],{34:205,19:206,11:L,43:ie}),e(ve,[2,86],{11:[1,207]}),{11:[1,208]},{31:209,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{80:[1,210],82:211,119:xe,122:Se},e(Qe,[2,92]),e(Qe,[2,94]),e(Qe,[2,95]),e(Qe,[2,183]),e(Qe,[2,184]),{79:212,82:130,83:ye,84:be,119:xe,122:Se},e(Ce,[2,97]),{8:z,9:B,10:V,11:we,12:H,13:Te,15:Ee,22:214,28:De,30:[1,213],33:Oe,34:215,35:ke,36:Ae,43:ie,47:je,63:Me,78:Ne,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:216,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},e($,[2,116]),e($,[2,118]),e($,[2,119]),e($,[2,172]),e($,[2,173]),e($,[2,174]),e($,[2,175]),e($,[2,176]),e($,[2,177]),e($,[2,178]),e($,[2,179]),e($,[2,180]),e($,[2,181]),e($,[2,182]),e($,[2,103]),e($,[2,104]),e($,[2,105]),e($,[2,106]),e($,[2,107]),e($,[2,108]),e($,[2,109]),e($,[2,110]),e($,[2,111]),e($,[2,112]),e($,[2,113]),e($,[2,114]),e($,[2,115]),{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,217],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,218],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},{8:z,9:B,10:V,11:we,12:H,13:Te,15:Ee,22:220,28:De,30:[1,219],33:Oe,34:221,35:ke,36:Ae,43:ie,47:je,63:Me,78:Ne,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:216,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},{11:L,19:222},{47:[1,223]},e(ge,[2,56]),{11:[1,224],47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:122,117:M,118:N,119:P},{11:[1,225]},{11:[1,226],109:[1,227]},e($e,[2,143]),{11:[1,228],47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:122,117:M,118:N,119:P},{11:[1,229],47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:122,117:M,118:N,119:P},{83:[1,230]},e(G,[2,124],{11:[1,231]}),e(G,[2,126],{11:[1,232]}),{83:[1,233]},e(K,[2,199]),{83:[1,234],101:[1,235]},e(ge,[2,68],{116:122,47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,117:M,118:N,119:P}),{32:[1,236],70:q,85:237,119:X,120:Z,121:Q},e(et,[2,99]),e(et,[2,101]),e(et,[2,102]),e(et,[2,168]),e(et,[2,169]),e(et,[2,170]),e(et,[2,171]),{52:[1,238],70:q,85:237,119:X,120:Z,121:Q},{31:239,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{54:[1,240],70:q,85:237,119:X,120:Z,121:Q},{56:[1,241],70:q,85:237,119:X,120:Z,121:Q},{58:[1,242],70:q,85:237,119:X,120:Z,121:Q},{60:[1,243],70:q,85:237,119:X,120:Z,121:Q},{63:[1,244]},{67:[1,245],70:q,85:237,119:X,120:Z,121:Q},{69:[1,246],70:q,85:237,119:X,120:Z,121:Q},{31:247,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{32:[1,248],70:q,85:237,119:X,120:Z,121:Q},{70:q,72:[1,249],74:[1,250],85:237,119:X,120:Z,121:Q},{70:q,72:[1,252],74:[1,251],85:237,119:X,120:Z,121:Q},e(re,[2,58],{19:169,11:L,43:Ze}),e(re,[2,60],{47:Xe}),e(ve,[2,88]),e(ve,[2,87]),{65:[1,253],70:q,85:237,119:X,120:Z,121:Q},e(ve,[2,90]),e(Qe,[2,93]),{80:[1,254],82:211,119:xe,122:Se},{31:255,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(Ye,s,{5:256}),{8:z,9:B,10:V,12:H,22:257,43:Ze},e($,[2,117]),e(R,[2,42]),e(R,[2,43]),{31:258,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(R,[2,46]),{8:z,9:B,10:V,12:H,22:259,43:Ze},{46:260,47:y,48:45,50:46,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{11:L,19:261},{11:tt,63:nt,87:rt,95:262,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{11:tt,63:nt,87:rt,95:273,107:[1,274],108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{11:tt,63:nt,87:rt,95:275,107:[1,276],108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{108:[1,277]},{11:tt,63:nt,87:rt,95:278,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{47:y,50:279,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(G,[2,123]),{83:[1,280]},{83:[1,281],101:[1,282]},e(G,[2,131]),e(G,[2,133],{11:[1,283]}),e(G,[2,134]),e(U,[2,69]),e(et,[2,100]),e(U,[2,70]),{54:[1,284],70:q,85:237,119:X,120:Z,121:Q},e(U,[2,77]),e(U,[2,72]),e(U,[2,73]),e(U,[2,74]),{112:[1,285]},e(U,[2,76]),e(U,[2,78]),{69:[1,286],70:q,85:237,119:X,120:Z,121:Q},e(U,[2,80]),e(U,[2,81]),e(U,[2,83]),e(U,[2,82]),e(U,[2,84]),e([11,47,63,92,105,108,109,112,114,117,118,119],[2,98]),e(ve,[2,91]),{32:[1,287],70:q,85:237,119:X,120:Z,121:Q},{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,288],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(Ye,s,{5:289}),{32:[1,290],70:q,85:237,119:X,120:Z,121:Q},e(R,[2,47]),e(ge,[2,66]),{46:291,47:y,48:45,50:46,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(G,[2,136],{109:lt}),e(ut,[2,145],{111:293,11:tt,63:nt,87:rt,108:it,112:at,113:ot,114:st,115:ct}),e(dt,[2,147]),e(dt,[2,149]),e(dt,[2,150]),e(dt,[2,151]),e(dt,[2,152]),e(dt,[2,153]),e(dt,[2,154]),e(dt,[2,155]),e(dt,[2,156]),e(G,[2,137],{109:lt}),{11:[1,294]},e(G,[2,138],{109:lt}),{11:[1,295]},e($e,[2,144]),e(G,[2,120],{109:lt}),e(G,[2,121],{116:122,47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,117:M,118:N,119:P}),e(G,[2,125]),e(G,[2,127],{11:[1,296]}),e(G,[2,128]),{101:[1,297]},{54:[1,298]},{65:[1,299]},{69:[1,300]},{8:z,9:B,10:V,12:H,22:301,34:302,43:ie},e(R,[2,40]),{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,303],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},{8:z,9:B,10:V,12:H,22:304,34:305,43:ie},e(ge,[2,65]),{11:tt,63:nt,87:rt,108:it,110:306,111:264,112:at,113:ot,114:st,115:ct},e(dt,[2,148]),{15:ae,47:oe,63:se,92:ce,104:307,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he,123:97},{15:ae,47:oe,63:se,92:ce,104:308,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he,123:97},{101:[1,309]},e(G,[2,135]),e(U,[2,71]),{31:310,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(U,[2,79]),e(Ye,s,{5:311}),{8:z,9:B,10:V,12:H,22:312,43:Ze},e(R,[2,41]),e(R,[2,44]),{8:z,9:B,10:V,12:H,22:313,43:Ze},e(ut,[2,146],{111:293,11:tt,63:nt,87:rt,108:it,112:at,113:ot,114:st,115:ct}),e(G,[2,141],{123:181,11:[1,314],15:ae,47:oe,63:se,92:ce,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he}),e(G,[2,142],{123:181,11:[1,315],15:ae,47:oe,63:se,92:ce,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he}),e(G,[2,129]),{32:[1,316],70:q,85:237,119:X,120:Z,121:Q},{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,317],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(Ye,s,{5:318}),e(R,[2,45]),{11:tt,63:nt,87:rt,95:319,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{11:tt,63:nt,87:rt,95:320,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},e(U,[2,75]),e(R,[2,38]),{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,321],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(G,[2,139],{109:lt}),e(G,[2,140],{109:lt}),e(R,[2,39])],defaultActions:{},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
23
|
+
`+h.showPosition()+`
|
|
24
|
+
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};ft.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
25
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
26
|
+
`+t+`^`},`showPosition`),test_match:t(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:t(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
|
|
27
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:t(function(){return this.next()||this.lex()},`lex`),begin:t(function(e){this.conditionStack.push(e)},`begin`),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{},performAction:t(function(e,t,n,r){switch(n){case 0:return this.begin(`acc_title`),38;case 1:return this.popState(),`acc_title_value`;case 2:return this.begin(`acc_descr`),40;case 3:return this.popState(),`acc_descr_value`;case 4:this.begin(`acc_descr_multiline`);break;case 5:this.popState();break;case 6:return`acc_descr_multiline_value`;case 7:return this.pushState(`shapeData`),t.yytext=``,43;case 8:return this.pushState(`shapeDataStr`),43;case 9:return this.popState(),43;case 10:return t.yytext=t.yytext.replace(/\n\s*/g,`<br/>`),43;case 11:return 43;case 12:this.popState();break;case 13:this.begin(`callbackname`);break;case 14:this.popState();break;case 15:this.popState(),this.begin(`callbackargs`);break;case 16:return 98;case 17:this.popState();break;case 18:return 99;case 19:return`MD_STR`;case 20:this.popState();break;case 21:this.begin(`md_string`);break;case 22:return`STR`;case 23:this.popState();break;case 24:this.pushState(`string`);break;case 25:return 87;case 26:return 105;case 27:return 88;case 28:return 107;case 29:return 89;case 30:return 90;case 31:return 100;case 32:this.begin(`click`);break;case 33:this.popState();break;case 34:return 91;case 35:return e.lex.firstGraph()&&this.begin(`dir`),13;case 36:return 28;case 37:return 36;case 38:return 35;case 39:return 33;case 40:return 101;case 41:return 101;case 42:return 101;case 43:return 101;case 44:return this.popState(),14;case 45:return this.popState(),15;case 46:return this.popState(),15;case 47:return this.popState(),15;case 48:return this.popState(),15;case 49:return this.popState(),15;case 50:return this.popState(),15;case 51:return this.popState(),15;case 52:return this.popState(),15;case 53:return this.popState(),15;case 54:return this.popState(),15;case 55:return 124;case 56:return 125;case 57:return 126;case 58:return 127;case 59:return 128;case 60:return 81;case 61:return 108;case 62:return 114;case 63:return 49;case 64:return 63;case 65:return 47;case 66:return 9;case 67:return 109;case 68:return 118;case 69:return this.popState(),80;case 70:return this.pushState(`edgeText`),78;case 71:return 122;case 72:return 80;case 73:break;case 74:return this.popState(),56;case 75:return`TEXT`;case 76:return this.pushState(`ellipseText`),55;case 77:return this.popState(),58;case 78:return this.pushState(`text`),57;case 79:return this.popState(),60;case 80:return this.pushState(`text`),59;case 81:return 61;case 82:return this.pushState(`text`),70;case 83:return this.popState(),67;case 84:return this.pushState(`text`),66;case 85:return this.popState(),52;case 86:return this.pushState(`text`),51;case 87:break;case 88:return this.popState(),72;case 89:return this.popState(),74;case 90:return 120;case 91:return this.pushState(`trapText`),71;case 92:return this.pushState(`trapText`),73;case 93:return 121;case 94:return 70;case 95:return 93;case 96:return`SEP`;case 97:return 92;case 98:return 118;case 99:return 114;case 100:return 47;case 101:return 8;case 102:return 112;case 103:return 117;case 104:return 119;case 105:return this.popState(),65;case 106:return this.pushState(`text`),65;case 107:return this.popState(),54;case 108:return this.pushState(`text`),53;case 109:return this.popState(),32;case 110:return this.pushState(`text`),30;case 111:return this.popState(),69;case 112:return this.pushState(`text`),68;case 113:break;case 114:return`TEXT`;case 115:return`QUOTE`;case 116:return 10;case 117:return 11;case 118:return 12}},`anonymous`),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:agentflow-beta\b)/,/^(?:flow\b)/,/^(?:connector\b)/,/^(?:global\b[ \t]*)/,/^(?:end\b[ \t]*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*--+[x>]\s*)/,/^(?:\s*--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*-\.+-\s*)/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|(?:[^\\\[\]\(\)\{\}\/%]+|(?!))+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:[ \t]*%%(?!\{)[^\n]*)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:%%(?!\{)[^\n]*)/,/^(?:(?:[^\[\]\(\)\{\}\|\"%]+|(?!))+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},shapeData:{rules:[8,11,12,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},callbackargs:{rules:[17,18,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},callbackname:{rules:[14,15,16,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},href:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},click:{rules:[21,24,33,34,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},edgeText:{rules:[21,24,69,71,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},trapText:{rules:[21,24,76,78,80,84,86,87,88,89,90,91,92,106,108,110,112],inclusive:!1},ellipseText:{rules:[21,24,73,74,75,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},text:{rules:[21,24,76,77,78,79,80,83,84,85,86,91,92,105,106,107,108,109,110,111,112,113,114],inclusive:!1},vertex:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_descr:{rules:[3,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_title:{rules:[1,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},md_string:{rules:[19,20,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},string:{rules:[21,22,23,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,76,78,80,81,82,84,86,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,108,110,112,115,116,117,118],inclusive:!0}}}})();function pt(){this.yy={}}return t(pt,`Parser`),pt.prototype=ft,ft.Parser=pt,new pt})();fe.parser=fe;var pe=fe,me=Object.assign({},pe);me.parse=e=>{let t=e.replace(/}[^\S\n]*\n/g,`}
|
|
28
|
+
`);return pe.parse(t)};var he=me,ge=t(e=>{let{theme:n,bkgColorArray:r,borderColorArray:i}=e;if(!b(n,i))return``;let a=S(e.look),o=C(r),s=x(e.THEME_COLOR_LIMIT,i),c=t(e=>i[e%i.length],`border`),l=t(e=>o?`fill: ${r[e%r.length]};`:``,`fill`),u=``;for(let e of B){let t=L.get(e),n=`[data-look="${a}"].node.${z(e)}`;u+=`
|
|
29
|
+
|
|
30
|
+
${n} rect,
|
|
31
|
+
${n} path,
|
|
32
|
+
${n} polygon {
|
|
33
|
+
stroke: ${c(t)};
|
|
34
|
+
${l(t)}
|
|
35
|
+
}
|
|
36
|
+
`}for(let e=0;e<V(s);e++){let n=H(e,s),r=`[data-look="${a}"][data-color-id="color-${n}"].cluster`,i=`[data-look="${a}"][data-color-id="color-${n}"].node`,o=t(e=>`${r} ${e}, ${i} ${e}`,`rule`);u+=`
|
|
37
|
+
|
|
38
|
+
${o(`rect`)},
|
|
39
|
+
${o(`path`)} {
|
|
40
|
+
stroke: ${c(n)};
|
|
41
|
+
${l(n)}
|
|
42
|
+
}
|
|
43
|
+
`}return u},`genColor`),U=t((e,t)=>{let n=g,r=n(e,`r`),i=n(e,`g`),a=n(e,`b`);return l(r,i,a,t)},`fade`),W={parser:he,get db(){return new ue},renderer:de,styles:t(e=>`${ge(e)}
|
|
44
|
+
.label {
|
|
45
|
+
font-family: ${e.fontFamily};
|
|
46
|
+
color: ${e.nodeTextColor||e.textColor};
|
|
47
|
+
}
|
|
48
|
+
.cluster-label text {
|
|
49
|
+
fill: ${e.titleColor};
|
|
50
|
+
}
|
|
51
|
+
.cluster-label span {
|
|
52
|
+
color: ${e.titleColor};
|
|
53
|
+
}
|
|
54
|
+
.cluster-label span p {
|
|
55
|
+
background-color: transparent;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.label text,span {
|
|
59
|
+
fill: ${e.nodeTextColor||e.textColor};
|
|
60
|
+
color: ${e.nodeTextColor||e.textColor};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.node rect,
|
|
64
|
+
.node circle,
|
|
65
|
+
.node ellipse,
|
|
66
|
+
.node polygon,
|
|
67
|
+
.node path {
|
|
68
|
+
fill: ${e.mainBkg};
|
|
69
|
+
stroke: ${e.nodeBorder};
|
|
70
|
+
stroke-width: ${e.strokeWidth??1}px;
|
|
71
|
+
}
|
|
72
|
+
.rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {
|
|
73
|
+
text-anchor: middle;
|
|
74
|
+
}
|
|
75
|
+
.node .katex path {
|
|
76
|
+
fill: ${e.nodeTextColor||e.textColor};
|
|
77
|
+
stroke: ${e.nodeTextColor||e.textColor};
|
|
78
|
+
stroke-width: 1px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.rough-node .label,.node .label, .image-shape .label, .icon-shape .label {
|
|
82
|
+
text-align: center;
|
|
83
|
+
}
|
|
84
|
+
.node.clickable {
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
.root .anchor path {
|
|
90
|
+
fill: ${e.lineColor} !important;
|
|
91
|
+
stroke-width: 0;
|
|
92
|
+
stroke: ${e.lineColor};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.arrowheadPath {
|
|
96
|
+
fill: ${e.arrowheadColor};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.edgePaths .path {
|
|
100
|
+
stroke: ${e.lineColor};
|
|
101
|
+
stroke-width: ${e.strokeWidth??2}px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.flowchart-link {
|
|
105
|
+
stroke: ${e.lineColor};
|
|
106
|
+
fill: none;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.edgeLabel {
|
|
110
|
+
background-color: ${e.edgeLabelBackground};
|
|
111
|
+
p {
|
|
112
|
+
background-color: ${e.edgeLabelBackground};
|
|
113
|
+
}
|
|
114
|
+
rect {
|
|
115
|
+
opacity: 0.5;
|
|
116
|
+
background-color: ${e.edgeLabelBackground};
|
|
117
|
+
fill: ${e.edgeLabelBackground};
|
|
118
|
+
}
|
|
119
|
+
text-align: center;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* For html labels only */
|
|
123
|
+
.labelBkg {
|
|
124
|
+
background-color: ${U(e.edgeLabelBackground,.5)};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.cluster rect {
|
|
128
|
+
fill: ${e.clusterBkg};
|
|
129
|
+
stroke: ${e.clusterBorder};
|
|
130
|
+
stroke-width: 1px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.flow-cluster rect {
|
|
134
|
+
fill: none;
|
|
135
|
+
stroke: ${e.clusterBorder};
|
|
136
|
+
stroke-width: 0.75px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.node .collapsed-indicator {
|
|
140
|
+
fill: ${e.nodeBorder};
|
|
141
|
+
stroke: none;
|
|
142
|
+
stroke-width: 0;
|
|
143
|
+
opacity: 0.5;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.node .collapsed-separator {
|
|
147
|
+
stroke-width: 0.75px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.cluster text {
|
|
151
|
+
fill: ${e.titleColor};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.cluster span {
|
|
155
|
+
color: ${e.titleColor};
|
|
156
|
+
}
|
|
157
|
+
/* .cluster div {
|
|
158
|
+
color: ${e.titleColor};
|
|
159
|
+
} */
|
|
160
|
+
|
|
161
|
+
div.mermaidTooltip {
|
|
162
|
+
position: absolute;
|
|
163
|
+
text-align: center;
|
|
164
|
+
max-width: 200px;
|
|
165
|
+
padding: 2px;
|
|
166
|
+
font-family: ${e.fontFamily};
|
|
167
|
+
font-size: 12px;
|
|
168
|
+
background: ${e.tertiaryColor};
|
|
169
|
+
border: 1px solid ${e.border2};
|
|
170
|
+
border-radius: 2px;
|
|
171
|
+
pointer-events: none;
|
|
172
|
+
z-index: 100;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.agentflowTitleText {
|
|
176
|
+
text-anchor: middle;
|
|
177
|
+
font-size: 18px;
|
|
178
|
+
fill: ${e.textColor};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
rect.text {
|
|
182
|
+
fill: none;
|
|
183
|
+
stroke-width: 0;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.icon-shape, .image-shape {
|
|
187
|
+
background-color: ${e.edgeLabelBackground};
|
|
188
|
+
p {
|
|
189
|
+
background-color: ${e.edgeLabelBackground};
|
|
190
|
+
padding: 2px;
|
|
191
|
+
}
|
|
192
|
+
.label rect {
|
|
193
|
+
opacity: 0.5;
|
|
194
|
+
background-color: ${e.edgeLabelBackground};
|
|
195
|
+
fill: ${e.edgeLabelBackground};
|
|
196
|
+
}
|
|
197
|
+
text-align: center;
|
|
198
|
+
}
|
|
199
|
+
${y()}
|
|
200
|
+
`,`getStyles`),init:t(e=>{e.agentflow??={},e.layout&&i({layout:e.layout}),e.flowchart??={},e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,i({flowchart:{arrowMarkerAbsolute:e.arrowMarkerAbsolute}})},`init`)};export{W as diagram};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{n as e}from"./mermaid-parser.core-Du2mcMMx.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n,p as r}from"./src-oBChb5qS.js";import{D as i,H as a,U as o,a as s,b as c,c as l,f as u,q as d,v as f,w as p,y as m}from"./chunk-O7XYJQB3-CjZQSnt8.js";import{t as h}from"./ordinal-BDEzSJ7C.js";import{t as g}from"./defaultLocale-BFoDCU3G.js";import{i as _}from"./chunk-ZIGJFQKS-C6SOqBs6.js";import{t as v}from"./chunk-JWPE2WC7-DVXcaiue.js";import{i as y,n as b}from"./chunk-7PRAP22T-CPe5zfLc.js";import{t as x}from"./chunk-WEXAMYUT-CT8bG5L7.js";import{a as S}from"./mermaid.core-B4zgSyXF.js";function C(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function w(){return this.eachAfter(C)}function T(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function E(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function D(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function O(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function k(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function A(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function j(e){for(var t=this,n=M(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function M(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function N(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function P(){return Array.from(this)}function F(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function I(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*L(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function R(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=V)):t===void 0&&(t=B);for(var n=new W(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new W(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(U)}function z(){return R(this).eachBefore(H)}function B(e){return e.children}function V(e){return Array.isArray(e)?e[1]:null}function H(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function U(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function W(e){this.data=e,this.depth=this.height=0,this.parent=null}W.prototype=R.prototype={constructor:W,count:w,each:T,eachAfter:D,eachBefore:E,find:O,sum:k,sort:A,path:j,ancestors:N,descendants:P,leaves:F,links:I,copy:z,[Symbol.iterator]:L};function G(e){if(typeof e!=`function`)throw Error();return e}function K(){return 0}function q(e){return function(){return e}}function ee(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function te(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}function ne(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s<c;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var re=(1+Math.sqrt(5))/2;function ie(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;u<f;){p=i-n,m=a-r;do g=s[d++].value;while(!g&&d<f);for(_=v=g,x=Math.max(m/p,p/m)/(h*e),S=g*g*x,b=Math.max(v/S,S/_);d<f;++d){if(g+=l=s[d].value,l<_&&(_=l),l>v&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p<m,children:s.slice(u,d)}),c.dice?te(c,n,r,i,h?r+=m*g/h:a):ne(c,n,r,h?n+=p*g/h:i,a),h-=g,u=d}return o}var ae=(function e(t){function n(e,n,r,i,a){ie(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(re);function oe(){var e=ae,t=!1,n=1,r=1,i=[0],a=K,o=K,s=K,c=K,l=K;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(ee),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),t.x0=r,t.y0=u,t.x1=d,t.y1=f,t.children&&(n=i[t.depth+1]=a(t)/2,r+=l(t)-n,u+=o(t)-n,d-=s(t)-n,f-=c(t)-n,d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),e(t,r,u,d,f))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(n=+e[0],r=+e[1],u):[n,r]},u.tile=function(t){return arguments.length?(e=G(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(a=typeof e==`function`?e:q(+e),u):a},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o=typeof e==`function`?e:q(+e),u):o},u.paddingRight=function(e){return arguments.length?(s=typeof e==`function`?e:q(+e),u):s},u.paddingBottom=function(e){return arguments.length?(c=typeof e==`function`?e:q(+e),u):c},u.paddingLeft=function(e){return arguments.length?(l=typeof e==`function`?e:q(+e),u):l},u}var J=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=o,this.getAccTitle=m,this.setDiagramTitle=d,this.getDiagramTitle=p,this.getAccDescription=f,this.setAccDescription=a}static{t(this,`TreeMapDB`)}getNodes(){return this.nodes}getConfig(){let e=u,t=c();return _({...e.treemap,...t.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),t===0&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:``,children:this.outerNodes}}addClass(e,t){let n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},r=t.replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);r&&r.forEach(e=>{b(e)&&(n?.textStyles?n.textStyles.push(e):n.textStyles=[e]),n?.styles?n.styles.push(e):n.styles=[e]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){s(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function Y(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}t(Y,`buildHierarchy`);var se=t((e,n)=>{v(e,n);let r=[];for(let t of e.TreemapRows??[])t.$type===`ClassDefStatement`&&n.addClass(t.className??``,t.styleText??``);for(let t of e.TreemapRows??[]){let e=t.item;if(!e)continue;let i=t.indent?parseInt(t.indent):0,a=ce(e),o=e.classSelector?n.getStylesForClass(e.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:e.$type,value:e.value,classSelector:e.classSelector,cssCompiledStyles:s};r.push(c)}let i=Y(r),a=t((e,t)=>{for(let r of e)n.addNode(r,t),r.children&&r.children.length>0&&a(r.children,t+1)},`addNodesRecursively`);a(i,0)},`populate`),ce=t(e=>e.name?String(e.name):``,`getItemName`),X={parser:{yy:void 0},parse:t(async t=>{try{let r=await e(`treemap`,t);n.debug(`Treemap AST:`,r);let i=X.parser?.yy;if(!(i instanceof J))throw Error(`parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);se(r,i)}catch(e){throw n.error(`Error parsing treemap:`,e),e}},`parse`)},Z=10,Q=10,$=25,le={draw:t((e,i,a,o)=>{let s=o.db,u=s.getConfig(),d=u.padding??Z,f=s.getDiagramTitle(),p=s.getRoot(),{themeVariables:m}=c();if(!p)return;let _=f?30:0,v=S(i),b=u.nodeWidth?u.nodeWidth*Q:960,C=u.nodeHeight?u.nodeHeight*Q:500,w=b,T=C+_;v.attr(`viewBox`,`0 0 ${w} ${T}`),l(v,T,w,u.useMaxWidth);let E;try{let e=u.valueFormat||`,`;if(e===`$0,0`)E=t(e=>`$`+g(`,`)(e),`valueFormat`);else if(e.startsWith(`$`)&&e.includes(`,`)){let n=/\.\d+/.exec(e),r=n?n[0]:``;E=t(e=>`$`+g(`,`+r)(e),`valueFormat`)}else if(e.startsWith(`$`)){let n=e.substring(1);E=t(e=>`$`+g(n||``)(e),`valueFormat`)}else E=g(e)}catch(e){n.error(`Error creating format function:`,e),E=g(`,`)}let D=h().range([`transparent`,m.cScale0,m.cScale1,m.cScale2,m.cScale3,m.cScale4,m.cScale5,m.cScale6,m.cScale7,m.cScale8,m.cScale9,m.cScale10,m.cScale11]),O=h().range([`transparent`,m.cScalePeer0,m.cScalePeer1,m.cScalePeer2,m.cScalePeer3,m.cScalePeer4,m.cScalePeer5,m.cScalePeer6,m.cScalePeer7,m.cScalePeer8,m.cScalePeer9,m.cScalePeer10,m.cScalePeer11]),k=h().range([m.cScaleLabel0,m.cScaleLabel1,m.cScaleLabel2,m.cScaleLabel3,m.cScaleLabel4,m.cScaleLabel5,m.cScaleLabel6,m.cScaleLabel7,m.cScaleLabel8,m.cScaleLabel9,m.cScaleLabel10,m.cScaleLabel11]);f&&v.append(`text`).attr(`x`,w/2).attr(`y`,_/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(f);let A=v.append(`g`).attr(`transform`,`translate(0, ${_})`).attr(`class`,`treemapContainer`),j=R(p).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),M=oe().size([b,C]).paddingTop(e=>e.children&&e.children.length>0?$+Q:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?Q:0).paddingRight(e=>e.children&&e.children.length>0?Q:0).paddingBottom(e=>e.children&&e.children.length>0?Q:0).round(!0)(j),N=M.descendants().filter(e=>e.children&&e.children.length>0),P=A.selectAll(`.treemapSection`).data(N).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,$).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),P.append(`clipPath`).attr(`id`,(e,t)=>`clip-section-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,$),P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>D(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>O(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let t=y({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+`;`+t.borderStyles.join(`;`)}),P.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,$/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`clip-path`,(e,t)=>`url(#clip-section-${i}-${t})`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+y({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=r(this),n=e.data.name;t.text(n);let i=e.x1-e.x0,a;a=u.showValues!==!1&&e.value?i-10-30-10-6:i-6-6;let o=Math.max(15,a),s=t.node();if(s.getComputedTextLength()>o){let e=n;for(;e.length>0;){if(e=n.substring(0,e.length-1),e.length===0){t.text(`...`),s.getComputedTextLength()>o&&t.text(``);break}if(t.text(e+`...`),s.getComputedTextLength()<=o)break}}}),u.showValues!==!1&&P.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,$/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?E(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+y({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let F=M.leaves(),I=F.length>20,L=I?16:38,z=I?14:28,B=I?4:8,V=I?4:6,H=I?2:4,U=I?8:10,W=I?1:2,G=A.selectAll(`.treemapLeafGroup`).data(F).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);G.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`style`,e=>y({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`stroke-width`,3),G.append(`clipPath`).attr(`id`,(e,t)=>`clip-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),G.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: ${L}px;fill:`+k(e.data.name)+`;`+y({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.data.name).each(function(e){let t=r(this),n=e.x1-e.x0,i=e.y1-e.y0,a=t.node(),o=n-2*H,s=i-2*H;if(o<U||s<U){t.style(`display`,`none`);return}let c=parseInt(t.style(`font-size`),10),l=.6;for(;a.getComputedTextLength()>o&&c>B;)c--,t.style(`font-size`,`${c}px`);let u=Math.max(V,Math.min(z,Math.round(c*l))),d=c+W+u;for(;d>s&&c>B&&(c--,u=Math.max(V,Math.min(z,Math.round(c*l))),!(u<V&&c===B));)t.style(`font-size`,`${c}px`),d=c+W+u;t.style(`font-size`,`${c}px`),I?(c<B||s<B)&&t.style(`display`,`none`):(a.getComputedTextLength()>o||c<B||s<c)&&t.style(`display`,`none`)}),u.showValues!==!1&&G.append(`text`).attr(`class`,`treemapValue`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: ${z}px;fill:`+k(e.data.name)+`;`+y({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.value?E(e.value):``).each(function(e){let t=r(this),n=this.parentNode;if(!n){t.style(`display`,`none`);return}let i=r(n).select(`.treemapLabel`);if(i.empty()||i.style(`display`)===`none`){t.style(`display`,`none`);return}let a=parseFloat(i.style(`font-size`)),o=Math.max(V,Math.min(z,Math.round(a*.6)));t.style(`font-size`,`${o}px`);let s=(e.y1-e.y0)/2+a/2+W;t.attr(`y`,s);let c=e.x1-e.x0,l=e.y1-e.y0-4,u=c-2*H;t.node().getComputedTextLength()>u||s+o>l||o<V?t.style(`display`,`none`):t.style(`display`,null)});let K=u.diagramPadding??8;x(v,K,`flowchart`,u?.useMaxWidth||!1)},`draw`),getClasses:t(function(e,t){return t.db.getClasses()},`getClasses`)},ue={sectionStrokeColor:`black`,sectionStrokeWidth:`1`,sectionFillColor:`#efefef`,leafStrokeColor:`black`,leafStrokeWidth:`1`,leafFillColor:`#efefef`,labelFontSize:`12px`,valueFontSize:`10px`,titleFontSize:`14px`},de={parser:X,get db(){return new J},renderer:le,styles:t(({treemap:e}={})=>{let t=i(),n=c(),r=_(t,n.themeVariables),a=_(ue,e),o=a.titleColor??r.titleColor,s=a.labelColor??r.textColor,l=a.valueColor??r.textColor;return`
|
|
2
|
+
.treemapNode.section {
|
|
3
|
+
stroke: ${a.sectionStrokeColor};
|
|
4
|
+
stroke-width: ${a.sectionStrokeWidth};
|
|
5
|
+
fill: ${a.sectionFillColor};
|
|
6
|
+
}
|
|
7
|
+
.treemapNode.leaf {
|
|
8
|
+
stroke: ${a.leafStrokeColor};
|
|
9
|
+
stroke-width: ${a.leafStrokeWidth};
|
|
10
|
+
fill: ${a.leafFillColor};
|
|
11
|
+
}
|
|
12
|
+
.treemapLabel {
|
|
13
|
+
fill: ${s};
|
|
14
|
+
font-size: ${a.labelFontSize};
|
|
15
|
+
}
|
|
16
|
+
.treemapValue {
|
|
17
|
+
fill: ${l};
|
|
18
|
+
font-size: ${a.valueFontSize};
|
|
19
|
+
}
|
|
20
|
+
.treemapTitle {
|
|
21
|
+
fill: ${o};
|
|
22
|
+
font-size: ${a.titleFontSize};
|
|
23
|
+
}
|
|
24
|
+
`},`getStyles`)};export{de as diagram};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{T as e}from"./chunk-FOHPRMQF-DzxwRta7.js";import{n as t}from"./mermaid-parser.core-Du2mcMMx.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as r,p as i}from"./src-oBChb5qS.js";import{H as a,U as o,X as s,a as c,b as l,f as u,q as d,v as f,w as p,x as m,y as h,z as g}from"./chunk-O7XYJQB3-CjZQSnt8.js";import{_,i as ee,t as te}from"./chunk-ZIGJFQKS-C6SOqBs6.js";import{t as ne}from"./chunk-JWPE2WC7-DVXcaiue.js";var v=`position frame`,y=`frame positioned`,b=`position relation`,x=`relation positioned`,re=n(function(e){r.debug(`options str`,e)},`setOptions`),ie=n(function(){return{}},`getOptions`),ae=n(function(){S(),c()},`clear`);function S(){C={}}n(S,`reset`);var oe=u.eventmodeling,se=n(()=>ee({...oe,...l().eventmodeling}),`getConfig`),C={};function w(){let e=ce,{ast:t}=C,n=D();if(!t)throw Error(`No data for EventModel`);return t.frames.forEach((i,a)=>{let o=P(i,t.dataEntities,n);e=J(e,{$kind:v,index:a,frame:i,textProps:o});let s;V(i)?(r.debug(`source frame`,i.sourceFrames),s=t.frames.filter(e=>i.sourceFrames.some(t=>t.$refText===e.name)),s.forEach(t=>{e=J(e,{$kind:b,index:a,frame:i,sourceFrame:t})})):e=J(e,{$kind:b,index:a,frame:i})}),e={...e,sortedSwimlanesArray:R(e.swimlanes)},e}n(w,`getState`);function T(e){C.ast=e}n(T,`setAst`);var E={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:`bold`,boxTextPadding:10,swimlaneTextFontWeight:`bold`,labelUiAutomation:`UI/Automation`,labelUiAutomationPrefix:`UI/A: `,labelCommandReadModel:`Command/Read Model`,labelCommandReadModelPrefix:`C/RM: `,labelEvents:`Events`,labelEventsPrefix:`Stream: `};function D(){return E}n(D,`getDiagramProps`);var ce={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function O(e){let t=e.split(`.`);if(t.length===2)return t[0]}n(O,`extractNamespace`);function k(e){let t=e.split(`.`);return t.length===2?t[1]:e}n(k,`extractName`);function A(e,t){if(t&&t.length!==0)return Object.values(e).find(e=>e.namespace===t)}n(A,`findSwimlaneByNamespace`);function j(e,t,n){return Math.max(t,...Object.keys(e).filter(e=>{let r=Number.parseInt(e);return r>t&&r<n}).map(e=>Number.parseInt(e)))+1}n(j,`findNextAvailableIndex`);function M(e,t){let n=O(e.entityIdentifier),r=A(t,n);switch(e.modelEntityType){case`ui`:case`pcr`:case`processor`:return r?{index:r.index,label:r.namespace||E.labelUiAutomation}:n?{index:j(t,0,100),label:E.labelUiAutomationPrefix+n}:{index:0,label:E.labelUiAutomation};case`rmo`:case`readmodel`:case`cmd`:case`command`:return r?{index:r.index,label:r.namespace||E.labelCommandReadModel}:n?{index:j(t,100,200),label:E.labelCommandReadModelPrefix+n}:{index:100,label:E.labelCommandReadModel};default:return r?{index:r.index,label:r.namespace||E.labelEvents}:n?{index:j(t,200,300),label:E.labelEventsPrefix+n}:{index:200,label:E.labelEvents}}}n(M,`calculateSwimlaneProps`);function N(e){let{themeVariables:t}=l();switch(e.modelEntityType){case`ui`:return{fill:t.emUiFill??`white`,stroke:t.emUiStroke??`#dbdada`};case`pcr`:case`processor`:return{fill:t.emProcessorFill??`#edb3f6`,stroke:t.emProcessorStroke??`#b88cbf`};case`rmo`:case`readmodel`:return{fill:t.emReadModelFill??`#d3f1a2`,stroke:t.emReadModelStroke??`#a3b732`};case`cmd`:case`command`:return{fill:t.emCommandFill??`#bcd6fe`,stroke:t.emCommandStroke??`#679ac3`};case`evt`:case`event`:return{fill:t.emEventFill??`#ffb778`,stroke:t.emEventStroke??`#c19a0f`};default:return{fill:`red`,stroke:`black`}}}n(N,`calculateEntityVisualProps`);function P(e,t,n){let i=l(),a=g(k(e.entityIdentifier)??``,i),o,s={fontSize:16,fontWeight:700,fontFamily:`"trebuchet ms", verdana, arial, sans-serif`,joinWith:`<br/>`},c=`<b>${_(a,n.textMaxWidth,s)}</b>`;if(e.dataInlineValue&&(o=e.dataInlineValue,o=o.substring(o.indexOf(`{`)+1),o=o.substring(0,o.lastIndexOf(`}`)-1),o=g(o,i),o=_(o,n.textMaxWidth,s),o=o.replaceAll(` `,` `)),e.dataReference){let r=t.find(t=>t.name===e.dataReference?.$refText);r&&(o=r.dataBlockValue,o=o.substring(o.indexOf(`{
|
|
2
|
+
`)+2),o=o.substring(0,o.lastIndexOf(`}`)-1),o=g(o,i),o=_(o,n.textMaxWidth,s),o=o.replaceAll(` `,` `),o+=`<br/>`)}let u=o!==void 0;u&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${n.textMaxWidth}px">${o}</code>`);let d={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},f=te(c,d),p=u?f.width/3:f.width,m={content:c,width:p,height:f.height};return r.debug(`[${e.name}] ${e.entityIdentifier} text`,m),m}n(P,`calculateTextProps`);function F(e,t){let n=t,r=N(n.frame),i={width:n.textProps.width+2*E.boxTextPadding,height:n.textProps.height+2*E.boxTextPadding};return[{$kind:y,frame:n.frame,index:n.index,visual:r,dimension:i,textProps:n.textProps}]}n(F,`decidePositionFrame`);function I(e,t,n){return t===void 0?E.contentStartX:t.index===e.index&&e.r?e.r+E.boxPadding:n===void 0?E.contentStartX:n.r-E.boxOverlap+E.boxPadding}n(I,`calculateX`);function L(e,t){let n=[...e.map(e=>e.r),t];return Math.max(...n)}n(L,`calculateMaxRight`);function R(e){return Object.values(e).sort((e,t)=>e.index-t.index)}n(R,`sortedSwimlanesArray`);function z(e,t){let n=t,r=M(n.frame,e.swimlanes),i;i=r.index in e.swimlanes?e.swimlanes[r.index]:{index:r.index,label:r.label,r:0,y:r.index*E.swimlaneMinHeight+E.swimlaneGap,height:E.swimlaneMinHeight,maxHeight:E.swimlaneMinHeight};let a=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,o=e.previousSwimlaneNumber===void 0?void 0:e.swimlanes[e.previousSwimlaneNumber],s={width:Math.max(E.boxMinWidth,Math.min(E.boxMaxWidth,n.dimension.width))+2*E.boxPadding,height:Math.max(E.boxMinHeight,Math.min(E.boxMaxHeight,n.dimension.height))+2*E.boxPadding},c=I(i,o,a),l=c+s.width+E.boxPadding,u=L(Object.values(e.swimlanes),l);i.r=c+s.width,i.maxHeight=Math.max(i.maxHeight,s.height),i.height=Math.max(E.swimlaneMinHeight,i.maxHeight)+2*E.swimlanePadding;let d={x:c,y:E.swimlanePadding+i.y,r:l,dimension:s,leftSibling:!1,swimlane:i,visual:n.visual,text:n.textProps.content,frame:n.frame,index:n.index},f={...e,boxes:[...e.boxes,d],swimlanes:{...e.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:r.index,previousFrame:n.frame,maxR:u},p=R(f.swimlanes);p.length>0&&(p[0].y=0);for(let e=1;e<p.length;e++){let t=p[e],n=p[e-1];t.y=n.y+n.height+E.swimlaneGap}return f}n(z,`evolveFramePositioned`);function B(e,t){return e===0&&t.sourceFrames.length===0}n(B,`isFirstFrame`);function V(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}n(V,`hasSourceFrame`);function H(e,t){if(t!=null)return e.find(e=>e.frame.name===t.name)}n(H,`findBoxByFrame`);function U(e,t,n){if(!(n<0))for(let r=n;r>=0;r--){let n=e[r];if(n.swimlane.index!==t)return n}}n(U,`findBoxByLineIndex`);function W(t,n){let r=n;if(e(r.frame)||B(r.index,r.frame))return[];let i=H(t.boxes,r.frame);if(i===void 0)throw Error(`Target box not found for frame ${r.frame.name}`);let a;return a=r.sourceFrame?H(t.boxes,r.sourceFrame):U(t.boxes,i.swimlane.index,r.index-1),a===void 0?[]:[{$kind:x,frame:r.frame,index:r.index,sourceBox:a,targetBox:i}]}n(W,`decidePositionRelation`);function G(e,t){let n=t,r={visual:{fill:`none`,stroke:`#000`},source:{x:n.sourceBox.x,y:n.sourceBox.y},target:{x:n.targetBox.x,y:n.targetBox.y},sourceBox:n.sourceBox,targetBox:n.targetBox};return{...e,relations:[...e.relations,r]}}n(G,`evolveRelationPositioned`);var le={[v]:F,[b]:W},ue={[y]:z,[x]:G};function K(e,t){let n=le[t.$kind];if(n==null)return[];let i=n(e,t);return r.debug(`decided events`,i),i}n(K,`decide`);function q(e,t){let n=t.reduce((e,t)=>{let n=ue[t.$kind];return n==null?e:n(e,t)},e);return r.debug(`evolve events`,{state:e,newState:n,events:t}),n}n(q,`evolve`);function J(e,t){return q(e,K(e,t))}n(J,`dispatch`);var Y={getConfig:se,setOptions:re,getOptions:ie,clear:ae,setAccTitle:o,getAccTitle:h,getAccDescription:f,setAccDescription:a,setDiagramTitle:d,getDiagramTitle:p,setAst:T,getDiagramProps:D,getState:w},de={parse:n(async e=>{let n=await t(`eventmodeling`,e);r.debug(n),Y.setAst(n),ne(n,Y)},`parse`)},fe=m()?.eventmodeling;function X(e,t){return n=>{let r=n.swimlane.y+t.swimlanePadding,i=e.append(`g`).attr(`class`,`em-box`);i.append(`rect`).attr(`x`,n.x).attr(`y`,r).attr(`rx`,`3`).attr(`width`,n.dimension.width).attr(`height`,n.dimension.height).attr(`stroke`,n.visual.stroke).attr(`fill`,n.visual.fill),i.append(`foreignObject`).attr(`x`,n.x+t.boxPadding).attr(`y`,r+10).attr(`width`,n.dimension.width-2*t.boxPadding).attr(`height`,n.dimension.height-2*t.boxPadding).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`).append(`span`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).html(n.text)}}n(X,`renderD3Box`);function Z(e,t){return e>t}n(Z,`dirUpwards`);function Q(e,t,n,i){return a=>{let o=a.sourceBox.swimlane.y+t.swimlanePadding,s=a.targetBox.swimlane.y+t.swimlanePadding,c=Z(o,s),l=a.sourceBox.x+a.sourceBox.dimension.width*2/3,u=a.targetBox.x+a.targetBox.dimension.width/3,d,f;r.debug(`rendering relation up=${c} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),c?(d=o,f=s+a.targetBox.dimension.height):(d=o+a.sourceBox.dimension.height,f=s);let p=i.emRelationStroke??a.visual.stroke;e.append(`path`).attr(`class`,`em-relation`).attr(`fill`,a.visual.fill).attr(`stroke`,p).attr(`stroke-width`,`1`).attr(`marker-end`,`url(#${n})`).attr(`d`,`M${l} ${d} L${u} ${f}`)}}n(Q,`renderD3Relation`);function $(e,t,n,r){return i=>{let a=e.append(`g`).attr(`class`,`em-swimlane`),o=r.emSwimlaneBackgroundOdd??`rgb(250,250,250)`,s=r.emSwimlaneBackgroundStroke??`rgb(240,240,240)`;a.append(`rect`).attr(`x`,0).attr(`y`,i.y).attr(`rx`,`3`).attr(`width`,t+n.swimlanePadding).attr(`height`,i.height).attr(`fill`,o).attr(`stroke`,s),a.append(`text`).attr(`font-weight`,n.swimlaneTextFontWeight).attr(`x`,30).attr(`y`,i.y+30).text(i.label)}}n($,`renderD3Swimlane`);var pe={parser:de,db:Y,renderer:{draw:n(function(e,t,n,a){if(r.debug(`in eventmodeling renderer`,e+`
|
|
3
|
+
`,`id:`,t,n),!fe)throw Error(`EventModeling config not found`);let o=a.db,{themeVariables:c,eventmodeling:l}=m(),u=i(`[id="${t}"]`),d=o.getDiagramProps(),f=o.getState(),p=`em-arrowhead-${t}`,h=c.emArrowhead??`#000000`;f.sortedSwimlanesArray.forEach($(u,f.maxR,d,c)),f.boxes.forEach(X(u,d)),f.relations.forEach(Q(u,d,p,c)),u.append(`defs`).append(`marker`).attr(`id`,p).attr(`markerWidth`,`10`).attr(`markerHeight`,`7`).attr(`refX`,`10`).attr(`refY`,`3.5`).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0 0, 10 3.5, 0 7`).attr(`fill`,h),s(void 0,u,l?.padding??30,l?.useMaxWidth)},`draw`)},styles:n(e=>``,`getStyles`)};export{pe as diagram};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{n as e}from"./mermaid-parser.core-Du2mcMMx.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n}from"./src-oBChb5qS.js";import{H as r,U as i,a,b as o,c as s,f as c,q as l,v as u,w as d,y as f,z as p}from"./chunk-O7XYJQB3-CjZQSnt8.js";import{i as m}from"./chunk-ZIGJFQKS-C6SOqBs6.js";import{t as h}from"./chunk-JWPE2WC7-DVXcaiue.js";import{r as g,t as _}from"./chunk-742MDFTN-DTR6iTOw.js";import{t as v}from"./chunk-2Q5K7J3B-C1jixKkw.js";import{a as y}from"./mermaid.core-B4zgSyXF.js";var b=/[─━│┃└┗├┣]/,x=/[└┗├┣]/,S=/[─━]/,C=/^[\s│┃]+$/,w=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,T=/^\s*%%/,E=` `;function D(e){return e.some(e=>b.test(e))}t(D,`isBoxDrawingFormat`);function O(e){for(let t of e){let e=x.exec(t);if(e?.index&&e.index>0)return e.index}return 4}t(O,`inferSegmentWidth`);function k(e,t){return e.replace(/\bline\s+(\d+)\b/gi,(e,n)=>{let r=parseInt(n,10),i=t.get(r);return i?`line ${i}`:e})}t(k,`remapErrorLines`);function A(e){let t=e.split(`
|
|
2
|
+
`),n=new Map,r=-1;for(let[e,n]of t.entries())if(n.trim()===`treeView-beta`){r=e;break}if(r===-1)return{text:e,lineMap:n};let i=[];for(let e=r+1;e<t.length;e++){let n=t[e];n.trim()===``||T.test(n)||w.test(n)||C.test(n)||i.push(n.replace(/\t/g,` `))}if(!D(i))return{text:e,lineMap:n};let a=O(i),o=[],s=0;for(let e=0;e<=r;e++)o.push(t[e]),s++,n.set(s,e+1);for(let e=r+1;e<t.length;e++){let r=t[e],i=r.trim(),c=e+1;if(i===``){o.push(r),s++,n.set(s,c);continue}if(T.test(r)){o.push(r),s++,n.set(s,c);continue}if(w.test(r)){o.push(r),s++,n.set(s,c);continue}if(C.test(r))continue;let l=r.replace(/\t/g,` `),u=x.exec(l);if(u?.index!==void 0){let e=u.index,t=Math.round(e/a)+1,r=e+1;for(;r<l.length&&S.test(l[r]);)r++;for(;r<l.length&&l[r]===` `;)r++;let i=l.slice(r).trimEnd();if(!i)throw Error(`Line ${c}: Empty node \u2014 expected a filename or directory name after the box-drawing prefix`);let d=E.repeat(t);o.push(d+i),s++,n.set(s,c)}else if(/^[\s─━│┃└┗├┣]+$/.test(l))continue;else if(b.test(l))o.push(r),s++,n.set(s,c);else if(/^\s+/.test(l))throw Error(`Line ${c}: Unexpected indentation without box-drawing characters. In box-drawing format, use \u251C\u2500\u2500 or \u2514\u2500\u2500 prefixes for indented nodes.`);else o.push(r),s++,n.set(s,c)}return{text:o.join(`
|
|
3
|
+
`),lineMap:n}}t(A,`preprocessBoxDrawing`);var j=new v(()=>({cnt:1,stack:[{id:0,level:-1,name:`/`,nodeType:`directory`,children:[]}]})),M=t(()=>{j.reset(),a()},`clear`),N=t(()=>j.records.stack[0],`getRoot`),P=t(()=>j.records.cnt,`getCount`),F=c.treeView,I={clear:M,addNode:t((e,t,n,r,i,a)=>{for(;e<=j.records.stack[j.records.stack.length-1].level;)j.records.stack.pop();let o={id:j.records.cnt++,level:e,name:t,nodeType:n,icon:i,cssClass:r,description:a,children:[]};j.records.stack[j.records.stack.length-1].children.push(o),j.records.stack.push(o)},`addNode`),getRoot:N,getCount:P,getConfig:t(()=>m(F,o().treeView),`getConfig`),getAccTitle:f,getAccDescription:u,getDiagramTitle:d,setAccDescription:r,setAccTitle:i,setDiagramTitle:l},L=t(e=>{h(e,I);for(let t of e.nodes){let e=typeof t.indent==`number`?t.indent:0,n=t.name,r=n.endsWith(`/`);r&&(n=n.slice(0,-1));let i=r?`directory`:`file`,a=t.classAnnotation||void 0,s=t.iconAnnotation,c=s===void 0?void 0:s||`none`,l=t.descAnnotation||void 0,u=l?p(l,o()):void 0;I.addNode(e,n,i,a,c,u)}},`populate`),R={parse:t(async t=>{let{text:r,lineMap:i}=A(t);try{let t=await e(`treeView`,r);n.debug(t),L(t)}catch(e){throw i.size>0&&e instanceof Error&&(e.message=k(e.message,i)),e}},`parse`)},z={prefix:`mermaid-treeview`,height:24,width:24,icons:{folder:{body:`<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>`},file:{body:`<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>`}}};function B(e,t){let n=t?.filenameIcons?.[e];if(n)return n;let r=e.lastIndexOf(`.`);if(r>0){let n=e.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[n]??i?.[n.slice(1)]}}t(B,`detectIcon`);function V(e,t){return e.includes(`:`)?e:e in z.icons||!t?`${z.prefix}:${e}`:`${t}:${e}`}t(V,`qualifyIcon`);function H(e,t){if(e.icon!==`none`){if(e.icon)return V(e.icon,t.defaultIconPack);if(t.showIcons){if(e.nodeType===`file`){let n=B(e.name,t);if(n===`none`)return;if(n)return V(n,t.defaultIconPack)}return`${z.prefix}:${e.nodeType===`directory`?`folder`:`file`}`}}}t(H,`getNodeIcon`),g([{name:z.prefix,icons:z}]);var U=14,W=4,G=16,K=t(async(e,n)=>{let r=[],i=t(e=>{let t=H(e,n);t&&r.push({icon:t,node:e}),e.children.forEach(i)},`collect`);i(e);let a=await Promise.all(r.map(async({icon:e,node:t})=>({id:t.id,svg:await _(e,{height:U,width:U})})));return new Map(a.map(({id:e,svg:t})=>[e,t]))},`resolveNodeIcons`),q=t((e,t,n,r,i,a)=>{let o=r.append(`g`),s=`treeView-node-label`;n.nodeType===`directory`&&(s+=` treeView-node-dir`),n.cssClass&&(s+=` ${n.cssClass}`);let c=U+W,l=H(n,i),u=l!==void 0;l&&o.append(`g`).attr(`class`,`treeView-node-icon`).attr(`transform`,`translate(${e+i.paddingX}, ${t+i.paddingY})`).html(a.get(n.id)??``);let d=o.append(`text`).text(n.name).attr(`dominant-baseline`,`middle`).attr(`class`,s),{height:f,width:p}=d.node().getBBox(),m=f+i.paddingY*2,h=e+i.paddingX+(u?c:0);d.attr(`x`,h),d.attr(`y`,t+m/2);let g=h+p;return n.BBox={x:e,y:t,width:p+i.paddingX*2+(u?c:0),height:m},n.cssClass?.split(/\s+/).includes(`highlight`)&&o.insert(`rect`,`:first-child`).attr(`x`,e).attr(`y`,t+1).attr(`width`,0).attr(`height`,m-2).attr(`rx`,3).attr(`class`,`treeView-highlight-bg`),{node:n,nodeGroup:o,labelRightEdge:g,centerY:t+m/2}},`positionLabel`),J=t((e,t,n,r,i,a)=>e.append(`line`).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i).attr(`stroke-width`,a).attr(`class`,`treeView-node-line`),`positionLine`),Y=t((e,n,r,i)=>{let a=0,o=0,s=[],c=t((e,t,n,r)=>{let c=r*(n.rowIndent+n.paddingX),l=q(c,a,t,e,n,i);s.push(l);let{height:u,width:d}=t.BBox;J(e,c-n.rowIndent,a+u/2,c,a+u/2,n.lineThickness),o=Math.max(o,c+d),a+=u},`drawNode`),l=t((t,n=0)=>{c(e,t,r,n),t.children.forEach(e=>{l(e,n+1)});let{x:i,y:a,height:o}=t.BBox;if(t.children.length){let{y:n,height:s}=t.children[t.children.length-1].BBox;J(e,i+r.paddingX,a+o,i+r.paddingX,n+s/2+r.lineThickness/2,r.lineThickness)}},`processNode`);l(n);let u=s.filter(e=>e.node.description);if(u.length>0){let e=Math.max(...s.map(e=>e.labelRightEdge))+G;for(let t of u){let n=t.nodeGroup.append(`text`).text(t.node.description).attr(`dominant-baseline`,`middle`).attr(`class`,`treeView-node-description`).attr(`x`,e).attr(`y`,t.centerY).node().getBBox();o=Math.max(o,e+n.width+r.paddingX)}}for(let e of s)if(e.node.cssClass?.split(/\s+/).includes(`highlight`)){let t=e.nodeGroup.select(`.treeView-highlight-bg`);if(!t.empty()){let n=o-e.node.BBox.x+8;t.attr(`width`,n),o=Math.max(o,e.node.BBox.x+n+2)}}return{totalHeight:a,totalWidth:o}},`drawTree`),X={draw:t(async(e,t,r,i)=>{n.debug(`Rendering treeView diagram
|
|
4
|
+
`+e);let a=i.db,o=a.getRoot(),c=a.getConfig(),l=y(t),u=l.append(`g`);u.attr(`class`,`tree-view`);let{totalHeight:d,totalWidth:f}=Y(u,o,c,await K(o,c));l.attr(`viewBox`,`-${c.lineThickness/2} 0 ${f} ${d}`),s(l,d,f,c.useMaxWidth)},`draw`)},Z={labelFontSize:`16px`,labelColor:`black`,lineColor:`black`,iconColor:`#546e7a`,descriptionColor:`#6a9955`,highlightBg:`rgba(255, 193, 7, 0.15)`,highlightStroke:`#ffc107`},Q={db:I,renderer:X,parser:R,styles:t(({treeView:e})=>{let{labelFontSize:t,labelColor:n,lineColor:r,iconColor:i,descriptionColor:a,highlightBg:o,highlightStroke:s}=m(Z,e);return`
|
|
5
|
+
.treeView-node-label {
|
|
6
|
+
font-size: ${t};
|
|
7
|
+
fill: ${n};
|
|
8
|
+
white-space: pre;
|
|
9
|
+
}
|
|
10
|
+
.treeView-node-dir {
|
|
11
|
+
font-weight: bold;
|
|
12
|
+
}
|
|
13
|
+
.treeView-node-line {
|
|
14
|
+
stroke: ${r};
|
|
15
|
+
}
|
|
16
|
+
.treeView-node-icon {
|
|
17
|
+
color: ${i};
|
|
18
|
+
}
|
|
19
|
+
.treeView-node-description {
|
|
20
|
+
font-size: ${t};
|
|
21
|
+
fill: ${a};
|
|
22
|
+
font-style: italic;
|
|
23
|
+
white-space: pre;
|
|
24
|
+
}
|
|
25
|
+
.treeView-highlight-bg {
|
|
26
|
+
fill: ${o};
|
|
27
|
+
stroke: ${s};
|
|
28
|
+
stroke-width: 1;
|
|
29
|
+
}
|
|
30
|
+
`},`styles`)};export{Q as diagram};
|