cc-viewer 1.7.8 → 1.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/assets/{App-DtsIVPu6.js → App-CYvr5YQv.js} +2 -2
  2. package/dist/assets/{MdxEditorPanel-DWPAEnpm.js → MdxEditorPanel-D1MOJabL.js} +1 -1
  3. package/dist/assets/{Mobile-DHwMZG4N.js → Mobile-B7GXxkfK.js} +1 -1
  4. package/dist/assets/{ProxyStatsModal-D9lTz0-T.js → ProxyStatsModal-BqH9cIks.js} +1 -1
  5. package/dist/assets/_baseUniq-aTokVjQN.js +1 -0
  6. package/dist/assets/arc-mxp8gSRQ.js +1 -0
  7. package/dist/assets/architectureDiagram-Q4EWVU46-msh8IODx.js +1 -0
  8. package/dist/assets/blockDiagram-DXYQGD6D-BUatNJTI.js +1 -0
  9. package/dist/assets/{c4Diagram-LMCZKHZV-C2QvkF2i.js → c4Diagram-AHTNJAMY-CJ92TNZe.js} +1 -1
  10. package/dist/assets/{channel-ClOiNc35.js → channel-CTM7CJrB.js} +1 -1
  11. package/dist/assets/{chunk-JWPE2WC7-D5RR93-U.js → chunk-4BX2VUAB-Bdv98T9c.js} +1 -1
  12. package/dist/assets/chunk-4TB4RGXK-DaIEuSP0.js +1 -0
  13. package/dist/assets/{chunk-XXDRQBXY-Blw-tThR.js → chunk-55IACEB6-Bi9130Nu.js} +1 -1
  14. package/dist/assets/{chunk-VR4S4FIN-BR0zG1Ep.js → chunk-EDXVE4YY-CZw-Vwwn.js} +1 -1
  15. package/dist/assets/{chunk-5VM5RSS4-CMJWLQsQ.js → chunk-FMBD7UC4-BBI7swjg.js} +1 -1
  16. package/dist/assets/chunk-OYMX7WX6-CHKotm_J.js +1 -0
  17. package/dist/assets/{chunk-2Q5K7J3B-BvZ7-Ft4.js → chunk-QZHKN3VN-ECW0McUe.js} +1 -1
  18. package/dist/assets/{chunk-32BRIVSS-Dg3PlJIt.js → chunk-YZCP3GAM-DLdAqU2z.js} +1 -1
  19. package/dist/assets/classDiagram-6PBFFD2Q-CkmfHfqf.js +1 -0
  20. package/dist/assets/classDiagram-v2-HSJHXN6E-CkmfHfqf.js +1 -0
  21. package/dist/assets/clone-pjnYCaC4.js +1 -0
  22. package/dist/assets/{cose-bilkent-JH36ORCC-BnDDyyuN.js → cose-bilkent-S5V4N54A-CfMuBnZy.js} +1 -1
  23. package/dist/assets/cytoscape.esm-CT1mZavR.js +9 -0
  24. package/dist/assets/dagre-KV5264BT-xxdATAWV.js +1 -0
  25. package/dist/assets/diagram-5BDNPKRD-s8izYXws.js +1 -0
  26. package/dist/assets/diagram-G4DWMVQ6-BaZWrq-d.js +1 -0
  27. package/dist/assets/diagram-MMDJMWI5-DlzU0RKB.js +1 -0
  28. package/dist/assets/diagram-TYMM5635-Fej8ir1x.js +1 -0
  29. package/dist/assets/erDiagram-SMLLAGMA-Bwg0_DNs.js +1 -0
  30. package/dist/assets/flowDiagram-DWJPFMVM-pJ8Bv6wt.js +1 -0
  31. package/dist/assets/{ganttDiagram-NO4QXBWP-_4nnZ3ta.js → ganttDiagram-T4ZO3ILL-DvgJ4Q6n.js} +1 -1
  32. package/dist/assets/gitGraphDiagram-UUTBAWPF-Du8KitZ0.js +1 -0
  33. package/dist/assets/graph-57Q-0mNG.js +1 -0
  34. package/dist/assets/{index-CPAQ767L.js → index-BOryMxum.js} +1 -1
  35. package/dist/assets/{index-DuUUHxox.js → index-Bt7QsK9T.js} +1 -1
  36. package/dist/assets/{index-BJ9Xm7_G.js → index-CVh-Zo2A.js} +1 -1
  37. package/dist/assets/{index-BiYKFU6w.js → index-Cf77lzSr.js} +1 -1
  38. package/dist/assets/{index-7VeS_xrl.js → index-Cn0akK9k.js} +1 -1
  39. package/dist/assets/{index-CBix0zSu.js → index-EFFRo37G.js} +1 -1
  40. package/dist/assets/{index-By8aqIvN.js → index-mpHzrAV9.js} +2 -2
  41. package/dist/assets/{index-_pxC-jz_.js → index-zljZK-NO.js} +1 -1
  42. package/dist/assets/infoDiagram-42DDH7IO-DZz6OAQe.js +1 -0
  43. package/dist/assets/{ishikawaDiagram-FXEZZL3T-DHHu_UGe.js → ishikawaDiagram-UXIWVN3A-Chrlpw73.js} +1 -1
  44. package/dist/assets/{journeyDiagram-5HDEW3XC-Bx06Sp3y.js → journeyDiagram-VCZTEJTY-D-fCEwg9.js} +1 -1
  45. package/dist/assets/{jszip.min-Bn5J9HN-.js → jszip.min-mU_-As7x.js} +1 -1
  46. package/dist/assets/{kanban-definition-HUTT4EX6-BuEuKkQp.js → kanban-definition-6JOO6SKY-DFdrm5t-.js} +1 -1
  47. package/dist/assets/layout-Dh-E01gA.js +1 -0
  48. package/dist/assets/{linear-BJRZNsdX.js → linear-BjXnK-6T.js} +1 -1
  49. package/dist/assets/mermaid.core-Cbqxn86C.js +7 -0
  50. package/dist/assets/min-B4n9eIGL.js +1 -0
  51. package/dist/assets/{mindmap-definition-LN4V7U3C-DYtgJ2f4.js → mindmap-definition-QFDTVHPH-Bw49x4oU.js} +1 -1
  52. package/dist/assets/pieDiagram-DEJITSTG-D-iq9rKK.js +1 -0
  53. package/dist/assets/quadrantDiagram-34T5L4WZ-QtFjo8i4.js +1 -0
  54. package/dist/assets/{requirementDiagram-TGXJPOKE-Cwb2FU3N.js → requirementDiagram-MS252O5E-BwmEZf4F.js} +1 -1
  55. package/dist/assets/sankeyDiagram-XADWPNL6-CTtXN32x.js +1 -0
  56. package/dist/assets/{seqResourceLoaders-C-pxCjNh.js → seqResourceLoaders-DMyPYdA-.js} +2 -2
  57. package/dist/assets/sequenceDiagram-FGHM5R23-DC00gRqs.js +1 -0
  58. package/dist/assets/stateDiagram-FHFEXIEX-CT963BWJ.js +1 -0
  59. package/dist/assets/stateDiagram-v2-QKLJ7IA2-1T7yDlvQ.js +1 -0
  60. package/dist/assets/{timeline-definition-FHXFAJF6-CK8MkCLz.js → timeline-definition-GMOUNBTQ-CDu66c9j.js} +1 -1
  61. package/dist/assets/{vendor-antd-DNUTLr77.js → vendor-antd-DADYo_zg.js} +3 -3
  62. package/dist/assets/{vendor-codemirror-6ck0hLRU.js → vendor-codemirror-tF6HNoR6.js} +1 -1
  63. package/dist/assets/vendor-markdown-DOJHsAxX.js +3 -0
  64. package/dist/assets/{vendor-mdxeditor-DT0rad22.js → vendor-mdxeditor-CFAmRN3Y.js} +2 -2
  65. package/dist/assets/{vendor-qrcode-CPmWG6hm.js → vendor-qrcode-DYKmbePy.js} +1 -1
  66. package/dist/assets/{vendor-virtuoso-YwK7i7L6.js → vendor-virtuoso-TxPxvPjL.js} +1 -1
  67. package/dist/assets/{vennDiagram-L72KCM5P-CWA2Gdi_.js → vennDiagram-DHZGUBPP-DSm6yR_C.js} +1 -1
  68. package/dist/assets/wardley-RL74JXVD-kFdCN4XL.js +1 -0
  69. package/dist/assets/wardleyDiagram-NUSXRM2D-BY1GQbCO.js +1 -0
  70. package/dist/assets/xychartDiagram-5P7HB3ND-ONnFdWbS.js +1 -0
  71. package/dist/index.html +4 -4
  72. package/findcc.js +7 -2
  73. package/package.json +1 -1
  74. package/dist/assets/abnfDiagram-VRR7QNED-9ax220Vv.js +0 -1
  75. package/dist/assets/arc-Cshrl52z.js +0 -1
  76. package/dist/assets/architectureDiagram-ZJ3FMSHR-QtERolgF.js +0 -1
  77. package/dist/assets/blockDiagram-677ZJIJ3-BaCd4R0Z.js +0 -1
  78. package/dist/assets/chunk-EX3LRPZG-CmoC-M2G.js +0 -1
  79. package/dist/assets/chunk-MOJQB5TN-JXgBLjCY.js +0 -1
  80. package/dist/assets/chunk-RYQCIY6F-gT-v276m.js +0 -1
  81. package/dist/assets/chunk-V7JOEXUC-Cl-E_fxl.js +0 -1
  82. package/dist/assets/classDiagram-OUVF2IWQ-ClkcbuHu.js +0 -1
  83. package/dist/assets/classDiagram-v2-EOCWNBFH-ClkcbuHu.js +0 -1
  84. package/dist/assets/cynefin-VYW2F7L2-Ch8_Ihra.js +0 -15
  85. package/dist/assets/cynefinDiagram-TSTJHNR4-CuX_xTSU.js +0 -1
  86. package/dist/assets/cytoscape.esm-D0POlJZ1.js +0 -9
  87. package/dist/assets/dagre-VKFMJZFB-DHDO7DUw.js +0 -1
  88. package/dist/assets/diagram-FQU43EPY-CxDVpL25.js +0 -1
  89. package/dist/assets/diagram-G47NLZAW-DHX7L6pT.js +0 -1
  90. package/dist/assets/diagram-NH7WQ7WH-HlwtIdWA.js +0 -1
  91. package/dist/assets/diagram-OA4YK3LP-BnTSu9CG.js +0 -1
  92. package/dist/assets/diagram-WEI45ONY-C712tBJk.js +0 -1
  93. package/dist/assets/ebnfDiagram-CCIWWBDH-DzMcH3cz.js +0 -1
  94. package/dist/assets/erDiagram-Q63AITRT-0fyhQG92.js +0 -1
  95. package/dist/assets/flowDiagram-23GEKE2U-lgfs10IO.js +0 -1
  96. package/dist/assets/gitGraphDiagram-IHSO6WYX-DrgEKJkZ.js +0 -1
  97. package/dist/assets/graph-CnJdn47S.js +0 -1
  98. package/dist/assets/infoDiagram-FWYZ7A6U-Cki8RIbq.js +0 -1
  99. package/dist/assets/layout-CCUE9ZRw.js +0 -1
  100. package/dist/assets/map-DQeg2hXV.js +0 -1
  101. package/dist/assets/mermaid.core-DH-sQJgr.js +0 -7
  102. package/dist/assets/pegDiagram-2B236MQR-BVN6OIEN.js +0 -1
  103. package/dist/assets/pieDiagram-ENE6RG2P-mVeQtQTD.js +0 -1
  104. package/dist/assets/quadrantDiagram-ABIIQ3AL-Croqf1qH.js +0 -1
  105. package/dist/assets/railroadDiagram-RFXS5EU6-jkGuNfMY.js +0 -1
  106. package/dist/assets/sankeyDiagram-HTMAVEWB-D-HWOuX0.js +0 -1
  107. package/dist/assets/sequenceDiagram-DBY2YBRQ-Bh3XgPxy.js +0 -1
  108. package/dist/assets/sizeCapture-X5ZJPWSS-C_acEkFf.js +0 -1
  109. package/dist/assets/stateDiagram-2N3HPSRC-CmbRj6R7.js +0 -1
  110. package/dist/assets/stateDiagram-v2-6OUMAXLB-ClrX-Ofc.js +0 -1
  111. package/dist/assets/swimlanes-5IMT3BWC-CIfoRrLM.js +0 -2
  112. package/dist/assets/swimlanesDiagram-G3AALYLV-DZuW0-dQ.js +0 -1
  113. package/dist/assets/vendor-markdown-DBlfs4dR.js +0 -3
  114. package/dist/assets/wardleyDiagram-EHGQE667-U22kgZ8v.js +0 -1
  115. package/dist/assets/xychartDiagram-FW5EYKEG-BiGsMUKC.js +0 -1
