@ootc/markdown 0.0.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -4
- package/dist/CodeBlock-BquZ4WRk.cjs +2 -0
- package/dist/CodeBlock-DSwq2gw5.js +74 -0
- package/dist/MarkdownPreview-CMvzqhTd.js +7592 -0
- package/dist/MarkdownPreview-DfDx-wep.cjs +29 -0
- package/dist/code.cjs +1 -1
- package/dist/code.css +1 -0
- package/dist/code.d.ts +3 -1
- package/dist/code.js +3 -2
- package/dist/components/code-block/CodeBlock.d.ts +7 -1
- package/dist/components/markdown/MarkdownPreview.d.ts +8 -2
- package/dist/components/markdown-editor/MarkdownEditor.d.ts +4 -1
- package/dist/css/CodeBlock.css +1 -0
- package/dist/css/MarkdownPreview.css +1 -0
- package/dist/css/editor.css +1 -0
- package/dist/css/plugin-mermaid.css +1 -0
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +3 -0
- package/dist/editor.d.ts +3 -1
- package/dist/editor.js +28 -25
- package/dist/index-BJZhyxD_.cjs +9 -0
- package/dist/index-DWVMYNE4.js +800 -0
- package/dist/index-HmBYTPyZ.js +1179 -0
- package/dist/index-jsnhzgIQ.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -2
- package/dist/jsx-runtime-DXgJBoQh.js +264 -0
- package/dist/jsx-runtime-nZSsnGb7.cjs +6 -0
- package/dist/plugin-highlight.cjs +1 -0
- package/dist/plugin-highlight.js +20 -0
- package/dist/plugin-katex.cjs +1 -0
- package/dist/plugin-katex.js +12 -0
- package/dist/plugin-mermaid.cjs +1 -0
- package/dist/plugin-mermaid.css +1 -0
- package/dist/plugin-mermaid.js +266 -0
- package/dist/plugins/types.d.ts +38 -0
- package/dist/preview.cjs +1 -1
- package/dist/preview.css +2 -0
- package/dist/preview.d.ts +3 -1
- package/dist/preview.js +4 -3
- package/dist/style.css +4 -1
- package/package.json +76 -21
- package/dist/CodeBlock-BYxQBfWO.js +0 -40827
- package/dist/CodeBlock-CJ6j8Wkl.cjs +0 -3934
- package/dist/MarkdownPreview-DcWMewhy.cjs +0 -295
- package/dist/MarkdownPreview-lqJAnu4B.js +0 -20424
- package/dist/_baseUniq-BfVwFITD.js +0 -477
- package/dist/_baseUniq-D-3LoSZp.cjs +0 -1
- package/dist/arc-CyzqoBTV.js +0 -83
- package/dist/arc-DrpGAtaq.cjs +0 -1
- package/dist/architecture-U656AL7Q-C8Bj_Ouy.cjs +0 -1
- package/dist/architecture-U656AL7Q-DTKdLHLe.js +0 -5
- package/dist/architectureDiagram-VXUJARFQ-B8EG6DIA.js +0 -4662
- package/dist/architectureDiagram-VXUJARFQ-DJ1ub7X0.cjs +0 -36
- package/dist/blockDiagram-VD42YOAC-CKNTgeZ8.js +0 -2256
- package/dist/blockDiagram-VD42YOAC-G-1iOwuq.cjs +0 -122
- package/dist/c4Diagram-YG6GDRKO-BJ1Ka924.cjs +0 -10
- package/dist/c4Diagram-YG6GDRKO-Bokkq4pO.js +0 -1580
- package/dist/channel-C4noxv-h.js +0 -5
- package/dist/channel-DvIIEA3u.cjs +0 -1
- package/dist/chunk-4BX2VUAB-B5M-5e_l.cjs +0 -1
- package/dist/chunk-4BX2VUAB-ByoAwp1j.js +0 -8
- package/dist/chunk-55IACEB6-BpG-_f0h.cjs +0 -1
- package/dist/chunk-55IACEB6-DRnx6y7F.js +0 -8
- package/dist/chunk-B4BG7PRW-0toVGVN-.js +0 -1375
- package/dist/chunk-B4BG7PRW-evUM3dip.cjs +0 -165
- package/dist/chunk-DI55MBZ5-CyInK_-M.js +0 -1370
- package/dist/chunk-DI55MBZ5-DKs4p2E0.cjs +0 -220
- package/dist/chunk-FMBD7UC4-BwUpmqhP.js +0 -19
- package/dist/chunk-FMBD7UC4-cpOVGF_2.cjs +0 -15
- package/dist/chunk-QN33PNHL-C7XXEbKU.js +0 -19
- package/dist/chunk-QN33PNHL-CEdYSNej.cjs +0 -1
- package/dist/chunk-QZHKN3VN-hppYv0Iu.cjs +0 -1
- package/dist/chunk-QZHKN3VN-qqHBDA_I.js +0 -15
- package/dist/chunk-TZMSLE5B-B9QqMSFM.js +0 -64
- package/dist/chunk-TZMSLE5B-Bklau4qu.cjs +0 -1
- package/dist/classDiagram-2ON5EDUG-CYKX_y1c.js +0 -16
- package/dist/classDiagram-2ON5EDUG-TgiEUsUn.cjs +0 -1
- package/dist/classDiagram-v2-WZHVMYZB-CYKX_y1c.js +0 -16
- package/dist/classDiagram-v2-WZHVMYZB-TgiEUsUn.cjs +0 -1
- package/dist/clone-CE64n2kf.js +0 -8
- package/dist/clone-jaW02xOC.cjs +0 -1
- package/dist/cose-bilkent-S5V4N54A-B_XAF1ZT.js +0 -2609
- package/dist/cose-bilkent-S5V4N54A-DSZx3rxe.cjs +0 -1
- package/dist/cytoscape.esm-CNUX3VTg.cjs +0 -321
- package/dist/cytoscape.esm-Cvf3sx9F.js +0 -18704
- package/dist/dagre-6UL2VRFP-Biy3Qm3K.js +0 -443
- package/dist/dagre-6UL2VRFP-C8MiPDEQ.cjs +0 -4
- package/dist/defaultLocale-D7EN2tov.js +0 -171
- package/dist/defaultLocale-DIVzfLaQ.cjs +0 -1
- package/dist/diagram-PSM6KHXK-B1y0Lt7Z.cjs +0 -24
- package/dist/diagram-PSM6KHXK-CIfbagcO.js +0 -531
- package/dist/diagram-QEK2KX5R-BJNTbg0b.cjs +0 -43
- package/dist/diagram-QEK2KX5R-BQz0yqem.js +0 -217
- package/dist/diagram-S2PKOQOG-BGsratMZ.js +0 -142
- package/dist/diagram-S2PKOQOG-BK_tj5Pz.cjs +0 -24
- package/dist/erDiagram-Q2GNP2WA-CJbuwIgY.cjs +0 -60
- package/dist/erDiagram-Q2GNP2WA-CurkAz8N.js +0 -841
- package/dist/flowDiagram-NV44I4VS-DAMyok8X.js +0 -1620
- package/dist/flowDiagram-NV44I4VS-DnmHUmh1.cjs +0 -162
- package/dist/ganttDiagram-JELNMOA3-DxXvW49B.cjs +0 -267
- package/dist/ganttDiagram-JELNMOA3-oVlSmAjl.js +0 -2671
- package/dist/gitGraph-F6HP7TQM-DUSMetNW.js +0 -5
- package/dist/gitGraph-F6HP7TQM-DveZcMpA.cjs +0 -1
- package/dist/gitGraphDiagram-NY62KEGX-CFdtd4Gb.js +0 -699
- package/dist/gitGraphDiagram-NY62KEGX-CspGhCdP.cjs +0 -65
- package/dist/graph-Bza-HyX6.js +0 -381
- package/dist/graph-CE_Z8OkL.cjs +0 -1
- package/dist/info-NVLQJR56-3ayytpiF.js +0 -5
- package/dist/info-NVLQJR56-D-IKjb_E.cjs +0 -1
- package/dist/infoDiagram-WHAUD3N6--LngDYSE.cjs +0 -2
- package/dist/infoDiagram-WHAUD3N6-BtO0qT6g.js +0 -24
- package/dist/init-CHZsXQcr.cjs +0 -1
- package/dist/init-DjUOC4st.js +0 -16
- package/dist/journeyDiagram-XKPGCS4Q-DCvKw6yJ.cjs +0 -139
- package/dist/journeyDiagram-XKPGCS4Q-Unrh_bjo.js +0 -834
- package/dist/kanban-definition-3W4ZIXB7-CRa6bR24.cjs +0 -89
- package/dist/kanban-definition-3W4ZIXB7-Vpm6gG9R.js +0 -719
- package/dist/layout-BJzrWbaG.cjs +0 -1
- package/dist/layout-D6Pf3Nys.js +0 -1441
- package/dist/linear-C0E_OSxf.js +0 -259
- package/dist/linear-TSwNFrBs.cjs +0 -1
- package/dist/mermaid-parser.core-B9wV8XMP.js +0 -14177
- package/dist/mermaid-parser.core-Ba9EAFlD.cjs +0 -128
- package/dist/mermaid.core-B1lFjYb9.js +0 -15269
- package/dist/mermaid.core-C8vi9eg6.cjs +0 -249
- package/dist/min-BC6TlZcq.cjs +0 -1
- package/dist/min-DT5Wu4V1.js +0 -38
- package/dist/mindmap-definition-VGOIOE7T-COA86V4i.js +0 -784
- package/dist/mindmap-definition-VGOIOE7T-D9oMyZ2M.cjs +0 -68
- package/dist/ordinal-B6-f3MAq.js +0 -61
- package/dist/ordinal-CagbB1m8.cjs +0 -1
- package/dist/packet-BFZMPI3H-BZI0_bZt.js +0 -5
- package/dist/packet-BFZMPI3H-D4pnK0Ol.cjs +0 -1
- package/dist/pie-7BOR55EZ-DS6huTOL.cjs +0 -1
- package/dist/pie-7BOR55EZ-DgzTX76e.js +0 -5
- package/dist/pieDiagram-ADFJNKIX-CYW3Diea.js +0 -161
- package/dist/pieDiagram-ADFJNKIX-CxPAjreR.cjs +0 -30
- package/dist/quadrantDiagram-AYHSOK5B-BT94kssD.js +0 -1022
- package/dist/quadrantDiagram-AYHSOK5B-ehLphI_D.cjs +0 -7
- package/dist/radar-NHE76QYJ-CKcVnf1I.cjs +0 -1
- package/dist/radar-NHE76QYJ-D8cZitaQ.js +0 -5
- package/dist/requirementDiagram-UZGBJVZJ-B4UYGl6e.js +0 -850
- package/dist/requirementDiagram-UZGBJVZJ-BDLj6-Do.cjs +0 -64
- package/dist/sankeyDiagram-TZEHDZUN-CAWsWdn8.js +0 -810
- package/dist/sankeyDiagram-TZEHDZUN-DUb360Ep.cjs +0 -10
- package/dist/sequenceDiagram-WL72ISMW-Bb4Tkhf2.cjs +0 -145
- package/dist/sequenceDiagram-WL72ISMW-DsmW0gAI.js +0 -2511
- package/dist/stateDiagram-FKZM4ZOC-Da-8DKdP.js +0 -263
- package/dist/stateDiagram-FKZM4ZOC-jOvG1Jmy.cjs +0 -1
- package/dist/stateDiagram-v2-4FDKWEC3-GMZ8nH4e.js +0 -16
- package/dist/stateDiagram-v2-4FDKWEC3-mWKIMY-b.cjs +0 -1
- package/dist/timeline-definition-IT6M3QCI-BdnDlTsf.cjs +0 -61
- package/dist/timeline-definition-IT6M3QCI-CvJDgHLW.js +0 -795
- package/dist/treemap-KMMF4GRG-BVy_kMp3.js +0 -5
- package/dist/treemap-KMMF4GRG-BsA9nu7r.cjs +0 -1
- package/dist/xychartDiagram-PRI3JC2R-CYXNZ7B0.cjs +0 -7
- package/dist/xychartDiagram-PRI3JC2R-wG1xpI1S.js +0 -1340
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("./chunk-4BX2VUAB-B5M-5e_l.cjs"),j=require("./chunk-QZHKN3VN-hppYv0Iu.cjs"),s=require("./mermaid.core-C8vi9eg6.cjs"),K=require("./mermaid-parser.core-Ba9EAFlD.cjs");var x={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},U=s.defaultConfig_default.gitGraph,L=s.__name(()=>s.cleanAndMerge({...U,...s.getConfig().gitGraph}),"getConfig"),i=new j.ImperativeState(()=>{const t=L(),e=t.mainBranchName,n=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:n}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function G(){return s.random({length:7})}s.__name(G,"getID");function H(t,e){const n=Object.create(null);return t.reduce((o,r)=>{const a=e(r);return n[a]||(n[a]=!0,o.push(r)),o},[])}s.__name(H,"uniqBy");var Y=s.__name(function(t){i.records.direction=t},"setDirection"),V=s.__name(function(t){s.log.debug("options str",t),t=t?.trim(),t=t||"{}";try{i.records.options=JSON.parse(t)}catch(e){s.log.error("error while parsing gitGraph options",e.message)}},"setOptions"),X=s.__name(function(){return i.records.options},"getOptions"),Q=s.__name(function(t){let e=t.msg,n=t.id;const o=t.type;let r=t.tags;s.log.info("commit",e,n,o,r),s.log.debug("Entering commit:",e,n,o,r);const a=L();n=s.common_default.sanitizeText(n,a),e=s.common_default.sanitizeText(e,a),r=r?.map(c=>s.common_default.sanitizeText(c,a));const l={id:n||i.records.seq+"-"+G(),message:e,seq:i.records.seq++,type:o??x.NORMAL,tags:r??[],parents:i.records.head==null?[]:[i.records.head.id],branch:i.records.currBranch};i.records.head=l,s.log.info("main branch",a.mainBranchName),i.records.commits.has(l.id)&&s.log.warn(`Commit ID ${l.id} already exists`),i.records.commits.set(l.id,l),i.records.branches.set(i.records.currBranch,l.id),s.log.debug("in pushCommit "+l.id)},"commit"),J=s.__name(function(t){let e=t.name;const n=t.order;if(e=s.common_default.sanitizeText(e,L()),i.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);i.records.branches.set(e,i.records.head!=null?i.records.head.id:null),i.records.branchConfig.set(e,{name:e,order:n}),D(e),s.log.debug("in createBranch")},"branch"),Z=s.__name(t=>{let e=t.branch,n=t.id;const o=t.type,r=t.tags,a=L();e=s.common_default.sanitizeText(e,a),n&&(n=s.common_default.sanitizeText(n,a));const l=i.records.branches.get(i.records.currBranch),c=i.records.branches.get(e),f=l?i.records.commits.get(l):void 0,h=c?i.records.commits.get(c):void 0;if(f&&h&&f.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(i.records.currBranch===e){const d=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw d.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},d}if(f===void 0||!f){const d=new Error(`Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`);throw d.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},d}if(!i.records.branches.has(e)){const d=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw d.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},d}if(h===void 0||!h){const d=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw d.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},d}if(f===h){const d=new Error('Incorrect usage of "merge". Both branches have same head');throw d.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},d}if(n&&i.records.commits.has(n)){const d=new Error('Incorrect usage of "merge". Commit with id:'+n+" already exists, use different custom id");throw d.hash={text:`merge ${e} ${n} ${o} ${r?.join(" ")}`,token:`merge ${e} ${n} ${o} ${r?.join(" ")}`,expected:[`merge ${e} ${n}_UNIQUE ${o} ${r?.join(" ")}`]},d}const $=c||"",g={id:n||`${i.records.seq}-${G()}`,message:`merged branch ${e} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,$],branch:i.records.currBranch,type:x.MERGE,customType:o,customId:!!n,tags:r??[]};i.records.head=g,i.records.commits.set(g.id,g),i.records.branches.set(i.records.currBranch,g.id),s.log.debug(i.records.branches),s.log.debug("in mergeBranch")},"merge"),ee=s.__name(function(t){let e=t.id,n=t.targetId,o=t.tags,r=t.parent;s.log.debug("Entering cherryPick:",e,n,o);const a=L();if(e=s.common_default.sanitizeText(e,a),n=s.common_default.sanitizeText(n,a),o=o?.map(f=>s.common_default.sanitizeText(f,a)),r=s.common_default.sanitizeText(r,a),!e||!i.records.commits.has(e)){const f=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw f.hash={text:`cherryPick ${e} ${n}`,token:`cherryPick ${e} ${n}`,expected:["cherry-pick abc"]},f}const l=i.records.commits.get(e);if(l===void 0||!l)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(r&&!(Array.isArray(l.parents)&&l.parents.includes(r)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const c=l.branch;if(l.type===x.MERGE&&!r)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!n||!i.records.commits.has(n)){if(c===i.records.currBranch){const g=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw g.hash={text:`cherryPick ${e} ${n}`,token:`cherryPick ${e} ${n}`,expected:["cherry-pick abc"]},g}const f=i.records.branches.get(i.records.currBranch);if(f===void 0||!f){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${e} ${n}`,token:`cherryPick ${e} ${n}`,expected:["cherry-pick abc"]},g}const h=i.records.commits.get(f);if(h===void 0||!h){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${e} ${n}`,token:`cherryPick ${e} ${n}`,expected:["cherry-pick abc"]},g}const $={id:i.records.seq+"-"+G(),message:`cherry-picked ${l?.message} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,l.id],branch:i.records.currBranch,type:x.CHERRY_PICK,tags:o?o.filter(Boolean):[`cherry-pick:${l.id}${l.type===x.MERGE?`|parent:${r}`:""}`]};i.records.head=$,i.records.commits.set($.id,$),i.records.branches.set(i.records.currBranch,$.id),s.log.debug(i.records.branches),s.log.debug("in cherryPick")}},"cherryPick"),D=s.__name(function(t){if(t=s.common_default.sanitizeText(t,L()),i.records.branches.has(t)){i.records.currBranch=t;const e=i.records.branches.get(i.records.currBranch);e===void 0||!e?i.records.head=null:i.records.head=i.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");function A(t,e,n){const o=t.indexOf(e);o===-1?t.push(n):t.splice(o,1,n)}s.__name(A,"upsert");function q(t){const e=t.reduce((r,a)=>r.seq>a.seq?r:a,t[0]);let n="";t.forEach(function(r){r===e?n+=" *":n+=" |"});const o=[n,e.id,e.seq];for(const r in i.records.branches)i.records.branches.get(r)===e.id&&o.push(r);if(s.log.debug(o.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const r=i.records.commits.get(e.parents[0]);A(t,e,r),e.parents[1]&&t.push(i.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const r=i.records.commits.get(e.parents[0]);A(t,e,r)}}t=H(t,r=>r.id),q(t)}s.__name(q,"prettyPrintCommitHistory");var re=s.__name(function(){s.log.debug(i.records.commits);const t=N()[0];q([t])},"prettyPrint"),te=s.__name(function(){i.reset(),s.clear()},"clear"),ae=s.__name(function(){return[...i.records.branchConfig.values()].map((e,n)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${n}`)}).sort((e,n)=>(e.order??0)-(n.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),ne=s.__name(function(){return i.records.branches},"getBranches"),se=s.__name(function(){return i.records.commits},"getCommits"),N=s.__name(function(){const t=[...i.records.commits.values()];return t.forEach(function(e){s.log.debug(e.id)}),t.sort((e,n)=>e.seq-n.seq),t},"getCommitsArray"),oe=s.__name(function(){return i.records.currBranch},"getCurrentBranch"),ce=s.__name(function(){return i.records.direction},"getDirection"),ie=s.__name(function(){return i.records.head},"getHead"),z={commitType:x,getConfig:L,setDirection:Y,setOptions:V,getOptions:X,commit:Q,branch:J,merge:Z,cherryPick:ee,checkout:D,prettyPrint:re,clear:te,getBranchesAsObjArray:ae,getBranches:ne,getCommits:se,getCommitsArray:N,getCurrentBranch:oe,getDirection:ce,getHead:ie,setAccTitle:s.setAccTitle,getAccTitle:s.getAccTitle,getAccDescription:s.getAccDescription,setAccDescription:s.setAccDescription,setDiagramTitle:s.setDiagramTitle,getDiagramTitle:s.getDiagramTitle},de=s.__name((t,e)=>{W.populateCommonDb(t,e),t.dir&&e.setDirection(t.dir);for(const n of t.statements)le(n,e)},"populate"),le=s.__name((t,e)=>{const o={Commit:s.__name(r=>e.commit(he(r)),"Commit"),Branch:s.__name(r=>e.branch($e(r)),"Branch"),Merge:s.__name(r=>e.merge(fe(r)),"Merge"),Checkout:s.__name(r=>e.checkout(ge(r)),"Checkout"),CherryPicking:s.__name(r=>e.cherryPick(ye(r)),"CherryPicking")}[t.$type];o?o(t):s.log.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),he=s.__name(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?x[t.type]:x.NORMAL,tags:t.tags??void 0}),"parseCommit"),$e=s.__name(t=>({name:t.name,order:t.order??0}),"parseBranch"),fe=s.__name(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?x[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),ge=s.__name(t=>t.branch,"parseCheckout"),ye=s.__name(t=>({id:t.id,targetId:"",tags:t.tags?.length===0?void 0:t.tags,parent:t.parent}),"parseCherryPicking"),ue={parse:s.__name(async t=>{const e=await K.parse("gitGraph",t);s.log.debug(e),de(e,z)},"parse")},me=s.getConfig2(),_=me?.gitGraph,E=10,T=40,w=4,v=2,B=8,p=new Map,b=new Map,I=30,k=new Map,R=[],C=0,u="LR",xe=s.__name(()=>{p.clear(),b.clear(),k.clear(),C=0,R=[],u="LR"},"clear"),F=s.__name(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach(o=>{const r=document.createElementNS("http://www.w3.org/2000/svg","tspan");r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.setAttribute("dy","1em"),r.setAttribute("x","0"),r.setAttribute("class","row"),r.textContent=o.trim(),e.appendChild(r)}),e},"drawText"),S=s.__name(t=>{let e,n,o;return u==="BT"?(n=s.__name((r,a)=>r<=a,"comparisonFunc"),o=1/0):(n=s.__name((r,a)=>r>=a,"comparisonFunc"),o=0),t.forEach(r=>{const a=u==="TB"||u=="BT"?b.get(r)?.y:b.get(r)?.x;a!==void 0&&n(a,o)&&(e=r,o=a)}),e},"findClosestParent"),pe=s.__name(t=>{let e="",n=1/0;return t.forEach(o=>{const r=b.get(o).y;r<=n&&(e=o,n=r)}),e||void 0},"findClosestParentBT"),be=s.__name((t,e,n)=>{let o=n,r=n;const a=[];t.forEach(l=>{const c=e.get(l);if(!c)throw new Error(`Commit not found for key ${l}`);c.parents.length?(o=we(c),r=Math.max(o,r)):a.push(c),ve(c,o)}),o=r,a.forEach(l=>{Ce(l,o,n)}),t.forEach(l=>{const c=e.get(l);if(c?.parents.length){const f=pe(c.parents);o=b.get(f).y-T,o<=r&&(r=o);const h=p.get(c.branch).pos,$=o-E;b.set(c.id,{x:h,y:$})}})},"setParallelBTPos"),_e=s.__name(t=>{const e=S(t.parents.filter(o=>o!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const n=b.get(e)?.y;if(n===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return n},"findClosestParentPos"),we=s.__name(t=>_e(t)+T,"calculateCommitPosition"),ve=s.__name((t,e)=>{const n=p.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const o=n.pos,r=e+E;return b.set(t.id,{x:o,y:r}),{x:o,y:r}},"setCommitPosition"),Ce=s.__name((t,e,n)=>{const o=p.get(t.branch);if(!o)throw new Error(`Branch not found for commit ${t.id}`);const r=e+n,a=o.pos;b.set(t.id,{x:a,y:r})},"setRootPosition"),Ee=s.__name((t,e,n,o,r,a)=>{if(a===x.HIGHLIGHT)t.append("rect").attr("x",n.x-10).attr("y",n.y-10).attr("width",20).attr("height",20).attr("class",`commit ${e.id} commit-highlight${r%B} ${o}-outer`),t.append("rect").attr("x",n.x-6).attr("y",n.y-6).attr("width",12).attr("height",12).attr("class",`commit ${e.id} commit${r%B} ${o}-inner`);else if(a===x.CHERRY_PICK)t.append("circle").attr("cx",n.x).attr("cy",n.y).attr("r",10).attr("class",`commit ${e.id} ${o}`),t.append("circle").attr("cx",n.x-3).attr("cy",n.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${o}`),t.append("circle").attr("cx",n.x+3).attr("cy",n.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${o}`),t.append("line").attr("x1",n.x+3).attr("y1",n.y+1).attr("x2",n.x).attr("y2",n.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${o}`),t.append("line").attr("x1",n.x-3).attr("y1",n.y+1).attr("x2",n.x).attr("y2",n.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${o}`);else{const l=t.append("circle");if(l.attr("cx",n.x),l.attr("cy",n.y),l.attr("r",e.type===x.MERGE?9:10),l.attr("class",`commit ${e.id} commit${r%B}`),a===x.MERGE){const c=t.append("circle");c.attr("cx",n.x),c.attr("cy",n.y),c.attr("r",6),c.attr("class",`commit ${o} ${e.id} commit${r%B}`)}a===x.REVERSE&&t.append("path").attr("d",`M ${n.x-5},${n.y-5}L${n.x+5},${n.y+5}M${n.x-5},${n.y+5}L${n.x+5},${n.y-5}`).attr("class",`commit ${o} ${e.id} commit${r%B}`)}},"drawCommitBullet"),Te=s.__name((t,e,n,o)=>{if(e.type!==x.CHERRY_PICK&&(e.customId&&e.type===x.MERGE||e.type!==x.MERGE)&&_?.showCommitLabel){const r=t.append("g"),a=r.insert("rect").attr("class","commit-label-bkg"),l=r.append("text").attr("x",o).attr("y",n.y+25).attr("class","commit-label").text(e.id),c=l.node()?.getBBox();if(c&&(a.attr("x",n.posWithOffset-c.width/2-v).attr("y",n.y+13.5).attr("width",c.width+2*v).attr("height",c.height+2*v),u==="TB"||u==="BT"?(a.attr("x",n.x-(c.width+4*w+5)).attr("y",n.y-12),l.attr("x",n.x-(c.width+4*w)).attr("y",n.y+c.height-12)):l.attr("x",n.posWithOffset-c.width/2),_.rotateCommitLabel))if(u==="TB"||u==="BT")l.attr("transform","rotate(-45, "+n.x+", "+n.y+")"),a.attr("transform","rotate(-45, "+n.x+", "+n.y+")");else{const f=-7.5-(c.width+10)/25*9.5,h=10+c.width/25*8.5;r.attr("transform","translate("+f+", "+h+") rotate(-45, "+o+", "+n.y+")")}}},"drawCommitLabel"),Be=s.__name((t,e,n,o)=>{if(e.tags.length>0){let r=0,a=0,l=0;const c=[];for(const f of e.tags.reverse()){const h=t.insert("polygon"),$=t.append("circle"),g=t.append("text").attr("y",n.y-16-r).attr("class","tag-label").text(f),d=g.node()?.getBBox();if(!d)throw new Error("Tag bbox not found");a=Math.max(a,d.width),l=Math.max(l,d.height),g.attr("x",n.posWithOffset-d.width/2),c.push({tag:g,hole:$,rect:h,yOffset:r}),r+=20}for(const{tag:f,hole:h,rect:$,yOffset:g}of c){const d=l/2,y=n.y-19.2-g;if($.attr("class","tag-label-bkg").attr("points",`
|
|
2
|
-
${o-a/2-w/2},${y+v}
|
|
3
|
-
${o-a/2-w/2},${y-v}
|
|
4
|
-
${n.posWithOffset-a/2-w},${y-d-v}
|
|
5
|
-
${n.posWithOffset+a/2+w},${y-d-v}
|
|
6
|
-
${n.posWithOffset+a/2+w},${y+d+v}
|
|
7
|
-
${n.posWithOffset-a/2-w},${y+d+v}`),h.attr("cy",y).attr("cx",o-a/2+w/2).attr("r",1.5).attr("class","tag-hole"),u==="TB"||u==="BT"){const m=o+g;$.attr("class","tag-label-bkg").attr("points",`
|
|
8
|
-
${n.x},${m+2}
|
|
9
|
-
${n.x},${m-2}
|
|
10
|
-
${n.x+E},${m-d-2}
|
|
11
|
-
${n.x+E+a+4},${m-d-2}
|
|
12
|
-
${n.x+E+a+4},${m+d+2}
|
|
13
|
-
${n.x+E},${m+d+2}`).attr("transform","translate(12,12) rotate(45, "+n.x+","+o+")"),h.attr("cx",n.x+w/2).attr("cy",m).attr("transform","translate(12,12) rotate(45, "+n.x+","+o+")"),f.attr("x",n.x+5).attr("y",m+3).attr("transform","translate(14,14) rotate(45, "+n.x+","+o+")")}}}},"drawCommitTags"),Le=s.__name(t=>{switch(t.customType??t.type){case x.NORMAL:return"commit-normal";case x.REVERSE:return"commit-reverse";case x.HIGHLIGHT:return"commit-highlight";case x.MERGE:return"commit-merge";case x.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),ke=s.__name((t,e,n,o)=>{const r={x:0,y:0};if(t.parents.length>0){const a=S(t.parents);if(a){const l=o.get(a)??r;return e==="TB"?l.y+T:e==="BT"?(o.get(t.id)??r).y-T:l.x+T}}else return e==="TB"?I:e==="BT"?(o.get(t.id)??r).y-T:0;return 0},"calculatePosition"),Me=s.__name((t,e,n)=>{const o=u==="BT"&&n?e:e+E,r=u==="TB"||u==="BT"?o:p.get(t.branch)?.pos,a=u==="TB"||u==="BT"?p.get(t.branch)?.pos:o;if(a===void 0||r===void 0)throw new Error(`Position were undefined for commit ${t.id}`);return{x:a,y:r,posWithOffset:o}},"getCommitPosition"),P=s.__name((t,e,n)=>{if(!_)throw new Error("GitGraph config not found");const o=t.append("g").attr("class","commit-bullets"),r=t.append("g").attr("class","commit-labels");let a=u==="TB"||u==="BT"?I:0;const l=[...e.keys()],c=_?.parallelCommits??!1,f=s.__name(($,g)=>{const d=e.get($)?.seq,y=e.get(g)?.seq;return d!==void 0&&y!==void 0?d-y:0},"sortKeys");let h=l.sort(f);u==="BT"&&(c&&be(h,e,a),h=h.reverse()),h.forEach($=>{const g=e.get($);if(!g)throw new Error(`Commit not found for key ${$}`);c&&(a=ke(g,u,a,b));const d=Me(g,a,c);if(n){const y=Le(g),m=g.customType??g.type,O=p.get(g.branch)?.index??0;Ee(o,g,d,y,O,m),Te(r,g,d,a),Be(r,g,d,a)}u==="TB"||u==="BT"?b.set(g.id,{x:d.x,y:d.posWithOffset}):b.set(g.id,{x:d.posWithOffset,y:d.y}),a=u==="BT"&&c?a+T:a+T+E,a>C&&(C=a)})},"drawCommits"),Ie=s.__name((t,e,n,o,r)=>{const l=(u==="TB"||u==="BT"?n.x<o.x:n.y<o.y)?e.branch:t.branch,c=s.__name(h=>h.branch===l,"isOnBranchToGetCurve"),f=s.__name(h=>h.seq>t.seq&&h.seq<e.seq,"isBetweenCommits");return[...r.values()].some(h=>f(h)&&c(h))},"shouldRerouteArrow"),M=s.__name((t,e,n=0)=>{const o=t+Math.abs(t-e)/2;if(n>5)return o;if(R.every(l=>Math.abs(l-o)>=10))return R.push(o),o;const a=Math.abs(t-e);return M(t,e-a/5,n+1)},"findLane"),Re=s.__name((t,e,n,o)=>{const r=b.get(e.id),a=b.get(n.id);if(r===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${n.id}`);const l=Ie(e,n,r,a,o);let c="",f="",h=0,$=0,g=p.get(n.branch)?.index;n.type===x.MERGE&&e.id!==n.parents[0]&&(g=p.get(e.branch)?.index);let d;if(l){c="A 10 10, 0, 0, 0,",f="A 10 10, 0, 0, 1,",h=10,$=10;const y=r.y<a.y?M(r.y,a.y):M(a.y,r.y),m=r.x<a.x?M(r.x,a.x):M(a.x,r.x);u==="TB"?r.x<a.x?d=`M ${r.x} ${r.y} L ${m-h} ${r.y} ${f} ${m} ${r.y+$} L ${m} ${a.y-h} ${c} ${m+$} ${a.y} L ${a.x} ${a.y}`:(g=p.get(e.branch)?.index,d=`M ${r.x} ${r.y} L ${m+h} ${r.y} ${c} ${m} ${r.y+$} L ${m} ${a.y-h} ${f} ${m-$} ${a.y} L ${a.x} ${a.y}`):u==="BT"?r.x<a.x?d=`M ${r.x} ${r.y} L ${m-h} ${r.y} ${c} ${m} ${r.y-$} L ${m} ${a.y+h} ${f} ${m+$} ${a.y} L ${a.x} ${a.y}`:(g=p.get(e.branch)?.index,d=`M ${r.x} ${r.y} L ${m+h} ${r.y} ${f} ${m} ${r.y-$} L ${m} ${a.y+h} ${c} ${m-$} ${a.y} L ${a.x} ${a.y}`):r.y<a.y?d=`M ${r.x} ${r.y} L ${r.x} ${y-h} ${c} ${r.x+$} ${y} L ${a.x-h} ${y} ${f} ${a.x} ${y+$} L ${a.x} ${a.y}`:(g=p.get(e.branch)?.index,d=`M ${r.x} ${r.y} L ${r.x} ${y+h} ${f} ${r.x+$} ${y} L ${a.x-h} ${y} ${c} ${a.x} ${y-$} L ${a.x} ${a.y}`)}else c="A 20 20, 0, 0, 0,",f="A 20 20, 0, 0, 1,",h=20,$=20,u==="TB"?(r.x<a.x&&(n.type===x.MERGE&&e.id!==n.parents[0]?d=`M ${r.x} ${r.y} L ${r.x} ${a.y-h} ${c} ${r.x+$} ${a.y} L ${a.x} ${a.y}`:d=`M ${r.x} ${r.y} L ${a.x-h} ${r.y} ${f} ${a.x} ${r.y+$} L ${a.x} ${a.y}`),r.x>a.x&&(c="A 20 20, 0, 0, 0,",f="A 20 20, 0, 0, 1,",h=20,$=20,n.type===x.MERGE&&e.id!==n.parents[0]?d=`M ${r.x} ${r.y} L ${r.x} ${a.y-h} ${f} ${r.x-$} ${a.y} L ${a.x} ${a.y}`:d=`M ${r.x} ${r.y} L ${a.x+h} ${r.y} ${c} ${a.x} ${r.y+$} L ${a.x} ${a.y}`),r.x===a.x&&(d=`M ${r.x} ${r.y} L ${a.x} ${a.y}`)):u==="BT"?(r.x<a.x&&(n.type===x.MERGE&&e.id!==n.parents[0]?d=`M ${r.x} ${r.y} L ${r.x} ${a.y+h} ${f} ${r.x+$} ${a.y} L ${a.x} ${a.y}`:d=`M ${r.x} ${r.y} L ${a.x-h} ${r.y} ${c} ${a.x} ${r.y-$} L ${a.x} ${a.y}`),r.x>a.x&&(c="A 20 20, 0, 0, 0,",f="A 20 20, 0, 0, 1,",h=20,$=20,n.type===x.MERGE&&e.id!==n.parents[0]?d=`M ${r.x} ${r.y} L ${r.x} ${a.y+h} ${c} ${r.x-$} ${a.y} L ${a.x} ${a.y}`:d=`M ${r.x} ${r.y} L ${a.x-h} ${r.y} ${c} ${a.x} ${r.y-$} L ${a.x} ${a.y}`),r.x===a.x&&(d=`M ${r.x} ${r.y} L ${a.x} ${a.y}`)):(r.y<a.y&&(n.type===x.MERGE&&e.id!==n.parents[0]?d=`M ${r.x} ${r.y} L ${a.x-h} ${r.y} ${f} ${a.x} ${r.y+$} L ${a.x} ${a.y}`:d=`M ${r.x} ${r.y} L ${r.x} ${a.y-h} ${c} ${r.x+$} ${a.y} L ${a.x} ${a.y}`),r.y>a.y&&(n.type===x.MERGE&&e.id!==n.parents[0]?d=`M ${r.x} ${r.y} L ${a.x-h} ${r.y} ${c} ${a.x} ${r.y-$} L ${a.x} ${a.y}`:d=`M ${r.x} ${r.y} L ${r.x} ${a.y+h} ${f} ${r.x+$} ${a.y} L ${a.x} ${a.y}`),r.y===a.y&&(d=`M ${r.x} ${r.y} L ${a.x} ${a.y}`));if(d===void 0)throw new Error("Line definition not found");t.append("path").attr("d",d).attr("class","arrow arrow"+g%B)},"drawArrow"),Ge=s.__name((t,e)=>{const n=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(o=>{const r=e.get(o);r.parents&&r.parents.length>0&&r.parents.forEach(a=>{Re(n,e.get(a),r,e)})})},"drawArrows"),Oe=s.__name((t,e)=>{const n=t.append("g");e.forEach((o,r)=>{const a=r%B,l=p.get(o.name)?.pos;if(l===void 0)throw new Error(`Position not found for branch ${o.name}`);const c=n.append("line");c.attr("x1",0),c.attr("y1",l),c.attr("x2",C),c.attr("y2",l),c.attr("class","branch branch"+a),u==="TB"?(c.attr("y1",I),c.attr("x1",l),c.attr("y2",C),c.attr("x2",l)):u==="BT"&&(c.attr("y1",C),c.attr("x1",l),c.attr("y2",I),c.attr("x2",l)),R.push(l);const f=o.name,h=F(f),$=n.insert("rect"),d=n.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+a);d.node().appendChild(h);const y=h.getBBox();$.attr("class","branchLabelBkg label"+a).attr("rx",4).attr("ry",4).attr("x",-y.width-4-(_?.rotateCommitLabel===!0?30:0)).attr("y",-y.height/2+8).attr("width",y.width+18).attr("height",y.height+4),d.attr("transform","translate("+(-y.width-14-(_?.rotateCommitLabel===!0?30:0))+", "+(l-y.height/2-1)+")"),u==="TB"?($.attr("x",l-y.width/2-10).attr("y",0),d.attr("transform","translate("+(l-y.width/2-5)+", 0)")):u==="BT"?($.attr("x",l-y.width/2-10).attr("y",C),d.attr("transform","translate("+(l-y.width/2-5)+", "+C+")")):$.attr("transform","translate(-19, "+(l-y.height/2)+")")})},"drawBranches"),Ae=s.__name(function(t,e,n,o,r){return p.set(t,{pos:e,index:n}),e+=50+(r?40:0)+(u==="TB"||u==="BT"?o.width/2:0),e},"setBranchPosition"),qe=s.__name(function(t,e,n,o){if(xe(),s.log.debug("in gitgraph renderer",t+`
|
|
14
|
-
`,"id:",e,n),!_)throw new Error("GitGraph config not found");const r=_.rotateCommitLabel??!1,a=o.db;k=a.getCommits();const l=a.getBranchesAsObjArray();u=a.getDirection();const c=s.select(`[id="${e}"]`);let f=0;l.forEach((h,$)=>{const g=F(h.name),d=c.append("g"),y=d.insert("g").attr("class","branchLabel"),m=y.insert("g").attr("class","label branch-label");m.node()?.appendChild(g);const O=g.getBBox();f=Ae(h.name,f,$,O,r),m.remove(),y.remove(),d.remove()}),P(c,k,!1),_.showBranches&&Oe(c,l),Ge(c,k),P(c,k,!0),s.utils_default.insertTitle(c,"gitTitleText",_.titleTopMargin??0,a.getDiagramTitle()),s.setupGraphViewbox2(void 0,c,_.diagramPadding,_.useMaxWidth)},"draw"),Pe={draw:qe},He=s.__name(t=>`
|
|
15
|
-
.commit-id,
|
|
16
|
-
.commit-msg,
|
|
17
|
-
.branch-label {
|
|
18
|
-
fill: lightgrey;
|
|
19
|
-
color: lightgrey;
|
|
20
|
-
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
|
21
|
-
font-family: var(--mermaid-font-family);
|
|
22
|
-
}
|
|
23
|
-
${[0,1,2,3,4,5,6,7].map(e=>`
|
|
24
|
-
.branch-label${e} { fill: ${t["gitBranchLabel"+e]}; }
|
|
25
|
-
.commit${e} { stroke: ${t["git"+e]}; fill: ${t["git"+e]}; }
|
|
26
|
-
.commit-highlight${e} { stroke: ${t["gitInv"+e]}; fill: ${t["gitInv"+e]}; }
|
|
27
|
-
.label${e} { fill: ${t["git"+e]}; }
|
|
28
|
-
.arrow${e} { stroke: ${t["git"+e]}; }
|
|
29
|
-
`).join(`
|
|
30
|
-
`)}
|
|
31
|
-
|
|
32
|
-
.branch {
|
|
33
|
-
stroke-width: 1;
|
|
34
|
-
stroke: ${t.lineColor};
|
|
35
|
-
stroke-dasharray: 2;
|
|
36
|
-
}
|
|
37
|
-
.commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}
|
|
38
|
-
.commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }
|
|
39
|
-
.tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
|
|
40
|
-
.tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }
|
|
41
|
-
.tag-hole { fill: ${t.textColor}; }
|
|
42
|
-
|
|
43
|
-
.commit-merge {
|
|
44
|
-
stroke: ${t.primaryColor};
|
|
45
|
-
fill: ${t.primaryColor};
|
|
46
|
-
}
|
|
47
|
-
.commit-reverse {
|
|
48
|
-
stroke: ${t.primaryColor};
|
|
49
|
-
fill: ${t.primaryColor};
|
|
50
|
-
stroke-width: 3;
|
|
51
|
-
}
|
|
52
|
-
.commit-highlight-outer {
|
|
53
|
-
}
|
|
54
|
-
.commit-highlight-inner {
|
|
55
|
-
stroke: ${t.primaryColor};
|
|
56
|
-
fill: ${t.primaryColor};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.arrow { stroke-width: 8; stroke-linecap: round; fill: none}
|
|
60
|
-
.gitTitleText {
|
|
61
|
-
text-anchor: middle;
|
|
62
|
-
font-size: 18px;
|
|
63
|
-
fill: ${t.textColor};
|
|
64
|
-
}
|
|
65
|
-
`,"getStyles"),De=He,Ne={parser:ue,db:z,renderer:Pe,styles:De};exports.diagram=Ne;
|
package/dist/graph-Bza-HyX6.js
DELETED
|
@@ -1,381 +0,0 @@
|
|
|
1
|
-
import { aO as T, aP as C, aQ as z, aR as R, aS as S, aT as k, aU as V, aV as L, aW as K, aX as j, aY as ee, aZ as te, a_ as re, a$ as se, b0 as ne, b1 as ie, aE as ae, b2 as oe, b3 as ue, b4 as he, b5 as y, b6 as $, b7 as v } from "./mermaid.core-B1lFjYb9.js";
|
|
2
|
-
import { k as d, g as Y, s as de, e as ce, f as fe, h as ge, j as le, c as be, l as _e, b as pe, m, n as g, r as ye } from "./_baseUniq-BfVwFITD.js";
|
|
3
|
-
function me(t, e) {
|
|
4
|
-
return t && T(e, d(e), t);
|
|
5
|
-
}
|
|
6
|
-
function je(t, e) {
|
|
7
|
-
return t && T(e, C(e), t);
|
|
8
|
-
}
|
|
9
|
-
function Te(t, e) {
|
|
10
|
-
return T(t, Y(t), e);
|
|
11
|
-
}
|
|
12
|
-
var Oe = Object.getOwnPropertySymbols, W = Oe ? function(t) {
|
|
13
|
-
for (var e = []; t; )
|
|
14
|
-
ce(e, Y(t)), t = z(t);
|
|
15
|
-
return e;
|
|
16
|
-
} : de;
|
|
17
|
-
function Ee(t, e) {
|
|
18
|
-
return T(t, W(t), e);
|
|
19
|
-
}
|
|
20
|
-
function Ae(t) {
|
|
21
|
-
return fe(t, C, W);
|
|
22
|
-
}
|
|
23
|
-
var Ce = Object.prototype, Le = Ce.hasOwnProperty;
|
|
24
|
-
function we(t) {
|
|
25
|
-
var e = t.length, r = new t.constructor(e);
|
|
26
|
-
return e && typeof t[0] == "string" && Le.call(t, "index") && (r.index = t.index, r.input = t.input), r;
|
|
27
|
-
}
|
|
28
|
-
function Ne(t, e) {
|
|
29
|
-
var r = e ? R(t.buffer) : t.buffer;
|
|
30
|
-
return new t.constructor(r, t.byteOffset, t.byteLength);
|
|
31
|
-
}
|
|
32
|
-
var Pe = /\w*$/;
|
|
33
|
-
function Fe(t) {
|
|
34
|
-
var e = new t.constructor(t.source, Pe.exec(t));
|
|
35
|
-
return e.lastIndex = t.lastIndex, e;
|
|
36
|
-
}
|
|
37
|
-
var I = S ? S.prototype : void 0, D = I ? I.valueOf : void 0;
|
|
38
|
-
function Se(t) {
|
|
39
|
-
return D ? Object(D.call(t)) : {};
|
|
40
|
-
}
|
|
41
|
-
var $e = "[object Boolean]", ve = "[object Date]", Ie = "[object Map]", De = "[object Number]", Me = "[object RegExp]", Ue = "[object Set]", Ge = "[object String]", xe = "[object Symbol]", Be = "[object ArrayBuffer]", Re = "[object DataView]", Ve = "[object Float32Array]", Ke = "[object Float64Array]", Ye = "[object Int8Array]", We = "[object Int16Array]", qe = "[object Int32Array]", He = "[object Uint8Array]", Qe = "[object Uint8ClampedArray]", Xe = "[object Uint16Array]", Ze = "[object Uint32Array]";
|
|
42
|
-
function Je(t, e, r) {
|
|
43
|
-
var s = t.constructor;
|
|
44
|
-
switch (e) {
|
|
45
|
-
case Be:
|
|
46
|
-
return R(t);
|
|
47
|
-
case $e:
|
|
48
|
-
case ve:
|
|
49
|
-
return new s(+t);
|
|
50
|
-
case Re:
|
|
51
|
-
return Ne(t, r);
|
|
52
|
-
case Ve:
|
|
53
|
-
case Ke:
|
|
54
|
-
case Ye:
|
|
55
|
-
case We:
|
|
56
|
-
case qe:
|
|
57
|
-
case He:
|
|
58
|
-
case Qe:
|
|
59
|
-
case Xe:
|
|
60
|
-
case Ze:
|
|
61
|
-
return k(t, r);
|
|
62
|
-
case Ie:
|
|
63
|
-
return new s();
|
|
64
|
-
case De:
|
|
65
|
-
case Ge:
|
|
66
|
-
return new s(t);
|
|
67
|
-
case Me:
|
|
68
|
-
return Fe(t);
|
|
69
|
-
case Ue:
|
|
70
|
-
return new s();
|
|
71
|
-
case xe:
|
|
72
|
-
return Se(t);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
var ze = "[object Map]";
|
|
76
|
-
function ke(t) {
|
|
77
|
-
return V(t) && L(t) == ze;
|
|
78
|
-
}
|
|
79
|
-
var M = j && j.isMap, et = M ? K(M) : ke, tt = "[object Set]";
|
|
80
|
-
function rt(t) {
|
|
81
|
-
return V(t) && L(t) == tt;
|
|
82
|
-
}
|
|
83
|
-
var U = j && j.isSet, st = U ? K(U) : rt, nt = 1, it = 2, at = 4, q = "[object Arguments]", ot = "[object Array]", ut = "[object Boolean]", ht = "[object Date]", dt = "[object Error]", H = "[object Function]", ct = "[object GeneratorFunction]", ft = "[object Map]", gt = "[object Number]", Q = "[object Object]", lt = "[object RegExp]", bt = "[object Set]", _t = "[object String]", pt = "[object Symbol]", yt = "[object WeakMap]", mt = "[object ArrayBuffer]", jt = "[object DataView]", Tt = "[object Float32Array]", Ot = "[object Float64Array]", Et = "[object Int8Array]", At = "[object Int16Array]", Ct = "[object Int32Array]", Lt = "[object Uint8Array]", wt = "[object Uint8ClampedArray]", Nt = "[object Uint16Array]", Pt = "[object Uint32Array]", o = {};
|
|
84
|
-
o[q] = o[ot] = o[mt] = o[jt] = o[ut] = o[ht] = o[Tt] = o[Ot] = o[Et] = o[At] = o[Ct] = o[ft] = o[gt] = o[Q] = o[lt] = o[bt] = o[_t] = o[pt] = o[Lt] = o[wt] = o[Nt] = o[Pt] = !0;
|
|
85
|
-
o[dt] = o[H] = o[yt] = !1;
|
|
86
|
-
function O(t, e, r, s, n, a) {
|
|
87
|
-
var i, u = e & nt, h = e & it, Z = e & at;
|
|
88
|
-
if (i !== void 0)
|
|
89
|
-
return i;
|
|
90
|
-
if (!ee(t))
|
|
91
|
-
return t;
|
|
92
|
-
var w = ae(t);
|
|
93
|
-
if (w) {
|
|
94
|
-
if (i = we(t), !u)
|
|
95
|
-
return te(t, i);
|
|
96
|
-
} else {
|
|
97
|
-
var b = L(t), N = b == H || b == ct;
|
|
98
|
-
if (re(t))
|
|
99
|
-
return se(t, u);
|
|
100
|
-
if (b == Q || b == q || N && !n) {
|
|
101
|
-
if (i = h || N ? {} : ne(t), !u)
|
|
102
|
-
return h ? Ee(t, je(i, t)) : Te(t, me(i, t));
|
|
103
|
-
} else {
|
|
104
|
-
if (!o[b])
|
|
105
|
-
return n ? t : {};
|
|
106
|
-
i = Je(t, b, u);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
a || (a = new ie());
|
|
110
|
-
var P = a.get(t);
|
|
111
|
-
if (P)
|
|
112
|
-
return P;
|
|
113
|
-
a.set(t, i), st(t) ? t.forEach(function(c) {
|
|
114
|
-
i.add(O(c, e, r, c, t, a));
|
|
115
|
-
}) : et(t) && t.forEach(function(c, f) {
|
|
116
|
-
i.set(f, O(c, e, r, f, t, a));
|
|
117
|
-
});
|
|
118
|
-
var J = Z ? h ? Ae : ge : h ? C : d, F = w ? void 0 : J(t);
|
|
119
|
-
return le(F || t, function(c, f) {
|
|
120
|
-
F && (f = c, c = t[f]), oe(i, f, O(c, e, r, f, t, a));
|
|
121
|
-
}), i;
|
|
122
|
-
}
|
|
123
|
-
function Ft(t, e) {
|
|
124
|
-
return be(e, function(r) {
|
|
125
|
-
return t[r];
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
function E(t) {
|
|
129
|
-
return t == null ? [] : Ft(t, d(t));
|
|
130
|
-
}
|
|
131
|
-
function _(t) {
|
|
132
|
-
return t === void 0;
|
|
133
|
-
}
|
|
134
|
-
var St = ue(function(t) {
|
|
135
|
-
return _e(pe(t, 1, he, !0));
|
|
136
|
-
}), $t = "\0", l = "\0", G = "";
|
|
137
|
-
class X {
|
|
138
|
-
constructor(e = {}) {
|
|
139
|
-
this._isDirected = Object.prototype.hasOwnProperty.call(e, "directed") ? e.directed : !0, this._isMultigraph = Object.prototype.hasOwnProperty.call(e, "multigraph") ? e.multigraph : !1, this._isCompound = Object.prototype.hasOwnProperty.call(e, "compound") ? e.compound : !1, this._label = void 0, this._defaultNodeLabelFn = y(void 0), this._defaultEdgeLabelFn = y(void 0), this._nodes = {}, this._isCompound && (this._parent = {}, this._children = {}, this._children[l] = {}), this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {};
|
|
140
|
-
}
|
|
141
|
-
/* === Graph functions ========= */
|
|
142
|
-
isDirected() {
|
|
143
|
-
return this._isDirected;
|
|
144
|
-
}
|
|
145
|
-
isMultigraph() {
|
|
146
|
-
return this._isMultigraph;
|
|
147
|
-
}
|
|
148
|
-
isCompound() {
|
|
149
|
-
return this._isCompound;
|
|
150
|
-
}
|
|
151
|
-
setGraph(e) {
|
|
152
|
-
return this._label = e, this;
|
|
153
|
-
}
|
|
154
|
-
graph() {
|
|
155
|
-
return this._label;
|
|
156
|
-
}
|
|
157
|
-
/* === Node functions ========== */
|
|
158
|
-
setDefaultNodeLabel(e) {
|
|
159
|
-
return $(e) || (e = y(e)), this._defaultNodeLabelFn = e, this;
|
|
160
|
-
}
|
|
161
|
-
nodeCount() {
|
|
162
|
-
return this._nodeCount;
|
|
163
|
-
}
|
|
164
|
-
nodes() {
|
|
165
|
-
return d(this._nodes);
|
|
166
|
-
}
|
|
167
|
-
sources() {
|
|
168
|
-
var e = this;
|
|
169
|
-
return m(this.nodes(), function(r) {
|
|
170
|
-
return v(e._in[r]);
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
sinks() {
|
|
174
|
-
var e = this;
|
|
175
|
-
return m(this.nodes(), function(r) {
|
|
176
|
-
return v(e._out[r]);
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
setNodes(e, r) {
|
|
180
|
-
var s = arguments, n = this;
|
|
181
|
-
return g(e, function(a) {
|
|
182
|
-
s.length > 1 ? n.setNode(a, r) : n.setNode(a);
|
|
183
|
-
}), this;
|
|
184
|
-
}
|
|
185
|
-
setNode(e, r) {
|
|
186
|
-
return Object.prototype.hasOwnProperty.call(this._nodes, e) ? (arguments.length > 1 && (this._nodes[e] = r), this) : (this._nodes[e] = arguments.length > 1 ? r : this._defaultNodeLabelFn(e), this._isCompound && (this._parent[e] = l, this._children[e] = {}, this._children[l][e] = !0), this._in[e] = {}, this._preds[e] = {}, this._out[e] = {}, this._sucs[e] = {}, ++this._nodeCount, this);
|
|
187
|
-
}
|
|
188
|
-
node(e) {
|
|
189
|
-
return this._nodes[e];
|
|
190
|
-
}
|
|
191
|
-
hasNode(e) {
|
|
192
|
-
return Object.prototype.hasOwnProperty.call(this._nodes, e);
|
|
193
|
-
}
|
|
194
|
-
removeNode(e) {
|
|
195
|
-
if (Object.prototype.hasOwnProperty.call(this._nodes, e)) {
|
|
196
|
-
var r = (s) => this.removeEdge(this._edgeObjs[s]);
|
|
197
|
-
delete this._nodes[e], this._isCompound && (this._removeFromParentsChildList(e), delete this._parent[e], g(this.children(e), (s) => {
|
|
198
|
-
this.setParent(s);
|
|
199
|
-
}), delete this._children[e]), g(d(this._in[e]), r), delete this._in[e], delete this._preds[e], g(d(this._out[e]), r), delete this._out[e], delete this._sucs[e], --this._nodeCount;
|
|
200
|
-
}
|
|
201
|
-
return this;
|
|
202
|
-
}
|
|
203
|
-
setParent(e, r) {
|
|
204
|
-
if (!this._isCompound)
|
|
205
|
-
throw new Error("Cannot set parent in a non-compound graph");
|
|
206
|
-
if (_(r))
|
|
207
|
-
r = l;
|
|
208
|
-
else {
|
|
209
|
-
r += "";
|
|
210
|
-
for (var s = r; !_(s); s = this.parent(s))
|
|
211
|
-
if (s === e)
|
|
212
|
-
throw new Error("Setting " + r + " as parent of " + e + " would create a cycle");
|
|
213
|
-
this.setNode(r);
|
|
214
|
-
}
|
|
215
|
-
return this.setNode(e), this._removeFromParentsChildList(e), this._parent[e] = r, this._children[r][e] = !0, this;
|
|
216
|
-
}
|
|
217
|
-
_removeFromParentsChildList(e) {
|
|
218
|
-
delete this._children[this._parent[e]][e];
|
|
219
|
-
}
|
|
220
|
-
parent(e) {
|
|
221
|
-
if (this._isCompound) {
|
|
222
|
-
var r = this._parent[e];
|
|
223
|
-
if (r !== l)
|
|
224
|
-
return r;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
children(e) {
|
|
228
|
-
if (_(e) && (e = l), this._isCompound) {
|
|
229
|
-
var r = this._children[e];
|
|
230
|
-
if (r)
|
|
231
|
-
return d(r);
|
|
232
|
-
} else {
|
|
233
|
-
if (e === l)
|
|
234
|
-
return this.nodes();
|
|
235
|
-
if (this.hasNode(e))
|
|
236
|
-
return [];
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
predecessors(e) {
|
|
240
|
-
var r = this._preds[e];
|
|
241
|
-
if (r)
|
|
242
|
-
return d(r);
|
|
243
|
-
}
|
|
244
|
-
successors(e) {
|
|
245
|
-
var r = this._sucs[e];
|
|
246
|
-
if (r)
|
|
247
|
-
return d(r);
|
|
248
|
-
}
|
|
249
|
-
neighbors(e) {
|
|
250
|
-
var r = this.predecessors(e);
|
|
251
|
-
if (r)
|
|
252
|
-
return St(r, this.successors(e));
|
|
253
|
-
}
|
|
254
|
-
isLeaf(e) {
|
|
255
|
-
var r;
|
|
256
|
-
return this.isDirected() ? r = this.successors(e) : r = this.neighbors(e), r.length === 0;
|
|
257
|
-
}
|
|
258
|
-
filterNodes(e) {
|
|
259
|
-
var r = new this.constructor({
|
|
260
|
-
directed: this._isDirected,
|
|
261
|
-
multigraph: this._isMultigraph,
|
|
262
|
-
compound: this._isCompound
|
|
263
|
-
});
|
|
264
|
-
r.setGraph(this.graph());
|
|
265
|
-
var s = this;
|
|
266
|
-
g(this._nodes, function(i, u) {
|
|
267
|
-
e(u) && r.setNode(u, i);
|
|
268
|
-
}), g(this._edgeObjs, function(i) {
|
|
269
|
-
r.hasNode(i.v) && r.hasNode(i.w) && r.setEdge(i, s.edge(i));
|
|
270
|
-
});
|
|
271
|
-
var n = {};
|
|
272
|
-
function a(i) {
|
|
273
|
-
var u = s.parent(i);
|
|
274
|
-
return u === void 0 || r.hasNode(u) ? (n[i] = u, u) : u in n ? n[u] : a(u);
|
|
275
|
-
}
|
|
276
|
-
return this._isCompound && g(r.nodes(), function(i) {
|
|
277
|
-
r.setParent(i, a(i));
|
|
278
|
-
}), r;
|
|
279
|
-
}
|
|
280
|
-
/* === Edge functions ========== */
|
|
281
|
-
setDefaultEdgeLabel(e) {
|
|
282
|
-
return $(e) || (e = y(e)), this._defaultEdgeLabelFn = e, this;
|
|
283
|
-
}
|
|
284
|
-
edgeCount() {
|
|
285
|
-
return this._edgeCount;
|
|
286
|
-
}
|
|
287
|
-
edges() {
|
|
288
|
-
return E(this._edgeObjs);
|
|
289
|
-
}
|
|
290
|
-
setPath(e, r) {
|
|
291
|
-
var s = this, n = arguments;
|
|
292
|
-
return ye(e, function(a, i) {
|
|
293
|
-
return n.length > 1 ? s.setEdge(a, i, r) : s.setEdge(a, i), i;
|
|
294
|
-
}), this;
|
|
295
|
-
}
|
|
296
|
-
/*
|
|
297
|
-
* setEdge(v, w, [value, [name]])
|
|
298
|
-
* setEdge({ v, w, [name] }, [value])
|
|
299
|
-
*/
|
|
300
|
-
setEdge() {
|
|
301
|
-
var e, r, s, n, a = !1, i = arguments[0];
|
|
302
|
-
typeof i == "object" && i !== null && "v" in i ? (e = i.v, r = i.w, s = i.name, arguments.length === 2 && (n = arguments[1], a = !0)) : (e = i, r = arguments[1], s = arguments[3], arguments.length > 2 && (n = arguments[2], a = !0)), e = "" + e, r = "" + r, _(s) || (s = "" + s);
|
|
303
|
-
var u = p(this._isDirected, e, r, s);
|
|
304
|
-
if (Object.prototype.hasOwnProperty.call(this._edgeLabels, u))
|
|
305
|
-
return a && (this._edgeLabels[u] = n), this;
|
|
306
|
-
if (!_(s) && !this._isMultigraph)
|
|
307
|
-
throw new Error("Cannot set a named edge when isMultigraph = false");
|
|
308
|
-
this.setNode(e), this.setNode(r), this._edgeLabels[u] = a ? n : this._defaultEdgeLabelFn(e, r, s);
|
|
309
|
-
var h = vt(this._isDirected, e, r, s);
|
|
310
|
-
return e = h.v, r = h.w, Object.freeze(h), this._edgeObjs[u] = h, x(this._preds[r], e), x(this._sucs[e], r), this._in[r][u] = h, this._out[e][u] = h, this._edgeCount++, this;
|
|
311
|
-
}
|
|
312
|
-
edge(e, r, s) {
|
|
313
|
-
var n = arguments.length === 1 ? A(this._isDirected, arguments[0]) : p(this._isDirected, e, r, s);
|
|
314
|
-
return this._edgeLabels[n];
|
|
315
|
-
}
|
|
316
|
-
hasEdge(e, r, s) {
|
|
317
|
-
var n = arguments.length === 1 ? A(this._isDirected, arguments[0]) : p(this._isDirected, e, r, s);
|
|
318
|
-
return Object.prototype.hasOwnProperty.call(this._edgeLabels, n);
|
|
319
|
-
}
|
|
320
|
-
removeEdge(e, r, s) {
|
|
321
|
-
var n = arguments.length === 1 ? A(this._isDirected, arguments[0]) : p(this._isDirected, e, r, s), a = this._edgeObjs[n];
|
|
322
|
-
return a && (e = a.v, r = a.w, delete this._edgeLabels[n], delete this._edgeObjs[n], B(this._preds[r], e), B(this._sucs[e], r), delete this._in[r][n], delete this._out[e][n], this._edgeCount--), this;
|
|
323
|
-
}
|
|
324
|
-
inEdges(e, r) {
|
|
325
|
-
var s = this._in[e];
|
|
326
|
-
if (s) {
|
|
327
|
-
var n = E(s);
|
|
328
|
-
return r ? m(n, function(a) {
|
|
329
|
-
return a.v === r;
|
|
330
|
-
}) : n;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
outEdges(e, r) {
|
|
334
|
-
var s = this._out[e];
|
|
335
|
-
if (s) {
|
|
336
|
-
var n = E(s);
|
|
337
|
-
return r ? m(n, function(a) {
|
|
338
|
-
return a.w === r;
|
|
339
|
-
}) : n;
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
nodeEdges(e, r) {
|
|
343
|
-
var s = this.inEdges(e, r);
|
|
344
|
-
if (s)
|
|
345
|
-
return s.concat(this.outEdges(e, r));
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
X.prototype._nodeCount = 0;
|
|
349
|
-
X.prototype._edgeCount = 0;
|
|
350
|
-
function x(t, e) {
|
|
351
|
-
t[e] ? t[e]++ : t[e] = 1;
|
|
352
|
-
}
|
|
353
|
-
function B(t, e) {
|
|
354
|
-
--t[e] || delete t[e];
|
|
355
|
-
}
|
|
356
|
-
function p(t, e, r, s) {
|
|
357
|
-
var n = "" + e, a = "" + r;
|
|
358
|
-
if (!t && n > a) {
|
|
359
|
-
var i = n;
|
|
360
|
-
n = a, a = i;
|
|
361
|
-
}
|
|
362
|
-
return n + G + a + G + (_(s) ? $t : s);
|
|
363
|
-
}
|
|
364
|
-
function vt(t, e, r, s) {
|
|
365
|
-
var n = "" + e, a = "" + r;
|
|
366
|
-
if (!t && n > a) {
|
|
367
|
-
var i = n;
|
|
368
|
-
n = a, a = i;
|
|
369
|
-
}
|
|
370
|
-
var u = { v: n, w: a };
|
|
371
|
-
return s && (u.name = s), u;
|
|
372
|
-
}
|
|
373
|
-
function A(t, e) {
|
|
374
|
-
return p(t, e.v, e.w, e.name);
|
|
375
|
-
}
|
|
376
|
-
export {
|
|
377
|
-
X as G,
|
|
378
|
-
O as b,
|
|
379
|
-
_ as i,
|
|
380
|
-
E as v
|
|
381
|
-
};
|
package/dist/graph-CE_Z8OkL.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const o=require("./mermaid.core-C8vi9eg6.cjs"),u=require("./_baseUniq-D-3LoSZp.cjs");function B(t,e){return t&&o.copyObject(e,u.keys(e),t)}function x(t,e){return t&&o.copyObject(e,o.keysIn(e),t)}function R(t,e){return o.copyObject(t,u.getSymbols(t),e)}var V=Object.getOwnPropertySymbols,v=V?function(t){for(var e=[];t;)u.arrayPush(e,u.getSymbols(t)),t=o.getPrototype(t);return e}:u.stubArray;function k(t,e){return o.copyObject(t,v(t),e)}function q(t){return u.baseGetAllKeys(t,o.keysIn,v)}var K=Object.prototype,Y=K.hasOwnProperty;function H(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Y.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function W(t,e){var r=e?o.cloneArrayBuffer(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var J=/\w*$/;function Q(t){var e=new t.constructor(t.source,J.exec(t));return e.lastIndex=t.lastIndex,e}var L=o.Symbol?o.Symbol.prototype:void 0,w=L?L.valueOf:void 0;function X(t){return w?Object(w.call(t)):{}}var Z="[object Boolean]",z="[object Date]",ee="[object Map]",te="[object Number]",re="[object RegExp]",se="[object Set]",ne="[object String]",ie="[object Symbol]",oe="[object ArrayBuffer]",ae="[object DataView]",ue="[object Float32Array]",he="[object Float64Array]",ce="[object Int8Array]",de="[object Int16Array]",fe="[object Int32Array]",le="[object Uint8Array]",ge="[object Uint8ClampedArray]",_e="[object Uint16Array]",be="[object Uint32Array]";function pe(t,e,r){var s=t.constructor;switch(e){case oe:return o.cloneArrayBuffer(t);case Z:case z:return new s(+t);case ae:return W(t,r);case ue:case he:case ce:case de:case fe:case le:case ge:case _e:case be:return o.cloneTypedArray(t,r);case ee:return new s;case te:case ne:return new s(t);case re:return Q(t);case se:return new s;case ie:return X(t)}}var ye="[object Map]";function me(t){return o.isObjectLike(t)&&o.getTag(t)==ye}var N=o.nodeUtil&&o.nodeUtil.isMap,je=N?o.baseUnary(N):me,Te="[object Set]";function Oe(t){return o.isObjectLike(t)&&o.getTag(t)==Te}var F=o.nodeUtil&&o.nodeUtil.isSet,Ee=F?o.baseUnary(F):Oe,Ae=1,Ce=2,Le=4,I="[object Arguments]",we="[object Array]",Ne="[object Boolean]",Fe="[object Date]",Se="[object Error]",D="[object Function]",$e="[object GeneratorFunction]",Pe="[object Map]",ve="[object Number]",M="[object Object]",Ie="[object RegExp]",De="[object Set]",Me="[object String]",Ue="[object Symbol]",Ge="[object WeakMap]",Be="[object ArrayBuffer]",xe="[object DataView]",Re="[object Float32Array]",Ve="[object Float64Array]",ke="[object Int8Array]",qe="[object Int16Array]",Ke="[object Int32Array]",Ye="[object Uint8Array]",He="[object Uint8ClampedArray]",We="[object Uint16Array]",Je="[object Uint32Array]",h={};h[I]=h[we]=h[Be]=h[xe]=h[Ne]=h[Fe]=h[Re]=h[Ve]=h[ke]=h[qe]=h[Ke]=h[Pe]=h[ve]=h[M]=h[Ie]=h[De]=h[Me]=h[Ue]=h[Ye]=h[He]=h[We]=h[Je]=!0;h[Se]=h[D]=h[Ge]=!1;function y(t,e,r,s,n,a){var i,c=e&Ae,d=e&Ce,U=e&Le;if(i!==void 0)return i;if(!o.isObject(t))return t;var O=o.isArray(t);if(O){if(i=H(t),!c)return o.copyArray(t,i)}else{var b=o.getTag(t),E=b==D||b==$e;if(o.isBuffer(t))return o.cloneBuffer(t,c);if(b==M||b==I||E&&!n){if(i=d||E?{}:o.initCloneObject(t),!c)return d?k(t,x(i,t)):R(t,B(i,t))}else{if(!h[b])return n?t:{};i=pe(t,b,c)}}a||(a=new o.Stack);var A=a.get(t);if(A)return A;a.set(t,i),Ee(t)?t.forEach(function(f){i.add(y(f,e,r,f,t,a))}):je(t)&&t.forEach(function(f,l){i.set(l,y(f,e,r,l,t,a))});var G=U?d?q:u.getAllKeys:d?o.keysIn:u.keys,C=O?void 0:G(t);return u.arrayEach(C||t,function(f,l){C&&(l=f,f=t[l]),o.assignValue(i,l,y(f,e,r,l,t,a))}),i}function Qe(t,e){return u.arrayMap(e,function(r){return t[r]})}function m(t){return t==null?[]:Qe(t,u.keys(t))}function _(t){return t===void 0}var Xe=o.baseRest(function(t){return u.baseUniq(u.baseFlatten(t,1,o.isArrayLikeObject,!0))}),Ze="\0",g="\0",S="";class T{constructor(e={}){this._isDirected=Object.prototype.hasOwnProperty.call(e,"directed")?e.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(e,"multigraph")?e.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(e,"compound")?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=o.constant$2(void 0),this._defaultEdgeLabelFn=o.constant$2(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[g]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return o.isFunction(e)||(e=o.constant$2(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return u.keys(this._nodes)}sources(){var e=this;return u.filter(this.nodes(),function(r){return o.isEmpty(e._in[r])})}sinks(){var e=this;return u.filter(this.nodes(),function(r){return o.isEmpty(e._out[r])})}setNodes(e,r){var s=arguments,n=this;return u.forEach(e,function(a){s.length>1?n.setNode(a,r):n.setNode(a)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=g,this._children[e]={},this._children[g][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=s=>this.removeEdge(this._edgeObjs[s]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],u.forEach(this.children(e),s=>{this.setParent(s)}),delete this._children[e]),u.forEach(u.keys(this._in[e]),r),delete this._in[e],delete this._preds[e],u.forEach(u.keys(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(_(r))r=g;else{r+="";for(var s=r;!_(s);s=this.parent(s))if(s===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==g)return r}}children(e){if(_(e)&&(e=g),this._isCompound){var r=this._children[e];if(r)return u.keys(r)}else{if(e===g)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return u.keys(r)}successors(e){var r=this._sucs[e];if(r)return u.keys(r)}neighbors(e){var r=this.predecessors(e);if(r)return Xe(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var s=this;u.forEach(this._nodes,function(i,c){e(c)&&r.setNode(c,i)}),u.forEach(this._edgeObjs,function(i){r.hasNode(i.v)&&r.hasNode(i.w)&&r.setEdge(i,s.edge(i))});var n={};function a(i){var c=s.parent(i);return c===void 0||r.hasNode(c)?(n[i]=c,c):c in n?n[c]:a(c)}return this._isCompound&&u.forEach(r.nodes(),function(i){r.setParent(i,a(i))}),r}setDefaultEdgeLabel(e){return o.isFunction(e)||(e=o.constant$2(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return m(this._edgeObjs)}setPath(e,r){var s=this,n=arguments;return u.reduce(e,function(a,i){return n.length>1?s.setEdge(a,i,r):s.setEdge(a,i),i}),this}setEdge(){var e,r,s,n,a=!1,i=arguments[0];typeof i=="object"&&i!==null&&"v"in i?(e=i.v,r=i.w,s=i.name,arguments.length===2&&(n=arguments[1],a=!0)):(e=i,r=arguments[1],s=arguments[3],arguments.length>2&&(n=arguments[2],a=!0)),e=""+e,r=""+r,_(s)||(s=""+s);var c=p(this._isDirected,e,r,s);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,c))return a&&(this._edgeLabels[c]=n),this;if(!_(s)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[c]=a?n:this._defaultEdgeLabelFn(e,r,s);var d=ze(this._isDirected,e,r,s);return e=d.v,r=d.w,Object.freeze(d),this._edgeObjs[c]=d,$(this._preds[r],e),$(this._sucs[e],r),this._in[r][c]=d,this._out[e][c]=d,this._edgeCount++,this}edge(e,r,s){var n=arguments.length===1?j(this._isDirected,arguments[0]):p(this._isDirected,e,r,s);return this._edgeLabels[n]}hasEdge(e,r,s){var n=arguments.length===1?j(this._isDirected,arguments[0]):p(this._isDirected,e,r,s);return Object.prototype.hasOwnProperty.call(this._edgeLabels,n)}removeEdge(e,r,s){var n=arguments.length===1?j(this._isDirected,arguments[0]):p(this._isDirected,e,r,s),a=this._edgeObjs[n];return a&&(e=a.v,r=a.w,delete this._edgeLabels[n],delete this._edgeObjs[n],P(this._preds[r],e),P(this._sucs[e],r),delete this._in[r][n],delete this._out[e][n],this._edgeCount--),this}inEdges(e,r){var s=this._in[e];if(s){var n=m(s);return r?u.filter(n,function(a){return a.v===r}):n}}outEdges(e,r){var s=this._out[e];if(s){var n=m(s);return r?u.filter(n,function(a){return a.w===r}):n}}nodeEdges(e,r){var s=this.inEdges(e,r);if(s)return s.concat(this.outEdges(e,r))}}T.prototype._nodeCount=0;T.prototype._edgeCount=0;function $(t,e){t[e]?t[e]++:t[e]=1}function P(t,e){--t[e]||delete t[e]}function p(t,e,r,s){var n=""+e,a=""+r;if(!t&&n>a){var i=n;n=a,a=i}return n+S+a+S+(_(s)?Ze:s)}function ze(t,e,r,s){var n=""+e,a=""+r;if(!t&&n>a){var i=n;n=a,a=i}var c={v:n,w:a};return s&&(c.name=s),c}function j(t,e){return p(t,e.v,e.w,e.name)}exports.Graph=T;exports.baseClone=y;exports.isUndefined=_;exports.values=m;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./mermaid-parser.core-Ba9EAFlD.cjs");exports.InfoModule=e.InfoModule;exports.createInfoServices=e.createInfoServices;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./mermaid.core-C8vi9eg6.cjs"),o=require("./mermaid-parser.core-Ba9EAFlD.cjs");var s={parse:e.__name(async r=>{const a=await o.parse("info",r);e.log.debug(a)},"parse")},i={version:e.package_default.version+""},g=e.__name(()=>i.version,"getVersion"),d={getVersion:g},v=e.__name((r,a,n)=>{e.log.debug(`rendering info diagram
|
|
2
|
-
`+r);const t=e.selectSvgElement(a);e.configureSvgSize(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),c={draw:v},m={parser:s,db:d,renderer:c};exports.diagram=m;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { _ as e, l as s, H as o, e as i, I as g } from "./mermaid.core-B1lFjYb9.js";
|
|
2
|
-
import { p } from "./mermaid-parser.core-B9wV8XMP.js";
|
|
3
|
-
var v = {
|
|
4
|
-
parse: /* @__PURE__ */ e(async (r) => {
|
|
5
|
-
const a = await p("info", r);
|
|
6
|
-
s.debug(a);
|
|
7
|
-
}, "parse")
|
|
8
|
-
}, d = {
|
|
9
|
-
version: g.version + ""
|
|
10
|
-
}, c = /* @__PURE__ */ e(() => d.version, "getVersion"), m = {
|
|
11
|
-
getVersion: c
|
|
12
|
-
}, l = /* @__PURE__ */ e((r, a, n) => {
|
|
13
|
-
s.debug(`rendering info diagram
|
|
14
|
-
` + r);
|
|
15
|
-
const t = o(a);
|
|
16
|
-
i(t, 100, 400, !0), t.append("g").append("text").attr("x", 100).attr("y", 40).attr("class", "version").attr("font-size", 32).style("text-anchor", "middle").text(`v${n}`);
|
|
17
|
-
}, "draw"), f = { draw: l }, b = {
|
|
18
|
-
parser: v,
|
|
19
|
-
db: m,
|
|
20
|
-
renderer: f
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
b as diagram
|
|
24
|
-
};
|
package/dist/init-CHZsXQcr.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function a(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}exports.initRange=a;
|