vibelet 1.2.249 → 1.2.251
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/index.cjs +7 -1
- package/dist/inventory-scan-worker.cjs +1 -1
- package/dist/runtime-version.cjs +1 -1
- package/dist/web/assets/App-Bx92ZYqP.js +2 -0
- package/dist/web/assets/App-C7OILF5b.css +97 -0
- package/dist/web/assets/{BrowserControlPanel-ChZyiZg8.js → BrowserControlPanel-BSBCQsTC.js} +1 -1
- package/dist/web/assets/ChatPane-CNkEpPZD.js +1 -0
- package/dist/web/assets/{ChipGroup-0exv9rzn.js → ChipGroup-BGteDQAS.js} +1 -1
- package/dist/web/assets/ComposerMenus-7XnPTSod.js +1 -0
- package/dist/web/assets/{DiffDrawer-D4eELjEe.js → DiffDrawer-DLUBB9ig.js} +1 -1
- package/dist/web/assets/FilesControlPanel-BC8Kvjf2.js +1 -0
- package/dist/web/assets/GlobalPendingDialog-ZjYyhVoG.js +1 -0
- package/dist/web/assets/{ImageViewer-BojwpCb-.js → ImageViewer-D_-eK1aP.js} +1 -1
- package/dist/web/assets/InteractionPolish-CQwU9CEi.css +1 -0
- package/dist/web/assets/{LanguageSettingsPanel-C1ZHQpVG.js → LanguageSettingsPanel-Btyc58mw.js} +1 -1
- package/dist/web/assets/{MarkdownModePanel-B4iVncFO.js → MarkdownModePanel-q63q8r9N.js} +1 -1
- package/dist/web/assets/{NewSessionDialog-eX_6NPbk.css → NewSessionDialog-CWW1T1s7.css} +1 -1
- package/dist/web/assets/NewSessionDialog-Cqymzgm4.js +1 -0
- package/dist/web/assets/{NotificationSettingsPanel-BA0Lj4kT.js → NotificationSettingsPanel-CKYNiUya.js} +1 -1
- package/dist/web/assets/{PanelFind-D_pRPFBN.js → PanelFind-BA1eUXgS.js} +1 -1
- package/dist/web/assets/{RemoteLifeOSBlock-CZkQLmE5.js → RemoteLifeOSBlock-Bq3YQBy7.js} +2 -2
- package/dist/web/assets/RemoteWorkspaceSettings-Cs_zzqpf.css +1 -0
- package/dist/web/assets/RemoteWorkspaceSettings-D8_jQ7Wt.js +1 -0
- package/dist/web/assets/{SessionTerminalPanel-B-TvX4Fz.js → SessionTerminalPanel-Dmt2m_B6.js} +2 -2
- package/dist/web/assets/{SpeechInputSettingsPanel-Buqwjrth.js → SpeechInputSettingsPanel-9qu4_cQx.js} +1 -1
- package/dist/web/assets/{ThemeSettingsPanel-Bph9zVcN.js → ThemeSettingsPanel-zefRQEDV.js} +1 -1
- package/dist/web/assets/{__vite-browser-external-2447137e-Dbwxx6PZ.js → __vite-browser-external-2447137e-BMiSckAV.js} +1 -1
- package/dist/web/assets/_baseMerge-CwDZKfvJ.js +1 -0
- package/dist/web/assets/{_initCloneObject-CgHgrY9n.js → _initCloneObject-C781OlVa.js} +1 -1
- package/dist/web/assets/{abnfDiagram-VRR7QNED-dJfL32qR.js → abnfDiagram-VRR7QNED-THI3SIgB.js} +1 -1
- package/dist/web/assets/arc-DgeTKeM5.js +1 -0
- package/dist/web/assets/{architectureDiagram-ZJ3FMSHR-LXgKoYZv.js → architectureDiagram-ZJ3FMSHR-CPVnaW5G.js} +1 -1
- package/dist/web/assets/{arrow-left-CagvtJU8.js → arrow-left-dANl3leX.js} +1 -1
- package/dist/web/assets/{arrow-right-CW797wzk.js → arrow-right-DTaF5t16.js} +1 -1
- package/dist/web/assets/{blockDiagram-677ZJIJ3-BOLqwY0y.js → blockDiagram-677ZJIJ3-BDME3ZFA.js} +1 -1
- package/dist/web/assets/{c4Diagram-LMCZKHZV-BvwC7DIr.js → c4Diagram-LMCZKHZV-CMY3o7XE.js} +1 -1
- package/dist/web/assets/channel-BE7FnnNv.js +1 -0
- package/dist/web/assets/chevron-up-C3_IR2td.js +1 -0
- package/dist/web/assets/{chunk-2Q5K7J3B-D2B_BdaG.js → chunk-2Q5K7J3B-Brbuto5C.js} +1 -1
- package/dist/web/assets/{chunk-32BRIVSS-B93XkYif.js → chunk-32BRIVSS-BGCuhDXk.js} +1 -1
- package/dist/web/assets/{chunk-5VM5RSS4-Uv1D4oA2.js → chunk-5VM5RSS4-D85xFHwk.js} +1 -1
- package/dist/web/assets/{chunk-EX3LRPZG-xZrFFOcj.js → chunk-EX3LRPZG-W6U7GsD7.js} +1 -1
- package/dist/web/assets/{chunk-JWPE2WC7-1--FpPFR.js → chunk-JWPE2WC7-CKdx8e0r.js} +1 -1
- package/dist/web/assets/{chunk-MOJQB5TN-BLOL5fhw.js → chunk-MOJQB5TN-Cjf1dDyf.js} +1 -1
- package/dist/web/assets/{chunk-RYQCIY6F-z7wmcSRp.js → chunk-RYQCIY6F-DFxqNYlG.js} +1 -1
- package/dist/web/assets/{chunk-V7JOEXUC-DPvobQwd.js → chunk-V7JOEXUC-lwXYy3Zq.js} +1 -1
- package/dist/web/assets/{chunk-VR4S4FIN-DD3Gj91z.js → chunk-VR4S4FIN-BxiP-OR0.js} +1 -1
- package/dist/web/assets/{chunk-XXDRQBXY-DoVRk31D.js → chunk-XXDRQBXY-BhED1rK6.js} +1 -1
- package/dist/web/assets/classDiagram-OUVF2IWQ-C0-VAw-b.js +1 -0
- package/dist/web/assets/classDiagram-v2-EOCWNBFH-C0-VAw-b.js +1 -0
- package/dist/web/assets/{clsx-DoZLeicy.js → clsx-Dy3K9oBb.js} +1 -1
- package/dist/web/assets/{collectMessageImages-B2EAkrhU.js → collectMessageImages-DEnoDhBs.js} +1 -1
- package/dist/web/assets/composerOptions-0DZvXA1-.js +1 -0
- package/dist/web/assets/{cose-bilkent-JH36ORCC-BQknAy25.js → cose-bilkent-JH36ORCC-DC9M3QOS.js} +1 -1
- package/dist/web/assets/{cynefin-VYW2F7L2-09uNSfvT.js → cynefin-VYW2F7L2-D1LRWQeS.js} +1 -1
- package/dist/web/assets/{cynefinDiagram-TSTJHNR4-CgKhj0m5.js → cynefinDiagram-TSTJHNR4-BJvzO8nK.js} +1 -1
- package/dist/web/assets/{dagre-VKFMJZFB-CLCxvrOo.js → dagre-VKFMJZFB-u4EU1mWb.js} +1 -1
- package/dist/web/assets/{diagram-FQU43EPY-B4VfNgsF.js → diagram-FQU43EPY-DfvPNd6F.js} +1 -1
- package/dist/web/assets/{diagram-G47NLZAW-CQC0I6zX.js → diagram-G47NLZAW-DlJwWs1J.js} +1 -1
- package/dist/web/assets/{diagram-NH7WQ7WH-CSBbTiMh.js → diagram-NH7WQ7WH-DcgpOjQV.js} +1 -1
- package/dist/web/assets/{diagram-OA4YK3LP-CkUx0v34.js → diagram-OA4YK3LP-BrNCuljO.js} +1 -1
- package/dist/web/assets/{diagram-WEI45ONY-dlEY_W2R.js → diagram-WEI45ONY-DxT28KUR.js} +1 -1
- package/dist/web/assets/{ebnfDiagram-CCIWWBDH-BsxdwE2E.js → ebnfDiagram-CCIWWBDH-FD63emzf.js} +1 -1
- package/dist/web/assets/{erDiagram-Q63AITRT-CE8BUsrY.js → erDiagram-Q63AITRT-COEH4rgh.js} +1 -1
- package/dist/web/assets/{file-editor-FileCodeEditor-HR6Wsm5I.js → file-editor-FileCodeEditor-B0qv9YKs.js} +2 -2
- package/dist/web/assets/{file-editor-ObsidianCodeEditor-BMcU5Aqo.js → file-editor-ObsidianCodeEditor-q_YWJSDk.js} +1 -1
- package/dist/web/assets/file-editor-ObsidianFileEditor-bdzeuwke.js +2 -0
- package/dist/web/assets/{file-editor-index-BXupf89-.js → file-editor-index-B6XepRuc.js} +1 -1
- package/dist/web/assets/{file-editor-index-DuqNWTkz.js → file-editor-index-BUPn4zC8.js} +1 -1
- package/dist/web/assets/{file-editor-index-Dc4mA3Mx.js → file-editor-index-BmcxkKR_.js} +1 -1
- package/dist/web/assets/{file-editor-index-ORJkxheE.js → file-editor-index-C-sivrT3.js} +1 -1
- package/dist/web/assets/{file-editor-index-D3hWXNQc.js → file-editor-index-C8hW6Muj.js} +1 -1
- package/dist/web/assets/{file-editor-index-CP7DVsyc.js → file-editor-index-CthnNAMC.js} +1 -1
- package/dist/web/assets/{file-editor-index-Ce_Hrot9.js → file-editor-index-DOP_6x0k.js} +1 -1
- package/dist/web/assets/{file-editor-index-BEhJJ-2S.js → file-editor-index-Db8cbNln.js} +1 -1
- package/dist/web/assets/{file-editor-index-CIj8OyuX.js → file-editor-index-Dg5e3Cpy.js} +1 -1
- package/dist/web/assets/{file-editor-index-DX8Fwz0S.js → file-editor-index-DqKTONJ4.js} +1 -1
- package/dist/web/assets/{file-editor-index-CrvkFqLZ.js → file-editor-index-JhH0nqee.js} +1 -1
- package/dist/web/assets/{file-editor-index-7BDUBERb.js → file-editor-index-WDJmssCC.js} +1 -1
- package/dist/web/assets/{file-editor-index-DL4CfMoo.js → file-editor-index-YBbEVrxT.js} +1 -1
- package/dist/web/assets/{flowDiagram-23GEKE2U-DUiI830l.js → flowDiagram-23GEKE2U-kWBomx5I.js} +1 -1
- package/dist/web/assets/{folder-plus-Byi2WQUY.js → folder-plus-ChLrua3z.js} +1 -1
- package/dist/web/assets/ganttDiagram-NO4QXBWP-bd158wNu.js +1 -0
- package/dist/web/assets/{gitGraphDiagram-IHSO6WYX-BJA7zQjW.js → gitGraphDiagram-IHSO6WYX-BsWMZB1T.js} +1 -1
- package/dist/web/assets/{highlighted-body-TPN3WLV5-lW0JmP5H.js → highlighted-body-TPN3WLV5-BcvTxHra.js} +1 -1
- package/dist/web/assets/index-kcB9N5v8.js +2 -0
- package/dist/web/assets/{infoDiagram-FWYZ7A6U-BfA2fWjL.js → infoDiagram-FWYZ7A6U-DtvGyYt0.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-FXEZZL3T-B7WW0j7E.js → ishikawaDiagram-FXEZZL3T-CHsj8iVR.js} +1 -1
- package/dist/web/assets/{journeyDiagram-5HDEW3XC-BEMtGLhR.js → journeyDiagram-5HDEW3XC-Ben3XW9L.js} +1 -1
- package/dist/web/assets/{kanban-definition-HUTT4EX6-DqIkrGPA.js → kanban-definition-HUTT4EX6-w1H0lvRK.js} +1 -1
- package/dist/web/assets/{key-round-y1oxWXOB.js → key-round-Csanuqei.js} +1 -1
- package/dist/web/assets/{layout-CAp4KseL.js → layout-DvVF2R1Q.js} +1 -1
- package/dist/web/assets/{linear-DRFQGBEA.js → linear-CYqpDCXS.js} +1 -1
- package/dist/web/assets/{map-XtUTTYLw.js → map-yP9qyz-l.js} +1 -1
- package/dist/web/assets/{mermaid-O7DHMXV3-9HC6mORt.js → mermaid-O7DHMXV3-DUoHFycq.js} +2 -2
- package/dist/web/assets/{mermaid-O7DHMXV3-DHmcgJGk.css → mermaid-O7DHMXV3-rMhXRrUE.css} +1 -1
- package/dist/web/assets/{mermaid.core-LEKKQwXZ.js → mermaid.core-CSuHyCbU.js} +2 -2
- package/dist/web/assets/{mic-BOKcmdUn.js → mic-D6yq4BVC.js} +1 -1
- package/dist/web/assets/{mindmap-definition-LN4V7U3C-Bt6LtGWO.js → mindmap-definition-LN4V7U3C-BariZ1mC.js} +1 -1
- package/dist/web/assets/newSessionDefaults-DY7-PuSf.js +1 -0
- package/dist/web/assets/pegDiagram-2B236MQR-DsjvsiG-.js +1 -0
- package/dist/web/assets/{pieDiagram-ENE6RG2P-CeQnXIl7.js → pieDiagram-ENE6RG2P-CVDkx6T3.js} +1 -1
- package/dist/web/assets/{quadrantDiagram-ABIIQ3AL-DNGl4Hse.js → quadrantDiagram-ABIIQ3AL-CZfhv8B5.js} +1 -1
- package/dist/web/assets/{railroadDiagram-RFXS5EU6-BiFr0x3V.js → railroadDiagram-RFXS5EU6-DPiV-o4k.js} +1 -1
- package/dist/web/assets/{requirementDiagram-TGXJPOKE-DIx4dpS7.js → requirementDiagram-TGXJPOKE-ifd3KNkN.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-HTMAVEWB-D_zRhmQ_.js → sankeyDiagram-HTMAVEWB-BTgBAMv9.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-DBY2YBRQ-ChMRMmPd.js → sequenceDiagram-DBY2YBRQ-6-7v8n8u.js} +1 -1
- package/dist/web/assets/{sizeCapture-X5ZJPWSS-CLVxFMDT.js → sizeCapture-X5ZJPWSS-BRFGoPEh.js} +1 -1
- package/dist/web/assets/{square-K9kFBDil.js → square-Dl4fOYPP.js} +1 -1
- package/dist/web/assets/{stateDiagram-2N3HPSRC-Dn7yCHtf.js → stateDiagram-2N3HPSRC-BBiXuN7R.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-6OUMAXLB-DRJJe0JN.js +1 -0
- package/dist/web/assets/{swimlanes-5IMT3BWC-Dhut6RY-.js → swimlanes-5IMT3BWC-C40_UKFy.js} +2 -2
- package/dist/web/assets/swimlanesDiagram-G3AALYLV-DEaTTKbV.js +1 -0
- package/dist/web/assets/{timeline-definition-FHXFAJF6-D_9aY3SL.js → timeline-definition-FHXFAJF6-cuYaryrF.js} +1 -1
- package/dist/web/assets/useComposerCompletion-DBl1CTPC.js +1 -0
- package/dist/web/assets/{vennDiagram-L72KCM5P-Bxsjs1td.js → vennDiagram-L72KCM5P-BjSt5IQl.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-EHGQE667-B8vO0orG.js → wardleyDiagram-EHGQE667-DAJYQgOm.js} +1 -1
- package/dist/web/assets/{xychartDiagram-FW5EYKEG-CUBLdGVB.js → xychartDiagram-FW5EYKEG-DwQxHkEv.js} +1 -1
- package/dist/web/assets/zap-D3JafXHq.js +1 -0
- package/dist/web/index.html +1 -1
- package/dist/web/obsidian-editor-assets.json +1 -1
- package/package.json +1 -1
- package/dist/web/assets/App-CqANyaMK.css +0 -97
- package/dist/web/assets/App-gwVbOIB1.js +0 -2
- package/dist/web/assets/ChatPane-fH0IY48w.js +0 -1
- package/dist/web/assets/ComposerMenus-DhMX49q9.js +0 -1
- package/dist/web/assets/FilesControlPanel-Bz4i0bf2.js +0 -1
- package/dist/web/assets/GlobalPendingDialog-tews3DVC.js +0 -1
- package/dist/web/assets/InteractionPolish-Nkww8pqM.css +0 -1
- package/dist/web/assets/NewSessionDialog-CsOHExrY.js +0 -1
- package/dist/web/assets/RemoteWorkspaceSettings-7jz8oX59.css +0 -1
- package/dist/web/assets/RemoteWorkspaceSettings-tDqbDqj4.js +0 -1
- package/dist/web/assets/_baseMerge-YHvLFG89.js +0 -1
- package/dist/web/assets/arc-BYAxnPQ_.js +0 -1
- package/dist/web/assets/channel-DpGkajT1.js +0 -1
- package/dist/web/assets/chevron-up-DfL2d5fV.js +0 -1
- package/dist/web/assets/classDiagram-OUVF2IWQ-oZMIKKng.js +0 -1
- package/dist/web/assets/classDiagram-v2-EOCWNBFH-oZMIKKng.js +0 -1
- package/dist/web/assets/file-editor-ObsidianFileEditor-BuzsfQwA.js +0 -2
- package/dist/web/assets/ganttDiagram-NO4QXBWP-x0WR7K4r.js +0 -1
- package/dist/web/assets/index-c9Eb0rEZ.js +0 -2
- package/dist/web/assets/pegDiagram-2B236MQR-DVdodUA1.js +0 -1
- package/dist/web/assets/shield-check-DM9poYLJ.js +0 -1
- package/dist/web/assets/stateDiagram-v2-6OUMAXLB-DkgnQPrP.js +0 -1
- package/dist/web/assets/swimlanesDiagram-G3AALYLV-D62G5R34.js +0 -1
- package/dist/web/assets/useComposerCompletion-DcHhaHlX.js +0 -1
- package/dist/web/assets/zap-4rbaTb6R.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as r,s as e}from"./flowDiagram-23GEKE2U-kWBomx5I.js";import{_ as t}from"./mermaid.core-CSuHyCbU.js";import"./RemoteLifeOSBlock-Bq3YQBy7.js";import"./chunk-5VM5RSS4-D85xFHwk.js";import"./chunk-XXDRQBXY-BhED1rK6.js";import"./chunk-VR4S4FIN-BxiP-OR0.js";import"./chunk-32BRIVSS-BGCuhDXk.js";import"./purify.es-BNLkGfTg.js";import"./channel-BE7FnnNv.js";import"./index-kcB9N5v8.js";import"./marked.esm-BBjA1da9.js";import"./index-S4bzeLfy.js";import"./index-8TM1eFHE.js";import"./file-editor-CodeHighlight-aQ9kP3Wv.js";import"./App-Bx92ZYqP.js";import"./square-Dl4fOYPP.js";import"./chevron-up-C3_IR2td.js";import"./__vite-browser-external-2447137e-BMiSckAV.js";var o=r({defaultLayout:"swimlane",styles:t(r=>`${e(r)}\n .swimlane.cluster rect {\n stroke: ${r.clusterBorder} !important;\n }\n [data-look="neo"].cluster rect {\n filter: none;\n }\n`,"getStyles")});export{o as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,z as e,a9 as n,aa as i,ab as r,c as a,l as s,F as o,a1 as c,ac as l,d as h,u as d,ad as p,q as u}from"./mermaid.core-LEKKQwXZ.js";import{d as g}from"./arc-BYAxnPQ_.js";import"./index-c9Eb0rEZ.js";import"./RemoteLifeOSBlock-CZkQLmE5.js";import"./index-S4bzeLfy.js";import"./index-8TM1eFHE.js";import"./file-editor-CodeHighlight-aQ9kP3Wv.js";import"./App-gwVbOIB1.js";import"./square-K9kFBDil.js";import"./chevron-up-DfL2d5fV.js";import"./__vite-browser-external-2447137e-Dbwxx6PZ.js";import"./purify.es-BNLkGfTg.js";import"./marked.esm-BBjA1da9.js";var y=function(){var e=t(function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},"o"),n=[6,11,13,14,15,17,19,20,23,24],i=[1,12],r=[1,13],a=[1,14],s=[1,15],o=[1,16],c=[1,19],l=[1,20],h={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:t(function(t,e,n,i,r,a,s){var o=a.length-1;switch(r){case 1:return a[o-1];case 3:i.setDirection("LR");break;case 4:i.setDirection("TD");break;case 5:case 9:case 10:this.$=[];break;case 6:a[o-1].push(a[o]),this.$=a[o-1];break;case 7:case 8:this.$=a[o];break;case 11:i.getCommonDb().setDiagramTitle(a[o].substr(6)),this.$=a[o].substr(6);break;case 12:this.$=a[o].trim(),i.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=a[o].trim(),i.getCommonDb().setAccDescription(this.$);break;case 15:i.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 18:i.addTask(a[o],0,""),this.$=a[o];break;case 19:i.addEvent(a[o].substr(2)),this.$=a[o]}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(n,[2,5],{5:6}),e(n,[2,2]),e(n,[2,3]),e(n,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:i,15:r,17:a,19:s,20:o,21:17,22:18,23:c,24:l},e(n,[2,10],{1:[2,1]}),e(n,[2,6]),{12:21,14:i,15:r,17:a,19:s,20:o,21:17,22:18,23:c,24:l},e(n,[2,8]),e(n,[2,9]),e(n,[2,11]),{16:[1,22]},{18:[1,23]},e(n,[2,14]),e(n,[2,15]),e(n,[2,16]),e(n,[2,17]),e(n,[2,18]),e(n,[2,19]),e(n,[2,7]),e(n,[2,12]),e(n,[2,13])],defaultActions:{},parseError:t(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:t(function(e){var n=this,i=[0],r=[],a=[null],s=[],o=this.table,c="",l=0,h=0,d=s.slice.call(arguments,1),p=Object.create(this.lexer),u={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(u.yy[g]=this.yy[g]);p.setInput(e,u.yy),u.yy.lexer=p,u.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var y=p.yylloc;s.push(y);var f=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=r.pop()||p.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t(function(t){i.length=i.length-2*t,a.length=a.length-t,s.length=s.length-t},"popStack"),t(m,"lex");for(var x,b,k,w,_,$,v,S,E={};;){if(b=i[i.length-1],this.defaultActions[b]?k=this.defaultActions[b]:(null==x&&(x=m()),k=o[b]&&o[b][x]),void 0===k||!k.length||!k[0]){var T;for(_ in S=[],o[b])this.terminals_[_]&&_>2&&S.push("'"+this.terminals_[_]+"'");T=p.showPosition?"Parse error on line "+(l+1)+":\n"+p.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(T,{text:p.match,token:this.terminals_[x]||x,line:p.yylineno,loc:y,expected:S})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+x);switch(k[0]){case 1:i.push(x),a.push(p.yytext),s.push(p.yylloc),i.push(k[1]),x=null,h=p.yyleng,c=p.yytext,l=p.yylineno,y=p.yylloc;break;case 2:if($=this.productions_[k[1]][1],E.$=a[a.length-$],E._$={first_line:s[s.length-($||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-($||1)].first_column,last_column:s[s.length-1].last_column},f&&(E._$.range=[s[s.length-($||1)].range[0],s[s.length-1].range[1]]),void 0!==(w=this.performAction.apply(E,[c,h,l,u.yy,k[1],a,s].concat(d))))return w;$&&(i=i.slice(0,-1*$*2),a=a.slice(0,-1*$),s=s.slice(0,-1*$)),i.push(this.productions_[k[1]][0]),a.push(E.$),s.push(E._$),v=o[i[i.length-2]][i[i.length-1]],i.push(v);break;case 3:return!0}}return!0},"parse")},d=function(){return{EOF:1,parseError:t(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:t(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:t(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:t(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:t(function(t){this.unput(this.match.slice(t))},"less"),pastInput:t(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:t(function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;a<r.length;a++)if((n=this._input.match(this.rules[r[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){return this.next()||this.lex()},"lex"),begin:t(function(t){this.conditionStack.push(t)},"begin"),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:t(function(t){this.begin(t)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(t,e,n,i){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 13;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}}}();function p(){this.yy={}}return h.lexer=d,t(p,"Parser"),p.prototype=h,h.Parser=p,new p}();y.parser=y;var f=y,m={};d(m,{addEvent:()=>L,addSection:()=>I,addTask:()=>C,addTaskOrg:()=>N,clear:()=>S,default:()=>D,getCommonDb:()=>v,getDirection:()=>T,getSections:()=>M,getTasks:()=>H,setDirection:()=>E});var x="",b=0,k="LR",w=[],_=[],$=[],v=t(()=>p,"getCommonDb"),S=t(function(){w.length=0,_.length=0,x="",$.length=0,k="LR",u()},"clear"),E=t(function(t){k=t},"setDirection"),T=t(function(){return k},"getDirection"),I=t(function(t){x=t,w.push(t)},"addSection"),M=t(function(){return w},"getSections"),H=t(function(){let t=j(),e=0;for(;!t&&e<100;)t=j(),e++;return _.push(...$),_},"getTasks"),C=t(function(t,e,n){const i={id:b++,section:x,type:x,task:t,score:e||0,events:n?[n]:[]};$.push(i)},"addTask"),L=t(function(t){$.find(t=>t.id===b-1).events.push(t)},"addEvent"),N=t(function(t){const e={section:x,type:x,description:t,task:t,classes:[]};_.push(e)},"addTaskOrg"),j=t(function(){const e=t(function(t){return $[t].processed},"compileTask");let n=!0;for(const[t,i]of $.entries())e(t),n=n&&i.processed;return n},"compileTasks"),D={clear:S,getCommonDb:v,getDirection:T,setDirection:E,addSection:I,getSections:M,getTasks:H,addTask:C,addTaskOrg:N,addEvent:L},O=0,A=t(function(t,e){const n=t.append("rect");return n.attr("x",e.x),n.attr("y",e.y),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("width",e.width),n.attr("height",e.height),n.attr("rx",e.rx),n.attr("ry",e.ry),void 0!==e.class&&n.attr("class",e.class),n},"drawRect"),R=t(function(e,n){const i=e.append("circle").attr("cx",n.cx).attr("cy",n.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),r=e.append("g");function a(t){const e=g().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+n.cx+","+(n.cy+2)+")")}function s(t){const e=g().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+n.cx+","+(n.cy+7)+")")}function o(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",n.cx-5).attr("y1",n.cy+7).attr("x2",n.cx+5).attr("y2",n.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return r.append("circle").attr("cx",n.cx-5).attr("cy",n.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",n.cx+5).attr("cy",n.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),t(a,"smile"),t(s,"sad"),t(o,"ambivalent"),n.score>3?a(r):n.score<3?s(r):o(r),i},"drawFace"),B=t(function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n},"drawCircle"),P=t(function(t,e){const n=e.text.replace(/<br\s*\/?>/gi," "),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.attr("class","legend"),i.style("text-anchor",e.anchor),void 0!==e.class&&i.attr("class",e.class);const r=i.append("tspan");return r.attr("x",e.x+2*e.textMargin),r.text(n),i},"drawText"),W=t(function(e,n){function i(t,e,n,i,r){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+i-r)+" "+(t+n-1.2*r)+","+(e+i)+" "+t+","+(e+i)}t(i,"genPoints");const r=e.append("polygon");r.attr("points",i(n.x,n.y,50,20,7)),r.attr("class","labelBox"),n.y=n.y+n.labelMargin,n.x=n.x+.5*n.labelMargin,P(e,n)},"drawLabel"),F=t(function(t,e,n){const i=t.append("g"),r=U();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=n.width,r.height=n.height,r.class="journey-section section-type-"+e.num,r.rx=3,r.ry=3,A(i,r),Z(n)(e.text,i,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+e.num},n,e.colour)},"drawSection"),z=-1,V=t(function(t,e,n,i){const r=e.x+n.width/2,a=t.append("g");z++,a.append("line").attr("id",i+"-task"+z).attr("x1",r).attr("y1",e.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),R(a,{cx:r,cy:300+30*(5-e.score),score:e.score});const s=U();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=n.width,s.height=n.height,s.class="task task-type-"+e.num,s.rx=3,s.ry=3,A(a,s),Z(n)(e.task,a,s.x,s.y,s.width,s.height,{class:"task"},n,e.colour)},"drawTask"),G=t(function(t,e){A(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),q=t(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),U=t(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Z=function(){function e(t,e,n,i,a,s,o,c){r(e.append("text").attr("x",n+a/2).attr("y",i+s/2+5).style("font-color",c).style("text-anchor","middle").text(t),o)}function n(t,e,n,i,a,s,o,c,l){const{taskFontSize:h,taskFontFamily:d}=c,p=t.split(/<br\s*\/?>/gi);for(let u=0;u<p.length;u++){const t=u*h-h*(p.length-1)/2,c=e.append("text").attr("x",n+a/2).attr("y",i).attr("fill",l).style("text-anchor","middle").style("font-size",h).style("font-family",d);c.append("tspan").attr("x",n+a/2).attr("dy",t).text(p[u]),c.attr("y",i+s/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(c,o)}}function i(t,e,i,a,s,o,c,l){const h=e.append("switch"),d=h.append("foreignObject").attr("x",i).attr("y",a).attr("width",s).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),n(t,h,i,a,s,o,c,l),r(d,c)}function r(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return t(e,"byText"),t(n,"byTspan"),t(i,"byFo"),t(r,"_setTextAttrs"),function(t){return"fo"===t.textPlacement?i:"old"===t.textPlacement?e:n}}(),Y=t(function(t,e){O=0,z=-1,t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function K(t,e){t.each(function(){var t,n=h(this),i=n.text().split(/(\s+|<br>)/).reverse(),r=[],a=n.attr("y"),s=parseFloat(n.attr("dy")),o=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",s+"em");for(let c=0;c<i.length;c++)t=i[i.length-1-c],r.push(t),o.text(r.join(" ").trim()),(o.node().getComputedTextLength()>e||"<br>"===t)&&(r.pop(),o.text(r.join(" ").trim()),r="<br>"===t?[""]:[t],o=n.append("tspan").attr("x",0).attr("y",a).attr("dy","1.1em").text(t))})}t(K,"wrap");var Q=t(function(t,e,n,i,r,a=!1){const{theme:s,look:o}=i,c=s?.includes("redux"),l=n%(i?.themeVariables?.THEME_COLOR_LIMIT??12)-1,d=t.append("g");e.section=l,d.attr("class",(e.class?e.class+" ":"")+"timeline-node section-"+l);const p=d.append("g"),u=d.append("g"),g=u.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(K,e.width).node().getBBox(),y=i.fontSize?.replace?i.fontSize.replace("px",""):i.fontSize;if(e.height=g.height+1.1*y*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,u.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),c&&u.attr("transform",`translate(${e.width/2}, ${a?e.padding/2+3:e.padding})`),J(p,e,l,r,i),"neo"===o&&(d.attr("data-look","neo"),c)){const e=s.includes("dark"),n=t.node()?.ownerSVGElement??t.node(),i=h(n),r=i.attr("id")??"",a=r?`${r}-drop-shadow`:"drop-shadow";if(i.select(`#${a}`).empty()){const t=i.select("defs");(t.empty()?i.append("defs"):t).append("filter").attr("id",a).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",e?"0.2":"0.06").attr("flood-color",e?"#FFFFFF":"#000000")}}return e},"drawNode"),X=t(function(t,e,n){const i=t.append("g"),r=i.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(K,e.width).node().getBBox(),a=n.fontSize?.replace?n.fontSize.replace("px",""):n.fontSize;return i.remove(),r.height+1.1*a*.5+e.padding},"getVirtualNodeHeight"),J=t(function(t,e,n,i,r){const{theme:a}=r,s=a?.includes("redux")?0:5,o=s>0?`M0 ${e.height-5} v${10-e.height} q0,-${s},${s},-${s} h${e.width-10} q${s},0,${s},${s} v${e.height-5} H0 Z`:`M0 ${e.height-5} v${-(e.height-5)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",i+"-node-"+O++).attr("class","node-bkg node-"+e.type).attr("d",o),a?.includes("redux")||t.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),tt={drawRect:A,drawCircle:B,drawSection:F,drawText:P,drawLabel:W,drawTask:V,drawBackgroundRect:G,getTextObj:q,getNoteRect:U,initGraphics:Y,drawNode:Q,getVirtualNodeHeight:X},et=t(function(t,e,n,i){const r=a(),{look:o,theme:c,themeVariables:d}=r,{useGradient:p,gradientStart:u,gradientStop:g}=d,y=r.timeline?.leftMargin??50;s.debug("timeline",i.db);const f=r.securityLevel;let m;"sandbox"===f&&(m=h("#i"+e));const x=h("sandbox"===f?m.nodes()[0].contentDocument.body:"body").select("#"+e);x.append("g");const b=i.db.getTasks(),k=i.db.getCommonDb().getDiagramTitle();s.debug("task",b),tt.initGraphics(x,e);const w=i.db.getSections();s.debug("sections",w);let _=0,$=0,v=0,S=0,E=50+y,T=50;S=50;let I=0,M=!0;w.forEach(function(t){const e={number:I,descr:t,section:I,width:150,padding:20,maxHeight:_},n=tt.getVirtualNodeHeight(x,e,r);s.debug("sectionHeight before draw",n),_=Math.max(_,n+20)});let H=0,C=0;s.debug("tasks.length",b.length);for(const[a,l]of b.entries()){const t={number:a,descr:l,section:l.section,width:150,padding:20,maxHeight:$},e=tt.getVirtualNodeHeight(x,t,r);s.debug("taskHeight before draw",e),$=Math.max($,e+20),H=Math.max(H,l.events.length);let n=0;for(const i of l.events){const t={descr:i,section:l.section,number:l.section,width:150,padding:20,maxHeight:50};n+=tt.getVirtualNodeHeight(x,t,r)}l.events.length>0&&(n+=10*(l.events.length-1)),C=Math.max(C,n)}s.debug("maxSectionHeight before draw",_),s.debug("maxTaskHeight before draw",$),w&&w.length>0?w.forEach(t=>{const n=b.filter(e=>e.section===t),i={number:I,descr:t,section:I,width:200*Math.max(n.length,1)-50,padding:20,maxHeight:_};s.debug("sectionNode",i);const a=x.append("g"),o=tt.drawNode(a,i,I,r,e);s.debug("sectionNode output",o),a.attr("transform",`translate(${E}, 50)`),T+=_+50,n.length>0&&nt(x,n,I,E,T,$,r,H,C,_,!1,e),E+=200*Math.max(n.length,1),T=50,I++}):(M=!1,nt(x,b,I,E,T,$,r,H,C,_,!0,e));const L=x.node().getBBox();if(s.debug("bounds",L),k&&x.append("text").text(k).attr("x","neo"===o?2*L.x+y:L.width/2-y).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),v=M?_+$+150:$+100,x.append("g").attr("class","lineWrapper").append("line").attr("x1",y).attr("y1",v).attr("x2",L.width+3*y).attr("y2",v).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),"neo"===o&&p&&"neutral"!==c){const t=x.select("defs"),e=(t.empty()?x.append("defs"):t).append("linearGradient").attr("id",x.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");e.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),e.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}l(void 0,x,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),nt=t(function(t,e,n,i,r,a,o,c,l,h,d,p){for(const u of e){const e={descr:u.task,section:n,number:n,width:150,padding:20,maxHeight:a};s.debug("taskNode",e);const c=t.append("g").attr("class","taskWrapper"),h=tt.drawNode(c,e,n,o,p).height;if(s.debug("taskHeight after draw",h),c.attr("transform",`translate(${i}, ${r})`),a=Math.max(a,h),u.events){const e=t.append("g").attr("class","lineWrapper");let s=a;r+=100,s+=it(t,u.events,n,i,r,o,p),r-=100,e.append("line").attr("x1",i+95).attr("y1",r+a).attr("x2",i+95).attr("y2",r+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${p}-arrowhead)`).attr("stroke-dasharray","5,5")}i+=200,d&&!o.timeline?.disableMulticolor&&n++}r-=10},"drawTasks"),it=t(function(t,e,n,i,r,a,o){let c=0;const l=r;r+=100;for(const h of e){const e={descr:h,section:n,number:n,width:150,padding:20,maxHeight:50};s.debug("eventNode",e);const l=t.append("g").attr("class","eventWrapper"),d=tt.drawNode(l,e,n,a,o,!0).height;c+=d,l.attr("transform",`translate(${i}, ${r})`),r=r+10+d}return r=l,c},"drawEvents"),rt={setConf:t(()=>{},"setConf"),draw:et},at=t(function(t,e,n,i){const r=a(),h=r.timeline?.leftMargin??50;s.debug("timeline",i.db);const d=o(e);d.append("g");const p=i.db.getTasks(),u=i.db.getCommonDb().getDiagramTitle();s.debug("task",p),tt.initGraphics(d);const g=i.db.getSections();s.debug("sections",g);let y=0,f=0;const m=50+h;let x=50;const b=x,k=m+230;let w=0;const _=g&&g.length>0,$=_?k:m+230,v=Math.max(50,580);g.forEach(function(t){const e={number:w,descr:t,section:w,width:v,padding:5,maxHeight:y},n=tt.getVirtualNodeHeight(d,e,r);s.debug("sectionHeight before draw",n),y=Math.max(y,n)});let S=0;s.debug("tasks.length",p.length);for(const[a,o]of p.entries()){const t={number:a,descr:o,section:o.section,width:200,padding:5,maxHeight:f},e=tt.getVirtualNodeHeight(d,t,r);s.debug("taskHeight before draw",e),f=Math.max(f,e);let n=0;for(const i of o.events){const t={descr:i,section:o.section,number:o.section,width:300,padding:5,maxHeight:50};n+=tt.getVirtualNodeHeight(d,t,r)}o.events.length>0&&(n+=10*(o.events.length-1)),S=Math.max(S,n)+0}s.debug("maxSectionHeight before draw",y),s.debug("maxTaskHeight before draw",f);const E=Math.max(f,S)+30;_?g.forEach(t=>{const e=p.filter(e=>e.section===t),n={number:w,descr:t,section:w,width:v,padding:5,maxHeight:y};s.debug("sectionNode",n);const i=d.append("g"),a=tt.drawNode(i,n,w,r);s.debug("sectionNode output",a);const o=$-230;i.attr("transform",`translate(${o}, ${x})`);const c=x+a.height+20;e.length>0&&st(d,e,w,$,c,f,r,E,!1);const l=e.length,h=a.height+20+E*Math.max(l,1)-(l>0?60:0);x+=h,w++}):st(d,p,w,$,x,f,r,E,!0);let T=d.node()?.getBBox();if(!T)throw new Error("bbox not found");if(s.debug("bounds",T),u){if(d.append("text").text(u).attr("x",T.width/2-h).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),T=d.node()?.getBBox(),!T)throw new Error("bbox not found");s.debug("bounds after title",T)}const[I]=c(r.fontSize),M=2*(I??16),H=.5*(I??16)+20,C=d.append("g").attr("class","lineWrapper");C.append("line").attr("x1",$).attr("y1",b-M).attr("x2",$).attr("y2",T.y+T.height+H).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),C.lower(),l(void 0,d,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),st=t(function(t,e,n,i,r,a,o,c,l){for(const h of e){const e={descr:h.task,section:n,number:n,width:200,padding:5,maxHeight:a};s.debug("taskNode",e);const d=t.append("g").attr("class","taskWrapper"),p=tt.drawNode(d,e,n,o),u=p.height;s.debug("taskHeight after draw",u);const g=i-20-p.width;if(d.attr("transform",`translate(${g}, ${r})`),a=Math.max(a,u),h.events&&h.events.length>0){const e=r,a=i+50;ot(t,h.events,n,i,a,e,o)}r+=c,l&&!o.timeline?.disableMulticolor&&n++}},"drawTasks"),ot=t(function(t,e,n,i,r,a,o){let c=a;for(const l of e){const e={descr:l,section:n,number:n,width:300,padding:5,maxHeight:0};s.debug("eventNode",e);const a=t.append("g").attr("class","eventWrapper"),h=tt.drawNode(a,e,n,o).height;a.attr("transform",`translate(${r}, ${c})`);const d=c+h/2;t.append("g").attr("class","lineWrapper").append("line").attr("x1",i).attr("y1",d).attr("x2",r).attr("y2",d).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),c=c+h+10}return c-a},"drawEvents"),ct={setConf:t(()=>{},"setConf"),draw:at},lt=t(t=>{const{theme:n}=e(),i=n?.includes("dark"),r=n?.includes("color"),a=t.svgId?.replace(/^#/,"")??"",s=a?`url(#${a}-drop-shadow)`:t.dropShadow??"none";let o="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++){const n=""+(17-3*e),a=r?t.borderColorArray[e]:t.mainBkg,c=r?t.borderColorArray[e]:t.nodeBorder;o+=`\n .section-${e-1} rect,\n .section-${e-1} path,\n .section-${e-1} circle {\n fill: ${i&&r?t.mainBkg:a};\n stroke: ${c};\n stroke-width: ${t.strokeWidth};\n filter: ${s};\n }\n\n .section-${e-1} text {\n fill: ${t.nodeBorder};\n font-weight: ${t.fontWeight}\n }\n\n .node-icon-${e-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+e]};\n }\n\n .section-edge-${e-1} {\n stroke: ${t["cScale"+e]};\n }\n\n .edge-depth-${e-1} {\n stroke-width: ${n};\n }\n\n .section-${e-1} line {\n stroke: ${t["cScaleInv"+e]};\n stroke-width: 3;\n }\n\n .lineWrapper line {\n stroke: ${t.nodeBorder};\n stroke-width:${t.strokeWidth}\n }\n\n .disabled,\n .disabled circle,\n .disabled text {\n fill: ${t.tertiaryColor??"lightgray"};\n }\n\n .disabled text {\n fill: ${t.clusterBorder??"#efefef"};\n }\n `}return o},"genReduxSections"),ht=t(t=>{let e="";for(let a=0;a<t.THEME_COLOR_LIMIT;a++)t["lineColor"+a]=t["lineColor"+a]||t["cScaleInv"+a],n(t["lineColor"+a])?t["lineColor"+a]=i(t["lineColor"+a],20):t["lineColor"+a]=r(t["lineColor"+a],20);for(let n=0;n<t.THEME_COLOR_LIMIT;n++){const i=""+(17-3*n);e+=`\n .section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} path {\n fill: ${t["cScale"+n]};\n }\n .section-${n-1} text {\n fill: ${t["cScaleLabel"+n]};\n }\n .node-icon-${n-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+n]};\n }\n .section-edge-${n-1}{\n stroke: ${t["cScale"+n]};\n }\n .edge-depth-${n-1}{\n stroke-width: ${i};\n }\n .section-${n-1} line {\n stroke: ${t["cScaleInv"+n]} ;\n stroke-width: 3;\n }\n\n .lineWrapper line{\n stroke: ${t["cScaleLabel"+n]} ;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: ${t.tertiaryColor??"lightgray"};\n }\n .disabled text {\n fill: ${t.clusterBorder??"#efefef"};\n }\n `}return e},"genSections"),dt=t(t=>{const{theme:n}=e(),i=n?.includes("redux"),r="neutral"===n,a=t.svgId?.replace(/^#/,"")??"";let s="";if(t.useGradient&&a&&t.THEME_COLOR_LIMIT&&!r)for(let e=0;e<t.THEME_COLOR_LIMIT;e++)s+=`\n .section-${e-1}[data-look="neo"] rect,\n .section-${e-1}[data-look="neo"] path,\n .section-${e-1}[data-look="neo"] circle {\n fill: ${t.mainBkg};\n stroke: url(#${a}-gradient);\n stroke-width: 2;\n }\n .section-${e-1}[data-look="neo"] line {\n stroke: url(#${a}-gradient);\n stroke-width: 2;\n }`;return`\n .edge {\n stroke-width: 3;\n }\n ${i?lt(t):ht(t)}\n ${s}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`},"getStyles"),pt={db:m,renderer:{setConf:t(()=>{},"setConf"),draw:t((t,e,n,i)=>"TD"===(i?.db?.getDirection?.()??"LR")?ct.draw(t,e,n,i):rt.draw(t,e,n,i),"draw")},parser:f,styles:dt};export{pt as diagram};
|
|
1
|
+
import{_ as t,z as e,a9 as n,aa as i,ab as r,c as a,l as s,F as o,a1 as c,ac as l,d as h,u as d,ad as p,q as u}from"./mermaid.core-CSuHyCbU.js";import{d as g}from"./arc-DgeTKeM5.js";import"./index-kcB9N5v8.js";import"./RemoteLifeOSBlock-Bq3YQBy7.js";import"./index-S4bzeLfy.js";import"./index-8TM1eFHE.js";import"./file-editor-CodeHighlight-aQ9kP3Wv.js";import"./App-Bx92ZYqP.js";import"./square-Dl4fOYPP.js";import"./chevron-up-C3_IR2td.js";import"./__vite-browser-external-2447137e-BMiSckAV.js";import"./purify.es-BNLkGfTg.js";import"./marked.esm-BBjA1da9.js";var y=function(){var e=t(function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},"o"),n=[6,11,13,14,15,17,19,20,23,24],i=[1,12],r=[1,13],a=[1,14],s=[1,15],o=[1,16],c=[1,19],l=[1,20],h={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:t(function(t,e,n,i,r,a,s){var o=a.length-1;switch(r){case 1:return a[o-1];case 3:i.setDirection("LR");break;case 4:i.setDirection("TD");break;case 5:case 9:case 10:this.$=[];break;case 6:a[o-1].push(a[o]),this.$=a[o-1];break;case 7:case 8:this.$=a[o];break;case 11:i.getCommonDb().setDiagramTitle(a[o].substr(6)),this.$=a[o].substr(6);break;case 12:this.$=a[o].trim(),i.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=a[o].trim(),i.getCommonDb().setAccDescription(this.$);break;case 15:i.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 18:i.addTask(a[o],0,""),this.$=a[o];break;case 19:i.addEvent(a[o].substr(2)),this.$=a[o]}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(n,[2,5],{5:6}),e(n,[2,2]),e(n,[2,3]),e(n,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:i,15:r,17:a,19:s,20:o,21:17,22:18,23:c,24:l},e(n,[2,10],{1:[2,1]}),e(n,[2,6]),{12:21,14:i,15:r,17:a,19:s,20:o,21:17,22:18,23:c,24:l},e(n,[2,8]),e(n,[2,9]),e(n,[2,11]),{16:[1,22]},{18:[1,23]},e(n,[2,14]),e(n,[2,15]),e(n,[2,16]),e(n,[2,17]),e(n,[2,18]),e(n,[2,19]),e(n,[2,7]),e(n,[2,12]),e(n,[2,13])],defaultActions:{},parseError:t(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:t(function(e){var n=this,i=[0],r=[],a=[null],s=[],o=this.table,c="",l=0,h=0,d=s.slice.call(arguments,1),p=Object.create(this.lexer),u={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(u.yy[g]=this.yy[g]);p.setInput(e,u.yy),u.yy.lexer=p,u.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var y=p.yylloc;s.push(y);var f=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=r.pop()||p.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t(function(t){i.length=i.length-2*t,a.length=a.length-t,s.length=s.length-t},"popStack"),t(m,"lex");for(var x,b,k,w,_,$,v,S,E={};;){if(b=i[i.length-1],this.defaultActions[b]?k=this.defaultActions[b]:(null==x&&(x=m()),k=o[b]&&o[b][x]),void 0===k||!k.length||!k[0]){var T;for(_ in S=[],o[b])this.terminals_[_]&&_>2&&S.push("'"+this.terminals_[_]+"'");T=p.showPosition?"Parse error on line "+(l+1)+":\n"+p.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(T,{text:p.match,token:this.terminals_[x]||x,line:p.yylineno,loc:y,expected:S})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+x);switch(k[0]){case 1:i.push(x),a.push(p.yytext),s.push(p.yylloc),i.push(k[1]),x=null,h=p.yyleng,c=p.yytext,l=p.yylineno,y=p.yylloc;break;case 2:if($=this.productions_[k[1]][1],E.$=a[a.length-$],E._$={first_line:s[s.length-($||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-($||1)].first_column,last_column:s[s.length-1].last_column},f&&(E._$.range=[s[s.length-($||1)].range[0],s[s.length-1].range[1]]),void 0!==(w=this.performAction.apply(E,[c,h,l,u.yy,k[1],a,s].concat(d))))return w;$&&(i=i.slice(0,-1*$*2),a=a.slice(0,-1*$),s=s.slice(0,-1*$)),i.push(this.productions_[k[1]][0]),a.push(E.$),s.push(E._$),v=o[i[i.length-2]][i[i.length-1]],i.push(v);break;case 3:return!0}}return!0},"parse")},d=function(){return{EOF:1,parseError:t(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:t(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:t(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:t(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:t(function(t){this.unput(this.match.slice(t))},"less"),pastInput:t(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:t(function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;a<r.length;a++)if((n=this._input.match(this.rules[r[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){return this.next()||this.lex()},"lex"),begin:t(function(t){this.conditionStack.push(t)},"begin"),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:t(function(t){this.begin(t)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(t,e,n,i){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 13;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}}}();function p(){this.yy={}}return h.lexer=d,t(p,"Parser"),p.prototype=h,h.Parser=p,new p}();y.parser=y;var f=y,m={};d(m,{addEvent:()=>L,addSection:()=>I,addTask:()=>C,addTaskOrg:()=>N,clear:()=>S,default:()=>D,getCommonDb:()=>v,getDirection:()=>T,getSections:()=>M,getTasks:()=>H,setDirection:()=>E});var x="",b=0,k="LR",w=[],_=[],$=[],v=t(()=>p,"getCommonDb"),S=t(function(){w.length=0,_.length=0,x="",$.length=0,k="LR",u()},"clear"),E=t(function(t){k=t},"setDirection"),T=t(function(){return k},"getDirection"),I=t(function(t){x=t,w.push(t)},"addSection"),M=t(function(){return w},"getSections"),H=t(function(){let t=j(),e=0;for(;!t&&e<100;)t=j(),e++;return _.push(...$),_},"getTasks"),C=t(function(t,e,n){const i={id:b++,section:x,type:x,task:t,score:e||0,events:n?[n]:[]};$.push(i)},"addTask"),L=t(function(t){$.find(t=>t.id===b-1).events.push(t)},"addEvent"),N=t(function(t){const e={section:x,type:x,description:t,task:t,classes:[]};_.push(e)},"addTaskOrg"),j=t(function(){const e=t(function(t){return $[t].processed},"compileTask");let n=!0;for(const[t,i]of $.entries())e(t),n=n&&i.processed;return n},"compileTasks"),D={clear:S,getCommonDb:v,getDirection:T,setDirection:E,addSection:I,getSections:M,getTasks:H,addTask:C,addTaskOrg:N,addEvent:L},O=0,A=t(function(t,e){const n=t.append("rect");return n.attr("x",e.x),n.attr("y",e.y),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("width",e.width),n.attr("height",e.height),n.attr("rx",e.rx),n.attr("ry",e.ry),void 0!==e.class&&n.attr("class",e.class),n},"drawRect"),B=t(function(e,n){const i=e.append("circle").attr("cx",n.cx).attr("cy",n.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),r=e.append("g");function a(t){const e=g().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+n.cx+","+(n.cy+2)+")")}function s(t){const e=g().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+n.cx+","+(n.cy+7)+")")}function o(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",n.cx-5).attr("y1",n.cy+7).attr("x2",n.cx+5).attr("y2",n.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return r.append("circle").attr("cx",n.cx-5).attr("cy",n.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",n.cx+5).attr("cy",n.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),t(a,"smile"),t(s,"sad"),t(o,"ambivalent"),n.score>3?a(r):n.score<3?s(r):o(r),i},"drawFace"),R=t(function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n},"drawCircle"),P=t(function(t,e){const n=e.text.replace(/<br\s*\/?>/gi," "),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.attr("class","legend"),i.style("text-anchor",e.anchor),void 0!==e.class&&i.attr("class",e.class);const r=i.append("tspan");return r.attr("x",e.x+2*e.textMargin),r.text(n),i},"drawText"),W=t(function(e,n){function i(t,e,n,i,r){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+i-r)+" "+(t+n-1.2*r)+","+(e+i)+" "+t+","+(e+i)}t(i,"genPoints");const r=e.append("polygon");r.attr("points",i(n.x,n.y,50,20,7)),r.attr("class","labelBox"),n.y=n.y+n.labelMargin,n.x=n.x+.5*n.labelMargin,P(e,n)},"drawLabel"),F=t(function(t,e,n){const i=t.append("g"),r=U();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=n.width,r.height=n.height,r.class="journey-section section-type-"+e.num,r.rx=3,r.ry=3,A(i,r),Z(n)(e.text,i,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+e.num},n,e.colour)},"drawSection"),z=-1,V=t(function(t,e,n,i){const r=e.x+n.width/2,a=t.append("g");z++,a.append("line").attr("id",i+"-task"+z).attr("x1",r).attr("y1",e.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),B(a,{cx:r,cy:300+30*(5-e.score),score:e.score});const s=U();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=n.width,s.height=n.height,s.class="task task-type-"+e.num,s.rx=3,s.ry=3,A(a,s),Z(n)(e.task,a,s.x,s.y,s.width,s.height,{class:"task"},n,e.colour)},"drawTask"),G=t(function(t,e){A(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),q=t(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),U=t(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Z=function(){function e(t,e,n,i,a,s,o,c){r(e.append("text").attr("x",n+a/2).attr("y",i+s/2+5).style("font-color",c).style("text-anchor","middle").text(t),o)}function n(t,e,n,i,a,s,o,c,l){const{taskFontSize:h,taskFontFamily:d}=c,p=t.split(/<br\s*\/?>/gi);for(let u=0;u<p.length;u++){const t=u*h-h*(p.length-1)/2,c=e.append("text").attr("x",n+a/2).attr("y",i).attr("fill",l).style("text-anchor","middle").style("font-size",h).style("font-family",d);c.append("tspan").attr("x",n+a/2).attr("dy",t).text(p[u]),c.attr("y",i+s/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(c,o)}}function i(t,e,i,a,s,o,c,l){const h=e.append("switch"),d=h.append("foreignObject").attr("x",i).attr("y",a).attr("width",s).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),n(t,h,i,a,s,o,c,l),r(d,c)}function r(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return t(e,"byText"),t(n,"byTspan"),t(i,"byFo"),t(r,"_setTextAttrs"),function(t){return"fo"===t.textPlacement?i:"old"===t.textPlacement?e:n}}(),Y=t(function(t,e){O=0,z=-1,t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function J(t,e){t.each(function(){var t,n=h(this),i=n.text().split(/(\s+|<br>)/).reverse(),r=[],a=n.attr("y"),s=parseFloat(n.attr("dy")),o=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",s+"em");for(let c=0;c<i.length;c++)t=i[i.length-1-c],r.push(t),o.text(r.join(" ").trim()),(o.node().getComputedTextLength()>e||"<br>"===t)&&(r.pop(),o.text(r.join(" ").trim()),r="<br>"===t?[""]:[t],o=n.append("tspan").attr("x",0).attr("y",a).attr("dy","1.1em").text(t))})}t(J,"wrap");var Q=t(function(t,e,n,i,r,a=!1){const{theme:s,look:o}=i,c=s?.includes("redux"),l=n%(i?.themeVariables?.THEME_COLOR_LIMIT??12)-1,d=t.append("g");e.section=l,d.attr("class",(e.class?e.class+" ":"")+"timeline-node section-"+l);const p=d.append("g"),u=d.append("g"),g=u.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(J,e.width).node().getBBox(),y=i.fontSize?.replace?i.fontSize.replace("px",""):i.fontSize;if(e.height=g.height+1.1*y*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,u.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),c&&u.attr("transform",`translate(${e.width/2}, ${a?e.padding/2+3:e.padding})`),K(p,e,l,r,i),"neo"===o&&(d.attr("data-look","neo"),c)){const e=s.includes("dark"),n=t.node()?.ownerSVGElement??t.node(),i=h(n),r=i.attr("id")??"",a=r?`${r}-drop-shadow`:"drop-shadow";if(i.select(`#${a}`).empty()){const t=i.select("defs");(t.empty()?i.append("defs"):t).append("filter").attr("id",a).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",e?"0.2":"0.06").attr("flood-color",e?"#FFFFFF":"#000000")}}return e},"drawNode"),X=t(function(t,e,n){const i=t.append("g"),r=i.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(J,e.width).node().getBBox(),a=n.fontSize?.replace?n.fontSize.replace("px",""):n.fontSize;return i.remove(),r.height+1.1*a*.5+e.padding},"getVirtualNodeHeight"),K=t(function(t,e,n,i,r){const{theme:a}=r,s=a?.includes("redux")?0:5,o=s>0?`M0 ${e.height-5} v${10-e.height} q0,-${s},${s},-${s} h${e.width-10} q${s},0,${s},${s} v${e.height-5} H0 Z`:`M0 ${e.height-5} v${-(e.height-5)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",i+"-node-"+O++).attr("class","node-bkg node-"+e.type).attr("d",o),a?.includes("redux")||t.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),tt={drawRect:A,drawCircle:R,drawSection:F,drawText:P,drawLabel:W,drawTask:V,drawBackgroundRect:G,getTextObj:q,getNoteRect:U,initGraphics:Y,drawNode:Q,getVirtualNodeHeight:X},et=t(function(t,e,n,i){const r=a(),{look:o,theme:c,themeVariables:d}=r,{useGradient:p,gradientStart:u,gradientStop:g}=d,y=r.timeline?.leftMargin??50;s.debug("timeline",i.db);const f=r.securityLevel;let m;"sandbox"===f&&(m=h("#i"+e));const x=h("sandbox"===f?m.nodes()[0].contentDocument.body:"body").select("#"+e);x.append("g");const b=i.db.getTasks(),k=i.db.getCommonDb().getDiagramTitle();s.debug("task",b),tt.initGraphics(x,e);const w=i.db.getSections();s.debug("sections",w);let _=0,$=0,v=0,S=0,E=50+y,T=50;S=50;let I=0,M=!0;w.forEach(function(t){const e={number:I,descr:t,section:I,width:150,padding:20,maxHeight:_},n=tt.getVirtualNodeHeight(x,e,r);s.debug("sectionHeight before draw",n),_=Math.max(_,n+20)});let H=0,C=0;s.debug("tasks.length",b.length);for(const[a,l]of b.entries()){const t={number:a,descr:l,section:l.section,width:150,padding:20,maxHeight:$},e=tt.getVirtualNodeHeight(x,t,r);s.debug("taskHeight before draw",e),$=Math.max($,e+20),H=Math.max(H,l.events.length);let n=0;for(const i of l.events){const t={descr:i,section:l.section,number:l.section,width:150,padding:20,maxHeight:50};n+=tt.getVirtualNodeHeight(x,t,r)}l.events.length>0&&(n+=10*(l.events.length-1)),C=Math.max(C,n)}s.debug("maxSectionHeight before draw",_),s.debug("maxTaskHeight before draw",$),w&&w.length>0?w.forEach(t=>{const n=b.filter(e=>e.section===t),i={number:I,descr:t,section:I,width:200*Math.max(n.length,1)-50,padding:20,maxHeight:_};s.debug("sectionNode",i);const a=x.append("g"),o=tt.drawNode(a,i,I,r,e);s.debug("sectionNode output",o),a.attr("transform",`translate(${E}, 50)`),T+=_+50,n.length>0&&nt(x,n,I,E,T,$,r,H,C,_,!1,e),E+=200*Math.max(n.length,1),T=50,I++}):(M=!1,nt(x,b,I,E,T,$,r,H,C,_,!0,e));const L=x.node().getBBox();if(s.debug("bounds",L),k&&x.append("text").text(k).attr("x","neo"===o?2*L.x+y:L.width/2-y).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),v=M?_+$+150:$+100,x.append("g").attr("class","lineWrapper").append("line").attr("x1",y).attr("y1",v).attr("x2",L.width+3*y).attr("y2",v).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),"neo"===o&&p&&"neutral"!==c){const t=x.select("defs"),e=(t.empty()?x.append("defs"):t).append("linearGradient").attr("id",x.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");e.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),e.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}l(void 0,x,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),nt=t(function(t,e,n,i,r,a,o,c,l,h,d,p){for(const u of e){const e={descr:u.task,section:n,number:n,width:150,padding:20,maxHeight:a};s.debug("taskNode",e);const c=t.append("g").attr("class","taskWrapper"),h=tt.drawNode(c,e,n,o,p).height;if(s.debug("taskHeight after draw",h),c.attr("transform",`translate(${i}, ${r})`),a=Math.max(a,h),u.events){const e=t.append("g").attr("class","lineWrapper");let s=a;r+=100,s+=it(t,u.events,n,i,r,o,p),r-=100,e.append("line").attr("x1",i+95).attr("y1",r+a).attr("x2",i+95).attr("y2",r+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${p}-arrowhead)`).attr("stroke-dasharray","5,5")}i+=200,d&&!o.timeline?.disableMulticolor&&n++}r-=10},"drawTasks"),it=t(function(t,e,n,i,r,a,o){let c=0;const l=r;r+=100;for(const h of e){const e={descr:h,section:n,number:n,width:150,padding:20,maxHeight:50};s.debug("eventNode",e);const l=t.append("g").attr("class","eventWrapper"),d=tt.drawNode(l,e,n,a,o,!0).height;c+=d,l.attr("transform",`translate(${i}, ${r})`),r=r+10+d}return r=l,c},"drawEvents"),rt={setConf:t(()=>{},"setConf"),draw:et},at=t(function(t,e,n,i){const r=a(),h=r.timeline?.leftMargin??50;s.debug("timeline",i.db);const d=o(e);d.append("g");const p=i.db.getTasks(),u=i.db.getCommonDb().getDiagramTitle();s.debug("task",p),tt.initGraphics(d);const g=i.db.getSections();s.debug("sections",g);let y=0,f=0;const m=50+h;let x=50;const b=x,k=m+230;let w=0;const _=g&&g.length>0,$=_?k:m+230,v=Math.max(50,580);g.forEach(function(t){const e={number:w,descr:t,section:w,width:v,padding:5,maxHeight:y},n=tt.getVirtualNodeHeight(d,e,r);s.debug("sectionHeight before draw",n),y=Math.max(y,n)});let S=0;s.debug("tasks.length",p.length);for(const[a,o]of p.entries()){const t={number:a,descr:o,section:o.section,width:200,padding:5,maxHeight:f},e=tt.getVirtualNodeHeight(d,t,r);s.debug("taskHeight before draw",e),f=Math.max(f,e);let n=0;for(const i of o.events){const t={descr:i,section:o.section,number:o.section,width:300,padding:5,maxHeight:50};n+=tt.getVirtualNodeHeight(d,t,r)}o.events.length>0&&(n+=10*(o.events.length-1)),S=Math.max(S,n)+0}s.debug("maxSectionHeight before draw",y),s.debug("maxTaskHeight before draw",f);const E=Math.max(f,S)+30;_?g.forEach(t=>{const e=p.filter(e=>e.section===t),n={number:w,descr:t,section:w,width:v,padding:5,maxHeight:y};s.debug("sectionNode",n);const i=d.append("g"),a=tt.drawNode(i,n,w,r);s.debug("sectionNode output",a);const o=$-230;i.attr("transform",`translate(${o}, ${x})`);const c=x+a.height+20;e.length>0&&st(d,e,w,$,c,f,r,E,!1);const l=e.length,h=a.height+20+E*Math.max(l,1)-(l>0?60:0);x+=h,w++}):st(d,p,w,$,x,f,r,E,!0);let T=d.node()?.getBBox();if(!T)throw new Error("bbox not found");if(s.debug("bounds",T),u){if(d.append("text").text(u).attr("x",T.width/2-h).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),T=d.node()?.getBBox(),!T)throw new Error("bbox not found");s.debug("bounds after title",T)}const[I]=c(r.fontSize),M=2*(I??16),H=.5*(I??16)+20,C=d.append("g").attr("class","lineWrapper");C.append("line").attr("x1",$).attr("y1",b-M).attr("x2",$).attr("y2",T.y+T.height+H).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),C.lower(),l(void 0,d,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),st=t(function(t,e,n,i,r,a,o,c,l){for(const h of e){const e={descr:h.task,section:n,number:n,width:200,padding:5,maxHeight:a};s.debug("taskNode",e);const d=t.append("g").attr("class","taskWrapper"),p=tt.drawNode(d,e,n,o),u=p.height;s.debug("taskHeight after draw",u);const g=i-20-p.width;if(d.attr("transform",`translate(${g}, ${r})`),a=Math.max(a,u),h.events&&h.events.length>0){const e=r,a=i+50;ot(t,h.events,n,i,a,e,o)}r+=c,l&&!o.timeline?.disableMulticolor&&n++}},"drawTasks"),ot=t(function(t,e,n,i,r,a,o){let c=a;for(const l of e){const e={descr:l,section:n,number:n,width:300,padding:5,maxHeight:0};s.debug("eventNode",e);const a=t.append("g").attr("class","eventWrapper"),h=tt.drawNode(a,e,n,o).height;a.attr("transform",`translate(${r}, ${c})`);const d=c+h/2;t.append("g").attr("class","lineWrapper").append("line").attr("x1",i).attr("y1",d).attr("x2",r).attr("y2",d).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),c=c+h+10}return c-a},"drawEvents"),ct={setConf:t(()=>{},"setConf"),draw:at},lt=t(t=>{const{theme:n}=e(),i=n?.includes("dark"),r=n?.includes("color"),a=t.svgId?.replace(/^#/,"")??"",s=a?`url(#${a}-drop-shadow)`:t.dropShadow??"none";let o="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++){const n=""+(17-3*e),a=r?t.borderColorArray[e]:t.mainBkg,c=r?t.borderColorArray[e]:t.nodeBorder;o+=`\n .section-${e-1} rect,\n .section-${e-1} path,\n .section-${e-1} circle {\n fill: ${i&&r?t.mainBkg:a};\n stroke: ${c};\n stroke-width: ${t.strokeWidth};\n filter: ${s};\n }\n\n .section-${e-1} text {\n fill: ${t.nodeBorder};\n font-weight: ${t.fontWeight}\n }\n\n .node-icon-${e-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+e]};\n }\n\n .section-edge-${e-1} {\n stroke: ${t["cScale"+e]};\n }\n\n .edge-depth-${e-1} {\n stroke-width: ${n};\n }\n\n .section-${e-1} line {\n stroke: ${t["cScaleInv"+e]};\n stroke-width: 3;\n }\n\n .lineWrapper line {\n stroke: ${t.nodeBorder};\n stroke-width:${t.strokeWidth}\n }\n\n .disabled,\n .disabled circle,\n .disabled text {\n fill: ${t.tertiaryColor??"lightgray"};\n }\n\n .disabled text {\n fill: ${t.clusterBorder??"#efefef"};\n }\n `}return o},"genReduxSections"),ht=t(t=>{let e="";for(let a=0;a<t.THEME_COLOR_LIMIT;a++)t["lineColor"+a]=t["lineColor"+a]||t["cScaleInv"+a],n(t["lineColor"+a])?t["lineColor"+a]=i(t["lineColor"+a],20):t["lineColor"+a]=r(t["lineColor"+a],20);for(let n=0;n<t.THEME_COLOR_LIMIT;n++){const i=""+(17-3*n);e+=`\n .section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} path {\n fill: ${t["cScale"+n]};\n }\n .section-${n-1} text {\n fill: ${t["cScaleLabel"+n]};\n }\n .node-icon-${n-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+n]};\n }\n .section-edge-${n-1}{\n stroke: ${t["cScale"+n]};\n }\n .edge-depth-${n-1}{\n stroke-width: ${i};\n }\n .section-${n-1} line {\n stroke: ${t["cScaleInv"+n]} ;\n stroke-width: 3;\n }\n\n .lineWrapper line{\n stroke: ${t["cScaleLabel"+n]} ;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: ${t.tertiaryColor??"lightgray"};\n }\n .disabled text {\n fill: ${t.clusterBorder??"#efefef"};\n }\n `}return e},"genSections"),dt=t(t=>{const{theme:n}=e(),i=n?.includes("redux"),r="neutral"===n,a=t.svgId?.replace(/^#/,"")??"";let s="";if(t.useGradient&&a&&t.THEME_COLOR_LIMIT&&!r)for(let e=0;e<t.THEME_COLOR_LIMIT;e++)s+=`\n .section-${e-1}[data-look="neo"] rect,\n .section-${e-1}[data-look="neo"] path,\n .section-${e-1}[data-look="neo"] circle {\n fill: ${t.mainBkg};\n stroke: url(#${a}-gradient);\n stroke-width: 2;\n }\n .section-${e-1}[data-look="neo"] line {\n stroke: url(#${a}-gradient);\n stroke-width: 2;\n }`;return`\n .edge {\n stroke-width: 3;\n }\n ${i?lt(t):ht(t)}\n ${s}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`},"getStyles"),pt={db:m,renderer:{setConf:t(()=>{},"setConf"),draw:t((t,e,n,i)=>"TD"===(i?.db?.getDirection?.()??"LR")?ct.draw(t,e,n,i):rt.draw(t,e,n,i),"draw")},parser:f,styles:dt};export{pt as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e,r as t,j as n,u as a,f as s}from"./index-kcB9N5v8.js";import{a6 as o,a5 as r,a8 as l,f as i,a9 as c,aa as d,ab as u,X as m,_ as p,P as h,h as f,q as g,ac as x,ad as b,ae as v,af as j}from"./App-Bx92ZYqP.js";import{u as y,C as k,a as C,S as w}from"./ComposerMenus-7XnPTSod.js";import{C as $,G as M}from"./composerOptions-0DZvXA1-.js";import{Z as S,S as N}from"./zap-D3JafXHq.js";const E=e("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),D=e("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);function F(e,n,a,s,o,r,l){const i=JSON.stringify([n,a,s,o]),[c,d]=t.useState(null);if(t.useEffect(()=>{if("codex"!==n||!e)return;let t,o=!1,r=0,l=0,c=!1,u=!1;const m=()=>{o||u||c||void 0!==t||l>=5||(t=setTimeout(g,1e3*2**Math.max(0,l-1)))},p=t=>{u=Boolean(t?.defaultModel),d({client:e,key:i,state:t,loading:!u&&l<5})};d({client:e,key:i,state:null,loading:!0});const h=e.onMessage(e=>{o||"session.model"!==e.type||e.sessionId!==s||(r++,clearTimeout(t),t=void 0,p(e),m())}),f=e.onClose(()=>{o=!0,clearTimeout(t),d({client:e,key:i,state:null,loading:!1})});async function g(){if(t=void 0,o||!e)return;c=!0,l++;const n=r;try{const t=await e.request({action:"model.status",id:e.makeId("model-status"),...s?{sessionId:s}:{cwd:a}},{timeoutMs:15e3});o||r!==n||p(t)}catch{o||r!==n||p(null)}finally{c=!1,m()}}return t=setTimeout(g,200),()=>{o=!0,clearTimeout(t),h(),f()}},[e,n,a,s,o,i]),"codex"!==n)return r;const u=c&&c.client===e&&c.key===i?c:null,m={value:"",label:`CLI · ${u?.state?.defaultModel||(!e||u&&!u.loading?l.unknown:l.remoteModelChecking)}`,desc:"config"===u?.state?.defaultSource?l.remoteModelConfig:"recommended"===u?.state?.defaultSource?l.remoteModelRecommended:l.unknown};return r.some(e=>""===e.value)?r.map(e=>""===e.value?{...e,...m}:e):[m,...r]}function I(e,t,n=o()){return!t.altKey&&(t.metaKey||t.ctrlKey?r(t,n):"enter"===e?!t.shiftKey:"shiftEnter"===e&&t.shiftKey)}function R({attachments:e,uploadBusy:t,onRemove:a,onOpen:s,t:o}){if(!e.length&&!t)return null;const r=e.filter(e=>e.type.startsWith("image/")||l(e.path)||l(e.name)),p=()=>r.map(e=>({src:e.path,alt:e.name||i(e.path)}));return n.jsxs("div",{className:"attachment-row composer-attachments",children:[e.length>0&&n.jsx("div",{className:"composer-attachment-images",children:e.map(e=>{const t=e.name||i(e.path),l=r.includes(e);return n.jsxs("div",{className:"composer-attachment-card "+(l?"composer-image-card":"composer-file-card"),children:[l?n.jsx(c,{src:e.path,alt:t,onOpen:s,gallery:p}):n.jsxs("button",{className:"composer-file-preview",type:"button",title:`${t} · ${d(e.size)}`,"aria-label":`${o.preview}: ${t}`,onClick:()=>s(e.path),children:[n.jsx(u,{"aria-hidden":"true"}),n.jsx("span",{children:t}),n.jsx("small",{children:d(e.size)})]}),n.jsx("button",{className:"composer-image-remove",type:"button",title:`${o.removeAttachment}: ${t}`,"aria-label":`${o.removeAttachment}: ${t}`,onClick:()=>a(e.path),children:n.jsx(m,{"aria-hidden":"true"})})]},e.path)})}),t&&n.jsxs("span",{className:"attachment-empty",role:"status",children:[n.jsx("span",{className:"loading-spinner small","aria-hidden":"true"}),o.uploading]})]})}function A({shortcut:e,onChange:t,action:a,t:s}){const o="New session"!==s.newSession,r="傳送快捷鍵"===s.sendShortcut,l="enter"===e?"Enter":"shiftEnter"===e?"Shift+Enter":p("mod+enter"),i="enter"===e?"shiftEnter":"enter",c="enter"===i?"Enter":"Shift+Enter",d="create"===a?o?"建立":"create":o?s.send:"send",u="create"===a&&o&&!r?"创建":d,m="enter"===e?"Shift+Enter":"Enter",h=o?`${l} ${u};${m} ${r?"換行":"换行"}。${r?"點擊切換為":"点击切换为"} ${c} ${u}`:`${l} to ${d}; ${m} for a newline. Click to switch to ${c} to ${d}`;return n.jsxs("button",{type:"button",className:"submit-shortcut-toggle","data-shortcut":e,"aria-label":h,"aria-pressed":"enter"!==e,onMouseDown:e=>e.preventDefault(),onClick:()=>t(i),children:[n.jsx(E,{"aria-hidden":"true"}),n.jsx("span",{className:"submit-shortcut-tooltip","aria-hidden":"true",children:h})]})}function L({leading:e,controls:t,submit:a}){return n.jsxs("div",{className:"composer-toolbar",children:[n.jsxs("div",{className:"composer-scroll-controls",children:[n.jsx("div",{className:"composer-leading-controls",children:e}),n.jsx("div",{className:"composer-control-strip",children:t})]}),a]})}function K({label:e,disabled:t,onClick:a}){return n.jsx("button",{type:"button",className:"icon-button",title:e,"aria-label":e,disabled:t,onClick:a,children:n.jsx(h,{"aria-hidden":"true"})})}function O({children:e,...t}){return n.jsx("button",{...t,className:"send-button submit-action-button",children:e})}function q({value:e,textareaRef:a,onValueChange:s,onKeyDown:o,autoFocus:r,disabled:l,...i}){const c=t.useRef(!1),d=t.useRef(!1);t.useEffect(()=>{if(!r||l||d.current)return;let e=requestAnimationFrame(()=>{e=requestAnimationFrame(()=>{const e=a.current;if(!e)return;d.current=!0;const t=document.activeElement;t&&t!==document.body&&t!==e||(e.focus({preventScroll:!0}),e.setSelectionRange(e.value.length,e.value.length),d.current=!0)})});return()=>cancelAnimationFrame(e)},[r,l,a]);const u=t.useMemo(()=>function(e){let t=0;for(let n=0;n<e.length;n++){const a=e.charCodeAt(n);if(t=a>32&&a<127?t+1:0,t>=4096)return"off"}return"soft"}(e),[e]);return t.useLayoutEffect(()=>{const t=a.current;t&&!c.current&&t.value!==e&&(t.value=e)},[e,a]),n.jsx("textarea",{...i,ref:a,disabled:l,wrap:c.current?a.current?.wrap:u,onCompositionStart:()=>{c.current=!0},onCompositionEnd:e=>{c.current=!1,s(e.currentTarget.value)},onChange:e=>s(e.currentTarget.value),onKeyDown:e=>{c.current||e.nativeEvent.isComposing||229===e.nativeEvent.keyCode||o?.(e)}})}function T({label:e,triggerContent:o,className:r="",align:l="right",children:i}){const[c,d]=t.useState(!1),u=t.useRef(null),m=t.useId(),p=()=>{d(!1),u.current?.focus()},h=a(p,void 0,c),f=y(c,u,h,l);return t.useEffect(()=>{if(!c)return;const e=e=>{e.target instanceof Node&&!h.current?.contains(e.target)&&!u.current?.contains(e.target)&&d(!1)},t=e=>{e.target instanceof Node&&!h.current?.contains(e.target)&&!u.current?.contains(e.target)&&d(!1)};return document.addEventListener("pointerdown",e),document.addEventListener("focusin",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("focusin",t)}},[c]),n.jsxs("div",{className:`composer-menu ${r}`,onKeyDown:e=>{"Escape"!==e.key||e.defaultPrevented||(e.preventDefault(),e.stopPropagation(),p())},children:[n.jsx("button",{ref:u,type:"button",className:"composer-option-button",title:e,"aria-label":e,"aria-haspopup":"dialog","aria-expanded":c,"aria-controls":c?m:void 0,onClick:()=>d(!c),children:o}),c&&s.createPortal(n.jsx("div",{ref:h,id:m,role:"dialog","aria-label":e,className:"composer-settings-popover",style:f,children:i(p)}),document.body)]})}function P(e){const{t}=e;return e.modelOnly?n.jsx(k,{icon:$,label:e.modelLabel,menuLabel:t.model,options:e.modelOptions,value:e.model,onSelect:e.onModelChange,blendBackground:!0}):n.jsxs(n.Fragment,{children:[!e.hideFastMode&&e.fastMode&&n.jsxs("span",{className:"composer-fast-indicator",role:"status","aria-label":t.fastMode,title:t.fastMode,children:[n.jsx(S,{"aria-hidden":"true"}),n.jsx("span",{children:t.fast})]}),n.jsx(T,{label:`${t.model} / ${t.effort}`,className:"composer-model-trigger",triggerContent:n.jsxs(n.Fragment,{children:[n.jsxs("span",{children:[e.modelLabel," · ",e.effort?e.effortLabel:t.defaultOption]}),n.jsx(f,{"aria-hidden":"true"})]}),children:()=>n.jsxs("div",{className:"composer-model-settings",children:[n.jsx("strong",{children:t.model}),n.jsx(k,{icon:$,label:e.modelLabel,menuLabel:t.model,tooltipHoverDelay:1500,options:e.modelOptions,value:e.model,onSelect:e.onModelChange,search:{label:t.searchModels,empty:t.searchResultCount(0)},wide:!0}),n.jsx("strong",{children:t.effort}),n.jsx("div",{className:"composer-effort-options",role:"group","aria-label":t.effort,children:e.effortOptions.map(a=>n.jsx("button",{type:"button",disabled:a.disabled,"aria-pressed":e.effort===a.value,title:a.description??a.label,onClick:()=>e.onEffortChange(a.value),children:a.value?a.label:t.defaultOption},a.value))}),!e.hideFastMode&&n.jsxs("button",{type:"button",role:"switch","aria-checked":e.fastMode,"aria-label":t.fastMode,className:"composer-fast-switch",onClick:()=>e.onFastModeChange(!e.fastMode),children:[n.jsx(M,{"aria-hidden":"true"}),n.jsxs("span",{children:[n.jsx("strong",{children:t.fastMode}),n.jsx("small",{children:t.preferFasterResponses})]}),n.jsx("span",{className:"composer-switch-track","aria-hidden":"true",children:n.jsx("span",{})})]})]})})]})}function z(e){const{t}=e,a="fullAccess"===e.approvalMode||!e.antigravity&&"autoApprove"===e.approvalMode,s=e.usage?.contextUsedTokens,o=e.usage?.contextWindowTokens,r=void 0!==s&&o&&o>0?{percentage:`${Math.min(100,s/o*100).toFixed(1)}%`,tokens:`${s.toLocaleString()} / ${o.toLocaleString()}`}:void 0;return n.jsxs("div",{className:"composer-toolbar desktop-composer-toolbar",children:[n.jsx(U,{...e}),n.jsx("div",{className:"composer-permission "+(a?"full-access":""),children:n.jsx(k,{portal:!0,icon:N,label:e.approvalLabel,menuLabel:t.approvalMode,options:e.approvalOptions,value:e.approvalMode,onSelect:e.onApprovalModeChange,wide:!0,blendBackground:!0})}),n.jsx("div",{className:"composer-toolbar-spacer"}),n.jsx(P,{...e}),(r||e.quota?.limits)&&n.jsx(T,{label:t.contextUsage,triggerContent:n.jsxs(n.Fragment,{children:[n.jsx(M,{"aria-hidden":"true"})," ",r?.percentage]}),children:()=>n.jsxs("div",{className:"composer-model-settings quota-details-panel",children:[r&&n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:t.contextUsage}),n.jsx("span",{children:r.tokens})]}),e.quota?.limits&&n.jsx(x,{agent:"antigravity",limits:{antigravity:e.quota},failed:{},connected:!e.toolsDisabled,t})]})}),e.voice,e.submit]})}function U(e){const{t}=e,a=[{label:t.uploadFiles,icon:u,action:e.onUpload,disabled:e.toolsDisabled},{label:t.skills,icon:S,action:e.onSkills,shortcut:"$",disabled:e.toolsDisabled},{label:t.commands,icon:g,action:e.onCommands,shortcut:"/",disabled:e.toolsDisabled},...e.quickRepliesAvailable?[{label:e.quickRepliesOpen?t.hideQuickReplies:t.showQuickReplies,icon:D,action:e.onQuickReplies,disabled:!1}]:[]];return n.jsx(T,{align:"left",label:`${t.uploadFiles} / ${t.skills} / ${t.commands}`,className:"composer-tools-trigger",triggerContent:n.jsx(h,{"aria-hidden":"true"}),children:e=>n.jsx("div",{className:"composer-tools-list",children:a.map(({label:t,icon:a,action:s,shortcut:o,disabled:r})=>n.jsxs("button",{type:"button",disabled:r,onClick:()=>{e(),s?.()},children:[n.jsx(a,{"aria-hidden":"true"}),n.jsx("span",{children:t}),o&&n.jsx("kbd",{children:o})]},t))})})}function B({draft:e,onChange:a,textareaRef:s,agent:o,skills:r,onRefreshSkills:l,t:i}){const[c,d]=t.useState(null),[u,m]=t.useState(""),[p,h]=t.useState(null),f=c?.draft===e?c.start:e.length,g=c?.draft===e&&c.start!==c.end?null:function(e,t){const n=/([$/])([A-Za-z0-9._:-]*)$/.exec(e.slice(0,t));return n&&n.index>0&&!/\s/.test(e[n.index-1])?null:n?{symbol:n[1],keyword:n[2],start:n.index,end:t}:null}(e,f),x=g?`${e}:${f}`:"",y=!!g&&u!==x,k=y&&"/"===g.symbol,$=y&&"$"===g.symbol,M=b(v(o),g?.keyword??"",8),S=j(r,g?.keyword??"",8),N=(e,t)=>{a(e),d({draft:e,start:t,end:t}),requestAnimationFrame(()=>{const e=s.current;e&&(e.focus(),e.setSelectionRange(t,t))})},E=()=>{m(x),p&&e===p.after&&N(p.before,p.caret),h(null),s.current?.focus()},D=t=>{if("$"===t&&l(),y&&g?.symbol===t)return E();if(m(""),g?.symbol===t)return s.current?.focus();const n=f>0&&!/\s/.test(e[f-1])?" ":"",a=e.slice(0,f)+n+t+e.slice(f);h({before:e,after:a,caret:f}),N(a,f+n.length+1)},F=t=>{if(!g)return;const n=`${g.symbol}${t} `,a=e.slice(0,g.start)+n+e.slice(g.end);h(null),N(a,g.start+n.length)},I=function({context:e,count:n,onSelect:a,onClose:s}){const o=t.useId(),[r,l]=t.useState({context:"",index:0}),i=r.context===e?Math.min(r.index,Math.max(0,n-1)):0,c=t=>l({context:e,index:t});return{listId:o,selectedIndex:i,selectIndex:c,handleKeyDown:t=>!(!e||t.nativeEvent.isComposing||229===t.nativeEvent.keyCode||t.metaKey||t.ctrlKey||t.altKey||t.shiftKey||("Escape"===t.key?(t.preventDefault(),t.stopPropagation(),s(),0):!n||("ArrowDown"===t.key||"ArrowUp"===t.key?(t.preventDefault(),t.stopPropagation(),c((i+("ArrowDown"===t.key?1:-1)+n)%n),0):"Enter"!==t.key&&"Tab"!==t.key||(t.preventDefault(),t.stopPropagation(),a(i),0))))}}({context:y?`${x}:${o}`:"",count:k?M.length:$?S.length:0,onSelect:e=>F(k?M[e].name:S[e].name),onClose:E}),R={listId:I.listId,selectedIndex:I.selectedIndex,onHighlight:I.selectIndex,onClose:E,t:i};return{showCommandSuggestions:k,showSkillSuggestions:$,handleOpenCommands:()=>D("/"),handleOpenSkills:()=>D("$"),handleKeyDown:I.handleKeyDown,textareaProps:{onSelect:()=>{const e=s.current;e&&d({draft:e.value,start:e.selectionStart,end:e.selectionEnd})},"aria-controls":y?I.listId:void 0,"aria-activedescendant":y&&(k?M.length:S.length)?`${I.listId}-${I.selectedIndex}`:void 0,"aria-autocomplete":"list"},popovers:n.jsxs(n.Fragment,{children:[n.jsx(C,{...R,visible:k,commands:M,onSelect:e=>F(e.name)}),n.jsx(w,{...R,visible:$,skills:S,onSelect:e=>F(e.name)})]})}}export{q as C,z as D,A as S,R as a,L as b,U as c,P as d,F as e,O as f,K as g,D as h,I as s,B as u};
|
package/dist/web/assets/{vennDiagram-L72KCM5P-Bxsjs1td.js → vennDiagram-L72KCM5P-BjSt5IQl.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b3 as t,_ as e,s as n,g as s,p as i,o as r,a as o,b as a,z as l,F as c,d as h,ak as u,a9 as f,aa as d,ab as y,e as g,q as p,B as x,D as m}from"./mermaid.core-LEKKQwXZ.js";import"./RemoteLifeOSBlock-CZkQLmE5.js";import"./index-c9Eb0rEZ.js";import"./purify.es-BNLkGfTg.js";import"./marked.esm-BBjA1da9.js";import"./index-S4bzeLfy.js";import"./index-8TM1eFHE.js";import"./file-editor-CodeHighlight-aQ9kP3Wv.js";import"./App-gwVbOIB1.js";import"./square-K9kFBDil.js";import"./chevron-up-DfL2d5fV.js";import"./__vite-browser-external-2447137e-Dbwxx6PZ.js";const b=(e,n)=>t(e,"a",-n);function v(t,e){const n=function(t){const e=[];for(let n=0;n<t.length;++n)for(let s=n+1;s<t.length;++s){const i=w(t[n],t[s]);for(const t of i)t.parentIndex=[n,s],e.push(t)}return e}(t),s=n.filter(e=>function(t,e){return e.every(e=>M(t,e)<e.radius+1e-10)}(e,t));let i=0,r=0;const o=[];if(s.length>1){const e=_(s);for(let t=0;t<s.length;++t){const n=s[t];n.angle=Math.atan2(n.x-e.x,n.y-e.y)}s.sort((t,e)=>e.angle-t.angle);let n=s[s.length-1];for(let a=0;a<s.length;++a){const e=s[a];r+=(n.x+e.x)*(e.y-n.y);const l={x:(e.x+n.x)/2,y:(e.y+n.y)/2};let c=null;for(let s=0;s<e.parentIndex.length;++s)if(n.parentIndex.includes(e.parentIndex[s])){const i=t[e.parentIndex[s]],r=Math.atan2(e.x-i.x,e.y-i.y),o=Math.atan2(n.x-i.x,n.y-i.y);let a=o-r;a<0&&(a+=2*Math.PI);const h=o-a/2;let u=M(l,{x:i.x+i.radius*Math.sin(h),y:i.y+i.radius*Math.cos(h)});u>2*i.radius&&(u=2*i.radius),(null==c||c.width>u)&&(c={circle:i,width:u,p1:e,p2:n,large:u>i.radius,sweep:!0})}null!=c&&(o.push(c),i+=I(c.circle.radius,c.width),n=e)}}else{let e=t[0];for(let s=1;s<t.length;++s)t[s].radius<e.radius&&(e=t[s]);let n=!1;for(let s=0;s<t.length;++s)if(M(t[s],e)>Math.abs(e.radius-t[s].radius)){n=!0;break}n?i=r=0:(i=e.radius*e.radius*Math.PI,o.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-1e-10,y:e.y+e.radius},width:2*e.radius,large:!0,sweep:!0}))}return r/=2,e&&(e.area=i+r,e.arcArea=i,e.polygonArea=r,e.arcs=o,e.innerPoints=s,e.intersectionPoints=n),i+r}function I(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function M(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function k(t,e,n){if(n>=t+e)return 0;if(n<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const s=e-(n*n-t*t+e*e)/(2*n);return I(t,t-(n*n-e*e+t*t)/(2*n))+I(e,s)}function w(t,e){const n=M(t,e),s=t.radius,i=e.radius;if(n>=s+i||n<=Math.abs(s-i))return[];const r=(s*s-i*i+n*n)/(2*n),o=Math.sqrt(s*s-r*r),a=t.x+r*(e.x-t.x)/n,l=t.y+r*(e.y-t.y)/n,c=-(e.y-t.y)*(o/n),h=-(e.x-t.x)*(o/n);return[{x:a+c,y:l-h},{x:a-c,y:l+h}]}function _(t){const e={x:0,y:0};for(const n of t)e.x+=n.x,e.y+=n.y;return e.x/=t.length,e.y/=t.length,e}function S(t){const e=new Array(t);for(let n=0;n<t;++n)e[n]=0;return e}function E(t,e){return S(t).map(()=>S(e))}function T(t,e){let n=0;for(let s=0;s<t.length;++s)n+=t[s]*e[s];return n}function z(t){return Math.sqrt(T(t,t))}function A(t,e,n){for(let s=0;s<e.length;++s)t[s]=e[s]*n}function R(t,e,n,s,i){for(let r=0;r<t.length;++r)t[r]=e*n[r]+s*i[r]}function N(t,e,n){const s=(n=n||{}).maxIterations||200*e.length,i=n.nonZeroDelta||1.05,r=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,a=n.minErrorDelta||1e-5,l=void 0!==n.rho?n.rho:1,c=void 0!==n.chi?n.chi:2,h=void 0!==n.psi?n.psi:-.5,u=void 0!==n.sigma?n.sigma:.5;let f;const d=e.length,y=new Array(d+1);y[0]=e,y[0].fx=t(e),y[0].id=0;for(let I=0;I<d;++I){const n=e.slice();n[I]=n[I]?n[I]*i:r,y[I+1]=n,y[I+1].fx=t(n),y[I+1].id=I+1}function g(t){for(let e=0;e<t.length;e++)y[d][e]=t[e];y[d].fx=t.fx}const p=(t,e)=>t.fx-e.fx,x=e.slice(),m=e.slice(),b=e.slice(),v=e.slice();for(let I=0;I<s;++I){if(y.sort(p),n.history){const t=y.map(t=>{const e=t.slice();return e.fx=t.fx,e.id=t.id,e});t.sort((t,e)=>t.id-e.id),n.history.push({x:y[0].slice(),fx:y[0].fx,simplex:t})}f=0;for(let t=0;t<d;++t)f=Math.max(f,Math.abs(y[0][t]-y[1][t]));if(Math.abs(y[0].fx-y[d].fx)<o&&f<a)break;for(let t=0;t<d;++t){x[t]=0;for(let e=0;e<d;++e)x[t]+=y[e][t];x[t]/=d}const e=y[d];if(R(m,1+l,x,-l,e),m.fx=t(m),m.fx<y[0].fx)R(v,1+c,x,-c,e),v.fx=t(v),v.fx<m.fx?g(v):g(m);else if(m.fx>=y[d-1].fx){let n=!1;if(m.fx>e.fx?(R(b,1+h,x,-h,e),b.fx=t(b),b.fx<e.fx?g(b):n=!0):(R(b,1-h*l,x,h*l,e),b.fx=t(b),b.fx<m.fx?g(b):n=!0),n){if(u>=1)break;for(let e=1;e<y.length;++e)R(y[e],1-u,y[0],u,y[e]),y[e].fx=t(y[e])}}else g(m)}return y.sort(p),{fx:y[0].fx,x:y[0]}}function D(t,e,n,s,i,r,o){const a=n.fx,l=T(n.fxprime,e);let c=a,h=a,u=l,f=0;function d(h,f,d){for(let y=0;y<16;++y)if(i=(h+f)/2,R(s.x,1,n.x,i,e),c=s.fx=t(s.x,s.fxprime),u=T(s.fxprime,e),c>a+r*i*l||c>=d)f=i;else{if(Math.abs(u)<=-o*l)return i;u*(f-h)>=0&&(f=h),h=i,d=c}return 0}i=i||1,r=r||1e-6,o=o||.1;for(let y=0;y<10;++y){if(R(s.x,1,n.x,i,e),c=s.fx=t(s.x,s.fxprime),u=T(s.fxprime,e),c>a+r*i*l||y&&c>=h)return d(f,i,h);if(Math.abs(u)<=-o*l)return i;if(u>=0)return d(i,f,c);h=c,f=i,i*=2}return i}function O(t,e,n){let s={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const r=e.slice();let o,a,l,c=1;l=(n=n||{}).maxIterations||20*e.length,s.fx=t(s.x,s.fxprime),o=s.fxprime.slice(),A(o,s.fxprime,-1);for(let h=0;h<l;++h){if(c=D(t,o,s,i,c),n.history&&n.history.push({x:s.x.slice(),fx:s.fx,fxprime:s.fxprime.slice(),alpha:c}),c){R(r,1,i.fxprime,-1,s.fxprime);const t=T(s.fxprime,s.fxprime);R(o,Math.max(0,T(r,i.fxprime)/t),o,-1,i.fxprime),a=s,s=i,i=a}else A(o,s.fxprime,-1);if(z(s.fxprime)<=1e-5)break}return n.history&&n.history.push({x:s.x.slice(),fx:s.fx,fxprime:s.fxprime.slice(),alpha:c}),s}function j(t,e={}){e.maxIterations=e.maxIterations||500;const n=e.initialLayout||$,s=e.lossFunction||P,i=function(t,e={}){const n=e.distinct,s=t.map(t=>Object.assign({},t));function i(t){return t.join(";")}if(n){const t=new Map;for(const e of s)for(let n=0;n<e.sets.length;n++){const s=String(e.sets[n]);t.set(s,e.size+(t.get(s)||0));for(let i=n+1;i<e.sets.length;i++){const n=String(e.sets[i]),r=`${s};${n}`,o=`${n};${s}`;t.set(r,e.size+(t.get(r)||0)),t.set(o,e.size+(t.get(o)||0))}}for(const e of s)e.sets.length<3&&(e.size=t.get(i(e.sets)))}const r=[],o=new Set;for(const a of s)if(1===a.sets.length)r.push(a.sets[0]);else if(2===a.sets.length){const t=a.sets[0],e=a.sets[1];o.add(i(a.sets)),o.add(i([e,t]))}r.sort((t,e)=>t===e?0:t<e?-1:1);for(let a=0;a<r.length;++a){const t=r[a];for(let e=a+1;e<r.length;++e){const n=r[e];o.has(i([t,n]))||s.push({sets:[t,n],size:0})}}return s}(t,e),r=n(i,e),o=Object.keys(r),a=[];for(const c of o)a.push(r[c].x),a.push(r[c].y);const l=N(t=>{const e={};for(let n=0;n<o.length;++n){const s=o[n];e[s]={x:t[2*n],y:t[2*n+1],radius:r[s].radius}}return s(e,i)},a,e).x;for(let c=0;c<o.length;++c){const t=o[c];r[t].x=l[2*c],r[t].y=l[2*c+1]}return r}const C=1e-10;function F(t,e,n){return Math.min(t,e)*Math.min(t,e)*Math.PI<=n+C?Math.abs(t-e):function(t,e,n,s){const i=(s=s||{}).maxIterations||100,r=s.tolerance||1e-10,o=t(e),a=t(n);let l=n-e;if(o*a>0)throw"Initial bisect points must have opposite signs";if(0===o)return e;if(0===a)return n;for(let c=0;c<i;++c){l/=2;const n=e+l,s=t(n);if(s*o>=0&&(e=n),Math.abs(l)<r||0===s)return n}return e+l}(s=>k(t,e,s)-n,0,t+e)}function $(t,e={}){let n=function(t,e){const n=e&&e.lossFunction?e.lossFunction:P,s={},i={};for(const u of t)if(1===u.sets.length){const t=u.sets[0];s[t]={x:1e10,y:1e10,rowid:s.length,size:u.size,radius:Math.sqrt(u.size/Math.PI)},i[t]=[]}t=t.filter(t=>2===t.sets.length);for(const u of t){let t=null!=u.weight?u.weight:1;const e=u.sets[0],n=u.sets[1];u.size+C>=Math.min(s[e].size,s[n].size)&&(t=0),i[e].push({set:n,size:u.size,weight:t}),i[n].push({set:e,size:u.size,weight:t})}const r=[];function o(t,e){return e.size-t.size}Object.keys(i).forEach(t=>{let e=0;for(let n=0;n<i[t].length;++n)e+=i[t][n].size*i[t][n].weight;r.push({set:t,size:e})}),r.sort(o);const a={};function l(t){return t.set in a}function c(t,e){s[e].x=t.x,s[e].y=t.y,a[e]=!0}c({x:0,y:0},r[0].set);for(let u=1;u<r.length;++u){const e=r[u].set,a=i[e].filter(l),f=s[e];if(a.sort(o),0===a.length)throw"ERROR: missing pairwise overlap information";const d=[];for(var h=0;h<a.length;++h){const t=s[a[h].set],e=F(f.radius,t.radius,a[h].size);d.push({x:t.x+e,y:t.y}),d.push({x:t.x-e,y:t.y}),d.push({y:t.y+e,x:t.x}),d.push({y:t.y-e,x:t.x});for(let n=h+1;n<a.length;++n){const i=s[a[n].set],r=F(f.radius,i.radius,a[n].size),o=w({x:t.x,y:t.y,radius:e},{x:i.x,y:i.y,radius:r});d.push(...o)}}let y=1e50,g=d[0];for(const i of d){s[e].x=i.x,s[e].y=i.y;const r=n(s,t);r<y&&(y=r,g=i)}c(g,e)}return s}(t,e);const s=e.lossFunction||P;if(t.length>=8){const i=function(t,e={}){const n=e.restarts||10,s=[],i={};for(const f of t)1===f.sets.length&&(i[f.sets[0]]=s.length,s.push(f));let{distances:r,constraints:o}=function(t,e,n){const s=E(e.length,e.length),i=E(e.length,e.length);return t.filter(t=>2===t.sets.length).forEach(t=>{const r=n[t.sets[0]],o=n[t.sets[1]],a=F(Math.sqrt(e[r].size/Math.PI),Math.sqrt(e[o].size/Math.PI),t.size);s[r][o]=s[o][r]=a;let l=0;t.size+1e-10>=Math.min(e[r].size,e[o].size)?l=1:t.size<=1e-10&&(l=-1),i[r][o]=i[o][r]=l}),{distances:s,constraints:i}}(t,s,i);const a=z(r.map(z))/r.length;r=r.map(t=>t.map(t=>t/a));const l=(t,e)=>function(t,e,n,s){for(let r=0;r<e.length;++r)e[r]=0;let i=0;for(let r=0;r<n.length;++r){const o=t[2*r],a=t[2*r+1];for(let l=r+1;l<n.length;++l){const c=t[2*l],h=t[2*l+1],u=n[r][l],f=s[r][l],d=(c-o)*(c-o)+(h-a)*(h-a),y=Math.sqrt(d),g=d-u*u;f>0&&y<=u||f<0&&y>=u||(i+=2*g*g,e[2*r]+=4*g*(o-c),e[2*r+1]+=4*g*(a-h),e[2*l]+=4*g*(c-o),e[2*l+1]+=4*g*(h-a))}}return i}(t,e,r,o);let c=null;for(let f=0;f<n;++f){const t=O(l,S(2*r.length).map(Math.random),e);(!c||t.fx<c.fx)&&(c=t)}const h=c.x,u={};for(let f=0;f<s.length;++f){const t=s[f];u[t.sets[0]]={x:h[2*f]*a,y:h[2*f+1]*a,radius:Math.sqrt(t.size/Math.PI)}}if(e.history)for(const f of e.history)A(f.x,a);return u}(t,e);s(i,t)+1e-8<s(n,t)&&(n=i)}return n}function P(t,e){let n=0;for(const s of e){if(1===s.sets.length)continue;let e;if(2===s.sets.length){const n=t[s.sets[0]],i=t[s.sets[1]];e=k(n.radius,i.radius,M(n,i))}else e=v(s.sets.map(e=>t[e]));n+=(null!=s.weight?s.weight:1)*(e-s.size)*(e-s.size)}return n}function L(t,e){let n=0;for(const s of e){if(1===s.sets.length)continue;let e;if(2===s.sets.length){const n=t[s.sets[0]],i=t[s.sets[1]];e=k(n.radius,i.radius,M(n,i))}else e=v(s.sets.map(e=>t[e]));const i=null!=s.weight?s.weight:1,r=Math.log((e+1)/(s.size+1));n+=i*r*r}return n}function q(t,e,n){if(null==n?t.sort((t,e)=>e.radius-t.radius):t.sort(n),t.length>0){const e=t[0].x,n=t[0].y;for(const s of t)s.x-=e,s.y-=n}if(2===t.length&&M(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const n=Math.atan2(t[1].x,t[1].y)-e,s=Math.cos(n),i=Math.sin(n);for(const e of t){const t=e.x,n=e.y;e.x=s*t-i*n,e.y=i*t+s*n}}if(t.length>2){let n=Math.atan2(t[2].x,t[2].y)-e;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){const e=t[1].y/(1e-10+t[1].x);for(const n of t){var s=(n.x+e*n.y)/(1+e*e);n.x=2*s-n.x,n.y=2*s*e-n.y}}}}function B(t){const e=e=>({max:t.reduce((t,n)=>Math.max(t,n[e]+n.radius),Number.NEGATIVE_INFINITY),min:t.reduce((t,n)=>Math.min(t,n[e]-n.radius),Number.POSITIVE_INFINITY)});return{xRange:e("x"),yRange:e("y")}}function U(t,e,n){null==e&&(e=Math.PI/2);let s=V(t).map(t=>Object.assign({},t));const i=function(t){function e(t){return t.parent!==t&&(t.parent=e(t.parent)),t.parent}function n(t,n){const s=e(t),i=e(n);s.parent=i}t.forEach(t=>{t.parent=t});for(let i=0;i<t.length;++i)for(let e=i+1;e<t.length;++e){const s=t[i].radius+t[e].radius;M(t[i],t[e])+1e-10<s&&n(t[e],t[i])}const s=new Map;for(let i=0;i<t.length;++i){const n=e(t[i]).parent.setid;s.has(n)||s.set(n,[]),s.get(n).push(t[i])}return t.forEach(t=>{delete t.parent}),Array.from(s.values())}(s);for(const c of i){q(c,e,n);const t=B(c);c.size=(t.xRange.max-t.xRange.min)*(t.yRange.max-t.yRange.min),c.bounds=t}i.sort((t,e)=>e.size-t.size),s=i[0];let r=s.bounds;const o=(r.xRange.max-r.xRange.min)/50;function a(t,e,n){if(!t)return;const i=t.bounds;let a,l;if(e)a=r.xRange.max-i.xRange.min+o;else{a=r.xRange.max-i.xRange.max;const t=(i.xRange.max-i.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;t<0&&(a+=t)}if(n)l=r.yRange.max-i.yRange.min+o;else{l=r.yRange.max-i.yRange.max;const t=(i.yRange.max-i.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;t<0&&(l+=t)}for(const r of t)r.x+=a,r.y+=l,s.push(r)}let l=1;for(;l<i.length;)a(i[l],!0,!1),a(i[l+1],!1,!0),a(i[l+2],!0,!0),l+=3,r=B(s);return W(s)}function G(t,e,n,s,i){const r=V(t);e-=2*s,n-=2*s;const{xRange:o,yRange:a}=B(r);if(o.max===o.min||a.max===a.min)return console.log("not scaling solution: zero size detected"),t;let l,c;if(i){const t=2*Math.sqrt(i/Math.PI);l=e/t,c=n/t}else l=e/(o.max-o.min),c=n/(a.max-a.min);const h=Math.min(c,l),u=(e-(o.max-o.min)*h)/2,f=(n-(a.max-a.min)*h)/2;return W(r.map(t=>({radius:h*t.radius,x:s+u+(t.x-o.min)*h,y:s+f+(t.y-a.min)*h,setid:t.setid})))}function W(t){const e={};for(const n of t)e[n.setid]=n;return e}function V(t){return Object.keys(t).map(e=>Object.assign(t[e],{setid:e}))}function X(t,e){return function(n){const s=this,i=t[n.sets[0]].radius||50,r=e(n)||"",o=r.split(/\s+/).reverse(),a=(r.length+o.length)/3;let l=o.pop(),c=[l],h=0;s.textContent=null;const u=[];function f(t){const e=s.ownerDocument.createElementNS(s.namespaceURI,"tspan");return e.textContent=t,u.push(e),s.append(e),e}let d=f(l);for(;l=o.pop(),l;){c.push(l);const t=c.join(" ");d.textContent=t,t.length>a&&d.getComputedTextLength()>i&&(c.pop(),d.textContent=c.join(" "),c=[l],d=f(l),h++)}const y=.35-1.1*h/2,g=s.getAttribute("x"),p=s.getAttribute("y");u.forEach((t,e)=>{t.setAttribute("x",g),t.setAttribute("y",p),t.setAttribute("dy",`${y+1.1*e}em`)})}}function K(t,e,n){let s=e[0].radius-M(e[0],t);for(let i=1;i<e.length;++i){const n=e[i].radius-M(e[i],t);n<=s&&(s=n)}for(let i=0;i<n.length;++i){const e=M(n[i],t)-n[i].radius;e<=s&&(s=e)}return s}function Y(t,e,n){const s=[];for(const h of t)s.push({x:h.x,y:h.y}),s.push({x:h.x+h.radius/2,y:h.y}),s.push({x:h.x-h.radius/2,y:h.y}),s.push({x:h.x,y:h.y+h.radius/2}),s.push({x:h.x,y:h.y-h.radius/2});let i=s[0],r=K(s[0],t,e);for(let h=1;h<s.length;++h){const n=K(s[h],t,e);n>=r&&(i=s[h],r=n)}const o=N(n=>-1*K({x:n[0],y:n[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,a={x:n?0:o[0],y:o[1]};let l=!0;for(const h of t)if(M(a,h)>h.radius){l=!1;break}for(const h of e)if(M(a,h)<h.radius){l=!1;break}if(l)return a;if(1==t.length)return{x:t[0].x,y:t[0].y};const c={};return v(t,c),0===c.arcs.length?{x:0,y:-1e3,disjoint:!0}:1==c.arcs.length?{x:c.arcs[0].circle.x,y:c.arcs[0].circle.y}:e.length?Y(t,[]):_(c.arcs.map(t=>t.p1))}function H(t,e,n){const s={},i=function(t){const e={},n=Object.keys(t);for(const s of n)e[s]=[];for(let s=0;s<n.length;s++){const i=n[s],r=t[i];for(let o=s+1;o<n.length;++o){const s=n[o],a=t[s],l=M(r,a);l+a.radius<=r.radius+1e-10?e[s].push(i):l+r.radius<=a.radius+1e-10&&e[i].push(s)}}return e}(t);for(let r=0;r<e.length;++r){const o=e[r].sets,a={},l={};for(let t=0;t<o.length;++t){a[o[t]]=!0;const e=i[o[t]];for(let t=0;t<e.length;++t)l[e[t]]=!0}const c=[],h=[];for(let e in t)e in a?c.push(t[e]):e in l||h.push(t[e]);const u=Y(c,h,n);s[o]=u,u.disjoint&&e[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return s}function Z(t){if(0===t.length)return[];const e={};return v(t,e),e.arcs}function Q(t,e){if(0===t.length)return"M 0 0";const n=Math.pow(10,e||0),s=null!=e?t=>Math.round(t*n)/n:t=>t;if(1==t.length){const e=t[0].circle;return function(t,e,n){const s=[];return s.push("\nM",t,e),s.push("\nm",-n,0),s.push("\na",n,n,0,1,0,2*n,0),s.push("\na",n,n,0,1,0,2*-n,0),s.join(" ")}(s(e.x),s(e.y),s(e.radius))}const i=["\nM",s(t[0].p2.x),s(t[0].p2.y)];for(const r of t){const t=s(r.circle.radius);i.push("\nA",t,t,0,r.large?1:0,r.sweep?1:0,s(r.p1.x),s(r.p1.y))}return i.join(" ")}function J(t,e){return Q(Z(t),e)}var tt=function(){var t=e(function(t,e,n,s){for(n=n||{},s=t.length;s--;n[t[s]]=e);return n},"o"),n=[5,8],s=[7,8,11,12,17,19,22,24],i=[1,17],r=[1,18],o=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],a=[1,31],l=[1,39],c=[7,8,11,12,17,19,22,24,27],h=[1,57],u=[1,56],f=[1,58],d=[1,59],y=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],p={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:e(function(t,e,n,s,i,r,o){var a=r.length-1;switch(i){case 1:return r[a-1];case 2:case 3:case 4:case 6:this.$=[];break;case 5:case 35:r[a-1].push(r[a]),this.$=r[a-1];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:case 43:case 44:this.$=r[a];break;case 8:s.setDiagramTitle(r[a].substr(6)),this.$=r[a].substr(6);break;case 9:s.addSubsetData([r[a]],void 0,void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 10:s.addSubsetData([r[a-1]],r[a],void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 11:s.addSubsetData([r[a-2]],void 0,parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 12:s.addSubsetData([r[a-3]],r[a-2],parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 13:if(r[a].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a]),s.addSubsetData(r[a],void 0,void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 14:if(r[a-1].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-1]),s.addSubsetData(r[a-1],r[a],void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 15:if(r[a-2].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-2]),s.addSubsetData(r[a-2],void 0,parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 16:if(r[a-3].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-3]),s.addSubsetData(r[a-3],r[a-2],parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 17:case 18:case 19:s.addTextData(r[a-1],r[a],void 0);break;case 20:case 21:s.addTextData(r[a-2],r[a-1],r[a]);break;case 23:s.addStyleData(r[a-1],r[a]);break;case 24:case 25:case 26:if(!(l=s.getCurrentSets()))throw new Error("text requires set");s.addTextData(l,r[a],void 0);break;case 27:case 28:var l;if(!(l=s.getCurrentSets()))throw new Error("text requires set");s.addTextData(l,r[a-1],r[a]);break;case 29:case 41:case 34:this.$=[r[a]];break;case 30:case 42:this.$=[...r[a-2],r[a]];break;case 31:this.$=[r[a-2],r[a]];break;case 33:this.$=r[a].join(" ")}},"anonymous"),table:[t(n,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(s,[2,4],{6:5}),t(n,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(s,[2,5]),t(s,[2,6]),t(s,[2,7]),t(s,[2,8]),{13:16,20:i,21:r},{13:20,18:19,20:i,21:r},{13:20,18:21,20:i,21:r},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:i,21:r},t(s,[2,9],{14:[1,27],15:[1,28]}),t(o,[2,43]),t(o,[2,44]),t(s,[2,13],{14:[1,29],15:[1,30],27:a}),t(o,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:a},t(s,[2,22]),t(s,[2,24],{14:[1,35]}),t(s,[2,25],{14:[1,36]}),t(s,[2,26]),{20:l,25:37,26:38,27:a},t(s,[2,10],{15:[1,40]}),{16:[1,41]},t(s,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:i,21:r},t(s,[2,17],{14:[1,45]}),t(s,[2,18],{14:[1,46]}),t(s,[2,19]),t(s,[2,27]),t(s,[2,28]),t(s,[2,23],{27:[1,47]}),t(c,[2,29]),{15:[1,48]},{16:[1,49]},t(s,[2,11]),{16:[1,50]},t(s,[2,15]),t(o,[2,42]),t(s,[2,20]),t(s,[2,21]),{20:l,26:51},{16:h,20:u,21:[1,53],28:52,29:54,30:55,31:f,32:d,33:y},t(s,[2,12]),t(s,[2,16]),t(c,[2,30]),t(c,[2,31]),t(c,[2,32]),t(c,[2,33],{30:61,16:h,20:u,31:f,32:d,33:y}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:e(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:e(function(t){var n=this,s=[0],i=[],r=[null],o=[],a=this.table,l="",c=0,h=0,u=o.slice.call(arguments,1),f=Object.create(this.lexer),d={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(d.yy[y]=this.yy[y]);f.setInput(t,d.yy),d.yy.lexer=f,d.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var g=f.yylloc;o.push(g);var p=f.options&&f.options.ranges;function x(){var t;return"number"!=typeof(t=i.pop()||f.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,e(function(t){s.length=s.length-2*t,r.length=r.length-t,o.length=o.length-t},"popStack"),e(x,"lex");for(var m,b,v,I,M,k,w,_,S={};;){if(b=s[s.length-1],this.defaultActions[b]?v=this.defaultActions[b]:(null==m&&(m=x()),v=a[b]&&a[b][m]),void 0===v||!v.length||!v[0]){var E;for(M in _=[],a[b])this.terminals_[M]&&M>2&&_.push("'"+this.terminals_[M]+"'");E=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(E,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:g,expected:_})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+m);switch(v[0]){case 1:s.push(m),r.push(f.yytext),o.push(f.yylloc),s.push(v[1]),m=null,h=f.yyleng,l=f.yytext,c=f.yylineno,g=f.yylloc;break;case 2:if(k=this.productions_[v[1]][1],S.$=r[r.length-k],S._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},p&&(S._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),void 0!==(I=this.performAction.apply(S,[l,h,c,d.yy,v[1],r,o].concat(u))))return I;k&&(s=s.slice(0,-1*k*2),r=r.slice(0,-1*k),o=o.slice(0,-1*k)),s.push(this.productions_[v[1]][0]),r.push(S.$),o.push(S._$),w=a[s[s.length-2]][s[s.length-1]],s.push(w);break;case 3:return!0}}return!0},"parse")},x=function(){return{EOF:1,parseError:e(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:e(function(t,e){return this.yy=e||this.yy||{},this._input=t,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:e(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:e(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:e(function(t){this.unput(this.match.slice(t))},"less"),pastInput:e(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:e(function(t,e){var n,s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in i)this[r]=i[r];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;var t,e,n,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),r=0;r<i.length;r++)if((n=this._input.match(this.rules[i[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,s=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){return this.next()||this.lex()},"lex"),begin:e(function(t){this.conditionStack.push(t)},"begin"),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:e(function(t){this.begin(t)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(t,e,n,s){switch(n){case 0:case 1:case 2:case 4:case 7:case 8:break;case 3:if(t.getIndentMode&&t.getIndentMode())return t.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 5:t.setIndentMode&&t.setIndentMode(!1),this.begin("INITIAL"),this.unput(e.yytext);break;case 6:return this.begin("bol"),8;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(!t.consumeIndentText)return 19;t.consumeIndentText=!1;break;case 15:return 24;case 16:return e.yytext=e.yytext.slice(2,-2),14;case 17:return e.yytext=e.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}}}();function m(){this.yy={}}return p.lexer=x,e(m,"Parser"),m.prototype=p,p.Parser=m,new m}();tt.parser=tt;var et,nt=tt,st=[],it=[],rt=[],ot=new Set,at=!1,lt=e((t,e,n)=>{const s=gt(t).sort(),i=n??10/Math.pow(t.length,2);et=s,1===s.length&&ot.add(s[0]),st.push({sets:s,size:i,label:e?ht(e):void 0})},"addSubsetData"),ct=e(()=>st,"getSubsetData"),ht=e(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),ut=e(t=>t?ht(t):t,"normalizeStyleValue"),ft=e((t,e,n)=>{const s=ht(e);it.push({sets:gt(t).sort(),id:s,label:n?ht(n):void 0})},"addTextData"),dt=e((t,e)=>{const n=gt(t).sort(),s={};for(const[i,r]of e)s[i]=ut(r)??r;rt.push({targets:n,styles:s})},"addStyleData"),yt=e(()=>rt,"getStyleData"),gt=e(t=>t.map(t=>ht(t)),"normalizeIdentifierList"),pt=e(t=>{const e=gt(t).filter(t=>!ot.has(t));if(e.length>0)throw new Error(`unknown set identifier: ${e.join(", ")}`)},"validateUnionIdentifiers"),xt=e(()=>it,"getTextData"),mt=e(()=>et,"getCurrentSets"),bt=e(()=>at,"getIndentMode"),vt=e(t=>{at=t},"setIndentMode"),It=m.venn;function Mt(){return x(It,l().venn)}e(Mt,"getConfig");var kt={getConfig:Mt,clear:e(()=>{p(),st.length=0,it.length=0,rt.length=0,ot.clear(),et=void 0,at=!1},"customClear"),setAccTitle:a,getAccTitle:o,setDiagramTitle:r,getDiagramTitle:i,getAccDescription:s,setAccDescription:n,addSubsetData:lt,getSubsetData:ct,addTextData:ft,addStyleData:dt,validateUnionIdentifiers:pt,getTextData:xt,getStyleData:yt,getCurrentSets:mt,getIndentMode:bt,setIndentMode:vt},wt=e(t=>`\n .venn-title {\n font-size: 32px;\n fill: ${t.vennTitleTextColor};\n font-family: ${t.fontFamily};\n }\n\n .venn-circle text {\n font-size: 48px;\n font-family: ${t.fontFamily};\n }\n\n .venn-intersection text {\n font-size: 48px;\n fill: ${t.vennSetTextColor};\n font-family: ${t.fontFamily};\n }\n\n .venn-text-node {\n font-family: ${t.fontFamily};\n color: ${t.vennSetTextColor};\n }\n`,"getStyles");function _t(t){const e=new Map;for(const n of t){const t=n.targets.join("|"),s=e.get(t);s?Object.assign(s,n.styles):e.set(t,{...n.styles})}return e}e(_t,"buildStyleByKey");var St=e((t,e,n,s)=>{const i=s.db,r=i.getConfig?.(),{themeVariables:o,look:a,handDrawnSeed:p}=l(),x="handDrawn"===a,m=[o.venn1,o.venn2,o.venn3,o.venn4,o.venn5,o.venn6,o.venn7,o.venn8].filter(Boolean),v=i.getDiagramTitle?.(),I=i.getSubsetData(),M=i.getTextData(),k=_t(i.getStyleData()),w=zt(I),_=r?.width??800,S=r?.height??450,E=_/1600,T=v?48*E:0,z=o.primaryTextColor??o.textColor,A=c(e);A.attr("viewBox",`0 0 ${_} ${S}`),v&&A.append("text").text(v).attr("class","venn-title").attr("font-size",32*E+"px").attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*E).style("fill",o.vennTitleTextColor||o.titleColor);const R=h(document.createElement("div")),N=function(t={}){let e=!1,n=600,s=350,i=15,r=1e3,o=Math.PI/2,a=!0,l=null,c=!0,h=!0,u=null,f=null,d=!1,y=null,g=!(!t||!t.symmetricalTextCentre)&&t.symmetricalTextCentre,p={},x=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],m=0,b=function(t){if(t in p)return p[t];var e=p[t]=x[m];return m+=1,m>=x.length&&(m=0),e},v=j,I=P;function M(p){let x=p.datum();const m=new Set;x.forEach(t=>{0==t.size&&1==t.sets.length&&m.add(t.sets[0])}),x=x.filter(t=>!t.sets.some(t=>m.has(t)));let M={},k={};if(x.length>0){let t=v(x,{lossFunction:I,distinct:d});a&&(t=U(t,o,f)),M=G(t,n,s,i,l),k=H(M,x,g)}const w={};function _(t){return t.sets in w?w[t.sets]:1==t.sets.length?""+t.sets[0]:void 0}x.forEach(t=>{t.label&&(w[t.sets]=t.label)}),p.selectAll("svg").data([M]).enter().append("svg");const S=p.select("svg");e?S.attr("viewBox",`0 0 ${n} ${s}`):S.attr("width",n).attr("height",s);const E={};let T=!1;function z(t){return e=>J(t.sets.map(t=>{let i=E[t],r=M[t];return i||(i={x:n/2,y:s/2,radius:1}),r||(r={x:n/2,y:s/2,radius:1}),{x:i.x*(1-e)+r.x*e,y:i.y*(1-e)+r.y*e,radius:i.radius*(1-e)+r.radius*e}}),y)}S.selectAll(".venn-area path").each(function(t){const e=this.getAttribute("d");1==t.sets.length&&e&&!d&&(T=!0,E[t.sets[0]]=function(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}(e))});const A=S.selectAll(".venn-area").data(x,t=>t.sets),R=A.enter().append("g").attr("class",t=>`venn-area venn-${1==t.sets.length?"circle":"intersection"}${t.colour||t.color?" venn-coloured":""}`).attr("data-venn-sets",t=>t.sets.join("_")),N=R.append("path"),D=R.append("text").attr("class","label").text(t=>_(t)).attr("text-anchor","middle").attr("dy",".35em").attr("x",n/2).attr("y",s/2);function O(t){return"function"==typeof t.transition?t.transition("venn").duration(r):t}h&&(N.style("fill-opacity","0").filter(t=>1==t.sets.length).style("fill",t=>t.colour?t.colour:t.color?t.color:b(t.sets)).style("fill-opacity",".25"),D.style("fill",e=>e.colour||e.color?"#FFF":t.textFill?t.textFill:1==e.sets.length?b(e.sets):"#444"));let j=p;T&&"function"==typeof j.transition?(j=O(p),j.selectAll("path").attrTween("d",z)):j.selectAll("path").attr("d",t=>J(t.sets.map(t=>M[t])),y);const C=j.selectAll("text").filter(t=>t.sets in k).text(t=>_(t)).attr("x",t=>Math.floor(k[t.sets].x)).attr("y",t=>Math.floor(k[t.sets].y));c&&(T?"on"in C?C.on("end",X(M,_)):C.each("end",X(M,_)):C.each(X(M,_)));const F=O(A.exit()).remove();"function"==typeof A.transition&&F.selectAll("path").attrTween("d",z);const $=F.selectAll("text").attr("x",n/2).attr("y",s/2);return null!==u&&(D.style("font-size","0px"),C.style("font-size",u),$.style("font-size","0px")),{circles:M,textCentres:k,nodes:A,enter:R,update:j,exit:F}}return M.wrap=function(t){return arguments.length?(c=t,M):c},M.useViewBox=function(){return e=!0,M},M.width=function(t){return arguments.length?(n=t,M):n},M.height=function(t){return arguments.length?(s=t,M):s},M.padding=function(t){return arguments.length?(i=t,M):i},M.distinct=function(t){return arguments.length?(d=t,M):d},M.colours=function(t){return arguments.length?(b=t,M):b},M.colors=function(t){return arguments.length?(b=t,M):b},M.fontSize=function(t){return arguments.length?(u=t,M):u},M.round=function(t){return arguments.length?(y=t,M):y},M.duration=function(t){return arguments.length?(r=t,M):r},M.layoutFunction=function(t){return arguments.length?(v=t,M):v},M.normalize=function(t){return arguments.length?(a=t,M):a},M.scaleToFit=function(t){return arguments.length?(l=t,M):l},M.styled=function(t){return arguments.length?(h=t,M):h},M.orientation=function(t){return arguments.length?(o=t,M):o},M.orientationOrder=function(t){return arguments.length?(f=t,M):f},M.lossFunction=function(t){return arguments.length?(I="default"===t?P:"logRatio"===t?L:t,M):I},M}().width(_).height(S-T);R.datum(w).call(N);const D=x?u.svg(R.select("svg").node()):void 0,O=function(t,e={}){const{lossFunction:n,layoutFunction:s=j,normalize:i=!0,orientation:r=Math.PI/2,orientationOrder:o,width:a=600,height:l=350,padding:c=15,scaleToFit:h=!1,symmetricalTextCentre:u=!1,distinct:f,round:d=2}=e;let y=s(t,{lossFunction:"default"!==n&&n?"logRatio"===n?L:n:P,distinct:f});i&&(y=U(y,r,o));const g=G(y,a,l,c,h),p=H(g,t,u),x=new Map(Object.keys(g).map(t=>[t,{set:t,x:g[t].x,y:g[t].y,radius:g[t].radius}])),m=t.map(t=>{const e=t.sets.map(t=>x.get(t)),n=Z(e);return{circles:e,arcs:n,path:Q(n,d),area:t,has:new Set(t.sets)}});function b(t){let e="";for(const n of m)n.has.size>t.length&&t.every(t=>n.has.has(t))&&(e+=" "+n.path);return e}return m.map(({circles:t,arcs:e,path:n,area:s})=>({data:s,text:p[s.sets],circles:t,arcs:e,path:n,distinctPath:n+b(s.sets)}))}(w,{width:_,height:S-T,padding:r?.padding??15}),C=new Map;for(const l of O){const t=Et([...l.data.sets].sort());C.set(t,l)}M.length>0&&Tt(r,C,R,M,E,k);const F=f(o.background||"#f4f4f4");R.selectAll(".venn-circle").each(function(t,e){const n=h(this),s=Et([...t.sets].sort()),i=k.get(s),r=i?.fill||m[e%m.length]||o.primaryColor;n.classed("venn-set-"+e%8,!0);const a=i?.["fill-opacity"]??.1,l=i?.stroke||r,c=i?.["stroke-width"]||""+5*E;if(x&&D){const t=C.get(s);if(t&&t.circles.length>0){const s=t.circles[0],i=D.circle(s.x,s.y,2*s.radius,{roughness:.7,seed:p,fill:b(r,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:60*e-41,stroke:l,strokeWidth:parseFloat(String(c))});n.select("path").remove(),n.node()?.insertBefore(i,n.select("text").node())}}else n.select("path").style("fill",r).style("fill-opacity",a).style("stroke",l).style("stroke-width",c).style("stroke-opacity",.95);const u=i?.color||(F?d(r,30):y(r,30));n.select("text").style("font-size",48*E+"px").style("fill",u)}),x&&D?R.selectAll(".venn-intersection").each(function(t){const e=h(this),n=Et([...t.sets].sort()),s=k.get(n),i=s?.fill;if(i){const t=e.select("path"),n=t.attr("d");if(n){const e=D.path(n,{roughness:.7,seed:p,fill:b(i,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),s=t.node();s?.parentNode?.insertBefore(e,s),t.remove()}}else e.select("path").style("fill-opacity",0);e.select("text").style("font-size",48*E+"px").style("fill",s?.color??o.vennSetTextColor??z)}):(R.selectAll(".venn-intersection text").style("font-size",48*E+"px").style("fill",t=>{const e=Et([...t.sets].sort());return k.get(e)?.color??o.vennSetTextColor??z}),R.selectAll(".venn-intersection path").style("fill-opacity",t=>{const e=Et([...t.sets].sort());return k.get(e)?.fill?1:0}).style("fill",t=>{const e=Et([...t.sets].sort());return k.get(e)?.fill??"transparent"}));const $=A.append("g").attr("transform",`translate(0, ${T})`),q=R.select("svg").node();if(q&&"childNodes"in q)for(const l of[...q.childNodes])$.node()?.appendChild(l);g(A,S,_,r?.useMaxWidth??!0)},"draw");function Et(t){return t.join("|")}function Tt(t,e,n,s,i,r){const o=t?.useDebugLayout??!1,a=n.select("svg").append("g").attr("class","venn-text-nodes"),l=new Map;for(const c of s){const t=Et(c.sets),e=l.get(t);e?e.push(c):l.set(t,[c])}for(const[c,h]of l.entries()){const t=e.get(c);if(!t?.text)continue;const n=t.text.x,s=t.text.y,l=Math.min(...t.circles.map(t=>t.radius)),u=Math.min(...t.circles.map(t=>t.radius-Math.hypot(n-t.x,s-t.y)));let f=Number.isFinite(u)?Math.max(0,u):0;0===f&&Number.isFinite(l)&&(f=.6*l);const d=a.append("g").attr("class","venn-text-area").attr("font-size",40*i+"px");o&&d.append("circle").attr("class","venn-text-debug-circle").attr("cx",n).attr("cy",s).attr("r",f).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const y=Math.max(80*i,2*f*.95),g=Math.max(60*i,2*f*.95),p=(t.data.label&&t.data.label.length>0?Math.min(32*i,.25*f):0)+(h.length<=2?30*i:0),x=n-y/2,m=s-g/2+p,b=Math.max(1,Math.ceil(Math.sqrt(h.length))),v=y/b,I=g/Math.max(1,Math.ceil(h.length/b));for(const[e,a]of h.entries()){const t=e%b,n=Math.floor(e/b),s=x+v*(t+.5),l=m+I*(n+.5);o&&d.append("rect").attr("class","venn-text-debug-cell").attr("x",x+v*t).attr("y",m+I*n).attr("width",v).attr("height",I).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const c=.9*v,h=.9*I,u=d.append("foreignObject").attr("class","venn-text-node-fo").attr("width",c).attr("height",h).attr("x",s-c/2).attr("y",l-h/2).attr("overflow","visible"),f=r.get(a.id)?.color,y=u.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(a.label??a.id);f&&y.style("color",f)}}}function zt(t){const e=new Set(t.map(t=>[...t.sets].sort().join("|"))),n=new Map(t.filter(t=>1===t.sets.length&&void 0!==t.size).map(t=>[t.sets[0],t.size])),s=[];for(const i of t){if(i.sets.length<3)continue;const t=[...i.sets].sort();for(let i=0;i<t.length-1;i++)for(let r=i+1;r<t.length;r++){const o=[t[i],t[r]],a=o.join("|");if(!e.has(a)){e.add(a);const t=n.get(o[0]),i=n.get(o[1]),r=void 0!==t&&void 0!==i?Math.min(t,i)/4:2.5;s.push({sets:o,size:r,label:""})}}}return s.length>0?[...t,...s]:t}e(Et,"stableSetsKey"),e(Tt,"renderTextNodes"),e(zt,"ensurePairwiseSubsets");var At={parser:nt,db:kt,renderer:{draw:St},styles:wt};export{At as diagram};
|
|
1
|
+
import{b3 as t,_ as e,s as n,g as s,p as i,o as r,a as o,b as a,z as l,F as c,d as h,ak as u,a9 as f,aa as d,ab as y,e as g,q as p,B as x,D as m}from"./mermaid.core-CSuHyCbU.js";import"./RemoteLifeOSBlock-Bq3YQBy7.js";import"./index-kcB9N5v8.js";import"./purify.es-BNLkGfTg.js";import"./marked.esm-BBjA1da9.js";import"./index-S4bzeLfy.js";import"./index-8TM1eFHE.js";import"./file-editor-CodeHighlight-aQ9kP3Wv.js";import"./App-Bx92ZYqP.js";import"./square-Dl4fOYPP.js";import"./chevron-up-C3_IR2td.js";import"./__vite-browser-external-2447137e-BMiSckAV.js";const b=(e,n)=>t(e,"a",-n);function v(t,e){const n=function(t){const e=[];for(let n=0;n<t.length;++n)for(let s=n+1;s<t.length;++s){const i=w(t[n],t[s]);for(const t of i)t.parentIndex=[n,s],e.push(t)}return e}(t),s=n.filter(e=>function(t,e){return e.every(e=>M(t,e)<e.radius+1e-10)}(e,t));let i=0,r=0;const o=[];if(s.length>1){const e=_(s);for(let t=0;t<s.length;++t){const n=s[t];n.angle=Math.atan2(n.x-e.x,n.y-e.y)}s.sort((t,e)=>e.angle-t.angle);let n=s[s.length-1];for(let a=0;a<s.length;++a){const e=s[a];r+=(n.x+e.x)*(e.y-n.y);const l={x:(e.x+n.x)/2,y:(e.y+n.y)/2};let c=null;for(let s=0;s<e.parentIndex.length;++s)if(n.parentIndex.includes(e.parentIndex[s])){const i=t[e.parentIndex[s]],r=Math.atan2(e.x-i.x,e.y-i.y),o=Math.atan2(n.x-i.x,n.y-i.y);let a=o-r;a<0&&(a+=2*Math.PI);const h=o-a/2;let u=M(l,{x:i.x+i.radius*Math.sin(h),y:i.y+i.radius*Math.cos(h)});u>2*i.radius&&(u=2*i.radius),(null==c||c.width>u)&&(c={circle:i,width:u,p1:e,p2:n,large:u>i.radius,sweep:!0})}null!=c&&(o.push(c),i+=I(c.circle.radius,c.width),n=e)}}else{let e=t[0];for(let s=1;s<t.length;++s)t[s].radius<e.radius&&(e=t[s]);let n=!1;for(let s=0;s<t.length;++s)if(M(t[s],e)>Math.abs(e.radius-t[s].radius)){n=!0;break}n?i=r=0:(i=e.radius*e.radius*Math.PI,o.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-1e-10,y:e.y+e.radius},width:2*e.radius,large:!0,sweep:!0}))}return r/=2,e&&(e.area=i+r,e.arcArea=i,e.polygonArea=r,e.arcs=o,e.innerPoints=s,e.intersectionPoints=n),i+r}function I(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function M(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function k(t,e,n){if(n>=t+e)return 0;if(n<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const s=e-(n*n-t*t+e*e)/(2*n);return I(t,t-(n*n-e*e+t*t)/(2*n))+I(e,s)}function w(t,e){const n=M(t,e),s=t.radius,i=e.radius;if(n>=s+i||n<=Math.abs(s-i))return[];const r=(s*s-i*i+n*n)/(2*n),o=Math.sqrt(s*s-r*r),a=t.x+r*(e.x-t.x)/n,l=t.y+r*(e.y-t.y)/n,c=-(e.y-t.y)*(o/n),h=-(e.x-t.x)*(o/n);return[{x:a+c,y:l-h},{x:a-c,y:l+h}]}function _(t){const e={x:0,y:0};for(const n of t)e.x+=n.x,e.y+=n.y;return e.x/=t.length,e.y/=t.length,e}function S(t){const e=new Array(t);for(let n=0;n<t;++n)e[n]=0;return e}function E(t,e){return S(t).map(()=>S(e))}function T(t,e){let n=0;for(let s=0;s<t.length;++s)n+=t[s]*e[s];return n}function z(t){return Math.sqrt(T(t,t))}function A(t,e,n){for(let s=0;s<e.length;++s)t[s]=e[s]*n}function R(t,e,n,s,i){for(let r=0;r<t.length;++r)t[r]=e*n[r]+s*i[r]}function N(t,e,n){const s=(n=n||{}).maxIterations||200*e.length,i=n.nonZeroDelta||1.05,r=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,a=n.minErrorDelta||1e-5,l=void 0!==n.rho?n.rho:1,c=void 0!==n.chi?n.chi:2,h=void 0!==n.psi?n.psi:-.5,u=void 0!==n.sigma?n.sigma:.5;let f;const d=e.length,y=new Array(d+1);y[0]=e,y[0].fx=t(e),y[0].id=0;for(let I=0;I<d;++I){const n=e.slice();n[I]=n[I]?n[I]*i:r,y[I+1]=n,y[I+1].fx=t(n),y[I+1].id=I+1}function g(t){for(let e=0;e<t.length;e++)y[d][e]=t[e];y[d].fx=t.fx}const p=(t,e)=>t.fx-e.fx,x=e.slice(),m=e.slice(),b=e.slice(),v=e.slice();for(let I=0;I<s;++I){if(y.sort(p),n.history){const t=y.map(t=>{const e=t.slice();return e.fx=t.fx,e.id=t.id,e});t.sort((t,e)=>t.id-e.id),n.history.push({x:y[0].slice(),fx:y[0].fx,simplex:t})}f=0;for(let t=0;t<d;++t)f=Math.max(f,Math.abs(y[0][t]-y[1][t]));if(Math.abs(y[0].fx-y[d].fx)<o&&f<a)break;for(let t=0;t<d;++t){x[t]=0;for(let e=0;e<d;++e)x[t]+=y[e][t];x[t]/=d}const e=y[d];if(R(m,1+l,x,-l,e),m.fx=t(m),m.fx<y[0].fx)R(v,1+c,x,-c,e),v.fx=t(v),v.fx<m.fx?g(v):g(m);else if(m.fx>=y[d-1].fx){let n=!1;if(m.fx>e.fx?(R(b,1+h,x,-h,e),b.fx=t(b),b.fx<e.fx?g(b):n=!0):(R(b,1-h*l,x,h*l,e),b.fx=t(b),b.fx<m.fx?g(b):n=!0),n){if(u>=1)break;for(let e=1;e<y.length;++e)R(y[e],1-u,y[0],u,y[e]),y[e].fx=t(y[e])}}else g(m)}return y.sort(p),{fx:y[0].fx,x:y[0]}}function D(t,e,n,s,i,r,o){const a=n.fx,l=T(n.fxprime,e);let c=a,h=a,u=l,f=0;function d(h,f,d){for(let y=0;y<16;++y)if(i=(h+f)/2,R(s.x,1,n.x,i,e),c=s.fx=t(s.x,s.fxprime),u=T(s.fxprime,e),c>a+r*i*l||c>=d)f=i;else{if(Math.abs(u)<=-o*l)return i;u*(f-h)>=0&&(f=h),h=i,d=c}return 0}i=i||1,r=r||1e-6,o=o||.1;for(let y=0;y<10;++y){if(R(s.x,1,n.x,i,e),c=s.fx=t(s.x,s.fxprime),u=T(s.fxprime,e),c>a+r*i*l||y&&c>=h)return d(f,i,h);if(Math.abs(u)<=-o*l)return i;if(u>=0)return d(i,f,c);h=c,f=i,i*=2}return i}function O(t,e,n){let s={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const r=e.slice();let o,a,l,c=1;l=(n=n||{}).maxIterations||20*e.length,s.fx=t(s.x,s.fxprime),o=s.fxprime.slice(),A(o,s.fxprime,-1);for(let h=0;h<l;++h){if(c=D(t,o,s,i,c),n.history&&n.history.push({x:s.x.slice(),fx:s.fx,fxprime:s.fxprime.slice(),alpha:c}),c){R(r,1,i.fxprime,-1,s.fxprime);const t=T(s.fxprime,s.fxprime);R(o,Math.max(0,T(r,i.fxprime)/t),o,-1,i.fxprime),a=s,s=i,i=a}else A(o,s.fxprime,-1);if(z(s.fxprime)<=1e-5)break}return n.history&&n.history.push({x:s.x.slice(),fx:s.fx,fxprime:s.fxprime.slice(),alpha:c}),s}function j(t,e={}){e.maxIterations=e.maxIterations||500;const n=e.initialLayout||$,s=e.lossFunction||P,i=function(t,e={}){const n=e.distinct,s=t.map(t=>Object.assign({},t));function i(t){return t.join(";")}if(n){const t=new Map;for(const e of s)for(let n=0;n<e.sets.length;n++){const s=String(e.sets[n]);t.set(s,e.size+(t.get(s)||0));for(let i=n+1;i<e.sets.length;i++){const n=String(e.sets[i]),r=`${s};${n}`,o=`${n};${s}`;t.set(r,e.size+(t.get(r)||0)),t.set(o,e.size+(t.get(o)||0))}}for(const e of s)e.sets.length<3&&(e.size=t.get(i(e.sets)))}const r=[],o=new Set;for(const a of s)if(1===a.sets.length)r.push(a.sets[0]);else if(2===a.sets.length){const t=a.sets[0],e=a.sets[1];o.add(i(a.sets)),o.add(i([e,t]))}r.sort((t,e)=>t===e?0:t<e?-1:1);for(let a=0;a<r.length;++a){const t=r[a];for(let e=a+1;e<r.length;++e){const n=r[e];o.has(i([t,n]))||s.push({sets:[t,n],size:0})}}return s}(t,e),r=n(i,e),o=Object.keys(r),a=[];for(const c of o)a.push(r[c].x),a.push(r[c].y);const l=N(t=>{const e={};for(let n=0;n<o.length;++n){const s=o[n];e[s]={x:t[2*n],y:t[2*n+1],radius:r[s].radius}}return s(e,i)},a,e).x;for(let c=0;c<o.length;++c){const t=o[c];r[t].x=l[2*c],r[t].y=l[2*c+1]}return r}const C=1e-10;function F(t,e,n){return Math.min(t,e)*Math.min(t,e)*Math.PI<=n+C?Math.abs(t-e):function(t,e,n,s){const i=(s=s||{}).maxIterations||100,r=s.tolerance||1e-10,o=t(e),a=t(n);let l=n-e;if(o*a>0)throw"Initial bisect points must have opposite signs";if(0===o)return e;if(0===a)return n;for(let c=0;c<i;++c){l/=2;const n=e+l,s=t(n);if(s*o>=0&&(e=n),Math.abs(l)<r||0===s)return n}return e+l}(s=>k(t,e,s)-n,0,t+e)}function $(t,e={}){let n=function(t,e){const n=e&&e.lossFunction?e.lossFunction:P,s={},i={};for(const u of t)if(1===u.sets.length){const t=u.sets[0];s[t]={x:1e10,y:1e10,rowid:s.length,size:u.size,radius:Math.sqrt(u.size/Math.PI)},i[t]=[]}t=t.filter(t=>2===t.sets.length);for(const u of t){let t=null!=u.weight?u.weight:1;const e=u.sets[0],n=u.sets[1];u.size+C>=Math.min(s[e].size,s[n].size)&&(t=0),i[e].push({set:n,size:u.size,weight:t}),i[n].push({set:e,size:u.size,weight:t})}const r=[];function o(t,e){return e.size-t.size}Object.keys(i).forEach(t=>{let e=0;for(let n=0;n<i[t].length;++n)e+=i[t][n].size*i[t][n].weight;r.push({set:t,size:e})}),r.sort(o);const a={};function l(t){return t.set in a}function c(t,e){s[e].x=t.x,s[e].y=t.y,a[e]=!0}c({x:0,y:0},r[0].set);for(let u=1;u<r.length;++u){const e=r[u].set,a=i[e].filter(l),f=s[e];if(a.sort(o),0===a.length)throw"ERROR: missing pairwise overlap information";const d=[];for(var h=0;h<a.length;++h){const t=s[a[h].set],e=F(f.radius,t.radius,a[h].size);d.push({x:t.x+e,y:t.y}),d.push({x:t.x-e,y:t.y}),d.push({y:t.y+e,x:t.x}),d.push({y:t.y-e,x:t.x});for(let n=h+1;n<a.length;++n){const i=s[a[n].set],r=F(f.radius,i.radius,a[n].size),o=w({x:t.x,y:t.y,radius:e},{x:i.x,y:i.y,radius:r});d.push(...o)}}let y=1e50,g=d[0];for(const i of d){s[e].x=i.x,s[e].y=i.y;const r=n(s,t);r<y&&(y=r,g=i)}c(g,e)}return s}(t,e);const s=e.lossFunction||P;if(t.length>=8){const i=function(t,e={}){const n=e.restarts||10,s=[],i={};for(const f of t)1===f.sets.length&&(i[f.sets[0]]=s.length,s.push(f));let{distances:r,constraints:o}=function(t,e,n){const s=E(e.length,e.length),i=E(e.length,e.length);return t.filter(t=>2===t.sets.length).forEach(t=>{const r=n[t.sets[0]],o=n[t.sets[1]],a=F(Math.sqrt(e[r].size/Math.PI),Math.sqrt(e[o].size/Math.PI),t.size);s[r][o]=s[o][r]=a;let l=0;t.size+1e-10>=Math.min(e[r].size,e[o].size)?l=1:t.size<=1e-10&&(l=-1),i[r][o]=i[o][r]=l}),{distances:s,constraints:i}}(t,s,i);const a=z(r.map(z))/r.length;r=r.map(t=>t.map(t=>t/a));const l=(t,e)=>function(t,e,n,s){for(let r=0;r<e.length;++r)e[r]=0;let i=0;for(let r=0;r<n.length;++r){const o=t[2*r],a=t[2*r+1];for(let l=r+1;l<n.length;++l){const c=t[2*l],h=t[2*l+1],u=n[r][l],f=s[r][l],d=(c-o)*(c-o)+(h-a)*(h-a),y=Math.sqrt(d),g=d-u*u;f>0&&y<=u||f<0&&y>=u||(i+=2*g*g,e[2*r]+=4*g*(o-c),e[2*r+1]+=4*g*(a-h),e[2*l]+=4*g*(c-o),e[2*l+1]+=4*g*(h-a))}}return i}(t,e,r,o);let c=null;for(let f=0;f<n;++f){const t=O(l,S(2*r.length).map(Math.random),e);(!c||t.fx<c.fx)&&(c=t)}const h=c.x,u={};for(let f=0;f<s.length;++f){const t=s[f];u[t.sets[0]]={x:h[2*f]*a,y:h[2*f+1]*a,radius:Math.sqrt(t.size/Math.PI)}}if(e.history)for(const f of e.history)A(f.x,a);return u}(t,e);s(i,t)+1e-8<s(n,t)&&(n=i)}return n}function P(t,e){let n=0;for(const s of e){if(1===s.sets.length)continue;let e;if(2===s.sets.length){const n=t[s.sets[0]],i=t[s.sets[1]];e=k(n.radius,i.radius,M(n,i))}else e=v(s.sets.map(e=>t[e]));n+=(null!=s.weight?s.weight:1)*(e-s.size)*(e-s.size)}return n}function L(t,e){let n=0;for(const s of e){if(1===s.sets.length)continue;let e;if(2===s.sets.length){const n=t[s.sets[0]],i=t[s.sets[1]];e=k(n.radius,i.radius,M(n,i))}else e=v(s.sets.map(e=>t[e]));const i=null!=s.weight?s.weight:1,r=Math.log((e+1)/(s.size+1));n+=i*r*r}return n}function q(t,e,n){if(null==n?t.sort((t,e)=>e.radius-t.radius):t.sort(n),t.length>0){const e=t[0].x,n=t[0].y;for(const s of t)s.x-=e,s.y-=n}if(2===t.length&&M(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const n=Math.atan2(t[1].x,t[1].y)-e,s=Math.cos(n),i=Math.sin(n);for(const e of t){const t=e.x,n=e.y;e.x=s*t-i*n,e.y=i*t+s*n}}if(t.length>2){let n=Math.atan2(t[2].x,t[2].y)-e;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){const e=t[1].y/(1e-10+t[1].x);for(const n of t){var s=(n.x+e*n.y)/(1+e*e);n.x=2*s-n.x,n.y=2*s*e-n.y}}}}function B(t){const e=e=>({max:t.reduce((t,n)=>Math.max(t,n[e]+n.radius),Number.NEGATIVE_INFINITY),min:t.reduce((t,n)=>Math.min(t,n[e]-n.radius),Number.POSITIVE_INFINITY)});return{xRange:e("x"),yRange:e("y")}}function U(t,e,n){null==e&&(e=Math.PI/2);let s=V(t).map(t=>Object.assign({},t));const i=function(t){function e(t){return t.parent!==t&&(t.parent=e(t.parent)),t.parent}function n(t,n){const s=e(t),i=e(n);s.parent=i}t.forEach(t=>{t.parent=t});for(let i=0;i<t.length;++i)for(let e=i+1;e<t.length;++e){const s=t[i].radius+t[e].radius;M(t[i],t[e])+1e-10<s&&n(t[e],t[i])}const s=new Map;for(let i=0;i<t.length;++i){const n=e(t[i]).parent.setid;s.has(n)||s.set(n,[]),s.get(n).push(t[i])}return t.forEach(t=>{delete t.parent}),Array.from(s.values())}(s);for(const c of i){q(c,e,n);const t=B(c);c.size=(t.xRange.max-t.xRange.min)*(t.yRange.max-t.yRange.min),c.bounds=t}i.sort((t,e)=>e.size-t.size),s=i[0];let r=s.bounds;const o=(r.xRange.max-r.xRange.min)/50;function a(t,e,n){if(!t)return;const i=t.bounds;let a,l;if(e)a=r.xRange.max-i.xRange.min+o;else{a=r.xRange.max-i.xRange.max;const t=(i.xRange.max-i.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;t<0&&(a+=t)}if(n)l=r.yRange.max-i.yRange.min+o;else{l=r.yRange.max-i.yRange.max;const t=(i.yRange.max-i.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;t<0&&(l+=t)}for(const r of t)r.x+=a,r.y+=l,s.push(r)}let l=1;for(;l<i.length;)a(i[l],!0,!1),a(i[l+1],!1,!0),a(i[l+2],!0,!0),l+=3,r=B(s);return W(s)}function G(t,e,n,s,i){const r=V(t);e-=2*s,n-=2*s;const{xRange:o,yRange:a}=B(r);if(o.max===o.min||a.max===a.min)return console.log("not scaling solution: zero size detected"),t;let l,c;if(i){const t=2*Math.sqrt(i/Math.PI);l=e/t,c=n/t}else l=e/(o.max-o.min),c=n/(a.max-a.min);const h=Math.min(c,l),u=(e-(o.max-o.min)*h)/2,f=(n-(a.max-a.min)*h)/2;return W(r.map(t=>({radius:h*t.radius,x:s+u+(t.x-o.min)*h,y:s+f+(t.y-a.min)*h,setid:t.setid})))}function W(t){const e={};for(const n of t)e[n.setid]=n;return e}function V(t){return Object.keys(t).map(e=>Object.assign(t[e],{setid:e}))}function X(t,e){return function(n){const s=this,i=t[n.sets[0]].radius||50,r=e(n)||"",o=r.split(/\s+/).reverse(),a=(r.length+o.length)/3;let l=o.pop(),c=[l],h=0;s.textContent=null;const u=[];function f(t){const e=s.ownerDocument.createElementNS(s.namespaceURI,"tspan");return e.textContent=t,u.push(e),s.append(e),e}let d=f(l);for(;l=o.pop(),l;){c.push(l);const t=c.join(" ");d.textContent=t,t.length>a&&d.getComputedTextLength()>i&&(c.pop(),d.textContent=c.join(" "),c=[l],d=f(l),h++)}const y=.35-1.1*h/2,g=s.getAttribute("x"),p=s.getAttribute("y");u.forEach((t,e)=>{t.setAttribute("x",g),t.setAttribute("y",p),t.setAttribute("dy",`${y+1.1*e}em`)})}}function Y(t,e,n){let s=e[0].radius-M(e[0],t);for(let i=1;i<e.length;++i){const n=e[i].radius-M(e[i],t);n<=s&&(s=n)}for(let i=0;i<n.length;++i){const e=M(n[i],t)-n[i].radius;e<=s&&(s=e)}return s}function K(t,e,n){const s=[];for(const h of t)s.push({x:h.x,y:h.y}),s.push({x:h.x+h.radius/2,y:h.y}),s.push({x:h.x-h.radius/2,y:h.y}),s.push({x:h.x,y:h.y+h.radius/2}),s.push({x:h.x,y:h.y-h.radius/2});let i=s[0],r=Y(s[0],t,e);for(let h=1;h<s.length;++h){const n=Y(s[h],t,e);n>=r&&(i=s[h],r=n)}const o=N(n=>-1*Y({x:n[0],y:n[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,a={x:n?0:o[0],y:o[1]};let l=!0;for(const h of t)if(M(a,h)>h.radius){l=!1;break}for(const h of e)if(M(a,h)<h.radius){l=!1;break}if(l)return a;if(1==t.length)return{x:t[0].x,y:t[0].y};const c={};return v(t,c),0===c.arcs.length?{x:0,y:-1e3,disjoint:!0}:1==c.arcs.length?{x:c.arcs[0].circle.x,y:c.arcs[0].circle.y}:e.length?K(t,[]):_(c.arcs.map(t=>t.p1))}function H(t,e,n){const s={},i=function(t){const e={},n=Object.keys(t);for(const s of n)e[s]=[];for(let s=0;s<n.length;s++){const i=n[s],r=t[i];for(let o=s+1;o<n.length;++o){const s=n[o],a=t[s],l=M(r,a);l+a.radius<=r.radius+1e-10?e[s].push(i):l+r.radius<=a.radius+1e-10&&e[i].push(s)}}return e}(t);for(let r=0;r<e.length;++r){const o=e[r].sets,a={},l={};for(let t=0;t<o.length;++t){a[o[t]]=!0;const e=i[o[t]];for(let t=0;t<e.length;++t)l[e[t]]=!0}const c=[],h=[];for(let e in t)e in a?c.push(t[e]):e in l||h.push(t[e]);const u=K(c,h,n);s[o]=u,u.disjoint&&e[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return s}function Z(t){if(0===t.length)return[];const e={};return v(t,e),e.arcs}function J(t,e){if(0===t.length)return"M 0 0";const n=Math.pow(10,e||0),s=null!=e?t=>Math.round(t*n)/n:t=>t;if(1==t.length){const e=t[0].circle;return function(t,e,n){const s=[];return s.push("\nM",t,e),s.push("\nm",-n,0),s.push("\na",n,n,0,1,0,2*n,0),s.push("\na",n,n,0,1,0,2*-n,0),s.join(" ")}(s(e.x),s(e.y),s(e.radius))}const i=["\nM",s(t[0].p2.x),s(t[0].p2.y)];for(const r of t){const t=s(r.circle.radius);i.push("\nA",t,t,0,r.large?1:0,r.sweep?1:0,s(r.p1.x),s(r.p1.y))}return i.join(" ")}function Q(t,e){return J(Z(t),e)}var tt=function(){var t=e(function(t,e,n,s){for(n=n||{},s=t.length;s--;n[t[s]]=e);return n},"o"),n=[5,8],s=[7,8,11,12,17,19,22,24],i=[1,17],r=[1,18],o=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],a=[1,31],l=[1,39],c=[7,8,11,12,17,19,22,24,27],h=[1,57],u=[1,56],f=[1,58],d=[1,59],y=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],p={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:e(function(t,e,n,s,i,r,o){var a=r.length-1;switch(i){case 1:return r[a-1];case 2:case 3:case 4:case 6:this.$=[];break;case 5:case 35:r[a-1].push(r[a]),this.$=r[a-1];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:case 43:case 44:this.$=r[a];break;case 8:s.setDiagramTitle(r[a].substr(6)),this.$=r[a].substr(6);break;case 9:s.addSubsetData([r[a]],void 0,void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 10:s.addSubsetData([r[a-1]],r[a],void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 11:s.addSubsetData([r[a-2]],void 0,parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 12:s.addSubsetData([r[a-3]],r[a-2],parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 13:if(r[a].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a]),s.addSubsetData(r[a],void 0,void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 14:if(r[a-1].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-1]),s.addSubsetData(r[a-1],r[a],void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 15:if(r[a-2].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-2]),s.addSubsetData(r[a-2],void 0,parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 16:if(r[a-3].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-3]),s.addSubsetData(r[a-3],r[a-2],parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 17:case 18:case 19:s.addTextData(r[a-1],r[a],void 0);break;case 20:case 21:s.addTextData(r[a-2],r[a-1],r[a]);break;case 23:s.addStyleData(r[a-1],r[a]);break;case 24:case 25:case 26:if(!(l=s.getCurrentSets()))throw new Error("text requires set");s.addTextData(l,r[a],void 0);break;case 27:case 28:var l;if(!(l=s.getCurrentSets()))throw new Error("text requires set");s.addTextData(l,r[a-1],r[a]);break;case 29:case 41:case 34:this.$=[r[a]];break;case 30:case 42:this.$=[...r[a-2],r[a]];break;case 31:this.$=[r[a-2],r[a]];break;case 33:this.$=r[a].join(" ")}},"anonymous"),table:[t(n,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(s,[2,4],{6:5}),t(n,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(s,[2,5]),t(s,[2,6]),t(s,[2,7]),t(s,[2,8]),{13:16,20:i,21:r},{13:20,18:19,20:i,21:r},{13:20,18:21,20:i,21:r},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:i,21:r},t(s,[2,9],{14:[1,27],15:[1,28]}),t(o,[2,43]),t(o,[2,44]),t(s,[2,13],{14:[1,29],15:[1,30],27:a}),t(o,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:a},t(s,[2,22]),t(s,[2,24],{14:[1,35]}),t(s,[2,25],{14:[1,36]}),t(s,[2,26]),{20:l,25:37,26:38,27:a},t(s,[2,10],{15:[1,40]}),{16:[1,41]},t(s,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:i,21:r},t(s,[2,17],{14:[1,45]}),t(s,[2,18],{14:[1,46]}),t(s,[2,19]),t(s,[2,27]),t(s,[2,28]),t(s,[2,23],{27:[1,47]}),t(c,[2,29]),{15:[1,48]},{16:[1,49]},t(s,[2,11]),{16:[1,50]},t(s,[2,15]),t(o,[2,42]),t(s,[2,20]),t(s,[2,21]),{20:l,26:51},{16:h,20:u,21:[1,53],28:52,29:54,30:55,31:f,32:d,33:y},t(s,[2,12]),t(s,[2,16]),t(c,[2,30]),t(c,[2,31]),t(c,[2,32]),t(c,[2,33],{30:61,16:h,20:u,31:f,32:d,33:y}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:e(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:e(function(t){var n=this,s=[0],i=[],r=[null],o=[],a=this.table,l="",c=0,h=0,u=o.slice.call(arguments,1),f=Object.create(this.lexer),d={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(d.yy[y]=this.yy[y]);f.setInput(t,d.yy),d.yy.lexer=f,d.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var g=f.yylloc;o.push(g);var p=f.options&&f.options.ranges;function x(){var t;return"number"!=typeof(t=i.pop()||f.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,e(function(t){s.length=s.length-2*t,r.length=r.length-t,o.length=o.length-t},"popStack"),e(x,"lex");for(var m,b,v,I,M,k,w,_,S={};;){if(b=s[s.length-1],this.defaultActions[b]?v=this.defaultActions[b]:(null==m&&(m=x()),v=a[b]&&a[b][m]),void 0===v||!v.length||!v[0]){var E;for(M in _=[],a[b])this.terminals_[M]&&M>2&&_.push("'"+this.terminals_[M]+"'");E=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(E,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:g,expected:_})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+m);switch(v[0]){case 1:s.push(m),r.push(f.yytext),o.push(f.yylloc),s.push(v[1]),m=null,h=f.yyleng,l=f.yytext,c=f.yylineno,g=f.yylloc;break;case 2:if(k=this.productions_[v[1]][1],S.$=r[r.length-k],S._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},p&&(S._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),void 0!==(I=this.performAction.apply(S,[l,h,c,d.yy,v[1],r,o].concat(u))))return I;k&&(s=s.slice(0,-1*k*2),r=r.slice(0,-1*k),o=o.slice(0,-1*k)),s.push(this.productions_[v[1]][0]),r.push(S.$),o.push(S._$),w=a[s[s.length-2]][s[s.length-1]],s.push(w);break;case 3:return!0}}return!0},"parse")},x=function(){return{EOF:1,parseError:e(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:e(function(t,e){return this.yy=e||this.yy||{},this._input=t,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:e(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:e(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:e(function(t){this.unput(this.match.slice(t))},"less"),pastInput:e(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:e(function(t,e){var n,s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in i)this[r]=i[r];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;var t,e,n,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),r=0;r<i.length;r++)if((n=this._input.match(this.rules[i[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,s=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){return this.next()||this.lex()},"lex"),begin:e(function(t){this.conditionStack.push(t)},"begin"),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:e(function(t){this.begin(t)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(t,e,n,s){switch(n){case 0:case 1:case 2:case 4:case 7:case 8:break;case 3:if(t.getIndentMode&&t.getIndentMode())return t.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 5:t.setIndentMode&&t.setIndentMode(!1),this.begin("INITIAL"),this.unput(e.yytext);break;case 6:return this.begin("bol"),8;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(!t.consumeIndentText)return 19;t.consumeIndentText=!1;break;case 15:return 24;case 16:return e.yytext=e.yytext.slice(2,-2),14;case 17:return e.yytext=e.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}}}();function m(){this.yy={}}return p.lexer=x,e(m,"Parser"),m.prototype=p,p.Parser=m,new m}();tt.parser=tt;var et,nt=tt,st=[],it=[],rt=[],ot=new Set,at=!1,lt=e((t,e,n)=>{const s=gt(t).sort(),i=n??10/Math.pow(t.length,2);et=s,1===s.length&&ot.add(s[0]),st.push({sets:s,size:i,label:e?ht(e):void 0})},"addSubsetData"),ct=e(()=>st,"getSubsetData"),ht=e(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),ut=e(t=>t?ht(t):t,"normalizeStyleValue"),ft=e((t,e,n)=>{const s=ht(e);it.push({sets:gt(t).sort(),id:s,label:n?ht(n):void 0})},"addTextData"),dt=e((t,e)=>{const n=gt(t).sort(),s={};for(const[i,r]of e)s[i]=ut(r)??r;rt.push({targets:n,styles:s})},"addStyleData"),yt=e(()=>rt,"getStyleData"),gt=e(t=>t.map(t=>ht(t)),"normalizeIdentifierList"),pt=e(t=>{const e=gt(t).filter(t=>!ot.has(t));if(e.length>0)throw new Error(`unknown set identifier: ${e.join(", ")}`)},"validateUnionIdentifiers"),xt=e(()=>it,"getTextData"),mt=e(()=>et,"getCurrentSets"),bt=e(()=>at,"getIndentMode"),vt=e(t=>{at=t},"setIndentMode"),It=m.venn;function Mt(){return x(It,l().venn)}e(Mt,"getConfig");var kt={getConfig:Mt,clear:e(()=>{p(),st.length=0,it.length=0,rt.length=0,ot.clear(),et=void 0,at=!1},"customClear"),setAccTitle:a,getAccTitle:o,setDiagramTitle:r,getDiagramTitle:i,getAccDescription:s,setAccDescription:n,addSubsetData:lt,getSubsetData:ct,addTextData:ft,addStyleData:dt,validateUnionIdentifiers:pt,getTextData:xt,getStyleData:yt,getCurrentSets:mt,getIndentMode:bt,setIndentMode:vt},wt=e(t=>`\n .venn-title {\n font-size: 32px;\n fill: ${t.vennTitleTextColor};\n font-family: ${t.fontFamily};\n }\n\n .venn-circle text {\n font-size: 48px;\n font-family: ${t.fontFamily};\n }\n\n .venn-intersection text {\n font-size: 48px;\n fill: ${t.vennSetTextColor};\n font-family: ${t.fontFamily};\n }\n\n .venn-text-node {\n font-family: ${t.fontFamily};\n color: ${t.vennSetTextColor};\n }\n`,"getStyles");function _t(t){const e=new Map;for(const n of t){const t=n.targets.join("|"),s=e.get(t);s?Object.assign(s,n.styles):e.set(t,{...n.styles})}return e}e(_t,"buildStyleByKey");var St=e((t,e,n,s)=>{const i=s.db,r=i.getConfig?.(),{themeVariables:o,look:a,handDrawnSeed:p}=l(),x="handDrawn"===a,m=[o.venn1,o.venn2,o.venn3,o.venn4,o.venn5,o.venn6,o.venn7,o.venn8].filter(Boolean),v=i.getDiagramTitle?.(),I=i.getSubsetData(),M=i.getTextData(),k=_t(i.getStyleData()),w=zt(I),_=r?.width??800,S=r?.height??450,E=_/1600,T=v?48*E:0,z=o.primaryTextColor??o.textColor,A=c(e);A.attr("viewBox",`0 0 ${_} ${S}`),v&&A.append("text").text(v).attr("class","venn-title").attr("font-size",32*E+"px").attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*E).style("fill",o.vennTitleTextColor||o.titleColor);const R=h(document.createElement("div")),N=function(t={}){let e=!1,n=600,s=350,i=15,r=1e3,o=Math.PI/2,a=!0,l=null,c=!0,h=!0,u=null,f=null,d=!1,y=null,g=!(!t||!t.symmetricalTextCentre)&&t.symmetricalTextCentre,p={},x=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],m=0,b=function(t){if(t in p)return p[t];var e=p[t]=x[m];return m+=1,m>=x.length&&(m=0),e},v=j,I=P;function M(p){let x=p.datum();const m=new Set;x.forEach(t=>{0==t.size&&1==t.sets.length&&m.add(t.sets[0])}),x=x.filter(t=>!t.sets.some(t=>m.has(t)));let M={},k={};if(x.length>0){let t=v(x,{lossFunction:I,distinct:d});a&&(t=U(t,o,f)),M=G(t,n,s,i,l),k=H(M,x,g)}const w={};function _(t){return t.sets in w?w[t.sets]:1==t.sets.length?""+t.sets[0]:void 0}x.forEach(t=>{t.label&&(w[t.sets]=t.label)}),p.selectAll("svg").data([M]).enter().append("svg");const S=p.select("svg");e?S.attr("viewBox",`0 0 ${n} ${s}`):S.attr("width",n).attr("height",s);const E={};let T=!1;function z(t){return e=>Q(t.sets.map(t=>{let i=E[t],r=M[t];return i||(i={x:n/2,y:s/2,radius:1}),r||(r={x:n/2,y:s/2,radius:1}),{x:i.x*(1-e)+r.x*e,y:i.y*(1-e)+r.y*e,radius:i.radius*(1-e)+r.radius*e}}),y)}S.selectAll(".venn-area path").each(function(t){const e=this.getAttribute("d");1==t.sets.length&&e&&!d&&(T=!0,E[t.sets[0]]=function(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}(e))});const A=S.selectAll(".venn-area").data(x,t=>t.sets),R=A.enter().append("g").attr("class",t=>`venn-area venn-${1==t.sets.length?"circle":"intersection"}${t.colour||t.color?" venn-coloured":""}`).attr("data-venn-sets",t=>t.sets.join("_")),N=R.append("path"),D=R.append("text").attr("class","label").text(t=>_(t)).attr("text-anchor","middle").attr("dy",".35em").attr("x",n/2).attr("y",s/2);function O(t){return"function"==typeof t.transition?t.transition("venn").duration(r):t}h&&(N.style("fill-opacity","0").filter(t=>1==t.sets.length).style("fill",t=>t.colour?t.colour:t.color?t.color:b(t.sets)).style("fill-opacity",".25"),D.style("fill",e=>e.colour||e.color?"#FFF":t.textFill?t.textFill:1==e.sets.length?b(e.sets):"#444"));let j=p;T&&"function"==typeof j.transition?(j=O(p),j.selectAll("path").attrTween("d",z)):j.selectAll("path").attr("d",t=>Q(t.sets.map(t=>M[t])),y);const C=j.selectAll("text").filter(t=>t.sets in k).text(t=>_(t)).attr("x",t=>Math.floor(k[t.sets].x)).attr("y",t=>Math.floor(k[t.sets].y));c&&(T?"on"in C?C.on("end",X(M,_)):C.each("end",X(M,_)):C.each(X(M,_)));const F=O(A.exit()).remove();"function"==typeof A.transition&&F.selectAll("path").attrTween("d",z);const $=F.selectAll("text").attr("x",n/2).attr("y",s/2);return null!==u&&(D.style("font-size","0px"),C.style("font-size",u),$.style("font-size","0px")),{circles:M,textCentres:k,nodes:A,enter:R,update:j,exit:F}}return M.wrap=function(t){return arguments.length?(c=t,M):c},M.useViewBox=function(){return e=!0,M},M.width=function(t){return arguments.length?(n=t,M):n},M.height=function(t){return arguments.length?(s=t,M):s},M.padding=function(t){return arguments.length?(i=t,M):i},M.distinct=function(t){return arguments.length?(d=t,M):d},M.colours=function(t){return arguments.length?(b=t,M):b},M.colors=function(t){return arguments.length?(b=t,M):b},M.fontSize=function(t){return arguments.length?(u=t,M):u},M.round=function(t){return arguments.length?(y=t,M):y},M.duration=function(t){return arguments.length?(r=t,M):r},M.layoutFunction=function(t){return arguments.length?(v=t,M):v},M.normalize=function(t){return arguments.length?(a=t,M):a},M.scaleToFit=function(t){return arguments.length?(l=t,M):l},M.styled=function(t){return arguments.length?(h=t,M):h},M.orientation=function(t){return arguments.length?(o=t,M):o},M.orientationOrder=function(t){return arguments.length?(f=t,M):f},M.lossFunction=function(t){return arguments.length?(I="default"===t?P:"logRatio"===t?L:t,M):I},M}().width(_).height(S-T);R.datum(w).call(N);const D=x?u.svg(R.select("svg").node()):void 0,O=function(t,e={}){const{lossFunction:n,layoutFunction:s=j,normalize:i=!0,orientation:r=Math.PI/2,orientationOrder:o,width:a=600,height:l=350,padding:c=15,scaleToFit:h=!1,symmetricalTextCentre:u=!1,distinct:f,round:d=2}=e;let y=s(t,{lossFunction:"default"!==n&&n?"logRatio"===n?L:n:P,distinct:f});i&&(y=U(y,r,o));const g=G(y,a,l,c,h),p=H(g,t,u),x=new Map(Object.keys(g).map(t=>[t,{set:t,x:g[t].x,y:g[t].y,radius:g[t].radius}])),m=t.map(t=>{const e=t.sets.map(t=>x.get(t)),n=Z(e);return{circles:e,arcs:n,path:J(n,d),area:t,has:new Set(t.sets)}});function b(t){let e="";for(const n of m)n.has.size>t.length&&t.every(t=>n.has.has(t))&&(e+=" "+n.path);return e}return m.map(({circles:t,arcs:e,path:n,area:s})=>({data:s,text:p[s.sets],circles:t,arcs:e,path:n,distinctPath:n+b(s.sets)}))}(w,{width:_,height:S-T,padding:r?.padding??15}),C=new Map;for(const l of O){const t=Et([...l.data.sets].sort());C.set(t,l)}M.length>0&&Tt(r,C,R,M,E,k);const F=f(o.background||"#f4f4f4");R.selectAll(".venn-circle").each(function(t,e){const n=h(this),s=Et([...t.sets].sort()),i=k.get(s),r=i?.fill||m[e%m.length]||o.primaryColor;n.classed("venn-set-"+e%8,!0);const a=i?.["fill-opacity"]??.1,l=i?.stroke||r,c=i?.["stroke-width"]||""+5*E;if(x&&D){const t=C.get(s);if(t&&t.circles.length>0){const s=t.circles[0],i=D.circle(s.x,s.y,2*s.radius,{roughness:.7,seed:p,fill:b(r,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:60*e-41,stroke:l,strokeWidth:parseFloat(String(c))});n.select("path").remove(),n.node()?.insertBefore(i,n.select("text").node())}}else n.select("path").style("fill",r).style("fill-opacity",a).style("stroke",l).style("stroke-width",c).style("stroke-opacity",.95);const u=i?.color||(F?d(r,30):y(r,30));n.select("text").style("font-size",48*E+"px").style("fill",u)}),x&&D?R.selectAll(".venn-intersection").each(function(t){const e=h(this),n=Et([...t.sets].sort()),s=k.get(n),i=s?.fill;if(i){const t=e.select("path"),n=t.attr("d");if(n){const e=D.path(n,{roughness:.7,seed:p,fill:b(i,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),s=t.node();s?.parentNode?.insertBefore(e,s),t.remove()}}else e.select("path").style("fill-opacity",0);e.select("text").style("font-size",48*E+"px").style("fill",s?.color??o.vennSetTextColor??z)}):(R.selectAll(".venn-intersection text").style("font-size",48*E+"px").style("fill",t=>{const e=Et([...t.sets].sort());return k.get(e)?.color??o.vennSetTextColor??z}),R.selectAll(".venn-intersection path").style("fill-opacity",t=>{const e=Et([...t.sets].sort());return k.get(e)?.fill?1:0}).style("fill",t=>{const e=Et([...t.sets].sort());return k.get(e)?.fill??"transparent"}));const $=A.append("g").attr("transform",`translate(0, ${T})`),q=R.select("svg").node();if(q&&"childNodes"in q)for(const l of[...q.childNodes])$.node()?.appendChild(l);g(A,S,_,r?.useMaxWidth??!0)},"draw");function Et(t){return t.join("|")}function Tt(t,e,n,s,i,r){const o=t?.useDebugLayout??!1,a=n.select("svg").append("g").attr("class","venn-text-nodes"),l=new Map;for(const c of s){const t=Et(c.sets),e=l.get(t);e?e.push(c):l.set(t,[c])}for(const[c,h]of l.entries()){const t=e.get(c);if(!t?.text)continue;const n=t.text.x,s=t.text.y,l=Math.min(...t.circles.map(t=>t.radius)),u=Math.min(...t.circles.map(t=>t.radius-Math.hypot(n-t.x,s-t.y)));let f=Number.isFinite(u)?Math.max(0,u):0;0===f&&Number.isFinite(l)&&(f=.6*l);const d=a.append("g").attr("class","venn-text-area").attr("font-size",40*i+"px");o&&d.append("circle").attr("class","venn-text-debug-circle").attr("cx",n).attr("cy",s).attr("r",f).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const y=Math.max(80*i,2*f*.95),g=Math.max(60*i,2*f*.95),p=(t.data.label&&t.data.label.length>0?Math.min(32*i,.25*f):0)+(h.length<=2?30*i:0),x=n-y/2,m=s-g/2+p,b=Math.max(1,Math.ceil(Math.sqrt(h.length))),v=y/b,I=g/Math.max(1,Math.ceil(h.length/b));for(const[e,a]of h.entries()){const t=e%b,n=Math.floor(e/b),s=x+v*(t+.5),l=m+I*(n+.5);o&&d.append("rect").attr("class","venn-text-debug-cell").attr("x",x+v*t).attr("y",m+I*n).attr("width",v).attr("height",I).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const c=.9*v,h=.9*I,u=d.append("foreignObject").attr("class","venn-text-node-fo").attr("width",c).attr("height",h).attr("x",s-c/2).attr("y",l-h/2).attr("overflow","visible"),f=r.get(a.id)?.color,y=u.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(a.label??a.id);f&&y.style("color",f)}}}function zt(t){const e=new Set(t.map(t=>[...t.sets].sort().join("|"))),n=new Map(t.filter(t=>1===t.sets.length&&void 0!==t.size).map(t=>[t.sets[0],t.size])),s=[];for(const i of t){if(i.sets.length<3)continue;const t=[...i.sets].sort();for(let i=0;i<t.length-1;i++)for(let r=i+1;r<t.length;r++){const o=[t[i],t[r]],a=o.join("|");if(!e.has(a)){e.add(a);const t=n.get(o[0]),i=n.get(o[1]),r=void 0!==t&&void 0!==i?Math.min(t,i)/4:2.5;s.push({sets:o,size:r,label:""})}}}return s.length>0?[...t,...s]:t}e(Et,"stableSetsKey"),e(Tt,"renderTextNodes"),e(zt,"ensurePairwiseSubsets");var At={parser:nt,db:kt,renderer:{draw:St},styles:wt};export{At as diagram};
|