@1agents/dsh-a2a 0.0.0-stage → 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/README.md +57 -2
- package/cordis.patch.yml +10 -0
- package/dist/approvals.js +49 -0
- package/dist/cli.js +15 -0
- package/dist/executor.js +121 -0
- package/dist/index.js +18 -0
- package/dist/sdk-runtime.js +116 -0
- package/dist/server.js +46 -0
- package/dist/shared/a2a/workbench-ui.js +182 -0
- package/dist/workbench-ui/app.css +453 -0
- package/dist/workbench-ui/app.js +13 -0
- package/dist/workbench-ui/chunk-23JHGYT3.js +1 -0
- package/dist/workbench-ui/chunk-3H6STGPV.js +1 -0
- package/dist/workbench-ui/chunk-3SNBBMGH.js +1 -0
- package/dist/workbench-ui/chunk-3XJZ6DIE.js +1 -0
- package/dist/workbench-ui/chunk-44KDLLKJ.js +1 -0
- package/dist/workbench-ui/chunk-46H7FU5Y.js +7 -0
- package/dist/workbench-ui/chunk-4N44QPL7.js +1 -0
- package/dist/workbench-ui/chunk-4YN4BS7I.js +1 -0
- package/dist/workbench-ui/chunk-53EG4IVQ.js +96 -0
- package/dist/workbench-ui/chunk-5FIPUNR4.js +1 -0
- package/dist/workbench-ui/chunk-6DWWYA6G.js +2 -0
- package/dist/workbench-ui/chunk-6FU3T633.js +99 -0
- package/dist/workbench-ui/chunk-6XKIHRA4.js +1 -0
- package/dist/workbench-ui/chunk-7GIX43Y5.js +1 -0
- package/dist/workbench-ui/chunk-7Q4WBGX6.js +4 -0
- package/dist/workbench-ui/chunk-A3BQM7HR.js +1 -0
- package/dist/workbench-ui/chunk-AFCFDDOP.js +24 -0
- package/dist/workbench-ui/chunk-AG67EUYD.js +89 -0
- package/dist/workbench-ui/chunk-AGJHMMTN.js +1 -0
- package/dist/workbench-ui/chunk-AO6JUBV6.js +41 -0
- package/dist/workbench-ui/chunk-AUSLTP43.js +72 -0
- package/dist/workbench-ui/chunk-AVZL46TT.js +1 -0
- package/dist/workbench-ui/chunk-AZRIGIV2.js +168 -0
- package/dist/workbench-ui/chunk-B2LIVH37.js +1 -0
- package/dist/workbench-ui/chunk-B7YX5TR5.js +1 -0
- package/dist/workbench-ui/chunk-BCB4X4XX.js +1 -0
- package/dist/workbench-ui/chunk-BCRQUL2A.js +88 -0
- package/dist/workbench-ui/chunk-BI6UHHQP.js +1 -0
- package/dist/workbench-ui/chunk-BLSLQ4AQ.js +120 -0
- package/dist/workbench-ui/chunk-C3QSRS6E.js +1 -0
- package/dist/workbench-ui/chunk-CK7M2PJ3.js +62 -0
- package/dist/workbench-ui/chunk-CM6LZ7TU.js +1 -0
- package/dist/workbench-ui/chunk-CP63H27F.js +36 -0
- package/dist/workbench-ui/chunk-CPUMMIS2.js +70 -0
- package/dist/workbench-ui/chunk-CSEIBI5U.js +2 -0
- package/dist/workbench-ui/chunk-CUS65DKZ.js +161 -0
- package/dist/workbench-ui/chunk-CVQY7TNC.js +1 -0
- package/dist/workbench-ui/chunk-D6S3XBIX.js +106 -0
- package/dist/workbench-ui/chunk-E253Y562.js +1 -0
- package/dist/workbench-ui/chunk-EADDJUDC.js +1 -0
- package/dist/workbench-ui/chunk-EBGJ3YXG.js +206 -0
- package/dist/workbench-ui/chunk-EKPVZ3WY.js +8 -0
- package/dist/workbench-ui/chunk-EQDCEAFY.js +1 -0
- package/dist/workbench-ui/chunk-ES3SSDJY.js +40 -0
- package/dist/workbench-ui/chunk-ESFD2H7N.js +231 -0
- package/dist/workbench-ui/chunk-FVOHPMS6.js +1 -0
- package/dist/workbench-ui/chunk-FXMQAGVT.js +1 -0
- package/dist/workbench-ui/chunk-GGTADRXD.js +24 -0
- package/dist/workbench-ui/chunk-GHIVPGNQ.js +1 -0
- package/dist/workbench-ui/chunk-GLU2YQV2.js +1 -0
- package/dist/workbench-ui/chunk-GOCKBYSM.js +1 -0
- package/dist/workbench-ui/chunk-H2KMMTJB.js +1 -0
- package/dist/workbench-ui/chunk-HGVLDNPP.js +39 -0
- package/dist/workbench-ui/chunk-HSAVC5GY.js +1 -0
- package/dist/workbench-ui/chunk-HSEAD2JH.js +1 -0
- package/dist/workbench-ui/chunk-HSIHOBTY.js +1 -0
- package/dist/workbench-ui/chunk-IZXOKUGG.js +67 -0
- package/dist/workbench-ui/chunk-JFT2LC2T.js +1 -0
- package/dist/workbench-ui/chunk-JHL3ZDYK.js +3 -0
- package/dist/workbench-ui/chunk-JMORLCZG.js +257 -0
- package/dist/workbench-ui/chunk-JR4SIX7A.js +1 -0
- package/dist/workbench-ui/chunk-K23HAGEH.js +30 -0
- package/dist/workbench-ui/chunk-K43JDCBH.js +1 -0
- package/dist/workbench-ui/chunk-KINKFJY7.js +1 -0
- package/dist/workbench-ui/chunk-KKQSA4LI.js +2 -0
- package/dist/workbench-ui/chunk-KOUZX3UX.js +1 -0
- package/dist/workbench-ui/chunk-KR4DRHW2.js +78 -0
- package/dist/workbench-ui/chunk-KT4DJNOR.js +1 -0
- package/dist/workbench-ui/chunk-KTPNKRRZ.js +292 -0
- package/dist/workbench-ui/chunk-LFHIPGSU.js +7 -0
- package/dist/workbench-ui/chunk-LWDL4HZB.js +125 -0
- package/dist/workbench-ui/chunk-MVYC3CY4.js +1 -0
- package/dist/workbench-ui/chunk-NWUPALCY.js +129 -0
- package/dist/workbench-ui/chunk-NY7C662Z.js +1 -0
- package/dist/workbench-ui/chunk-O76WTHWP.js +1 -0
- package/dist/workbench-ui/chunk-OTF7YHRE.js +162 -0
- package/dist/workbench-ui/chunk-P6TKKRKP.js +1 -0
- package/dist/workbench-ui/chunk-PFHOOWV3.js +1 -0
- package/dist/workbench-ui/chunk-PUQLANIM.js +1 -0
- package/dist/workbench-ui/chunk-PZCGBYVO.js +1 -0
- package/dist/workbench-ui/chunk-QOHUZGP4.js +1 -0
- package/dist/workbench-ui/chunk-QSEG3OFF.js +1 -0
- package/dist/workbench-ui/chunk-QYPOXZIA.js +84 -0
- package/dist/workbench-ui/chunk-R6SOF3JC.js +1 -0
- package/dist/workbench-ui/chunk-RCLOYU5F.js +1 -0
- package/dist/workbench-ui/chunk-RSRUP64S.js +1 -0
- package/dist/workbench-ui/chunk-RVAIT6JW.js +1 -0
- package/dist/workbench-ui/chunk-S2CCN3II.js +1 -0
- package/dist/workbench-ui/chunk-S2Q52W46.js +1 -0
- package/dist/workbench-ui/chunk-S2W5THJ5.js +1 -0
- package/dist/workbench-ui/chunk-S6ZQZNOX.js +1 -0
- package/dist/workbench-ui/chunk-S74PLMMS.js +1 -0
- package/dist/workbench-ui/chunk-S7C4HKEY.js +1 -0
- package/dist/workbench-ui/chunk-SDTB3Q65.js +1 -0
- package/dist/workbench-ui/chunk-SLPRGYUV.js +32 -0
- package/dist/workbench-ui/chunk-SQE76S5B.js +1 -0
- package/dist/workbench-ui/chunk-SSDZPVPW.js +1 -0
- package/dist/workbench-ui/chunk-SVI7DGIE.js +1 -0
- package/dist/workbench-ui/chunk-T6QKLZ4H.js +62 -0
- package/dist/workbench-ui/chunk-TJNRPTFL.js +1 -0
- package/dist/workbench-ui/chunk-TP6U4EDH.js +2 -0
- package/dist/workbench-ui/chunk-TYAAT3GQ.js +1 -0
- package/dist/workbench-ui/chunk-U6OCY4ZH.js +1 -0
- package/dist/workbench-ui/chunk-UAN3NLRF.js +1 -0
- package/dist/workbench-ui/chunk-UMLU3FIX.js +1 -0
- package/dist/workbench-ui/chunk-URIY2OTM.js +1 -0
- package/dist/workbench-ui/chunk-V2NUKAA7.js +38 -0
- package/dist/workbench-ui/chunk-V4QLL4TE.js +139 -0
- package/dist/workbench-ui/chunk-VASHXUK4.js +2 -0
- package/dist/workbench-ui/chunk-VJLIWNIU.js +1 -0
- package/dist/workbench-ui/chunk-VQNQFBID.js +1 -0
- package/dist/workbench-ui/chunk-VSIWU7XA.js +3 -0
- package/dist/workbench-ui/chunk-VSJASPUZ.js +321 -0
- package/dist/workbench-ui/chunk-VXPNUNUX.js +3 -0
- package/dist/workbench-ui/chunk-WBKLDCV6.js +1 -0
- package/dist/workbench-ui/chunk-WOKJM3FY.js +1 -0
- package/dist/workbench-ui/chunk-X3U3NA3X.js +34 -0
- package/dist/workbench-ui/chunk-XBYU7M4J.js +1 -0
- package/dist/workbench-ui/chunk-XBZAO4ID.js +10 -0
- package/dist/workbench-ui/chunk-XLLPZ2WO.js +1 -0
- package/dist/workbench-ui/chunk-YFVL4NJL.js +1 -0
- package/dist/workbench-ui/chunk-YRFQENM4.js +1 -0
- package/dist/workbench-ui/chunk-YUADQVB2.js +1 -0
- package/dist/workbench-ui/chunk-Z3TCAKM5.js +1 -0
- package/dist/workbench-ui/chunk-Z6QR6FRE.js +10 -0
- package/dist/workbench-ui/chunk-ZJPSORPP.js +3 -0
- package/dist/workbench-ui/chunk-ZLGCSTR2.js +15 -0
- package/dist/workbench-ui/chunk-ZLR4SG5X.js +1 -0
- package/dist/workbench-ui/chunk-ZND3TTGF.js +1 -0
- package/dist/workbench-ui/chunk-ZOP3ZYH7.js +2 -0
- package/dist/workbench-ui/index.html +14 -0
- package/dist/workbench.js +53 -0
- package/package.json +25 -4
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import{a as ge}from"./chunk-H2KMMTJB.js";import{b as he,c as de}from"./chunk-XLLPZ2WO.js";import{a as ue}from"./chunk-RVAIT6JW.js";import"./chunk-MVYC3CY4.js";import"./chunk-XBZAO4ID.js";import"./chunk-PZCGBYVO.js";import"./chunk-CK7M2PJ3.js";import"./chunk-44KDLLKJ.js";import"./chunk-JFT2LC2T.js";import"./chunk-AUSLTP43.js";import"./chunk-GLU2YQV2.js";import"./chunk-6DWWYA6G.js";import"./chunk-VJLIWNIU.js";import{G as M,Z as C,c as se,d as oe,e as ae,j as B,t as ce,w as le}from"./chunk-LWDL4HZB.js";import"./chunk-VXPNUNUX.js";import{b as T}from"./chunk-JR4SIX7A.js";import{a as h}from"./chunk-5FIPUNR4.js";import"./chunk-SQE76S5B.js";var k=[];for(let e=0;e<256;++e)k.push((e+256).toString(16).slice(1));function pe(e,i=0){return(k[e[i+0]]+k[e[i+1]]+k[e[i+2]]+k[e[i+3]]+"-"+k[e[i+4]]+k[e[i+5]]+"-"+k[e[i+6]]+k[e[i+7]]+"-"+k[e[i+8]]+k[e[i+9]]+"-"+k[e[i+10]]+k[e[i+11]]+k[e[i+12]]+k[e[i+13]]+k[e[i+14]]+k[e[i+15]]).toLowerCase()}var Ee=new Uint8Array(16);function q(){return crypto.getRandomValues(Ee)}function _e(e,i,l){return!i&&!e&&crypto.randomUUID?crypto.randomUUID():Se(e,i,l)}function Se(e,i,l){e=e||{};let a=e.random??e.rng?.()??q();if(a.length<16)throw new Error("Random bytes length must be >= 16");if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,i){if(l=l||0,l<0||l+16>i.length)throw new RangeError(`UUID byte range ${l}:${l+15} is out of buffer bounds`);for(let t=0;t<16;++t)i[l+t]=a[t];return i}return pe(a)}var J=_e;var K=(function(){var e=h(function(D,s,n,o){for(n=n||{},o=D.length;o--;n[D[o]]=s);return n},"o"),i=[1,4],l=[1,13],a=[1,12],t=[1,15],d=[1,16],f=[1,20],m=[1,19],b=[6,7,8],O=[1,26],w=[1,24],R=[1,25],g=[6,7,11],A=[1,6,13,15,16,19,22],Q=[1,33],Z=[1,34],$=[1,6,7,11,13,15,16,19,22],j={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:h(function(s,n,o,c,p,r,U){var u=r.length-1;switch(p){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[u].id),c.addNode(r[u-1].length,r[u].id,r[u].descr,r[u].type);break;case 16:c.getLogger().trace("Icon: ",r[u]),c.decorateNode({icon:r[u]});break;case 17:case 21:c.decorateNode({class:r[u]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[u].id),c.addNode(0,r[u].id,r[u].descr,r[u].type);break;case 20:c.decorateNode({icon:r[u]});break;case 25:c.getLogger().trace("node found ..",r[u-2]),this.$={id:r[u-1],descr:r[u-1],type:c.getType(r[u-2],r[u])};break;case 26:this.$={id:r[u],descr:r[u],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[u-3]),this.$={id:r[u-3],descr:r[u-1],type:c.getType(r[u-2],r[u])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:i},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:i},{6:l,7:[1,10],9:9,12:11,13:a,14:14,15:t,16:d,17:17,18:18,19:f,22:m},e(b,[2,3]),{1:[2,2]},e(b,[2,4]),e(b,[2,5]),{1:[2,6],6:l,12:21,13:a,14:14,15:t,16:d,17:17,18:18,19:f,22:m},{6:l,9:22,12:11,13:a,14:14,15:t,16:d,17:17,18:18,19:f,22:m},{6:O,7:w,10:23,11:R},e(g,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:f,22:m}),e(g,[2,18]),e(g,[2,19]),e(g,[2,20]),e(g,[2,21]),e(g,[2,23]),e(g,[2,24]),e(g,[2,26],{19:[1,30]}),{20:[1,31]},{6:O,7:w,10:32,11:R},{1:[2,7],6:l,12:21,13:a,14:14,15:t,16:d,17:17,18:18,19:f,22:m},e(A,[2,14],{7:Q,11:Z}),e($,[2,8]),e($,[2,9]),e($,[2,10]),e(g,[2,15]),e(g,[2,16]),e(g,[2,17]),{20:[1,35]},{21:[1,36]},e(A,[2,13],{7:Q,11:Z}),e($,[2,11]),e($,[2,12]),{21:[1,37]},e(g,[2,25]),e(g,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:h(function(s,n){if(n.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=n,o}},"parseError"),parse:h(function(s){var n=this,o=[0],c=[],p=[null],r=[],U=this.table,u="",V=0,ee=0,te=0,me=2,ie=1,ye=r.slice.call(arguments,1),y=Object.create(this.lexer),L={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(L.yy[H]=this.yy[H]);y.setInput(s,L.yy),L.yy.lexer=y,L.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var W=y.yylloc;r.push(W);var ke=y.options&&y.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function be(_){o.length=o.length-2*_,p.length=p.length-_,r.length=r.length-_}h(be,"popStack");function ne(){var _;return _=c.pop()||y.lex()||ie,typeof _!="number"&&(_ instanceof Array&&(c=_,_=c.pop()),_=n.symbols_[_]||_),_}h(ne,"lex");for(var E,X,v,S,we,z,I={},F,x,re,G;;){if(v=o[o.length-1],this.defaultActions[v]?S=this.defaultActions[v]:((E===null||typeof E>"u")&&(E=ne()),S=U[v]&&U[v][E]),typeof S>"u"||!S.length||!S[0]){var Y="";G=[];for(F in U[v])this.terminals_[F]&&F>me&&G.push("'"+this.terminals_[F]+"'");y.showPosition?Y="Parse error on line "+(V+1)+`:
|
|
2
|
+
`+y.showPosition()+`
|
|
3
|
+
Expecting `+G.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Y="Parse error on line "+(V+1)+": Unexpected "+(E==ie?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Y,{text:y.match,token:this.terminals_[E]||E,line:y.yylineno,loc:W,expected:G})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+E);switch(S[0]){case 1:o.push(E),p.push(y.yytext),r.push(y.yylloc),o.push(S[1]),E=null,X?(E=X,X=null):(ee=y.yyleng,u=y.yytext,V=y.yylineno,W=y.yylloc,te>0&&te--);break;case 2:if(x=this.productions_[S[1]][1],I.$=p[p.length-x],I._$={first_line:r[r.length-(x||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(x||1)].first_column,last_column:r[r.length-1].last_column},ke&&(I._$.range=[r[r.length-(x||1)].range[0],r[r.length-1].range[1]]),z=this.performAction.apply(I,[u,ee,V,L.yy,S[1],p,r].concat(ye)),typeof z<"u")return z;x&&(o=o.slice(0,-1*x*2),p=p.slice(0,-1*x),r=r.slice(0,-1*x)),o.push(this.productions_[S[1]][0]),p.push(I.$),r.push(I._$),re=U[o[o.length-2]][o[o.length-1]],o.push(re);break;case 3:return!0}}return!0},"parse")},fe=(function(){var D={EOF:1,parseError:h(function(n,o){if(this.yy.parser)this.yy.parser.parseError(n,o);else throw new Error(n)},"parseError"),setInput:h(function(s,n){return this.yy=n||this.yy||{},this._input=s,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:h(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:h(function(s){var n=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var c=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),o.length-1&&(this.yylineno-=o.length-1);var p=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:o?(o.length===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(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).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:h(function(s){this.unput(this.match.slice(s))},"less"),pastInput:h(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
5
|
+
`+n+"^"},"showPosition"),test_match:h(function(s,n){var o,c,p;if(this.options.backtrack_lexer&&(p={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&&(p.yylloc.range=this.yylloc.range.slice(0))),c=s[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,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(s[0].length),this.matched+=s[0],o=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var r in p)this[r]=p[r];return!1}return!1},"test_match"),next:h(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,n,o,c;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),r=0;r<p.length;r++)if(o=this._input.match(this.rules[p[r]]),o&&(!n||o[0].length>n[0].length)){if(n=o,c=r,this.options.backtrack_lexer){if(s=this.test_match(o,p[r]),s!==!1)return s;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(s=this.test_match(n,p[c]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:h(function(){var n=this.next();return n||this.lex()},"lex"),begin:h(function(n){this.conditionStack.push(n)},"begin"),popState:h(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:h(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:h(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:h(function(n){this.begin(n)},"pushState"),stateStackSize:h(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:h(function(n,o,c,p){var r=p;switch(c){case 0:return n.getLogger().trace("Found comment",o.yytext),6;break;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;break;case 4:this.popState();break;case 5:n.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return n.getLogger().trace("SPACELINE"),6;break;case 7:return 7;case 8:return 15;case 9:n.getLogger().trace("end icon"),this.popState();break;case 10:return n.getLogger().trace("Exploding node"),this.begin("NODE"),19;break;case 11:return n.getLogger().trace("Cloud"),this.begin("NODE"),19;break;case 12:return n.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;break;case 13:return n.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;break;case 14:return this.begin("NODE"),19;break;case 15:return this.begin("NODE"),19;break;case 16:return this.begin("NODE"),19;break;case 17:return this.begin("NODE"),19;break;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:n.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return n.getLogger().trace("description:",o.yytext),"NODE_DESCR";break;case 26:this.popState();break;case 27:return this.popState(),n.getLogger().trace("node end ))"),"NODE_DEND";break;case 28:return this.popState(),n.getLogger().trace("node end )"),"NODE_DEND";break;case 29:return this.popState(),n.getLogger().trace("node end ...",o.yytext),"NODE_DEND";break;case 30:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";break;case 31:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";break;case 32:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";break;case 33:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";break;case 34:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";break;case 35:return n.getLogger().trace("Long description:",o.yytext),20;break;case 36:return n.getLogger().trace("Long description:",o.yytext),20;break}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return D})();j.lexer=fe;function P(){this.yy={}}return h(P,"Parser"),P.prototype=j,j.Parser=P,new P})();K.parser=K;var xe=K,Ne=12,N={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},De=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=N,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}static{h(this,"MindmapDB")}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let i=this.nodes.length-1;i>=0;i--)if(this.nodes[i].level<e)return this.nodes[i];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(e,i,l,a){T.info("addNode",e,i,l,a);let t=!1;this.nodes.length===0?(this.baseLevel=e,e=0,t=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,t=!1);let d=C(),f=d.mindmap?.padding??B.mindmap.padding;switch(a){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:f*=2;break}let m={id:this.count++,nodeId:M(i,d),level:e,descr:M(l,d),type:a,children:[],width:d.mindmap?.maxNodeWidth??B.mindmap.maxNodeWidth,padding:f,isRoot:t},b=this.getParent(e);if(b)b.children.push(m),this.nodes.push(m);else if(t)this.nodes.push(m);else throw new Error(`There can be only one root. No parent could be found for ("${m.descr}")`)}getType(e,i){switch(T.debug("In get type",e,i),e){case"[":return this.nodeType.RECT;case"(":return i===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,i){this.elements[e]=i}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;let i=C(),l=this.nodes[this.nodes.length-1];e.icon&&(l.icon=M(e.icon,i)),e.class&&(l.class=M(e.class,i))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,i){if(e.level===0?e.section=void 0:e.section=i,e.children)for(let[l,a]of e.children.entries()){let t=e.level===0?l%(Ne-1):i;this.assignSections(a,t)}}flattenNodes(e,i){let l=C(),a=["mindmap-node"];e.isRoot===!0?a.push("section-root","section--1"):e.section!==void 0&&a.push(`section-${e.section}`),e.class&&a.push(e.class);let t=a.join(" "),d=h(m=>{let O=(l.theme?.toLowerCase()??"").includes("redux");switch(m){case N.CIRCLE:return"mindmapCircle";case N.RECT:return"rect";case N.ROUNDED_RECT:return"rounded";case N.CLOUD:return"cloud";case N.BANG:return"bang";case N.HEXAGON:return"hexagon";case N.DEFAULT:return O?"rounded":"defaultMindmapNode";case N.NO_BORDER:default:return"rect"}},"getShapeFromType"),f={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:d(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:t,cssStyles:[],look:l.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(i.push(f),e.children)for(let m of e.children)this.flattenNodes(m,i)}generateEdges(e,i){if(!e.children)return;let l=C();for(let a of e.children){let t="edge";a.section!==void 0&&(t+=` section-edge-${a.section}`);let d=e.level+1;t+=` edge-depth-${d}`;let f={id:`edge_${e.id}_${a.id}`,start:e.id.toString(),end:a.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:l.look,classes:t,depth:e.level,section:a.section};i.push(f),this.generateEdges(a,i)}}getData(){let e=this.getMindmap(),i=C(),a=le().layout!==void 0,t=i;if(a||(t.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:t};T.debug("getData: mindmapRoot",e,i),this.assignSections(e);let d=[],f=[];this.flattenNodes(e,d),this.generateEdges(e,f),T.debug(`getData: processed ${d.length} nodes and ${f.length} edges`);let m=new Map;for(let b of d)m.set(b.id,{shape:b.shape,width:b.width,height:b.height,padding:b.padding});return{nodes:d,edges:f,config:t,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(m),type:"mindmap",diagramId:"mindmap-"+J()}}getLogger(){return T}},Le=h(async(e,i,l,a)=>{T.debug(`Rendering mindmap diagram
|
|
7
|
+
`+e);let t=a.db,d=t.getData(),f=ge(i,d.config.securityLevel);if(d.type=a.type,d.layoutAlgorithm=de(d.config.layout,{fallback:"cose-bilkent"}),d.diagramId=i,!t.getMindmap())return;d.nodes.forEach(g=>{g.shape==="rounded"?(g.radius=15,g.taper=15,g.stroke="none",g.width=0,g.padding=15):g.shape==="circle"?g.padding=10:g.shape==="rect"?(g.width=0,g.padding=10):g.shape==="hexagon"&&(g.width=0,g.height=0)}),await he(d,f);let{themeVariables:b}=ce(),{useGradient:O,gradientStart:w,gradientStop:R}=b;if(O&&w&&R){let g=f.attr("id"),A=f.append("defs").append("linearGradient").attr("id",`${g}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");A.append("stop").attr("offset","0%").attr("stop-color",w).attr("stop-opacity",1),A.append("stop").attr("offset","100%").attr("stop-color",R).attr("stop-opacity",1)}ue(f,d.config.mindmap?.padding??B.mindmap.padding,"mindmapDiagram",d.config.mindmap?.useMaxWidth??B.mindmap.useMaxWidth)},"draw"),ve={draw:Le},Te=h(e=>{let{theme:i,look:l}=e,a="";for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e["lineColor"+t]=e["lineColor"+t]||e["cScaleInv"+t],se(e["lineColor"+t])?e["lineColor"+t]=oe(e["lineColor"+t],20):e["lineColor"+t]=ae(e["lineColor"+t],20);for(let t=0;t<e.THEME_COLOR_LIMIT;t++){let d=""+(l==="neo"?Math.max(10-(t-1)*2,2):17-3*t);a+=`
|
|
8
|
+
.section-${t-1} rect, .section-${t-1} path, .section-${t-1} circle, .section-${t-1} polygon, .section-${t-1} path {
|
|
9
|
+
fill: ${e["cScale"+t]};
|
|
10
|
+
}
|
|
11
|
+
.section-${t-1} text {
|
|
12
|
+
fill: ${e["cScaleLabel"+t]};
|
|
13
|
+
}
|
|
14
|
+
.section-${t-1} span {
|
|
15
|
+
color: ${e["cScaleLabel"+t]};
|
|
16
|
+
}
|
|
17
|
+
.node-icon-${t-1} {
|
|
18
|
+
font-size: 40px;
|
|
19
|
+
color: ${e["cScaleLabel"+t]};
|
|
20
|
+
}
|
|
21
|
+
.section-edge-${t-1}{
|
|
22
|
+
stroke: ${e["cScale"+t]};
|
|
23
|
+
}
|
|
24
|
+
.edge-depth-${t-1}{
|
|
25
|
+
stroke-width: ${d};
|
|
26
|
+
}
|
|
27
|
+
.section-${t-1} line {
|
|
28
|
+
stroke: ${e["cScaleInv"+t]} ;
|
|
29
|
+
stroke-width: 3;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.disabled, .disabled circle, .disabled text {
|
|
33
|
+
fill: lightgray;
|
|
34
|
+
}
|
|
35
|
+
.disabled text {
|
|
36
|
+
fill: #efefef;
|
|
37
|
+
}
|
|
38
|
+
[data-look="neo"].mindmap-node.section-${t-1} rect, [data-look="neo"].mindmap-node.section-${t-1} path, [data-look="neo"].mindmap-node.section-${t-1} circle, [data-look="neo"].mindmap-node.section-${t-1} polygon {
|
|
39
|
+
fill: ${i==="redux"||i==="redux-dark"||i==="neutral"?e.mainBkg:e["cScale"+t]};
|
|
40
|
+
stroke: ${i==="redux"||i==="redux-dark"?e.nodeBorder:e["cScale"+t]};
|
|
41
|
+
stroke-width: ${e.strokeWidth??2}px;
|
|
42
|
+
}
|
|
43
|
+
[data-look="neo"].section-edge-${t-1}{
|
|
44
|
+
stroke: ${i?.includes("redux")||i==="neo-dark"?e.nodeBorder:e["cScale"+t]};
|
|
45
|
+
}
|
|
46
|
+
[data-look="neo"].mindmap-node.section-${t-1} text {
|
|
47
|
+
fill: ${i==="redux"||i==="redux-dark"?e.nodeBorder:e["cScaleLabel"+(i==="neutral"?1:t)]};
|
|
48
|
+
}
|
|
49
|
+
`}return a},"genSections"),Oe=h((e,i,l)=>{let a="";for(let t=0;t<e;t++)a+=`
|
|
50
|
+
[data-look="neo"].mindmap-node.section-${t-1} rect, [data-look="neo"].mindmap-node.section-${t-1} path, [data-look="neo"].mindmap-node.section-${t-1} circle, [data-look="neo"].mindmap-node.section-${t-1} polygon {
|
|
51
|
+
stroke: url(${i}-gradient);
|
|
52
|
+
fill: ${l};
|
|
53
|
+
}
|
|
54
|
+
.section-${t-1} line {
|
|
55
|
+
stroke-width: 0;
|
|
56
|
+
}`;return a},"genGradient"),Ie=h(e=>{let{theme:i}=e,l=e.svgId,a=e.dropShadow?e.dropShadow.replace("url(#drop-shadow)",`url(${l}-drop-shadow)`):"none";return`
|
|
57
|
+
.edge {
|
|
58
|
+
stroke-width: 3;
|
|
59
|
+
}
|
|
60
|
+
${Te(e)}
|
|
61
|
+
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
|
|
62
|
+
fill: ${e.git0};
|
|
63
|
+
}
|
|
64
|
+
.section-root text {
|
|
65
|
+
fill: ${e.gitBranchLabel0};
|
|
66
|
+
}
|
|
67
|
+
.section-root span {
|
|
68
|
+
color: ${i?.includes("redux")?e.nodeBorder:e.gitBranchLabel0};
|
|
69
|
+
}
|
|
70
|
+
.icon-container {
|
|
71
|
+
height:100%;
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
align-items: center;
|
|
75
|
+
}
|
|
76
|
+
.edge {
|
|
77
|
+
fill: none;
|
|
78
|
+
}
|
|
79
|
+
.mindmap-node-label {
|
|
80
|
+
dy: 1em;
|
|
81
|
+
alignment-baseline: middle;
|
|
82
|
+
text-anchor: middle;
|
|
83
|
+
dominant-baseline: middle;
|
|
84
|
+
text-align: center;
|
|
85
|
+
}
|
|
86
|
+
[data-look="neo"].mindmap-node {
|
|
87
|
+
filter: ${a};
|
|
88
|
+
}
|
|
89
|
+
[data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon {
|
|
90
|
+
fill: ${i?.includes("redux")?e.mainBkg:e.git0};
|
|
91
|
+
}
|
|
92
|
+
[data-look="neo"].mindmap-node.section-root .text-inner-tspan {
|
|
93
|
+
fill: ${i?.includes("redux")?e.nodeBorder:e["cScaleLabel"+(i==="neutral"?1:0)]};
|
|
94
|
+
}
|
|
95
|
+
${e.useGradient&&l&&e.mainBkg?Oe(e.THEME_COLOR_LIMIT,l,e.mainBkg):""}
|
|
96
|
+
`},"getStyles"),Ce=Ie,it={get db(){return new De},renderer:ve,parser:xe,styles:Ce};export{it as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=Object.defineProperty,o=(r,e)=>a(r,"name",{value:e,configurable:!0}),_=(r,e)=>{for(var t in e)a(r,t,{get:e[t],enumerable:!0})};export{o as a,_ as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as pt}from"./chunk-VJLIWNIU.js";import{C as dr,M as N,g as or,k as gr,z as E}from"./chunk-LWDL4HZB.js";import{$ as Tr,G as xr,J as br,K as Ar,L as wr,M as Or,N as Br,O as Sr,P as Ir,Q as Pr,R as Mr,S as Wr,T as Er,U as Lr,V as Dr,W as $r,X as Rr,Y as Nr,Z as Fr,_ as jr,b as w,h as hr}from"./chunk-JR4SIX7A.js";import{a}from"./chunk-5FIPUNR4.js";import{b as at}from"./chunk-SQE76S5B.js";function h(r){return r==null||typeof r!="object"&&typeof r!="function"}function d(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}var F="[object RegExp]",O="[object String]",B="[object Number]",S="[object Boolean]",I="[object Arguments]",j="[object Symbol]",T="[object Date]",z="[object Map]",_="[object Set]",v="[object Array]";var U="[object ArrayBuffer]",k="[object Object]";var H="[object DataView]",q="[object Uint8Array]",K="[object Uint8ClampedArray]",V="[object Uint16Array]",X="[object Uint32Array]";var Y="[object Int8Array]",G="[object Int16Array]",J="[object Int32Array]";var Z="[object Float32Array]",Q="[object Float64Array]";function zr(r){return Array.isArray(r)}function P(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function x(r){return P(r)}function ct(r){if(h(r))return r;let t=d(r);if(!ut(r))return{};if(zr(r)){let e=Array.from(r);return r.length>0&&typeof r[0]=="string"&&Object.hasOwn(r,"index")&&(e.index=r.index,e.input=r.input),e}if(x(r)){let e=r,n=e.constructor;return new n(e.buffer,e.byteOffset,e.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(r.byteLength);if(t==="[object DataView]"){let e=r,n=e.buffer,m=e.byteOffset,o=e.byteLength,f=new ArrayBuffer(o),s=new Uint8Array(n,m,o);return new Uint8Array(f).set(s),new DataView(f)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){let e=r.constructor,n=new e(r.valueOf());return t==="[object String]"?lt(n,r):nr(n,r),n}if(t==="[object Date]")return new Date(Number(r));if(t==="[object RegExp]"){let e=r,n=new RegExp(e.source,e.flags);return n.lastIndex=e.lastIndex,n}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(r));if(t==="[object Map]"){let e=r,n=new Map;return e.forEach((m,o)=>{n.set(o,m)}),n}if(t==="[object Set]"){let e=r,n=new Set;return e.forEach(m=>{n.add(m)}),n}if(t==="[object Arguments]"){let e=r,n={};return nr(n,e),n.length=e.length,n[Symbol.iterator]=e[Symbol.iterator],n}let i={};return gt(i,r),nr(i,r),yt(i,r),i}function ut(r){switch(d(r)){case I:case v:case U:case H:case S:case T:case Z:case Q:case Y:case G:case J:case z:case B:case k:case F:case _:case O:case j:case q:case K:case V:case X:return!0;default:return!1}}function nr(r,t){for(let i in t)Object.hasOwn(t,i)&&(r[i]=t[i])}function yt(r,t){let i=Object.getOwnPropertySymbols(t);for(let e=0;e<i.length;e++){let n=i[e];Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}}function lt(r,t){let i=t.valueOf().length;for(let e in t)Object.hasOwn(t,e)&&(Number.isNaN(Number(e))||Number(e)>=i)&&(r[e]=t[e])}function gt(r,t){let i=Object.getPrototypeOf(t);i!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(r,i)}var mr=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function M(r){return typeof mr.Buffer<"u"&&mr.Buffer.isBuffer(r)}function _r(r){return Number.isSafeInteger(r)&&r>=0}function C(r){return r!=null&&typeof r!="function"&&_r(r.length)}function L(r){return r!==null&&typeof r=="object"&&d(r)==="[object Arguments]"}function vr(r){let t=r?.constructor;return r===(typeof t=="function"?t.prototype:Object.prototype)}function dt(r){if(r==null)return!0;if(C(r))return typeof r.splice!="function"&&typeof r!="string"&&!M(r)&&!x(r)&&!L(r)?!1:r.length===0;if(typeof r=="object"||typeof r=="function"){if(r instanceof Map||r instanceof Set)return r.size===0;let t=Object.keys(r);return vr(r)?t.filter(i=>i!=="constructor").length===0:t.length===0}return!0}function rr(r){if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){let i=r[Symbol.toStringTag];return i==null||!Object.getOwnPropertyDescriptor(r,Symbol.toStringTag)?.writable?!1:r.toString()===`[object ${i}]`}let t=r;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(r)===t}function Ur(){}function tr(r){return Object.getOwnPropertySymbols(r).filter(t=>Object.prototype.propertyIsEnumerable.call(r,t))}function kr(r){return r==="__proto__"}function Hr(r,t){return W(r,void 0,r,new Map,t)}function W(r,t,i,e=new Map,n=void 0){let m=n?.(r,t,i,e);if(m!==void 0)return m;if(h(r))return r;if(e.has(r))return e.get(r);if(Array.isArray(r)){let o=new Array(r.length);e.set(r,o);for(let f=0;f<r.length;f++)o[f]=W(r[f],f,i,e,n);return Object.hasOwn(r,"index")&&(o.index=r.index),Object.hasOwn(r,"input")&&(o.input=r.input),o}if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp){let o=new RegExp(r.source,r.flags);return o.lastIndex=r.lastIndex,o}if(r instanceof Map){let o=new Map;e.set(r,o);for(let[f,s]of r)o.set(f,W(s,f,i,e,n));return o}if(r instanceof Set){let o=new Set;e.set(r,o);for(let f of r)o.add(W(f,void 0,i,e,n));return o}if(M(r))return r.subarray();if(P(r)){let o=new(Object.getPrototypeOf(r)).constructor(r.length);e.set(r,o);for(let f=0;f<r.length;f++)o[f]=W(r[f],f,i,e,n);return o}if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer)return r.slice(0);if(r instanceof DataView){let o=new DataView(r.buffer.slice(0),r.byteOffset,r.byteLength);return e.set(r,o),u(o,r,i,e,n),o}if(typeof File<"u"&&r instanceof File){let o=new File([r],r.name,{type:r.type});return e.set(r,o),u(o,r,i,e,n),o}if(typeof Blob<"u"&&r instanceof Blob){let o=new Blob([r],{type:r.type});return e.set(r,o),u(o,r,i,e,n),o}if(r instanceof Error){let o=structuredClone(r);return e.set(r,o),o.message=r.message,o.name=r.name,o.stack=r.stack,o.cause=r.cause,o.constructor=r.constructor,u(o,r,i,e,n),o}if(r instanceof Boolean){let o=new Boolean(r.valueOf());return e.set(r,o),u(o,r,i,e,n),o}if(r instanceof Number){let o=new Number(r.valueOf());return e.set(r,o),u(o,r,i,e,n),o}if(r instanceof String){let o=new String(r.valueOf());return e.set(r,o),u(o,r,i,e,n),o}if(typeof r=="object"&&ht(r)){let o=Object.create(Object.getPrototypeOf(r));return e.set(r,o),u(o,r,i,e,n),o}return r}function u(r,t,i=r,e,n){let m=[...Object.keys(t),...tr(t)];for(let o=0;o<m.length;o++){let f=m[o],s=Object.getOwnPropertyDescriptor(r,f);(s==null||s.writable)&&(r[f]=W(t[f],f,i,e,n))}}function ht(r){switch(d(r)){case I:case v:case U:case H:case S:case T:case Z:case Q:case Y:case G:case J:case z:case B:case k:case F:case _:case O:case j:case q:case K:case V:case X:return!0;default:return!1}}function qr(r,t){return Hr(r,(i,e,n,m)=>{let o=t?.(i,e,n,m);if(o!==void 0)return o;if(typeof r=="object"){if(d(r)==="[object Object]"&&typeof r.constructor!="function"){let f={};return m.set(r,f),u(f,r,n,m),f}switch(Object.prototype.toString.call(r)){case B:case O:case S:{let f=new r.constructor(r?.valueOf());return u(f,r),f}case I:{let f={};return u(f,r),f.length=r.length,f[Symbol.iterator]=r[Symbol.iterator],f}default:return}}})}function fr(r){return qr(r)}function D(r){return typeof r=="object"&&r!==null}function Kr(r){return D(r)&&C(r)}function b(r,t){if(typeof r!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");let i=function(...e){let n=t?t.apply(this,e):e[0],m=i.cache;if(m.has(n))return m.get(n);let o=r.apply(this,e);return i.cache=m.set(n,o)||m,o};return i.cache=new(b.Cache||Map),i}b.Cache=Map;function Vr(r){if(h(r))return r;if(Array.isArray(r)||P(r)||r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer)return r.slice(0);let t=Object.getPrototypeOf(r);if(t==null)return Object.assign(Object.create(t),r);let i=t.constructor;if(r instanceof Date||r instanceof Map||r instanceof Set)return new i(r);if(r instanceof RegExp){let e=new i(r);return e.lastIndex=r.lastIndex,e}if(r instanceof DataView)return new i(r.buffer.slice(0));if(r instanceof Error){let e;return r instanceof AggregateError?e=new i(r.errors,r.message,{cause:r.cause}):e=new i(r.message,{cause:r.cause}),e.stack=r.stack,Object.assign(e,r),e}return typeof File<"u"&&r instanceof File?new i([r],r.name,{type:r.type,lastModified:r.lastModified}):typeof r=="object"?Object.assign(Object.create(t),r):r}function Xr(r,...t){let i=t.slice(0,-1),e=t[t.length-1],n=r;for(let m=0;m<i.length;m++){let o=i[m];n=er(n,o,e,new Map)}return n}function er(r,t,i,e){if(h(r)&&(r=Object(r)),t==null||typeof t!="object")return r;if(e.has(t))return Vr(e.get(t));if(e.set(t,r),Array.isArray(t)){t=t.slice();for(let m=0;m<t.length;m++)m in t||(t[m]=void 0)}let n=[...Object.keys(t),...tr(t)];for(let m=0;m<n.length;m++){let o=n[m];if(kr(o))continue;let f=t[o],s=r[o];if(L(f)&&(f={...f}),L(s)&&(s={...s}),M(f)&&(f=fr(f)),Array.isArray(f))if(Array.isArray(s)){let y=[],c=Reflect.ownKeys(s);for(let g=0;g<c.length;g++){let l=c[g];y[l]=s[l]}s=y}else if(Kr(s)){let y=[];for(let c=0;c<s.length;c++)y[c]=s[c];s=y}else s=[];let p=i(s,f,o,r,t,e);p!==void 0?r[o]=p:Array.isArray(f)||D(s)&&D(f)&&(rr(s)||rr(f)||x(s)||x(f))?r[o]=er(s,f,i,e):s==null&&rr(f)?r[o]=er({},f,i,e):s==null&&x(f)?r[o]=fr(f):(s===void 0||f!==void 0)&&(r[o]=f)}return r}function sr(r,...t){return Xr(r,...t,Ur)}var Jr=at(pt(),1);var xt="\u200B",bt={curveBasis:wr,curveBasisClosed:Or,curveBasisOpen:Br,curveBumpX:br,curveBumpY:Ar,curveBundle:Sr,curveCardinalClosed:Pr,curveCardinalOpen:Mr,curveCardinal:Ir,curveCatmullRomClosed:Er,curveCatmullRomOpen:Lr,curveCatmullRom:Wr,curveLinear:xr,curveLinearClosed:Dr,curveMonotoneX:$r,curveMonotoneY:Rr,curveNatural:Nr,curveStep:Fr,curveStepAfter:Tr,curveStepBefore:jr},At=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,wt=a(function(r,t){let i=Zr(r,/(?:init\b)|(?:initialize\b)/),e={};if(Array.isArray(i)){let o=i.map(f=>f.args);gr(o),e=or(e,[...o])}else e=i.args;if(!e)return;let n=dr(r,t),m="config";return e[m]!==void 0&&(n==="flowchart-v2"&&(n="flowchart"),e[n]=e[m],delete e[m]),e},"detectInit"),Zr=a(function(r,t=null){try{let i=new RegExp(`[%]{2}(?![{]${At.source})(?=[}][%]{2}).*
|
|
2
|
+
`,"ig");r=r.trim().replace(i,"").replace(/'/gm,'"'),w.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${r}`);let e,n=[];for(;(e=E.exec(r))!==null;)if(e.index===E.lastIndex&&E.lastIndex++,e&&!t||t&&e[1]?.match(t)||t&&e[2]?.match(t)){let m=e[1]?e[1]:e[2],o=e[3]?e[3].trim():e[4]?JSON.parse(e[4].trim()):null;n.push({type:m,args:o})}return n.length===0?{type:r,args:null}:n.length===1?n[0]:n}catch(i){return w.error(`ERROR: ${i.message} - Unable to parse directive type: '${t}' based on the text: '${r}'`),{type:void 0,args:null}}},"detectDirective"),mi=a(function(r){return r.replace(E,"")},"removeDirectives"),Ot=a(function(r,t){for(let[i,e]of t.entries())if(e.match(r))return i;return-1},"isSubstringInArray");function Qr(r,t){if(!r)return t;let i=`curve${r.charAt(0).toUpperCase()+r.slice(1)}`;return bt[i]??t}a(Qr,"interpolateToCurve");function Cr(r,t){let i=r.trim();if(i)return t.securityLevel!=="loose"?(0,Jr.sanitizeUrl)(i):i}a(Cr,"formatUrl");var Bt=a((r,...t)=>{let i=r.split("."),e=i.length-1,n=i[e],m=window;for(let o=0;o<e;o++)if(m=m[i[o]],!m){w.error(`Function name: ${r} not found in window`);return}m[n](...t)},"runFunc");function ar(r,t){return!r||!t?0:Math.sqrt(Math.pow(t.x-r.x,2)+Math.pow(t.y-r.y,2))}a(ar,"distance");function rt(r){let t,i=0;r.forEach(n=>{i+=ar(n,t),t=n});let e=i/2;return pr(r,e)}a(rt,"traverseEdge");function tt(r){return r.length===1?r[0]:rt(r)}a(tt,"calcLabelPosition");var Yr=a((r,t=2)=>{let i=Math.pow(10,t);return Math.round(r*i)/i},"roundNumber"),pr=a((r,t)=>{let i,e=t;for(let n of r){if(i){let m=ar(n,i);if(m===0)return i;if(m<e)e-=m;else{let o=e/m;if(o<=0)return i;if(o>=1)return{x:n.x,y:n.y};if(o>0&&o<1)return{x:Yr((1-o)*i.x+o*n.x,5),y:Yr((1-o)*i.y+o*n.y,5)}}}i=n}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),St=a((r,t,i)=>{w.info(`our points ${JSON.stringify(t)}`),t[0]!==i&&(t=t.reverse());let n=pr(t,25),m=r?10:5,o=Math.atan2(t[0].y-n.y,t[0].x-n.x),f={x:0,y:0};return f.x=Math.sin(o)*m+(t[0].x+n.x)/2,f.y=-Math.cos(o)*m+(t[0].y+n.y)/2,f},"calcCardinalityPosition");function et(r,t,i){let e=structuredClone(i);w.info("our points",e),t!=="start_left"&&t!=="start_right"&&e.reverse();let n=25+r,m=pr(e,n),o=10+r*.5,f=Math.atan2(e[0].y-m.y,e[0].x-m.x),s={x:0,y:0};return t==="start_left"?(s.x=Math.sin(f+Math.PI)*o+(e[0].x+m.x)/2,s.y=-Math.cos(f+Math.PI)*o+(e[0].y+m.y)/2):t==="end_right"?(s.x=Math.sin(f-Math.PI)*o+(e[0].x+m.x)/2-5,s.y=-Math.cos(f-Math.PI)*o+(e[0].y+m.y)/2-5):t==="end_left"?(s.x=Math.sin(f)*o+(e[0].x+m.x)/2-5,s.y=-Math.cos(f)*o+(e[0].y+m.y)/2-5):(s.x=Math.sin(f)*o+(e[0].x+m.x)/2,s.y=-Math.cos(f)*o+(e[0].y+m.y)/2),s}a(et,"calcTerminalLabelPosition");function it(r){let t="",i="";for(let e of r)e!==void 0&&(e.startsWith("color:")||e.startsWith("text-align:")?i=i+e+";":t=t+e+";");return{style:t,labelStyle:i}}a(it,"getStylesFromArray");var Gr=0,It=a(()=>(Gr++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Gr),"generateId");function ot(r){let t="",i="0123456789abcdef",e=i.length;for(let n=0;n<r;n++)t+=i.charAt(Math.floor(Math.random()*e));return t}a(ot,"makeRandomHex");var Pt=a(r=>ot(r.length),"random"),Mt=a(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),Wt=a(function(r,t){let i=t.text.replace(N.lineBreakRegex," "),[,e]=ur(t.fontSize),n=r.append("text");n.attr("x",t.x),n.attr("y",t.y),n.style("text-anchor",t.anchor),n.style("font-family",t.fontFamily),n.style("font-size",e),n.style("font-weight",t.fontWeight),n.attr("fill",t.fill),t.class!==void 0&&n.attr("class",t.class);let m=n.append("tspan");return m.attr("x",t.x+t.textMargin*2),m.attr("fill",t.fill),m.text(i),n},"drawSimpleText"),Et=b((r,t,i)=>{if(!r||(i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},i),N.lineBreakRegex.test(r)))return r;let e=r.split(" ").filter(Boolean),n=[],m="";return e.forEach((o,f)=>{let s=$(`${o} `,i),p=$(m,i);if(s>t){let{hyphenatedStrings:g,remainingWord:l}=Lt(o,t,"-",i);n.push(m,...g),m=l}else p+s>=t?(n.push(m),m=o):m=[m,o].filter(Boolean).join(" ");f+1===e.length&&n.push(m)}),n.filter(o=>o!=="").join(i.joinWith)},(r,t,i)=>`${r}${t}${i.fontSize}${i.fontWeight}${i.fontFamily}${i.joinWith}`),Lt=b((r,t,i="-",e)=>{e=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},e);let n=[...r],m=[],o="";return n.forEach((f,s)=>{let p=`${o}${f}`;if($(p,e)>=t){let c=s+1,g=n.length===c,l=`${p}${i}`;m.push(g?p:l),o=""}else o=p}),{hyphenatedStrings:m,remainingWord:o}},(r,t,i="-",e)=>`${r}${t}${i}${e.fontSize}${e.fontWeight}${e.fontFamily}`);function nt(r,t){return cr(r,t).height}a(nt,"calculateTextHeight");function $(r,t){return cr(r,t).width}a($,"calculateTextWidth");var cr=b((r,t)=>{let{fontSize:i=12,fontFamily:e="Arial",fontWeight:n=400}=t;if(!r)return{width:0,height:0};let[,m]=ur(i),o=["sans-serif",e],f=r.split(N.lineBreakRegex),s=[],p=hr("body");if(!p.remove)return{width:0,height:0,lineHeight:0};let y=p.append("svg");for(let g of o){let l=0,A={width:0,height:0,lineHeight:0};for(let st of f){let yr=Mt();yr.text=st||xt;let lr=Wt(y,yr).style("font-size",m).style("font-weight",n).style("font-family",g),R=(lr._groups||lr)[0][0].getBBox();if(R.width===0&&R.height===0)throw new Error("svg element not in render tree");A.width=Math.round(Math.max(A.width,R.width)),l=Math.round(R.height),A.height+=l,A.lineHeight=Math.round(Math.max(A.lineHeight,l))}s.push(A)}y.remove();let c=isNaN(s[1].height)||isNaN(s[1].width)||isNaN(s[1].lineHeight)||s[0].height>s[1].height&&s[0].width>s[1].width&&s[0].lineHeight>s[1].lineHeight?0:1;return s[c]},(r,t)=>`${r}${t.fontSize}${t.fontWeight}${t.fontFamily}`),Dt=class{constructor(r=!1,t){this.count=0,this.count=t?t.length:0,this.next=r?()=>this.count++:()=>Date.now()}static{a(this,"InitIDGenerator")}},ir,$t=a(function(r){return ir=ir||document.createElement("div"),r=escape(r).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),ir.innerHTML=r,unescape(ir.textContent)},"entityDecode");function Rt(r){return"str"in r}a(Rt,"isDetailedError");var Nt=a((r,t,i,e)=>{if(!e)return;let n=r.node()?.getBBox();n&&r.append("text").text(e).attr("text-anchor","middle").attr("x",n.x+n.width/2).attr("y",-i).attr("class",t)},"insertTitle"),ur=a(r=>{if(typeof r=="number")return[r,r+"px"];let t=parseInt(r??"",10);return Number.isNaN(t)?[void 0,void 0]:r===String(t)?[t,r+"px"]:[t,r]},"parseFontSize");function mt(r,t){return sr({},r,t)}a(mt,"cleanAndMerge");var fi={assignWithDepth:or,wrapLabel:Et,calculateTextHeight:nt,calculateTextWidth:$,calculateTextDimensions:cr,cleanAndMerge:mt,detectInit:wt,detectDirective:Zr,isSubstringInArray:Ot,interpolateToCurve:Qr,calcLabelPosition:tt,calcCardinalityPosition:St,calcTerminalLabelPosition:et,formatUrl:Cr,getStylesFromArray:it,generateId:It,random:Pt,runFunc:Bt,entityDecode:$t,insertTitle:Nt,isLabelCoordinateInPath:ft,parseFontSize:ur,InitIDGenerator:Dt},si=a(function(r){let t=r;return t=t.replace(/style.*:\S*#.*;/g,function(i){return i.substring(0,i.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(i){return i.substring(0,i.length-1)}),t=t.replace(/#\w+;/g,function(i){let e=i.substring(1,i.length-1);return/^\+?\d+$/.test(e)?"\uFB02\xB0\xB0"+e+"\xB6\xDF":"\uFB02\xB0"+e+"\xB6\xDF"}),t},"encodeEntities"),ai=a(function(r){return r.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),pi=a((r,t,{counter:i=0,prefix:e,suffix:n},m)=>m||`${e?`${e}_`:""}${r}_${t}_${i}${n?`_${n}`:""}`,"getEdgeId");function Ft(r){return r??null}a(Ft,"handleUndefinedAttr");function ft(r,t){let i=Math.round(r.x),e=Math.round(r.y),n=t.replace(/(\d+\.\d+)/g,m=>Math.round(parseFloat(m)).toString());return n.includes(i.toString())||n.includes(e.toString())}a(ft,"isLabelCoordinateInPath");export{ct as a,dt as b,xt as c,mi as d,Qr as e,it as f,It as g,Pt as h,Et as i,nt as j,$ as k,cr as l,Rt as m,ur as n,mt as o,fi as p,si as q,ai as r,pi as s,Ft as t};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import{a as $e}from"./chunk-H2KMMTJB.js";import{b as Xe,c as Je}from"./chunk-XLLPZ2WO.js";import{a as et}from"./chunk-RVAIT6JW.js";import"./chunk-MVYC3CY4.js";import"./chunk-XBZAO4ID.js";import"./chunk-PZCGBYVO.js";import"./chunk-CK7M2PJ3.js";import"./chunk-44KDLLKJ.js";import"./chunk-JFT2LC2T.js";import"./chunk-AUSLTP43.js";import"./chunk-GLU2YQV2.js";import{p as He,s as Qe}from"./chunk-6DWWYA6G.js";import"./chunk-VJLIWNIU.js";import{M as Ye,S as Pe,T as ze,U as Ue,V as Ke,W as Ze,X as je,Y as qe,Z as U,a as Ge,b as Fe}from"./chunk-LWDL4HZB.js";import"./chunk-VXPNUNUX.js";import{b as A,h as We}from"./chunk-JR4SIX7A.js";import{a as d,b as Be}from"./chunk-5FIPUNR4.js";import"./chunk-SQE76S5B.js";var Oe=(function(){var t=d(function(M,a,o,h){for(o=o||{},h=M.length;h--;o[M[h]]=a);return o},"o"),n=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],u=[2,2],r=[1,7],l=[1,9],f=[1,10],_=[1,11],p=[1,12],S=[1,30],b=[1,23],k=[1,24],x=[1,25],B=[1,26],Y=[1,27],m=[1,19],I=[1,28],K=[1,29],N=[1,20],R=[1,18],v=[1,21],D=[1,22],xe=[2,6],c=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],de=[1,36],be=[1,37],pe=[1,38],fe=[1,39],ke=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],L=[1,46],w=[1,47],j=[1,57],q=[43,51,53,54,55,74,75],W=[1,70],H=[1,68],V=[1,65],Q=[1,69],X=[1,71],ee=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],te=[1,78],se=[1,77],ie=[1,76],Ne=[69,70,71,72,73],Ce=[1,91],Ae=[6,9,45,50],P=[6,9,12,44,45,50,51,52],re=[1,101],ae=[1,100],ne=[1,99],J=[18,61],Ie=[1,110],Re=[1,109],ve=[20,43,51,53,54,55],ge=[18,61,64,66],ye={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:d(function(a,o,h,i,g,e,$){var s=e.length-1;switch(g){case 1:break;case 2:this.$=[];break;case 3:this.$=e[s-1].concat(e[s]);break;case 4:this.$=e[s];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(e[s-4]),i.addEntity(e[s-2]),i.addRelationship(e[s-4],e[s],e[s-2],e[s-3]),this.$=[e[s-4],e[s-2]];break;case 8:i.addEntity(e[s-8]),i.addEntity(e[s-4]),i.addRelationship(e[s-8],e[s],e[s-4],e[s-5]),i.setClass([e[s-8]],e[s-6]),i.setClass([e[s-4]],e[s-2]),this.$=[e[s-8],e[s-4]];break;case 9:i.addEntity(e[s-6]),i.addEntity(e[s-2]),i.addRelationship(e[s-6],e[s],e[s-2],e[s-3]),i.setClass([e[s-6]],e[s-4]),this.$=[e[s-6],e[s-2]];break;case 10:i.addEntity(e[s-6]),i.addEntity(e[s-4]),i.addRelationship(e[s-6],e[s],e[s-4],e[s-5]),i.setClass([e[s-4]],e[s-2]),this.$=[e[s-6],e[s-4]];break;case 11:i.addEntity(e[s-3]),i.addAttributes(e[s-3],e[s-1]),this.$=[e[s-3]];break;case 12:i.addEntity(e[s-5]),i.addAttributes(e[s-5],e[s-1]),i.setClass([e[s-5]],e[s-3]),this.$=[e[s-5]];break;case 13:i.addEntity(e[s-2]),this.$=[e[s-2]];break;case 14:i.addEntity(e[s-4]),i.setClass([e[s-4]],e[s-2]),this.$=[e[s-4]];break;case 15:i.addEntity(e[s]),this.$=[e[s]];break;case 16:i.addEntity(e[s-2]),i.setClass([e[s-2]],e[s]),this.$=[e[s-2]];break;case 17:i.addEntity(e[s-6],e[s-4]),i.addAttributes(e[s-6],e[s-1]),this.$=[e[s-6]];break;case 18:i.addEntity(e[s-8],e[s-6]),i.addAttributes(e[s-8],e[s-1]),i.setClass([e[s-8]],e[s-3]),this.$=[e[s-8]];break;case 19:i.addEntity(e[s-5],e[s-3]),this.$=[e[s-5]];break;case 20:i.addEntity(e[s-7],e[s-5]),i.setClass([e[s-7]],e[s-2]),this.$=[e[s-7]];break;case 21:i.addEntity(e[s-3],e[s-1]);break;case 22:i.addEntity(e[s-5],e[s-3]),i.setClass([e[s-5]],e[s]);break;case 23:case 24:this.$=e[s].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=e[s].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=e[s]:(i.setDirection(e[s].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:e[s-2].id},e[s-1],{text:e[s-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:e[s-1],text:e[s-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:e[s-4],text:e[s-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=e[s];break;case 35:this.$=e[s-1]+" "+e[s];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=e[s-3],i.addClass(e[s-2],e[s-1]);break;case 41:case 42:case 63:case 72:this.$=[e[s]];break;case 43:case 44:this.$=e[s-2].concat([e[s]]);break;case 45:this.$=e[s-2],i.setClass(e[s-1],e[s]);break;case 46:this.$=e[s-3],i.addCssStyles(e[s-2],e[s-1]);break;case 47:this.$=[e[s]];break;case 48:e[s-2].push(e[s]),this.$=e[s-2];break;case 50:this.$=e[s-1]+e[s];break;case 58:case 84:case 85:this.$=e[s].replace(/"/g,"");break;case 64:e[s].push(e[s-1]),this.$=e[s];break;case 65:this.$={type:e[s-1],name:e[s]};break;case 66:this.$={type:e[s-2],name:e[s-1],keys:e[s]};break;case 67:this.$={type:e[s-2],name:e[s-1],comment:e[s]};break;case 68:this.$={type:e[s-3],name:e[s-2],keys:e[s-1],comment:e[s]};break;case 69:case 71:case 74:this.$=e[s];break;case 70:this.$=e[s-1]+e[s];break;case 73:e[s-2].push(e[s]),this.$=e[s-2];break;case 75:this.$=e[s].replace(/"/g,"");break;case 76:this.$={cardA:e[s],relType:e[s-1],cardB:e[s-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(n,u,{5:3}),{6:[1,4],7:5,8:6,9:r,10:8,21:l,23:f,25:_,27:p,28:13,29:14,30:15,31:16,32:17,34:S,37:b,38:k,39:x,40:B,41:Y,43:m,46:I,47:K,51:N,53:R,54:v,55:D},t(n,xe,{1:[2,1]}),t(c,[2,3]),t(c,[2,4]),t(c,[2,5]),t(c,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:de,70:be,71:pe,72:fe,73:ke}),{22:[1,41]},{24:[1,42]},{26:[1,43]},t(c,[2,26]),t(c,[2,27]),t(c,[2,28]),t(c,[2,29]),t(c,[2,30]),t(c,u,{5:44}),t(Z,[2,58]),t(Z,[2,59]),t(Z,[2,60]),t(Z,[2,61]),t(Z,[2,62]),t(c,[2,36]),t(c,[2,37]),t(c,[2,38]),t(c,[2,39]),{15:45,43:L,44:w},{15:48,43:L,44:w},{15:49,43:L,44:w},{10:50,43:m,51:N,53:R,54:v,55:D},{10:51,43:m,51:N,53:R,54:v,55:D},{15:52,43:L,44:w},{17:53,18:[1,54],56:55,57:56,61:j},{10:58,43:m,51:N,53:R,54:v,55:D},{68:59,74:[1,60],75:[1,61]},t(q,[2,77]),t(q,[2,78]),t(q,[2,79]),t(q,[2,80]),t(q,[2,81]),t(c,[2,23]),t(c,[2,24]),t(c,[2,25]),{6:[1,63],7:5,8:6,9:r,10:8,21:l,23:f,25:_,27:p,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:S,37:b,38:k,39:x,40:B,41:Y,43:m,46:I,47:K,51:N,53:R,54:v,55:D},{12:W,42:64,44:H,45:V,48:66,49:67,51:Q,52:X},t(ee,[2,41]),t(ee,[2,42]),{15:72,43:L,44:w,45:V},{12:W,42:73,44:H,45:V,48:66,49:67,51:Q,52:X},{6:te,9:se,19:[1,75],35:74,50:ie},{12:[1,79],14:[1,80]},t(c,[2,16],{67:35,11:81,16:[1,82],45:V,69:de,70:be,71:pe,72:fe,73:ke}),{18:[1,83]},t(c,[2,13]),{17:84,18:[2,63],56:55,57:56,61:j},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:de,70:be,71:pe,72:fe,73:ke},t(Ne,[2,82]),t(Ne,[2,83]),t(c,[2,31]),t(c,xe),{6:te,9:se,35:90,45:Ce,50:ie},{43:[1,92],44:[1,93]},t(Ae,[2,47],{49:94,12:W,44:H,51:Q,52:X}),t(P,[2,49]),t(P,[2,54]),t(P,[2,55]),t(P,[2,56]),t(P,[2,57]),t(c,[2,45],{45:V}),{6:te,9:se,35:95,45:Ce,50:ie},t(c,[2,32]),{10:97,36:96,43:m,51:N,53:R,54:v,55:D},t(c,[2,51]),t(c,[2,52]),t(c,[2,53]),{13:98,43:re,53:ae,76:ne},{15:102,43:L,44:w},{10:103,43:m,51:N,53:R,54:v,55:D},{17:104,18:[1,105],56:55,57:56,61:j},t(c,[2,11]),{18:[2,64]},t(J,[2,65],{59:106,60:107,63:108,65:Ie,66:Re}),t([18,61,65,66],[2,71]),{61:[2,70]},t(c,[2,21],{14:[1,112],16:[1,111]}),t([43,51,53,54,55],[2,76]),t(c,[2,40]),{12:W,44:H,48:113,49:67,51:Q,52:X},t(ee,[2,43]),t(ee,[2,44]),t(P,[2,50]),t(c,[2,46]),{10:115,20:[1,114],43:m,51:N,53:R,54:v,55:D},t(ve,[2,34]),t(c,[2,7]),t(c,[2,84]),t(c,[2,85]),t(c,[2,86]),{12:[1,116],45:V},{12:[1,118],14:[1,117]},{18:[1,119]},t(c,[2,14]),t(J,[2,66],{60:120,64:[1,121],66:Re}),t(J,[2,67]),t(ge,[2,72]),t(J,[2,75]),t(ge,[2,74]),{17:122,18:[1,123],56:55,57:56,61:j},{15:124,43:L,44:w},t(Ae,[2,48],{49:94,12:W,44:H,51:Q,52:X}),{6:te,9:se,35:125,50:ie},t(ve,[2,35]),{13:126,43:re,53:ae,76:ne},{15:127,43:L,44:w},{13:128,43:re,53:ae,76:ne},t(c,[2,12]),t(J,[2,68]),{63:129,65:Ie},{18:[1,130]},t(c,[2,19]),t(c,[2,22],{16:[1,131],45:V}),t(c,[2,33]),t(c,[2,10]),{12:[1,132],45:V},t(c,[2,9]),t(ge,[2,73]),t(c,[2,17]),{17:133,18:[1,134],56:55,57:56,61:j},{13:135,43:re,53:ae,76:ne},{18:[1,136]},t(c,[2,20]),t(c,[2,8]),t(c,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:d(function(a,o){if(o.recoverable)this.trace(a);else{var h=new Error(a);throw h.hash=o,h}},"parseError"),parse:d(function(a){var o=this,h=[0],i=[],g=[null],e=[],$=this.table,s="",le=0,De=0,Le=0,rt=2,we=1,at=e.slice.call(arguments,1),y=Object.create(this.lexer),G={yy:{}};for(var _e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_e)&&(G.yy[_e]=this.yy[_e]);y.setInput(a,G.yy),G.yy.lexer=y,G.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var me=y.yylloc;e.push(me);var nt=y.options&&y.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ot(T){h.length=h.length-2*T,g.length=g.length-T,e.length=e.length-T}d(ot,"popStack");function Ve(){var T;return T=i.pop()||y.lex()||we,typeof T!="number"&&(T instanceof Array&&(i=T,T=i.pop()),T=o.symbols_[T]||T),T}d(Ve,"lex");for(var E,Ee,F,O,pt,Se,z={},ce,C,Me,he;;){if(F=h[h.length-1],this.defaultActions[F]?O=this.defaultActions[F]:((E===null||typeof E>"u")&&(E=Ve()),O=$[F]&&$[F][E]),typeof O>"u"||!O.length||!O[0]){var Te="";he=[];for(ce in $[F])this.terminals_[ce]&&ce>rt&&he.push("'"+this.terminals_[ce]+"'");y.showPosition?Te="Parse error on line "+(le+1)+`:
|
|
2
|
+
`+y.showPosition()+`
|
|
3
|
+
Expecting `+he.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Te="Parse error on line "+(le+1)+": Unexpected "+(E==we?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Te,{text:y.match,token:this.terminals_[E]||E,line:y.yylineno,loc:me,expected:he})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+F+", token: "+E);switch(O[0]){case 1:h.push(E),g.push(y.yytext),e.push(y.yylloc),h.push(O[1]),E=null,Ee?(E=Ee,Ee=null):(De=y.yyleng,s=y.yytext,le=y.yylineno,me=y.yylloc,Le>0&&Le--);break;case 2:if(C=this.productions_[O[1]][1],z.$=g[g.length-C],z._$={first_line:e[e.length-(C||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(C||1)].first_column,last_column:e[e.length-1].last_column},nt&&(z._$.range=[e[e.length-(C||1)].range[0],e[e.length-1].range[1]]),Se=this.performAction.apply(z,[s,De,le,G.yy,O[1],g,e].concat(at)),typeof Se<"u")return Se;C&&(h=h.slice(0,-1*C*2),g=g.slice(0,-1*C),e=e.slice(0,-1*C)),h.push(this.productions_[O[1]][0]),g.push(z.$),e.push(z._$),Me=$[h[h.length-2]][h[h.length-1]],h.push(Me);break;case 3:return!0}}return!0},"parse")},it=(function(){var M={EOF:1,parseError:d(function(o,h){if(this.yy.parser)this.yy.parser.parseError(o,h);else throw new Error(o)},"parseError"),setInput:d(function(a,o){return this.yy=o||this.yy||{},this._input=a,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:d(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var o=a.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:d(function(a){var o=a.length,h=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var i=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),h.length-1&&(this.yylineno-=h.length-1);var g=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:h?(h.length===i.length?this.yylloc.first_column:0)+i[i.length-h.length].length-h[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[g[0],g[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(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).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(a){this.unput(this.match.slice(a))},"less"),pastInput:d(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var a=this.pastInput(),o=new Array(a.length+1).join("-");return a+this.upcomingInput()+`
|
|
5
|
+
`+o+"^"},"showPosition"),test_match:d(function(a,o){var h,i,g;if(this.options.backtrack_lexer&&(g={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&&(g.yylloc.range=this.yylloc.range.slice(0))),i=a[0].match(/(?:\r\n?|\n).*/g),i&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,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(a[0].length),this.matched+=a[0],h=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var e in g)this[e]=g[e];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,o,h,i;this._more||(this.yytext="",this.match="");for(var g=this._currentRules(),e=0;e<g.length;e++)if(h=this._input.match(this.rules[g[e]]),h&&(!o||h[0].length>o[0].length)){if(o=h,i=e,this.options.backtrack_lexer){if(a=this.test_match(h,g[e]),a!==!1)return a;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(a=this.test_match(o,g[i]),a!==!1?a:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var o=this.next();return o||this.lex()},"lex"),begin:d(function(o){this.conditionStack.push(o)},"begin"),popState:d(function(){var o=this.conditionStack.length-1;return o>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(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:d(function(o){return o=this.conditionStack.length-1-Math.abs(o||0),o>=0?this.conditionStack[o]:"INITIAL"},"topState"),pushState:d(function(o){this.begin(o)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(o,h,i,g){var e=g;switch(i){case 0:return this.begin("acc_title"),23;break;case 1:return this.popState(),"acc_title_value";break;case 2:return this.begin("acc_descr"),25;break;case 3:return this.popState(),"acc_descr_value";break;case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin("block"),16;break;case 17:return 52;case 18:return 52;case 19:return 45;case 20:return 14;case 21:return 12;case 22:break;case 23:return 65;case 24:return 61;case 25:return 61;case 26:this.begin("block_bq");break;case 27:return 61;case 28:this.popState();break;case 29:return 66;case 30:break;case 31:return this.popState(),18;break;case 32:return h.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin("style"),47;break;case 36:return this.popState(),9;break;case 37:break;case 38:return 12;case 39:return 45;case 40:return 52;case 41:return this.begin("style"),41;break;case 42:return 46;case 43:return 34;case 44:return 33;case 45:return 69;case 46:return 71;case 47:return 71;case 48:return 71;case 49:return 69;case 50:return 69;case 51:return 70;case 52:return 70;case 53:return 70;case 54:return 70;case 55:return 70;case 56:return 71;case 57:return 70;case 58:return 71;case 59:return 72;case 60:return 72;case 61:return 54;case 62:return 72;case 63:return 72;case 64:return 72;case 65:return 55;case 66:return 51;case 67:return 72;case 68:return 69;case 69:return 70;case 70:return 71;case 71:return 73;case 72:return 74;case 73:return 75;case 74:return 75;case 75:return 74;case 76:return 74;case 77:return 74;case 78:return 44;case 79:return 50;case 80:return 43;case 81:return h.yytext[0];case 82:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:subgraph\b)/i,/^(?:end\b\s*)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[36,37,38,39,40,78,79],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82],inclusive:!0}}};return M})();ye.lexer=it;function oe(){this.yy={}}return d(oe,"Parser"),oe.prototype=ye,ye.Parser=oe,new oe})();Oe.parser=Oe;var lt=Oe,ct=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=ze,this.getAccTitle=Ue,this.setAccDescription=Ke,this.getAccDescription=Ze,this.setDiagramTitle=je,this.getDiagramTitle=qe,this.getConfig=d(()=>U().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this),this.addSubGraph=this.addSubGraph.bind(this)}static{d(this,"ErDB")}addEntity(t,n=""){return this.entities.has(t)?!this.entities.get(t)?.alias&&n&&(this.entities.get(t).alias=n,A.info(`Add alias '${n}' to entity '${t}'`)):(this.entities.set(t,{id:`entity-${t}-${this.entities.size}`,label:t,attributes:[],alias:n,shape:"erBox",look:U().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),A.info("Added new entity :",t)),this.entities.get(t)}getEntity(t){return this.entities.get(t)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(t,n){let u=this.addEntity(t),r;for(r=n.length-1;r>=0;r--)n[r].keys||(n[r].keys=[]),n[r].comment||(n[r].comment=""),u.attributes.push(n[r]),A.debug("Added attribute ",n[r].name)}addRelationship(t,n,u,r){let l;if(this.subGraphLookup.has(t))l=t;else{let p=this.addEntity(t);if(!p)return;l=p.id}let f;if(this.subGraphLookup.has(u))f=u;else{let p=this.addEntity(u);if(!p)return;f=p.id}let _={entityA:l,roleA:n,entityB:f,relSpec:r};this.relationships.push(_),A.debug("Added new relationship :",_)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(t){this.direction=t}getCompiledStyles(t){let n=[];for(let u of t){let r=this.classes.get(u);r?.styles&&(n=[...n,...r.styles??[]].map(l=>l.trim())),r?.textStyles&&(n=[...n,...r.textStyles??[]].map(l=>l.trim()))}return n}addCssStyles(t,n){for(let u of t){let r=this.entities.get(u),l=this.subGraphLookup.get(u);if(n){if(r)for(let f of n)r.cssStyles.push(f);if(l){l.cssStyles||(l.cssStyles=[]);for(let f of n)l.cssStyles.push(f)}}}}addClass(t,n){t.forEach(u=>{let r=this.classes.get(u);r===void 0&&(r={id:u,styles:[],textStyles:[]},this.classes.set(u,r)),n&&n.forEach(function(l){if(/color/.exec(l)){let f=l.replace("fill","bgFill");r.textStyles.push(f)}r.styles.push(l)})})}addSubGraph(t,n,u){let r=t.text.trim(),l=u.text,_=d(k=>{let x=new Set,B;return{nodeList:k.filter(m=>{if(m?.stmt)return m.stmt==="dir"&&(B=m.value),!1;if(typeof m!="string")return!1;let I=m.trim();return!I||x.has(I)?!1:(x.add(I),!0)}),dir:B}},"uniq")(n.flat()),p=_.nodeList,S=_.dir;r=r??"subGraph"+this.subCount,l=l||"",l=this.sanitizeText(l),this.subCount=this.subCount+1;let b={id:r,nodes:p,title:l.trim(),classes:[],cssStyles:[],dir:S,labelType:this.sanitizeNodeLabelType(u?.type)};return A.info("Adding",b.id,b.nodes,b.dir),b.nodes=this.makeUniq(b,this.subGraphs).nodes,this.subGraphs.push(b),this.subGraphLookup.set(r,b),r}getSubGraphs(){return this.subGraphs}setClass(t,n){for(let u of t){let r=this.entities.get(u);if(r)for(let f of n)r.cssClasses+=" "+f;let l=this.subGraphLookup.get(u);if(l)for(let f of n)l.classes.push(f)}}subgraphNodeCache(t){let n=new Set;for(let u of t)for(let r of u.nodes)n.add(r);return n}makeUniq(t,n){let u=this.subgraphNodeCache(n),r=[];return t.nodes.forEach((l,f)=>{u.has(l)?A.warn(`Entity '${l}' already belongs to another subgraph and will be ignored`):r.push(t.nodes[f])}),{nodes:r}}sanitizeText(t){return Ye.sanitizeText(t,U())}sanitizeNodeLabelType(t){switch(t){case"markdown":case"string":case"text":return t;default:return"markdown"}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.subgraphDepth=0,Pe()}getData(){let t=[],n=[],u=U(),r=this.getSubGraphs(),l=new Map,f=new Map;for(let b=r.length-1;b>=0;b--){let k=r[b];k.nodes.length>0&&f.set(k.id,!0);for(let x of k.nodes)l.set(x,k.id)}for(let b=r.length-1;b>=0;b--){let k=r[b];t.push({id:k.id,label:k.title,labelStyle:"",labelType:k.labelType,parentId:l.get(k.id),padding:8,cssCompiledStyles:this.getCompiledStyles(k.classes),cssStyles:k.cssStyles,cssClasses:k.classes.join(" "),shape:"rect",dir:k.dir,isGroup:!0,look:u.look})}let _=new Set(r.map(b=>b.id)),p=0;for(let b of this.entities.keys()){if(_.has(b))continue;let k=this.entities.get(b);k&&(k.cssCompiledStyles=this.getCompiledStyles(k.cssClasses.split(" ")),k.colorIndex=p++,t.push({...k,parentId:l.get(b),isGroup:!1}))}let S=0;for(let b of this.relationships){let k={id:Qe(b.entityA,b.entityB,{prefix:"id",counter:S++}),type:"normal",curve:"basis",start:b.entityA,end:b.entityB,label:b.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:b.relSpec.cardB.toLowerCase(),arrowTypeEnd:b.relSpec.cardA.toLowerCase(),pattern:b.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:u.look,labelType:"markdown"};n.push(k)}return{nodes:t,edges:n,other:{},config:u,direction:this.direction}}},st={};Be(st,{draw:()=>ht});var ht=d(async function(t,n,u,r){A.info("REF0:"),A.info("Drawing er diagram (unified)",n);let{securityLevel:l,er:f,layout:_}=U(),p=r.db.getData(),S=$e(n,l);p.type=r.type,p.layoutAlgorithm=Je(_),p.config.flowchart.nodeSpacing=f?.nodeSpacing||140,p.config.flowchart.rankSpacing=f?.rankSpacing||80,p.direction=r.db.getDirection();let{config:b}=p,{look:k}=b;k==="neo"?p.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:p.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],p.diagramId=n,await Xe(p,S),p.layoutAlgorithm==="elk"&&S.select(".edges").lower();let x=S.selectAll('[id*="-background"]');Array.from(x).length>0&&x.each(function(){let Y=We(this),I=Y.attr("id").replace("-background",""),K=S.select(`#${CSS.escape(I)}`);if(!K.empty()){let N=K.attr("transform");Y.attr("transform",N)}});let B=8;He.insertTitle(S,"erDiagramTitleText",f?.titleTopMargin??25,r.db.getDiagramTitle()),et(S,B,"erDiagram",f?.useMaxWidth??!0)},"draw"),tt=d((t,n)=>{let u=Fe,r=u(t,"r"),l=u(t,"g"),f=u(t,"b");return Ge(r,l,f,n)},"fade"),ue=new Set(["redux-color","redux-dark-color"]),ut=d(t=>{let{theme:n,look:u,bkgColorArray:r,borderColorArray:l}=t;if(!ue.has(n))return"";let f=r?.length>0,_="";for(let p=0;p<t.THEME_COLOR_LIMIT;p++)_+=`
|
|
7
|
+
|
|
8
|
+
[data-look="${u}"][data-color-id="color-${p}"].node path {
|
|
9
|
+
stroke: ${l[p]};
|
|
10
|
+
${f?`fill: ${r[p]};`:""}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-look="${u}"][data-color-id="color-${p}"].node rect {
|
|
14
|
+
stroke: ${l[p]};
|
|
15
|
+
${f?`fill: ${r[p]};`:""}
|
|
16
|
+
}
|
|
17
|
+
`;return _},"genColor"),dt=d(t=>{let{look:n,theme:u,erEdgeLabelBackground:r,strokeWidth:l}=t;return`
|
|
18
|
+
${ut(t)}
|
|
19
|
+
.entityBox {
|
|
20
|
+
fill: ${t.mainBkg};
|
|
21
|
+
stroke: ${t.nodeBorder};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.relationshipLabelBox {
|
|
25
|
+
fill: ${t.tertiaryColor};
|
|
26
|
+
opacity: 0.7;
|
|
27
|
+
background-color: ${t.tertiaryColor};
|
|
28
|
+
rect {
|
|
29
|
+
opacity: 0.5;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.labelBkg {
|
|
34
|
+
background-color: ${ue.has(u)&&r?r:tt(t.tertiaryColor,.5)};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.edgeLabel {
|
|
38
|
+
background-color: ${ue.has(u)&&r?r:t.edgeLabelBackground};
|
|
39
|
+
}
|
|
40
|
+
.edgeLabel .label rect {
|
|
41
|
+
fill: ${ue.has(u)&&r?r:t.edgeLabelBackground};
|
|
42
|
+
}
|
|
43
|
+
.edgeLabel .label text {
|
|
44
|
+
fill: ${t.textColor};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.edgeLabel .label {
|
|
48
|
+
fill: ${t.nodeBorder};
|
|
49
|
+
font-size: 14px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.label {
|
|
53
|
+
font-family: ${t.fontFamily};
|
|
54
|
+
color: ${t.nodeTextColor||t.textColor};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.edge-pattern-dashed {
|
|
58
|
+
stroke-dasharray: 8,8;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.node rect,
|
|
62
|
+
.node circle,
|
|
63
|
+
.node ellipse,
|
|
64
|
+
.node polygon
|
|
65
|
+
{
|
|
66
|
+
fill: ${t.mainBkg};
|
|
67
|
+
stroke: ${t.nodeBorder};
|
|
68
|
+
stroke-width: ${n==="neo"?l:"1px"};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.relationshipLine {
|
|
72
|
+
stroke: ${t.lineColor};
|
|
73
|
+
stroke-width: ${n==="neo"?l:"1px"};
|
|
74
|
+
fill: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.marker {
|
|
78
|
+
fill: none !important;
|
|
79
|
+
stroke: ${t.lineColor} !important;
|
|
80
|
+
stroke-width: 1;
|
|
81
|
+
}
|
|
82
|
+
[data-look=neo].labelBkg {
|
|
83
|
+
background-color: ${tt(t.tertiaryColor,.5)};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.cluster rect {
|
|
87
|
+
fill: ${t.clusterBkg??t.mainBkg};
|
|
88
|
+
stroke: ${t.clusterBorder??t.nodeBorder};
|
|
89
|
+
stroke-width: 1px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.cluster text {
|
|
93
|
+
fill: ${t.titleColor??t.textColor};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.cluster-label text {
|
|
97
|
+
fill: ${t.titleColor??t.textColor};
|
|
98
|
+
}
|
|
99
|
+
`},"getStyles"),bt=dt,vt={parser:lt,get db(){return new ct},renderer:st,styles:bt};export{vt as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as _,c as N,d as F}from"./chunk-ESFD2H7N.js";import{a as U}from"./chunk-SDTB3Q65.js";import{C}from"./chunk-EADDJUDC.js";import"./chunk-H2KMMTJB.js";import"./chunk-XLLPZ2WO.js";import"./chunk-RVAIT6JW.js";import"./chunk-MVYC3CY4.js";import"./chunk-XBZAO4ID.js";import"./chunk-PZCGBYVO.js";import"./chunk-U6OCY4ZH.js";import"./chunk-CK7M2PJ3.js";import"./chunk-44KDLLKJ.js";import"./chunk-JFT2LC2T.js";import"./chunk-AUSLTP43.js";import"./chunk-GLU2YQV2.js";import{p as P}from"./chunk-6DWWYA6G.js";import"./chunk-VJLIWNIU.js";import{H as A,M as T,N as G,Z as t}from"./chunk-LWDL4HZB.js";import"./chunk-VXPNUNUX.js";import{H as R,L as W,b as v,h as z}from"./chunk-JR4SIX7A.js";import{a as u}from"./chunk-5FIPUNR4.js";import"./chunk-SQE76S5B.js";var D=u(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),Y=u(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),I=u((e,i)=>{let s=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),g=s.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g.width+2*t().state.padding).attr("height",g.height+2*t().state.padding).attr("rx",t().state.radius),s},"drawSimpleState"),$=u((e,i)=>{let s=u(function(o,w,y){let S=o.append("tspan").attr("x",2*t().state.padding).text(w);y||S.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),p=n.height,h=e.append("text").attr("x",t().state.padding).attr("y",p+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description"),a=!0,d=!0;i.descriptions.forEach(function(o){a||(s(h,o,d),d=!1),a=!1});let m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+p+t().state.dividerMargin/2).attr("y2",t().state.padding+p+t().state.dividerMargin/2).attr("class","descr-divider"),x=h.node().getBBox(),c=Math.max(x.width,n.width);return m.attr("x2",c+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c+2*t().state.padding).attr("height",x.height+p+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),q=u((e,i,s)=>{let g=t().state.padding,n=2*t().state.padding,p=e.node().getBBox(),h=p.width,a=p.x,d=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=d.node().getBBox().width+n,c=Math.max(x,h);c===h&&(c=c+n);let o,w=e.node().getBBox();i.doc,o=a-g,x>h&&(o=(h-c)/2+g),Math.abs(a-w.x)<g&&x>h&&(o=a-(x-h)/2);let y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",s?"alt-composit":"composit").attr("width",c).attr("height",w.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),d.attr("x",o+g),x<=h&&d.attr("x",a+(c-n)/2-x/2+g),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",c).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",c).attr("height",w.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),Z=u(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),j=u((e,i)=>{let s=t().state.forkWidth,g=t().state.forkHeight;if(i.parentId){let n=s;s=g,g=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",s).attr("height",g).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),K=u((e,i,s,g)=>{let n=0,p=g.append("text");p.style("text-anchor","start"),p.attr("class","noteText");let h=e.replace(/\r\n/g,"<br/>");h=h.replace(/\n/g,"<br/>");let a=h.split(T.lineBreakRegex),d=1.25*t().state.noteMargin;for(let m of a){let x=m.trim();if(x.length>0){let c=p.append("tspan");if(c.text(x),d===0){let o=c.node().getBBox();d+=o.height}n+=d,c.attr("x",i+t().state.noteMargin),c.attr("y",s+n+1.25*t().state.noteMargin)}}return{textWidth:p.node().getBBox().width,textHeight:n}},"_drawLongText"),Q=u((e,i)=>{i.attr("class","state-note");let s=i.append("rect").attr("x",0).attr("y",t().state.padding),g=i.append("g"),{textWidth:n,textHeight:p}=K(e,0,0,g);return s.attr("height",p+2*t().state.noteMargin),s.attr("width",n+t().state.noteMargin*2),s},"drawNote"),O=u(function(e,i){let s=i.id,g={id:s,label:i.id,width:0,height:0},n=e.append("g").attr("id",s).attr("class","stateGroup");i.type==="start"&&D(n),i.type==="end"&&Z(n),(i.type==="fork"||i.type==="join")&&j(n,i),i.type==="note"&&Q(i.note.text,n),i.type==="divider"&&Y(n),i.type==="default"&&i.descriptions.length===0&&I(n,i),i.type==="default"&&i.descriptions.length>0&&$(n,i);let p=n.node().getBBox();return g.width=p.width+2*t().state.padding,g.height=p.height+2*t().state.padding,g},"drawState"),J=0,V=u(function(e,i,s){let g=u(function(d){switch(d){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(d=>!Number.isNaN(d.y));let n=i.points,p=R().x(function(d){return d.x}).y(function(d){return d.y}).curve(W),h=e.append("path").attr("d",p(n)).attr("id","edge"+J).attr("class","transition"),a="";if(t().state.arrowMarkerAbsolute&&(a=A(!0)),h.attr("marker-end","url("+a+"#"+g(N.relationType.DEPENDENCY)+"End)"),s.title!==void 0){let d=e.append("g").attr("class","stateLabel"),{x:m,y:x}=P.calcLabelPosition(i.points),c=T.getRows(s.title),o=0,w=[],y=0,S=0;for(let r=0;r<=c.length;r++){let f=d.append("text").attr("text-anchor","middle").text(c[r]).attr("x",m).attr("y",x+o),l=f.node().getBBox();y=Math.max(y,l.width),S=Math.min(S,l.x),v.info(l.x,m,x+o),o===0&&(o=f.node().getBBox().height,v.info("Title height",o,x)),w.push(f)}let k=o*c.length;if(c.length>1){let r=(c.length-1)*o*.5;w.forEach((f,l)=>f.attr("y",x+l*o-r)),k=o*c.length}let M=d.node().getBBox();d.insert("rect",":first-child").attr("class","box").attr("x",m-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),v.info(M)}J++},"drawEdge"),b,L={},tt=u(function(){},"setConf"),et=u(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),at=u(function(e,i,s,g){b=t().state;let n=t().securityLevel,p;n==="sandbox"&&(p=z("#i"+i));let h=n==="sandbox"?z(p.nodes()[0].contentDocument.body):z("body"),a=n==="sandbox"?p.nodes()[0].contentDocument:document;v.debug("Rendering diagram "+e);let d=h.select(`[id='${i}']`);et(d);let m=g.db.getRootDoc(),x=d.append("g").attr("id",i+"-root");X(m,x,void 0,!1,h,a,g);let c=b.padding,o=d.node().getBBox(),w=o.width+c*2,y=o.height+c*2,S=w*1.75;G(d,y,S,b.useMaxWidth),d.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+w+" "+y)},"draw"),it=u(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),X=u((e,i,s,g,n,p,h)=>{let a=new C({compound:!0,multigraph:!0}),d,m=!0;for(d=0;d<e.length;d++)if(e[d].stmt==="relation"){m=!1;break}s?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:m?1:b.edgeLengthFactor,nodeSep:m?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:m?1:b.edgeLengthFactor,nodeSep:m?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});let x=h.db.getStates(),c=h.db.getRelations(),o=Object.keys(x),w=!0;for(let r of o){let f=x[r];s&&(f.parentId=s);let l;if(f.doc){let B=i.append("g").attr("id",f.id).attr("class","stateGroup");if(l=X(f.doc,B,f.id,!g,n,p,h),w){B=q(B,f,g);let E=B.node().getBBox();l.width=E.width,l.height=E.height+b.padding/2,L[f.id]={y:b.compositTitleSize}}else{let E=B.node().getBBox();l.width=E.width,l.height=E.height}}else l=O(i,f,a);if(f.note){let B={descriptions:[],id:f.id+"-note",note:f.note,type:"note"},E=O(i,B,a);f.note.position==="left of"?(a.setNode(l.id+"-note",E),a.setNode(l.id,l)):(a.setNode(l.id,l),a.setNode(l.id+"-note",E)),a.setParent(l.id,l.id+"-group"),a.setParent(l.id+"-note",l.id+"-group")}else a.setNode(l.id,l)}v.debug("Count=",a.nodeCount(),a);let y=0;c.forEach(function(r){y++,v.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:it(r.title),height:b.labelHeight*T.getRows(r.title).length,labelpos:"c"},"id"+y)}),U(a),v.debug("Graph after layout",a.nodes());let S=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(v.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+S.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(L[r]?L[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+S.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),p.querySelectorAll("#"+S.id+" #"+r+" .divider").forEach(l=>{let B=l.parentElement,E=0,H=0;B&&(B.parentElement&&(E=B.parentElement.getBBox().width),H=parseInt(B.getAttribute("data-x-shift"),10),Number.isNaN(H)&&(H=0)),l.setAttribute("x1",0-H+8),l.setAttribute("x2",E-H-8)})):v.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let k=S.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(v.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),V(i,a.edge(r),a.edge(r).relation))}),k=S.getBBox();let M={id:s||"root",label:s||"root",width:0,height:0};return M.width=k.width+2*b.padding,M.height=k.height+2*b.padding,v.debug("Doc rendered",M,a),M},"renderDoc"),rt={setConf:tt,draw:at},kt={parser:_,get db(){return new N(1)},renderer:rt,styles:F,init:u(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{kt as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-SQE76S5B.js";function u(e){let g=e.regex,s=/[\p{XID_Start}_]\p{XID_Continue}*/u,b=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","lazy","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],r={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:b,built_in:["__import__","abs","aiter","all","anext","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozendict","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","sentinel","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},n={className:"meta",begin:/^(>>>|\.\.\.) /},i={className:"subst",begin:/\{/,end:/\}/,keywords:r,illegal:/#/},o={begin:/\{\{/,relevance:0},c={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,n],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,n],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,n,o,i]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,n,o,i]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,o,i]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,o,i]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},t="[0-9](_?[0-9])*",d=`(\\b(${t}))?\\.(${t})|\\b(${t})\\.`,a=`\\b|${b.join("|")}`,l={className:"number",relevance:0,variants:[{begin:`(\\b(${t})|(${d}))[eE][+-]?(${t})[jJ]?(?=${a})`},{begin:`(${d})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${a})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${a})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${a})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${a})`},{begin:`\\b(${t})[jJ](?=${a})`}]},_={className:"comment",begin:g.lookahead(/# type:/),end:/$/,keywords:r,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},p={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:["self",n,l,c,e.HASH_COMMENT_MODE]}]};return i.contains=[c,l,n],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:r,illegal:/(<\/|\?)|=>/,contains:[n,l,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},c,_,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,s],scope:{1:"keyword",3:"title.function"},contains:[p]},{variants:[{match:[/\bclass/,/\s+/,s,/\s*/,/\(\s*/,s,/\s*\)/]},{match:[/\bclass/,/\s+/,s]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[l,p,c]}]}}export{u as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as H}from"./chunk-SDTB3Q65.js";import{a as O,b as A,c as E,d as D,e as Y,f as x,g as _}from"./chunk-SSDZPVPW.js";import{C as k}from"./chunk-EADDJUDC.js";import{a as I}from"./chunk-MVYC3CY4.js";import{f as N,g as M,h as G}from"./chunk-XBZAO4ID.js";import{a as v,c as B,e as S}from"./chunk-PZCGBYVO.js";import{b as P}from"./chunk-CK7M2PJ3.js";import"./chunk-44KDLLKJ.js";import"./chunk-JFT2LC2T.js";import"./chunk-AUSLTP43.js";import"./chunk-GLU2YQV2.js";import"./chunk-6DWWYA6G.js";import"./chunk-VJLIWNIU.js";import{Z as R}from"./chunk-LWDL4HZB.js";import"./chunk-VXPNUNUX.js";import{b as p}from"./chunk-JR4SIX7A.js";import{a as m}from"./chunk-5FIPUNR4.js";import"./chunk-SQE76S5B.js";var J=m((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),T=m((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";default:return"top"}},"getDefaultSelfLoopSide"),U=m(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram"||t==="er"||t==="classDiagram","shouldMergeSelfLoopSegments"),K=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],Q=m((t,e,r,d,n)=>{let f=[],h=new Set;if(r.forEach(({start:s,end:o})=>{s!==d&&h.add(s),o!==d&&h.add(o)}),h.forEach(s=>{let o=t.node(s);typeof o?.x=="number"&&typeof o?.y=="number"&&f.push(o)}),f.length===0&&r.forEach(({edge:s})=>{(s.points??[]).forEach(o=>{typeof o?.x=="number"&&typeof o?.y=="number"&&f.push(o)})}),f.length===0)return T(n);let g=f.reduce((s,o)=>({x:s.x+o.x/f.length,y:s.y+o.y/f.length}),{x:0,y:0}),l=g.x-e.x,i=g.y-e.y;return Math.abs(l)>Math.abs(i)?l>0?"right":"left":Math.abs(i)>0?i>0?"bottom":"top":T(n)},"getSelfLoopSide"),V=m((t,e="top",r=0,d=0)=>{let n=t.x,f=t.y-r,h=t.width/2,g=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),i=J(Math.max(d,t.width*.35),36,l),s=J(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{let o=f+g;return[{x:n-i/2,y:o},{x:n-i/2,y:o+s},{x:n+i/2,y:o+s},{x:n+i/2,y:o}]}case"right":{let o=n+h;return[{x:o,y:f-i/2},{x:o+s,y:f-i/2},{x:o+s,y:f+i/2},{x:o,y:f+i/2}]}case"left":{let o=n-h;return[{x:o,y:f-i/2},{x:o-s,y:f-i/2},{x:o-s,y:f+i/2},{x:o,y:f+i/2}]}default:{let o=f-g;return[{x:n-i/2,y:o},{x:n-i/2,y:o-s},{x:n+i/2,y:o-s},{x:n+i/2,y:o}]}}},"getSelfLoopPoints"),Z=m((t,e,r="top",d=0,n={})=>{let h=t.x,g=t.y-d,l=n.width??0,i=n.height??0;switch(r){case"bottom":return{x:h,y:Math.max(...e.map(s=>s.y))+i/2+4};case"right":return{x:Math.max(...e.map(s=>s.x))+l/2+4,y:g};case"left":return{x:Math.min(...e.map(s=>s.x))-l/2-4,y:g};default:return{x:h,y:Math.min(...e.map(s=>s.y))-i/2-4}}},"getSelfLoopLabelPosition"),F=m((t,e=0,{mergeSelfLoops:r=!0}={})=>{let d=new Map,n=[],f=t.graph()?.rankdir;return t.edges().forEach(h=>{let g=t.edge(h);if(r&&g.selfLoop){let l=g.selfLoop.id;d.has(l)||d.set(l,[]),d.get(l).push({edge:g,start:h.v,end:h.w})}else n.push({edge:g,start:h.v,end:h.w})}),d.forEach(h=>{if(h.length!==3){h.forEach(u=>n.push(u));return}h.sort((u,w)=>u.edge.selfLoop.order-w.edge.selfLoop.order);let[g,l,i]=h,s=g.edge.originalEdge??l.edge.originalEdge??i.edge.originalEdge??l.edge,o=t.node(s.start);if(!o){h.forEach(u=>n.push(u));return}let a={width:l.edge.width,height:l.edge.height},L=Q(t,o,h,s.start,f),b=V(o,L,e,a.width??0),y=Z(o,b,L,e,a),c={...l.edge,...s,id:s.id,points:b,start:s.start,end:s.end,x:y.x,y:y.y,width:a.width,height:a.height,labelStyle:l.edge.labelStyle,fromCluster:g.edge.fromCluster??l.edge.fromCluster??i.edge.fromCluster,toCluster:g.edge.toCluster??l.edge.toCluster??i.edge.toCluster};delete c.selfLoop,delete c.originalEdge,n.push({edge:c,start:c.start,end:c.end})}),n},"getEdgesToRender"),W=m(async({element:t,graph:e,diagramType:r,id:d,parentCluster:n,siteConfig:f})=>{let h=e.graph().rankdir;p.trace("Dir in recursive render - dir:",h);let{clusters:g,edgePaths:l,edgeLabels:i,nodes:s,rootGroups:o}=O(t,{edgePathsClass:"edgePaths"});e.nodes()?p.info("Recursive render XXX",e.nodes()):p.info("No nodes found for",e),e.edges().length>0&&p.info("Recursive edges",e.edge(e.edges()[0]));let a=U(r);await Promise.all(e.nodes().map(async function(y){let c=e.node(y);if(n!==void 0){let u=JSON.parse(JSON.stringify(n.clusterData));p.trace(`Setting data for parent cluster XXX
|
|
2
|
+
Node.id = `,y,`
|
|
3
|
+
data=`,u.height,`
|
|
4
|
+
Parent cluster`,n.height),e.setNode(n.id,u),e.parent(y)||(p.trace("Setting parent",y,n.id),e.setParent(y,n.id,u))}if(p.info("(Insert) Node XXX"+y+": "+JSON.stringify(e.node(y))),c?.clusterNode){p.info("Cluster identified XBX",y,c.width,e.node(y));let{ranksep:u,nodesep:w}=e.graph();c.graph.setGraph({...c.graph.graph(),ranksep:u+25,nodesep:w});let X=await oe({element:s,graph:c.graph,diagramType:r,id:d,parentCluster:e.node(y),siteConfig:f}),C=X.elem;P(c,C),c.diff=X.diff||0,p.info("New compound node after recursive render XAX",y,"width",c.width,"height",c.height),B(C,c)}else e.children(y).length>0?(p.trace("Cluster - the non recursive path XBX",y,c.id,c,c.width,"Graph:",e),p.trace(D(c.id,e)),E.set(c.id,{id:D(c.id,e),node:c})):(p.trace("Node - the non recursive path XAX",y,s,e.node(y),h),await A(s,e.node(y),{config:f,dir:h}))})),await m(async()=>{let y=e.edges().map(async function(c){let u=e.edge(c.v,c.w,c.name);if(p.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c)),p.info("Edge "+c.v+" -> "+c.w+": ",c," ",JSON.stringify(e.edge(c))),p.info("Fix",E,"ids:",c.v,c.w,"Translating: ",E.get(c.v),E.get(c.w)),a&&u.selfLoop){if(u.selfLoop.order!==1)return;let w={...u.originalEdge,...u,id:u.selfLoop.id,startLabelLeft:u.originalEdge?.startLabelLeft??u.startLabelLeft,startLabelRight:u.originalEdge?.startLabelRight??u.startLabelRight,endLabelLeft:u.originalEdge?.endLabelLeft??u.endLabelLeft,endLabelRight:u.originalEdge?.endLabelRight??u.endLabelRight};await N(i,w),u.width=w.width,u.height=w.height,u.labelStyle=w.labelStyle;return}await N(i,u)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:b}=v(f);return{elem:o,graph:e,groups:{clusters:g,edgePaths:l,edgeLabels:i,nodes:s,rootGroups:o},diagramType:r,id:d,mergeSelfLoops:a,subGraphTitleTotalMargin:b}},"measureDagreGraph"),j=m(t=>{p.info("############################################# XXX"),p.info("### Layout ### XXX"),p.info("############################################# XXX"),H(t)},"runDagreGraphLayout"),$=m((t,e,r)=>{let d=t.node(e);if(!d)return;let n={...d};return d?.clusterNode?n.y=(d.y??0)+r:t.children(e).length>0?n.height=(d.height??0)+r:n.y=(d.y??0)+r/2,n},"normalizeDagreNode"),z=m((t,e)=>{K.forEach(r=>{e[r]!==void 0&&(t[r]=e[r])})},"applyDagreNodeLayout"),ee=m((t,e,r,d)=>({...t,start:t.start??e,end:t.end??r,points:(t.points??[]).map(n=>({...n,y:typeof n.y=="number"?n.y+d:n.y}))}),"normalizeDagreEdge"),te=m((t,e)=>{let{graph:r,mergeSelfLoops:d,subGraphTitleTotalMargin:n=0}=e,f=new Map(t.nodes.map(g=>[g.id,g]));x(r).forEach(g=>{let l=$(r,g,n);if(!l)return;z(r.node(g),l);let i=f.get(g);i&&z(i,l)});let h=n/2;return t.edges=F(r,h,{mergeSelfLoops:d}).map(({edge:g,start:l,end:i})=>ee(g,l,i,h)),t},"applyDagreLayoutResult"),re=m(async({elem:t,graph:e,groups:{clusters:r,edgePaths:d},diagramType:n,id:f,mergeSelfLoops:h,subGraphTitleTotalMargin:g})=>{let l=0;await Promise.all(x(e).map(async function(o){let a=e.node(o);if(p.info("Position XBX => "+o+": ("+a.x,","+a.y,") width: ",a.width," height: ",a.height),a?.clusterNode)a.y+=g,p.info("A tainted cluster node XBX1",o,a.id,a.width,a.height,a.x,a.y,e.parent(o)),E.get(a.id).node=a,S(a);else if(e.children(o).length>0){p.info("A pure cluster node XBX1",o,a.id,a.x,a.y,a.width,a.height,e.parent(o)),a.height+=g,e.node(a.parentId);let L=a?.padding/2||0,b=a?.labelBBox?.height||0,y=b-L||0;p.debug("OffsetY",y,"labelHeight",b,"halfPadding",L),await I(r,a),E.get(a.id).node=a}else{let L=e.node(a.parentId);a.y+=g/2,p.info("A regular node XBX1 - using the padding",a.id,"parent",a.parentId,a.width,a.height,a.x,a.y,"offsetY",a.offsetY,"parent",L,L?.offsetY,a),S(a)}}));let i=g/2;return F(e,i,{mergeSelfLoops:h}).forEach(function({edge:o,start:a,end:L}){p.info("Edge "+a+" -> "+L+": "+JSON.stringify(o),o),o.points.forEach(u=>u.y+=i);let b=e.node(a),y=e.node(L),c=G(d,o,E,n,b,y,f);M(o,c)}),e.nodes().forEach(function(o){let a=e.node(o);p.info(o,a.type,a.diff),a.isGroup&&(l=a.diff)}),p.warn("Returning from recursive render XAX",t,l),{elem:t,diff:l}},"paintDagreLayoutCore"),oe=m(async t=>{let e=await W(t);return j(e.graph),await re(e)},"renderDagreSubgraph"),q=m(t=>{let e=new k({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:t.config?.nodeSpacing||t.nodeSpacing||t.config?.flowchart?.nodeSpacing,ranksep:t.config?.rankSpacing||t.rankSpacing||t.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return t.nodes.forEach(r=>{e.setNode(r.id,{...r}),r.parentId&&e.setParent(r.id,r.parentId)}),p.debug("Edges:",t.edges),t.edges.forEach(r=>{if(r.start===r.end){let d=r.start,n=d+"---"+d+"---1",f=d+"---"+d+"---2",h=e.node(d);e.setNode(n,{domId:n,id:n,parentId:h.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(n,h.parentId),e.setNode(f,{domId:f,id:f,parentId:h.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(f,h.parentId);let g=structuredClone(r),l=structuredClone(r),i=structuredClone(r),s=structuredClone(r);l.originalEdge=g,l.selfLoop={id:g.id,order:0},i.originalEdge=g,i.selfLoop={id:g.id,order:1},s.originalEdge=g,s.selfLoop={id:g.id,order:2},l.label="",l.arrowTypeEnd="none",l.endLabelLeft="",l.endLabelRight="",l.startLabelLeft="",l.id=d+"-cyclic-special-1",i.startLabelRight="",i.startLabelLeft="",i.endLabelLeft="",i.endLabelRight="",i.arrowTypeStart="none",i.arrowTypeEnd="none",i.id=d+"-cyclic-special-mid",s.label="",s.startLabelRight="",s.startLabelLeft="",s.arrowTypeStart="none",h.isGroup&&(l.fromCluster=d,s.toCluster=d),s.id=d+"-cyclic-special-2",s.arrowTypeStart="none",e.setEdge(d,n,l,d+"-cyclic-special-0"),e.setEdge(n,f,i,d+"-cyclic-special-1"),e.setEdge(f,d,s,d+"-cyclic-special-2")}else e.setEdge(r.start,r.end,{...r},r.id)}),Y(e),{graph:e}},"prepareLayoutForDagre"),ne=m(async(t,{element:e,preparedLayout:r})=>{let d=r??q(t),n=R(),f=await W({element:e,graph:d.graph,diagramType:t.type,id:t.diagramId,parentCluster:void 0,siteConfig:n});return d.measuredLayout=f,f},"measureDagreLayout"),ae=m((t,e)=>{let r=e.preparedLayout?.measuredLayout;if(!r)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return j(r.graph),te(t,r),r},"runDagreLayoutCore"),ie=m((t,{measure:e})=>x(e.graph).map(r=>e.graph.node(r)).filter(Boolean),"getDagrePaintNodes"),se=m((t,e,{measure:r})=>t?r.graph.node(t):void 0,"getDagreEdgeNode"),xe=_({prepareLayout:q,measureLayout:ne,runLayoutCore:ae,paintOptions:{clusterDb:E,getNodes:ie,getEdgeNode:se,skipNode:m((t,{measure:e})=>!e.graph.hasNode(t.id),"skipNode"),isCluster:m((t,{measure:e})=>e.graph.hasNode(t.id)&&(e.graph.children(t.id)??[]).length>0,"isCluster")}});export{te as applyDagreLayoutResult,F as getEdgesToRender,ne as measureDagreLayout,q as prepareLayoutForDagre,xe as render,ae as runDagreLayoutCore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,b as i,c as o,d as m}from"./chunk-ESFD2H7N.js";import"./chunk-H2KMMTJB.js";import"./chunk-XLLPZ2WO.js";import"./chunk-RVAIT6JW.js";import"./chunk-MVYC3CY4.js";import"./chunk-XBZAO4ID.js";import"./chunk-PZCGBYVO.js";import"./chunk-U6OCY4ZH.js";import"./chunk-CK7M2PJ3.js";import"./chunk-44KDLLKJ.js";import"./chunk-JFT2LC2T.js";import"./chunk-AUSLTP43.js";import"./chunk-GLU2YQV2.js";import"./chunk-6DWWYA6G.js";import"./chunk-VJLIWNIU.js";import"./chunk-LWDL4HZB.js";import"./chunk-VXPNUNUX.js";import"./chunk-JR4SIX7A.js";import{a as r}from"./chunk-5FIPUNR4.js";import"./chunk-SQE76S5B.js";var D={parser:e,get db(){return new o(2)},renderer:i,styles:m,init:r(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{D as diagram};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{a as ue}from"./chunk-KINKFJY7.js";import{a as ye}from"./chunk-ZJPSORPP.js";import"./chunk-C3QSRS6E.js";import{a as he}from"./chunk-B7YX5TR5.js";import"./chunk-4YN4BS7I.js";import"./chunk-WBKLDCV6.js";import"./chunk-TP6U4EDH.js";import"./chunk-ZOP3ZYH7.js";import"./chunk-3XJZ6DIE.js";import"./chunk-KKQSA4LI.js";import"./chunk-FVOHPMS6.js";import"./chunk-HSIHOBTY.js";import"./chunk-3H6STGPV.js";import"./chunk-HSEAD2JH.js";import"./chunk-SVI7DGIE.js";import"./chunk-YUADQVB2.js";import"./chunk-WOKJM3FY.js";import"./chunk-S6ZQZNOX.js";import"./chunk-CUS65DKZ.js";import{a as fe}from"./chunk-RVAIT6JW.js";import{c as me,d as $}from"./chunk-JFT2LC2T.js";import{o as I}from"./chunk-6DWWYA6G.js";import"./chunk-VJLIWNIU.js";import{N as ae,S as le,T as se,U as re,V as ne,W as oe,X as ie,Y as ce,h as ee,j as te,t as R}from"./chunk-LWDL4HZB.js";import"./chunk-VXPNUNUX.js";import{b as H,h as V,j as N,k as pe,l as de,m as B}from"./chunk-JR4SIX7A.js";import{a as h}from"./chunk-5FIPUNR4.js";import"./chunk-SQE76S5B.js";var ge=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=se,this.getAccTitle=re,this.setDiagramTitle=ie,this.getDiagramTitle=ce,this.getAccDescription=oe,this.setAccDescription=ne}static{h(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){let r=te,s=R();return I({...r.treemap,...s.treemap??{}})}addNode(r,s){this.nodes.push(r),this.levels.set(r,s),s===0&&(this.outerNodes.push(r),this.root??=r)}getRoot(){return{name:"",children:this.outerNodes}}addClass(r,s){let i=this.classes.get(r)??{id:r,styles:[],textStyles:[]},c=s.replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/§§§/g,",").split(";");c&&c.forEach(l=>{me(l)&&(i?.textStyles?i.textStyles.push(l):i.textStyles=[l]),i?.styles?i.styles.push(l):i.styles=[l]}),this.classes.set(r,i)}getClasses(){return this.classes}getStylesForClass(r){return this.classes.get(r)?.styles??[]}clear(){le(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function Se(r){if(!r.length)return[];let s=[],i=[];return r.forEach(c=>{let l={name:c.name,children:c.type==="Leaf"?void 0:[]};for(l.classSelector=c?.classSelector,c?.cssCompiledStyles&&(l.cssCompiledStyles=c.cssCompiledStyles),c.type==="Leaf"&&c.value!==void 0&&(l.value=c.value);i.length>0&&i[i.length-1].level>=c.level;)i.pop();if(i.length===0)s.push(l);else{let n=i[i.length-1].node;n.children?n.children.push(l):n.children=[l]}c.type!=="Leaf"&&i.push({node:l,level:c.level})}),s}h(Se,"buildHierarchy");var Fe=h((r,s)=>{ue(r,s);let i=[];for(let n of r.TreemapRows??[])n.$type==="ClassDefStatement"&&s.addClass(n.className??"",n.styleText??"");for(let n of r.TreemapRows??[]){let d=n.item;if(!d)continue;let m=n.indent?parseInt(n.indent):0,k=Ne(d),a=d.classSelector?s.getStylesForClass(d.classSelector):[],A=a.length>0?a:void 0,b={level:m,name:k,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:A};i.push(b)}let c=Se(i),l=h((n,d)=>{for(let m of n)s.addNode(m,d),m.children&&m.children.length>0&&l(m.children,d+1)},"addNodesRecursively");l(c,0)},"populate"),Ne=h(r=>r.name?String(r.name):"","getItemName"),xe={parser:{yy:void 0},parse:h(async r=>{try{let i=await ye("treemap",r);H.debug("Treemap AST:",i);let c=xe.parser?.yy;if(!(c instanceof ge))throw new 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.");Fe(i,c)}catch(s){throw H.error("Error parsing treemap:",s),s}},"parse")},ze=10,z=10,M=25,Ae=h((r,s,i,c)=>{let l=c.db,n=l.getConfig(),d=n.padding??ze,m=l.getDiagramTitle(),k=l.getRoot(),{themeVariables:a}=R();if(!k)return;let A=m?30:0,b=he(s),Y=n.nodeWidth?n.nodeWidth*z:960,j=n.nodeHeight?n.nodeHeight*z:500,O=Y,U=j+A;b.attr("viewBox",`0 0 ${O} ${U}`),ae(b,U,O,n.useMaxWidth);let v;try{let e=n.valueFormat||",";if(e==="$0,0")v=h(t=>"$"+N(",")(t),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){let t=/\.\d+/.exec(e),o=t?t[0]:"";v=h(f=>"$"+N(","+o)(f),"valueFormat")}else if(e.startsWith("$")){let t=e.substring(1);v=h(o=>"$"+N(t||"")(o),"valueFormat")}else v=N(e)}catch(e){H.error("Error creating format function:",e),v=N(",")}let P=B().range(["transparent",a.cScale0,a.cScale1,a.cScale2,a.cScale3,a.cScale4,a.cScale5,a.cScale6,a.cScale7,a.cScale8,a.cScale9,a.cScale10,a.cScale11]),be=B().range(["transparent",a.cScalePeer0,a.cScalePeer1,a.cScalePeer2,a.cScalePeer3,a.cScalePeer4,a.cScalePeer5,a.cScalePeer6,a.cScalePeer7,a.cScalePeer8,a.cScalePeer9,a.cScalePeer10,a.cScalePeer11]),W=B().range([a.cScaleLabel0,a.cScaleLabel1,a.cScaleLabel2,a.cScaleLabel3,a.cScaleLabel4,a.cScaleLabel5,a.cScaleLabel6,a.cScaleLabel7,a.cScaleLabel8,a.cScaleLabel9,a.cScaleLabel10,a.cScaleLabel11]);m&&b.append("text").attr("x",O/2).attr("y",A/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(m);let q=b.append("g").attr("transform",`translate(0, ${A})`).attr("class","treemapContainer"),ve=pe(k).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),J=de().size([Y,j]).paddingTop(e=>e.children&&e.children.length>0?M+z:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?z:0).paddingRight(e=>e.children&&e.children.length>0?z:0).paddingBottom(e=>e.children&&e.children.length>0?z:0).round(!0)(ve),Ce=J.descendants().filter(e=>e.children&&e.children.length>0),D=q.selectAll(".treemapSection").data(Ce).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);D.append("rect").attr("width",e=>e.x1-e.x0).attr("height",M).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),D.append("clipPath").attr("id",(e,t)=>`clip-section-${s}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",M),D.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=>P(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>be(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";let t=$({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+";"+t.borderStyles.join(";")}),D.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",M/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-${s}-${t})`).attr("style",e=>{if(e.depth===0)return"display: none;";let t="dominant-baseline: middle; font-size: 12px; fill:"+W(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",o=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+o.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;let t=V(this),o=e.data.name;t.text(o);let f=e.x1-e.x0,y=6,u;n.showValues!==!1&&e.value?u=f-10-30-10-y:u=f-y-6;let p=Math.max(15,u),w=t.node();if(w.getComputedTextLength()>p){let T=o;for(;T.length>0;){if(T=o.substring(0,T.length-1),T.length===0){t.text("..."),w.getComputedTextLength()>p&&t.text("");break}if(t.text(T+"..."),w.getComputedTextLength()<=p)break}}}),n.showValues!==!1&&D.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",M/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?v(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";let t="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+W(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",o=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+o.labelStyles.replace("color:","fill:")});let K=J.leaves(),S=K.length>20,we=S?16:38,E=S?14:28,L=S?4:8,F=S?4:6,G=S?2:4,Q=S?8:10,X=S?1:2,_=q.selectAll(".treemapLeafGroup").data(K).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})`);_.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?P(e.parent.data.name):P(e.data.name)).attr("style",e=>$({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?P(e.parent.data.name):P(e.data.name)).attr("stroke-width",3),_.append("clipPath").attr("id",(e,t)=>`clip-${s}-${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)),_.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{let t=`text-anchor: middle; dominant-baseline: middle; font-size: ${we}px;fill:`+W(e.data.name)+";",o=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+o.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,t)=>`url(#clip-${s}-${t})`).text(e=>e.data.name).each(function(e){let t=V(this),o=e.x1-e.x0,f=e.y1-e.y0,y=t.node(),u=o-2*G,C=f-2*G;if(u<Q||C<Q){t.style("display","none");return}let p=parseInt(t.style("font-size"),10),w=.6;for(;y.getComputedTextLength()>u&&p>L;)p--,t.style("font-size",`${p}px`);let g=Math.max(F,Math.min(E,Math.round(p*w))),x=p+X+g;for(;x>C&&p>L&&(p--,g=Math.max(F,Math.min(E,Math.round(p*w))),!(g<F&&p===L));)t.style("font-size",`${p}px`),x=p+X+g,g<=F&&x>C;t.style("font-size",`${p}px`),S?(p<L||C<L)&&t.style("display","none"):(y.getComputedTextLength()>u||p<L||C<p)&&t.style("display","none")}),n.showValues!==!1&&_.append("text").attr("class","treemapValue").attr("x",t=>(t.x1-t.x0)/2).attr("y",function(t){return(t.y1-t.y0)/2}).attr("style",t=>{let o=`text-anchor: middle; dominant-baseline: hanging; font-size: ${E}px;fill:`+W(t.data.name)+";",f=$({cssCompiledStyles:t.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,o)=>`url(#clip-${s}-${o})`).text(t=>t.value?v(t.value):"").each(function(t){let o=V(this),f=this.parentNode;if(!f){o.style("display","none");return}let y=V(f).select(".treemapLabel");if(y.empty()||y.style("display")==="none"){o.style("display","none");return}let u=parseFloat(y.style("font-size")),p=Math.max(F,Math.min(E,Math.round(u*.6)));o.style("font-size",`${p}px`);let g=(t.y1-t.y0)/2+u/2+X;o.attr("y",g);let x=t.x1-t.x0,Z=t.y1-t.y0-4,Le=x-2*G;o.node().getComputedTextLength()>Le||g+p>Z||p<F?o.style("display","none"):o.style("display",null)});let Te=n.diagramPadding??8;fe(b,Te,"flowchart",n?.useMaxWidth||!1)},"draw"),Pe=h(function(r,s){return s.db.getClasses()},"getClasses"),De={draw:Ae,getClasses:Pe},Ve={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},Me=h(({treemap:r}={})=>{let s=ee(),i=R(),c=I(s,i.themeVariables),l=I(Ve,r),n=l.titleColor??c.titleColor,d=l.labelColor??c.textColor,m=l.valueColor??c.textColor;return`
|
|
2
|
+
.treemapNode.section {
|
|
3
|
+
stroke: ${l.sectionStrokeColor};
|
|
4
|
+
stroke-width: ${l.sectionStrokeWidth};
|
|
5
|
+
fill: ${l.sectionFillColor};
|
|
6
|
+
}
|
|
7
|
+
.treemapNode.leaf {
|
|
8
|
+
stroke: ${l.leafStrokeColor};
|
|
9
|
+
stroke-width: ${l.leafStrokeWidth};
|
|
10
|
+
fill: ${l.leafFillColor};
|
|
11
|
+
}
|
|
12
|
+
.treemapLabel {
|
|
13
|
+
fill: ${d};
|
|
14
|
+
font-size: ${l.labelFontSize};
|
|
15
|
+
}
|
|
16
|
+
.treemapValue {
|
|
17
|
+
fill: ${m};
|
|
18
|
+
font-size: ${l.valueFontSize};
|
|
19
|
+
}
|
|
20
|
+
.treemapTitle {
|
|
21
|
+
fill: ${n};
|
|
22
|
+
font-size: ${l.titleFontSize};
|
|
23
|
+
}
|
|
24
|
+
`},"getStyles"),ke=Me,Ue={parser:xe,get db(){return new ge},renderer:De,styles:ke};export{Ue as diagram};
|