@@ -1,3 +0,0 @@
1
- var _a,__defProp=Object.defineProperty,__publicField=(obj,key,value)=>((obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value:value}):obj[key]=value)(obj,"symbol"!=typeof key?key+"":key,value);function M(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var O={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function G(u3){O=u3}var _={exec:()=>null};function k(u3,e=""){let t="string"==typeof u3?u3:u3.source,n={replace:(r,i)=>{let s="string"==typeof i?i:i.source;return s=s.replace(m.caret,"$1"),t=t.replace(r,s),n},getRegex:()=>new RegExp(t,e)};return n}var be=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),m={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:u3=>new RegExp(`^( {0,3}${u3})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:u3=>new RegExp(`^ {0,${Math.min(3,u3-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:u3=>new RegExp(`^ {0,${Math.min(3,u3-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:u3=>new RegExp(`^ {0,${Math.min(3,u3-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:u3=>new RegExp(`^ {0,${Math.min(3,u3-1)}}#`),htmlBeginRegex:u3=>new RegExp(`^ {0,${Math.min(3,u3-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:u3=>new RegExp(`^ {0,${Math.min(3,u3-1)}}>`)},C=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Q=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,se=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ie=k(se).replace(/bull/g,Q).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ye=k(se).replace(/bull/g,Q).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),j=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,F=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Se=k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",F).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$e=k(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Q).getRegex(),v="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",U=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,_e=k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",U).replace("tag",v).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oe=k(j).replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",v).getRegex(),K={blockquote:k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",oe).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Se,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:C,html:_e,lheading:ie,list:$e,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:oe,table:_,text:/^[^\n]+/},ne=k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",v).getRegex(),Me={...K,lheading:ye,table:ne,paragraph:k(j).replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ne).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",v).getRegex()},ze={...K,html:k("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",U).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:_,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:k(j).replace("hr",C).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ie).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ae=/^( {2,}|\\)\n(?!\s*$)/,z=/[\p{P}\p{S}]/u,H=/[\s\p{P}\p{S}]/u,W=/[^\s\p{P}\p{S}]/u,Ce=k(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,H).getRegex(),le=/(?!~)[\p{P}\p{S}]/u,qe=k(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",be?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ue=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ve=k(ue,"u").replace(/punct/g,z).getRegex(),He=k(ue,"u").replace(/punct/g,le).getRegex(),pe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ze=k(pe,"gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,H).replace(/punct/g,z).getRegex(),Ge=k(pe,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,le).getRegex(),Ne=k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,H).replace(/punct/g,z).getRegex(),Qe=k(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,z).getRegex(),Fe=k("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,H).replace(/punct/g,z).getRegex(),Ue=k(/\\(punct)/,"gu").replace(/punct/g,z).getRegex(),Ke=k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),We=k(U).replace("(?:--\x3e|$)","--\x3e").getRegex(),Xe=k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",We).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),q=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Je=k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",q).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ce=k(/^!?\[(label)\]\[(ref)\]/).replace("label",q).replace("ref",F).getRegex(),he=k(/^!?\[(ref)\](?:\[\])?/).replace("ref",F).getRegex(),re=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,X={_backpedal:_,anyPunctuation:Ue,autolink:Ke,blockSkip:qe,br:ae,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:_,delLDelim:_,delRDelim:_,emStrongLDelim:ve,emStrongRDelimAst:Ze,emStrongRDelimUnd:Ne,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Je,nolink:he,punctuation:Ce,reflink:ce,reflinkSearch:k("reflink|nolink(?!\\()","g").replace("reflink",ce).replace("nolink",he).getRegex(),tag:Xe,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:_},Ye={...X,link:k(/^!?\[(label)\]\((.*?)\)/).replace("label",q).getRegex(),reflink:k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q).getRegex()},N={...X,emStrongRDelimAst:Ge,emStrongLDelim:He,delLDelim:Qe,delRDelim:Fe,url:k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",re).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",re).getRegex()},et={...N,br:k(ae).replace("{2,}","*").getRegex(),text:k(N.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},B={normal:K,gfm:Me,pedantic:ze},E={normal:X,gfm:N,breaks:et,pedantic:Ye},tt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ke=u3=>tt[u3];function T(u3,e){if(e){if(m.escapeTest.test(u3))return u3.replace(m.escapeReplace,ke)}else if(m.escapeTestNoEncode.test(u3))return u3.replace(m.escapeReplaceNoEncode,ke);return u3}function J(u3){try{u3=encodeURI(u3).replace(m.percentDecode,"%")}catch{return null}return u3}function V(u3,e){var _a2;let n=u3.replace(m.findPipe,(i,s,a)=>{let o=!1,l=s;for(;--l>=0&&"\\"===a[l];)o=!o;return o?"|":" |"}).split(m.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!(null==(_a2=n.at(-1))?void 0:_a2.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(m.slashPipe,"|");return n}function I(u3,e,t){let n=u3.length;if(0===n)return"";let r=0;for(;r<n;){if(u3.charAt(n-r-1)!==e)break;r++}return u3.slice(0,n-r)}function ge(u3,e=0){let t=e,n="";for(let r of u3)if("\t"===r){let i=4-t%4;n+=" ".repeat(i),t+=i}else n+=r,t++;return n}function fe(u3,e,t,n,r){let i=e.href,s=e.title||null,a=u3[1].replace(r.other.outputLinkReplace,"$1");n.state.inLink=!0;let o={type:"!"===u3[0].charAt(0)?"image":"link",raw:t,href:i,title:s,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,o}var w=class{constructor(e){__publicField(this,"options"),__publicField(this,"rules"),__publicField(this,"lexer"),this.options=e||O}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:I(n,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=function(u3,e,t){let n=u3.match(t.other.indentCodeCompensation);if(null===n)return e;let r=n[1];return e.split("\n").map(i=>{let s=i.match(t.other.beginningSpace);if(null===s)return i;let[a]=s;return a.length>=r.length?i.slice(r.length):i}).join("\n")}(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=I(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:I(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=I(t[0],"\n").split("\n"),r="",i="",s=[];for(;n.length>0;){let l,a=!1,o=[];for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))o.push(n[l]),a=!0;else{if(a)break;o.push(n[l])}n=n.slice(l);let p=o.join("\n"),c=p.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}\n${p}`:p,i=i?`${i}\n${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,s,!0),this.lexer.state.top=d,0===n.length)break;let h=s.at(-1);if("code"===(null==h?void 0:h.type))break;if("blockquote"===(null==h?void 0:h.type)){let R=h,f=R.raw+"\n"+n.join("\n"),S=this.blockquote(f);s[s.length-1]=S,r=r.substring(0,r.length-R.raw.length)+S.raw,i=i.substring(0,i.length-R.text.length)+S.text;break}if("list"===(null==h?void 0:h.type)){let R=h,f=R.raw+"\n"+n.join("\n"),S=this.list(f);s[s.length-1]=S,r=r.substring(0,r.length-h.raw.length)+S.raw,i=i.substring(0,i.length-R.raw.length)+S.raw,n=f.substring(s.at(-1).raw.length).split("\n");continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(e){var _a2,_b;let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),a=!1;for(;e;){let l=!1,p="",c="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;p=t[0],e=e.substring(p.length);let d=ge(t[2].split("\n",1)[0],t[1].length),h=e.split("\n",1)[0],R=!d.trim(),f=0;if(this.options.pedantic?(f=2,c=d.trimStart()):R?f=t[1].length+1:(f=d.search(this.rules.other.nonSpaceChar),f=f>4?1:f,c=d.slice(f),f+=t[1].length),R&&this.rules.other.blankLine.test(h)&&(p+=h+"\n",e=e.substring(h.length+1),l=!0),!l){let S=this.rules.other.nextBulletRegex(f),Y=this.rules.other.hrRegex(f),ee=this.rules.other.fencesBeginRegex(f),te=this.rules.other.headingBeginRegex(f),me=this.rules.other.htmlBeginRegex(f),xe=this.rules.other.blockquoteBeginRegex(f);for(;e;){let A,Z=e.split("\n",1)[0];if(h=Z,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),A=h):A=h.replace(this.rules.other.tabCharGlobal," "),ee.test(h)||te.test(h)||me.test(h)||xe.test(h)||S.test(h)||Y.test(h))break;if(A.search(this.rules.other.nonSpaceChar)>=f||!h.trim())c+="\n"+A.slice(f);else{if(R||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ee.test(d)||te.test(d)||Y.test(d))break;c+="\n"+h}R=!h.trim(),p+=Z+"\n",e=e.substring(Z.length+1),d=A.slice(f)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(a=!0)),i.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),i.raw+=p}let o=i.items.at(-1);if(!o)return;o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd(),i.raw=i.raw.trimEnd();for(let l of i.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),"text"===(null==(_a2=l.tokens[0])?void 0:_a2.type)||"paragraph"===(null==(_b=l.tokens[0])?void 0:_b.type)){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let p=this.rules.other.listTaskCheckbox.exec(l.raw);if(p){let c={type:"checkbox",raw:p[0]+" ",checked:"[ ]"!==p[0]};l.checked=c.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=c.raw+l.tokens[0].raw,l.tokens[0].text=c.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(c)):l.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):l.tokens.unshift(c)}}if(!i.loose){let p=l.tokens.filter(d=>"space"===d.type),c=p.length>0&&p.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=c}}if(i.loose)for(let l of i.items){l.loose=!0;for(let p of l.tokens)"text"===p.type&&(p.type="paragraph")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:i}}}table(e){var _a2;let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=V(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(null==(_a2=t[3])?void 0:_a2.trim())?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let a of r)this.rules.other.tableAlignRight.test(a)?s.align.push("right"):this.rules.other.tableAlignCenter.test(a)?s.align.push("center"):this.rules.other.tableAlignLeft.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<n.length;a++)s.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:s.align[a]});for(let a of i)s.rows.push(V(a,s.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:s.align[l]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=I(n.slice(0,-1),"\\");if((n.length-s.length)%2==0)return}else{let s=function(u3,e){if(-1===u3.indexOf(e[1]))return-1;let t=0;for(let n=0;n<u3.length;n++)if("\\"===u3[n])n++;else if(u3[n]===e[0])t++;else if(u3[n]===e[1]&&(t--,t<0))return n;return t>0?-2:-1}(t[2],"()");if(-2===s)return;if(s>-1){let o=(0===t[0].indexOf("!")?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(r=this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r.slice(1):r.slice(1,-1)),fe(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return fe(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&(r[1]||r[2]||r[3]||r[4])&&(!r[4]||!n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[3]||!n||this.rules.inline.punctuation.exec(n))){let a,o,s=[...r[0]].length-1,l=s,p=0,c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+s);null!==(r=c.exec(t));){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){l+=o;continue}if((r[5]||r[6])&&s%3&&!((s+o)%3)){p+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+p);let d=[...r[0]][0].length,h=e.slice(0,s+r.index+d+o);if(Math.min(s,o)%2){let f=h.slice(1,-1);return{type:"em",raw:h,text:f,tokens:this.lexer.inlineTokens(f)}}let R=h.slice(2,-2);return{type:"strong",raw:h,text:R,tokens:this.lexer.inlineTokens(R)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let a,o,s=[...r[0]].length-1,l=s,p=this.rules.inline.delRDelim;for(p.lastIndex=0,t=t.slice(-1*e.length+s);null!==(r=p.exec(t));){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a||(o=[...a].length,o!==s))continue;if(r[3]||r[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let c=[...r[0]][0].length,d=e.slice(0,s+r.index+c+o),h=d.slice(s,-s);return{type:"del",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return"@"===t[2]?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var _a2;let t;if(t=this.rules.inline.url.exec(e)){let n,r;if("@"===t[2])n=t[0],r="mailto:"+n;else{let i;do{i=t[0],t[0]=(null==(_a2=this.rules.inline._backpedal.exec(t[0]))?void 0:_a2[0])??""}while(i!==t[0]);n=t[0],r="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},x=class u{constructor(e){__publicField(this,"tokens"),__publicField(this,"options"),__publicField(this,"state"),__publicField(this,"inlineQueue"),__publicField(this,"tokenizer"),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||O,this.options.tokenizer=this.options.tokenizer||new w,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:m,block:B.normal,inline:E.normal};this.options.pedantic?(t.block=B.pedantic,t.inline=E.pedantic):this.options.gfm&&(t.block=B.gfm,this.options.breaks?t.inline=E.breaks:t.inline=E.gfm),this.tokenizer.rules=t}static get rules(){return{block:B,inline:E}}static lex(e,t){return new u(t).lex(e)}static lexInline(e,t){return new u(t).inlineTokens(e)}lex(e){e=e.replace(m.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){var _a2,_b,_c;for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(m.tabCharGlobal," ").replace(m.spaceLine,""));e;){let r;if(null==(_b=null==(_a2=this.options.extensions)?void 0:_a2.block)?void 0:_b.some(s=>!!(r=s.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let s=t.at(-1);1===r.raw.length&&void 0!==s?s.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let s=t.at(-1);"paragraph"===(null==s?void 0:s.type)||"text"===(null==s?void 0:s.type)?(s.raw+=(s.raw.endsWith("\n")?"":"\n")+r.raw,s.text+="\n"+r.text,this.inlineQueue.at(-1).src=s.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let s=t.at(-1);"paragraph"===(null==s?void 0:s.type)||"text"===(null==s?void 0:s.type)?(s.raw+=(s.raw.endsWith("\n")?"":"\n")+r.raw,s.text+="\n"+r.raw,this.inlineQueue.at(-1).src=s.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(null==(_c=this.options.extensions)?void 0:_c.startBlock){let o,s=1/0,a=e.slice(1);this.options.extensions.startBlock.forEach(l=>{o=l.call({lexer:this},a),"number"==typeof o&&o>=0&&(s=Math.min(s,o))}),s<1/0&&s>=0&&(i=e.substring(0,s+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let s=t.at(-1);n&&"paragraph"===(null==s?void 0:s.type)?(s.raw+=(s.raw.endsWith("\n")?"":"\n")+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let s=t.at(-1);"text"===(null==s?void 0:s.type)?(s.raw+=(s.raw.endsWith("\n")?"":"\n")+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r);continue}if(e){let s="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(s);break}throw new Error(s)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var _a2,_b,_c,_d,_e2;this.tokenizer.lexer=this;let i,n=e,r=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;null!==(r=this.tokenizer.rules.inline.reflinkSearch.exec(n));)o.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!==(r=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!==(r=this.tokenizer.rules.inline.blockSkip.exec(n));)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+"["+"a".repeat(r[0].length-i-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=(null==(_b=null==(_a2=this.options.hooks)?void 0:_a2.emStrongMask)?void 0:_b.call({lexer:this},n))??n;let s=!1,a="";for(;e;){let o;if(s||(a=""),s=!1,null==(_d=null==(_c=this.options.extensions)?void 0:_c.inline)?void 0:_d.some(p=>!!(o=p.call({lexer:this},e,t))&&(e=e.substring(o.raw.length),t.push(o),!0)))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let p=t.at(-1);"text"===o.type&&"text"===(null==p?void 0:p.type)?(p.raw+=o.raw,p.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,a)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,a)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let l=e;if(null==(_e2=this.options.extensions)?void 0:_e2.startInline){let d,p=1/0,c=e.slice(1);this.options.extensions.startInline.forEach(h=>{d=h.call({lexer:this},c),"number"==typeof d&&d>=0&&(p=Math.min(p,d))}),p<1/0&&p>=0&&(l=e.substring(0,p+1))}if(o=this.tokenizer.inlineText(l)){e=e.substring(o.raw.length),"_"!==o.raw.slice(-1)&&(a=o.raw.slice(-1)),s=!0;let p=t.at(-1);"text"===(null==p?void 0:p.type)?(p.raw+=o.raw,p.text+=o.text):t.push(o);continue}if(e){let p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}throw new Error(p)}}return t}},y=class{constructor(e){__publicField(this,"options"),__publicField(this,"parser"),this.options=e||O}space(e){return""}code({text:e,lang:t,escaped:n}){var _a2;let r=null==(_a2=(t||"").match(m.notSpaceStart))?void 0:_a2[0],i=e.replace(m.endingNewline,"")+"\n";return r?'<pre><code class="language-'+T(r)+'">'+(n?i:T(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:T(i,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,r="";for(let a=0;a<e.items.length;a++){let o=e.items[a];r+=this.listitem(o)}let i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+i+">\n"}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let i=0;i<e.header.length;i++)n+=this.tablecell(e.header[i]);t+=this.tablerow({text:n});let r="";for(let i=0;i<e.rows.length;i++){let s=e.rows[i];n="";for(let a=0;a<s.length;a++)n+=this.tablecell(s[a]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${T(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=J(e);if(null===i)return r;let s='<a href="'+(e=i)+'"';return t&&(s+=' title="'+T(t)+'"'),s+=">"+r+"</a>",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=J(e);if(null===i)return T(n);let s=`<img src="${e=i}" alt="${T(n)}"`;return t&&(s+=` title="${T(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:T(e.text)}},$=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},b=class u2{constructor(e){__publicField(this,"options"),__publicField(this,"renderer"),__publicField(this,"textRenderer"),this.options=e||O,this.options.renderer=this.options.renderer||new y,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $}static parse(e,t){return new u2(t).parse(e)}static parseInline(e,t){return new u2(t).parseInline(e)}parse(e){var _a2,_b;this.renderer.parser=this;let t="";for(let n=0;n<e.length;n++){let r=e[n];if(null==(_b=null==(_a2=this.options.extensions)?void 0:_a2.renderers)?void 0:_b[r.type]){let s=r,a=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==a||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(s.type)){t+=a||"";continue}}let i=r;switch(i.type){case"space":t+=this.renderer.space(i);break;case"hr":t+=this.renderer.hr(i);break;case"heading":t+=this.renderer.heading(i);break;case"code":t+=this.renderer.code(i);break;case"table":t+=this.renderer.table(i);break;case"blockquote":t+=this.renderer.blockquote(i);break;case"list":t+=this.renderer.list(i);break;case"checkbox":t+=this.renderer.checkbox(i);break;case"html":t+=this.renderer.html(i);break;case"def":t+=this.renderer.def(i);break;case"paragraph":t+=this.renderer.paragraph(i);break;case"text":t+=this.renderer.text(i);break;default:{let s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return t}parseInline(e,t=this.renderer){var _a2,_b;this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let i=e[r];if(null==(_b=null==(_a2=this.options.extensions)?void 0:_a2.renderers)?void 0:_b[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==a||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=a||"";continue}}let s=i;switch(s.type){case"escape":case"text":n+=t.text(s);break;case"html":n+=t.html(s);break;case"link":n+=t.link(s);break;case"image":n+=t.image(s);break;case"checkbox":n+=t.checkbox(s);break;case"strong":n+=t.strong(s);break;case"em":n+=t.em(s);break;case"codespan":n+=t.codespan(s);break;case"br":n+=t.br(s);break;case"del":n+=t.del(s);break;default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}},P=(_a=class{constructor(e){__publicField(this,"options"),__publicField(this,"block"),this.options=e||O}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?x.lex:x.lexInline}provideParser(e=this.block){return e?b.parse:b.parseInline}},__publicField(_a,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),__publicField(_a,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),_a),L=new class{constructor(...e){__publicField(this,"defaults",{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}),__publicField(this,"options",this.setOptions),__publicField(this,"parse",this.parseMarkdown(!0)),__publicField(this,"parseInline",this.parseMarkdown(!1)),__publicField(this,"Parser",b),__publicField(this,"Renderer",y),__publicField(this,"TextRenderer",$),__publicField(this,"Lexer",x),__publicField(this,"Tokenizer",w),__publicField(this,"Hooks",P),this.use(...e)}walkTokens(e,t){var _a2,_b;let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let i=r;for(let s of i.header)n=n.concat(this.walkTokens(s.tokens,t));for(let s of i.rows)for(let a of s)n=n.concat(this.walkTokens(a.tokens,t));break}case"list":{let i=r;n=n.concat(this.walkTokens(i.items,t));break}default:{let i=r;(null==(_b=null==(_a2=this.defaults.extensions)?void 0:_a2.childTokens)?void 0:_b[i.type])?this.defaults.extensions.childTokens[i.type].forEach(s=>{let a=i[s].flat(1/0);n=n.concat(this.walkTokens(a,t))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=t.renderers[i.name];t.renderers[i.name]=s?function(...a){let o=i.renderer.apply(this,a);return!1===o&&(o=s.apply(this,a)),o}:i.renderer}if("tokenizer"in i){if(!i.level||"block"!==i.level&&"inline"!==i.level)throw new Error("extension level must be 'block' or 'inline'");let s=t[i.level];s?s.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&("block"===i.level?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:"inline"===i.level&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){let i=this.defaults.renderer||new y(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,o=n.renderer[a],l=i[a];i[a]=(...p)=>{let c=o.apply(i,p);return!1===c&&(c=l.apply(i,p)),c||""}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new w(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,o=n.tokenizer[a],l=i[a];i[a]=(...p)=>{let c=o.apply(i,p);return!1===c&&(c=l.apply(i,p)),c}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new P;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let a=s,o=n.hooks[a],l=i[a];P.passThroughHooks.has(s)?i[a]=p=>{if(this.defaults.async&&P.passThroughHooksRespectAsync.has(s))return(async()=>{let d=await o.call(i,p);return l.call(i,d)})();let c=o.call(i,p);return l.call(i,c)}:i[a]=(...p)=>{if(this.defaults.async)return(async()=>{let d=await o.apply(i,p);return!1===d&&(d=await l.apply(i,p)),d})();let c=o.apply(i,p);return!1===c&&(c=l.apply(i,p)),c}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let o=[];return o.push(s.call(this,a)),i&&(o=o.concat(i.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return x.lex(e,t??this.defaults)}parser(e,t){return b.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{let i={...r},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===i.async)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||null===n)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(n):n,p=await(s.hooks?await s.hooks.provideLexer(e):e?x.lex:x.lexInline)(o,s),c=s.hooks?await s.hooks.processAllTokens(p):p;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser(e):e?b.parse:b.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(n=s.hooks.preprocess(n));let l=(s.hooks?s.hooks.provideLexer(e):e?x.lex:x.lexInline)(n,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let c=(s.hooks?s.hooks.provideParser(e):e?b.parse:b.parseInline)(l,s);return s.hooks&&(c=s.hooks.postprocess(c)),c}catch(o){return a(o)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let r="<p>An error occurred:</p><pre>"+T(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}};function g(u3,e){return L.parse(u3,e)}
2
- /*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE */
3
- function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _slicedToArray(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u3,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l);else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r2){o=!0,n=r2}finally{try{if(!f&&null!=t.return&&(u3=t.return(),Object(u3)!==u3))return}finally{if(o)throw n}}return a}}(r,e)||function(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}g.options=g.setOptions=function(u3){return L.setOptions(u3),g.defaults=L.defaults,G(g.defaults),g},g.getDefaults=M,g.defaults=O,g.use=function(...u3){return L.use(...u3),g.defaults=L.defaults,G(g.defaults),g},g.walkTokens=function(u3,e){return L.walkTokens(u3,e)},g.parseInline=L.parseInline,g.Parser=b,g.parser=b.parse,g.Renderer=y,g.TextRenderer=$,g.Lexer=x,g.lexer=x.lex,g.Tokenizer=w,g.Hooks=P,g.parse=g,g.options,g.setOptions,g.use,g.walkTokens,g.parseInline,b.parse,x.lex;const entries=Object.entries,setPrototypeOf=Object.setPrototypeOf,isFrozen=Object.isFrozen,getPrototypeOf=Object.getPrototypeOf,getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;let freeze=Object.freeze,seal=Object.seal,create=Object.create,_ref="undefined"!=typeof Reflect&&Reflect,apply=_ref.apply,construct=_ref.construct;freeze||(freeze=function(x2){return x2}),seal||(seal=function(x2){return x2}),apply||(apply=function(func,thisArg){for(var _len=arguments.length,args=new Array(_len>2?_len-2:0),_key=2;_key<_len;_key++)args[_key-2]=arguments[_key];return func.apply(thisArg,args)}),construct||(construct=function(Func){for(var _len2=arguments.length,args=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++)args[_key2-1]=arguments[_key2];return new Func(...args)});const arrayForEach=unapply(Array.prototype.forEach),arrayLastIndexOf=unapply(Array.prototype.lastIndexOf),arrayPop=unapply(Array.prototype.pop),arrayPush=unapply(Array.prototype.push),arraySplice=unapply(Array.prototype.splice),arrayIsArray=Array.isArray,stringToLowerCase=unapply(String.prototype.toLowerCase),stringToString=unapply(String.prototype.toString),stringMatch=unapply(String.prototype.match),stringReplace=unapply(String.prototype.replace),stringIndexOf=unapply(String.prototype.indexOf),stringTrim=unapply(String.prototype.trim),numberToString=unapply(Number.prototype.toString),booleanToString=unapply(Boolean.prototype.toString),bigintToString="undefined"==typeof BigInt?null:unapply(BigInt.prototype.toString),symbolToString="undefined"==typeof Symbol?null:unapply(Symbol.prototype.toString),objectHasOwnProperty=unapply(Object.prototype.hasOwnProperty),objectToString=unapply(Object.prototype.toString),regExpTest=unapply(RegExp.prototype.test),typeErrorCreate=(Func=TypeError,function(){for(var _len4=arguments.length,args=new Array(_len4),_key4=0;_key4<_len4;_key4++)args[_key4]=arguments[_key4];return construct(Func,args)});var Func;function unapply(func){return function(thisArg){thisArg instanceof RegExp&&(thisArg.lastIndex=0);for(var _len3=arguments.length,args=new Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++)args[_key3-1]=arguments[_key3];return apply(func,thisArg,args)}}function addToSet(set,array){let transformCaseFunc=arguments.length>2&&void 0!==arguments[2]?arguments[2]:stringToLowerCase;if(setPrototypeOf&&setPrototypeOf(set,null),!arrayIsArray(array))return set;let l=array.length;for(;l--;){let element=array[l];if("string"==typeof element){const lcElement=transformCaseFunc(element);lcElement!==element&&(isFrozen(array)||(array[l]=lcElement),element=lcElement)}set[element]=!0}return set}function cleanArray(array){for(let index=0;index<array.length;index++){objectHasOwnProperty(array,index)||(array[index]=null)}return array}function clone(object){const newObject=create(null);for(const _ref2 of entries(object)){var _ref3=_slicedToArray(_ref2,2);const property=_ref3[0],value=_ref3[1];objectHasOwnProperty(object,property)&&(arrayIsArray(value)?newObject[property]=cleanArray(value):value&&"object"==typeof value&&value.constructor===Object?newObject[property]=clone(value):newObject[property]=value)}return newObject}function lookupGetter(object,prop){for(;null!==object;){const desc=getOwnPropertyDescriptor(object,prop);if(desc){if(desc.get)return unapply(desc.get);if("function"==typeof desc.value)return unapply(desc.value)}object=getPrototypeOf(object)}return function(){return null}}const html$1=freeze(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),svg$1=freeze(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),svgFilters=freeze(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),svgDisallowed=freeze(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),mathMl$1=freeze(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),mathMlDisallowed=freeze(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),text=freeze(["#text"]),html=freeze(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),svg=freeze(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),mathMl=freeze(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),xml=freeze(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MUSTACHE_EXPR=seal(/{{[\w\W]*|^[\w\W]*}}/g),ERB_EXPR=seal(/<%[\w\W]*|^[\w\W]*%>/g),TMPLIT_EXPR=seal(/\${[\w\W]*/g),DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]+$/),ARIA_ATTR=seal(/^aria-[\-\w]+$/),IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i),ATTR_WHITESPACE=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),DOCTYPE_NAME=seal(/^html$/i),CUSTOM_ELEMENT=seal(/^[a-z][.\w]*(-[.\w]+)+$/i),ELEMENT_MARKUP_PROBE=seal(/<[/\w!]/g),COMMENT_MARKUP_PROBE=seal(/<[/\w]/g),FALLBACK_TAG_CLOSE=seal(/<\/no(script|embed|frames)/i),SELF_CLOSING_TAG=seal(/\/>/i),NODE_TYPE_element=1,NODE_TYPE_text=3,NODE_TYPE_processingInstruction=7,NODE_TYPE_comment=8,NODE_TYPE_document=9,NODE_TYPE_documentFragment=11,_resolveSetOption=function(cfg,key,fallback,options){return objectHasOwnProperty(cfg,key)&&arrayIsArray(cfg[key])?addToSet(options.base?clone(options.base):{},cfg[key],options.transform):fallback};var purify=function createDOMPurify(){let window2=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window;const DOMPurify=root=>createDOMPurify(root);if(DOMPurify.version="3.4.11",DOMPurify.removed=[],!window2||!window2.document||window2.document.nodeType!==NODE_TYPE_document||!window2.Element)return DOMPurify.isSupported=!1,DOMPurify;let document=window2.document;const originalDocument=document,currentScript=originalDocument.currentScript;window2.DocumentFragment;const HTMLTemplateElement=window2.HTMLTemplateElement,Node=window2.Node,Element=window2.Element,NodeFilter=window2.NodeFilter,_window$NamedNodeMap=window2.NamedNodeMap;void 0===_window$NamedNodeMap&&(window2.NamedNodeMap||window2.MozNamedAttrMap),window2.HTMLFormElement;const DOMParser=window2.DOMParser,trustedTypes=window2.trustedTypes,ElementPrototype=Element.prototype,cloneNode=lookupGetter(ElementPrototype,"cloneNode"),remove=lookupGetter(ElementPrototype,"remove"),getNextSibling=lookupGetter(ElementPrototype,"nextSibling"),getChildNodes=lookupGetter(ElementPrototype,"childNodes"),getParentNode=lookupGetter(ElementPrototype,"parentNode"),getShadowRoot=lookupGetter(ElementPrototype,"shadowRoot"),getAttributes=lookupGetter(ElementPrototype,"attributes"),getNodeType=Node&&Node.prototype?lookupGetter(Node.prototype,"nodeType"):null,getNodeName=Node&&Node.prototype?lookupGetter(Node.prototype,"nodeName"):null;if("function"==typeof HTMLTemplateElement){const template=document.createElement("template");template.content&&template.content.ownerDocument&&(document=template.content.ownerDocument)}let trustedTypesPolicy,defaultTrustedTypesPolicy,emptyHTML="",defaultTrustedTypesPolicyResolved=!1,IN_TRUSTED_TYPES_POLICY=0;const _assertNotInTrustedTypesPolicy=function(){if(IN_TRUSTED_TYPES_POLICY>0)throw typeErrorCreate('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},_createTrustedHTML=function(html2){_assertNotInTrustedTypesPolicy(),IN_TRUSTED_TYPES_POLICY++;try{return trustedTypesPolicy.createHTML(html2)}finally{IN_TRUSTED_TYPES_POLICY--}},_getDefaultTrustedTypesPolicy=function(){return defaultTrustedTypesPolicyResolved||(defaultTrustedTypesPolicy=function(trustedTypes,purifyHostElement){if("object"!=typeof trustedTypes||"function"!=typeof trustedTypes.createPolicy)return null;let suffix=null;purifyHostElement&&purifyHostElement.hasAttribute("data-tt-policy-suffix")&&(suffix=purifyHostElement.getAttribute("data-tt-policy-suffix"));const policyName="dompurify"+(suffix?"#"+suffix:"");try{return trustedTypes.createPolicy(policyName,{createHTML:html2=>html2,createScriptURL:scriptUrl=>scriptUrl})}catch(_2){return console.warn("TrustedTypes policy "+policyName+" could not be created."),null}}(trustedTypes,currentScript),defaultTrustedTypesPolicyResolved=!0),defaultTrustedTypesPolicy},_document=document,implementation=_document.implementation,createNodeIterator=_document.createNodeIterator,createDocumentFragment=_document.createDocumentFragment,getElementsByTagName=_document.getElementsByTagName,importNode=originalDocument.importNode;let hooks={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};DOMPurify.isSupported="function"==typeof entries&&"function"==typeof getParentNode&&implementation&&void 0!==implementation.createHTMLDocument;const MUSTACHE_EXPR$1=MUSTACHE_EXPR,ERB_EXPR$1=ERB_EXPR,TMPLIT_EXPR$1=TMPLIT_EXPR,DATA_ATTR$1=DATA_ATTR,ARIA_ATTR$1=ARIA_ATTR,IS_SCRIPT_OR_DATA$1=IS_SCRIPT_OR_DATA,ATTR_WHITESPACE$1=ATTR_WHITESPACE,CUSTOM_ELEMENT$1=CUSTOM_ELEMENT;let IS_ALLOWED_URI$1=IS_ALLOWED_URI,ALLOWED_TAGS=null;const DEFAULT_ALLOWED_TAGS=addToSet({},[...html$1,...svg$1,...svgFilters,...mathMl$1,...text]);let ALLOWED_ATTR=null;const DEFAULT_ALLOWED_ATTR=addToSet({},[...html,...svg,...mathMl,...xml]);let CUSTOM_ELEMENT_HANDLING=Object.seal(create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),FORBID_TAGS=null,FORBID_ATTR=null;const EXTRA_ELEMENT_HANDLING=Object.seal(create(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ALLOW_ARIA_ATTR=!0,ALLOW_DATA_ATTR=!0,ALLOW_UNKNOWN_PROTOCOLS=!1,ALLOW_SELF_CLOSE_IN_ATTR=!0,SAFE_FOR_TEMPLATES=!1,SAFE_FOR_XML=!0,WHOLE_DOCUMENT=!1,SET_CONFIG=!1,SET_CONFIG_ALLOWED_TAGS=null,SET_CONFIG_ALLOWED_ATTR=null,FORCE_BODY=!1,RETURN_DOM=!1,RETURN_DOM_FRAGMENT=!1,RETURN_TRUSTED_TYPE=!1,SANITIZE_DOM=!0,SANITIZE_NAMED_PROPS=!1,KEEP_CONTENT=!0,IN_PLACE=!1,USE_PROFILES={},FORBID_CONTENTS=null;const DEFAULT_FORBID_CONTENTS=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let DATA_URI_TAGS=null;const DEFAULT_DATA_URI_TAGS=addToSet({},["audio","video","img","source","image","track"]);let URI_SAFE_ATTRIBUTES=null;const DEFAULT_URI_SAFE_ATTRIBUTES=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),MATHML_NAMESPACE="http://www.w3.org/1998/Math/MathML",SVG_NAMESPACE="http://www.w3.org/2000/svg",HTML_NAMESPACE="http://www.w3.org/1999/xhtml";let NAMESPACE=HTML_NAMESPACE,IS_EMPTY_INPUT=!1,ALLOWED_NAMESPACES=null;const DEFAULT_ALLOWED_NAMESPACES=addToSet({},[MATHML_NAMESPACE,SVG_NAMESPACE,HTML_NAMESPACE],stringToString),DEFAULT_MATHML_TEXT_INTEGRATION_POINTS=freeze(["mi","mo","mn","ms","mtext"]);let MATHML_TEXT_INTEGRATION_POINTS=addToSet({},DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);const DEFAULT_HTML_INTEGRATION_POINTS=freeze(["annotation-xml"]);let HTML_INTEGRATION_POINTS=addToSet({},DEFAULT_HTML_INTEGRATION_POINTS);const COMMON_SVG_AND_HTML_ELEMENTS=addToSet({},["title","style","font","a","script"]);let PARSER_MEDIA_TYPE=null;const SUPPORTED_PARSER_MEDIA_TYPES=["application/xhtml+xml","text/html"];let transformCaseFunc=null,CONFIG=null;const formElement=document.createElement("form"),isRegexOrFunction=function(testValue){return testValue instanceof RegExp||testValue instanceof Function},_parseConfig=function(){let cfg=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(CONFIG&&CONFIG===cfg)return;cfg&&"object"==typeof cfg||(cfg={}),cfg=clone(cfg),PARSER_MEDIA_TYPE=-1===SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE)?"text/html":cfg.PARSER_MEDIA_TYPE,transformCaseFunc="application/xhtml+xml"===PARSER_MEDIA_TYPE?stringToString:stringToLowerCase,ALLOWED_TAGS=_resolveSetOption(cfg,"ALLOWED_TAGS",DEFAULT_ALLOWED_TAGS,{transform:transformCaseFunc}),ALLOWED_ATTR=_resolveSetOption(cfg,"ALLOWED_ATTR",DEFAULT_ALLOWED_ATTR,{transform:transformCaseFunc}),ALLOWED_NAMESPACES=_resolveSetOption(cfg,"ALLOWED_NAMESPACES",DEFAULT_ALLOWED_NAMESPACES,{transform:stringToString}),URI_SAFE_ATTRIBUTES=_resolveSetOption(cfg,"ADD_URI_SAFE_ATTR",DEFAULT_URI_SAFE_ATTRIBUTES,{transform:transformCaseFunc,base:DEFAULT_URI_SAFE_ATTRIBUTES}),DATA_URI_TAGS=_resolveSetOption(cfg,"ADD_DATA_URI_TAGS",DEFAULT_DATA_URI_TAGS,{transform:transformCaseFunc,base:DEFAULT_DATA_URI_TAGS}),FORBID_CONTENTS=_resolveSetOption(cfg,"FORBID_CONTENTS",DEFAULT_FORBID_CONTENTS,{transform:transformCaseFunc}),FORBID_TAGS=_resolveSetOption(cfg,"FORBID_TAGS",clone({}),{transform:transformCaseFunc}),FORBID_ATTR=_resolveSetOption(cfg,"FORBID_ATTR",clone({}),{transform:transformCaseFunc}),USE_PROFILES=!!objectHasOwnProperty(cfg,"USE_PROFILES")&&(cfg.USE_PROFILES&&"object"==typeof cfg.USE_PROFILES?clone(cfg.USE_PROFILES):cfg.USE_PROFILES),ALLOW_ARIA_ATTR=!1!==cfg.ALLOW_ARIA_ATTR,ALLOW_DATA_ATTR=!1!==cfg.ALLOW_DATA_ATTR,ALLOW_UNKNOWN_PROTOCOLS=cfg.ALLOW_UNKNOWN_PROTOCOLS||!1,ALLOW_SELF_CLOSE_IN_ATTR=!1!==cfg.ALLOW_SELF_CLOSE_IN_ATTR,SAFE_FOR_TEMPLATES=cfg.SAFE_FOR_TEMPLATES||!1,SAFE_FOR_XML=!1!==cfg.SAFE_FOR_XML,WHOLE_DOCUMENT=cfg.WHOLE_DOCUMENT||!1,RETURN_DOM=cfg.RETURN_DOM||!1,RETURN_DOM_FRAGMENT=cfg.RETURN_DOM_FRAGMENT||!1,RETURN_TRUSTED_TYPE=cfg.RETURN_TRUSTED_TYPE||!1,FORCE_BODY=cfg.FORCE_BODY||!1,SANITIZE_DOM=!1!==cfg.SANITIZE_DOM,SANITIZE_NAMED_PROPS=cfg.SANITIZE_NAMED_PROPS||!1,KEEP_CONTENT=!1!==cfg.KEEP_CONTENT,IN_PLACE=cfg.IN_PLACE||!1,IS_ALLOWED_URI$1=function(value){try{return regExpTest(value,""),!0}catch(_unused){return!1}}(cfg.ALLOWED_URI_REGEXP)?cfg.ALLOWED_URI_REGEXP:IS_ALLOWED_URI,NAMESPACE="string"==typeof cfg.NAMESPACE?cfg.NAMESPACE:HTML_NAMESPACE,MATHML_TEXT_INTEGRATION_POINTS=objectHasOwnProperty(cfg,"MATHML_TEXT_INTEGRATION_POINTS")&&cfg.MATHML_TEXT_INTEGRATION_POINTS&&"object"==typeof cfg.MATHML_TEXT_INTEGRATION_POINTS?clone(cfg.MATHML_TEXT_INTEGRATION_POINTS):addToSet({},DEFAULT_MATHML_TEXT_INTEGRATION_POINTS),HTML_INTEGRATION_POINTS=objectHasOwnProperty(cfg,"HTML_INTEGRATION_POINTS")&&cfg.HTML_INTEGRATION_POINTS&&"object"==typeof cfg.HTML_INTEGRATION_POINTS?clone(cfg.HTML_INTEGRATION_POINTS):addToSet({},DEFAULT_HTML_INTEGRATION_POINTS);const customElementHandling=objectHasOwnProperty(cfg,"CUSTOM_ELEMENT_HANDLING")&&cfg.CUSTOM_ELEMENT_HANDLING&&"object"==typeof cfg.CUSTOM_ELEMENT_HANDLING?clone(cfg.CUSTOM_ELEMENT_HANDLING):create(null);if(CUSTOM_ELEMENT_HANDLING=create(null),objectHasOwnProperty(customElementHandling,"tagNameCheck")&&isRegexOrFunction(customElementHandling.tagNameCheck)&&(CUSTOM_ELEMENT_HANDLING.tagNameCheck=customElementHandling.tagNameCheck),objectHasOwnProperty(customElementHandling,"attributeNameCheck")&&isRegexOrFunction(customElementHandling.attributeNameCheck)&&(CUSTOM_ELEMENT_HANDLING.attributeNameCheck=customElementHandling.attributeNameCheck),objectHasOwnProperty(customElementHandling,"allowCustomizedBuiltInElements")&&"boolean"==typeof customElementHandling.allowCustomizedBuiltInElements&&(CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=customElementHandling.allowCustomizedBuiltInElements),seal(CUSTOM_ELEMENT_HANDLING),SAFE_FOR_TEMPLATES&&(ALLOW_DATA_ATTR=!1),RETURN_DOM_FRAGMENT&&(RETURN_DOM=!0),USE_PROFILES&&(ALLOWED_TAGS=addToSet({},text),ALLOWED_ATTR=create(null),!0===USE_PROFILES.html&&(addToSet(ALLOWED_TAGS,html$1),addToSet(ALLOWED_ATTR,html)),!0===USE_PROFILES.svg&&(addToSet(ALLOWED_TAGS,svg$1),addToSet(ALLOWED_ATTR,svg),addToSet(ALLOWED_ATTR,xml)),!0===USE_PROFILES.svgFilters&&(addToSet(ALLOWED_TAGS,svgFilters),addToSet(ALLOWED_ATTR,svg),addToSet(ALLOWED_ATTR,xml)),!0===USE_PROFILES.mathMl&&(addToSet(ALLOWED_TAGS,mathMl$1),addToSet(ALLOWED_ATTR,mathMl),addToSet(ALLOWED_ATTR,xml))),EXTRA_ELEMENT_HANDLING.tagCheck=null,EXTRA_ELEMENT_HANDLING.attributeCheck=null,objectHasOwnProperty(cfg,"ADD_TAGS")&&("function"==typeof cfg.ADD_TAGS?EXTRA_ELEMENT_HANDLING.tagCheck=cfg.ADD_TAGS:arrayIsArray(cfg.ADD_TAGS)&&(ALLOWED_TAGS===DEFAULT_ALLOWED_TAGS&&(ALLOWED_TAGS=clone(ALLOWED_TAGS)),addToSet(ALLOWED_TAGS,cfg.ADD_TAGS,transformCaseFunc))),objectHasOwnProperty(cfg,"ADD_ATTR")&&("function"==typeof cfg.ADD_ATTR?EXTRA_ELEMENT_HANDLING.attributeCheck=cfg.ADD_ATTR:arrayIsArray(cfg.ADD_ATTR)&&(ALLOWED_ATTR===DEFAULT_ALLOWED_ATTR&&(ALLOWED_ATTR=clone(ALLOWED_ATTR)),addToSet(ALLOWED_ATTR,cfg.ADD_ATTR,transformCaseFunc))),objectHasOwnProperty(cfg,"ADD_URI_SAFE_ATTR")&&arrayIsArray(cfg.ADD_URI_SAFE_ATTR)&&addToSet(URI_SAFE_ATTRIBUTES,cfg.ADD_URI_SAFE_ATTR,transformCaseFunc),objectHasOwnProperty(cfg,"FORBID_CONTENTS")&&arrayIsArray(cfg.FORBID_CONTENTS)&&(FORBID_CONTENTS===DEFAULT_FORBID_CONTENTS&&(FORBID_CONTENTS=clone(FORBID_CONTENTS)),addToSet(FORBID_CONTENTS,cfg.FORBID_CONTENTS,transformCaseFunc)),objectHasOwnProperty(cfg,"ADD_FORBID_CONTENTS")&&arrayIsArray(cfg.ADD_FORBID_CONTENTS)&&(FORBID_CONTENTS===DEFAULT_FORBID_CONTENTS&&(FORBID_CONTENTS=clone(FORBID_CONTENTS)),addToSet(FORBID_CONTENTS,cfg.ADD_FORBID_CONTENTS,transformCaseFunc)),KEEP_CONTENT&&(ALLOWED_TAGS["#text"]=!0),WHOLE_DOCUMENT&&addToSet(ALLOWED_TAGS,["html","head","body"]),ALLOWED_TAGS.table&&(addToSet(ALLOWED_TAGS,["tbody"]),delete FORBID_TAGS.tbody),cfg.TRUSTED_TYPES_POLICY){if("function"!=typeof cfg.TRUSTED_TYPES_POLICY.createHTML)throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL)throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const previousTrustedTypesPolicy=trustedTypesPolicy;trustedTypesPolicy=cfg.TRUSTED_TYPES_POLICY;try{emptyHTML=_createTrustedHTML("")}catch(error){throw trustedTypesPolicy=previousTrustedTypesPolicy,error}}else null===cfg.TRUSTED_TYPES_POLICY?(trustedTypesPolicy=void 0,emptyHTML=""):(void 0===trustedTypesPolicy&&(trustedTypesPolicy=_getDefaultTrustedTypesPolicy()),trustedTypesPolicy&&"string"==typeof emptyHTML&&(emptyHTML=_createTrustedHTML("")));freeze&&freeze(cfg),CONFIG=cfg},ALL_SVG_TAGS=addToSet({},[...svg$1,...svgFilters,...svgDisallowed]),ALL_MATHML_TAGS=addToSet({},[...mathMl$1,...mathMlDisallowed]),_checkValidNamespace=function(element){let parent=getParentNode(element);parent&&parent.tagName||(parent={namespaceURI:NAMESPACE,tagName:"template"});const tagName=stringToLowerCase(element.tagName),parentTagName=stringToLowerCase(parent.tagName);return!!ALLOWED_NAMESPACES[element.namespaceURI]&&(element.namespaceURI===SVG_NAMESPACE?function(tagName,parent,parentTagName){return parent.namespaceURI===HTML_NAMESPACE?"svg"===tagName:parent.namespaceURI===MATHML_NAMESPACE?"svg"===tagName&&("annotation-xml"===parentTagName||MATHML_TEXT_INTEGRATION_POINTS[parentTagName]):Boolean(ALL_SVG_TAGS[tagName])}(tagName,parent,parentTagName):element.namespaceURI===MATHML_NAMESPACE?function(tagName,parent,parentTagName){return parent.namespaceURI===HTML_NAMESPACE?"math"===tagName:parent.namespaceURI===SVG_NAMESPACE?"math"===tagName&&HTML_INTEGRATION_POINTS[parentTagName]:Boolean(ALL_MATHML_TAGS[tagName])}(tagName,parent,parentTagName):element.namespaceURI===HTML_NAMESPACE?function(tagName,parent,parentTagName){return!(parent.namespaceURI===SVG_NAMESPACE&&!HTML_INTEGRATION_POINTS[parentTagName])&&!(parent.namespaceURI===MATHML_NAMESPACE&&!MATHML_TEXT_INTEGRATION_POINTS[parentTagName])&&!ALL_MATHML_TAGS[tagName]&&(COMMON_SVG_AND_HTML_ELEMENTS[tagName]||!ALL_SVG_TAGS[tagName])}(tagName,parent,parentTagName):!("application/xhtml+xml"!==PARSER_MEDIA_TYPE||!ALLOWED_NAMESPACES[element.namespaceURI]))},_forceRemove=function(node){arrayPush(DOMPurify.removed,{element:node});try{getParentNode(node).removeChild(node)}catch(_2){if(remove(node),!getParentNode(node))throw typeErrorCreate("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},_neutralizeRoot=function(root){const childNodes=getChildNodes(root);if(childNodes){const snapshot=[];arrayForEach(childNodes,child=>{arrayPush(snapshot,child)}),arrayForEach(snapshot,child=>{try{remove(child)}catch(_2){}})}const attributes=getAttributes(root);if(attributes)for(let i=attributes.length-1;i>=0;--i){const attribute=attributes[i],name=attribute&&attribute.name;if("string"==typeof name)try{root.removeAttribute(name)}catch(_2){}}},_removeAttribute=function(name,element){try{arrayPush(DOMPurify.removed,{attribute:element.getAttributeNode(name),from:element})}catch(_2){arrayPush(DOMPurify.removed,{attribute:null,from:element})}if(element.removeAttribute(name),"is"===name)if(RETURN_DOM||RETURN_DOM_FRAGMENT)try{_forceRemove(element)}catch(_2){}else try{element.setAttribute(name,"")}catch(_2){}},_stripDisallowedAttributes=function(element){const attributes=getAttributes(element);if(attributes)for(let i=attributes.length-1;i>=0;--i){const attribute=attributes[i],name=attribute&&attribute.name;if("string"==typeof name&&!ALLOWED_ATTR[transformCaseFunc(name)])try{element.removeAttribute(name)}catch(_2){}}},_initDocument=function(dirty){let doc=null,leadingWhitespace=null;if(FORCE_BODY)dirty="<remove></remove>"+dirty;else{const matches=stringMatch(dirty,/^[\r\n\t ]+/);leadingWhitespace=matches&&matches[0]}"application/xhtml+xml"===PARSER_MEDIA_TYPE&&NAMESPACE===HTML_NAMESPACE&&(dirty='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+dirty+"</body></html>");const dirtyPayload=trustedTypesPolicy?_createTrustedHTML(dirty):dirty;if(NAMESPACE===HTML_NAMESPACE)try{doc=(new DOMParser).parseFromString(dirtyPayload,PARSER_MEDIA_TYPE)}catch(_2){}if(!doc||!doc.documentElement){doc=implementation.createDocument(NAMESPACE,"template",null);try{doc.documentElement.innerHTML=IS_EMPTY_INPUT?emptyHTML:dirtyPayload}catch(_2){}}const body=doc.body||doc.documentElement;return dirty&&leadingWhitespace&&body.insertBefore(document.createTextNode(leadingWhitespace),body.childNodes[0]||null),NAMESPACE===HTML_NAMESPACE?getElementsByTagName.call(doc,WHOLE_DOCUMENT?"html":"body")[0]:WHOLE_DOCUMENT?doc.documentElement:body},_createNodeIterator=function(root){return createNodeIterator.call(root.ownerDocument||root,root,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_PROCESSING_INSTRUCTION|NodeFilter.SHOW_CDATA_SECTION,null)},_stripTemplateExpressions=function(value){return value=stringReplace(value,MUSTACHE_EXPR$1," "),value=stringReplace(value,ERB_EXPR$1," "),value=stringReplace(value,TMPLIT_EXPR$1," ")},_scrubTemplateExpressions2=function(node){var _node$querySelectorAl;node.normalize();const walker=createNodeIterator.call(node.ownerDocument||node,node,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_CDATA_SECTION|NodeFilter.SHOW_PROCESSING_INSTRUCTION,null);let currentNode=walker.nextNode();for(;currentNode;)currentNode.data=_stripTemplateExpressions(currentNode.data),currentNode=walker.nextNode();const templates=null===(_node$querySelectorAl=node.querySelectorAll)||void 0===_node$querySelectorAl?void 0:_node$querySelectorAl.call(node,"template");templates&&arrayForEach(templates,tmpl=>{_isDocumentFragment(tmpl.content)&&_scrubTemplateExpressions2(tmpl.content)})},_isClobbered=function(element){const realTagName=getNodeName?getNodeName(element):null;return"string"==typeof realTagName&&("form"===transformCaseFunc(realTagName)&&("string"!=typeof element.nodeName||"string"!=typeof element.textContent||"function"!=typeof element.removeChild||element.attributes!==getAttributes(element)||"function"!=typeof element.removeAttribute||"function"!=typeof element.setAttribute||"string"!=typeof element.namespaceURI||"function"!=typeof element.insertBefore||"function"!=typeof element.hasChildNodes||element.nodeType!==getNodeType(element)||element.childNodes!==getChildNodes(element)))},_isDocumentFragment=function(value){if(!getNodeType||"object"!=typeof value||null===value)return!1;try{return getNodeType(value)===NODE_TYPE_documentFragment}catch(_2){return!1}},_isNode=function(value){if(!getNodeType||"object"!=typeof value||null===value)return!1;try{return"number"==typeof getNodeType(value)}catch(_2){return!1}};function _executeHooks(hooks2,currentNode,data){0!==hooks2.length&&arrayForEach(hooks2,hook=>{hook.call(DOMPurify,currentNode,data,CONFIG)})}const _sanitizeElements=function(currentNode){if(_executeHooks(hooks.beforeSanitizeElements,currentNode,null),_isClobbered(currentNode))return _forceRemove(currentNode),!0;const tagName=transformCaseFunc(getNodeName?getNodeName(currentNode):currentNode.nodeName);if(_executeHooks(hooks.uponSanitizeElement,currentNode,{tagName:tagName,allowedTags:ALLOWED_TAGS}),function(currentNode,tagName){return!!(SAFE_FOR_XML&&currentNode.hasChildNodes()&&!_isNode(currentNode.firstElementChild)&&regExpTest(ELEMENT_MARKUP_PROBE,currentNode.textContent)&&regExpTest(ELEMENT_MARKUP_PROBE,currentNode.innerHTML))||!(!SAFE_FOR_XML||currentNode.namespaceURI!==HTML_NAMESPACE||"style"!==tagName||!_isNode(currentNode.firstElementChild))||currentNode.nodeType===NODE_TYPE_processingInstruction||!(!SAFE_FOR_XML||currentNode.nodeType!==NODE_TYPE_comment||!regExpTest(COMMENT_MARKUP_PROBE,currentNode.data))}(currentNode,tagName))return _forceRemove(currentNode),!0;if(FORBID_TAGS[tagName]||!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function&&EXTRA_ELEMENT_HANDLING.tagCheck(tagName))&&!ALLOWED_TAGS[tagName])return function(currentNode,tagName){if(!FORBID_TAGS[tagName]&&_isBasicCustomElement(tagName)){if(CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp&&regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck,tagName))return!1;if(CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function&&CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName))return!1}if(KEEP_CONTENT&&!FORBID_CONTENTS[tagName]){const parentNode=getParentNode(currentNode),childNodes=getChildNodes(currentNode);if(childNodes&&parentNode)for(let i=childNodes.length-1;i>=0;--i){const hoisted=IN_PLACE?childNodes[i]:cloneNode(childNodes[i],!0);parentNode.insertBefore(hoisted,getNextSibling(currentNode))}}return _forceRemove(currentNode),!0}(currentNode,tagName);if((getNodeType?getNodeType(currentNode):currentNode.nodeType)===NODE_TYPE_element&&!_checkValidNamespace(currentNode))return _forceRemove(currentNode),!0;if(("noscript"===tagName||"noembed"===tagName||"noframes"===tagName)&&regExpTest(FALLBACK_TAG_CLOSE,currentNode.innerHTML))return _forceRemove(currentNode),!0;if(SAFE_FOR_TEMPLATES&&currentNode.nodeType===NODE_TYPE_text){const content=_stripTemplateExpressions(currentNode.textContent);currentNode.textContent!==content&&(arrayPush(DOMPurify.removed,{element:currentNode.cloneNode()}),currentNode.textContent=content)}return _executeHooks(hooks.afterSanitizeElements,currentNode,null),!1},_isValidAttribute=function(lcTag,lcName,value){if(FORBID_ATTR[lcName])return!1;if(SANITIZE_DOM&&("id"===lcName||"name"===lcName)&&(value in document||value in formElement))return!1;const nameIsPermitted=ALLOWED_ATTR[lcName]||EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function&&EXTRA_ELEMENT_HANDLING.attributeCheck(lcName,lcTag);if(ALLOW_DATA_ATTR&&regExpTest(DATA_ATTR$1,lcName));else if(ALLOW_ARIA_ATTR&&regExpTest(ARIA_ATTR$1,lcName));else if(nameIsPermitted)if(URI_SAFE_ATTRIBUTES[lcName]);else if(regExpTest(IS_ALLOWED_URI$1,stringReplace(value,ATTR_WHITESPACE$1,"")));else if("src"!==lcName&&"xlink:href"!==lcName&&"href"!==lcName||"script"===lcTag||0!==stringIndexOf(value,"data:")||!DATA_URI_TAGS[lcTag]){if(ALLOW_UNKNOWN_PROTOCOLS&&!regExpTest(IS_SCRIPT_OR_DATA$1,stringReplace(value,ATTR_WHITESPACE$1,"")));else if(value)return!1}else;else if(!(_isBasicCustomElement(lcTag)&&(CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp&&regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck,lcTag)||CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function&&CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag))&&(CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp&&regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck,lcName)||CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function&&CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName,lcTag))||"is"===lcName&&CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp&&regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck,value)||CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function&&CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))))return!1;return!0},RESERVED_CUSTOM_ELEMENT_NAMES=addToSet({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),_isBasicCustomElement=function(tagName){return!RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)]&&regExpTest(CUSTOM_ELEMENT$1,tagName)},_applyTrustedTypesToAttribute=function(lcTag,lcName,namespaceURI,value){if(trustedTypesPolicy&&"object"==typeof trustedTypes&&"function"==typeof trustedTypes.getAttributeType&&!namespaceURI)switch(trustedTypes.getAttributeType(lcTag,lcName)){case"TrustedHTML":return _createTrustedHTML(value);case"TrustedScriptURL":return function(scriptUrl){_assertNotInTrustedTypesPolicy(),IN_TRUSTED_TYPES_POLICY++;try{return trustedTypesPolicy.createScriptURL(scriptUrl)}finally{IN_TRUSTED_TYPES_POLICY--}}(value)}return value},_setAttributeValue=function(currentNode,name,namespaceURI,value){try{namespaceURI?currentNode.setAttributeNS(namespaceURI,name,value):currentNode.setAttribute(name,value),_isClobbered(currentNode)?_forceRemove(currentNode):arrayPop(DOMPurify.removed)}catch(_2){_removeAttribute(name,currentNode)}},_sanitizeAttributes=function(currentNode){_executeHooks(hooks.beforeSanitizeAttributes,currentNode,null);const attributes=currentNode.attributes;if(!attributes||_isClobbered(currentNode))return;const hookEvent={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ALLOWED_ATTR,forceKeepAttr:void 0};let l=attributes.length;const lcTag=transformCaseFunc(currentNode.nodeName);for(;l--;){const attr=attributes[l],name=attr.name,namespaceURI=attr.namespaceURI,attrValue=attr.value,lcName=transformCaseFunc(name),initValue=attrValue;let value="value"===name?initValue:stringTrim(initValue);hookEvent.attrName=lcName,hookEvent.attrValue=value,hookEvent.keepAttr=!0,hookEvent.forceKeepAttr=void 0,_executeHooks(hooks.uponSanitizeAttribute,currentNode,hookEvent),value=hookEvent.attrValue,!SANITIZE_NAMED_PROPS||"id"!==lcName&&"name"!==lcName||0===stringIndexOf(value,"user-content-")||(_removeAttribute(name,currentNode),value="user-content-"+value),SAFE_FOR_XML&&regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,value)?_removeAttribute(name,currentNode):"attributename"===lcName&&stringMatch(value,"href")?_removeAttribute(name,currentNode):hookEvent.forceKeepAttr||(hookEvent.keepAttr&&(ALLOW_SELF_CLOSE_IN_ATTR||!regExpTest(SELF_CLOSING_TAG,value))?(SAFE_FOR_TEMPLATES&&(value=_stripTemplateExpressions(value)),_isValidAttribute(lcTag,lcName,value)?(value=_applyTrustedTypesToAttribute(lcTag,lcName,namespaceURI,value),value!==initValue&&_setAttributeValue(currentNode,name,namespaceURI,value)):_removeAttribute(name,currentNode)):_removeAttribute(name,currentNode))}_executeHooks(hooks.afterSanitizeAttributes,currentNode,null)},_sanitizeShadowDOM2=function(fragment){let shadowNode=null;const shadowIterator=_createNodeIterator(fragment);for(_executeHooks(hooks.beforeSanitizeShadowDOM,fragment,null);shadowNode=shadowIterator.nextNode();){_executeHooks(hooks.uponSanitizeShadowNode,shadowNode,null),_sanitizeElements(shadowNode),_sanitizeAttributes(shadowNode),_isDocumentFragment(shadowNode.content)&&_sanitizeShadowDOM2(shadowNode.content);if((getNodeType?getNodeType(shadowNode):shadowNode.nodeType)===NODE_TYPE_element){const innerSr=getShadowRoot(shadowNode);_isDocumentFragment(innerSr)&&(_sanitizeAttachedShadowRoots(innerSr),_sanitizeShadowDOM2(innerSr))}}_executeHooks(hooks.afterSanitizeShadowDOM,fragment,null)},_sanitizeAttachedShadowRoots=function(root){const stack=[{node:root,shadow:null}];for(;stack.length>0;){const item=stack.pop();if(item.shadow){_sanitizeShadowDOM2(item.shadow);continue}const node=item.node,isElement=(getNodeType?getNodeType(node):node.nodeType)===NODE_TYPE_element,childNodes=getChildNodes(node);if(childNodes)for(let i=childNodes.length-1;i>=0;--i)stack.push({node:childNodes[i],shadow:null});if(isElement){const rootName=getNodeName?getNodeName(node):null;if("string"==typeof rootName&&"template"===transformCaseFunc(rootName)){const content=node.content;_isDocumentFragment(content)&&stack.push({node:content,shadow:null})}}if(isElement){const sr=getShadowRoot(node);_isDocumentFragment(sr)&&stack.push({node:null,shadow:sr},{node:sr,shadow:null})}}};return DOMPurify.sanitize=function(dirty){let cfg=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},body=null,importedNode=null,currentNode=null,returnNode=null;if(IS_EMPTY_INPUT=!dirty,IS_EMPTY_INPUT&&(dirty="\x3c!--\x3e"),"string"!=typeof dirty&&!_isNode(dirty)&&"string"!=typeof(dirty=function(value){switch(typeof value){case"string":return value;case"number":return numberToString(value);case"boolean":return booleanToString(value);case"bigint":return bigintToString?bigintToString(value):"0";case"symbol":return symbolToString?symbolToString(value):"Symbol()";case"undefined":default:return objectToString(value);case"function":case"object":{if(null===value)return objectToString(value);const valueAsRecord=value,valueToString=lookupGetter(valueAsRecord,"toString");if("function"==typeof valueToString){const stringified=valueToString(valueAsRecord);return"string"==typeof stringified?stringified:objectToString(stringified)}return objectToString(value)}}}(dirty)))throw typeErrorCreate("dirty is not a string, aborting");if(!DOMPurify.isSupported)return dirty;SET_CONFIG?(ALLOWED_TAGS=SET_CONFIG_ALLOWED_TAGS,ALLOWED_ATTR=SET_CONFIG_ALLOWED_ATTR):_parseConfig(cfg),(hooks.uponSanitizeElement.length>0||hooks.uponSanitizeAttribute.length>0)&&(ALLOWED_TAGS=clone(ALLOWED_TAGS)),hooks.uponSanitizeAttribute.length>0&&(ALLOWED_ATTR=clone(ALLOWED_ATTR)),DOMPurify.removed=[];const inPlace=IN_PLACE&&"string"!=typeof dirty&&_isNode(dirty);if(inPlace){const nn=getNodeName?getNodeName(dirty):dirty.nodeName;if("string"==typeof nn){const tagName=transformCaseFunc(nn);if(!ALLOWED_TAGS[tagName]||FORBID_TAGS[tagName])throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place")}if(_isClobbered(dirty))throw typeErrorCreate("root node is clobbered and cannot be sanitized in-place");try{_sanitizeAttachedShadowRoots(dirty)}catch(error){throw _neutralizeRoot(dirty),error}}else if(_isNode(dirty))body=_initDocument("\x3c!----\x3e"),importedNode=body.ownerDocument.importNode(dirty,!0),importedNode.nodeType===NODE_TYPE_element&&"BODY"===importedNode.nodeName||"HTML"===importedNode.nodeName?body=importedNode:body.appendChild(importedNode),_sanitizeAttachedShadowRoots(importedNode);else{if(!RETURN_DOM&&!SAFE_FOR_TEMPLATES&&!WHOLE_DOCUMENT&&-1===dirty.indexOf("<"))return trustedTypesPolicy&&RETURN_TRUSTED_TYPE?_createTrustedHTML(dirty):dirty;if(body=_initDocument(dirty),!body)return RETURN_DOM?null:RETURN_TRUSTED_TYPE?emptyHTML:""}body&&FORCE_BODY&&_forceRemove(body.firstChild);const nodeIterator=_createNodeIterator(inPlace?dirty:body);try{for(;currentNode=nodeIterator.nextNode();)_sanitizeElements(currentNode),_sanitizeAttributes(currentNode),_isDocumentFragment(currentNode.content)&&_sanitizeShadowDOM2(currentNode.content)}catch(error){throw inPlace&&_neutralizeRoot(dirty),error}if(inPlace)return arrayForEach(DOMPurify.removed,entry=>{entry.element&&function(root){const stack=[root];for(;stack.length>0;){const node=stack.pop();(getNodeType?getNodeType(node):node.nodeType)===NODE_TYPE_element&&_stripDisallowedAttributes(node);const childNodes=getChildNodes(node);if(childNodes)for(let i=childNodes.length-1;i>=0;--i)stack.push(childNodes[i])}}(entry.element)}),SAFE_FOR_TEMPLATES&&_scrubTemplateExpressions2(dirty),dirty;if(RETURN_DOM){if(SAFE_FOR_TEMPLATES&&_scrubTemplateExpressions2(body),RETURN_DOM_FRAGMENT)for(returnNode=createDocumentFragment.call(body.ownerDocument);body.firstChild;)returnNode.appendChild(body.firstChild);else returnNode=body;return(ALLOWED_ATTR.shadowroot||ALLOWED_ATTR.shadowrootmode)&&(returnNode=importNode.call(originalDocument,returnNode,!0)),returnNode}let serializedHTML=WHOLE_DOCUMENT?body.outerHTML:body.innerHTML;return WHOLE_DOCUMENT&&ALLOWED_TAGS["!doctype"]&&body.ownerDocument&&body.ownerDocument.doctype&&body.ownerDocument.doctype.name&&regExpTest(DOCTYPE_NAME,body.ownerDocument.doctype.name)&&(serializedHTML="<!DOCTYPE "+body.ownerDocument.doctype.name+">\n"+serializedHTML),SAFE_FOR_TEMPLATES&&(serializedHTML=_stripTemplateExpressions(serializedHTML)),trustedTypesPolicy&&RETURN_TRUSTED_TYPE?_createTrustedHTML(serializedHTML):serializedHTML},DOMPurify.setConfig=function(){_parseConfig(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),SET_CONFIG=!0,SET_CONFIG_ALLOWED_TAGS=ALLOWED_TAGS,SET_CONFIG_ALLOWED_ATTR=ALLOWED_ATTR},DOMPurify.clearConfig=function(){CONFIG=null,SET_CONFIG=!1,SET_CONFIG_ALLOWED_TAGS=null,SET_CONFIG_ALLOWED_ATTR=null,trustedTypesPolicy=defaultTrustedTypesPolicy,emptyHTML=""},DOMPurify.isValidAttribute=function(tag,attr,value){CONFIG||_parseConfig({});const lcTag=transformCaseFunc(tag),lcName=transformCaseFunc(attr);return _isValidAttribute(lcTag,lcName,value)},DOMPurify.addHook=function(entryPoint,hookFunction){"function"==typeof hookFunction&&objectHasOwnProperty(hooks,entryPoint)&&arrayPush(hooks[entryPoint],hookFunction)},DOMPurify.removeHook=function(entryPoint,hookFunction){if(objectHasOwnProperty(hooks,entryPoint)){if(void 0!==hookFunction){const index=arrayLastIndexOf(hooks[entryPoint],hookFunction);return-1===index?void 0:arraySplice(hooks[entryPoint],index,1)[0]}return arrayPop(hooks[entryPoint])}},DOMPurify.removeHooks=function(entryPoint){objectHasOwnProperty(hooks,entryPoint)&&(hooks[entryPoint]=[])},DOMPurify.removeAllHooks=function(){hooks={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},DOMPurify}();export{g,purify as p};
@@ -1 +0,0 @@
1
- var _a;import{p as populateCommonDb}from"./chunk-JWPE2WC7-D5RR93-U.js";import{s as setAccDescription,g as getAccDescription,o as getDiagramTitle,n as setDiagramTitle,a as getAccTitle,b as setAccTitle,_ as __name,E as getThemeVariables3,y as getConfig,A as cleanAndMerge,l as log,D as selectSvgElement,e as configureSvgSize,p as clear,c as getConfig2}from"./mermaid.core-DH-sQJgr.js";import{p as parse}from"./cynefin-VYW2F7L2-Ch8_Ihra.js";import"./vendor-mdxeditor-DT0rad22.js";import"./vendor-antd-DNUTLr77.js";import"./vendor-codemirror-6ck0hLRU.js";import"./vendor-markdown-DBlfs4dR.js";var toPercent=__name((value,context)=>{const normalized=value<=1?100*value:value;if(normalized<0||normalized>100)throw new Error(`${context} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${value}`);return normalized},"toPercent"),toCoordinates=__name((visibility,evolution,context)=>({x:toPercent(evolution,`${context} evolution`),y:toPercent(visibility,`${context} visibility`)}),"toCoordinates"),getFlowFromPort=__name(port=>{if(port)return"+<>"===port?"bidirectional":"+<"===port?"backward":"+>"===port?"forward":void 0},"getFlowFromPort"),extractFlowFromArrow=__name(arrow=>{if(!(null==arrow?void 0:arrow.startsWith("+")))return{};const labelMatch=/^\+'([^']*)'/.exec(arrow),flowLabel=null==labelMatch?void 0:labelMatch[1];return arrow.includes("<>")?{flow:"bidirectional",label:flowLabel}:arrow.includes("<")?{flow:"backward",label:flowLabel}:arrow.includes(">")?{flow:"forward",label:flowLabel}:{label:flowLabel}},"extractFlowFromArrow"),populateDb=__name((ast,db)=>{if(populateCommonDb(ast,db),ast.size&&db.setSize(ast.size.width,ast.size.height),ast.evolution){const stages=ast.evolution.stages.map(stage=>stage.secondName?`${stage.name.trim()} / ${stage.secondName.trim()}`:stage.name.trim()),stageBoundaries=ast.evolution.stages.filter(stage=>void 0!==stage.boundary).map(stage=>stage.boundary);db.updateAxes({stages:stages,stageBoundaries:stageBoundaries})}if(ast.anchors.forEach(anchor=>{const coords=toCoordinates(anchor.visibility,anchor.evolution,`Anchor "${anchor.name}"`);db.addNode(anchor.name,anchor.name,coords.x,coords.y,"anchor")}),ast.components.forEach(component=>{var _a2;const coords=toCoordinates(component.visibility,component.evolution,`Component "${component.name}"`),labelOffsetX=component.label?(component.label.negX?-1:1)*component.label.offsetX:void 0,labelOffsetY=component.label?(component.label.negY?-1:1)*component.label.offsetY:void 0,sourceStrategy=null==(_a2=component.decorator)?void 0:_a2.strategy;db.addNode(component.name,component.name,coords.x,coords.y,"component",labelOffsetX,labelOffsetY,component.inertia,sourceStrategy)}),ast.notes.forEach(note=>{const coords=toCoordinates(note.visibility,note.evolution,`Note "${note.text}"`);db.addNote(note.text,coords.x,coords.y)}),ast.pipelines.forEach(pipeline=>{const parentNode=db.getNode(pipeline.parent);if(!parentNode||"number"!=typeof parentNode.y)throw new Error(`Pipeline "${pipeline.parent}" must reference an existing component with coordinates.`);const parentY=parentNode.y;db.startPipeline(pipeline.parent),pipeline.components.forEach(component=>{const componentId=`${pipeline.parent}_${component.name}`,labelOffsetX=component.label?(component.label.negX?-1:1)*component.label.offsetX:void 0,labelOffsetY=component.label?(component.label.negY?-1:1)*component.label.offsetY:void 0,x=toPercent(component.evolution,`Pipeline component "${component.name}" evolution`);db.addNode(componentId,component.name,x,parentY,"pipeline-component",labelOffsetX,labelOffsetY),db.addPipelineComponent(pipeline.parent,componentId)})}),ast.links.forEach(link=>{const isDashed=!!link.arrow&&(link.arrow.includes("-.->")||link.arrow.includes(".-."));let flow=getFlowFromPort(link.fromPort)??getFlowFromPort(link.toPort);const{flow:arrowFlow,label:flowLabel}=extractFlowFromArrow(link.arrow);!flow&&arrowFlow&&(flow=arrowFlow);const annotation=link.linkLabel,label=flowLabel??annotation;db.addLink(db.resolveNodeId(link.from),db.resolveNodeId(link.to),isDashed,label,flow)}),ast.evolves.forEach(evolve=>{const node=db.getNode(evolve.component);if(void 0!==(null==node?void 0:node.y)){const target=toPercent(evolve.target,`Evolve target for "${evolve.component}"`);db.addTrend(evolve.component,target,node.y)}}),ast.annotations.length>0){const annotationsBox=ast.annotations[0],coords=toCoordinates(annotationsBox.x,annotationsBox.y,"Annotations box");db.setAnnotationsBox(coords.x,coords.y)}ast.annotation.forEach(annotation=>{const coords=toCoordinates(annotation.x,annotation.y,`Annotation ${annotation.number}`);db.addAnnotation(annotation.number,[{x:coords.x,y:coords.y}],annotation.text)}),ast.accelerators.forEach(accelerator=>{const coords=toCoordinates(accelerator.x,accelerator.y,`Accelerator "${accelerator.name}"`);db.addAccelerator(accelerator.name,coords.x,coords.y)}),ast.deaccelerators.forEach(deaccelerator=>{const coords=toCoordinates(deaccelerator.x,deaccelerator.y,`Deaccelerator "${deaccelerator.name}"`);db.addDeaccelerator(deaccelerator.name,coords.x,coords.y)})},"populateDb"),parser={parser:{yy:void 0},parse:__name(async input=>{var _a2;const ast=await parse("wardley",input);log.debug(ast);const db=null==(_a2=parser.parser)?void 0:_a2.yy;if(!db||"function"!=typeof db.addNode)throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");populateDb(ast,db)},"parse")},builder=new(__name(_a=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(node){const existing=this.nodes.get(node.id)??{id:node.id,label:node.label},merged={...existing,...node,className:node.className??existing.className,labelOffsetX:node.labelOffsetX??existing.labelOffsetX,labelOffsetY:node.labelOffsetY??existing.labelOffsetY};this.nodes.set(node.id,merged)}addLink(link){this.links.push(link)}addTrend(trend){this.trends.set(trend.nodeId,trend)}startPipeline(nodeId){this.pipelines.set(nodeId,{nodeId:nodeId,componentIds:[]});const node=this.nodes.get(nodeId);node&&(node.isPipelineParent=!0)}addPipelineComponent(pipelineNodeId,componentId){const pipeline=this.pipelines.get(pipelineNodeId);pipeline&&pipeline.componentIds.push(componentId);const node=this.nodes.get(componentId);node&&(node.inPipeline=!0)}addAnnotation(annotation){this.annotations.push(annotation)}addNote(note){this.notes.push(note)}addAccelerator(accelerator){this.accelerators.push(accelerator)}addDeaccelerator(deaccelerator){this.deaccelerators.push(deaccelerator)}setAnnotationsBox(x,y){this.annotationsBox={x:x,y:y}}setAxes(partial){this.axes={...this.axes,...partial}}setSize(width,height){this.size={width:width,height:height}}getNode(id){return this.nodes.get(id)}resolveNodeId(name){if(this.nodes.has(name))return name;for(const[id,node]of this.nodes)if(node.label===name)return id;return name}build(){const nodes=[];for(const node of this.nodes.values()){if("number"!=typeof node.x||"number"!=typeof node.y)throw new Error(`Node "${node.label}" is missing coordinates`);nodes.push(node)}return{nodes:nodes,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},"WardleyBuilder"),_a);function getConfig3(){return getConfig2()["wardley-beta"]}function addNode(id,label,x,y,className,labelOffsetX,labelOffsetY,inertia,sourceStrategy){builder.addNode({id:id,label:label,x:x,y:y,className:className,labelOffsetX:labelOffsetX,labelOffsetY:labelOffsetY,inertia:inertia,sourceStrategy:sourceStrategy})}function addLink(sourceId,targetId,dashed=!1,label,flow){builder.addLink({source:sourceId,target:targetId,dashed:dashed,label:label,flow:flow})}function addTrend(nodeId,targetX,targetY){builder.addTrend({nodeId:nodeId,targetX:targetX,targetY:targetY})}function addAnnotation(number,coordinates,text){builder.addAnnotation({number:number,coordinates:coordinates,text:text})}function addNote(text,x,y){builder.addNote({text:text,x:x,y:y})}function addAccelerator(name,x,y){builder.addAccelerator({name:name,x:x,y:y})}function addDeaccelerator(name,x,y){builder.addDeaccelerator({name:name,x:x,y:y})}function setAnnotationsBox(x,y){builder.setAnnotationsBox(x,y)}function setSize(width,height){builder.setSize(width,height)}function startPipeline(nodeId){builder.startPipeline(nodeId)}function addPipelineComponent(pipelineNodeId,componentId){builder.addPipelineComponent(pipelineNodeId,componentId)}function updateAxes(partial){builder.setAxes(partial)}function getNode(id){return builder.getNode(id)}function resolveNodeId(name){return builder.resolveNodeId(name)}function getWardleyData(){return builder.build()}function clear2(){builder.clear(),clear()}__name(getConfig3,"getConfig"),__name(addNode,"addNode"),__name(addLink,"addLink"),__name(addTrend,"addTrend"),__name(addAnnotation,"addAnnotation"),__name(addNote,"addNote"),__name(addAccelerator,"addAccelerator"),__name(addDeaccelerator,"addDeaccelerator"),__name(setAnnotationsBox,"setAnnotationsBox"),__name(setSize,"setSize"),__name(startPipeline,"startPipeline"),__name(addPipelineComponent,"addPipelineComponent"),__name(updateAxes,"updateAxes"),__name(getNode,"getNode"),__name(resolveNodeId,"resolveNodeId"),__name(getWardleyData,"getWardleyData"),__name(clear2,"clear");var wardleyDb_default={getConfig:getConfig3,addNode:addNode,addLink:addLink,addTrend:addTrend,addAnnotation:addAnnotation,addNote:addNote,addAccelerator:addAccelerator,addDeaccelerator:addDeaccelerator,setAnnotationsBox:setAnnotationsBox,setSize:setSize,startPipeline:startPipeline,addPipelineComponent:addPipelineComponent,updateAxes:updateAxes,getNode:getNode,resolveNodeId:resolveNodeId,getWardleyData:getWardleyData,clear:clear2,setAccTitle:setAccTitle,getAccTitle:getAccTitle,setDiagramTitle:setDiagramTitle,getDiagramTitle:getDiagramTitle,getAccDescription:getAccDescription,setAccDescription:setAccDescription},DEFAULT_STAGES=["Genesis","Custom Built","Product","Commodity"],getTheme=__name(()=>{var _a2,_b,_c,_d,_e,_f,_g,_h,_i,_j,_k,_l;const{themeVariables:themeVariables}=getConfig2();return{backgroundColor:(null==(_a2=themeVariables.wardley)?void 0:_a2.backgroundColor)??themeVariables.background??"#fff",axisColor:(null==(_b=themeVariables.wardley)?void 0:_b.axisColor)??"#000",axisTextColor:(null==(_c=themeVariables.wardley)?void 0:_c.axisTextColor)??themeVariables.primaryTextColor??"#222",gridColor:(null==(_d=themeVariables.wardley)?void 0:_d.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:(null==(_e=themeVariables.wardley)?void 0:_e.componentFill)??"#fff",componentStroke:(null==(_f=themeVariables.wardley)?void 0:_f.componentStroke)??"#000",componentLabelColor:(null==(_g=themeVariables.wardley)?void 0:_g.componentLabelColor)??themeVariables.primaryTextColor??"#222",linkStroke:(null==(_h=themeVariables.wardley)?void 0:_h.linkStroke)??"#000",evolutionStroke:(null==(_i=themeVariables.wardley)?void 0:_i.evolutionStroke)??"#dc3545",annotationStroke:(null==(_j=themeVariables.wardley)?void 0:_j.annotationStroke)??"#000",annotationTextColor:(null==(_k=themeVariables.wardley)?void 0:_k.annotationTextColor)??themeVariables.primaryTextColor??"#222",annotationFill:(null==(_l=themeVariables.wardley)?void 0:_l.annotationFill)??themeVariables.background??"#fff"}},"getTheme"),getConfigValues=__name(()=>{const wardleyConfig=getConfig2()["wardley-beta"];return{width:(null==wardleyConfig?void 0:wardleyConfig.width)??900,height:(null==wardleyConfig?void 0:wardleyConfig.height)??600,padding:(null==wardleyConfig?void 0:wardleyConfig.padding)??48,nodeRadius:(null==wardleyConfig?void 0:wardleyConfig.nodeRadius)??6,nodeLabelOffset:(null==wardleyConfig?void 0:wardleyConfig.nodeLabelOffset)??8,axisFontSize:(null==wardleyConfig?void 0:wardleyConfig.axisFontSize)??12,labelFontSize:(null==wardleyConfig?void 0:wardleyConfig.labelFontSize)??10,showGrid:(null==wardleyConfig?void 0:wardleyConfig.showGrid)??!1,useMaxWidth:(null==wardleyConfig?void 0:wardleyConfig.useMaxWidth)??!0}},"getConfigValues"),diagram={parser:parser,db:wardleyDb_default,renderer:{draw:__name((text,id,_version,diagObj)=>{var _a2,_b;log.debug("Rendering Wardley map\n"+text);const configValues=getConfigValues(),theme=getTheme(),squareSize=1.6*configValues.nodeRadius,db=diagObj.db,data=db.getWardleyData(),title=db.getDiagramTitle(),width=(null==(_a2=data.size)?void 0:_a2.width)??configValues.width,height=(null==(_b=data.size)?void 0:_b.height)??configValues.height,svg=selectSvgElement(id);svg.selectAll("*").remove(),configureSvgSize(svg,height,width,configValues.useMaxWidth),svg.attr("viewBox",`0 0 ${width} ${height}`);const root=svg.append("g").attr("class","wardley-map"),defs=svg.append("defs");defs.append("marker").attr("id",`arrow-${id}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",theme.evolutionStroke).attr("stroke","none"),defs.append("marker").attr("id",`link-arrow-end-${id}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",theme.linkStroke).attr("stroke","none"),defs.append("marker").attr("id",`link-arrow-start-${id}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",theme.linkStroke).attr("stroke","none"),root.append("rect").attr("class","wardley-background").attr("width",width).attr("height",height).attr("fill",theme.backgroundColor);const chartWidth=width-2*configValues.padding,chartHeight=height-2*configValues.padding;title&&root.append("text").attr("class","wardley-title").attr("x",width/2).attr("y",configValues.padding/2).attr("fill",theme.axisTextColor).attr("font-size",1.05*configValues.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(title);const projectX=__name(value=>configValues.padding+value/100*chartWidth,"projectX"),projectY=__name(value=>height-configValues.padding-value/100*chartHeight,"projectY"),axisGroup=root.append("g").attr("class","wardley-axes");axisGroup.append("line").attr("x1",configValues.padding).attr("x2",width-configValues.padding).attr("y1",height-configValues.padding).attr("y2",height-configValues.padding).attr("stroke",theme.axisColor).attr("stroke-width",1),axisGroup.append("line").attr("x1",configValues.padding).attr("x2",configValues.padding).attr("y1",configValues.padding).attr("y2",height-configValues.padding).attr("stroke",theme.axisColor).attr("stroke-width",1);const xLabel=data.axes.xLabel??"Evolution",yLabel=data.axes.yLabel??"Visibility";axisGroup.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",configValues.padding+chartWidth/2).attr("y",height-configValues.padding/4).attr("fill",theme.axisTextColor).attr("font-size",configValues.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(xLabel),axisGroup.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",configValues.padding/3).attr("y",configValues.padding+chartHeight/2).attr("fill",theme.axisTextColor).attr("font-size",configValues.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${configValues.padding/3} ${configValues.padding+chartHeight/2})`).text(yLabel);const stages=data.axes.stages&&data.axes.stages.length>0?data.axes.stages:DEFAULT_STAGES;if(stages.length>0){const stageGroup=root.append("g").attr("class","wardley-stages"),boundaries=data.axes.stageBoundaries,stagePositions=[];if(boundaries&&boundaries.length===stages.length){let prevBoundary=0;boundaries.forEach(boundary=>{stagePositions.push({start:prevBoundary,end:boundary}),prevBoundary=boundary})}else{const stageWidth=1/stages.length;stages.forEach((_,index)=>{stagePositions.push({start:index*stageWidth,end:(index+1)*stageWidth})})}stages.forEach((stage,index)=>{const pos=stagePositions[index],startX=configValues.padding+pos.start*chartWidth,centerX=(startX+(configValues.padding+pos.end*chartWidth))/2;index>0&&stageGroup.append("line").attr("x1",startX).attr("x2",startX).attr("y1",configValues.padding).attr("y2",height-configValues.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),stageGroup.append("text").attr("class","wardley-stage-label").attr("x",centerX).attr("y",height-configValues.padding/1.5).attr("fill",theme.axisTextColor).attr("font-size",configValues.axisFontSize-2).attr("text-anchor","middle").text(stage)})}if(configValues.showGrid){const gridGroup=root.append("g").attr("class","wardley-grid");for(let i=1;i<4;i++){const ratio=i/4,x=configValues.padding+chartWidth*ratio;gridGroup.append("line").attr("x1",x).attr("x2",x).attr("y1",configValues.padding).attr("y2",height-configValues.padding).attr("stroke",theme.gridColor).attr("stroke-dasharray","2 6"),gridGroup.append("line").attr("x1",configValues.padding).attr("x2",width-configValues.padding).attr("y1",height-configValues.padding-chartHeight*ratio).attr("y2",height-configValues.padding-chartHeight*ratio).attr("stroke",theme.gridColor).attr("stroke-dasharray","2 6")}}const positions=new Map;if(data.nodes.forEach(node=>{positions.set(node.id,{x:projectX(node.x),y:projectY(node.y),node:node})}),data.pipelines.length>0){const pipelineGroup=root.append("g").attr("class","wardley-pipelines"),pipelineLinksGroup=root.append("g").attr("class","wardley-pipeline-links");data.pipelines.forEach(pipeline=>{if(0===pipeline.componentIds.length)return;const sortedComponents=pipeline.componentIds.map(id2=>({id:id2,pos:positions.get(id2),node:data.nodes.find(n=>n.id===id2)})).filter(c=>c.pos&&c.node).sort((a,b)=>a.node.x-b.node.x);for(let i=0;i<sortedComponents.length-1;i++){const current=sortedComponents[i],next=sortedComponents[i+1];pipelineLinksGroup.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",current.pos.x).attr("y1",current.pos.y).attr("x2",next.pos.x).attr("y2",next.pos.y).attr("stroke",theme.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let minX=1/0,maxX=-1/0,y=0;if(pipeline.componentIds.forEach(componentId=>{const pos=positions.get(componentId);pos&&(minX=Math.min(minX,pos.x),maxX=Math.max(maxX,pos.x),y=pos.y)}),minX!==1/0&&maxX!==-1/0){const padding=15,height2=4*configValues.nodeRadius,boxTop=y-height2/2,parentPos=positions.get(pipeline.nodeId);if(parentPos){const centerX=(minX+maxX)/2;parentPos.x=centerX,parentPos.y=boxTop-squareSize/6}pipelineGroup.append("rect").attr("class","wardley-pipeline-box").attr("x",minX-padding).attr("y",boxTop).attr("width",maxX-minX+2*padding).attr("height",height2).attr("fill","none").attr("stroke",theme.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const linksGroup=root.append("g").attr("class","wardley-links"),pipelineMap=new Map;data.pipelines.forEach(pipeline=>{pipelineMap.set(pipeline.nodeId,new Set(pipeline.componentIds))});const validLinks=data.links.filter(link=>{if(!positions.has(link.source)||!positions.has(link.target))return!1;const pipelineComponents=pipelineMap.get(link.target);return!(null==pipelineComponents?void 0:pipelineComponents.has(link.source))});linksGroup.selectAll("line").data(validLinks).enter().append("line").attr("class",link=>"wardley-link"+(link.dashed?" wardley-link--dashed":"")).attr("x1",link=>{const sourcePos=positions.get(link.source),targetPos=positions.get(link.target),radius=data.nodes.find(n=>n.id===link.source).isPipelineParent?squareSize/Math.sqrt(2):configValues.nodeRadius,dx=targetPos.x-sourcePos.x,dy=targetPos.y-sourcePos.y,distance=Math.sqrt(dx*dx+dy*dy);return sourcePos.x+dx/distance*radius}).attr("y1",link=>{const sourcePos=positions.get(link.source),targetPos=positions.get(link.target),radius=data.nodes.find(n=>n.id===link.source).isPipelineParent?squareSize/Math.sqrt(2):configValues.nodeRadius,dx=targetPos.x-sourcePos.x,dy=targetPos.y-sourcePos.y,distance=Math.sqrt(dx*dx+dy*dy);return sourcePos.y+dy/distance*radius}).attr("x2",link=>{const sourcePos=positions.get(link.source),targetPos=positions.get(link.target),radius=data.nodes.find(n=>n.id===link.target).isPipelineParent?squareSize/Math.sqrt(2):configValues.nodeRadius,dx=sourcePos.x-targetPos.x,dy=sourcePos.y-targetPos.y,distance=Math.sqrt(dx*dx+dy*dy);return targetPos.x+dx/distance*radius}).attr("y2",link=>{const sourcePos=positions.get(link.source),targetPos=positions.get(link.target),radius=data.nodes.find(n=>n.id===link.target).isPipelineParent?squareSize/Math.sqrt(2):configValues.nodeRadius,dx=sourcePos.x-targetPos.x,dy=sourcePos.y-targetPos.y,distance=Math.sqrt(dx*dx+dy*dy);return targetPos.y+dy/distance*radius}).attr("stroke",theme.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",link=>link.dashed?"6 6":null).attr("marker-end",link=>"forward"===link.flow||"bidirectional"===link.flow?`url(#link-arrow-end-${id})`:null).attr("marker-start",link=>"backward"===link.flow||"bidirectional"===link.flow?`url(#link-arrow-start-${id})`:null),linksGroup.selectAll("text").data(validLinks.filter(link=>link.label)).enter().append("text").attr("class","wardley-link-label").attr("x",link=>{const sourcePos=positions.get(link.source),targetPos=positions.get(link.target),midX=(sourcePos.x+targetPos.x)/2,dy=targetPos.y-sourcePos.y,dx=targetPos.x-sourcePos.x;return midX+8*(dy/Math.sqrt(dx*dx+dy*dy))}).attr("y",link=>{const sourcePos=positions.get(link.source),targetPos=positions.get(link.target),midY=(sourcePos.y+targetPos.y)/2,dx=targetPos.x-sourcePos.x,dy=targetPos.y-sourcePos.y;return midY+8*(-dx/Math.sqrt(dx*dx+dy*dy))}).attr("fill",theme.axisTextColor).attr("font-size",configValues.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",link=>{const sourcePos=positions.get(link.source),targetPos=positions.get(link.target),midX=(sourcePos.x+targetPos.x)/2,midY=(sourcePos.y+targetPos.y)/2,dx=targetPos.x-sourcePos.x,dy=targetPos.y-sourcePos.y,distance=Math.sqrt(dx*dx+dy*dy),labelX=midX+8*(dy/distance),labelY=midY+8*(-dx/distance);let angle=180*Math.atan2(dy,dx)/Math.PI;return(angle>90||angle<-90)&&(angle+=180),`rotate(${angle} ${labelX} ${labelY})`}).text(link=>link.label);const trendGroup=root.append("g").attr("class","wardley-trends"),trendsWithPositions=data.trends.map(trend=>{const origin=positions.get(trend.nodeId);if(!origin)return null;const targetX=projectX(trend.targetX),targetY=projectY(trend.targetY),dx=targetX-origin.x,dy=targetY-origin.y,distance=Math.sqrt(dx*dx+dy*dy),shortenBy=configValues.nodeRadius+2;return{origin:origin,targetX:targetX,targetY:targetY,adjustedX2:distance>shortenBy?targetX-dx/distance*shortenBy:targetX,adjustedY2:distance>shortenBy?targetY-dy/distance*shortenBy:targetY}}).filter(trend=>null!==trend);trendGroup.selectAll("line").data(trendsWithPositions).enter().append("line").attr("class","wardley-trend").attr("x1",trend=>trend.origin.x).attr("y1",trend=>trend.origin.y).attr("x2",trend=>trend.adjustedX2).attr("y2",trend=>trend.adjustedY2).attr("stroke",theme.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${id})`);const nodeEnter=root.append("g").attr("class","wardley-nodes").selectAll("g").data(data.nodes).enter().append("g").attr("class",node=>["wardley-node",node.className?`wardley-node--${node.className}`:""].filter(Boolean).join(" "));nodeEnter.filter(node=>"outsource"===node.sourceStrategy).append("circle").attr("class","wardley-outsource-overlay").attr("cx",node=>positions.get(node.id).x).attr("cy",node=>positions.get(node.id).y).attr("r",2*configValues.nodeRadius).attr("fill","#666").attr("stroke",theme.componentStroke).attr("stroke-width",1),nodeEnter.filter(node=>"buy"===node.sourceStrategy).append("circle").attr("class","wardley-buy-overlay").attr("cx",node=>positions.get(node.id).x).attr("cy",node=>positions.get(node.id).y).attr("r",2*configValues.nodeRadius).attr("fill","#ccc").attr("stroke",theme.componentStroke).attr("stroke-width",1),nodeEnter.filter(node=>"build"===node.sourceStrategy).append("circle").attr("class","wardley-build-overlay").attr("cx",node=>positions.get(node.id).x).attr("cy",node=>positions.get(node.id).y).attr("r",2*configValues.nodeRadius).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const marketNodes=nodeEnter.filter(node=>"market"===node.sourceStrategy);marketNodes.append("circle").attr("class","wardley-market-overlay").attr("cx",node=>positions.get(node.id).x).attr("cy",node=>positions.get(node.id).y).attr("r",2*configValues.nodeRadius).attr("fill","white").attr("stroke",theme.componentStroke).attr("stroke-width",1),nodeEnter.filter(node=>!node.isPipelineParent&&"market"!==node.sourceStrategy&&"anchor"!==node.className).append("circle").attr("cx",node=>positions.get(node.id).x).attr("cy",node=>positions.get(node.id).y).attr("r",configValues.nodeRadius).attr("fill",theme.componentFill).attr("stroke",theme.componentStroke).attr("stroke-width",1);const smallCircleRadius=.7*configValues.nodeRadius,triangleRadius=1.2*configValues.nodeRadius;if(marketNodes.append("line").attr("class","wardley-market-line").attr("x1",node=>positions.get(node.id).x).attr("y1",node=>positions.get(node.id).y-triangleRadius).attr("x2",node=>positions.get(node.id).x-triangleRadius*Math.cos(Math.PI/6)).attr("y2",node=>positions.get(node.id).y+triangleRadius*Math.sin(Math.PI/6)).attr("stroke",theme.componentStroke).attr("stroke-width",1),marketNodes.append("line").attr("class","wardley-market-line").attr("x1",node=>positions.get(node.id).x-triangleRadius*Math.cos(Math.PI/6)).attr("y1",node=>positions.get(node.id).y+triangleRadius*Math.sin(Math.PI/6)).attr("x2",node=>positions.get(node.id).x+triangleRadius*Math.cos(Math.PI/6)).attr("y2",node=>positions.get(node.id).y+triangleRadius*Math.sin(Math.PI/6)).attr("stroke",theme.componentStroke).attr("stroke-width",1),marketNodes.append("line").attr("class","wardley-market-line").attr("x1",node=>positions.get(node.id).x+triangleRadius*Math.cos(Math.PI/6)).attr("y1",node=>positions.get(node.id).y+triangleRadius*Math.sin(Math.PI/6)).attr("x2",node=>positions.get(node.id).x).attr("y2",node=>positions.get(node.id).y-triangleRadius).attr("stroke",theme.componentStroke).attr("stroke-width",1),marketNodes.append("circle").attr("class","wardley-market-dot").attr("cx",node=>positions.get(node.id).x).attr("cy",node=>positions.get(node.id).y-triangleRadius).attr("r",smallCircleRadius).attr("fill","white").attr("stroke",theme.componentStroke).attr("stroke-width",2),marketNodes.append("circle").attr("class","wardley-market-dot").attr("cx",node=>positions.get(node.id).x-triangleRadius*Math.cos(Math.PI/6)).attr("cy",node=>positions.get(node.id).y+triangleRadius*Math.sin(Math.PI/6)).attr("r",smallCircleRadius).attr("fill","white").attr("stroke",theme.componentStroke).attr("stroke-width",2),marketNodes.append("circle").attr("class","wardley-market-dot").attr("cx",node=>positions.get(node.id).x+triangleRadius*Math.cos(Math.PI/6)).attr("cy",node=>positions.get(node.id).y+triangleRadius*Math.sin(Math.PI/6)).attr("r",smallCircleRadius).attr("fill","white").attr("stroke",theme.componentStroke).attr("stroke-width",2),nodeEnter.filter(node=>!0===node.isPipelineParent).append("rect").attr("x",node=>positions.get(node.id).x-squareSize/2).attr("y",node=>positions.get(node.id).y-squareSize/2).attr("width",squareSize).attr("height",squareSize).attr("fill",theme.componentFill).attr("stroke",theme.componentStroke).attr("stroke-width",1),nodeEnter.filter(node=>!0===node.inertia).append("line").attr("class","wardley-inertia").attr("x1",node=>{const pos=positions.get(node.id);let offset=node.isPipelineParent?squareSize/2+15:configValues.nodeRadius+15;return node.sourceStrategy&&(offset+=configValues.nodeRadius+10),pos.x+offset}).attr("y1",node=>{const pos=positions.get(node.id),lineHeight=node.isPipelineParent?squareSize:2*configValues.nodeRadius;return pos.y-lineHeight/2}).attr("x2",node=>{const pos=positions.get(node.id);let offset=node.isPipelineParent?squareSize/2+15:configValues.nodeRadius+15;return node.sourceStrategy&&(offset+=configValues.nodeRadius+10),pos.x+offset}).attr("y2",node=>{const pos=positions.get(node.id),lineHeight=node.isPipelineParent?squareSize:2*configValues.nodeRadius;return pos.y+lineHeight/2}).attr("stroke",theme.componentStroke).attr("stroke-width",6),nodeEnter.append("text").attr("x",node=>{const pos=positions.get(node.id);if("anchor"===node.className)return void 0!==node.labelOffsetX?pos.x+node.labelOffsetX:pos.x;let defaultOffset=configValues.nodeLabelOffset;node.sourceStrategy&&void 0===node.labelOffsetX&&(defaultOffset+=10);const customOffset=node.labelOffsetX??defaultOffset;return pos.x+customOffset}).attr("y",node=>{const pos=positions.get(node.id);if("anchor"===node.className)return void 0!==node.labelOffsetY?pos.y+node.labelOffsetY:pos.y-3;let defaultOffset=-configValues.nodeLabelOffset;node.sourceStrategy&&void 0===node.labelOffsetY&&(defaultOffset-=10);const customOffset=node.labelOffsetY??defaultOffset;return pos.y+customOffset}).attr("class","wardley-node-label").attr("fill",node=>"evolved"===node.className?theme.evolutionStroke:"anchor"===node.className?"#000":theme.componentLabelColor).attr("font-size",configValues.labelFontSize).attr("font-weight",node=>"anchor"===node.className?"bold":"normal").attr("text-anchor",node=>"anchor"===node.className?"middle":"start").attr("dominant-baseline",node=>"anchor"===node.className?"middle":"auto").text(node=>node.label),data.annotations.length>0){const annotationsGroup=root.append("g").attr("class","wardley-annotations");if(data.annotations.forEach(annotation=>{const projectedCoords=annotation.coordinates.map(coord=>({x:projectX(coord.x),y:projectY(coord.y)}));if(projectedCoords.length>1)for(let i=0;i<projectedCoords.length-1;i++)annotationsGroup.append("line").attr("class","wardley-annotation-line").attr("x1",projectedCoords[i].x).attr("y1",projectedCoords[i].y).attr("x2",projectedCoords[i+1].x).attr("y2",projectedCoords[i+1].y).attr("stroke",theme.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");projectedCoords.forEach(coord=>{const annotationNode=annotationsGroup.append("g").attr("class","wardley-annotation");annotationNode.append("circle").attr("cx",coord.x).attr("cy",coord.y).attr("r",10).attr("fill","white").attr("stroke",theme.axisColor).attr("stroke-width",1.5),annotationNode.append("text").attr("x",coord.x).attr("y",coord.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",theme.axisTextColor).attr("font-weight","bold").text(annotation.number)})}),data.annotationsBox){let boxX=projectX(data.annotationsBox.x),boxY=projectY(data.annotationsBox.y);const padding=10,lineHeight=16,fontSize=11,textBoxGroup=annotationsGroup.append("g").attr("class","wardley-annotations-box"),sortedAnnotations=[...data.annotations].filter(a=>a.text).sort((a,b)=>a.number-b.number),textElements=[];if(sortedAnnotations.forEach((annotation,idx)=>{const text2=textBoxGroup.append("text").attr("x",boxX+padding).attr("y",boxY+padding+(idx+1)*lineHeight).attr("font-size",fontSize).attr("fill",theme.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${annotation.number}. ${annotation.text}`);textElements.push(text2)}),textElements.length>0){let maxWidth=0,maxHeight=0;textElements.forEach(text2=>{const textNode=text2.node(),textWidth=textNode.getComputedTextLength();maxWidth=Math.max(maxWidth,textWidth);const bbox=textNode.getBBox();maxHeight=Math.max(maxHeight,bbox.height)});const boxWidth=maxWidth+2*padding+105,boxHeight=sortedAnnotations.length*lineHeight+2*padding+maxHeight/2,minX=configValues.padding,maxX=width-configValues.padding-boxWidth,minY=configValues.padding,maxY=height-configValues.padding-boxHeight;boxX=Math.max(minX,Math.min(boxX,maxX)),boxY=Math.max(minY,Math.min(boxY,maxY)),textElements.forEach((text2,idx)=>{text2.attr("x",boxX+padding).attr("y",boxY+padding+(idx+1)*lineHeight)}),textBoxGroup.insert("rect","text").attr("x",boxX).attr("y",boxY).attr("width",boxWidth).attr("height",boxHeight).attr("fill","white").attr("stroke",theme.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(data.notes.length>0){const notesGroup=root.append("g").attr("class","wardley-notes");data.notes.forEach(note=>{const noteX=projectX(note.x),noteY=projectY(note.y);notesGroup.append("text").attr("x",noteX).attr("y",noteY).attr("text-anchor","start").attr("font-size",11).attr("fill",theme.axisTextColor).attr("font-weight","bold").text(note.text)})}if(data.accelerators.length>0){const acceleratorsGroup=root.append("g").attr("class","wardley-accelerators");data.accelerators.forEach(accelerator=>{const accX=projectX(accelerator.x),accY=projectY(accelerator.y),arrowPath=`\n M ${accX} ${accY-15}\n L ${accX+60-20} ${accY-15}\n L ${accX+60-20} ${accY-15-8}\n L ${accX+60} ${accY}\n L ${accX+60-20} ${accY+15+8}\n L ${accX+60-20} ${accY+15}\n L ${accX} ${accY+15}\n Z\n `;acceleratorsGroup.append("path").attr("d",arrowPath).attr("fill","white").attr("stroke",theme.componentStroke).attr("stroke-width",1),acceleratorsGroup.append("text").attr("x",accX+30).attr("y",accY+15+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",theme.axisTextColor).attr("font-weight","bold").text(accelerator.name)})}if(data.deaccelerators.length>0){const deacceleratorsGroup=root.append("g").attr("class","wardley-deaccelerators");data.deaccelerators.forEach(deaccelerator=>{const decX=projectX(deaccelerator.x),decY=projectY(deaccelerator.y),arrowPath=`\n M ${decX+60} ${decY-15}\n L ${decX+20} ${decY-15}\n L ${decX+20} ${decY-15-8}\n L ${decX} ${decY}\n L ${decX+20} ${decY+15+8}\n L ${decX+20} ${decY+15}\n L ${decX+60} ${decY+15}\n Z\n `;deacceleratorsGroup.append("path").attr("d",arrowPath).attr("fill","white").attr("stroke",theme.componentStroke).attr("stroke-width",1),deacceleratorsGroup.append("text").attr("x",decX+30).attr("y",decY+15+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",theme.axisTextColor).attr("font-weight","bold").text(deaccelerator.name)})}},"draw")},styles:__name(({wardley:wardley}={})=>{const defaultThemeVariables=getThemeVariables3(),currentConfig=getConfig(),themeVariables=cleanAndMerge(defaultThemeVariables,currentConfig.themeVariables),w=cleanAndMerge(themeVariables.wardley,wardley);return`\n .wardley-background {\n fill: ${w.backgroundColor};\n }\n .wardley-axes line, .wardley-axes path {\n stroke: ${w.axisColor};\n }\n .wardley-axis-label {\n fill: ${w.axisTextColor};\n }\n .wardley-stage-label {\n fill: ${w.axisTextColor};\n }\n .wardley-grid line {\n stroke: ${w.gridColor};\n }\n .wardley-node circle {\n fill: ${w.componentFill};\n stroke: ${w.componentStroke};\n }\n .wardley-node-label {\n fill: ${w.componentLabelColor};\n }\n .wardley-link {\n stroke: ${w.linkStroke};\n }\n .wardley-link--dashed {\n stroke-dasharray: 4 4;\n }\n .wardley-link-label {\n fill: ${w.axisTextColor};\n }\n .wardley-trend line {\n stroke: ${w.evolutionStroke};\n }\n .wardley-annotation-line {\n stroke: ${w.annotationStroke};\n }\n .wardley-annotation circle {\n fill: ${w.annotationFill};\n stroke: ${w.annotationStroke};\n }\n .wardley-annotation text {\n fill: ${w.annotationTextColor};\n }\n .wardley-annotations-box rect {\n fill: ${w.annotationFill};\n stroke: ${w.annotationStroke};\n }\n .wardley-annotations-box text {\n fill: ${w.annotationTextColor};\n }\n .wardley-pipeline-box {\n stroke: ${w.componentStroke};\n }\n .wardley-notes text {\n fill: ${w.axisTextColor};\n }\n `},"styles")};export{diagram};
@@ -1 +0,0 @@
1
- var _a,_b,_c,_d,_e,_f,_g,_h,_i,_j;import{s as setAccDescription,g as getAccDescription,o as getDiagramTitle,n as setDiagramTitle,a as getAccTitle,b as setAccTitle,_ as __name,l as log,D as selectSvgElement,e as configureSvgSize,p as clear,y as getConfig,i as sanitizeText,A as cleanAndMerge,B as defaultConfig_default,E as getThemeVariables3,ay as computeDimensionOfText,O as line}from"./mermaid.core-DH-sQJgr.js";import{i as initRange}from"./init-DMZMl1PR.js";import{o as ordinal}from"./ordinal-DA-_8pMy.js";import{l as linear}from"./linear-BJRZNsdX.js";import"./vendor-mdxeditor-DT0rad22.js";import"./vendor-antd-DNUTLr77.js";import"./vendor-codemirror-6ck0hLRU.js";import"./vendor-markdown-DBlfs4dR.js";import"./defaultLocale-DZ7E7S9R.js";function band(){var step,bandwidth,scale=ordinal().unknown(void 0),domain=scale.domain,ordinalRange=scale.range,r0=0,r1=1,round=!1,paddingInner=0,paddingOuter=0,align=.5;function rescale(){var n=domain().length,reverse=r1<r0,start=reverse?r1:r0,stop=reverse?r0:r1;step=(stop-start)/Math.max(1,n-paddingInner+2*paddingOuter),round&&(step=Math.floor(step)),start+=(stop-start-step*(n-paddingInner))*align,bandwidth=step*(1-paddingInner),round&&(start=Math.round(start),bandwidth=Math.round(bandwidth));var values=function(start,stop,step){start=+start,stop=+stop,step=(n=arguments.length)<2?(stop=start,start=0,1):n<3?1:+step;for(var i=-1,n=0|Math.max(0,Math.ceil((stop-start)/step)),range2=new Array(n);++i<n;)range2[i]=start+i*step;return range2}(n).map(function(i){return start+step*i});return ordinalRange(reverse?values.reverse():values)}return delete scale.unknown,scale.domain=function(_){return arguments.length?(domain(_),rescale()):domain()},scale.range=function(_){return arguments.length?([r0,r1]=_,r0=+r0,r1=+r1,rescale()):[r0,r1]},scale.rangeRound=function(_){return[r0,r1]=_,r0=+r0,r1=+r1,round=!0,rescale()},scale.bandwidth=function(){return bandwidth},scale.step=function(){return step},scale.round=function(_){return arguments.length?(round=!!_,rescale()):round},scale.padding=function(_){return arguments.length?(paddingInner=Math.min(1,paddingOuter=+_),rescale()):paddingInner},scale.paddingInner=function(_){return arguments.length?(paddingInner=Math.min(1,_),rescale()):paddingInner},scale.paddingOuter=function(_){return arguments.length?(paddingOuter=+_,rescale()):paddingOuter},scale.align=function(_){return arguments.length?(align=Math.max(0,Math.min(1,_)),rescale()):align},scale.copy=function(){return band(domain(),[r0,r1]).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align)},initRange.apply(rescale(),arguments)}var parser=function(){var o=__name(function(k,v,o2,l){for(o2=o2||{},l=k.length;l--;o2[k[l]]=v);return o2},"o"),$V0=[1,10,12,14,16,18,19,21,23],$V1=[2,6],$V2=[1,3],$V3=[1,5],$V4=[1,6],$V5=[1,7],$V6=[1,5,10,12,14,16,18,19,21,23,36,37,38],$V7=[1,25],$V8=[1,26],$V9=[1,28],$Va=[1,29],$Vb=[1,30],$Vc=[1,31],$Vd=[1,32],$Ve=[1,33],$Vf=[1,34],$Vg=[1,35],$Vh=[1,36],$Vi=[1,37],$Vj=[1,43],$Vk=[1,42],$Vl=[1,47],$Vm=[1,50],$Vn=[1,10,12,14,16,18,19,21,23,36,37,38],$Vo=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],$Vp=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],$Vq=[1,65],$Vr=[26,28],parser2={trace:__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:__name(function(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 5:yy.setOrientation($$[$0]);break;case 9:yy.setDiagramTitle($$[$0].text.trim());break;case 12:yy.setLineData({text:"",type:"text"},$$[$0]);break;case 13:yy.setLineData($$[$0-1],$$[$0]);break;case 14:yy.setBarData({text:"",type:"text"},$$[$0]);break;case 15:yy.setBarData($$[$0-1],$$[$0]);break;case 16:this.$=$$[$0].trim(),yy.setAccTitle(this.$);break;case 17:case 18:this.$=$$[$0].trim(),yy.setAccDescription(this.$);break;case 19:case 29:this.$=$$[$0-1];break;case 20:case 30:this.$=[$$[$0-2],...$$[$0]];break;case 21:case 31:this.$=[$$[$0]];break;case 22:this.$={value:Number($$[$0-1]),label:$$[$0]};break;case 23:this.$={value:Number($$[$0]),label:""};break;case 24:yy.setXAxisTitle($$[$0]);break;case 25:yy.setXAxisTitle($$[$0-1]);break;case 26:yy.setXAxisTitle({type:"text",text:""});break;case 27:yy.setXAxisBand($$[$0]);break;case 28:yy.setXAxisRangeData(Number($$[$0-2]),Number($$[$0]));break;case 32:yy.setYAxisTitle($$[$0]);break;case 33:yy.setYAxisTitle($$[$0-1]);break;case 34:yy.setYAxisTitle({type:"text",text:""});break;case 35:yy.setYAxisRangeData(Number($$[$0-2]),Number($$[$0]));break;case 39:case 40:this.$={text:$$[$0],type:"text"};break;case 41:this.$={text:$$[$0],type:"markdown"};break;case 42:this.$=$$[$0];break;case 43:this.$=$$[$0-1]+""+$$[$0]}},"anonymous"),table:[o($V0,$V1,{3:1,4:2,7:4,5:$V2,36:$V3,37:$V4,38:$V5}),{1:[3]},o($V0,$V1,{4:2,7:4,3:8,5:$V2,36:$V3,37:$V4,38:$V5}),o($V0,$V1,{4:2,7:4,6:9,3:10,5:$V2,8:[1,11],36:$V3,37:$V4,38:$V5}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},o($V6,[2,36]),o($V6,[2,37]),o($V6,[2,38]),{1:[2,1]},o($V0,$V1,{4:2,7:4,3:21,5:$V2,36:$V3,37:$V4,38:$V5}),{1:[2,3]},o($V6,[2,5]),o($V0,[2,7],{4:22,36:$V3,37:$V4,38:$V5}),{11:23,30:$V7,39:24,40:$V8,41:27,42:$V9,43:$Va,44:$Vb,45:$Vc,46:$Vd,47:$Ve,48:$Vf,49:$Vg,50:$Vh,51:$Vi},{11:39,13:38,24:$Vj,29:$Vk,30:$V7,31:40,32:41,39:24,40:$V8,41:27,42:$V9,43:$Va,44:$Vb,45:$Vc,46:$Vd,47:$Ve,48:$Vf,49:$Vg,50:$Vh,51:$Vi},{11:45,15:44,29:$Vl,30:$V7,35:46,39:24,40:$V8,41:27,42:$V9,43:$Va,44:$Vb,45:$Vc,46:$Vd,47:$Ve,48:$Vf,49:$Vg,50:$Vh,51:$Vi},{11:49,17:48,24:$Vm,30:$V7,39:24,40:$V8,41:27,42:$V9,43:$Va,44:$Vb,45:$Vc,46:$Vd,47:$Ve,48:$Vf,49:$Vg,50:$Vh,51:$Vi},{11:52,17:51,24:$Vm,30:$V7,39:24,40:$V8,41:27,42:$V9,43:$Va,44:$Vb,45:$Vc,46:$Vd,47:$Ve,48:$Vf,49:$Vg,50:$Vh,51:$Vi},{20:[1,53]},{22:[1,54]},o($Vn,[2,18]),{1:[2,2]},o($Vn,[2,8]),o($Vn,[2,9]),o($Vo,[2,39],{41:55,42:$V9,43:$Va,44:$Vb,45:$Vc,46:$Vd,47:$Ve,48:$Vf,49:$Vg,50:$Vh,51:$Vi}),o($Vo,[2,40]),o($Vo,[2,41]),o($Vp,[2,42]),o($Vp,[2,44]),o($Vp,[2,45]),o($Vp,[2,46]),o($Vp,[2,47]),o($Vp,[2,48]),o($Vp,[2,49]),o($Vp,[2,50]),o($Vp,[2,51]),o($Vp,[2,52]),o($Vp,[2,53]),o($Vn,[2,10]),o($Vn,[2,24],{32:41,31:56,24:$Vj,29:$Vk}),o($Vn,[2,26]),o($Vn,[2,27]),{33:[1,57]},{11:59,30:$V7,34:58,39:24,40:$V8,41:27,42:$V9,43:$Va,44:$Vb,45:$Vc,46:$Vd,47:$Ve,48:$Vf,49:$Vg,50:$Vh,51:$Vi},o($Vn,[2,11]),o($Vn,[2,32],{35:60,29:$Vl}),o($Vn,[2,34]),{33:[1,61]},o($Vn,[2,12]),{17:62,24:$Vm},{25:63,27:64,29:$Vq},o($Vn,[2,14]),{17:66,24:$Vm},o($Vn,[2,16]),o($Vn,[2,17]),o($Vp,[2,43]),o($Vn,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},o($Vn,[2,33]),{29:[1,70]},o($Vn,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},o($Vr,[2,23],{30:[1,73]}),o($Vn,[2,15]),o($Vn,[2,28]),o($Vn,[2,29]),{11:59,30:$V7,34:74,39:24,40:$V8,41:27,42:$V9,43:$Va,44:$Vb,45:$Vc,46:$Vd,47:$Ve,48:$Vf,49:$Vg,50:$Vh,51:$Vi},o($Vn,[2,35]),o($Vn,[2,19]),{25:75,27:64,29:$Vq},o($Vr,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:__name(function(str,hash){if(!hash.recoverable){var error=new Error(str);throw error.hash=hash,error}this.trace(str)},"parseError"),parse:__name(function(input){var self=this,stack=[0],tstack=[],vstack=[null],lstack=[],table=this.table,yytext="",yylineno=0,yyleng=0,args=lstack.slice.call(arguments,1),lexer2=Object.create(this.lexer),sharedState={yy:{}};for(var k in this.yy)Object.prototype.hasOwnProperty.call(this.yy,k)&&(sharedState.yy[k]=this.yy[k]);lexer2.setInput(input,sharedState.yy),sharedState.yy.lexer=lexer2,sharedState.yy.parser=this,void 0===lexer2.yylloc&&(lexer2.yylloc={});var yyloc=lexer2.yylloc;lstack.push(yyloc);var ranges=lexer2.options&&lexer2.options.ranges;function lex(){var token;return"number"!=typeof(token=tstack.pop()||lexer2.lex()||1)&&(token instanceof Array&&(token=(tstack=token).pop()),token=self.symbols_[token]||token),token}"function"==typeof sharedState.yy.parseError?this.parseError=sharedState.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,__name(function(n){stack.length=stack.length-2*n,vstack.length=vstack.length-n,lstack.length=lstack.length-n},"popStack"),__name(lex,"lex");for(var symbol,state,action,r,p,len,newState,expected,yyval={};;){if(state=stack[stack.length-1],this.defaultActions[state]?action=this.defaultActions[state]:(null==symbol&&(symbol=lex()),action=table[state]&&table[state][symbol]),void 0===action||!action.length||!action[0]){var errStr="";for(p in expected=[],table[state])this.terminals_[p]&&p>2&&expected.push("'"+this.terminals_[p]+"'");errStr=lexer2.showPosition?"Parse error on line "+(yylineno+1)+":\n"+lexer2.showPosition()+"\nExpecting "+expected.join(", ")+", got '"+(this.terminals_[symbol]||symbol)+"'":"Parse error on line "+(yylineno+1)+": Unexpected "+(1==symbol?"end of input":"'"+(this.terminals_[symbol]||symbol)+"'"),this.parseError(errStr,{text:lexer2.match,token:this.terminals_[symbol]||symbol,line:lexer2.yylineno,loc:yyloc,expected:expected})}if(action[0]instanceof Array&&action.length>1)throw new Error("Parse Error: multiple actions possible at state: "+state+", token: "+symbol);switch(action[0]){case 1:stack.push(symbol),vstack.push(lexer2.yytext),lstack.push(lexer2.yylloc),stack.push(action[1]),symbol=null,yyleng=lexer2.yyleng,yytext=lexer2.yytext,yylineno=lexer2.yylineno,yyloc=lexer2.yylloc;break;case 2:if(len=this.productions_[action[1]][1],yyval.$=vstack[vstack.length-len],yyval._$={first_line:lstack[lstack.length-(len||1)].first_line,last_line:lstack[lstack.length-1].last_line,first_column:lstack[lstack.length-(len||1)].first_column,last_column:lstack[lstack.length-1].last_column},ranges&&(yyval._$.range=[lstack[lstack.length-(len||1)].range[0],lstack[lstack.length-1].range[1]]),void 0!==(r=this.performAction.apply(yyval,[yytext,yyleng,yylineno,sharedState.yy,action[1],vstack,lstack].concat(args))))return r;len&&(stack=stack.slice(0,-1*len*2),vstack=vstack.slice(0,-1*len),lstack=lstack.slice(0,-1*len)),stack.push(this.productions_[action[1]][0]),vstack.push(yyval.$),lstack.push(yyval._$),newState=table[stack[stack.length-2]][stack[stack.length-1]],stack.push(newState);break;case 3:return!0}}return!0},"parse")},lexer=function(){return{EOF:1,parseError:__name(function(str,hash){if(!this.yy.parser)throw new Error(str);this.yy.parser.parseError(str,hash)},"parseError"),setInput:__name(function(input,yy){return this.yy=yy||this.yy||{},this._input=input,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:__name(function(){var ch=this._input[0];return this.yytext+=ch,this.yyleng++,this.offset++,this.match+=ch,this.matched+=ch,ch.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),ch},"input"),unput:__name(function(ch){var len=ch.length,lines=ch.split(/(?:\r\n?|\n)/g);this._input=ch+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-len),this.offset-=len;var oldLines=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),lines.length-1&&(this.yylineno-=lines.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:lines?(lines.length===oldLines.length?this.yylloc.first_column:0)+oldLines[oldLines.length-lines.length].length-lines[0].length:this.yylloc.first_column-len},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-len]),this.yyleng=this.yytext.length,this},"unput"),more:__name(function(){return this._more=!0,this},"more"),reject:__name(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:__name(function(n){this.unput(this.match.slice(n))},"less"),pastInput:__name(function(){var past=this.matched.substr(0,this.matched.length-this.match.length);return(past.length>20?"...":"")+past.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:__name(function(){var next=this.match;return next.length<20&&(next+=this._input.substr(0,20-next.length)),(next.substr(0,20)+(next.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:__name(function(){var pre=this.pastInput(),c=new Array(pre.length+1).join("-");return pre+this.upcomingInput()+"\n"+c+"^"},"showPosition"),test_match:__name(function(match,indexed_rule){var token,lines,backup;if(this.options.backtrack_lexer&&(backup={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&&(backup.yylloc.range=this.yylloc.range.slice(0))),(lines=match[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=lines.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:lines?lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+match[0].length},this.yytext+=match[0],this.match+=match[0],this.matches=match,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(match[0].length),this.matched+=match[0],token=this.performAction.call(this,this.yy,this,indexed_rule,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),token)return token;if(this._backtrack){for(var k in backup)this[k]=backup[k];return!1}return!1},"test_match"),next:__name(function(){if(this.done)return this.EOF;var token,match,tempMatch,index;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var rules=this._currentRules(),i=0;i<rules.length;i++)if((tempMatch=this._input.match(this.rules[rules[i]]))&&(!match||tempMatch[0].length>match[0].length)){if(match=tempMatch,index=i,this.options.backtrack_lexer){if(!1!==(token=this.test_match(tempMatch,rules[i])))return token;if(this._backtrack){match=!1;continue}return!1}if(!this.options.flex)break}return match?!1!==(token=this.test_match(match,rules[index]))&&token:""===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:__name(function(){var r=this.next();return r||this.lex()},"lex"),begin:__name(function(condition){this.conditionStack.push(condition)},"begin"),popState:__name(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:__name(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:__name(function(n){return(n=this.conditionStack.length-1-Math.abs(n||0))>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:__name(function(condition){this.begin(condition)},"pushState"),stateStackSize:__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:__name(function(yy,yy_,$avoiding_name_collisions,YY_START){switch($avoiding_name_collisions){case 0:case 1:case 5:case 44:break;case 2:case 3:return this.popState(),36;case 4:return 36;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:case 26:case 28:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 27:this.pushState("string");break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}}}();function Parser(){this.yy={}}return parser2.lexer=lexer,__name(Parser,"Parser"),Parser.prototype=parser2,parser2.Parser=Parser,new Parser}();parser.parser=parser;var xychart_default=parser;function isBarPlot(data){return"bar"===data.type}function isBandAxisData(data){return"band"===data.type}function isLinearAxisData(data){return"linear"===data.type}__name(isBarPlot,"isBarPlot"),__name(isBandAxisData,"isBandAxisData"),__name(isLinearAxisData,"isLinearAxisData");var TextDimensionCalculatorWithFont=(__name(_a=class{constructor(parentGroup){this.parentGroup=parentGroup}getMaxDimension(texts,fontSize){if(!this.parentGroup)return{width:texts.reduce((acc,cur)=>Math.max(cur.length,acc),0)*fontSize,height:fontSize};const dimension={width:0,height:0},elem=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",fontSize);for(const t of texts){const bbox=computeDimensionOfText(elem,1,t),width=bbox?bbox.width:t.length*fontSize,height=bbox?bbox.height:fontSize;dimension.width=Math.max(dimension.width,width),dimension.height=Math.max(dimension.height,height)}return elem.remove(),dimension}},"TextDimensionCalculatorWithFont"),_a),BaseAxis=(__name(_b=class{constructor(axisConfig,title,textDimensionCalculator,axisThemeConfig){this.axisConfig=axisConfig,this.title=title,this.textDimensionCalculator=textDimensionCalculator,this.axisThemeConfig=axisThemeConfig,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}setRange(range2){this.range=range2,"left"===this.axisPosition||"right"===this.axisPosition?this.boundingRect.height=range2[1]-range2[0]:this.boundingRect.width=range2[1]-range2[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(axisPosition){this.axisPosition=axisPosition,this.setRange(this.range)}getTickDistance(){const range2=this.getRange();return Math.abs(range2[0]-range2[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(tick=>tick.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(availableSpace){let availableHeight=availableSpace.height;if(this.axisConfig.showAxisLine&&availableHeight>this.axisConfig.axisLineWidth&&(availableHeight-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const spaceRequired=this.getLabelDimension(),maxPadding=.2*availableSpace.width;this.outerPadding=Math.min(spaceRequired.width/2,maxPadding);let heightRequired=spaceRequired.height;"bottom"===this.axisPosition&&0!==this.normalizedLabelRotationInRad&&(heightRequired=Math.max(heightRequired,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*spaceRequired.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*spaceRequired.height))),heightRequired+=2*this.axisConfig.labelPadding,this.labelTextHeight=spaceRequired.height,heightRequired<=availableHeight&&(availableHeight-=heightRequired,this.showLabel=!0)}if(this.axisConfig.showTick&&availableHeight>=this.axisConfig.tickLength&&(this.showTick=!0,availableHeight-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const spaceRequired=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),heightRequired=spaceRequired.height+2*this.axisConfig.titlePadding;this.titleTextHeight=spaceRequired.height,heightRequired<=availableHeight&&(availableHeight-=heightRequired,this.showTitle=!0)}this.boundingRect.width=availableSpace.width,this.boundingRect.height=availableSpace.height-availableHeight}calculateSpaceIfDrawnVertical(availableSpace){let availableWidth=availableSpace.width;if(this.axisConfig.showAxisLine&&availableWidth>this.axisConfig.axisLineWidth&&(availableWidth-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const spaceRequired=this.getLabelDimension(),maxPadding=.2*availableSpace.height;this.outerPadding=Math.min(spaceRequired.height/2,maxPadding);const widthRequired=spaceRequired.width+2*this.axisConfig.labelPadding;widthRequired<=availableWidth&&(availableWidth-=widthRequired,this.showLabel=!0)}if(this.axisConfig.showTick&&availableWidth>=this.axisConfig.tickLength&&(this.showTick=!0,availableWidth-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const spaceRequired=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),widthRequired=spaceRequired.height+2*this.axisConfig.titlePadding;this.titleTextHeight=spaceRequired.height,widthRequired<=availableWidth&&(availableWidth-=widthRequired,this.showTitle=!0)}this.boundingRect.width=availableSpace.width-availableWidth,this.boundingRect.height=availableSpace.height}calculateSpace(availableSpace){return"left"===this.axisPosition||"right"===this.axisPosition?this.calculateSpaceIfDrawnVertical(availableSpace):this.calculateSpaceIfDrawnHorizontally(availableSpace),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(point){this.boundingRect.x=point.x,this.boundingRect.y=point.y}calculateOffsetByRotation(reference){const rotation=this.normalizedLabelRotationInRad;return 0===rotation?0:Math.sin(rotation)*this.getLabelDimension()[reference]/2}getDrawableElementsForLeftAxis(){const drawableElement=[];if(this.showAxisLine){const x=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;drawableElement.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${x},${this.boundingRect.y} L ${x},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&drawableElement.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(tick=>({text:tick.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(tick),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const x=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);drawableElement.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(tick=>({path:`M ${x},${this.getScaleValue(tick)} L ${x-this.axisConfig.tickLength},${this.getScaleValue(tick)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&drawableElement.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),drawableElement}getDrawableElementsForBottomAxis(){const drawableElement=[];if(this.showAxisLine){const y=this.boundingRect.y+this.axisConfig.axisLineWidth/2;drawableElement.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${y} L ${this.boundingRect.x+this.boundingRect.width},${y}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&drawableElement.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(tick=>({text:tick.toString(),x:this.getScaleValue(tick)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:180*this.normalizedLabelRotationInRad/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const y=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);drawableElement.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(tick=>({path:`M ${this.getScaleValue(tick)},${y} L ${this.getScaleValue(tick)},${y+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&drawableElement.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),drawableElement}getDrawableElementsForTopAxis(){const drawableElement=[];if(this.showAxisLine){const y=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;drawableElement.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${y} L ${this.boundingRect.x+this.boundingRect.width},${y}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&drawableElement.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(tick=>({text:tick.toString(),x:this.getScaleValue(tick),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const y=this.boundingRect.y;drawableElement.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(tick=>({path:`M ${this.getScaleValue(tick)},${y+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(tick)},${y+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&drawableElement.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),drawableElement}getDrawableElements(){if("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},"BaseAxis"),_b),BandAxis=(__name(_c=class extends BaseAxis{constructor(axisConfig,axisThemeConfig,categories,title,textDimensionCalculator){super(axisConfig,title,textDimensionCalculator,axisThemeConfig),this.categories=categories,this.scale=band().domain(this.categories).range(this.getRange())}setRange(range2){super.setRange(range2)}recalculateScale(){this.scale=band().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),log.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(value){return this.scale(value)??this.getRange()[0]}},"BandAxis"),_c),LinearAxis=(__name(_d=class extends BaseAxis{constructor(axisConfig,axisThemeConfig,domain,title,textDimensionCalculator){super(axisConfig,title,textDimensionCalculator,axisThemeConfig),this.domain=domain,this.scale=linear().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const domain=[...this.domain];"left"===this.axisPosition&&domain.reverse(),this.scale=linear().domain(domain).range(this.getRange())}getScaleValue(value){return this.scale(value)}},"LinearAxis"),_d);function getAxis(data,axisConfig,axisThemeConfig,tmpSVGGroup2){const textDimensionCalculator=new TextDimensionCalculatorWithFont(tmpSVGGroup2);return isBandAxisData(data)?new BandAxis(axisConfig,axisThemeConfig,data.categories,data.title,textDimensionCalculator):new LinearAxis(axisConfig,axisThemeConfig,[data.min,data.max],data.title,textDimensionCalculator)}__name(getAxis,"getAxis");var ChartTitle=(__name(_e=class{constructor(textDimensionCalculator,chartConfig,chartData,chartThemeConfig){this.textDimensionCalculator=textDimensionCalculator,this.chartConfig=chartConfig,this.chartData=chartData,this.chartThemeConfig=chartThemeConfig,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(point){this.boundingRect.x=point.x,this.boundingRect.y=point.y}calculateSpace(availableSpace){const titleDimension=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),widthRequired=Math.max(titleDimension.width,availableSpace.width),heightRequired=titleDimension.height+2*this.chartConfig.titlePadding;return titleDimension.width<=widthRequired&&titleDimension.height<=heightRequired&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=widthRequired,this.boundingRect.height=heightRequired,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const drawableElem=[];return this.showChartTitle&&drawableElem.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),drawableElem}},"ChartTitle"),_e);function getChartTitleComponent(chartConfig,chartData,chartThemeConfig,tmpSVGGroup2){const textDimensionCalculator=new TextDimensionCalculatorWithFont(tmpSVGGroup2);return new ChartTitle(textDimensionCalculator,chartConfig,chartData,chartThemeConfig)}__name(getChartTitleComponent,"getChartTitleComponent");var LinePlot=(__name(_f=class{constructor(plotData,xAxis,yAxis,orientation,plotIndex2){this.plotData=plotData,this.xAxis=xAxis,this.yAxis=yAxis,this.orientation=orientation,this.plotIndex=plotIndex2}getDrawableElement(){const finalData=this.plotData.data.map(d=>[this.xAxis.getScaleValue(d[0]),this.yAxis.getScaleValue(d[1])]);let path;if(path="horizontal"===this.orientation?line().y(d=>d[0]).x(d=>d[1])(finalData):line().x(d=>d[0]).y(d=>d[1])(finalData),!path)return[];const elements=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:path,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const labelOffset=10,fontSize=12,textData=[];for(const[i,[px,py]]of finalData.entries()){const label=this.plotData.pointLabels[i];label&&("horizontal"===this.orientation?textData.push({x:py+labelOffset,y:px,text:label,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:fontSize,rotation:0}):textData.push({x:px,y:py-labelOffset,text:label,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:fontSize,rotation:0}))}textData.length>0&&elements.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:textData})}return elements}},"LinePlot"),_f),BarPlot=(__name(_g=class{constructor(barData,boundingRect,xAxis,yAxis,orientation,plotIndex2){this.barData=barData,this.boundingRect=boundingRect,this.xAxis=xAxis,this.yAxis=yAxis,this.orientation=orientation,this.plotIndex=plotIndex2}getDrawableElement(){const finalData=this.barData.data.map(d=>[this.xAxis.getScaleValue(d[0]),this.yAxis.getScaleValue(d[1])]),barWidth=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),barWidthHalf=barWidth/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:finalData.map(data=>({x:this.boundingRect.x,y:data[0]-barWidthHalf,height:barWidth,width:data[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:finalData.map(data=>({x:data[0]-barWidthHalf,y:data[1],width:barWidth,height:this.boundingRect.y+this.boundingRect.height-data[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},"BarPlot"),_g),BasePlot=(__name(_h=class{constructor(chartConfig,chartData,chartThemeConfig){this.chartConfig=chartConfig,this.chartData=chartData,this.chartThemeConfig=chartThemeConfig,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(xAxis,yAxis){this.xAxis=xAxis,this.yAxis=yAxis}setBoundingBoxXY(point){this.boundingRect.x=point.x,this.boundingRect.y=point.y}calculateSpace(availableSpace){return this.boundingRect.width=availableSpace.width,this.boundingRect.height=availableSpace.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!this.xAxis||!this.yAxis)throw Error("Axes must be passed to render Plots");const drawableElem=[];for(const[i,plot]of this.chartData.plots.entries())switch(plot.type){case"line":{const linePlot=new LinePlot(plot,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);drawableElem.push(...linePlot.getDrawableElement())}break;case"bar":{const barPlot=new BarPlot(plot,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);drawableElem.push(...barPlot.getDrawableElement())}}return drawableElem}},"BasePlot"),_h);function getPlotComponent(chartConfig,chartData,chartThemeConfig){return new BasePlot(chartConfig,chartData,chartThemeConfig)}__name(getPlotComponent,"getPlotComponent");var tmpSVGGroup,Orchestrator=(__name(_i=class{constructor(chartConfig,chartData,chartThemeConfig,tmpSVGGroup2){this.chartConfig=chartConfig,this.chartData=chartData,this.componentStore={title:getChartTitleComponent(chartConfig,chartData,chartThemeConfig,tmpSVGGroup2),plot:getPlotComponent(chartConfig,chartData,chartThemeConfig),xAxis:getAxis(chartData.xAxis,chartConfig.xAxis,{titleColor:chartThemeConfig.xAxisTitleColor,labelColor:chartThemeConfig.xAxisLabelColor,tickColor:chartThemeConfig.xAxisTickColor,axisLineColor:chartThemeConfig.xAxisLineColor},tmpSVGGroup2),yAxis:getAxis(chartData.yAxis,chartConfig.yAxis,{titleColor:chartThemeConfig.yAxisTitleColor,labelColor:chartThemeConfig.yAxisLabelColor,tickColor:chartThemeConfig.yAxisTickColor,axisLineColor:chartThemeConfig.yAxisLineColor},tmpSVGGroup2)}}calculateVerticalSpace(){let availableWidth=this.chartConfig.width,availableHeight=this.chartConfig.height,plotX=0,plotY=0,chartWidth=Math.floor(availableWidth*this.chartConfig.plotReservedSpacePercent/100),chartHeight=Math.floor(availableHeight*this.chartConfig.plotReservedSpacePercent/100),spaceUsed=this.componentStore.plot.calculateSpace({width:chartWidth,height:chartHeight});availableWidth-=spaceUsed.width,availableHeight-=spaceUsed.height,spaceUsed=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:availableHeight}),plotY=spaceUsed.height,availableHeight-=spaceUsed.height,this.componentStore.xAxis.setAxisPosition("bottom"),spaceUsed=this.componentStore.xAxis.calculateSpace({width:availableWidth,height:availableHeight}),availableHeight-=spaceUsed.height,this.componentStore.yAxis.setAxisPosition("left"),spaceUsed=this.componentStore.yAxis.calculateSpace({width:availableWidth,height:availableHeight}),plotX=spaceUsed.width,availableWidth-=spaceUsed.width,availableWidth>0&&(chartWidth+=availableWidth,availableWidth=0),availableHeight>0&&(chartHeight+=availableHeight,availableHeight=0),this.componentStore.plot.calculateSpace({width:chartWidth,height:chartHeight}),this.componentStore.plot.setBoundingBoxXY({x:plotX,y:plotY}),this.componentStore.xAxis.setRange([plotX,plotX+chartWidth]),this.componentStore.xAxis.setBoundingBoxXY({x:plotX,y:plotY+chartHeight}),this.componentStore.yAxis.setRange([plotY,plotY+chartHeight]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:plotY}),this.chartData.plots.some(p=>isBarPlot(p))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let availableWidth=this.chartConfig.width,availableHeight=this.chartConfig.height,titleYEnd=0,plotX=0,plotY=0,chartWidth=Math.floor(availableWidth*this.chartConfig.plotReservedSpacePercent/100),chartHeight=Math.floor(availableHeight*this.chartConfig.plotReservedSpacePercent/100),spaceUsed=this.componentStore.plot.calculateSpace({width:chartWidth,height:chartHeight});availableWidth-=spaceUsed.width,availableHeight-=spaceUsed.height,spaceUsed=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:availableHeight}),titleYEnd=spaceUsed.height,availableHeight-=spaceUsed.height,this.componentStore.xAxis.setAxisPosition("left"),spaceUsed=this.componentStore.xAxis.calculateSpace({width:availableWidth,height:availableHeight}),availableWidth-=spaceUsed.width,plotX=spaceUsed.width,this.componentStore.yAxis.setAxisPosition("top"),spaceUsed=this.componentStore.yAxis.calculateSpace({width:availableWidth,height:availableHeight}),availableHeight-=spaceUsed.height,plotY=titleYEnd+spaceUsed.height,availableWidth>0&&(chartWidth+=availableWidth,availableWidth=0),availableHeight>0&&(chartHeight+=availableHeight,availableHeight=0),this.componentStore.plot.calculateSpace({width:chartWidth,height:chartHeight}),this.componentStore.plot.setBoundingBoxXY({x:plotX,y:plotY}),this.componentStore.yAxis.setRange([plotX,plotX+chartWidth]),this.componentStore.yAxis.setBoundingBoxXY({x:plotX,y:titleYEnd}),this.componentStore.xAxis.setRange([plotY,plotY+chartHeight]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:plotY}),this.chartData.plots.some(p=>isBarPlot(p))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const drawableElem=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const component of Object.values(this.componentStore))drawableElem.push(...component.getDrawableElements());return drawableElem}},"Orchestrator"),_i),XYChartBuilder=(__name(_j=class{static build(config,chartData,chartThemeConfig,tmpSVGGroup2){return new Orchestrator(config,chartData,chartThemeConfig,tmpSVGGroup2).getDrawableElement()}},"XYChartBuilder"),_j),plotIndex=0,xyChartConfig=getChartDefaultConfig(),xyChartThemeConfig=getChartDefaultThemeConfig(),xyChartData=getChartDefaultData(),plotColorPalette=xyChartThemeConfig.plotColorPalette.split(",").map(color=>color.trim()),hasSetXAxis=!1,hasSetYAxis=!1;function getChartDefaultThemeConfig(){const defaultThemeVariables=getThemeVariables3(),config=getConfig();return cleanAndMerge(defaultThemeVariables.xyChart,config.themeVariables.xyChart)}function getChartDefaultConfig(){const config=getConfig();return cleanAndMerge(defaultConfig_default.xyChart,config.xyChart)}function getChartDefaultData(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function textSanitizer(text){const config=getConfig();return sanitizeText(text.trim(),config)}function setTmpSVGG(SVGG){tmpSVGGroup=SVGG}function setOrientation(orientation){xyChartConfig.chartOrientation="horizontal"===orientation?"horizontal":"vertical"}function setXAxisTitle(title){xyChartData.xAxis.title=textSanitizer(title.text)}function setXAxisRangeData(min,max){xyChartData.xAxis={type:"linear",title:xyChartData.xAxis.title,min:min,max:max},hasSetXAxis=!0}function setXAxisBand(categories){xyChartData.xAxis={type:"band",title:xyChartData.xAxis.title,categories:categories.map(c=>textSanitizer(c.text))},hasSetXAxis=!0}function setYAxisTitle(title){xyChartData.yAxis.title=textSanitizer(title.text)}function setYAxisRangeData(min,max){xyChartData.yAxis={type:"linear",title:xyChartData.yAxis.title,min:min,max:max},hasSetYAxis=!0}function setYAxisRangeFromPlotData(data){const minValue=Math.min(...data),maxValue=Math.max(...data),prevMinValue=isLinearAxisData(xyChartData.yAxis)?xyChartData.yAxis.min:1/0,prevMaxValue=isLinearAxisData(xyChartData.yAxis)?xyChartData.yAxis.max:-1/0;xyChartData.yAxis={type:"linear",title:xyChartData.yAxis.title,min:Math.min(prevMinValue,minValue),max:Math.max(prevMaxValue,maxValue)}}function transformDataWithoutCategory(data){let retData=[];if(0===data.length)return retData;if(!hasSetXAxis){const prevMinValue=isLinearAxisData(xyChartData.xAxis)?xyChartData.xAxis.min:1/0,prevMaxValue=isLinearAxisData(xyChartData.xAxis)?xyChartData.xAxis.max:-1/0;setXAxisRangeData(Math.min(prevMinValue,1),Math.max(prevMaxValue,data.length))}if(isBandAxisData(xyChartData.xAxis)&&data.length>xyChartData.xAxis.categories.length&&(data=data.slice(0,xyChartData.xAxis.categories.length)),hasSetYAxis||setYAxisRangeFromPlotData(data),isBandAxisData(xyChartData.xAxis)&&(retData=xyChartData.xAxis.categories.map((c,i)=>[c,data[i]])),isLinearAxisData(xyChartData.xAxis)){const min=xyChartData.xAxis.min,max=xyChartData.xAxis.max,step=(max-min)/(data.length-1),categories=[];for(let i=min;i<=max;i+=step)categories.push(`${i}`);retData=categories.map((c,i)=>[c,data[i]])}return retData}function getPlotColorFromPalette(plotIndex2){return plotColorPalette[0===plotIndex2?0:plotIndex2%plotColorPalette.length]}function setLineData(title,data){const values=data.map(d=>d.value),labels=data.map(d=>d.label?textSanitizer(d.label):""),plotData=transformDataWithoutCategory(values),hasAnyLabel=labels.some(l=>""!==l);xyChartData.plots.push({type:"line",strokeFill:getPlotColorFromPalette(plotIndex),strokeWidth:2,data:plotData,...hasAnyLabel?{pointLabels:labels}:{}}),plotIndex++}function setBarData(title,data){const plotData=transformDataWithoutCategory(data.map(d=>d.value));xyChartData.plots.push({type:"bar",fill:getPlotColorFromPalette(plotIndex),data:plotData}),plotIndex++}function getDrawableElem(){if(0===xyChartData.plots.length)throw Error("No Plot to render, please provide a plot with some data");return xyChartData.title=getDiagramTitle(),XYChartBuilder.build(xyChartConfig,xyChartData,xyChartThemeConfig,tmpSVGGroup)}function getChartThemeConfig(){return xyChartThemeConfig}function getChartConfig(){return xyChartConfig}function getXYChartData(){return xyChartData}__name(getChartDefaultThemeConfig,"getChartDefaultThemeConfig"),__name(getChartDefaultConfig,"getChartDefaultConfig"),__name(getChartDefaultData,"getChartDefaultData"),__name(textSanitizer,"textSanitizer"),__name(setTmpSVGG,"setTmpSVGG"),__name(setOrientation,"setOrientation"),__name(setXAxisTitle,"setXAxisTitle"),__name(setXAxisRangeData,"setXAxisRangeData"),__name(setXAxisBand,"setXAxisBand"),__name(setYAxisTitle,"setYAxisTitle"),__name(setYAxisRangeData,"setYAxisRangeData"),__name(setYAxisRangeFromPlotData,"setYAxisRangeFromPlotData"),__name(transformDataWithoutCategory,"transformDataWithoutCategory"),__name(getPlotColorFromPalette,"getPlotColorFromPalette"),__name(setLineData,"setLineData"),__name(setBarData,"setBarData"),__name(getDrawableElem,"getDrawableElem"),__name(getChartThemeConfig,"getChartThemeConfig"),__name(getChartConfig,"getChartConfig"),__name(getXYChartData,"getXYChartData");var diagram={parser:xychart_default,db:{getDrawableElem:getDrawableElem,clear:__name(function(){clear(),plotIndex=0,xyChartConfig=getChartDefaultConfig(),xyChartData={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},xyChartThemeConfig=getChartDefaultThemeConfig(),plotColorPalette=xyChartThemeConfig.plotColorPalette.split(",").map(color=>color.trim()),hasSetXAxis=!1,hasSetYAxis=!1},"clear"),setAccTitle:setAccTitle,getAccTitle:getAccTitle,setDiagramTitle:setDiagramTitle,getDiagramTitle:getDiagramTitle,getAccDescription:getAccDescription,setAccDescription:setAccDescription,setOrientation:setOrientation,setXAxisTitle:setXAxisTitle,setXAxisRangeData:setXAxisRangeData,setXAxisBand:setXAxisBand,setYAxisTitle:setYAxisTitle,setYAxisRangeData:setYAxisRangeData,setLineData:setLineData,setBarData:setBarData,setTmpSVGG:setTmpSVGG,getChartThemeConfig:getChartThemeConfig,getChartConfig:getChartConfig,getXYChartData:getXYChartData},renderer:{draw:__name((txt,id,_version,diagObj)=>{const db=diagObj.db,themeConfig=db.getChartThemeConfig(),chartConfig=db.getChartConfig(),labelData=db.getXYChartData().plots[0].data.map(data=>data[1]);function getDominantBaseLine(horizontalPos){return"top"===horizontalPos?"text-before-edge":"middle"}function getTextAnchor(verticalPos){return"left"===verticalPos?"start":"right"===verticalPos?"end":"middle"}function getTextTransformation(data){return`translate(${data.x}, ${data.y}) rotate(${data.rotation||0})`}__name(getDominantBaseLine,"getDominantBaseLine"),__name(getTextAnchor,"getTextAnchor"),__name(getTextTransformation,"getTextTransformation"),log.debug("Rendering xychart chart\n"+txt);const svg=selectSvgElement(id),group=svg.append("g").attr("class","main"),background=group.append("rect").attr("width",chartConfig.width).attr("height",chartConfig.height).attr("class","background");configureSvgSize(svg,chartConfig.height,chartConfig.width,!0),svg.attr("viewBox",`0 0 ${chartConfig.width} ${chartConfig.height}`),background.attr("fill",themeConfig.backgroundColor),db.setTmpSVGG(svg.append("g").attr("class","mermaid-tmp-group"));const shapes=db.getDrawableElem(),groups={};function getGroup(gList){let elem=group,prefix="";for(const[i]of gList.entries()){let parent=group;i>0&&groups[prefix]&&(parent=groups[prefix]),prefix+=gList[i],elem=groups[prefix],elem||(elem=groups[prefix]=parent.append("g").attr("class",gList[i]))}return elem}__name(getGroup,"getGroup");for(const shape of shapes){if(0===shape.data.length)continue;const shapeGroup=getGroup(shape.groupTexts);switch(shape.type){case"rect":if(shapeGroup.selectAll("rect").data(shape.data).enter().append("rect").attr("x",data=>data.x).attr("y",data=>data.y).attr("width",data=>data.width).attr("height",data=>data.height).attr("fill",data=>data.fill).attr("stroke",data=>data.strokeFill).attr("stroke-width",data=>data.strokeWidth),chartConfig.showDataLabel){const showDataLabelOutsideBar=chartConfig.showDataLabelOutsideBar;if("horizontal"===chartConfig.chartOrientation){let fitsHorizontally2=function(item,fontSize){const{data:data,label:label}=item;return fontSize*label.length*charWidthFactor<=data.width-rightMargin};__name(fitsHorizontally2,"fitsHorizontally");const charWidthFactor=.7,rightMargin=10,validItems=shape.data.map((d,i)=>({data:d,label:labelData[i].toString()})).filter(item=>item.data.width>0&&item.data.height>0),candidateFontSizes=validItems.map(item=>{const{data:data}=item;let fontSize=.7*data.height;for(;!fitsHorizontally2(item,fontSize)&&fontSize>0;)fontSize-=1;return fontSize}),uniformFontSize=Math.floor(Math.min(...candidateFontSizes)),determineLabelXPosition=__name(item=>showDataLabelOutsideBar?item.data.x+item.data.width+rightMargin:item.data.x+item.data.width-rightMargin,"determineLabelXPosition");shapeGroup.selectAll("text").data(validItems).enter().append("text").attr("x",determineLabelXPosition).attr("y",item=>item.data.y+item.data.height/2).attr("text-anchor",showDataLabelOutsideBar?"start":"end").attr("dominant-baseline","middle").attr("fill",themeConfig.dataLabelColor).attr("font-size",`${uniformFontSize}px`).text(item=>item.label)}else{let fitsInBar2=function(item,fontSize,yOffset2){const{data:data,label:label}=item,textWidth=fontSize*label.length*.7,centerX=data.x+data.width/2,rightEdge=centerX+textWidth/2,horizontalFits=centerX-textWidth/2>=data.x&&rightEdge<=data.x+data.width,verticalFits=data.y+yOffset2+fontSize<=data.y+data.height;return horizontalFits&&verticalFits};__name(fitsInBar2,"fitsInBar");const yOffset=10,validItems=shape.data.map((d,i)=>({data:d,label:labelData[i].toString()})).filter(item=>item.data.width>0&&item.data.height>0),candidateFontSizes=validItems.map(item=>{const{data:data,label:label}=item;let fontSize=data.width/(.7*label.length);for(;!fitsInBar2(item,fontSize,yOffset)&&fontSize>0;)fontSize-=1;return fontSize}),uniformFontSize=Math.floor(Math.min(...candidateFontSizes)),determineLabelYPosition=__name(item=>showDataLabelOutsideBar?item.data.y-yOffset:item.data.y+yOffset,"determineLabelYPosition");shapeGroup.selectAll("text").data(validItems).enter().append("text").attr("x",item=>item.data.x+item.data.width/2).attr("y",determineLabelYPosition).attr("text-anchor","middle").attr("dominant-baseline",showDataLabelOutsideBar?"auto":"hanging").attr("fill",themeConfig.dataLabelColor).attr("font-size",`${uniformFontSize}px`).text(item=>item.label)}}break;case"text":shapeGroup.selectAll("text").data(shape.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",data=>data.fill).attr("font-size",data=>data.fontSize).attr("dominant-baseline",data=>getDominantBaseLine(data.verticalPos)).attr("text-anchor",data=>getTextAnchor(data.horizontalPos)).attr("transform",data=>getTextTransformation(data)).text(data=>data.text);break;case"path":shapeGroup.selectAll("path").data(shape.data).enter().append("path").attr("d",data=>data.path).attr("fill",data=>data.fill?data.fill:"none").attr("stroke",data=>data.strokeFill).attr("stroke-width",data=>data.strokeWidth)}}},"draw")}};export{diagram};