cullmann.io/themes/blowfish/assets/lib/mermaid/mermaidAPI-51c0c26b.js.map

1 line
106 KiB
Plaintext

{"version":3,"file":"mermaidAPI-51c0c26b.js","sources":["../../../node_modules/.pnpm/stylis@4.1.2/node_modules/stylis/src/Enum.js","../../../node_modules/.pnpm/stylis@4.1.2/node_modules/stylis/src/Utility.js","../../../node_modules/.pnpm/stylis@4.1.2/node_modules/stylis/src/Tokenizer.js","../../../node_modules/.pnpm/stylis@4.1.2/node_modules/stylis/src/Parser.js","../../../node_modules/.pnpm/stylis@4.1.2/node_modules/stylis/src/Serializer.js","../src/diagrams/c4/c4Detector.ts","../src/diagrams/flowchart/flowDetector.ts","../src/diagrams/flowchart/flowDetector-v2.ts","../src/diagrams/er/erDetector.ts","../src/diagrams/git/gitGraphDetector.ts","../src/diagrams/gantt/ganttDetector.ts","../src/diagrams/info/infoDetector.ts","../src/diagrams/pie/pieDetector.ts","../src/diagrams/requirement/requirementDetector.ts","../src/diagrams/sequence/sequenceDetector.ts","../src/diagrams/class/classDetector.ts","../src/diagrams/class/classDetector-V2.ts","../src/diagrams/state/stateDetector.ts","../src/diagrams/state/stateDetector-V2.ts","../src/diagrams/user-journey/journeyDetector.ts","../src/diagrams/error/errorDetector.ts","../src/diagrams/flowchart/elk/detector.ts","../src/diagrams/timeline/detector.ts","../src/diagrams/mindmap/detector.ts","../src/diagram-api/diagram-orchestration.ts","../src/Diagram.ts","../src/interactionDb.ts","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isPrototype.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_overArg.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeys.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseKeys.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_DataView.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Promise.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Set.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_WeakMap.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getTag.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsArguments.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArguments.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArray.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isLength.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArrayLike.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubFalse.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isBuffer.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsTypedArray.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUnary.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nodeUtil.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isTypedArray.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isEmpty.js","../src/accessibility.ts","../src/mermaidAPI.ts"],"sourcesContent":["export var MS = '-ms-'\nexport var MOZ = '-moz-'\nexport var WEBKIT = '-webkit-'\n\nexport var COMMENT = 'comm'\nexport var RULESET = 'rule'\nexport var DECLARATION = 'decl'\n\nexport var PAGE = '@page'\nexport var MEDIA = '@media'\nexport var IMPORT = '@import'\nexport var CHARSET = '@charset'\nexport var VIEWPORT = '@viewport'\nexport var SUPPORTS = '@supports'\nexport var DOCUMENT = '@document'\nexport var NAMESPACE = '@namespace'\nexport var KEYFRAMES = '@keyframes'\nexport var FONT_FACE = '@font-face'\nexport var COUNTER_STYLE = '@counter-style'\nexport var FONT_FEATURE_VALUES = '@font-feature-values'\n","/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @return {number}\n */\nexport function indexof (value, search) {\n\treturn value.indexOf(search)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n","import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n","import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && charat(characters, length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f') != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset:\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tswitch (atrule) {\n\t\t\t\t\t\t\t\t\t// d m s\n\t\t\t\t\t\t\t\t\tcase 100: case 109: case 115:\n\t\t\t\t\t\t\t\t\t\tparse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tparse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @return {object}\n */\nexport function comment (value, root, parent) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @return {object}\n */\nexport function declaration (value, root, parent, length) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)\n}\n","import {IMPORT, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen, sizeof} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\tvar length = sizeof(children)\n\n\tfor (var i = 0; i < length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: element.value = element.props.join(',')\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n","import type { ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'c4';\n\nconst detector = (txt: string) => {\n return txt.match(/^\\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/) !== null;\n};\n\nconst loader = async () => {\n const { diagram } = await import('./c4Diagram');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'flowchart';\n\nconst detector: DiagramDetector = (txt, config) => {\n // If we have conferred to only use new flow charts this function should always return false\n // as in not signalling true for a legacy flowchart\n if (\n config?.flowchart?.defaultRenderer === 'dagre-wrapper' ||\n config?.flowchart?.defaultRenderer === 'elk'\n ) {\n return false;\n }\n return txt.match(/^\\s*graph/) !== null;\n};\n\nconst loader = async () => {\n const { diagram } = await import('./flowDiagram');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector } from '../../diagram-api/types';\nimport type { ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'flowchart-v2';\n\nconst detector: DiagramDetector = (txt, config) => {\n if (\n config?.flowchart?.defaultRenderer === 'dagre-d3' ||\n config?.flowchart?.defaultRenderer === 'elk'\n ) {\n return false;\n }\n\n // If we have configured to use dagre-wrapper then we should return true in this function for graph code thus making it use the new flowchart diagram\n if (txt.match(/^\\s*graph/) !== null && config?.flowchart?.defaultRenderer === 'dagre-wrapper') {\n return true;\n }\n return txt.match(/^\\s*flowchart/) !== null;\n};\n\nconst loader = async () => {\n const { diagram } = await import('./flowDiagram-v2');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'er';\n\nconst detector: DiagramDetector = (txt) => {\n return txt.match(/^\\s*erDiagram/) !== null;\n};\n\nconst loader = async () => {\n const { diagram } = await import('./erDiagram');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector } from '../../diagram-api/types';\nimport type { ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'gitGraph';\n\nconst detector: DiagramDetector = (txt) => {\n return txt.match(/^\\s*gitGraph/) !== null;\n};\n\nconst loader = async () => {\n const { diagram } = await import('./gitGraphDiagram');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'gantt';\n\nconst detector: DiagramDetector = (txt) => {\n return txt.match(/^\\s*gantt/) !== null;\n};\n\nconst loader = async () => {\n const { diagram } = await import('./ganttDiagram');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'info';\n\nconst detector: DiagramDetector = (txt) => {\n return txt.match(/^\\s*info/) !== null;\n};\n\nconst loader = async () => {\n const { diagram } = await import('./infoDiagram');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'pie';\n\nconst detector: DiagramDetector = (txt) => {\n return txt.match(/^\\s*pie/) !== null;\n};\n\nconst loader = async () => {\n const { diagram } = await import('./pieDiagram');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'requirement';\n\nconst detector: DiagramDetector = (txt) => {\n return txt.match(/^\\s*requirement(Diagram)?/) !== null;\n};\n\nconst loader = async () => {\n const { diagram } = await import('./requirementDiagram');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'sequence';\n\nconst detector: DiagramDetector = (txt) => {\n return txt.match(/^\\s*sequenceDiagram/) !== null;\n};\n\nconst loader = async () => {\n const { diagram } = await import('./sequenceDiagram');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'class';\n\nconst detector: DiagramDetector = (txt, config) => {\n // If we have configured to use dagre-wrapper then we should never return true in this function\n if (config?.class?.defaultRenderer === 'dagre-wrapper') {\n return false;\n }\n // We have not opted to use the new renderer so we should return true if we detect a class diagram\n return txt.match(/^\\s*classDiagram/) !== null;\n};\n\nconst loader = async () => {\n const { diagram } = await import('./classDiagram');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'classDiagram';\n\nconst detector: DiagramDetector = (txt, config) => {\n // If we have configured to use dagre-wrapper then we should return true in this function for classDiagram code thus making it use the new class diagram\n if (\n txt.match(/^\\s*classDiagram/) !== null &&\n config?.class?.defaultRenderer === 'dagre-wrapper'\n ) {\n return true;\n }\n // We have not opted to use the new renderer so we should return true if we detect a class diagram\n return txt.match(/^\\s*classDiagram-v2/) !== null;\n};\n\nconst loader = async () => {\n const { diagram } = await import('./classDiagram-v2');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'state';\n\nconst detector: DiagramDetector = (txt, config) => {\n // If we have confirmed to only use new state diagrams this function should always return false\n // as in not signalling true for a legacy state diagram\n if (config?.state?.defaultRenderer === 'dagre-wrapper') {\n return false;\n }\n return txt.match(/^\\s*stateDiagram/) !== null;\n};\n\nconst loader = async () => {\n const { diagram } = await import('./stateDiagram');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'stateDiagram';\n\nconst detector: DiagramDetector = (text, config) => {\n if (text.match(/^\\s*stateDiagram-v2/) !== null) {\n return true;\n }\n if (text.match(/^\\s*stateDiagram/) && config?.state?.defaultRenderer === 'dagre-wrapper') {\n return true;\n }\n if (text.match(/^\\s*stateDiagram/) && config?.state?.defaultRenderer === 'dagre-wrapper') {\n return true;\n }\n return false;\n};\n\nconst loader = async () => {\n const { diagram } = await import('./stateDiagram-v2');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'journey';\n\nconst detector: DiagramDetector = (txt) => {\n return txt.match(/^\\s*journey/) !== null;\n};\n\nconst loader = async () => {\n const { diagram } = await import('./journeyDiagram');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'error';\n\nconst detector: DiagramDetector = (text) => {\n return text.toLowerCase().trim() === 'error';\n};\n\nconst loader = async () => {\n const { diagram } = await import('./errorDiagram');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import type { MermaidConfig } from '../../../config.type';\nimport type { ExternalDiagramDefinition, DiagramDetector } from '../../../diagram-api/types';\n\nconst id = 'flowchart-elk';\n\nconst detector: DiagramDetector = (txt: string, config?: MermaidConfig): boolean => {\n if (\n // If diagram explicitly states flowchart-elk\n txt.match(/^\\s*flowchart-elk/) ||\n // If a flowchart/graph diagram has their default renderer set to elk\n (txt.match(/^\\s*flowchart|graph/) && config?.flowchart?.defaultRenderer === 'elk')\n ) {\n return true;\n }\n return false;\n};\n\nconst loader = async () => {\n const { diagram } = await import('./flowchart-elk-definition.js');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import type { ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'timeline';\n\nconst detector = (txt: string) => {\n return txt.match(/^\\s*timeline/) !== null;\n};\n\nconst loader = async () => {\n const { diagram } = await import('./timeline-definition.js');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import type { ExternalDiagramDefinition } from '../../diagram-api/types';\nconst id = 'mindmap';\n\nconst detector = (txt: string) => {\n return txt.match(/^\\s*mindmap/) !== null;\n};\n\nconst loader = async () => {\n const { diagram } = await import('./mindmap-definition.js');\n return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n id,\n detector,\n loader,\n};\n\nexport default plugin;\n","import c4 from '../diagrams/c4/c4Detector';\nimport flowchart from '../diagrams/flowchart/flowDetector';\nimport flowchartV2 from '../diagrams/flowchart/flowDetector-v2';\nimport er from '../diagrams/er/erDetector';\nimport git from '../diagrams/git/gitGraphDetector';\nimport gantt from '../diagrams/gantt/ganttDetector';\nimport info from '../diagrams/info/infoDetector';\nimport pie from '../diagrams/pie/pieDetector';\nimport requirement from '../diagrams/requirement/requirementDetector';\nimport sequence from '../diagrams/sequence/sequenceDetector';\nimport classDiagram from '../diagrams/class/classDetector';\nimport classDiagramV2 from '../diagrams/class/classDetector-V2';\nimport state from '../diagrams/state/stateDetector';\nimport stateV2 from '../diagrams/state/stateDetector-V2';\nimport journey from '../diagrams/user-journey/journeyDetector';\nimport error from '../diagrams/error/errorDetector';\nimport flowchartElk from '../diagrams/flowchart/elk/detector';\nimport timeline from '../diagrams/timeline/detector';\nimport mindmap from '../diagrams/mindmap/detector';\nimport { registerLazyLoadedDiagrams } from './detectType';\nimport { registerDiagram } from './diagramAPI';\n\nlet hasLoadedDiagrams = false;\nexport const addDiagrams = () => {\n if (hasLoadedDiagrams) {\n return;\n }\n // This is added here to avoid race-conditions.\n // We could optimize the loading logic somehow.\n hasLoadedDiagrams = true;\n registerDiagram(\n '---',\n // --- diagram type may appear if YAML front-matter is not parsed correctly\n {\n db: {\n clear: () => {\n // Quite ok, clear needs to be there for --- to work as a regular diagram\n },\n },\n styles: {}, // should never be used\n renderer: {}, // should never be used\n parser: {\n parser: { yy: {} },\n parse: () => {\n throw new Error(\n 'Diagrams beginning with --- are not valid. ' +\n 'If you were trying to use a YAML front-matter, please ensure that ' +\n \"you've correctly opened and closed the YAML front-matter with un-indented `---` blocks\"\n );\n },\n },\n init: () => null, // no op\n },\n (text) => {\n return text.toLowerCase().trimStart().startsWith('---');\n }\n );\n // Ordering of detectors is important. The first one to return true will be used.\n registerLazyLoadedDiagrams(\n error,\n c4,\n classDiagramV2,\n classDiagram,\n er,\n gantt,\n info,\n pie,\n requirement,\n sequence,\n flowchartElk,\n flowchartV2,\n flowchart,\n mindmap,\n timeline,\n git,\n stateV2,\n state,\n journey\n );\n};\n","import * as configApi from './config';\nimport { log } from './logger';\nimport { getDiagram, registerDiagram } from './diagram-api/diagramAPI';\nimport { detectType, getDiagramLoader } from './diagram-api/detectType';\nimport { extractFrontMatter } from './diagram-api/frontmatter';\nimport { UnknownDiagramError } from './errors';\nimport { DetailedError } from './utils';\n\nexport type ParseErrorFunction = (err: string | DetailedError | unknown, hash?: any) => void;\nexport class Diagram {\n type = 'graph';\n parser;\n renderer;\n db;\n private detectError?: UnknownDiagramError;\n constructor(public text: string) {\n this.text += '\\n';\n const cnf = configApi.getConfig();\n try {\n this.type = detectType(text, cnf);\n } catch (e) {\n this.type = 'error';\n this.detectError = e as UnknownDiagramError;\n }\n const diagram = getDiagram(this.type);\n log.debug('Type ' + this.type);\n // Setup diagram\n this.db = diagram.db;\n this.db.clear?.();\n this.renderer = diagram.renderer;\n this.parser = diagram.parser;\n const originalParse = this.parser.parse.bind(this.parser);\n // Wrap the jison parse() method to handle extracting frontmatter.\n //\n // This can't be done in this.parse() because some code\n // directly calls diagram.parser.parse(), bypassing this.parse().\n //\n // Similarly, we can't do this in getDiagramFromText() because some code\n // calls diagram.db.clear(), which would reset anything set by\n // extractFrontMatter().\n this.parser.parse = (text: string) => originalParse(extractFrontMatter(text, this.db));\n this.parser.parser.yy = this.db;\n if (diagram.init) {\n diagram.init(cnf);\n log.info('Initialized diagram ' + this.type, cnf);\n }\n this.parse();\n }\n\n parse() {\n if (this.detectError) {\n throw this.detectError;\n }\n this.db.clear?.();\n this.parser.parse(this.text);\n }\n\n async render(id: string, version: string) {\n await this.renderer.draw(this.text, id, version, this);\n }\n\n getParser() {\n return this.parser;\n }\n\n getType() {\n return this.type;\n }\n}\n\nexport const getDiagramFromText = async (text: string): Promise<Diagram> => {\n const type = detectType(text, configApi.getConfig());\n try {\n // Trying to find the diagram\n getDiagram(type);\n } catch (error) {\n const loader = getDiagramLoader(type);\n if (!loader) {\n throw new UnknownDiagramError(`Diagram ${type} not found.`);\n }\n // Diagram not available, loading it.\n // new diagram will try getDiagram again and if fails then it is a valid throw\n const { id, diagram } = await loader();\n registerDiagram(id, diagram);\n }\n return new Diagram(text);\n};\n","let interactionFunctions: (() => void)[] = [];\nexport const addFunction = (func: () => void) => {\n interactionFunctions.push(func);\n};\nexport const attachFunctions = () => {\n interactionFunctions.forEach((f) => {\n f();\n });\n interactionFunctions = [];\n};\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n","import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n","import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n","import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n","import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n","import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n","import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n","import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n","import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n","import baseKeys from './_baseKeys.js';\nimport getTag from './_getTag.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLike from './isArrayLike.js';\nimport isBuffer from './isBuffer.js';\nimport isPrototype from './_isPrototype.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n\nexport default isEmpty;\n","/**\n * Accessibility (a11y) functions, types, helpers\n * @see https://www.w3.org/WAI/\n * @see https://www.w3.org/TR/wai-aria-1.1/\n * @see https://www.w3.org/TR/svg-aam-1.0/\n *\n */\nimport { D3Element } from './mermaidAPI';\n\nimport isEmpty from 'lodash-es/isEmpty.js';\n\n/**\n * SVG element role:\n * The SVG element role _should_ be set to 'graphics-document' per SVG standard\n * but in practice is not always done by browsers, etc. (As of 2022-12-08).\n * A fallback role of 'document' should be set for those browsers, etc., that only support ARIA 1.0.\n *\n * @see https://www.w3.org/TR/svg-aam-1.0/#roleMappingGeneralRules\n * @see https://www.w3.org/TR/graphics-aria-1.0/#graphics-document\n */\nconst SVG_ROLE = 'graphics-document document';\n\n/**\n * Add role and aria-roledescription to the svg element\n *\n * @param svg - d3 object that contains the SVG HTML element\n * @param diagramType - diagram name for to the aria-roledescription\n */\nexport function setA11yDiagramInfo(svg: D3Element, diagramType: string | null | undefined) {\n svg.attr('role', SVG_ROLE);\n if (!isEmpty(diagramType)) {\n svg.attr('aria-roledescription', diagramType);\n }\n}\n/**\n * Add an accessible title and/or description element to a chart.\n * The title is usually not displayed and the description is never displayed.\n *\n * The following charts display their title as a visual and accessibility element: gantt\n *\n * @param svg - d3 node to insert the a11y title and desc info\n * @param a11yTitle - a11y title. null and undefined are meaningful: means to skip it\n * @param a11yDesc - a11y description. null and undefined are meaningful: means to skip it\n * @param baseId - id used to construct the a11y title and description id\n */\nexport function addSVGa11yTitleDescription(\n svg: D3Element,\n a11yTitle: string | null | undefined,\n a11yDesc: string | null | undefined,\n baseId: string\n) {\n if (svg.insert === undefined) {\n return;\n }\n\n if (a11yTitle || a11yDesc) {\n if (a11yDesc) {\n const descId = 'chart-desc-' + baseId;\n svg.attr('aria-describedby', descId);\n svg.insert('desc', ':first-child').attr('id', descId).text(a11yDesc);\n }\n if (a11yTitle) {\n const titleId = 'chart-title-' + baseId;\n svg.attr('aria-labelledby', titleId);\n svg.insert('title', ':first-child').attr('id', titleId).text(a11yTitle);\n }\n } else {\n return;\n }\n}\n","/**\n * This is the API to be used when optionally handling the integration with the web page, instead of\n * using the default integration provided by mermaid.js.\n *\n * The core of this api is the [**render**](Setup.md?id=render) function which, given a graph\n * definition as text, renders the graph/diagram and returns an svg element for the graph.\n *\n * It is then up to the user of the API to make use of the svg, either insert it somewhere in the\n * page or do something completely different.\n *\n * In addition to the render function, a number of behavioral configuration options are available.\n */\n// @ts-ignore TODO: Investigate D3 issue\nimport { select } from 'd3';\nimport { compile, serialize, stringify } from 'stylis';\n// @ts-ignore: TODO Fix ts errors\nimport { version } from '../package.json';\nimport * as configApi from './config';\nimport { addDiagrams } from './diagram-api/diagram-orchestration';\nimport { Diagram, getDiagramFromText } from './Diagram';\nimport errorRenderer from './diagrams/error/errorRenderer';\nimport { attachFunctions } from './interactionDb';\nimport { log, setLogLevel } from './logger';\nimport getStyles from './styles';\nimport theme from './themes';\nimport utils, { directiveSanitizer } from './utils';\nimport DOMPurify from 'dompurify';\nimport { MermaidConfig } from './config.type';\nimport { evaluate } from './diagrams/common/common';\nimport isEmpty from 'lodash-es/isEmpty.js';\nimport { setA11yDiagramInfo, addSVGa11yTitleDescription } from './accessibility';\nimport { parseDirective } from './directiveUtils';\n\n// diagram names that support classDef statements\nconst CLASSDEF_DIAGRAMS = ['graph', 'flowchart', 'flowchart-v2', 'stateDiagram', 'stateDiagram-v2'];\nconst MAX_TEXTLENGTH = 50_000;\nconst MAX_TEXTLENGTH_EXCEEDED_MSG =\n 'graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa';\n\nconst SECURITY_LVL_SANDBOX = 'sandbox';\nconst SECURITY_LVL_LOOSE = 'loose';\n\nconst XMLNS_SVG_STD = 'http://www.w3.org/2000/svg';\nconst XMLNS_XLINK_STD = 'http://www.w3.org/1999/xlink';\nconst XMLNS_XHTML_STD = 'http://www.w3.org/1999/xhtml';\n\n// ------------------------------\n// iFrame\nconst IFRAME_WIDTH = '100%';\nconst IFRAME_HEIGHT = '100%';\nconst IFRAME_STYLES = 'border:0;margin:0;';\nconst IFRAME_BODY_STYLE = 'margin:0';\nconst IFRAME_SANDBOX_OPTS = 'allow-top-navigation-by-user-activation allow-popups';\nconst IFRAME_NOT_SUPPORTED_MSG = 'The \"iframe\" tag is not supported by your browser.';\n\n// DOMPurify settings for svgCode\nconst DOMPURIFY_TAGS = ['foreignobject'];\nconst DOMPURIFY_ATTR = ['dominant-baseline'];\n\n// This is what is returned from getClasses(...) methods.\n// It is slightly renamed to ..StyleClassDef instead of just ClassDef because \"class\" is a greatly ambiguous and overloaded word.\n// It makes it clear we're working with a style class definition, even though defining the type is currently difficult.\ninterface DiagramStyleClassDef {\n id: string;\n styles?: string[];\n textStyles?: string[];\n}\n\nexport interface ParseOptions {\n suppressErrors?: boolean;\n}\n\n// This makes it clear that we're working with a d3 selected element of some kind, even though it's hard to specify the exact type.\n// @ts-ignore Could replicate the type definition in d3. This also makes it possible to use the untyped info from the js diagram files.\nexport type D3Element = any;\n\nexport interface RenderResult {\n /**\n * The svg code for the rendered graph.\n */\n svg: string;\n /**\n * Bind function to be called after the svg has been inserted into the DOM.\n * This is necessary for adding event listeners to the elements in the svg.\n * ```js\n * const { svg, bindFunctions } = mermaidAPI.render('id1', 'graph TD;A-->B');\n * div.innerHTML = svg;\n * bindFunctions?.(div); // To call bindFunctions only if it's present.\n * ```\n */\n bindFunctions?: (element: Element) => void;\n}\n\n/**\n * Parse the text and validate the syntax.\n * @param text - The mermaid diagram definition.\n * @param parseOptions - Options for parsing.\n * @returns true if the diagram is valid, false otherwise if parseOptions.suppressErrors is true.\n * @throws Error if the diagram is invalid and parseOptions.suppressErrors is false.\n */\n\nasync function parse(text: string, parseOptions?: ParseOptions): Promise<boolean | void> {\n addDiagrams();\n let error;\n try {\n const diagram = await getDiagramFromText(text);\n diagram.parse();\n } catch (err) {\n error = err;\n }\n if (parseOptions?.suppressErrors) {\n return error === undefined;\n }\n if (error) {\n throw error;\n }\n}\n\n/**\n * @param text - text to be encoded\n * @returns\n */\nexport const encodeEntities = function (text: string): string {\n let txt = text;\n\n txt = txt.replace(/style.*:\\S*#.*;/g, function (s): string {\n return s.substring(0, s.length - 1);\n });\n txt = txt.replace(/classDef.*:\\S*#.*;/g, function (s): string {\n return s.substring(0, s.length - 1);\n });\n\n txt = txt.replace(/#\\w+;/g, function (s) {\n const innerTxt = s.substring(1, s.length - 1);\n\n const isInt = /^\\+?\\d+$/.test(innerTxt);\n if (isInt) {\n return 'fl°°' + innerTxt + '¶ß';\n } else {\n return 'fl°' + innerTxt + '¶ß';\n }\n });\n\n return txt;\n};\n\n/**\n *\n * @param text - text to be decoded\n * @returns\n */\nexport const decodeEntities = function (text: string): string {\n let txt = text;\n\n txt = txt.replace(/fl°°/g, '&#');\n txt = txt.replace(/fl°/g, '&');\n txt = txt.replace(/¶ß/g, ';');\n\n return txt;\n};\n\n// append !important; to each cssClass followed by a final !important, all enclosed in { }\n//\n/**\n * Create a CSS style that starts with the given class name, then the element,\n * with an enclosing block that has each of the cssClasses followed by !important;\n * @param cssClass - CSS class name\n * @param element - CSS element\n * @param cssClasses - list of CSS styles to append after the element\n * @returns - the constructed string\n */\nexport const cssImportantStyles = (\n cssClass: string,\n element: string,\n cssClasses: string[] = []\n): string => {\n return `\\n.${cssClass} ${element} { ${cssClasses.join(' !important; ')} !important; }`;\n};\n\n/**\n * Create the user styles\n *\n * @param config - configuration that has style and theme settings to use\n * @param graphType - used for checking if classDefs should be applied\n * @param classDefs - the classDefs in the diagram text. Might be null if none were defined. Usually is the result of a call to getClasses(...)\n * @returns the string with all the user styles\n */\nexport const createCssStyles = (\n config: MermaidConfig,\n graphType: string,\n classDefs: Record<string, DiagramStyleClassDef> | null | undefined = {}\n): string => {\n let cssStyles = '';\n\n // user provided theme CSS info\n // If you add more configuration driven data into the user styles make sure that the value is\n // sanitized by the sanitize CSS function TODO where is this method? what should be used to replace it? refactor so that it's always sanitized\n if (config.themeCSS !== undefined) {\n cssStyles += `\\n${config.themeCSS}`;\n }\n\n if (config.fontFamily !== undefined) {\n cssStyles += `\\n:root { --mermaid-font-family: ${config.fontFamily}}`;\n }\n if (config.altFontFamily !== undefined) {\n cssStyles += `\\n:root { --mermaid-alt-font-family: ${config.altFontFamily}}`;\n }\n\n // classDefs defined in the diagram text\n if (!isEmpty(classDefs) && CLASSDEF_DIAGRAMS.includes(graphType)) {\n const htmlLabels = config.htmlLabels || config.flowchart?.htmlLabels; // TODO why specifically check the Flowchart diagram config?\n\n const cssHtmlElements = ['> *', 'span']; // TODO make a constant\n const cssShapeElements = ['rect', 'polygon', 'ellipse', 'circle', 'path']; // TODO make a constant\n\n const cssElements = htmlLabels ? cssHtmlElements : cssShapeElements;\n\n // create the CSS styles needed for each styleClass definition and css element\n for (const classId in classDefs) {\n const styleClassDef = classDefs[classId];\n // create the css styles for each cssElement and the styles (only if there are styles)\n if (!isEmpty(styleClassDef.styles)) {\n cssElements.forEach((cssElement) => {\n cssStyles += cssImportantStyles(styleClassDef.id, cssElement, styleClassDef.styles);\n });\n }\n // create the css styles for the tspan element and the text styles (only if there are textStyles)\n if (!isEmpty(styleClassDef.textStyles)) {\n cssStyles += cssImportantStyles(styleClassDef.id, 'tspan', styleClassDef.textStyles);\n }\n }\n }\n return cssStyles;\n};\n\nexport const createUserStyles = (\n config: MermaidConfig,\n graphType: string,\n classDefs: Record<string, DiagramStyleClassDef>,\n svgId: string\n): string => {\n const userCSSstyles = createCssStyles(config, graphType, classDefs);\n const allStyles = getStyles(graphType, userCSSstyles, config.themeVariables);\n\n // Now turn all of the styles into a (compiled) string that starts with the id\n // use the stylis library to compile the css, turn the results into a valid CSS string (serialize(...., stringify))\n // @see https://github.com/thysultan/stylis\n return serialize(compile(`${svgId}{${allStyles}}`), stringify);\n};\n\n/**\n * Clean up svgCode. Do replacements needed\n *\n * @param svgCode - the code to clean up\n * @param inSandboxMode - security level\n * @param useArrowMarkerUrls - should arrow marker's use full urls? (vs. just the anchors)\n * @returns the cleaned up svgCode\n */\nexport const cleanUpSvgCode = (\n svgCode = '',\n inSandboxMode: boolean,\n useArrowMarkerUrls: boolean\n): string => {\n let cleanedUpSvg = svgCode;\n\n // Replace marker-end urls with just the # anchor (remove the preceding part of the URL)\n if (!useArrowMarkerUrls && !inSandboxMode) {\n cleanedUpSvg = cleanedUpSvg.replace(/marker-end=\"url\\(.*?#/g, 'marker-end=\"url(#');\n }\n\n cleanedUpSvg = decodeEntities(cleanedUpSvg);\n\n // replace old br tags with newer style\n cleanedUpSvg = cleanedUpSvg.replace(/<br>/g, '<br/>');\n\n return cleanedUpSvg;\n};\n\n/**\n * Put the svgCode into an iFrame. Return the iFrame code\n *\n * @param svgCode - the svg code to put inside the iFrame\n * @param svgElement - the d3 node that has the current svgElement so we can get the height from it\n * @returns - the code with the iFrame that now contains the svgCode\n * TODO replace btoa(). Replace with buf.toString('base64')?\n */\nexport const putIntoIFrame = (svgCode = '', svgElement?: D3Element): string => {\n const height = svgElement ? svgElement.viewBox.baseVal.height + 'px' : IFRAME_HEIGHT;\n const base64encodedSrc = btoa('<body style=\"' + IFRAME_BODY_STYLE + '\">' + svgCode + '</body>');\n return `<iframe style=\"width:${IFRAME_WIDTH};height:${height};${IFRAME_STYLES}\" src=\"data:text/html;base64,${base64encodedSrc}\" sandbox=\"${IFRAME_SANDBOX_OPTS}\">\n ${IFRAME_NOT_SUPPORTED_MSG}\n</iframe>`;\n};\n\n/**\n * Append an enclosing div, then svg, then g (group) to the d3 parentRoot. Set attributes.\n * Only set the style attribute on the enclosing div if divStyle is given.\n * Only set the xmlns:xlink attribute on svg if svgXlink is given.\n * Return the last node appended\n *\n * @param parentRoot - the d3 node to append things to\n * @param id - the value to set the id attr to\n * @param enclosingDivId - the id to set the enclosing div to\n * @param divStyle - if given, the style to set the enclosing div to\n * @param svgXlink - if given, the link to set the new svg element to\n * @returns - returns the parentRoot that had nodes appended\n */\nexport const appendDivSvgG = (\n parentRoot: D3Element,\n id: string,\n enclosingDivId: string,\n divStyle?: string,\n svgXlink?: string\n): D3Element => {\n const enclosingDiv = parentRoot.append('div');\n enclosingDiv.attr('id', enclosingDivId);\n if (divStyle) {\n enclosingDiv.attr('style', divStyle);\n }\n\n const svgNode = enclosingDiv\n .append('svg')\n .attr('id', id)\n .attr('width', '100%')\n .attr('xmlns', XMLNS_SVG_STD);\n if (svgXlink) {\n svgNode.attr('xmlns:xlink', svgXlink);\n }\n\n svgNode.append('g');\n return parentRoot;\n};\n\n/**\n * Append an iFrame node to the given parentNode and set the id, style, and 'sandbox' attributes\n * Return the appended iframe d3 node\n *\n * @param parentNode - the d3 node to append the iFrame node to\n * @param iFrameId - id to use for the iFrame\n * @returns the appended iframe d3 node\n */\nfunction sandboxedIframe(parentNode: D3Element, iFrameId: string): D3Element {\n return parentNode\n .append('iframe')\n .attr('id', iFrameId)\n .attr('style', 'width: 100%; height: 100%;')\n .attr('sandbox', '');\n}\n\n/**\n * Remove any existing elements from the given document\n *\n * @param doc - the document to removed elements from\n * @param id - id for any existing SVG element\n * @param divSelector - selector for any existing enclosing div element\n * @param iFrameSelector - selector for any existing iFrame element\n */\nexport const removeExistingElements = (\n doc: Document,\n id: string,\n divId: string,\n iFrameId: string\n) => {\n // Remove existing SVG element if it exists\n doc.getElementById(id)?.remove();\n // Remove previous temporary element if it exists\n // Both div and iframe needs to be cleared in case there is a config change happening between renders.\n doc.getElementById(divId)?.remove();\n doc.getElementById(iFrameId)?.remove();\n};\n\n/**\n * @deprecated - use the `mermaid.render` function instead of `mermaid.mermaidAPI.render`\n *\n * Deprecated for external use.\n */\n\nconst render = async function (\n id: string,\n text: string,\n svgContainingElement?: Element\n): Promise<RenderResult> {\n addDiagrams();\n\n configApi.reset();\n\n // Add Directives. Must do this before getting the config and before creating the diagram.\n const graphInit = utils.detectInit(text);\n if (graphInit) {\n directiveSanitizer(graphInit);\n configApi.addDirective(graphInit);\n }\n\n const config = configApi.getConfig();\n log.debug(config);\n\n // Check the maximum allowed text size\n if (text.length > (config?.maxTextSize ?? MAX_TEXTLENGTH)) {\n text = MAX_TEXTLENGTH_EXCEEDED_MSG;\n }\n\n // clean up text CRLFs\n text = text.replace(/\\r\\n?/g, '\\n'); // parser problems on CRLF ignore all CR and leave LF;;\n\n const idSelector = '#' + id;\n const iFrameID = 'i' + id;\n const iFrameID_selector = '#' + iFrameID;\n const enclosingDivID = 'd' + id;\n const enclosingDivID_selector = '#' + enclosingDivID;\n\n let root: any = select('body');\n\n const isSandboxed = config.securityLevel === SECURITY_LVL_SANDBOX;\n const isLooseSecurityLevel = config.securityLevel === SECURITY_LVL_LOOSE;\n\n const fontFamily = config.fontFamily;\n\n // -------------------------------------------------------------------------------\n // Define the root d3 node\n // In regular execution the svgContainingElement will be the element with a mermaid class\n\n if (svgContainingElement !== undefined) {\n if (svgContainingElement) {\n svgContainingElement.innerHTML = '';\n }\n\n if (isSandboxed) {\n // If we are in sandboxed mode, we do everything mermaid related in a (sandboxed )iFrame\n const iframe = sandboxedIframe(select(svgContainingElement), iFrameID);\n root = select(iframe.nodes()[0]!.contentDocument!.body);\n root.node().style.margin = 0;\n } else {\n root = select(svgContainingElement);\n }\n appendDivSvgG(root, id, enclosingDivID, `font-family: ${fontFamily}`, XMLNS_XLINK_STD);\n } else {\n // No svgContainingElement was provided\n\n // If there is an existing element with the id, we remove it. This likely a previously rendered diagram\n removeExistingElements(document, id, enclosingDivID, iFrameID);\n\n // Add the temporary div used for rendering with the enclosingDivID.\n // This temporary div will contain a svg with the id == id\n\n if (isSandboxed) {\n // If we are in sandboxed mode, we do everything mermaid related in a (sandboxed) iFrame\n const iframe = sandboxedIframe(select('body'), iFrameID);\n root = select(iframe.nodes()[0]!.contentDocument!.body);\n root.node().style.margin = 0;\n } else {\n root = select('body');\n }\n\n appendDivSvgG(root, id, enclosingDivID);\n }\n\n text = encodeEntities(text);\n\n // -------------------------------------------------------------------------------\n // Create the diagram\n\n // Important that we do not create the diagram until after the directives have been included\n let diag: Diagram;\n let parseEncounteredException;\n\n try {\n diag = await getDiagramFromText(text);\n } catch (error) {\n diag = new Diagram('error');\n parseEncounteredException = error;\n }\n\n // Get the temporary div element containing the svg\n const element = root.select(enclosingDivID_selector).node();\n const graphType = diag.type;\n\n // -------------------------------------------------------------------------------\n // Create and insert the styles (user styles, theme styles, config styles)\n\n // Insert an element into svg. This is where we put the styles\n const svg = element.firstChild;\n const firstChild = svg.firstChild;\n const diagramClassDefs = CLASSDEF_DIAGRAMS.includes(graphType)\n ? diag.renderer.getClasses(text, diag)\n : {};\n\n const rules = createUserStyles(\n config,\n graphType,\n // @ts-ignore convert renderer to TS.\n diagramClassDefs,\n idSelector\n );\n\n const style1 = document.createElement('style');\n style1.innerHTML = rules;\n svg.insertBefore(style1, firstChild);\n\n // -------------------------------------------------------------------------------\n // Draw the diagram with the renderer\n try {\n await diag.renderer.draw(text, id, version, diag);\n } catch (e) {\n errorRenderer.draw(text, id, version);\n throw e;\n }\n\n // This is the d3 node for the svg element\n const svgNode = root.select(`${enclosingDivID_selector} svg`);\n const a11yTitle = diag.db.getAccTitle?.();\n const a11yDescr = diag.db.getAccDescription?.();\n addA11yInfo(graphType, svgNode, a11yTitle, a11yDescr);\n\n // -------------------------------------------------------------------------------\n // Clean up SVG code\n root.select(`[id=\"${id}\"]`).selectAll('foreignobject > *').attr('xmlns', XMLNS_XHTML_STD);\n\n // Fix for when the base tag is used\n let svgCode: string = root.select(enclosingDivID_selector).node().innerHTML;\n\n log.debug('config.arrowMarkerAbsolute', config.arrowMarkerAbsolute);\n svgCode = cleanUpSvgCode(svgCode, isSandboxed, evaluate(config.arrowMarkerAbsolute));\n\n if (isSandboxed) {\n const svgEl = root.select(enclosingDivID_selector + ' svg').node();\n svgCode = putIntoIFrame(svgCode, svgEl);\n } else if (!isLooseSecurityLevel) {\n // Sanitize the svgCode using DOMPurify\n svgCode = DOMPurify.sanitize(svgCode, {\n ADD_TAGS: DOMPURIFY_TAGS,\n ADD_ATTR: DOMPURIFY_ATTR,\n });\n }\n\n attachFunctions();\n\n // -------------------------------------------------------------------------------\n // Remove the temporary HTML element if appropriate\n const tmpElementSelector = isSandboxed ? iFrameID_selector : enclosingDivID_selector;\n const node = select(tmpElementSelector).node();\n if (node && 'remove' in node) {\n node.remove();\n }\n\n if (parseEncounteredException) {\n throw parseEncounteredException;\n }\n\n return {\n svg: svgCode,\n bindFunctions: diag.db.bindFunctions,\n };\n};\n\n/**\n * @param options - Initial Mermaid options\n */\nfunction initialize(options: MermaidConfig = {}) {\n // Handle legacy location of font-family configuration\n if (options?.fontFamily && !options.themeVariables?.fontFamily) {\n if (!options.themeVariables) {\n options.themeVariables = {};\n }\n options.themeVariables.fontFamily = options.fontFamily;\n }\n\n // Set default options\n configApi.saveConfigFromInitialize(options);\n\n if (options?.theme && options.theme in theme) {\n // Todo merge with user options\n options.themeVariables = theme[options.theme as keyof typeof theme].getThemeVariables(\n options.themeVariables\n );\n } else if (options) {\n options.themeVariables = theme.default.getThemeVariables(options.themeVariables);\n }\n\n const config =\n typeof options === 'object' ? configApi.setSiteConfig(options) : configApi.getSiteConfig();\n\n setLogLevel(config.logLevel);\n addDiagrams();\n}\n\n/**\n * Add accessibility (a11y) information to the diagram.\n *\n */\nfunction addA11yInfo(\n graphType: string,\n svgNode: D3Element,\n a11yTitle: string | undefined,\n a11yDescr: string | undefined\n) {\n setA11yDiagramInfo(svgNode, graphType);\n addSVGa11yTitleDescription(svgNode, a11yTitle, a11yDescr, svgNode.attr('id'));\n}\n\n/**\n * ## mermaidAPI configuration defaults\n *\n * ```ts\n * const config = {\n * theme: 'default',\n * logLevel: 'fatal',\n * securityLevel: 'strict',\n * startOnLoad: true,\n * arrowMarkerAbsolute: false,\n *\n * er: {\n * diagramPadding: 20,\n * layoutDirection: 'TB',\n * minEntityWidth: 100,\n * minEntityHeight: 75,\n * entityPadding: 15,\n * stroke: 'gray',\n * fill: 'honeydew',\n * fontSize: 12,\n * useMaxWidth: true,\n * },\n * flowchart: {\n * diagramPadding: 8,\n * htmlLabels: true,\n * curve: 'basis',\n * },\n * sequence: {\n * diagramMarginX: 50,\n * diagramMarginY: 10,\n * actorMargin: 50,\n * width: 150,\n * height: 65,\n * boxMargin: 10,\n * boxTextMargin: 5,\n * noteMargin: 10,\n * messageMargin: 35,\n * messageAlign: 'center',\n * mirrorActors: true,\n * bottomMarginAdj: 1,\n * useMaxWidth: true,\n * rightAngles: false,\n * showSequenceNumbers: false,\n * },\n * gantt: {\n * titleTopMargin: 25,\n * barHeight: 20,\n * barGap: 4,\n * topPadding: 50,\n * leftPadding: 75,\n * gridLineStartPadding: 35,\n * fontSize: 11,\n * fontFamily: '\"Open Sans\", sans-serif',\n * numberSectionStyles: 4,\n * axisFormat: '%Y-%m-%d',\n * topAxis: false,\n * },\n * };\n * mermaid.initialize(config);\n * ```\n */\n\nexport const mermaidAPI = Object.freeze({\n render,\n parse,\n parseDirective,\n initialize,\n getConfig: configApi.getConfig,\n setConfig: configApi.setConfig,\n getSiteConfig: configApi.getSiteConfig,\n updateSiteConfig: configApi.updateSiteConfig,\n reset: () => {\n configApi.reset();\n },\n globalReset: () => {\n configApi.reset(configApi.defaultConfig);\n },\n defaultConfig: configApi.defaultConfig,\n});\n\nsetLogLevel(configApi.getConfig().logLevel);\nconfigApi.reset(configApi.getConfig());\nexport default mermaidAPI;\n"],"names":["COMMENT","RULESET","DECLARATION","IMPORT","KEYFRAMES","abs","from","trim","value","replace","pattern","replacement","indexof","search","charat","index","substr","begin","end","strlen","sizeof","append","array","line","column","length","position","character","characters","node","root","parent","type","props","children","char","prev","next","peek","caret","slice","token","alloc","dealloc","delimit","delimiter","whitespace","escaping","count","commenter","identifier","compile","parse","rule","rules","rulesets","pseudo","points","declarations","offset","atrule","property","previous","variable","scanning","ampersand","reference","comment","declaration","ruleset","post","size","i","j","k","x","y","z","serialize","callback","output","stringify","element","id","detector","txt","loader","diagram","plugin","c4","config","_a","_b","flowchart","_c","flowchartV2","er","git","gantt","info","pie","requirement","sequence","classDiagram","classDiagramV2","state","text","stateV2","journey","error","flowchartElk","timeline","mindmap","hasLoadedDiagrams","addDiagrams","registerDiagram","registerLazyLoadedDiagrams","Diagram","cnf","configApi.getConfig","detectType","e","getDiagram","log","originalParse","extractFrontMatter","version","getDiagramFromText","getDiagramLoader","UnknownDiagramError","interactionFunctions","addFunction","func","attachFunctions","f","objectProto","isPrototype","Ctor","proto","overArg","transform","arg","nativeKeys","nativeKeys$1","hasOwnProperty","baseKeys","object","result","key","DataView","getNative","DataView$1","Promise","Promise$2","Set","Set$1","WeakMap","WeakMap$1","mapTag","objectTag","promiseTag","setTag","weakMapTag","dataViewTag","dataViewCtorString","toSource","mapCtorString","Map","promiseCtorString","setCtorString","weakMapCtorString","getTag","baseGetTag","ctorString","getTag$1","isObjectLike","argsTag","baseIsArguments","propertyIsEnumerable","isArguments","isArguments$1","isArray","isArray$1","MAX_SAFE_INTEGER","isLength","isArrayLike","isFunction","stubFalse","freeExports","freeModule","moduleExports","Buffer","nativeIsBuffer","isBuffer","isBuffer$1","arrayTag","boolTag","dateTag","errorTag","funcTag","numberTag","regexpTag","stringTag","arrayBufferTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","typedArrayTags","baseIsTypedArray","baseUnary","freeProcess","freeGlobal","nodeUtil","types","nodeUtil$1","nodeIsTypedArray","isTypedArray","isTypedArray$1","isEmpty","tag","SVG_ROLE","setA11yDiagramInfo","svg","diagramType","addSVGa11yTitleDescription","a11yTitle","a11yDesc","baseId","descId","titleId","CLASSDEF_DIAGRAMS","MAX_TEXTLENGTH","MAX_TEXTLENGTH_EXCEEDED_MSG","SECURITY_LVL_SANDBOX","SECURITY_LVL_LOOSE","XMLNS_SVG_STD","XMLNS_XLINK_STD","XMLNS_XHTML_STD","IFRAME_WIDTH","IFRAME_HEIGHT","IFRAME_STYLES","IFRAME_BODY_STYLE","IFRAME_SANDBOX_OPTS","IFRAME_NOT_SUPPORTED_MSG","DOMPURIFY_TAGS","DOMPURIFY_ATTR","parseOptions","err","encodeEntities","s","innerTxt","decodeEntities","cssImportantStyles","cssClass","cssClasses","createCssStyles","graphType","classDefs","cssStyles","cssElements","classId","styleClassDef","cssElement","createUserStyles","svgId","userCSSstyles","allStyles","getStyles","cleanUpSvgCode","svgCode","inSandboxMode","useArrowMarkerUrls","cleanedUpSvg","putIntoIFrame","svgElement","height","base64encodedSrc","appendDivSvgG","parentRoot","enclosingDivId","divStyle","svgXlink","enclosingDiv","svgNode","sandboxedIframe","parentNode","iFrameId","removeExistingElements","doc","divId","render","svgContainingElement","configApi.reset","graphInit","utils","directiveSanitizer","configApi.addDirective","idSelector","iFrameID","iFrameID_selector","enclosingDivID","enclosingDivID_selector","select","isSandboxed","isLooseSecurityLevel","fontFamily","iframe","diag","parseEncounteredException","firstChild","diagramClassDefs","style1","errorRenderer","a11yDescr","_d","addA11yInfo","evaluate","svgEl","DOMPurify","initialize","options","configApi.saveConfigFromInitialize","theme","configApi.setSiteConfig","configApi.getSiteConfig","setLogLevel","mermaidAPI","parseDirective","configApi.setConfig","configApi.updateSiteConfig","configApi.defaultConfig"],"mappings":";;;AAIO,IAAIA,KAAU,QACVC,KAAU,QACVC,KAAc,QAIdC,KAAS,WAMTC,KAAY,cCZZC,KAAM,KAAK,KAMXC,KAAO,OAAO;AAqBlB,SAASC,GAAMC,GAAO;AAC5B,SAAOA,EAAM,KAAM;AACpB;AAiBO,SAASC,GAASD,GAAOE,GAAS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