@leanspec/ui 0.2.21-dev.21575245759 → 0.2.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{_baseUniq-Bt-G8KSC-D27tYV3n.js → _baseUniq-D7Jo4wA--B2TRxPWE.js} +1 -1
- package/dist/assets/{_baseUniq-nZPp3_pT.js → _baseUniq-iT192ZJn.js} +1 -1
- package/dist/assets/{arc-CxsGLnmn.js → arc-BpF2CtTd.js} +1 -1
- package/dist/assets/{arc-DZ2LCm0s-DPK_o6oK.js → arc-bSbgZKu2-DL3rNhb4.js} +1 -1
- package/dist/assets/{architectureDiagram-VXUJARFQ-U-uGQw8X-DYC2qZNI.js → architectureDiagram-VXUJARFQ-B9csKaKv-CjjNwF-J.js} +1 -1
- package/dist/assets/{architectureDiagram-VXUJARFQ-I8x722zf.js → architectureDiagram-VXUJARFQ-RJJR00DR.js} +1 -1
- package/dist/assets/{blockDiagram-VD42YOAC-Bg1O-O95.js → blockDiagram-VD42YOAC-1uTfdDe0.js} +1 -1
- package/dist/assets/{blockDiagram-VD42YOAC-BlLxEg73-DF3T8csB.js → blockDiagram-VD42YOAC-DrRsdznF-BABvqVBT.js} +1 -1
- package/dist/assets/{c4Diagram-YG6GDRKO-CWDMR1_B-CXvvRsJe.js → c4Diagram-YG6GDRKO-Di2rkJ8i-Ds0QfElR.js} +1 -1
- package/dist/assets/{c4Diagram-YG6GDRKO-pEqJtWMO.js → c4Diagram-YG6GDRKO-f40n5_vc.js} +1 -1
- package/dist/assets/channel-B6afjgOL.js +1 -0
- package/dist/assets/channel-CTeTHv-y-DAoPNf9o.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-B-w6f95H.js → chunk-4BX2VUAB-BWm6jvkB.js} +1 -1
- package/dist/assets/{chunk-4BX2VUAB-CXaj02kc-C7T33H1t.js → chunk-4BX2VUAB-Dkr-Egsj-hwESrSLd.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-o1l2wNNZ-B4eZtpxO.js → chunk-55IACEB6-D_uwi6CC-CwcdTnFf.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-DONj5PGh.js → chunk-55IACEB6-SXD_npDw.js} +1 -1
- package/dist/assets/{chunk-B4BG7PRW-ByP5AEXO-D7q5byqQ.js → chunk-B4BG7PRW-BipBIVhj-1FtWONL8.js} +1 -1
- package/dist/assets/{chunk-B4BG7PRW-BiConymO.js → chunk-B4BG7PRW-UGjCd_Gn.js} +1 -1
- package/dist/assets/{chunk-DI55MBZ5-Cy8ug2Ot-BzD-RQbN.js → chunk-DI55MBZ5-8tWOlvAD-Cye13dPz.js} +1 -1
- package/dist/assets/{chunk-DI55MBZ5-5aEOOAh4.js → chunk-DI55MBZ5-BQAFhPjX.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-D2V_FohP-C3CtLLXp.js → chunk-FMBD7UC4-CLc8_72--CGehZjII.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-CFCGkvlM.js → chunk-FMBD7UC4-GQVp2u3C.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-BgDnNc7H-Dg0jsCmn.js → chunk-QN33PNHL-QKH9jByz-BVKajMNG.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-C3TYjKHt.js → chunk-QN33PNHL-xEzemp3c.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN--CtIzUYG-COYF7kdN.js → chunk-QZHKN3VN-BPpgPA2g-DfaPwKB_.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-BTgIbPLF.js → chunk-QZHKN3VN-DmaRauNH.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-BYa7dHNX.js → chunk-TZMSLE5B-Bx7Kyzw7.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-Co2797zI-B0eGB9AN.js → chunk-TZMSLE5B-Coq49FaX-CdOY_0Y9.js} +1 -1
- package/dist/assets/classDiagram-2ON5EDUG-DDdP3lEc.js +1 -0
- package/dist/assets/classDiagram-2ON5EDUG-DYaKkEXb-BMs1bhMY.js +1 -0
- package/dist/assets/classDiagram-v2-WZHVMYZB-DDdP3lEc.js +1 -0
- package/dist/assets/classDiagram-v2-WZHVMYZB-DYaKkEXb-BMs1bhMY.js +1 -0
- package/dist/assets/clone-B4FGNCC9.js +1 -0
- package/dist/assets/clone-Ctm6tjrV-cgncjIrI.js +1 -0
- package/dist/assets/{code-block-37QAKDTI-CV0fNy9d-7-ZI8oN1.js → code-block-37QAKDTI-3zaK1Sok-DkWCKnjc.js} +1 -1
- package/dist/assets/{cose-bilkent-S5V4N54A-DeBB4jVj.js → cose-bilkent-S5V4N54A-OjaorTGT.js} +1 -1
- package/dist/assets/{cose-bilkent-S5V4N54A-KnAtiu0m-COpUFhy5.js → cose-bilkent-S5V4N54A-iUMgKFJZ-CcWe6Gov.js} +1 -1
- package/dist/assets/{dagre-6UL2VRFP-D23NtPEO.js → dagre-6UL2VRFP-BLazRBE2.js} +1 -1
- package/dist/assets/{dagre-6UL2VRFP-D51yjhSx-EqzQGkqV.js → dagre-6UL2VRFP-CKc2IEbO-CPlhk_ig.js} +1 -1
- package/dist/assets/{diagram-PSM6KHXK-Ch_DZlT0.js → diagram-PSM6KHXK-Cz_Zed26.js} +1 -1
- package/dist/assets/{diagram-PSM6KHXK-23_kzlwi-BpZ6Fb-v.js → diagram-PSM6KHXK-DERIvROx-B9mGRCGq.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-BKtrKu-S-DR2vXCUU.js → diagram-QEK2KX5R-B6CdcylU-lSCL2dm4.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-CrY0CKvn.js → diagram-QEK2KX5R-BAMwQLy8.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-DoEO8H2S-0b5T-ySZ.js → diagram-S2PKOQOG-5f_4uCtF-CUC-ZBue.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-FgGua24R.js → diagram-S2PKOQOG-v5vZ9P70.js} +1 -1
- package/dist/assets/{erDiagram-Q2GNP2WA-Brk8cDjC--fOBX-6o.js → erDiagram-Q2GNP2WA-CnN7DF_N-yqb-l1CZ.js} +1 -1
- package/dist/assets/{erDiagram-Q2GNP2WA-CXAB8RkT.js → erDiagram-Q2GNP2WA-DFCKi0mZ.js} +1 -1
- package/dist/assets/{flowDiagram-NV44I4VS-BnzQkPfl.js → flowDiagram-NV44I4VS-3Rq7lbgS.js} +1 -1
- package/dist/assets/{flowDiagram-NV44I4VS-DlEP0pXZ-CkXOee12.js → flowDiagram-NV44I4VS-Dl3ZZj2W-C9K7yiSN.js} +1 -1
- package/dist/assets/{ganttDiagram-JELNMOA3-B3bFmOWF.js → ganttDiagram-JELNMOA3-D76DQdCK.js} +1 -1
- package/dist/assets/{ganttDiagram-JELNMOA3-Bi3P37Jn-3K4cNggw.js → ganttDiagram-JELNMOA3-q87tSGGF-CKPOItTI.js} +1 -1
- package/dist/assets/{gitGraphDiagram-NY62KEGX-B0ee5fGK.js → gitGraphDiagram-NY62KEGX-Db2iqJeU.js} +1 -1
- package/dist/assets/{gitGraphDiagram-NY62KEGX-CTxAPzG3-Dt7-M6Il.js → gitGraphDiagram-NY62KEGX-NeHUXng4-DDlIETSy.js} +1 -1
- package/dist/assets/{graph-Dc_5IX9m.js → graph-D9RB6DwV.js} +1 -1
- package/dist/assets/{graph-BBwx-qRB-Bw-VVURa.js → graph-Da1z0n_J-yJ-tLMG7.js} +1 -1
- package/dist/assets/{index-Ct8vAKMN.js → index-B7GqH6If.js} +469 -469
- package/dist/assets/index-Blg_AJgc.css +1 -0
- package/dist/assets/{infoDiagram-WHAUD3N6-BEIQvzVL.js → infoDiagram-WHAUD3N6-CgNeND0m.js} +1 -1
- package/dist/assets/{infoDiagram-WHAUD3N6-CuYFw1_3-DZl9eVid.js → infoDiagram-WHAUD3N6-Cj-s-gtw-B2FbdsVb.js} +1 -1
- package/dist/assets/{journeyDiagram-XKPGCS4Q-DIhWLskT-D3mqQXDZ.js → journeyDiagram-XKPGCS4Q-BbXXFBC--Cb6ONhr6.js} +1 -1
- package/dist/assets/{journeyDiagram-XKPGCS4Q-RyUDjBEd.js → journeyDiagram-XKPGCS4Q-D0meuzwF.js} +1 -1
- package/dist/assets/{kanban-definition-3W4ZIXB7-CeXULItR.js → kanban-definition-3W4ZIXB7-BCx2MTD3.js} +1 -1
- package/dist/assets/{kanban-definition-3W4ZIXB7-DO-lQxEf-BZn7mE4M.js → kanban-definition-3W4ZIXB7-ClCUbNCO-DyL1fJFZ.js} +1 -1
- package/dist/assets/{layout-BzpSdQ1b-piwZFZhY.js → layout-BoJlbrAK-CAQ1YqzH.js} +1 -1
- package/dist/assets/{layout-ZafNe8NA.js → layout-DFWNR-Y1.js} +1 -1
- package/dist/assets/{linear-CeTmiU5L-DrCaNM8J.js → linear-4rmylyIU-DexK5wO7.js} +1 -1
- package/dist/assets/{min-DK0HBqAV-C6wdO-W-.js → min-C8aXS73f-D0DvW8t2.js} +1 -1
- package/dist/assets/{min-BG6PRNYP.js → min-CRMSN7nx.js} +1 -1
- package/dist/assets/{mindmap-definition-VGOIOE7T-BEPp-fci.js → mindmap-definition-VGOIOE7T-BGABgSVt.js} +1 -1
- package/dist/assets/{mindmap-definition-VGOIOE7T-DuH7hBBA-nWu1G-Wa.js → mindmap-definition-VGOIOE7T-BRNm-2aJ-DQQO6TMa.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-Ckix0LGw.js → pieDiagram-ADFJNKIX-BAPQcD4y.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-C3qcL2xx-Crl6TO-T.js → pieDiagram-ADFJNKIX-BVRqurYx-QWWibrkj.js} +1 -1
- package/dist/assets/{quadrantDiagram-AYHSOK5B-CWcQ_rDh-DSoW8n0T.js → quadrantDiagram-AYHSOK5B-CcsZBY3e-DjxqpMlH.js} +1 -1
- package/dist/assets/{quadrantDiagram-AYHSOK5B-D7wPIJnr.js → quadrantDiagram-AYHSOK5B-kNxQZTX1.js} +1 -1
- package/dist/assets/{requirementDiagram-UZGBJVZJ-vIebjgGs.js → requirementDiagram-UZGBJVZJ-BZ08al2Y.js} +1 -1
- package/dist/assets/{requirementDiagram-UZGBJVZJ-BwrtCkIe-DXNfmmRt.js → requirementDiagram-UZGBJVZJ-CV5SUGj--Crvo94rv.js} +1 -1
- package/dist/assets/{sankeyDiagram-TZEHDZUN-D0EYmAQl-wwDJ3KS4.js → sankeyDiagram-TZEHDZUN-BFPvVGcz-DAajH7lE.js} +1 -1
- package/dist/assets/{sankeyDiagram-TZEHDZUN-Ca0uoUWB.js → sankeyDiagram-TZEHDZUN-BQT0X4qe.js} +1 -1
- package/dist/assets/{sequenceDiagram-WL72ISMW-DJhv-n8R.js → sequenceDiagram-WL72ISMW-BcmegQjZ.js} +1 -1
- package/dist/assets/{sequenceDiagram-WL72ISMW-B9ehIr-I-Cjp87WYq.js → sequenceDiagram-WL72ISMW-CQ5u3b_o-B7RzlL6P.js} +1 -1
- package/dist/assets/{stateDiagram-FKZM4ZOC-CCyyct-m.js → stateDiagram-FKZM4ZOC-C-u3YY-3.js} +1 -1
- package/dist/assets/{stateDiagram-FKZM4ZOC-gpYbn_kg-AXqF50Pv.js → stateDiagram-FKZM4ZOC-zOb-V3pD-D2k2TVkN.js} +1 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-CvvobAsa.js +1 -0
- package/dist/assets/stateDiagram-v2-4FDKWEC3-_Mzc1jVl-lAsEHEbp.js +1 -0
- package/dist/assets/{timeline-definition-IT6M3QCI-B4IcdbBF-sHXwuTVu.js → timeline-definition-IT6M3QCI-B2T2QrC5-eoEFP1Po.js} +1 -1
- package/dist/assets/{timeline-definition-IT6M3QCI-BNtl1Khg.js → timeline-definition-IT6M3QCI-Dx4HH0C5.js} +1 -1
- package/dist/assets/{treemap-KMMF4GRG-CYH0mpe_.js → treemap-KMMF4GRG-DfaADvmb.js} +1 -1
- package/dist/assets/{treemap-KMMF4GRG-CcT4hm8S-BToKQPCO.js → treemap-KMMF4GRG-wB3pBnFc-DQrUn2c6.js} +19 -19
- package/dist/assets/{xychartDiagram-PRI3JC2R-U8S5ep3O-tw2WRWDG.js → xychartDiagram-PRI3JC2R-BSPghzKh-CYIgkUk9.js} +1 -1
- package/dist/assets/{xychartDiagram-PRI3JC2R-CjiaqZ0I.js → xychartDiagram-PRI3JC2R-DusIzSwm.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +4 -3
- package/dist/assets/channel-6eiInZuW-CgNgdRzb.js +0 -1
- package/dist/assets/channel-BJ5t0Etp.js +0 -1
- package/dist/assets/classDiagram-2ON5EDUG-BwW7Xsc6.js +0 -1
- package/dist/assets/classDiagram-2ON5EDUG-DuGJj6Wa-DhRoJudg.js +0 -1
- package/dist/assets/classDiagram-v2-WZHVMYZB-BwW7Xsc6.js +0 -1
- package/dist/assets/classDiagram-v2-WZHVMYZB-DuGJj6Wa-DhRoJudg.js +0 -1
- package/dist/assets/clone-CZsI6H4n.js +0 -1
- package/dist/assets/clone-Ctpto5BP-ESuTgnBA.js +0 -1
- package/dist/assets/index-Dpvo-in9.css +0 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-6INNq0Hu.js +0 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-C4KMyOyW-BF6DY14F.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as R,a as W,S as N}from"./chunk-DI55MBZ5-5aEOOAh4.js";import{bE as f,bJ as t,bK as H,bL as S,bM as P,bS as z,cz as U,cH as _,cE as C,bY as F}from"./index-Ct8vAKMN.js";import{G as J}from"./graph-Dc_5IX9m.js";import{l as O}from"./layout-ZafNe8NA.js";import"./chunk-55IACEB6-DONj5PGh.js";import"./chunk-QN33PNHL-C3TYjKHt.js";import"./_baseUniq-nZPp3_pT.js";import"./min-BG6PRNYP.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),Y=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),D=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(g,b,m){const v=g.append("tspan").attr("x",2*t().state.padding).text(b);m||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,x=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(g){a||(d(x,g,s),s=!1),a=!1});const w=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),p=x.node().getBBox(),o=Math.max(p.width,n.width);return w.attr("x2",o+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",o+2*t().state.padding).attr("height",p.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),x=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),p=s.node().getBBox().width+n;let o=Math.max(p,x);o===x&&(o=o+n);let g;const b=e.node().getBBox();i.doc,g=a-c,p>x&&(g=(x-o)/2+c),Math.abs(a-b.x)<c&&p>x&&(g=a-(p-x)/2);const m=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",g).attr("y",m).attr("class",d?"alt-composit":"composit").attr("width",o).attr("height",b.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",g+c),p<=x&&s.attr("x",a+(o-n)/2-p/2+c),e.insert("rect",":first-child").attr("x",g).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",o).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",g).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",o).attr("height",b.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),K=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),Z=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let x=e.replace(/\r\n/g,"<br/>");x=x.replace(/\n/g,"<br/>");const a=x.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const w of a){const p=w.trim();if(p.length>0){const o=l.append("tspan");if(o.text(p),s===0){const g=o.node().getBBox();s+=g.height}n+=s,o.attr("x",i+t().state.noteMargin),o.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),j=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=Z(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&K(n,i),i.type==="note"&&j(i.note.text,n),i.type==="divider"&&Y(n),i.type==="default"&&i.descriptions.length===0&&D(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),A=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=U().x(function(s){return s.x}).y(function(s){return s.y}).curve(_),x=e.append("path").attr("d",l(n)).attr("id","edge"+A).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!0)),x.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:w,y:p}=F.calcLabelPosition(i.points),o=z.getRows(d.title);let g=0;const b=[];let m=0,v=0;for(let u=0;u<=o.length;u++){const h=s.append("text").attr("text-anchor","middle").text(o[u]).attr("x",w).attr("y",p+g),y=h.node().getBBox();m=Math.max(m,y.width),v=Math.min(v,y.x),S.info(y.x,w,p+g),g===0&&(g=h.node().getBBox().height,S.info("Title height",g,p)),b.push(h)}let k=g*o.length;if(o.length>1){const u=(o.length-1)*g*.5;b.forEach((h,y)=>h.attr("y",p+y*g-u)),k=g*o.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",w-m/2-t().state.padding/2).attr("y",p-k/2-t().state.padding/2-3.5).attr("width",m+t().state.padding).attr("height",k+t().state.padding),S.info(r)}A++},"drawEdge"),B,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){B=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const x=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=x.select(`[id='${i}']`);tt(s);const w=c.db.getRootDoc();G(w,s,void 0,!1,x,a,c);const p=B.padding,o=s.node().getBBox(),g=o.width+p*2,b=o.height+p*2,m=g*1.75;P(s,b,m,B.useMaxWidth),s.attr("viewBox",`${o.x-B.padding} ${o.y-B.padding} `+g+" "+b)},"draw"),at=f(e=>e?e.length*B.fontSizeFactor:1,"getLabelWidth"),G=f((e,i,d,c,n,l,x)=>{const a=new J({compound:!0,multigraph:!0});let s,w=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){w=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:w?1:B.edgeLengthFactor,nodeSep:w?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:w?1:B.edgeLengthFactor,nodeSep:w?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const p=x.db.getStates(),o=x.db.getRelations(),g=Object.keys(p);for(const r of g){const u=p[r];d&&(u.parentId=d);let h;if(u.doc){let y=i.append("g").attr("id",u.id).attr("class","stateGroup");h=G(u.doc,y,u.id,!c,n,l,x);{y=$(y,u,c);let E=y.node().getBBox();h.width=E.width,h.height=E.height+B.padding/2,T[u.id]={y:B.compositTitleSize}}}else h=L(i,u,a);if(u.note){const y={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},E=L(i,y,a);u.note.position==="left of"?(a.setNode(h.id+"-note",E),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",E)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let b=0;o.forEach(function(r){b++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:at(r.title),height:B.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+b)}),O(a),S.debug("Graph after layout",a.nodes());const m=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+m.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(T[r]?T[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+m.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),l.querySelectorAll("#"+m.id+" #"+r+" .divider").forEach(h=>{const y=h.parentElement;let E=0,M=0;y&&(y.parentElement&&(E=y.parentElement.getBBox().width),M=parseInt(y.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=m.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=m.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*B.padding,k.height=v.height+2*B.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},ht={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{ht as diagram};
|
|
1
|
+
import{s as R,a as W,S as N}from"./chunk-DI55MBZ5-BQAFhPjX.js";import{bE as f,bJ as t,bK as H,bL as S,bM as P,bS as z,cz as U,cH as _,cE as C,bY as F}from"./index-B7GqH6If.js";import{G as J}from"./graph-D9RB6DwV.js";import{l as O}from"./layout-DFWNR-Y1.js";import"./chunk-55IACEB6-SXD_npDw.js";import"./chunk-QN33PNHL-xEzemp3c.js";import"./_baseUniq-iT192ZJn.js";import"./min-CRMSN7nx.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),Y=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),D=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(g,b,m){const v=g.append("tspan").attr("x",2*t().state.padding).text(b);m||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,x=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(g){a||(d(x,g,s),s=!1),a=!1});const w=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),p=x.node().getBBox(),o=Math.max(p.width,n.width);return w.attr("x2",o+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",o+2*t().state.padding).attr("height",p.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),x=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),p=s.node().getBBox().width+n;let o=Math.max(p,x);o===x&&(o=o+n);let g;const b=e.node().getBBox();i.doc,g=a-c,p>x&&(g=(x-o)/2+c),Math.abs(a-b.x)<c&&p>x&&(g=a-(p-x)/2);const m=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",g).attr("y",m).attr("class",d?"alt-composit":"composit").attr("width",o).attr("height",b.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",g+c),p<=x&&s.attr("x",a+(o-n)/2-p/2+c),e.insert("rect",":first-child").attr("x",g).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",o).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",g).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",o).attr("height",b.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),K=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),Z=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let x=e.replace(/\r\n/g,"<br/>");x=x.replace(/\n/g,"<br/>");const a=x.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const w of a){const p=w.trim();if(p.length>0){const o=l.append("tspan");if(o.text(p),s===0){const g=o.node().getBBox();s+=g.height}n+=s,o.attr("x",i+t().state.noteMargin),o.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),j=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=Z(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&K(n,i),i.type==="note"&&j(i.note.text,n),i.type==="divider"&&Y(n),i.type==="default"&&i.descriptions.length===0&&D(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),A=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=U().x(function(s){return s.x}).y(function(s){return s.y}).curve(_),x=e.append("path").attr("d",l(n)).attr("id","edge"+A).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!0)),x.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:w,y:p}=F.calcLabelPosition(i.points),o=z.getRows(d.title);let g=0;const b=[];let m=0,v=0;for(let u=0;u<=o.length;u++){const h=s.append("text").attr("text-anchor","middle").text(o[u]).attr("x",w).attr("y",p+g),y=h.node().getBBox();m=Math.max(m,y.width),v=Math.min(v,y.x),S.info(y.x,w,p+g),g===0&&(g=h.node().getBBox().height,S.info("Title height",g,p)),b.push(h)}let k=g*o.length;if(o.length>1){const u=(o.length-1)*g*.5;b.forEach((h,y)=>h.attr("y",p+y*g-u)),k=g*o.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",w-m/2-t().state.padding/2).attr("y",p-k/2-t().state.padding/2-3.5).attr("width",m+t().state.padding).attr("height",k+t().state.padding),S.info(r)}A++},"drawEdge"),B,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){B=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const x=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=x.select(`[id='${i}']`);tt(s);const w=c.db.getRootDoc();G(w,s,void 0,!1,x,a,c);const p=B.padding,o=s.node().getBBox(),g=o.width+p*2,b=o.height+p*2,m=g*1.75;P(s,b,m,B.useMaxWidth),s.attr("viewBox",`${o.x-B.padding} ${o.y-B.padding} `+g+" "+b)},"draw"),at=f(e=>e?e.length*B.fontSizeFactor:1,"getLabelWidth"),G=f((e,i,d,c,n,l,x)=>{const a=new J({compound:!0,multigraph:!0});let s,w=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){w=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:w?1:B.edgeLengthFactor,nodeSep:w?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:w?1:B.edgeLengthFactor,nodeSep:w?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const p=x.db.getStates(),o=x.db.getRelations(),g=Object.keys(p);for(const r of g){const u=p[r];d&&(u.parentId=d);let h;if(u.doc){let y=i.append("g").attr("id",u.id).attr("class","stateGroup");h=G(u.doc,y,u.id,!c,n,l,x);{y=$(y,u,c);let E=y.node().getBBox();h.width=E.width,h.height=E.height+B.padding/2,T[u.id]={y:B.compositTitleSize}}}else h=L(i,u,a);if(u.note){const y={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},E=L(i,y,a);u.note.position==="left of"?(a.setNode(h.id+"-note",E),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",E)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let b=0;o.forEach(function(r){b++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:at(r.title),height:B.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+b)}),O(a),S.debug("Graph after layout",a.nodes());const m=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+m.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(T[r]?T[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+m.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),l.querySelectorAll("#"+m.id+" #"+r+" .divider").forEach(h=>{const y=h.parentElement;let E=0,M=0;y&&(y.parentElement&&(E=y.parentElement.getBBox().width),M=parseInt(y.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=m.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=m.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*B.padding,k.height=v.height+2*B.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},ht={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{ht as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{U as G,B as A,M}from"./chunk-DI55MBZ5-Cy8ug2Ot-BzD-RQbN.js";import{H as y,b as t,a5 as v,z as E,ab as U,ah as H,b8 as P,bf as O,bc as R,an as C}from"./index-Ct8vAKMN.js";import{X as I}from"./graph-BBwx-qRB-Bw-VVURa.js";import{B as W}from"./layout-BzpSdQ1b-piwZFZhY.js";import"./chunk-55IACEB6-o1l2wNNZ-B4eZtpxO.js";import"./chunk-QN33PNHL-BgDnNc7H-Dg0jsCmn.js";import"./_baseUniq-Bt-G8KSC-D27tYV3n.js";import"./min-DK0HBqAV-C6wdO-W-.js";var X=y(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),$=y(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),F=y((e,n)=>{const g=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(n.id),s=g.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",s.width+2*t().state.padding).attr("height",s.height+2*t().state.padding).attr("rx",t().state.radius),g},"drawSimpleState"),J=y((e,n)=>{const g=y(function(o,u,B){const m=o.append("tspan").attr("x",2*t().state.padding).text(u);B||m.attr("dy",t().state.textHeight)},"addTspan"),s=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(n.descriptions[0]).node().getBBox(),r=s.height,c=e.append("text").attr("x",t().state.padding).attr("y",r+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let l=!0,a=!0;n.descriptions.forEach(function(o){l||(g(c,o,a),a=!1),l=!1});const d=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+r+t().state.dividerMargin/2).attr("y2",t().state.padding+r+t().state.dividerMargin/2).attr("class","descr-divider"),x=c.node().getBBox(),h=Math.max(x.width,s.width);return d.attr("x2",h+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",h+2*t().state.padding).attr("height",x.height+r+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),Y=y((e,n,g)=>{const s=t().state.padding,r=2*t().state.padding,c=e.node().getBBox(),l=c.width,a=c.x,d=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(n.id),x=d.node().getBBox().width+r;let h=Math.max(x,l);h===l&&(h=h+r);let o;const u=e.node().getBBox();n.doc,o=a-s,x>l&&(o=(l-h)/2+s),Math.abs(a-u.x)<s&&x>l&&(o=a-(x-l)/2);const B=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",B).attr("class",g?"alt-composit":"composit").attr("width",h).attr("height",u.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),d.attr("x",o+s),x<=l&&d.attr("x",a+(h-r)/2-x/2+s),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",h).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",h).attr("height",u.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),j=y(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=y((e,n)=>{let g=t().state.forkWidth,s=t().state.forkHeight;if(n.parentId){let r=g;g=s,s=r}return e.append("rect").style("stroke","black").style("fill","black").attr("width",g).attr("height",s).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),q=y((e,n,g,s)=>{let r=0;const c=s.append("text");c.style("text-anchor","start"),c.attr("class","noteText");let l=e.replace(/\r\n/g,"<br/>");l=l.replace(/\n/g,"<br/>");const a=l.split(H.lineBreakRegex);let d=1.25*t().state.noteMargin;for(const x of a){const h=x.trim();if(h.length>0){const o=c.append("tspan");if(o.text(h),d===0){const u=o.node().getBBox();d+=u.height}r+=d,o.attr("x",n+t().state.noteMargin),o.attr("y",g+r+1.25*t().state.noteMargin)}}return{textWidth:c.node().getBBox().width,textHeight:r}},"_drawLongText"),K=y((e,n)=>{n.attr("class","state-note");const g=n.append("rect").attr("x",0).attr("y",t().state.padding),s=n.append("g"),{textWidth:r,textHeight:c}=q(e,0,0,s);return g.attr("height",c+2*t().state.noteMargin),g.attr("width",r+t().state.noteMargin*2),g},"drawNote"),T=y(function(e,n){const g=n.id,s={id:g,label:n.id,width:0,height:0},r=e.append("g").attr("id",g).attr("class","stateGroup");n.type==="start"&&X(r),n.type==="end"&&j(r),(n.type==="fork"||n.type==="join")&&Z(r,n),n.type==="note"&&K(n.note.text,r),n.type==="divider"&&$(r),n.type==="default"&&n.descriptions.length===0&&F(r,n),n.type==="default"&&n.descriptions.length>0&&J(r,n);const c=r.node().getBBox();return s.width=c.width+2*t().state.padding,s.height=c.height+2*t().state.padding,s},"drawState"),D=0,Q=y(function(e,n,g){const s=y(function(d){switch(d){case M.relationType.AGGREGATION:return"aggregation";case M.relationType.EXTENSION:return"extension";case M.relationType.COMPOSITION:return"composition";case M.relationType.DEPENDENCY:return"dependency"}},"getRelationType");n.points=n.points.filter(d=>!Number.isNaN(d.y));const r=n.points,c=P().x(function(d){return d.x}).y(function(d){return d.y}).curve(O),l=e.append("path").attr("d",c(r)).attr("id","edge"+D).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=R(!0)),l.attr("marker-end","url("+a+"#"+s(M.relationType.DEPENDENCY)+"End)"),g.title!==void 0){const d=e.append("g").attr("class","stateLabel"),{x,y:h}=C.calcLabelPosition(n.points),o=H.getRows(g.title);let u=0;const B=[];let m=0,N=0;for(let f=0;f<=o.length;f++){const p=d.append("text").attr("text-anchor","middle").text(o[f]).attr("x",x).attr("y",h+u),w=p.node().getBBox();m=Math.max(m,w.width),N=Math.min(N,w.x),E.info(w.x,x,h+u),u===0&&(u=p.node().getBBox().height,E.info("Title height",u,h)),B.push(p)}let S=u*o.length;if(o.length>1){const f=(o.length-1)*u*.5;B.forEach((p,w)=>p.attr("y",h+w*u-f)),S=u*o.length}const i=d.node().getBBox();d.insert("rect",":first-child").attr("class","box").attr("x",x-m/2-t().state.padding/2).attr("y",h-S/2-t().state.padding/2-3.5).attr("width",m+t().state.padding).attr("height",S+t().state.padding),E.info(i)}D++},"drawEdge"),b,z={},V=y(function(){},"setConf"),_=y(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),tt=y(function(e,n,g,s){b=t().state;const r=t().securityLevel;let c;r==="sandbox"&&(c=v("#i"+n));const l=r==="sandbox"?v(c.nodes()[0].contentDocument.body):v("body"),a=r==="sandbox"?c.nodes()[0].contentDocument:document;E.debug("Rendering diagram "+e);const d=l.select(`[id='${n}']`);_(d);const x=s.db.getRootDoc();L(x,d,void 0,!1,l,a,s);const h=b.padding,o=d.node().getBBox(),u=o.width+h*2,B=o.height+h*2,m=u*1.75;U(d,B,m,b.useMaxWidth),d.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+u+" "+B)},"draw"),et=y(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),L=y((e,n,g,s,r,c,l)=>{const a=new I({compound:!0,multigraph:!0});let d,x=!0;for(d=0;d<e.length;d++)if(e[d].stmt==="relation"){x=!1;break}g?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:x?1:b.edgeLengthFactor,nodeSep:x?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:x?1:b.edgeLengthFactor,nodeSep:x?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const h=l.db.getStates(),o=l.db.getRelations(),u=Object.keys(h);for(const i of u){const f=h[i];g&&(f.parentId=g);let p;if(f.doc){let w=n.append("g").attr("id",f.id).attr("class","stateGroup");p=L(f.doc,w,f.id,!s,r,c,l);{w=Y(w,f,s);let k=w.node().getBBox();p.width=k.width,p.height=k.height+b.padding/2,z[f.id]={y:b.compositTitleSize}}}else p=T(n,f,a);if(f.note){const w={descriptions:[],id:f.id+"-note",note:f.note,type:"note"},k=T(n,w,a);f.note.position==="left of"?(a.setNode(p.id+"-note",k),a.setNode(p.id,p)):(a.setNode(p.id,p),a.setNode(p.id+"-note",k)),a.setParent(p.id,p.id+"-group"),a.setParent(p.id+"-note",p.id+"-group")}else a.setNode(p.id,p)}E.debug("Count=",a.nodeCount(),a);let B=0;o.forEach(function(i){B++,E.debug("Setting edge",i),a.setEdge(i.id1,i.id2,{relation:i,width:et(i.title),height:b.labelHeight*H.getRows(i.title).length,labelpos:"c"},"id"+B)}),W(a),E.debug("Graph after layout",a.nodes());const m=n.node();a.nodes().forEach(function(i){i!==void 0&&a.node(i)!==void 0?(E.warn("Node "+i+": "+JSON.stringify(a.node(i))),r.select("#"+m.id+" #"+i).attr("transform","translate("+(a.node(i).x-a.node(i).width/2)+","+(a.node(i).y+(z[i]?z[i].y:0)-a.node(i).height/2)+" )"),r.select("#"+m.id+" #"+i).attr("data-x-shift",a.node(i).x-a.node(i).width/2),c.querySelectorAll("#"+m.id+" #"+i+" .divider").forEach(f=>{const p=f.parentElement;let w=0,k=0;p&&(p.parentElement&&(w=p.parentElement.getBBox().width),k=parseInt(p.getAttribute("data-x-shift"),10),Number.isNaN(k)&&(k=0)),f.setAttribute("x1",0-k+8),f.setAttribute("x2",w-k-8)})):E.debug("No Node "+i+": "+JSON.stringify(a.node(i)))});let N=m.getBBox();a.edges().forEach(function(i){i!==void 0&&a.edge(i)!==void 0&&(E.debug("Edge "+i.v+" -> "+i.w+": "+JSON.stringify(a.edge(i))),Q(n,a.edge(i),a.edge(i).relation))}),N=m.getBBox();const S={id:g||"root",label:g||"root",width:0,height:0};return S.width=N.width+2*b.padding,S.height=N.height+2*b.padding,E.debug("Doc rendered",S,a),S},"renderDoc"),at={setConf:V,draw:tt},ht={parser:A,get db(){return new M(1)},renderer:at,styles:G,init:y(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{ht as diagram};
|
|
1
|
+
import{U as G,B as A,M}from"./chunk-DI55MBZ5-8tWOlvAD-Cye13dPz.js";import{H as y,b as t,a5 as v,z as E,ab as U,ah as H,b8 as P,bf as O,bc as R,an as C}from"./index-B7GqH6If.js";import{X as I}from"./graph-Da1z0n_J-yJ-tLMG7.js";import{B as W}from"./layout-BoJlbrAK-CAQ1YqzH.js";import"./chunk-55IACEB6-D_uwi6CC-CwcdTnFf.js";import"./chunk-QN33PNHL-QKH9jByz-BVKajMNG.js";import"./_baseUniq-D7Jo4wA--B2TRxPWE.js";import"./min-C8aXS73f-D0DvW8t2.js";var X=y(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),$=y(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),F=y((e,n)=>{const g=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(n.id),s=g.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",s.width+2*t().state.padding).attr("height",s.height+2*t().state.padding).attr("rx",t().state.radius),g},"drawSimpleState"),J=y((e,n)=>{const g=y(function(o,u,B){const m=o.append("tspan").attr("x",2*t().state.padding).text(u);B||m.attr("dy",t().state.textHeight)},"addTspan"),s=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(n.descriptions[0]).node().getBBox(),r=s.height,c=e.append("text").attr("x",t().state.padding).attr("y",r+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let l=!0,a=!0;n.descriptions.forEach(function(o){l||(g(c,o,a),a=!1),l=!1});const d=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+r+t().state.dividerMargin/2).attr("y2",t().state.padding+r+t().state.dividerMargin/2).attr("class","descr-divider"),x=c.node().getBBox(),h=Math.max(x.width,s.width);return d.attr("x2",h+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",h+2*t().state.padding).attr("height",x.height+r+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),Y=y((e,n,g)=>{const s=t().state.padding,r=2*t().state.padding,c=e.node().getBBox(),l=c.width,a=c.x,d=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(n.id),x=d.node().getBBox().width+r;let h=Math.max(x,l);h===l&&(h=h+r);let o;const u=e.node().getBBox();n.doc,o=a-s,x>l&&(o=(l-h)/2+s),Math.abs(a-u.x)<s&&x>l&&(o=a-(x-l)/2);const B=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",B).attr("class",g?"alt-composit":"composit").attr("width",h).attr("height",u.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),d.attr("x",o+s),x<=l&&d.attr("x",a+(h-r)/2-x/2+s),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",h).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",h).attr("height",u.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),j=y(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=y((e,n)=>{let g=t().state.forkWidth,s=t().state.forkHeight;if(n.parentId){let r=g;g=s,s=r}return e.append("rect").style("stroke","black").style("fill","black").attr("width",g).attr("height",s).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),q=y((e,n,g,s)=>{let r=0;const c=s.append("text");c.style("text-anchor","start"),c.attr("class","noteText");let l=e.replace(/\r\n/g,"<br/>");l=l.replace(/\n/g,"<br/>");const a=l.split(H.lineBreakRegex);let d=1.25*t().state.noteMargin;for(const x of a){const h=x.trim();if(h.length>0){const o=c.append("tspan");if(o.text(h),d===0){const u=o.node().getBBox();d+=u.height}r+=d,o.attr("x",n+t().state.noteMargin),o.attr("y",g+r+1.25*t().state.noteMargin)}}return{textWidth:c.node().getBBox().width,textHeight:r}},"_drawLongText"),K=y((e,n)=>{n.attr("class","state-note");const g=n.append("rect").attr("x",0).attr("y",t().state.padding),s=n.append("g"),{textWidth:r,textHeight:c}=q(e,0,0,s);return g.attr("height",c+2*t().state.noteMargin),g.attr("width",r+t().state.noteMargin*2),g},"drawNote"),T=y(function(e,n){const g=n.id,s={id:g,label:n.id,width:0,height:0},r=e.append("g").attr("id",g).attr("class","stateGroup");n.type==="start"&&X(r),n.type==="end"&&j(r),(n.type==="fork"||n.type==="join")&&Z(r,n),n.type==="note"&&K(n.note.text,r),n.type==="divider"&&$(r),n.type==="default"&&n.descriptions.length===0&&F(r,n),n.type==="default"&&n.descriptions.length>0&&J(r,n);const c=r.node().getBBox();return s.width=c.width+2*t().state.padding,s.height=c.height+2*t().state.padding,s},"drawState"),D=0,Q=y(function(e,n,g){const s=y(function(d){switch(d){case M.relationType.AGGREGATION:return"aggregation";case M.relationType.EXTENSION:return"extension";case M.relationType.COMPOSITION:return"composition";case M.relationType.DEPENDENCY:return"dependency"}},"getRelationType");n.points=n.points.filter(d=>!Number.isNaN(d.y));const r=n.points,c=P().x(function(d){return d.x}).y(function(d){return d.y}).curve(O),l=e.append("path").attr("d",c(r)).attr("id","edge"+D).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=R(!0)),l.attr("marker-end","url("+a+"#"+s(M.relationType.DEPENDENCY)+"End)"),g.title!==void 0){const d=e.append("g").attr("class","stateLabel"),{x,y:h}=C.calcLabelPosition(n.points),o=H.getRows(g.title);let u=0;const B=[];let m=0,N=0;for(let f=0;f<=o.length;f++){const p=d.append("text").attr("text-anchor","middle").text(o[f]).attr("x",x).attr("y",h+u),w=p.node().getBBox();m=Math.max(m,w.width),N=Math.min(N,w.x),E.info(w.x,x,h+u),u===0&&(u=p.node().getBBox().height,E.info("Title height",u,h)),B.push(p)}let S=u*o.length;if(o.length>1){const f=(o.length-1)*u*.5;B.forEach((p,w)=>p.attr("y",h+w*u-f)),S=u*o.length}const i=d.node().getBBox();d.insert("rect",":first-child").attr("class","box").attr("x",x-m/2-t().state.padding/2).attr("y",h-S/2-t().state.padding/2-3.5).attr("width",m+t().state.padding).attr("height",S+t().state.padding),E.info(i)}D++},"drawEdge"),b,z={},V=y(function(){},"setConf"),_=y(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),tt=y(function(e,n,g,s){b=t().state;const r=t().securityLevel;let c;r==="sandbox"&&(c=v("#i"+n));const l=r==="sandbox"?v(c.nodes()[0].contentDocument.body):v("body"),a=r==="sandbox"?c.nodes()[0].contentDocument:document;E.debug("Rendering diagram "+e);const d=l.select(`[id='${n}']`);_(d);const x=s.db.getRootDoc();L(x,d,void 0,!1,l,a,s);const h=b.padding,o=d.node().getBBox(),u=o.width+h*2,B=o.height+h*2,m=u*1.75;U(d,B,m,b.useMaxWidth),d.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+u+" "+B)},"draw"),et=y(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),L=y((e,n,g,s,r,c,l)=>{const a=new I({compound:!0,multigraph:!0});let d,x=!0;for(d=0;d<e.length;d++)if(e[d].stmt==="relation"){x=!1;break}g?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:x?1:b.edgeLengthFactor,nodeSep:x?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:x?1:b.edgeLengthFactor,nodeSep:x?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const h=l.db.getStates(),o=l.db.getRelations(),u=Object.keys(h);for(const i of u){const f=h[i];g&&(f.parentId=g);let p;if(f.doc){let w=n.append("g").attr("id",f.id).attr("class","stateGroup");p=L(f.doc,w,f.id,!s,r,c,l);{w=Y(w,f,s);let k=w.node().getBBox();p.width=k.width,p.height=k.height+b.padding/2,z[f.id]={y:b.compositTitleSize}}}else p=T(n,f,a);if(f.note){const w={descriptions:[],id:f.id+"-note",note:f.note,type:"note"},k=T(n,w,a);f.note.position==="left of"?(a.setNode(p.id+"-note",k),a.setNode(p.id,p)):(a.setNode(p.id,p),a.setNode(p.id+"-note",k)),a.setParent(p.id,p.id+"-group"),a.setParent(p.id+"-note",p.id+"-group")}else a.setNode(p.id,p)}E.debug("Count=",a.nodeCount(),a);let B=0;o.forEach(function(i){B++,E.debug("Setting edge",i),a.setEdge(i.id1,i.id2,{relation:i,width:et(i.title),height:b.labelHeight*H.getRows(i.title).length,labelpos:"c"},"id"+B)}),W(a),E.debug("Graph after layout",a.nodes());const m=n.node();a.nodes().forEach(function(i){i!==void 0&&a.node(i)!==void 0?(E.warn("Node "+i+": "+JSON.stringify(a.node(i))),r.select("#"+m.id+" #"+i).attr("transform","translate("+(a.node(i).x-a.node(i).width/2)+","+(a.node(i).y+(z[i]?z[i].y:0)-a.node(i).height/2)+" )"),r.select("#"+m.id+" #"+i).attr("data-x-shift",a.node(i).x-a.node(i).width/2),c.querySelectorAll("#"+m.id+" #"+i+" .divider").forEach(f=>{const p=f.parentElement;let w=0,k=0;p&&(p.parentElement&&(w=p.parentElement.getBBox().width),k=parseInt(p.getAttribute("data-x-shift"),10),Number.isNaN(k)&&(k=0)),f.setAttribute("x1",0-k+8),f.setAttribute("x2",w-k-8)})):E.debug("No Node "+i+": "+JSON.stringify(a.node(i)))});let N=m.getBBox();a.edges().forEach(function(i){i!==void 0&&a.edge(i)!==void 0&&(E.debug("Edge "+i.v+" -> "+i.w+": "+JSON.stringify(a.edge(i))),Q(n,a.edge(i),a.edge(i).relation))}),N=m.getBBox();const S={id:g||"root",label:g||"root",width:0,height:0};return S.width=N.width+2*b.padding,S.height=N.height+2*b.padding,E.debug("Doc rendered",S,a),S},"renderDoc"),at={setConf:V,draw:tt},ht={parser:A,get db(){return new M(1)},renderer:at,styles:G,init:y(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{ht as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as t,b as r,a,S as s}from"./chunk-DI55MBZ5-BQAFhPjX.js";import{bE as i}from"./index-B7GqH6If.js";import"./chunk-55IACEB6-SXD_npDw.js";import"./chunk-QN33PNHL-xEzemp3c.js";var u={parser:a,get db(){return new s(2)},renderer:r,styles:t,init:i(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{u as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{U as t,V as e,B as a,M as s}from"./chunk-DI55MBZ5-8tWOlvAD-Cye13dPz.js";import{H as o}from"./index-B7GqH6If.js";import"./chunk-55IACEB6-D_uwi6CC-CwcdTnFf.js";import"./chunk-QN33PNHL-QKH9jByz-BVKajMNG.js";var M={parser:a,get db(){return new s(2)},renderer:e,styles:t,init:o(r=>{r.state||(r.state={}),r.state.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{M as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{H as r,b as mt,z as S,a5 as R,bh as xt,bi as bt,bj as kt,bk as _t,az as wt,bl as vt,au as St}from"./index-
|
|
1
|
+
import{H as r,b as mt,z as S,a5 as R,bh as xt,bi as bt,bj as kt,bk as _t,az as wt,bl as vt,au as St}from"./index-B7GqH6If.js";import{h as tt}from"./arc-bSbgZKu2-DL3rNhb4.js";var U=(function(){var n=r(function(g,i,l,h){for(l=l||{},h=g.length;h--;l[g[h]]=i);return l},"o"),t=[6,8,10,11,12,14,16,17,20,21],e=[1,9],a=[1,10],s=[1,11],o=[1,12],p=[1,13],y=[1,16],u=[1,17],f={trace:r(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",20:"period",21:"event"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[18,1],[19,1]],performAction:r(function(g,i,l,h,d,c,m){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:h.getCommonDb().setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),h.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),h.getCommonDb().setAccDescription(this.$);break;case 12:h.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 15:h.addTask(c[k],0,""),this.$=c[k];break;case 16:h.addEvent(c[k].substr(2)),this.$=c[k];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},n(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:e,12:a,14:s,16:o,17:p,18:14,19:15,20:y,21:u},n(t,[2,7],{1:[2,1]}),n(t,[2,3]),{9:18,11:e,12:a,14:s,16:o,17:p,18:14,19:15,20:y,21:u},n(t,[2,5]),n(t,[2,6]),n(t,[2,8]),{13:[1,19]},{15:[1,20]},n(t,[2,11]),n(t,[2,12]),n(t,[2,13]),n(t,[2,14]),n(t,[2,15]),n(t,[2,16]),n(t,[2,4]),n(t,[2,9]),n(t,[2,10])],defaultActions:{},parseError:r(function(g,i){if(i.recoverable)this.trace(g);else{var l=new Error(g);throw l.hash=i,l}},"parseError"),parse:r(function(g){var i=this,l=[0],h=[],d=[null],c=[],m=this.table,k="",M=0,H=0,D=2,C=1,w=c.slice.call(arguments,1),x=Object.create(this.lexer),$={yy:{}};for(var N in this.yy)Object.prototype.hasOwnProperty.call(this.yy,N)&&($.yy[N]=this.yy[N]);x.setInput(g,$.yy),$.yy.lexer=x,$.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var I=x.yylloc;c.push(I);var G=x.options&&x.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ft(E){l.length=l.length-2*E,d.length=d.length-E,c.length=c.length-E}r(ft,"popStack");function J(){var E;return E=h.pop()||x.lex()||C,typeof E!="number"&&(E instanceof Array&&(h=E,E=h.pop()),E=i.symbols_[E]||E),E}r(J,"lex");for(var v,L,T,Z,z={},W,P,K,F;;){if(L=l[l.length-1],this.defaultActions[L]?T=this.defaultActions[L]:((v===null||typeof v>"u")&&(v=J()),T=m[L]&&m[L][v]),typeof T>"u"||!T.length||!T[0]){var q="";F=[];for(W in m[L])this.terminals_[W]&&W>D&&F.push("'"+this.terminals_[W]+"'");x.showPosition?q="Parse error on line "+(M+1)+`:
|
|
2
2
|
`+x.showPosition()+`
|
|
3
3
|
Expecting `+F.join(", ")+", got '"+(this.terminals_[v]||v)+"'":q="Parse error on line "+(M+1)+": Unexpected "+(v==C?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(q,{text:x.match,token:this.terminals_[v]||v,line:x.yylineno,loc:I,expected:F})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+L+", token: "+v);switch(T[0]){case 1:l.push(v),d.push(x.yytext),c.push(x.yylloc),l.push(T[1]),v=null,H=x.yyleng,k=x.yytext,M=x.yylineno,I=x.yylloc;break;case 2:if(P=this.productions_[T[1]][1],z.$=d[d.length-P],z._$={first_line:c[c.length-(P||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(P||1)].first_column,last_column:c[c.length-1].last_column},G&&(z._$.range=[c[c.length-(P||1)].range[0],c[c.length-1].range[1]]),Z=this.performAction.apply(z,[k,H,M,$.yy,T[1],d,c].concat(w)),typeof Z<"u")return Z;P&&(l=l.slice(0,-1*P*2),d=d.slice(0,-1*P),c=c.slice(0,-1*P)),l.push(this.productions_[T[1]][0]),d.push(z.$),c.push(z._$),K=m[l[l.length-2]][l[l.length-1]],l.push(K);break;case 3:return!0}}return!0},"parse")},_=(function(){var g={EOF:1,parseError:r(function(i,l){if(this.yy.parser)this.yy.parser.parseError(i,l);else throw new Error(i)},"parseError"),setInput:r(function(i,l){return this.yy=l||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:r(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var l=i.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:r(function(i){var l=i.length,h=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var c=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===d.length?this.yylloc.first_column:0)+d[d.length-h.length].length-h[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[c[0],c[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:r(function(){return this._more=!0,this},"more"),reject:r(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:r(function(i){this.unput(this.match.slice(i))},"less"),pastInput:r(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:r(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:r(function(){var i=this.pastInput(),l=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bE as s,bJ as xt,bL as E,bK as j,cJ as kt,cK as vt,cL as bt,cM as _t,c8 as wt,cN as St,c3 as Et}from"./index-
|
|
1
|
+
import{bE as s,bJ as xt,bL as E,bK as j,cJ as kt,cK as vt,cL as bt,cM as _t,c8 as wt,cN as St,c3 as Et}from"./index-B7GqH6If.js";import{d as nt}from"./arc-BpF2CtTd.js";var Q=(function(){var n=s(function(x,r,a,c){for(a=a||{},c=x.length;c--;a[x[c]]=r);return a},"o"),t=[6,8,10,11,12,14,16,17,20,21],e=[1,9],l=[1,10],i=[1,11],d=[1,12],h=[1,13],f=[1,16],m=[1,17],p={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",20:"period",21:"event"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[18,1],[19,1]],performAction:s(function(r,a,c,u,y,o,w){var v=o.length-1;switch(y){case 1:return o[v-1];case 2:this.$=[];break;case 3:o[v-1].push(o[v]),this.$=o[v-1];break;case 4:case 5:this.$=o[v];break;case 6:case 7:this.$=[];break;case 8:u.getCommonDb().setDiagramTitle(o[v].substr(6)),this.$=o[v].substr(6);break;case 9:this.$=o[v].trim(),u.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=o[v].trim(),u.getCommonDb().setAccDescription(this.$);break;case 12:u.addSection(o[v].substr(8)),this.$=o[v].substr(8);break;case 15:u.addTask(o[v],0,""),this.$=o[v];break;case 16:u.addEvent(o[v].substr(2)),this.$=o[v];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},n(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:e,12:l,14:i,16:d,17:h,18:14,19:15,20:f,21:m},n(t,[2,7],{1:[2,1]}),n(t,[2,3]),{9:18,11:e,12:l,14:i,16:d,17:h,18:14,19:15,20:f,21:m},n(t,[2,5]),n(t,[2,6]),n(t,[2,8]),{13:[1,19]},{15:[1,20]},n(t,[2,11]),n(t,[2,12]),n(t,[2,13]),n(t,[2,14]),n(t,[2,15]),n(t,[2,16]),n(t,[2,4]),n(t,[2,9]),n(t,[2,10])],defaultActions:{},parseError:s(function(r,a){if(a.recoverable)this.trace(r);else{var c=new Error(r);throw c.hash=a,c}},"parseError"),parse:s(function(r){var a=this,c=[0],u=[],y=[null],o=[],w=this.table,v="",N=0,P=0,V=2,J=1,H=o.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var L in this.yy)Object.prototype.hasOwnProperty.call(this.yy,L)&&(_.yy[L]=this.yy[L]);g.setInput(r,_.yy),_.yy.lexer=g,_.yy.parser=this,typeof g.yylloc>"u"&&(g.yylloc={});var M=g.yylloc;o.push(M);var W=g.options&&g.options.ranges;typeof _.yy.parseError=="function"?this.parseError=_.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function K(T){c.length=c.length-2*T,y.length=y.length-T,o.length=o.length-T}s(K,"popStack");function tt(){var T;return T=u.pop()||g.lex()||J,typeof T!="number"&&(T instanceof Array&&(u=T,T=u.pop()),T=a.symbols_[T]||T),T}s(tt,"lex");for(var S,A,I,U,R={},B,$,et,O;;){if(A=c[c.length-1],this.defaultActions[A]?I=this.defaultActions[A]:((S===null||typeof S>"u")&&(S=tt()),I=w[A]&&w[A][S]),typeof I>"u"||!I.length||!I[0]){var Z="";O=[];for(B in w[A])this.terminals_[B]&&B>V&&O.push("'"+this.terminals_[B]+"'");g.showPosition?Z="Parse error on line "+(N+1)+`:
|
|
2
2
|
`+g.showPosition()+`
|
|
3
3
|
Expecting `+O.join(", ")+", got '"+(this.terminals_[S]||S)+"'":Z="Parse error on line "+(N+1)+": Unexpected "+(S==J?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(Z,{text:g.match,token:this.terminals_[S]||S,line:g.yylineno,loc:M,expected:O})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+S);switch(I[0]){case 1:c.push(S),y.push(g.yytext),o.push(g.yylloc),c.push(I[1]),S=null,P=g.yyleng,v=g.yytext,N=g.yylineno,M=g.yylloc;break;case 2:if($=this.productions_[I[1]][1],R.$=y[y.length-$],R._$={first_line:o[o.length-($||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-($||1)].first_column,last_column:o[o.length-1].last_column},W&&(R._$.range=[o[o.length-($||1)].range[0],o[o.length-1].range[1]]),U=this.performAction.apply(R,[v,P,N,_.yy,I[1],y,o].concat(H)),typeof U<"u")return U;$&&(c=c.slice(0,-1*$*2),y=y.slice(0,-1*$),o=o.slice(0,-1*$)),c.push(this.productions_[I[1]][0]),y.push(R.$),o.push(R._$),et=w[c[c.length-2]][c[c.length-1]],c.push(et);break;case 3:return!0}}return!0},"parse")},k=(function(){var x={EOF:1,parseError:s(function(a,c){if(this.yy.parser)this.yy.parser.parseError(a,c);else throw new Error(a)},"parseError"),setInput:s(function(r,a){return this.yy=a||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var a=r.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var a=r.length,c=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===u.length?this.yylloc.first_column:0)+u[u.length-c.length].length-c[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(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:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),a=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{dZ as Ud,ej as wt}from"./index-Ct8vAKMN.js";import{m as st,f as Bd,d as jd}from"./min-BG6PRNYP.js";import{b as Kd,l as Hd,d as Vd,m as Wd,r as wo,n as Rs}from"./_baseUniq-nZPp3_pT.js";function zd(t,e){return Kd(st(t,e))}function qd(t,e){return t&&t.length?Hd(t,Vd(e)):[]}function le(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function ze(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function Yd(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function ai(t){return typeof t=="object"&&t!==null&&le(t.container)&&ze(t.reference)&&typeof t.message=="string"}class dc{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,n){return le(e)&&this.isSubtype(e.$type,n)}isSubtype(e,n){if(e===n)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const i=r[n];if(i!==void 0)return i;{const s=this.computeIsSubtype(e,n);return r[n]=s,s}}getAllSubTypes(e){const n=this.allSubtypes[e];if(n)return n;{const r=this.getAllTypes(),i=[];for(const s of r)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}}function Tr(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function hc(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function pc(t){return Tr(t)&&typeof t.fullText=="string"}class ne{constructor(e,n){this.startFn=e,this.nextFn=n}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let n=0,r=e.next();for(;!r.done;)n++,r=e.next();return n}toArray(){const e=[],n=this.iterator();let r;do r=n.next(),r.value!==void 0&&e.push(r.value);while(!r.done);return e}toSet(){return new Set(this)}toMap(e,n){const r=this.map(i=>[e?e(i):i,n?n(i):i]);return new Map(r)}toString(){return this.join()}concat(e){return new ne(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),n=>{let r;if(!n.firstDone){do if(r=this.nextFn(n.first),!r.done)return r;while(!r.done);n.firstDone=!0}do if(r=n.iterator.next(),!r.done)return r;while(!r.done);return Ae})}join(e=","){const n=this.iterator();let r="",i,s=!1;do i=n.next(),i.done||(s&&(r+=e),r+=Xd(i.value)),s=!0;while(!i.done);return r}indexOf(e,n=0){const r=this.iterator();let i=0,s=r.next();for(;!s.done;){if(i>=n&&s.value===e)return i;s=r.next(),i++}return-1}every(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(!e(r.value))return!1;r=n.next()}return!0}some(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return!0;r=n.next()}return!1}forEach(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;)e(i.value,r),i=n.next(),r++}map(e){return new ne(this.startFn,n=>{const{done:r,value:i}=this.nextFn(n);return r?Ae:{done:!1,value:e(i)}})}filter(e){return new ne(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&e(r.value))return r;while(!r.done);return Ae})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,n){const r=this.iterator();let i=n,s=r.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=r.next();return i}reduceRight(e,n){return this.recursiveReduce(this.iterator(),e,n)}recursiveReduce(e,n,r){const i=e.next();if(i.done)return r;const s=this.recursiveReduce(e,n,r);return s===void 0?i.value:n(s,i.value)}find(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return r.value;r=n.next()}}findIndex(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(e(i.value))return r;i=n.next(),r++}return-1}includes(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(r.value===e)return!0;r=n.next()}return!1}flatMap(e){return new ne(()=>({this:this.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:r,value:i}=this.nextFn(n.this);if(!r){const s=e(i);if(Ei(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(n.iterator);return Ae})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new ne(()=>({this:n.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:i,value:s}=n.nextFn(r.this);if(!i)if(Ei(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return Ae})}head(){const n=this.iterator().next();if(!n.done)return n.value}tail(e=1){return new ne(()=>{const n=this.startFn();for(let r=0;r<e;r++)if(this.nextFn(n).done)return n;return n},this.nextFn)}limit(e){return new ne(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>e?Ae:this.nextFn(n.state)))}distinct(e){return new ne(()=>({set:new Set,internalState:this.startFn()}),n=>{let r;do if(r=this.nextFn(n.internalState),!r.done){const i=e?e(r.value):r.value;if(!n.set.has(i))return n.set.add(i),r}while(!r.done);return Ae})}exclude(e,n){const r=new Set;for(const i of e){const s=n?n(i):i;r.add(s)}return this.filter(i=>{const s=n?n(i):i;return!r.has(s)})}}function Xd(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Ei(t){return!!t&&typeof t[Symbol.iterator]=="function"}const Jd=new ne(()=>{},()=>Ae),Ae=Object.freeze({done:!0,value:void 0});function re(...t){if(t.length===1){const e=t[0];if(e instanceof ne)return e;if(Ei(e))return new ne(()=>e[Symbol.iterator](),n=>n.next());if(typeof e.length=="number")return new ne(()=>({index:0}),n=>n.index<e.length?{done:!1,value:e[n.index++]}:Ae)}return t.length>1?new ne(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const n=e.iterator.next();if(!n.done)return n;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){const n=t[e.collIndex++];Ei(n)?e.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(e.array=n)}}while(e.iterator||e.array||e.collIndex<t.length);return Ae}):Jd}class Fa extends ne{constructor(e,n,r){super(()=>({iterators:r?.includeRoot?[[e][Symbol.iterator]()]:[n(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const a=i.iterators[i.iterators.length-1].next();if(a.done)i.iterators.pop();else return i.iterators.push(n(a.value)[Symbol.iterator]()),a}return Ae})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Zs;(function(t){function e(s){return s.reduce((a,o)=>a+o,0)}t.sum=e;function n(s){return s.reduce((a,o)=>a*o,0)}t.product=n;function r(s){return s.reduce((a,o)=>Math.min(a,o))}t.min=r;function i(s){return s.reduce((a,o)=>Math.max(a,o))}t.max=i})(Zs||(Zs={}));function Qs(t){return new Fa(t,e=>Tr(e)?e.content:[],{includeRoot:!0})}function Zd(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function ea(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function $i(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}var rt;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(rt||(rt={}));function Qd(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return rt.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return rt.After;const n=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,r=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return n&&r?rt.Inside:n?rt.OverlapBack:r?rt.OverlapFront:rt.Outside}function eh(t,e){return Qd(t,e)>rt.After}const th=/^[\w\p{L}]$/u;function nh(t,e){if(t){const n=rh(t,!0);if(n&&_o(n,e))return n;if(pc(t)){const r=t.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=t.content[i];if(_o(s,e))return s}}}}function _o(t,e){return hc(t)&&e.includes(t.tokenType.name)}function rh(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);for(;r>0;){r--;const i=n.content[r];if(e||!i.hidden)return i}t=n}}class mc extends Error{constructor(e,n){super(e?`${n} at ${e.range.start.line}:${e.range.start.character}`:n)}}function xr(t){throw new Error("Error! The input value was not handled.")}const Dr="AbstractRule",Fr="AbstractType",As="Condition",No="TypeDefinition",Es="ValueLiteral",Ln="AbstractElement";function ih(t){return F.isInstance(t,Ln)}const Gr="ArrayLiteral",Ur="ArrayType",Pn="BooleanLiteral";function sh(t){return F.isInstance(t,Pn)}const Mn="Conjunction";function ah(t){return F.isInstance(t,Mn)}const Dn="Disjunction";function oh(t){return F.isInstance(t,Dn)}const Br="Grammar",$s="GrammarImport",Fn="InferredType";function gc(t){return F.isInstance(t,Fn)}const Gn="Interface";function yc(t){return F.isInstance(t,Gn)}const Ss="NamedArgument",Un="Negation";function lh(t){return F.isInstance(t,Un)}const jr="NumberLiteral",Kr="Parameter",Bn="ParameterReference";function uh(t){return F.isInstance(t,Bn)}const jn="ParserRule";function Ne(t){return F.isInstance(t,jn)}const Hr="ReferenceType",oi="ReturnType";function ch(t){return F.isInstance(t,oi)}const Kn="SimpleType";function fh(t){return F.isInstance(t,Kn)}const Vr="StringLiteral",Yt="TerminalRule";function Ut(t){return F.isInstance(t,Yt)}const Hn="Type";function Tc(t){return F.isInstance(t,Hn)}const xs="TypeAttribute",Wr="UnionType",Vn="Action";function zi(t){return F.isInstance(t,Vn)}const Wn="Alternatives";function vc(t){return F.isInstance(t,Wn)}const zn="Assignment";function Ot(t){return F.isInstance(t,zn)}const qn="CharacterRange";function dh(t){return F.isInstance(t,qn)}const Yn="CrossReference";function Ga(t){return F.isInstance(t,Yn)}const Xn="EndOfFile";function hh(t){return F.isInstance(t,Xn)}const Jn="Group";function Ua(t){return F.isInstance(t,Jn)}const Zn="Keyword";function Lt(t){return F.isInstance(t,Zn)}const Qn="NegatedToken";function ph(t){return F.isInstance(t,Qn)}const er="RegexToken";function mh(t){return F.isInstance(t,er)}const tr="RuleCall";function Pt(t){return F.isInstance(t,tr)}const nr="TerminalAlternatives";function gh(t){return F.isInstance(t,nr)}const rr="TerminalGroup";function yh(t){return F.isInstance(t,rr)}const ir="TerminalRuleCall";function Th(t){return F.isInstance(t,ir)}const sr="UnorderedGroup";function Rc(t){return F.isInstance(t,sr)}const ar="UntilToken";function vh(t){return F.isInstance(t,ar)}const or="Wildcard";function Rh(t){return F.isInstance(t,or)}class Ac extends dc{getAllTypes(){return[Ln,Dr,Fr,Vn,Wn,Gr,Ur,zn,Pn,qn,As,Mn,Yn,Dn,Xn,Br,$s,Jn,Fn,Gn,Zn,Ss,Qn,Un,jr,Kr,Bn,jn,Hr,er,oi,tr,Kn,Vr,nr,rr,Yt,ir,Hn,xs,No,Wr,sr,ar,Es,or]}computeIsSubtype(e,n){switch(e){case Vn:case Wn:case zn:case qn:case Yn:case Xn:case Jn:case Zn:case Qn:case er:case tr:case nr:case rr:case ir:case sr:case ar:case or:return this.isSubtype(Ln,n);case Gr:case jr:case Vr:return this.isSubtype(Es,n);case Ur:case Hr:case Kn:case Wr:return this.isSubtype(No,n);case Pn:return this.isSubtype(As,n)||this.isSubtype(Es,n);case Mn:case Dn:case Un:case Bn:return this.isSubtype(As,n);case Fn:case Gn:case Hn:return this.isSubtype(Fr,n);case jn:return this.isSubtype(Dr,n)||this.isSubtype(Fr,n);case Yt:return this.isSubtype(Dr,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return Fr;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return Dr;case"Grammar:usedGrammars":return Br;case"NamedArgument:parameter":case"ParameterReference:parameter":return Kr;case"TerminalRuleCall:rule":return Yt;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case Ln:return{name:Ln,properties:[{name:"cardinality"},{name:"lookahead"}]};case Gr:return{name:Gr,properties:[{name:"elements",defaultValue:[]}]};case Ur:return{name:Ur,properties:[{name:"elementType"}]};case Pn:return{name:Pn,properties:[{name:"true",defaultValue:!1}]};case Mn:return{name:Mn,properties:[{name:"left"},{name:"right"}]};case Dn:return{name:Dn,properties:[{name:"left"},{name:"right"}]};case Br:return{name:Br,properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case $s:return{name:$s,properties:[{name:"path"}]};case Fn:return{name:Fn,properties:[{name:"name"}]};case Gn:return{name:Gn,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case Ss:return{name:Ss,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case Un:return{name:Un,properties:[{name:"value"}]};case jr:return{name:jr,properties:[{name:"value"}]};case Kr:return{name:Kr,properties:[{name:"name"}]};case Bn:return{name:Bn,properties:[{name:"parameter"}]};case jn:return{name:jn,properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case Hr:return{name:Hr,properties:[{name:"referenceType"}]};case oi:return{name:oi,properties:[{name:"name"}]};case Kn:return{name:Kn,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case Vr:return{name:Vr,properties:[{name:"value"}]};case Yt:return{name:Yt,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case Hn:return{name:Hn,properties:[{name:"name"},{name:"type"}]};case xs:return{name:xs,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case Wr:return{name:Wr,properties:[{name:"types",defaultValue:[]}]};case Vn:return{name:Vn,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case Wn:return{name:Wn,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case zn:return{name:zn,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case qn:return{name:qn,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case Yn:return{name:Yn,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case Xn:return{name:Xn,properties:[{name:"cardinality"},{name:"lookahead"}]};case Jn:return{name:Jn,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case Zn:return{name:Zn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case Qn:return{name:Qn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case er:return{name:er,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case tr:return{name:tr,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case nr:return{name:nr,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case rr:return{name:rr,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case ir:return{name:ir,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case sr:return{name:sr,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case ar:return{name:ar,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case or:return{name:or,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const F=new Ac;function Ah(t){for(const[e,n]of Object.entries(t))e.startsWith("$")||(Array.isArray(n)?n.forEach((r,i)=>{le(r)&&(r.$container=t,r.$containerProperty=e,r.$containerIndex=i)}):le(n)&&(n.$container=t,n.$containerProperty=e))}function qi(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function pt(t){const n=ta(t).$document;if(!n)throw new Error("AST node has no document.");return n}function ta(t){for(;t.$container;)t=t.$container;return t}function Ba(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=e?.range;return new ne(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndex<r.keys.length;){const i=r.keys[r.keyIndex];if(!i.startsWith("$")){const s=t[i];if(le(s)){if(r.keyIndex++,bo(s,n))return{done:!1,value:s}}else if(Array.isArray(s)){for(;r.arrayIndex<s.length;){const a=r.arrayIndex++,o=s[a];if(le(o)&&bo(o,n))return{done:!1,value:o}}r.arrayIndex=0}}r.keyIndex++}return Ae})}function kr(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Fa(t,n=>Ba(n,e))}function Jt(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Fa(t,n=>Ba(n,e),{includeRoot:!0})}function bo(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)===null||n===void 0?void 0:n.range;return r?eh(r,e):!1}function Ec(t){return new ne(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const n=e.keys[e.keyIndex];if(!n.startsWith("$")){const r=t[n];if(ze(r))return e.keyIndex++,{done:!1,value:{reference:r,container:t,property:n}};if(Array.isArray(r)){for(;e.arrayIndex<r.length;){const i=e.arrayIndex++,s=r[i];if(ze(s))return{done:!1,value:{reference:s,container:t,property:n,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Ae})}function Eh(t,e){const n=t.getTypeMetaData(e.$type),r=e;for(const i of n.properties)i.defaultValue!==void 0&&r[i.name]===void 0&&(r[i.name]=$c(i.defaultValue))}function $c(t){return Array.isArray(t)?[...t.map($c)]:t}function _(t){return t.charCodeAt(0)}function ks(t,e){Array.isArray(t)?t.forEach(function(n){e.push(n)}):e.push(t)}function _n(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function qt(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function $h(){throw Error("Internal Error - Should never get here!")}function Oo(t){return t.type==="Character"}const Si=[];for(let t=_("0");t<=_("9");t++)Si.push(t);const xi=[_("_")].concat(Si);for(let t=_("a");t<=_("z");t++)xi.push(t);for(let t=_("A");t<=_("Z");t++)xi.push(t);const Lo=[_(" "),_("\f"),_(`
|
|
1
|
+
import{dZ as Ud,ej as wt}from"./index-B7GqH6If.js";import{m as st,f as Bd,d as jd}from"./min-CRMSN7nx.js";import{b as Kd,l as Hd,d as Vd,m as Wd,r as wo,n as Rs}from"./_baseUniq-iT192ZJn.js";function zd(t,e){return Kd(st(t,e))}function qd(t,e){return t&&t.length?Hd(t,Vd(e)):[]}function le(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function ze(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function Yd(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function ai(t){return typeof t=="object"&&t!==null&&le(t.container)&&ze(t.reference)&&typeof t.message=="string"}class dc{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,n){return le(e)&&this.isSubtype(e.$type,n)}isSubtype(e,n){if(e===n)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const i=r[n];if(i!==void 0)return i;{const s=this.computeIsSubtype(e,n);return r[n]=s,s}}getAllSubTypes(e){const n=this.allSubtypes[e];if(n)return n;{const r=this.getAllTypes(),i=[];for(const s of r)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}}function Tr(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function hc(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function pc(t){return Tr(t)&&typeof t.fullText=="string"}class ne{constructor(e,n){this.startFn=e,this.nextFn=n}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let n=0,r=e.next();for(;!r.done;)n++,r=e.next();return n}toArray(){const e=[],n=this.iterator();let r;do r=n.next(),r.value!==void 0&&e.push(r.value);while(!r.done);return e}toSet(){return new Set(this)}toMap(e,n){const r=this.map(i=>[e?e(i):i,n?n(i):i]);return new Map(r)}toString(){return this.join()}concat(e){return new ne(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),n=>{let r;if(!n.firstDone){do if(r=this.nextFn(n.first),!r.done)return r;while(!r.done);n.firstDone=!0}do if(r=n.iterator.next(),!r.done)return r;while(!r.done);return Ae})}join(e=","){const n=this.iterator();let r="",i,s=!1;do i=n.next(),i.done||(s&&(r+=e),r+=Xd(i.value)),s=!0;while(!i.done);return r}indexOf(e,n=0){const r=this.iterator();let i=0,s=r.next();for(;!s.done;){if(i>=n&&s.value===e)return i;s=r.next(),i++}return-1}every(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(!e(r.value))return!1;r=n.next()}return!0}some(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return!0;r=n.next()}return!1}forEach(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;)e(i.value,r),i=n.next(),r++}map(e){return new ne(this.startFn,n=>{const{done:r,value:i}=this.nextFn(n);return r?Ae:{done:!1,value:e(i)}})}filter(e){return new ne(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&e(r.value))return r;while(!r.done);return Ae})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,n){const r=this.iterator();let i=n,s=r.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=r.next();return i}reduceRight(e,n){return this.recursiveReduce(this.iterator(),e,n)}recursiveReduce(e,n,r){const i=e.next();if(i.done)return r;const s=this.recursiveReduce(e,n,r);return s===void 0?i.value:n(s,i.value)}find(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return r.value;r=n.next()}}findIndex(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(e(i.value))return r;i=n.next(),r++}return-1}includes(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(r.value===e)return!0;r=n.next()}return!1}flatMap(e){return new ne(()=>({this:this.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:r,value:i}=this.nextFn(n.this);if(!r){const s=e(i);if(Ei(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(n.iterator);return Ae})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new ne(()=>({this:n.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:i,value:s}=n.nextFn(r.this);if(!i)if(Ei(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return Ae})}head(){const n=this.iterator().next();if(!n.done)return n.value}tail(e=1){return new ne(()=>{const n=this.startFn();for(let r=0;r<e;r++)if(this.nextFn(n).done)return n;return n},this.nextFn)}limit(e){return new ne(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>e?Ae:this.nextFn(n.state)))}distinct(e){return new ne(()=>({set:new Set,internalState:this.startFn()}),n=>{let r;do if(r=this.nextFn(n.internalState),!r.done){const i=e?e(r.value):r.value;if(!n.set.has(i))return n.set.add(i),r}while(!r.done);return Ae})}exclude(e,n){const r=new Set;for(const i of e){const s=n?n(i):i;r.add(s)}return this.filter(i=>{const s=n?n(i):i;return!r.has(s)})}}function Xd(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Ei(t){return!!t&&typeof t[Symbol.iterator]=="function"}const Jd=new ne(()=>{},()=>Ae),Ae=Object.freeze({done:!0,value:void 0});function re(...t){if(t.length===1){const e=t[0];if(e instanceof ne)return e;if(Ei(e))return new ne(()=>e[Symbol.iterator](),n=>n.next());if(typeof e.length=="number")return new ne(()=>({index:0}),n=>n.index<e.length?{done:!1,value:e[n.index++]}:Ae)}return t.length>1?new ne(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const n=e.iterator.next();if(!n.done)return n;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){const n=t[e.collIndex++];Ei(n)?e.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(e.array=n)}}while(e.iterator||e.array||e.collIndex<t.length);return Ae}):Jd}class Fa extends ne{constructor(e,n,r){super(()=>({iterators:r?.includeRoot?[[e][Symbol.iterator]()]:[n(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const a=i.iterators[i.iterators.length-1].next();if(a.done)i.iterators.pop();else return i.iterators.push(n(a.value)[Symbol.iterator]()),a}return Ae})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Zs;(function(t){function e(s){return s.reduce((a,o)=>a+o,0)}t.sum=e;function n(s){return s.reduce((a,o)=>a*o,0)}t.product=n;function r(s){return s.reduce((a,o)=>Math.min(a,o))}t.min=r;function i(s){return s.reduce((a,o)=>Math.max(a,o))}t.max=i})(Zs||(Zs={}));function Qs(t){return new Fa(t,e=>Tr(e)?e.content:[],{includeRoot:!0})}function Zd(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function ea(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function $i(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}var rt;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(rt||(rt={}));function Qd(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return rt.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return rt.After;const n=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,r=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return n&&r?rt.Inside:n?rt.OverlapBack:r?rt.OverlapFront:rt.Outside}function eh(t,e){return Qd(t,e)>rt.After}const th=/^[\w\p{L}]$/u;function nh(t,e){if(t){const n=rh(t,!0);if(n&&_o(n,e))return n;if(pc(t)){const r=t.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=t.content[i];if(_o(s,e))return s}}}}function _o(t,e){return hc(t)&&e.includes(t.tokenType.name)}function rh(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);for(;r>0;){r--;const i=n.content[r];if(e||!i.hidden)return i}t=n}}class mc extends Error{constructor(e,n){super(e?`${n} at ${e.range.start.line}:${e.range.start.character}`:n)}}function xr(t){throw new Error("Error! The input value was not handled.")}const Dr="AbstractRule",Fr="AbstractType",As="Condition",No="TypeDefinition",Es="ValueLiteral",Ln="AbstractElement";function ih(t){return F.isInstance(t,Ln)}const Gr="ArrayLiteral",Ur="ArrayType",Pn="BooleanLiteral";function sh(t){return F.isInstance(t,Pn)}const Mn="Conjunction";function ah(t){return F.isInstance(t,Mn)}const Dn="Disjunction";function oh(t){return F.isInstance(t,Dn)}const Br="Grammar",$s="GrammarImport",Fn="InferredType";function gc(t){return F.isInstance(t,Fn)}const Gn="Interface";function yc(t){return F.isInstance(t,Gn)}const Ss="NamedArgument",Un="Negation";function lh(t){return F.isInstance(t,Un)}const jr="NumberLiteral",Kr="Parameter",Bn="ParameterReference";function uh(t){return F.isInstance(t,Bn)}const jn="ParserRule";function Ne(t){return F.isInstance(t,jn)}const Hr="ReferenceType",oi="ReturnType";function ch(t){return F.isInstance(t,oi)}const Kn="SimpleType";function fh(t){return F.isInstance(t,Kn)}const Vr="StringLiteral",Yt="TerminalRule";function Ut(t){return F.isInstance(t,Yt)}const Hn="Type";function Tc(t){return F.isInstance(t,Hn)}const xs="TypeAttribute",Wr="UnionType",Vn="Action";function zi(t){return F.isInstance(t,Vn)}const Wn="Alternatives";function vc(t){return F.isInstance(t,Wn)}const zn="Assignment";function Ot(t){return F.isInstance(t,zn)}const qn="CharacterRange";function dh(t){return F.isInstance(t,qn)}const Yn="CrossReference";function Ga(t){return F.isInstance(t,Yn)}const Xn="EndOfFile";function hh(t){return F.isInstance(t,Xn)}const Jn="Group";function Ua(t){return F.isInstance(t,Jn)}const Zn="Keyword";function Lt(t){return F.isInstance(t,Zn)}const Qn="NegatedToken";function ph(t){return F.isInstance(t,Qn)}const er="RegexToken";function mh(t){return F.isInstance(t,er)}const tr="RuleCall";function Pt(t){return F.isInstance(t,tr)}const nr="TerminalAlternatives";function gh(t){return F.isInstance(t,nr)}const rr="TerminalGroup";function yh(t){return F.isInstance(t,rr)}const ir="TerminalRuleCall";function Th(t){return F.isInstance(t,ir)}const sr="UnorderedGroup";function Rc(t){return F.isInstance(t,sr)}const ar="UntilToken";function vh(t){return F.isInstance(t,ar)}const or="Wildcard";function Rh(t){return F.isInstance(t,or)}class Ac extends dc{getAllTypes(){return[Ln,Dr,Fr,Vn,Wn,Gr,Ur,zn,Pn,qn,As,Mn,Yn,Dn,Xn,Br,$s,Jn,Fn,Gn,Zn,Ss,Qn,Un,jr,Kr,Bn,jn,Hr,er,oi,tr,Kn,Vr,nr,rr,Yt,ir,Hn,xs,No,Wr,sr,ar,Es,or]}computeIsSubtype(e,n){switch(e){case Vn:case Wn:case zn:case qn:case Yn:case Xn:case Jn:case Zn:case Qn:case er:case tr:case nr:case rr:case ir:case sr:case ar:case or:return this.isSubtype(Ln,n);case Gr:case jr:case Vr:return this.isSubtype(Es,n);case Ur:case Hr:case Kn:case Wr:return this.isSubtype(No,n);case Pn:return this.isSubtype(As,n)||this.isSubtype(Es,n);case Mn:case Dn:case Un:case Bn:return this.isSubtype(As,n);case Fn:case Gn:case Hn:return this.isSubtype(Fr,n);case jn:return this.isSubtype(Dr,n)||this.isSubtype(Fr,n);case Yt:return this.isSubtype(Dr,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return Fr;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return Dr;case"Grammar:usedGrammars":return Br;case"NamedArgument:parameter":case"ParameterReference:parameter":return Kr;case"TerminalRuleCall:rule":return Yt;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case Ln:return{name:Ln,properties:[{name:"cardinality"},{name:"lookahead"}]};case Gr:return{name:Gr,properties:[{name:"elements",defaultValue:[]}]};case Ur:return{name:Ur,properties:[{name:"elementType"}]};case Pn:return{name:Pn,properties:[{name:"true",defaultValue:!1}]};case Mn:return{name:Mn,properties:[{name:"left"},{name:"right"}]};case Dn:return{name:Dn,properties:[{name:"left"},{name:"right"}]};case Br:return{name:Br,properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case $s:return{name:$s,properties:[{name:"path"}]};case Fn:return{name:Fn,properties:[{name:"name"}]};case Gn:return{name:Gn,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case Ss:return{name:Ss,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case Un:return{name:Un,properties:[{name:"value"}]};case jr:return{name:jr,properties:[{name:"value"}]};case Kr:return{name:Kr,properties:[{name:"name"}]};case Bn:return{name:Bn,properties:[{name:"parameter"}]};case jn:return{name:jn,properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case Hr:return{name:Hr,properties:[{name:"referenceType"}]};case oi:return{name:oi,properties:[{name:"name"}]};case Kn:return{name:Kn,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case Vr:return{name:Vr,properties:[{name:"value"}]};case Yt:return{name:Yt,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case Hn:return{name:Hn,properties:[{name:"name"},{name:"type"}]};case xs:return{name:xs,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case Wr:return{name:Wr,properties:[{name:"types",defaultValue:[]}]};case Vn:return{name:Vn,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case Wn:return{name:Wn,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case zn:return{name:zn,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case qn:return{name:qn,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case Yn:return{name:Yn,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case Xn:return{name:Xn,properties:[{name:"cardinality"},{name:"lookahead"}]};case Jn:return{name:Jn,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case Zn:return{name:Zn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case Qn:return{name:Qn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case er:return{name:er,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case tr:return{name:tr,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case nr:return{name:nr,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case rr:return{name:rr,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case ir:return{name:ir,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case sr:return{name:sr,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case ar:return{name:ar,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case or:return{name:or,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const F=new Ac;function Ah(t){for(const[e,n]of Object.entries(t))e.startsWith("$")||(Array.isArray(n)?n.forEach((r,i)=>{le(r)&&(r.$container=t,r.$containerProperty=e,r.$containerIndex=i)}):le(n)&&(n.$container=t,n.$containerProperty=e))}function qi(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function pt(t){const n=ta(t).$document;if(!n)throw new Error("AST node has no document.");return n}function ta(t){for(;t.$container;)t=t.$container;return t}function Ba(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=e?.range;return new ne(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndex<r.keys.length;){const i=r.keys[r.keyIndex];if(!i.startsWith("$")){const s=t[i];if(le(s)){if(r.keyIndex++,bo(s,n))return{done:!1,value:s}}else if(Array.isArray(s)){for(;r.arrayIndex<s.length;){const a=r.arrayIndex++,o=s[a];if(le(o)&&bo(o,n))return{done:!1,value:o}}r.arrayIndex=0}}r.keyIndex++}return Ae})}function kr(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Fa(t,n=>Ba(n,e))}function Jt(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Fa(t,n=>Ba(n,e),{includeRoot:!0})}function bo(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)===null||n===void 0?void 0:n.range;return r?eh(r,e):!1}function Ec(t){return new ne(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const n=e.keys[e.keyIndex];if(!n.startsWith("$")){const r=t[n];if(ze(r))return e.keyIndex++,{done:!1,value:{reference:r,container:t,property:n}};if(Array.isArray(r)){for(;e.arrayIndex<r.length;){const i=e.arrayIndex++,s=r[i];if(ze(s))return{done:!1,value:{reference:s,container:t,property:n,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Ae})}function Eh(t,e){const n=t.getTypeMetaData(e.$type),r=e;for(const i of n.properties)i.defaultValue!==void 0&&r[i.name]===void 0&&(r[i.name]=$c(i.defaultValue))}function $c(t){return Array.isArray(t)?[...t.map($c)]:t}function _(t){return t.charCodeAt(0)}function ks(t,e){Array.isArray(t)?t.forEach(function(n){e.push(n)}):e.push(t)}function _n(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function qt(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function $h(){throw Error("Internal Error - Should never get here!")}function Oo(t){return t.type==="Character"}const Si=[];for(let t=_("0");t<=_("9");t++)Si.push(t);const xi=[_("_")].concat(Si);for(let t=_("a");t<=_("z");t++)xi.push(t);for(let t=_("A");t<=_("Z");t++)xi.push(t);const Lo=[_(" "),_("\f"),_(`
|
|
2
2
|
`),_("\r"),_(" "),_("\v"),_(" "),_(" "),_(" "),_(" "),_(" "),_(" "),_(" "),_(" "),_(" "),_(" "),_(" "),_(" "),_(" "),_(" "),_("\u2028"),_("\u2029"),_(" "),_(" "),_(" "),_("\uFEFF")],Sh=/[0-9a-fA-F]/,zr=/[0-9]/,xh=/[1-9]/;class Sc{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const n=this.disjunction();this.consumeChar("/");const r={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":_n(r,"global");break;case"i":_n(r,"ignoreCase");break;case"m":_n(r,"multiLine");break;case"u":_n(r,"unicode");break;case"y":_n(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:n,loc:this.loc(0)}}disjunction(){const e=[],n=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(n)}}alternative(){const e=[],n=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(n)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let n;switch(this.popChar()){case"=":n="Lookahead";break;case"!":n="NegativeLookahead";break}qt(n);const r=this.disjunction();return this.consumeChar(")"),{type:n,value:r,loc:this.loc(e)}}return $h()}quantifier(e=!1){let n;const r=this.idx;switch(this.popChar()){case"*":n={atLeast:0,atMost:1/0};break;case"+":n={atLeast:1,atMost:1/0};break;case"?":n={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":n={atLeast:i,atMost:i};break;case",":let s;this.isDigit()?(s=this.integerIncludingZero(),n={atLeast:i,atMost:s}):n={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&n===void 0)return;qt(n);break}if(!(e===!0&&n===void 0)&&qt(n))return this.peekChar(0)==="?"?(this.consumeChar("?"),n.greedy=!1):n.greedy=!0,n.type="Quantifier",n.loc=this.loc(r),n}atom(){let e;const n=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),qt(e))return e.loc=this.loc(n),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[_(`
|
|
3
3
|
`),_("\r"),_("\u2028"),_("\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 e,n=!1;switch(this.popChar()){case"d":e=Si;break;case"D":e=Si,n=!0;break;case"s":e=Lo;break;case"S":e=Lo,n=!0;break;case"w":e=xi;break;case"W":e=xi,n=!0;break}if(qt(e))return{type:"Set",value:e,complement:n}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=_("\f");break;case"n":e=_(`
|
|
4
4
|
`);break;case"r":e=_("\r");break;case"t":e=_(" ");break;case"v":e=_("\v");break}if(qt(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:_("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:_(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|