@softistx/pulsarix-widget 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +8 -1
  2. package/dist/chunks/{abnfDiagram-XWFEHMT6.rxx9wyp3.js → abnfDiagram-XWFEHMT6.9n16jbeh.js} +1 -1
  3. package/dist/chunks/architecture-WOLXFQ4H.04w48nbq.js +1 -0
  4. package/dist/chunks/{architectureDiagram-CSQXQB3N.mrm0pgc0.js → architectureDiagram-CSQXQB3N.3c7xm6kb.js} +6 -6
  5. package/dist/chunks/{blockDiagram-BEDRHYPZ.f4dfpk7e.js → blockDiagram-BEDRHYPZ.b7d9kkgr.js} +2 -2
  6. package/dist/chunks/{c4Diagram-M2UUVUY5.rz43j1my.js → c4Diagram-M2UUVUY5.f883rrpb.js} +1 -1
  7. package/dist/chunks/{chat-markdown-BSu4FB_l.xgn4yj83.js → chat-markdown-BSu4FB_l.ngsfz1hc.js} +15 -15
  8. package/dist/chunks/{classDiagram-v2-KXABOMEV.m96cfcad.js → classDiagram-v2-KXABOMEV.6gcf0jbx.js} +1 -1
  9. package/dist/chunks/{cose-bilkent-JH36ORCC.zz2rwyw6.js → cose-bilkent-JH36ORCC.900yznpf.js} +1 -1
  10. package/dist/chunks/cynefin-EF2NZ3EQ.jp3enwcw.js +1 -0
  11. package/dist/chunks/{cynefinDiagram-NJNITYFG.az2k68wq.js → cynefinDiagram-NJNITYFG.7y6esx64.js} +1 -1
  12. package/dist/chunks/{dagre-KIHZ2IZ3.mgwg8bc4.js → dagre-KIHZ2IZ3.2xtjsjjb.js} +2 -2
  13. package/dist/chunks/{diagram-7YQZDPLS.x8fg6705.js → diagram-7YQZDPLS.5a4btxfh.js} +2 -2
  14. package/dist/chunks/{diagram-QBROCOUO.db60dsss.js → diagram-QBROCOUO.je55sz0f.js} +1 -1
  15. package/dist/chunks/{diagram-RJJCUUZO.a7e9w297.js → diagram-RJJCUUZO.19nj7yqv.js} +4 -4
  16. package/dist/chunks/{diagram-WERXNKYE.a04f53kd.js → diagram-WERXNKYE.h15fxc8e.js} +2 -2
  17. package/dist/chunks/{diagram-YHHI257C.v19jhmrh.js → diagram-YHHI257C.rjb588jf.js} +1 -1
  18. package/dist/chunks/{diagram-YR4HJLHV.c5e87gmw.js → diagram-YR4HJLHV.5cj602t4.js} +1 -1
  19. package/dist/chunks/{ebnfDiagram-N527522P.bjrxfgze.js → ebnfDiagram-N527522P.edah3bz7.js} +1 -1
  20. package/dist/chunks/{editor-shortcuts-dialog-Cz3T8435.5ve4nsaw.js → editor-shortcuts-dialog-Cz3T8435.kb0b5cra.js} +1 -1
  21. package/dist/chunks/{editor.yak1qktd.js → editor.ywaw7sz9.js} +3 -3
  22. package/dist/chunks/{elk-O5DQBFGD.1ydp0b7a.js → elk-O5DQBFGD.qnxmxe5n.js} +8 -8
  23. package/dist/chunks/{emoji-picker-00Bw2c2b.gzznrrz5.js → emoji-picker-00Bw2c2b.2985hrzf.js} +2 -2
  24. package/dist/chunks/{erDiagram-K3K3BIDK.g171ckq1.js → erDiagram-K3K3BIDK.9wh4fsa9.js} +1 -1
  25. package/dist/chunks/eventmodeling-K75KTNOO.xt3yb4h8.js +1 -0
  26. package/dist/chunks/{flow-diagram-DGZOc1z1.3gbgbm5m.js → flow-diagram-DGZOc1z1.1276ykn3.js} +4 -4
  27. package/dist/chunks/flowDiagram-Z6JWZHQI.3t1zqq9x.js +1 -0
  28. package/dist/chunks/{ganttDiagram-3PRQTZWP.3b9dh4nr.js → ganttDiagram-3PRQTZWP.4t4r8jy0.js} +2 -2
  29. package/dist/chunks/gitGraph-VSP46ZUC.v9e8d46n.js +1 -0
  30. package/dist/chunks/{gitGraphDiagram-VXDFKS5L.thyp7vsd.js → gitGraphDiagram-VXDFKS5L.x4pypqh9.js} +5 -5
  31. package/dist/chunks/{grid-E2QIVN74.entqjpa3.js → grid-E2QIVN74.8njsnft0.js} +1 -1
  32. package/dist/chunks/illustration-BcaGDjvB.ahkxq9mz.js +1 -0
  33. package/dist/chunks/{index.9n1y396a.js → index.0tz15aew.js} +1 -1
  34. package/dist/chunks/{index.35d4zbh8.js → index.0yskyw4t.js} +1 -1
  35. package/dist/chunks/{index.g2ba0pke.js → index.10k18jx6.js} +1 -1
  36. package/dist/chunks/{index.qr6a02kx.js → index.28jrnjz5.js} +2 -2
  37. package/dist/chunks/{index.w1516g8q.js → index.2j6fty9j.js} +3 -3
  38. package/dist/chunks/{index.5fcbba6e.js → index.3c95g5mh.js} +1 -1
  39. package/dist/chunks/{index.6pzexww5.js → index.3y8baz7q.js} +2 -2
  40. package/dist/chunks/{index.v02zf4zg.js → index.5n55ccv6.js} +1 -1
  41. package/dist/chunks/{index.zkx4ryzt.js → index.5sj251kq.js} +39 -39
  42. package/dist/chunks/{index.0g1t1pjx.js → index.a7m06kba.js} +1 -1
  43. package/dist/chunks/{index.8vaktk8x.js → index.f1bfv6bh.js} +1 -1
  44. package/dist/chunks/{index.8zg579vd.js → index.gzgeb5ax.js} +1 -1
  45. package/dist/chunks/{index.zkngte5k.js → index.mjp06b03.js} +1 -1
  46. package/dist/chunks/{index.cw97ff3b.js → index.mtrj86e8.js} +2 -2
  47. package/dist/chunks/{index.sw8gvntb.js → index.n53k66q8.js} +1 -1
  48. package/dist/chunks/{index.rkgfxpm3.js → index.pg4f51t3.js} +4 -4
  49. package/dist/chunks/{index.h1xzvasx.js → index.q39061xn.js} +1 -1
  50. package/dist/chunks/{index.w4emtsqw.js → index.tnx5y2zc.js} +1 -1
  51. package/dist/chunks/{index.a3njhfdd.js → index.znt11tbm.js} +1 -1
  52. package/dist/chunks/info-OHQRW6UA.atpz16bq.js +1 -0
  53. package/dist/chunks/{infoDiagram-EZ3ZOAHP.833fvq8n.js → infoDiagram-EZ3ZOAHP.mq5603w2.js} +1 -1
  54. package/dist/chunks/{ishikawaDiagram-S3EKX5GW.q3evaw24.js → ishikawaDiagram-S3EKX5GW.sx08qj3j.js} +1 -1
  55. package/dist/chunks/{journeyDiagram-POQNLL5X.9werrmpy.js → journeyDiagram-POQNLL5X.c3e37ws5.js} +1 -1
  56. package/dist/chunks/{kanban-definition-BH5XI6FM.f3ssda0m.js → kanban-definition-BH5XI6FM.6b85jkvt.js} +1 -1
  57. package/dist/chunks/{markup-color-chrome-ykGNUl8y.pcgw4znz.js → markup-color-chrome-ykGNUl8y.76asgnkk.js} +1 -1
  58. package/dist/chunks/{markup-custom-color-MM-HnrqY.sygnt3gs.js → markup-custom-color-MM-HnrqY.de5f5c2g.js} +1 -1
  59. package/dist/chunks/{mention-list-6cR5VSPa.x0x55xzp.js → mention-list-6cR5VSPa.r7r4w0q8.js} +1 -1
  60. package/dist/chunks/{mermaid.core.5cqab0cw.js → mermaid.core.kh4z9f22.js} +3 -3
  61. package/dist/chunks/{mindmap-definition-WVAN44T4.pjjxgse0.js → mindmap-definition-WVAN44T4.07nv313g.js} +1 -1
  62. package/dist/chunks/packet-JDAUHWVQ.dmnq0wwq.js +1 -0
  63. package/dist/chunks/{panel.2vwd6k3h.js → panel.zcphrx3e.js} +1 -1
  64. package/dist/chunks/{pegDiagram-D4NLKWP3.mdacgbzb.js → pegDiagram-D4NLKWP3.2mqrk2xy.js} +1 -1
  65. package/dist/chunks/pie-XZMESJXO.0rpk8mwa.js +1 -0
  66. package/dist/chunks/{pieDiagram-36ENHN4W.fb0d6a9w.js → pieDiagram-36ENHN4W.kx9bhkyj.js} +2 -2
  67. package/dist/chunks/{plated-illustration-pTqcYOQg.6b9fm4a7.js → plated-illustration-pTqcYOQg.a24pxzgf.js} +1 -1
  68. package/dist/chunks/{quadrantDiagram-ZQUDMS73.m5cgqatg.js → quadrantDiagram-ZQUDMS73.68vxq0vb.js} +1 -1
  69. package/dist/chunks/radar-ABXABTNO.xt7snfyy.js +1 -0
  70. package/dist/chunks/railroad-I3PHUGI6.bjssfxkf.js +1 -0
  71. package/dist/chunks/railroad-abnf-LNEFI6M7.mchc5mex.js +1 -0
  72. package/dist/chunks/railroad-ebnf-DWYD2UWJ.wz1e7a1n.js +1 -0
  73. package/dist/chunks/railroad-peg-JR7BVNR7.xg4e4nsz.js +1 -0
  74. package/dist/chunks/{railroadDiagram-JIZHGYPL.w2e1k61e.js → railroadDiagram-JIZHGYPL.dnj3h1n0.js} +1 -1
  75. package/dist/chunks/{render-VIF2ZAQL.exs2rt60.js → render-VIF2ZAQL.cawqkxpf.js} +1 -1
  76. package/dist/chunks/{requirementDiagram-AXW2TVFA.mrxb120d.js → requirementDiagram-AXW2TVFA.5z51j1hn.js} +1 -1
  77. package/dist/chunks/{sankeyDiagram-FBCJTAIF.csj5n1sg.js → sankeyDiagram-FBCJTAIF.0dqdm7yd.js} +1 -1
  78. package/dist/chunks/{sequenceDiagram-3LA2ROMG.73qx1ab4.js → sequenceDiagram-3LA2ROMG.0fpdfwg0.js} +1 -1
  79. package/dist/chunks/{sizeCapture-2Q2CQKSF.vfe8maj3.js → sizeCapture-2Q2CQKSF.gverqc02.js} +1 -1
  80. package/dist/chunks/{stateDiagram-v2-ATKHQDJO.h4grfmy4.js → stateDiagram-v2-ATKHQDJO.56dj904f.js} +1 -1
  81. package/dist/chunks/{swimlanes-YQL5WMAO.e2y8jam1.js → swimlanes-YQL5WMAO.frj4npw4.js} +1 -1
  82. package/dist/chunks/swimlanesDiagram-UCCPES4V.834hahmm.js +8 -0
  83. package/dist/chunks/{timeline-definition-7Z437IG3.2zxa6hz5.js → timeline-definition-7Z437IG3.v99ghwdb.js} +1 -1
  84. package/dist/chunks/treeView-D4JQ5SDB.tbqcaq5q.js +1 -0
  85. package/dist/chunks/treemap-SAJKECNS.jgfv37a0.js +1 -0
  86. package/dist/chunks/{usecaseDiagram-RDK6N6HP.61cdyktj.js → usecaseDiagram-RDK6N6HP.b6317ne8.js} +1 -1
  87. package/dist/chunks/{vennDiagram-SHRQU5PJ.4tspw3rs.js → vennDiagram-SHRQU5PJ.adr331gc.js} +5 -5
  88. package/dist/chunks/wardley-7MLQ67FV.4653yv6a.js +1 -0
  89. package/dist/chunks/{wardleyDiagram-F3OXNVQS.q2p8tshx.js → wardleyDiagram-F3OXNVQS.5tt3knhg.js} +4 -4
  90. package/dist/chunks/{xychartDiagram-GDYJKCDI.69desp9j.js → xychartDiagram-GDYJKCDI.dqs1thzc.js} +4 -4
  91. package/dist/index.js +12 -12
  92. package/docs/integration.md +1 -1
  93. package/package.json +1 -1
  94. package/dist/chunks/architecture-WOLXFQ4H.hwrxbct0.js +0 -1
  95. package/dist/chunks/cynefin-EF2NZ3EQ.y29bn1cz.js +0 -1
  96. package/dist/chunks/eventmodeling-K75KTNOO.46qfxqj7.js +0 -1
  97. package/dist/chunks/flowDiagram-Z6JWZHQI.f0eaj70g.js +0 -1
  98. package/dist/chunks/gitGraph-VSP46ZUC.swware7n.js +0 -1
  99. package/dist/chunks/illustration-BcaGDjvB.1q9xtmyq.js +0 -1
  100. package/dist/chunks/info-OHQRW6UA.1er9b42t.js +0 -1
  101. package/dist/chunks/packet-JDAUHWVQ.t5jwb2rb.js +0 -1
  102. package/dist/chunks/pie-XZMESJXO.pe88zesw.js +0 -1
  103. package/dist/chunks/radar-ABXABTNO.jtbddwfq.js +0 -1
  104. package/dist/chunks/railroad-I3PHUGI6.kvyt0f9s.js +0 -1
  105. package/dist/chunks/railroad-abnf-LNEFI6M7.ybx0vspg.js +0 -1
  106. package/dist/chunks/railroad-ebnf-DWYD2UWJ.yx4c4enn.js +0 -1
  107. package/dist/chunks/railroad-peg-JR7BVNR7.mb71eyqe.js +0 -1
  108. package/dist/chunks/swimlanesDiagram-UCCPES4V.dtthssd5.js +0 -8
  109. package/dist/chunks/treeView-D4JQ5SDB.3kgztv30.js +0 -1
  110. package/dist/chunks/treemap-SAJKECNS.xj47e2ae.js +0 -1
  111. package/dist/chunks/wardley-7MLQ67FV.pckbr6zr.js +0 -1
@@ -0,0 +1,8 @@
1
+ import"./index.f1bfv6bh.js";import{e}from"./index.5sj251kq.js";import"./index.5n55ccv6.js";import{cs,us}from"./index.2j6fty9j.js";import"./index.gzgeb5ax.js";import"./index.3c95g5mh.js";import"./index.tnx5y2zc.js";var r=e((t)=>`${cs(t)}
2
+ .swimlane.cluster:not([data-color-id]) rect {
3
+ stroke: ${t.clusterBorder} !important;
4
+ }
5
+ [data-look="neo"].cluster rect {
6
+ filter: none;
7
+ }
8
+ `,"getStyles"),o=r,F=us({styles:o});export{F as diagram};
@@ -1,4 +1,4 @@
1
- import{e,ur,n,ne,f,h,k,kt,ro,A,u,p,Yt,X,de,Je,Xe}from"./index.zkx4ryzt.js";var ct=function(){var r=e(function(E,o,y,d){for(y=y||{},d=E.length;d--;y[E[d]]=o);return y},"o"),t=[6,11,13,14,15,17,19,20,23,24],a=[1,12],s=[1,13],i=[1,14],g=[1,15],c=[1,16],l=[1,19],_=[1,20],b={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:e(function(o,y,d,x,w,m,I){var T=m.length-1;switch(w){case 1:return m[T-1];case 3:x.setDirection("LR");break;case 4:x.setDirection("TD");break;case 5:this.$=[];break;case 6:m[T-1].push(m[T]),this.$=m[T-1];break;case 7:case 8:this.$=m[T];break;case 9:case 10:this.$=[];break;case 11:x.getCommonDb().setDiagramTitle(m[T].substr(6)),this.$=m[T].substr(6);break;case 12:this.$=m[T].trim(),x.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=m[T].trim(),x.getCommonDb().setAccDescription(this.$);break;case 15:x.addSection(m[T].substr(8)),this.$=m[T].substr(8);break;case 18:x.addTask(m[T],0,""),this.$=m[T];break;case 19:x.addEvent(m[T].substr(2)),this.$=m[T];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},r(t,[2,5],{5:6}),r(t,[2,2]),r(t,[2,3]),r(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:a,15:s,17:i,19:g,20:c,21:17,22:18,23:l,24:_},r(t,[2,10],{1:[2,1]}),r(t,[2,6]),{12:21,14:a,15:s,17:i,19:g,20:c,21:17,22:18,23:l,24:_},r(t,[2,8]),r(t,[2,9]),r(t,[2,11]),{16:[1,22]},{18:[1,23]},r(t,[2,14]),r(t,[2,15]),r(t,[2,16]),r(t,[2,17]),r(t,[2,18]),r(t,[2,19]),r(t,[2,7]),r(t,[2,12]),r(t,[2,13])],defaultActions:{},parseError:e(function(o,y){if(y.recoverable)this.trace(o);else{var d=Error(o);throw d.hash=y,d}},"parseError"),parse:e(function(o){var y=this,d=[0],x=[],w=[null],m=[],I=this.table,T="",W=0,G=0,D=0,J=2,B=1,O=m.slice.call(arguments,1),L=Object.create(this.lexer),F={yy:{}};for(var U in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,U))F.yy[U]=this.yy[U];if(L.setInput(o,F.yy),F.yy.lexer=L,F.yy.parser=this,typeof L.yylloc>"u")L.yylloc={};var Q=L.yylloc;m.push(Q);var C=L.options&&L.options.ranges;if(typeof F.yy.parseError==="function")this.parseError=F.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function N(K){d.length=d.length-2*K,w.length=w.length-K,m.length=m.length-K}e(N,"popStack");function M(){var K=x.pop()||L.lex()||B;if(typeof K!=="number"){if(K instanceof Array)x=K,K=x.pop();K=y.symbols_[K]||K}return K}e(M,"lex");var H,P,V,R,ot,et,q={},rt,Z,yt,nt;while(!0){if(V=d[d.length-1],this.defaultActions[V])R=this.defaultActions[V];else{if(H===null||typeof H>"u")H=M();R=I[V]&&I[V][H]}if(typeof R>"u"||!R.length||!R[0]){var lt="";nt=[];for(rt in I[V])if(this.terminals_[rt]&&rt>J)nt.push("'"+this.terminals_[rt]+"'");if(L.showPosition)lt="Parse error on line "+(W+1)+`:
1
+ import{e,ur,n,ne,f,h,k,kt,ro,A,u,p,Yt,X,de,Je,Xe}from"./index.5sj251kq.js";var ct=function(){var r=e(function(E,o,y,d){for(y=y||{},d=E.length;d--;y[E[d]]=o);return y},"o"),t=[6,11,13,14,15,17,19,20,23,24],a=[1,12],s=[1,13],i=[1,14],g=[1,15],c=[1,16],l=[1,19],_=[1,20],b={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:e(function(o,y,d,x,w,m,I){var T=m.length-1;switch(w){case 1:return m[T-1];case 3:x.setDirection("LR");break;case 4:x.setDirection("TD");break;case 5:this.$=[];break;case 6:m[T-1].push(m[T]),this.$=m[T-1];break;case 7:case 8:this.$=m[T];break;case 9:case 10:this.$=[];break;case 11:x.getCommonDb().setDiagramTitle(m[T].substr(6)),this.$=m[T].substr(6);break;case 12:this.$=m[T].trim(),x.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=m[T].trim(),x.getCommonDb().setAccDescription(this.$);break;case 15:x.addSection(m[T].substr(8)),this.$=m[T].substr(8);break;case 18:x.addTask(m[T],0,""),this.$=m[T];break;case 19:x.addEvent(m[T].substr(2)),this.$=m[T];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},r(t,[2,5],{5:6}),r(t,[2,2]),r(t,[2,3]),r(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:a,15:s,17:i,19:g,20:c,21:17,22:18,23:l,24:_},r(t,[2,10],{1:[2,1]}),r(t,[2,6]),{12:21,14:a,15:s,17:i,19:g,20:c,21:17,22:18,23:l,24:_},r(t,[2,8]),r(t,[2,9]),r(t,[2,11]),{16:[1,22]},{18:[1,23]},r(t,[2,14]),r(t,[2,15]),r(t,[2,16]),r(t,[2,17]),r(t,[2,18]),r(t,[2,19]),r(t,[2,7]),r(t,[2,12]),r(t,[2,13])],defaultActions:{},parseError:e(function(o,y){if(y.recoverable)this.trace(o);else{var d=Error(o);throw d.hash=y,d}},"parseError"),parse:e(function(o){var y=this,d=[0],x=[],w=[null],m=[],I=this.table,T="",W=0,G=0,D=0,J=2,B=1,O=m.slice.call(arguments,1),L=Object.create(this.lexer),F={yy:{}};for(var U in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,U))F.yy[U]=this.yy[U];if(L.setInput(o,F.yy),F.yy.lexer=L,F.yy.parser=this,typeof L.yylloc>"u")L.yylloc={};var Q=L.yylloc;m.push(Q);var C=L.options&&L.options.ranges;if(typeof F.yy.parseError==="function")this.parseError=F.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function N(K){d.length=d.length-2*K,w.length=w.length-K,m.length=m.length-K}e(N,"popStack");function M(){var K=x.pop()||L.lex()||B;if(typeof K!=="number"){if(K instanceof Array)x=K,K=x.pop();K=y.symbols_[K]||K}return K}e(M,"lex");var H,P,V,R,ot,et,q={},rt,Z,yt,nt;while(!0){if(V=d[d.length-1],this.defaultActions[V])R=this.defaultActions[V];else{if(H===null||typeof H>"u")H=M();R=I[V]&&I[V][H]}if(typeof R>"u"||!R.length||!R[0]){var lt="";nt=[];for(rt in I[V])if(this.terminals_[rt]&&rt>J)nt.push("'"+this.terminals_[rt]+"'");if(L.showPosition)lt="Parse error on line "+(W+1)+`:
2
2
  `+L.showPosition()+`
3
3
  Expecting `+nt.join(", ")+", got '"+(this.terminals_[H]||H)+"'";else lt="Parse error on line "+(W+1)+": Unexpected "+(H==B?"end of input":"'"+(this.terminals_[H]||H)+"'");this.parseError(lt,{text:L.match,token:this.terminals_[H]||H,line:L.yylineno,loc:Q,expected:nt})}if(R[0]instanceof Array&&R.length>1)throw Error("Parse Error: multiple actions possible at state: "+V+", token: "+H);switch(R[0]){case 1:if(d.push(H),w.push(L.yytext),m.push(L.yylloc),d.push(R[1]),H=null,!P){if(G=L.yyleng,T=L.yytext,W=L.yylineno,Q=L.yylloc,D>0)D--}else H=P,P=null;break;case 2:if(Z=this.productions_[R[1]][1],q.$=w[w.length-Z],q._$={first_line:m[m.length-(Z||1)].first_line,last_line:m[m.length-1].last_line,first_column:m[m.length-(Z||1)].first_column,last_column:m[m.length-1].last_column},C)q._$.range=[m[m.length-(Z||1)].range[0],m[m.length-1].range[1]];if(et=this.performAction.apply(q,[T,G,W,F.yy,R[1],w,m].concat(O)),typeof et<"u")return et;if(Z)d=d.slice(0,-1*Z*2),w=w.slice(0,-1*Z),m=m.slice(0,-1*Z);d.push(this.productions_[R[1]][0]),w.push(q.$),m.push(q._$),yt=I[d[d.length-2]][d[d.length-1]],d.push(yt);break;case 3:return!0}}return!0},"parse")},S=function(){var E={EOF:1,parseError:e(function(y,d){if(this.yy.parser)this.yy.parser.parseError(y,d);else throw Error(y)},"parseError"),setInput:e(function(o,y){if(this.yy=y||this.yy||{},this._input=o,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];return this.offset=0,this},"setInput"),input:e(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var y=o.match(/(?:\r\n?|\n).*/g);if(y)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),o},"input"),unput:e(function(o){var y=o.length,d=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-y),this.offset-=y;var x=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),d.length-1)this.yylineno-=d.length-1;var w=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===x.length?this.yylloc.first_column:0)+x[x.length-d.length].length-d[0].length:this.yylloc.first_column-y},this.options.ranges)this.yylloc.range=[w[0],w[0]+this.yyleng-y];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(o){this.unput(this.match.slice(o))},"less"),pastInput:e(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var o=this.match;if(o.length<20)o+=this._input.substr(0,20-o.length);return(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var o=this.pastInput(),y=Array(o.length+1).join("-");return o+this.upcomingInput()+`
@@ -0,0 +1 @@
1
+ import{rs}from"./index.3y8baz7q.js";export{rs as createTreeViewServices};
@@ -0,0 +1 @@
1
+ import{Yo}from"./index.3y8baz7q.js";export{Yo as createTreemapServices};
@@ -1,4 +1,4 @@
1
- import{e,n,B,k,q,A,L,R,I,M,P,O,u,p,ge,de,fe,Tt,F,_o,Se,Ee}from"./index.zkx4ryzt.js";import{Ce}from"./index.5fcbba6e.js";import{pe}from"./index.w4emtsqw.js";function tt(t){if(console&&console.error)console.error(`Error: ${t}`)}function gt(t){if(console&&console.warn)console.warn(`Warning: ${t}`)}function At(t){let s=new Date().getTime(),i=t();return{time:new Date().getTime()-s,value:i}}function St(t){function s(){}s.prototype=t;let i=new s;function r(){return typeof i.bar}return r(),r(),t;(0,eval)(t)}function $r(t){if(Gr(t))return t.LABEL;else return t.name}function Gr(t){return typeof t.LABEL==="string"&&t.LABEL!==""}class Le{get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){this._definition=t}accept(t){t.visit(this),this.definition.forEach((s)=>{s.accept(t)})}}class G extends Le{constructor(t){super([]);this.idx=1,Object.assign(this,xe(t))}set definition(t){}get definition(){if(this.referencedRule!==void 0)return this.referencedRule.definition;return[]}accept(t){t.visit(this)}}class me extends Le{constructor(t){super(t.definition);this.orgText="",Object.assign(this,xe(t))}}class W extends Le{constructor(t){super(t.definition);this.ignoreAmbiguities=!1,Object.assign(this,xe(t))}}class j extends Le{constructor(t){super(t.definition);this.idx=1,Object.assign(this,xe(t))}}class Z extends Le{constructor(t){super(t.definition);this.idx=1,Object.assign(this,xe(t))}}class Q extends Le{constructor(t){super(t.definition);this.idx=1,Object.assign(this,xe(t))}}class D extends Le{constructor(t){super(t.definition);this.idx=1,Object.assign(this,xe(t))}}class Y extends Le{constructor(t){super(t.definition);this.idx=1,Object.assign(this,xe(t))}}class J extends Le{get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){super(t.definition);this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,xe(t))}}class w{constructor(t){this.idx=1,Object.assign(this,xe(t))}accept(t){t.visit(this)}}function Wt(t){return t.map(st)}function st(t){function s(i){return i.map(st)}if(t instanceof G){let i={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};if(typeof t.label==="string")i.label=t.label;return i}else if(t instanceof W)return{type:"Alternative",definition:s(t.definition)};else if(t instanceof j)return{type:"Option",idx:t.idx,definition:s(t.definition)};else if(t instanceof Z)return{type:"RepetitionMandatory",idx:t.idx,definition:s(t.definition)};else if(t instanceof Q)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:st(new w({terminalType:t.separator})),definition:s(t.definition)};else if(t instanceof Y)return{type:"RepetitionWithSeparator",idx:t.idx,separator:st(new w({terminalType:t.separator})),definition:s(t.definition)};else if(t instanceof D)return{type:"Repetition",idx:t.idx,definition:s(t.definition)};else if(t instanceof J)return{type:"Alternation",idx:t.idx,definition:s(t.definition)};else if(t instanceof w){let i={type:"Terminal",name:t.terminalType.name,label:$r(t.terminalType),idx:t.idx};if(typeof t.label==="string")i.terminalLabel=t.label;let r=t.terminalType.PATTERN;if(t.terminalType.PATTERN)i.pattern=r instanceof RegExp?r.source:r;return i}else if(t instanceof me)return{type:"Rule",name:t.name,orgText:t.orgText,definition:s(t.definition)};else throw Error("non exhaustive match")}function xe(t){return Object.fromEntries(Object.entries(t).filter(([,s])=>s!==void 0))}class Te{visit(t){let s=t;switch(s.constructor){case G:return this.visitNonTerminal(s);case W:return this.visitAlternative(s);case j:return this.visitOption(s);case Z:return this.visitRepetitionMandatory(s);case Q:return this.visitRepetitionMandatoryWithSeparator(s);case Y:return this.visitRepetitionWithSeparator(s);case D:return this.visitRepetition(s);case J:return this.visitAlternation(s);case w:return this.visitTerminal(s);case me:return this.visitRule(s);default:throw Error("non exhaustive match")}}visitNonTerminal(t){}visitAlternative(t){}visitOption(t){}visitRepetition(t){}visitRepetitionMandatory(t){}visitRepetitionMandatoryWithSeparator(t){}visitRepetitionWithSeparator(t){}visitAlternation(t){}visitTerminal(t){}visitRule(t){}}function vs(t){return t instanceof W||t instanceof j||t instanceof D||t instanceof Z||t instanceof Q||t instanceof Y||t instanceof w||t instanceof me}function je(t,s=[]){if(t instanceof j||t instanceof D||t instanceof Y)return!0;if(t instanceof J)return t.definition.some((r)=>je(r,s));else if(t instanceof G&&s.includes(t))return!1;else if(t instanceof Le){if(t instanceof G)s.push(t);return t.definition.every((r)=>je(r,s))}else return!1}function Ms(t){return t instanceof J}function Ae(t){if(t instanceof G)return"SUBRULE";else if(t instanceof j)return"OPTION";else if(t instanceof J)return"OR";else if(t instanceof Z)return"AT_LEAST_ONE";else if(t instanceof Q)return"AT_LEAST_ONE_SEP";else if(t instanceof Y)return"MANY_SEP";else if(t instanceof D)return"MANY";else if(t instanceof w)return"CONSUME";else throw Error("non exhaustive match")}class $e{walk(t,s=[]){t.definition.forEach((i,r)=>{let a=t.definition.slice(r+1);if(i instanceof G)this.walkProdRef(i,a,s);else if(i instanceof w)this.walkTerminal(i,a,s);else if(i instanceof W)this.walkFlat(i,a,s);else if(i instanceof j)this.walkOption(i,a,s);else if(i instanceof Z)this.walkAtLeastOne(i,a,s);else if(i instanceof Q)this.walkAtLeastOneSep(i,a,s);else if(i instanceof Y)this.walkManySep(i,a,s);else if(i instanceof D)this.walkMany(i,a,s);else if(i instanceof J)this.walkOr(i,a,s);else throw Error("non exhaustive match")})}walkTerminal(t,s,i){}walkProdRef(t,s,i){}walkFlat(t,s,i){let r=s.concat(i);this.walk(t,r)}walkOption(t,s,i){let r=s.concat(i);this.walk(t,r)}walkAtLeastOne(t,s,i){let r=[new j({definition:t.definition})].concat(s,i);this.walk(t,r)}walkAtLeastOneSep(t,s,i){let r=Nn(t,s,i);this.walk(t,r)}walkMany(t,s,i){let r=[new j({definition:t.definition})].concat(s,i);this.walk(t,r)}walkManySep(t,s,i){let r=Nn(t,s,i);this.walk(t,r)}walkOr(t,s,i){let r=s.concat(i);t.definition.forEach((a)=>{let o=new W({definition:[a]});this.walk(o,r)})}}function Nn(t,s,i){return[new j({definition:[new w({terminalType:t.separator})].concat(t.definition)})].concat(s,i)}function Ke(t){if(t instanceof G)return Ke(t.referencedRule);else if(t instanceof w)return Kr(t);else if(vs(t))return Wr(t);else if(Ms(t))return jr(t);else throw Error("non exhaustive match")}function Wr(t){let s=[],i=t.definition,r=0,a=i.length>r,o,c=!0;while(a&&c)o=i[r],c=je(o),s=s.concat(Ke(o)),r=r+1,a=i.length>r;return[...new Set(s)]}function jr(t){let s=t.definition.map((i)=>Ke(i));return[...new Set(s.flat())]}function Kr(t){return[t.terminalType]}var jt="_~IN~_";class In extends $e{constructor(t){super();this.topProd=t,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(t,s,i){}walkProdRef(t,s,i){let r=Vr(t.referencedRule,t.idx)+this.topProd.name,a=s.concat(i),o=new W({definition:a}),c=Ke(o);this.follows[r]=c}}function kn(t){let s={};return t.forEach((i)=>{let r=new In(i).startWalking();Object.assign(s,r)}),s}function Vr(t,s){return t.name+s+jt}function C(t){return t.charCodeAt(0)}function Kt(t,s){if(Array.isArray(t))t.forEach(function(i){s.push(i)});else s.push(t)}function nt(t,s){if(t[s]===!0)throw"duplicate flag "+s;let i=t[s];t[s]=!0}function Ve(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function Rt(){throw Error("Internal Error - Should never get here!")}function ws(t){return t.type==="Character"}var yt=[];for(let t=C("0");t<=C("9");t++)yt.push(t);var Ot=[C("_")].concat(yt);for(let t=C("a");t<=C("z");t++)Ot.push(t);for(let t=C("A");t<=C("Z");t++)Ot.push(t);var Us=[C(" "),C("\f"),C(`
1
+ import{e,n,B,k,q,A,L,R,I,M,P,O,u,p,ge,de,fe,Tt,F,_o,Se,Ee}from"./index.5sj251kq.js";import{Ce}from"./index.3c95g5mh.js";import{pe}from"./index.tnx5y2zc.js";function tt(t){if(console&&console.error)console.error(`Error: ${t}`)}function gt(t){if(console&&console.warn)console.warn(`Warning: ${t}`)}function At(t){let s=new Date().getTime(),i=t();return{time:new Date().getTime()-s,value:i}}function St(t){function s(){}s.prototype=t;let i=new s;function r(){return typeof i.bar}return r(),r(),t;(0,eval)(t)}function $r(t){if(Gr(t))return t.LABEL;else return t.name}function Gr(t){return typeof t.LABEL==="string"&&t.LABEL!==""}class Le{get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){this._definition=t}accept(t){t.visit(this),this.definition.forEach((s)=>{s.accept(t)})}}class G extends Le{constructor(t){super([]);this.idx=1,Object.assign(this,xe(t))}set definition(t){}get definition(){if(this.referencedRule!==void 0)return this.referencedRule.definition;return[]}accept(t){t.visit(this)}}class me extends Le{constructor(t){super(t.definition);this.orgText="",Object.assign(this,xe(t))}}class W extends Le{constructor(t){super(t.definition);this.ignoreAmbiguities=!1,Object.assign(this,xe(t))}}class j extends Le{constructor(t){super(t.definition);this.idx=1,Object.assign(this,xe(t))}}class Z extends Le{constructor(t){super(t.definition);this.idx=1,Object.assign(this,xe(t))}}class Q extends Le{constructor(t){super(t.definition);this.idx=1,Object.assign(this,xe(t))}}class D extends Le{constructor(t){super(t.definition);this.idx=1,Object.assign(this,xe(t))}}class Y extends Le{constructor(t){super(t.definition);this.idx=1,Object.assign(this,xe(t))}}class J extends Le{get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){super(t.definition);this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,xe(t))}}class w{constructor(t){this.idx=1,Object.assign(this,xe(t))}accept(t){t.visit(this)}}function Wt(t){return t.map(st)}function st(t){function s(i){return i.map(st)}if(t instanceof G){let i={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};if(typeof t.label==="string")i.label=t.label;return i}else if(t instanceof W)return{type:"Alternative",definition:s(t.definition)};else if(t instanceof j)return{type:"Option",idx:t.idx,definition:s(t.definition)};else if(t instanceof Z)return{type:"RepetitionMandatory",idx:t.idx,definition:s(t.definition)};else if(t instanceof Q)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:st(new w({terminalType:t.separator})),definition:s(t.definition)};else if(t instanceof Y)return{type:"RepetitionWithSeparator",idx:t.idx,separator:st(new w({terminalType:t.separator})),definition:s(t.definition)};else if(t instanceof D)return{type:"Repetition",idx:t.idx,definition:s(t.definition)};else if(t instanceof J)return{type:"Alternation",idx:t.idx,definition:s(t.definition)};else if(t instanceof w){let i={type:"Terminal",name:t.terminalType.name,label:$r(t.terminalType),idx:t.idx};if(typeof t.label==="string")i.terminalLabel=t.label;let r=t.terminalType.PATTERN;if(t.terminalType.PATTERN)i.pattern=r instanceof RegExp?r.source:r;return i}else if(t instanceof me)return{type:"Rule",name:t.name,orgText:t.orgText,definition:s(t.definition)};else throw Error("non exhaustive match")}function xe(t){return Object.fromEntries(Object.entries(t).filter(([,s])=>s!==void 0))}class Te{visit(t){let s=t;switch(s.constructor){case G:return this.visitNonTerminal(s);case W:return this.visitAlternative(s);case j:return this.visitOption(s);case Z:return this.visitRepetitionMandatory(s);case Q:return this.visitRepetitionMandatoryWithSeparator(s);case Y:return this.visitRepetitionWithSeparator(s);case D:return this.visitRepetition(s);case J:return this.visitAlternation(s);case w:return this.visitTerminal(s);case me:return this.visitRule(s);default:throw Error("non exhaustive match")}}visitNonTerminal(t){}visitAlternative(t){}visitOption(t){}visitRepetition(t){}visitRepetitionMandatory(t){}visitRepetitionMandatoryWithSeparator(t){}visitRepetitionWithSeparator(t){}visitAlternation(t){}visitTerminal(t){}visitRule(t){}}function vs(t){return t instanceof W||t instanceof j||t instanceof D||t instanceof Z||t instanceof Q||t instanceof Y||t instanceof w||t instanceof me}function je(t,s=[]){if(t instanceof j||t instanceof D||t instanceof Y)return!0;if(t instanceof J)return t.definition.some((r)=>je(r,s));else if(t instanceof G&&s.includes(t))return!1;else if(t instanceof Le){if(t instanceof G)s.push(t);return t.definition.every((r)=>je(r,s))}else return!1}function Ms(t){return t instanceof J}function Ae(t){if(t instanceof G)return"SUBRULE";else if(t instanceof j)return"OPTION";else if(t instanceof J)return"OR";else if(t instanceof Z)return"AT_LEAST_ONE";else if(t instanceof Q)return"AT_LEAST_ONE_SEP";else if(t instanceof Y)return"MANY_SEP";else if(t instanceof D)return"MANY";else if(t instanceof w)return"CONSUME";else throw Error("non exhaustive match")}class $e{walk(t,s=[]){t.definition.forEach((i,r)=>{let a=t.definition.slice(r+1);if(i instanceof G)this.walkProdRef(i,a,s);else if(i instanceof w)this.walkTerminal(i,a,s);else if(i instanceof W)this.walkFlat(i,a,s);else if(i instanceof j)this.walkOption(i,a,s);else if(i instanceof Z)this.walkAtLeastOne(i,a,s);else if(i instanceof Q)this.walkAtLeastOneSep(i,a,s);else if(i instanceof Y)this.walkManySep(i,a,s);else if(i instanceof D)this.walkMany(i,a,s);else if(i instanceof J)this.walkOr(i,a,s);else throw Error("non exhaustive match")})}walkTerminal(t,s,i){}walkProdRef(t,s,i){}walkFlat(t,s,i){let r=s.concat(i);this.walk(t,r)}walkOption(t,s,i){let r=s.concat(i);this.walk(t,r)}walkAtLeastOne(t,s,i){let r=[new j({definition:t.definition})].concat(s,i);this.walk(t,r)}walkAtLeastOneSep(t,s,i){let r=Nn(t,s,i);this.walk(t,r)}walkMany(t,s,i){let r=[new j({definition:t.definition})].concat(s,i);this.walk(t,r)}walkManySep(t,s,i){let r=Nn(t,s,i);this.walk(t,r)}walkOr(t,s,i){let r=s.concat(i);t.definition.forEach((a)=>{let o=new W({definition:[a]});this.walk(o,r)})}}function Nn(t,s,i){return[new j({definition:[new w({terminalType:t.separator})].concat(t.definition)})].concat(s,i)}function Ke(t){if(t instanceof G)return Ke(t.referencedRule);else if(t instanceof w)return Kr(t);else if(vs(t))return Wr(t);else if(Ms(t))return jr(t);else throw Error("non exhaustive match")}function Wr(t){let s=[],i=t.definition,r=0,a=i.length>r,o,c=!0;while(a&&c)o=i[r],c=je(o),s=s.concat(Ke(o)),r=r+1,a=i.length>r;return[...new Set(s)]}function jr(t){let s=t.definition.map((i)=>Ke(i));return[...new Set(s.flat())]}function Kr(t){return[t.terminalType]}var jt="_~IN~_";class In extends $e{constructor(t){super();this.topProd=t,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(t,s,i){}walkProdRef(t,s,i){let r=Vr(t.referencedRule,t.idx)+this.topProd.name,a=s.concat(i),o=new W({definition:a}),c=Ke(o);this.follows[r]=c}}function kn(t){let s={};return t.forEach((i)=>{let r=new In(i).startWalking();Object.assign(s,r)}),s}function Vr(t,s){return t.name+s+jt}function C(t){return t.charCodeAt(0)}function Kt(t,s){if(Array.isArray(t))t.forEach(function(i){s.push(i)});else s.push(t)}function nt(t,s){if(t[s]===!0)throw"duplicate flag "+s;let i=t[s];t[s]=!0}function Ve(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function Rt(){throw Error("Internal Error - Should never get here!")}function ws(t){return t.type==="Character"}var yt=[];for(let t=C("0");t<=C("9");t++)yt.push(t);var Ot=[C("_")].concat(yt);for(let t=C("a");t<=C("z");t++)Ot.push(t);for(let t=C("A");t<=C("Z");t++)Ot.push(t);var Us=[C(" "),C("\f"),C(`
2
2
  `),C("\r"),C("\t"),C("\v"),C("\t"),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C("\u2028"),C("\u2029"),C(" "),C(" "),C(" "),C("\uFEFF")];var zr=/[0-9a-fA-F]/,Vt=/[0-9]/,Hr=/[1-9]/;class zt{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(t){this.idx=t.idx,this.input=t.input,this.groupIdx=t.groupIdx}pattern(t){this.idx=0,this.input=t,this.groupIdx=0,this.consumeChar("/");let s=this.disjunction();this.consumeChar("/");let i={type:"Flags",loc:{begin:this.idx,end:t.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};while(this.isRegExpFlag())switch(this.popChar()){case"g":nt(i,"global");break;case"i":nt(i,"ignoreCase");break;case"m":nt(i,"multiLine");break;case"u":nt(i,"unicode");break;case"y":nt(i,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:i,value:s,loc:this.loc(0)}}disjunction(){let t=[],s=this.idx;t.push(this.alternative());while(this.peekChar()==="|")this.consumeChar("|"),t.push(this.alternative());return{type:"Disjunction",value:t,loc:this.loc(s)}}alternative(){let t=[],s=this.idx;while(this.isTerm())t.push(this.term());return{type:"Alternative",value:t,loc:this.loc(s)}}term(){if(this.isAssertion())return this.assertion();else return this.atom()}assertion(){let t=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(t)};case"$":return{type:"EndAnchor",loc:this.loc(t)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(t)};case"B":return{type:"NonWordBoundary",loc:this.loc(t)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let s;switch(this.popChar()){case"=":s="Lookahead";break;case"!":s="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":s="Lookbehind";break;case"!":s="NegativeLookbehind"}break}}Ve(s);let i=this.disjunction();return this.consumeChar(")"),{type:s,value:i,loc:this.loc(t)}}return Rt()}quantifier(t=!1){let s=void 0,i=this.idx;switch(this.popChar()){case"*":s={atLeast:0,atMost:1/0};break;case"+":s={atLeast:1,atMost:1/0};break;case"?":s={atLeast:0,atMost:1};break;case"{":let r=this.integerIncludingZero();switch(this.popChar()){case"}":s={atLeast:r,atMost:r};break;case",":let a;if(this.isDigit())a=this.integerIncludingZero(),s={atLeast:r,atMost:a};else s={atLeast:r,atMost:1/0};this.consumeChar("}");break}if(t===!0&&s===void 0)return;Ve(s);break}if(t===!0&&s===void 0)return;if(Ve(s)){if(this.peekChar(0)==="?")this.consumeChar("?"),s.greedy=!1;else s.greedy=!0;return s.type="Quantifier",s.loc=this.loc(i),s}}atom(){let t,s=this.idx;switch(this.peekChar()){case".":t=this.dotAll();break;case"\\":t=this.atomEscape();break;case"[":t=this.characterClass();break;case"(":t=this.group();break}if(t===void 0&&this.isPatternCharacter())t=this.patternCharacter();if(Ve(t)){if(t.loc=this.loc(s),this.isQuantifier())t.quantifier=this.quantifier();return t}return Rt()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[C(`
3
3
  `),C("\r"),C("\u2028"),C("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let t,s=!1;switch(this.popChar()){case"d":t=yt;break;case"D":t=yt,s=!0;break;case"s":t=Us;break;case"S":t=Us,s=!0;break;case"w":t=Ot;break;case"W":t=Ot,s=!0;break}if(Ve(t))return{type:"Set",value:t,complement:s};return Rt()}controlEscapeAtom(){let t;switch(this.popChar()){case"f":t=C("\f");break;case"n":t=C(`
4
4
  `);break;case"r":t=C("\r");break;case"t":t=C("\t");break;case"v":t=C("\v");break}if(Ve(t))return{type:"Character",value:t};return Rt()}controlLetterEscapeAtom(){this.consumeChar("c");let t=this.popChar();if(/[a-zA-Z]/.test(t)===!1)throw Error("Invalid ");return{type:"Character",value:t.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:C("\x00")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let t=this.popChar();return{type:"Character",value:C(t)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
@@ -1,15 +1,15 @@
1
- import{e,ne,Qn,f,h,B,k,j,A,L,R,I,M,P,O,p,X,Y,m}from"./index.zkx4ryzt.js";var fe=(t,s)=>Qn(t,"a",-s),St=fe;function kt(t,s){let i=de(t),n=i.filter((c)=>he(c,t)),r=0,o=0,a=[];if(n.length>1){let c=Wt(n);for(let d=0;d<n.length;++d){let l=n[d];l.angle=Math.atan2(l.x-c.x,l.y-c.y)}n.sort((d,l)=>l.angle-d.angle);let g=n[n.length-1];for(let d=0;d<n.length;++d){let l=n[d];o+=(g.x+l.x)*(l.y-g.y);let S={x:(l.x+g.x)/2,y:(l.y+g.y)/2},y=null;for(let E=0;E<l.parentIndex.length;++E)if(g.parentIndex.includes(l.parentIndex[E])){let w=t[l.parentIndex[E]],D=Math.atan2(l.x-w.x,l.y-w.y),q=Math.atan2(g.x-w.x,g.y-w.y),F=q-D;if(F<0)F+=2*Math.PI;let N=q-F/2,b=ot(S,{x:w.x+w.radius*Math.sin(N),y:w.y+w.radius*Math.cos(N)});if(b>w.radius*2)b=w.radius*2;if(y==null||y.width>b)y={circle:w,width:b,p1:l,p2:g,large:b>w.radius,sweep:!0}}if(y!=null)a.push(y),r+=Et(y.circle.radius,y.width),g=l}}else{let c=t[0];for(let d=1;d<t.length;++d)if(t[d].radius<c.radius)c=t[d];let g=!1;for(let d=0;d<t.length;++d)if(ot(t[d],c)>Math.abs(c.radius-t[d].radius)){g=!0;break}if(g)r=o=0;else r=c.radius*c.radius*Math.PI,a.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-0.0000000001,y:c.y+c.radius},width:c.radius*2,large:!0,sweep:!0})}if(o/=2,s)s.area=r+o,s.arcArea=r,s.polygonArea=o,s.arcs=a,s.innerPoints=n,s.intersectionPoints=i;return r+o}function he(t,s){return s.every((i)=>ot(t,i)<i.radius+0.0000000001)}function de(t){let s=[];for(let i=0;i<t.length;++i)for(let n=i+1;n<t.length;++n){let r=Gt(t[i],t[n]);for(let o of r)o.parentIndex=[i,n],s.push(o)}return s}function Et(t,s){return t*t*Math.acos(1-s/t)-(t-s)*Math.sqrt(s*(2*t-s))}function ot(t,s){return Math.sqrt((t.x-s.x)*(t.x-s.x)+(t.y-s.y)*(t.y-s.y))}function Rt(t,s,i){if(i>=t+s)return 0;if(i<=Math.abs(t-s))return Math.PI*Math.min(t,s)*Math.min(t,s);let n=t-(i*i-s*s+t*t)/(2*i),r=s-(i*i-t*t+s*s)/(2*i);return Et(t,n)+Et(s,r)}function Gt(t,s){let i=ot(t,s),n=t.radius,r=s.radius;if(i>=n+r||i<=Math.abs(n-r))return[];let o=(n*n-r*r+i*i)/(2*i),a=Math.sqrt(n*n-o*o),c=t.x+o*(s.x-t.x)/i,g=t.y+o*(s.y-t.y)/i,d=-(s.y-t.y)*(a/i),l=-(s.x-t.x)*(a/i);return[{x:c+d,y:g-l},{x:c-d,y:g+l}]}function Wt(t){let s={x:0,y:0};for(let i of t)s.x+=i.x,s.y+=i.y;return s.x/=t.length,s.y/=t.length,s}function ge(t,s,i,n){n=n||{};let r=n.maxIterations||100,o=n.tolerance||0.0000000001,a=t(s),c=t(i),g=i-s;if(a*c>0)throw"Initial bisect points must have opposite signs";if(a===0)return s;if(c===0)return i;for(let d=0;d<r;++d){g/=2;let l=s+g,S=t(l);if(S*a>=0)s=l;if(Math.abs(g)<o||S===0)return l}return s+g}function Tt(t){let s=Array(t);for(let i=0;i<t;++i)s[i]=0;return s}function qt(t,s){return Tt(t).map(()=>Tt(s))}function pt(t,s){let i=0;for(let n=0;n<t.length;++n)i+=t[n]*s[n];return i}function zt(t){return Math.sqrt(pt(t,t))}function At(t,s,i){for(let n=0;n<s.length;++n)t[n]=s[n]*i}function gt(t,s,i,n,r){for(let o=0;o<t.length;++o)t[o]=s*i[o]+n*r[o]}function Kt(t,s,i){i=i||{};let n=i.maxIterations||s.length*200,r=i.nonZeroDelta||1.05,o=i.zeroDelta||0.001,a=i.minErrorDelta||0.000001,c=i.minErrorDelta||0.00001,g=i.rho!==void 0?i.rho:1,d=i.chi!==void 0?i.chi:2,l=i.psi!==void 0?i.psi:-0.5,S=i.sigma!==void 0?i.sigma:0.5,y,E=s.length,w=Array(E+1);w[0]=s,w[0].fx=t(s),w[0].id=0;for(let T=0;T<E;++T){let u=s.slice();u[T]=u[T]?u[T]*r:o,w[T+1]=u,w[T+1].fx=t(u),w[T+1].id=T+1}function D(T){for(let u=0;u<T.length;u++)w[E][u]=T[u];w[E].fx=T.fx}let q=(T,u)=>T.fx-u.fx,F=s.slice(),N=s.slice(),b=s.slice(),_=s.slice();for(let T=0;T<n;++T){if(w.sort(q),i.history){let v=w.map((x)=>{let W=x.slice();return W.fx=x.fx,W.id=x.id,W});v.sort((x,W)=>x.id-W.id),i.history.push({x:w[0].slice(),fx:w[0].fx,simplex:v})}y=0;for(let v=0;v<E;++v)y=Math.max(y,Math.abs(w[0][v]-w[1][v]));if(Math.abs(w[0].fx-w[E].fx)<a&&y<c)break;for(let v=0;v<E;++v){F[v]=0;for(let x=0;x<E;++x)F[v]+=w[x][v];F[v]/=E}let u=w[E];if(gt(N,1+g,F,-g,u),N.fx=t(N),N.fx<w[0].fx)if(gt(_,1+d,F,-d,u),_.fx=t(_),_.fx<N.fx)D(_);else D(N);else if(N.fx>=w[E-1].fx){let v=!1;if(N.fx>u.fx)if(gt(b,1+l,F,-l,u),b.fx=t(b),b.fx<u.fx)D(b);else v=!0;else if(gt(b,1-l*g,F,l*g,u),b.fx=t(b),b.fx<N.fx)D(b);else v=!0;if(v){if(S>=1)break;for(let x=1;x<w.length;++x)gt(w[x],1-S,w[0],S,w[x]),w[x].fx=t(w[x])}}else D(N)}return w.sort(q),{fx:w[0].fx,x:w[0]}}function xe(t,s,i,n,r,o,a){let c=i.fx,g=pt(i.fxprime,s),d=c,l=c,S=g,y=0;r=r||1,o=o||0.000001,a=a||0.1;function E(w,D,q){for(let F=0;F<16;++F)if(r=(w+D)/2,gt(n.x,1,i.x,r,s),d=n.fx=t(n.x,n.fxprime),S=pt(n.fxprime,s),d>c+o*r*g||d>=q)D=r;else{if(Math.abs(S)<=-a*g)return r;if(S*(D-w)>=0)D=w;w=r,q=d}return 0}for(let w=0;w<10;++w){if(gt(n.x,1,i.x,r,s),d=n.fx=t(n.x,n.fxprime),S=pt(n.fxprime,s),d>c+o*r*g||w&&d>=l)return E(y,r,l);if(Math.abs(S)<=-a*g)return r;if(S>=0)return E(r,y,d);l=d,y=r,r*=2}return r}function ye(t,s,i){let n={x:s.slice(),fx:0,fxprime:s.slice()},r={x:s.slice(),fx:0,fxprime:s.slice()},o=s.slice(),a,c,g=1,d;i=i||{},d=i.maxIterations||s.length*20,n.fx=t(n.x,n.fxprime),a=n.fxprime.slice(),At(a,n.fxprime,-1);for(let l=0;l<d;++l){if(g=xe(t,a,n,r,g),i.history)i.history.push({x:n.x.slice(),fx:n.fx,fxprime:n.fxprime.slice(),alpha:g});if(!g)At(a,n.fxprime,-1);else{gt(o,1,r.fxprime,-1,n.fxprime);let S=pt(n.fxprime,n.fxprime),y=Math.max(0,pt(o,r.fxprime)/S);gt(a,y,a,-1,r.fxprime),c=n,n=r,r=c}if(zt(n.fxprime)<=0.00001)break}if(i.history)i.history.push({x:n.x.slice(),fx:n.fx,fxprime:n.fxprime.slice(),alpha:g});return n}function Ht(t,s={}){s.maxIterations=s.maxIterations||500;let i=s.initialLayout||ve,n=s.lossFunction||mt,r=pe(t,s),o=i(r,s),a=Object.keys(o),c=[];for(let l of a)c.push(o[l].x),c.push(o[l].y);let d=Kt((l)=>{let S={};for(let y=0;y<a.length;++y){let E=a[y];S[E]={x:l[2*y],y:l[2*y+1],radius:o[E].radius}}return n(S,r)},c,s).x;for(let l=0;l<a.length;++l){let S=a[l];o[S].x=d[2*l],o[S].y=d[2*l+1]}return o}var Yt=0.0000000001;function Ct(t,s,i){if(Math.min(t,s)*Math.min(t,s)*Math.PI<=i+Yt)return Math.abs(t-s);return ge((n)=>Rt(t,s,n)-i,0,t+s)}function pe(t,s={}){let i=s.distinct,n=t.map((c)=>Object.assign({},c));function r(c){return c.join(";")}if(i){let c=new Map;for(let g of n)for(let d=0;d<g.sets.length;d++){let l=String(g.sets[d]);c.set(l,g.size+(c.get(l)||0));for(let S=d+1;S<g.sets.length;S++){let y=String(g.sets[S]),E=`${l};${y}`,w=`${y};${l}`;c.set(E,g.size+(c.get(E)||0)),c.set(w,g.size+(c.get(w)||0))}}for(let g of n)if(g.sets.length<3)g.size=c.get(r(g.sets))}let o=[],a=new Set;for(let c of n)if(c.sets.length===1)o.push(c.sets[0]);else if(c.sets.length===2){let g=c.sets[0],d=c.sets[1];a.add(r(c.sets)),a.add(r([d,g]))}o.sort((c,g)=>c===g?0:c<g?-1:1);for(let c=0;c<o.length;++c){let g=o[c];for(let d=c+1;d<o.length;++d){let l=o[d];if(!a.has(r([g,l])))n.push({sets:[g,l],size:0})}}return n}function me(t,s,i){let n=qt(s.length,s.length),r=qt(s.length,s.length);return t.filter((o)=>o.sets.length===2).forEach((o)=>{let a=i[o.sets[0]],c=i[o.sets[1]],g=Math.sqrt(s[a].size/Math.PI),d=Math.sqrt(s[c].size/Math.PI),l=Ct(g,d,o.size);n[a][c]=n[c][a]=l;let S=0;if(o.size+0.0000000001>=Math.min(s[a].size,s[c].size))S=1;else if(o.size<=0.0000000001)S=-1;r[a][c]=r[c][a]=S}),{distances:n,constraints:r}}function be(t,s,i,n){for(let o=0;o<s.length;++o)s[o]=0;let r=0;for(let o=0;o<i.length;++o){let a=t[2*o],c=t[2*o+1];for(let g=o+1;g<i.length;++g){let d=t[2*g],l=t[2*g+1],S=i[o][g],y=n[o][g],E=(d-a)*(d-a)+(l-c)*(l-c),w=Math.sqrt(E),D=E-S*S;if(y>0&&w<=S||y<0&&w>=S)continue;r+=2*D*D,s[2*o]+=4*D*(a-d),s[2*o+1]+=4*D*(c-l),s[2*g]+=4*D*(d-a),s[2*g+1]+=4*D*(l-c)}}return r}function ve(t,s={}){let i=Ie(t,s),n=s.lossFunction||mt;if(t.length>=8){let r=ke(t,s),o=n(r,t),a=n(i,t);if(o+0.00000001<a)i=r}return i}function ke(t,s={}){let i=s.restarts||10,n=[],r={};for(let y of t)if(y.sets.length===1)r[y.sets[0]]=n.length,n.push(y);let{distances:o,constraints:a}=me(t,n,r),c=zt(o.map(zt))/o.length;o=o.map((y)=>y.map((E)=>E/c));let g=(y,E)=>be(y,E,o,a),d=null;for(let y=0;y<i;++y){let E=Tt(o.length*2).map(Math.random),w=ye(g,E,s);if(!d||w.fx<d.fx)d=w}let l=d.x,S={};for(let y=0;y<n.length;++y){let E=n[y];S[E.sets[0]]={x:l[2*y]*c,y:l[2*y+1]*c,radius:Math.sqrt(E.size/Math.PI)}}if(s.history)for(let y of s.history)At(y.x,c);return S}function Ie(t,s){let i=s&&s.lossFunction?s.lossFunction:mt,n={},r={};for(let S of t)if(S.sets.length===1){let y=S.sets[0];n[y]={x:10000000000,y:10000000000,rowid:n.length,size:S.size,radius:Math.sqrt(S.size/Math.PI)},r[y]=[]}t=t.filter((S)=>S.sets.length===2);for(let S of t){let y=S.weight!=null?S.weight:1,E=S.sets[0],w=S.sets[1];if(S.size+Yt>=Math.min(n[E].size,n[w].size))y=0;r[E].push({set:w,size:S.size,weight:y}),r[w].push({set:E,size:S.size,weight:y})}let o=[];Object.keys(r).forEach((S)=>{let y=0;for(let E=0;E<r[S].length;++E)y+=r[S][E].size*r[S][E].weight;o.push({set:S,size:y})});function a(S,y){return y.size-S.size}o.sort(a);let c={};function g(S){return S.set in c}function d(S,y){n[y].x=S.x,n[y].y=S.y,c[y]=!0}d({x:0,y:0},o[0].set);for(let S=1;S<o.length;++S){let y=o[S].set,E=r[y].filter(g),w=n[y];if(E.sort(a),E.length===0)throw"ERROR: missing pairwise overlap information";let D=[];for(var l=0;l<E.length;++l){let N=n[E[l].set],b=Ct(w.radius,N.radius,E[l].size);D.push({x:N.x+b,y:N.y}),D.push({x:N.x-b,y:N.y}),D.push({y:N.y+b,x:N.x}),D.push({y:N.y-b,x:N.x});for(let _=l+1;_<E.length;++_){let T=n[E[_].set],u=Ct(w.radius,T.radius,E[_].size),v=Gt({x:N.x,y:N.y,radius:b},{x:T.x,y:T.y,radius:u});D.push(...v)}}let q=100000000000000000000000000000000000000000000000000,F=D[0];for(let N of D){n[y].x=N.x,n[y].y=N.y;let b=i(n,t);if(b<q)q=b,F=N}d(F,y)}return n}function mt(t,s){let i=0;for(let n of s){if(n.sets.length===1)continue;let r;if(n.sets.length===2){let a=t[n.sets[0]],c=t[n.sets[1]];r=Rt(a.radius,c.radius,ot(a,c))}else r=kt(n.sets.map((a)=>t[a]));let o=n.weight!=null?n.weight:1;i+=o*(r-n.size)*(r-n.size)}return i}function Xt(t,s){let i=0;for(let n of s){if(n.sets.length===1)continue;let r;if(n.sets.length===2){let c=t[n.sets[0]],g=t[n.sets[1]];r=Rt(c.radius,g.radius,ot(c,g))}else r=kt(n.sets.map((c)=>t[c]));let o=n.weight!=null?n.weight:1,a=Math.log((r+1)/(n.size+1));i+=o*a*a}return i}function Me(t,s,i){if(i==null)t.sort((r,o)=>o.radius-r.radius);else t.sort(i);if(t.length>0){let r=t[0].x,o=t[0].y;for(let a of t)a.x-=r,a.y-=o}if(t.length===2){if(ot(t[0],t[1])<Math.abs(t[1].radius-t[0].radius))t[1].x=t[0].x+t[0].radius-t[1].radius-0.0000000001,t[1].y=t[0].y}if(t.length>1){let r=Math.atan2(t[1].x,t[1].y)-s,o=Math.cos(r),a=Math.sin(r);for(let c of t){let{x:g,y:d}=c;c.x=o*g-a*d,c.y=a*g+o*d}}if(t.length>2){let r=Math.atan2(t[2].x,t[2].y)-s;while(r<0)r+=2*Math.PI;while(r>2*Math.PI)r-=2*Math.PI;if(r>Math.PI){let o=t[1].y/(0.0000000001+t[1].x);for(let a of t){var n=(a.x+o*a.y)/(1+o*o);a.x=2*n-a.x,a.y=2*n*o-a.y}}}}function Se(t){t.forEach((r)=>{r.parent=r});function s(r){if(r.parent!==r)r.parent=s(r.parent);return r.parent}function i(r,o){let a=s(r),c=s(o);a.parent=c}for(let r=0;r<t.length;++r)for(let o=r+1;o<t.length;++o){let a=t[r].radius+t[o].radius;if(ot(t[r],t[o])+0.0000000001<a)i(t[o],t[r])}let n=new Map;for(let r=0;r<t.length;++r){let o=s(t[r]).parent.setid;if(!n.has(o))n.set(o,[]);n.get(o).push(t[r])}return t.forEach((r)=>{delete r.parent}),Array.from(n.values())}function Dt(t){let s=(i)=>{let n=t.reduce((o,a)=>Math.max(o,a[i]+a.radius),Number.NEGATIVE_INFINITY),r=t.reduce((o,a)=>Math.min(o,a[i]-a.radius),Number.POSITIVE_INFINITY);return{max:n,min:r}};return{xRange:s("x"),yRange:s("y")}}function Zt(t,s,i){if(s==null)s=Math.PI/2;let n=$t(t).map((d)=>Object.assign({},d)),r=Se(n);for(let d of r){Me(d,s,i);let l=Dt(d);d.size=(l.xRange.max-l.xRange.min)*(l.yRange.max-l.yRange.min),d.bounds=l}r.sort((d,l)=>l.size-d.size),n=r[0];let o=n.bounds,a=(o.xRange.max-o.xRange.min)/50;function c(d,l,S){if(!d)return;let y=d.bounds,E,w;if(l)E=o.xRange.max-y.xRange.min+a;else{E=o.xRange.max-y.xRange.max;let D=(y.xRange.max-y.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;if(D<0)E+=D}if(S)w=o.yRange.max-y.yRange.min+a;else{w=o.yRange.max-y.yRange.max;let D=(y.yRange.max-y.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;if(D<0)w+=D}for(let D of d)D.x+=E,D.y+=w,n.push(D)}let g=1;while(g<r.length)c(r[g],!0,!1),c(r[g+1],!1,!0),c(r[g+2],!0,!0),g+=3,o=Dt(n);return Qt(n)}function Jt(t,s,i,n,r){let o=$t(t);s-=2*n,i-=2*n;let{xRange:a,yRange:c}=Dt(o);if(a.max===a.min||c.max===c.min)return console.log("not scaling solution: zero size detected"),t;let g,d;if(r){let E=Math.sqrt(r/Math.PI)*2;g=s/E,d=i/E}else g=s/(a.max-a.min),d=i/(c.max-c.min);let l=Math.min(d,g),S=(s-(a.max-a.min)*l)/2,y=(i-(c.max-c.min)*l)/2;return Qt(o.map((E)=>({radius:l*E.radius,x:n+S+(E.x-a.min)*l,y:n+y+(E.y-c.min)*l,setid:E.setid})))}function Qt(t){let s={};for(let i of t)s[i.setid]=i;return s}function $t(t){return Object.keys(t).map((i)=>Object.assign(t[i],{setid:i}))}function te(t={}){let s=!1,i=600,n=350,r=15,o=1000,a=Math.PI/2,c=!0,g=null,d=!0,l=!0,S=null,y=null,E=!1,w=null,D=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,q={},F=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],N=0,b=function(v){if(v in q)return q[v];var x=q[v]=F[N];if(N+=1,N>=F.length)N=0;return x},_=Ht,T=mt;function u(v){let x=v.datum(),W=new Set;x.forEach((z)=>{if(z.size==0&&z.sets.length==1)W.add(z.sets[0])}),x=x.filter((z)=>!z.sets.some((J)=>W.has(J)));let C={},K={};if(x.length>0){let z=_(x,{lossFunction:T,distinct:E});if(c)z=Zt(z,a,y);C=Jt(z,i,n,r,g),K=se(C,x,D)}let at={};x.forEach((z)=>{if(z.label)at[z.sets]=z.label});function nt(z){if(z.sets in at)return at[z.sets];if(z.sets.length==1)return""+z.sets[0]}v.selectAll("svg").data([C]).enter().append("svg");let Z=v.select("svg");if(s)Z.attr("viewBox",`0 0 ${i} ${n}`);else Z.attr("width",i).attr("height",n);let G={},H=!1;Z.selectAll(".venn-area path").each(function(z){let J=this.getAttribute("d");if(z.sets.length==1&&J&&!E)H=!0,G[z.sets[0]]=Ee(J)});function V(z){return(J)=>{let yt=z.sets.map((dt)=>{let ht=G[dt],rt=C[dt];if(!ht)ht={x:i/2,y:n/2,radius:1};if(!rt)rt={x:i/2,y:n/2,radius:1};return{x:ht.x*(1-J)+rt.x*J,y:ht.y*(1-J)+rt.y*J,radius:ht.radius*(1-J)+rt.radius*J}});return Ut(yt,w)}}let Q=Z.selectAll(".venn-area").data(x,(z)=>z.sets),st=Q.enter().append("g").attr("class",(z)=>`venn-area venn-${z.sets.length==1?"circle":"intersection"}${z.colour||z.color?" venn-coloured":""}`).attr("data-venn-sets",(z)=>z.sets.join("_")),tt=st.append("path"),lt=st.append("text").attr("class","label").text((z)=>nt(z)).attr("text-anchor","middle").attr("dy",".35em").attr("x",i/2).attr("y",n/2);if(l)tt.style("fill-opacity","0").filter((z)=>z.sets.length==1).style("fill",(z)=>z.colour?z.colour:z.color?z.color:b(z.sets)).style("fill-opacity",".25"),lt.style("fill",(z)=>{if(z.colour||z.color)return"#FFF";if(t.textFill)return t.textFill;return z.sets.length==1?b(z.sets):"#444"});function it(z){if(typeof z.transition==="function")return z.transition("venn").duration(o);return z}let et=v;if(H&&typeof et.transition==="function")et=it(v),et.selectAll("path").attrTween("d",V);else et.selectAll("path").attr("d",(z)=>Ut(z.sets.map((J)=>C[J])),w);let U=et.selectAll("text").filter((z)=>(z.sets in K)).text((z)=>nt(z)).attr("x",(z)=>Math.floor(K[z.sets].x)).attr("y",(z)=>Math.floor(K[z.sets].y));if(d)if(H)if("on"in U)U.on("end",wt(C,nt));else U.each("end",wt(C,nt));else U.each(wt(C,nt));let ft=it(Q.exit()).remove();if(typeof Q.transition==="function")ft.selectAll("path").attrTween("d",V);let ut=ft.selectAll("text").attr("x",i/2).attr("y",n/2);if(S!==null)lt.style("font-size","0px"),U.style("font-size",S),ut.style("font-size","0px");return{circles:C,textCentres:K,nodes:Q,enter:st,update:et,exit:ft}}return u.wrap=function(v){if(!arguments.length)return d;return d=v,u},u.useViewBox=function(){return s=!0,u},u.width=function(v){if(!arguments.length)return i;return i=v,u},u.height=function(v){if(!arguments.length)return n;return n=v,u},u.padding=function(v){if(!arguments.length)return r;return r=v,u},u.distinct=function(v){if(!arguments.length)return E;return E=v,u},u.colours=function(v){if(!arguments.length)return b;return b=v,u},u.colors=function(v){if(!arguments.length)return b;return b=v,u},u.fontSize=function(v){if(!arguments.length)return S;return S=v,u},u.round=function(v){if(!arguments.length)return w;return w=v,u},u.duration=function(v){if(!arguments.length)return o;return o=v,u},u.layoutFunction=function(v){if(!arguments.length)return _;return _=v,u},u.normalize=function(v){if(!arguments.length)return c;return c=v,u},u.scaleToFit=function(v){if(!arguments.length)return g;return g=v,u},u.styled=function(v){if(!arguments.length)return l;return l=v,u},u.orientation=function(v){if(!arguments.length)return a;return a=v,u},u.orientationOrder=function(v){if(!arguments.length)return y;return y=v,u},u.lossFunction=function(v){if(!arguments.length)return T;return T=v==="default"?mt:v==="logRatio"?Xt:v,u},u}function wt(t,s){return function(i){let n=this,r=t[i.sets[0]].radius||50,o=s(i)||"",a=o.split(/\s+/).reverse(),c=3,g=(o.length+a.length)/3,d=a.pop(),l=[d],S=0,y=1.1;n.textContent=null;let E=[];function w(b){let _=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return _.textContent=b,E.push(_),n.append(_),_}let D=w(d);while(!0){if(d=a.pop(),!d)break;l.push(d);let b=l.join(" ");if(D.textContent=b,b.length>g&&D.getComputedTextLength()>r)l.pop(),D.textContent=l.join(" "),l=[d],D=w(d),S++}let q=0.35-S*y/2,F=n.getAttribute("x"),N=n.getAttribute("y");E.forEach((b,_)=>{b.setAttribute("x",F),b.setAttribute("y",N),b.setAttribute("dy",`${q+_*y}em`)})}}function _t(t,s,i){let n=s[0].radius-ot(s[0],t);for(let r=1;r<s.length;++r){let o=s[r].radius-ot(s[r],t);if(o<=n)n=o}for(let r=0;r<i.length;++r){let o=ot(i[r],t)-i[r].radius;if(o<=n)n=o}return n}function ee(t,s,i){let n=[];for(let l of t)n.push({x:l.x,y:l.y}),n.push({x:l.x+l.radius/2,y:l.y}),n.push({x:l.x-l.radius/2,y:l.y}),n.push({x:l.x,y:l.y+l.radius/2}),n.push({x:l.x,y:l.y-l.radius/2});let r=n[0],o=_t(n[0],t,s);for(let l=1;l<n.length;++l){let S=_t(n[l],t,s);if(S>=o)r=n[l],o=S}let a=Kt((l)=>-1*_t({x:l[0],y:l[1]},t,s),[r.x,r.y],{maxIterations:500,minErrorDelta:0.0000000001}).x,c={x:i?0:a[0],y:a[1]},g=!0;for(let l of t)if(ot(c,l)>l.radius){g=!1;break}for(let l of s)if(ot(c,l)<l.radius){g=!1;break}if(g)return c;if(t.length==1)return{x:t[0].x,y:t[0].y};let d={};if(kt(t,d),d.arcs.length===0)return{x:0,y:-1000,disjoint:!0};if(d.arcs.length==1)return{x:d.arcs[0].circle.x,y:d.arcs[0].circle.y};if(s.length)return ee(t,[]);return Wt(d.arcs.map((l)=>l.p1))}function we(t){let s={},i=Object.keys(t);for(let n of i)s[n]=[];for(let n=0;n<i.length;n++){let r=i[n],o=t[r];for(let a=n+1;a<i.length;++a){let c=i[a],g=t[c],d=ot(o,g);if(d+g.radius<=o.radius+0.0000000001)s[c].push(r);else if(d+o.radius<=g.radius+0.0000000001)s[r].push(c)}}return s}function se(t,s,i){let n={},r=we(t);for(let o=0;o<s.length;++o){let a=s[o].sets,c={},g={};for(let y=0;y<a.length;++y){c[a[y]]=!0;let E=r[a[y]];for(let w=0;w<E.length;++w)g[E[w]]=!0}let d=[],l=[];for(let y in t)if(y in c)d.push(t[y]);else if(!(y in g))l.push(t[y]);let S=ee(d,l,i);if(n[a]=S,S.disjoint&&s[o].size>0)console.log("WARNING: area "+a+" not represented on screen")}return n}function _e(t,s,i){let n=[];return n.push(`
1
+ import{e,ne,Qn,f,h,B,k,j,A,L,R,I,M,P,O,p,X,K,m}from"./index.5sj251kq.js";var fe=(t,s)=>Qn(t,"a",-s),St=fe;function kt(t,s){let i=de(t),n=i.filter((c)=>he(c,t)),r=0,o=0,a=[];if(n.length>1){let c=Wt(n);for(let d=0;d<n.length;++d){let l=n[d];l.angle=Math.atan2(l.x-c.x,l.y-c.y)}n.sort((d,l)=>l.angle-d.angle);let g=n[n.length-1];for(let d=0;d<n.length;++d){let l=n[d];o+=(g.x+l.x)*(l.y-g.y);let S={x:(l.x+g.x)/2,y:(l.y+g.y)/2},y=null;for(let E=0;E<l.parentIndex.length;++E)if(g.parentIndex.includes(l.parentIndex[E])){let w=t[l.parentIndex[E]],D=Math.atan2(l.x-w.x,l.y-w.y),q=Math.atan2(g.x-w.x,g.y-w.y),F=q-D;if(F<0)F+=2*Math.PI;let N=q-F/2,b=ot(S,{x:w.x+w.radius*Math.sin(N),y:w.y+w.radius*Math.cos(N)});if(b>w.radius*2)b=w.radius*2;if(y==null||y.width>b)y={circle:w,width:b,p1:l,p2:g,large:b>w.radius,sweep:!0}}if(y!=null)a.push(y),r+=Et(y.circle.radius,y.width),g=l}}else{let c=t[0];for(let d=1;d<t.length;++d)if(t[d].radius<c.radius)c=t[d];let g=!1;for(let d=0;d<t.length;++d)if(ot(t[d],c)>Math.abs(c.radius-t[d].radius)){g=!0;break}if(g)r=o=0;else r=c.radius*c.radius*Math.PI,a.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-0.0000000001,y:c.y+c.radius},width:c.radius*2,large:!0,sweep:!0})}if(o/=2,s)s.area=r+o,s.arcArea=r,s.polygonArea=o,s.arcs=a,s.innerPoints=n,s.intersectionPoints=i;return r+o}function he(t,s){return s.every((i)=>ot(t,i)<i.radius+0.0000000001)}function de(t){let s=[];for(let i=0;i<t.length;++i)for(let n=i+1;n<t.length;++n){let r=Gt(t[i],t[n]);for(let o of r)o.parentIndex=[i,n],s.push(o)}return s}function Et(t,s){return t*t*Math.acos(1-s/t)-(t-s)*Math.sqrt(s*(2*t-s))}function ot(t,s){return Math.sqrt((t.x-s.x)*(t.x-s.x)+(t.y-s.y)*(t.y-s.y))}function Rt(t,s,i){if(i>=t+s)return 0;if(i<=Math.abs(t-s))return Math.PI*Math.min(t,s)*Math.min(t,s);let n=t-(i*i-s*s+t*t)/(2*i),r=s-(i*i-t*t+s*s)/(2*i);return Et(t,n)+Et(s,r)}function Gt(t,s){let i=ot(t,s),n=t.radius,r=s.radius;if(i>=n+r||i<=Math.abs(n-r))return[];let o=(n*n-r*r+i*i)/(2*i),a=Math.sqrt(n*n-o*o),c=t.x+o*(s.x-t.x)/i,g=t.y+o*(s.y-t.y)/i,d=-(s.y-t.y)*(a/i),l=-(s.x-t.x)*(a/i);return[{x:c+d,y:g-l},{x:c-d,y:g+l}]}function Wt(t){let s={x:0,y:0};for(let i of t)s.x+=i.x,s.y+=i.y;return s.x/=t.length,s.y/=t.length,s}function ge(t,s,i,n){n=n||{};let r=n.maxIterations||100,o=n.tolerance||0.0000000001,a=t(s),c=t(i),g=i-s;if(a*c>0)throw"Initial bisect points must have opposite signs";if(a===0)return s;if(c===0)return i;for(let d=0;d<r;++d){g/=2;let l=s+g,S=t(l);if(S*a>=0)s=l;if(Math.abs(g)<o||S===0)return l}return s+g}function Tt(t){let s=Array(t);for(let i=0;i<t;++i)s[i]=0;return s}function qt(t,s){return Tt(t).map(()=>Tt(s))}function pt(t,s){let i=0;for(let n=0;n<t.length;++n)i+=t[n]*s[n];return i}function zt(t){return Math.sqrt(pt(t,t))}function At(t,s,i){for(let n=0;n<s.length;++n)t[n]=s[n]*i}function gt(t,s,i,n,r){for(let o=0;o<t.length;++o)t[o]=s*i[o]+n*r[o]}function Kt(t,s,i){i=i||{};let n=i.maxIterations||s.length*200,r=i.nonZeroDelta||1.05,o=i.zeroDelta||0.001,a=i.minErrorDelta||0.000001,c=i.minErrorDelta||0.00001,g=i.rho!==void 0?i.rho:1,d=i.chi!==void 0?i.chi:2,l=i.psi!==void 0?i.psi:-0.5,S=i.sigma!==void 0?i.sigma:0.5,y,E=s.length,w=Array(E+1);w[0]=s,w[0].fx=t(s),w[0].id=0;for(let T=0;T<E;++T){let u=s.slice();u[T]=u[T]?u[T]*r:o,w[T+1]=u,w[T+1].fx=t(u),w[T+1].id=T+1}function D(T){for(let u=0;u<T.length;u++)w[E][u]=T[u];w[E].fx=T.fx}let q=(T,u)=>T.fx-u.fx,F=s.slice(),N=s.slice(),b=s.slice(),_=s.slice();for(let T=0;T<n;++T){if(w.sort(q),i.history){let v=w.map((x)=>{let W=x.slice();return W.fx=x.fx,W.id=x.id,W});v.sort((x,W)=>x.id-W.id),i.history.push({x:w[0].slice(),fx:w[0].fx,simplex:v})}y=0;for(let v=0;v<E;++v)y=Math.max(y,Math.abs(w[0][v]-w[1][v]));if(Math.abs(w[0].fx-w[E].fx)<a&&y<c)break;for(let v=0;v<E;++v){F[v]=0;for(let x=0;x<E;++x)F[v]+=w[x][v];F[v]/=E}let u=w[E];if(gt(N,1+g,F,-g,u),N.fx=t(N),N.fx<w[0].fx)if(gt(_,1+d,F,-d,u),_.fx=t(_),_.fx<N.fx)D(_);else D(N);else if(N.fx>=w[E-1].fx){let v=!1;if(N.fx>u.fx)if(gt(b,1+l,F,-l,u),b.fx=t(b),b.fx<u.fx)D(b);else v=!0;else if(gt(b,1-l*g,F,l*g,u),b.fx=t(b),b.fx<N.fx)D(b);else v=!0;if(v){if(S>=1)break;for(let x=1;x<w.length;++x)gt(w[x],1-S,w[0],S,w[x]),w[x].fx=t(w[x])}}else D(N)}return w.sort(q),{fx:w[0].fx,x:w[0]}}function xe(t,s,i,n,r,o,a){let c=i.fx,g=pt(i.fxprime,s),d=c,l=c,S=g,y=0;r=r||1,o=o||0.000001,a=a||0.1;function E(w,D,q){for(let F=0;F<16;++F)if(r=(w+D)/2,gt(n.x,1,i.x,r,s),d=n.fx=t(n.x,n.fxprime),S=pt(n.fxprime,s),d>c+o*r*g||d>=q)D=r;else{if(Math.abs(S)<=-a*g)return r;if(S*(D-w)>=0)D=w;w=r,q=d}return 0}for(let w=0;w<10;++w){if(gt(n.x,1,i.x,r,s),d=n.fx=t(n.x,n.fxprime),S=pt(n.fxprime,s),d>c+o*r*g||w&&d>=l)return E(y,r,l);if(Math.abs(S)<=-a*g)return r;if(S>=0)return E(r,y,d);l=d,y=r,r*=2}return r}function ye(t,s,i){let n={x:s.slice(),fx:0,fxprime:s.slice()},r={x:s.slice(),fx:0,fxprime:s.slice()},o=s.slice(),a,c,g=1,d;i=i||{},d=i.maxIterations||s.length*20,n.fx=t(n.x,n.fxprime),a=n.fxprime.slice(),At(a,n.fxprime,-1);for(let l=0;l<d;++l){if(g=xe(t,a,n,r,g),i.history)i.history.push({x:n.x.slice(),fx:n.fx,fxprime:n.fxprime.slice(),alpha:g});if(!g)At(a,n.fxprime,-1);else{gt(o,1,r.fxprime,-1,n.fxprime);let S=pt(n.fxprime,n.fxprime),y=Math.max(0,pt(o,r.fxprime)/S);gt(a,y,a,-1,r.fxprime),c=n,n=r,r=c}if(zt(n.fxprime)<=0.00001)break}if(i.history)i.history.push({x:n.x.slice(),fx:n.fx,fxprime:n.fxprime.slice(),alpha:g});return n}function Ht(t,s={}){s.maxIterations=s.maxIterations||500;let i=s.initialLayout||ve,n=s.lossFunction||mt,r=pe(t,s),o=i(r,s),a=Object.keys(o),c=[];for(let l of a)c.push(o[l].x),c.push(o[l].y);let d=Kt((l)=>{let S={};for(let y=0;y<a.length;++y){let E=a[y];S[E]={x:l[2*y],y:l[2*y+1],radius:o[E].radius}}return n(S,r)},c,s).x;for(let l=0;l<a.length;++l){let S=a[l];o[S].x=d[2*l],o[S].y=d[2*l+1]}return o}var Yt=0.0000000001;function Ct(t,s,i){if(Math.min(t,s)*Math.min(t,s)*Math.PI<=i+Yt)return Math.abs(t-s);return ge((n)=>Rt(t,s,n)-i,0,t+s)}function pe(t,s={}){let i=s.distinct,n=t.map((c)=>Object.assign({},c));function r(c){return c.join(";")}if(i){let c=new Map;for(let g of n)for(let d=0;d<g.sets.length;d++){let l=String(g.sets[d]);c.set(l,g.size+(c.get(l)||0));for(let S=d+1;S<g.sets.length;S++){let y=String(g.sets[S]),E=`${l};${y}`,w=`${y};${l}`;c.set(E,g.size+(c.get(E)||0)),c.set(w,g.size+(c.get(w)||0))}}for(let g of n)if(g.sets.length<3)g.size=c.get(r(g.sets))}let o=[],a=new Set;for(let c of n)if(c.sets.length===1)o.push(c.sets[0]);else if(c.sets.length===2){let g=c.sets[0],d=c.sets[1];a.add(r(c.sets)),a.add(r([d,g]))}o.sort((c,g)=>c===g?0:c<g?-1:1);for(let c=0;c<o.length;++c){let g=o[c];for(let d=c+1;d<o.length;++d){let l=o[d];if(!a.has(r([g,l])))n.push({sets:[g,l],size:0})}}return n}function me(t,s,i){let n=qt(s.length,s.length),r=qt(s.length,s.length);return t.filter((o)=>o.sets.length===2).forEach((o)=>{let a=i[o.sets[0]],c=i[o.sets[1]],g=Math.sqrt(s[a].size/Math.PI),d=Math.sqrt(s[c].size/Math.PI),l=Ct(g,d,o.size);n[a][c]=n[c][a]=l;let S=0;if(o.size+0.0000000001>=Math.min(s[a].size,s[c].size))S=1;else if(o.size<=0.0000000001)S=-1;r[a][c]=r[c][a]=S}),{distances:n,constraints:r}}function be(t,s,i,n){for(let o=0;o<s.length;++o)s[o]=0;let r=0;for(let o=0;o<i.length;++o){let a=t[2*o],c=t[2*o+1];for(let g=o+1;g<i.length;++g){let d=t[2*g],l=t[2*g+1],S=i[o][g],y=n[o][g],E=(d-a)*(d-a)+(l-c)*(l-c),w=Math.sqrt(E),D=E-S*S;if(y>0&&w<=S||y<0&&w>=S)continue;r+=2*D*D,s[2*o]+=4*D*(a-d),s[2*o+1]+=4*D*(c-l),s[2*g]+=4*D*(d-a),s[2*g+1]+=4*D*(l-c)}}return r}function ve(t,s={}){let i=Ie(t,s),n=s.lossFunction||mt;if(t.length>=8){let r=ke(t,s),o=n(r,t),a=n(i,t);if(o+0.00000001<a)i=r}return i}function ke(t,s={}){let i=s.restarts||10,n=[],r={};for(let y of t)if(y.sets.length===1)r[y.sets[0]]=n.length,n.push(y);let{distances:o,constraints:a}=me(t,n,r),c=zt(o.map(zt))/o.length;o=o.map((y)=>y.map((E)=>E/c));let g=(y,E)=>be(y,E,o,a),d=null;for(let y=0;y<i;++y){let E=Tt(o.length*2).map(Math.random),w=ye(g,E,s);if(!d||w.fx<d.fx)d=w}let l=d.x,S={};for(let y=0;y<n.length;++y){let E=n[y];S[E.sets[0]]={x:l[2*y]*c,y:l[2*y+1]*c,radius:Math.sqrt(E.size/Math.PI)}}if(s.history)for(let y of s.history)At(y.x,c);return S}function Ie(t,s){let i=s&&s.lossFunction?s.lossFunction:mt,n={},r={};for(let S of t)if(S.sets.length===1){let y=S.sets[0];n[y]={x:10000000000,y:10000000000,rowid:n.length,size:S.size,radius:Math.sqrt(S.size/Math.PI)},r[y]=[]}t=t.filter((S)=>S.sets.length===2);for(let S of t){let y=S.weight!=null?S.weight:1,E=S.sets[0],w=S.sets[1];if(S.size+Yt>=Math.min(n[E].size,n[w].size))y=0;r[E].push({set:w,size:S.size,weight:y}),r[w].push({set:E,size:S.size,weight:y})}let o=[];Object.keys(r).forEach((S)=>{let y=0;for(let E=0;E<r[S].length;++E)y+=r[S][E].size*r[S][E].weight;o.push({set:S,size:y})});function a(S,y){return y.size-S.size}o.sort(a);let c={};function g(S){return S.set in c}function d(S,y){n[y].x=S.x,n[y].y=S.y,c[y]=!0}d({x:0,y:0},o[0].set);for(let S=1;S<o.length;++S){let y=o[S].set,E=r[y].filter(g),w=n[y];if(E.sort(a),E.length===0)throw"ERROR: missing pairwise overlap information";let D=[];for(var l=0;l<E.length;++l){let N=n[E[l].set],b=Ct(w.radius,N.radius,E[l].size);D.push({x:N.x+b,y:N.y}),D.push({x:N.x-b,y:N.y}),D.push({y:N.y+b,x:N.x}),D.push({y:N.y-b,x:N.x});for(let _=l+1;_<E.length;++_){let T=n[E[_].set],u=Ct(w.radius,T.radius,E[_].size),v=Gt({x:N.x,y:N.y,radius:b},{x:T.x,y:T.y,radius:u});D.push(...v)}}let q=100000000000000000000000000000000000000000000000000,F=D[0];for(let N of D){n[y].x=N.x,n[y].y=N.y;let b=i(n,t);if(b<q)q=b,F=N}d(F,y)}return n}function mt(t,s){let i=0;for(let n of s){if(n.sets.length===1)continue;let r;if(n.sets.length===2){let a=t[n.sets[0]],c=t[n.sets[1]];r=Rt(a.radius,c.radius,ot(a,c))}else r=kt(n.sets.map((a)=>t[a]));let o=n.weight!=null?n.weight:1;i+=o*(r-n.size)*(r-n.size)}return i}function Xt(t,s){let i=0;for(let n of s){if(n.sets.length===1)continue;let r;if(n.sets.length===2){let c=t[n.sets[0]],g=t[n.sets[1]];r=Rt(c.radius,g.radius,ot(c,g))}else r=kt(n.sets.map((c)=>t[c]));let o=n.weight!=null?n.weight:1,a=Math.log((r+1)/(n.size+1));i+=o*a*a}return i}function Me(t,s,i){if(i==null)t.sort((r,o)=>o.radius-r.radius);else t.sort(i);if(t.length>0){let r=t[0].x,o=t[0].y;for(let a of t)a.x-=r,a.y-=o}if(t.length===2){if(ot(t[0],t[1])<Math.abs(t[1].radius-t[0].radius))t[1].x=t[0].x+t[0].radius-t[1].radius-0.0000000001,t[1].y=t[0].y}if(t.length>1){let r=Math.atan2(t[1].x,t[1].y)-s,o=Math.cos(r),a=Math.sin(r);for(let c of t){let{x:g,y:d}=c;c.x=o*g-a*d,c.y=a*g+o*d}}if(t.length>2){let r=Math.atan2(t[2].x,t[2].y)-s;while(r<0)r+=2*Math.PI;while(r>2*Math.PI)r-=2*Math.PI;if(r>Math.PI){let o=t[1].y/(0.0000000001+t[1].x);for(let a of t){var n=(a.x+o*a.y)/(1+o*o);a.x=2*n-a.x,a.y=2*n*o-a.y}}}}function Se(t){t.forEach((r)=>{r.parent=r});function s(r){if(r.parent!==r)r.parent=s(r.parent);return r.parent}function i(r,o){let a=s(r),c=s(o);a.parent=c}for(let r=0;r<t.length;++r)for(let o=r+1;o<t.length;++o){let a=t[r].radius+t[o].radius;if(ot(t[r],t[o])+0.0000000001<a)i(t[o],t[r])}let n=new Map;for(let r=0;r<t.length;++r){let o=s(t[r]).parent.setid;if(!n.has(o))n.set(o,[]);n.get(o).push(t[r])}return t.forEach((r)=>{delete r.parent}),Array.from(n.values())}function Dt(t){let s=(i)=>{let n=t.reduce((o,a)=>Math.max(o,a[i]+a.radius),Number.NEGATIVE_INFINITY),r=t.reduce((o,a)=>Math.min(o,a[i]-a.radius),Number.POSITIVE_INFINITY);return{max:n,min:r}};return{xRange:s("x"),yRange:s("y")}}function Zt(t,s,i){if(s==null)s=Math.PI/2;let n=$t(t).map((d)=>Object.assign({},d)),r=Se(n);for(let d of r){Me(d,s,i);let l=Dt(d);d.size=(l.xRange.max-l.xRange.min)*(l.yRange.max-l.yRange.min),d.bounds=l}r.sort((d,l)=>l.size-d.size),n=r[0];let o=n.bounds,a=(o.xRange.max-o.xRange.min)/50;function c(d,l,S){if(!d)return;let y=d.bounds,E,w;if(l)E=o.xRange.max-y.xRange.min+a;else{E=o.xRange.max-y.xRange.max;let D=(y.xRange.max-y.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;if(D<0)E+=D}if(S)w=o.yRange.max-y.yRange.min+a;else{w=o.yRange.max-y.yRange.max;let D=(y.yRange.max-y.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;if(D<0)w+=D}for(let D of d)D.x+=E,D.y+=w,n.push(D)}let g=1;while(g<r.length)c(r[g],!0,!1),c(r[g+1],!1,!0),c(r[g+2],!0,!0),g+=3,o=Dt(n);return Qt(n)}function Jt(t,s,i,n,r){let o=$t(t);s-=2*n,i-=2*n;let{xRange:a,yRange:c}=Dt(o);if(a.max===a.min||c.max===c.min)return console.log("not scaling solution: zero size detected"),t;let g,d;if(r){let E=Math.sqrt(r/Math.PI)*2;g=s/E,d=i/E}else g=s/(a.max-a.min),d=i/(c.max-c.min);let l=Math.min(d,g),S=(s-(a.max-a.min)*l)/2,y=(i-(c.max-c.min)*l)/2;return Qt(o.map((E)=>({radius:l*E.radius,x:n+S+(E.x-a.min)*l,y:n+y+(E.y-c.min)*l,setid:E.setid})))}function Qt(t){let s={};for(let i of t)s[i.setid]=i;return s}function $t(t){return Object.keys(t).map((i)=>Object.assign(t[i],{setid:i}))}function te(t={}){let s=!1,i=600,n=350,r=15,o=1000,a=Math.PI/2,c=!0,g=null,d=!0,l=!0,S=null,y=null,E=!1,w=null,D=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,q={},F=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],N=0,b=function(v){if(v in q)return q[v];var x=q[v]=F[N];if(N+=1,N>=F.length)N=0;return x},_=Ht,T=mt;function u(v){let x=v.datum(),W=new Set;x.forEach((z)=>{if(z.size==0&&z.sets.length==1)W.add(z.sets[0])}),x=x.filter((z)=>!z.sets.some((J)=>W.has(J)));let C={},H={};if(x.length>0){let z=_(x,{lossFunction:T,distinct:E});if(c)z=Zt(z,a,y);C=Jt(z,i,n,r,g),H=se(C,x,D)}let at={};x.forEach((z)=>{if(z.label)at[z.sets]=z.label});function nt(z){if(z.sets in at)return at[z.sets];if(z.sets.length==1)return""+z.sets[0]}v.selectAll("svg").data([C]).enter().append("svg");let Z=v.select("svg");if(s)Z.attr("viewBox",`0 0 ${i} ${n}`);else Z.attr("width",i).attr("height",n);let G={},Y=!1;Z.selectAll(".venn-area path").each(function(z){let J=this.getAttribute("d");if(z.sets.length==1&&J&&!E)Y=!0,G[z.sets[0]]=Ee(J)});function V(z){return(J)=>{let yt=z.sets.map((dt)=>{let ht=G[dt],rt=C[dt];if(!ht)ht={x:i/2,y:n/2,radius:1};if(!rt)rt={x:i/2,y:n/2,radius:1};return{x:ht.x*(1-J)+rt.x*J,y:ht.y*(1-J)+rt.y*J,radius:ht.radius*(1-J)+rt.radius*J}});return Ut(yt,w)}}let Q=Z.selectAll(".venn-area").data(x,(z)=>z.sets),st=Q.enter().append("g").attr("class",(z)=>`venn-area venn-${z.sets.length==1?"circle":"intersection"}${z.colour||z.color?" venn-coloured":""}`).attr("data-venn-sets",(z)=>z.sets.join("_")),tt=st.append("path"),lt=st.append("text").attr("class","label").text((z)=>nt(z)).attr("text-anchor","middle").attr("dy",".35em").attr("x",i/2).attr("y",n/2);if(l)tt.style("fill-opacity","0").filter((z)=>z.sets.length==1).style("fill",(z)=>z.colour?z.colour:z.color?z.color:b(z.sets)).style("fill-opacity",".25"),lt.style("fill",(z)=>{if(z.colour||z.color)return"#FFF";if(t.textFill)return t.textFill;return z.sets.length==1?b(z.sets):"#444"});function it(z){if(typeof z.transition==="function")return z.transition("venn").duration(o);return z}let et=v;if(Y&&typeof et.transition==="function")et=it(v),et.selectAll("path").attrTween("d",V);else et.selectAll("path").attr("d",(z)=>Ut(z.sets.map((J)=>C[J])),w);let U=et.selectAll("text").filter((z)=>(z.sets in H)).text((z)=>nt(z)).attr("x",(z)=>Math.floor(H[z.sets].x)).attr("y",(z)=>Math.floor(H[z.sets].y));if(d)if(Y)if("on"in U)U.on("end",wt(C,nt));else U.each("end",wt(C,nt));else U.each(wt(C,nt));let ft=it(Q.exit()).remove();if(typeof Q.transition==="function")ft.selectAll("path").attrTween("d",V);let ut=ft.selectAll("text").attr("x",i/2).attr("y",n/2);if(S!==null)lt.style("font-size","0px"),U.style("font-size",S),ut.style("font-size","0px");return{circles:C,textCentres:H,nodes:Q,enter:st,update:et,exit:ft}}return u.wrap=function(v){if(!arguments.length)return d;return d=v,u},u.useViewBox=function(){return s=!0,u},u.width=function(v){if(!arguments.length)return i;return i=v,u},u.height=function(v){if(!arguments.length)return n;return n=v,u},u.padding=function(v){if(!arguments.length)return r;return r=v,u},u.distinct=function(v){if(!arguments.length)return E;return E=v,u},u.colours=function(v){if(!arguments.length)return b;return b=v,u},u.colors=function(v){if(!arguments.length)return b;return b=v,u},u.fontSize=function(v){if(!arguments.length)return S;return S=v,u},u.round=function(v){if(!arguments.length)return w;return w=v,u},u.duration=function(v){if(!arguments.length)return o;return o=v,u},u.layoutFunction=function(v){if(!arguments.length)return _;return _=v,u},u.normalize=function(v){if(!arguments.length)return c;return c=v,u},u.scaleToFit=function(v){if(!arguments.length)return g;return g=v,u},u.styled=function(v){if(!arguments.length)return l;return l=v,u},u.orientation=function(v){if(!arguments.length)return a;return a=v,u},u.orientationOrder=function(v){if(!arguments.length)return y;return y=v,u},u.lossFunction=function(v){if(!arguments.length)return T;return T=v==="default"?mt:v==="logRatio"?Xt:v,u},u}function wt(t,s){return function(i){let n=this,r=t[i.sets[0]].radius||50,o=s(i)||"",a=o.split(/\s+/).reverse(),c=3,g=(o.length+a.length)/3,d=a.pop(),l=[d],S=0,y=1.1;n.textContent=null;let E=[];function w(b){let _=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return _.textContent=b,E.push(_),n.append(_),_}let D=w(d);while(!0){if(d=a.pop(),!d)break;l.push(d);let b=l.join(" ");if(D.textContent=b,b.length>g&&D.getComputedTextLength()>r)l.pop(),D.textContent=l.join(" "),l=[d],D=w(d),S++}let q=0.35-S*y/2,F=n.getAttribute("x"),N=n.getAttribute("y");E.forEach((b,_)=>{b.setAttribute("x",F),b.setAttribute("y",N),b.setAttribute("dy",`${q+_*y}em`)})}}function _t(t,s,i){let n=s[0].radius-ot(s[0],t);for(let r=1;r<s.length;++r){let o=s[r].radius-ot(s[r],t);if(o<=n)n=o}for(let r=0;r<i.length;++r){let o=ot(i[r],t)-i[r].radius;if(o<=n)n=o}return n}function ee(t,s,i){let n=[];for(let l of t)n.push({x:l.x,y:l.y}),n.push({x:l.x+l.radius/2,y:l.y}),n.push({x:l.x-l.radius/2,y:l.y}),n.push({x:l.x,y:l.y+l.radius/2}),n.push({x:l.x,y:l.y-l.radius/2});let r=n[0],o=_t(n[0],t,s);for(let l=1;l<n.length;++l){let S=_t(n[l],t,s);if(S>=o)r=n[l],o=S}let a=Kt((l)=>-1*_t({x:l[0],y:l[1]},t,s),[r.x,r.y],{maxIterations:500,minErrorDelta:0.0000000001}).x,c={x:i?0:a[0],y:a[1]},g=!0;for(let l of t)if(ot(c,l)>l.radius){g=!1;break}for(let l of s)if(ot(c,l)<l.radius){g=!1;break}if(g)return c;if(t.length==1)return{x:t[0].x,y:t[0].y};let d={};if(kt(t,d),d.arcs.length===0)return{x:0,y:-1000,disjoint:!0};if(d.arcs.length==1)return{x:d.arcs[0].circle.x,y:d.arcs[0].circle.y};if(s.length)return ee(t,[]);return Wt(d.arcs.map((l)=>l.p1))}function we(t){let s={},i=Object.keys(t);for(let n of i)s[n]=[];for(let n=0;n<i.length;n++){let r=i[n],o=t[r];for(let a=n+1;a<i.length;++a){let c=i[a],g=t[c],d=ot(o,g);if(d+g.radius<=o.radius+0.0000000001)s[c].push(r);else if(d+o.radius<=g.radius+0.0000000001)s[r].push(c)}}return s}function se(t,s,i){let n={},r=we(t);for(let o=0;o<s.length;++o){let a=s[o].sets,c={},g={};for(let y=0;y<a.length;++y){c[a[y]]=!0;let E=r[a[y]];for(let w=0;w<E.length;++w)g[E[w]]=!0}let d=[],l=[];for(let y in t)if(y in c)d.push(t[y]);else if(!(y in g))l.push(t[y]);let S=ee(d,l,i);if(n[a]=S,S.disjoint&&s[o].size>0)console.log("WARNING: area "+a+" not represented on screen")}return n}function _e(t,s,i){let n=[];return n.push(`
2
2
  M`,t,s),n.push(`
3
3
  m`,-i,0),n.push(`
4
4
  a`,i,i,0,1,0,i*2,0),n.push(`
5
5
  a`,i,i,0,1,0,-i*2,0),n.join(" ")}function Ee(t){let s=t.split(" ");return{x:Number.parseFloat(s[1]),y:Number.parseFloat(s[2]),radius:-Number.parseFloat(s[4])}}function ie(t){if(t.length===0)return[];let s={};return kt(t,s),s.arcs}function re(t,s){if(t.length===0)return"M 0 0";let i=Math.pow(10,s||0),n=s!=null?(o)=>Math.round(o*i)/i:(o)=>o;if(t.length==1){let o=t[0].circle;return _e(n(o.x),n(o.y),n(o.radius))}let r=[`
6
6
  M`,n(t[0].p2.x),n(t[0].p2.y)];for(let o of t){let a=n(o.circle.radius);r.push(`
7
- A`,a,a,0,o.large?1:0,o.sweep?1:0,n(o.p1.x),n(o.p1.y))}return r.join(" ")}function Ut(t,s){return re(ie(t),s)}function oe(t,s={}){let{lossFunction:i,layoutFunction:n=Ht,normalize:r=!0,orientation:o=Math.PI/2,orientationOrder:a,width:c=600,height:g=350,padding:d=15,scaleToFit:l=!1,symmetricalTextCentre:S=!1,distinct:y,round:E=2}=s,w=n(t,{lossFunction:i==="default"||!i?mt:i==="logRatio"?Xt:i,distinct:y});if(r)w=Zt(w,o,a);let D=Jt(w,c,g,d,l),q=se(D,t,S),F=new Map(Object.keys(D).map((_)=>[_,{set:_,x:D[_].x,y:D[_].y,radius:D[_].radius}])),N=t.map((_)=>{let T=_.sets.map((x)=>F.get(x)),u=ie(T),v=re(u,E);return{circles:T,arcs:u,path:v,area:_,has:new Set(_.sets)}});function b(_){let T="";for(let u of N)if(u.has.size>_.length&&_.every((v)=>u.has.has(v)))T+=" "+u.path;return T}return N.map(({circles:_,arcs:T,path:u,area:v})=>({data:v,text:q[v.sets],circles:_,arcs:T,path:u,distinctPath:u+b(v.sets)}))}var Nt=function(){var t=e(function(N,b,_,T){for(_=_||{},T=N.length;T--;_[N[T]]=b);return _},"o"),s=[5,8],i=[7,8,11,12,17,19,22,24],n=[1,17],r=[1,18],o=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],a=[1,31],c=[1,39],g=[7,8,11,12,17,19,22,24,27],d=[1,57],l=[1,56],S=[1,58],y=[1,59],E=[1,60],w=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],D={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:e(function(b,_,T,u,v,x,W){var C=x.length-1;switch(v){case 1:return x[C-1];case 2:case 3:case 4:this.$=[];break;case 5:x[C-1].push(x[C]),this.$=x[C-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=x[C];break;case 8:u.setDiagramTitle(x[C].substr(6)),this.$=x[C].substr(6);break;case 9:if(u.addSubsetData([x[C]],void 0,void 0),u.setIndentMode)u.setIndentMode(!0);break;case 10:if(u.addSubsetData([x[C-1]],x[C],void 0),u.setIndentMode)u.setIndentMode(!0);break;case 11:if(u.addSubsetData([x[C-2]],void 0,parseFloat(x[C])),u.setIndentMode)u.setIndentMode(!0);break;case 12:if(u.addSubsetData([x[C-3]],x[C-2],parseFloat(x[C])),u.setIndentMode)u.setIndentMode(!0);break;case 13:if(x[C].length<2)throw Error("union requires multiple identifiers");if(u.validateUnionIdentifiers)u.validateUnionIdentifiers(x[C]);if(u.addSubsetData(x[C],void 0,void 0),u.setIndentMode)u.setIndentMode(!0);break;case 14:if(x[C-1].length<2)throw Error("union requires multiple identifiers");if(u.validateUnionIdentifiers)u.validateUnionIdentifiers(x[C-1]);if(u.addSubsetData(x[C-1],x[C],void 0),u.setIndentMode)u.setIndentMode(!0);break;case 15:if(x[C-2].length<2)throw Error("union requires multiple identifiers");if(u.validateUnionIdentifiers)u.validateUnionIdentifiers(x[C-2]);if(u.addSubsetData(x[C-2],void 0,parseFloat(x[C])),u.setIndentMode)u.setIndentMode(!0);break;case 16:if(x[C-3].length<2)throw Error("union requires multiple identifiers");if(u.validateUnionIdentifiers)u.validateUnionIdentifiers(x[C-3]);if(u.addSubsetData(x[C-3],x[C-2],parseFloat(x[C])),u.setIndentMode)u.setIndentMode(!0);break;case 17:case 18:case 19:u.addTextData(x[C-1],x[C],void 0);break;case 20:case 21:u.addTextData(x[C-2],x[C-1],x[C]);break;case 23:u.addStyleData(x[C-1],x[C]);break;case 24:case 25:case 26:var K=u.getCurrentSets();if(!K)throw Error("text requires set");u.addTextData(K,x[C],void 0);break;case 27:case 28:var K=u.getCurrentSets();if(!K)throw Error("text requires set");u.addTextData(K,x[C-1],x[C]);break;case 29:case 41:this.$=[x[C]];break;case 30:case 42:this.$=[...x[C-2],x[C]];break;case 31:this.$=[x[C-2],x[C]];break;case 33:this.$=x[C].join(" ");break;case 34:this.$=[x[C]];break;case 35:x[C-1].push(x[C]),this.$=x[C-1];break;case 43:case 44:this.$=x[C];break}},"anonymous"),table:[t(s,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(i,[2,4],{6:5}),t(s,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(i,[2,5]),t(i,[2,6]),t(i,[2,7]),t(i,[2,8]),{13:16,20:n,21:r},{13:20,18:19,20:n,21:r},{13:20,18:21,20:n,21:r},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:r},t(i,[2,9],{14:[1,27],15:[1,28]}),t(o,[2,43]),t(o,[2,44]),t(i,[2,13],{14:[1,29],15:[1,30],27:a}),t(o,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:a},t(i,[2,22]),t(i,[2,24],{14:[1,35]}),t(i,[2,25],{14:[1,36]}),t(i,[2,26]),{20:c,25:37,26:38,27:a},t(i,[2,10],{15:[1,40]}),{16:[1,41]},t(i,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:r},t(i,[2,17],{14:[1,45]}),t(i,[2,18],{14:[1,46]}),t(i,[2,19]),t(i,[2,27]),t(i,[2,28]),t(i,[2,23],{27:[1,47]}),t(g,[2,29]),{15:[1,48]},{16:[1,49]},t(i,[2,11]),{16:[1,50]},t(i,[2,15]),t(o,[2,42]),t(i,[2,20]),t(i,[2,21]),{20:c,26:51},{16:d,20:l,21:[1,53],28:52,29:54,30:55,31:S,32:y,33:E},t(i,[2,12]),t(i,[2,16]),t(g,[2,30]),t(g,[2,31]),t(g,[2,32]),t(g,[2,33],{30:61,16:d,20:l,31:S,32:y,33:E}),t(w,[2,34]),t(w,[2,36]),t(w,[2,37]),t(w,[2,38]),t(w,[2,39]),t(w,[2,40]),t(w,[2,35])],defaultActions:{6:[2,1]},parseError:e(function(b,_){if(_.recoverable)this.trace(b);else{var T=Error(b);throw T.hash=_,T}},"parseError"),parse:e(function(b){var _=this,T=[0],u=[],v=[null],x=[],W=this.table,C="",K=0,at=0,nt=0,Z=2,G=1,H=x.slice.call(arguments,1),V=Object.create(this.lexer),Q={yy:{}};for(var st in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,st))Q.yy[st]=this.yy[st];if(V.setInput(b,Q.yy),Q.yy.lexer=V,Q.yy.parser=this,typeof V.yylloc>"u")V.yylloc={};var tt=V.yylloc;x.push(tt);var lt=V.options&&V.options.ranges;if(typeof Q.yy.parseError==="function")this.parseError=Q.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function it(ct){T.length=T.length-2*ct,v.length=v.length-ct,x.length=x.length-ct}e(it,"popStack");function et(){var ct=u.pop()||V.lex()||G;if(typeof ct!=="number"){if(ct instanceof Array)u=ct,ct=u.pop();ct=_.symbols_[ct]||ct}return ct}e(et,"lex");var U,ft,ut,z,J,yt,dt={},ht,rt,Bt,vt;while(!0){if(ut=T[T.length-1],this.defaultActions[ut])z=this.defaultActions[ut];else{if(U===null||typeof U>"u")U=et();z=W[ut]&&W[ut][U]}if(typeof z>"u"||!z.length||!z[0]){var Mt="";vt=[];for(ht in W[ut])if(this.terminals_[ht]&&ht>Z)vt.push("'"+this.terminals_[ht]+"'");if(V.showPosition)Mt="Parse error on line "+(K+1)+`:
7
+ A`,a,a,0,o.large?1:0,o.sweep?1:0,n(o.p1.x),n(o.p1.y))}return r.join(" ")}function Ut(t,s){return re(ie(t),s)}function oe(t,s={}){let{lossFunction:i,layoutFunction:n=Ht,normalize:r=!0,orientation:o=Math.PI/2,orientationOrder:a,width:c=600,height:g=350,padding:d=15,scaleToFit:l=!1,symmetricalTextCentre:S=!1,distinct:y,round:E=2}=s,w=n(t,{lossFunction:i==="default"||!i?mt:i==="logRatio"?Xt:i,distinct:y});if(r)w=Zt(w,o,a);let D=Jt(w,c,g,d,l),q=se(D,t,S),F=new Map(Object.keys(D).map((_)=>[_,{set:_,x:D[_].x,y:D[_].y,radius:D[_].radius}])),N=t.map((_)=>{let T=_.sets.map((x)=>F.get(x)),u=ie(T),v=re(u,E);return{circles:T,arcs:u,path:v,area:_,has:new Set(_.sets)}});function b(_){let T="";for(let u of N)if(u.has.size>_.length&&_.every((v)=>u.has.has(v)))T+=" "+u.path;return T}return N.map(({circles:_,arcs:T,path:u,area:v})=>({data:v,text:q[v.sets],circles:_,arcs:T,path:u,distinctPath:u+b(v.sets)}))}var Nt=function(){var t=e(function(N,b,_,T){for(_=_||{},T=N.length;T--;_[N[T]]=b);return _},"o"),s=[5,8],i=[7,8,11,12,17,19,22,24],n=[1,17],r=[1,18],o=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],a=[1,31],c=[1,39],g=[7,8,11,12,17,19,22,24,27],d=[1,57],l=[1,56],S=[1,58],y=[1,59],E=[1,60],w=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],D={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:e(function(b,_,T,u,v,x,W){var C=x.length-1;switch(v){case 1:return x[C-1];case 2:case 3:case 4:this.$=[];break;case 5:x[C-1].push(x[C]),this.$=x[C-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=x[C];break;case 8:u.setDiagramTitle(x[C].substr(6)),this.$=x[C].substr(6);break;case 9:if(u.addSubsetData([x[C]],void 0,void 0),u.setIndentMode)u.setIndentMode(!0);break;case 10:if(u.addSubsetData([x[C-1]],x[C],void 0),u.setIndentMode)u.setIndentMode(!0);break;case 11:if(u.addSubsetData([x[C-2]],void 0,parseFloat(x[C])),u.setIndentMode)u.setIndentMode(!0);break;case 12:if(u.addSubsetData([x[C-3]],x[C-2],parseFloat(x[C])),u.setIndentMode)u.setIndentMode(!0);break;case 13:if(x[C].length<2)throw Error("union requires multiple identifiers");if(u.validateUnionIdentifiers)u.validateUnionIdentifiers(x[C]);if(u.addSubsetData(x[C],void 0,void 0),u.setIndentMode)u.setIndentMode(!0);break;case 14:if(x[C-1].length<2)throw Error("union requires multiple identifiers");if(u.validateUnionIdentifiers)u.validateUnionIdentifiers(x[C-1]);if(u.addSubsetData(x[C-1],x[C],void 0),u.setIndentMode)u.setIndentMode(!0);break;case 15:if(x[C-2].length<2)throw Error("union requires multiple identifiers");if(u.validateUnionIdentifiers)u.validateUnionIdentifiers(x[C-2]);if(u.addSubsetData(x[C-2],void 0,parseFloat(x[C])),u.setIndentMode)u.setIndentMode(!0);break;case 16:if(x[C-3].length<2)throw Error("union requires multiple identifiers");if(u.validateUnionIdentifiers)u.validateUnionIdentifiers(x[C-3]);if(u.addSubsetData(x[C-3],x[C-2],parseFloat(x[C])),u.setIndentMode)u.setIndentMode(!0);break;case 17:case 18:case 19:u.addTextData(x[C-1],x[C],void 0);break;case 20:case 21:u.addTextData(x[C-2],x[C-1],x[C]);break;case 23:u.addStyleData(x[C-1],x[C]);break;case 24:case 25:case 26:var H=u.getCurrentSets();if(!H)throw Error("text requires set");u.addTextData(H,x[C],void 0);break;case 27:case 28:var H=u.getCurrentSets();if(!H)throw Error("text requires set");u.addTextData(H,x[C-1],x[C]);break;case 29:case 41:this.$=[x[C]];break;case 30:case 42:this.$=[...x[C-2],x[C]];break;case 31:this.$=[x[C-2],x[C]];break;case 33:this.$=x[C].join(" ");break;case 34:this.$=[x[C]];break;case 35:x[C-1].push(x[C]),this.$=x[C-1];break;case 43:case 44:this.$=x[C];break}},"anonymous"),table:[t(s,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(i,[2,4],{6:5}),t(s,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(i,[2,5]),t(i,[2,6]),t(i,[2,7]),t(i,[2,8]),{13:16,20:n,21:r},{13:20,18:19,20:n,21:r},{13:20,18:21,20:n,21:r},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:r},t(i,[2,9],{14:[1,27],15:[1,28]}),t(o,[2,43]),t(o,[2,44]),t(i,[2,13],{14:[1,29],15:[1,30],27:a}),t(o,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:a},t(i,[2,22]),t(i,[2,24],{14:[1,35]}),t(i,[2,25],{14:[1,36]}),t(i,[2,26]),{20:c,25:37,26:38,27:a},t(i,[2,10],{15:[1,40]}),{16:[1,41]},t(i,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:r},t(i,[2,17],{14:[1,45]}),t(i,[2,18],{14:[1,46]}),t(i,[2,19]),t(i,[2,27]),t(i,[2,28]),t(i,[2,23],{27:[1,47]}),t(g,[2,29]),{15:[1,48]},{16:[1,49]},t(i,[2,11]),{16:[1,50]},t(i,[2,15]),t(o,[2,42]),t(i,[2,20]),t(i,[2,21]),{20:c,26:51},{16:d,20:l,21:[1,53],28:52,29:54,30:55,31:S,32:y,33:E},t(i,[2,12]),t(i,[2,16]),t(g,[2,30]),t(g,[2,31]),t(g,[2,32]),t(g,[2,33],{30:61,16:d,20:l,31:S,32:y,33:E}),t(w,[2,34]),t(w,[2,36]),t(w,[2,37]),t(w,[2,38]),t(w,[2,39]),t(w,[2,40]),t(w,[2,35])],defaultActions:{6:[2,1]},parseError:e(function(b,_){if(_.recoverable)this.trace(b);else{var T=Error(b);throw T.hash=_,T}},"parseError"),parse:e(function(b){var _=this,T=[0],u=[],v=[null],x=[],W=this.table,C="",H=0,at=0,nt=0,Z=2,G=1,Y=x.slice.call(arguments,1),V=Object.create(this.lexer),Q={yy:{}};for(var st in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,st))Q.yy[st]=this.yy[st];if(V.setInput(b,Q.yy),Q.yy.lexer=V,Q.yy.parser=this,typeof V.yylloc>"u")V.yylloc={};var tt=V.yylloc;x.push(tt);var lt=V.options&&V.options.ranges;if(typeof Q.yy.parseError==="function")this.parseError=Q.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function it(ct){T.length=T.length-2*ct,v.length=v.length-ct,x.length=x.length-ct}e(it,"popStack");function et(){var ct=u.pop()||V.lex()||G;if(typeof ct!=="number"){if(ct instanceof Array)u=ct,ct=u.pop();ct=_.symbols_[ct]||ct}return ct}e(et,"lex");var U,ft,ut,z,J,yt,dt={},ht,rt,Bt,vt;while(!0){if(ut=T[T.length-1],this.defaultActions[ut])z=this.defaultActions[ut];else{if(U===null||typeof U>"u")U=et();z=W[ut]&&W[ut][U]}if(typeof z>"u"||!z.length||!z[0]){var Mt="";vt=[];for(ht in W[ut])if(this.terminals_[ht]&&ht>Z)vt.push("'"+this.terminals_[ht]+"'");if(V.showPosition)Mt="Parse error on line "+(H+1)+`:
8
8
  `+V.showPosition()+`
9
- Expecting `+vt.join(", ")+", got '"+(this.terminals_[U]||U)+"'";else Mt="Parse error on line "+(K+1)+": Unexpected "+(U==G?"end of input":"'"+(this.terminals_[U]||U)+"'");this.parseError(Mt,{text:V.match,token:this.terminals_[U]||U,line:V.yylineno,loc:tt,expected:vt})}if(z[0]instanceof Array&&z.length>1)throw Error("Parse Error: multiple actions possible at state: "+ut+", token: "+U);switch(z[0]){case 1:if(T.push(U),v.push(V.yytext),x.push(V.yylloc),T.push(z[1]),U=null,!ft){if(at=V.yyleng,C=V.yytext,K=V.yylineno,tt=V.yylloc,nt>0)nt--}else U=ft,ft=null;break;case 2:if(rt=this.productions_[z[1]][1],dt.$=v[v.length-rt],dt._$={first_line:x[x.length-(rt||1)].first_line,last_line:x[x.length-1].last_line,first_column:x[x.length-(rt||1)].first_column,last_column:x[x.length-1].last_column},lt)dt._$.range=[x[x.length-(rt||1)].range[0],x[x.length-1].range[1]];if(yt=this.performAction.apply(dt,[C,at,K,Q.yy,z[1],v,x].concat(H)),typeof yt<"u")return yt;if(rt)T=T.slice(0,-1*rt*2),v=v.slice(0,-1*rt),x=x.slice(0,-1*rt);T.push(this.productions_[z[1]][0]),v.push(dt.$),x.push(dt._$),Bt=W[T[T.length-2]][T[T.length-1]],T.push(Bt);break;case 3:return!0}}return!0},"parse")},q=function(){var N={EOF:1,parseError:e(function(_,T){if(this.yy.parser)this.yy.parser.parseError(_,T);else throw Error(_)},"parseError"),setInput:e(function(b,_){if(this.yy=_||this.yy||{},this._input=b,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];return this.offset=0,this},"setInput"),input:e(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var _=b.match(/(?:\r\n?|\n).*/g);if(_)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),b},"input"),unput:e(function(b){var _=b.length,T=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-_),this.offset-=_;var u=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),T.length-1)this.yylineno-=T.length-1;var v=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:T?(T.length===u.length?this.yylloc.first_column:0)+u[u.length-T.length].length-T[0].length:this.yylloc.first_column-_},this.options.ranges)this.yylloc.range=[v[0],v[0]+this.yyleng-_];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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).
9
+ Expecting `+vt.join(", ")+", got '"+(this.terminals_[U]||U)+"'";else Mt="Parse error on line "+(H+1)+": Unexpected "+(U==G?"end of input":"'"+(this.terminals_[U]||U)+"'");this.parseError(Mt,{text:V.match,token:this.terminals_[U]||U,line:V.yylineno,loc:tt,expected:vt})}if(z[0]instanceof Array&&z.length>1)throw Error("Parse Error: multiple actions possible at state: "+ut+", token: "+U);switch(z[0]){case 1:if(T.push(U),v.push(V.yytext),x.push(V.yylloc),T.push(z[1]),U=null,!ft){if(at=V.yyleng,C=V.yytext,H=V.yylineno,tt=V.yylloc,nt>0)nt--}else U=ft,ft=null;break;case 2:if(rt=this.productions_[z[1]][1],dt.$=v[v.length-rt],dt._$={first_line:x[x.length-(rt||1)].first_line,last_line:x[x.length-1].last_line,first_column:x[x.length-(rt||1)].first_column,last_column:x[x.length-1].last_column},lt)dt._$.range=[x[x.length-(rt||1)].range[0],x[x.length-1].range[1]];if(yt=this.performAction.apply(dt,[C,at,H,Q.yy,z[1],v,x].concat(Y)),typeof yt<"u")return yt;if(rt)T=T.slice(0,-1*rt*2),v=v.slice(0,-1*rt),x=x.slice(0,-1*rt);T.push(this.productions_[z[1]][0]),v.push(dt.$),x.push(dt._$),Bt=W[T[T.length-2]][T[T.length-1]],T.push(Bt);break;case 3:return!0}}return!0},"parse")},q=function(){var N={EOF:1,parseError:e(function(_,T){if(this.yy.parser)this.yy.parser.parseError(_,T);else throw Error(_)},"parseError"),setInput:e(function(b,_){if(this.yy=_||this.yy||{},this._input=b,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];return this.offset=0,this},"setInput"),input:e(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var _=b.match(/(?:\r\n?|\n).*/g);if(_)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),b},"input"),unput:e(function(b){var _=b.length,T=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-_),this.offset-=_;var u=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),T.length-1)this.yylineno-=T.length-1;var v=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:T?(T.length===u.length?this.yylloc.first_column:0)+u[u.length-T.length].length-T[0].length:this.yylloc.first_column-_},this.options.ranges)this.yylloc.range=[v[0],v[0]+this.yyleng-_];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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).
10
10
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(b){this.unput(this.match.slice(b))},"less"),pastInput:e(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var b=this.match;if(b.length<20)b+=this._input.substr(0,20-b.length);return(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var b=this.pastInput(),_=Array(b.length+1).join("-");return b+this.upcomingInput()+`
11
11
  `+_+"^"},"showPosition"),test_match:e(function(b,_){var T,u,v;if(this.options.backtrack_lexer){if(v={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)v.yylloc.range=this.yylloc.range.slice(0)}if(u=b[0].match(/(?:\r\n?|\n).*/g),u)this.yylineno+=u.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],T=this.performAction.call(this,this.yy,this,_,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(T)return T;else if(this._backtrack){for(var x in v)this[x]=v[x];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var b,_,T,u;if(!this._more)this.yytext="",this.match="";var v=this._currentRules();for(var x=0;x<v.length;x++)if(T=this._input.match(this.rules[v[x]]),T&&(!_||T[0].length>_[0].length)){if(_=T,u=x,this.options.backtrack_lexer)if(b=this.test_match(T,v[x]),b!==!1)return b;else if(this._backtrack){_=!1;continue}else return!1;else if(!this.options.flex)break}if(_){if(b=this.test_match(_,v[u]),b!==!1)return b;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
12
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var _=this.next();if(_)return _;else return this.lex()},"lex"),begin:e(function(_){this.conditionStack.push(_)},"begin"),popState:e(function(){var _=this.conditionStack.length-1;if(_>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(_){if(_=this.conditionStack.length-1-Math.abs(_||0),_>=0)return this.conditionStack[_];else return"INITIAL"},"topState"),pushState:e(function(_){this.begin(_)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(_,T,u,v){var x=v;switch(u){case 0:break;case 1:break;case 2:break;case 3:if(_.getIndentMode&&_.getIndentMode())return _.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:if(_.setIndentMode)_.setIndentMode(!1);this.begin("INITIAL"),this.unput(T.yytext);break;case 6:return this.begin("bol"),8;break;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(_.consumeIndentText)_.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return T.yytext=T.yytext.slice(2,-2),14;break;case 17:return T.yytext=T.yytext.slice(1,-1).trim(),14;break;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return N}();D.lexer=q;function F(){this.yy={}}return e(F,"Parser"),F.prototype=D,D.Parser=F,new F}();Nt.parser=Nt;var ze=Nt,Ot=[],Lt=[],jt=[],Ft=new Set,Pt,Vt=!1,Ae=e((t,s,i)=>{let n=It(t).sort(),r=i??10/Math.pow(t.length,2);if(Pt=n,n.length===1)Ft.add(n[0]);Ot.push({sets:n,size:r,label:s?bt(s):void 0})},"addSubsetData"),Ce=e(()=>Ot,"getSubsetData"),bt=e((t)=>{let s=t.trim();if(s.length>=2&&s.startsWith('"')&&s.endsWith('"'))return s.slice(1,-1);return s},"normalizeText"),De=e((t)=>t?bt(t):t,"normalizeStyleValue"),Re=e((t,s,i)=>{let n=bt(s);Lt.push({sets:It(t).sort(),id:n,label:i?bt(i):void 0})},"addTextData"),Ne=e((t,s)=>{let i=It(t).sort(),n={};for(let[r,o]of s)n[r]=De(o)??o;jt.push({targets:i,styles:n})},"addStyleData"),Oe=e(()=>jt,"getStyleData"),It=e((t)=>t.map((s)=>bt(s)),"normalizeIdentifierList"),Le=e((t)=>{let i=It(t).filter((n)=>!Ft.has(n));if(i.length>0)throw Error(`unknown set identifier: ${i.join(", ")}`)},"validateUnionIdentifiers"),je=e(()=>Lt,"getTextData"),Fe=e(()=>Pt,"getCurrentSets"),Pe=e(()=>Vt,"getIndentMode"),Ve=e((t)=>{Vt=t},"setIndentMode"),Be=B.venn;function ae(){return Y(Be,k().venn)}e(ae,"getConfig");var qe=e(()=>{A(),Ot.length=0,Lt.length=0,jt.length=0,Ft.clear(),Pt=void 0,Vt=!1},"customClear"),Ue={getConfig:ae,clear:qe,setAccTitle:L,getAccTitle:R,setDiagramTitle:P,getDiagramTitle:O,getAccDescription:M,setAccDescription:I,addSubsetData:Ae,getSubsetData:Ce,addTextData:Re,addStyleData:Ne,validateUnionIdentifiers:Le,getTextData:je,getStyleData:Oe,getCurrentSets:Fe,getIndentMode:Pe,setIndentMode:Ve},Ge=e((t)=>`
12
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var _=this.next();if(_)return _;else return this.lex()},"lex"),begin:e(function(_){this.conditionStack.push(_)},"begin"),popState:e(function(){var _=this.conditionStack.length-1;if(_>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(_){if(_=this.conditionStack.length-1-Math.abs(_||0),_>=0)return this.conditionStack[_];else return"INITIAL"},"topState"),pushState:e(function(_){this.begin(_)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(_,T,u,v){var x=v;switch(u){case 0:break;case 1:break;case 2:break;case 3:if(_.getIndentMode&&_.getIndentMode())return _.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:if(_.setIndentMode)_.setIndentMode(!1);this.begin("INITIAL"),this.unput(T.yytext);break;case 6:return this.begin("bol"),8;break;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(_.consumeIndentText)_.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return T.yytext=T.yytext.slice(2,-2),14;break;case 17:return T.yytext=T.yytext.slice(1,-1).trim(),14;break;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return N}();D.lexer=q;function F(){this.yy={}}return e(F,"Parser"),F.prototype=D,D.Parser=F,new F}();Nt.parser=Nt;var ze=Nt,Ot=[],Lt=[],jt=[],Ft=new Set,Pt,Vt=!1,Ae=e((t,s,i)=>{let n=It(t).sort(),r=i??10/Math.pow(t.length,2);if(Pt=n,n.length===1)Ft.add(n[0]);Ot.push({sets:n,size:r,label:s?bt(s):void 0})},"addSubsetData"),Ce=e(()=>Ot,"getSubsetData"),bt=e((t)=>{let s=t.trim();if(s.length>=2&&s.startsWith('"')&&s.endsWith('"'))return s.slice(1,-1);return s},"normalizeText"),De=e((t)=>t?bt(t):t,"normalizeStyleValue"),Re=e((t,s,i)=>{let n=bt(s);Lt.push({sets:It(t).sort(),id:n,label:i?bt(i):void 0})},"addTextData"),Ne=e((t,s)=>{let i=It(t).sort(),n={};for(let[r,o]of s)n[r]=De(o)??o;jt.push({targets:i,styles:n})},"addStyleData"),Oe=e(()=>jt,"getStyleData"),It=e((t)=>t.map((s)=>bt(s)),"normalizeIdentifierList"),Le=e((t)=>{let i=It(t).filter((n)=>!Ft.has(n));if(i.length>0)throw Error(`unknown set identifier: ${i.join(", ")}`)},"validateUnionIdentifiers"),je=e(()=>Lt,"getTextData"),Fe=e(()=>Pt,"getCurrentSets"),Pe=e(()=>Vt,"getIndentMode"),Ve=e((t)=>{Vt=t},"setIndentMode"),Be=B.venn;function ae(){return K(Be,k().venn)}e(ae,"getConfig");var qe=e(()=>{A(),Ot.length=0,Lt.length=0,jt.length=0,Ft.clear(),Pt=void 0,Vt=!1},"customClear"),Ue={getConfig:ae,clear:qe,setAccTitle:L,getAccTitle:R,setDiagramTitle:P,getDiagramTitle:O,getAccDescription:M,setAccDescription:I,addSubsetData:Ae,getSubsetData:Ce,addTextData:Re,addStyleData:Ne,validateUnionIdentifiers:Le,getTextData:je,getStyleData:Oe,getCurrentSets:Fe,getIndentMode:Pe,setIndentMode:Ve},Ge=e((t)=>`
13
13
  .venn-title {
14
14
  font-size: 32px;
15
15
  fill: ${t.vennTitleTextColor};
@@ -31,4 +31,4 @@ Expecting `+vt.join(", ")+", got '"+(this.terminals_[U]||U)+"'";else Mt="Parse e
31
31
  font-family: ${t.fontFamily};
32
32
  color: ${t.vennSetTextColor};
33
33
  }
34
- `,"getStyles"),We=Ge;function le(t){let s=new Map;for(let i of t){let n=i.targets.join("|"),r=s.get(n);if(r)Object.assign(r,i.styles);else s.set(n,{...i.styles})}return s}e(le,"buildStyleByKey");var Ke=e((t,s,i,n)=>{let r=n.db,o=r.getConfig?.(),{themeVariables:a,look:c,handDrawnSeed:g}=k(),d=c==="handDrawn",l=[a.venn1,a.venn2,a.venn3,a.venn4,a.venn5,a.venn6,a.venn7,a.venn8].filter(Boolean),S=r.getDiagramTitle?.(),y=r.getSubsetData(),E=r.getTextData(),w=le(r.getStyleData()),D=ue(y),q=o?.width??800,F=o?.height??450,N=1600,b=q/1600,_=S?48*b:0,T=a.primaryTextColor??a.textColor,u=X(s);if(u.attr("viewBox",`0 0 ${q} ${F}`),S)u.append("text").text(S).attr("class","venn-title").attr("font-size",`${32*b}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*b).style("fill",a.vennTitleTextColor||a.titleColor);let v=p(document.createElement("div")),x=te().width(q).height(F-_);v.datum(D).call(x);let W=d?m.svg(v.select("svg").node()):void 0,C=oe(D,{width:q,height:F-_,padding:o?.padding??15}),K=new Map;for(let G of C){let H=xt([...G.data.sets].sort());K.set(H,G)}if(E.length>0)ce(o,K,v,E,b,w);let at=ne(a.background||"#f4f4f4");if(v.selectAll(".venn-circle").each(function(G,H){let V=p(this),st=xt([...G.sets].sort()),tt=w.get(st),lt=l.length>0?l[H%l.length]:void 0,it=tt?.fill||lt||a.primaryColor;V.classed(`venn-set-${H%8}`,!0);let et=tt?.["fill-opacity"]??0.1,U=tt?.stroke||it,ft=tt?.["stroke-width"]||`${5*b}`;if(d&&W){let z=K.get(st);if(z&&z.circles.length>0){let J=z.circles[0],yt=W.circle(J.x,J.y,J.radius*2,{roughness:0.7,seed:g,fill:St(it,0.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+H*60,stroke:U,strokeWidth:parseFloat(String(ft))});V.select("path").remove(),V.node()?.insertBefore(yt,V.select("text").node())}}else V.select("path").style("fill",it).style("fill-opacity",et).style("stroke",U).style("stroke-width",ft).style("stroke-opacity",0.95);let ut=tt?.color||(at?f(it,30):h(it,30));V.select("text").style("font-size",`${48*b}px`).style("fill",ut)}),d&&W)v.selectAll(".venn-intersection").each(function(G){let H=p(this),Q=xt([...G.sets].sort()),st=w.get(Q),tt=st?.fill;if(tt){let lt=H.select("path"),it=lt.attr("d");if(it){let et=W.path(it,{roughness:0.7,seed:g,fill:St(tt,0.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),U=lt.node();U?.parentNode?.insertBefore(et,U),lt.remove()}}else H.select("path").style("fill-opacity",0);H.select("text").style("font-size",`${48*b}px`).style("fill",st?.color??a.vennSetTextColor??T)});else v.selectAll(".venn-intersection text").style("font-size",`${48*b}px`).style("fill",(G)=>{let V=xt([...G.sets].sort());return w.get(V)?.color??a.vennSetTextColor??T}),v.selectAll(".venn-intersection path").style("fill-opacity",(G)=>{let V=xt([...G.sets].sort());return w.get(V)?.fill?1:0}).style("fill",(G)=>{let V=xt([...G.sets].sort());return w.get(V)?.fill??"transparent"});let nt=u.append("g").attr("transform",`translate(0, ${_})`),Z=v.select("svg").node();if(Z&&"childNodes"in Z)for(let G of[...Z.childNodes])nt.node()?.appendChild(G);j(u,F,q,o?.useMaxWidth??!0)},"draw");function xt(t){return t.join("|")}e(xt,"stableSetsKey");function ce(t,s,i,n,r,o){let a=t?.useDebugLayout??!1,g=i.select("svg").append("g").attr("class","venn-text-nodes"),d=new Map;for(let l of n){let S=xt(l.sets),y=d.get(S);if(y)y.push(l);else d.set(S,[l])}for(let[l,S]of d.entries()){let y=s.get(l);if(!y?.text)continue;let E=y.text.x,w=y.text.y,D=Math.min(...y.circles.map((Z)=>Z.radius)),q=Math.min(...y.circles.map((Z)=>Z.radius-Math.hypot(E-Z.x,w-Z.y))),F=Number.isFinite(q)?Math.max(0,q):0;if(F===0&&Number.isFinite(D))F=D*0.6;let N=g.append("g").attr("class","venn-text-area").attr("font-size",`${40*r}px`);if(a)N.append("circle").attr("class","venn-text-debug-circle").attr("cx",E).attr("cy",w).attr("r",F).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*r).attr("stroke-dasharray",`${6*r} ${4*r}`);let b=Math.max(80*r,F*2*0.95),_=Math.max(60*r,F*2*0.95),v=(y.data.label&&y.data.label.length>0?Math.min(32*r,F*0.25):0)+(S.length<=2?30*r:0),x=E-b/2,W=w-_/2+v,C=Math.max(1,Math.ceil(Math.sqrt(S.length))),K=Math.max(1,Math.ceil(S.length/C)),at=b/C,nt=_/K;for(let[Z,G]of S.entries()){let H=Z%C,V=Math.floor(Z/C),Q=x+at*(H+0.5),st=W+nt*(V+0.5);if(a)N.append("rect").attr("class","venn-text-debug-cell").attr("x",x+at*H).attr("y",W+nt*V).attr("width",at).attr("height",nt).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*r).attr("stroke-dasharray",`${4*r} ${3*r}`);let tt=at*0.9,lt=nt*0.9,it=N.append("foreignObject").attr("class","venn-text-node-fo").attr("width",tt).attr("height",lt).attr("x",Q-tt/2).attr("y",st-lt/2).attr("overflow","visible"),et=o.get(G.id)?.color,U=it.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(G.label??G.id);if(et)U.style("color",et)}}}e(ce,"renderTextNodes");function ue(t){let s=new Set(t.map((r)=>[...r.sets].sort().join("|"))),i=new Map(t.filter((r)=>r.sets.length===1&&r.size!==void 0).map((r)=>[r.sets[0],r.size])),n=[];for(let r of t){if(r.sets.length<3)continue;let o=[...r.sets].sort();for(let a=0;a<o.length-1;a++)for(let c=a+1;c<o.length;c++){let g=[o[a],o[c]],d=g.join("|");if(!s.has(d)){s.add(d);let l=i.get(g[0]),S=i.get(g[1]),y=l!==void 0&&S!==void 0?Math.min(l,S)/4:2.5;n.push({sets:g,size:y,label:""})}}}return n.length>0?[...t,...n]:t}e(ue,"ensurePairwiseSubsets");var He={draw:Ke},rn={parser:ze,db:Ue,renderer:He,styles:We};export{rn as diagram};
34
+ `,"getStyles"),We=Ge;function le(t){let s=new Map;for(let i of t){let n=i.targets.join("|"),r=s.get(n);if(r)Object.assign(r,i.styles);else s.set(n,{...i.styles})}return s}e(le,"buildStyleByKey");var Ke=e((t,s,i,n)=>{let r=n.db,o=r.getConfig?.(),{themeVariables:a,look:c,handDrawnSeed:g}=k(),d=c==="handDrawn",l=[a.venn1,a.venn2,a.venn3,a.venn4,a.venn5,a.venn6,a.venn7,a.venn8].filter(Boolean),S=r.getDiagramTitle?.(),y=r.getSubsetData(),E=r.getTextData(),w=le(r.getStyleData()),D=ue(y),q=o?.width??800,F=o?.height??450,N=1600,b=q/1600,_=S?48*b:0,T=a.primaryTextColor??a.textColor,u=X(s);if(u.attr("viewBox",`0 0 ${q} ${F}`),S)u.append("text").text(S).attr("class","venn-title").attr("font-size",`${32*b}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*b).style("fill",a.vennTitleTextColor||a.titleColor);let v=p(document.createElement("div")),x=te().width(q).height(F-_);v.datum(D).call(x);let W=d?m.svg(v.select("svg").node()):void 0,C=oe(D,{width:q,height:F-_,padding:o?.padding??15}),H=new Map;for(let G of C){let Y=xt([...G.data.sets].sort());H.set(Y,G)}if(E.length>0)ce(o,H,v,E,b,w);let at=ne(a.background||"#f4f4f4");if(v.selectAll(".venn-circle").each(function(G,Y){let V=p(this),st=xt([...G.sets].sort()),tt=w.get(st),lt=l.length>0?l[Y%l.length]:void 0,it=tt?.fill||lt||a.primaryColor;V.classed(`venn-set-${Y%8}`,!0);let et=tt?.["fill-opacity"]??0.1,U=tt?.stroke||it,ft=tt?.["stroke-width"]||`${5*b}`;if(d&&W){let z=H.get(st);if(z&&z.circles.length>0){let J=z.circles[0],yt=W.circle(J.x,J.y,J.radius*2,{roughness:0.7,seed:g,fill:St(it,0.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+Y*60,stroke:U,strokeWidth:parseFloat(String(ft))});V.select("path").remove(),V.node()?.insertBefore(yt,V.select("text").node())}}else V.select("path").style("fill",it).style("fill-opacity",et).style("stroke",U).style("stroke-width",ft).style("stroke-opacity",0.95);let ut=tt?.color||(at?f(it,30):h(it,30));V.select("text").style("font-size",`${48*b}px`).style("fill",ut)}),d&&W)v.selectAll(".venn-intersection").each(function(G){let Y=p(this),Q=xt([...G.sets].sort()),st=w.get(Q),tt=st?.fill;if(tt){let lt=Y.select("path"),it=lt.attr("d");if(it){let et=W.path(it,{roughness:0.7,seed:g,fill:St(tt,0.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),U=lt.node();U?.parentNode?.insertBefore(et,U),lt.remove()}}else Y.select("path").style("fill-opacity",0);Y.select("text").style("font-size",`${48*b}px`).style("fill",st?.color??a.vennSetTextColor??T)});else v.selectAll(".venn-intersection text").style("font-size",`${48*b}px`).style("fill",(G)=>{let V=xt([...G.sets].sort());return w.get(V)?.color??a.vennSetTextColor??T}),v.selectAll(".venn-intersection path").style("fill-opacity",(G)=>{let V=xt([...G.sets].sort());return w.get(V)?.fill?1:0}).style("fill",(G)=>{let V=xt([...G.sets].sort());return w.get(V)?.fill??"transparent"});let nt=u.append("g").attr("transform",`translate(0, ${_})`),Z=v.select("svg").node();if(Z&&"childNodes"in Z)for(let G of[...Z.childNodes])nt.node()?.appendChild(G);j(u,F,q,o?.useMaxWidth??!0)},"draw");function xt(t){return t.join("|")}e(xt,"stableSetsKey");function ce(t,s,i,n,r,o){let a=t?.useDebugLayout??!1,g=i.select("svg").append("g").attr("class","venn-text-nodes"),d=new Map;for(let l of n){let S=xt(l.sets),y=d.get(S);if(y)y.push(l);else d.set(S,[l])}for(let[l,S]of d.entries()){let y=s.get(l);if(!y?.text)continue;let E=y.text.x,w=y.text.y,D=Math.min(...y.circles.map((Z)=>Z.radius)),q=Math.min(...y.circles.map((Z)=>Z.radius-Math.hypot(E-Z.x,w-Z.y))),F=Number.isFinite(q)?Math.max(0,q):0;if(F===0&&Number.isFinite(D))F=D*0.6;let N=g.append("g").attr("class","venn-text-area").attr("font-size",`${40*r}px`);if(a)N.append("circle").attr("class","venn-text-debug-circle").attr("cx",E).attr("cy",w).attr("r",F).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*r).attr("stroke-dasharray",`${6*r} ${4*r}`);let b=Math.max(80*r,F*2*0.95),_=Math.max(60*r,F*2*0.95),v=(y.data.label&&y.data.label.length>0?Math.min(32*r,F*0.25):0)+(S.length<=2?30*r:0),x=E-b/2,W=w-_/2+v,C=Math.max(1,Math.ceil(Math.sqrt(S.length))),H=Math.max(1,Math.ceil(S.length/C)),at=b/C,nt=_/H;for(let[Z,G]of S.entries()){let Y=Z%C,V=Math.floor(Z/C),Q=x+at*(Y+0.5),st=W+nt*(V+0.5);if(a)N.append("rect").attr("class","venn-text-debug-cell").attr("x",x+at*Y).attr("y",W+nt*V).attr("width",at).attr("height",nt).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*r).attr("stroke-dasharray",`${4*r} ${3*r}`);let tt=at*0.9,lt=nt*0.9,it=N.append("foreignObject").attr("class","venn-text-node-fo").attr("width",tt).attr("height",lt).attr("x",Q-tt/2).attr("y",st-lt/2).attr("overflow","visible"),et=o.get(G.id)?.color,U=it.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(G.label??G.id);if(et)U.style("color",et)}}}e(ce,"renderTextNodes");function ue(t){let s=new Set(t.map((r)=>[...r.sets].sort().join("|"))),i=new Map(t.filter((r)=>r.sets.length===1&&r.size!==void 0).map((r)=>[r.sets[0],r.size])),n=[];for(let r of t){if(r.sets.length<3)continue;let o=[...r.sets].sort();for(let a=0;a<o.length-1;a++)for(let c=a+1;c<o.length;c++){let g=[o[a],o[c]],d=g.join("|");if(!s.has(d)){s.add(d);let l=i.get(g[0]),S=i.get(g[1]),y=l!==void 0&&S!==void 0?Math.min(l,S)/4:2.5;n.push({sets:g,size:y,label:""})}}}return n.length>0?[...t,...n]:t}e(ue,"ensurePairwiseSubsets");var He={draw:Ke},rn={parser:ze,db:Ue,renderer:He,styles:We};export{rn as diagram};
@@ -0,0 +1 @@
1
+ import{Xo}from"./index.3y8baz7q.js";export{Xo as createWardleyServices};
@@ -1,5 +1,5 @@
1
- import{ee}from"./index.0g1t1pjx.js";import{e,n,Ie,k,j,A,L,R,I,M,P,O,u,X,Y}from"./index.zkx4ryzt.js";import{oe}from"./index.6pzexww5.js";var at=e((a,i)=>{let o=a<=1?a*100:a;if(o<0||o>100)throw Error(`${i} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return o},"toPercent"),q=e((a,i,o)=>({x:at(i,`${o} evolution`),y:at(a,`${o} visibility`)}),"toCoordinates"),lt=e((a)=>{if(!a)return;if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward";return},"getFlowFromPort"),Yt=e((a)=>{if(!a?.startsWith("+"))return{};let o=/^\+'([^']*)'/.exec(a)?.[1];if(a.includes("<>"))return{flow:"bidirectional",label:o};if(a.includes("<"))return{flow:"backward",label:o};if(a.includes(">"))return{flow:"forward",label:o};return{label:o}},"extractFlowFromArrow"),It=e((a,i)=>{if(ee(a,i),a.size)i.setSize(a.size.width,a.size.height);if(a.evolution){let o=a.evolution.stages.map((r)=>{if(r.secondName)return`${r.name.trim()} / ${r.secondName.trim()}`;return r.name.trim()}),g=a.evolution.stages.filter((r)=>r.boundary!==void 0).map((r)=>r.boundary);i.updateAxes({stages:o,stageBoundaries:g})}if(a.anchors.forEach((o)=>{let g=q(o.visibility,o.evolution,`Anchor "${o.name}"`);i.addNode(o.name,o.name,g.x,g.y,"anchor")}),a.components.forEach((o)=>{let g=q(o.visibility,o.evolution,`Component "${o.name}"`),r=o.label?(o.label.negX?-1:1)*o.label.offsetX:void 0,c=o.label?(o.label.negY?-1:1)*o.label.offsetY:void 0,b=o.decorator?.strategy;i.addNode(o.name,o.name,g.x,g.y,"component",r,c,o.inertia,b)}),a.notes.forEach((o)=>{let g=q(o.visibility,o.evolution,`Note "${o.text}"`);i.addNote(o.text,g.x,g.y)}),a.pipelines.forEach((o)=>{let g=i.getNode(o.parent);if(!g||typeof g.y!=="number")throw Error(`Pipeline "${o.parent}" must reference an existing component with coordinates.`);let r=g.y;i.startPipeline(o.parent),o.components.forEach((c)=>{let b=`${o.parent}_${c.name}`,W=c.label?(c.label.negX?-1:1)*c.label.offsetX:void 0,w=c.label?(c.label.negY?-1:1)*c.label.offsetY:void 0,K=at(c.evolution,`Pipeline component "${c.name}" evolution`);i.addNode(b,c.name,K,r,"pipeline-component",W,w),i.addPipelineComponent(o.parent,b)})}),a.links.forEach((o)=>{let g=!!o.arrow&&(o.arrow.includes("-.->")||o.arrow.includes(".-.")),r=lt(o.fromPort)??lt(o.toPort),{flow:c,label:b}=Yt(o.arrow);if(!r&&c)r=c;let W=o.linkLabel,w=b??W;i.addLink(i.resolveNodeId(o.from),i.resolveNodeId(o.to),g,w,r)}),a.evolves.forEach((o)=>{let g=i.getNode(o.component);if(g?.y!==void 0){let r=at(o.target,`Evolve target for "${o.component}"`);i.addTrend(o.component,r,g.y)}}),a.annotations.length>0){let o=a.annotations[0],g=q(o.x,o.y,"Annotations box");i.setAnnotationsBox(g.x,g.y)}a.annotation.forEach((o)=>{let g=q(o.x,o.y,`Annotation ${o.number}`);i.addAnnotation(o.number,[{x:g.x,y:g.y}],o.text)}),a.accelerators.forEach((o)=>{let g=q(o.x,o.y,`Accelerator "${o.name}"`);i.addAccelerator(o.name,g.x,g.y)}),a.deaccelerators.forEach((o)=>{let g=q(o.x,o.y,`Deaccelerator "${o.name}"`);i.addDeaccelerator(o.name,g.x,g.y)})},"populateDb"),ct={parser:{yy:void 0},parse:e(async(a)=>{let i=await oe("wardley",a);n.debug(i);let o=ct.parser?.yy;if(!o||typeof o.addNode!=="function")throw Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");It(i,o)},"parse")},Bt=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{e(this,"WardleyBuilder")}addNode(a){let i=this.nodes.get(a.id)??{id:a.id,label:a.label},o={...i,...a,className:a.className??i.className,labelOffsetX:a.labelOffsetX??i.labelOffsetX,labelOffsetY:a.labelOffsetY??i.labelOffsetY};this.nodes.set(a.id,o)}addLink(a){this.links.push(a)}addTrend(a){this.trends.set(a.nodeId,a)}startPipeline(a){this.pipelines.set(a,{nodeId:a,componentIds:[]});let i=this.nodes.get(a);if(i)i.isPipelineParent=!0}addPipelineComponent(a,i){let o=this.pipelines.get(a);if(o)o.componentIds.push(i);let g=this.nodes.get(i);if(g)g.inPipeline=!0}addAnnotation(a){this.annotations.push(a)}addNote(a){this.notes.push(a)}addAccelerator(a){this.accelerators.push(a)}addDeaccelerator(a){this.deaccelerators.push(a)}setAnnotationsBox(a,i){this.annotationsBox={x:a,y:i}}setAxes(a){this.axes={...this.axes,...a}}setSize(a,i){this.size={width:a,height:i}}getNode(a){return this.nodes.get(a)}resolveNodeId(a){if(this.nodes.has(a))return a;for(let[i,o]of this.nodes)if(o.label===a)return i;return a}build(){let a=[];for(let i of this.nodes.values()){if(typeof i.x!=="number"||typeof i.y!=="number")throw Error(`Node "${i.label}" is missing coordinates`);a.push(i)}return{nodes:a,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},C=new Bt;function pt(){return u()["wardley-beta"]}e(pt,"getConfig");function ht(a,i,o,g,r,c,b,W,w){C.addNode({id:a,label:i,x:o,y:g,className:r,labelOffsetX:c,labelOffsetY:b,inertia:W,sourceStrategy:w})}e(ht,"addNode");function ft(a,i,o=!1,g,r){C.addLink({source:a,target:i,dashed:o,label:g,flow:r})}e(ft,"addLink");function xt(a,i,o){C.addTrend({nodeId:a,targetX:i,targetY:o})}e(xt,"addTrend");function gt(a,i,o){C.addAnnotation({number:a,coordinates:i,text:o})}e(gt,"addAnnotation");function yt(a,i,o){C.addNote({text:a,x:i,y:o})}e(yt,"addNote");function ut(a,i,o){C.addAccelerator({name:a,x:i,y:o})}e(ut,"addAccelerator");function wt(a,i,o){C.addDeaccelerator({name:a,x:i,y:o})}e(wt,"addDeaccelerator");function mt(a,i){C.setAnnotationsBox(a,i)}e(mt,"setAnnotationsBox");function kt(a,i){C.setSize(a,i)}e(kt,"setSize");function bt(a){C.startPipeline(a)}e(bt,"startPipeline");function $t(a,i){C.addPipelineComponent(a,i)}e($t,"addPipelineComponent");function vt(a){C.setAxes(a)}e(vt,"updateAxes");function Pt(a){return C.getNode(a)}e(Pt,"getNode");function Ct(a){return C.resolveNodeId(a)}e(Ct,"resolveNodeId");function St(){return C.build()}e(St,"getWardleyData");function Mt(){C.clear(),A()}e(Mt,"clear");var Ft={getConfig:pt,addNode:ht,addLink:ft,addTrend:xt,addAnnotation:gt,addNote:yt,addAccelerator:ut,addDeaccelerator:wt,setAnnotationsBox:mt,setSize:kt,startPipeline:bt,addPipelineComponent:$t,updateAxes:vt,getNode:Pt,resolveNodeId:Ct,getWardleyData:St,clear:Mt,setAccTitle:L,getAccTitle:R,setDiagramTitle:P,getDiagramTitle:O,getAccDescription:M,setAccDescription:I},Rt=["Genesis","Custom Built","Product","Commodity"],Ot=e(()=>{let{themeVariables:a}=u();return{backgroundColor:a.wardley?.backgroundColor??a.background??"#fff",axisColor:a.wardley?.axisColor??"#000",axisTextColor:a.wardley?.axisTextColor??a.primaryTextColor??"#222",gridColor:a.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:a.wardley?.componentFill??"#fff",componentStroke:a.wardley?.componentStroke??"#000",componentLabelColor:a.wardley?.componentLabelColor??a.primaryTextColor??"#222",linkStroke:a.wardley?.linkStroke??"#000",evolutionStroke:a.wardley?.evolutionStroke??"#dc3545",annotationStroke:a.wardley?.annotationStroke??"#000",annotationTextColor:a.wardley?.annotationTextColor??a.primaryTextColor??"#222",annotationFill:a.wardley?.annotationFill??a.background??"#fff"}},"getTheme"),Dt=e(()=>{let a=u()["wardley-beta"];return{width:a?.width??900,height:a?.height??600,padding:a?.padding??48,nodeRadius:a?.nodeRadius??6,nodeLabelOffset:a?.nodeLabelOffset??8,axisFontSize:a?.axisFontSize??12,labelFontSize:a?.labelFontSize??10,showGrid:a?.showGrid??!1,useMaxWidth:a?.useMaxWidth??!0}},"getConfigValues"),Gt=e((a,i,o,g)=>{n.debug(`Rendering Wardley map
2
- `+a);let r=Dt(),c=Ot(),b=r.nodeRadius*1.6,W=g.db,w=W.getWardleyData(),K=W.getDiagramTitle(),E=w.size?.width??r.width,S=w.size?.height??r.height,_=X(i);_.selectAll("*").remove(),j(_,S,E,r.useMaxWidth),_.attr("viewBox",`0 0 ${E} ${S}`);let z=_.append("g").attr("class","wardley-map"),rt=_.append("defs");rt.append("marker").attr("id",`arrow-${i}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",c.evolutionStroke).attr("stroke","none"),rt.append("marker").attr("id",`link-arrow-end-${i}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",c.linkStroke).attr("stroke","none"),rt.append("marker").attr("id",`link-arrow-start-${i}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",c.linkStroke).attr("stroke","none"),z.append("rect").attr("class","wardley-background").attr("width",E).attr("height",S).attr("fill",c.backgroundColor);let Z=E-r.padding*2,U=S-r.padding*2;if(K)z.append("text").attr("class","wardley-title").attr("x",E/2).attr("y",r.padding/2).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(K);let F=e((t)=>r.padding+t/100*Z,"projectX"),D=e((t)=>S-r.padding-t/100*U,"projectY"),Q=z.append("g").attr("class","wardley-axes");Q.append("line").attr("x1",r.padding).attr("x2",E-r.padding).attr("y1",S-r.padding).attr("y2",S-r.padding).attr("stroke",c.axisColor).attr("stroke-width",1),Q.append("line").attr("x1",r.padding).attr("x2",r.padding).attr("y1",r.padding).attr("y2",S-r.padding).attr("stroke",c.axisColor).attr("stroke-width",1);let Nt=w.axes.xLabel??"Evolution",zt=w.axes.yLabel??"Visibility";Q.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",r.padding+Z/2).attr("y",S-r.padding/4).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(Nt),Q.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",r.padding/3).attr("y",r.padding+U/2).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${r.padding/3} ${r.padding+U/2})`).text(zt);let J=w.axes.stages&&w.axes.stages.length>0?w.axes.stages:Rt;if(J.length>0){let t=z.append("g").attr("class","wardley-stages"),d=w.axes.stageBoundaries,s=[];if(d&&d.length===J.length){let l=0;d.forEach((h)=>{s.push({start:l,end:h}),l=h})}else{let l=1/J.length;J.forEach((h,f)=>{s.push({start:f*l,end:(f+1)*l})})}J.forEach((l,h)=>{let f=s[h],y=r.padding+f.start*Z,x=r.padding+f.end*Z,m=(y+x)/2;if(h>0)t.append("line").attr("x1",y).attr("x2",y).attr("y1",r.padding).attr("y2",S-r.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",0.8);t.append("text").attr("class","wardley-stage-label").attr("x",m).attr("y",S-r.padding/1.5).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize-2).attr("text-anchor","middle").text(l)})}if(r.showGrid){let t=z.append("g").attr("class","wardley-grid");for(let d=1;d<4;d++){let s=d/4,l=r.padding+Z*s;t.append("line").attr("x1",l).attr("x2",l).attr("y1",r.padding).attr("y2",S-r.padding).attr("stroke",c.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",r.padding).attr("x2",E-r.padding).attr("y1",S-r.padding-U*s).attr("y2",S-r.padding-U*s).attr("stroke",c.gridColor).attr("stroke-dasharray","2 6")}}let p=new Map;if(w.nodes.forEach((t)=>{p.set(t.id,{x:F(t.x),y:D(t.y),node:t})}),w.pipelines.length>0){let t=z.append("g").attr("class","wardley-pipelines"),d=z.append("g").attr("class","wardley-pipeline-links");w.pipelines.forEach((s)=>{if(s.componentIds.length===0)return;let l=s.componentIds.map((x)=>({id:x,pos:p.get(x),node:w.nodes.find((m)=>m.id===x)})).filter((x)=>x.pos&&x.node).sort((x,m)=>x.node.x-m.node.x);for(let x=0;x<l.length-1;x++){let m=l[x],v=l[x+1];d.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",m.pos.x).attr("y1",m.pos.y).attr("x2",v.pos.x).attr("y2",v.pos.y).attr("stroke",c.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let h=1/0,f=-1/0,y=0;if(s.componentIds.forEach((x)=>{let m=p.get(x);if(m)h=Math.min(h,m.x),f=Math.max(f,m.x),y=m.y}),h!==1/0&&f!==-1/0){let m=r.nodeRadius*4,v=y-m/2,T=p.get(s.nodeId);if(T){let B=(h+f)/2;T.x=B,T.y=v-b/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",h-15).attr("y",v).attr("width",f-h+30).attr("height",m).attr("fill","none").attr("stroke",c.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}let st=z.append("g").attr("class","wardley-links"),it=new Map;w.pipelines.forEach((t)=>{it.set(t.nodeId,new Set(t.componentIds))});let dt=w.links.filter((t)=>{if(!p.has(t.source)||!p.has(t.target))return!1;if(it.get(t.target)?.has(t.source))return!1;return!0});st.selectAll("line").data(dt).enter().append("line").attr("class",(t)=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",(t)=>{let d=p.get(t.source),s=p.get(t.target),h=w.nodes.find((m)=>m.id===t.source).isPipelineParent?b/Math.sqrt(2):r.nodeRadius,f=s.x-d.x,y=s.y-d.y,x=Math.sqrt(f*f+y*y);return d.x+f/x*h}).attr("y1",(t)=>{let d=p.get(t.source),s=p.get(t.target),h=w.nodes.find((m)=>m.id===t.source).isPipelineParent?b/Math.sqrt(2):r.nodeRadius,f=s.x-d.x,y=s.y-d.y,x=Math.sqrt(f*f+y*y);return d.y+y/x*h}).attr("x2",(t)=>{let d=p.get(t.source),s=p.get(t.target),h=w.nodes.find((m)=>m.id===t.target).isPipelineParent?b/Math.sqrt(2):r.nodeRadius,f=d.x-s.x,y=d.y-s.y,x=Math.sqrt(f*f+y*y);return s.x+f/x*h}).attr("y2",(t)=>{let d=p.get(t.source),s=p.get(t.target),h=w.nodes.find((m)=>m.id===t.target).isPipelineParent?b/Math.sqrt(2):r.nodeRadius,f=d.x-s.x,y=d.y-s.y,x=Math.sqrt(f*f+y*y);return s.y+y/x*h}).attr("stroke",c.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",(t)=>t.dashed?"6 6":null).attr("marker-end",(t)=>{if(t.flow==="forward"||t.flow==="bidirectional")return`url(#link-arrow-end-${i})`;return null}).attr("marker-start",(t)=>{if(t.flow==="backward"||t.flow==="bidirectional")return`url(#link-arrow-start-${i})`;return null}),st.selectAll("text").data(dt.filter((t)=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",(t)=>{let d=p.get(t.source),s=p.get(t.target),l=(d.x+s.x)/2,h=s.y-d.y,f=s.x-d.x,y=Math.sqrt(f*f+h*h),x=8,m=h/y;return l+m*8}).attr("y",(t)=>{let d=p.get(t.source),s=p.get(t.target),l=(d.y+s.y)/2,h=s.x-d.x,f=s.y-d.y,y=Math.sqrt(h*h+f*f),x=8,m=-h/y;return l+m*8}).attr("fill",c.axisTextColor).attr("font-size",r.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",(t)=>{let d=p.get(t.source),s=p.get(t.target),l=(d.x+s.x)/2,h=(d.y+s.y)/2,f=s.x-d.x,y=s.y-d.y,x=Math.sqrt(f*f+y*y),m=8,v=y/x,T=-f/x,B=l+v*8,tt=h+T*8,V=Math.atan2(y,f)*180/Math.PI;if(V>90||V<-90)V+=180;return`rotate(${V} ${B} ${tt})`}).text((t)=>t.label);let Lt=z.append("g").attr("class","wardley-trends"),Tt=w.trends.map((t)=>{let d=p.get(t.nodeId);if(!d)return null;let s=F(t.targetX),l=D(t.targetY),h=s-d.x,f=l-d.y,y=Math.sqrt(h*h+f*f),x=r.nodeRadius+2,m=y>x?s-h/y*x:s,v=y>x?l-f/y*x:l;return{origin:d,targetX:s,targetY:l,adjustedX2:m,adjustedY2:v}}).filter((t)=>t!==null);Lt.selectAll("line").data(Tt).enter().append("line").attr("class","wardley-trend").attr("x1",(t)=>t.origin.x).attr("y1",(t)=>t.origin.y).attr("x2",(t)=>t.adjustedX2).attr("y2",(t)=>t.adjustedY2).attr("stroke",c.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${i})`);let H=z.append("g").attr("class","wardley-nodes").selectAll("g").data(w.nodes).enter().append("g").attr("class",(t)=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));H.filter((t)=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#666").attr("stroke",c.componentStroke).attr("stroke-width",1),H.filter((t)=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#ccc").attr("stroke",c.componentStroke).attr("stroke-width",1),H.filter((t)=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);let G=H.filter((t)=>t.sourceStrategy==="market");G.append("circle").attr("class","wardley-market-overlay").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",1),H.filter((t)=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius).attr("fill",c.componentFill).attr("stroke",c.componentStroke).attr("stroke-width",1);let ot=r.nodeRadius*0.7,N=r.nodeRadius*1.2;if(G.append("line").attr("class","wardley-market-line").attr("x1",(t)=>p.get(t.id).x).attr("y1",(t)=>p.get(t.id).y-N).attr("x2",(t)=>p.get(t.id).x-N*Math.cos(Math.PI/6)).attr("y2",(t)=>p.get(t.id).y+N*Math.sin(Math.PI/6)).attr("stroke",c.componentStroke).attr("stroke-width",1),G.append("line").attr("class","wardley-market-line").attr("x1",(t)=>p.get(t.id).x-N*Math.cos(Math.PI/6)).attr("y1",(t)=>p.get(t.id).y+N*Math.sin(Math.PI/6)).attr("x2",(t)=>p.get(t.id).x+N*Math.cos(Math.PI/6)).attr("y2",(t)=>p.get(t.id).y+N*Math.sin(Math.PI/6)).attr("stroke",c.componentStroke).attr("stroke-width",1),G.append("line").attr("class","wardley-market-line").attr("x1",(t)=>p.get(t.id).x+N*Math.cos(Math.PI/6)).attr("y1",(t)=>p.get(t.id).y+N*Math.sin(Math.PI/6)).attr("x2",(t)=>p.get(t.id).x).attr("y2",(t)=>p.get(t.id).y-N).attr("stroke",c.componentStroke).attr("stroke-width",1),G.append("circle").attr("class","wardley-market-dot").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y-N).attr("r",ot).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",2),G.append("circle").attr("class","wardley-market-dot").attr("cx",(t)=>p.get(t.id).x-N*Math.cos(Math.PI/6)).attr("cy",(t)=>p.get(t.id).y+N*Math.sin(Math.PI/6)).attr("r",ot).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",2),G.append("circle").attr("class","wardley-market-dot").attr("cx",(t)=>p.get(t.id).x+N*Math.cos(Math.PI/6)).attr("cy",(t)=>p.get(t.id).y+N*Math.sin(Math.PI/6)).attr("r",ot).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",2),H.filter((t)=>t.isPipelineParent===!0).append("rect").attr("x",(t)=>p.get(t.id).x-b/2).attr("y",(t)=>p.get(t.id).y-b/2).attr("width",b).attr("height",b).attr("fill",c.componentFill).attr("stroke",c.componentStroke).attr("stroke-width",1),H.filter((t)=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",(t)=>{let d=p.get(t.id),s=t.isPipelineParent?b/2+15:r.nodeRadius+15;if(t.sourceStrategy)s+=r.nodeRadius+10;return d.x+s}).attr("y1",(t)=>{let d=p.get(t.id),s=t.isPipelineParent?b:r.nodeRadius*2;return d.y-s/2}).attr("x2",(t)=>{let d=p.get(t.id),s=t.isPipelineParent?b/2+15:r.nodeRadius+15;if(t.sourceStrategy)s+=r.nodeRadius+10;return d.x+s}).attr("y2",(t)=>{let d=p.get(t.id),s=t.isPipelineParent?b:r.nodeRadius*2;return d.y+s/2}).attr("stroke",c.componentStroke).attr("stroke-width",6),H.append("text").attr("x",(t)=>{let d=p.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?d.x+t.labelOffsetX:d.x;let s=r.nodeLabelOffset;if(t.sourceStrategy&&t.labelOffsetX===void 0)s+=10;let l=t.labelOffsetX??s;return d.x+l}).attr("y",(t)=>{let d=p.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?d.y+t.labelOffsetY:d.y-3;let s=-r.nodeLabelOffset;if(t.sourceStrategy&&t.labelOffsetY===void 0)s-=10;let l=t.labelOffsetY??s;return d.y+l}).attr("class","wardley-node-label").attr("fill",(t)=>{if(t.className==="evolved")return c.evolutionStroke;if(t.className==="anchor")return"#000";return c.componentLabelColor}).attr("font-size",r.labelFontSize).attr("font-weight",(t)=>t.className==="anchor"?"bold":"normal").attr("text-anchor",(t)=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",(t)=>t.className==="anchor"?"middle":"auto").text((t)=>t.label),w.annotations.length>0){let t=z.append("g").attr("class","wardley-annotations");if(w.annotations.forEach((d)=>{let s=d.coordinates.map((l)=>({x:F(l.x),y:D(l.y)}));if(s.length>1)for(let l=0;l<s.length-1;l++)t.append("line").attr("class","wardley-annotation-line").attr("x1",s[l].x).attr("y1",s[l].y).attr("x2",s[l+1].x).attr("y2",s[l+1].y).attr("stroke",c.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");s.forEach((l)=>{let h=t.append("g").attr("class","wardley-annotation");h.append("circle").attr("cx",l.x).attr("cy",l.y).attr("r",10).attr("fill","white").attr("stroke",c.axisColor).attr("stroke-width",1.5),h.append("text").attr("x",l.x).attr("y",l.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",c.axisTextColor).attr("font-weight","bold").text(d.number)})}),w.annotationsBox){let d=F(w.annotationsBox.x),s=D(w.annotationsBox.y),l=10,h=16,f=11,y=t.append("g").attr("class","wardley-annotations-box"),x=[...w.annotations].filter((v)=>v.text).sort((v,T)=>v.number-T.number),m=[];if(x.forEach((v,T)=>{let B=y.append("text").attr("x",d+l).attr("y",s+l+(T+1)*h).attr("font-size",f).attr("fill",c.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${v.number}. ${v.text}`);m.push(B)}),m.length>0){let v=0,T=0;m.forEach((nt)=>{let et=nt.node(),Et=et.getComputedTextLength();v=Math.max(v,Et);let Ht=et.getBBox();T=Math.max(T,Ht.height)});let B=v+l*2+105,tt=x.length*h+l*2+T/2,V=r.padding,Wt=E-r.padding-B,At=r.padding,Xt=S-r.padding-tt;d=Math.max(V,Math.min(d,Wt)),s=Math.max(At,Math.min(s,Xt)),m.forEach((nt,et)=>{nt.attr("x",d+l).attr("y",s+l+(et+1)*h)}),y.insert("rect","text").attr("x",d).attr("y",s).attr("width",B).attr("height",tt).attr("fill","white").attr("stroke",c.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(w.notes.length>0){let t=z.append("g").attr("class","wardley-notes");w.notes.forEach((d)=>{let s=F(d.x),l=D(d.y);t.append("text").attr("x",s).attr("y",l).attr("text-anchor","start").attr("font-size",11).attr("fill",c.axisTextColor).attr("font-weight","bold").text(d.text)})}if(w.accelerators.length>0){let t=z.append("g").attr("class","wardley-accelerators");w.accelerators.forEach((d)=>{let s=F(d.x),l=D(d.y),h=60,f=30,y=20,x=`
1
+ import{ee}from"./index.a7m06kba.js";import{e,n,Ie,k,j,A,L,R,I,M,P,O,u,X,K}from"./index.5sj251kq.js";import{oe}from"./index.3y8baz7q.js";var at=e((a,i)=>{let o=a<=1?a*100:a;if(o<0||o>100)throw Error(`${i} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return o},"toPercent"),G=e((a,i,o)=>({x:at(i,`${o} evolution`),y:at(a,`${o} visibility`)}),"toCoordinates"),lt=e((a)=>{if(!a)return;if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward";return},"getFlowFromPort"),Yt=e((a)=>{if(!a?.startsWith("+"))return{};let o=/^\+'([^']*)'/.exec(a)?.[1];if(a.includes("<>"))return{flow:"bidirectional",label:o};if(a.includes("<"))return{flow:"backward",label:o};if(a.includes(">"))return{flow:"forward",label:o};return{label:o}},"extractFlowFromArrow"),It=e((a,i)=>{if(ee(a,i),a.size)i.setSize(a.size.width,a.size.height);if(a.evolution){let o=a.evolution.stages.map((r)=>{if(r.secondName)return`${r.name.trim()} / ${r.secondName.trim()}`;return r.name.trim()}),g=a.evolution.stages.filter((r)=>r.boundary!==void 0).map((r)=>r.boundary);i.updateAxes({stages:o,stageBoundaries:g})}if(a.anchors.forEach((o)=>{let g=G(o.visibility,o.evolution,`Anchor "${o.name}"`);i.addNode(o.name,o.name,g.x,g.y,"anchor")}),a.components.forEach((o)=>{let g=G(o.visibility,o.evolution,`Component "${o.name}"`),r=o.label?(o.label.negX?-1:1)*o.label.offsetX:void 0,c=o.label?(o.label.negY?-1:1)*o.label.offsetY:void 0,b=o.decorator?.strategy;i.addNode(o.name,o.name,g.x,g.y,"component",r,c,o.inertia,b)}),a.notes.forEach((o)=>{let g=G(o.visibility,o.evolution,`Note "${o.text}"`);i.addNote(o.text,g.x,g.y)}),a.pipelines.forEach((o)=>{let g=i.getNode(o.parent);if(!g||typeof g.y!=="number")throw Error(`Pipeline "${o.parent}" must reference an existing component with coordinates.`);let r=g.y;i.startPipeline(o.parent),o.components.forEach((c)=>{let b=`${o.parent}_${c.name}`,W=c.label?(c.label.negX?-1:1)*c.label.offsetX:void 0,w=c.label?(c.label.negY?-1:1)*c.label.offsetY:void 0,J=at(c.evolution,`Pipeline component "${c.name}" evolution`);i.addNode(b,c.name,J,r,"pipeline-component",W,w),i.addPipelineComponent(o.parent,b)})}),a.links.forEach((o)=>{let g=!!o.arrow&&(o.arrow.includes("-.->")||o.arrow.includes(".-.")),r=lt(o.fromPort)??lt(o.toPort),{flow:c,label:b}=Yt(o.arrow);if(!r&&c)r=c;let W=o.linkLabel,w=b??W;i.addLink(i.resolveNodeId(o.from),i.resolveNodeId(o.to),g,w,r)}),a.evolves.forEach((o)=>{let g=i.getNode(o.component);if(g?.y!==void 0){let r=at(o.target,`Evolve target for "${o.component}"`);i.addTrend(o.component,r,g.y)}}),a.annotations.length>0){let o=a.annotations[0],g=G(o.x,o.y,"Annotations box");i.setAnnotationsBox(g.x,g.y)}a.annotation.forEach((o)=>{let g=G(o.x,o.y,`Annotation ${o.number}`);i.addAnnotation(o.number,[{x:g.x,y:g.y}],o.text)}),a.accelerators.forEach((o)=>{let g=G(o.x,o.y,`Accelerator "${o.name}"`);i.addAccelerator(o.name,g.x,g.y)}),a.deaccelerators.forEach((o)=>{let g=G(o.x,o.y,`Deaccelerator "${o.name}"`);i.addDeaccelerator(o.name,g.x,g.y)})},"populateDb"),ct={parser:{yy:void 0},parse:e(async(a)=>{let i=await oe("wardley",a);n.debug(i);let o=ct.parser?.yy;if(!o||typeof o.addNode!=="function")throw Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");It(i,o)},"parse")},Bt=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{e(this,"WardleyBuilder")}addNode(a){let i=this.nodes.get(a.id)??{id:a.id,label:a.label},o={...i,...a,className:a.className??i.className,labelOffsetX:a.labelOffsetX??i.labelOffsetX,labelOffsetY:a.labelOffsetY??i.labelOffsetY};this.nodes.set(a.id,o)}addLink(a){this.links.push(a)}addTrend(a){this.trends.set(a.nodeId,a)}startPipeline(a){this.pipelines.set(a,{nodeId:a,componentIds:[]});let i=this.nodes.get(a);if(i)i.isPipelineParent=!0}addPipelineComponent(a,i){let o=this.pipelines.get(a);if(o)o.componentIds.push(i);let g=this.nodes.get(i);if(g)g.inPipeline=!0}addAnnotation(a){this.annotations.push(a)}addNote(a){this.notes.push(a)}addAccelerator(a){this.accelerators.push(a)}addDeaccelerator(a){this.deaccelerators.push(a)}setAnnotationsBox(a,i){this.annotationsBox={x:a,y:i}}setAxes(a){this.axes={...this.axes,...a}}setSize(a,i){this.size={width:a,height:i}}getNode(a){return this.nodes.get(a)}resolveNodeId(a){if(this.nodes.has(a))return a;for(let[i,o]of this.nodes)if(o.label===a)return i;return a}build(){let a=[];for(let i of this.nodes.values()){if(typeof i.x!=="number"||typeof i.y!=="number")throw Error(`Node "${i.label}" is missing coordinates`);a.push(i)}return{nodes:a,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},C=new Bt;function pt(){return u()["wardley-beta"]}e(pt,"getConfig");function ht(a,i,o,g,r,c,b,W,w){C.addNode({id:a,label:i,x:o,y:g,className:r,labelOffsetX:c,labelOffsetY:b,inertia:W,sourceStrategy:w})}e(ht,"addNode");function ft(a,i,o=!1,g,r){C.addLink({source:a,target:i,dashed:o,label:g,flow:r})}e(ft,"addLink");function xt(a,i,o){C.addTrend({nodeId:a,targetX:i,targetY:o})}e(xt,"addTrend");function gt(a,i,o){C.addAnnotation({number:a,coordinates:i,text:o})}e(gt,"addAnnotation");function yt(a,i,o){C.addNote({text:a,x:i,y:o})}e(yt,"addNote");function ut(a,i,o){C.addAccelerator({name:a,x:i,y:o})}e(ut,"addAccelerator");function wt(a,i,o){C.addDeaccelerator({name:a,x:i,y:o})}e(wt,"addDeaccelerator");function mt(a,i){C.setAnnotationsBox(a,i)}e(mt,"setAnnotationsBox");function kt(a,i){C.setSize(a,i)}e(kt,"setSize");function bt(a){C.startPipeline(a)}e(bt,"startPipeline");function $t(a,i){C.addPipelineComponent(a,i)}e($t,"addPipelineComponent");function vt(a){C.setAxes(a)}e(vt,"updateAxes");function Pt(a){return C.getNode(a)}e(Pt,"getNode");function Ct(a){return C.resolveNodeId(a)}e(Ct,"resolveNodeId");function St(){return C.build()}e(St,"getWardleyData");function Mt(){C.clear(),A()}e(Mt,"clear");var Ft={getConfig:pt,addNode:ht,addLink:ft,addTrend:xt,addAnnotation:gt,addNote:yt,addAccelerator:ut,addDeaccelerator:wt,setAnnotationsBox:mt,setSize:kt,startPipeline:bt,addPipelineComponent:$t,updateAxes:vt,getNode:Pt,resolveNodeId:Ct,getWardleyData:St,clear:Mt,setAccTitle:L,getAccTitle:R,setDiagramTitle:P,getDiagramTitle:O,getAccDescription:M,setAccDescription:I},Rt=["Genesis","Custom Built","Product","Commodity"],Ot=e(()=>{let{themeVariables:a}=u();return{backgroundColor:a.wardley?.backgroundColor??a.background??"#fff",axisColor:a.wardley?.axisColor??"#000",axisTextColor:a.wardley?.axisTextColor??a.primaryTextColor??"#222",gridColor:a.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:a.wardley?.componentFill??"#fff",componentStroke:a.wardley?.componentStroke??"#000",componentLabelColor:a.wardley?.componentLabelColor??a.primaryTextColor??"#222",linkStroke:a.wardley?.linkStroke??"#000",evolutionStroke:a.wardley?.evolutionStroke??"#dc3545",annotationStroke:a.wardley?.annotationStroke??"#000",annotationTextColor:a.wardley?.annotationTextColor??a.primaryTextColor??"#222",annotationFill:a.wardley?.annotationFill??a.background??"#fff"}},"getTheme"),Dt=e(()=>{let a=u()["wardley-beta"];return{width:a?.width??900,height:a?.height??600,padding:a?.padding??48,nodeRadius:a?.nodeRadius??6,nodeLabelOffset:a?.nodeLabelOffset??8,axisFontSize:a?.axisFontSize??12,labelFontSize:a?.labelFontSize??10,showGrid:a?.showGrid??!1,useMaxWidth:a?.useMaxWidth??!0}},"getConfigValues"),Gt=e((a,i,o,g)=>{n.debug(`Rendering Wardley map
2
+ `+a);let r=Dt(),c=Ot(),b=r.nodeRadius*1.6,W=g.db,w=W.getWardleyData(),J=W.getDiagramTitle(),E=w.size?.width??r.width,S=w.size?.height??r.height,V=X(i);V.selectAll("*").remove(),j(V,S,E,r.useMaxWidth),V.attr("viewBox",`0 0 ${E} ${S}`);let z=V.append("g").attr("class","wardley-map"),rt=V.append("defs");rt.append("marker").attr("id",`arrow-${i}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",c.evolutionStroke).attr("stroke","none"),rt.append("marker").attr("id",`link-arrow-end-${i}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",c.linkStroke).attr("stroke","none"),rt.append("marker").attr("id",`link-arrow-start-${i}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",c.linkStroke).attr("stroke","none"),z.append("rect").attr("class","wardley-background").attr("width",E).attr("height",S).attr("fill",c.backgroundColor);let _=E-r.padding*2,Z=S-r.padding*2;if(J)z.append("text").attr("class","wardley-title").attr("x",E/2).attr("y",r.padding/2).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(J);let B=e((t)=>r.padding+t/100*_,"projectX"),F=e((t)=>S-r.padding-t/100*Z,"projectY"),Q=z.append("g").attr("class","wardley-axes");Q.append("line").attr("x1",r.padding).attr("x2",E-r.padding).attr("y1",S-r.padding).attr("y2",S-r.padding).attr("stroke",c.axisColor).attr("stroke-width",1),Q.append("line").attr("x1",r.padding).attr("x2",r.padding).attr("y1",r.padding).attr("y2",S-r.padding).attr("stroke",c.axisColor).attr("stroke-width",1);let Nt=w.axes.xLabel??"Evolution",zt=w.axes.yLabel??"Visibility";Q.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",r.padding+_/2).attr("y",S-r.padding/4).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(Nt),Q.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",r.padding/3).attr("y",r.padding+Z/2).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${r.padding/3} ${r.padding+Z/2})`).text(zt);let U=w.axes.stages&&w.axes.stages.length>0?w.axes.stages:Rt;if(U.length>0){let t=z.append("g").attr("class","wardley-stages"),d=w.axes.stageBoundaries,s=[];if(d&&d.length===U.length){let l=0;d.forEach((h)=>{s.push({start:l,end:h}),l=h})}else{let l=1/U.length;U.forEach((h,f)=>{s.push({start:f*l,end:(f+1)*l})})}U.forEach((l,h)=>{let f=s[h],y=r.padding+f.start*_,x=r.padding+f.end*_,m=(y+x)/2;if(h>0)t.append("line").attr("x1",y).attr("x2",y).attr("y1",r.padding).attr("y2",S-r.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",0.8);t.append("text").attr("class","wardley-stage-label").attr("x",m).attr("y",S-r.padding/1.5).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize-2).attr("text-anchor","middle").text(l)})}if(r.showGrid){let t=z.append("g").attr("class","wardley-grid");for(let d=1;d<4;d++){let s=d/4,l=r.padding+_*s;t.append("line").attr("x1",l).attr("x2",l).attr("y1",r.padding).attr("y2",S-r.padding).attr("stroke",c.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",r.padding).attr("x2",E-r.padding).attr("y1",S-r.padding-Z*s).attr("y2",S-r.padding-Z*s).attr("stroke",c.gridColor).attr("stroke-dasharray","2 6")}}let p=new Map;if(w.nodes.forEach((t)=>{p.set(t.id,{x:B(t.x),y:F(t.y),node:t})}),w.pipelines.length>0){let t=z.append("g").attr("class","wardley-pipelines"),d=z.append("g").attr("class","wardley-pipeline-links");w.pipelines.forEach((s)=>{if(s.componentIds.length===0)return;let l=s.componentIds.map((x)=>({id:x,pos:p.get(x),node:w.nodes.find((m)=>m.id===x)})).filter((x)=>x.pos&&x.node).sort((x,m)=>x.node.x-m.node.x);for(let x=0;x<l.length-1;x++){let m=l[x],v=l[x+1];d.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",m.pos.x).attr("y1",m.pos.y).attr("x2",v.pos.x).attr("y2",v.pos.y).attr("stroke",c.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let h=1/0,f=-1/0,y=0;if(s.componentIds.forEach((x)=>{let m=p.get(x);if(m)h=Math.min(h,m.x),f=Math.max(f,m.x),y=m.y}),h!==1/0&&f!==-1/0){let m=r.nodeRadius*4,v=y-m/2,T=p.get(s.nodeId);if(T){let Y=(h+f)/2;T.x=Y,T.y=v-b/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",h-15).attr("y",v).attr("width",f-h+30).attr("height",m).attr("fill","none").attr("stroke",c.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}let st=z.append("g").attr("class","wardley-links"),it=new Map;w.pipelines.forEach((t)=>{it.set(t.nodeId,new Set(t.componentIds))});let dt=w.links.filter((t)=>{if(!p.has(t.source)||!p.has(t.target))return!1;if(it.get(t.target)?.has(t.source))return!1;return!0});st.selectAll("line").data(dt).enter().append("line").attr("class",(t)=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",(t)=>{let d=p.get(t.source),s=p.get(t.target),h=w.nodes.find((m)=>m.id===t.source).isPipelineParent?b/Math.sqrt(2):r.nodeRadius,f=s.x-d.x,y=s.y-d.y,x=Math.sqrt(f*f+y*y);return d.x+f/x*h}).attr("y1",(t)=>{let d=p.get(t.source),s=p.get(t.target),h=w.nodes.find((m)=>m.id===t.source).isPipelineParent?b/Math.sqrt(2):r.nodeRadius,f=s.x-d.x,y=s.y-d.y,x=Math.sqrt(f*f+y*y);return d.y+y/x*h}).attr("x2",(t)=>{let d=p.get(t.source),s=p.get(t.target),h=w.nodes.find((m)=>m.id===t.target).isPipelineParent?b/Math.sqrt(2):r.nodeRadius,f=d.x-s.x,y=d.y-s.y,x=Math.sqrt(f*f+y*y);return s.x+f/x*h}).attr("y2",(t)=>{let d=p.get(t.source),s=p.get(t.target),h=w.nodes.find((m)=>m.id===t.target).isPipelineParent?b/Math.sqrt(2):r.nodeRadius,f=d.x-s.x,y=d.y-s.y,x=Math.sqrt(f*f+y*y);return s.y+y/x*h}).attr("stroke",c.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",(t)=>t.dashed?"6 6":null).attr("marker-end",(t)=>{if(t.flow==="forward"||t.flow==="bidirectional")return`url(#link-arrow-end-${i})`;return null}).attr("marker-start",(t)=>{if(t.flow==="backward"||t.flow==="bidirectional")return`url(#link-arrow-start-${i})`;return null}),st.selectAll("text").data(dt.filter((t)=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",(t)=>{let d=p.get(t.source),s=p.get(t.target),l=(d.x+s.x)/2,h=s.y-d.y,f=s.x-d.x,y=Math.sqrt(f*f+h*h),x=8,m=h/y;return l+m*8}).attr("y",(t)=>{let d=p.get(t.source),s=p.get(t.target),l=(d.y+s.y)/2,h=s.x-d.x,f=s.y-d.y,y=Math.sqrt(h*h+f*f),x=8,m=-h/y;return l+m*8}).attr("fill",c.axisTextColor).attr("font-size",r.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",(t)=>{let d=p.get(t.source),s=p.get(t.target),l=(d.x+s.x)/2,h=(d.y+s.y)/2,f=s.x-d.x,y=s.y-d.y,x=Math.sqrt(f*f+y*y),m=8,v=y/x,T=-f/x,Y=l+v*8,tt=h+T*8,q=Math.atan2(y,f)*180/Math.PI;if(q>90||q<-90)q+=180;return`rotate(${q} ${Y} ${tt})`}).text((t)=>t.label);let Lt=z.append("g").attr("class","wardley-trends"),Tt=w.trends.map((t)=>{let d=p.get(t.nodeId);if(!d)return null;let s=B(t.targetX),l=F(t.targetY),h=s-d.x,f=l-d.y,y=Math.sqrt(h*h+f*f),x=r.nodeRadius+2,m=y>x?s-h/y*x:s,v=y>x?l-f/y*x:l;return{origin:d,targetX:s,targetY:l,adjustedX2:m,adjustedY2:v}}).filter((t)=>t!==null);Lt.selectAll("line").data(Tt).enter().append("line").attr("class","wardley-trend").attr("x1",(t)=>t.origin.x).attr("y1",(t)=>t.origin.y).attr("x2",(t)=>t.adjustedX2).attr("y2",(t)=>t.adjustedY2).attr("stroke",c.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${i})`);let H=z.append("g").attr("class","wardley-nodes").selectAll("g").data(w.nodes).enter().append("g").attr("class",(t)=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));H.filter((t)=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#666").attr("stroke",c.componentStroke).attr("stroke-width",1),H.filter((t)=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#ccc").attr("stroke",c.componentStroke).attr("stroke-width",1),H.filter((t)=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);let D=H.filter((t)=>t.sourceStrategy==="market");D.append("circle").attr("class","wardley-market-overlay").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",1),H.filter((t)=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y).attr("r",r.nodeRadius).attr("fill",c.componentFill).attr("stroke",c.componentStroke).attr("stroke-width",1);let ot=r.nodeRadius*0.7,N=r.nodeRadius*1.2;if(D.append("line").attr("class","wardley-market-line").attr("x1",(t)=>p.get(t.id).x).attr("y1",(t)=>p.get(t.id).y-N).attr("x2",(t)=>p.get(t.id).x-N*Math.cos(Math.PI/6)).attr("y2",(t)=>p.get(t.id).y+N*Math.sin(Math.PI/6)).attr("stroke",c.componentStroke).attr("stroke-width",1),D.append("line").attr("class","wardley-market-line").attr("x1",(t)=>p.get(t.id).x-N*Math.cos(Math.PI/6)).attr("y1",(t)=>p.get(t.id).y+N*Math.sin(Math.PI/6)).attr("x2",(t)=>p.get(t.id).x+N*Math.cos(Math.PI/6)).attr("y2",(t)=>p.get(t.id).y+N*Math.sin(Math.PI/6)).attr("stroke",c.componentStroke).attr("stroke-width",1),D.append("line").attr("class","wardley-market-line").attr("x1",(t)=>p.get(t.id).x+N*Math.cos(Math.PI/6)).attr("y1",(t)=>p.get(t.id).y+N*Math.sin(Math.PI/6)).attr("x2",(t)=>p.get(t.id).x).attr("y2",(t)=>p.get(t.id).y-N).attr("stroke",c.componentStroke).attr("stroke-width",1),D.append("circle").attr("class","wardley-market-dot").attr("cx",(t)=>p.get(t.id).x).attr("cy",(t)=>p.get(t.id).y-N).attr("r",ot).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",2),D.append("circle").attr("class","wardley-market-dot").attr("cx",(t)=>p.get(t.id).x-N*Math.cos(Math.PI/6)).attr("cy",(t)=>p.get(t.id).y+N*Math.sin(Math.PI/6)).attr("r",ot).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",2),D.append("circle").attr("class","wardley-market-dot").attr("cx",(t)=>p.get(t.id).x+N*Math.cos(Math.PI/6)).attr("cy",(t)=>p.get(t.id).y+N*Math.sin(Math.PI/6)).attr("r",ot).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",2),H.filter((t)=>t.isPipelineParent===!0).append("rect").attr("x",(t)=>p.get(t.id).x-b/2).attr("y",(t)=>p.get(t.id).y-b/2).attr("width",b).attr("height",b).attr("fill",c.componentFill).attr("stroke",c.componentStroke).attr("stroke-width",1),H.filter((t)=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",(t)=>{let d=p.get(t.id),s=t.isPipelineParent?b/2+15:r.nodeRadius+15;if(t.sourceStrategy)s+=r.nodeRadius+10;return d.x+s}).attr("y1",(t)=>{let d=p.get(t.id),s=t.isPipelineParent?b:r.nodeRadius*2;return d.y-s/2}).attr("x2",(t)=>{let d=p.get(t.id),s=t.isPipelineParent?b/2+15:r.nodeRadius+15;if(t.sourceStrategy)s+=r.nodeRadius+10;return d.x+s}).attr("y2",(t)=>{let d=p.get(t.id),s=t.isPipelineParent?b:r.nodeRadius*2;return d.y+s/2}).attr("stroke",c.componentStroke).attr("stroke-width",6),H.append("text").attr("x",(t)=>{let d=p.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?d.x+t.labelOffsetX:d.x;let s=r.nodeLabelOffset;if(t.sourceStrategy&&t.labelOffsetX===void 0)s+=10;let l=t.labelOffsetX??s;return d.x+l}).attr("y",(t)=>{let d=p.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?d.y+t.labelOffsetY:d.y-3;let s=-r.nodeLabelOffset;if(t.sourceStrategy&&t.labelOffsetY===void 0)s-=10;let l=t.labelOffsetY??s;return d.y+l}).attr("class","wardley-node-label").attr("fill",(t)=>{if(t.className==="evolved")return c.evolutionStroke;if(t.className==="anchor")return"#000";return c.componentLabelColor}).attr("font-size",r.labelFontSize).attr("font-weight",(t)=>t.className==="anchor"?"bold":"normal").attr("text-anchor",(t)=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",(t)=>t.className==="anchor"?"middle":"auto").text((t)=>t.label),w.annotations.length>0){let t=z.append("g").attr("class","wardley-annotations");if(w.annotations.forEach((d)=>{let s=d.coordinates.map((l)=>({x:B(l.x),y:F(l.y)}));if(s.length>1)for(let l=0;l<s.length-1;l++)t.append("line").attr("class","wardley-annotation-line").attr("x1",s[l].x).attr("y1",s[l].y).attr("x2",s[l+1].x).attr("y2",s[l+1].y).attr("stroke",c.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");s.forEach((l)=>{let h=t.append("g").attr("class","wardley-annotation");h.append("circle").attr("cx",l.x).attr("cy",l.y).attr("r",10).attr("fill","white").attr("stroke",c.axisColor).attr("stroke-width",1.5),h.append("text").attr("x",l.x).attr("y",l.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",c.axisTextColor).attr("font-weight","bold").text(d.number)})}),w.annotationsBox){let d=B(w.annotationsBox.x),s=F(w.annotationsBox.y),l=10,h=16,f=11,y=t.append("g").attr("class","wardley-annotations-box"),x=[...w.annotations].filter((v)=>v.text).sort((v,T)=>v.number-T.number),m=[];if(x.forEach((v,T)=>{let Y=y.append("text").attr("x",d+l).attr("y",s+l+(T+1)*h).attr("font-size",f).attr("fill",c.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${v.number}. ${v.text}`);m.push(Y)}),m.length>0){let v=0,T=0;m.forEach((nt)=>{let et=nt.node(),Et=et.getComputedTextLength();v=Math.max(v,Et);let Ht=et.getBBox();T=Math.max(T,Ht.height)});let Y=v+l*2+105,tt=x.length*h+l*2+T/2,q=r.padding,Wt=E-r.padding-Y,At=r.padding,Xt=S-r.padding-tt;d=Math.max(q,Math.min(d,Wt)),s=Math.max(At,Math.min(s,Xt)),m.forEach((nt,et)=>{nt.attr("x",d+l).attr("y",s+l+(et+1)*h)}),y.insert("rect","text").attr("x",d).attr("y",s).attr("width",Y).attr("height",tt).attr("fill","white").attr("stroke",c.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(w.notes.length>0){let t=z.append("g").attr("class","wardley-notes");w.notes.forEach((d)=>{let s=B(d.x),l=F(d.y);t.append("text").attr("x",s).attr("y",l).attr("text-anchor","start").attr("font-size",11).attr("fill",c.axisTextColor).attr("font-weight","bold").text(d.text)})}if(w.accelerators.length>0){let t=z.append("g").attr("class","wardley-accelerators");w.accelerators.forEach((d)=>{let s=B(d.x),l=F(d.y),h=60,f=30,y=20,x=`
3
3
  M ${s} ${l-15}
4
4
  L ${s+60-20} ${l-15}
5
5
  L ${s+60-20} ${l-15-8}
@@ -8,7 +8,7 @@ import{ee}from"./index.0g1t1pjx.js";import{e,n,Ie,k,j,A,L,R,I,M,P,O,u,X,Y}from".
8
8
  L ${s+60-20} ${l+15}
9
9
  L ${s} ${l+15}
10
10
  Z
11
- `;t.append("path").attr("d",x).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",1),t.append("text").attr("x",s+30).attr("y",l+15+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",c.axisTextColor).attr("font-weight","bold").text(d.name)})}if(w.deaccelerators.length>0){let t=z.append("g").attr("class","wardley-deaccelerators");w.deaccelerators.forEach((d)=>{let s=F(d.x),l=D(d.y),h=60,f=30,y=20,x=`
11
+ `;t.append("path").attr("d",x).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",1),t.append("text").attr("x",s+30).attr("y",l+15+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",c.axisTextColor).attr("font-weight","bold").text(d.name)})}if(w.deaccelerators.length>0){let t=z.append("g").attr("class","wardley-deaccelerators");w.deaccelerators.forEach((d)=>{let s=B(d.x),l=F(d.y),h=60,f=30,y=20,x=`
12
12
  M ${s+60} ${l-15}
13
13
  L ${s+20} ${l-15}
14
14
  L ${s+20} ${l-15-8}
@@ -17,7 +17,7 @@ import{ee}from"./index.0g1t1pjx.js";import{e,n,Ie,k,j,A,L,R,I,M,P,O,u,X,Y}from".
17
17
  L ${s+20} ${l+15}
18
18
  L ${s+60} ${l+15}
19
19
  Z
20
- `;t.append("path").attr("d",x).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",1),t.append("text").attr("x",s+30).attr("y",l+15+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",c.axisTextColor).attr("font-weight","bold").text(d.name)})}},"draw"),qt={draw:Gt},jt=e(({wardley:a}={})=>{let i=Ie(),o=k(),g=Y(i,o.themeVariables),r=Y(g.wardley,a);return`
20
+ `;t.append("path").attr("d",x).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",1),t.append("text").attr("x",s+30).attr("y",l+15+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",c.axisTextColor).attr("font-weight","bold").text(d.name)})}},"draw"),qt={draw:Gt},jt=e(({wardley:a}={})=>{let i=Ie(),o=k(),g=K(i,o.themeVariables),r=K(g.wardley,a);return`
21
21
  .wardley-background {
22
22
  fill: ${r.backgroundColor};
23
23
  }