UNPKG

588 kBJavaScriptView Raw
1(function webpackUniversalModuleDefinition(root, factory) {
2 if(typeof exports === 'object' && typeof module === 'object')
3 module.exports = factory();
4 else if(typeof define === 'function' && define.amd)
5 define([], factory);
6 else if(typeof exports === 'object')
7 exports["mermaid"] = factory();
8 else
9 root["mermaid"] = factory();
10})(window, function() {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14/******/
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17/******/
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId]) {
20/******/ return installedModules[moduleId].exports;
21/******/ }
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ i: moduleId,
25/******/ l: false,
26/******/ exports: {}
27/******/ };
28/******/
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31/******/
32/******/ // Flag the module as loaded
33/******/ module.l = true;
34/******/
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38/******/
39/******/
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42/******/
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45/******/
46/******/ // define getter function for harmony exports
47/******/ __webpack_require__.d = function(exports, name, getter) {
48/******/ if(!__webpack_require__.o(exports, name)) {
49/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
50/******/ }
51/******/ };
52/******/
53/******/ // define __esModule on exports
54/******/ __webpack_require__.r = function(exports) {
55/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
56/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
57/******/ }
58/******/ Object.defineProperty(exports, '__esModule', { value: true });
59/******/ };
60/******/
61/******/ // create a fake namespace object
62/******/ // mode & 1: value is a module id, require it
63/******/ // mode & 2: merge all properties of value into the ns
64/******/ // mode & 4: return value when already ns object
65/******/ // mode & 8|1: behave like require
66/******/ __webpack_require__.t = function(value, mode) {
67/******/ if(mode & 1) value = __webpack_require__(value);
68/******/ if(mode & 8) return value;
69/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
70/******/ var ns = Object.create(null);
71/******/ __webpack_require__.r(ns);
72/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
73/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
74/******/ return ns;
75/******/ };
76/******/
77/******/ // getDefaultExport function for compatibility with non-harmony modules
78/******/ __webpack_require__.n = function(module) {
79/******/ var getter = module && module.__esModule ?
80/******/ function getDefault() { return module['default']; } :
81/******/ function getModuleExports() { return module; };
82/******/ __webpack_require__.d(getter, 'a', getter);
83/******/ return getter;
84/******/ };
85/******/
86/******/ // Object.prototype.hasOwnProperty.call
87/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
88/******/
89/******/ // __webpack_public_path__
90/******/ __webpack_require__.p = "";
91/******/
92/******/
93/******/ // Load entry module and return exports
94/******/ return __webpack_require__(__webpack_require__.s = "./src/mermaid.js");
95/******/ })
96/************************************************************************/
97/******/ ({
98
99/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/dark/index.scss":
100/*!*****************************************************************************************************************!*\
101 !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/dark/index.scss ***!
102 \*****************************************************************************************************************/
103/*! no static exports found */
104/***/ (function(module, exports, __webpack_require__) {
105
106exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false);
107// Module
108exports.push([module.i, "/* Flowchart variables */\n/* Sequence Diagram variables */\n/* Gantt chart variables */\n/* state colors */\n.label {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n color: #333; }\n\n.label text {\n fill: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon {\n fill: #BDD5EA;\n stroke: purple;\n stroke-width: 1px; }\n\n.node .label {\n text-align: center; }\n\n.node.clickable {\n cursor: pointer; }\n\n.arrowheadPath {\n fill: lightgrey; }\n\n.edgePath .path {\n stroke: lightgrey;\n stroke-width: 1.5px; }\n\n.edgeLabel {\n background-color: #e8e8e8;\n text-align: center; }\n\n.cluster rect {\n fill: #6D6D65;\n stroke: rgba(255, 255, 255, 0.25);\n stroke-width: 1px; }\n\n.cluster text {\n fill: #F9FFFE; }\n\ndiv.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: #6D6D65;\n border: 1px solid rgba(255, 255, 255, 0.25);\n border-radius: 2px;\n pointer-events: none;\n z-index: 100; }\n\n.actor {\n stroke: #81B1DB;\n fill: #BDD5EA; }\n\ntext.actor {\n fill: black;\n stroke: none; }\n\n.actor-line {\n stroke: lightgrey; }\n\n.messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: lightgrey; }\n\n.messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: lightgrey; }\n\n#arrowhead {\n fill: lightgrey; }\n\n.sequenceNumber {\n fill: white; }\n\n#sequencenumber {\n fill: lightgrey; }\n\n#crosshead path {\n fill: lightgrey !important;\n stroke: lightgrey !important; }\n\n.messageText {\n fill: lightgrey;\n stroke: none; }\n\n.labelBox {\n stroke: #81B1DB;\n fill: #BDD5EA; }\n\n.labelText {\n fill: #323D47;\n stroke: none; }\n\n.loopText {\n fill: lightgrey;\n stroke: none; }\n\n.loopLine {\n stroke-width: 2;\n stroke-dasharray: '2 2';\n stroke: #81B1DB; }\n\n.note {\n stroke: rgba(255, 255, 255, 0.25);\n fill: #fff5ad; }\n\n.noteText {\n fill: black;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 14px; }\n\n.activation0 {\n fill: #f4f4f4;\n stroke: #666; }\n\n.activation1 {\n fill: #f4f4f4;\n stroke: #666; }\n\n.activation2 {\n fill: #f4f4f4;\n stroke: #666; }\n\n/** Section styling */\n.mermaid-main-font {\n font-family: \"trebuchet ms\", verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.section {\n stroke: none;\n opacity: 0.2; }\n\n.section0 {\n fill: rgba(255, 255, 255, 0.3); }\n\n.section2 {\n fill: #EAE8B9; }\n\n.section1,\n.section3 {\n fill: white;\n opacity: 0.2; }\n\n.sectionTitle0 {\n fill: #F9FFFE; }\n\n.sectionTitle1 {\n fill: #F9FFFE; }\n\n.sectionTitle2 {\n fill: #F9FFFE; }\n\n.sectionTitle3 {\n fill: #F9FFFE; }\n\n.sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n/* Grid and axis */\n.grid .tick {\n stroke: lightgrey;\n opacity: 0.3;\n shape-rendering: crispEdges; }\n .grid .tick text {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.grid path {\n stroke-width: 0; }\n\n/* Today line */\n.today {\n fill: none;\n stroke: #DB5757;\n stroke-width: 2px; }\n\n/* Task styling */\n/* Default task */\n.task {\n stroke-width: 2; }\n\n.taskText {\n text-anchor: middle;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.taskText:not([font-size]) {\n font-size: 11px; }\n\n.taskTextOutsideRight {\n fill: #323D47;\n text-anchor: start;\n font-size: 11px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.taskTextOutsideLeft {\n fill: #323D47;\n text-anchor: end;\n font-size: 11px; }\n\n/* Special case clickable */\n.task.clickable {\n cursor: pointer; }\n\n.taskText.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n.taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n.taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n/* Specific task settings for the sections*/\n.taskText0,\n.taskText1,\n.taskText2,\n.taskText3 {\n fill: #323D47; }\n\n.task0,\n.task1,\n.task2,\n.task3 {\n fill: #BDD5EA;\n stroke: rgba(255, 255, 255, 0.5); }\n\n.taskTextOutside0,\n.taskTextOutside2 {\n fill: lightgrey; }\n\n.taskTextOutside1,\n.taskTextOutside3 {\n fill: lightgrey; }\n\n/* Active task */\n.active0,\n.active1,\n.active2,\n.active3 {\n fill: #81B1DB;\n stroke: rgba(255, 255, 255, 0.5); }\n\n.activeText0,\n.activeText1,\n.activeText2,\n.activeText3 {\n fill: #323D47 !important; }\n\n/* Completed task */\n.done0,\n.done1,\n.done2,\n.done3 {\n stroke: grey;\n fill: lightgrey;\n stroke-width: 2; }\n\n.doneText0,\n.doneText1,\n.doneText2,\n.doneText3 {\n fill: #323D47 !important; }\n\n/* Tasks on the critical line */\n.crit0,\n.crit1,\n.crit2,\n.crit3 {\n stroke: #E83737;\n fill: #E83737;\n stroke-width: 2; }\n\n.activeCrit0,\n.activeCrit1,\n.activeCrit2,\n.activeCrit3 {\n stroke: #E83737;\n fill: #81B1DB;\n stroke-width: 2; }\n\n.doneCrit0,\n.doneCrit1,\n.doneCrit2,\n.doneCrit3 {\n stroke: #E83737;\n fill: lightgrey;\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges; }\n\n.milestone {\n transform: rotate(45deg) scale(0.8, 0.8); }\n\n.milestoneText {\n font-style: italic; }\n\n.doneCritText0,\n.doneCritText1,\n.doneCritText2,\n.doneCritText3 {\n fill: #323D47 !important; }\n\n.activeCritText0,\n.activeCritText1,\n.activeCritText2,\n.activeCritText3 {\n fill: #323D47 !important; }\n\n.titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: #323D47;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.classGroup text {\n fill: purple;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 10px; }\n g.classGroup text .title {\n font-weight: bolder; }\n\ng.classGroup rect {\n fill: #BDD5EA;\n stroke: purple; }\n\ng.classGroup line {\n stroke: purple;\n stroke-width: 1; }\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #BDD5EA;\n opacity: 0.5; }\n\n.classLabel .label {\n fill: purple;\n font-size: 10px; }\n\n.relation {\n stroke: purple;\n stroke-width: 1;\n fill: none; }\n\n#compositionStart {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#compositionEnd {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#aggregationStart {\n fill: #BDD5EA;\n stroke: purple;\n stroke-width: 1; }\n\n#aggregationEnd {\n fill: #BDD5EA;\n stroke: purple;\n stroke-width: 1; }\n\n#dependencyStart {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#dependencyEnd {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#extensionStart {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#extensionEnd {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n.commit-id,\n.commit-msg,\n.branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.pieTitleText {\n text-anchor: middle;\n font-size: 25px;\n fill: #323D47;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.slice {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.stateGroup text {\n fill: purple;\n stroke: none;\n font-size: 10px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.stateGroup text {\n fill: purple;\n stroke: none;\n font-size: 10px; }\n\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: black; }\n\ng.stateGroup rect {\n fill: #BDD5EA;\n stroke: purple; }\n\ng.stateGroup line {\n stroke: purple;\n stroke-width: 1; }\n\n.transition {\n stroke: purple;\n stroke-width: 1;\n fill: none; }\n\n.stateGroup .composit {\n fill: white;\n border-bottom: 1px; }\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px; }\n\n.state-note {\n stroke: rgba(255, 255, 255, 0.25);\n fill: #fff5ad; }\n .state-note text {\n fill: black;\n stroke: none;\n font-size: 10px; }\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #BDD5EA;\n opacity: 0.5; }\n\n.stateLabel text {\n fill: black;\n font-size: 10px;\n font-weight: bold;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n:root {\n --mermaid-font-family: '\"trebuchet ms\", verdana, arial';\n --mermaid-font-family: \"Comic Sans MS\", \"Comic Sans\", cursive; }\n", ""]);
109
110
111
112/***/ }),
113
114/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/default/index.scss":
115/*!********************************************************************************************************************!*\
116 !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/default/index.scss ***!
117 \********************************************************************************************************************/
118/*! no static exports found */
119/***/ (function(module, exports, __webpack_require__) {
120
121exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false);
122// Module
123exports.push([module.i, "/* Flowchart variables */\n/* Sequence Diagram variables */\n/* Gantt chart variables */\n/* state colors */\n.label {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n color: #333; }\n\n.label text {\n fill: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon {\n fill: #ECECFF;\n stroke: #9370DB;\n stroke-width: 1px; }\n\n.node .label {\n text-align: center; }\n\n.node.clickable {\n cursor: pointer; }\n\n.arrowheadPath {\n fill: #333333; }\n\n.edgePath .path {\n stroke: #333333;\n stroke-width: 1.5px; }\n\n.edgeLabel {\n background-color: #e8e8e8;\n text-align: center; }\n\n.cluster rect {\n fill: #ffffde;\n stroke: #aaaa33;\n stroke-width: 1px; }\n\n.cluster text {\n fill: #333; }\n\ndiv.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: #ffffde;\n border: 1px solid #aaaa33;\n border-radius: 2px;\n pointer-events: none;\n z-index: 100; }\n\n.actor {\n stroke: #CCCCFF;\n fill: #ECECFF; }\n\ntext.actor {\n fill: black;\n stroke: none; }\n\n.actor-line {\n stroke: grey; }\n\n.messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: #333; }\n\n.messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: #333; }\n\n#arrowhead {\n fill: #333; }\n\n.sequenceNumber {\n fill: white; }\n\n#sequencenumber {\n fill: #333; }\n\n#crosshead path {\n fill: #333 !important;\n stroke: #333 !important; }\n\n.messageText {\n fill: #333;\n stroke: none; }\n\n.labelBox {\n stroke: #CCCCFF;\n fill: #ECECFF; }\n\n.labelText {\n fill: black;\n stroke: none; }\n\n.loopText {\n fill: black;\n stroke: none; }\n\n.loopLine {\n stroke-width: 2;\n stroke-dasharray: '2 2';\n stroke: #CCCCFF; }\n\n.note {\n stroke: #aaaa33;\n fill: #fff5ad; }\n\n.noteText {\n fill: black;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 14px; }\n\n.activation0 {\n fill: #f4f4f4;\n stroke: #666; }\n\n.activation1 {\n fill: #f4f4f4;\n stroke: #666; }\n\n.activation2 {\n fill: #f4f4f4;\n stroke: #666; }\n\n/** Section styling */\n.mermaid-main-font {\n font-family: \"trebuchet ms\", verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.section {\n stroke: none;\n opacity: 0.2; }\n\n.section0 {\n fill: rgba(102, 102, 255, 0.49); }\n\n.section2 {\n fill: #fff400; }\n\n.section1,\n.section3 {\n fill: white;\n opacity: 0.2; }\n\n.sectionTitle0 {\n fill: #333; }\n\n.sectionTitle1 {\n fill: #333; }\n\n.sectionTitle2 {\n fill: #333; }\n\n.sectionTitle3 {\n fill: #333; }\n\n.sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n/* Grid and axis */\n.grid .tick {\n stroke: lightgrey;\n opacity: 0.3;\n shape-rendering: crispEdges; }\n .grid .tick text {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.grid path {\n stroke-width: 0; }\n\n/* Today line */\n.today {\n fill: none;\n stroke: red;\n stroke-width: 2px; }\n\n/* Task styling */\n/* Default task */\n.task {\n stroke-width: 2; }\n\n.taskText {\n text-anchor: middle;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.taskText:not([font-size]) {\n font-size: 11px; }\n\n.taskTextOutsideRight {\n fill: black;\n text-anchor: start;\n font-size: 11px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.taskTextOutsideLeft {\n fill: black;\n text-anchor: end;\n font-size: 11px; }\n\n/* Special case clickable */\n.task.clickable {\n cursor: pointer; }\n\n.taskText.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n.taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n.taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n/* Specific task settings for the sections*/\n.taskText0,\n.taskText1,\n.taskText2,\n.taskText3 {\n fill: white; }\n\n.task0,\n.task1,\n.task2,\n.task3 {\n fill: #8a90dd;\n stroke: #534fbc; }\n\n.taskTextOutside0,\n.taskTextOutside2 {\n fill: black; }\n\n.taskTextOutside1,\n.taskTextOutside3 {\n fill: black; }\n\n/* Active task */\n.active0,\n.active1,\n.active2,\n.active3 {\n fill: #bfc7ff;\n stroke: #534fbc; }\n\n.activeText0,\n.activeText1,\n.activeText2,\n.activeText3 {\n fill: black !important; }\n\n/* Completed task */\n.done0,\n.done1,\n.done2,\n.done3 {\n stroke: grey;\n fill: lightgrey;\n stroke-width: 2; }\n\n.doneText0,\n.doneText1,\n.doneText2,\n.doneText3 {\n fill: black !important; }\n\n/* Tasks on the critical line */\n.crit0,\n.crit1,\n.crit2,\n.crit3 {\n stroke: #ff8888;\n fill: red;\n stroke-width: 2; }\n\n.activeCrit0,\n.activeCrit1,\n.activeCrit2,\n.activeCrit3 {\n stroke: #ff8888;\n fill: #bfc7ff;\n stroke-width: 2; }\n\n.doneCrit0,\n.doneCrit1,\n.doneCrit2,\n.doneCrit3 {\n stroke: #ff8888;\n fill: lightgrey;\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges; }\n\n.milestone {\n transform: rotate(45deg) scale(0.8, 0.8); }\n\n.milestoneText {\n font-style: italic; }\n\n.doneCritText0,\n.doneCritText1,\n.doneCritText2,\n.doneCritText3 {\n fill: black !important; }\n\n.activeCritText0,\n.activeCritText1,\n.activeCritText2,\n.activeCritText3 {\n fill: black !important; }\n\n.titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: black;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.classGroup text {\n fill: #9370DB;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 10px; }\n g.classGroup text .title {\n font-weight: bolder; }\n\ng.classGroup rect {\n fill: #ECECFF;\n stroke: #9370DB; }\n\ng.classGroup line {\n stroke: #9370DB;\n stroke-width: 1; }\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #ECECFF;\n opacity: 0.5; }\n\n.classLabel .label {\n fill: #9370DB;\n font-size: 10px; }\n\n.relation {\n stroke: #9370DB;\n stroke-width: 1;\n fill: none; }\n\n#compositionStart {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#compositionEnd {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#aggregationStart {\n fill: #ECECFF;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#aggregationEnd {\n fill: #ECECFF;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#dependencyStart {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#dependencyEnd {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#extensionStart {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#extensionEnd {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n.commit-id,\n.commit-msg,\n.branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.pieTitleText {\n text-anchor: middle;\n font-size: 25px;\n fill: black;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.slice {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.stateGroup text {\n fill: #9370DB;\n stroke: none;\n font-size: 10px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.stateGroup text {\n fill: #9370DB;\n stroke: none;\n font-size: 10px; }\n\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: black; }\n\ng.stateGroup rect {\n fill: #ECECFF;\n stroke: #9370DB; }\n\ng.stateGroup line {\n stroke: #9370DB;\n stroke-width: 1; }\n\n.transition {\n stroke: #9370DB;\n stroke-width: 1;\n fill: none; }\n\n.stateGroup .composit {\n fill: white;\n border-bottom: 1px; }\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px; }\n\n.state-note {\n stroke: #aaaa33;\n fill: #fff5ad; }\n .state-note text {\n fill: black;\n stroke: none;\n font-size: 10px; }\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #ECECFF;\n opacity: 0.5; }\n\n.stateLabel text {\n fill: black;\n font-size: 10px;\n font-weight: bold;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n:root {\n --mermaid-font-family: '\"trebuchet ms\", verdana, arial';\n --mermaid-font-family: \"Comic Sans MS\", \"Comic Sans\", cursive; }\n", ""]);
124
125
126
127/***/ }),
128
129/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/forest/index.scss":
130/*!*******************************************************************************************************************!*\
131 !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/forest/index.scss ***!
132 \*******************************************************************************************************************/
133/*! no static exports found */
134/***/ (function(module, exports, __webpack_require__) {
135
136exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false);
137// Module
138exports.push([module.i, "/* Flowchart variables */\n/* Sequence Diagram variables */\n/* Gantt chart variables */\n/* state colors */\n.label {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n color: #333; }\n\n.label text {\n fill: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon {\n fill: #cde498;\n stroke: #13540c;\n stroke-width: 1px; }\n\n.node .label {\n text-align: center; }\n\n.node.clickable {\n cursor: pointer; }\n\n.arrowheadPath {\n fill: green; }\n\n.edgePath .path {\n stroke: green;\n stroke-width: 1.5px; }\n\n.edgeLabel {\n background-color: #e8e8e8;\n text-align: center; }\n\n.cluster rect {\n fill: #cdffb2;\n stroke: #6eaa49;\n stroke-width: 1px; }\n\n.cluster text {\n fill: #333; }\n\ndiv.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: #cdffb2;\n border: 1px solid #6eaa49;\n border-radius: 2px;\n pointer-events: none;\n z-index: 100; }\n\n.actor {\n stroke: #13540c;\n fill: #cde498; }\n\ntext.actor {\n fill: black;\n stroke: none; }\n\n.actor-line {\n stroke: grey; }\n\n.messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: #333; }\n\n.messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: #333; }\n\n#arrowhead {\n fill: #333; }\n\n.sequenceNumber {\n fill: white; }\n\n#sequencenumber {\n fill: #333; }\n\n#crosshead path {\n fill: #333 !important;\n stroke: #333 !important; }\n\n.messageText {\n fill: #333;\n stroke: none; }\n\n.labelBox {\n stroke: #326932;\n fill: #cde498; }\n\n.labelText {\n fill: black;\n stroke: none; }\n\n.loopText {\n fill: black;\n stroke: none; }\n\n.loopLine {\n stroke-width: 2;\n stroke-dasharray: '2 2';\n stroke: #326932; }\n\n.note {\n stroke: #6eaa49;\n fill: #fff5ad; }\n\n.noteText {\n fill: black;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 14px; }\n\n.activation0 {\n fill: #f4f4f4;\n stroke: #666; }\n\n.activation1 {\n fill: #f4f4f4;\n stroke: #666; }\n\n.activation2 {\n fill: #f4f4f4;\n stroke: #666; }\n\n/** Section styling */\n.mermaid-main-font {\n font-family: \"trebuchet ms\", verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.section {\n stroke: none;\n opacity: 0.2; }\n\n.section0 {\n fill: #6eaa49; }\n\n.section2 {\n fill: #6eaa49; }\n\n.section1,\n.section3 {\n fill: white;\n opacity: 0.2; }\n\n.sectionTitle0 {\n fill: #333; }\n\n.sectionTitle1 {\n fill: #333; }\n\n.sectionTitle2 {\n fill: #333; }\n\n.sectionTitle3 {\n fill: #333; }\n\n.sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n/* Grid and axis */\n.grid .tick {\n stroke: lightgrey;\n opacity: 0.3;\n shape-rendering: crispEdges; }\n .grid .tick text {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.grid path {\n stroke-width: 0; }\n\n/* Today line */\n.today {\n fill: none;\n stroke: red;\n stroke-width: 2px; }\n\n/* Task styling */\n/* Default task */\n.task {\n stroke-width: 2; }\n\n.taskText {\n text-anchor: middle;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.taskText:not([font-size]) {\n font-size: 11px; }\n\n.taskTextOutsideRight {\n fill: black;\n text-anchor: start;\n font-size: 11px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.taskTextOutsideLeft {\n fill: black;\n text-anchor: end;\n font-size: 11px; }\n\n/* Special case clickable */\n.task.clickable {\n cursor: pointer; }\n\n.taskText.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n.taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n.taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n/* Specific task settings for the sections*/\n.taskText0,\n.taskText1,\n.taskText2,\n.taskText3 {\n fill: white; }\n\n.task0,\n.task1,\n.task2,\n.task3 {\n fill: #487e3a;\n stroke: #13540c; }\n\n.taskTextOutside0,\n.taskTextOutside2 {\n fill: black; }\n\n.taskTextOutside1,\n.taskTextOutside3 {\n fill: black; }\n\n/* Active task */\n.active0,\n.active1,\n.active2,\n.active3 {\n fill: #cde498;\n stroke: #13540c; }\n\n.activeText0,\n.activeText1,\n.activeText2,\n.activeText3 {\n fill: black !important; }\n\n/* Completed task */\n.done0,\n.done1,\n.done2,\n.done3 {\n stroke: grey;\n fill: lightgrey;\n stroke-width: 2; }\n\n.doneText0,\n.doneText1,\n.doneText2,\n.doneText3 {\n fill: black !important; }\n\n/* Tasks on the critical line */\n.crit0,\n.crit1,\n.crit2,\n.crit3 {\n stroke: #ff8888;\n fill: red;\n stroke-width: 2; }\n\n.activeCrit0,\n.activeCrit1,\n.activeCrit2,\n.activeCrit3 {\n stroke: #ff8888;\n fill: #cde498;\n stroke-width: 2; }\n\n.doneCrit0,\n.doneCrit1,\n.doneCrit2,\n.doneCrit3 {\n stroke: #ff8888;\n fill: lightgrey;\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges; }\n\n.milestone {\n transform: rotate(45deg) scale(0.8, 0.8); }\n\n.milestoneText {\n font-style: italic; }\n\n.doneCritText0,\n.doneCritText1,\n.doneCritText2,\n.doneCritText3 {\n fill: black !important; }\n\n.activeCritText0,\n.activeCritText1,\n.activeCritText2,\n.activeCritText3 {\n fill: black !important; }\n\n.titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: black;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.classGroup text {\n fill: #13540c;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 10px; }\n g.classGroup text .title {\n font-weight: bolder; }\n\ng.classGroup rect {\n fill: #cde498;\n stroke: #13540c; }\n\ng.classGroup line {\n stroke: #13540c;\n stroke-width: 1; }\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #cde498;\n opacity: 0.5; }\n\n.classLabel .label {\n fill: #13540c;\n font-size: 10px; }\n\n.relation {\n stroke: #13540c;\n stroke-width: 1;\n fill: none; }\n\n#compositionStart {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#compositionEnd {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#aggregationStart {\n fill: #cde498;\n stroke: #13540c;\n stroke-width: 1; }\n\n#aggregationEnd {\n fill: #cde498;\n stroke: #13540c;\n stroke-width: 1; }\n\n#dependencyStart {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#dependencyEnd {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#extensionStart {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#extensionEnd {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n.commit-id,\n.commit-msg,\n.branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.pieTitleText {\n text-anchor: middle;\n font-size: 25px;\n fill: black;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.slice {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.stateGroup text {\n fill: #13540c;\n stroke: none;\n font-size: 10px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.stateGroup text {\n fill: #13540c;\n stroke: none;\n font-size: 10px; }\n\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: black; }\n\ng.stateGroup rect {\n fill: #cde498;\n stroke: #13540c; }\n\ng.stateGroup line {\n stroke: #13540c;\n stroke-width: 1; }\n\n.transition {\n stroke: #13540c;\n stroke-width: 1;\n fill: none; }\n\n.stateGroup .composit {\n fill: white;\n border-bottom: 1px; }\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px; }\n\n.state-note {\n stroke: #6eaa49;\n fill: #fff5ad; }\n .state-note text {\n fill: black;\n stroke: none;\n font-size: 10px; }\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #cde498;\n opacity: 0.5; }\n\n.stateLabel text {\n fill: black;\n font-size: 10px;\n font-weight: bold;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n:root {\n --mermaid-font-family: '\"trebuchet ms\", verdana, arial';\n --mermaid-font-family: \"Comic Sans MS\", \"Comic Sans\", cursive; }\n", ""]);
139
140
141
142/***/ }),
143
144/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/neutral/index.scss":
145/*!********************************************************************************************************************!*\
146 !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/neutral/index.scss ***!
147 \********************************************************************************************************************/
148/*! no static exports found */
149/***/ (function(module, exports, __webpack_require__) {
150
151exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false);
152// Module
153exports.push([module.i, "/* Flowchart variables */\n/* Sequence Diagram variables */\n/* Gantt chart variables */\n/* state colors */\n.label {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n color: #333; }\n\n.label text {\n fill: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon {\n fill: #eee;\n stroke: #999;\n stroke-width: 1px; }\n\n.node .label {\n text-align: center; }\n\n.node.clickable {\n cursor: pointer; }\n\n.arrowheadPath {\n fill: #333333; }\n\n.edgePath .path {\n stroke: #666;\n stroke-width: 1.5px; }\n\n.edgeLabel {\n background-color: white;\n text-align: center; }\n\n.cluster rect {\n fill: #eaf2fb;\n stroke: #26a;\n stroke-width: 1px; }\n\n.cluster text {\n fill: #333; }\n\ndiv.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: #eaf2fb;\n border: 1px solid #26a;\n border-radius: 2px;\n pointer-events: none;\n z-index: 100; }\n\n.actor {\n stroke: #999;\n fill: #eee; }\n\ntext.actor {\n fill: #333;\n stroke: none; }\n\n.actor-line {\n stroke: #666; }\n\n.messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: #333; }\n\n.messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: #333; }\n\n#arrowhead {\n fill: #333; }\n\n.sequenceNumber {\n fill: white; }\n\n#sequencenumber {\n fill: #333; }\n\n#crosshead path {\n fill: #333 !important;\n stroke: #333 !important; }\n\n.messageText {\n fill: #333;\n stroke: none; }\n\n.labelBox {\n stroke: #999;\n fill: #eee; }\n\n.labelText {\n fill: #333;\n stroke: none; }\n\n.loopText {\n fill: #333;\n stroke: none; }\n\n.loopLine {\n stroke-width: 2;\n stroke-dasharray: '2 2';\n stroke: #999; }\n\n.note {\n stroke: #777700;\n fill: #ffa; }\n\n.noteText {\n fill: black;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 14px; }\n\n.activation0 {\n fill: #f4f4f4;\n stroke: #666; }\n\n.activation1 {\n fill: #f4f4f4;\n stroke: #666; }\n\n.activation2 {\n fill: #f4f4f4;\n stroke: #666; }\n\n/** Section styling */\n.mermaid-main-font {\n font-family: \"trebuchet ms\", verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.section {\n stroke: none;\n opacity: 0.2; }\n\n.section0 {\n fill: #80b3e6; }\n\n.section2 {\n fill: #80b3e6; }\n\n.section1,\n.section3 {\n fill: white;\n opacity: 0.2; }\n\n.sectionTitle0 {\n fill: #333; }\n\n.sectionTitle1 {\n fill: #333; }\n\n.sectionTitle2 {\n fill: #333; }\n\n.sectionTitle3 {\n fill: #333; }\n\n.sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n/* Grid and axis */\n.grid .tick {\n stroke: #e6e6e6;\n opacity: 0.3;\n shape-rendering: crispEdges; }\n .grid .tick text {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.grid path {\n stroke-width: 0; }\n\n/* Today line */\n.today {\n fill: none;\n stroke: #d42;\n stroke-width: 2px; }\n\n/* Task styling */\n/* Default task */\n.task {\n stroke-width: 2; }\n\n.taskText {\n text-anchor: middle;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.taskText:not([font-size]) {\n font-size: 11px; }\n\n.taskTextOutsideRight {\n fill: #333;\n text-anchor: start;\n font-size: 11px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.taskTextOutsideLeft {\n fill: #333;\n text-anchor: end;\n font-size: 11px; }\n\n/* Special case clickable */\n.task.clickable {\n cursor: pointer; }\n\n.taskText.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n.taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n.taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n/* Specific task settings for the sections*/\n.taskText0,\n.taskText1,\n.taskText2,\n.taskText3 {\n fill: white; }\n\n.task0,\n.task1,\n.task2,\n.task3 {\n fill: #26a;\n stroke: #1a4d80; }\n\n.taskTextOutside0,\n.taskTextOutside2 {\n fill: #333; }\n\n.taskTextOutside1,\n.taskTextOutside3 {\n fill: #333; }\n\n/* Active task */\n.active0,\n.active1,\n.active2,\n.active3 {\n fill: #eee;\n stroke: #1a4d80; }\n\n.activeText0,\n.activeText1,\n.activeText2,\n.activeText3 {\n fill: #333 !important; }\n\n/* Completed task */\n.done0,\n.done1,\n.done2,\n.done3 {\n stroke: #666;\n fill: #bbb;\n stroke-width: 2; }\n\n.doneText0,\n.doneText1,\n.doneText2,\n.doneText3 {\n fill: #333 !important; }\n\n/* Tasks on the critical line */\n.crit0,\n.crit1,\n.crit2,\n.crit3 {\n stroke: #b1361b;\n fill: #d42;\n stroke-width: 2; }\n\n.activeCrit0,\n.activeCrit1,\n.activeCrit2,\n.activeCrit3 {\n stroke: #b1361b;\n fill: #eee;\n stroke-width: 2; }\n\n.doneCrit0,\n.doneCrit1,\n.doneCrit2,\n.doneCrit3 {\n stroke: #b1361b;\n fill: #bbb;\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges; }\n\n.milestone {\n transform: rotate(45deg) scale(0.8, 0.8); }\n\n.milestoneText {\n font-style: italic; }\n\n.doneCritText0,\n.doneCritText1,\n.doneCritText2,\n.doneCritText3 {\n fill: #333 !important; }\n\n.activeCritText0,\n.activeCritText1,\n.activeCritText2,\n.activeCritText3 {\n fill: #333 !important; }\n\n.titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: #333;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.classGroup text {\n fill: #999;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 10px; }\n g.classGroup text .title {\n font-weight: bolder; }\n\ng.classGroup rect {\n fill: #eee;\n stroke: #999; }\n\ng.classGroup line {\n stroke: #999;\n stroke-width: 1; }\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #eee;\n opacity: 0.5; }\n\n.classLabel .label {\n fill: #999;\n font-size: 10px; }\n\n.relation {\n stroke: #999;\n stroke-width: 1;\n fill: none; }\n\n#compositionStart {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#compositionEnd {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#aggregationStart {\n fill: #eee;\n stroke: #999;\n stroke-width: 1; }\n\n#aggregationEnd {\n fill: #eee;\n stroke: #999;\n stroke-width: 1; }\n\n#dependencyStart {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#dependencyEnd {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#extensionStart {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#extensionEnd {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n.commit-id,\n.commit-msg,\n.branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.pieTitleText {\n text-anchor: middle;\n font-size: 25px;\n fill: #333;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.slice {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.stateGroup text {\n fill: #999;\n stroke: none;\n font-size: 10px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.stateGroup text {\n fill: #999;\n stroke: none;\n font-size: 10px; }\n\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: black; }\n\ng.stateGroup rect {\n fill: #eee;\n stroke: #999; }\n\ng.stateGroup line {\n stroke: #999;\n stroke-width: 1; }\n\n.transition {\n stroke: #999;\n stroke-width: 1;\n fill: none; }\n\n.stateGroup .composit {\n fill: white;\n border-bottom: 1px; }\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px; }\n\n.state-note {\n stroke: #777700;\n fill: #ffa; }\n .state-note text {\n fill: black;\n stroke: none;\n font-size: 10px; }\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #eee;\n opacity: 0.5; }\n\n.stateLabel text {\n fill: black;\n font-size: 10px;\n font-weight: bold;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n:root {\n --mermaid-font-family: '\"trebuchet ms\", verdana, arial';\n --mermaid-font-family: \"Comic Sans MS\", \"Comic Sans\", cursive; }\n", ""]);
154
155
156
157/***/ }),
158
159/***/ "./node_modules/css-loader/dist/runtime/api.js":
160/*!*****************************************************!*\
161 !*** ./node_modules/css-loader/dist/runtime/api.js ***!
162 \*****************************************************/
163/*! no static exports found */
164/***/ (function(module, exports, __webpack_require__) {
165
166"use strict";
167
168
169/*
170 MIT License http://www.opensource.org/licenses/mit-license.php
171 Author Tobias Koppers @sokra
172*/
173// css base code, injected by the css-loader
174module.exports = function (useSourceMap) {
175 var list = []; // return the list of modules as css string
176
177 list.toString = function toString() {
178 return this.map(function (item) {
179 var content = cssWithMappingToString(item, useSourceMap);
180
181 if (item[2]) {
182 return '@media ' + item[2] + '{' + content + '}';
183 } else {
184 return content;
185 }
186 }).join('');
187 }; // import a list of modules into the list
188
189
190 list.i = function (modules, mediaQuery) {
191 if (typeof modules === 'string') {
192 modules = [[null, modules, '']];
193 }
194
195 var alreadyImportedModules = {};
196
197 for (var i = 0; i < this.length; i++) {
198 var id = this[i][0];
199
200 if (id != null) {
201 alreadyImportedModules[id] = true;
202 }
203 }
204
205 for (i = 0; i < modules.length; i++) {
206 var item = modules[i]; // skip already imported module
207 // this implementation is not 100% perfect for weird media query combinations
208 // when a module is imported multiple times with different media queries.
209 // I hope this will never occur (Hey this way we have smaller bundles)
210
211 if (item[0] == null || !alreadyImportedModules[item[0]]) {
212 if (mediaQuery && !item[2]) {
213 item[2] = mediaQuery;
214 } else if (mediaQuery) {
215 item[2] = '(' + item[2] + ') and (' + mediaQuery + ')';
216 }
217
218 list.push(item);
219 }
220 }
221 };
222
223 return list;
224};
225
226function cssWithMappingToString(item, useSourceMap) {
227 var content = item[1] || '';
228 var cssMapping = item[3];
229
230 if (!cssMapping) {
231 return content;
232 }
233
234 if (useSourceMap && typeof btoa === 'function') {
235 var sourceMapping = toComment(cssMapping);
236 var sourceURLs = cssMapping.sources.map(function (source) {
237 return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */';
238 });
239 return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
240 }
241
242 return [content].join('\n');
243} // Adapted from convert-source-map (MIT)
244
245
246function toComment(sourceMap) {
247 // eslint-disable-next-line no-undef
248 var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
249 var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
250 return '/*# ' + data + ' */';
251}
252
253/***/ }),
254
255/***/ "./node_modules/node-libs-browser/mock/empty.js":
256/*!******************************************************!*\
257 !*** ./node_modules/node-libs-browser/mock/empty.js ***!
258 \******************************************************/
259/*! no static exports found */
260/***/ (function(module, exports) {
261
262
263
264/***/ }),
265
266/***/ "./node_modules/path-browserify/index.js":
267/*!***********************************************!*\
268 !*** ./node_modules/path-browserify/index.js ***!
269 \***********************************************/
270/*! no static exports found */
271/***/ (function(module, exports, __webpack_require__) {
272
273/* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
274// backported and transplited with Babel, with backwards-compat fixes
275
276// Copyright Joyent, Inc. and other Node contributors.
277//
278// Permission is hereby granted, free of charge, to any person obtaining a
279// copy of this software and associated documentation files (the
280// "Software"), to deal in the Software without restriction, including
281// without limitation the rights to use, copy, modify, merge, publish,
282// distribute, sublicense, and/or sell copies of the Software, and to permit
283// persons to whom the Software is furnished to do so, subject to the
284// following conditions:
285//
286// The above copyright notice and this permission notice shall be included
287// in all copies or substantial portions of the Software.
288//
289// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
290// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
291// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
292// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
293// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
294// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
295// USE OR OTHER DEALINGS IN THE SOFTWARE.
296
297// resolves . and .. elements in a path array with directory names there
298// must be no slashes, empty elements, or device names (c:\) in the array
299// (so also no leading and trailing slashes - it does not distinguish
300// relative and absolute paths)
301function normalizeArray(parts, allowAboveRoot) {
302 // if the path tries to go above the root, `up` ends up > 0
303 var up = 0;
304 for (var i = parts.length - 1; i >= 0; i--) {
305 var last = parts[i];
306 if (last === '.') {
307 parts.splice(i, 1);
308 } else if (last === '..') {
309 parts.splice(i, 1);
310 up++;
311 } else if (up) {
312 parts.splice(i, 1);
313 up--;
314 }
315 }
316
317 // if the path is allowed to go above the root, restore leading ..s
318 if (allowAboveRoot) {
319 for (; up--; up) {
320 parts.unshift('..');
321 }
322 }
323
324 return parts;
325}
326
327// path.resolve([from ...], to)
328// posix version
329exports.resolve = function() {
330 var resolvedPath = '',
331 resolvedAbsolute = false;
332
333 for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
334 var path = (i >= 0) ? arguments[i] : process.cwd();
335
336 // Skip empty and invalid entries
337 if (typeof path !== 'string') {
338 throw new TypeError('Arguments to path.resolve must be strings');
339 } else if (!path) {
340 continue;
341 }
342
343 resolvedPath = path + '/' + resolvedPath;
344 resolvedAbsolute = path.charAt(0) === '/';
345 }
346
347 // At this point the path should be resolved to a full absolute path, but
348 // handle relative paths to be safe (might happen when process.cwd() fails)
349
350 // Normalize the path
351 resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
352 return !!p;
353 }), !resolvedAbsolute).join('/');
354
355 return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
356};
357
358// path.normalize(path)
359// posix version
360exports.normalize = function(path) {
361 var isAbsolute = exports.isAbsolute(path),
362 trailingSlash = substr(path, -1) === '/';
363
364 // Normalize the path
365 path = normalizeArray(filter(path.split('/'), function(p) {
366 return !!p;
367 }), !isAbsolute).join('/');
368
369 if (!path && !isAbsolute) {
370 path = '.';
371 }
372 if (path && trailingSlash) {
373 path += '/';
374 }
375
376 return (isAbsolute ? '/' : '') + path;
377};
378
379// posix version
380exports.isAbsolute = function(path) {
381 return path.charAt(0) === '/';
382};
383
384// posix version
385exports.join = function() {
386 var paths = Array.prototype.slice.call(arguments, 0);
387 return exports.normalize(filter(paths, function(p, index) {
388 if (typeof p !== 'string') {
389 throw new TypeError('Arguments to path.join must be strings');
390 }
391 return p;
392 }).join('/'));
393};
394
395
396// path.relative(from, to)
397// posix version
398exports.relative = function(from, to) {
399 from = exports.resolve(from).substr(1);
400 to = exports.resolve(to).substr(1);
401
402 function trim(arr) {
403 var start = 0;
404 for (; start < arr.length; start++) {
405 if (arr[start] !== '') break;
406 }
407
408 var end = arr.length - 1;
409 for (; end >= 0; end--) {
410 if (arr[end] !== '') break;
411 }
412
413 if (start > end) return [];
414 return arr.slice(start, end - start + 1);
415 }
416
417 var fromParts = trim(from.split('/'));
418 var toParts = trim(to.split('/'));
419
420 var length = Math.min(fromParts.length, toParts.length);
421 var samePartsLength = length;
422 for (var i = 0; i < length; i++) {
423 if (fromParts[i] !== toParts[i]) {
424 samePartsLength = i;
425 break;
426 }
427 }
428
429 var outputParts = [];
430 for (var i = samePartsLength; i < fromParts.length; i++) {
431 outputParts.push('..');
432 }
433
434 outputParts = outputParts.concat(toParts.slice(samePartsLength));
435
436 return outputParts.join('/');
437};
438
439exports.sep = '/';
440exports.delimiter = ':';
441
442exports.dirname = function (path) {
443 if (typeof path !== 'string') path = path + '';
444 if (path.length === 0) return '.';
445 var code = path.charCodeAt(0);
446 var hasRoot = code === 47 /*/*/;
447 var end = -1;
448 var matchedSlash = true;
449 for (var i = path.length - 1; i >= 1; --i) {
450 code = path.charCodeAt(i);
451 if (code === 47 /*/*/) {
452 if (!matchedSlash) {
453 end = i;
454 break;
455 }
456 } else {
457 // We saw the first non-path separator
458 matchedSlash = false;
459 }
460 }
461
462 if (end === -1) return hasRoot ? '/' : '.';
463 if (hasRoot && end === 1) {
464 // return '//';
465 // Backwards-compat fix:
466 return '/';
467 }
468 return path.slice(0, end);
469};
470
471function basename(path) {
472 if (typeof path !== 'string') path = path + '';
473
474 var start = 0;
475 var end = -1;
476 var matchedSlash = true;
477 var i;
478
479 for (i = path.length - 1; i >= 0; --i) {
480 if (path.charCodeAt(i) === 47 /*/*/) {
481 // If we reached a path separator that was not part of a set of path
482 // separators at the end of the string, stop now
483 if (!matchedSlash) {
484 start = i + 1;
485 break;
486 }
487 } else if (end === -1) {
488 // We saw the first non-path separator, mark this as the end of our
489 // path component
490 matchedSlash = false;
491 end = i + 1;
492 }
493 }
494
495 if (end === -1) return '';
496 return path.slice(start, end);
497}
498
499// Uses a mixed approach for backwards-compatibility, as ext behavior changed
500// in new Node.js versions, so only basename() above is backported here
501exports.basename = function (path, ext) {
502 var f = basename(path);
503 if (ext && f.substr(-1 * ext.length) === ext) {
504 f = f.substr(0, f.length - ext.length);
505 }
506 return f;
507};
508
509exports.extname = function (path) {
510 if (typeof path !== 'string') path = path + '';
511 var startDot = -1;
512 var startPart = 0;
513 var end = -1;
514 var matchedSlash = true;
515 // Track the state of characters (if any) we see before our first dot and
516 // after any path separator we find
517 var preDotState = 0;
518 for (var i = path.length - 1; i >= 0; --i) {
519 var code = path.charCodeAt(i);
520 if (code === 47 /*/*/) {
521 // If we reached a path separator that was not part of a set of path
522 // separators at the end of the string, stop now
523 if (!matchedSlash) {
524 startPart = i + 1;
525 break;
526 }
527 continue;
528 }
529 if (end === -1) {
530 // We saw the first non-path separator, mark this as the end of our
531 // extension
532 matchedSlash = false;
533 end = i + 1;
534 }
535 if (code === 46 /*.*/) {
536 // If this is our first dot, mark it as the start of our extension
537 if (startDot === -1)
538 startDot = i;
539 else if (preDotState !== 1)
540 preDotState = 1;
541 } else if (startDot !== -1) {
542 // We saw a non-dot and non-path separator before our dot, so we should
543 // have a good chance at having a non-empty extension
544 preDotState = -1;
545 }
546 }
547
548 if (startDot === -1 || end === -1 ||
549 // We saw a non-dot character immediately before the dot
550 preDotState === 0 ||
551 // The (right-most) trimmed path component is exactly '..'
552 preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
553 return '';
554 }
555 return path.slice(startDot, end);
556};
557
558function filter (xs, f) {
559 if (xs.filter) return xs.filter(f);
560 var res = [];
561 for (var i = 0; i < xs.length; i++) {
562 if (f(xs[i], i, xs)) res.push(xs[i]);
563 }
564 return res;
565}
566
567// String.prototype.substr - negative index don't work in IE8
568var substr = 'ab'.substr(-1) === 'b'
569 ? function (str, start, len) { return str.substr(start, len) }
570 : function (str, start, len) {
571 if (start < 0) start = str.length + start;
572 return str.substr(start, len);
573 }
574;
575
576/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js")))
577
578/***/ }),
579
580/***/ "./node_modules/process/browser.js":
581/*!*****************************************!*\
582 !*** ./node_modules/process/browser.js ***!
583 \*****************************************/
584/*! no static exports found */
585/***/ (function(module, exports) {
586
587// shim for using process in browser
588var process = module.exports = {};
589
590// cached from whatever global is present so that test runners that stub it
591// don't break things. But we need to wrap it in a try catch in case it is
592// wrapped in strict mode code which doesn't define any globals. It's inside a
593// function because try/catches deoptimize in certain engines.
594
595var cachedSetTimeout;
596var cachedClearTimeout;
597
598function defaultSetTimout() {
599 throw new Error('setTimeout has not been defined');
600}
601function defaultClearTimeout () {
602 throw new Error('clearTimeout has not been defined');
603}
604(function () {
605 try {
606 if (typeof setTimeout === 'function') {
607 cachedSetTimeout = setTimeout;
608 } else {
609 cachedSetTimeout = defaultSetTimout;
610 }
611 } catch (e) {
612 cachedSetTimeout = defaultSetTimout;
613 }
614 try {
615 if (typeof clearTimeout === 'function') {
616 cachedClearTimeout = clearTimeout;
617 } else {
618 cachedClearTimeout = defaultClearTimeout;
619 }
620 } catch (e) {
621 cachedClearTimeout = defaultClearTimeout;
622 }
623} ())
624function runTimeout(fun) {
625 if (cachedSetTimeout === setTimeout) {
626 //normal enviroments in sane situations
627 return setTimeout(fun, 0);
628 }
629 // if setTimeout wasn't available but was latter defined
630 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
631 cachedSetTimeout = setTimeout;
632 return setTimeout(fun, 0);
633 }
634 try {
635 // when when somebody has screwed with setTimeout but no I.E. maddness
636 return cachedSetTimeout(fun, 0);
637 } catch(e){
638 try {
639 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
640 return cachedSetTimeout.call(null, fun, 0);
641 } catch(e){
642 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
643 return cachedSetTimeout.call(this, fun, 0);
644 }
645 }
646
647
648}
649function runClearTimeout(marker) {
650 if (cachedClearTimeout === clearTimeout) {
651 //normal enviroments in sane situations
652 return clearTimeout(marker);
653 }
654 // if clearTimeout wasn't available but was latter defined
655 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
656 cachedClearTimeout = clearTimeout;
657 return clearTimeout(marker);
658 }
659 try {
660 // when when somebody has screwed with setTimeout but no I.E. maddness
661 return cachedClearTimeout(marker);
662 } catch (e){
663 try {
664 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
665 return cachedClearTimeout.call(null, marker);
666 } catch (e){
667 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
668 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
669 return cachedClearTimeout.call(this, marker);
670 }
671 }
672
673
674
675}
676var queue = [];
677var draining = false;
678var currentQueue;
679var queueIndex = -1;
680
681function cleanUpNextTick() {
682 if (!draining || !currentQueue) {
683 return;
684 }
685 draining = false;
686 if (currentQueue.length) {
687 queue = currentQueue.concat(queue);
688 } else {
689 queueIndex = -1;
690 }
691 if (queue.length) {
692 drainQueue();
693 }
694}
695
696function drainQueue() {
697 if (draining) {
698 return;
699 }
700 var timeout = runTimeout(cleanUpNextTick);
701 draining = true;
702
703 var len = queue.length;
704 while(len) {
705 currentQueue = queue;
706 queue = [];
707 while (++queueIndex < len) {
708 if (currentQueue) {
709 currentQueue[queueIndex].run();
710 }
711 }
712 queueIndex = -1;
713 len = queue.length;
714 }
715 currentQueue = null;
716 draining = false;
717 runClearTimeout(timeout);
718}
719
720process.nextTick = function (fun) {
721 var args = new Array(arguments.length - 1);
722 if (arguments.length > 1) {
723 for (var i = 1; i < arguments.length; i++) {
724 args[i - 1] = arguments[i];
725 }
726 }
727 queue.push(new Item(fun, args));
728 if (queue.length === 1 && !draining) {
729 runTimeout(drainQueue);
730 }
731};
732
733// v8 likes predictible objects
734function Item(fun, array) {
735 this.fun = fun;
736 this.array = array;
737}
738Item.prototype.run = function () {
739 this.fun.apply(null, this.array);
740};
741process.title = 'browser';
742process.browser = true;
743process.env = {};
744process.argv = [];
745process.version = ''; // empty string to avoid regexp issues
746process.versions = {};
747
748function noop() {}
749
750process.on = noop;
751process.addListener = noop;
752process.once = noop;
753process.off = noop;
754process.removeListener = noop;
755process.removeAllListeners = noop;
756process.emit = noop;
757process.prependListener = noop;
758process.prependOnceListener = noop;
759
760process.listeners = function (name) { return [] }
761
762process.binding = function (name) {
763 throw new Error('process.binding is not supported');
764};
765
766process.cwd = function () { return '/' };
767process.chdir = function (dir) {
768 throw new Error('process.chdir is not supported');
769};
770process.umask = function() { return 0; };
771
772
773/***/ }),
774
775/***/ "./node_modules/webpack/buildin/module.js":
776/*!***********************************!*\
777 !*** (webpack)/buildin/module.js ***!
778 \***********************************/
779/*! no static exports found */
780/***/ (function(module, exports) {
781
782module.exports = function(module) {
783 if (!module.webpackPolyfill) {
784 module.deprecate = function() {};
785 module.paths = [];
786 // module.parent = undefined by default
787 if (!module.children) module.children = [];
788 Object.defineProperty(module, "loaded", {
789 enumerable: true,
790 get: function() {
791 return module.l;
792 }
793 });
794 Object.defineProperty(module, "id", {
795 enumerable: true,
796 get: function() {
797 return module.i;
798 }
799 });
800 module.webpackPolyfill = 1;
801 }
802 return module;
803};
804
805
806/***/ }),
807
808/***/ "./package.json":
809/*!**********************!*\
810 !*** ./package.json ***!
811 \**********************/
812/*! exports provided: name, version, description, main, keywords, scripts, repository, author, license, standard, dependencies, devDependencies, files, yarn-upgrade-all, default */
813/***/ (function(module) {
814
815module.exports = JSON.parse("{\"name\":\"mermaid\",\"version\":\"8.4.4\",\"description\":\"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.\",\"main\":\"dist/mermaid.core.js\",\"keywords\":[\"diagram\",\"markdown\",\"flowchart\",\"sequence diagram\",\"gantt\",\"class diagram\",\"git graph\"],\"scripts\":{\"build\":\"webpack --progress --colors\",\"postbuild\":\"documentation build src/mermaidAPI.js --shallow -f md --markdown-toc false -o docs/mermaidAPI.md\",\"build:watch\":\"yarn build --watch\",\"minify\":\"minify ./dist/mermaid.js > ./dist/mermaid.min.js\",\"release\":\"yarn build -p --config webpack.config.prod.babel.js\",\"lint\":\"eslint src\",\"e2e:depr\":\"yarn lint && jest e2e --config e2e/jest.config.js\",\"cypress\":\"percy exec -- cypress run\",\"e2e\":\"start-server-and-test dev http://localhost:9000/ cypress\",\"e2e-upd\":\"yarn lint && jest e2e -u --config e2e/jest.config.js\",\"dev\":\"webpack-dev-server --config webpack.config.e2e.js\",\"test\":\"yarn lint && jest src/.*\",\"test:watch\":\"jest --watch src\",\"prepublishOnly\":\"yarn build && yarn release && yarn test && yarn e2e\",\"prepush\":\"yarn test\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/knsv/mermaid\"},\"author\":\"Knut Sveidqvist\",\"license\":\"MIT\",\"standard\":{\"ignore\":[\"**/parser/*.js\",\"dist/**/*.js\",\"cypress/**/*.js\"],\"globals\":[\"page\"]},\"dependencies\":{\"@braintree/sanitize-url\":\"^3.1.0\",\"crypto-random-string\":\"^3.0.1\",\"d3\":\"^5.7.0\",\"dagre\":\"^0.8.4\",\"dagre-d3\":\"^0.6.4\",\"graphlib\":\"^2.1.7\",\"he\":\"^1.2.0\",\"lodash\":\"^4.17.11\",\"minify\":\"^4.1.1\",\"moment-mini\":\"^2.22.1\",\"scope-css\":\"^1.2.1\"},\"devDependencies\":{\"@babel/core\":\"^7.2.2\",\"@babel/preset-env\":\"^7.2.0\",\"@babel/register\":\"^7.0.0\",\"@percy/cypress\":\"^2.0.1\",\"babel-core\":\"7.0.0-bridge.0\",\"babel-jest\":\"^24.9.0\",\"babel-loader\":\"^8.0.4\",\"coveralls\":\"^3.0.2\",\"css-loader\":\"^2.0.1\",\"css-to-string-loader\":\"^0.1.3\",\"cypress\":\"3.4.0\",\"documentation\":\"^12.0.1\",\"eslint\":\"^6.3.0\",\"eslint-config-prettier\":\"^6.3.0\",\"eslint-plugin-prettier\":\"^3.1.0\",\"husky\":\"^1.2.1\",\"identity-obj-proxy\":\"^3.0.0\",\"jest\":\"^24.9.0\",\"jison\":\"^0.4.18\",\"moment\":\"^2.23.0\",\"node-sass\":\"^4.12.0\",\"prettier\":\"^1.18.2\",\"puppeteer\":\"^1.17.0\",\"sass-loader\":\"^7.1.0\",\"start-server-and-test\":\"^1.10.6\",\"webpack\":\"^4.27.1\",\"webpack-cli\":\"^3.1.2\",\"webpack-dev-server\":\"^3.4.1\",\"webpack-node-externals\":\"^1.7.2\",\"yarn-upgrade-all\":\"^0.5.0\"},\"files\":[\"dist\"],\"yarn-upgrade-all\":{\"ignore\":[\"babel-core\"]}}");
816
817/***/ }),
818
819/***/ "./src/config.js":
820/*!***********************!*\
821 !*** ./src/config.js ***!
822 \***********************/
823/*! exports provided: setConfig, getConfig, default */
824/***/ (function(module, __webpack_exports__, __webpack_require__) {
825
826"use strict";
827__webpack_require__.r(__webpack_exports__);
828/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConfig", function() { return setConfig; });
829/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getConfig", function() { return getConfig; });
830function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
831
832var config = {};
833
834var setConf = function setConf(cnf) {
835 // Top level initially mermaid, gflow, sequenceDiagram and gantt
836 var lvl1Keys = Object.keys(cnf);
837
838 for (var i = 0; i < lvl1Keys.length; i++) {
839 if (_typeof(cnf[lvl1Keys[i]]) === 'object' && cnf[lvl1Keys[i]] != null) {
840 var lvl2Keys = Object.keys(cnf[lvl1Keys[i]]);
841
842 for (var j = 0; j < lvl2Keys.length; j++) {
843 // logger.debug('Setting conf ', lvl1Keys[i], '-', lvl2Keys[j])
844 if (typeof config[lvl1Keys[i]] === 'undefined') {
845 config[lvl1Keys[i]] = {};
846 } // logger.debug('Setting config: ' + lvl1Keys[i] + ' ' + lvl2Keys[j] + ' to ' + cnf[lvl1Keys[i]][lvl2Keys[j]])
847
848
849 config[lvl1Keys[i]][lvl2Keys[j]] = cnf[lvl1Keys[i]][lvl2Keys[j]];
850 }
851 } else {
852 config[lvl1Keys[i]] = cnf[lvl1Keys[i]];
853 }
854 }
855};
856
857var setConfig = function setConfig(conf) {
858 setConf(conf);
859};
860var getConfig = function getConfig() {
861 return config;
862};
863var configApi = {
864 setConfig: setConfig,
865 getConfig: getConfig // get conf() {
866 // return config;
867 // }
868
869};
870/* harmony default export */ __webpack_exports__["default"] = (configApi);
871
872/***/ }),
873
874/***/ "./src/diagrams/class/classDb.js":
875/*!***************************************!*\
876 !*** ./src/diagrams/class/classDb.js ***!
877 \***************************************/
878/*! exports provided: addClass, clear, getClass, getClasses, getRelations, addRelation, addAnnotation, addMember, addMembers, cleanupLabel, lineType, relationType, default */
879/***/ (function(module, __webpack_exports__, __webpack_require__) {
880
881"use strict";
882__webpack_require__.r(__webpack_exports__);
883/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addClass", function() { return addClass; });
884/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
885/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClass", function() { return getClass; });
886/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClasses", function() { return getClasses; });
887/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRelations", function() { return getRelations; });
888/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addRelation", function() { return addRelation; });
889/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addAnnotation", function() { return addAnnotation; });
890/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addMember", function() { return addMember; });
891/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addMembers", function() { return addMembers; });
892/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanupLabel", function() { return cleanupLabel; });
893/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lineType", function() { return lineType; });
894/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relationType", function() { return relationType; });
895/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
896
897var relations = [];
898var classes = {};
899/**
900 * Function called by parser when a node definition has been found.
901 * @param id
902 * @public
903 */
904
905var addClass = function addClass(id) {
906 // Only add class if not exists
907 if (typeof classes[id] !== 'undefined') return;
908 classes[id] = {
909 id: id,
910 methods: [],
911 members: [],
912 annotations: []
913 };
914};
915var clear = function clear() {
916 relations = [];
917 classes = {};
918};
919var getClass = function getClass(id) {
920 return classes[id];
921};
922var getClasses = function getClasses() {
923 return classes;
924};
925var getRelations = function getRelations() {
926 return relations;
927};
928var addRelation = function addRelation(relation) {
929 _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Adding relation: ' + JSON.stringify(relation));
930 addClass(relation.id1);
931 addClass(relation.id2);
932 relations.push(relation);
933};
934/**
935 * Adds an annotation to the specified class
936 * Annotations mark special properties of the given type (like 'interface' or 'service')
937 * @param className The class name
938 * @param annotation The name of the annotation without any brackets
939 * @public
940 */
941
942var addAnnotation = function addAnnotation(className, annotation) {
943 classes[className].annotations.push(annotation);
944};
945/**
946 * Adds a member to the specified class
947 * @param className The class name
948 * @param member The full name of the member.
949 * If the member is enclosed in <<brackets>> it is treated as an annotation
950 * If the member is ending with a closing bracket ) it is treated as a method
951 * Otherwise the member will be treated as a normal property
952 * @public
953 */
954
955var addMember = function addMember(className, member) {
956 var theClass = classes[className];
957
958 if (typeof member === 'string') {
959 // Member can contain white spaces, we trim them out
960 var memberString = member.trim();
961
962 if (memberString.startsWith('<<') && memberString.endsWith('>>')) {
963 // Remove leading and trailing brackets
964 theClass.annotations.push(memberString.substring(2, memberString.length - 2));
965 } else if (memberString.endsWith(')')) {
966 theClass.methods.push(memberString);
967 } else if (memberString) {
968 theClass.members.push(memberString);
969 }
970 }
971};
972var addMembers = function addMembers(className, members) {
973 if (Array.isArray(members)) {
974 members.reverse();
975 members.forEach(function (member) {
976 return addMember(className, member);
977 });
978 }
979};
980var cleanupLabel = function cleanupLabel(label) {
981 if (label.substring(0, 1) === ':') {
982 return label.substr(2).trim();
983 } else {
984 return label.trim();
985 }
986};
987var lineType = {
988 LINE: 0,
989 DOTTED_LINE: 1
990};
991var relationType = {
992 AGGREGATION: 0,
993 EXTENSION: 1,
994 COMPOSITION: 2,
995 DEPENDENCY: 3
996};
997/* harmony default export */ __webpack_exports__["default"] = ({
998 addClass: addClass,
999 clear: clear,
1000 getClass: getClass,
1001 getClasses: getClasses,
1002 addAnnotation: addAnnotation,
1003 getRelations: getRelations,
1004 addRelation: addRelation,
1005 addMember: addMember,
1006 addMembers: addMembers,
1007 cleanupLabel: cleanupLabel,
1008 lineType: lineType,
1009 relationType: relationType
1010});
1011
1012/***/ }),
1013
1014/***/ "./src/diagrams/class/classRenderer.js":
1015/*!*********************************************!*\
1016 !*** ./src/diagrams/class/classRenderer.js ***!
1017 \*********************************************/
1018/*! exports provided: setConf, draw, default */
1019/***/ (function(module, __webpack_exports__, __webpack_require__) {
1020
1021"use strict";
1022__webpack_require__.r(__webpack_exports__);
1023/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
1024/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
1025/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
1026/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
1027/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dagre */ "dagre");
1028/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dagre__WEBPACK_IMPORTED_MODULE_1__);
1029/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! graphlib */ "graphlib");
1030/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_2__);
1031/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
1032/* harmony import */ var _classDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./classDb */ "./src/diagrams/class/classDb.js");
1033/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
1034/* harmony import */ var _parser_classDiagram__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parser/classDiagram */ "./src/diagrams/class/parser/classDiagram.jison");
1035/* harmony import */ var _parser_classDiagram__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_parser_classDiagram__WEBPACK_IMPORTED_MODULE_6__);
1036
1037
1038
1039
1040
1041
1042
1043_parser_classDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].yy = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"];
1044var idCache = {};
1045var classCnt = 0;
1046var conf = {
1047 dividerMargin: 10,
1048 padding: 5,
1049 textHeight: 10
1050}; // Todo optimize
1051
1052var getGraphId = function getGraphId(label) {
1053 var keys = Object.keys(idCache);
1054
1055 for (var i = 0; i < keys.length; i++) {
1056 if (idCache[keys[i]].label === label) {
1057 return keys[i];
1058 }
1059 }
1060
1061 return undefined;
1062};
1063/**
1064 * Setup arrow head and define the marker. The result is appended to the svg.
1065 */
1066
1067
1068var insertMarkers = function insertMarkers(elem) {
1069 elem.append('defs').append('marker').attr('id', 'extensionStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 1,7 L18,13 V 1 Z');
1070 elem.append('defs').append('marker').attr('id', 'extensionEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead
1071
1072 elem.append('defs').append('marker').attr('id', 'compositionStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');
1073 elem.append('defs').append('marker').attr('id', 'compositionEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');
1074 elem.append('defs').append('marker').attr('id', 'aggregationStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');
1075 elem.append('defs').append('marker').attr('id', 'aggregationEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');
1076 elem.append('defs').append('marker').attr('id', 'dependencyStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z');
1077 elem.append('defs').append('marker').attr('id', 'dependencyEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z');
1078};
1079
1080var edgeCount = 0;
1081
1082var drawEdge = function drawEdge(elem, path, relation) {
1083 var getRelationType = function getRelationType(type) {
1084 switch (type) {
1085 case _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].relationType.AGGREGATION:
1086 return 'aggregation';
1087
1088 case _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].relationType.EXTENSION:
1089 return 'extension';
1090
1091 case _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].relationType.COMPOSITION:
1092 return 'composition';
1093
1094 case _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].relationType.DEPENDENCY:
1095 return 'dependency';
1096 }
1097 };
1098
1099 path.points = path.points.filter(function (p) {
1100 return !Number.isNaN(p.y);
1101 }); // The data for our line
1102
1103 var lineData = path.points; // This is the accessor function we talked about above
1104
1105 var lineFunction = d3__WEBPACK_IMPORTED_MODULE_0__["line"]().x(function (d) {
1106 return d.x;
1107 }).y(function (d) {
1108 return d.y;
1109 }).curve(d3__WEBPACK_IMPORTED_MODULE_0__["curveBasis"]);
1110 var svgPath = elem.append('path').attr('d', lineFunction(lineData)).attr('id', 'edge' + edgeCount).attr('class', 'relation');
1111 var url = '';
1112
1113 if (conf.arrowMarkerAbsolute) {
1114 url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;
1115 url = url.replace(/\(/g, '\\(');
1116 url = url.replace(/\)/g, '\\)');
1117 }
1118
1119 if (relation.relation.type1 !== 'none') {
1120 svgPath.attr('marker-start', 'url(' + url + '#' + getRelationType(relation.relation.type1) + 'Start' + ')');
1121 }
1122
1123 if (relation.relation.type2 !== 'none') {
1124 svgPath.attr('marker-end', 'url(' + url + '#' + getRelationType(relation.relation.type2) + 'End' + ')');
1125 }
1126
1127 var x, y;
1128 var l = path.points.length; // Calculate Label position
1129
1130 var labalPosition = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcLabelPosition(path.points);
1131 x = labalPosition.x;
1132 y = labalPosition.y;
1133 var p1_card_x, p1_card_y; // p1_card_padd_x = conf.padding * 2,
1134 // p1_card_padd_y = conf.padding;
1135
1136 var p2_card_x, p2_card_y; // p2_card_padd_x = conf.padding * 2,
1137 // p2_card_padd_y = -conf.padding / 2;
1138
1139 if (l % 2 !== 0 && l > 1) {
1140 var cardinality_1_point = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcCardinalityPosition(relation.relation.type1 !== 'none', path.points, path.points[0]);
1141 var cardinality_2_point = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcCardinalityPosition(relation.relation.type2 !== 'none', path.points, path.points[l - 1]);
1142 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('cardinality_1_point ' + JSON.stringify(cardinality_1_point));
1143 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('cardinality_2_point ' + JSON.stringify(cardinality_2_point));
1144 p1_card_x = cardinality_1_point.x;
1145 p1_card_y = cardinality_1_point.y;
1146 p2_card_x = cardinality_2_point.x;
1147 p2_card_y = cardinality_2_point.y;
1148 }
1149
1150 if (typeof relation.title !== 'undefined') {
1151 var g = elem.append('g').attr('class', 'classLabel');
1152 var label = g.append('text').attr('class', 'label').attr('x', x).attr('y', y).attr('fill', 'red').attr('text-anchor', 'middle').text(relation.title);
1153 window.label = label;
1154 var bounds = label.node().getBBox();
1155 g.insert('rect', ':first-child').attr('class', 'box').attr('x', bounds.x - conf.padding / 2).attr('y', bounds.y - conf.padding / 2).attr('width', bounds.width + conf.padding).attr('height', bounds.height + conf.padding);
1156 }
1157
1158 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Rendering relation ' + JSON.stringify(relation));
1159
1160 if (typeof relation.relationTitle1 !== 'undefined' && relation.relationTitle1 !== 'none') {
1161 var _g = elem.append('g').attr('class', 'cardinality');
1162
1163 _g.append('text').attr('class', 'type1').attr('x', p1_card_x).attr('y', p1_card_y).attr('fill', 'black').attr('font-size', '6').text(relation.relationTitle1);
1164 }
1165
1166 if (typeof relation.relationTitle2 !== 'undefined' && relation.relationTitle2 !== 'none') {
1167 var _g2 = elem.append('g').attr('class', 'cardinality');
1168
1169 _g2.append('text').attr('class', 'type2').attr('x', p2_card_x).attr('y', p2_card_y).attr('fill', 'black').attr('font-size', '6').text(relation.relationTitle2);
1170 }
1171
1172 edgeCount++;
1173};
1174
1175var drawClass = function drawClass(elem, classDef) {
1176 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Rendering class ' + classDef);
1177
1178 var addTspan = function addTspan(textEl, txt, isFirst) {
1179 var tSpan = textEl.append('tspan').attr('x', conf.padding).text(txt);
1180
1181 if (!isFirst) {
1182 tSpan.attr('dy', conf.textHeight);
1183 }
1184 };
1185
1186 var id = 'classId' + classCnt;
1187 var classInfo = {
1188 id: id,
1189 label: classDef.id,
1190 width: 0,
1191 height: 0
1192 }; // add class group
1193
1194 var g = elem.append('g').attr('id', id).attr('class', 'classGroup'); // add title
1195
1196 var title = g.append('text').attr('y', conf.textHeight + conf.padding).attr('x', 0); // add annotations
1197
1198 var isFirst = true;
1199 classDef.annotations.forEach(function (member) {
1200 var titleText2 = title.append('tspan').text('«' + member + '»');
1201 if (!isFirst) titleText2.attr('dy', conf.textHeight);
1202 isFirst = false;
1203 }); // add class title
1204
1205 var classTitle = title.append('tspan').text(classDef.id).attr('class', 'title'); // If class has annotations the title needs to have an offset of the text height
1206
1207 if (!isFirst) classTitle.attr('dy', conf.textHeight);
1208 var titleHeight = title.node().getBBox().height;
1209 var membersLine = g.append('line') // text label for the x axis
1210 .attr('x1', 0).attr('y1', conf.padding + titleHeight + conf.dividerMargin / 2).attr('y2', conf.padding + titleHeight + conf.dividerMargin / 2);
1211 var members = g.append('text') // text label for the x axis
1212 .attr('x', conf.padding).attr('y', titleHeight + conf.dividerMargin + conf.textHeight).attr('fill', 'white').attr('class', 'classText');
1213 isFirst = true;
1214 classDef.members.forEach(function (member) {
1215 addTspan(members, member, isFirst);
1216 isFirst = false;
1217 });
1218 var membersBox = members.node().getBBox();
1219 var methodsLine = g.append('line') // text label for the x axis
1220 .attr('x1', 0).attr('y1', conf.padding + titleHeight + conf.dividerMargin + membersBox.height).attr('y2', conf.padding + titleHeight + conf.dividerMargin + membersBox.height);
1221 var methods = g.append('text') // text label for the x axis
1222 .attr('x', conf.padding).attr('y', titleHeight + 2 * conf.dividerMargin + membersBox.height + conf.textHeight).attr('fill', 'white').attr('class', 'classText');
1223 isFirst = true;
1224 classDef.methods.forEach(function (method) {
1225 addTspan(methods, method, isFirst);
1226 isFirst = false;
1227 });
1228 var classBox = g.node().getBBox();
1229 var rect = g.insert('rect', ':first-child').attr('x', 0).attr('y', 0).attr('width', classBox.width + 2 * conf.padding).attr('height', classBox.height + conf.padding + 0.5 * conf.dividerMargin);
1230 var rectWidth = rect.node().getBBox().width; // Center title
1231 // We subtract the width of each text element from the class box width and divide it by 2
1232
1233 title.node().childNodes.forEach(function (x) {
1234 x.setAttribute('x', (rectWidth - x.getBBox().width) / 2);
1235 });
1236 membersLine.attr('x2', rectWidth);
1237 methodsLine.attr('x2', rectWidth);
1238 classInfo.width = rectWidth;
1239 classInfo.height = classBox.height + conf.padding + 0.5 * conf.dividerMargin;
1240 idCache[id] = classInfo;
1241 classCnt++;
1242 return classInfo;
1243};
1244
1245var setConf = function setConf(cnf) {
1246 var keys = Object.keys(cnf);
1247 keys.forEach(function (key) {
1248 conf[key] = cnf[key];
1249 });
1250};
1251/**
1252 * Draws a flowchart in the tag with id: id based on the graph definition in text.
1253 * @param text
1254 * @param id
1255 */
1256
1257var draw = function draw(text, id) {
1258 idCache = {};
1259 _parser_classDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].yy.clear();
1260 _parser_classDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].parse(text);
1261 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Rendering diagram ' + text); /// / Fetch the default direction, use TD if none was found
1262
1263 var diagram = d3__WEBPACK_IMPORTED_MODULE_0__["select"]("[id='".concat(id, "']"));
1264 insertMarkers(diagram); // Layout graph, Create a new directed graph
1265
1266 var g = new graphlib__WEBPACK_IMPORTED_MODULE_2___default.a.Graph({
1267 multigraph: true
1268 }); // Set an object for the graph label
1269
1270 g.setGraph({
1271 isMultiGraph: true
1272 }); // Default to assigning a new object as a label for each new edge.
1273
1274 g.setDefaultEdgeLabel(function () {
1275 return {};
1276 });
1277 var classes = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getClasses();
1278 var keys = Object.keys(classes);
1279
1280 for (var i = 0; i < keys.length; i++) {
1281 var classDef = classes[keys[i]];
1282 var node = drawClass(diagram, classDef); // Add nodes to the graph. The first argument is the node id. The second is
1283 // metadata about the node. In this case we're going to add labels to each of
1284 // our nodes.
1285
1286 g.setNode(node.id, node);
1287 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Org height: ' + node.height);
1288 }
1289
1290 var relations = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRelations();
1291 relations.forEach(function (relation) {
1292 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('tjoho' + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation));
1293 g.setEdge(getGraphId(relation.id1), getGraphId(relation.id2), {
1294 relation: relation
1295 });
1296 });
1297 dagre__WEBPACK_IMPORTED_MODULE_1___default.a.layout(g);
1298 g.nodes().forEach(function (v) {
1299 if (typeof v !== 'undefined' && typeof g.node(v) !== 'undefined') {
1300 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Node ' + v + ': ' + JSON.stringify(g.node(v)));
1301 d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#' + v).attr('transform', 'translate(' + (g.node(v).x - g.node(v).width / 2) + ',' + (g.node(v).y - g.node(v).height / 2) + ' )');
1302 }
1303 });
1304 g.edges().forEach(function (e) {
1305 if (typeof e !== 'undefined' && typeof g.edge(e) !== 'undefined') {
1306 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(g.edge(e)));
1307 drawEdge(diagram, g.edge(e), g.edge(e).relation);
1308 }
1309 });
1310 diagram.attr('height', '100%');
1311 diagram.attr('width', "".concat(g.graph().width * 1.5 + 20));
1312 diagram.attr('viewBox', '-10 -10 ' + (g.graph().width + 20) + ' ' + (g.graph().height + 20));
1313};
1314/* harmony default export */ __webpack_exports__["default"] = ({
1315 setConf: setConf,
1316 draw: draw
1317});
1318
1319/***/ }),
1320
1321/***/ "./src/diagrams/class/parser/classDiagram.jison":
1322/*!******************************************************!*\
1323 !*** ./src/diagrams/class/parser/classDiagram.jison ***!
1324 \******************************************************/
1325/*! no static exports found */
1326/***/ (function(module, exports, __webpack_require__) {
1327
1328/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
1329/*
1330 Returns a Parser object of the following structure:
1331
1332 Parser: {
1333 yy: {}
1334 }
1335
1336 Parser.prototype: {
1337 yy: {},
1338 trace: function(),
1339 symbols_: {associative list: name ==> number},
1340 terminals_: {associative list: number ==> name},
1341 productions_: [...],
1342 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
1343 table: [...],
1344 defaultActions: {...},
1345 parseError: function(str, hash),
1346 parse: function(input),
1347
1348 lexer: {
1349 EOF: 1,
1350 parseError: function(str, hash),
1351 setInput: function(input),
1352 input: function(),
1353 unput: function(str),
1354 more: function(),
1355 less: function(n),
1356 pastInput: function(),
1357 upcomingInput: function(),
1358 showPosition: function(),
1359 test_match: function(regex_match_array, rule_index),
1360 next: function(),
1361 lex: function(),
1362 begin: function(condition),
1363 popState: function(),
1364 _currentRules: function(),
1365 topState: function(),
1366 pushState: function(condition),
1367
1368 options: {
1369 ranges: boolean (optional: true ==> token location info will include a .range[] member)
1370 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
1371 backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
1372 },
1373
1374 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
1375 rules: [...],
1376 conditions: {associative list: name ==> set},
1377 }
1378 }
1379
1380
1381 token location info (@$, _$, etc.): {
1382 first_line: n,
1383 last_line: n,
1384 first_column: n,
1385 last_column: n,
1386 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
1387 }
1388
1389
1390 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
1391 text: (matched text)
1392 token: (the produced terminal token, if any)
1393 line: (yylineno)
1394 }
1395 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
1396 loc: (yylloc)
1397 expected: (string describing the set of expected tokens)
1398 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
1399 }
1400*/
1401var parser = (function(){
1402var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,12],$V1=[1,15],$V2=[1,13],$V3=[1,14],$V4=[1,17],$V5=[1,18],$V6=[1,19],$V7=[6,8],$V8=[1,28],$V9=[1,29],$Va=[1,30],$Vb=[1,31],$Vc=[1,32],$Vd=[1,33],$Ve=[6,8,13,18,26,29,30,31,32,33,34],$Vf=[6,8,13,18,22,26,29,30,31,32,33,34,48,49,50],$Vg=[26,48,49,50],$Vh=[26,33,34,48,49,50],$Vi=[26,29,30,31,32,48,49,50],$Vj=[6,8,13],$Vk=[1,50];
1403var parser = {trace: function trace () { },
1404yy: {},
1405symbols_: {"error":2,"mermaidDoc":3,"graphConfig":4,"CLASS_DIAGRAM":5,"NEWLINE":6,"statements":7,"EOF":8,"statement":9,"className":10,"alphaNumToken":11,"relationStatement":12,"LABEL":13,"classStatement":14,"methodStatement":15,"annotationStatement":16,"CLASS":17,"STRUCT_START":18,"members":19,"STRUCT_STOP":20,"ANNOTATION_START":21,"ANNOTATION_END":22,"MEMBER":23,"SEPARATOR":24,"relation":25,"STR":26,"relationType":27,"lineType":28,"AGGREGATION":29,"EXTENSION":30,"COMPOSITION":31,"DEPENDENCY":32,"LINE":33,"DOTTED_LINE":34,"commentToken":35,"textToken":36,"graphCodeTokens":37,"textNoTagsToken":38,"TAGSTART":39,"TAGEND":40,"==":41,"--":42,"PCT":43,"DEFAULT":44,"SPACE":45,"MINUS":46,"keywords":47,"UNICODE_TEXT":48,"NUM":49,"ALPHA":50,"$accept":0,"$end":1},
1406terminals_: {2:"error",5:"CLASS_DIAGRAM",6:"NEWLINE",8:"EOF",13:"LABEL",17:"CLASS",18:"STRUCT_START",20:"STRUCT_STOP",21:"ANNOTATION_START",22:"ANNOTATION_END",23:"MEMBER",24:"SEPARATOR",26:"STR",29:"AGGREGATION",30:"EXTENSION",31:"COMPOSITION",32:"DEPENDENCY",33:"LINE",34:"DOTTED_LINE",37:"graphCodeTokens",39:"TAGSTART",40:"TAGEND",41:"==",42:"--",43:"PCT",44:"DEFAULT",45:"SPACE",46:"MINUS",47:"keywords",48:"UNICODE_TEXT",49:"NUM",50:"ALPHA"},
1407productions_: [0,[3,1],[4,4],[7,1],[7,2],[7,3],[10,2],[10,1],[9,1],[9,2],[9,1],[9,1],[9,1],[14,2],[14,5],[16,4],[19,1],[19,2],[15,1],[15,2],[15,1],[15,1],[12,3],[12,4],[12,4],[12,5],[25,3],[25,2],[25,2],[25,1],[27,1],[27,1],[27,1],[27,1],[28,1],[28,1],[35,1],[35,1],[36,1],[36,1],[36,1],[36,1],[36,1],[36,1],[36,1],[38,1],[38,1],[38,1],[38,1],[11,1],[11,1],[11,1]],
1408performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
1409/* this == yyval */
1410
1411var $0 = $$.length - 1;
1412switch (yystate) {
1413case 6:
1414 this.$=$$[$0-1]+$$[$0];
1415break;
1416case 7:
1417 this.$=$$[$0];
1418break;
1419case 8:
1420 yy.addRelation($$[$0]);
1421break;
1422case 9:
1423 $$[$0-1].title = yy.cleanupLabel($$[$0]); yy.addRelation($$[$0-1]);
1424break;
1425case 13:
1426yy.addClass($$[$0]);
1427break;
1428case 14:
1429/*console.log($$[$0-3],JSON.stringify($$[$0-1]));*/yy.addClass($$[$0-3]);yy.addMembers($$[$0-3],$$[$0-1]);
1430break;
1431case 15:
1432 yy.addAnnotation($$[$0],$$[$0-2]);
1433break;
1434case 16:
1435 this.$ = [$$[$0]];
1436break;
1437case 17:
1438 $$[$0].push($$[$0-1]);this.$=$$[$0];
1439break;
1440case 18:
1441/*console.log('Rel found',$$[$0]);*/
1442break;
1443case 19:
1444yy.addMember($$[$0-1],yy.cleanupLabel($$[$0]));
1445break;
1446case 20:
1447/*console.warn('Member',$$[$0]);*/
1448break;
1449case 21:
1450/*console.log('sep found',$$[$0]);*/
1451break;
1452case 22:
1453 this.$ = {'id1':$$[$0-2],'id2':$$[$0], relation:$$[$0-1], relationTitle1:'none', relationTitle2:'none'};
1454break;
1455case 23:
1456 this.$ = {id1:$$[$0-3], id2:$$[$0], relation:$$[$0-1], relationTitle1:$$[$0-2], relationTitle2:'none'}
1457break;
1458case 24:
1459 this.$ = {id1:$$[$0-3], id2:$$[$0], relation:$$[$0-2], relationTitle1:'none', relationTitle2:$$[$0-1]};
1460break;
1461case 25:
1462 this.$ = {id1:$$[$0-4], id2:$$[$0], relation:$$[$0-2], relationTitle1:$$[$0-3], relationTitle2:$$[$0-1]}
1463break;
1464case 26:
1465 this.$={type1:$$[$0-2],type2:$$[$0],lineType:$$[$0-1]};
1466break;
1467case 27:
1468 this.$={type1:'none',type2:$$[$0],lineType:$$[$0-1]};
1469break;
1470case 28:
1471 this.$={type1:$$[$0-1],type2:'none',lineType:$$[$0]};
1472break;
1473case 29:
1474 this.$={type1:'none',type2:'none',lineType:$$[$0]};
1475break;
1476case 30:
1477 this.$=yy.relationType.AGGREGATION;
1478break;
1479case 31:
1480 this.$=yy.relationType.EXTENSION;
1481break;
1482case 32:
1483 this.$=yy.relationType.COMPOSITION;
1484break;
1485case 33:
1486 this.$=yy.relationType.DEPENDENCY;
1487break;
1488case 34:
1489this.$=yy.lineType.LINE;
1490break;
1491case 35:
1492this.$=yy.lineType.DOTTED_LINE;
1493break;
1494}
1495},
1496table: [{3:1,4:2,5:[1,3]},{1:[3]},{1:[2,1]},{6:[1,4]},{7:5,9:6,10:11,11:16,12:7,14:8,15:9,16:10,17:$V0,21:$V1,23:$V2,24:$V3,48:$V4,49:$V5,50:$V6},{8:[1,20]},{6:[1,21],8:[2,3]},o($V7,[2,8],{13:[1,22]}),o($V7,[2,10]),o($V7,[2,11]),o($V7,[2,12]),o($V7,[2,18],{25:23,27:26,28:27,13:[1,25],26:[1,24],29:$V8,30:$V9,31:$Va,32:$Vb,33:$Vc,34:$Vd}),{10:34,11:16,48:$V4,49:$V5,50:$V6},o($V7,[2,20]),o($V7,[2,21]),{11:35,48:$V4,49:$V5,50:$V6},o($Ve,[2,7],{11:16,10:36,48:$V4,49:$V5,50:$V6}),o($Vf,[2,49]),o($Vf,[2,50]),o($Vf,[2,51]),{1:[2,2]},{7:37,8:[2,4],9:6,10:11,11:16,12:7,14:8,15:9,16:10,17:$V0,21:$V1,23:$V2,24:$V3,48:$V4,49:$V5,50:$V6},o($V7,[2,9]),{10:38,11:16,26:[1,39],48:$V4,49:$V5,50:$V6},{25:40,27:26,28:27,29:$V8,30:$V9,31:$Va,32:$Vb,33:$Vc,34:$Vd},o($V7,[2,19]),{28:41,33:$Vc,34:$Vd},o($Vg,[2,29],{27:42,29:$V8,30:$V9,31:$Va,32:$Vb}),o($Vh,[2,30]),o($Vh,[2,31]),o($Vh,[2,32]),o($Vh,[2,33]),o($Vi,[2,34]),o($Vi,[2,35]),o($V7,[2,13],{18:[1,43]}),{22:[1,44]},o($Ve,[2,6]),{8:[2,5]},o($Vj,[2,22]),{10:45,11:16,48:$V4,49:$V5,50:$V6},{10:46,11:16,26:[1,47],48:$V4,49:$V5,50:$V6},o($Vg,[2,28],{27:48,29:$V8,30:$V9,31:$Va,32:$Vb}),o($Vg,[2,27]),{19:49,23:$Vk},{10:51,11:16,48:$V4,49:$V5,50:$V6},o($Vj,[2,24]),o($Vj,[2,23]),{10:52,11:16,48:$V4,49:$V5,50:$V6},o($Vg,[2,26]),{20:[1,53]},{19:54,20:[2,16],23:$Vk},o($V7,[2,15]),o($Vj,[2,25]),o($V7,[2,14]),{20:[2,17]}],
1497defaultActions: {2:[2,1],20:[2,2],37:[2,5],54:[2,17]},
1498parseError: function parseError (str, hash) {
1499 if (hash.recoverable) {
1500 this.trace(str);
1501 } else {
1502 var error = new Error(str);
1503 error.hash = hash;
1504 throw error;
1505 }
1506},
1507parse: function parse(input) {
1508 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
1509 var args = lstack.slice.call(arguments, 1);
1510 var lexer = Object.create(this.lexer);
1511 var sharedState = { yy: {} };
1512 for (var k in this.yy) {
1513 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
1514 sharedState.yy[k] = this.yy[k];
1515 }
1516 }
1517 lexer.setInput(input, sharedState.yy);
1518 sharedState.yy.lexer = lexer;
1519 sharedState.yy.parser = this;
1520 if (typeof lexer.yylloc == 'undefined') {
1521 lexer.yylloc = {};
1522 }
1523 var yyloc = lexer.yylloc;
1524 lstack.push(yyloc);
1525 var ranges = lexer.options && lexer.options.ranges;
1526 if (typeof sharedState.yy.parseError === 'function') {
1527 this.parseError = sharedState.yy.parseError;
1528 } else {
1529 this.parseError = Object.getPrototypeOf(this).parseError;
1530 }
1531 function popStack(n) {
1532 stack.length = stack.length - 2 * n;
1533 vstack.length = vstack.length - n;
1534 lstack.length = lstack.length - n;
1535 }
1536 function lex() {
1537 var token;
1538 token = tstack.pop() || lexer.lex() || EOF;
1539 if (typeof token !== 'number') {
1540 if (token instanceof Array) {
1541 tstack = token;
1542 token = tstack.pop();
1543 }
1544 token = self.symbols_[token] || token;
1545 }
1546 return token;
1547 }
1548 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
1549 while (true) {
1550 state = stack[stack.length - 1];
1551 if (this.defaultActions[state]) {
1552 action = this.defaultActions[state];
1553 } else {
1554 if (symbol === null || typeof symbol == 'undefined') {
1555 symbol = lex();
1556 }
1557 action = table[state] && table[state][symbol];
1558 }
1559 if (typeof action === 'undefined' || !action.length || !action[0]) {
1560 var errStr = '';
1561 expected = [];
1562 for (p in table[state]) {
1563 if (this.terminals_[p] && p > TERROR) {
1564 expected.push('\'' + this.terminals_[p] + '\'');
1565 }
1566 }
1567 if (lexer.showPosition) {
1568 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
1569 } else {
1570 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
1571 }
1572 this.parseError(errStr, {
1573 text: lexer.match,
1574 token: this.terminals_[symbol] || symbol,
1575 line: lexer.yylineno,
1576 loc: yyloc,
1577 expected: expected
1578 });
1579 }
1580 if (action[0] instanceof Array && action.length > 1) {
1581 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
1582 }
1583 switch (action[0]) {
1584 case 1:
1585 stack.push(symbol);
1586 vstack.push(lexer.yytext);
1587 lstack.push(lexer.yylloc);
1588 stack.push(action[1]);
1589 symbol = null;
1590 if (!preErrorSymbol) {
1591 yyleng = lexer.yyleng;
1592 yytext = lexer.yytext;
1593 yylineno = lexer.yylineno;
1594 yyloc = lexer.yylloc;
1595 if (recovering > 0) {
1596 recovering--;
1597 }
1598 } else {
1599 symbol = preErrorSymbol;
1600 preErrorSymbol = null;
1601 }
1602 break;
1603 case 2:
1604 len = this.productions_[action[1]][1];
1605 yyval.$ = vstack[vstack.length - len];
1606 yyval._$ = {
1607 first_line: lstack[lstack.length - (len || 1)].first_line,
1608 last_line: lstack[lstack.length - 1].last_line,
1609 first_column: lstack[lstack.length - (len || 1)].first_column,
1610 last_column: lstack[lstack.length - 1].last_column
1611 };
1612 if (ranges) {
1613 yyval._$.range = [
1614 lstack[lstack.length - (len || 1)].range[0],
1615 lstack[lstack.length - 1].range[1]
1616 ];
1617 }
1618 r = this.performAction.apply(yyval, [
1619 yytext,
1620 yyleng,
1621 yylineno,
1622 sharedState.yy,
1623 action[1],
1624 vstack,
1625 lstack
1626 ].concat(args));
1627 if (typeof r !== 'undefined') {
1628 return r;
1629 }
1630 if (len) {
1631 stack = stack.slice(0, -1 * len * 2);
1632 vstack = vstack.slice(0, -1 * len);
1633 lstack = lstack.slice(0, -1 * len);
1634 }
1635 stack.push(this.productions_[action[1]][0]);
1636 vstack.push(yyval.$);
1637 lstack.push(yyval._$);
1638 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
1639 stack.push(newState);
1640 break;
1641 case 3:
1642 return true;
1643 }
1644 }
1645 return true;
1646}};
1647
1648/* generated by jison-lex 0.3.4 */
1649var lexer = (function(){
1650var lexer = ({
1651
1652EOF:1,
1653
1654parseError:function parseError(str, hash) {
1655 if (this.yy.parser) {
1656 this.yy.parser.parseError(str, hash);
1657 } else {
1658 throw new Error(str);
1659 }
1660 },
1661
1662// resets the lexer, sets new input
1663setInput:function (input, yy) {
1664 this.yy = yy || this.yy || {};
1665 this._input = input;
1666 this._more = this._backtrack = this.done = false;
1667 this.yylineno = this.yyleng = 0;
1668 this.yytext = this.matched = this.match = '';
1669 this.conditionStack = ['INITIAL'];
1670 this.yylloc = {
1671 first_line: 1,
1672 first_column: 0,
1673 last_line: 1,
1674 last_column: 0
1675 };
1676 if (this.options.ranges) {
1677 this.yylloc.range = [0,0];
1678 }
1679 this.offset = 0;
1680 return this;
1681 },
1682
1683// consumes and returns one char from the input
1684input:function () {
1685 var ch = this._input[0];
1686 this.yytext += ch;
1687 this.yyleng++;
1688 this.offset++;
1689 this.match += ch;
1690 this.matched += ch;
1691 var lines = ch.match(/(?:\r\n?|\n).*/g);
1692 if (lines) {
1693 this.yylineno++;
1694 this.yylloc.last_line++;
1695 } else {
1696 this.yylloc.last_column++;
1697 }
1698 if (this.options.ranges) {
1699 this.yylloc.range[1]++;
1700 }
1701
1702 this._input = this._input.slice(1);
1703 return ch;
1704 },
1705
1706// unshifts one char (or a string) into the input
1707unput:function (ch) {
1708 var len = ch.length;
1709 var lines = ch.split(/(?:\r\n?|\n)/g);
1710
1711 this._input = ch + this._input;
1712 this.yytext = this.yytext.substr(0, this.yytext.length - len);
1713 //this.yyleng -= len;
1714 this.offset -= len;
1715 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
1716 this.match = this.match.substr(0, this.match.length - 1);
1717 this.matched = this.matched.substr(0, this.matched.length - 1);
1718
1719 if (lines.length - 1) {
1720 this.yylineno -= lines.length - 1;
1721 }
1722 var r = this.yylloc.range;
1723
1724 this.yylloc = {
1725 first_line: this.yylloc.first_line,
1726 last_line: this.yylineno + 1,
1727 first_column: this.yylloc.first_column,
1728 last_column: lines ?
1729 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
1730 + oldLines[oldLines.length - lines.length].length - lines[0].length :
1731 this.yylloc.first_column - len
1732 };
1733
1734 if (this.options.ranges) {
1735 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
1736 }
1737 this.yyleng = this.yytext.length;
1738 return this;
1739 },
1740
1741// When called from action, caches matched text and appends it on next action
1742more:function () {
1743 this._more = true;
1744 return this;
1745 },
1746
1747// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
1748reject:function () {
1749 if (this.options.backtrack_lexer) {
1750 this._backtrack = true;
1751 } else {
1752 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
1753 text: "",
1754 token: null,
1755 line: this.yylineno
1756 });
1757
1758 }
1759 return this;
1760 },
1761
1762// retain first n characters of the match
1763less:function (n) {
1764 this.unput(this.match.slice(n));
1765 },
1766
1767// displays already matched input, i.e. for error messages
1768pastInput:function () {
1769 var past = this.matched.substr(0, this.matched.length - this.match.length);
1770 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
1771 },
1772
1773// displays upcoming input, i.e. for error messages
1774upcomingInput:function () {
1775 var next = this.match;
1776 if (next.length < 20) {
1777 next += this._input.substr(0, 20-next.length);
1778 }
1779 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
1780 },
1781
1782// displays the character position where the lexing error occurred, i.e. for error messages
1783showPosition:function () {
1784 var pre = this.pastInput();
1785 var c = new Array(pre.length + 1).join("-");
1786 return pre + this.upcomingInput() + "\n" + c + "^";
1787 },
1788
1789// test the lexed token: return FALSE when not a match, otherwise return token
1790test_match:function(match, indexed_rule) {
1791 var token,
1792 lines,
1793 backup;
1794
1795 if (this.options.backtrack_lexer) {
1796 // save context
1797 backup = {
1798 yylineno: this.yylineno,
1799 yylloc: {
1800 first_line: this.yylloc.first_line,
1801 last_line: this.last_line,
1802 first_column: this.yylloc.first_column,
1803 last_column: this.yylloc.last_column
1804 },
1805 yytext: this.yytext,
1806 match: this.match,
1807 matches: this.matches,
1808 matched: this.matched,
1809 yyleng: this.yyleng,
1810 offset: this.offset,
1811 _more: this._more,
1812 _input: this._input,
1813 yy: this.yy,
1814 conditionStack: this.conditionStack.slice(0),
1815 done: this.done
1816 };
1817 if (this.options.ranges) {
1818 backup.yylloc.range = this.yylloc.range.slice(0);
1819 }
1820 }
1821
1822 lines = match[0].match(/(?:\r\n?|\n).*/g);
1823 if (lines) {
1824 this.yylineno += lines.length;
1825 }
1826 this.yylloc = {
1827 first_line: this.yylloc.last_line,
1828 last_line: this.yylineno + 1,
1829 first_column: this.yylloc.last_column,
1830 last_column: lines ?
1831 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
1832 this.yylloc.last_column + match[0].length
1833 };
1834 this.yytext += match[0];
1835 this.match += match[0];
1836 this.matches = match;
1837 this.yyleng = this.yytext.length;
1838 if (this.options.ranges) {
1839 this.yylloc.range = [this.offset, this.offset += this.yyleng];
1840 }
1841 this._more = false;
1842 this._backtrack = false;
1843 this._input = this._input.slice(match[0].length);
1844 this.matched += match[0];
1845 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
1846 if (this.done && this._input) {
1847 this.done = false;
1848 }
1849 if (token) {
1850 return token;
1851 } else if (this._backtrack) {
1852 // recover context
1853 for (var k in backup) {
1854 this[k] = backup[k];
1855 }
1856 return false; // rule action called reject() implying the next rule should be tested instead.
1857 }
1858 return false;
1859 },
1860
1861// return next match in input
1862next:function () {
1863 if (this.done) {
1864 return this.EOF;
1865 }
1866 if (!this._input) {
1867 this.done = true;
1868 }
1869
1870 var token,
1871 match,
1872 tempMatch,
1873 index;
1874 if (!this._more) {
1875 this.yytext = '';
1876 this.match = '';
1877 }
1878 var rules = this._currentRules();
1879 for (var i = 0; i < rules.length; i++) {
1880 tempMatch = this._input.match(this.rules[rules[i]]);
1881 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
1882 match = tempMatch;
1883 index = i;
1884 if (this.options.backtrack_lexer) {
1885 token = this.test_match(tempMatch, rules[i]);
1886 if (token !== false) {
1887 return token;
1888 } else if (this._backtrack) {
1889 match = false;
1890 continue; // rule action called reject() implying a rule MISmatch.
1891 } else {
1892 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
1893 return false;
1894 }
1895 } else if (!this.options.flex) {
1896 break;
1897 }
1898 }
1899 }
1900 if (match) {
1901 token = this.test_match(match, rules[index]);
1902 if (token !== false) {
1903 return token;
1904 }
1905 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
1906 return false;
1907 }
1908 if (this._input === "") {
1909 return this.EOF;
1910 } else {
1911 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
1912 text: "",
1913 token: null,
1914 line: this.yylineno
1915 });
1916 }
1917 },
1918
1919// return next match that has a token
1920lex:function lex () {
1921 var r = this.next();
1922 if (r) {
1923 return r;
1924 } else {
1925 return this.lex();
1926 }
1927 },
1928
1929// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
1930begin:function begin (condition) {
1931 this.conditionStack.push(condition);
1932 },
1933
1934// pop the previously active lexer condition state off the condition stack
1935popState:function popState () {
1936 var n = this.conditionStack.length - 1;
1937 if (n > 0) {
1938 return this.conditionStack.pop();
1939 } else {
1940 return this.conditionStack[0];
1941 }
1942 },
1943
1944// produce the lexer rule set which is active for the currently active lexer condition state
1945_currentRules:function _currentRules () {
1946 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
1947 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
1948 } else {
1949 return this.conditions["INITIAL"].rules;
1950 }
1951 },
1952
1953// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
1954topState:function topState (n) {
1955 n = this.conditionStack.length - 1 - Math.abs(n || 0);
1956 if (n >= 0) {
1957 return this.conditionStack[n];
1958 } else {
1959 return "INITIAL";
1960 }
1961 },
1962
1963// alias for begin(condition)
1964pushState:function pushState (condition) {
1965 this.begin(condition);
1966 },
1967
1968// return the number of states currently on the stack
1969stateStackSize:function stateStackSize() {
1970 return this.conditionStack.length;
1971 },
1972options: {},
1973performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
1974var YYSTATE=YY_START;
1975switch($avoiding_name_collisions) {
1976case 0:/* do nothing */
1977break;
1978case 1:return 6;
1979break;
1980case 2:/* skip whitespace */
1981break;
1982case 3:return 5;
1983break;
1984case 4: this.begin("struct"); /*console.log('Starting struct');*/return 18;
1985break;
1986case 5: /*console.log('Ending struct');*/this.popState(); return 20;
1987break;
1988case 6:/* nothing */
1989break;
1990case 7: /*console.log('lex-member: ' + yy_.yytext);*/ return "MEMBER";
1991break;
1992case 8:return 17;
1993break;
1994case 9:return 21;
1995break;
1996case 10:return 22;
1997break;
1998case 11:this.begin("string");
1999break;
2000case 12:this.popState();
2001break;
2002case 13:return "STR";
2003break;
2004case 14:return 30;
2005break;
2006case 15:return 30;
2007break;
2008case 16:return 32;
2009break;
2010case 17:return 32;
2011break;
2012case 18:return 31;
2013break;
2014case 19:return 29;
2015break;
2016case 20:return 33;
2017break;
2018case 21:return 34;
2019break;
2020case 22:return 13;
2021break;
2022case 23:return 46;
2023break;
2024case 24:return 'DOT';
2025break;
2026case 25:return 'PLUS';
2027break;
2028case 26:return 43;
2029break;
2030case 27:return 'EQUALS';
2031break;
2032case 28:return 'EQUALS';
2033break;
2034case 29:return 50;
2035break;
2036case 30:return 'PUNCTUATION';
2037break;
2038case 31:return 49;
2039break;
2040case 32:return 48;
2041break;
2042case 33:return 45;
2043break;
2044case 34:return 8;
2045break;
2046}
2047},
2048rules: [/^(?:%%[^\n]*\n*)/,/^(?:\n+)/,/^(?:\s+)/,/^(?:classDiagram\b)/,/^(?:[\{])/,/^(?:\})/,/^(?:[\n])/,/^(?:[^\{\}\n]*)/,/^(?:class\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:--)/,/^(?:\.\.)/,/^(?::[^\n;]+)/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:[!"#$%&'*+,-.`?\\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:$)/],
2049conditions: {"string":{"rules":[12,13],"inclusive":false},"struct":{"rules":[5,6,7],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,8,9,10,11,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"inclusive":true}}
2050});
2051return lexer;
2052})();
2053parser.lexer = lexer;
2054function Parser () {
2055 this.yy = {};
2056}
2057Parser.prototype = parser;parser.Parser = Parser;
2058return new Parser;
2059})();
2060
2061
2062if (true) {
2063exports.parser = parser;
2064exports.Parser = parser.Parser;
2065exports.parse = function () { return parser.parse.apply(parser, arguments); };
2066exports.main = function commonjsMain (args) {
2067 if (!args[1]) {
2068 console.log('Usage: '+args[0]+' FILE');
2069 process.exit(1);
2070 }
2071 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
2072 return exports.parser.parse(source);
2073};
2074if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
2075 exports.main(process.argv.slice(1));
2076}
2077}
2078/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
2079
2080/***/ }),
2081
2082/***/ "./src/diagrams/flowchart/flowChartShapes.js":
2083/*!***************************************************!*\
2084 !*** ./src/diagrams/flowchart/flowChartShapes.js ***!
2085 \***************************************************/
2086/*! exports provided: addToRender, default */
2087/***/ (function(module, __webpack_exports__, __webpack_require__) {
2088
2089"use strict";
2090__webpack_require__.r(__webpack_exports__);
2091/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addToRender", function() { return addToRender; });
2092/* harmony import */ var dagre_d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dagre-d3 */ "dagre-d3");
2093/* harmony import */ var dagre_d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dagre_d3__WEBPACK_IMPORTED_MODULE_0__);
2094
2095
2096function question(parent, bbox, node) {
2097 var w = bbox.width;
2098 var h = bbox.height;
2099 var s = (w + h) * 0.9;
2100 var points = [{
2101 x: s / 2,
2102 y: 0
2103 }, {
2104 x: s,
2105 y: -s / 2
2106 }, {
2107 x: s / 2,
2108 y: -s
2109 }, {
2110 x: 0,
2111 y: -s / 2
2112 }];
2113 var shapeSvg = insertPolygonShape(parent, s, s, points);
2114
2115 node.intersect = function (point) {
2116 return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point);
2117 };
2118
2119 return shapeSvg;
2120}
2121
2122function hexagon(parent, bbox, node) {
2123 var f = 4;
2124 var h = bbox.height;
2125 var m = h / f;
2126 var w = bbox.width + 2 * m;
2127 var points = [{
2128 x: m,
2129 y: 0
2130 }, {
2131 x: w - m,
2132 y: 0
2133 }, {
2134 x: w,
2135 y: -h / 2
2136 }, {
2137 x: w - m,
2138 y: -h
2139 }, {
2140 x: m,
2141 y: -h
2142 }, {
2143 x: 0,
2144 y: -h / 2
2145 }];
2146 var shapeSvg = insertPolygonShape(parent, w, h, points);
2147
2148 node.intersect = function (point) {
2149 return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point);
2150 };
2151
2152 return shapeSvg;
2153}
2154
2155function rect_left_inv_arrow(parent, bbox, node) {
2156 var w = bbox.width;
2157 var h = bbox.height;
2158 var points = [{
2159 x: -h / 2,
2160 y: 0
2161 }, {
2162 x: w,
2163 y: 0
2164 }, {
2165 x: w,
2166 y: -h
2167 }, {
2168 x: -h / 2,
2169 y: -h
2170 }, {
2171 x: 0,
2172 y: -h / 2
2173 }];
2174 var shapeSvg = insertPolygonShape(parent, w, h, points);
2175
2176 node.intersect = function (point) {
2177 return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point);
2178 };
2179
2180 return shapeSvg;
2181}
2182
2183function lean_right(parent, bbox, node) {
2184 var w = bbox.width;
2185 var h = bbox.height;
2186 var points = [{
2187 x: -2 * h / 6,
2188 y: 0
2189 }, {
2190 x: w - h / 6,
2191 y: 0
2192 }, {
2193 x: w + 2 * h / 6,
2194 y: -h
2195 }, {
2196 x: h / 6,
2197 y: -h
2198 }];
2199 var shapeSvg = insertPolygonShape(parent, w, h, points);
2200
2201 node.intersect = function (point) {
2202 return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point);
2203 };
2204
2205 return shapeSvg;
2206}
2207
2208function lean_left(parent, bbox, node) {
2209 var w = bbox.width;
2210 var h = bbox.height;
2211 var points = [{
2212 x: 2 * h / 6,
2213 y: 0
2214 }, {
2215 x: w + h / 6,
2216 y: 0
2217 }, {
2218 x: w - 2 * h / 6,
2219 y: -h
2220 }, {
2221 x: -h / 6,
2222 y: -h
2223 }];
2224 var shapeSvg = insertPolygonShape(parent, w, h, points);
2225
2226 node.intersect = function (point) {
2227 return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point);
2228 };
2229
2230 return shapeSvg;
2231}
2232
2233function trapezoid(parent, bbox, node) {
2234 var w = bbox.width;
2235 var h = bbox.height;
2236 var points = [{
2237 x: -2 * h / 6,
2238 y: 0
2239 }, {
2240 x: w + 2 * h / 6,
2241 y: 0
2242 }, {
2243 x: w - h / 6,
2244 y: -h
2245 }, {
2246 x: h / 6,
2247 y: -h
2248 }];
2249 var shapeSvg = insertPolygonShape(parent, w, h, points);
2250
2251 node.intersect = function (point) {
2252 return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point);
2253 };
2254
2255 return shapeSvg;
2256}
2257
2258function inv_trapezoid(parent, bbox, node) {
2259 var w = bbox.width;
2260 var h = bbox.height;
2261 var points = [{
2262 x: h / 6,
2263 y: 0
2264 }, {
2265 x: w - h / 6,
2266 y: 0
2267 }, {
2268 x: w + 2 * h / 6,
2269 y: -h
2270 }, {
2271 x: -2 * h / 6,
2272 y: -h
2273 }];
2274 var shapeSvg = insertPolygonShape(parent, w, h, points);
2275
2276 node.intersect = function (point) {
2277 return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point);
2278 };
2279
2280 return shapeSvg;
2281}
2282
2283function rect_right_inv_arrow(parent, bbox, node) {
2284 var w = bbox.width;
2285 var h = bbox.height;
2286 var points = [{
2287 x: 0,
2288 y: 0
2289 }, {
2290 x: w + h / 2,
2291 y: 0
2292 }, {
2293 x: w,
2294 y: -h / 2
2295 }, {
2296 x: w + h / 2,
2297 y: -h
2298 }, {
2299 x: 0,
2300 y: -h
2301 }];
2302 var shapeSvg = insertPolygonShape(parent, w, h, points);
2303
2304 node.intersect = function (point) {
2305 return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point);
2306 };
2307
2308 return shapeSvg;
2309}
2310
2311function addToRender(render) {
2312 render.shapes().question = question;
2313 render.shapes().hexagon = hexagon; // Add custom shape for box with inverted arrow on left side
2314
2315 render.shapes().rect_left_inv_arrow = rect_left_inv_arrow; // Add custom shape for box with inverted arrow on left side
2316
2317 render.shapes().lean_right = lean_right; // Add custom shape for box with inverted arrow on left side
2318
2319 render.shapes().lean_left = lean_left; // Add custom shape for box with inverted arrow on left side
2320
2321 render.shapes().trapezoid = trapezoid; // Add custom shape for box with inverted arrow on left side
2322
2323 render.shapes().inv_trapezoid = inv_trapezoid; // Add custom shape for box with inverted arrow on right side
2324
2325 render.shapes().rect_right_inv_arrow = rect_right_inv_arrow;
2326}
2327
2328function insertPolygonShape(parent, w, h, points) {
2329 return parent.insert('polygon', ':first-child').attr('points', points.map(function (d) {
2330 return d.x + ',' + d.y;
2331 }).join(' ')).attr('transform', 'translate(' + -w / 2 + ',' + h / 2 + ')');
2332}
2333
2334/* harmony default export */ __webpack_exports__["default"] = ({
2335 addToRender: addToRender
2336});
2337
2338/***/ }),
2339
2340/***/ "./src/diagrams/flowchart/flowDb.js":
2341/*!******************************************!*\
2342 !*** ./src/diagrams/flowchart/flowDb.js ***!
2343 \******************************************/
2344/*! exports provided: addVertex, addLink, updateLinkInterpolate, updateLink, addClass, setDirection, setClass, setLink, getTooltip, setClickEvent, bindFunctions, getDirection, getVertices, getEdges, getClasses, clear, defaultStyle, addSubGraph, getDepthFirstPos, indexNodes, getSubGraphs, firstGraph, default */
2345/***/ (function(module, __webpack_exports__, __webpack_require__) {
2346
2347"use strict";
2348__webpack_require__.r(__webpack_exports__);
2349/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addVertex", function() { return addVertex; });
2350/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addLink", function() { return addLink; });
2351/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateLinkInterpolate", function() { return updateLinkInterpolate; });
2352/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateLink", function() { return updateLink; });
2353/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addClass", function() { return addClass; });
2354/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDirection", function() { return setDirection; });
2355/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setClass", function() { return setClass; });
2356/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLink", function() { return setLink; });
2357/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTooltip", function() { return getTooltip; });
2358/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setClickEvent", function() { return setClickEvent; });
2359/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindFunctions", function() { return bindFunctions; });
2360/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDirection", function() { return getDirection; });
2361/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVertices", function() { return getVertices; });
2362/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEdges", function() { return getEdges; });
2363/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClasses", function() { return getClasses; });
2364/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
2365/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultStyle", function() { return defaultStyle; });
2366/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSubGraph", function() { return addSubGraph; });
2367/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDepthFirstPos", function() { return getDepthFirstPos; });
2368/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "indexNodes", function() { return indexNodes; });
2369/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSubGraphs", function() { return getSubGraphs; });
2370/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstGraph", function() { return firstGraph; });
2371/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
2372/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
2373/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @braintree/sanitize-url */ "@braintree/sanitize-url");
2374/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__);
2375/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
2376/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
2377/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../config */ "./src/config.js");
2378function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2379
2380
2381
2382
2383
2384 // const MERMAID_DOM_ID_PREFIX = 'mermaid-dom-id-';
2385
2386var MERMAID_DOM_ID_PREFIX = '';
2387var config = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])();
2388var vertices = {};
2389var edges = [];
2390var classes = [];
2391var subGraphs = [];
2392var subGraphLookup = {};
2393var tooltips = {};
2394var subCount = 0;
2395var firstGraphFlag = true;
2396var direction; // Functions to be run after graph rendering
2397
2398var funs = [];
2399
2400var sanitize = function sanitize(text) {
2401 var txt = text;
2402 var htmlLabels = true;
2403 if (config.flowchart && (config.flowchart.htmlLabels === false || config.flowchart.htmlLabels === 'false')) htmlLabels = false;
2404
2405 if (config.securityLevel !== 'loose' && htmlLabels) {
2406 // eslint-disable-line
2407 txt = txt.replace(/<br>/g, '#br#');
2408 txt = txt.replace(/<br\S*?\/>/g, '#br#');
2409 txt = txt.replace(/</g, '&lt;').replace(/>/g, '&gt;');
2410 txt = txt.replace(/=/g, '&equals;');
2411 txt = txt.replace(/#br#/g, '<br/>');
2412 }
2413
2414 return txt;
2415};
2416/**
2417 * Function called by parser when a node definition has been found
2418 * @param id
2419 * @param text
2420 * @param type
2421 * @param style
2422 * @param classes
2423 */
2424
2425
2426var addVertex = function addVertex(_id, text, type, style, classes) {
2427 var txt;
2428 var id = _id;
2429
2430 if (typeof id === 'undefined') {
2431 return;
2432 }
2433
2434 if (id.trim().length === 0) {
2435 return;
2436 }
2437
2438 if (id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id;
2439
2440 if (typeof vertices[id] === 'undefined') {
2441 vertices[id] = {
2442 id: id,
2443 styles: [],
2444 classes: []
2445 };
2446 }
2447
2448 if (typeof text !== 'undefined') {
2449 txt = sanitize(text.trim()); // strip quotes if string starts and exnds with a quote
2450
2451 if (txt[0] === '"' && txt[txt.length - 1] === '"') {
2452 txt = txt.substring(1, txt.length - 1);
2453 }
2454
2455 vertices[id].text = txt;
2456 } else {
2457 if (!vertices[id].text) {
2458 vertices[id].text = _id;
2459 }
2460 }
2461
2462 if (typeof type !== 'undefined') {
2463 vertices[id].type = type;
2464 }
2465
2466 if (typeof style !== 'undefined') {
2467 if (style !== null) {
2468 style.forEach(function (s) {
2469 vertices[id].styles.push(s);
2470 });
2471 }
2472 }
2473
2474 if (typeof classes !== 'undefined') {
2475 if (classes !== null) {
2476 classes.forEach(function (s) {
2477 vertices[id].classes.push(s);
2478 });
2479 }
2480 }
2481};
2482/**
2483 * Function called by parser when a link/edge definition has been found
2484 * @param start
2485 * @param end
2486 * @param type
2487 * @param linktext
2488 */
2489
2490var addLink = function addLink(_start, _end, type, linktext) {
2491 var start = _start;
2492 var end = _end;
2493 if (start[0].match(/\d/)) start = MERMAID_DOM_ID_PREFIX + start;
2494 if (end[0].match(/\d/)) end = MERMAID_DOM_ID_PREFIX + end;
2495 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].info('Got edge...', start, end);
2496 var edge = {
2497 start: start,
2498 end: end,
2499 type: undefined,
2500 text: ''
2501 };
2502 linktext = type.text;
2503
2504 if (typeof linktext !== 'undefined') {
2505 edge.text = sanitize(linktext.trim()); // strip quotes if string starts and exnds with a quote
2506
2507 if (edge.text[0] === '"' && edge.text[edge.text.length - 1] === '"') {
2508 edge.text = edge.text.substring(1, edge.text.length - 1);
2509 }
2510 }
2511
2512 if (typeof type !== 'undefined') {
2513 edge.type = type.type;
2514 edge.stroke = type.stroke;
2515 }
2516
2517 edges.push(edge);
2518};
2519/**
2520 * Updates a link's line interpolation algorithm
2521 * @param pos
2522 * @param interpolate
2523 */
2524
2525var updateLinkInterpolate = function updateLinkInterpolate(positions, interp) {
2526 positions.forEach(function (pos) {
2527 if (pos === 'default') {
2528 edges.defaultInterpolate = interp;
2529 } else {
2530 edges[pos].interpolate = interp;
2531 }
2532 });
2533};
2534/**
2535 * Updates a link with a style
2536 * @param pos
2537 * @param style
2538 */
2539
2540var updateLink = function updateLink(positions, style) {
2541 positions.forEach(function (pos) {
2542 if (pos === 'default') {
2543 edges.defaultStyle = style;
2544 } else {
2545 if (_utils__WEBPACK_IMPORTED_MODULE_3__["default"].isSubstringInArray('fill', style) === -1) {
2546 style.push('fill:none');
2547 }
2548
2549 edges[pos].style = style;
2550 }
2551 });
2552};
2553var addClass = function addClass(id, style) {
2554 if (typeof classes[id] === 'undefined') {
2555 classes[id] = {
2556 id: id,
2557 styles: []
2558 };
2559 }
2560
2561 if (typeof style !== 'undefined') {
2562 if (style !== null) {
2563 style.forEach(function (s) {
2564 classes[id].styles.push(s);
2565 });
2566 }
2567 }
2568};
2569/**
2570 * Called by parser when a graph definition is found, stores the direction of the chart.
2571 * @param dir
2572 */
2573
2574var setDirection = function setDirection(dir) {
2575 direction = dir;
2576
2577 if (direction.match(/.*</)) {
2578 direction = 'RL';
2579 }
2580
2581 if (direction.match(/.*\^/)) {
2582 direction = 'BT';
2583 }
2584
2585 if (direction.match(/.*>/)) {
2586 direction = 'LR';
2587 }
2588
2589 if (direction.match(/.*v/)) {
2590 direction = 'TB';
2591 }
2592};
2593/**
2594 * Called by parser when a special node is found, e.g. a clickable element.
2595 * @param ids Comma separated list of ids
2596 * @param className Class to add
2597 */
2598
2599var setClass = function setClass(ids, className) {
2600 ids.split(',').forEach(function (_id) {
2601 var id = _id;
2602 if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id;
2603
2604 if (typeof vertices[id] !== 'undefined') {
2605 vertices[id].classes.push(className);
2606 }
2607
2608 if (typeof subGraphLookup[id] !== 'undefined') {
2609 subGraphLookup[id].classes.push(className);
2610 }
2611 });
2612};
2613
2614var setTooltip = function setTooltip(ids, tooltip) {
2615 ids.split(',').forEach(function (id) {
2616 if (typeof tooltip !== 'undefined') {
2617 tooltips[id] = sanitize(tooltip);
2618 }
2619 });
2620};
2621
2622var setClickFun = function setClickFun(_id, functionName) {
2623 var id = _id;
2624 if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id;
2625
2626 if (config.securityLevel !== 'loose') {
2627 return;
2628 }
2629
2630 if (typeof functionName === 'undefined') {
2631 return;
2632 }
2633
2634 if (typeof vertices[id] !== 'undefined') {
2635 funs.push(function () {
2636 var elem = document.querySelector("[id=\"".concat(id, "\"]"));
2637
2638 if (elem !== null) {
2639 elem.addEventListener('click', function () {
2640 window[functionName](id);
2641 }, false);
2642 }
2643 });
2644 }
2645};
2646/**
2647 * Called by parser when a link is found. Adds the URL to the vertex data.
2648 * @param ids Comma separated list of ids
2649 * @param linkStr URL to create a link for
2650 * @param tooltip Tooltip for the clickable element
2651 */
2652
2653
2654var setLink = function setLink(ids, linkStr, tooltip) {
2655 ids.split(',').forEach(function (_id) {
2656 var id = _id;
2657 if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id;
2658
2659 if (typeof vertices[id] !== 'undefined') {
2660 if (config.securityLevel !== 'loose') {
2661 vertices[id].link = Object(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__["sanitizeUrl"])(linkStr); // .replace(/javascript:.*/g, '')
2662 } else {
2663 vertices[id].link = linkStr;
2664 }
2665 }
2666 });
2667 setTooltip(ids, tooltip);
2668 setClass(ids, 'clickable');
2669};
2670var getTooltip = function getTooltip(id) {
2671 return tooltips[id];
2672};
2673/**
2674 * Called by parser when a click definition is found. Registers an event handler.
2675 * @param ids Comma separated list of ids
2676 * @param functionName Function to be called on click
2677 * @param tooltip Tooltip for the clickable element
2678 */
2679
2680var setClickEvent = function setClickEvent(ids, functionName, tooltip) {
2681 ids.split(',').forEach(function (id) {
2682 setClickFun(id, functionName);
2683 });
2684 setTooltip(ids, tooltip);
2685 setClass(ids, 'clickable');
2686};
2687var bindFunctions = function bindFunctions(element) {
2688 funs.forEach(function (fun) {
2689 fun(element);
2690 });
2691};
2692var getDirection = function getDirection() {
2693 return direction.trim();
2694};
2695/**
2696 * Retrieval function for fetching the found nodes after parsing has completed.
2697 * @returns {{}|*|vertices}
2698 */
2699
2700var getVertices = function getVertices() {
2701 return vertices;
2702};
2703/**
2704 * Retrieval function for fetching the found links after parsing has completed.
2705 * @returns {{}|*|edges}
2706 */
2707
2708var getEdges = function getEdges() {
2709 return edges;
2710};
2711/**
2712 * Retrieval function for fetching the found class definitions after parsing has completed.
2713 * @returns {{}|*|classes}
2714 */
2715
2716var getClasses = function getClasses() {
2717 return classes;
2718};
2719
2720var setupToolTips = function setupToolTips(element) {
2721 var tooltipElem = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('.mermaidTooltip');
2722
2723 if ((tooltipElem._groups || tooltipElem)[0][0] === null) {
2724 tooltipElem = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('body').append('div').attr('class', 'mermaidTooltip').style('opacity', 0);
2725 }
2726
2727 var svg = d3__WEBPACK_IMPORTED_MODULE_0__["select"](element).select('svg');
2728 var nodes = svg.selectAll('g.node');
2729 nodes.on('mouseover', function () {
2730 var el = d3__WEBPACK_IMPORTED_MODULE_0__["select"](this);
2731 var title = el.attr('title'); // Dont try to draw a tooltip if no data is provided
2732
2733 if (title === null) {
2734 return;
2735 }
2736
2737 var rect = this.getBoundingClientRect();
2738 tooltipElem.transition().duration(200).style('opacity', '.9');
2739 tooltipElem.html(el.attr('title')).style('left', rect.left + (rect.right - rect.left) / 2 + 'px').style('top', rect.top - 14 + document.body.scrollTop + 'px');
2740 el.classed('hover', true);
2741 }).on('mouseout', function () {
2742 tooltipElem.transition().duration(500).style('opacity', 0);
2743 var el = d3__WEBPACK_IMPORTED_MODULE_0__["select"](this);
2744 el.classed('hover', false);
2745 });
2746};
2747
2748funs.push(setupToolTips);
2749/**
2750 * Clears the internal graph db so that a new graph can be parsed.
2751 */
2752
2753var clear = function clear() {
2754 vertices = {};
2755 classes = {};
2756 edges = [];
2757 funs = [];
2758 funs.push(setupToolTips);
2759 subGraphs = [];
2760 subGraphLookup = {};
2761 subCount = 0;
2762 tooltips = [];
2763 firstGraphFlag = true;
2764};
2765/**
2766 *
2767 * @returns {string}
2768 */
2769
2770var defaultStyle = function defaultStyle() {
2771 return 'fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;';
2772};
2773/**
2774 * Clears the internal graph db so that a new graph can be parsed.
2775 */
2776
2777var addSubGraph = function addSubGraph(_id, list, _title) {
2778 var id = _id;
2779 var title = _title;
2780
2781 if (_id === _title && _title.match(/\s/)) {
2782 id = undefined;
2783 }
2784
2785 function uniq(a) {
2786 var prims = {
2787 boolean: {},
2788 number: {},
2789 string: {}
2790 };
2791 var objs = [];
2792 return a.filter(function (item) {
2793 var type = _typeof(item);
2794
2795 if (item.trim() === '') {
2796 return false;
2797 }
2798
2799 if (type in prims) {
2800 return prims[type].hasOwnProperty(item) ? false : prims[type][item] = true; // eslint-disable-line
2801 } else {
2802 return objs.indexOf(item) >= 0 ? false : objs.push(item);
2803 }
2804 });
2805 }
2806
2807 var nodeList = [];
2808 nodeList = uniq(nodeList.concat.apply(nodeList, list));
2809
2810 for (var i = 0; i < nodeList.length; i++) {
2811 if (nodeList[i][0].match(/\d/)) nodeList[i] = MERMAID_DOM_ID_PREFIX + nodeList[i];
2812 }
2813
2814 id = id || 'subGraph' + subCount;
2815 if (id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id;
2816 title = title || '';
2817 title = sanitize(title);
2818 subCount = subCount + 1;
2819 var subGraph = {
2820 id: id,
2821 nodes: nodeList,
2822 title: title.trim(),
2823 classes: []
2824 };
2825 subGraphs.push(subGraph);
2826 subGraphLookup[id] = subGraph;
2827 return id;
2828};
2829
2830var getPosForId = function getPosForId(id) {
2831 for (var i = 0; i < subGraphs.length; i++) {
2832 if (subGraphs[i].id === id) {
2833 return i;
2834 }
2835 }
2836
2837 return -1;
2838};
2839
2840var secCount = -1;
2841var posCrossRef = [];
2842
2843var indexNodes2 = function indexNodes2(id, pos) {
2844 var nodes = subGraphs[pos].nodes;
2845 secCount = secCount + 1;
2846
2847 if (secCount > 2000) {
2848 return;
2849 }
2850
2851 posCrossRef[secCount] = pos; // Check if match
2852
2853 if (subGraphs[pos].id === id) {
2854 return {
2855 result: true,
2856 count: 0
2857 };
2858 }
2859
2860 var count = 0;
2861 var posCount = 1;
2862
2863 while (count < nodes.length) {
2864 var childPos = getPosForId(nodes[count]); // Ignore regular nodes (pos will be -1)
2865
2866 if (childPos >= 0) {
2867 var res = indexNodes2(id, childPos);
2868
2869 if (res.result) {
2870 return {
2871 result: true,
2872 count: posCount + res.count
2873 };
2874 } else {
2875 posCount = posCount + res.count;
2876 }
2877 }
2878
2879 count = count + 1;
2880 }
2881
2882 return {
2883 result: false,
2884 count: posCount
2885 };
2886};
2887
2888var getDepthFirstPos = function getDepthFirstPos(pos) {
2889 return posCrossRef[pos];
2890};
2891var indexNodes = function indexNodes() {
2892 secCount = -1;
2893
2894 if (subGraphs.length > 0) {
2895 indexNodes2('none', subGraphs.length - 1, 0);
2896 }
2897};
2898var getSubGraphs = function getSubGraphs() {
2899 return subGraphs;
2900};
2901var firstGraph = function firstGraph() {
2902 if (firstGraphFlag) {
2903 firstGraphFlag = false;
2904 return true;
2905 }
2906
2907 return false;
2908};
2909/* harmony default export */ __webpack_exports__["default"] = ({
2910 addVertex: addVertex,
2911 addLink: addLink,
2912 updateLinkInterpolate: updateLinkInterpolate,
2913 updateLink: updateLink,
2914 addClass: addClass,
2915 setDirection: setDirection,
2916 setClass: setClass,
2917 getTooltip: getTooltip,
2918 setClickEvent: setClickEvent,
2919 setLink: setLink,
2920 bindFunctions: bindFunctions,
2921 getDirection: getDirection,
2922 getVertices: getVertices,
2923 getEdges: getEdges,
2924 getClasses: getClasses,
2925 clear: clear,
2926 defaultStyle: defaultStyle,
2927 addSubGraph: addSubGraph,
2928 getDepthFirstPos: getDepthFirstPos,
2929 indexNodes: indexNodes,
2930 getSubGraphs: getSubGraphs,
2931 lex: {
2932 firstGraph: firstGraph
2933 }
2934});
2935
2936/***/ }),
2937
2938/***/ "./src/diagrams/flowchart/flowRenderer.js":
2939/*!************************************************!*\
2940 !*** ./src/diagrams/flowchart/flowRenderer.js ***!
2941 \************************************************/
2942/*! exports provided: setConf, addVertices, addEdges, getClasses, draw, default */
2943/***/ (function(module, __webpack_exports__, __webpack_require__) {
2944
2945"use strict";
2946__webpack_require__.r(__webpack_exports__);
2947/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
2948/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addVertices", function() { return addVertices; });
2949/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addEdges", function() { return addEdges; });
2950/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClasses", function() { return getClasses; });
2951/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
2952/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! graphlib */ "graphlib");
2953/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_0__);
2954/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3 */ "d3");
2955/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_1__);
2956/* harmony import */ var _flowDb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./flowDb */ "./src/diagrams/flowchart/flowDb.js");
2957/* harmony import */ var _parser_flow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/flow */ "./src/diagrams/flowchart/parser/flow.jison");
2958/* harmony import */ var _parser_flow__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_flow__WEBPACK_IMPORTED_MODULE_3__);
2959/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../config */ "./src/config.js");
2960/* harmony import */ var dagre_d3__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! dagre-d3 */ "dagre-d3");
2961/* harmony import */ var dagre_d3__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(dagre_d3__WEBPACK_IMPORTED_MODULE_5__);
2962/* harmony import */ var dagre_d3_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! dagre-d3/lib/label/add-html-label.js */ "dagre-d3/lib/label/add-html-label.js");
2963/* harmony import */ var dagre_d3_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(dagre_d3_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6__);
2964/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
2965/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
2966/* harmony import */ var _flowChartShapes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./flowChartShapes */ "./src/diagrams/flowchart/flowChartShapes.js");
2967
2968
2969
2970
2971
2972var newDagreD3 = true;
2973 // const newDagreD3 = false;
2974
2975
2976
2977
2978
2979var conf = {};
2980var setConf = function setConf(cnf) {
2981 var keys = Object.keys(cnf);
2982
2983 for (var i = 0; i < keys.length; i++) {
2984 conf[keys[i]] = cnf[keys[i]];
2985 }
2986};
2987/**
2988 * Function that adds the vertices found in the graph definition to the graph to be rendered.
2989 * @param vert Object containing the vertices.
2990 * @param g The graph that is to be drawn.
2991 */
2992
2993var addVertices = function addVertices(vert, g, svgId) {
2994 var svg = d3__WEBPACK_IMPORTED_MODULE_1__["select"]("[id=\"".concat(svgId, "\"]"));
2995 var keys = Object.keys(vert);
2996
2997 var styleFromStyleArr = function styleFromStyleArr(styleStr, arr, _ref) {
2998 var label = _ref.label;
2999
3000 if (!label) {
3001 // Create a compound style definition from the style definitions found for the node in the graph definition
3002 for (var i = 0; i < arr.length; i++) {
3003 if (typeof arr[i] !== 'undefined') {
3004 styleStr = styleStr + arr[i] + ';';
3005 }
3006 }
3007 } else {
3008 // create the style definition for the text, if property is a text-property
3009 for (var _i = 0; _i < arr.length; _i++) {
3010 if (typeof arr[_i] !== 'undefined') {
3011 if (arr[_i].match('^color:|^text-align:')) styleStr = styleStr + arr[_i] + ';';
3012 }
3013 }
3014 }
3015
3016 return styleStr;
3017 }; // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition
3018
3019
3020 keys.forEach(function (id) {
3021 var vertex = vert[id];
3022 /**
3023 * Variable for storing the classes for the vertex
3024 * @type {string}
3025 */
3026
3027 var classStr = '';
3028
3029 if (vertex.classes.length > 0) {
3030 classStr = vertex.classes.join(' ');
3031 }
3032 /**
3033 * Variable for storing the extracted style for the vertex
3034 * @type {string}
3035 */
3036
3037
3038 var style = ''; // Create a compound style definition from the style definitions found for the node in the graph definition
3039
3040 style = styleFromStyleArr(style, vertex.styles, {
3041 label: false
3042 });
3043 var labelStyle = '';
3044 labelStyle = styleFromStyleArr(labelStyle, vertex.styles, {
3045 label: true
3046 }); // Use vertex id as text in the box if no text is provided by the graph definition
3047
3048 var vertexText = vertex.text !== undefined ? vertex.text : vertex.id; // We create a SVG label, either by delegating to addHtmlLabel or manually
3049
3050 var vertexNode;
3051
3052 if (Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels) {
3053 // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that?
3054 var node = {
3055 label: vertexText.replace(/fa[lrsb]?:fa-[\w-]+/g, function (s) {
3056 return "<i class='".concat(s.replace(':', ' '), "'></i>");
3057 })
3058 };
3059 vertexNode = dagre_d3_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6___default()(svg, node).node();
3060 vertexNode.parentNode.removeChild(vertexNode);
3061 } else {
3062 var svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text');
3063 var rows = vertexText.split(/<br[/]{0,1}>/);
3064
3065 for (var j = 0; j < rows.length; j++) {
3066 var tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');
3067 tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
3068 tspan.setAttribute('dy', '1em');
3069 tspan.setAttribute('x', '1');
3070 tspan.textContent = rows[j];
3071 svgLabel.appendChild(tspan);
3072 }
3073
3074 vertexNode = svgLabel;
3075 } // If the node has a link, we wrap it in a SVG link
3076
3077
3078 if (vertex.link) {
3079 var link = document.createElementNS('http://www.w3.org/2000/svg', 'a');
3080 link.setAttributeNS('http://www.w3.org/2000/svg', 'href', vertex.link);
3081 link.setAttributeNS('http://www.w3.org/2000/svg', 'rel', 'noopener');
3082 link.appendChild(vertexNode);
3083 vertexNode = link;
3084 }
3085
3086 var radious = 0;
3087 var _shape = ''; // Set the shape based parameters
3088
3089 switch (vertex.type) {
3090 case 'round':
3091 radious = 5;
3092 _shape = 'rect';
3093 break;
3094
3095 case 'square':
3096 _shape = 'rect';
3097 break;
3098
3099 case 'diamond':
3100 _shape = 'question';
3101 break;
3102
3103 case 'hexagon':
3104 _shape = 'hexagon';
3105 break;
3106
3107 case 'odd':
3108 _shape = 'rect_left_inv_arrow';
3109 break;
3110
3111 case 'lean_right':
3112 _shape = 'lean_right';
3113 break;
3114
3115 case 'lean_left':
3116 _shape = 'lean_left';
3117 break;
3118
3119 case 'trapezoid':
3120 _shape = 'trapezoid';
3121 break;
3122
3123 case 'inv_trapezoid':
3124 _shape = 'inv_trapezoid';
3125 break;
3126
3127 case 'odd_right':
3128 _shape = 'rect_left_inv_arrow';
3129 break;
3130
3131 case 'circle':
3132 _shape = 'circle';
3133 break;
3134
3135 case 'ellipse':
3136 _shape = 'ellipse';
3137 break;
3138
3139 case 'group':
3140 _shape = 'rect';
3141 break;
3142
3143 default:
3144 _shape = 'rect';
3145 } // Add the node
3146
3147
3148 g.setNode(vertex.id, {
3149 labelType: 'svg',
3150 labelStyle: labelStyle,
3151 shape: _shape,
3152 label: vertexNode,
3153 rx: radious,
3154 ry: radious,
3155 class: classStr,
3156 style: style,
3157 id: vertex.id
3158 });
3159 });
3160};
3161/**
3162 * Add edges to graph based on parsed graph defninition
3163 * @param {Object} edges The edges to add to the graph
3164 * @param {Object} g The graph object
3165 */
3166
3167var addEdges = function addEdges(edges, g) {
3168 var cnt = 0;
3169 var defaultStyle;
3170
3171 if (typeof edges.defaultStyle !== 'undefined') {
3172 defaultStyle = edges.defaultStyle.toString().replace(/,/g, ';');
3173 }
3174
3175 edges.forEach(function (edge) {
3176 cnt++;
3177 var edgeData = {}; // Set link type for rendering
3178
3179 if (edge.type === 'arrow_open') {
3180 edgeData.arrowhead = 'none';
3181 } else {
3182 edgeData.arrowhead = 'normal';
3183 }
3184
3185 var style = '';
3186
3187 if (typeof edge.style !== 'undefined') {
3188 edge.style.forEach(function (s) {
3189 style = style + s + ';';
3190 });
3191 } else {
3192 switch (edge.stroke) {
3193 case 'normal':
3194 style = 'fill:none';
3195
3196 if (typeof defaultStyle !== 'undefined') {
3197 style = defaultStyle;
3198 }
3199
3200 break;
3201
3202 case 'dotted':
3203 style = 'fill:none;stroke-width:2px;stroke-dasharray:3;';
3204 break;
3205
3206 case 'thick':
3207 style = ' stroke-width: 3.5px;fill:none';
3208 break;
3209 }
3210 }
3211
3212 edgeData.style = style;
3213
3214 if (typeof edge.interpolate !== 'undefined') {
3215 edgeData.curve = Object(_utils__WEBPACK_IMPORTED_MODULE_8__["interpolateToCurve"])(edge.interpolate, d3__WEBPACK_IMPORTED_MODULE_1__["curveLinear"]);
3216 } else if (typeof edges.defaultInterpolate !== 'undefined') {
3217 edgeData.curve = Object(_utils__WEBPACK_IMPORTED_MODULE_8__["interpolateToCurve"])(edges.defaultInterpolate, d3__WEBPACK_IMPORTED_MODULE_1__["curveLinear"]);
3218 } else {
3219 edgeData.curve = Object(_utils__WEBPACK_IMPORTED_MODULE_8__["interpolateToCurve"])(conf.curve, d3__WEBPACK_IMPORTED_MODULE_1__["curveLinear"]);
3220 }
3221
3222 if (typeof edge.text === 'undefined') {
3223 if (typeof edge.style !== 'undefined') {
3224 edgeData.arrowheadStyle = 'fill: #333';
3225 }
3226 } else {
3227 edgeData.arrowheadStyle = 'fill: #333';
3228
3229 if (typeof edge.style === 'undefined') {
3230 edgeData.labelpos = 'c';
3231
3232 if (Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels) {
3233 edgeData.labelType = 'html';
3234 edgeData.label = '<span class="edgeLabel">' + edge.text + '</span>';
3235 } else {
3236 edgeData.labelType = 'text';
3237 edgeData.style = edgeData.style || 'stroke: #333; stroke-width: 1.5px;fill:none';
3238 edgeData.label = edge.text.replace(/<br>/g, '\n');
3239 }
3240 } else {
3241 edgeData.label = edge.text.replace(/<br>/g, '\n');
3242 }
3243 } // Add the edge to the graph
3244
3245
3246 g.setEdge(edge.start, edge.end, edgeData, cnt);
3247 });
3248};
3249/**
3250 * Returns the all the styles from classDef statements in the graph definition.
3251 * @returns {object} classDef styles
3252 */
3253
3254var getClasses = function getClasses(text) {
3255 _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info('Extracting classes');
3256 _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear();
3257 var parser = _parser_flow__WEBPACK_IMPORTED_MODULE_3___default.a.parser;
3258 parser.yy = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"]; // Parse the graph definition
3259
3260 parser.parse(text);
3261 return _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getClasses();
3262};
3263/**
3264 * Draws a flowchart in the tag with id: id based on the graph definition in text.
3265 * @param text
3266 * @param id
3267 */
3268
3269var draw = function draw(text, id) {
3270 _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info('Drawing flowchart');
3271 _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear();
3272 var parser = _parser_flow__WEBPACK_IMPORTED_MODULE_3___default.a.parser;
3273 parser.yy = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"]; // Parse the graph definition
3274
3275 try {
3276 parser.parse(text);
3277 } catch (err) {
3278 _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].debug('Parsing failed');
3279 } // Fetch the default direction, use TD if none was found
3280
3281
3282 var dir = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getDirection();
3283
3284 if (typeof dir === 'undefined') {
3285 dir = 'TD';
3286 } // Create the input mermaid.graph
3287
3288
3289 var g; // Todo remove newDagreD3 when properly verified
3290
3291 if (newDagreD3) {
3292 g = new graphlib__WEBPACK_IMPORTED_MODULE_0___default.a.Graph({
3293 multigraph: true,
3294 compound: true
3295 }).setGraph({
3296 rankdir: dir,
3297 marginx: 8,
3298 marginy: 8
3299 }).setDefaultEdgeLabel(function () {
3300 return {};
3301 });
3302 } else {
3303 g = new graphlib__WEBPACK_IMPORTED_MODULE_0___default.a.Graph({
3304 multigraph: true,
3305 compound: true
3306 }).setGraph({
3307 rankdir: dir,
3308 marginx: 20,
3309 marginy: 20
3310 }).setDefaultEdgeLabel(function () {
3311 return {};
3312 });
3313 }
3314
3315 var subG;
3316 var subGraphs = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getSubGraphs();
3317
3318 for (var _i2 = subGraphs.length - 1; _i2 >= 0; _i2--) {
3319 subG = subGraphs[_i2];
3320 _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].addVertex(subG.id, subG.title, 'group', undefined, subG.classes);
3321 } // Fetch the verices/nodes and edges/links from the parsed graph definition
3322
3323
3324 var vert = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getVertices();
3325 var edges = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getEdges();
3326 var i = 0;
3327
3328 for (i = subGraphs.length - 1; i >= 0; i--) {
3329 subG = subGraphs[i];
3330 d3__WEBPACK_IMPORTED_MODULE_1__["selectAll"]('cluster').append('text');
3331
3332 for (var j = 0; j < subG.nodes.length; j++) {
3333 g.setParent(subG.nodes[j], subG.id);
3334 }
3335 }
3336
3337 addVertices(vert, g, id);
3338 addEdges(edges, g); // Create the renderer
3339
3340 var Render = dagre_d3__WEBPACK_IMPORTED_MODULE_5___default.a.render;
3341 var render = new Render(); // Add custom shapes
3342
3343 _flowChartShapes__WEBPACK_IMPORTED_MODULE_9__["default"].addToRender(render); // Add our custom arrow - an empty arrowhead
3344
3345 render.arrows().none = function normal(parent, id, edge, type) {
3346 var marker = parent.append('marker').attr('id', id).attr('viewBox', '0 0 10 10').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'strokeWidth').attr('markerWidth', 8).attr('markerHeight', 6).attr('orient', 'auto');
3347 var path = marker.append('path').attr('d', 'M 0 0 L 0 0 L 0 0 z');
3348 dagre_d3__WEBPACK_IMPORTED_MODULE_5___default.a.util.applyStyle(path, edge[type + 'Style']);
3349 }; // Override normal arrowhead defined in d3. Remove style & add class to allow css styling.
3350
3351
3352 render.arrows().normal = function normal(parent, id) {
3353 var marker = parent.append('marker').attr('id', id).attr('viewBox', '0 0 10 10').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'strokeWidth').attr('markerWidth', 8).attr('markerHeight', 6).attr('orient', 'auto');
3354 marker.append('path').attr('d', 'M 0 0 L 10 5 L 0 10 z').attr('class', 'arrowheadPath').style('stroke-width', 1).style('stroke-dasharray', '1,0');
3355 }; // Set up an SVG group so that we can translate the final graph.
3356
3357
3358 var svg = d3__WEBPACK_IMPORTED_MODULE_1__["select"]("[id=\"".concat(id, "\"]")); // Run the renderer. This is what draws the final graph.
3359
3360 var element = d3__WEBPACK_IMPORTED_MODULE_1__["select"]('#' + id + ' g');
3361 render(element, g);
3362 element.selectAll('g.node').attr('title', function () {
3363 return _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getTooltip(this.id);
3364 });
3365 var conf = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart;
3366 var padding = 8; // Todo remove newDagreD3 when properly verified
3367
3368 if (newDagreD3) {
3369 var svgBounds = svg.node().getBBox();
3370 var width = svgBounds.width + padding * 2;
3371 var height = svgBounds.height + padding * 2;
3372 _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].debug("new ViewBox 0 0 ".concat(width, " ").concat(height), "translate(".concat(padding - g._label.marginx, ", ").concat(padding - g._label.marginy, ")"));
3373
3374 if (conf.useMaxWidth) {
3375 svg.attr('width', '100%');
3376 svg.attr('style', "max-width: ".concat(width, "px;"));
3377 } else {
3378 svg.attr('height', height);
3379 svg.attr('width', width);
3380 }
3381
3382 svg.attr('viewBox', "0 0 ".concat(width, " ").concat(height));
3383 svg.select('g').attr('transform', "translate(".concat(padding - g._label.marginx, ", ").concat(padding - svgBounds.y, ")"));
3384 } else {
3385 var _width = g.maxX - g.minX + padding * 2;
3386
3387 var _height = g.maxY - g.minY + padding * 2;
3388
3389 if (conf.useMaxWidth) {
3390 svg.attr('width', '100%');
3391 svg.attr('style', "max-width: ".concat(_width, "px;"));
3392 } else {
3393 svg.attr('height', _height);
3394 svg.attr('width', _width);
3395 }
3396
3397 _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].debug("Org ViewBox 0 0 ".concat(_width, " ").concat(_height), "translate(".concat(padding - g.minX, ", ").concat(padding - g.minY, ")\n").concat(location.href));
3398 svg.attr('viewBox', "0 0 ".concat(_width, " ").concat(_height));
3399 svg.select('g').attr('transform', "translate(".concat(padding - g.minX, ", ").concat(padding - g.minY, ")")); // svg.select('g').attr('transform', `translate(${padding - minX}, ${padding - minY})`);
3400 } // Index nodes
3401
3402
3403 _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].indexNodes('subGraph' + i); // reposition labels
3404
3405 for (i = 0; i < subGraphs.length; i++) {
3406 subG = subGraphs[i];
3407
3408 if (subG.title !== 'undefined') {
3409 var clusterRects = document.querySelectorAll('#' + id + ' [id="' + subG.id + '"] rect');
3410 var clusterEl = document.querySelectorAll('#' + id + ' [id="' + subG.id + '"]');
3411 var xPos = clusterRects[0].x.baseVal.value;
3412 var yPos = clusterRects[0].y.baseVal.value;
3413 var _width2 = clusterRects[0].width.baseVal.value;
3414 var cluster = d3__WEBPACK_IMPORTED_MODULE_1__["select"](clusterEl[0]);
3415 var te = cluster.select('.label');
3416 te.attr('transform', "translate(".concat(xPos + _width2 / 2, ", ").concat(yPos + 14, ")"));
3417 te.attr('id', id + 'Text');
3418 }
3419 } // Add label rects for non html labels
3420
3421
3422 if (!conf.htmlLabels) {
3423 var labels = document.querySelectorAll('[id="' + id + '"] .edgeLabel .label');
3424
3425 for (var k = 0; k < labels.length; k++) {
3426 var label = labels[k]; // Get dimensions of label
3427
3428 var dim = label.getBBox();
3429 var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
3430 rect.setAttribute('rx', 0);
3431 rect.setAttribute('ry', 0);
3432 rect.setAttribute('width', dim.width);
3433 rect.setAttribute('height', dim.height);
3434 rect.setAttribute('style', 'fill:#e8e8e8;');
3435 label.insertBefore(rect, label.firstChild);
3436 }
3437 }
3438};
3439/* harmony default export */ __webpack_exports__["default"] = ({
3440 setConf: setConf,
3441 addVertices: addVertices,
3442 addEdges: addEdges,
3443 getClasses: getClasses,
3444 draw: draw
3445});
3446
3447/***/ }),
3448
3449/***/ "./src/diagrams/flowchart/parser/flow.jison":
3450/*!**************************************************!*\
3451 !*** ./src/diagrams/flowchart/parser/flow.jison ***!
3452 \**************************************************/
3453/*! no static exports found */
3454/***/ (function(module, exports, __webpack_require__) {
3455
3456/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
3457/*
3458 Returns a Parser object of the following structure:
3459
3460 Parser: {
3461 yy: {}
3462 }
3463
3464 Parser.prototype: {
3465 yy: {},
3466 trace: function(),
3467 symbols_: {associative list: name ==> number},
3468 terminals_: {associative list: number ==> name},
3469 productions_: [...],
3470 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
3471 table: [...],
3472 defaultActions: {...},
3473 parseError: function(str, hash),
3474 parse: function(input),
3475
3476 lexer: {
3477 EOF: 1,
3478 parseError: function(str, hash),
3479 setInput: function(input),
3480 input: function(),
3481 unput: function(str),
3482 more: function(),
3483 less: function(n),
3484 pastInput: function(),
3485 upcomingInput: function(),
3486 showPosition: function(),
3487 test_match: function(regex_match_array, rule_index),
3488 next: function(),
3489 lex: function(),
3490 begin: function(condition),
3491 popState: function(),
3492 _currentRules: function(),
3493 topState: function(),
3494 pushState: function(condition),
3495
3496 options: {
3497 ranges: boolean (optional: true ==> token location info will include a .range[] member)
3498 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
3499 backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
3500 },
3501
3502 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
3503 rules: [...],
3504 conditions: {associative list: name ==> set},
3505 }
3506 }
3507
3508
3509 token location info (@$, _$, etc.): {
3510 first_line: n,
3511 last_line: n,
3512 first_column: n,
3513 last_column: n,
3514 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
3515 }
3516
3517
3518 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
3519 text: (matched text)
3520 token: (the produced terminal token, if any)
3521 line: (yylineno)
3522 }
3523 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
3524 loc: (yylloc)
3525 expected: (string describing the set of expected tokens)
3526 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
3527 }
3528*/
3529var parser = (function(){
3530var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,4],$V1=[1,3],$V2=[1,5],$V3=[1,8,9,10,11,26,87,88,89,90,91,92,102,103,106,107,108,110,111,117,118,119,120,121,122],$V4=[2,2],$V5=[1,12],$V6=[1,13],$V7=[1,14],$V8=[1,15],$V9=[1,22],$Va=[1,24],$Vb=[1,25],$Vc=[1,26],$Vd=[1,27],$Ve=[1,28],$Vf=[1,40],$Vg=[1,35],$Vh=[1,37],$Vi=[1,32],$Vj=[1,36],$Vk=[1,39],$Vl=[1,43],$Vm=[1,44],$Vn=[1,45],$Vo=[1,34],$Vp=[1,38],$Vq=[1,41],$Vr=[1,42],$Vs=[1,33],$Vt=[1,50],$Vu=[1,8,9,10,11,26,30,87,88,89,90,91,92,102,103,106,107,108,110,111,117,118,119,120,121,122],$Vv=[1,54],$Vw=[1,53],$Vx=[1,55],$Vy=[8,9,11,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82],$Vz=[8,9,11,34,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82],$VA=[8,9,10,11,28,34,36,38,40,42,43,45,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,92,102,103,106,107,108,110,111,117,118,119,120,121,122],$VB=[92,102,103,106,107,108,110,111,117,118,119,120,121,122],$VC=[1,129],$VD=[1,149],$VE=[1,150],$VF=[1,151],$VG=[1,152],$VH=[1,123],$VI=[1,125],$VJ=[1,124],$VK=[1,120],$VL=[1,144],$VM=[1,145],$VN=[1,146],$VO=[1,147],$VP=[1,148],$VQ=[1,153],$VR=[1,154],$VS=[1,127],$VT=[1,134],$VU=[1,137],$VV=[1,135],$VW=[1,136],$VX=[1,130],$VY=[1,142],$VZ=[1,141],$V_=[1,126],$V$=[1,122],$V01=[1,132],$V11=[1,133],$V21=[1,138],$V31=[1,139],$V41=[1,140],$V51=[1,143],$V61=[49,83,92,102,103,106,107,108,110,111,117,118,119,120,121,122],$V71=[8,9,10,11,26,30,87,88,89,90,91,92,102,103,106,107,108,110,111,117,118,119,120,121,122],$V81=[1,171],$V91=[1,173],$Va1=[1,174],$Vb1=[8,9,10,11,12,13,26,28,29,30,37,39,41,42,44,46,50,51,53,55,57,59,61,63,65,66,67,69,71,73,83,87,88,89,90,91,92,93,96,102,103,106,107,108,110,111,112,113,117,118,119,120,121,122],$Vc1=[8,9,10,11,13,92,102,103,106,107,108,110,111,117,118,119,120,121,122],$Vd1=[10,103],$Ve1=[1,252],$Vf1=[1,256],$Vg1=[1,253],$Vh1=[1,250],$Vi1=[1,247],$Vj1=[1,248],$Vk1=[1,249],$Vl1=[1,251],$Vm1=[1,254],$Vn1=[1,255],$Vo1=[1,257],$Vp1=[8,9,11],$Vq1=[1,282],$Vr1=[8,9,11,103],$Vs1=[8,9,10,11,87,99,102,103,106,107,108,109,110,111,112];
3531var parser = {trace: function trace () { },
3532yy: {},
3533symbols_: {"error":2,"mermaidDoc":3,"graphConfig":4,"document":5,"line":6,"statement":7,"SEMI":8,"NEWLINE":9,"SPACE":10,"EOF":11,"GRAPH":12,"DIR":13,"FirstStmtSeperator":14,"ending":15,"endToken":16,"spaceList":17,"spaceListNewline":18,"verticeStatement":19,"separator":20,"styleStatement":21,"linkStyleStatement":22,"classDefStatement":23,"classStatement":24,"clickStatement":25,"subgraph":26,"text":27,"SQS":28,"SQE":29,"end":30,"link":31,"node":32,"vertex":33,"STYLE_SEPARATOR":34,"idString":35,"PS":36,"PE":37,"(-":38,"-)":39,"DIAMOND_START":40,"DIAMOND_STOP":41,"TAGEND":42,"TRAPSTART":43,"TRAPEND":44,"INVTRAPSTART":45,"INVTRAPEND":46,"linkStatement":47,"arrowText":48,"TESTSTR":49,"--":50,"ARROW_POINT":51,"START_DOUBLE_ARROW_POINT":52,"ARROW_CIRCLE":53,"START_DOUBLE_ARROW_CIRCLE":54,"ARROW_CROSS":55,"START_DOUBLE_ARROW_CROSS":56,"ARROW_OPEN":57,"-.":58,"DOTTED_ARROW_POINT":59,"START_DOUBLE_DOTTED_ARROW_POINT":60,"DOTTED_ARROW_CIRCLE":61,"START_DOUBLE_DOTTED_ARROW_CIRCLE":62,"DOTTED_ARROW_CROSS":63,"START_DOUBLE_DOTTED_ARROW_CROSS":64,"DOTTED_ARROW_OPEN":65,"==":66,"THICK_ARROW_POINT":67,"START_DOUBLE_THICK_ARROW_POINT":68,"THICK_ARROW_CIRCLE":69,"START_DOUBLE_THICK_ARROW_CIRCLE":70,"THICK_ARROW_CROSS":71,"START_DOUBLE_THICK_ARROW_CROSS":72,"THICK_ARROW_OPEN":73,"DOUBLE_ARROW_POINT":74,"DOUBLE_ARROW_CIRCLE":75,"DOUBLE_ARROW_CROSS":76,"DOUBLE_DOTTED_ARROW_POINT":77,"DOUBLE_DOTTED_ARROW_CIRCLE":78,"DOUBLE_DOTTED_ARROW_CROSS":79,"DOUBLE_THICK_ARROW_POINT":80,"DOUBLE_THICK_ARROW_CIRCLE":81,"DOUBLE_THICK_ARROW_CROSS":82,"PIPE":83,"textToken":84,"STR":85,"keywords":86,"STYLE":87,"LINKSTYLE":88,"CLASSDEF":89,"CLASS":90,"CLICK":91,"DOWN":92,"UP":93,"textNoTags":94,"textNoTagsToken":95,"DEFAULT":96,"stylesOpt":97,"alphaNum":98,"HEX":99,"numList":100,"INTERPOLATE":101,"NUM":102,"COMMA":103,"style":104,"styleComponent":105,"ALPHA":106,"COLON":107,"MINUS":108,"UNIT":109,"BRKT":110,"DOT":111,"PCT":112,"TAGSTART":113,"alphaNumToken":114,"idStringToken":115,"alphaNumStatement":116,"PUNCTUATION":117,"UNICODE_TEXT":118,"PLUS":119,"EQUALS":120,"MULT":121,"UNDERSCORE":122,"graphCodeTokens":123,"QUOTE":124,"$accept":0,"$end":1},
3534terminals_: {2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"DIR",26:"subgraph",28:"SQS",29:"SQE",30:"end",34:"STYLE_SEPARATOR",36:"PS",37:"PE",38:"(-",39:"-)",40:"DIAMOND_START",41:"DIAMOND_STOP",42:"TAGEND",43:"TRAPSTART",44:"TRAPEND",45:"INVTRAPSTART",46:"INVTRAPEND",49:"TESTSTR",50:"--",51:"ARROW_POINT",52:"START_DOUBLE_ARROW_POINT",53:"ARROW_CIRCLE",54:"START_DOUBLE_ARROW_CIRCLE",55:"ARROW_CROSS",56:"START_DOUBLE_ARROW_CROSS",57:"ARROW_OPEN",58:"-.",59:"DOTTED_ARROW_POINT",60:"START_DOUBLE_DOTTED_ARROW_POINT",61:"DOTTED_ARROW_CIRCLE",62:"START_DOUBLE_DOTTED_ARROW_CIRCLE",63:"DOTTED_ARROW_CROSS",64:"START_DOUBLE_DOTTED_ARROW_CROSS",65:"DOTTED_ARROW_OPEN",66:"==",67:"THICK_ARROW_POINT",68:"START_DOUBLE_THICK_ARROW_POINT",69:"THICK_ARROW_CIRCLE",70:"START_DOUBLE_THICK_ARROW_CIRCLE",71:"THICK_ARROW_CROSS",72:"START_DOUBLE_THICK_ARROW_CROSS",73:"THICK_ARROW_OPEN",74:"DOUBLE_ARROW_POINT",75:"DOUBLE_ARROW_CIRCLE",76:"DOUBLE_ARROW_CROSS",77:"DOUBLE_DOTTED_ARROW_POINT",78:"DOUBLE_DOTTED_ARROW_CIRCLE",79:"DOUBLE_DOTTED_ARROW_CROSS",80:"DOUBLE_THICK_ARROW_POINT",81:"DOUBLE_THICK_ARROW_CIRCLE",82:"DOUBLE_THICK_ARROW_CROSS",83:"PIPE",85:"STR",87:"STYLE",88:"LINKSTYLE",89:"CLASSDEF",90:"CLASS",91:"CLICK",92:"DOWN",93:"UP",96:"DEFAULT",99:"HEX",101:"INTERPOLATE",102:"NUM",103:"COMMA",106:"ALPHA",107:"COLON",108:"MINUS",109:"UNIT",110:"BRKT",111:"DOT",112:"PCT",113:"TAGSTART",117:"PUNCTUATION",118:"UNICODE_TEXT",119:"PLUS",120:"EQUALS",121:"MULT",122:"UNDERSCORE",124:"QUOTE"},
3535productions_: [0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,3],[15,2],[15,1],[16,1],[16,1],[16,1],[14,1],[14,1],[14,2],[18,2],[18,2],[18,1],[18,1],[17,2],[17,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[20,1],[20,1],[20,1],[19,3],[19,1],[32,1],[32,3],[33,4],[33,5],[33,6],[33,7],[33,4],[33,5],[33,4],[33,5],[33,4],[33,5],[33,6],[33,7],[33,4],[33,5],[33,4],[33,5],[33,4],[33,5],[33,4],[33,5],[33,4],[33,5],[33,1],[33,2],[31,2],[31,3],[31,3],[31,1],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[48,3],[27,1],[27,2],[27,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[94,1],[94,2],[23,5],[23,5],[24,5],[25,5],[25,7],[25,5],[25,7],[21,5],[21,5],[22,5],[22,5],[22,9],[22,9],[22,7],[22,7],[100,1],[100,3],[97,1],[97,3],[104,1],[104,2],[105,1],[105,1],[105,1],[105,1],[105,1],[105,1],[105,1],[105,1],[105,1],[105,1],[105,1],[84,1],[84,1],[84,1],[84,1],[84,1],[84,1],[84,1],[95,1],[95,1],[95,1],[95,1],[35,1],[35,2],[98,1],[98,2],[116,1],[116,1],[116,1],[116,1],[114,1],[114,1],[114,1],[114,1],[114,1],[114,1],[114,1],[114,1],[114,1],[114,1],[114,1],[114,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1]],
3536performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
3537/* this == yyval */
3538
3539var $0 = $$.length - 1;
3540switch (yystate) {
3541case 2:
3542 this.$ = [];
3543break;
3544case 3:
3545
3546 if($$[$0] !== []){
3547 $$[$0-1].push($$[$0]);
3548 }
3549 this.$=$$[$0-1];
3550break;
3551case 4: case 113: case 115: case 127: case 174: case 176: case 177:
3552this.$=$$[$0];
3553break;
3554case 11:
3555 yy.setDirection($$[$0-1]);this.$ = $$[$0-1];
3556break;
3557case 26:
3558 this.$=$$[$0-1]
3559break;
3560case 27: case 28: case 29: case 30: case 31:
3561this.$=[];
3562break;
3563case 32:
3564this.$=yy.addSubGraph($$[$0-6],$$[$0-1],$$[$0-4]);
3565break;
3566case 33:
3567this.$=yy.addSubGraph($$[$0-3],$$[$0-1],$$[$0-3]);
3568break;
3569case 34:
3570this.$=yy.addSubGraph(undefined,$$[$0-1],undefined);
3571break;
3572case 38:
3573 yy.addLink($$[$0-2][0],$$[$0][0],$$[$0-1]); this.$ = $$[$0].concat($$[$0-2])
3574break;
3575case 39:
3576 this.$ = $$[$0]
3577break;
3578case 40:
3579 this.$ = [$$[$0]];
3580break;
3581case 41:
3582this.$ = [$$[$0-2]];yy.setClass($$[$0-2],$$[$0])
3583break;
3584case 42:
3585this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'square');
3586break;
3587case 43:
3588this.$ = $$[$0-4];yy.addVertex($$[$0-4],$$[$0-2],'square');
3589break;
3590case 44:
3591this.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'circle');
3592break;
3593case 45:
3594this.$ = $$[$0-6];yy.addVertex($$[$0-6],$$[$0-3],'circle');
3595break;
3596case 46:
3597this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'ellipse');
3598break;
3599case 47:
3600this.$ = $$[$0-4];yy.addVertex($$[$0-4],$$[$0-2],'ellipse');
3601break;
3602case 48:
3603this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'round');
3604break;
3605case 49:
3606this.$ = $$[$0-4];yy.addVertex($$[$0-4],$$[$0-2],'round');
3607break;
3608case 50:
3609this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'diamond');
3610break;
3611case 51:
3612this.$ = $$[$0-4];yy.addVertex($$[$0-4],$$[$0-2],'diamond');
3613break;
3614case 52:
3615this.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'hexagon');
3616break;
3617case 53:
3618this.$ = $$[$0-6];yy.addVertex($$[$0-6],$$[$0-3],'hexagon');
3619break;
3620case 54:
3621this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'odd');
3622break;
3623case 55:
3624this.$ = $$[$0-4];yy.addVertex($$[$0-4],$$[$0-2],'odd');
3625break;
3626case 56:
3627this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'trapezoid');
3628break;
3629case 57:
3630this.$ = $$[$0-4];yy.addVertex($$[$0-4],$$[$0-2],'trapezoid');
3631break;
3632case 58:
3633this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'inv_trapezoid');
3634break;
3635case 59:
3636this.$ = $$[$0-4];yy.addVertex($$[$0-4],$$[$0-2],'inv_trapezoid');
3637break;
3638case 60:
3639this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_right');
3640break;
3641case 61:
3642this.$ = $$[$0-4];yy.addVertex($$[$0-4],$$[$0-2],'lean_right');
3643break;
3644case 62:
3645this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_left');
3646break;
3647case 63:
3648this.$ = $$[$0-4];yy.addVertex($$[$0-4],$$[$0-2],'lean_left');
3649break;
3650case 64:
3651this.$ = $$[$0];yy.addVertex($$[$0]);
3652break;
3653case 65:
3654this.$ = $$[$0-1];yy.addVertex($$[$0-1]);
3655break;
3656case 66:
3657$$[$0-1].text = $$[$0];this.$ = $$[$0-1];
3658break;
3659case 67: case 68:
3660$$[$0-2].text = $$[$0-1];this.$ = $$[$0-2];
3661break;
3662case 69:
3663this.$ = $$[$0];
3664break;
3665case 70:
3666this.$ = {"type":"arrow","stroke":"normal","text":$$[$0-1]};
3667break;
3668case 71:
3669this.$ = {"type":"double_arrow_point","stroke":"normal","text":$$[$0-1]};
3670break;
3671case 72:
3672this.$ = {"type":"arrow_circle","stroke":"normal","text":$$[$0-1]};
3673break;
3674case 73:
3675this.$ = {"type":"double_arrow_circle","stroke":"normal","text":$$[$0-1]};
3676break;
3677case 74:
3678this.$ = {"type":"arrow_cross","stroke":"normal","text":$$[$0-1]};
3679break;
3680case 75:
3681this.$ = {"type":"double_arrow_cross","stroke":"normal","text":$$[$0-1]};
3682break;
3683case 76:
3684this.$ = {"type":"arrow_open","stroke":"normal","text":$$[$0-1]};
3685break;
3686case 77:
3687this.$ = {"type":"arrow","stroke":"dotted","text":$$[$0-1]};
3688break;
3689case 78:
3690this.$ = {"type":"double_arrow_point","stroke":"dotted","text":$$[$0-1]};
3691break;
3692case 79:
3693this.$ = {"type":"arrow_circle","stroke":"dotted","text":$$[$0-1]};
3694break;
3695case 80:
3696this.$ = {"type":"double_arrow_circle","stroke":"dotted","text":$$[$0-1]};
3697break;
3698case 81:
3699this.$ = {"type":"arrow_cross","stroke":"dotted","text":$$[$0-1]};
3700break;
3701case 82:
3702this.$ = {"type":"double_arrow_cross","stroke":"dotted","text":$$[$0-1]};
3703break;
3704case 83:
3705this.$ = {"type":"arrow_open","stroke":"dotted","text":$$[$0-1]};
3706break;
3707case 84:
3708this.$ = {"type":"arrow","stroke":"thick","text":$$[$0-1]};
3709break;
3710case 85:
3711this.$ = {"type":"double_arrow_point","stroke":"thick","text":$$[$0-1]};
3712break;
3713case 86:
3714this.$ = {"type":"arrow_circle","stroke":"thick","text":$$[$0-1]};
3715break;
3716case 87:
3717this.$ = {"type":"double_arrow_circle","stroke":"thick","text":$$[$0-1]};
3718break;
3719case 88:
3720this.$ = {"type":"arrow_cross","stroke":"thick","text":$$[$0-1]};
3721break;
3722case 89:
3723this.$ = {"type":"double_arrow_cross","stroke":"thick","text":$$[$0-1]};
3724break;
3725case 90:
3726this.$ = {"type":"arrow_open","stroke":"thick","text":$$[$0-1]};
3727break;
3728case 91:
3729this.$ = {"type":"arrow","stroke":"normal"};
3730break;
3731case 92:
3732this.$ = {"type":"double_arrow_point","stroke":"normal"};
3733break;
3734case 93:
3735this.$ = {"type":"arrow_circle","stroke":"normal"};
3736break;
3737case 94:
3738this.$ = {"type":"double_arrow_circle","stroke":"normal"};
3739break;
3740case 95:
3741this.$ = {"type":"arrow_cross","stroke":"normal"};
3742break;
3743case 96:
3744this.$ = {"type":"double_arrow_cross","stroke":"normal"};
3745break;
3746case 97:
3747this.$ = {"type":"arrow_open","stroke":"normal"};
3748break;
3749case 98:
3750this.$ = {"type":"arrow","stroke":"dotted"};
3751break;
3752case 99:
3753this.$ = {"type":"double_arrow_point","stroke":"dotted"};
3754break;
3755case 100:
3756this.$ = {"type":"arrow_circle","stroke":"dotted"};
3757break;
3758case 101:
3759this.$ = {"type":"double_arrow_circle","stroke":"dotted"};
3760break;
3761case 102:
3762this.$ = {"type":"arrow_cross","stroke":"dotted"};
3763break;
3764case 103:
3765this.$ = {"type":"double_arrow_cross","stroke":"dotted"};
3766break;
3767case 104:
3768this.$ = {"type":"arrow_open","stroke":"dotted"};
3769break;
3770case 105:
3771this.$ = {"type":"arrow","stroke":"thick"};
3772break;
3773case 106:
3774this.$ = {"type":"double_arrow_point","stroke":"thick"};
3775break;
3776case 107:
3777this.$ = {"type":"arrow_circle","stroke":"thick"};
3778break;
3779case 108:
3780this.$ = {"type":"double_arrow_circle","stroke":"thick"};
3781break;
3782case 109:
3783this.$ = {"type":"arrow_cross","stroke":"thick"};
3784break;
3785case 110:
3786this.$ = {"type":"double_arrow_cross","stroke":"thick"};
3787break;
3788case 111:
3789this.$ = {"type":"arrow_open","stroke":"thick"};
3790break;
3791case 112:
3792this.$ = $$[$0-1];
3793break;
3794case 114: case 128: case 175:
3795this.$=$$[$0-1]+''+$$[$0];
3796break;
3797case 129: case 130:
3798this.$ = $$[$0-4];yy.addClass($$[$0-2],$$[$0]);
3799break;
3800case 131:
3801this.$ = $$[$0-4];yy.setClass($$[$0-2], $$[$0]);
3802break;
3803case 132:
3804this.$ = $$[$0-4];yy.setClickEvent($$[$0-2], $$[$0], undefined);
3805break;
3806case 133:
3807this.$ = $$[$0-6];yy.setClickEvent($$[$0-4], $$[$0-2], $$[$0]) ;
3808break;
3809case 134:
3810this.$ = $$[$0-4];yy.setLink($$[$0-2], $$[$0], undefined);
3811break;
3812case 135:
3813this.$ = $$[$0-6];yy.setLink($$[$0-4], $$[$0-2], $$[$0] );
3814break;
3815case 136:
3816this.$ = $$[$0-4];yy.addVertex($$[$0-2],undefined,undefined,$$[$0]);
3817break;
3818case 137: case 139:
3819this.$ = $$[$0-4];yy.updateLink($$[$0-2],$$[$0]);
3820break;
3821case 138:
3822this.$ = $$[$0-4];yy.updateLink([$$[$0-2]],$$[$0]);
3823break;
3824case 140:
3825this.$ = $$[$0-8];yy.updateLinkInterpolate([$$[$0-6]],$$[$0-2]);yy.updateLink([$$[$0-6]],$$[$0]);
3826break;
3827case 141:
3828this.$ = $$[$0-8];yy.updateLinkInterpolate($$[$0-6],$$[$0-2]);yy.updateLink($$[$0-6],$$[$0]);
3829break;
3830case 142:
3831this.$ = $$[$0-6];yy.updateLinkInterpolate([$$[$0-4]],$$[$0]);
3832break;
3833case 143:
3834this.$ = $$[$0-6];yy.updateLinkInterpolate($$[$0-4],$$[$0]);
3835break;
3836case 144: case 146:
3837this.$ = [$$[$0]]
3838break;
3839case 145: case 147:
3840$$[$0-2].push($$[$0]);this.$ = $$[$0-2];
3841break;
3842case 149:
3843this.$ = $$[$0-1] + $$[$0];
3844break;
3845case 172:
3846this.$=$$[$0]
3847break;
3848case 173:
3849this.$=$$[$0-1]+''+$$[$0]
3850break;
3851case 178:
3852this.$='v';
3853break;
3854case 179:
3855this.$='-';
3856break;
3857}
3858},
3859table: [{3:1,4:2,9:$V0,10:$V1,12:$V2},{1:[3]},o($V3,$V4,{5:6}),{4:7,9:$V0,10:$V1,12:$V2},{4:8,9:$V0,10:$V1,12:$V2},{13:[1,9]},{1:[2,1],6:10,7:11,8:$V5,9:$V6,10:$V7,11:$V8,19:16,21:17,22:18,23:19,24:20,25:21,26:$V9,32:23,33:29,35:30,87:$Va,88:$Vb,89:$Vc,90:$Vd,91:$Ve,92:$Vf,102:$Vg,103:$Vh,106:$Vi,107:$Vj,108:$Vk,110:$Vl,111:$Vm,115:31,117:$Vn,118:$Vo,119:$Vp,120:$Vq,121:$Vr,122:$Vs},o($V3,[2,9]),o($V3,[2,10]),{8:[1,47],9:[1,48],10:$Vt,14:46,17:49},o($Vu,[2,3]),o($Vu,[2,4]),o($Vu,[2,5]),o($Vu,[2,6]),o($Vu,[2,7]),o($Vu,[2,8]),{8:$Vv,9:$Vw,11:$Vx,20:51,31:52,47:56,50:[1,57],51:[1,69],52:[1,58],53:[1,71],54:[1,59],55:[1,73],56:[1,60],57:[1,75],58:[1,61],59:[1,76],60:[1,62],61:[1,78],62:[1,63],63:[1,80],64:[1,64],65:[1,82],66:[1,65],67:[1,83],68:[1,66],69:[1,85],70:[1,67],71:[1,87],72:[1,68],73:[1,89],74:[1,70],75:[1,72],76:[1,74],77:[1,77],78:[1,79],79:[1,81],80:[1,84],81:[1,86],82:[1,88]},{8:$Vv,9:$Vw,11:$Vx,20:90},{8:$Vv,9:$Vw,11:$Vx,20:91},{8:$Vv,9:$Vw,11:$Vx,20:92},{8:$Vv,9:$Vw,11:$Vx,20:93},{8:$Vv,9:$Vw,11:$Vx,20:94},{8:$Vv,9:$Vw,10:[1,95],11:$Vx,20:96},o($Vy,[2,39]),{10:[1,97]},{10:[1,98]},{10:[1,99]},{10:[1,100]},{10:[1,101]},o($Vy,[2,40],{34:[1,102]}),o($Vz,[2,64],{17:110,115:111,10:$Vt,28:[1,103],36:[1,104],38:[1,105],40:[1,106],42:[1,107],43:[1,108],45:[1,109],92:$Vf,102:$Vg,103:$Vh,106:$Vi,107:$Vj,108:$Vk,110:$Vl,111:$Vm,117:$Vn,118:$Vo,119:$Vp,120:$Vq,121:$Vr,122:$Vs}),o($VA,[2,172]),o($VA,[2,192]),o($VA,[2,193]),o($VA,[2,194]),o($VA,[2,195]),o($VA,[2,196]),o($VA,[2,197]),o($VA,[2,198]),o($VA,[2,199]),o($VA,[2,200]),o($VA,[2,201]),o($VA,[2,202]),o($VA,[2,203]),o($VA,[2,204]),o($VA,[2,205]),o($V3,[2,11]),o($V3,[2,17]),o($V3,[2,18]),{9:[1,112]},o($Vz,[2,25],{17:113,10:$Vt}),o($Vu,[2,26]),{32:114,33:29,35:30,92:$Vf,102:$Vg,103:$Vh,106:$Vi,107:$Vj,108:$Vk,110:$Vl,111:$Vm,115:31,117:$Vn,118:$Vo,119:$Vp,120:$Vq,121:$Vr,122:$Vs},o($Vu,[2,35]),o($Vu,[2,36]),o($Vu,[2,37]),o($VB,[2,69],{48:115,49:[1,116],83:[1,117]}),{10:$VC,12:$VD,13:$VE,26:$VF,27:118,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:155,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:156,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:157,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:158,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:159,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:160,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:161,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:162,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:163,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:164,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:165,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},o($V61,[2,91]),o($V61,[2,92]),o($V61,[2,93]),o($V61,[2,94]),o($V61,[2,95]),o($V61,[2,96]),o($V61,[2,97]),o($V61,[2,98]),o($V61,[2,99]),o($V61,[2,100]),o($V61,[2,101]),o($V61,[2,102]),o($V61,[2,103]),o($V61,[2,104]),o($V61,[2,105]),o($V61,[2,106]),o($V61,[2,107]),o($V61,[2,108]),o($V61,[2,109]),o($V61,[2,110]),o($V61,[2,111]),o($Vu,[2,27]),o($Vu,[2,28]),o($Vu,[2,29]),o($Vu,[2,30]),o($Vu,[2,31]),{10:$VC,12:$VD,13:$VE,26:$VF,27:166,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},o($V71,$V4,{5:167}),{13:$V81,92:$V91,98:168,99:[1,169],102:$VT,103:$VU,106:$VV,107:$VW,108:$Va1,110:$VY,111:$VZ,114:172,116:170,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{96:[1,175],100:176,102:[1,177]},{13:$V81,92:$V91,96:[1,178],98:179,102:$VT,103:$VU,106:$VV,107:$VW,108:$Va1,110:$VY,111:$VZ,114:172,116:170,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{13:$V81,92:$V91,98:180,102:$VT,103:$VU,106:$VV,107:$VW,108:$Va1,110:$VY,111:$VZ,114:172,116:170,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{13:$V81,92:$V91,98:181,102:$VT,103:$VU,106:$VV,107:$VW,108:$Va1,110:$VY,111:$VZ,114:172,116:170,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{35:182,92:$Vf,102:$Vg,103:$Vh,106:$Vi,107:$Vj,108:$Vk,110:$Vl,111:$Vm,115:31,117:$Vn,118:$Vo,119:$Vp,120:$Vq,121:$Vr,122:$Vs},{10:$VC,12:$VD,13:$VE,26:$VF,27:183,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:185,30:$VG,36:[1,184],42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:186,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:187,30:$VG,40:[1,188],42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:189,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:190,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:191,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},o($Vz,[2,65]),o($VA,[2,173]),o($V3,[2,19]),o($Vz,[2,24]),o($Vy,[2,38]),o($VB,[2,66],{10:[1,192]}),{10:[1,193]},{10:$VC,12:$VD,13:$VE,26:$VF,27:194,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,51:[1,195],53:[1,196],55:[1,197],57:[1,198],66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},o($Vb1,[2,113]),o($Vb1,[2,115]),o($Vb1,[2,161]),o($Vb1,[2,162]),o($Vb1,[2,163]),o($Vb1,[2,164]),o($Vb1,[2,165]),o($Vb1,[2,166]),o($Vb1,[2,167]),o($Vb1,[2,168]),o($Vb1,[2,169]),o($Vb1,[2,170]),o($Vb1,[2,171]),o($Vb1,[2,180]),o($Vb1,[2,181]),o($Vb1,[2,182]),o($Vb1,[2,183]),o($Vb1,[2,184]),o($Vb1,[2,185]),o($Vb1,[2,186]),o($Vb1,[2,187]),o($Vb1,[2,188]),o($Vb1,[2,189]),o($Vb1,[2,190]),o($Vb1,[2,191]),o($Vb1,[2,116]),o($Vb1,[2,117]),o($Vb1,[2,118]),o($Vb1,[2,119]),o($Vb1,[2,120]),o($Vb1,[2,121]),o($Vb1,[2,122]),o($Vb1,[2,123]),o($Vb1,[2,124]),o($Vb1,[2,125]),o($Vb1,[2,126]),{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,51:[1,200],66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,53:[1,201],66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,55:[1,202],66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,59:[1,203],61:[1,204],63:[1,205],65:[1,206],66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,59:[1,207],66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,61:[1,208],66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,63:[1,209],66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,66:$VJ,67:[1,210],69:[1,211],71:[1,212],73:[1,213],84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,66:$VJ,67:[1,214],84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,66:$VJ,69:[1,215],84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,66:$VJ,71:[1,216],84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{8:$Vv,9:$Vw,10:$VC,11:$Vx,12:$VD,13:$VE,20:218,26:$VF,28:[1,217],30:$VG,42:$VH,50:$VI,66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{6:10,7:11,8:$V5,9:$V6,10:$V7,11:$V8,19:16,21:17,22:18,23:19,24:20,25:21,26:$V9,30:[1,219],32:23,33:29,35:30,87:$Va,88:$Vb,89:$Vc,90:$Vd,91:$Ve,92:$Vf,102:$Vg,103:$Vh,106:$Vi,107:$Vj,108:$Vk,110:$Vl,111:$Vm,115:31,117:$Vn,118:$Vo,119:$Vp,120:$Vq,121:$Vr,122:$Vs},{10:[1,220],13:$V81,92:$V91,102:$VT,103:$VU,106:$VV,107:$VW,108:$Va1,110:$VY,111:$VZ,114:172,116:221,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:[1,222]},o($Vc1,[2,174]),o($Vc1,[2,176]),o($Vc1,[2,177]),o($Vc1,[2,178]),o($Vc1,[2,179]),{10:[1,223]},{10:[1,224],103:[1,225]},o($Vd1,[2,144]),{10:[1,226]},{10:[1,227],13:$V81,92:$V91,102:$VT,103:$VU,106:$VV,107:$VW,108:$Va1,110:$VY,111:$VZ,114:172,116:221,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:[1,228],13:$V81,92:$V91,102:$VT,103:$VU,106:$VV,107:$VW,108:$Va1,110:$VY,111:$VZ,114:172,116:221,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:[1,229],13:$V81,92:$V91,102:$VT,103:$VU,106:$VV,107:$VW,108:$Va1,110:$VY,111:$VZ,114:172,116:221,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},o($Vy,[2,41],{115:111,92:$Vf,102:$Vg,103:$Vh,106:$Vi,107:$Vj,108:$Vk,110:$Vl,111:$Vm,117:$Vn,118:$Vo,119:$Vp,120:$Vq,121:$Vr,122:$Vs}),{10:$VC,12:$VD,13:$VE,26:$VF,29:[1,230],30:$VG,42:$VH,50:$VI,66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:231,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,37:[1,232],42:$VH,50:$VI,66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,39:[1,233],42:$VH,50:$VI,66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,41:[1,234],42:$VH,50:$VI,66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:235,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,29:[1,236],30:$VG,42:$VH,50:$VI,66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,44:[1,237],46:[1,238],50:$VI,66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,44:[1,240],46:[1,239],50:$VI,66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},o($VB,[2,68]),o($VB,[2,67]),{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,66:$VJ,83:[1,241],84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},o($VB,[2,70]),o($VB,[2,72]),o($VB,[2,74]),o($VB,[2,76]),o($Vb1,[2,114]),o($VB,[2,71]),o($VB,[2,73]),o($VB,[2,75]),o($VB,[2,77]),o($VB,[2,79]),o($VB,[2,81]),o($VB,[2,83]),o($VB,[2,78]),o($VB,[2,80]),o($VB,[2,82]),o($VB,[2,84]),o($VB,[2,86]),o($VB,[2,88]),o($VB,[2,90]),o($VB,[2,85]),o($VB,[2,87]),o($VB,[2,89]),{10:$VC,12:$VD,13:$VE,26:$VF,27:242,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},o($V71,$V4,{5:243}),o($Vu,[2,34]),{10:$Ve1,87:$Vf1,97:244,99:$Vg1,102:$Vh1,104:245,105:246,106:$Vi1,107:$Vj1,108:$Vk1,109:$Vl1,110:$Vm1,111:$Vn1,112:$Vo1},o($Vc1,[2,175]),{10:$Ve1,87:$Vf1,97:258,99:$Vg1,102:$Vh1,104:245,105:246,106:$Vi1,107:$Vj1,108:$Vk1,109:$Vl1,110:$Vm1,111:$Vn1,112:$Vo1},{10:$Ve1,87:$Vf1,97:259,99:$Vg1,101:[1,260],102:$Vh1,104:245,105:246,106:$Vi1,107:$Vj1,108:$Vk1,109:$Vl1,110:$Vm1,111:$Vn1,112:$Vo1},{10:$Ve1,87:$Vf1,97:261,99:$Vg1,101:[1,262],102:$Vh1,104:245,105:246,106:$Vi1,107:$Vj1,108:$Vk1,109:$Vl1,110:$Vm1,111:$Vn1,112:$Vo1},{102:[1,263]},{10:$Ve1,87:$Vf1,97:264,99:$Vg1,102:$Vh1,104:245,105:246,106:$Vi1,107:$Vj1,108:$Vk1,109:$Vl1,110:$Vm1,111:$Vn1,112:$Vo1},{10:$Ve1,87:$Vf1,97:265,99:$Vg1,102:$Vh1,104:245,105:246,106:$Vi1,107:$Vj1,108:$Vk1,109:$Vl1,110:$Vm1,111:$Vn1,112:$Vo1},{13:$V81,92:$V91,98:266,102:$VT,103:$VU,106:$VV,107:$VW,108:$Va1,110:$VY,111:$VZ,114:172,116:170,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{13:$V81,85:[1,268],92:$V91,98:267,102:$VT,103:$VU,106:$VV,107:$VW,108:$Va1,110:$VY,111:$VZ,114:172,116:170,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},o($Vz,[2,42],{17:269,10:$Vt}),{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,37:[1,270],42:$VH,50:$VI,66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},o($Vz,[2,48],{17:271,10:$Vt}),o($Vz,[2,46],{17:272,10:$Vt}),o($Vz,[2,50],{17:273,10:$Vt}),{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,41:[1,274],42:$VH,50:$VI,66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},o($Vz,[2,54],{17:275,10:$Vt}),o($Vz,[2,56],{17:276,10:$Vt}),o($Vz,[2,60],{17:277,10:$Vt}),o($Vz,[2,58],{17:278,10:$Vt}),o($Vz,[2,62],{17:279,10:$Vt}),o([10,92,102,103,106,107,108,110,111,117,118,119,120,121,122],[2,112]),{10:$VC,12:$VD,13:$VE,26:$VF,29:[1,280],30:$VG,42:$VH,50:$VI,66:$VJ,84:199,86:131,87:$VL,88:$VM,89:$VN,90:$VO,91:$VP,92:$VQ,93:$VR,95:121,96:$VS,102:$VT,103:$VU,106:$VV,107:$VW,108:$VX,110:$VY,111:$VZ,112:$V_,113:$V$,114:128,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{6:10,7:11,8:$V5,9:$V6,10:$V7,11:$V8,19:16,21:17,22:18,23:19,24:20,25:21,26:$V9,30:[1,281],32:23,33:29,35:30,87:$Va,88:$Vb,89:$Vc,90:$Vd,91:$Ve,92:$Vf,102:$Vg,103:$Vh,106:$Vi,107:$Vj,108:$Vk,110:$Vl,111:$Vm,115:31,117:$Vn,118:$Vo,119:$Vp,120:$Vq,121:$Vr,122:$Vs},o($Vp1,[2,136],{103:$Vq1}),o($Vr1,[2,146],{105:283,10:$Ve1,87:$Vf1,99:$Vg1,102:$Vh1,106:$Vi1,107:$Vj1,108:$Vk1,109:$Vl1,110:$Vm1,111:$Vn1,112:$Vo1}),o($Vs1,[2,148]),o($Vs1,[2,150]),o($Vs1,[2,151]),o($Vs1,[2,152]),o($Vs1,[2,153]),o($Vs1,[2,154]),o($Vs1,[2,155]),o($Vs1,[2,156]),o($Vs1,[2,157]),o($Vs1,[2,158]),o($Vs1,[2,159]),o($Vs1,[2,160]),o($Vp1,[2,137],{103:$Vq1}),o($Vp1,[2,138],{103:$Vq1}),{10:[1,284]},o($Vp1,[2,139],{103:$Vq1}),{10:[1,285]},o($Vd1,[2,145]),o($Vp1,[2,129],{103:$Vq1}),o($Vp1,[2,130],{103:$Vq1}),o($Vp1,[2,131],{114:172,116:221,13:$V81,92:$V91,102:$VT,103:$VU,106:$VV,107:$VW,108:$Va1,110:$VY,111:$VZ,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51}),o($Vp1,[2,132],{114:172,116:221,10:[1,286],13:$V81,92:$V91,102:$VT,103:$VU,106:$VV,107:$VW,108:$Va1,110:$VY,111:$VZ,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51}),o($Vp1,[2,134],{10:[1,287]}),o($Vz,[2,43]),{37:[1,288]},o($Vz,[2,49]),o($Vz,[2,47]),o($Vz,[2,51]),{41:[1,289]},o($Vz,[2,55]),o($Vz,[2,57]),o($Vz,[2,61]),o($Vz,[2,59]),o($Vz,[2,63]),{8:$Vv,9:$Vw,11:$Vx,20:290},o($Vu,[2,33]),{10:$Ve1,87:$Vf1,99:$Vg1,102:$Vh1,104:291,105:246,106:$Vi1,107:$Vj1,108:$Vk1,109:$Vl1,110:$Vm1,111:$Vn1,112:$Vo1},o($Vs1,[2,149]),{13:$V81,92:$V91,98:292,102:$VT,103:$VU,106:$VV,107:$VW,108:$Va1,110:$VY,111:$VZ,114:172,116:170,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{13:$V81,92:$V91,98:293,102:$VT,103:$VU,106:$VV,107:$VW,108:$Va1,110:$VY,111:$VZ,114:172,116:170,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51},{85:[1,294]},{85:[1,295]},o($Vz,[2,44],{17:296,10:$Vt}),o($Vz,[2,52],{17:297,10:$Vt}),o($V71,$V4,{5:298}),o($Vr1,[2,147],{105:283,10:$Ve1,87:$Vf1,99:$Vg1,102:$Vh1,106:$Vi1,107:$Vj1,108:$Vk1,109:$Vl1,110:$Vm1,111:$Vn1,112:$Vo1}),o($Vp1,[2,142],{114:172,116:221,10:[1,299],13:$V81,92:$V91,102:$VT,103:$VU,106:$VV,107:$VW,108:$Va1,110:$VY,111:$VZ,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51}),o($Vp1,[2,143],{114:172,116:221,10:[1,300],13:$V81,92:$V91,102:$VT,103:$VU,106:$VV,107:$VW,108:$Va1,110:$VY,111:$VZ,117:$V01,118:$V11,119:$V21,120:$V31,121:$V41,122:$V51}),o($Vp1,[2,133]),o($Vp1,[2,135]),o($Vz,[2,45]),o($Vz,[2,53]),{6:10,7:11,8:$V5,9:$V6,10:$V7,11:$V8,19:16,21:17,22:18,23:19,24:20,25:21,26:$V9,30:[1,301],32:23,33:29,35:30,87:$Va,88:$Vb,89:$Vc,90:$Vd,91:$Ve,92:$Vf,102:$Vg,103:$Vh,106:$Vi,107:$Vj,108:$Vk,110:$Vl,111:$Vm,115:31,117:$Vn,118:$Vo,119:$Vp,120:$Vq,121:$Vr,122:$Vs},{10:$Ve1,87:$Vf1,97:302,99:$Vg1,102:$Vh1,104:245,105:246,106:$Vi1,107:$Vj1,108:$Vk1,109:$Vl1,110:$Vm1,111:$Vn1,112:$Vo1},{10:$Ve1,87:$Vf1,97:303,99:$Vg1,102:$Vh1,104:245,105:246,106:$Vi1,107:$Vj1,108:$Vk1,109:$Vl1,110:$Vm1,111:$Vn1,112:$Vo1},o($Vu,[2,32]),o($Vp1,[2,140],{103:$Vq1}),o($Vp1,[2,141],{103:$Vq1})],
3860defaultActions: {},
3861parseError: function parseError (str, hash) {
3862 if (hash.recoverable) {
3863 this.trace(str);
3864 } else {
3865 var error = new Error(str);
3866 error.hash = hash;
3867 throw error;
3868 }
3869},
3870parse: function parse(input) {
3871 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
3872 var args = lstack.slice.call(arguments, 1);
3873 var lexer = Object.create(this.lexer);
3874 var sharedState = { yy: {} };
3875 for (var k in this.yy) {
3876 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
3877 sharedState.yy[k] = this.yy[k];
3878 }
3879 }
3880 lexer.setInput(input, sharedState.yy);
3881 sharedState.yy.lexer = lexer;
3882 sharedState.yy.parser = this;
3883 if (typeof lexer.yylloc == 'undefined') {
3884 lexer.yylloc = {};
3885 }
3886 var yyloc = lexer.yylloc;
3887 lstack.push(yyloc);
3888 var ranges = lexer.options && lexer.options.ranges;
3889 if (typeof sharedState.yy.parseError === 'function') {
3890 this.parseError = sharedState.yy.parseError;
3891 } else {
3892 this.parseError = Object.getPrototypeOf(this).parseError;
3893 }
3894 function popStack(n) {
3895 stack.length = stack.length - 2 * n;
3896 vstack.length = vstack.length - n;
3897 lstack.length = lstack.length - n;
3898 }
3899 function lex() {
3900 var token;
3901 token = tstack.pop() || lexer.lex() || EOF;
3902 if (typeof token !== 'number') {
3903 if (token instanceof Array) {
3904 tstack = token;
3905 token = tstack.pop();
3906 }
3907 token = self.symbols_[token] || token;
3908 }
3909 return token;
3910 }
3911 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
3912 while (true) {
3913 state = stack[stack.length - 1];
3914 if (this.defaultActions[state]) {
3915 action = this.defaultActions[state];
3916 } else {
3917 if (symbol === null || typeof symbol == 'undefined') {
3918 symbol = lex();
3919 }
3920 action = table[state] && table[state][symbol];
3921 }
3922 if (typeof action === 'undefined' || !action.length || !action[0]) {
3923 var errStr = '';
3924 expected = [];
3925 for (p in table[state]) {
3926 if (this.terminals_[p] && p > TERROR) {
3927 expected.push('\'' + this.terminals_[p] + '\'');
3928 }
3929 }
3930 if (lexer.showPosition) {
3931 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
3932 } else {
3933 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
3934 }
3935 this.parseError(errStr, {
3936 text: lexer.match,
3937 token: this.terminals_[symbol] || symbol,
3938 line: lexer.yylineno,
3939 loc: yyloc,
3940 expected: expected
3941 });
3942 }
3943 if (action[0] instanceof Array && action.length > 1) {
3944 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
3945 }
3946 switch (action[0]) {
3947 case 1:
3948 stack.push(symbol);
3949 vstack.push(lexer.yytext);
3950 lstack.push(lexer.yylloc);
3951 stack.push(action[1]);
3952 symbol = null;
3953 if (!preErrorSymbol) {
3954 yyleng = lexer.yyleng;
3955 yytext = lexer.yytext;
3956 yylineno = lexer.yylineno;
3957 yyloc = lexer.yylloc;
3958 if (recovering > 0) {
3959 recovering--;
3960 }
3961 } else {
3962 symbol = preErrorSymbol;
3963 preErrorSymbol = null;
3964 }
3965 break;
3966 case 2:
3967 len = this.productions_[action[1]][1];
3968 yyval.$ = vstack[vstack.length - len];
3969 yyval._$ = {
3970 first_line: lstack[lstack.length - (len || 1)].first_line,
3971 last_line: lstack[lstack.length - 1].last_line,
3972 first_column: lstack[lstack.length - (len || 1)].first_column,
3973 last_column: lstack[lstack.length - 1].last_column
3974 };
3975 if (ranges) {
3976 yyval._$.range = [
3977 lstack[lstack.length - (len || 1)].range[0],
3978 lstack[lstack.length - 1].range[1]
3979 ];
3980 }
3981 r = this.performAction.apply(yyval, [
3982 yytext,
3983 yyleng,
3984 yylineno,
3985 sharedState.yy,
3986 action[1],
3987 vstack,
3988 lstack
3989 ].concat(args));
3990 if (typeof r !== 'undefined') {
3991 return r;
3992 }
3993 if (len) {
3994 stack = stack.slice(0, -1 * len * 2);
3995 vstack = vstack.slice(0, -1 * len);
3996 lstack = lstack.slice(0, -1 * len);
3997 }
3998 stack.push(this.productions_[action[1]][0]);
3999 vstack.push(yyval.$);
4000 lstack.push(yyval._$);
4001 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
4002 stack.push(newState);
4003 break;
4004 case 3:
4005 return true;
4006 }
4007 }
4008 return true;
4009}};
4010
4011/* generated by jison-lex 0.3.4 */
4012var lexer = (function(){
4013var lexer = ({
4014
4015EOF:1,
4016
4017parseError:function parseError(str, hash) {
4018 if (this.yy.parser) {
4019 this.yy.parser.parseError(str, hash);
4020 } else {
4021 throw new Error(str);
4022 }
4023 },
4024
4025// resets the lexer, sets new input
4026setInput:function (input, yy) {
4027 this.yy = yy || this.yy || {};
4028 this._input = input;
4029 this._more = this._backtrack = this.done = false;
4030 this.yylineno = this.yyleng = 0;
4031 this.yytext = this.matched = this.match = '';
4032 this.conditionStack = ['INITIAL'];
4033 this.yylloc = {
4034 first_line: 1,
4035 first_column: 0,
4036 last_line: 1,
4037 last_column: 0
4038 };
4039 if (this.options.ranges) {
4040 this.yylloc.range = [0,0];
4041 }
4042 this.offset = 0;
4043 return this;
4044 },
4045
4046// consumes and returns one char from the input
4047input:function () {
4048 var ch = this._input[0];
4049 this.yytext += ch;
4050 this.yyleng++;
4051 this.offset++;
4052 this.match += ch;
4053 this.matched += ch;
4054 var lines = ch.match(/(?:\r\n?|\n).*/g);
4055 if (lines) {
4056 this.yylineno++;
4057 this.yylloc.last_line++;
4058 } else {
4059 this.yylloc.last_column++;
4060 }
4061 if (this.options.ranges) {
4062 this.yylloc.range[1]++;
4063 }
4064
4065 this._input = this._input.slice(1);
4066 return ch;
4067 },
4068
4069// unshifts one char (or a string) into the input
4070unput:function (ch) {
4071 var len = ch.length;
4072 var lines = ch.split(/(?:\r\n?|\n)/g);
4073
4074 this._input = ch + this._input;
4075 this.yytext = this.yytext.substr(0, this.yytext.length - len);
4076 //this.yyleng -= len;
4077 this.offset -= len;
4078 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
4079 this.match = this.match.substr(0, this.match.length - 1);
4080 this.matched = this.matched.substr(0, this.matched.length - 1);
4081
4082 if (lines.length - 1) {
4083 this.yylineno -= lines.length - 1;
4084 }
4085 var r = this.yylloc.range;
4086
4087 this.yylloc = {
4088 first_line: this.yylloc.first_line,
4089 last_line: this.yylineno + 1,
4090 first_column: this.yylloc.first_column,
4091 last_column: lines ?
4092 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
4093 + oldLines[oldLines.length - lines.length].length - lines[0].length :
4094 this.yylloc.first_column - len
4095 };
4096
4097 if (this.options.ranges) {
4098 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
4099 }
4100 this.yyleng = this.yytext.length;
4101 return this;
4102 },
4103
4104// When called from action, caches matched text and appends it on next action
4105more:function () {
4106 this._more = true;
4107 return this;
4108 },
4109
4110// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
4111reject:function () {
4112 if (this.options.backtrack_lexer) {
4113 this._backtrack = true;
4114 } else {
4115 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
4116 text: "",
4117 token: null,
4118 line: this.yylineno
4119 });
4120
4121 }
4122 return this;
4123 },
4124
4125// retain first n characters of the match
4126less:function (n) {
4127 this.unput(this.match.slice(n));
4128 },
4129
4130// displays already matched input, i.e. for error messages
4131pastInput:function () {
4132 var past = this.matched.substr(0, this.matched.length - this.match.length);
4133 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
4134 },
4135
4136// displays upcoming input, i.e. for error messages
4137upcomingInput:function () {
4138 var next = this.match;
4139 if (next.length < 20) {
4140 next += this._input.substr(0, 20-next.length);
4141 }
4142 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
4143 },
4144
4145// displays the character position where the lexing error occurred, i.e. for error messages
4146showPosition:function () {
4147 var pre = this.pastInput();
4148 var c = new Array(pre.length + 1).join("-");
4149 return pre + this.upcomingInput() + "\n" + c + "^";
4150 },
4151
4152// test the lexed token: return FALSE when not a match, otherwise return token
4153test_match:function(match, indexed_rule) {
4154 var token,
4155 lines,
4156 backup;
4157
4158 if (this.options.backtrack_lexer) {
4159 // save context
4160 backup = {
4161 yylineno: this.yylineno,
4162 yylloc: {
4163 first_line: this.yylloc.first_line,
4164 last_line: this.last_line,
4165 first_column: this.yylloc.first_column,
4166 last_column: this.yylloc.last_column
4167 },
4168 yytext: this.yytext,
4169 match: this.match,
4170 matches: this.matches,
4171 matched: this.matched,
4172 yyleng: this.yyleng,
4173 offset: this.offset,
4174 _more: this._more,
4175 _input: this._input,
4176 yy: this.yy,
4177 conditionStack: this.conditionStack.slice(0),
4178 done: this.done
4179 };
4180 if (this.options.ranges) {
4181 backup.yylloc.range = this.yylloc.range.slice(0);
4182 }
4183 }
4184
4185 lines = match[0].match(/(?:\r\n?|\n).*/g);
4186 if (lines) {
4187 this.yylineno += lines.length;
4188 }
4189 this.yylloc = {
4190 first_line: this.yylloc.last_line,
4191 last_line: this.yylineno + 1,
4192 first_column: this.yylloc.last_column,
4193 last_column: lines ?
4194 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
4195 this.yylloc.last_column + match[0].length
4196 };
4197 this.yytext += match[0];
4198 this.match += match[0];
4199 this.matches = match;
4200 this.yyleng = this.yytext.length;
4201 if (this.options.ranges) {
4202 this.yylloc.range = [this.offset, this.offset += this.yyleng];
4203 }
4204 this._more = false;
4205 this._backtrack = false;
4206 this._input = this._input.slice(match[0].length);
4207 this.matched += match[0];
4208 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
4209 if (this.done && this._input) {
4210 this.done = false;
4211 }
4212 if (token) {
4213 return token;
4214 } else if (this._backtrack) {
4215 // recover context
4216 for (var k in backup) {
4217 this[k] = backup[k];
4218 }
4219 return false; // rule action called reject() implying the next rule should be tested instead.
4220 }
4221 return false;
4222 },
4223
4224// return next match in input
4225next:function () {
4226 if (this.done) {
4227 return this.EOF;
4228 }
4229 if (!this._input) {
4230 this.done = true;
4231 }
4232
4233 var token,
4234 match,
4235 tempMatch,
4236 index;
4237 if (!this._more) {
4238 this.yytext = '';
4239 this.match = '';
4240 }
4241 var rules = this._currentRules();
4242 for (var i = 0; i < rules.length; i++) {
4243 tempMatch = this._input.match(this.rules[rules[i]]);
4244 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
4245 match = tempMatch;
4246 index = i;
4247 if (this.options.backtrack_lexer) {
4248 token = this.test_match(tempMatch, rules[i]);
4249 if (token !== false) {
4250 return token;
4251 } else if (this._backtrack) {
4252 match = false;
4253 continue; // rule action called reject() implying a rule MISmatch.
4254 } else {
4255 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
4256 return false;
4257 }
4258 } else if (!this.options.flex) {
4259 break;
4260 }
4261 }
4262 }
4263 if (match) {
4264 token = this.test_match(match, rules[index]);
4265 if (token !== false) {
4266 return token;
4267 }
4268 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
4269 return false;
4270 }
4271 if (this._input === "") {
4272 return this.EOF;
4273 } else {
4274 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
4275 text: "",
4276 token: null,
4277 line: this.yylineno
4278 });
4279 }
4280 },
4281
4282// return next match that has a token
4283lex:function lex () {
4284 var r = this.next();
4285 if (r) {
4286 return r;
4287 } else {
4288 return this.lex();
4289 }
4290 },
4291
4292// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
4293begin:function begin (condition) {
4294 this.conditionStack.push(condition);
4295 },
4296
4297// pop the previously active lexer condition state off the condition stack
4298popState:function popState () {
4299 var n = this.conditionStack.length - 1;
4300 if (n > 0) {
4301 return this.conditionStack.pop();
4302 } else {
4303 return this.conditionStack[0];
4304 }
4305 },
4306
4307// produce the lexer rule set which is active for the currently active lexer condition state
4308_currentRules:function _currentRules () {
4309 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
4310 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
4311 } else {
4312 return this.conditions["INITIAL"].rules;
4313 }
4314 },
4315
4316// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
4317topState:function topState (n) {
4318 n = this.conditionStack.length - 1 - Math.abs(n || 0);
4319 if (n >= 0) {
4320 return this.conditionStack[n];
4321 } else {
4322 return "INITIAL";
4323 }
4324 },
4325
4326// alias for begin(condition)
4327pushState:function pushState (condition) {
4328 this.begin(condition);
4329 },
4330
4331// return the number of states currently on the stack
4332stateStackSize:function stateStackSize() {
4333 return this.conditionStack.length;
4334 },
4335options: {},
4336performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
4337var YYSTATE=YY_START;
4338switch($avoiding_name_collisions) {
4339case 0:/* do nothing */
4340break;
4341case 1:this.begin("string");
4342break;
4343case 2:this.popState();
4344break;
4345case 3:return "STR";
4346break;
4347case 4:return 87;
4348break;
4349case 5:return 96;
4350break;
4351case 6:return 88;
4352break;
4353case 7:return 101;
4354break;
4355case 8:return 89;
4356break;
4357case 9:return 90;
4358break;
4359case 10:return 91;
4360break;
4361case 11:if(yy.lex.firstGraph()){this.begin("dir");} return 12;
4362break;
4363case 12:return 26;
4364break;
4365case 13:return 30;
4366break;
4367case 14: this.popState(); return 13;
4368break;
4369case 15: this.popState(); return 13;
4370break;
4371case 16: this.popState(); return 13;
4372break;
4373case 17: this.popState(); return 13;
4374break;
4375case 18: this.popState(); return 13;
4376break;
4377case 19: this.popState(); return 13;
4378break;
4379case 20: this.popState(); return 13;
4380break;
4381case 21: this.popState(); return 13;
4382break;
4383case 22: this.popState(); return 13;
4384break;
4385case 23: this.popState(); return 13;
4386break;
4387case 24: return 102;
4388break;
4389case 25:return 110;
4390break;
4391case 26:return 34;
4392break;
4393case 27:return 107;
4394break;
4395case 28:return 8;
4396break;
4397case 29:return 103;
4398break;
4399case 30:return 121;
4400break;
4401case 31:return 55;
4402break;
4403case 32:return 51;
4404break;
4405case 33:return 74;
4406break;
4407case 34:return 76;
4408break;
4409case 35:return 75;
4410break;
4411case 36:return 78;
4412break;
4413case 37:return 80;
4414break;
4415case 38:return 81;
4416break;
4417case 39:return 82;
4418break;
4419case 40:return 79;
4420break;
4421case 41:return 79;
4422break;
4423case 42:return 77;
4424break;
4425case 43:return 77;
4426break;
4427case 44:return 78;
4428break;
4429case 45:return 53;
4430break;
4431case 46:return 57;
4432break;
4433case 47:return 63;
4434break;
4435case 48:return 59;
4436break;
4437case 49:return 61;
4438break;
4439case 50:return 65;
4440break;
4441case 51:return 63;
4442break;
4443case 52:return 59;
4444break;
4445case 53:return 61;
4446break;
4447case 54:return 65;
4448break;
4449case 55:return 71;
4450break;
4451case 56:return 67;
4452break;
4453case 57:return 69;
4454break;
4455case 58:return 73;
4456break;
4457case 59:return 52;
4458break;
4459case 60:return 56;
4460break;
4461case 61:return 54;
4462break;
4463case 62:return 60;
4464break;
4465case 63:return 64;
4466break;
4467case 64:return 62;
4468break;
4469case 65:return 68;
4470break;
4471case 66:return 72;
4472break;
4473case 67:return 70;
4474break;
4475case 68:return 50;
4476break;
4477case 69:return 58;
4478break;
4479case 70:return 66;
4480break;
4481case 71:return 38;
4482break;
4483case 72:return 39;
4484break;
4485case 73:return 108;
4486break;
4487case 74:return 111;
4488break;
4489case 75:return 122;
4490break;
4491case 76:return 119;
4492break;
4493case 77:return 112;
4494break;
4495case 78:return 120;
4496break;
4497case 79:return 120;
4498break;
4499case 80:return 113;
4500break;
4501case 81:return 42;
4502break;
4503case 82:return 93;
4504break;
4505case 83:return 92;
4506break;
4507case 84:return 106;
4508break;
4509case 85:return 44;
4510break;
4511case 86:return 43;
4512break;
4513case 87:return 46;
4514break;
4515case 88:return 45;
4516break;
4517case 89:return 117;
4518break;
4519case 90:return 118;
4520break;
4521case 91:return 83;
4522break;
4523case 92:return 36;
4524break;
4525case 93:return 37;
4526break;
4527case 94:return 28;
4528break;
4529case 95:return 29;
4530break;
4531case 96:return 40
4532break;
4533case 97:return 41
4534break;
4535case 98:return 124;
4536break;
4537case 99:return 9;
4538break;
4539case 100:return 10;
4540break;
4541case 101:return 11;
4542break;
4543}
4544},
4545rules: [/^(?:%%[^\n]*\n*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*--[x]\s*)/,/^(?:\s*-->\s*)/,/^(?:\s*<-->\s*)/,/^(?:\s*[x]--[x]\s*)/,/^(?:\s*[o]--[o]\s*)/,/^(?:\s*[o]\.-[o]\s*)/,/^(?:\s*<==>\s*)/,/^(?:\s*[o]==[o]\s*)/,/^(?:\s*[x]==[x]\s*)/,/^(?:\s*[x].-[x]\s*)/,/^(?:\s*[x]-\.-[x]\s*)/,/^(?:\s*<\.->\s*)/,/^(?:\s*<-\.->\s*)/,/^(?:\s*[o]-\.-[o]\s*)/,/^(?:\s*--[o]\s*)/,/^(?:\s*---\s*)/,/^(?:\s*-\.-[x]\s*)/,/^(?:\s*-\.->\s*)/,/^(?:\s*-\.-[o]\s*)/,/^(?:\s*-\.-\s*)/,/^(?:\s*.-[x]\s*)/,/^(?:\s*\.->\s*)/,/^(?:\s*\.-[o]\s*)/,/^(?:\s*\.-\s*)/,/^(?:\s*==[x]\s*)/,/^(?:\s*==>\s*)/,/^(?:\s*==[o]\s*)/,/^(?:\s*==[\=]\s*)/,/^(?:\s*<--\s*)/,/^(?:\s*[x]--\s*)/,/^(?:\s*[o]--\s*)/,/^(?:\s*<-\.\s*)/,/^(?:\s*[x]-\.\s*)/,/^(?:\s*[o]-\.\s*)/,/^(?:\s*<==\s*)/,/^(?:\s*[x]==\s*)/,/^(?:\s*[o]==\s*)/,/^(?:\s*--\s*)/,/^(?:\s*-\.\s*)/,/^(?:\s*==\s*)/,/^(?:\(-)/,/^(?:-\))/,/^(?:-)/,/^(?:\.)/,/^(?:[\_])/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:v\b)/,/^(?:[A-Za-z]+)/,/^(?:\\\])/,/^(?:\[\/)/,/^(?:\/\])/,/^(?:\[\\)/,/^(?:[!"#$%&'*+,-.`?\\_\/])/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:(\r|\n|\r\n)+)/,/^(?:\s)/,/^(?:$)/],
4546conditions: {"dir":{"rules":[14,15,16,17,18,19,20,21,22,23],"inclusive":false},"string":{"rules":[2,3],"inclusive":false},"INITIAL":{"rules":[0,1,4,5,6,7,8,9,10,11,12,13,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101],"inclusive":true}}
4547});
4548return lexer;
4549})();
4550parser.lexer = lexer;
4551function Parser () {
4552 this.yy = {};
4553}
4554Parser.prototype = parser;parser.Parser = Parser;
4555return new Parser;
4556})();
4557
4558
4559if (true) {
4560exports.parser = parser;
4561exports.Parser = parser.Parser;
4562exports.parse = function () { return parser.parse.apply(parser, arguments); };
4563exports.main = function commonjsMain (args) {
4564 if (!args[1]) {
4565 console.log('Usage: '+args[0]+' FILE');
4566 process.exit(1);
4567 }
4568 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
4569 return exports.parser.parse(source);
4570};
4571if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
4572 exports.main(process.argv.slice(1));
4573}
4574}
4575/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
4576
4577/***/ }),
4578
4579/***/ "./src/diagrams/gantt/ganttDb.js":
4580/*!***************************************!*\
4581 !*** ./src/diagrams/gantt/ganttDb.js ***!
4582 \***************************************/
4583/*! exports provided: clear, setAxisFormat, getAxisFormat, setDateFormat, enableInclusiveEndDates, endDatesAreInclusive, getDateFormat, setExcludes, getExcludes, setTitle, getTitle, addSection, getSections, getTasks, addTask, findTaskById, addTaskOrg, setLink, setClass, setClickEvent, bindFunctions, default */
4584/***/ (function(module, __webpack_exports__, __webpack_require__) {
4585
4586"use strict";
4587__webpack_require__.r(__webpack_exports__);
4588/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
4589/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAxisFormat", function() { return setAxisFormat; });
4590/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAxisFormat", function() { return getAxisFormat; });
4591/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDateFormat", function() { return setDateFormat; });
4592/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableInclusiveEndDates", function() { return enableInclusiveEndDates; });
4593/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endDatesAreInclusive", function() { return endDatesAreInclusive; });
4594/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDateFormat", function() { return getDateFormat; });
4595/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setExcludes", function() { return setExcludes; });
4596/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getExcludes", function() { return getExcludes; });
4597/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTitle", function() { return setTitle; });
4598/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTitle", function() { return getTitle; });
4599/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSection", function() { return addSection; });
4600/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSections", function() { return getSections; });
4601/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTasks", function() { return getTasks; });
4602/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addTask", function() { return addTask; });
4603/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findTaskById", function() { return findTaskById; });
4604/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addTaskOrg", function() { return addTaskOrg; });
4605/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLink", function() { return setLink; });
4606/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setClass", function() { return setClass; });
4607/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setClickEvent", function() { return setClickEvent; });
4608/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindFunctions", function() { return bindFunctions; });
4609/* harmony import */ var moment_mini__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment-mini */ "moment-mini");
4610/* harmony import */ var moment_mini__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment_mini__WEBPACK_IMPORTED_MODULE_0__);
4611/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @braintree/sanitize-url */ "@braintree/sanitize-url");
4612/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__);
4613/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
4614/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../config */ "./src/config.js");
4615function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
4616
4617function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
4618
4619function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
4620
4621function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
4622
4623
4624
4625
4626
4627var config = Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])();
4628var dateFormat = '';
4629var axisFormat = '';
4630var excludes = [];
4631var title = '';
4632var sections = [];
4633var tasks = [];
4634var currentSection = '';
4635var tags = ['active', 'done', 'crit', 'milestone'];
4636var funs = [];
4637var inclusiveEndDates = false;
4638var clear = function clear() {
4639 sections = [];
4640 tasks = [];
4641 currentSection = '';
4642 funs = [];
4643 title = '';
4644 taskCnt = 0;
4645 lastTask = undefined;
4646 lastTaskID = undefined;
4647 rawTasks = [];
4648 dateFormat = '';
4649 axisFormat = '';
4650 excludes = [];
4651 inclusiveEndDates = false;
4652};
4653var setAxisFormat = function setAxisFormat(txt) {
4654 axisFormat = txt;
4655};
4656var getAxisFormat = function getAxisFormat() {
4657 return axisFormat;
4658};
4659var setDateFormat = function setDateFormat(txt) {
4660 dateFormat = txt;
4661};
4662var enableInclusiveEndDates = function enableInclusiveEndDates() {
4663 inclusiveEndDates = true;
4664};
4665var endDatesAreInclusive = function endDatesAreInclusive() {
4666 return inclusiveEndDates;
4667};
4668var getDateFormat = function getDateFormat() {
4669 return dateFormat;
4670};
4671var setExcludes = function setExcludes(txt) {
4672 excludes = txt.toLowerCase().split(/[\s,]+/);
4673};
4674var getExcludes = function getExcludes() {
4675 return excludes;
4676};
4677var setTitle = function setTitle(txt) {
4678 title = txt;
4679};
4680var getTitle = function getTitle() {
4681 return title;
4682};
4683var addSection = function addSection(txt) {
4684 currentSection = txt;
4685 sections.push(txt);
4686};
4687var getSections = function getSections() {
4688 return sections;
4689};
4690var getTasks = function getTasks() {
4691 var allItemsPricessed = compileTasks();
4692 var maxDepth = 10;
4693 var iterationCount = 0;
4694
4695 while (!allItemsPricessed && iterationCount < maxDepth) {
4696 allItemsPricessed = compileTasks();
4697 iterationCount++;
4698 }
4699
4700 tasks = rawTasks;
4701 return tasks;
4702};
4703
4704var isInvalidDate = function isInvalidDate(date, dateFormat, excludes) {
4705 if (date.isoWeekday() >= 6 && excludes.indexOf('weekends') >= 0) {
4706 return true;
4707 }
4708
4709 if (excludes.indexOf(date.format('dddd').toLowerCase()) >= 0) {
4710 return true;
4711 }
4712
4713 return excludes.indexOf(date.format(dateFormat.trim())) >= 0;
4714};
4715
4716var checkTaskDates = function checkTaskDates(task, dateFormat, excludes) {
4717 if (!excludes.length || task.manualEndTime) return;
4718 var startTime = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(task.startTime, dateFormat, true);
4719 startTime.add(1, 'd');
4720 var endTime = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(task.endTime, dateFormat, true);
4721 var renderEndTime = fixTaskDates(startTime, endTime, dateFormat, excludes);
4722 task.endTime = endTime.toDate();
4723 task.renderEndTime = renderEndTime;
4724};
4725
4726var fixTaskDates = function fixTaskDates(startTime, endTime, dateFormat, excludes) {
4727 var invalid = false;
4728 var renderEndTime = null;
4729
4730 while (startTime.date() <= endTime.date()) {
4731 if (!invalid) {
4732 renderEndTime = endTime.toDate();
4733 }
4734
4735 invalid = isInvalidDate(startTime, dateFormat, excludes);
4736
4737 if (invalid) {
4738 endTime.add(1, 'd');
4739 }
4740
4741 startTime.add(1, 'd');
4742 }
4743
4744 return renderEndTime;
4745};
4746
4747var getStartDate = function getStartDate(prevTime, dateFormat, str) {
4748 str = str.trim(); // Test for after
4749
4750 var re = /^after\s+([\d\w-]+)/;
4751 var afterStatement = re.exec(str.trim());
4752
4753 if (afterStatement !== null) {
4754 var task = findTaskById(afterStatement[1]);
4755
4756 if (typeof task === 'undefined') {
4757 var dt = new Date();
4758 dt.setHours(0, 0, 0, 0);
4759 return dt;
4760 }
4761
4762 return task.endTime;
4763 } // Check for actual date set
4764
4765
4766 var mDate = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(str, dateFormat.trim(), true);
4767
4768 if (mDate.isValid()) {
4769 return mDate.toDate();
4770 } else {
4771 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Invalid date:' + str);
4772 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('With date format:' + dateFormat.trim());
4773 } // Default date - now
4774
4775
4776 return new Date();
4777};
4778
4779var durationToDate = function durationToDate(durationStatement, relativeTime) {
4780 if (durationStatement !== null) {
4781 switch (durationStatement[2]) {
4782 case 's':
4783 relativeTime.add(durationStatement[1], 'seconds');
4784 break;
4785
4786 case 'm':
4787 relativeTime.add(durationStatement[1], 'minutes');
4788 break;
4789
4790 case 'h':
4791 relativeTime.add(durationStatement[1], 'hours');
4792 break;
4793
4794 case 'd':
4795 relativeTime.add(durationStatement[1], 'days');
4796 break;
4797
4798 case 'w':
4799 relativeTime.add(durationStatement[1], 'weeks');
4800 break;
4801 }
4802 } // Default date - now
4803
4804
4805 return relativeTime.toDate();
4806};
4807
4808var getEndDate = function getEndDate(prevTime, dateFormat, str, inclusive) {
4809 inclusive = inclusive || false;
4810 str = str.trim(); // Check for actual date
4811
4812 var mDate = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(str, dateFormat.trim(), true);
4813
4814 if (mDate.isValid()) {
4815 if (inclusive) {
4816 mDate.add(1, 'd');
4817 }
4818
4819 return mDate.toDate();
4820 }
4821
4822 return durationToDate(/^([\d]+)([wdhms])/.exec(str.trim()), moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(prevTime));
4823};
4824
4825var taskCnt = 0;
4826
4827var parseId = function parseId(idStr) {
4828 if (typeof idStr === 'undefined') {
4829 taskCnt = taskCnt + 1;
4830 return 'task' + taskCnt;
4831 }
4832
4833 return idStr;
4834}; // id, startDate, endDate
4835// id, startDate, length
4836// id, after x, endDate
4837// id, after x, length
4838// startDate, endDate
4839// startDate, length
4840// after x, endDate
4841// after x, length
4842// endDate
4843// length
4844
4845
4846var compileData = function compileData(prevTask, dataStr) {
4847 var ds;
4848
4849 if (dataStr.substr(0, 1) === ':') {
4850 ds = dataStr.substr(1, dataStr.length);
4851 } else {
4852 ds = dataStr;
4853 }
4854
4855 var data = ds.split(',');
4856 var task = {}; // Get tags like active, done, crit and milestone
4857
4858 getTaskTags(data, task, tags);
4859
4860 for (var i = 0; i < data.length; i++) {
4861 data[i] = data[i].trim();
4862 }
4863
4864 var endTimeData = '';
4865
4866 switch (data.length) {
4867 case 1:
4868 task.id = parseId();
4869 task.startTime = prevTask.endTime;
4870 endTimeData = data[0];
4871 break;
4872
4873 case 2:
4874 task.id = parseId();
4875 task.startTime = getStartDate(undefined, dateFormat, data[0]);
4876 endTimeData = data[1];
4877 break;
4878
4879 case 3:
4880 task.id = parseId(data[0]);
4881 task.startTime = getStartDate(undefined, dateFormat, data[1]);
4882 endTimeData = data[2];
4883 break;
4884
4885 default:
4886 }
4887
4888 if (endTimeData) {
4889 task.endTime = getEndDate(task.startTime, dateFormat, endTimeData, inclusiveEndDates);
4890 task.manualEndTime = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(endTimeData, 'YYYY-MM-DD', true).isValid();
4891 checkTaskDates(task, dateFormat, excludes);
4892 }
4893
4894 return task;
4895};
4896
4897var parseData = function parseData(prevTaskId, dataStr) {
4898 var ds;
4899
4900 if (dataStr.substr(0, 1) === ':') {
4901 ds = dataStr.substr(1, dataStr.length);
4902 } else {
4903 ds = dataStr;
4904 }
4905
4906 var data = ds.split(',');
4907 var task = {}; // Get tags like active, done, crit and milestone
4908
4909 getTaskTags(data, task, tags);
4910
4911 for (var i = 0; i < data.length; i++) {
4912 data[i] = data[i].trim();
4913 }
4914
4915 switch (data.length) {
4916 case 1:
4917 task.id = parseId();
4918 task.startTime = {
4919 type: 'prevTaskEnd',
4920 id: prevTaskId
4921 };
4922 task.endTime = {
4923 data: data[0]
4924 };
4925 break;
4926
4927 case 2:
4928 task.id = parseId();
4929 task.startTime = {
4930 type: 'getStartDate',
4931 startData: data[0]
4932 };
4933 task.endTime = {
4934 data: data[1]
4935 };
4936 break;
4937
4938 case 3:
4939 task.id = parseId(data[0]);
4940 task.startTime = {
4941 type: 'getStartDate',
4942 startData: data[1]
4943 };
4944 task.endTime = {
4945 data: data[2]
4946 };
4947 break;
4948
4949 default:
4950 }
4951
4952 return task;
4953};
4954
4955var lastTask;
4956var lastTaskID;
4957var rawTasks = [];
4958var taskDb = {};
4959var addTask = function addTask(descr, data) {
4960 var rawTask = {
4961 section: currentSection,
4962 type: currentSection,
4963 processed: false,
4964 manualEndTime: false,
4965 renderEndTime: null,
4966 raw: {
4967 data: data
4968 },
4969 task: descr,
4970 classes: []
4971 };
4972 var taskInfo = parseData(lastTaskID, data);
4973 rawTask.raw.startTime = taskInfo.startTime;
4974 rawTask.raw.endTime = taskInfo.endTime;
4975 rawTask.id = taskInfo.id;
4976 rawTask.prevTaskId = lastTaskID;
4977 rawTask.active = taskInfo.active;
4978 rawTask.done = taskInfo.done;
4979 rawTask.crit = taskInfo.crit;
4980 rawTask.milestone = taskInfo.milestone;
4981 var pos = rawTasks.push(rawTask);
4982 lastTaskID = rawTask.id; // Store cross ref
4983
4984 taskDb[rawTask.id] = pos - 1;
4985};
4986var findTaskById = function findTaskById(id) {
4987 var pos = taskDb[id];
4988 return rawTasks[pos];
4989};
4990var addTaskOrg = function addTaskOrg(descr, data) {
4991 var newTask = {
4992 section: currentSection,
4993 type: currentSection,
4994 description: descr,
4995 task: descr,
4996 classes: []
4997 };
4998 var taskInfo = compileData(lastTask, data);
4999 newTask.startTime = taskInfo.startTime;
5000 newTask.endTime = taskInfo.endTime;
5001 newTask.id = taskInfo.id;
5002 newTask.active = taskInfo.active;
5003 newTask.done = taskInfo.done;
5004 newTask.crit = taskInfo.crit;
5005 newTask.milestone = taskInfo.milestone;
5006 lastTask = newTask;
5007 tasks.push(newTask);
5008};
5009
5010var compileTasks = function compileTasks() {
5011 var compileTask = function compileTask(pos) {
5012 var task = rawTasks[pos];
5013 var startTime = '';
5014
5015 switch (rawTasks[pos].raw.startTime.type) {
5016 case 'prevTaskEnd':
5017 {
5018 var prevTask = findTaskById(task.prevTaskId);
5019 task.startTime = prevTask.endTime;
5020 break;
5021 }
5022
5023 case 'getStartDate':
5024 startTime = getStartDate(undefined, dateFormat, rawTasks[pos].raw.startTime.startData);
5025
5026 if (startTime) {
5027 rawTasks[pos].startTime = startTime;
5028 }
5029
5030 break;
5031 }
5032
5033 if (rawTasks[pos].startTime) {
5034 rawTasks[pos].endTime = getEndDate(rawTasks[pos].startTime, dateFormat, rawTasks[pos].raw.endTime.data, inclusiveEndDates);
5035
5036 if (rawTasks[pos].endTime) {
5037 rawTasks[pos].processed = true;
5038 rawTasks[pos].manualEndTime = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(rawTasks[pos].raw.endTime.data, 'YYYY-MM-DD', true).isValid();
5039 checkTaskDates(rawTasks[pos], dateFormat, excludes);
5040 }
5041 }
5042
5043 return rawTasks[pos].processed;
5044 };
5045
5046 var allProcessed = true;
5047
5048 for (var i = 0; i < rawTasks.length; i++) {
5049 compileTask(i);
5050 allProcessed = allProcessed && rawTasks[i].processed;
5051 }
5052
5053 return allProcessed;
5054};
5055/**
5056 * Called by parser when a link is found. Adds the URL to the vertex data.
5057 * @param ids Comma separated list of ids
5058 * @param linkStr URL to create a link for
5059 */
5060
5061
5062var setLink = function setLink(ids, _linkStr) {
5063 var linkStr = _linkStr;
5064
5065 if (config.securityLevel !== 'loose') {
5066 linkStr = Object(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__["sanitizeUrl"])(_linkStr);
5067 }
5068
5069 ids.split(',').forEach(function (id) {
5070 var rawTask = findTaskById(id);
5071
5072 if (typeof rawTask !== 'undefined') {
5073 pushFun(id, function () {
5074 window.open(linkStr, '_self');
5075 });
5076 }
5077 });
5078 setClass(ids, 'clickable');
5079};
5080/**
5081 * Called by parser when a special node is found, e.g. a clickable element.
5082 * @param ids Comma separated list of ids
5083 * @param className Class to add
5084 */
5085
5086var setClass = function setClass(ids, className) {
5087 ids.split(',').forEach(function (id) {
5088 var rawTask = findTaskById(id);
5089
5090 if (typeof rawTask !== 'undefined') {
5091 rawTask.classes.push(className);
5092 }
5093 });
5094};
5095
5096var setClickFun = function setClickFun(id, functionName, functionArgs) {
5097 if (config.securityLevel !== 'loose') {
5098 return;
5099 }
5100
5101 if (typeof functionName === 'undefined') {
5102 return;
5103 }
5104
5105 var argList = [];
5106
5107 if (typeof functionArgs === 'string') {
5108 /* Splits functionArgs by ',', ignoring all ',' in double quoted strings */
5109 argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
5110
5111 for (var i = 0; i < argList.length; i++) {
5112 var item = argList[i].trim();
5113 /* Removes all double quotes at the start and end of an argument */
5114
5115 /* This preserves all starting and ending whitespace inside */
5116
5117 if (item.charAt(0) === '"' && item.charAt(item.length - 1) === '"') {
5118 item = item.substr(1, item.length - 2);
5119 }
5120
5121 argList[i] = item;
5122 }
5123 }
5124
5125 var rawTask = findTaskById(id);
5126
5127 if (typeof rawTask !== 'undefined') {
5128 pushFun(id, function () {
5129 var _window;
5130
5131 (_window = window)[functionName].apply(_window, _toConsumableArray(argList));
5132 });
5133 }
5134};
5135/**
5136 * The callbackFunction is executed in a click event bound to the task with the specified id or the task's assigned text
5137 * @param id The task's id
5138 * @param callbackFunction A function to be executed when clicked on the task or the task's text
5139 */
5140
5141
5142var pushFun = function pushFun(id, callbackFunction) {
5143 funs.push(function () {
5144 // const elem = d3.select(element).select(`[id="${id}"]`)
5145 var elem = document.querySelector("[id=\"".concat(id, "\"]"));
5146
5147 if (elem !== null) {
5148 elem.addEventListener('click', function () {
5149 callbackFunction();
5150 });
5151 }
5152 });
5153 funs.push(function () {
5154 // const elem = d3.select(element).select(`[id="${id}-text"]`)
5155 var elem = document.querySelector("[id=\"".concat(id, "-text\"]"));
5156
5157 if (elem !== null) {
5158 elem.addEventListener('click', function () {
5159 callbackFunction();
5160 });
5161 }
5162 });
5163};
5164/**
5165 * Called by parser when a click definition is found. Registers an event handler.
5166 * @param ids Comma separated list of ids
5167 * @param functionName Function to be called on click
5168 * @param functionArgs Function args the function should be called with
5169 */
5170
5171
5172var setClickEvent = function setClickEvent(ids, functionName, functionArgs) {
5173 ids.split(',').forEach(function (id) {
5174 setClickFun(id, functionName, functionArgs);
5175 });
5176 setClass(ids, 'clickable');
5177};
5178/**
5179 * Binds all functions previously added to fun (specified through click) to the element
5180 * @param element
5181 */
5182
5183var bindFunctions = function bindFunctions(element) {
5184 funs.forEach(function (fun) {
5185 fun(element);
5186 });
5187};
5188/* harmony default export */ __webpack_exports__["default"] = ({
5189 clear: clear,
5190 setDateFormat: setDateFormat,
5191 getDateFormat: getDateFormat,
5192 enableInclusiveEndDates: enableInclusiveEndDates,
5193 endDatesAreInclusive: endDatesAreInclusive,
5194 setAxisFormat: setAxisFormat,
5195 getAxisFormat: getAxisFormat,
5196 setTitle: setTitle,
5197 getTitle: getTitle,
5198 addSection: addSection,
5199 getSections: getSections,
5200 getTasks: getTasks,
5201 addTask: addTask,
5202 findTaskById: findTaskById,
5203 addTaskOrg: addTaskOrg,
5204 setExcludes: setExcludes,
5205 getExcludes: getExcludes,
5206 setClickEvent: setClickEvent,
5207 setLink: setLink,
5208 bindFunctions: bindFunctions,
5209 durationToDate: durationToDate
5210});
5211
5212function getTaskTags(data, task, tags) {
5213 var matchFound = true;
5214
5215 while (matchFound) {
5216 matchFound = false;
5217 tags.forEach(function (t) {
5218 var pattern = '^\\s*' + t + '\\s*$';
5219 var regex = new RegExp(pattern);
5220
5221 if (data[0].match(regex)) {
5222 task[t] = true;
5223 data.shift(1);
5224 matchFound = true;
5225 }
5226 });
5227 }
5228}
5229
5230/***/ }),
5231
5232/***/ "./src/diagrams/gantt/ganttRenderer.js":
5233/*!*********************************************!*\
5234 !*** ./src/diagrams/gantt/ganttRenderer.js ***!
5235 \*********************************************/
5236/*! exports provided: setConf, draw, default */
5237/***/ (function(module, __webpack_exports__, __webpack_require__) {
5238
5239"use strict";
5240__webpack_require__.r(__webpack_exports__);
5241/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
5242/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
5243/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
5244/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
5245/* harmony import */ var _parser_gantt__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parser/gantt */ "./src/diagrams/gantt/parser/gantt.jison");
5246/* harmony import */ var _parser_gantt__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_parser_gantt__WEBPACK_IMPORTED_MODULE_1__);
5247/* harmony import */ var _ganttDb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ganttDb */ "./src/diagrams/gantt/ganttDb.js");
5248
5249
5250
5251_parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy = _ganttDb__WEBPACK_IMPORTED_MODULE_2__["default"];
5252var conf = {
5253 titleTopMargin: 25,
5254 barHeight: 20,
5255 barGap: 4,
5256 topPadding: 50,
5257 rightPadding: 75,
5258 leftPadding: 75,
5259 gridLineStartPadding: 35,
5260 fontSize: 11,
5261 fontFamily: '"Open-Sans", "sans-serif"'
5262};
5263var setConf = function setConf(cnf) {
5264 var keys = Object.keys(cnf);
5265 keys.forEach(function (key) {
5266 conf[key] = cnf[key];
5267 });
5268};
5269var w;
5270var draw = function draw(text, id) {
5271 _parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.clear();
5272 _parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].parse(text);
5273 var elem = document.getElementById(id);
5274 w = elem.parentElement.offsetWidth;
5275
5276 if (typeof w === 'undefined') {
5277 w = 1200;
5278 }
5279
5280 if (typeof conf.useWidth !== 'undefined') {
5281 w = conf.useWidth;
5282 }
5283
5284 var taskArray = _parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.getTasks(); // Set height based on number of tasks
5285
5286 var h = taskArray.length * (conf.barHeight + conf.barGap) + 2 * conf.topPadding;
5287 elem.setAttribute('height', '100%'); // Set viewBox
5288
5289 elem.setAttribute('viewBox', '0 0 ' + w + ' ' + h);
5290 var svg = d3__WEBPACK_IMPORTED_MODULE_0__["select"]("[id=\"".concat(id, "\"]")); // Set timescale
5291
5292 var timeScale = d3__WEBPACK_IMPORTED_MODULE_0__["scaleTime"]().domain([d3__WEBPACK_IMPORTED_MODULE_0__["min"](taskArray, function (d) {
5293 return d.startTime;
5294 }), d3__WEBPACK_IMPORTED_MODULE_0__["max"](taskArray, function (d) {
5295 return d.endTime;
5296 })]).rangeRound([0, w - conf.leftPadding - conf.rightPadding]);
5297 var categories = [];
5298
5299 for (var i = 0; i < taskArray.length; i++) {
5300 categories.push(taskArray[i].type);
5301 }
5302
5303 var catsUnfiltered = categories; // for vert labels
5304
5305 categories = checkUnique(categories);
5306 makeGant(taskArray, w, h);
5307
5308 if (typeof conf.useWidth !== 'undefined') {
5309 elem.setAttribute('width', w);
5310 }
5311
5312 svg.append('text').text(_parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.getTitle()).attr('x', w / 2).attr('y', conf.titleTopMargin).attr('class', 'titleText');
5313
5314 function makeGant(tasks, pageWidth, pageHeight) {
5315 var barHeight = conf.barHeight;
5316 var gap = barHeight + conf.barGap;
5317 var topPadding = conf.topPadding;
5318 var leftPadding = conf.leftPadding;
5319 var colorScale = d3__WEBPACK_IMPORTED_MODULE_0__["scaleLinear"]().domain([0, categories.length]).range(['#00B9FA', '#F95002']).interpolate(d3__WEBPACK_IMPORTED_MODULE_0__["interpolateHcl"]);
5320 makeGrid(leftPadding, topPadding, pageWidth, pageHeight);
5321 drawRects(tasks, gap, topPadding, leftPadding, barHeight, colorScale, pageWidth, pageHeight);
5322 vertLabels(gap, topPadding, leftPadding, barHeight, colorScale);
5323 drawToday(leftPadding, topPadding, pageWidth, pageHeight);
5324 }
5325
5326 function drawRects(theArray, theGap, theTopPad, theSidePad, theBarHeight, theColorScale, w) {
5327 // Draw background rects covering the entire width of the graph, these form the section rows.
5328 svg.append('g').selectAll('rect').data(theArray).enter().append('rect').attr('x', 0).attr('y', function (d, i) {
5329 return i * theGap + theTopPad - 2;
5330 }).attr('width', function () {
5331 return w - conf.rightPadding / 2;
5332 }).attr('height', theGap).attr('class', function (d) {
5333 for (var _i = 0; _i < categories.length; _i++) {
5334 if (d.type === categories[_i]) {
5335 return 'section section' + _i % conf.numberSectionStyles;
5336 }
5337 }
5338
5339 return 'section section0';
5340 }); // Draw the rects representing the tasks
5341
5342 var rectangles = svg.append('g').selectAll('rect').data(theArray).enter();
5343 rectangles.append('rect').attr('id', function (d) {
5344 return d.id;
5345 }).attr('rx', 3).attr('ry', 3).attr('x', function (d) {
5346 if (d.milestone) {
5347 return timeScale(d.startTime) + theSidePad + 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight;
5348 }
5349
5350 return timeScale(d.startTime) + theSidePad;
5351 }).attr('y', function (d, i) {
5352 return i * theGap + theTopPad;
5353 }).attr('width', function (d) {
5354 if (d.milestone) {
5355 return theBarHeight;
5356 }
5357
5358 return timeScale(d.renderEndTime || d.endTime) - timeScale(d.startTime);
5359 }).attr('height', theBarHeight).attr('transform-origin', function (d, i) {
5360 return (timeScale(d.startTime) + theSidePad + 0.5 * (timeScale(d.endTime) - timeScale(d.startTime))).toString() + 'px ' + (i * theGap + theTopPad + 0.5 * theBarHeight).toString() + 'px';
5361 }).attr('class', function (d) {
5362 var res = 'task';
5363 var classStr = '';
5364
5365 if (d.classes.length > 0) {
5366 classStr = d.classes.join(' ');
5367 }
5368
5369 var secNum = 0;
5370
5371 for (var _i2 = 0; _i2 < categories.length; _i2++) {
5372 if (d.type === categories[_i2]) {
5373 secNum = _i2 % conf.numberSectionStyles;
5374 }
5375 }
5376
5377 var taskClass = '';
5378
5379 if (d.active) {
5380 if (d.crit) {
5381 taskClass += ' activeCrit';
5382 } else {
5383 taskClass = ' active';
5384 }
5385 } else if (d.done) {
5386 if (d.crit) {
5387 taskClass = ' doneCrit';
5388 } else {
5389 taskClass = ' done';
5390 }
5391 } else {
5392 if (d.crit) {
5393 taskClass += ' crit';
5394 }
5395 }
5396
5397 if (taskClass.length === 0) {
5398 taskClass = ' task';
5399 }
5400
5401 if (d.milestone) {
5402 taskClass = ' milestone ' + taskClass;
5403 }
5404
5405 taskClass += secNum;
5406 taskClass += ' ' + classStr;
5407 return res + taskClass;
5408 }); // Append task labels
5409
5410 rectangles.append('text').attr('id', function (d) {
5411 return d.id + '-text';
5412 }).text(function (d) {
5413 return d.task;
5414 }).attr('font-size', conf.fontSize).attr('x', function (d) {
5415 var startX = timeScale(d.startTime);
5416 var endX = timeScale(d.renderEndTime || d.endTime);
5417
5418 if (d.milestone) {
5419 startX += 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight;
5420 }
5421
5422 if (d.milestone) {
5423 endX = startX + theBarHeight;
5424 }
5425
5426 var textWidth = this.getBBox().width; // Check id text width > width of rectangle
5427
5428 if (textWidth > endX - startX) {
5429 if (endX + textWidth + 1.5 * conf.leftPadding > w) {
5430 return startX + theSidePad - 5;
5431 } else {
5432 return endX + theSidePad + 5;
5433 }
5434 } else {
5435 return (endX - startX) / 2 + startX + theSidePad;
5436 }
5437 }).attr('y', function (d, i) {
5438 return i * theGap + conf.barHeight / 2 + (conf.fontSize / 2 - 2) + theTopPad;
5439 }).attr('text-height', theBarHeight).attr('class', function (d) {
5440 var startX = timeScale(d.startTime);
5441 var endX = timeScale(d.endTime);
5442
5443 if (d.milestone) {
5444 endX = startX + theBarHeight;
5445 }
5446
5447 var textWidth = this.getBBox().width;
5448 var classStr = '';
5449
5450 if (d.classes.length > 0) {
5451 classStr = d.classes.join(' ');
5452 }
5453
5454 var secNum = 0;
5455
5456 for (var _i3 = 0; _i3 < categories.length; _i3++) {
5457 if (d.type === categories[_i3]) {
5458 secNum = _i3 % conf.numberSectionStyles;
5459 }
5460 }
5461
5462 var taskType = '';
5463
5464 if (d.active) {
5465 if (d.crit) {
5466 taskType = 'activeCritText' + secNum;
5467 } else {
5468 taskType = 'activeText' + secNum;
5469 }
5470 }
5471
5472 if (d.done) {
5473 if (d.crit) {
5474 taskType = taskType + ' doneCritText' + secNum;
5475 } else {
5476 taskType = taskType + ' doneText' + secNum;
5477 }
5478 } else {
5479 if (d.crit) {
5480 taskType = taskType + ' critText' + secNum;
5481 }
5482 }
5483
5484 if (d.milestone) {
5485 taskType += ' milestoneText';
5486 } // Check id text width > width of rectangle
5487
5488
5489 if (textWidth > endX - startX) {
5490 if (endX + textWidth + 1.5 * conf.leftPadding > w) {
5491 return classStr + ' taskTextOutsideLeft taskTextOutside' + secNum + ' ' + taskType;
5492 } else {
5493 return classStr + ' taskTextOutsideRight taskTextOutside' + secNum + ' ' + taskType + ' width-' + textWidth;
5494 }
5495 } else {
5496 return classStr + ' taskText taskText' + secNum + ' ' + taskType + ' width-' + textWidth;
5497 }
5498 });
5499 }
5500
5501 function makeGrid(theSidePad, theTopPad, w, h) {
5502 var xAxis = d3__WEBPACK_IMPORTED_MODULE_0__["axisBottom"](timeScale).tickSize(-h + theTopPad + conf.gridLineStartPadding).tickFormat(d3__WEBPACK_IMPORTED_MODULE_0__["timeFormat"](_parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.getAxisFormat() || conf.axisFormat || '%Y-%m-%d'));
5503 svg.append('g').attr('class', 'grid').attr('transform', 'translate(' + theSidePad + ', ' + (h - 50) + ')').call(xAxis).selectAll('text').style('text-anchor', 'middle').attr('fill', '#000').attr('stroke', 'none').attr('font-size', 10).attr('dy', '1em');
5504 }
5505
5506 function vertLabels(theGap, theTopPad) {
5507 var numOccurances = [];
5508 var prevGap = 0;
5509
5510 for (var _i4 = 0; _i4 < categories.length; _i4++) {
5511 numOccurances[_i4] = [categories[_i4], getCount(categories[_i4], catsUnfiltered)];
5512 }
5513
5514 svg.append('g') // without doing this, impossible to put grid lines behind text
5515 .selectAll('text').data(numOccurances).enter().append('text').text(function (d) {
5516 return d[0];
5517 }).attr('x', 10).attr('y', function (d, i) {
5518 if (i > 0) {
5519 for (var j = 0; j < i; j++) {
5520 prevGap += numOccurances[i - 1][1];
5521 return d[1] * theGap / 2 + prevGap * theGap + theTopPad;
5522 }
5523 } else {
5524 return d[1] * theGap / 2 + theTopPad;
5525 }
5526 }).attr('class', function (d) {
5527 for (var _i5 = 0; _i5 < categories.length; _i5++) {
5528 if (d[0] === categories[_i5]) {
5529 return 'sectionTitle sectionTitle' + _i5 % conf.numberSectionStyles;
5530 }
5531 }
5532
5533 return 'sectionTitle';
5534 });
5535 }
5536
5537 function drawToday(theSidePad, theTopPad, w, h) {
5538 var todayG = svg.append('g').attr('class', 'today');
5539 var today = new Date();
5540 todayG.append('line').attr('x1', timeScale(today) + theSidePad).attr('x2', timeScale(today) + theSidePad).attr('y1', conf.titleTopMargin).attr('y2', h - conf.titleTopMargin).attr('class', 'today');
5541 } // from this stackexchange question: http://stackoverflow.com/questions/1890203/unique-for-arrays-in-javascript
5542
5543
5544 function checkUnique(arr) {
5545 var hash = {};
5546 var result = [];
5547
5548 for (var _i6 = 0, l = arr.length; _i6 < l; ++_i6) {
5549 if (!hash.hasOwnProperty(arr[_i6])) {
5550 // eslint-disable-line
5551 // it works with objects! in FF, at least
5552 hash[arr[_i6]] = true;
5553 result.push(arr[_i6]);
5554 }
5555 }
5556
5557 return result;
5558 } // from this stackexchange question: http://stackoverflow.com/questions/14227981/count-how-many-strings-in-an-array-have-duplicates-in-the-same-array
5559
5560
5561 function getCounts(arr) {
5562 var i = arr.length; // const to loop over
5563
5564 var obj = {}; // obj to store results
5565
5566 while (i) {
5567 obj[arr[--i]] = (obj[arr[i]] || 0) + 1; // count occurrences
5568 }
5569
5570 return obj;
5571 } // get specific from everything
5572
5573
5574 function getCount(word, arr) {
5575 return getCounts(arr)[word] || 0;
5576 }
5577};
5578/* harmony default export */ __webpack_exports__["default"] = ({
5579 setConf: setConf,
5580 draw: draw
5581});
5582
5583/***/ }),
5584
5585/***/ "./src/diagrams/gantt/parser/gantt.jison":
5586/*!***********************************************!*\
5587 !*** ./src/diagrams/gantt/parser/gantt.jison ***!
5588 \***********************************************/
5589/*! no static exports found */
5590/***/ (function(module, exports, __webpack_require__) {
5591
5592/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
5593/*
5594 Returns a Parser object of the following structure:
5595
5596 Parser: {
5597 yy: {}
5598 }
5599
5600 Parser.prototype: {
5601 yy: {},
5602 trace: function(),
5603 symbols_: {associative list: name ==> number},
5604 terminals_: {associative list: number ==> name},
5605 productions_: [...],
5606 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
5607 table: [...],
5608 defaultActions: {...},
5609 parseError: function(str, hash),
5610 parse: function(input),
5611
5612 lexer: {
5613 EOF: 1,
5614 parseError: function(str, hash),
5615 setInput: function(input),
5616 input: function(),
5617 unput: function(str),
5618 more: function(),
5619 less: function(n),
5620 pastInput: function(),
5621 upcomingInput: function(),
5622 showPosition: function(),
5623 test_match: function(regex_match_array, rule_index),
5624 next: function(),
5625 lex: function(),
5626 begin: function(condition),
5627 popState: function(),
5628 _currentRules: function(),
5629 topState: function(),
5630 pushState: function(condition),
5631
5632 options: {
5633 ranges: boolean (optional: true ==> token location info will include a .range[] member)
5634 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
5635 backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
5636 },
5637
5638 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
5639 rules: [...],
5640 conditions: {associative list: name ==> set},
5641 }
5642 }
5643
5644
5645 token location info (@$, _$, etc.): {
5646 first_line: n,
5647 last_line: n,
5648 first_column: n,
5649 last_column: n,
5650 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
5651 }
5652
5653
5654 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
5655 text: (matched text)
5656 token: (the produced terminal token, if any)
5657 line: (yylineno)
5658 }
5659 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
5660 loc: (yylloc)
5661 expected: (string describing the set of expected tokens)
5662 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
5663 }
5664*/
5665var parser = (function(){
5666var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[6,8,10,11,12,13,14,15,16,18,20],$V1=[1,9],$V2=[1,10],$V3=[1,11],$V4=[1,12],$V5=[1,13],$V6=[1,14],$V7=[1,16],$V8=[1,17];
5667var parser = {trace: function trace () { },
5668yy: {},
5669symbols_: {"error":2,"start":3,"gantt":4,"document":5,"EOF":6,"line":7,"SPACE":8,"statement":9,"NL":10,"dateFormat":11,"inclusiveEndDates":12,"axisFormat":13,"excludes":14,"title":15,"section":16,"clickStatement":17,"taskTxt":18,"taskData":19,"click":20,"callbackname":21,"callbackargs":22,"href":23,"clickStatementDebug":24,"$accept":0,"$end":1},
5670terminals_: {2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",11:"dateFormat",12:"inclusiveEndDates",13:"axisFormat",14:"excludes",15:"title",16:"section",18:"taskTxt",19:"taskData",20:"click",21:"callbackname",22:"callbackargs",23:"href"},
5671productions_: [0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[17,2],[17,3],[17,3],[17,4],[17,3],[17,4],[17,2],[24,2],[24,3],[24,3],[24,4],[24,3],[24,4],[24,2]],
5672performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
5673/* this == yyval */
5674
5675var $0 = $$.length - 1;
5676switch (yystate) {
5677case 1:
5678 return $$[$0-1];
5679break;
5680case 2:
5681 this.$ = []
5682break;
5683case 3:
5684$$[$0-1].push($$[$0]);this.$ = $$[$0-1]
5685break;
5686case 4: case 5:
5687 this.$ = $$[$0]
5688break;
5689case 6: case 7:
5690 this.$=[];
5691break;
5692case 8:
5693yy.setDateFormat($$[$0].substr(11));this.$=$$[$0].substr(11);
5694break;
5695case 9:
5696yy.enableInclusiveEndDates();this.$=$$[$0].substr(18);
5697break;
5698case 10:
5699yy.setAxisFormat($$[$0].substr(11));this.$=$$[$0].substr(11);
5700break;
5701case 11:
5702yy.setExcludes($$[$0].substr(9));this.$=$$[$0].substr(9);
5703break;
5704case 12:
5705yy.setTitle($$[$0].substr(6));this.$=$$[$0].substr(6);
5706break;
5707case 13:
5708yy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8);
5709break;
5710case 15:
5711yy.addTask($$[$0-1],$$[$0]);this.$='task';
5712break;
5713case 16:
5714this.$ = $$[$0-1];yy.setClickEvent($$[$0-1], $$[$0], null);
5715break;
5716case 17:
5717this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]);
5718break;
5719case 18:
5720this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], null);yy.setLink($$[$0-2],$$[$0]);
5721break;
5722case 19:
5723this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-2], $$[$0-1]);yy.setLink($$[$0-3],$$[$0]);
5724break;
5725case 20:
5726this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0], null);yy.setLink($$[$0-2],$$[$0-1]);
5727break;
5728case 21:
5729this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-1], $$[$0]);yy.setLink($$[$0-3],$$[$0-2]);
5730break;
5731case 22:
5732this.$ = $$[$0-1];yy.setLink($$[$0-1], $$[$0]);
5733break;
5734case 23: case 29:
5735this.$=$$[$0-1] + ' ' + $$[$0];
5736break;
5737case 24: case 25: case 27:
5738this.$=$$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0];
5739break;
5740case 26: case 28:
5741this.$=$$[$0-3] + ' ' + $$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0];
5742break;
5743}
5744},
5745table: [{3:1,4:[1,2]},{1:[3]},o($V0,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:$V1,12:$V2,13:$V3,14:$V4,15:$V5,16:$V6,17:15,18:$V7,20:$V8},o($V0,[2,7],{1:[2,1]}),o($V0,[2,3]),{9:18,11:$V1,12:$V2,13:$V3,14:$V4,15:$V5,16:$V6,17:15,18:$V7,20:$V8},o($V0,[2,5]),o($V0,[2,6]),o($V0,[2,8]),o($V0,[2,9]),o($V0,[2,10]),o($V0,[2,11]),o($V0,[2,12]),o($V0,[2,13]),o($V0,[2,14]),{19:[1,19]},{21:[1,20],23:[1,21]},o($V0,[2,4]),o($V0,[2,15]),o($V0,[2,16],{22:[1,22],23:[1,23]}),o($V0,[2,22],{21:[1,24]}),o($V0,[2,17],{23:[1,25]}),o($V0,[2,18]),o($V0,[2,20],{22:[1,26]}),o($V0,[2,19]),o($V0,[2,21])],
5746defaultActions: {},
5747parseError: function parseError (str, hash) {
5748 if (hash.recoverable) {
5749 this.trace(str);
5750 } else {
5751 var error = new Error(str);
5752 error.hash = hash;
5753 throw error;
5754 }
5755},
5756parse: function parse(input) {
5757 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
5758 var args = lstack.slice.call(arguments, 1);
5759 var lexer = Object.create(this.lexer);
5760 var sharedState = { yy: {} };
5761 for (var k in this.yy) {
5762 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
5763 sharedState.yy[k] = this.yy[k];
5764 }
5765 }
5766 lexer.setInput(input, sharedState.yy);
5767 sharedState.yy.lexer = lexer;
5768 sharedState.yy.parser = this;
5769 if (typeof lexer.yylloc == 'undefined') {
5770 lexer.yylloc = {};
5771 }
5772 var yyloc = lexer.yylloc;
5773 lstack.push(yyloc);
5774 var ranges = lexer.options && lexer.options.ranges;
5775 if (typeof sharedState.yy.parseError === 'function') {
5776 this.parseError = sharedState.yy.parseError;
5777 } else {
5778 this.parseError = Object.getPrototypeOf(this).parseError;
5779 }
5780 function popStack(n) {
5781 stack.length = stack.length - 2 * n;
5782 vstack.length = vstack.length - n;
5783 lstack.length = lstack.length - n;
5784 }
5785 function lex() {
5786 var token;
5787 token = tstack.pop() || lexer.lex() || EOF;
5788 if (typeof token !== 'number') {
5789 if (token instanceof Array) {
5790 tstack = token;
5791 token = tstack.pop();
5792 }
5793 token = self.symbols_[token] || token;
5794 }
5795 return token;
5796 }
5797 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
5798 while (true) {
5799 state = stack[stack.length - 1];
5800 if (this.defaultActions[state]) {
5801 action = this.defaultActions[state];
5802 } else {
5803 if (symbol === null || typeof symbol == 'undefined') {
5804 symbol = lex();
5805 }
5806 action = table[state] && table[state][symbol];
5807 }
5808 if (typeof action === 'undefined' || !action.length || !action[0]) {
5809 var errStr = '';
5810 expected = [];
5811 for (p in table[state]) {
5812 if (this.terminals_[p] && p > TERROR) {
5813 expected.push('\'' + this.terminals_[p] + '\'');
5814 }
5815 }
5816 if (lexer.showPosition) {
5817 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
5818 } else {
5819 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
5820 }
5821 this.parseError(errStr, {
5822 text: lexer.match,
5823 token: this.terminals_[symbol] || symbol,
5824 line: lexer.yylineno,
5825 loc: yyloc,
5826 expected: expected
5827 });
5828 }
5829 if (action[0] instanceof Array && action.length > 1) {
5830 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
5831 }
5832 switch (action[0]) {
5833 case 1:
5834 stack.push(symbol);
5835 vstack.push(lexer.yytext);
5836 lstack.push(lexer.yylloc);
5837 stack.push(action[1]);
5838 symbol = null;
5839 if (!preErrorSymbol) {
5840 yyleng = lexer.yyleng;
5841 yytext = lexer.yytext;
5842 yylineno = lexer.yylineno;
5843 yyloc = lexer.yylloc;
5844 if (recovering > 0) {
5845 recovering--;
5846 }
5847 } else {
5848 symbol = preErrorSymbol;
5849 preErrorSymbol = null;
5850 }
5851 break;
5852 case 2:
5853 len = this.productions_[action[1]][1];
5854 yyval.$ = vstack[vstack.length - len];
5855 yyval._$ = {
5856 first_line: lstack[lstack.length - (len || 1)].first_line,
5857 last_line: lstack[lstack.length - 1].last_line,
5858 first_column: lstack[lstack.length - (len || 1)].first_column,
5859 last_column: lstack[lstack.length - 1].last_column
5860 };
5861 if (ranges) {
5862 yyval._$.range = [
5863 lstack[lstack.length - (len || 1)].range[0],
5864 lstack[lstack.length - 1].range[1]
5865 ];
5866 }
5867 r = this.performAction.apply(yyval, [
5868 yytext,
5869 yyleng,
5870 yylineno,
5871 sharedState.yy,
5872 action[1],
5873 vstack,
5874 lstack
5875 ].concat(args));
5876 if (typeof r !== 'undefined') {
5877 return r;
5878 }
5879 if (len) {
5880 stack = stack.slice(0, -1 * len * 2);
5881 vstack = vstack.slice(0, -1 * len);
5882 lstack = lstack.slice(0, -1 * len);
5883 }
5884 stack.push(this.productions_[action[1]][0]);
5885 vstack.push(yyval.$);
5886 lstack.push(yyval._$);
5887 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
5888 stack.push(newState);
5889 break;
5890 case 3:
5891 return true;
5892 }
5893 }
5894 return true;
5895}};
5896
5897/* generated by jison-lex 0.3.4 */
5898var lexer = (function(){
5899var lexer = ({
5900
5901EOF:1,
5902
5903parseError:function parseError(str, hash) {
5904 if (this.yy.parser) {
5905 this.yy.parser.parseError(str, hash);
5906 } else {
5907 throw new Error(str);
5908 }
5909 },
5910
5911// resets the lexer, sets new input
5912setInput:function (input, yy) {
5913 this.yy = yy || this.yy || {};
5914 this._input = input;
5915 this._more = this._backtrack = this.done = false;
5916 this.yylineno = this.yyleng = 0;
5917 this.yytext = this.matched = this.match = '';
5918 this.conditionStack = ['INITIAL'];
5919 this.yylloc = {
5920 first_line: 1,
5921 first_column: 0,
5922 last_line: 1,
5923 last_column: 0
5924 };
5925 if (this.options.ranges) {
5926 this.yylloc.range = [0,0];
5927 }
5928 this.offset = 0;
5929 return this;
5930 },
5931
5932// consumes and returns one char from the input
5933input:function () {
5934 var ch = this._input[0];
5935 this.yytext += ch;
5936 this.yyleng++;
5937 this.offset++;
5938 this.match += ch;
5939 this.matched += ch;
5940 var lines = ch.match(/(?:\r\n?|\n).*/g);
5941 if (lines) {
5942 this.yylineno++;
5943 this.yylloc.last_line++;
5944 } else {
5945 this.yylloc.last_column++;
5946 }
5947 if (this.options.ranges) {
5948 this.yylloc.range[1]++;
5949 }
5950
5951 this._input = this._input.slice(1);
5952 return ch;
5953 },
5954
5955// unshifts one char (or a string) into the input
5956unput:function (ch) {
5957 var len = ch.length;
5958 var lines = ch.split(/(?:\r\n?|\n)/g);
5959
5960 this._input = ch + this._input;
5961 this.yytext = this.yytext.substr(0, this.yytext.length - len);
5962 //this.yyleng -= len;
5963 this.offset -= len;
5964 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
5965 this.match = this.match.substr(0, this.match.length - 1);
5966 this.matched = this.matched.substr(0, this.matched.length - 1);
5967
5968 if (lines.length - 1) {
5969 this.yylineno -= lines.length - 1;
5970 }
5971 var r = this.yylloc.range;
5972
5973 this.yylloc = {
5974 first_line: this.yylloc.first_line,
5975 last_line: this.yylineno + 1,
5976 first_column: this.yylloc.first_column,
5977 last_column: lines ?
5978 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
5979 + oldLines[oldLines.length - lines.length].length - lines[0].length :
5980 this.yylloc.first_column - len
5981 };
5982
5983 if (this.options.ranges) {
5984 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
5985 }
5986 this.yyleng = this.yytext.length;
5987 return this;
5988 },
5989
5990// When called from action, caches matched text and appends it on next action
5991more:function () {
5992 this._more = true;
5993 return this;
5994 },
5995
5996// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
5997reject:function () {
5998 if (this.options.backtrack_lexer) {
5999 this._backtrack = true;
6000 } else {
6001 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
6002 text: "",
6003 token: null,
6004 line: this.yylineno
6005 });
6006
6007 }
6008 return this;
6009 },
6010
6011// retain first n characters of the match
6012less:function (n) {
6013 this.unput(this.match.slice(n));
6014 },
6015
6016// displays already matched input, i.e. for error messages
6017pastInput:function () {
6018 var past = this.matched.substr(0, this.matched.length - this.match.length);
6019 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
6020 },
6021
6022// displays upcoming input, i.e. for error messages
6023upcomingInput:function () {
6024 var next = this.match;
6025 if (next.length < 20) {
6026 next += this._input.substr(0, 20-next.length);
6027 }
6028 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
6029 },
6030
6031// displays the character position where the lexing error occurred, i.e. for error messages
6032showPosition:function () {
6033 var pre = this.pastInput();
6034 var c = new Array(pre.length + 1).join("-");
6035 return pre + this.upcomingInput() + "\n" + c + "^";
6036 },
6037
6038// test the lexed token: return FALSE when not a match, otherwise return token
6039test_match:function(match, indexed_rule) {
6040 var token,
6041 lines,
6042 backup;
6043
6044 if (this.options.backtrack_lexer) {
6045 // save context
6046 backup = {
6047 yylineno: this.yylineno,
6048 yylloc: {
6049 first_line: this.yylloc.first_line,
6050 last_line: this.last_line,
6051 first_column: this.yylloc.first_column,
6052 last_column: this.yylloc.last_column
6053 },
6054 yytext: this.yytext,
6055 match: this.match,
6056 matches: this.matches,
6057 matched: this.matched,
6058 yyleng: this.yyleng,
6059 offset: this.offset,
6060 _more: this._more,
6061 _input: this._input,
6062 yy: this.yy,
6063 conditionStack: this.conditionStack.slice(0),
6064 done: this.done
6065 };
6066 if (this.options.ranges) {
6067 backup.yylloc.range = this.yylloc.range.slice(0);
6068 }
6069 }
6070
6071 lines = match[0].match(/(?:\r\n?|\n).*/g);
6072 if (lines) {
6073 this.yylineno += lines.length;
6074 }
6075 this.yylloc = {
6076 first_line: this.yylloc.last_line,
6077 last_line: this.yylineno + 1,
6078 first_column: this.yylloc.last_column,
6079 last_column: lines ?
6080 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
6081 this.yylloc.last_column + match[0].length
6082 };
6083 this.yytext += match[0];
6084 this.match += match[0];
6085 this.matches = match;
6086 this.yyleng = this.yytext.length;
6087 if (this.options.ranges) {
6088 this.yylloc.range = [this.offset, this.offset += this.yyleng];
6089 }
6090 this._more = false;
6091 this._backtrack = false;
6092 this._input = this._input.slice(match[0].length);
6093 this.matched += match[0];
6094 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
6095 if (this.done && this._input) {
6096 this.done = false;
6097 }
6098 if (token) {
6099 return token;
6100 } else if (this._backtrack) {
6101 // recover context
6102 for (var k in backup) {
6103 this[k] = backup[k];
6104 }
6105 return false; // rule action called reject() implying the next rule should be tested instead.
6106 }
6107 return false;
6108 },
6109
6110// return next match in input
6111next:function () {
6112 if (this.done) {
6113 return this.EOF;
6114 }
6115 if (!this._input) {
6116 this.done = true;
6117 }
6118
6119 var token,
6120 match,
6121 tempMatch,
6122 index;
6123 if (!this._more) {
6124 this.yytext = '';
6125 this.match = '';
6126 }
6127 var rules = this._currentRules();
6128 for (var i = 0; i < rules.length; i++) {
6129 tempMatch = this._input.match(this.rules[rules[i]]);
6130 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
6131 match = tempMatch;
6132 index = i;
6133 if (this.options.backtrack_lexer) {
6134 token = this.test_match(tempMatch, rules[i]);
6135 if (token !== false) {
6136 return token;
6137 } else if (this._backtrack) {
6138 match = false;
6139 continue; // rule action called reject() implying a rule MISmatch.
6140 } else {
6141 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
6142 return false;
6143 }
6144 } else if (!this.options.flex) {
6145 break;
6146 }
6147 }
6148 }
6149 if (match) {
6150 token = this.test_match(match, rules[index]);
6151 if (token !== false) {
6152 return token;
6153 }
6154 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
6155 return false;
6156 }
6157 if (this._input === "") {
6158 return this.EOF;
6159 } else {
6160 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
6161 text: "",
6162 token: null,
6163 line: this.yylineno
6164 });
6165 }
6166 },
6167
6168// return next match that has a token
6169lex:function lex () {
6170 var r = this.next();
6171 if (r) {
6172 return r;
6173 } else {
6174 return this.lex();
6175 }
6176 },
6177
6178// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
6179begin:function begin (condition) {
6180 this.conditionStack.push(condition);
6181 },
6182
6183// pop the previously active lexer condition state off the condition stack
6184popState:function popState () {
6185 var n = this.conditionStack.length - 1;
6186 if (n > 0) {
6187 return this.conditionStack.pop();
6188 } else {
6189 return this.conditionStack[0];
6190 }
6191 },
6192
6193// produce the lexer rule set which is active for the currently active lexer condition state
6194_currentRules:function _currentRules () {
6195 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
6196 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
6197 } else {
6198 return this.conditions["INITIAL"].rules;
6199 }
6200 },
6201
6202// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
6203topState:function topState (n) {
6204 n = this.conditionStack.length - 1 - Math.abs(n || 0);
6205 if (n >= 0) {
6206 return this.conditionStack[n];
6207 } else {
6208 return "INITIAL";
6209 }
6210 },
6211
6212// alias for begin(condition)
6213pushState:function pushState (condition) {
6214 this.begin(condition);
6215 },
6216
6217// return the number of states currently on the stack
6218stateStackSize:function stateStackSize() {
6219 return this.conditionStack.length;
6220 },
6221options: {"case-insensitive":true},
6222performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
6223var YYSTATE=YY_START;
6224switch($avoiding_name_collisions) {
6225case 0:return 10;
6226break;
6227case 1:/* skip whitespace */
6228break;
6229case 2:/* skip comments */
6230break;
6231case 3:/* skip comments */
6232break;
6233case 4:this.begin("href");
6234break;
6235case 5:this.popState();
6236break;
6237case 6:return 23;
6238break;
6239case 7:this.begin("callbackname");
6240break;
6241case 8:this.popState();
6242break;
6243case 9:this.popState(); this.begin("callbackargs");
6244break;
6245case 10:return 21;
6246break;
6247case 11:this.popState();
6248break;
6249case 12:return 22;
6250break;
6251case 13:this.begin("click");
6252break;
6253case 14:this.popState();
6254break;
6255case 15:return 20;
6256break;
6257case 16:return 4;
6258break;
6259case 17:return 11;
6260break;
6261case 18:return 12;
6262break;
6263case 19:return 13;
6264break;
6265case 20:return 14;
6266break;
6267case 21:return 'date';
6268break;
6269case 22:return 15;
6270break;
6271case 23:return 16;
6272break;
6273case 24:return 18;
6274break;
6275case 25:return 19;
6276break;
6277case 26:return ':';
6278break;
6279case 27:return 6;
6280break;
6281case 28:return 'INVALID';
6282break;
6283}
6284},
6285rules: [/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],
6286conditions: {"callbackargs":{"rules":[11,12],"inclusive":false},"callbackname":{"rules":[8,9,10],"inclusive":false},"href":{"rules":[5,6],"inclusive":false},"click":{"rules":[14,15],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,7,13,16,17,18,19,20,21,22,23,24,25,26,27,28],"inclusive":true}}
6287});
6288return lexer;
6289})();
6290parser.lexer = lexer;
6291function Parser () {
6292 this.yy = {};
6293}
6294Parser.prototype = parser;parser.Parser = Parser;
6295return new Parser;
6296})();
6297
6298
6299if (true) {
6300exports.parser = parser;
6301exports.Parser = parser.Parser;
6302exports.parse = function () { return parser.parse.apply(parser, arguments); };
6303exports.main = function commonjsMain (args) {
6304 if (!args[1]) {
6305 console.log('Usage: '+args[0]+' FILE');
6306 process.exit(1);
6307 }
6308 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
6309 return exports.parser.parse(source);
6310};
6311if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
6312 exports.main(process.argv.slice(1));
6313}
6314}
6315/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
6316
6317/***/ }),
6318
6319/***/ "./src/diagrams/git/gitGraphAst.js":
6320/*!*****************************************!*\
6321 !*** ./src/diagrams/git/gitGraphAst.js ***!
6322 \*****************************************/
6323/*! exports provided: setDirection, setOptions, getOptions, commit, branch, merge, checkout, reset, prettyPrint, clear, getBranchesAsObjArray, getBranches, getCommits, getCommitsArray, getCurrentBranch, getDirection, getHead, default */
6324/***/ (function(module, __webpack_exports__, __webpack_require__) {
6325
6326"use strict";
6327__webpack_require__.r(__webpack_exports__);
6328/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDirection", function() { return setDirection; });
6329/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setOptions", function() { return setOptions; });
6330/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOptions", function() { return getOptions; });
6331/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commit", function() { return commit; });
6332/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "branch", function() { return branch; });
6333/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; });
6334/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkout", function() { return checkout; });
6335/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reset", function() { return reset; });
6336/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prettyPrint", function() { return prettyPrint; });
6337/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
6338/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBranchesAsObjArray", function() { return getBranchesAsObjArray; });
6339/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBranches", function() { return getBranches; });
6340/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCommits", function() { return getCommits; });
6341/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCommitsArray", function() { return getCommitsArray; });
6342/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCurrentBranch", function() { return getCurrentBranch; });
6343/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDirection", function() { return getDirection; });
6344/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getHead", function() { return getHead; });
6345/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash");
6346/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
6347/* harmony import */ var crypto_random_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! crypto-random-string */ "crypto-random-string");
6348/* harmony import */ var crypto_random_string__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(crypto_random_string__WEBPACK_IMPORTED_MODULE_1__);
6349/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
6350
6351
6352
6353var commits = {};
6354var head = null;
6355var branches = {
6356 master: head
6357};
6358var curBranch = 'master';
6359var direction = 'LR';
6360var seq = 0;
6361
6362function getId() {
6363 return crypto_random_string__WEBPACK_IMPORTED_MODULE_1___default()({
6364 length: 7,
6365 characters: '0123456789abcdef'
6366 });
6367}
6368
6369function isfastforwardable(currentCommit, otherCommit) {
6370 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Entering isfastforwardable:', currentCommit.id, otherCommit.id);
6371
6372 while (currentCommit.seq <= otherCommit.seq && currentCommit !== otherCommit) {
6373 // only if other branch has more commits
6374 if (otherCommit.parent == null) break;
6375
6376 if (Array.isArray(otherCommit.parent)) {
6377 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('In merge commit:', otherCommit.parent);
6378 return isfastforwardable(currentCommit, commits[otherCommit.parent[0]]) || isfastforwardable(currentCommit, commits[otherCommit.parent[1]]);
6379 } else {
6380 otherCommit = commits[otherCommit.parent];
6381 }
6382 }
6383
6384 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug(currentCommit.id, otherCommit.id);
6385 return currentCommit.id === otherCommit.id;
6386}
6387
6388function isReachableFrom(currentCommit, otherCommit) {
6389 var currentSeq = currentCommit.seq;
6390 var otherSeq = otherCommit.seq;
6391 if (currentSeq > otherSeq) return isfastforwardable(otherCommit, currentCommit);
6392 return false;
6393}
6394
6395var setDirection = function setDirection(dir) {
6396 direction = dir;
6397};
6398var options = {};
6399var setOptions = function setOptions(rawOptString) {
6400 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('options str', rawOptString);
6401 rawOptString = rawOptString && rawOptString.trim();
6402 rawOptString = rawOptString || '{}';
6403
6404 try {
6405 options = JSON.parse(rawOptString);
6406 } catch (e) {
6407 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].error('error while parsing gitGraph options', e.message);
6408 }
6409};
6410var getOptions = function getOptions() {
6411 return options;
6412};
6413var commit = function commit(msg) {
6414 var commit = {
6415 id: getId(),
6416 message: msg,
6417 seq: seq++,
6418 parent: head == null ? null : head.id
6419 };
6420 head = commit;
6421 commits[commit.id] = commit;
6422 branches[curBranch] = commit.id;
6423 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('in pushCommit ' + commit.id);
6424};
6425var branch = function branch(name) {
6426 branches[name] = head != null ? head.id : null;
6427 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('in createBranch');
6428};
6429var merge = function merge(otherBranch) {
6430 var currentCommit = commits[branches[curBranch]];
6431 var otherCommit = commits[branches[otherBranch]];
6432
6433 if (isReachableFrom(currentCommit, otherCommit)) {
6434 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Already merged');
6435 return;
6436 }
6437
6438 if (isfastforwardable(currentCommit, otherCommit)) {
6439 branches[curBranch] = branches[otherBranch];
6440 head = commits[branches[curBranch]];
6441 } else {
6442 // create merge commit
6443 var _commit = {
6444 id: getId(),
6445 message: 'merged branch ' + otherBranch + ' into ' + curBranch,
6446 seq: seq++,
6447 parent: [head == null ? null : head.id, branches[otherBranch]]
6448 };
6449 head = _commit;
6450 commits[_commit.id] = _commit;
6451 branches[curBranch] = _commit.id;
6452 }
6453
6454 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug(branches);
6455 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('in mergeBranch');
6456};
6457var checkout = function checkout(branch) {
6458 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('in checkout');
6459 curBranch = branch;
6460 var id = branches[curBranch];
6461 head = commits[id];
6462};
6463var reset = function reset(commitRef) {
6464 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('in reset', commitRef);
6465 var ref = commitRef.split(':')[0];
6466 var parentCount = parseInt(commitRef.split(':')[1]);
6467 var commit = ref === 'HEAD' ? head : commits[branches[ref]];
6468 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug(commit, parentCount);
6469
6470 while (parentCount > 0) {
6471 commit = commits[commit.parent];
6472 parentCount--;
6473
6474 if (!commit) {
6475 var err = 'Critical error - unique parent commit not found during reset';
6476 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].error(err);
6477 throw err;
6478 }
6479 }
6480
6481 head = commit;
6482 branches[curBranch] = commit.id;
6483};
6484
6485function upsert(arr, key, newval) {
6486 var index = arr.indexOf(key);
6487
6488 if (index === -1) {
6489 arr.push(newval);
6490 } else {
6491 arr.splice(index, 1, newval);
6492 }
6493}
6494
6495function prettyPrintCommitHistory(commitArr) {
6496 var commit = lodash__WEBPACK_IMPORTED_MODULE_0___default.a.maxBy(commitArr, 'seq');
6497
6498 var line = '';
6499 commitArr.forEach(function (c) {
6500 if (c === commit) {
6501 line += '\t*';
6502 } else {
6503 line += '\t|';
6504 }
6505 });
6506 var label = [line, commit.id, commit.seq];
6507
6508 for (var _branch in branches) {
6509 if (branches[_branch] === commit.id) label.push(_branch);
6510 }
6511
6512 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug(label.join(' '));
6513
6514 if (Array.isArray(commit.parent)) {
6515 var newCommit = commits[commit.parent[0]];
6516 upsert(commitArr, commit, newCommit);
6517 commitArr.push(commits[commit.parent[1]]);
6518 } else if (commit.parent == null) {
6519 return;
6520 } else {
6521 var nextCommit = commits[commit.parent];
6522 upsert(commitArr, commit, nextCommit);
6523 }
6524
6525 commitArr = lodash__WEBPACK_IMPORTED_MODULE_0___default.a.uniqBy(commitArr, 'id');
6526 prettyPrintCommitHistory(commitArr);
6527}
6528
6529var prettyPrint = function prettyPrint() {
6530 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug(commits);
6531 var node = getCommitsArray()[0];
6532 prettyPrintCommitHistory([node]);
6533};
6534var clear = function clear() {
6535 commits = {};
6536 head = null;
6537 branches = {
6538 master: head
6539 };
6540 curBranch = 'master';
6541 seq = 0;
6542};
6543var getBranchesAsObjArray = function getBranchesAsObjArray() {
6544 var branchArr = [];
6545
6546 for (var _branch2 in branches) {
6547 branchArr.push({
6548 name: _branch2,
6549 commit: commits[branches[_branch2]]
6550 });
6551 }
6552
6553 return branchArr;
6554};
6555var getBranches = function getBranches() {
6556 return branches;
6557};
6558var getCommits = function getCommits() {
6559 return commits;
6560};
6561var getCommitsArray = function getCommitsArray() {
6562 var commitArr = Object.keys(commits).map(function (key) {
6563 return commits[key];
6564 });
6565 commitArr.forEach(function (o) {
6566 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug(o.id);
6567 });
6568 return lodash__WEBPACK_IMPORTED_MODULE_0___default.a.orderBy(commitArr, ['seq'], ['desc']);
6569};
6570var getCurrentBranch = function getCurrentBranch() {
6571 return curBranch;
6572};
6573var getDirection = function getDirection() {
6574 return direction;
6575};
6576var getHead = function getHead() {
6577 return head;
6578};
6579/* harmony default export */ __webpack_exports__["default"] = ({
6580 setDirection: setDirection,
6581 setOptions: setOptions,
6582 getOptions: getOptions,
6583 commit: commit,
6584 branch: branch,
6585 merge: merge,
6586 checkout: checkout,
6587 reset: reset,
6588 prettyPrint: prettyPrint,
6589 clear: clear,
6590 getBranchesAsObjArray: getBranchesAsObjArray,
6591 getBranches: getBranches,
6592 getCommits: getCommits,
6593 getCommitsArray: getCommitsArray,
6594 getCurrentBranch: getCurrentBranch,
6595 getDirection: getDirection,
6596 getHead: getHead
6597});
6598
6599/***/ }),
6600
6601/***/ "./src/diagrams/git/gitGraphRenderer.js":
6602/*!**********************************************!*\
6603 !*** ./src/diagrams/git/gitGraphRenderer.js ***!
6604 \**********************************************/
6605/*! exports provided: setConf, draw, default */
6606/***/ (function(module, __webpack_exports__, __webpack_require__) {
6607
6608"use strict";
6609__webpack_require__.r(__webpack_exports__);
6610/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
6611/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
6612/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
6613/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
6614/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash");
6615/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
6616/* harmony import */ var _gitGraphAst__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./gitGraphAst */ "./src/diagrams/git/gitGraphAst.js");
6617/* harmony import */ var _parser_gitGraph__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/gitGraph */ "./src/diagrams/git/parser/gitGraph.jison");
6618/* harmony import */ var _parser_gitGraph__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_gitGraph__WEBPACK_IMPORTED_MODULE_3__);
6619/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
6620/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
6621
6622
6623
6624
6625
6626
6627var allCommitsDict = {};
6628var branchNum;
6629var config = {
6630 nodeSpacing: 150,
6631 nodeFillColor: 'yellow',
6632 nodeStrokeWidth: 2,
6633 nodeStrokeColor: 'grey',
6634 lineStrokeWidth: 4,
6635 branchOffset: 50,
6636 lineColor: 'grey',
6637 leftMargin: 50,
6638 branchColors: ['#442f74', '#983351', '#609732', '#AA9A39'],
6639 nodeRadius: 10,
6640 nodeLabel: {
6641 width: 75,
6642 height: 100,
6643 x: -25,
6644 y: 0
6645 }
6646};
6647var apiConfig = {};
6648var setConf = function setConf(c) {
6649 apiConfig = c;
6650};
6651
6652function svgCreateDefs(svg) {
6653 svg.append('defs').append('g').attr('id', 'def-commit').append('circle').attr('r', config.nodeRadius).attr('cx', 0).attr('cy', 0);
6654 svg.select('#def-commit').append('foreignObject').attr('width', config.nodeLabel.width).attr('height', config.nodeLabel.height).attr('x', config.nodeLabel.x).attr('y', config.nodeLabel.y).attr('class', 'node-label').attr('requiredFeatures', 'http://www.w3.org/TR/SVG11/feature#Extensibility').append('p').html('');
6655}
6656
6657function svgDrawLine(svg, points, colorIdx, interpolate) {
6658 var curve = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["interpolateToCurve"])(interpolate, d3__WEBPACK_IMPORTED_MODULE_0__["curveBasis"]);
6659 var color = config.branchColors[colorIdx % config.branchColors.length];
6660 var lineGen = d3__WEBPACK_IMPORTED_MODULE_0__["line"]().x(function (d) {
6661 return Math.round(d.x);
6662 }).y(function (d) {
6663 return Math.round(d.y);
6664 }).curve(curve);
6665 svg.append('svg:path').attr('d', lineGen(points)).style('stroke', color).style('stroke-width', config.lineStrokeWidth).style('fill', 'none');
6666} // Pass in the element and its pre-transform coords
6667
6668
6669function getElementCoords(element, coords) {
6670 coords = coords || element.node().getBBox();
6671 var ctm = element.node().getCTM();
6672 var xn = ctm.e + coords.x * ctm.a;
6673 var yn = ctm.f + coords.y * ctm.d;
6674 return {
6675 left: xn,
6676 top: yn,
6677 width: coords.width,
6678 height: coords.height
6679 };
6680}
6681
6682function svgDrawLineForCommits(svg, fromId, toId, direction, color) {
6683 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('svgDrawLineForCommits: ', fromId, toId);
6684 var fromBbox = getElementCoords(svg.select('#node-' + fromId + ' circle'));
6685 var toBbox = getElementCoords(svg.select('#node-' + toId + ' circle'));
6686
6687 switch (direction) {
6688 case 'LR':
6689 // (toBbox)
6690 // +--------
6691 // + (fromBbox)
6692 if (fromBbox.left - toBbox.left > config.nodeSpacing) {
6693 var lineStart = {
6694 x: fromBbox.left - config.nodeSpacing,
6695 y: toBbox.top + toBbox.height / 2
6696 };
6697 var lineEnd = {
6698 x: toBbox.left + toBbox.width,
6699 y: toBbox.top + toBbox.height / 2
6700 };
6701 svgDrawLine(svg, [lineStart, lineEnd], color, 'linear');
6702 svgDrawLine(svg, [{
6703 x: fromBbox.left,
6704 y: fromBbox.top + fromBbox.height / 2
6705 }, {
6706 x: fromBbox.left - config.nodeSpacing / 2,
6707 y: fromBbox.top + fromBbox.height / 2
6708 }, {
6709 x: fromBbox.left - config.nodeSpacing / 2,
6710 y: lineStart.y
6711 }, lineStart], color);
6712 } else {
6713 svgDrawLine(svg, [{
6714 x: fromBbox.left,
6715 y: fromBbox.top + fromBbox.height / 2
6716 }, {
6717 x: fromBbox.left - config.nodeSpacing / 2,
6718 y: fromBbox.top + fromBbox.height / 2
6719 }, {
6720 x: fromBbox.left - config.nodeSpacing / 2,
6721 y: toBbox.top + toBbox.height / 2
6722 }, {
6723 x: toBbox.left + toBbox.width,
6724 y: toBbox.top + toBbox.height / 2
6725 }], color);
6726 }
6727
6728 break;
6729
6730 case 'BT':
6731 // + (fromBbox)
6732 // |
6733 // |
6734 // + (toBbox)
6735 if (toBbox.top - fromBbox.top > config.nodeSpacing) {
6736 var _lineStart = {
6737 x: toBbox.left + toBbox.width / 2,
6738 y: fromBbox.top + fromBbox.height + config.nodeSpacing
6739 };
6740 var _lineEnd = {
6741 x: toBbox.left + toBbox.width / 2,
6742 y: toBbox.top
6743 };
6744 svgDrawLine(svg, [_lineStart, _lineEnd], color, 'linear');
6745 svgDrawLine(svg, [{
6746 x: fromBbox.left + fromBbox.width / 2,
6747 y: fromBbox.top + fromBbox.height
6748 }, {
6749 x: fromBbox.left + fromBbox.width / 2,
6750 y: fromBbox.top + fromBbox.height + config.nodeSpacing / 2
6751 }, {
6752 x: toBbox.left + toBbox.width / 2,
6753 y: _lineStart.y - config.nodeSpacing / 2
6754 }, _lineStart], color);
6755 } else {
6756 svgDrawLine(svg, [{
6757 x: fromBbox.left + fromBbox.width / 2,
6758 y: fromBbox.top + fromBbox.height
6759 }, {
6760 x: fromBbox.left + fromBbox.width / 2,
6761 y: fromBbox.top + config.nodeSpacing / 2
6762 }, {
6763 x: toBbox.left + toBbox.width / 2,
6764 y: toBbox.top - config.nodeSpacing / 2
6765 }, {
6766 x: toBbox.left + toBbox.width / 2,
6767 y: toBbox.top
6768 }], color);
6769 }
6770
6771 break;
6772 }
6773}
6774
6775function cloneNode(svg, selector) {
6776 return svg.select(selector).node().cloneNode(true);
6777}
6778
6779function renderCommitHistory(svg, commitid, branches, direction) {
6780 var commit;
6781 var numCommits = Object.keys(allCommitsDict).length;
6782
6783 if (typeof commitid === 'string') {
6784 do {
6785 commit = allCommitsDict[commitid];
6786 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('in renderCommitHistory', commit.id, commit.seq);
6787
6788 if (svg.select('#node-' + commitid).size() > 0) {
6789 return;
6790 }
6791
6792 svg.append(function () {
6793 return cloneNode(svg, '#def-commit');
6794 }).attr('class', 'commit').attr('id', function () {
6795 return 'node-' + commit.id;
6796 }).attr('transform', function () {
6797 switch (direction) {
6798 case 'LR':
6799 return 'translate(' + (commit.seq * config.nodeSpacing + config.leftMargin) + ', ' + branchNum * config.branchOffset + ')';
6800
6801 case 'BT':
6802 return 'translate(' + (branchNum * config.branchOffset + config.leftMargin) + ', ' + (numCommits - commit.seq) * config.nodeSpacing + ')';
6803 }
6804 }).attr('fill', config.nodeFillColor).attr('stroke', config.nodeStrokeColor).attr('stroke-width', config.nodeStrokeWidth);
6805 var branch = void 0;
6806
6807 for (var branchName in branches) {
6808 if (branches[branchName].commit === commit) {
6809 branch = branches[branchName];
6810 break;
6811 }
6812 }
6813
6814 if (branch) {
6815 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('found branch ', branch.name);
6816 svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'branch-label').text(branch.name + ', ');
6817 }
6818
6819 svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'commit-id').text(commit.id);
6820
6821 if (commit.message !== '' && direction === 'BT') {
6822 svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'commit-msg').text(', ' + commit.message);
6823 }
6824
6825 commitid = commit.parent;
6826 } while (commitid && allCommitsDict[commitid]);
6827 }
6828
6829 if (Array.isArray(commitid)) {
6830 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('found merge commmit', commitid);
6831 renderCommitHistory(svg, commitid[0], branches, direction);
6832 branchNum++;
6833 renderCommitHistory(svg, commitid[1], branches, direction);
6834 branchNum--;
6835 }
6836}
6837
6838function renderLines(svg, commit, direction, branchColor) {
6839 branchColor = branchColor || 0;
6840
6841 while (commit.seq > 0 && !commit.lineDrawn) {
6842 if (typeof commit.parent === 'string') {
6843 svgDrawLineForCommits(svg, commit.id, commit.parent, direction, branchColor);
6844 commit.lineDrawn = true;
6845 commit = allCommitsDict[commit.parent];
6846 } else if (Array.isArray(commit.parent)) {
6847 svgDrawLineForCommits(svg, commit.id, commit.parent[0], direction, branchColor);
6848 svgDrawLineForCommits(svg, commit.id, commit.parent[1], direction, branchColor + 1);
6849 renderLines(svg, allCommitsDict[commit.parent[1]], direction, branchColor + 1);
6850 commit.lineDrawn = true;
6851 commit = allCommitsDict[commit.parent[0]];
6852 }
6853 }
6854}
6855
6856var draw = function draw(txt, id, ver) {
6857 try {
6858 var parser = _parser_gitGraph__WEBPACK_IMPORTED_MODULE_3___default.a.parser;
6859 parser.yy = _gitGraphAst__WEBPACK_IMPORTED_MODULE_2__["default"];
6860 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('in gitgraph renderer', txt + '\n', 'id:', id, ver); // Parse the graph definition
6861
6862 parser.parse(txt + '\n');
6863 config = lodash__WEBPACK_IMPORTED_MODULE_1___default.a.assign(config, apiConfig, _gitGraphAst__WEBPACK_IMPORTED_MODULE_2__["default"].getOptions());
6864 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('effective options', config);
6865 var direction = _gitGraphAst__WEBPACK_IMPORTED_MODULE_2__["default"].getDirection();
6866 allCommitsDict = _gitGraphAst__WEBPACK_IMPORTED_MODULE_2__["default"].getCommits();
6867 var branches = _gitGraphAst__WEBPACK_IMPORTED_MODULE_2__["default"].getBranchesAsObjArray();
6868
6869 if (direction === 'BT') {
6870 config.nodeLabel.x = branches.length * config.branchOffset;
6871 config.nodeLabel.width = '100%';
6872 config.nodeLabel.y = -1 * 2 * config.nodeRadius;
6873 }
6874
6875 var svg = d3__WEBPACK_IMPORTED_MODULE_0__["select"]("[id=\"".concat(id, "\"]"));
6876 svgCreateDefs(svg);
6877 branchNum = 1;
6878
6879 for (var branch in branches) {
6880 var v = branches[branch];
6881 renderCommitHistory(svg, v.commit.id, branches, direction);
6882 renderLines(svg, v.commit, direction);
6883 branchNum++;
6884 }
6885
6886 svg.attr('height', function () {
6887 if (direction === 'BT') return Object.keys(allCommitsDict).length * config.nodeSpacing;
6888 return (branches.length + 1) * config.branchOffset;
6889 });
6890 } catch (e) {
6891 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].error('Error while rendering gitgraph');
6892 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].error(e.message);
6893 }
6894};
6895/* harmony default export */ __webpack_exports__["default"] = ({
6896 setConf: setConf,
6897 draw: draw
6898});
6899
6900/***/ }),
6901
6902/***/ "./src/diagrams/git/parser/gitGraph.jison":
6903/*!************************************************!*\
6904 !*** ./src/diagrams/git/parser/gitGraph.jison ***!
6905 \************************************************/
6906/*! no static exports found */
6907/***/ (function(module, exports, __webpack_require__) {
6908
6909/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
6910/*
6911 Returns a Parser object of the following structure:
6912
6913 Parser: {
6914 yy: {}
6915 }
6916
6917 Parser.prototype: {
6918 yy: {},
6919 trace: function(),
6920 symbols_: {associative list: name ==> number},
6921 terminals_: {associative list: number ==> name},
6922 productions_: [...],
6923 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
6924 table: [...],
6925 defaultActions: {...},
6926 parseError: function(str, hash),
6927 parse: function(input),
6928
6929 lexer: {
6930 EOF: 1,
6931 parseError: function(str, hash),
6932 setInput: function(input),
6933 input: function(),
6934 unput: function(str),
6935 more: function(),
6936 less: function(n),
6937 pastInput: function(),
6938 upcomingInput: function(),
6939 showPosition: function(),
6940 test_match: function(regex_match_array, rule_index),
6941 next: function(),
6942 lex: function(),
6943 begin: function(condition),
6944 popState: function(),
6945 _currentRules: function(),
6946 topState: function(),
6947 pushState: function(condition),
6948
6949 options: {
6950 ranges: boolean (optional: true ==> token location info will include a .range[] member)
6951 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
6952 backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
6953 },
6954
6955 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
6956 rules: [...],
6957 conditions: {associative list: name ==> set},
6958 }
6959 }
6960
6961
6962 token location info (@$, _$, etc.): {
6963 first_line: n,
6964 last_line: n,
6965 first_column: n,
6966 last_column: n,
6967 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
6968 }
6969
6970
6971 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
6972 text: (matched text)
6973 token: (the produced terminal token, if any)
6974 line: (yylineno)
6975 }
6976 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
6977 loc: (yylloc)
6978 expected: (string describing the set of expected tokens)
6979 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
6980 }
6981*/
6982var parser = (function(){
6983var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[2,3],$V1=[1,7],$V2=[7,12,15,17,19,20,21],$V3=[7,11,12,15,17,19,20,21],$V4=[2,20],$V5=[1,32];
6984var parser = {trace: function trace () { },
6985yy: {},
6986symbols_: {"error":2,"start":3,"GG":4,":":5,"document":6,"EOF":7,"DIR":8,"options":9,"body":10,"OPT":11,"NL":12,"line":13,"statement":14,"COMMIT":15,"commit_arg":16,"BRANCH":17,"ID":18,"CHECKOUT":19,"MERGE":20,"RESET":21,"reset_arg":22,"STR":23,"HEAD":24,"reset_parents":25,"CARET":26,"$accept":0,"$end":1},
6987terminals_: {2:"error",4:"GG",5:":",7:"EOF",8:"DIR",11:"OPT",12:"NL",15:"COMMIT",17:"BRANCH",18:"ID",19:"CHECKOUT",20:"MERGE",21:"RESET",23:"STR",24:"HEAD",26:"CARET"},
6988productions_: [0,[3,4],[3,5],[6,0],[6,2],[9,2],[9,1],[10,0],[10,2],[13,2],[13,1],[14,2],[14,2],[14,2],[14,2],[14,2],[16,0],[16,1],[22,2],[22,2],[25,0],[25,2]],
6989performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
6990/* this == yyval */
6991
6992var $0 = $$.length - 1;
6993switch (yystate) {
6994case 1:
6995 return $$[$0-1];
6996break;
6997case 2:
6998yy.setDirection($$[$0-3]); return $$[$0-1];
6999break;
7000case 4:
7001 yy.setOptions($$[$0-1]); this.$ = $$[$0]
7002break;
7003case 5:
7004$$[$0-1] +=$$[$0]; this.$=$$[$0-1]
7005break;
7006case 7:
7007this.$ = []
7008break;
7009case 8:
7010$$[$0-1].push($$[$0]); this.$=$$[$0-1];
7011break;
7012case 9:
7013this.$ =$$[$0-1]
7014break;
7015case 11:
7016yy.commit($$[$0])
7017break;
7018case 12:
7019yy.branch($$[$0])
7020break;
7021case 13:
7022yy.checkout($$[$0])
7023break;
7024case 14:
7025yy.merge($$[$0])
7026break;
7027case 15:
7028yy.reset($$[$0])
7029break;
7030case 16:
7031this.$ = ""
7032break;
7033case 17:
7034this.$=$$[$0]
7035break;
7036case 18:
7037this.$ = $$[$0-1]+ ":" + $$[$0]
7038break;
7039case 19:
7040this.$ = $$[$0-1]+ ":" + yy.count; yy.count = 0
7041break;
7042case 20:
7043yy.count = 0
7044break;
7045case 21:
7046 yy.count += 1
7047break;
7048}
7049},
7050table: [{3:1,4:[1,2]},{1:[3]},{5:[1,3],8:[1,4]},{6:5,7:$V0,9:6,12:$V1},{5:[1,8]},{7:[1,9]},o($V2,[2,7],{10:10,11:[1,11]}),o($V3,[2,6]),{6:12,7:$V0,9:6,12:$V1},{1:[2,1]},{7:[2,4],12:[1,15],13:13,14:14,15:[1,16],17:[1,17],19:[1,18],20:[1,19],21:[1,20]},o($V3,[2,5]),{7:[1,21]},o($V2,[2,8]),{12:[1,22]},o($V2,[2,10]),{12:[2,16],16:23,23:[1,24]},{18:[1,25]},{18:[1,26]},{18:[1,27]},{18:[1,30],22:28,24:[1,29]},{1:[2,2]},o($V2,[2,9]),{12:[2,11]},{12:[2,17]},{12:[2,12]},{12:[2,13]},{12:[2,14]},{12:[2,15]},{12:$V4,25:31,26:$V5},{12:$V4,25:33,26:$V5},{12:[2,18]},{12:$V4,25:34,26:$V5},{12:[2,19]},{12:[2,21]}],
7051defaultActions: {9:[2,1],21:[2,2],23:[2,11],24:[2,17],25:[2,12],26:[2,13],27:[2,14],28:[2,15],31:[2,18],33:[2,19],34:[2,21]},
7052parseError: function parseError (str, hash) {
7053 if (hash.recoverable) {
7054 this.trace(str);
7055 } else {
7056 var error = new Error(str);
7057 error.hash = hash;
7058 throw error;
7059 }
7060},
7061parse: function parse(input) {
7062 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
7063 var args = lstack.slice.call(arguments, 1);
7064 var lexer = Object.create(this.lexer);
7065 var sharedState = { yy: {} };
7066 for (var k in this.yy) {
7067 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
7068 sharedState.yy[k] = this.yy[k];
7069 }
7070 }
7071 lexer.setInput(input, sharedState.yy);
7072 sharedState.yy.lexer = lexer;
7073 sharedState.yy.parser = this;
7074 if (typeof lexer.yylloc == 'undefined') {
7075 lexer.yylloc = {};
7076 }
7077 var yyloc = lexer.yylloc;
7078 lstack.push(yyloc);
7079 var ranges = lexer.options && lexer.options.ranges;
7080 if (typeof sharedState.yy.parseError === 'function') {
7081 this.parseError = sharedState.yy.parseError;
7082 } else {
7083 this.parseError = Object.getPrototypeOf(this).parseError;
7084 }
7085 function popStack(n) {
7086 stack.length = stack.length - 2 * n;
7087 vstack.length = vstack.length - n;
7088 lstack.length = lstack.length - n;
7089 }
7090 function lex() {
7091 var token;
7092 token = tstack.pop() || lexer.lex() || EOF;
7093 if (typeof token !== 'number') {
7094 if (token instanceof Array) {
7095 tstack = token;
7096 token = tstack.pop();
7097 }
7098 token = self.symbols_[token] || token;
7099 }
7100 return token;
7101 }
7102 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
7103 while (true) {
7104 state = stack[stack.length - 1];
7105 if (this.defaultActions[state]) {
7106 action = this.defaultActions[state];
7107 } else {
7108 if (symbol === null || typeof symbol == 'undefined') {
7109 symbol = lex();
7110 }
7111 action = table[state] && table[state][symbol];
7112 }
7113 if (typeof action === 'undefined' || !action.length || !action[0]) {
7114 var errStr = '';
7115 expected = [];
7116 for (p in table[state]) {
7117 if (this.terminals_[p] && p > TERROR) {
7118 expected.push('\'' + this.terminals_[p] + '\'');
7119 }
7120 }
7121 if (lexer.showPosition) {
7122 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
7123 } else {
7124 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
7125 }
7126 this.parseError(errStr, {
7127 text: lexer.match,
7128 token: this.terminals_[symbol] || symbol,
7129 line: lexer.yylineno,
7130 loc: yyloc,
7131 expected: expected
7132 });
7133 }
7134 if (action[0] instanceof Array && action.length > 1) {
7135 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
7136 }
7137 switch (action[0]) {
7138 case 1:
7139 stack.push(symbol);
7140 vstack.push(lexer.yytext);
7141 lstack.push(lexer.yylloc);
7142 stack.push(action[1]);
7143 symbol = null;
7144 if (!preErrorSymbol) {
7145 yyleng = lexer.yyleng;
7146 yytext = lexer.yytext;
7147 yylineno = lexer.yylineno;
7148 yyloc = lexer.yylloc;
7149 if (recovering > 0) {
7150 recovering--;
7151 }
7152 } else {
7153 symbol = preErrorSymbol;
7154 preErrorSymbol = null;
7155 }
7156 break;
7157 case 2:
7158 len = this.productions_[action[1]][1];
7159 yyval.$ = vstack[vstack.length - len];
7160 yyval._$ = {
7161 first_line: lstack[lstack.length - (len || 1)].first_line,
7162 last_line: lstack[lstack.length - 1].last_line,
7163 first_column: lstack[lstack.length - (len || 1)].first_column,
7164 last_column: lstack[lstack.length - 1].last_column
7165 };
7166 if (ranges) {
7167 yyval._$.range = [
7168 lstack[lstack.length - (len || 1)].range[0],
7169 lstack[lstack.length - 1].range[1]
7170 ];
7171 }
7172 r = this.performAction.apply(yyval, [
7173 yytext,
7174 yyleng,
7175 yylineno,
7176 sharedState.yy,
7177 action[1],
7178 vstack,
7179 lstack
7180 ].concat(args));
7181 if (typeof r !== 'undefined') {
7182 return r;
7183 }
7184 if (len) {
7185 stack = stack.slice(0, -1 * len * 2);
7186 vstack = vstack.slice(0, -1 * len);
7187 lstack = lstack.slice(0, -1 * len);
7188 }
7189 stack.push(this.productions_[action[1]][0]);
7190 vstack.push(yyval.$);
7191 lstack.push(yyval._$);
7192 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
7193 stack.push(newState);
7194 break;
7195 case 3:
7196 return true;
7197 }
7198 }
7199 return true;
7200}};
7201/* generated by jison-lex 0.3.4 */
7202var lexer = (function(){
7203var lexer = ({
7204
7205EOF:1,
7206
7207parseError:function parseError(str, hash) {
7208 if (this.yy.parser) {
7209 this.yy.parser.parseError(str, hash);
7210 } else {
7211 throw new Error(str);
7212 }
7213 },
7214
7215// resets the lexer, sets new input
7216setInput:function (input, yy) {
7217 this.yy = yy || this.yy || {};
7218 this._input = input;
7219 this._more = this._backtrack = this.done = false;
7220 this.yylineno = this.yyleng = 0;
7221 this.yytext = this.matched = this.match = '';
7222 this.conditionStack = ['INITIAL'];
7223 this.yylloc = {
7224 first_line: 1,
7225 first_column: 0,
7226 last_line: 1,
7227 last_column: 0
7228 };
7229 if (this.options.ranges) {
7230 this.yylloc.range = [0,0];
7231 }
7232 this.offset = 0;
7233 return this;
7234 },
7235
7236// consumes and returns one char from the input
7237input:function () {
7238 var ch = this._input[0];
7239 this.yytext += ch;
7240 this.yyleng++;
7241 this.offset++;
7242 this.match += ch;
7243 this.matched += ch;
7244 var lines = ch.match(/(?:\r\n?|\n).*/g);
7245 if (lines) {
7246 this.yylineno++;
7247 this.yylloc.last_line++;
7248 } else {
7249 this.yylloc.last_column++;
7250 }
7251 if (this.options.ranges) {
7252 this.yylloc.range[1]++;
7253 }
7254
7255 this._input = this._input.slice(1);
7256 return ch;
7257 },
7258
7259// unshifts one char (or a string) into the input
7260unput:function (ch) {
7261 var len = ch.length;
7262 var lines = ch.split(/(?:\r\n?|\n)/g);
7263
7264 this._input = ch + this._input;
7265 this.yytext = this.yytext.substr(0, this.yytext.length - len);
7266 //this.yyleng -= len;
7267 this.offset -= len;
7268 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
7269 this.match = this.match.substr(0, this.match.length - 1);
7270 this.matched = this.matched.substr(0, this.matched.length - 1);
7271
7272 if (lines.length - 1) {
7273 this.yylineno -= lines.length - 1;
7274 }
7275 var r = this.yylloc.range;
7276
7277 this.yylloc = {
7278 first_line: this.yylloc.first_line,
7279 last_line: this.yylineno + 1,
7280 first_column: this.yylloc.first_column,
7281 last_column: lines ?
7282 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
7283 + oldLines[oldLines.length - lines.length].length - lines[0].length :
7284 this.yylloc.first_column - len
7285 };
7286
7287 if (this.options.ranges) {
7288 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
7289 }
7290 this.yyleng = this.yytext.length;
7291 return this;
7292 },
7293
7294// When called from action, caches matched text and appends it on next action
7295more:function () {
7296 this._more = true;
7297 return this;
7298 },
7299
7300// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
7301reject:function () {
7302 if (this.options.backtrack_lexer) {
7303 this._backtrack = true;
7304 } else {
7305 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
7306 text: "",
7307 token: null,
7308 line: this.yylineno
7309 });
7310
7311 }
7312 return this;
7313 },
7314
7315// retain first n characters of the match
7316less:function (n) {
7317 this.unput(this.match.slice(n));
7318 },
7319
7320// displays already matched input, i.e. for error messages
7321pastInput:function () {
7322 var past = this.matched.substr(0, this.matched.length - this.match.length);
7323 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
7324 },
7325
7326// displays upcoming input, i.e. for error messages
7327upcomingInput:function () {
7328 var next = this.match;
7329 if (next.length < 20) {
7330 next += this._input.substr(0, 20-next.length);
7331 }
7332 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
7333 },
7334
7335// displays the character position where the lexing error occurred, i.e. for error messages
7336showPosition:function () {
7337 var pre = this.pastInput();
7338 var c = new Array(pre.length + 1).join("-");
7339 return pre + this.upcomingInput() + "\n" + c + "^";
7340 },
7341
7342// test the lexed token: return FALSE when not a match, otherwise return token
7343test_match:function(match, indexed_rule) {
7344 var token,
7345 lines,
7346 backup;
7347
7348 if (this.options.backtrack_lexer) {
7349 // save context
7350 backup = {
7351 yylineno: this.yylineno,
7352 yylloc: {
7353 first_line: this.yylloc.first_line,
7354 last_line: this.last_line,
7355 first_column: this.yylloc.first_column,
7356 last_column: this.yylloc.last_column
7357 },
7358 yytext: this.yytext,
7359 match: this.match,
7360 matches: this.matches,
7361 matched: this.matched,
7362 yyleng: this.yyleng,
7363 offset: this.offset,
7364 _more: this._more,
7365 _input: this._input,
7366 yy: this.yy,
7367 conditionStack: this.conditionStack.slice(0),
7368 done: this.done
7369 };
7370 if (this.options.ranges) {
7371 backup.yylloc.range = this.yylloc.range.slice(0);
7372 }
7373 }
7374
7375 lines = match[0].match(/(?:\r\n?|\n).*/g);
7376 if (lines) {
7377 this.yylineno += lines.length;
7378 }
7379 this.yylloc = {
7380 first_line: this.yylloc.last_line,
7381 last_line: this.yylineno + 1,
7382 first_column: this.yylloc.last_column,
7383 last_column: lines ?
7384 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
7385 this.yylloc.last_column + match[0].length
7386 };
7387 this.yytext += match[0];
7388 this.match += match[0];
7389 this.matches = match;
7390 this.yyleng = this.yytext.length;
7391 if (this.options.ranges) {
7392 this.yylloc.range = [this.offset, this.offset += this.yyleng];
7393 }
7394 this._more = false;
7395 this._backtrack = false;
7396 this._input = this._input.slice(match[0].length);
7397 this.matched += match[0];
7398 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
7399 if (this.done && this._input) {
7400 this.done = false;
7401 }
7402 if (token) {
7403 return token;
7404 } else if (this._backtrack) {
7405 // recover context
7406 for (var k in backup) {
7407 this[k] = backup[k];
7408 }
7409 return false; // rule action called reject() implying the next rule should be tested instead.
7410 }
7411 return false;
7412 },
7413
7414// return next match in input
7415next:function () {
7416 if (this.done) {
7417 return this.EOF;
7418 }
7419 if (!this._input) {
7420 this.done = true;
7421 }
7422
7423 var token,
7424 match,
7425 tempMatch,
7426 index;
7427 if (!this._more) {
7428 this.yytext = '';
7429 this.match = '';
7430 }
7431 var rules = this._currentRules();
7432 for (var i = 0; i < rules.length; i++) {
7433 tempMatch = this._input.match(this.rules[rules[i]]);
7434 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
7435 match = tempMatch;
7436 index = i;
7437 if (this.options.backtrack_lexer) {
7438 token = this.test_match(tempMatch, rules[i]);
7439 if (token !== false) {
7440 return token;
7441 } else if (this._backtrack) {
7442 match = false;
7443 continue; // rule action called reject() implying a rule MISmatch.
7444 } else {
7445 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
7446 return false;
7447 }
7448 } else if (!this.options.flex) {
7449 break;
7450 }
7451 }
7452 }
7453 if (match) {
7454 token = this.test_match(match, rules[index]);
7455 if (token !== false) {
7456 return token;
7457 }
7458 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
7459 return false;
7460 }
7461 if (this._input === "") {
7462 return this.EOF;
7463 } else {
7464 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
7465 text: "",
7466 token: null,
7467 line: this.yylineno
7468 });
7469 }
7470 },
7471
7472// return next match that has a token
7473lex:function lex () {
7474 var r = this.next();
7475 if (r) {
7476 return r;
7477 } else {
7478 return this.lex();
7479 }
7480 },
7481
7482// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
7483begin:function begin (condition) {
7484 this.conditionStack.push(condition);
7485 },
7486
7487// pop the previously active lexer condition state off the condition stack
7488popState:function popState () {
7489 var n = this.conditionStack.length - 1;
7490 if (n > 0) {
7491 return this.conditionStack.pop();
7492 } else {
7493 return this.conditionStack[0];
7494 }
7495 },
7496
7497// produce the lexer rule set which is active for the currently active lexer condition state
7498_currentRules:function _currentRules () {
7499 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
7500 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
7501 } else {
7502 return this.conditions["INITIAL"].rules;
7503 }
7504 },
7505
7506// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
7507topState:function topState (n) {
7508 n = this.conditionStack.length - 1 - Math.abs(n || 0);
7509 if (n >= 0) {
7510 return this.conditionStack[n];
7511 } else {
7512 return "INITIAL";
7513 }
7514 },
7515
7516// alias for begin(condition)
7517pushState:function pushState (condition) {
7518 this.begin(condition);
7519 },
7520
7521// return the number of states currently on the stack
7522stateStackSize:function stateStackSize() {
7523 return this.conditionStack.length;
7524 },
7525options: {"case-insensitive":true},
7526performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
7527var YYSTATE=YY_START;
7528switch($avoiding_name_collisions) {
7529case 0:return 12;
7530break;
7531case 1:/* skip all whitespace */
7532break;
7533case 2:/* skip comments */
7534break;
7535case 3:/* skip comments */
7536break;
7537case 4:return 4;
7538break;
7539case 5:return 15;
7540break;
7541case 6:return 17;
7542break;
7543case 7:return 20;
7544break;
7545case 8:return 21;
7546break;
7547case 9:return 19;
7548break;
7549case 10:return 8;
7550break;
7551case 11:return 8;
7552break;
7553case 12:return 5;
7554break;
7555case 13:return 26
7556break;
7557case 14:this.begin("options");
7558break;
7559case 15:this.popState();
7560break;
7561case 16:return 11;
7562break;
7563case 17:this.begin("string");
7564break;
7565case 18:this.popState();
7566break;
7567case 19:return 23;
7568break;
7569case 20:return 18;
7570break;
7571case 21:return 7;
7572break;
7573}
7574},
7575rules: [/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gitGraph\b)/i,/^(?:commit\b)/i,/^(?:branch\b)/i,/^(?:merge\b)/i,/^(?:reset\b)/i,/^(?:checkout\b)/i,/^(?:LR\b)/i,/^(?:BT\b)/i,/^(?::)/i,/^(?:\^)/i,/^(?:options\r?\n)/i,/^(?:end\r?\n)/i,/^(?:[^\n]+\r?\n)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[a-zA-Z][a-zA-Z0-9_]+)/i,/^(?:$)/i],
7576conditions: {"options":{"rules":[15,16],"inclusive":false},"string":{"rules":[18,19],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,20,21],"inclusive":true}}
7577});
7578return lexer;
7579})();
7580parser.lexer = lexer;
7581function Parser () {
7582 this.yy = {};
7583}
7584Parser.prototype = parser;parser.Parser = Parser;
7585return new Parser;
7586})();
7587
7588
7589if (true) {
7590exports.parser = parser;
7591exports.Parser = parser.Parser;
7592exports.parse = function () { return parser.parse.apply(parser, arguments); };
7593exports.main = function commonjsMain (args) {
7594 if (!args[1]) {
7595 console.log('Usage: '+args[0]+' FILE');
7596 process.exit(1);
7597 }
7598 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
7599 return exports.parser.parse(source);
7600};
7601if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
7602 exports.main(process.argv.slice(1));
7603}
7604}
7605/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
7606
7607/***/ }),
7608
7609/***/ "./src/diagrams/info/infoDb.js":
7610/*!*************************************!*\
7611 !*** ./src/diagrams/info/infoDb.js ***!
7612 \*************************************/
7613/*! exports provided: setMessage, getMessage, setInfo, getInfo, default */
7614/***/ (function(module, __webpack_exports__, __webpack_require__) {
7615
7616"use strict";
7617__webpack_require__.r(__webpack_exports__);
7618/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setMessage", function() { return setMessage; });
7619/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMessage", function() { return getMessage; });
7620/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setInfo", function() { return setInfo; });
7621/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getInfo", function() { return getInfo; });
7622/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
7623/**
7624 * Created by knut on 15-01-14.
7625 */
7626
7627var message = '';
7628var info = false;
7629var setMessage = function setMessage(txt) {
7630 _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Setting message to: ' + txt);
7631 message = txt;
7632};
7633var getMessage = function getMessage() {
7634 return message;
7635};
7636var setInfo = function setInfo(inf) {
7637 info = inf;
7638};
7639var getInfo = function getInfo() {
7640 return info;
7641}; // export const parseError = (err, hash) => {
7642// global.mermaidAPI.parseError(err, hash)
7643// }
7644
7645/* harmony default export */ __webpack_exports__["default"] = ({
7646 setMessage: setMessage,
7647 getMessage: getMessage,
7648 setInfo: setInfo,
7649 getInfo: getInfo // parseError
7650
7651});
7652
7653/***/ }),
7654
7655/***/ "./src/diagrams/info/infoRenderer.js":
7656/*!*******************************************!*\
7657 !*** ./src/diagrams/info/infoRenderer.js ***!
7658 \*******************************************/
7659/*! exports provided: setConf, draw, default */
7660/***/ (function(module, __webpack_exports__, __webpack_require__) {
7661
7662"use strict";
7663__webpack_require__.r(__webpack_exports__);
7664/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
7665/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
7666/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
7667/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
7668/* harmony import */ var _infoDb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./infoDb */ "./src/diagrams/info/infoDb.js");
7669/* harmony import */ var _parser_info__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parser/info */ "./src/diagrams/info/parser/info.jison");
7670/* harmony import */ var _parser_info__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_parser_info__WEBPACK_IMPORTED_MODULE_2__);
7671/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
7672/**
7673 * Created by knut on 14-12-11.
7674 */
7675
7676
7677
7678
7679var conf = {};
7680var setConf = function setConf(cnf) {
7681 var keys = Object.keys(cnf);
7682 keys.forEach(function (key) {
7683 conf[key] = cnf[key];
7684 });
7685};
7686/**
7687 * Draws a an info picture in the tag with id: id based on the graph definition in text.
7688 * @param text
7689 * @param id
7690 */
7691
7692var draw = function draw(txt, id, ver) {
7693 try {
7694 var parser = _parser_info__WEBPACK_IMPORTED_MODULE_2___default.a.parser;
7695 parser.yy = _infoDb__WEBPACK_IMPORTED_MODULE_1__["default"];
7696 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Renering info diagram\n' + txt); // Parse the graph definition
7697
7698 parser.parse(txt);
7699 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Parsed info diagram'); // Fetch the default direction, use TD if none was found
7700
7701 var svg = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#' + id);
7702 var g = svg.append('g');
7703 g.append('text') // text label for the x axis
7704 .attr('x', 100).attr('y', 40).attr('class', 'version').attr('font-size', '32px').style('text-anchor', 'middle').text('v ' + ver);
7705 svg.attr('height', 100);
7706 svg.attr('width', 400); // svg.attr('viewBox', '0 0 300 150');
7707 } catch (e) {
7708 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error('Error while rendering info diagram');
7709 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error(e.message);
7710 }
7711};
7712/* harmony default export */ __webpack_exports__["default"] = ({
7713 setConf: setConf,
7714 draw: draw
7715});
7716
7717/***/ }),
7718
7719/***/ "./src/diagrams/info/parser/info.jison":
7720/*!*********************************************!*\
7721 !*** ./src/diagrams/info/parser/info.jison ***!
7722 \*********************************************/
7723/*! no static exports found */
7724/***/ (function(module, exports, __webpack_require__) {
7725
7726/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
7727/*
7728 Returns a Parser object of the following structure:
7729
7730 Parser: {
7731 yy: {}
7732 }
7733
7734 Parser.prototype: {
7735 yy: {},
7736 trace: function(),
7737 symbols_: {associative list: name ==> number},
7738 terminals_: {associative list: number ==> name},
7739 productions_: [...],
7740 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
7741 table: [...],
7742 defaultActions: {...},
7743 parseError: function(str, hash),
7744 parse: function(input),
7745
7746 lexer: {
7747 EOF: 1,
7748 parseError: function(str, hash),
7749 setInput: function(input),
7750 input: function(),
7751 unput: function(str),
7752 more: function(),
7753 less: function(n),
7754 pastInput: function(),
7755 upcomingInput: function(),
7756 showPosition: function(),
7757 test_match: function(regex_match_array, rule_index),
7758 next: function(),
7759 lex: function(),
7760 begin: function(condition),
7761 popState: function(),
7762 _currentRules: function(),
7763 topState: function(),
7764 pushState: function(condition),
7765
7766 options: {
7767 ranges: boolean (optional: true ==> token location info will include a .range[] member)
7768 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
7769 backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
7770 },
7771
7772 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
7773 rules: [...],
7774 conditions: {associative list: name ==> set},
7775 }
7776 }
7777
7778
7779 token location info (@$, _$, etc.): {
7780 first_line: n,
7781 last_line: n,
7782 first_column: n,
7783 last_column: n,
7784 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
7785 }
7786
7787
7788 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
7789 text: (matched text)
7790 token: (the produced terminal token, if any)
7791 line: (yylineno)
7792 }
7793 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
7794 loc: (yylloc)
7795 expected: (string describing the set of expected tokens)
7796 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
7797 }
7798*/
7799var parser = (function(){
7800var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[6,9,10];
7801var parser = {trace: function trace () { },
7802yy: {},
7803symbols_: {"error":2,"start":3,"info":4,"document":5,"EOF":6,"line":7,"statement":8,"NL":9,"showInfo":10,"$accept":0,"$end":1},
7804terminals_: {2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo"},
7805productions_: [0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1]],
7806performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
7807/* this == yyval */
7808
7809var $0 = $$.length - 1;
7810switch (yystate) {
7811case 1:
7812 return yy;
7813break;
7814case 4:
7815
7816break;
7817case 6:
7818 yy.setInfo(true);
7819break;
7820}
7821},
7822table: [{3:1,4:[1,2]},{1:[3]},o($V0,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8]},{1:[2,1]},o($V0,[2,3]),o($V0,[2,4]),o($V0,[2,5]),o($V0,[2,6])],
7823defaultActions: {4:[2,1]},
7824parseError: function parseError (str, hash) {
7825 if (hash.recoverable) {
7826 this.trace(str);
7827 } else {
7828 var error = new Error(str);
7829 error.hash = hash;
7830 throw error;
7831 }
7832},
7833parse: function parse(input) {
7834 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
7835 var args = lstack.slice.call(arguments, 1);
7836 var lexer = Object.create(this.lexer);
7837 var sharedState = { yy: {} };
7838 for (var k in this.yy) {
7839 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
7840 sharedState.yy[k] = this.yy[k];
7841 }
7842 }
7843 lexer.setInput(input, sharedState.yy);
7844 sharedState.yy.lexer = lexer;
7845 sharedState.yy.parser = this;
7846 if (typeof lexer.yylloc == 'undefined') {
7847 lexer.yylloc = {};
7848 }
7849 var yyloc = lexer.yylloc;
7850 lstack.push(yyloc);
7851 var ranges = lexer.options && lexer.options.ranges;
7852 if (typeof sharedState.yy.parseError === 'function') {
7853 this.parseError = sharedState.yy.parseError;
7854 } else {
7855 this.parseError = Object.getPrototypeOf(this).parseError;
7856 }
7857 function popStack(n) {
7858 stack.length = stack.length - 2 * n;
7859 vstack.length = vstack.length - n;
7860 lstack.length = lstack.length - n;
7861 }
7862 function lex() {
7863 var token;
7864 token = tstack.pop() || lexer.lex() || EOF;
7865 if (typeof token !== 'number') {
7866 if (token instanceof Array) {
7867 tstack = token;
7868 token = tstack.pop();
7869 }
7870 token = self.symbols_[token] || token;
7871 }
7872 return token;
7873 }
7874 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
7875 while (true) {
7876 state = stack[stack.length - 1];
7877 if (this.defaultActions[state]) {
7878 action = this.defaultActions[state];
7879 } else {
7880 if (symbol === null || typeof symbol == 'undefined') {
7881 symbol = lex();
7882 }
7883 action = table[state] && table[state][symbol];
7884 }
7885 if (typeof action === 'undefined' || !action.length || !action[0]) {
7886 var errStr = '';
7887 expected = [];
7888 for (p in table[state]) {
7889 if (this.terminals_[p] && p > TERROR) {
7890 expected.push('\'' + this.terminals_[p] + '\'');
7891 }
7892 }
7893 if (lexer.showPosition) {
7894 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
7895 } else {
7896 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
7897 }
7898 this.parseError(errStr, {
7899 text: lexer.match,
7900 token: this.terminals_[symbol] || symbol,
7901 line: lexer.yylineno,
7902 loc: yyloc,
7903 expected: expected
7904 });
7905 }
7906 if (action[0] instanceof Array && action.length > 1) {
7907 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
7908 }
7909 switch (action[0]) {
7910 case 1:
7911 stack.push(symbol);
7912 vstack.push(lexer.yytext);
7913 lstack.push(lexer.yylloc);
7914 stack.push(action[1]);
7915 symbol = null;
7916 if (!preErrorSymbol) {
7917 yyleng = lexer.yyleng;
7918 yytext = lexer.yytext;
7919 yylineno = lexer.yylineno;
7920 yyloc = lexer.yylloc;
7921 if (recovering > 0) {
7922 recovering--;
7923 }
7924 } else {
7925 symbol = preErrorSymbol;
7926 preErrorSymbol = null;
7927 }
7928 break;
7929 case 2:
7930 len = this.productions_[action[1]][1];
7931 yyval.$ = vstack[vstack.length - len];
7932 yyval._$ = {
7933 first_line: lstack[lstack.length - (len || 1)].first_line,
7934 last_line: lstack[lstack.length - 1].last_line,
7935 first_column: lstack[lstack.length - (len || 1)].first_column,
7936 last_column: lstack[lstack.length - 1].last_column
7937 };
7938 if (ranges) {
7939 yyval._$.range = [
7940 lstack[lstack.length - (len || 1)].range[0],
7941 lstack[lstack.length - 1].range[1]
7942 ];
7943 }
7944 r = this.performAction.apply(yyval, [
7945 yytext,
7946 yyleng,
7947 yylineno,
7948 sharedState.yy,
7949 action[1],
7950 vstack,
7951 lstack
7952 ].concat(args));
7953 if (typeof r !== 'undefined') {
7954 return r;
7955 }
7956 if (len) {
7957 stack = stack.slice(0, -1 * len * 2);
7958 vstack = vstack.slice(0, -1 * len);
7959 lstack = lstack.slice(0, -1 * len);
7960 }
7961 stack.push(this.productions_[action[1]][0]);
7962 vstack.push(yyval.$);
7963 lstack.push(yyval._$);
7964 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
7965 stack.push(newState);
7966 break;
7967 case 3:
7968 return true;
7969 }
7970 }
7971 return true;
7972}};
7973
7974/* generated by jison-lex 0.3.4 */
7975var lexer = (function(){
7976var lexer = ({
7977
7978EOF:1,
7979
7980parseError:function parseError(str, hash) {
7981 if (this.yy.parser) {
7982 this.yy.parser.parseError(str, hash);
7983 } else {
7984 throw new Error(str);
7985 }
7986 },
7987
7988// resets the lexer, sets new input
7989setInput:function (input, yy) {
7990 this.yy = yy || this.yy || {};
7991 this._input = input;
7992 this._more = this._backtrack = this.done = false;
7993 this.yylineno = this.yyleng = 0;
7994 this.yytext = this.matched = this.match = '';
7995 this.conditionStack = ['INITIAL'];
7996 this.yylloc = {
7997 first_line: 1,
7998 first_column: 0,
7999 last_line: 1,
8000 last_column: 0
8001 };
8002 if (this.options.ranges) {
8003 this.yylloc.range = [0,0];
8004 }
8005 this.offset = 0;
8006 return this;
8007 },
8008
8009// consumes and returns one char from the input
8010input:function () {
8011 var ch = this._input[0];
8012 this.yytext += ch;
8013 this.yyleng++;
8014 this.offset++;
8015 this.match += ch;
8016 this.matched += ch;
8017 var lines = ch.match(/(?:\r\n?|\n).*/g);
8018 if (lines) {
8019 this.yylineno++;
8020 this.yylloc.last_line++;
8021 } else {
8022 this.yylloc.last_column++;
8023 }
8024 if (this.options.ranges) {
8025 this.yylloc.range[1]++;
8026 }
8027
8028 this._input = this._input.slice(1);
8029 return ch;
8030 },
8031
8032// unshifts one char (or a string) into the input
8033unput:function (ch) {
8034 var len = ch.length;
8035 var lines = ch.split(/(?:\r\n?|\n)/g);
8036
8037 this._input = ch + this._input;
8038 this.yytext = this.yytext.substr(0, this.yytext.length - len);
8039 //this.yyleng -= len;
8040 this.offset -= len;
8041 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
8042 this.match = this.match.substr(0, this.match.length - 1);
8043 this.matched = this.matched.substr(0, this.matched.length - 1);
8044
8045 if (lines.length - 1) {
8046 this.yylineno -= lines.length - 1;
8047 }
8048 var r = this.yylloc.range;
8049
8050 this.yylloc = {
8051 first_line: this.yylloc.first_line,
8052 last_line: this.yylineno + 1,
8053 first_column: this.yylloc.first_column,
8054 last_column: lines ?
8055 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
8056 + oldLines[oldLines.length - lines.length].length - lines[0].length :
8057 this.yylloc.first_column - len
8058 };
8059
8060 if (this.options.ranges) {
8061 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
8062 }
8063 this.yyleng = this.yytext.length;
8064 return this;
8065 },
8066
8067// When called from action, caches matched text and appends it on next action
8068more:function () {
8069 this._more = true;
8070 return this;
8071 },
8072
8073// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
8074reject:function () {
8075 if (this.options.backtrack_lexer) {
8076 this._backtrack = true;
8077 } else {
8078 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
8079 text: "",
8080 token: null,
8081 line: this.yylineno
8082 });
8083
8084 }
8085 return this;
8086 },
8087
8088// retain first n characters of the match
8089less:function (n) {
8090 this.unput(this.match.slice(n));
8091 },
8092
8093// displays already matched input, i.e. for error messages
8094pastInput:function () {
8095 var past = this.matched.substr(0, this.matched.length - this.match.length);
8096 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
8097 },
8098
8099// displays upcoming input, i.e. for error messages
8100upcomingInput:function () {
8101 var next = this.match;
8102 if (next.length < 20) {
8103 next += this._input.substr(0, 20-next.length);
8104 }
8105 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
8106 },
8107
8108// displays the character position where the lexing error occurred, i.e. for error messages
8109showPosition:function () {
8110 var pre = this.pastInput();
8111 var c = new Array(pre.length + 1).join("-");
8112 return pre + this.upcomingInput() + "\n" + c + "^";
8113 },
8114
8115// test the lexed token: return FALSE when not a match, otherwise return token
8116test_match:function(match, indexed_rule) {
8117 var token,
8118 lines,
8119 backup;
8120
8121 if (this.options.backtrack_lexer) {
8122 // save context
8123 backup = {
8124 yylineno: this.yylineno,
8125 yylloc: {
8126 first_line: this.yylloc.first_line,
8127 last_line: this.last_line,
8128 first_column: this.yylloc.first_column,
8129 last_column: this.yylloc.last_column
8130 },
8131 yytext: this.yytext,
8132 match: this.match,
8133 matches: this.matches,
8134 matched: this.matched,
8135 yyleng: this.yyleng,
8136 offset: this.offset,
8137 _more: this._more,
8138 _input: this._input,
8139 yy: this.yy,
8140 conditionStack: this.conditionStack.slice(0),
8141 done: this.done
8142 };
8143 if (this.options.ranges) {
8144 backup.yylloc.range = this.yylloc.range.slice(0);
8145 }
8146 }
8147
8148 lines = match[0].match(/(?:\r\n?|\n).*/g);
8149 if (lines) {
8150 this.yylineno += lines.length;
8151 }
8152 this.yylloc = {
8153 first_line: this.yylloc.last_line,
8154 last_line: this.yylineno + 1,
8155 first_column: this.yylloc.last_column,
8156 last_column: lines ?
8157 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
8158 this.yylloc.last_column + match[0].length
8159 };
8160 this.yytext += match[0];
8161 this.match += match[0];
8162 this.matches = match;
8163 this.yyleng = this.yytext.length;
8164 if (this.options.ranges) {
8165 this.yylloc.range = [this.offset, this.offset += this.yyleng];
8166 }
8167 this._more = false;
8168 this._backtrack = false;
8169 this._input = this._input.slice(match[0].length);
8170 this.matched += match[0];
8171 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
8172 if (this.done && this._input) {
8173 this.done = false;
8174 }
8175 if (token) {
8176 return token;
8177 } else if (this._backtrack) {
8178 // recover context
8179 for (var k in backup) {
8180 this[k] = backup[k];
8181 }
8182 return false; // rule action called reject() implying the next rule should be tested instead.
8183 }
8184 return false;
8185 },
8186
8187// return next match in input
8188next:function () {
8189 if (this.done) {
8190 return this.EOF;
8191 }
8192 if (!this._input) {
8193 this.done = true;
8194 }
8195
8196 var token,
8197 match,
8198 tempMatch,
8199 index;
8200 if (!this._more) {
8201 this.yytext = '';
8202 this.match = '';
8203 }
8204 var rules = this._currentRules();
8205 for (var i = 0; i < rules.length; i++) {
8206 tempMatch = this._input.match(this.rules[rules[i]]);
8207 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
8208 match = tempMatch;
8209 index = i;
8210 if (this.options.backtrack_lexer) {
8211 token = this.test_match(tempMatch, rules[i]);
8212 if (token !== false) {
8213 return token;
8214 } else if (this._backtrack) {
8215 match = false;
8216 continue; // rule action called reject() implying a rule MISmatch.
8217 } else {
8218 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
8219 return false;
8220 }
8221 } else if (!this.options.flex) {
8222 break;
8223 }
8224 }
8225 }
8226 if (match) {
8227 token = this.test_match(match, rules[index]);
8228 if (token !== false) {
8229 return token;
8230 }
8231 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
8232 return false;
8233 }
8234 if (this._input === "") {
8235 return this.EOF;
8236 } else {
8237 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
8238 text: "",
8239 token: null,
8240 line: this.yylineno
8241 });
8242 }
8243 },
8244
8245// return next match that has a token
8246lex:function lex () {
8247 var r = this.next();
8248 if (r) {
8249 return r;
8250 } else {
8251 return this.lex();
8252 }
8253 },
8254
8255// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
8256begin:function begin (condition) {
8257 this.conditionStack.push(condition);
8258 },
8259
8260// pop the previously active lexer condition state off the condition stack
8261popState:function popState () {
8262 var n = this.conditionStack.length - 1;
8263 if (n > 0) {
8264 return this.conditionStack.pop();
8265 } else {
8266 return this.conditionStack[0];
8267 }
8268 },
8269
8270// produce the lexer rule set which is active for the currently active lexer condition state
8271_currentRules:function _currentRules () {
8272 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
8273 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
8274 } else {
8275 return this.conditions["INITIAL"].rules;
8276 }
8277 },
8278
8279// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
8280topState:function topState (n) {
8281 n = this.conditionStack.length - 1 - Math.abs(n || 0);
8282 if (n >= 0) {
8283 return this.conditionStack[n];
8284 } else {
8285 return "INITIAL";
8286 }
8287 },
8288
8289// alias for begin(condition)
8290pushState:function pushState (condition) {
8291 this.begin(condition);
8292 },
8293
8294// return the number of states currently on the stack
8295stateStackSize:function stateStackSize() {
8296 return this.conditionStack.length;
8297 },
8298options: {"case-insensitive":true},
8299performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
8300 // Pre-lexer code can go here
8301
8302var YYSTATE=YY_START;
8303switch($avoiding_name_collisions) {
8304case 0:return 4 ;
8305break;
8306case 1:return 9 ;
8307break;
8308case 2:return 'space';
8309break;
8310case 3:return 10;
8311break;
8312case 4:return 6 ;
8313break;
8314case 5:return 'TXT' ;
8315break;
8316}
8317},
8318rules: [/^(?:info\b)/i,/^(?:[\s\n\r]+)/i,/^(?:[\s]+)/i,/^(?:showInfo\b)/i,/^(?:$)/i,/^(?:.)/i],
8319conditions: {"INITIAL":{"rules":[0,1,2,3,4,5],"inclusive":true}}
8320});
8321return lexer;
8322})();
8323parser.lexer = lexer;
8324function Parser () {
8325 this.yy = {};
8326}
8327Parser.prototype = parser;parser.Parser = Parser;
8328return new Parser;
8329})();
8330
8331
8332if (true) {
8333exports.parser = parser;
8334exports.Parser = parser.Parser;
8335exports.parse = function () { return parser.parse.apply(parser, arguments); };
8336exports.main = function commonjsMain (args) {
8337 if (!args[1]) {
8338 console.log('Usage: '+args[0]+' FILE');
8339 process.exit(1);
8340 }
8341 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
8342 return exports.parser.parse(source);
8343};
8344if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
8345 exports.main(process.argv.slice(1));
8346}
8347}
8348/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
8349
8350/***/ }),
8351
8352/***/ "./src/diagrams/pie/parser/pie.jison":
8353/*!*******************************************!*\
8354 !*** ./src/diagrams/pie/parser/pie.jison ***!
8355 \*******************************************/
8356/*! no static exports found */
8357/***/ (function(module, exports, __webpack_require__) {
8358
8359/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
8360/*
8361 Returns a Parser object of the following structure:
8362
8363 Parser: {
8364 yy: {}
8365 }
8366
8367 Parser.prototype: {
8368 yy: {},
8369 trace: function(),
8370 symbols_: {associative list: name ==> number},
8371 terminals_: {associative list: number ==> name},
8372 productions_: [...],
8373 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
8374 table: [...],
8375 defaultActions: {...},
8376 parseError: function(str, hash),
8377 parse: function(input),
8378
8379 lexer: {
8380 EOF: 1,
8381 parseError: function(str, hash),
8382 setInput: function(input),
8383 input: function(),
8384 unput: function(str),
8385 more: function(),
8386 less: function(n),
8387 pastInput: function(),
8388 upcomingInput: function(),
8389 showPosition: function(),
8390 test_match: function(regex_match_array, rule_index),
8391 next: function(),
8392 lex: function(),
8393 begin: function(condition),
8394 popState: function(),
8395 _currentRules: function(),
8396 topState: function(),
8397 pushState: function(condition),
8398
8399 options: {
8400 ranges: boolean (optional: true ==> token location info will include a .range[] member)
8401 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
8402 backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
8403 },
8404
8405 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
8406 rules: [...],
8407 conditions: {associative list: name ==> set},
8408 }
8409 }
8410
8411
8412 token location info (@$, _$, etc.): {
8413 first_line: n,
8414 last_line: n,
8415 first_column: n,
8416 last_column: n,
8417 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
8418 }
8419
8420
8421 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
8422 text: (matched text)
8423 token: (the produced terminal token, if any)
8424 line: (yylineno)
8425 }
8426 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
8427 loc: (yylloc)
8428 expected: (string describing the set of expected tokens)
8429 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
8430 }
8431*/
8432var parser = (function(){
8433var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[6,9,10,12];
8434var parser = {trace: function trace () { },
8435yy: {},
8436symbols_: {"error":2,"start":3,"pie":4,"document":5,"EOF":6,"line":7,"statement":8,"NL":9,"STR":10,"VALUE":11,"title":12,"$accept":0,"$end":1},
8437terminals_: {2:"error",4:"pie",6:"EOF",9:"NL",10:"STR",11:"VALUE",12:"title"},
8438productions_: [0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,2],[8,1]],
8439performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
8440/* this == yyval */
8441
8442var $0 = $$.length - 1;
8443switch (yystate) {
8444case 4:
8445
8446break;
8447case 6:
8448
8449 console.log('str:'+$$[$0-1]+' value: '+$$[$0])
8450 yy.addSection($$[$0-1],yy.cleanupValue($$[$0]));
8451break;
8452case 7:
8453yy.setTitle($$[$0].substr(6));this.$=$$[$0].substr(6);
8454break;
8455}
8456},
8457table: [{3:1,4:[1,2]},{1:[3]},o($V0,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8],12:[1,9]},{1:[2,1]},o($V0,[2,3]),o($V0,[2,4]),o($V0,[2,5]),{11:[1,10]},o($V0,[2,7]),o($V0,[2,6])],
8458defaultActions: {4:[2,1]},
8459parseError: function parseError (str, hash) {
8460 if (hash.recoverable) {
8461 this.trace(str);
8462 } else {
8463 var error = new Error(str);
8464 error.hash = hash;
8465 throw error;
8466 }
8467},
8468parse: function parse(input) {
8469 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
8470 var args = lstack.slice.call(arguments, 1);
8471 var lexer = Object.create(this.lexer);
8472 var sharedState = { yy: {} };
8473 for (var k in this.yy) {
8474 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
8475 sharedState.yy[k] = this.yy[k];
8476 }
8477 }
8478 lexer.setInput(input, sharedState.yy);
8479 sharedState.yy.lexer = lexer;
8480 sharedState.yy.parser = this;
8481 if (typeof lexer.yylloc == 'undefined') {
8482 lexer.yylloc = {};
8483 }
8484 var yyloc = lexer.yylloc;
8485 lstack.push(yyloc);
8486 var ranges = lexer.options && lexer.options.ranges;
8487 if (typeof sharedState.yy.parseError === 'function') {
8488 this.parseError = sharedState.yy.parseError;
8489 } else {
8490 this.parseError = Object.getPrototypeOf(this).parseError;
8491 }
8492 function popStack(n) {
8493 stack.length = stack.length - 2 * n;
8494 vstack.length = vstack.length - n;
8495 lstack.length = lstack.length - n;
8496 }
8497 function lex() {
8498 var token;
8499 token = tstack.pop() || lexer.lex() || EOF;
8500 if (typeof token !== 'number') {
8501 if (token instanceof Array) {
8502 tstack = token;
8503 token = tstack.pop();
8504 }
8505 token = self.symbols_[token] || token;
8506 }
8507 return token;
8508 }
8509 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
8510 while (true) {
8511 state = stack[stack.length - 1];
8512 if (this.defaultActions[state]) {
8513 action = this.defaultActions[state];
8514 } else {
8515 if (symbol === null || typeof symbol == 'undefined') {
8516 symbol = lex();
8517 }
8518 action = table[state] && table[state][symbol];
8519 }
8520 if (typeof action === 'undefined' || !action.length || !action[0]) {
8521 var errStr = '';
8522 expected = [];
8523 for (p in table[state]) {
8524 if (this.terminals_[p] && p > TERROR) {
8525 expected.push('\'' + this.terminals_[p] + '\'');
8526 }
8527 }
8528 if (lexer.showPosition) {
8529 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
8530 } else {
8531 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
8532 }
8533 this.parseError(errStr, {
8534 text: lexer.match,
8535 token: this.terminals_[symbol] || symbol,
8536 line: lexer.yylineno,
8537 loc: yyloc,
8538 expected: expected
8539 });
8540 }
8541 if (action[0] instanceof Array && action.length > 1) {
8542 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
8543 }
8544 switch (action[0]) {
8545 case 1:
8546 stack.push(symbol);
8547 vstack.push(lexer.yytext);
8548 lstack.push(lexer.yylloc);
8549 stack.push(action[1]);
8550 symbol = null;
8551 if (!preErrorSymbol) {
8552 yyleng = lexer.yyleng;
8553 yytext = lexer.yytext;
8554 yylineno = lexer.yylineno;
8555 yyloc = lexer.yylloc;
8556 if (recovering > 0) {
8557 recovering--;
8558 }
8559 } else {
8560 symbol = preErrorSymbol;
8561 preErrorSymbol = null;
8562 }
8563 break;
8564 case 2:
8565 len = this.productions_[action[1]][1];
8566 yyval.$ = vstack[vstack.length - len];
8567 yyval._$ = {
8568 first_line: lstack[lstack.length - (len || 1)].first_line,
8569 last_line: lstack[lstack.length - 1].last_line,
8570 first_column: lstack[lstack.length - (len || 1)].first_column,
8571 last_column: lstack[lstack.length - 1].last_column
8572 };
8573 if (ranges) {
8574 yyval._$.range = [
8575 lstack[lstack.length - (len || 1)].range[0],
8576 lstack[lstack.length - 1].range[1]
8577 ];
8578 }
8579 r = this.performAction.apply(yyval, [
8580 yytext,
8581 yyleng,
8582 yylineno,
8583 sharedState.yy,
8584 action[1],
8585 vstack,
8586 lstack
8587 ].concat(args));
8588 if (typeof r !== 'undefined') {
8589 return r;
8590 }
8591 if (len) {
8592 stack = stack.slice(0, -1 * len * 2);
8593 vstack = vstack.slice(0, -1 * len);
8594 lstack = lstack.slice(0, -1 * len);
8595 }
8596 stack.push(this.productions_[action[1]][0]);
8597 vstack.push(yyval.$);
8598 lstack.push(yyval._$);
8599 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
8600 stack.push(newState);
8601 break;
8602 case 3:
8603 return true;
8604 }
8605 }
8606 return true;
8607}};
8608
8609/* generated by jison-lex 0.3.4 */
8610var lexer = (function(){
8611var lexer = ({
8612
8613EOF:1,
8614
8615parseError:function parseError(str, hash) {
8616 if (this.yy.parser) {
8617 this.yy.parser.parseError(str, hash);
8618 } else {
8619 throw new Error(str);
8620 }
8621 },
8622
8623// resets the lexer, sets new input
8624setInput:function (input, yy) {
8625 this.yy = yy || this.yy || {};
8626 this._input = input;
8627 this._more = this._backtrack = this.done = false;
8628 this.yylineno = this.yyleng = 0;
8629 this.yytext = this.matched = this.match = '';
8630 this.conditionStack = ['INITIAL'];
8631 this.yylloc = {
8632 first_line: 1,
8633 first_column: 0,
8634 last_line: 1,
8635 last_column: 0
8636 };
8637 if (this.options.ranges) {
8638 this.yylloc.range = [0,0];
8639 }
8640 this.offset = 0;
8641 return this;
8642 },
8643
8644// consumes and returns one char from the input
8645input:function () {
8646 var ch = this._input[0];
8647 this.yytext += ch;
8648 this.yyleng++;
8649 this.offset++;
8650 this.match += ch;
8651 this.matched += ch;
8652 var lines = ch.match(/(?:\r\n?|\n).*/g);
8653 if (lines) {
8654 this.yylineno++;
8655 this.yylloc.last_line++;
8656 } else {
8657 this.yylloc.last_column++;
8658 }
8659 if (this.options.ranges) {
8660 this.yylloc.range[1]++;
8661 }
8662
8663 this._input = this._input.slice(1);
8664 return ch;
8665 },
8666
8667// unshifts one char (or a string) into the input
8668unput:function (ch) {
8669 var len = ch.length;
8670 var lines = ch.split(/(?:\r\n?|\n)/g);
8671
8672 this._input = ch + this._input;
8673 this.yytext = this.yytext.substr(0, this.yytext.length - len);
8674 //this.yyleng -= len;
8675 this.offset -= len;
8676 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
8677 this.match = this.match.substr(0, this.match.length - 1);
8678 this.matched = this.matched.substr(0, this.matched.length - 1);
8679
8680 if (lines.length - 1) {
8681 this.yylineno -= lines.length - 1;
8682 }
8683 var r = this.yylloc.range;
8684
8685 this.yylloc = {
8686 first_line: this.yylloc.first_line,
8687 last_line: this.yylineno + 1,
8688 first_column: this.yylloc.first_column,
8689 last_column: lines ?
8690 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
8691 + oldLines[oldLines.length - lines.length].length - lines[0].length :
8692 this.yylloc.first_column - len
8693 };
8694
8695 if (this.options.ranges) {
8696 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
8697 }
8698 this.yyleng = this.yytext.length;
8699 return this;
8700 },
8701
8702// When called from action, caches matched text and appends it on next action
8703more:function () {
8704 this._more = true;
8705 return this;
8706 },
8707
8708// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
8709reject:function () {
8710 if (this.options.backtrack_lexer) {
8711 this._backtrack = true;
8712 } else {
8713 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
8714 text: "",
8715 token: null,
8716 line: this.yylineno
8717 });
8718
8719 }
8720 return this;
8721 },
8722
8723// retain first n characters of the match
8724less:function (n) {
8725 this.unput(this.match.slice(n));
8726 },
8727
8728// displays already matched input, i.e. for error messages
8729pastInput:function () {
8730 var past = this.matched.substr(0, this.matched.length - this.match.length);
8731 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
8732 },
8733
8734// displays upcoming input, i.e. for error messages
8735upcomingInput:function () {
8736 var next = this.match;
8737 if (next.length < 20) {
8738 next += this._input.substr(0, 20-next.length);
8739 }
8740 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
8741 },
8742
8743// displays the character position where the lexing error occurred, i.e. for error messages
8744showPosition:function () {
8745 var pre = this.pastInput();
8746 var c = new Array(pre.length + 1).join("-");
8747 return pre + this.upcomingInput() + "\n" + c + "^";
8748 },
8749
8750// test the lexed token: return FALSE when not a match, otherwise return token
8751test_match:function(match, indexed_rule) {
8752 var token,
8753 lines,
8754 backup;
8755
8756 if (this.options.backtrack_lexer) {
8757 // save context
8758 backup = {
8759 yylineno: this.yylineno,
8760 yylloc: {
8761 first_line: this.yylloc.first_line,
8762 last_line: this.last_line,
8763 first_column: this.yylloc.first_column,
8764 last_column: this.yylloc.last_column
8765 },
8766 yytext: this.yytext,
8767 match: this.match,
8768 matches: this.matches,
8769 matched: this.matched,
8770 yyleng: this.yyleng,
8771 offset: this.offset,
8772 _more: this._more,
8773 _input: this._input,
8774 yy: this.yy,
8775 conditionStack: this.conditionStack.slice(0),
8776 done: this.done
8777 };
8778 if (this.options.ranges) {
8779 backup.yylloc.range = this.yylloc.range.slice(0);
8780 }
8781 }
8782
8783 lines = match[0].match(/(?:\r\n?|\n).*/g);
8784 if (lines) {
8785 this.yylineno += lines.length;
8786 }
8787 this.yylloc = {
8788 first_line: this.yylloc.last_line,
8789 last_line: this.yylineno + 1,
8790 first_column: this.yylloc.last_column,
8791 last_column: lines ?
8792 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
8793 this.yylloc.last_column + match[0].length
8794 };
8795 this.yytext += match[0];
8796 this.match += match[0];
8797 this.matches = match;
8798 this.yyleng = this.yytext.length;
8799 if (this.options.ranges) {
8800 this.yylloc.range = [this.offset, this.offset += this.yyleng];
8801 }
8802 this._more = false;
8803 this._backtrack = false;
8804 this._input = this._input.slice(match[0].length);
8805 this.matched += match[0];
8806 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
8807 if (this.done && this._input) {
8808 this.done = false;
8809 }
8810 if (token) {
8811 return token;
8812 } else if (this._backtrack) {
8813 // recover context
8814 for (var k in backup) {
8815 this[k] = backup[k];
8816 }
8817 return false; // rule action called reject() implying the next rule should be tested instead.
8818 }
8819 return false;
8820 },
8821
8822// return next match in input
8823next:function () {
8824 if (this.done) {
8825 return this.EOF;
8826 }
8827 if (!this._input) {
8828 this.done = true;
8829 }
8830
8831 var token,
8832 match,
8833 tempMatch,
8834 index;
8835 if (!this._more) {
8836 this.yytext = '';
8837 this.match = '';
8838 }
8839 var rules = this._currentRules();
8840 for (var i = 0; i < rules.length; i++) {
8841 tempMatch = this._input.match(this.rules[rules[i]]);
8842 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
8843 match = tempMatch;
8844 index = i;
8845 if (this.options.backtrack_lexer) {
8846 token = this.test_match(tempMatch, rules[i]);
8847 if (token !== false) {
8848 return token;
8849 } else if (this._backtrack) {
8850 match = false;
8851 continue; // rule action called reject() implying a rule MISmatch.
8852 } else {
8853 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
8854 return false;
8855 }
8856 } else if (!this.options.flex) {
8857 break;
8858 }
8859 }
8860 }
8861 if (match) {
8862 token = this.test_match(match, rules[index]);
8863 if (token !== false) {
8864 return token;
8865 }
8866 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
8867 return false;
8868 }
8869 if (this._input === "") {
8870 return this.EOF;
8871 } else {
8872 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
8873 text: "",
8874 token: null,
8875 line: this.yylineno
8876 });
8877 }
8878 },
8879
8880// return next match that has a token
8881lex:function lex () {
8882 var r = this.next();
8883 if (r) {
8884 return r;
8885 } else {
8886 return this.lex();
8887 }
8888 },
8889
8890// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
8891begin:function begin (condition) {
8892 this.conditionStack.push(condition);
8893 },
8894
8895// pop the previously active lexer condition state off the condition stack
8896popState:function popState () {
8897 var n = this.conditionStack.length - 1;
8898 if (n > 0) {
8899 return this.conditionStack.pop();
8900 } else {
8901 return this.conditionStack[0];
8902 }
8903 },
8904
8905// produce the lexer rule set which is active for the currently active lexer condition state
8906_currentRules:function _currentRules () {
8907 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
8908 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
8909 } else {
8910 return this.conditions["INITIAL"].rules;
8911 }
8912 },
8913
8914// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
8915topState:function topState (n) {
8916 n = this.conditionStack.length - 1 - Math.abs(n || 0);
8917 if (n >= 0) {
8918 return this.conditionStack[n];
8919 } else {
8920 return "INITIAL";
8921 }
8922 },
8923
8924// alias for begin(condition)
8925pushState:function pushState (condition) {
8926 this.begin(condition);
8927 },
8928
8929// return the number of states currently on the stack
8930stateStackSize:function stateStackSize() {
8931 return this.conditionStack.length;
8932 },
8933options: {"case-insensitive":true},
8934performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
8935 // Pre-lexer code can go here
8936
8937var YYSTATE=YY_START;
8938switch($avoiding_name_collisions) {
8939case 0:/* do nothing */
8940break;
8941case 1:/* skip whitespace */
8942break;
8943case 2:return 4 ;
8944break;
8945case 3:return 9 ;
8946break;
8947case 4:return 'space';
8948break;
8949case 5:return 12;
8950break;
8951case 6:/*console.log('begin str');*/this.begin("string");
8952break;
8953case 7:/*console.log('pop-state');*/this.popState();
8954break;
8955case 8:/*console.log('ending string')*/return "STR";
8956break;
8957case 9:return "VALUE";
8958break;
8959case 10:return 6 ;
8960break;
8961}
8962},
8963rules: [/^(?:%%[^\n]*)/i,/^(?:\s+)/i,/^(?:pie\b)/i,/^(?:[\s\n\r]+)/i,/^(?:[\s]+)/i,/^(?:title\s[^#\n;]+)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i],
8964conditions: {"string":{"rules":[7,8],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,5,6,9,10],"inclusive":true}}
8965});
8966return lexer;
8967})();
8968parser.lexer = lexer;
8969function Parser () {
8970 this.yy = {};
8971}
8972Parser.prototype = parser;parser.Parser = Parser;
8973return new Parser;
8974})();
8975
8976
8977if (true) {
8978exports.parser = parser;
8979exports.Parser = parser.Parser;
8980exports.parse = function () { return parser.parse.apply(parser, arguments); };
8981exports.main = function commonjsMain (args) {
8982 if (!args[1]) {
8983 console.log('Usage: '+args[0]+' FILE');
8984 process.exit(1);
8985 }
8986 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
8987 return exports.parser.parse(source);
8988};
8989if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
8990 exports.main(process.argv.slice(1));
8991}
8992}
8993/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
8994
8995/***/ }),
8996
8997/***/ "./src/diagrams/pie/pieDb.js":
8998/*!***********************************!*\
8999 !*** ./src/diagrams/pie/pieDb.js ***!
9000 \***********************************/
9001/*! exports provided: default */
9002/***/ (function(module, __webpack_exports__, __webpack_require__) {
9003
9004"use strict";
9005__webpack_require__.r(__webpack_exports__);
9006/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
9007/**
9008 *
9009 */
9010
9011var sections = {};
9012var title = '';
9013
9014var addSection = function addSection(id, value) {
9015 if (typeof sections[id] === 'undefined') {
9016 sections[id] = value;
9017 _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Added new section :', id); // console.log('Added new section:', id, value)
9018 }
9019};
9020
9021var getSections = function getSections() {
9022 return sections;
9023};
9024
9025var setTitle = function setTitle(txt) {
9026 title = txt;
9027};
9028
9029var getTitle = function getTitle() {
9030 return title;
9031};
9032
9033var cleanupValue = function cleanupValue(value) {
9034 if (value.substring(0, 1) === ':') {
9035 value = value.substring(1).trim();
9036 return Number(value.trim());
9037 } else {
9038 return Number(value.trim());
9039 }
9040};
9041
9042var clear = function clear() {
9043 sections = {};
9044 title = '';
9045}; // export const parseError = (err, hash) => {
9046// global.mermaidAPI.parseError(err, hash)
9047// }
9048
9049
9050/* harmony default export */ __webpack_exports__["default"] = ({
9051 addSection: addSection,
9052 getSections: getSections,
9053 cleanupValue: cleanupValue,
9054 clear: clear,
9055 setTitle: setTitle,
9056 getTitle: getTitle // parseError
9057
9058});
9059
9060/***/ }),
9061
9062/***/ "./src/diagrams/pie/pieRenderer.js":
9063/*!*****************************************!*\
9064 !*** ./src/diagrams/pie/pieRenderer.js ***!
9065 \*****************************************/
9066/*! exports provided: setConf, draw, default */
9067/***/ (function(module, __webpack_exports__, __webpack_require__) {
9068
9069"use strict";
9070__webpack_require__.r(__webpack_exports__);
9071/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
9072/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
9073/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
9074/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
9075/* harmony import */ var _pieDb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pieDb */ "./src/diagrams/pie/pieDb.js");
9076/* harmony import */ var _parser_pie__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parser/pie */ "./src/diagrams/pie/parser/pie.jison");
9077/* harmony import */ var _parser_pie__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_parser_pie__WEBPACK_IMPORTED_MODULE_2__);
9078/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
9079/**
9080 * Created by AshishJ on 11-09-2019.
9081 */
9082
9083
9084
9085
9086var conf = {};
9087var setConf = function setConf(cnf) {
9088 var keys = Object.keys(cnf);
9089 keys.forEach(function (key) {
9090 conf[key] = cnf[key];
9091 });
9092};
9093/**
9094 * Draws a Pie Chart with the data given in text.
9095 * @param text
9096 * @param id
9097 */
9098
9099var w;
9100var draw = function draw(txt, id) {
9101 try {
9102 var parser = _parser_pie__WEBPACK_IMPORTED_MODULE_2___default.a.parser;
9103 parser.yy = _pieDb__WEBPACK_IMPORTED_MODULE_1__["default"];
9104 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Rendering info diagram\n' + txt); // Parse the Pie Chart definition
9105
9106 parser.yy.clear();
9107 parser.parse(txt);
9108 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Parsed info diagram');
9109 var elem = document.getElementById(id);
9110 w = elem.parentElement.offsetWidth;
9111
9112 if (typeof w === 'undefined') {
9113 w = 1200;
9114 }
9115
9116 if (typeof conf.useWidth !== 'undefined') {
9117 w = conf.useWidth;
9118 }
9119
9120 var h = 450;
9121 elem.setAttribute('height', '100%'); // Set viewBox
9122
9123 elem.setAttribute('viewBox', '0 0 ' + w + ' ' + h); // Fetch the default direction, use TD if none was found
9124
9125 var width = w; // 450
9126
9127 var height = 450;
9128 var margin = 40;
9129 var legendRectSize = 18;
9130 var legendSpacing = 4;
9131 var radius = Math.min(width, height) / 2 - margin;
9132 var svg = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#' + id).append('svg').attr('width', width).attr('height', height).append('g').attr('transform', 'translate(' + width / 2 + ',' + height / 2 + ')');
9133 var data = _pieDb__WEBPACK_IMPORTED_MODULE_1__["default"].getSections();
9134 var sum = 0;
9135 Object.keys(data).forEach(function (key) {
9136 sum += data[key];
9137 });
9138 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info(data); // set the color scale
9139
9140 var color = d3__WEBPACK_IMPORTED_MODULE_0__["scaleOrdinal"]().domain(data).range(d3__WEBPACK_IMPORTED_MODULE_0__["schemeSet2"]); // Compute the position of each group on the pie:
9141
9142 var pie = d3__WEBPACK_IMPORTED_MODULE_0__["pie"]().value(function (d) {
9143 return d.value;
9144 });
9145 var dataReady = pie(d3__WEBPACK_IMPORTED_MODULE_0__["entries"](data)); // shape helper to build arcs:
9146
9147 var arcGenerator = d3__WEBPACK_IMPORTED_MODULE_0__["arc"]().innerRadius(0).outerRadius(radius); // Build the pie chart: Basically, each part of the pie is a path that we build using the arc function.
9148
9149 svg.selectAll('mySlices').data(dataReady).enter().append('path').attr('d', arcGenerator).attr('fill', function (d) {
9150 return color(d.data.key);
9151 }).attr('stroke', 'black').style('stroke-width', '2px').style('opacity', 0.7); // Now add the Percentage. Use the centroid method to get the best coordinates
9152
9153 svg.selectAll('mySlices').data(dataReady).enter().append('text').text(function (d) {
9154 return (d.data.value / sum * 100).toFixed(0) + '%';
9155 }).attr('transform', function (d) {
9156 return 'translate(' + arcGenerator.centroid(d) + ')';
9157 }).style('text-anchor', 'middle').attr('class', 'slice').style('font-size', 17);
9158 svg.append('text').text(parser.yy.getTitle()).attr('x', 0).attr('y', -(h - 50) / 2).attr('class', 'pieTitleText'); //Add the slegend/annotations for each section
9159
9160 var legend = svg.selectAll('.legend').data(color.domain()).enter().append('g').attr('class', 'legend').attr('transform', function (d, i) {
9161 var height = legendRectSize + legendSpacing;
9162 var offset = height * color.domain().length / 2;
9163 var horz = 12 * legendRectSize;
9164 var vert = i * height - offset;
9165 return 'translate(' + horz + ',' + vert + ')';
9166 });
9167 legend.append('rect').attr('width', legendRectSize).attr('height', legendRectSize).style('fill', color).style('stroke', color);
9168 legend.append('text').attr('x', legendRectSize + legendSpacing).attr('y', legendRectSize - legendSpacing).text(function (d) {
9169 return d;
9170 });
9171 } catch (e) {
9172 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error('Error while rendering info diagram');
9173 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error(e.message);
9174 }
9175};
9176/* harmony default export */ __webpack_exports__["default"] = ({
9177 setConf: setConf,
9178 draw: draw
9179});
9180
9181/***/ }),
9182
9183/***/ "./src/diagrams/sequence/parser/sequenceDiagram.jison":
9184/*!************************************************************!*\
9185 !*** ./src/diagrams/sequence/parser/sequenceDiagram.jison ***!
9186 \************************************************************/
9187/*! no static exports found */
9188/***/ (function(module, exports, __webpack_require__) {
9189
9190/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
9191/*
9192 Returns a Parser object of the following structure:
9193
9194 Parser: {
9195 yy: {}
9196 }
9197
9198 Parser.prototype: {
9199 yy: {},
9200 trace: function(),
9201 symbols_: {associative list: name ==> number},
9202 terminals_: {associative list: number ==> name},
9203 productions_: [...],
9204 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
9205 table: [...],
9206 defaultActions: {...},
9207 parseError: function(str, hash),
9208 parse: function(input),
9209
9210 lexer: {
9211 EOF: 1,
9212 parseError: function(str, hash),
9213 setInput: function(input),
9214 input: function(),
9215 unput: function(str),
9216 more: function(),
9217 less: function(n),
9218 pastInput: function(),
9219 upcomingInput: function(),
9220 showPosition: function(),
9221 test_match: function(regex_match_array, rule_index),
9222 next: function(),
9223 lex: function(),
9224 begin: function(condition),
9225 popState: function(),
9226 _currentRules: function(),
9227 topState: function(),
9228 pushState: function(condition),
9229
9230 options: {
9231 ranges: boolean (optional: true ==> token location info will include a .range[] member)
9232 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
9233 backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
9234 },
9235
9236 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
9237 rules: [...],
9238 conditions: {associative list: name ==> set},
9239 }
9240 }
9241
9242
9243 token location info (@$, _$, etc.): {
9244 first_line: n,
9245 last_line: n,
9246 first_column: n,
9247 last_column: n,
9248 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
9249 }
9250
9251
9252 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
9253 text: (matched text)
9254 token: (the produced terminal token, if any)
9255 line: (yylineno)
9256 }
9257 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
9258 loc: (yylloc)
9259 expected: (string describing the set of expected tokens)
9260 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
9261 }
9262*/
9263var parser = (function(){
9264var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,4],$V3=[2,4],$V4=[1,9],$V5=[1,11],$V6=[1,12],$V7=[1,14],$V8=[1,15],$V9=[1,17],$Va=[1,18],$Vb=[1,19],$Vc=[1,20],$Vd=[1,21],$Ve=[1,22],$Vf=[1,24],$Vg=[1,25],$Vh=[1,4,5,10,15,16,18,20,21,22,23,24,26,28,29,30,41],$Vi=[1,33],$Vj=[4,5,10,15,16,18,20,21,22,23,24,26,30,41],$Vk=[4,5,10,15,16,18,20,21,22,23,24,26,29,30,41],$Vl=[4,5,10,15,16,18,20,21,22,23,24,26,28,30,41],$Vm=[39,40,41];
9265var parser = {trace: function trace () { },
9266yy: {},
9267symbols_: {"error":2,"start":3,"SPACE":4,"NL":5,"SD":6,"document":7,"line":8,"statement":9,"participant":10,"actor":11,"AS":12,"restOfLine":13,"signal":14,"activate":15,"deactivate":16,"note_statement":17,"title":18,"text2":19,"loop":20,"end":21,"rect":22,"opt":23,"alt":24,"else_sections":25,"par":26,"par_sections":27,"and":28,"else":29,"note":30,"placement":31,"over":32,"actor_pair":33,"spaceList":34,",":35,"left_of":36,"right_of":37,"signaltype":38,"+":39,"-":40,"ACTOR":41,"SOLID_OPEN_ARROW":42,"DOTTED_OPEN_ARROW":43,"SOLID_ARROW":44,"DOTTED_ARROW":45,"SOLID_CROSS":46,"DOTTED_CROSS":47,"TXT":48,"$accept":0,"$end":1},
9268terminals_: {2:"error",4:"SPACE",5:"NL",6:"SD",10:"participant",12:"AS",13:"restOfLine",15:"activate",16:"deactivate",18:"title",20:"loop",21:"end",22:"rect",23:"opt",24:"alt",26:"par",28:"and",29:"else",30:"note",32:"over",35:",",36:"left_of",37:"right_of",39:"+",40:"-",41:"ACTOR",42:"SOLID_OPEN_ARROW",43:"DOTTED_OPEN_ARROW",44:"SOLID_ARROW",45:"DOTTED_ARROW",46:"SOLID_CROSS",47:"DOTTED_CROSS",48:"TXT"},
9269productions_: [0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,5],[9,3],[9,2],[9,3],[9,3],[9,2],[9,3],[9,4],[9,4],[9,4],[9,4],[9,4],[27,1],[27,4],[25,1],[25,4],[17,4],[17,4],[34,2],[34,1],[33,3],[33,1],[31,1],[31,1],[14,5],[14,5],[14,4],[11,1],[38,1],[38,1],[38,1],[38,1],[38,1],[38,1],[19,1]],
9270performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
9271/* this == yyval */
9272
9273var $0 = $$.length - 1;
9274switch (yystate) {
9275case 3:
9276 yy.apply($$[$0]);return $$[$0];
9277break;
9278case 4:
9279 this.$ = []
9280break;
9281case 5:
9282$$[$0-1].push($$[$0]);this.$ = $$[$0-1]
9283break;
9284case 6: case 7:
9285 this.$ = $$[$0]
9286break;
9287case 8:
9288 this.$=[];
9289break;
9290case 9:
9291$$[$0-3].description=$$[$0-1]; this.$=$$[$0-3];
9292break;
9293case 10:
9294this.$=$$[$0-1];
9295break;
9296case 12:
9297this.$={type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]};
9298break;
9299case 13:
9300this.$={type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-1]};
9301break;
9302case 15:
9303this.$=[{type:'setTitle', text:$$[$0-1]}]
9304break;
9305case 16:
9306
9307 $$[$0-1].unshift({type: 'loopStart', loopText:$$[$0-2], signalType: yy.LINETYPE.LOOP_START});
9308 $$[$0-1].push({type: 'loopEnd', loopText:$$[$0-2], signalType: yy.LINETYPE.LOOP_END});
9309 this.$=$$[$0-1];
9310break;
9311case 17:
9312
9313 $$[$0-1].unshift({type: 'rectStart', color:$$[$0-2], signalType: yy.LINETYPE.RECT_START });
9314 $$[$0-1].push({type: 'rectEnd', color:$$[$0-2], signalType: yy.LINETYPE.RECT_END });
9315 this.$=$$[$0-1];
9316break;
9317case 18:
9318
9319 $$[$0-1].unshift({type: 'optStart', optText:$$[$0-2], signalType: yy.LINETYPE.OPT_START});
9320 $$[$0-1].push({type: 'optEnd', optText:$$[$0-2], signalType: yy.LINETYPE.OPT_END});
9321 this.$=$$[$0-1];
9322break;
9323case 19:
9324
9325 // Alt start
9326 $$[$0-1].unshift({type: 'altStart', altText:$$[$0-2], signalType: yy.LINETYPE.ALT_START});
9327 // Content in alt is already in $$[$0-1]
9328 // End
9329 $$[$0-1].push({type: 'altEnd', signalType: yy.LINETYPE.ALT_END});
9330 this.$=$$[$0-1];
9331break;
9332case 20:
9333
9334 // Parallel start
9335 $$[$0-1].unshift({type: 'parStart', parText:$$[$0-2], signalType: yy.LINETYPE.PAR_START});
9336 // Content in par is already in $$[$0-1]
9337 // End
9338 $$[$0-1].push({type: 'parEnd', signalType: yy.LINETYPE.PAR_END});
9339 this.$=$$[$0-1];
9340break;
9341case 22:
9342 this.$ = $$[$0-3].concat([{type: 'and', parText:$$[$0-1], signalType: yy.LINETYPE.PAR_AND}, $$[$0]]);
9343break;
9344case 24:
9345 this.$ = $$[$0-3].concat([{type: 'else', altText:$$[$0-1], signalType: yy.LINETYPE.ALT_ELSE}, $$[$0]]);
9346break;
9347case 25:
9348
9349 this.$ = [$$[$0-1], {type:'addNote', placement:$$[$0-2], actor:$$[$0-1].actor, text:$$[$0]}];
9350break;
9351case 26:
9352
9353 // Coerce actor_pair into a [to, from, ...] array
9354 $$[$0-2] = [].concat($$[$0-1], $$[$0-1]).slice(0, 2);
9355 $$[$0-2][0] = $$[$0-2][0].actor;
9356 $$[$0-2][1] = $$[$0-2][1].actor;
9357 this.$ = [$$[$0-1], {type:'addNote', placement:yy.PLACEMENT.OVER, actor:$$[$0-2].slice(0, 2), text:$$[$0]}];
9358break;
9359case 29:
9360 this.$ = [$$[$0-2], $$[$0]];
9361break;
9362case 30:
9363 this.$ = $$[$0];
9364break;
9365case 31:
9366 this.$ = yy.PLACEMENT.LEFTOF;
9367break;
9368case 32:
9369 this.$ = yy.PLACEMENT.RIGHTOF;
9370break;
9371case 33:
9372 this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]},
9373 {type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]}
9374 ]
9375break;
9376case 34:
9377 this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]},
9378 {type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-4]}
9379 ]
9380break;
9381case 35:
9382 this.$ = [$$[$0-3],$$[$0-1],{type: 'addMessage', from:$$[$0-3].actor, to:$$[$0-1].actor, signalType:$$[$0-2], msg:$$[$0]}]
9383break;
9384case 36:
9385this.$={type: 'addActor', actor:$$[$0]}
9386break;
9387case 37:
9388 this.$ = yy.LINETYPE.SOLID_OPEN;
9389break;
9390case 38:
9391 this.$ = yy.LINETYPE.DOTTED_OPEN;
9392break;
9393case 39:
9394 this.$ = yy.LINETYPE.SOLID;
9395break;
9396case 40:
9397 this.$ = yy.LINETYPE.DOTTED;
9398break;
9399case 41:
9400 this.$ = yy.LINETYPE.SOLID_CROSS;
9401break;
9402case 42:
9403 this.$ = yy.LINETYPE.DOTTED_CROSS;
9404break;
9405case 43:
9406this.$ = $$[$0].substring(1).trim().replace(/\\n/gm, "\n");
9407break;
9408}
9409},
9410table: [{3:1,4:$V0,5:$V1,6:$V2},{1:[3]},{3:5,4:$V0,5:$V1,6:$V2},{3:6,4:$V0,5:$V1,6:$V2},o([1,4,5,10,15,16,18,20,22,23,24,26,30,41],$V3,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:$V4,5:$V5,8:8,9:10,10:$V6,11:23,14:13,15:$V7,16:$V8,17:16,18:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,26:$Ve,30:$Vf,41:$Vg},o($Vh,[2,5]),{9:26,10:$V6,11:23,14:13,15:$V7,16:$V8,17:16,18:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,26:$Ve,30:$Vf,41:$Vg},o($Vh,[2,7]),o($Vh,[2,8]),{11:27,41:$Vg},{5:[1,28]},{11:29,41:$Vg},{11:30,41:$Vg},{5:[1,31]},{19:32,48:$Vi},{13:[1,34]},{13:[1,35]},{13:[1,36]},{13:[1,37]},{13:[1,38]},{38:39,42:[1,40],43:[1,41],44:[1,42],45:[1,43],46:[1,44],47:[1,45]},{31:46,32:[1,47],36:[1,48],37:[1,49]},o([5,12,35,42,43,44,45,46,47,48],[2,36]),o($Vh,[2,6]),{5:[1,51],12:[1,50]},o($Vh,[2,11]),{5:[1,52]},{5:[1,53]},o($Vh,[2,14]),{5:[1,54]},{5:[2,43]},o($Vj,$V3,{7:55}),o($Vj,$V3,{7:56}),o($Vj,$V3,{7:57}),o($Vk,$V3,{25:58,7:59}),o($Vl,$V3,{27:60,7:61}),{11:64,39:[1,62],40:[1,63],41:$Vg},o($Vm,[2,37]),o($Vm,[2,38]),o($Vm,[2,39]),o($Vm,[2,40]),o($Vm,[2,41]),o($Vm,[2,42]),{11:65,41:$Vg},{11:67,33:66,41:$Vg},{41:[2,31]},{41:[2,32]},{13:[1,68]},o($Vh,[2,10]),o($Vh,[2,12]),o($Vh,[2,13]),o($Vh,[2,15]),{4:$V4,5:$V5,8:8,9:10,10:$V6,11:23,14:13,15:$V7,16:$V8,17:16,18:$V9,20:$Va,21:[1,69],22:$Vb,23:$Vc,24:$Vd,26:$Ve,30:$Vf,41:$Vg},{4:$V4,5:$V5,8:8,9:10,10:$V6,11:23,14:13,15:$V7,16:$V8,17:16,18:$V9,20:$Va,21:[1,70],22:$Vb,23:$Vc,24:$Vd,26:$Ve,30:$Vf,41:$Vg},{4:$V4,5:$V5,8:8,9:10,10:$V6,11:23,14:13,15:$V7,16:$V8,17:16,18:$V9,20:$Va,21:[1,71],22:$Vb,23:$Vc,24:$Vd,26:$Ve,30:$Vf,41:$Vg},{21:[1,72]},{4:$V4,5:$V5,8:8,9:10,10:$V6,11:23,14:13,15:$V7,16:$V8,17:16,18:$V9,20:$Va,21:[2,23],22:$Vb,23:$Vc,24:$Vd,26:$Ve,29:[1,73],30:$Vf,41:$Vg},{21:[1,74]},{4:$V4,5:$V5,8:8,9:10,10:$V6,11:23,14:13,15:$V7,16:$V8,17:16,18:$V9,20:$Va,21:[2,21],22:$Vb,23:$Vc,24:$Vd,26:$Ve,28:[1,75],30:$Vf,41:$Vg},{11:76,41:$Vg},{11:77,41:$Vg},{19:78,48:$Vi},{19:79,48:$Vi},{19:80,48:$Vi},{35:[1,81],48:[2,30]},{5:[1,82]},o($Vh,[2,16]),o($Vh,[2,17]),o($Vh,[2,18]),o($Vh,[2,19]),{13:[1,83]},o($Vh,[2,20]),{13:[1,84]},{19:85,48:$Vi},{19:86,48:$Vi},{5:[2,35]},{5:[2,25]},{5:[2,26]},{11:87,41:$Vg},o($Vh,[2,9]),o($Vk,$V3,{7:59,25:88}),o($Vl,$V3,{7:61,27:89}),{5:[2,33]},{5:[2,34]},{48:[2,29]},{21:[2,24]},{21:[2,22]}],
9411defaultActions: {5:[2,1],6:[2,2],33:[2,43],48:[2,31],49:[2,32],78:[2,35],79:[2,25],80:[2,26],85:[2,33],86:[2,34],87:[2,29],88:[2,24],89:[2,22]},
9412parseError: function parseError (str, hash) {
9413 if (hash.recoverable) {
9414 this.trace(str);
9415 } else {
9416 var error = new Error(str);
9417 error.hash = hash;
9418 throw error;
9419 }
9420},
9421parse: function parse(input) {
9422 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
9423 var args = lstack.slice.call(arguments, 1);
9424 var lexer = Object.create(this.lexer);
9425 var sharedState = { yy: {} };
9426 for (var k in this.yy) {
9427 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
9428 sharedState.yy[k] = this.yy[k];
9429 }
9430 }
9431 lexer.setInput(input, sharedState.yy);
9432 sharedState.yy.lexer = lexer;
9433 sharedState.yy.parser = this;
9434 if (typeof lexer.yylloc == 'undefined') {
9435 lexer.yylloc = {};
9436 }
9437 var yyloc = lexer.yylloc;
9438 lstack.push(yyloc);
9439 var ranges = lexer.options && lexer.options.ranges;
9440 if (typeof sharedState.yy.parseError === 'function') {
9441 this.parseError = sharedState.yy.parseError;
9442 } else {
9443 this.parseError = Object.getPrototypeOf(this).parseError;
9444 }
9445 function popStack(n) {
9446 stack.length = stack.length - 2 * n;
9447 vstack.length = vstack.length - n;
9448 lstack.length = lstack.length - n;
9449 }
9450 function lex() {
9451 var token;
9452 token = tstack.pop() || lexer.lex() || EOF;
9453 if (typeof token !== 'number') {
9454 if (token instanceof Array) {
9455 tstack = token;
9456 token = tstack.pop();
9457 }
9458 token = self.symbols_[token] || token;
9459 }
9460 return token;
9461 }
9462 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
9463 while (true) {
9464 state = stack[stack.length - 1];
9465 if (this.defaultActions[state]) {
9466 action = this.defaultActions[state];
9467 } else {
9468 if (symbol === null || typeof symbol == 'undefined') {
9469 symbol = lex();
9470 }
9471 action = table[state] && table[state][symbol];
9472 }
9473 if (typeof action === 'undefined' || !action.length || !action[0]) {
9474 var errStr = '';
9475 expected = [];
9476 for (p in table[state]) {
9477 if (this.terminals_[p] && p > TERROR) {
9478 expected.push('\'' + this.terminals_[p] + '\'');
9479 }
9480 }
9481 if (lexer.showPosition) {
9482 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
9483 } else {
9484 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
9485 }
9486 this.parseError(errStr, {
9487 text: lexer.match,
9488 token: this.terminals_[symbol] || symbol,
9489 line: lexer.yylineno,
9490 loc: yyloc,
9491 expected: expected
9492 });
9493 }
9494 if (action[0] instanceof Array && action.length > 1) {
9495 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
9496 }
9497 switch (action[0]) {
9498 case 1:
9499 stack.push(symbol);
9500 vstack.push(lexer.yytext);
9501 lstack.push(lexer.yylloc);
9502 stack.push(action[1]);
9503 symbol = null;
9504 if (!preErrorSymbol) {
9505 yyleng = lexer.yyleng;
9506 yytext = lexer.yytext;
9507 yylineno = lexer.yylineno;
9508 yyloc = lexer.yylloc;
9509 if (recovering > 0) {
9510 recovering--;
9511 }
9512 } else {
9513 symbol = preErrorSymbol;
9514 preErrorSymbol = null;
9515 }
9516 break;
9517 case 2:
9518 len = this.productions_[action[1]][1];
9519 yyval.$ = vstack[vstack.length - len];
9520 yyval._$ = {
9521 first_line: lstack[lstack.length - (len || 1)].first_line,
9522 last_line: lstack[lstack.length - 1].last_line,
9523 first_column: lstack[lstack.length - (len || 1)].first_column,
9524 last_column: lstack[lstack.length - 1].last_column
9525 };
9526 if (ranges) {
9527 yyval._$.range = [
9528 lstack[lstack.length - (len || 1)].range[0],
9529 lstack[lstack.length - 1].range[1]
9530 ];
9531 }
9532 r = this.performAction.apply(yyval, [
9533 yytext,
9534 yyleng,
9535 yylineno,
9536 sharedState.yy,
9537 action[1],
9538 vstack,
9539 lstack
9540 ].concat(args));
9541 if (typeof r !== 'undefined') {
9542 return r;
9543 }
9544 if (len) {
9545 stack = stack.slice(0, -1 * len * 2);
9546 vstack = vstack.slice(0, -1 * len);
9547 lstack = lstack.slice(0, -1 * len);
9548 }
9549 stack.push(this.productions_[action[1]][0]);
9550 vstack.push(yyval.$);
9551 lstack.push(yyval._$);
9552 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
9553 stack.push(newState);
9554 break;
9555 case 3:
9556 return true;
9557 }
9558 }
9559 return true;
9560}};
9561
9562/* generated by jison-lex 0.3.4 */
9563var lexer = (function(){
9564var lexer = ({
9565
9566EOF:1,
9567
9568parseError:function parseError(str, hash) {
9569 if (this.yy.parser) {
9570 this.yy.parser.parseError(str, hash);
9571 } else {
9572 throw new Error(str);
9573 }
9574 },
9575
9576// resets the lexer, sets new input
9577setInput:function (input, yy) {
9578 this.yy = yy || this.yy || {};
9579 this._input = input;
9580 this._more = this._backtrack = this.done = false;
9581 this.yylineno = this.yyleng = 0;
9582 this.yytext = this.matched = this.match = '';
9583 this.conditionStack = ['INITIAL'];
9584 this.yylloc = {
9585 first_line: 1,
9586 first_column: 0,
9587 last_line: 1,
9588 last_column: 0
9589 };
9590 if (this.options.ranges) {
9591 this.yylloc.range = [0,0];
9592 }
9593 this.offset = 0;
9594 return this;
9595 },
9596
9597// consumes and returns one char from the input
9598input:function () {
9599 var ch = this._input[0];
9600 this.yytext += ch;
9601 this.yyleng++;
9602 this.offset++;
9603 this.match += ch;
9604 this.matched += ch;
9605 var lines = ch.match(/(?:\r\n?|\n).*/g);
9606 if (lines) {
9607 this.yylineno++;
9608 this.yylloc.last_line++;
9609 } else {
9610 this.yylloc.last_column++;
9611 }
9612 if (this.options.ranges) {
9613 this.yylloc.range[1]++;
9614 }
9615
9616 this._input = this._input.slice(1);
9617 return ch;
9618 },
9619
9620// unshifts one char (or a string) into the input
9621unput:function (ch) {
9622 var len = ch.length;
9623 var lines = ch.split(/(?:\r\n?|\n)/g);
9624
9625 this._input = ch + this._input;
9626 this.yytext = this.yytext.substr(0, this.yytext.length - len);
9627 //this.yyleng -= len;
9628 this.offset -= len;
9629 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
9630 this.match = this.match.substr(0, this.match.length - 1);
9631 this.matched = this.matched.substr(0, this.matched.length - 1);
9632
9633 if (lines.length - 1) {
9634 this.yylineno -= lines.length - 1;
9635 }
9636 var r = this.yylloc.range;
9637
9638 this.yylloc = {
9639 first_line: this.yylloc.first_line,
9640 last_line: this.yylineno + 1,
9641 first_column: this.yylloc.first_column,
9642 last_column: lines ?
9643 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
9644 + oldLines[oldLines.length - lines.length].length - lines[0].length :
9645 this.yylloc.first_column - len
9646 };
9647
9648 if (this.options.ranges) {
9649 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
9650 }
9651 this.yyleng = this.yytext.length;
9652 return this;
9653 },
9654
9655// When called from action, caches matched text and appends it on next action
9656more:function () {
9657 this._more = true;
9658 return this;
9659 },
9660
9661// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
9662reject:function () {
9663 if (this.options.backtrack_lexer) {
9664 this._backtrack = true;
9665 } else {
9666 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
9667 text: "",
9668 token: null,
9669 line: this.yylineno
9670 });
9671
9672 }
9673 return this;
9674 },
9675
9676// retain first n characters of the match
9677less:function (n) {
9678 this.unput(this.match.slice(n));
9679 },
9680
9681// displays already matched input, i.e. for error messages
9682pastInput:function () {
9683 var past = this.matched.substr(0, this.matched.length - this.match.length);
9684 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
9685 },
9686
9687// displays upcoming input, i.e. for error messages
9688upcomingInput:function () {
9689 var next = this.match;
9690 if (next.length < 20) {
9691 next += this._input.substr(0, 20-next.length);
9692 }
9693 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
9694 },
9695
9696// displays the character position where the lexing error occurred, i.e. for error messages
9697showPosition:function () {
9698 var pre = this.pastInput();
9699 var c = new Array(pre.length + 1).join("-");
9700 return pre + this.upcomingInput() + "\n" + c + "^";
9701 },
9702
9703// test the lexed token: return FALSE when not a match, otherwise return token
9704test_match:function(match, indexed_rule) {
9705 var token,
9706 lines,
9707 backup;
9708
9709 if (this.options.backtrack_lexer) {
9710 // save context
9711 backup = {
9712 yylineno: this.yylineno,
9713 yylloc: {
9714 first_line: this.yylloc.first_line,
9715 last_line: this.last_line,
9716 first_column: this.yylloc.first_column,
9717 last_column: this.yylloc.last_column
9718 },
9719 yytext: this.yytext,
9720 match: this.match,
9721 matches: this.matches,
9722 matched: this.matched,
9723 yyleng: this.yyleng,
9724 offset: this.offset,
9725 _more: this._more,
9726 _input: this._input,
9727 yy: this.yy,
9728 conditionStack: this.conditionStack.slice(0),
9729 done: this.done
9730 };
9731 if (this.options.ranges) {
9732 backup.yylloc.range = this.yylloc.range.slice(0);
9733 }
9734 }
9735
9736 lines = match[0].match(/(?:\r\n?|\n).*/g);
9737 if (lines) {
9738 this.yylineno += lines.length;
9739 }
9740 this.yylloc = {
9741 first_line: this.yylloc.last_line,
9742 last_line: this.yylineno + 1,
9743 first_column: this.yylloc.last_column,
9744 last_column: lines ?
9745 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
9746 this.yylloc.last_column + match[0].length
9747 };
9748 this.yytext += match[0];
9749 this.match += match[0];
9750 this.matches = match;
9751 this.yyleng = this.yytext.length;
9752 if (this.options.ranges) {
9753 this.yylloc.range = [this.offset, this.offset += this.yyleng];
9754 }
9755 this._more = false;
9756 this._backtrack = false;
9757 this._input = this._input.slice(match[0].length);
9758 this.matched += match[0];
9759 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
9760 if (this.done && this._input) {
9761 this.done = false;
9762 }
9763 if (token) {
9764 return token;
9765 } else if (this._backtrack) {
9766 // recover context
9767 for (var k in backup) {
9768 this[k] = backup[k];
9769 }
9770 return false; // rule action called reject() implying the next rule should be tested instead.
9771 }
9772 return false;
9773 },
9774
9775// return next match in input
9776next:function () {
9777 if (this.done) {
9778 return this.EOF;
9779 }
9780 if (!this._input) {
9781 this.done = true;
9782 }
9783
9784 var token,
9785 match,
9786 tempMatch,
9787 index;
9788 if (!this._more) {
9789 this.yytext = '';
9790 this.match = '';
9791 }
9792 var rules = this._currentRules();
9793 for (var i = 0; i < rules.length; i++) {
9794 tempMatch = this._input.match(this.rules[rules[i]]);
9795 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
9796 match = tempMatch;
9797 index = i;
9798 if (this.options.backtrack_lexer) {
9799 token = this.test_match(tempMatch, rules[i]);
9800 if (token !== false) {
9801 return token;
9802 } else if (this._backtrack) {
9803 match = false;
9804 continue; // rule action called reject() implying a rule MISmatch.
9805 } else {
9806 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
9807 return false;
9808 }
9809 } else if (!this.options.flex) {
9810 break;
9811 }
9812 }
9813 }
9814 if (match) {
9815 token = this.test_match(match, rules[index]);
9816 if (token !== false) {
9817 return token;
9818 }
9819 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
9820 return false;
9821 }
9822 if (this._input === "") {
9823 return this.EOF;
9824 } else {
9825 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
9826 text: "",
9827 token: null,
9828 line: this.yylineno
9829 });
9830 }
9831 },
9832
9833// return next match that has a token
9834lex:function lex () {
9835 var r = this.next();
9836 if (r) {
9837 return r;
9838 } else {
9839 return this.lex();
9840 }
9841 },
9842
9843// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
9844begin:function begin (condition) {
9845 this.conditionStack.push(condition);
9846 },
9847
9848// pop the previously active lexer condition state off the condition stack
9849popState:function popState () {
9850 var n = this.conditionStack.length - 1;
9851 if (n > 0) {
9852 return this.conditionStack.pop();
9853 } else {
9854 return this.conditionStack[0];
9855 }
9856 },
9857
9858// produce the lexer rule set which is active for the currently active lexer condition state
9859_currentRules:function _currentRules () {
9860 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
9861 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
9862 } else {
9863 return this.conditions["INITIAL"].rules;
9864 }
9865 },
9866
9867// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
9868topState:function topState (n) {
9869 n = this.conditionStack.length - 1 - Math.abs(n || 0);
9870 if (n >= 0) {
9871 return this.conditionStack[n];
9872 } else {
9873 return "INITIAL";
9874 }
9875 },
9876
9877// alias for begin(condition)
9878pushState:function pushState (condition) {
9879 this.begin(condition);
9880 },
9881
9882// return the number of states currently on the stack
9883stateStackSize:function stateStackSize() {
9884 return this.conditionStack.length;
9885 },
9886options: {"case-insensitive":true},
9887performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
9888var YYSTATE=YY_START;
9889switch($avoiding_name_collisions) {
9890case 0:return 5;
9891break;
9892case 1:/* skip all whitespace */
9893break;
9894case 2:/* skip same-line whitespace */
9895break;
9896case 3:/* skip comments */
9897break;
9898case 4:/* skip comments */
9899break;
9900case 5: this.begin('ID'); return 10;
9901break;
9902case 6: yy_.yytext = yy_.yytext.trim(); this.begin('ALIAS'); return 41;
9903break;
9904case 7: this.popState(); this.popState(); this.begin('LINE'); return 12;
9905break;
9906case 8: this.popState(); this.popState(); return 5;
9907break;
9908case 9: this.begin('LINE'); return 20;
9909break;
9910case 10: this.begin('LINE'); return 22;
9911break;
9912case 11: this.begin('LINE'); return 23;
9913break;
9914case 12: this.begin('LINE'); return 24;
9915break;
9916case 13: this.begin('LINE'); return 29;
9917break;
9918case 14: this.begin('LINE'); return 26;
9919break;
9920case 15: this.begin('LINE'); return 28;
9921break;
9922case 16: this.popState(); return 13;
9923break;
9924case 17:return 21;
9925break;
9926case 18:return 36;
9927break;
9928case 19:return 37;
9929break;
9930case 20:return 32;
9931break;
9932case 21:return 30;
9933break;
9934case 22: this.begin('ID'); return 15;
9935break;
9936case 23: this.begin('ID'); return 16;
9937break;
9938case 24:return 18;
9939break;
9940case 25:return 6;
9941break;
9942case 26:return 35;
9943break;
9944case 27:return 5;
9945break;
9946case 28: yy_.yytext = yy_.yytext.trim(); return 41;
9947break;
9948case 29:return 44;
9949break;
9950case 30:return 45;
9951break;
9952case 31:return 42;
9953break;
9954case 32:return 43;
9955break;
9956case 33:return 46;
9957break;
9958case 34:return 47;
9959break;
9960case 35:return 48;
9961break;
9962case 36:return 39;
9963break;
9964case 37:return 40;
9965break;
9966case 38:return 5;
9967break;
9968case 39:return 'INVALID';
9969break;
9970}
9971},
9972rules: [/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:participant\b)/i,/^(?:[^\->:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:and\b)/i,/^(?:[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?::[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],
9973conditions: {"LINE":{"rules":[2,3,16],"inclusive":false},"ALIAS":{"rules":[2,3,7,8],"inclusive":false},"ID":{"rules":[2,3,6],"inclusive":false},"INITIAL":{"rules":[0,1,3,4,5,9,10,11,12,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39],"inclusive":true}}
9974});
9975return lexer;
9976})();
9977parser.lexer = lexer;
9978function Parser () {
9979 this.yy = {};
9980}
9981Parser.prototype = parser;parser.Parser = Parser;
9982return new Parser;
9983})();
9984
9985
9986if (true) {
9987exports.parser = parser;
9988exports.Parser = parser.Parser;
9989exports.parse = function () { return parser.parse.apply(parser, arguments); };
9990exports.main = function commonjsMain (args) {
9991 if (!args[1]) {
9992 console.log('Usage: '+args[0]+' FILE');
9993 process.exit(1);
9994 }
9995 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
9996 return exports.parser.parse(source);
9997};
9998if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
9999 exports.main(process.argv.slice(1));
10000}
10001}
10002/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
10003
10004/***/ }),
10005
10006/***/ "./src/diagrams/sequence/sequenceDb.js":
10007/*!*********************************************!*\
10008 !*** ./src/diagrams/sequence/sequenceDb.js ***!
10009 \*********************************************/
10010/*! exports provided: addActor, addMessage, addSignal, getMessages, getActors, getActor, getActorKeys, getTitle, clear, LINETYPE, ARROWTYPE, PLACEMENT, addNote, setTitle, apply, default */
10011/***/ (function(module, __webpack_exports__, __webpack_require__) {
10012
10013"use strict";
10014__webpack_require__.r(__webpack_exports__);
10015/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addActor", function() { return addActor; });
10016/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addMessage", function() { return addMessage; });
10017/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSignal", function() { return addSignal; });
10018/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMessages", function() { return getMessages; });
10019/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActors", function() { return getActors; });
10020/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActor", function() { return getActor; });
10021/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActorKeys", function() { return getActorKeys; });
10022/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTitle", function() { return getTitle; });
10023/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
10024/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LINETYPE", function() { return LINETYPE; });
10025/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARROWTYPE", function() { return ARROWTYPE; });
10026/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLACEMENT", function() { return PLACEMENT; });
10027/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addNote", function() { return addNote; });
10028/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTitle", function() { return setTitle; });
10029/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "apply", function() { return apply; });
10030/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
10031
10032var actors = {};
10033var messages = [];
10034var notes = [];
10035var title = '';
10036var addActor = function addActor(id, name, description) {
10037 // Don't allow description nulling
10038 var old = actors[id];
10039 if (old && name === old.name && description == null) return; // Don't allow null descriptions, either
10040
10041 if (description == null) description = name;
10042 actors[id] = {
10043 name: name,
10044 description: description
10045 };
10046};
10047var addMessage = function addMessage(idFrom, idTo, message, answer) {
10048 messages.push({
10049 from: idFrom,
10050 to: idTo,
10051 message: message,
10052 answer: answer
10053 });
10054};
10055var addSignal = function addSignal(idFrom, idTo, message, messageType) {
10056 _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Adding message from=' + idFrom + ' to=' + idTo + ' message=' + message + ' type=' + messageType);
10057 messages.push({
10058 from: idFrom,
10059 to: idTo,
10060 message: message,
10061 type: messageType
10062 });
10063};
10064var getMessages = function getMessages() {
10065 return messages;
10066};
10067var getActors = function getActors() {
10068 return actors;
10069};
10070var getActor = function getActor(id) {
10071 return actors[id];
10072};
10073var getActorKeys = function getActorKeys() {
10074 return Object.keys(actors);
10075};
10076var getTitle = function getTitle() {
10077 return title;
10078};
10079var clear = function clear() {
10080 actors = {};
10081 messages = [];
10082};
10083var LINETYPE = {
10084 SOLID: 0,
10085 DOTTED: 1,
10086 NOTE: 2,
10087 SOLID_CROSS: 3,
10088 DOTTED_CROSS: 4,
10089 SOLID_OPEN: 5,
10090 DOTTED_OPEN: 6,
10091 LOOP_START: 10,
10092 LOOP_END: 11,
10093 ALT_START: 12,
10094 ALT_ELSE: 13,
10095 ALT_END: 14,
10096 OPT_START: 15,
10097 OPT_END: 16,
10098 ACTIVE_START: 17,
10099 ACTIVE_END: 18,
10100 PAR_START: 19,
10101 PAR_AND: 20,
10102 PAR_END: 21,
10103 RECT_START: 22,
10104 RECT_END: 23
10105};
10106var ARROWTYPE = {
10107 FILLED: 0,
10108 OPEN: 1
10109};
10110var PLACEMENT = {
10111 LEFTOF: 0,
10112 RIGHTOF: 1,
10113 OVER: 2
10114};
10115var addNote = function addNote(actor, placement, message) {
10116 var note = {
10117 actor: actor,
10118 placement: placement,
10119 message: message
10120 }; // Coerce actor into a [to, from, ...] array
10121
10122 var actors = [].concat(actor, actor);
10123 notes.push(note);
10124 messages.push({
10125 from: actors[0],
10126 to: actors[1],
10127 message: message,
10128 type: LINETYPE.NOTE,
10129 placement: placement
10130 });
10131};
10132var setTitle = function setTitle(titleText) {
10133 title = titleText;
10134};
10135var apply = function apply(param) {
10136 if (param instanceof Array) {
10137 param.forEach(function (item) {
10138 apply(item);
10139 });
10140 } else {
10141 switch (param.type) {
10142 case 'addActor':
10143 addActor(param.actor, param.actor, param.description);
10144 break;
10145
10146 case 'activeStart':
10147 addSignal(param.actor, undefined, undefined, param.signalType);
10148 break;
10149
10150 case 'activeEnd':
10151 addSignal(param.actor, undefined, undefined, param.signalType);
10152 break;
10153
10154 case 'addNote':
10155 addNote(param.actor, param.placement, param.text);
10156 break;
10157
10158 case 'addMessage':
10159 addSignal(param.from, param.to, param.msg, param.signalType);
10160 break;
10161
10162 case 'loopStart':
10163 addSignal(undefined, undefined, param.loopText, param.signalType);
10164 break;
10165
10166 case 'loopEnd':
10167 addSignal(undefined, undefined, undefined, param.signalType);
10168 break;
10169
10170 case 'rectStart':
10171 addSignal(undefined, undefined, param.color, param.signalType);
10172 break;
10173
10174 case 'rectEnd':
10175 addSignal(undefined, undefined, undefined, param.signalType);
10176 break;
10177
10178 case 'optStart':
10179 addSignal(undefined, undefined, param.optText, param.signalType);
10180 break;
10181
10182 case 'optEnd':
10183 addSignal(undefined, undefined, undefined, param.signalType);
10184 break;
10185
10186 case 'altStart':
10187 addSignal(undefined, undefined, param.altText, param.signalType);
10188 break;
10189
10190 case 'else':
10191 addSignal(undefined, undefined, param.altText, param.signalType);
10192 break;
10193
10194 case 'altEnd':
10195 addSignal(undefined, undefined, undefined, param.signalType);
10196 break;
10197
10198 case 'setTitle':
10199 setTitle(param.text);
10200 break;
10201
10202 case 'parStart':
10203 addSignal(undefined, undefined, param.parText, param.signalType);
10204 break;
10205
10206 case 'and':
10207 addSignal(undefined, undefined, param.parText, param.signalType);
10208 break;
10209
10210 case 'parEnd':
10211 addSignal(undefined, undefined, undefined, param.signalType);
10212 break;
10213 }
10214 }
10215};
10216/* harmony default export */ __webpack_exports__["default"] = ({
10217 addActor: addActor,
10218 addMessage: addMessage,
10219 addSignal: addSignal,
10220 getMessages: getMessages,
10221 getActors: getActors,
10222 getActor: getActor,
10223 getActorKeys: getActorKeys,
10224 getTitle: getTitle,
10225 clear: clear,
10226 LINETYPE: LINETYPE,
10227 ARROWTYPE: ARROWTYPE,
10228 PLACEMENT: PLACEMENT,
10229 addNote: addNote,
10230 setTitle: setTitle,
10231 apply: apply
10232});
10233
10234/***/ }),
10235
10236/***/ "./src/diagrams/sequence/sequenceRenderer.js":
10237/*!***************************************************!*\
10238 !*** ./src/diagrams/sequence/sequenceRenderer.js ***!
10239 \***************************************************/
10240/*! exports provided: bounds, drawActors, setConf, draw, default */
10241/***/ (function(module, __webpack_exports__, __webpack_require__) {
10242
10243"use strict";
10244__webpack_require__.r(__webpack_exports__);
10245/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bounds", function() { return bounds; });
10246/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawActors", function() { return drawActors; });
10247/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
10248/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
10249/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
10250/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
10251/* harmony import */ var _svgDraw__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./svgDraw */ "./src/diagrams/sequence/svgDraw.js");
10252/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
10253/* harmony import */ var _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/sequenceDiagram */ "./src/diagrams/sequence/parser/sequenceDiagram.jison");
10254/* harmony import */ var _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__);
10255/* harmony import */ var _sequenceDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./sequenceDb */ "./src/diagrams/sequence/sequenceDb.js");
10256
10257
10258
10259
10260
10261_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy = _sequenceDb__WEBPACK_IMPORTED_MODULE_4__["default"];
10262var conf = {
10263 diagramMarginX: 50,
10264 diagramMarginY: 30,
10265 // Margin between actors
10266 actorMargin: 50,
10267 // Width of actor boxes
10268 width: 150,
10269 // Height of actor boxes
10270 height: 65,
10271 actorFontSize: 14,
10272 actorFontFamily: '"Open-Sans", "sans-serif"',
10273 // Margin around loop boxes
10274 boxMargin: 10,
10275 boxTextMargin: 5,
10276 noteMargin: 10,
10277 // Space between messages
10278 messageMargin: 35,
10279 // mirror actors under diagram
10280 mirrorActors: false,
10281 // Depending on css styling this might need adjustment
10282 // Prolongs the edge of the diagram downwards
10283 bottomMarginAdj: 1,
10284 // width of activation box
10285 activationWidth: 10,
10286 // text placement as: tspan | fo | old only text as before
10287 textPlacement: 'tspan',
10288 showSequenceNumbers: false
10289};
10290var bounds = {
10291 data: {
10292 startx: undefined,
10293 stopx: undefined,
10294 starty: undefined,
10295 stopy: undefined
10296 },
10297 verticalPos: 0,
10298 sequenceItems: [],
10299 activations: [],
10300 init: function init() {
10301 this.sequenceItems = [];
10302 this.activations = [];
10303 this.data = {
10304 startx: undefined,
10305 stopx: undefined,
10306 starty: undefined,
10307 stopy: undefined
10308 };
10309 this.verticalPos = 0;
10310 },
10311 updateVal: function updateVal(obj, key, val, fun) {
10312 if (typeof obj[key] === 'undefined') {
10313 obj[key] = val;
10314 } else {
10315 obj[key] = fun(val, obj[key]);
10316 }
10317 },
10318 updateBounds: function updateBounds(startx, starty, stopx, stopy) {
10319 var _self = this;
10320
10321 var cnt = 0;
10322
10323 function updateFn(type) {
10324 return function updateItemBounds(item) {
10325 cnt++; // The loop sequenceItems is a stack so the biggest margins in the beginning of the sequenceItems
10326
10327 var n = _self.sequenceItems.length - cnt + 1;
10328
10329 _self.updateVal(item, 'starty', starty - n * conf.boxMargin, Math.min);
10330
10331 _self.updateVal(item, 'stopy', stopy + n * conf.boxMargin, Math.max);
10332
10333 _self.updateVal(bounds.data, 'startx', startx - n * conf.boxMargin, Math.min);
10334
10335 _self.updateVal(bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max);
10336
10337 if (!(type === 'activation')) {
10338 _self.updateVal(item, 'startx', startx - n * conf.boxMargin, Math.min);
10339
10340 _self.updateVal(item, 'stopx', stopx + n * conf.boxMargin, Math.max);
10341
10342 _self.updateVal(bounds.data, 'starty', starty - n * conf.boxMargin, Math.min);
10343
10344 _self.updateVal(bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max);
10345 }
10346 };
10347 }
10348
10349 this.sequenceItems.forEach(updateFn());
10350 this.activations.forEach(updateFn('activation'));
10351 },
10352 insert: function insert(startx, starty, stopx, stopy) {
10353 var _startx = Math.min(startx, stopx);
10354
10355 var _stopx = Math.max(startx, stopx);
10356
10357 var _starty = Math.min(starty, stopy);
10358
10359 var _stopy = Math.max(starty, stopy);
10360
10361 this.updateVal(bounds.data, 'startx', _startx, Math.min);
10362 this.updateVal(bounds.data, 'starty', _starty, Math.min);
10363 this.updateVal(bounds.data, 'stopx', _stopx, Math.max);
10364 this.updateVal(bounds.data, 'stopy', _stopy, Math.max);
10365 this.updateBounds(_startx, _starty, _stopx, _stopy);
10366 },
10367 newActivation: function newActivation(message, diagram) {
10368 var actorRect = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getActors()[message.from.actor];
10369 var stackedSize = actorActivations(message.from.actor).length;
10370 var x = actorRect.x + conf.width / 2 + (stackedSize - 1) * conf.activationWidth / 2;
10371 this.activations.push({
10372 startx: x,
10373 starty: this.verticalPos + 2,
10374 stopx: x + conf.activationWidth,
10375 stopy: undefined,
10376 actor: message.from.actor,
10377 anchored: _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].anchorElement(diagram)
10378 });
10379 },
10380 endActivation: function endActivation(message) {
10381 // find most recent activation for given actor
10382 var lastActorActivationIdx = this.activations.map(function (activation) {
10383 return activation.actor;
10384 }).lastIndexOf(message.from.actor);
10385 var activation = this.activations.splice(lastActorActivationIdx, 1)[0];
10386 return activation;
10387 },
10388 newLoop: function newLoop(title, fill) {
10389 this.sequenceItems.push({
10390 startx: undefined,
10391 starty: this.verticalPos,
10392 stopx: undefined,
10393 stopy: undefined,
10394 title: title,
10395 fill: fill
10396 });
10397 },
10398 endLoop: function endLoop() {
10399 var loop = this.sequenceItems.pop();
10400 return loop;
10401 },
10402 addSectionToLoop: function addSectionToLoop(message) {
10403 var loop = this.sequenceItems.pop();
10404 loop.sections = loop.sections || [];
10405 loop.sectionTitles = loop.sectionTitles || [];
10406 loop.sections.push(bounds.getVerticalPos());
10407 loop.sectionTitles.push(message);
10408 this.sequenceItems.push(loop);
10409 },
10410 bumpVerticalPos: function bumpVerticalPos(bump) {
10411 this.verticalPos = this.verticalPos + bump;
10412 this.data.stopy = this.verticalPos;
10413 },
10414 getVerticalPos: function getVerticalPos() {
10415 return this.verticalPos;
10416 },
10417 getBounds: function getBounds() {
10418 return this.data;
10419 }
10420};
10421
10422var _drawLongText = function _drawLongText(text, x, y, g, width) {
10423 var textHeight = 0;
10424 var lines = text.split(/<br\/?>/gi);
10425 var _iteratorNormalCompletion = true;
10426 var _didIteratorError = false;
10427 var _iteratorError = undefined;
10428
10429 try {
10430 for (var _iterator = lines[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
10431 var line = _step.value;
10432 var textObj = _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].getTextObj();
10433 textObj.x = x;
10434 textObj.y = y + textHeight;
10435 textObj.textMargin = conf.noteMargin;
10436 textObj.dy = '1em';
10437 textObj.text = line;
10438 textObj.class = 'noteText';
10439 var textElem = _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawText(g, textObj, width);
10440 textHeight += (textElem._groups || textElem)[0][0].getBBox().height;
10441 }
10442 } catch (err) {
10443 _didIteratorError = true;
10444 _iteratorError = err;
10445 } finally {
10446 try {
10447 if (!_iteratorNormalCompletion && _iterator.return != null) {
10448 _iterator.return();
10449 }
10450 } finally {
10451 if (_didIteratorError) {
10452 throw _iteratorError;
10453 }
10454 }
10455 }
10456
10457 return textHeight;
10458};
10459/**
10460 * Draws an actor in the diagram with the attaced line
10461 * @param center - The center of the the actor
10462 * @param pos The position if the actor in the liost of actors
10463 * @param description The text in the box
10464 */
10465
10466
10467var drawNote = function drawNote(elem, startx, verticalPos, msg, forceWidth) {
10468 var rect = _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].getNoteRect();
10469 rect.x = startx;
10470 rect.y = verticalPos;
10471 rect.width = forceWidth || conf.width;
10472 rect.class = 'note';
10473 var g = elem.append('g');
10474 var rectElem = _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawRect(g, rect);
10475
10476 var textHeight = _drawLongText(msg.message, startx - 4, verticalPos + 24, g, rect.width - conf.noteMargin);
10477
10478 bounds.insert(startx, verticalPos, startx + rect.width, verticalPos + 2 * conf.noteMargin + textHeight);
10479 rectElem.attr('height', textHeight + 2 * conf.noteMargin);
10480 bounds.bumpVerticalPos(textHeight + 2 * conf.noteMargin);
10481};
10482/**
10483 * Draws a message
10484 * @param elem
10485 * @param startx
10486 * @param stopx
10487 * @param verticalPos
10488 * @param txtCenter
10489 * @param msg
10490 */
10491
10492
10493var drawMessage = function drawMessage(elem, startx, stopx, verticalPos, msg, sequenceIndex) {
10494 var g = elem.append('g');
10495 var txtCenter = startx + (stopx - startx) / 2;
10496 var textElem;
10497 var counterBreaklines = 0;
10498 var breaklineOffset = 17;
10499 var breaklines = msg.message.split(/<br\/?>/gi);
10500 var _iteratorNormalCompletion2 = true;
10501 var _didIteratorError2 = false;
10502 var _iteratorError2 = undefined;
10503
10504 try {
10505 for (var _iterator2 = breaklines[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
10506 var breakline = _step2.value;
10507 textElem = g.append('text') // text label for the x axis
10508 .attr('x', txtCenter).attr('y', verticalPos - 7 + counterBreaklines * breaklineOffset).style('text-anchor', 'middle').attr('class', 'messageText').text(breakline.trim());
10509 counterBreaklines++;
10510 }
10511 } catch (err) {
10512 _didIteratorError2 = true;
10513 _iteratorError2 = err;
10514 } finally {
10515 try {
10516 if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
10517 _iterator2.return();
10518 }
10519 } finally {
10520 if (_didIteratorError2) {
10521 throw _iteratorError2;
10522 }
10523 }
10524 }
10525
10526 var offsetLineCounter = counterBreaklines - 1;
10527 var totalOffset = offsetLineCounter * breaklineOffset;
10528 var textWidth = (textElem._groups || textElem)[0][0].getBBox().width;
10529 var line;
10530
10531 if (startx === stopx) {
10532 if (conf.rightAngles) {
10533 line = g.append('path').attr('d', "M ".concat(startx, ",").concat(verticalPos + totalOffset, " H ").concat(startx + conf.width / 2, " V ").concat(verticalPos + 25 + totalOffset, " H ").concat(startx));
10534 } else {
10535 line = g.append('path').attr('d', 'M ' + startx + ',' + (verticalPos + totalOffset) + ' C ' + (startx + 60) + ',' + (verticalPos - 10 + totalOffset) + ' ' + (startx + 60) + ',' + (verticalPos + 30 + totalOffset) + ' ' + startx + ',' + (verticalPos + 20 + totalOffset));
10536 }
10537
10538 bounds.bumpVerticalPos(30 + totalOffset);
10539 var dx = Math.max(textWidth / 2, 100);
10540 bounds.insert(startx - dx, bounds.getVerticalPos() - 10 + totalOffset, stopx + dx, bounds.getVerticalPos() + totalOffset);
10541 } else {
10542 line = g.append('line');
10543 line.attr('x1', startx);
10544 line.attr('y1', verticalPos);
10545 line.attr('x2', stopx);
10546 line.attr('y2', verticalPos);
10547 bounds.insert(startx, bounds.getVerticalPos() - 10 + totalOffset, stopx, bounds.getVerticalPos() + totalOffset);
10548 } // Make an SVG Container
10549 // Draw the line
10550
10551
10552 if (msg.type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED || msg.type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_CROSS || msg.type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_OPEN) {
10553 line.style('stroke-dasharray', '3, 3');
10554 line.attr('class', 'messageLine1');
10555 } else {
10556 line.attr('class', 'messageLine0');
10557 }
10558
10559 var url = '';
10560
10561 if (conf.arrowMarkerAbsolute) {
10562 url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;
10563 url = url.replace(/\(/g, '\\(');
10564 url = url.replace(/\)/g, '\\)');
10565 }
10566
10567 line.attr('stroke-width', 2);
10568 line.attr('stroke', 'black');
10569 line.style('fill', 'none'); // remove any fill colour
10570
10571 if (msg.type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID || msg.type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED) {
10572 line.attr('marker-end', 'url(' + url + '#arrowhead)');
10573 }
10574
10575 if (msg.type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_CROSS || msg.type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_CROSS) {
10576 line.attr('marker-end', 'url(' + url + '#crosshead)');
10577 } // add node number
10578
10579
10580 if (conf.showSequenceNumbers) {
10581 line.attr('marker-start', 'url(' + url + '#sequencenumber)');
10582 g.append('text').attr('x', startx).attr('y', verticalPos + 4).attr('font-family', 'sans-serif').attr('font-size', '12px').attr('text-anchor', 'middle').attr('textLength', '16px').attr('class', 'sequenceNumber').text(sequenceIndex);
10583 }
10584};
10585
10586var drawActors = function drawActors(diagram, actors, actorKeys, verticalPos) {
10587 // Draw the actors
10588 for (var i = 0; i < actorKeys.length; i++) {
10589 var key = actorKeys[i]; // Add some rendering data to the object
10590
10591 actors[key].x = i * conf.actorMargin + i * conf.width;
10592 actors[key].y = verticalPos;
10593 actors[key].width = conf.diagramMarginX;
10594 actors[key].height = conf.diagramMarginY; // Draw the box with the attached line
10595
10596 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawActor(diagram, actors[key].x, verticalPos, actors[key].description, conf);
10597 bounds.insert(actors[key].x, verticalPos, actors[key].x + conf.width, conf.height);
10598 } // Add a margin between the actor boxes and the first arrow
10599
10600
10601 bounds.bumpVerticalPos(conf.height);
10602};
10603var setConf = function setConf(cnf) {
10604 var keys = Object.keys(cnf);
10605 keys.forEach(function (key) {
10606 conf[key] = cnf[key];
10607 });
10608 conf.actorFontFamily = cnf.fontFamily;
10609};
10610
10611var actorActivations = function actorActivations(actor) {
10612 return bounds.activations.filter(function (activation) {
10613 return activation.actor === actor;
10614 });
10615};
10616
10617var actorFlowVerticaBounds = function actorFlowVerticaBounds(actor) {
10618 // handle multiple stacked activations for same actor
10619 var actors = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getActors();
10620 var activations = actorActivations(actor);
10621 var left = activations.reduce(function (acc, activation) {
10622 return Math.min(acc, activation.startx);
10623 }, actors[actor].x + conf.width / 2);
10624 var right = activations.reduce(function (acc, activation) {
10625 return Math.max(acc, activation.stopx);
10626 }, actors[actor].x + conf.width / 2);
10627 return [left, right];
10628};
10629/**
10630 * Draws a flowchart in the tag with id: id based on the graph definition in text.
10631 * @param text
10632 * @param id
10633 */
10634
10635
10636var draw = function draw(text, id) {
10637 _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.clear();
10638 _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].parse(text + '\n');
10639 bounds.init();
10640 var diagram = d3__WEBPACK_IMPORTED_MODULE_0__["select"]("[id=\"".concat(id, "\"]"));
10641 var startx;
10642 var stopx;
10643 var forceWidth; // Fetch data from the parsing
10644
10645 var actors = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getActors();
10646 var actorKeys = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getActorKeys();
10647 var messages = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getMessages();
10648 var title = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getTitle();
10649 drawActors(diagram, actors, actorKeys, 0); // The arrow head definition is attached to the svg once
10650
10651 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].insertArrowHead(diagram);
10652 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].insertArrowCrossHead(diagram);
10653 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].insertSequenceNumber(diagram);
10654
10655 function activeEnd(msg, verticalPos) {
10656 var activationData = bounds.endActivation(msg);
10657
10658 if (activationData.starty + 18 > verticalPos) {
10659 activationData.starty = verticalPos - 6;
10660 verticalPos += 12;
10661 }
10662
10663 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawActivation(diagram, activationData, verticalPos, conf, actorActivations(msg.from.actor).length);
10664 bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos);
10665 } // const lastMsg
10666 // Draw the messages/signals
10667
10668
10669 var sequenceIndex = 1;
10670 messages.forEach(function (msg) {
10671 var loopData;
10672
10673 switch (msg.type) {
10674 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.NOTE:
10675 bounds.bumpVerticalPos(conf.boxMargin);
10676 startx = actors[msg.from].x;
10677 stopx = actors[msg.to].x;
10678
10679 if (msg.placement === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.PLACEMENT.RIGHTOF) {
10680 drawNote(diagram, startx + (conf.width + conf.actorMargin) / 2, bounds.getVerticalPos(), msg);
10681 } else if (msg.placement === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.PLACEMENT.LEFTOF) {
10682 drawNote(diagram, startx - (conf.width + conf.actorMargin) / 2, bounds.getVerticalPos(), msg);
10683 } else if (msg.to === msg.from) {
10684 // Single-actor over
10685 drawNote(diagram, startx, bounds.getVerticalPos(), msg);
10686 } else {
10687 // Multi-actor over
10688 forceWidth = Math.abs(startx - stopx) + conf.actorMargin;
10689 drawNote(diagram, (startx + stopx + conf.width - forceWidth) / 2, bounds.getVerticalPos(), msg, forceWidth);
10690 }
10691
10692 break;
10693
10694 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ACTIVE_START:
10695 bounds.newActivation(msg, diagram);
10696 break;
10697
10698 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ACTIVE_END:
10699 activeEnd(msg, bounds.getVerticalPos());
10700 break;
10701
10702 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.LOOP_START:
10703 bounds.bumpVerticalPos(conf.boxMargin);
10704 bounds.newLoop(msg.message);
10705 bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
10706 break;
10707
10708 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.LOOP_END:
10709 loopData = bounds.endLoop();
10710 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawLoop(diagram, loopData, 'loop', conf);
10711 bounds.bumpVerticalPos(conf.boxMargin);
10712 break;
10713
10714 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.RECT_START:
10715 bounds.bumpVerticalPos(conf.boxMargin);
10716 bounds.newLoop(undefined, msg.message);
10717 bounds.bumpVerticalPos(conf.boxMargin);
10718 break;
10719
10720 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.RECT_END:
10721 {
10722 var rectData = bounds.endLoop();
10723 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawBackgroundRect(diagram, rectData);
10724 bounds.bumpVerticalPos(conf.boxMargin);
10725 break;
10726 }
10727
10728 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.OPT_START:
10729 bounds.bumpVerticalPos(conf.boxMargin);
10730 bounds.newLoop(msg.message);
10731 bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
10732 break;
10733
10734 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.OPT_END:
10735 loopData = bounds.endLoop();
10736 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawLoop(diagram, loopData, 'opt', conf);
10737 bounds.bumpVerticalPos(conf.boxMargin);
10738 break;
10739
10740 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ALT_START:
10741 bounds.bumpVerticalPos(conf.boxMargin);
10742 bounds.newLoop(msg.message);
10743 bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
10744 break;
10745
10746 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ALT_ELSE:
10747 bounds.bumpVerticalPos(conf.boxMargin);
10748 loopData = bounds.addSectionToLoop(msg.message);
10749 bounds.bumpVerticalPos(conf.boxMargin);
10750 break;
10751
10752 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ALT_END:
10753 loopData = bounds.endLoop();
10754 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawLoop(diagram, loopData, 'alt', conf);
10755 bounds.bumpVerticalPos(conf.boxMargin);
10756 break;
10757
10758 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.PAR_START:
10759 bounds.bumpVerticalPos(conf.boxMargin);
10760 bounds.newLoop(msg.message);
10761 bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
10762 break;
10763
10764 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.PAR_AND:
10765 bounds.bumpVerticalPos(conf.boxMargin);
10766 loopData = bounds.addSectionToLoop(msg.message);
10767 bounds.bumpVerticalPos(conf.boxMargin);
10768 break;
10769
10770 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.PAR_END:
10771 loopData = bounds.endLoop();
10772 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawLoop(diagram, loopData, 'par', conf);
10773 bounds.bumpVerticalPos(conf.boxMargin);
10774 break;
10775
10776 default:
10777 try {
10778 // lastMsg = msg
10779 bounds.bumpVerticalPos(conf.messageMargin);
10780 var fromBounds = actorFlowVerticaBounds(msg.from);
10781 var toBounds = actorFlowVerticaBounds(msg.to);
10782 var fromIdx = fromBounds[0] <= toBounds[0] ? 1 : 0;
10783 var toIdx = fromBounds[0] < toBounds[0] ? 0 : 1;
10784 startx = fromBounds[fromIdx];
10785 stopx = toBounds[toIdx];
10786 var verticalPos = bounds.getVerticalPos();
10787 drawMessage(diagram, startx, stopx, verticalPos, msg, sequenceIndex);
10788 var allBounds = fromBounds.concat(toBounds);
10789 bounds.insert(Math.min.apply(null, allBounds), verticalPos, Math.max.apply(null, allBounds), verticalPos);
10790 } catch (e) {
10791 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].error('error while drawing message', e);
10792 }
10793
10794 } // Increment sequence counter if msg.type is a line (and not another event like activation or note, etc)
10795
10796
10797 if ([_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_OPEN, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_OPEN, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_CROSS, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_CROSS].includes(msg.type)) {
10798 sequenceIndex++;
10799 }
10800 });
10801
10802 if (conf.mirrorActors) {
10803 // Draw actors below diagram
10804 bounds.bumpVerticalPos(conf.boxMargin * 2);
10805 drawActors(diagram, actors, actorKeys, bounds.getVerticalPos());
10806 }
10807
10808 var box = bounds.getBounds(); // Adjust line height of actor lines now that the height of the diagram is known
10809
10810 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('For line height fix Querying: #' + id + ' .actor-line');
10811 var actorLines = d3__WEBPACK_IMPORTED_MODULE_0__["selectAll"]('#' + id + ' .actor-line');
10812 actorLines.attr('y2', box.stopy);
10813 var height = box.stopy - box.starty + 2 * conf.diagramMarginY;
10814
10815 if (conf.mirrorActors) {
10816 height = height - conf.boxMargin + conf.bottomMarginAdj;
10817 }
10818
10819 var width = box.stopx - box.startx + 2 * conf.diagramMarginX;
10820
10821 if (title) {
10822 diagram.append('text').text(title).attr('x', (box.stopx - box.startx) / 2 - 2 * conf.diagramMarginX).attr('y', -25);
10823 }
10824
10825 if (conf.useMaxWidth) {
10826 diagram.attr('height', '100%');
10827 diagram.attr('width', '100%');
10828 diagram.attr('style', 'max-width:' + width + 'px;');
10829 } else {
10830 diagram.attr('height', height);
10831 diagram.attr('width', width);
10832 }
10833
10834 var extraVertForTitle = title ? 40 : 0;
10835 diagram.attr('viewBox', box.startx - conf.diagramMarginX + ' -' + (conf.diagramMarginY + extraVertForTitle) + ' ' + width + ' ' + (height + extraVertForTitle));
10836};
10837/* harmony default export */ __webpack_exports__["default"] = ({
10838 bounds: bounds,
10839 drawActors: drawActors,
10840 setConf: setConf,
10841 draw: draw
10842});
10843
10844/***/ }),
10845
10846/***/ "./src/diagrams/sequence/svgDraw.js":
10847/*!******************************************!*\
10848 !*** ./src/diagrams/sequence/svgDraw.js ***!
10849 \******************************************/
10850/*! exports provided: drawRect, drawText, drawLabel, drawActor, anchorElement, drawActivation, drawLoop, drawBackgroundRect, insertArrowHead, insertSequenceNumber, insertArrowCrossHead, getTextObj, getNoteRect, default */
10851/***/ (function(module, __webpack_exports__, __webpack_require__) {
10852
10853"use strict";
10854__webpack_require__.r(__webpack_exports__);
10855/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawRect", function() { return drawRect; });
10856/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawText", function() { return drawText; });
10857/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawLabel", function() { return drawLabel; });
10858/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawActor", function() { return drawActor; });
10859/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "anchorElement", function() { return anchorElement; });
10860/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawActivation", function() { return drawActivation; });
10861/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawLoop", function() { return drawLoop; });
10862/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawBackgroundRect", function() { return drawBackgroundRect; });
10863/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertArrowHead", function() { return insertArrowHead; });
10864/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertSequenceNumber", function() { return insertSequenceNumber; });
10865/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertArrowCrossHead", function() { return insertArrowCrossHead; });
10866/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTextObj", function() { return getTextObj; });
10867/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNoteRect", function() { return getNoteRect; });
10868var drawRect = function drawRect(elem, rectData) {
10869 var rectElem = elem.append('rect');
10870 rectElem.attr('x', rectData.x);
10871 rectElem.attr('y', rectData.y);
10872 rectElem.attr('fill', rectData.fill);
10873 rectElem.attr('stroke', rectData.stroke);
10874 rectElem.attr('width', rectData.width);
10875 rectElem.attr('height', rectData.height);
10876 rectElem.attr('rx', rectData.rx);
10877 rectElem.attr('ry', rectData.ry);
10878
10879 if (typeof rectData.class !== 'undefined') {
10880 rectElem.attr('class', rectData.class);
10881 }
10882
10883 return rectElem;
10884};
10885var drawText = function drawText(elem, textData) {
10886 // Remove and ignore br:s
10887 var nText = textData.text.replace(/<br\/?>/gi, ' ');
10888 var textElem = elem.append('text');
10889 textElem.attr('x', textData.x);
10890 textElem.attr('y', textData.y);
10891 textElem.style('text-anchor', textData.anchor);
10892 textElem.attr('fill', textData.fill);
10893
10894 if (typeof textData.class !== 'undefined') {
10895 textElem.attr('class', textData.class);
10896 }
10897
10898 var span = textElem.append('tspan');
10899 span.attr('x', textData.x + textData.textMargin * 2);
10900 span.attr('fill', textData.fill);
10901 span.text(nText);
10902 return textElem;
10903};
10904var drawLabel = function drawLabel(elem, txtObject) {
10905 function genPoints(x, y, width, height, cut) {
10906 return x + ',' + y + ' ' + (x + width) + ',' + y + ' ' + (x + width) + ',' + (y + height - cut) + ' ' + (x + width - cut * 1.2) + ',' + (y + height) + ' ' + x + ',' + (y + height);
10907 }
10908
10909 var polygon = elem.append('polygon');
10910 polygon.attr('points', genPoints(txtObject.x, txtObject.y, 50, 20, 7));
10911 polygon.attr('class', 'labelBox');
10912 txtObject.y = txtObject.y + txtObject.labelMargin;
10913 txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin;
10914 drawText(elem, txtObject);
10915};
10916var actorCnt = -1;
10917/**
10918 * Draws an actor in the diagram with the attaced line
10919 * @param center - The center of the the actor
10920 * @param pos The position if the actor in the liost of actors
10921 * @param description The text in the box
10922 */
10923
10924var drawActor = function drawActor(elem, left, verticalPos, description, conf) {
10925 var center = left + conf.width / 2;
10926 var g = elem.append('g');
10927
10928 if (verticalPos === 0) {
10929 actorCnt++;
10930 g.append('line').attr('id', 'actor' + actorCnt).attr('x1', center).attr('y1', 5).attr('x2', center).attr('y2', 2000).attr('class', 'actor-line').attr('stroke-width', '0.5px').attr('stroke', '#999');
10931 }
10932
10933 var rect = getNoteRect();
10934 rect.x = left;
10935 rect.y = verticalPos;
10936 rect.fill = '#eaeaea';
10937 rect.width = conf.width;
10938 rect.height = conf.height;
10939 rect.class = 'actor';
10940 rect.rx = 3;
10941 rect.ry = 3;
10942 drawRect(g, rect);
10943
10944 _drawTextCandidateFunc(conf)(description, g, rect.x, rect.y, rect.width, rect.height, {
10945 class: 'actor'
10946 }, conf);
10947};
10948var anchorElement = function anchorElement(elem) {
10949 return elem.append('g');
10950};
10951/**
10952 * Draws an actor in the diagram with the attaced line
10953 * @param elem - element to append activation rect
10954 * @param bounds - activation box bounds
10955 * @param verticalPos - precise y cooridnate of bottom activation box edge
10956 */
10957
10958var drawActivation = function drawActivation(elem, bounds, verticalPos, conf, actorActivations) {
10959 var rect = getNoteRect();
10960 var g = bounds.anchored;
10961 rect.x = bounds.startx;
10962 rect.y = bounds.starty;
10963 rect.class = 'activation' + actorActivations % 3; // Will evaluate to 0, 1 or 2
10964
10965 rect.width = bounds.stopx - bounds.startx;
10966 rect.height = verticalPos - bounds.starty;
10967 drawRect(g, rect);
10968};
10969/**
10970 * Draws an actor in the diagram with the attaced line
10971 * @param center - The center of the the actor
10972 * @param pos The position if the actor in the list of actors
10973 * @param description The text in the box
10974 */
10975
10976var drawLoop = function drawLoop(elem, bounds, labelText, conf) {
10977 var g = elem.append('g');
10978
10979 var drawLoopLine = function drawLoopLine(startx, starty, stopx, stopy) {
10980 return g.append('line').attr('x1', startx).attr('y1', starty).attr('x2', stopx).attr('y2', stopy).attr('class', 'loopLine');
10981 };
10982
10983 drawLoopLine(bounds.startx, bounds.starty, bounds.stopx, bounds.starty);
10984 drawLoopLine(bounds.stopx, bounds.starty, bounds.stopx, bounds.stopy);
10985 drawLoopLine(bounds.startx, bounds.stopy, bounds.stopx, bounds.stopy);
10986 drawLoopLine(bounds.startx, bounds.starty, bounds.startx, bounds.stopy);
10987
10988 if (typeof bounds.sections !== 'undefined') {
10989 bounds.sections.forEach(function (item) {
10990 drawLoopLine(bounds.startx, item, bounds.stopx, item).style('stroke-dasharray', '3, 3');
10991 });
10992 }
10993
10994 var txt = getTextObj();
10995 txt.text = labelText;
10996 txt.x = bounds.startx;
10997 txt.y = bounds.starty;
10998 txt.labelMargin = 1.5 * 10; // This is the small box that says "loop"
10999
11000 txt.class = 'labelText'; // Its size & position are fixed.
11001
11002 drawLabel(g, txt);
11003 txt = getTextObj();
11004 txt.text = '[ ' + bounds.title + ' ]';
11005 txt.x = bounds.startx + (bounds.stopx - bounds.startx) / 2;
11006 txt.y = bounds.starty + 1.5 * conf.boxMargin;
11007 txt.anchor = 'middle';
11008 txt.class = 'loopText';
11009 drawText(g, txt);
11010
11011 if (typeof bounds.sectionTitles !== 'undefined') {
11012 bounds.sectionTitles.forEach(function (item, idx) {
11013 if (item !== '') {
11014 txt.text = '[ ' + item + ' ]';
11015 txt.y = bounds.sections[idx] + 1.5 * conf.boxMargin;
11016 drawText(g, txt);
11017 }
11018 });
11019 }
11020};
11021/**
11022 * Draws a background rectangle
11023 * @param color - The fill color for the background
11024 */
11025
11026var drawBackgroundRect = function drawBackgroundRect(elem, bounds) {
11027 var rectElem = drawRect(elem, {
11028 x: bounds.startx,
11029 y: bounds.starty,
11030 width: bounds.stopx - bounds.startx,
11031 height: bounds.stopy - bounds.starty,
11032 fill: bounds.fill,
11033 class: 'rect'
11034 });
11035 rectElem.lower();
11036};
11037/**
11038 * Setup arrow head and define the marker. The result is appended to the svg.
11039 */
11040
11041var insertArrowHead = function insertArrowHead(elem) {
11042 elem.append('defs').append('marker').attr('id', 'arrowhead').attr('refX', 5).attr('refY', 2).attr('markerWidth', 6).attr('markerHeight', 4).attr('orient', 'auto').append('path').attr('d', 'M 0,0 V 4 L6,2 Z'); // this is actual shape for arrowhead
11043};
11044/**
11045 * Setup node number. The result is appended to the svg.
11046 */
11047
11048var insertSequenceNumber = function insertSequenceNumber(elem) {
11049 elem.append('defs').append('marker').attr('id', 'sequencenumber').attr('refX', 15).attr('refY', 15).attr('markerWidth', 60).attr('markerHeight', 40).attr('orient', 'auto').append('circle').attr('cx', 15).attr('cy', 15).attr('r', 6); // .style("fill", '#f00');
11050};
11051/**
11052 * Setup arrow head and define the marker. The result is appended to the svg.
11053 */
11054
11055var insertArrowCrossHead = function insertArrowCrossHead(elem) {
11056 var defs = elem.append('defs');
11057 var marker = defs.append('marker').attr('id', 'crosshead').attr('markerWidth', 15).attr('markerHeight', 8).attr('orient', 'auto').attr('refX', 16).attr('refY', 4); // The arrow
11058
11059 marker.append('path').attr('fill', 'black').attr('stroke', '#000000').style('stroke-dasharray', '0, 0').attr('stroke-width', '1px').attr('d', 'M 9,2 V 6 L16,4 Z'); // The cross
11060
11061 marker.append('path').attr('fill', 'none').attr('stroke', '#000000').style('stroke-dasharray', '0, 0').attr('stroke-width', '1px').attr('d', 'M 0,1 L 6,7 M 6,1 L 0,7'); // this is actual shape for arrowhead
11062};
11063var getTextObj = function getTextObj() {
11064 var txt = {
11065 x: 0,
11066 y: 0,
11067 fill: undefined,
11068 'text-anchor': 'start',
11069 style: '#666',
11070 width: 100,
11071 height: 100,
11072 textMargin: 0,
11073 rx: 0,
11074 ry: 0
11075 };
11076 return txt;
11077};
11078var getNoteRect = function getNoteRect() {
11079 var rect = {
11080 x: 0,
11081 y: 0,
11082 fill: '#EDF2AE',
11083 stroke: '#666',
11084 width: 100,
11085 anchor: 'start',
11086 height: 100,
11087 rx: 0,
11088 ry: 0
11089 };
11090 return rect;
11091};
11092
11093var _drawTextCandidateFunc = function () {
11094 function byText(content, g, x, y, width, height, textAttrs) {
11095 var text = g.append('text').attr('x', x + width / 2).attr('y', y + height / 2 + 5).style('text-anchor', 'middle').text(content);
11096
11097 _setTextAttrs(text, textAttrs);
11098 }
11099
11100 function byTspan(content, g, x, y, width, height, textAttrs, conf) {
11101 var actorFontSize = conf.actorFontSize,
11102 actorFontFamily = conf.actorFontFamily;
11103 var lines = content.split(/<br\/?>/gi);
11104
11105 for (var i = 0; i < lines.length; i++) {
11106 var dy = i * actorFontSize - actorFontSize * (lines.length - 1) / 2;
11107 var text = g.append('text').attr('x', x + width / 2).attr('y', y).style('text-anchor', 'middle').style('font-size', actorFontSize).style('font-family', actorFontFamily);
11108 text.append('tspan').attr('x', x + width / 2).attr('dy', dy).text(lines[i]);
11109 text.attr('y', y + height / 2.0).attr('dominant-baseline', 'central').attr('alignment-baseline', 'central');
11110
11111 _setTextAttrs(text, textAttrs);
11112 }
11113 }
11114
11115 function byFo(content, g, x, y, width, height, textAttrs, conf) {
11116 var s = g.append('switch');
11117 var f = s.append('foreignObject').attr('x', x).attr('y', y).attr('width', width).attr('height', height);
11118 var text = f.append('div').style('display', 'table').style('height', '100%').style('width', '100%');
11119 text.append('div').style('display', 'table-cell').style('text-align', 'center').style('vertical-align', 'middle').text(content);
11120 byTspan(content, s, x, y, width, height, textAttrs, conf);
11121
11122 _setTextAttrs(text, textAttrs);
11123 }
11124
11125 function _setTextAttrs(toText, fromTextAttrsDict) {
11126 for (var key in fromTextAttrsDict) {
11127 if (fromTextAttrsDict.hasOwnProperty(key)) {
11128 // eslint-disable-line
11129 toText.attr(key, fromTextAttrsDict[key]);
11130 }
11131 }
11132 }
11133
11134 return function (conf) {
11135 return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'old' ? byText : byTspan;
11136 };
11137}();
11138
11139/* harmony default export */ __webpack_exports__["default"] = ({
11140 drawRect: drawRect,
11141 drawText: drawText,
11142 drawLabel: drawLabel,
11143 drawActor: drawActor,
11144 anchorElement: anchorElement,
11145 drawActivation: drawActivation,
11146 drawLoop: drawLoop,
11147 drawBackgroundRect: drawBackgroundRect,
11148 insertArrowHead: insertArrowHead,
11149 insertSequenceNumber: insertSequenceNumber,
11150 insertArrowCrossHead: insertArrowCrossHead,
11151 getTextObj: getTextObj,
11152 getNoteRect: getNoteRect
11153});
11154
11155/***/ }),
11156
11157/***/ "./src/diagrams/state/id-cache.js":
11158/*!****************************************!*\
11159 !*** ./src/diagrams/state/id-cache.js ***!
11160 \****************************************/
11161/*! exports provided: set, get, keys, size, default */
11162/***/ (function(module, __webpack_exports__, __webpack_require__) {
11163
11164"use strict";
11165__webpack_require__.r(__webpack_exports__);
11166/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
11167/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "get", function() { return get; });
11168/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return keys; });
11169/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "size", function() { return size; });
11170var idCache = {};
11171var set = function set(key, val) {
11172 idCache[key] = val;
11173};
11174var get = function get(k) {
11175 return idCache[k];
11176};
11177var keys = function keys() {
11178 return Object.keys(idCache);
11179};
11180var size = function size() {
11181 return keys().length;
11182};
11183/* harmony default export */ __webpack_exports__["default"] = ({
11184 get: get,
11185 set: set,
11186 keys: keys,
11187 size: size
11188});
11189
11190/***/ }),
11191
11192/***/ "./src/diagrams/state/parser/stateDiagram.jison":
11193/*!******************************************************!*\
11194 !*** ./src/diagrams/state/parser/stateDiagram.jison ***!
11195 \******************************************************/
11196/*! no static exports found */
11197/***/ (function(module, exports, __webpack_require__) {
11198
11199/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
11200/*
11201 Returns a Parser object of the following structure:
11202
11203 Parser: {
11204 yy: {}
11205 }
11206
11207 Parser.prototype: {
11208 yy: {},
11209 trace: function(),
11210 symbols_: {associative list: name ==> number},
11211 terminals_: {associative list: number ==> name},
11212 productions_: [...],
11213 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
11214 table: [...],
11215 defaultActions: {...},
11216 parseError: function(str, hash),
11217 parse: function(input),
11218
11219 lexer: {
11220 EOF: 1,
11221 parseError: function(str, hash),
11222 setInput: function(input),
11223 input: function(),
11224 unput: function(str),
11225 more: function(),
11226 less: function(n),
11227 pastInput: function(),
11228 upcomingInput: function(),
11229 showPosition: function(),
11230 test_match: function(regex_match_array, rule_index),
11231 next: function(),
11232 lex: function(),
11233 begin: function(condition),
11234 popState: function(),
11235 _currentRules: function(),
11236 topState: function(),
11237 pushState: function(condition),
11238
11239 options: {
11240 ranges: boolean (optional: true ==> token location info will include a .range[] member)
11241 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
11242 backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
11243 },
11244
11245 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
11246 rules: [...],
11247 conditions: {associative list: name ==> set},
11248 }
11249 }
11250
11251
11252 token location info (@$, _$, etc.): {
11253 first_line: n,
11254 last_line: n,
11255 first_column: n,
11256 last_column: n,
11257 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
11258 }
11259
11260
11261 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
11262 text: (matched text)
11263 token: (the produced terminal token, if any)
11264 line: (yylineno)
11265 }
11266 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
11267 loc: (yylloc)
11268 expected: (string describing the set of expected tokens)
11269 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
11270 }
11271*/
11272var parser = (function(){
11273var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,4],$V3=[2,4],$V4=[1,9],$V5=[1,11],$V6=[1,13],$V7=[1,14],$V8=[1,15],$V9=[1,16],$Va=[1,21],$Vb=[1,17],$Vc=[1,18],$Vd=[1,19],$Ve=[1,20],$Vf=[1,22],$Vg=[1,4,5,13,14,16,18,19,21,22,23,24,25,28],$Vh=[1,4,5,11,12,13,14,16,18,19,21,22,23,24,25,28],$Vi=[4,5,13,14,16,18,19,21,22,23,24,25,28];
11274var parser = {trace: function trace () { },
11275yy: {},
11276symbols_: {"error":2,"start":3,"SPACE":4,"NL":5,"SD":6,"document":7,"line":8,"statement":9,"idStatement":10,"DESCR":11,"-->":12,"HIDE_EMPTY":13,"scale":14,"WIDTH":15,"COMPOSIT_STATE":16,"STRUCT_START":17,"STRUCT_STOP":18,"STATE_DESCR":19,"AS":20,"ID":21,"FORK":22,"JOIN":23,"CONCURRENT":24,"note":25,"notePosition":26,"NOTE_TEXT":27,"EDGE_STATE":28,"left_of":29,"right_of":30,"$accept":0,"$end":1},
11277terminals_: {2:"error",4:"SPACE",5:"NL",6:"SD",11:"DESCR",12:"-->",13:"HIDE_EMPTY",14:"scale",15:"WIDTH",16:"COMPOSIT_STATE",17:"STRUCT_START",18:"STRUCT_STOP",19:"STATE_DESCR",20:"AS",21:"ID",22:"FORK",23:"JOIN",24:"CONCURRENT",25:"note",27:"NOTE_TEXT",28:"EDGE_STATE",29:"left_of",30:"right_of"},
11278productions_: [0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,4],[9,4],[10,1],[10,1],[26,1],[26,1]],
11279performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
11280/* this == yyval */
11281
11282var $0 = $$.length - 1;
11283switch (yystate) {
11284case 3:
11285 /*console.warn('Root document', $$[$0]);*/ yy.setRootDoc($$[$0]);return $$[$0];
11286break;
11287case 4:
11288 this.$ = []
11289break;
11290case 5:
11291
11292 if($$[$0]!='nl'){
11293 $$[$0-1].push($$[$0]);this.$ = $$[$0-1]
11294 }
11295 // console.warn('Got document',$$[$0-1], $$[$0]);
11296
11297break;
11298case 6: case 7:
11299 this.$ = $$[$0]
11300break;
11301case 8:
11302 this.$='nl';
11303break;
11304case 9:
11305 /*console.warn('got id and descr', $$[$0]);*/this.$={ stmt: 'state', id: $$[$0], type: 'default', description: ''};
11306break;
11307case 10:
11308 /*console.warn('got id and descr', $$[$0-1], $$[$0].trim());*/this.$={ stmt: 'state', id: $$[$0-1], type: 'default', description: $$[$0].trim()};
11309break;
11310case 11:
11311
11312 /*console.warn('got id', $$[$0-2]);yy.addRelation($$[$0-2], $$[$0]);*/
11313 this.$={ stmt: 'relation', state1: { stmt: 'state', id: $$[$0-2], type: 'default', description: '' }, state2:{ stmt: 'state', id: $$[$0] ,type: 'default', description: ''}};
11314
11315break;
11316case 12:
11317
11318 /*yy.addRelation($$[$0-3], $$[$0-1], $$[$0].substr(1).trim());*/
11319 this.$={ stmt: 'relation', state1: { stmt: 'state', id: $$[$0-3], type: 'default', description: '' }, state2:{ stmt: 'state', id: $$[$0-1] ,type: 'default', description: ''}, description: $$[$0].substr(1).trim()};
11320
11321break;
11322case 16:
11323
11324
11325 /* console.warn('Adding document for state without id ', $$[$0-3]);*/
11326 this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: '', doc: $$[$0-1] }
11327
11328break;
11329case 17:
11330
11331 var id=$$[$0];
11332 var description = $$[$0-2].trim();
11333 if($$[$0].match(':')){
11334 var parts = $$[$0].split(':');
11335 id=parts[0];
11336 description = [description, parts[1]];
11337 }
11338 this.$={stmt: 'state', id: id, type: 'default', description: description};
11339
11340
11341break;
11342case 18:
11343
11344 //console.warn('Adding document for state with id ', $$[$0-3], $$[$0-2]); yy.addDocument($$[$0-3]);
11345 this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: $$[$0-5], doc: $$[$0-1] }
11346
11347break;
11348case 19:
11349
11350 this.$={ stmt: 'state', id: $$[$0], type: 'fork' }
11351
11352break;
11353case 20:
11354
11355 this.$={ stmt: 'state', id: $$[$0], type: 'join' }
11356
11357break;
11358case 21:
11359
11360 this.$={ stmt: 'state', id: yy.getDividerId(), type: 'divider' }
11361
11362break;
11363case 22:
11364
11365 /*console.warn('got NOTE, position: ', $$[$0-2].trim(), 'id = ', $$[$0-1].trim(), 'note: ', $$[$0]);*/
11366 this.$={ stmt: 'state', id: $$[$0-1].trim(), note:{position: $$[$0-2].trim(), text: $$[$0].trim()}};
11367
11368break;
11369case 24: case 25:
11370this.$=$$[$0];
11371break;
11372}
11373},
11374table: [{3:1,4:$V0,5:$V1,6:$V2},{1:[3]},{3:5,4:$V0,5:$V1,6:$V2},{3:6,4:$V0,5:$V1,6:$V2},o([1,4,5,13,14,16,19,21,22,23,24,25,28],$V3,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:$V4,5:$V5,8:8,9:10,10:12,13:$V6,14:$V7,16:$V8,19:$V9,21:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,28:$Vf},o($Vg,[2,5]),{9:23,10:12,13:$V6,14:$V7,16:$V8,19:$V9,21:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,28:$Vf},o($Vg,[2,7]),o($Vg,[2,8]),o($Vg,[2,9],{11:[1,24],12:[1,25]}),o($Vg,[2,13]),{15:[1,26]},o($Vg,[2,15],{17:[1,27]}),{20:[1,28]},o($Vg,[2,19]),o($Vg,[2,20]),o($Vg,[2,21]),{26:29,27:[1,30],29:[1,31],30:[1,32]},o($Vh,[2,24]),o($Vh,[2,25]),o($Vg,[2,6]),o($Vg,[2,10]),{10:33,21:$Va,28:$Vf},o($Vg,[2,14]),o($Vi,$V3,{7:34}),{21:[1,35]},{21:[1,36]},{20:[1,37]},{21:[2,26]},{21:[2,27]},o($Vg,[2,11],{11:[1,38]}),{4:$V4,5:$V5,8:8,9:10,10:12,13:$V6,14:$V7,16:$V8,18:[1,39],19:$V9,21:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,28:$Vf},o($Vg,[2,17],{17:[1,40]}),{27:[1,41]},{21:[1,42]},o($Vg,[2,12]),o($Vg,[2,16]),o($Vi,$V3,{7:43}),o($Vg,[2,22]),o($Vg,[2,23]),{4:$V4,5:$V5,8:8,9:10,10:12,13:$V6,14:$V7,16:$V8,18:[1,44],19:$V9,21:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,28:$Vf},o($Vg,[2,18])],
11375defaultActions: {5:[2,1],6:[2,2],31:[2,26],32:[2,27]},
11376parseError: function parseError (str, hash) {
11377 if (hash.recoverable) {
11378 this.trace(str);
11379 } else {
11380 var error = new Error(str);
11381 error.hash = hash;
11382 throw error;
11383 }
11384},
11385parse: function parse(input) {
11386 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
11387 var args = lstack.slice.call(arguments, 1);
11388 var lexer = Object.create(this.lexer);
11389 var sharedState = { yy: {} };
11390 for (var k in this.yy) {
11391 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
11392 sharedState.yy[k] = this.yy[k];
11393 }
11394 }
11395 lexer.setInput(input, sharedState.yy);
11396 sharedState.yy.lexer = lexer;
11397 sharedState.yy.parser = this;
11398 if (typeof lexer.yylloc == 'undefined') {
11399 lexer.yylloc = {};
11400 }
11401 var yyloc = lexer.yylloc;
11402 lstack.push(yyloc);
11403 var ranges = lexer.options && lexer.options.ranges;
11404 if (typeof sharedState.yy.parseError === 'function') {
11405 this.parseError = sharedState.yy.parseError;
11406 } else {
11407 this.parseError = Object.getPrototypeOf(this).parseError;
11408 }
11409 function popStack(n) {
11410 stack.length = stack.length - 2 * n;
11411 vstack.length = vstack.length - n;
11412 lstack.length = lstack.length - n;
11413 }
11414 function lex() {
11415 var token;
11416 token = tstack.pop() || lexer.lex() || EOF;
11417 if (typeof token !== 'number') {
11418 if (token instanceof Array) {
11419 tstack = token;
11420 token = tstack.pop();
11421 }
11422 token = self.symbols_[token] || token;
11423 }
11424 return token;
11425 }
11426 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
11427 while (true) {
11428 state = stack[stack.length - 1];
11429 if (this.defaultActions[state]) {
11430 action = this.defaultActions[state];
11431 } else {
11432 if (symbol === null || typeof symbol == 'undefined') {
11433 symbol = lex();
11434 }
11435 action = table[state] && table[state][symbol];
11436 }
11437 if (typeof action === 'undefined' || !action.length || !action[0]) {
11438 var errStr = '';
11439 expected = [];
11440 for (p in table[state]) {
11441 if (this.terminals_[p] && p > TERROR) {
11442 expected.push('\'' + this.terminals_[p] + '\'');
11443 }
11444 }
11445 if (lexer.showPosition) {
11446 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
11447 } else {
11448 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
11449 }
11450 this.parseError(errStr, {
11451 text: lexer.match,
11452 token: this.terminals_[symbol] || symbol,
11453 line: lexer.yylineno,
11454 loc: yyloc,
11455 expected: expected
11456 });
11457 }
11458 if (action[0] instanceof Array && action.length > 1) {
11459 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
11460 }
11461 switch (action[0]) {
11462 case 1:
11463 stack.push(symbol);
11464 vstack.push(lexer.yytext);
11465 lstack.push(lexer.yylloc);
11466 stack.push(action[1]);
11467 symbol = null;
11468 if (!preErrorSymbol) {
11469 yyleng = lexer.yyleng;
11470 yytext = lexer.yytext;
11471 yylineno = lexer.yylineno;
11472 yyloc = lexer.yylloc;
11473 if (recovering > 0) {
11474 recovering--;
11475 }
11476 } else {
11477 symbol = preErrorSymbol;
11478 preErrorSymbol = null;
11479 }
11480 break;
11481 case 2:
11482 len = this.productions_[action[1]][1];
11483 yyval.$ = vstack[vstack.length - len];
11484 yyval._$ = {
11485 first_line: lstack[lstack.length - (len || 1)].first_line,
11486 last_line: lstack[lstack.length - 1].last_line,
11487 first_column: lstack[lstack.length - (len || 1)].first_column,
11488 last_column: lstack[lstack.length - 1].last_column
11489 };
11490 if (ranges) {
11491 yyval._$.range = [
11492 lstack[lstack.length - (len || 1)].range[0],
11493 lstack[lstack.length - 1].range[1]
11494 ];
11495 }
11496 r = this.performAction.apply(yyval, [
11497 yytext,
11498 yyleng,
11499 yylineno,
11500 sharedState.yy,
11501 action[1],
11502 vstack,
11503 lstack
11504 ].concat(args));
11505 if (typeof r !== 'undefined') {
11506 return r;
11507 }
11508 if (len) {
11509 stack = stack.slice(0, -1 * len * 2);
11510 vstack = vstack.slice(0, -1 * len);
11511 lstack = lstack.slice(0, -1 * len);
11512 }
11513 stack.push(this.productions_[action[1]][0]);
11514 vstack.push(yyval.$);
11515 lstack.push(yyval._$);
11516 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
11517 stack.push(newState);
11518 break;
11519 case 3:
11520 return true;
11521 }
11522 }
11523 return true;
11524}};
11525
11526/* generated by jison-lex 0.3.4 */
11527var lexer = (function(){
11528var lexer = ({
11529
11530EOF:1,
11531
11532parseError:function parseError(str, hash) {
11533 if (this.yy.parser) {
11534 this.yy.parser.parseError(str, hash);
11535 } else {
11536 throw new Error(str);
11537 }
11538 },
11539
11540// resets the lexer, sets new input
11541setInput:function (input, yy) {
11542 this.yy = yy || this.yy || {};
11543 this._input = input;
11544 this._more = this._backtrack = this.done = false;
11545 this.yylineno = this.yyleng = 0;
11546 this.yytext = this.matched = this.match = '';
11547 this.conditionStack = ['INITIAL'];
11548 this.yylloc = {
11549 first_line: 1,
11550 first_column: 0,
11551 last_line: 1,
11552 last_column: 0
11553 };
11554 if (this.options.ranges) {
11555 this.yylloc.range = [0,0];
11556 }
11557 this.offset = 0;
11558 return this;
11559 },
11560
11561// consumes and returns one char from the input
11562input:function () {
11563 var ch = this._input[0];
11564 this.yytext += ch;
11565 this.yyleng++;
11566 this.offset++;
11567 this.match += ch;
11568 this.matched += ch;
11569 var lines = ch.match(/(?:\r\n?|\n).*/g);
11570 if (lines) {
11571 this.yylineno++;
11572 this.yylloc.last_line++;
11573 } else {
11574 this.yylloc.last_column++;
11575 }
11576 if (this.options.ranges) {
11577 this.yylloc.range[1]++;
11578 }
11579
11580 this._input = this._input.slice(1);
11581 return ch;
11582 },
11583
11584// unshifts one char (or a string) into the input
11585unput:function (ch) {
11586 var len = ch.length;
11587 var lines = ch.split(/(?:\r\n?|\n)/g);
11588
11589 this._input = ch + this._input;
11590 this.yytext = this.yytext.substr(0, this.yytext.length - len);
11591 //this.yyleng -= len;
11592 this.offset -= len;
11593 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
11594 this.match = this.match.substr(0, this.match.length - 1);
11595 this.matched = this.matched.substr(0, this.matched.length - 1);
11596
11597 if (lines.length - 1) {
11598 this.yylineno -= lines.length - 1;
11599 }
11600 var r = this.yylloc.range;
11601
11602 this.yylloc = {
11603 first_line: this.yylloc.first_line,
11604 last_line: this.yylineno + 1,
11605 first_column: this.yylloc.first_column,
11606 last_column: lines ?
11607 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
11608 + oldLines[oldLines.length - lines.length].length - lines[0].length :
11609 this.yylloc.first_column - len
11610 };
11611
11612 if (this.options.ranges) {
11613 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
11614 }
11615 this.yyleng = this.yytext.length;
11616 return this;
11617 },
11618
11619// When called from action, caches matched text and appends it on next action
11620more:function () {
11621 this._more = true;
11622 return this;
11623 },
11624
11625// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
11626reject:function () {
11627 if (this.options.backtrack_lexer) {
11628 this._backtrack = true;
11629 } else {
11630 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
11631 text: "",
11632 token: null,
11633 line: this.yylineno
11634 });
11635
11636 }
11637 return this;
11638 },
11639
11640// retain first n characters of the match
11641less:function (n) {
11642 this.unput(this.match.slice(n));
11643 },
11644
11645// displays already matched input, i.e. for error messages
11646pastInput:function () {
11647 var past = this.matched.substr(0, this.matched.length - this.match.length);
11648 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
11649 },
11650
11651// displays upcoming input, i.e. for error messages
11652upcomingInput:function () {
11653 var next = this.match;
11654 if (next.length < 20) {
11655 next += this._input.substr(0, 20-next.length);
11656 }
11657 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
11658 },
11659
11660// displays the character position where the lexing error occurred, i.e. for error messages
11661showPosition:function () {
11662 var pre = this.pastInput();
11663 var c = new Array(pre.length + 1).join("-");
11664 return pre + this.upcomingInput() + "\n" + c + "^";
11665 },
11666
11667// test the lexed token: return FALSE when not a match, otherwise return token
11668test_match:function(match, indexed_rule) {
11669 var token,
11670 lines,
11671 backup;
11672
11673 if (this.options.backtrack_lexer) {
11674 // save context
11675 backup = {
11676 yylineno: this.yylineno,
11677 yylloc: {
11678 first_line: this.yylloc.first_line,
11679 last_line: this.last_line,
11680 first_column: this.yylloc.first_column,
11681 last_column: this.yylloc.last_column
11682 },
11683 yytext: this.yytext,
11684 match: this.match,
11685 matches: this.matches,
11686 matched: this.matched,
11687 yyleng: this.yyleng,
11688 offset: this.offset,
11689 _more: this._more,
11690 _input: this._input,
11691 yy: this.yy,
11692 conditionStack: this.conditionStack.slice(0),
11693 done: this.done
11694 };
11695 if (this.options.ranges) {
11696 backup.yylloc.range = this.yylloc.range.slice(0);
11697 }
11698 }
11699
11700 lines = match[0].match(/(?:\r\n?|\n).*/g);
11701 if (lines) {
11702 this.yylineno += lines.length;
11703 }
11704 this.yylloc = {
11705 first_line: this.yylloc.last_line,
11706 last_line: this.yylineno + 1,
11707 first_column: this.yylloc.last_column,
11708 last_column: lines ?
11709 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
11710 this.yylloc.last_column + match[0].length
11711 };
11712 this.yytext += match[0];
11713 this.match += match[0];
11714 this.matches = match;
11715 this.yyleng = this.yytext.length;
11716 if (this.options.ranges) {
11717 this.yylloc.range = [this.offset, this.offset += this.yyleng];
11718 }
11719 this._more = false;
11720 this._backtrack = false;
11721 this._input = this._input.slice(match[0].length);
11722 this.matched += match[0];
11723 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
11724 if (this.done && this._input) {
11725 this.done = false;
11726 }
11727 if (token) {
11728 return token;
11729 } else if (this._backtrack) {
11730 // recover context
11731 for (var k in backup) {
11732 this[k] = backup[k];
11733 }
11734 return false; // rule action called reject() implying the next rule should be tested instead.
11735 }
11736 return false;
11737 },
11738
11739// return next match in input
11740next:function () {
11741 if (this.done) {
11742 return this.EOF;
11743 }
11744 if (!this._input) {
11745 this.done = true;
11746 }
11747
11748 var token,
11749 match,
11750 tempMatch,
11751 index;
11752 if (!this._more) {
11753 this.yytext = '';
11754 this.match = '';
11755 }
11756 var rules = this._currentRules();
11757 for (var i = 0; i < rules.length; i++) {
11758 tempMatch = this._input.match(this.rules[rules[i]]);
11759 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
11760 match = tempMatch;
11761 index = i;
11762 if (this.options.backtrack_lexer) {
11763 token = this.test_match(tempMatch, rules[i]);
11764 if (token !== false) {
11765 return token;
11766 } else if (this._backtrack) {
11767 match = false;
11768 continue; // rule action called reject() implying a rule MISmatch.
11769 } else {
11770 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
11771 return false;
11772 }
11773 } else if (!this.options.flex) {
11774 break;
11775 }
11776 }
11777 }
11778 if (match) {
11779 token = this.test_match(match, rules[index]);
11780 if (token !== false) {
11781 return token;
11782 }
11783 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
11784 return false;
11785 }
11786 if (this._input === "") {
11787 return this.EOF;
11788 } else {
11789 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
11790 text: "",
11791 token: null,
11792 line: this.yylineno
11793 });
11794 }
11795 },
11796
11797// return next match that has a token
11798lex:function lex () {
11799 var r = this.next();
11800 if (r) {
11801 return r;
11802 } else {
11803 return this.lex();
11804 }
11805 },
11806
11807// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
11808begin:function begin (condition) {
11809 this.conditionStack.push(condition);
11810 },
11811
11812// pop the previously active lexer condition state off the condition stack
11813popState:function popState () {
11814 var n = this.conditionStack.length - 1;
11815 if (n > 0) {
11816 return this.conditionStack.pop();
11817 } else {
11818 return this.conditionStack[0];
11819 }
11820 },
11821
11822// produce the lexer rule set which is active for the currently active lexer condition state
11823_currentRules:function _currentRules () {
11824 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
11825 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
11826 } else {
11827 return this.conditions["INITIAL"].rules;
11828 }
11829 },
11830
11831// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
11832topState:function topState (n) {
11833 n = this.conditionStack.length - 1 - Math.abs(n || 0);
11834 if (n >= 0) {
11835 return this.conditionStack[n];
11836 } else {
11837 return "INITIAL";
11838 }
11839 },
11840
11841// alias for begin(condition)
11842pushState:function pushState (condition) {
11843 this.begin(condition);
11844 },
11845
11846// return the number of states currently on the stack
11847stateStackSize:function stateStackSize() {
11848 return this.conditionStack.length;
11849 },
11850options: {"case-insensitive":true},
11851performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
11852var YYSTATE=YY_START;
11853switch($avoiding_name_collisions) {
11854case 0:return 5;
11855break;
11856case 1:/* skip all whitespace */
11857break;
11858case 2:/* skip same-line whitespace */
11859break;
11860case 3:/* skip comments */
11861break;
11862case 4:/* skip comments */
11863break;
11864case 5: this.pushState('SCALE'); /* console.log('Got scale', yy_.yytext);*/ return 14;
11865break;
11866case 6:return 15;
11867break;
11868case 7:this.popState();
11869break;
11870case 8: this.pushState('STATE');
11871break;
11872case 9:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim(); /*console.warn('Fork Fork: ',yy_.yytext);*/return 22;
11873break;
11874case 10:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 23;
11875break;
11876case 11:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Fork: ',yy_.yytext);*/return 22;
11877break;
11878case 12:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 23;
11879break;
11880case 13:this.begin("STATE_STRING");
11881break;
11882case 14:this.popState();this.pushState('STATE_ID');return "AS";
11883break;
11884case 15:this.popState();/* console.log('STATE_ID', yy_.yytext);*/return "ID";
11885break;
11886case 16:this.popState();
11887break;
11888case 17: /*console.log('Long description:', yy_.yytext);*/return "STATE_DESCR";
11889break;
11890case 18:/*console.log('COMPOSIT_STATE', yy_.yytext);*/return 16;
11891break;
11892case 19:this.popState();
11893break;
11894case 20:this.popState();this.pushState('struct'); /*console.log('begin struct', yy_.yytext);*/return 17;
11895break;
11896case 21: /*console.log('Ending struct');*/ this.popState(); return 18;
11897break;
11898case 22:/* nothing */
11899break;
11900case 23: this.begin('NOTE'); return 25;
11901break;
11902case 24: this.popState();this.pushState('NOTE_ID');return 29;
11903break;
11904case 25: this.popState();this.pushState('NOTE_ID');return 30;
11905break;
11906case 26: this.popState();this.pushState('FLOATING_NOTE');
11907break;
11908case 27:this.popState();this.pushState('FLOATING_NOTE_ID');return "AS";
11909break;
11910case 28:/**/
11911break;
11912case 29: /*console.log('Floating note text: ', yy_.yytext);*/return "NOTE_TEXT";
11913break;
11914case 30:this.popState();/*console.log('Floating note ID', yy_.yytext);*/return "ID";
11915break;
11916case 31: this.popState();this.pushState('NOTE_TEXT');/*console.log('Got ID for note', yy_.yytext);*/return 21;
11917break;
11918case 32: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.substr(2).trim();return 27;
11919break;
11920case 33: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.slice(0,-8).trim();return 27;
11921break;
11922case 34: /*console.log('Got state diagram', yy_.yytext,'#');*/return 6;
11923break;
11924case 35: /*console.log('HIDE_EMPTY', yy_.yytext,'#');*/return 13;
11925break;
11926case 36: /*console.log('EDGE_STATE=',yy_.yytext);*/ return 28;
11927break;
11928case 37: /*console.log('=>ID=',yy_.yytext);*/ return 21;
11929break;
11930case 38: yy_.yytext = yy_.yytext.trim(); /*console.log('Descr = ', yy_.yytext);*/ return 11;
11931break;
11932case 39:return 12;
11933break;
11934case 40:return 24;
11935break;
11936case 41:return 5;
11937break;
11938case 42:return 'INVALID';
11939break;
11940}
11941},
11942rules: [/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:["])/i,/^(?:as\s*)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:\s*[^:;]+end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?:$)/i,/^(?:.)/i],
11943conditions: {"LINE":{"rules":[2,3],"inclusive":false},"struct":{"rules":[2,3,8,21,22,23,36,37,38,39,40],"inclusive":false},"FLOATING_NOTE_ID":{"rules":[30],"inclusive":false},"FLOATING_NOTE":{"rules":[27,28,29],"inclusive":false},"NOTE_TEXT":{"rules":[32,33],"inclusive":false},"NOTE_ID":{"rules":[31],"inclusive":false},"NOTE":{"rules":[24,25,26],"inclusive":false},"SCALE":{"rules":[6,7],"inclusive":false},"ALIAS":{"rules":[],"inclusive":false},"STATE_ID":{"rules":[15],"inclusive":false},"STATE_STRING":{"rules":[16,17],"inclusive":false},"FORK_STATE":{"rules":[],"inclusive":false},"STATE":{"rules":[2,3,9,10,11,12,13,14,18,19,20],"inclusive":false},"ID":{"rules":[2,3],"inclusive":false},"INITIAL":{"rules":[0,1,3,4,5,8,20,23,34,35,36,37,38,39,41,42],"inclusive":true}}
11944});
11945return lexer;
11946})();
11947parser.lexer = lexer;
11948function Parser () {
11949 this.yy = {};
11950}
11951Parser.prototype = parser;parser.Parser = Parser;
11952return new Parser;
11953})();
11954
11955
11956if (true) {
11957exports.parser = parser;
11958exports.Parser = parser.Parser;
11959exports.parse = function () { return parser.parse.apply(parser, arguments); };
11960exports.main = function commonjsMain (args) {
11961 if (!args[1]) {
11962 console.log('Usage: '+args[0]+' FILE');
11963 process.exit(1);
11964 }
11965 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
11966 return exports.parser.parse(source);
11967};
11968if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
11969 exports.main(process.argv.slice(1));
11970}
11971}
11972/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
11973
11974/***/ }),
11975
11976/***/ "./src/diagrams/state/shapes.js":
11977/*!**************************************!*\
11978 !*** ./src/diagrams/state/shapes.js ***!
11979 \**************************************/
11980/*! exports provided: drawStartState, drawDivider, drawSimpleState, drawDescrState, addTitleAndBox, drawText, drawNote, drawState, drawEdge */
11981/***/ (function(module, __webpack_exports__, __webpack_require__) {
11982
11983"use strict";
11984__webpack_require__.r(__webpack_exports__);
11985/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawStartState", function() { return drawStartState; });
11986/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawDivider", function() { return drawDivider; });
11987/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawSimpleState", function() { return drawSimpleState; });
11988/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawDescrState", function() { return drawDescrState; });
11989/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addTitleAndBox", function() { return addTitleAndBox; });
11990/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawText", function() { return drawText; });
11991/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawNote", function() { return drawNote; });
11992/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawState", function() { return drawState; });
11993/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawEdge", function() { return drawEdge; });
11994/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
11995/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
11996/* harmony import */ var _id_cache_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./id-cache.js */ "./src/diagrams/state/id-cache.js");
11997/* harmony import */ var _stateDb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stateDb */ "./src/diagrams/state/stateDb.js");
11998/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
11999/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../config */ "./src/config.js");
12000
12001
12002
12003
12004 // let conf;
12005
12006/**
12007 * Draws a start state as a black circle
12008 */
12009
12010var drawStartState = function drawStartState(g) {
12011 return g.append('circle').style('stroke', 'black').style('fill', 'black').attr('r', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.sizeUnit).attr('cx', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.sizeUnit).attr('cy', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.sizeUnit);
12012};
12013/**
12014 * Draws a start state as a black circle
12015 */
12016
12017var drawDivider = function drawDivider(g) {
12018 return g.append('line').style('stroke', 'grey').style('stroke-dasharray', '3').attr('x1', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight).attr('class', 'divider').attr('x2', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight * 2).attr('y1', 0).attr('y2', 0);
12019};
12020/**
12021 * Draws a an end state as a black circle
12022 */
12023
12024var drawSimpleState = function drawSimpleState(g, stateDef) {
12025 var state = g.append('text').attr('x', 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('font-size', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.fontSize).attr('class', 'state-title').text(stateDef.id);
12026 var classBox = state.node().getBBox();
12027 g.insert('rect', ':first-child').attr('x', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('width', classBox.width + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('height', classBox.height + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('rx', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.radius);
12028 return state;
12029};
12030/**
12031 * Draws a state with descriptions
12032 * @param {*} g
12033 * @param {*} stateDef
12034 */
12035
12036var drawDescrState = function drawDescrState(g, stateDef) {
12037 var addTspan = function addTspan(textEl, txt, isFirst) {
12038 var tSpan = textEl.append('tspan').attr('x', 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).text(txt);
12039
12040 if (!isFirst) {
12041 tSpan.attr('dy', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight);
12042 }
12043 };
12044
12045 var title = g.append('text').attr('x', 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight + 1.3 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('font-size', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.fontSize).attr('class', 'state-title').text(stateDef.descriptions[0]);
12046 var titleBox = title.node().getBBox();
12047 var titleHeight = titleBox.height;
12048 var description = g.append('text') // text label for the x axis
12049 .attr('x', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('y', titleHeight + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding * 0.4 + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.dividerMargin + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight).attr('class', 'state-description');
12050 var isFirst = true;
12051 var isSecond = true;
12052 stateDef.descriptions.forEach(function (descr) {
12053 if (!isFirst) {
12054 addTspan(description, descr, isSecond);
12055 isSecond = false;
12056 }
12057
12058 isFirst = false;
12059 });
12060 var descrLine = g.append('line') // text label for the x axis
12061 .attr('x1', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('y1', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding + titleHeight + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.dividerMargin / 2).attr('y2', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding + titleHeight + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.dividerMargin / 2).attr('class', 'descr-divider');
12062 var descrBox = description.node().getBBox();
12063 var width = Math.max(descrBox.width, titleBox.width);
12064 descrLine.attr('x2', width + 3 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding); // const classBox = title.node().getBBox();
12065
12066 g.insert('rect', ':first-child').attr('x', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('width', width + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('height', descrBox.height + titleHeight + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('rx', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.radius);
12067 return g;
12068};
12069/**
12070 * Adds the creates a box around the existing content and adds a
12071 * panel for the id on top of the content.
12072 */
12073
12074/**
12075 * Function that creates an title row and a frame around a substate for a composit state diagram.
12076 * The function returns a new d3 svg object with updated width and height properties;
12077 * @param {*} g The d3 svg object for the substate to framed
12078 * @param {*} stateDef The info about the
12079 */
12080
12081var addTitleAndBox = function addTitleAndBox(g, stateDef, altBkg) {
12082 var pad = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding;
12083 var dblPad = 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding;
12084 var orgBox = g.node().getBBox();
12085 var orgWidth = orgBox.width;
12086 var orgX = orgBox.x;
12087 var title = g.append('text').attr('x', 0).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.titleShift).attr('font-size', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.fontSize).attr('class', 'state-title').text(stateDef.id);
12088 var titleBox = title.node().getBBox();
12089 var titleWidth = titleBox.width + dblPad;
12090 var width = Math.max(titleWidth, orgWidth); // + dblPad;
12091
12092 if (width === orgWidth) {
12093 width = width + dblPad;
12094 }
12095
12096 var startX; // const lineY = 1 - getConfig().state.textHeight;
12097 // const descrLine = g
12098 // .append('line') // text label for the x axis
12099 // .attr('x1', 0)
12100 // .attr('y1', lineY)
12101 // .attr('y2', lineY)
12102 // .attr('class', 'descr-divider');
12103
12104 var graphBox = g.node().getBBox(); // console.warn(width / 2, titleWidth / 2, getConfig().state.padding, orgBox);
12105 // descrLine.attr('x2', graphBox.width + getConfig().state.padding);
12106
12107 if (stateDef.doc) {// cnsole.warn(
12108 // stateDef.id,
12109 // 'orgX: ',
12110 // orgX,
12111 // 'width: ',
12112 // width,
12113 // 'titleWidth: ',
12114 // titleWidth,
12115 // 'orgWidth: ',
12116 // orgWidth,
12117 // 'width',
12118 // width
12119 // );
12120 }
12121
12122 startX = orgX - pad;
12123
12124 if (titleWidth > orgWidth) {
12125 startX = (orgWidth - width) / 2 + pad;
12126 }
12127
12128 if (Math.abs(orgX - graphBox.x) < pad) {
12129 if (titleWidth > orgWidth) {
12130 startX = orgX - (titleWidth - orgWidth) / 2;
12131 }
12132 }
12133
12134 var lineY = 1 - Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight; // White color
12135
12136 g.insert('rect', ':first-child').attr('x', startX).attr('y', lineY).attr('class', altBkg ? 'alt-composit' : 'composit').attr('width', width).attr('height', graphBox.height + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.titleShift + 1).attr('rx', '0');
12137 title.attr('x', startX + pad);
12138 if (titleWidth <= orgWidth) title.attr('x', orgX + (width - dblPad) / 2 - titleWidth / 2 + pad); // Title background
12139
12140 g.insert('rect', ':first-child').attr('x', startX).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.titleShift - Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight - Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('width', width) // Just needs to be higher then the descr line, will be clipped by the white color box
12141 .attr('height', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight * 3).attr('rx', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.radius); // Full background
12142
12143 g.insert('rect', ':first-child').attr('x', startX).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.titleShift - Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight - Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('width', width).attr('height', graphBox.height + 3 + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight).attr('rx', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.radius);
12144 return g;
12145};
12146
12147var drawEndState = function drawEndState(g) {
12148 g.append('circle').style('stroke', 'black').style('fill', 'white').attr('r', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.sizeUnit + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.miniPadding).attr('cx', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.sizeUnit + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.miniPadding).attr('cy', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.sizeUnit + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.miniPadding);
12149 return g.append('circle').style('stroke', 'black').style('fill', 'black').attr('r', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.sizeUnit).attr('cx', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.sizeUnit + 2).attr('cy', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.sizeUnit + 2);
12150};
12151
12152var drawForkJoinState = function drawForkJoinState(g, stateDef) {
12153 var width = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.forkWidth;
12154 var height = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.forkHeight;
12155
12156 if (stateDef.parentId) {
12157 var tmp = width;
12158 width = height;
12159 height = tmp;
12160 }
12161
12162 return g.append('rect').style('stroke', 'black').style('fill', 'black').attr('width', width).attr('height', height).attr('x', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding);
12163};
12164
12165var drawText = function drawText(elem, textData) {
12166 // Remove and ignore br:s
12167 var nText = textData.text.replace(/<br\/?>/gi, ' ');
12168 var textElem = elem.append('text');
12169 textElem.attr('x', textData.x);
12170 textElem.attr('y', textData.y);
12171 textElem.style('text-anchor', textData.anchor);
12172 textElem.attr('fill', textData.fill);
12173
12174 if (typeof textData.class !== 'undefined') {
12175 textElem.attr('class', textData.class);
12176 }
12177
12178 var span = textElem.append('tspan');
12179 span.attr('x', textData.x + textData.textMargin * 2);
12180 span.attr('fill', textData.fill);
12181 span.text(nText);
12182 return textElem;
12183};
12184
12185var _drawLongText = function _drawLongText(_text, x, y, g) {
12186 var textHeight = 0;
12187 var textElem = g.append('text');
12188 textElem.style('text-anchor', 'start');
12189 textElem.attr('class', 'noteText');
12190
12191 var text = _text.replace(/\r\n/g, '<br/>');
12192
12193 text = text.replace(/\n/g, '<br/>');
12194 var lines = text.split(/<br\/?>/gi);
12195 var tHeight = 1.25 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.noteMargin;
12196 var _iteratorNormalCompletion = true;
12197 var _didIteratorError = false;
12198 var _iteratorError = undefined;
12199
12200 try {
12201 for (var _iterator = lines[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
12202 var line = _step.value;
12203 var txt = line.trim();
12204
12205 if (txt.length > 0) {
12206 var span = textElem.append('tspan');
12207 span.text(txt);
12208
12209 if (tHeight === 0) {
12210 var textBounds = span.node().getBBox();
12211 tHeight += textBounds.height;
12212 } // console.warn('textBounds', textBounds);
12213
12214
12215 textHeight += tHeight;
12216 span.attr('x', x + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.noteMargin);
12217 span.attr('y', y + textHeight + 1.25 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.noteMargin);
12218 }
12219 }
12220 } catch (err) {
12221 _didIteratorError = true;
12222 _iteratorError = err;
12223 } finally {
12224 try {
12225 if (!_iteratorNormalCompletion && _iterator.return != null) {
12226 _iterator.return();
12227 }
12228 } finally {
12229 if (_didIteratorError) {
12230 throw _iteratorError;
12231 }
12232 }
12233 }
12234
12235 return {
12236 textWidth: textElem.node().getBBox().width,
12237 textHeight: textHeight
12238 };
12239};
12240/**
12241 * Draws an actor in the diagram with the attaced line
12242 * @param center - The center of the the actor
12243 * @param pos The position if the actor in the liost of actors
12244 * @param description The text in the box
12245 */
12246
12247
12248var drawNote = function drawNote(text, g) {
12249 g.attr('class', 'state-note');
12250 var note = g.append('rect').attr('x', 0).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding);
12251 var rectElem = g.append('g');
12252
12253 var _drawLongText2 = _drawLongText(text, 0, 0, rectElem),
12254 textWidth = _drawLongText2.textWidth,
12255 textHeight = _drawLongText2.textHeight;
12256
12257 note.attr('height', textHeight + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.noteMargin);
12258 note.attr('width', textWidth + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.noteMargin * 2);
12259 return note;
12260};
12261/**
12262 * Starting point for drawing a state. The function finds out the specifics
12263 * about the state and renders with approprtiate function.
12264 * @param {*} elem
12265 * @param {*} stateDef
12266 */
12267
12268var drawState = function drawState(elem, stateDef) {
12269 var id = stateDef.id;
12270 var stateInfo = {
12271 id: id,
12272 label: stateDef.id,
12273 width: 0,
12274 height: 0
12275 };
12276 var g = elem.append('g').attr('id', id).attr('class', 'stateGroup');
12277 if (stateDef.type === 'start') drawStartState(g);
12278 if (stateDef.type === 'end') drawEndState(g);
12279 if (stateDef.type === 'fork' || stateDef.type === 'join') drawForkJoinState(g, stateDef);
12280 if (stateDef.type === 'note') drawNote(stateDef.note.text, g);
12281 if (stateDef.type === 'divider') drawDivider(g);
12282 if (stateDef.type === 'default' && stateDef.descriptions.length === 0) drawSimpleState(g, stateDef);
12283 if (stateDef.type === 'default' && stateDef.descriptions.length > 0) drawDescrState(g, stateDef);
12284 var stateBox = g.node().getBBox();
12285 stateInfo.width = stateBox.width + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding;
12286 stateInfo.height = stateBox.height + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding;
12287 _id_cache_js__WEBPACK_IMPORTED_MODULE_1__["default"].set(id, stateInfo); // stateCnt++;
12288
12289 return stateInfo;
12290};
12291
12292var getRows = function getRows(s) {
12293 var str = s.replace(/<br\/?>/gi, '#br#');
12294 str = str.replace(/\\n/g, '#br#');
12295 return str.split('#br#');
12296};
12297
12298var edgeCount = 0;
12299var drawEdge = function drawEdge(elem, path, relation) {
12300 var getRelationType = function getRelationType(type) {
12301 switch (type) {
12302 case _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].relationType.AGGREGATION:
12303 return 'aggregation';
12304
12305 case _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].relationType.EXTENSION:
12306 return 'extension';
12307
12308 case _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].relationType.COMPOSITION:
12309 return 'composition';
12310
12311 case _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].relationType.DEPENDENCY:
12312 return 'dependency';
12313 }
12314 };
12315
12316 path.points = path.points.filter(function (p) {
12317 return !Number.isNaN(p.y);
12318 }); // The data for our line
12319
12320 var lineData = path.points; // This is the accessor function we talked about above
12321
12322 var lineFunction = d3__WEBPACK_IMPORTED_MODULE_0__["line"]().x(function (d) {
12323 return d.x;
12324 }).y(function (d) {
12325 return d.y;
12326 }).curve(d3__WEBPACK_IMPORTED_MODULE_0__["curveBasis"]);
12327 var svgPath = elem.append('path').attr('d', lineFunction(lineData)).attr('id', 'edge' + edgeCount).attr('class', 'transition');
12328 var url = '';
12329
12330 if (Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.arrowMarkerAbsolute) {
12331 url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;
12332 url = url.replace(/\(/g, '\\(');
12333 url = url.replace(/\)/g, '\\)');
12334 }
12335
12336 svgPath.attr('marker-end', 'url(' + url + '#' + getRelationType(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].relationType.DEPENDENCY) + 'End' + ')');
12337
12338 if (typeof relation.title !== 'undefined') {
12339 var label = elem.append('g').attr('class', 'stateLabel');
12340
12341 var _utils$calcLabelPosit = _utils__WEBPACK_IMPORTED_MODULE_3__["default"].calcLabelPosition(path.points),
12342 x = _utils$calcLabelPosit.x,
12343 y = _utils$calcLabelPosit.y;
12344
12345 var rows = getRows(relation.title); // console.warn(rows);
12346
12347 var titleHeight = 0;
12348 var titleRows = [];
12349
12350 for (var i = 0; i <= rows.length; i++) {
12351 var title = label.append('text').attr('text-anchor', 'middle').text(rows[i]).attr('x', x).attr('y', y + titleHeight);
12352
12353 if (titleHeight === 0) {
12354 var titleBox = title.node().getBBox();
12355 titleHeight = titleBox.height;
12356 }
12357
12358 titleRows.push(title);
12359 }
12360
12361 if (rows.length > 1) {
12362 var heightAdj = rows.length * titleHeight * 0.25;
12363 titleRows.forEach(function (title, i) {
12364 return title.attr('y', y + i * titleHeight - heightAdj);
12365 });
12366 }
12367
12368 var bounds = label.node().getBBox();
12369 label.insert('rect', ':first-child').attr('class', 'box').attr('x', bounds.x - Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding / 2).attr('y', bounds.y - Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding / 2).attr('width', bounds.width + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('height', bounds.height + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding); //label.attr('transform', '0 -' + (bounds.y / 2));
12370 // Debug points
12371 // path.points.forEach(point => {
12372 // g.append('circle')
12373 // .style('stroke', 'red')
12374 // .style('fill', 'red')
12375 // .attr('r', 1)
12376 // .attr('cx', point.x)
12377 // .attr('cy', point.y);
12378 // });
12379 // g.append('circle')
12380 // .style('stroke', 'blue')
12381 // .style('fill', 'blue')
12382 // .attr('r', 1)
12383 // .attr('cx', x)
12384 // .attr('cy', y);
12385 }
12386
12387 edgeCount++;
12388};
12389
12390/***/ }),
12391
12392/***/ "./src/diagrams/state/stateDb.js":
12393/*!***************************************!*\
12394 !*** ./src/diagrams/state/stateDb.js ***!
12395 \***************************************/
12396/*! exports provided: addState, clear, getState, getStates, logDocuments, getRelations, addRelation, cleanupLabel, lineType, relationType, default */
12397/***/ (function(module, __webpack_exports__, __webpack_require__) {
12398
12399"use strict";
12400__webpack_require__.r(__webpack_exports__);
12401/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addState", function() { return addState; });
12402/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
12403/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getState", function() { return getState; });
12404/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getStates", function() { return getStates; });
12405/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logDocuments", function() { return logDocuments; });
12406/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRelations", function() { return getRelations; });
12407/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addRelation", function() { return addRelation; });
12408/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanupLabel", function() { return cleanupLabel; });
12409/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lineType", function() { return lineType; });
12410/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relationType", function() { return relationType; });
12411/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
12412function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
12413
12414
12415var rootDoc = [];
12416
12417var setRootDoc = function setRootDoc(o) {
12418 _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Setting root doc', o);
12419 rootDoc = o;
12420};
12421
12422var getRootDoc = function getRootDoc() {
12423 return rootDoc;
12424};
12425
12426var extract = function extract(doc) {
12427 // const res = { states: [], relations: [] };
12428 clear();
12429 doc.forEach(function (item) {
12430 if (item.stmt === 'state') {
12431 addState(item.id, item.type, item.doc, item.description, item.note);
12432 }
12433
12434 if (item.stmt === 'relation') {
12435 addRelation(item.state1.id, item.state2.id, item.description);
12436 }
12437 });
12438};
12439
12440var newDoc = function newDoc() {
12441 return {
12442 relations: [],
12443 states: {},
12444 documents: {}
12445 };
12446};
12447
12448var documents = {
12449 root: newDoc()
12450};
12451var currentDocument = documents.root;
12452var startCnt = 0;
12453var endCnt = 0; // eslint-disable-line
12454// let stateCnt = 0;
12455
12456/**
12457 * Function called by parser when a node definition has been found.
12458 * @param id
12459 * @param text
12460 * @param type
12461 * @param style
12462 */
12463
12464var addState = function addState(id, type, doc, descr, note) {
12465 if (typeof currentDocument.states[id] === 'undefined') {
12466 currentDocument.states[id] = {
12467 id: id,
12468 descriptions: [],
12469 type: type,
12470 doc: doc,
12471 note: note
12472 };
12473 } else {
12474 if (!currentDocument.states[id].doc) {
12475 currentDocument.states[id].doc = doc;
12476 }
12477
12478 if (!currentDocument.states[id].type) {
12479 currentDocument.states[id].type = type;
12480 }
12481 }
12482
12483 if (descr) {
12484 if (typeof descr === 'string') addDescription(id, descr.trim());
12485
12486 if (_typeof(descr) === 'object') {
12487 descr.forEach(function (des) {
12488 return addDescription(id, des.trim());
12489 });
12490 }
12491 }
12492
12493 if (note) currentDocument.states[id].note = note;
12494};
12495var clear = function clear() {
12496 documents = {
12497 root: newDoc()
12498 };
12499 currentDocument = documents.root;
12500};
12501var getState = function getState(id) {
12502 return currentDocument.states[id];
12503};
12504var getStates = function getStates() {
12505 return currentDocument.states;
12506};
12507var logDocuments = function logDocuments() {
12508 _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Documents = ', documents);
12509};
12510var getRelations = function getRelations() {
12511 return currentDocument.relations;
12512};
12513var addRelation = function addRelation(_id1, _id2, title) {
12514 var id1 = _id1;
12515 var id2 = _id2;
12516 var type1 = 'default';
12517 var type2 = 'default';
12518
12519 if (_id1 === '[*]') {
12520 startCnt++;
12521 id1 = 'start' + startCnt;
12522 type1 = 'start';
12523 }
12524
12525 if (_id2 === '[*]') {
12526 endCnt++;
12527 id2 = 'end' + startCnt;
12528 type2 = 'end';
12529 }
12530
12531 addState(id1, type1);
12532 addState(id2, type2);
12533 currentDocument.relations.push({
12534 id1: id1,
12535 id2: id2,
12536 title: title
12537 });
12538};
12539
12540var addDescription = function addDescription(id, _descr) {
12541 var theState = currentDocument.states[id];
12542 var descr = _descr;
12543
12544 if (descr[0] === ':') {
12545 descr = descr.substr(1).trim();
12546 }
12547
12548 theState.descriptions.push(descr);
12549};
12550
12551var cleanupLabel = function cleanupLabel(label) {
12552 if (label.substring(0, 1) === ':') {
12553 return label.substr(2).trim();
12554 } else {
12555 return label.trim();
12556 }
12557};
12558var lineType = {
12559 LINE: 0,
12560 DOTTED_LINE: 1
12561};
12562var dividerCnt = 0;
12563
12564var getDividerId = function getDividerId() {
12565 dividerCnt++;
12566 return 'divider-id-' + dividerCnt;
12567};
12568
12569var relationType = {
12570 AGGREGATION: 0,
12571 EXTENSION: 1,
12572 COMPOSITION: 2,
12573 DEPENDENCY: 3
12574};
12575/* harmony default export */ __webpack_exports__["default"] = ({
12576 addState: addState,
12577 clear: clear,
12578 getState: getState,
12579 getStates: getStates,
12580 getRelations: getRelations,
12581 addRelation: addRelation,
12582 getDividerId: getDividerId,
12583 // addDescription,
12584 cleanupLabel: cleanupLabel,
12585 lineType: lineType,
12586 relationType: relationType,
12587 logDocuments: logDocuments,
12588 getRootDoc: getRootDoc,
12589 setRootDoc: setRootDoc,
12590 extract: extract
12591});
12592
12593/***/ }),
12594
12595/***/ "./src/diagrams/state/stateRenderer.js":
12596/*!*********************************************!*\
12597 !*** ./src/diagrams/state/stateRenderer.js ***!
12598 \*********************************************/
12599/*! exports provided: setConf, draw, default */
12600/***/ (function(module, __webpack_exports__, __webpack_require__) {
12601
12602"use strict";
12603__webpack_require__.r(__webpack_exports__);
12604/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
12605/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
12606/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
12607/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
12608/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dagre */ "dagre");
12609/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dagre__WEBPACK_IMPORTED_MODULE_1__);
12610/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! graphlib */ "graphlib");
12611/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_2__);
12612/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
12613/* harmony import */ var _stateDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./stateDb */ "./src/diagrams/state/stateDb.js");
12614/* harmony import */ var _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parser/stateDiagram */ "./src/diagrams/state/parser/stateDiagram.jison");
12615/* harmony import */ var _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_5__);
12616/* harmony import */ var _shapes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./shapes */ "./src/diagrams/state/shapes.js");
12617/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../config */ "./src/config.js");
12618
12619
12620
12621
12622
12623 // import idCache from './id-cache';
12624
12625
12626
12627_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_5__["parser"].yy = _stateDb__WEBPACK_IMPORTED_MODULE_4__["default"]; // TODO Move conf object to main conf in mermaidAPI
12628
12629var conf;
12630var transformationLog = {};
12631var setConf = function setConf() {}; // Todo optimize
12632
12633/**
12634 * Setup arrow head and define the marker. The result is appended to the svg.
12635 */
12636
12637var insertMarkers = function insertMarkers(elem) {
12638 elem.append('defs').append('marker').attr('id', 'dependencyEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 19,7 L9,13 L14,7 L9,1 Z');
12639};
12640/**
12641 * Draws a flowchart in the tag with id: id based on the graph definition in text.
12642 * @param text
12643 * @param id
12644 */
12645
12646
12647var draw = function draw(text, id) {
12648 conf = Object(_config__WEBPACK_IMPORTED_MODULE_7__["getConfig"])().state;
12649 _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_5__["parser"].yy.clear();
12650 _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_5__["parser"].parse(text);
12651 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Rendering diagram ' + text); // Fetch the default direction, use TD if none was found
12652
12653 var diagram = d3__WEBPACK_IMPORTED_MODULE_0__["select"]("[id='".concat(id, "']"));
12654 insertMarkers(diagram); // Layout graph, Create a new directed graph
12655
12656 var graph = new graphlib__WEBPACK_IMPORTED_MODULE_2___default.a.Graph({
12657 multigraph: false,
12658 compound: true,
12659 // acyclicer: 'greedy',
12660 rankdir: 'RL' // ranksep: '20'
12661
12662 }); // Default to assigning a new object as a label for each new edge.
12663
12664 graph.setDefaultEdgeLabel(function () {
12665 return {};
12666 });
12667 var rootDoc = _stateDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRootDoc();
12668 renderDoc(rootDoc, diagram, undefined, false);
12669 var padding = conf.padding;
12670 var bounds = diagram.node().getBBox();
12671 var width = bounds.width + padding * 2;
12672 var height = bounds.height + padding * 2; // diagram.attr('height', '100%');
12673 // diagram.attr('style', `width: ${bounds.width * 3 + conf.padding * 2};`);
12674 // diagram.attr('height', height);
12675 // Zoom in a bit
12676
12677 diagram.attr('width', width * 1.75); // diagram.attr('height', bounds.height * 3 + conf.padding * 2);
12678
12679 diagram.attr('viewBox', "".concat(bounds.x - conf.padding, " ").concat(bounds.y - conf.padding, " ") + width + ' ' + height); // diagram.attr('transform', `translate(, 0)`);
12680 // diagram.attr(
12681 // 'viewBox',
12682 // `${conf.padding * -1} ${conf.padding * -1} ` +
12683 // (bounds.width * 1.5 + conf.padding * 2) +
12684 // ' ' +
12685 // (bounds.height + conf.padding * 5)
12686 // );
12687};
12688
12689var getLabelWidth = function getLabelWidth(text) {
12690 return text ? text.length * conf.fontSizeFactor : 1;
12691};
12692/* TODO: REMOVE DUPLICATION, SEE SHAPES */
12693
12694
12695var getRows = function getRows(s) {
12696 if (!s) return 1;
12697 var str = s.replace(/<br\/?>/gi, '#br#');
12698 str = str.replace(/\\n/g, '#br#');
12699 return str.split('#br#');
12700};
12701
12702var renderDoc = function renderDoc(doc, diagram, parentId, altBkg) {
12703 // // Layout graph, Create a new directed graph
12704 var graph = new graphlib__WEBPACK_IMPORTED_MODULE_2___default.a.Graph({
12705 compound: true
12706 });
12707 var i;
12708 var edgeFreeDoc = true;
12709
12710 for (i = 0; i < doc.length; i++) {
12711 if (doc[i].stmt === 'relation') {
12712 edgeFreeDoc = false;
12713 break;
12714 }
12715 } // Set an object for the graph label
12716
12717
12718 if (parentId) graph.setGraph({
12719 rankdir: 'LR',
12720 // multigraph: false,
12721 compound: true,
12722 // acyclicer: 'greedy',
12723 ranker: 'tight-tree',
12724 ranksep: edgeFreeDoc ? 1 : conf.edgeLengthFactor,
12725 nodeSep: edgeFreeDoc ? 1 : 50 // isMultiGraph: false
12726 // ranksep: 5,
12727 // nodesep: 1
12728
12729 });else {
12730 graph.setGraph({
12731 rankdir: 'TB',
12732 compound: true,
12733 // isCompound: true,
12734 // acyclicer: 'greedy',
12735 // ranker: 'longest-path'
12736 ranksep: edgeFreeDoc ? 1 : conf.edgeLengthFactor,
12737 nodeSep: edgeFreeDoc ? 1 : 50,
12738 ranker: 'tight-tree' // ranker: 'network-simplex'
12739 // isMultiGraph: false
12740
12741 });
12742 } // Default to assigning a new object as a label for each new edge.
12743
12744 graph.setDefaultEdgeLabel(function () {
12745 return {};
12746 });
12747 _stateDb__WEBPACK_IMPORTED_MODULE_4__["default"].extract(doc);
12748 var states = _stateDb__WEBPACK_IMPORTED_MODULE_4__["default"].getStates();
12749 var relations = _stateDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRelations();
12750 var keys = Object.keys(states);
12751 var first = true;
12752
12753 for (var _i = 0; _i < keys.length; _i++) {
12754 var stateDef = states[keys[_i]];
12755
12756 if (parentId) {
12757 stateDef.parentId = parentId;
12758 }
12759
12760 var node = void 0;
12761
12762 if (stateDef.doc) {
12763 var sub = diagram.append('g').attr('id', stateDef.id).attr('class', 'stateGroup');
12764 node = renderDoc(stateDef.doc, sub, stateDef.id, !altBkg);
12765
12766 if (first) {
12767 // first = false;
12768 sub = Object(_shapes__WEBPACK_IMPORTED_MODULE_6__["addTitleAndBox"])(sub, stateDef, altBkg);
12769 var boxBounds = sub.node().getBBox();
12770 node.width = boxBounds.width;
12771 node.height = boxBounds.height + conf.padding / 2;
12772 transformationLog[stateDef.id] = {
12773 y: conf.compositTitleSize
12774 };
12775 } else {
12776 // sub = addIdAndBox(sub, stateDef);
12777 var _boxBounds = sub.node().getBBox();
12778
12779 node.width = _boxBounds.width;
12780 node.height = _boxBounds.height; // transformationLog[stateDef.id] = { y: conf.compositTitleSize };
12781 }
12782 } else {
12783 node = Object(_shapes__WEBPACK_IMPORTED_MODULE_6__["drawState"])(diagram, stateDef, graph);
12784 }
12785
12786 if (stateDef.note) {
12787 // Draw note note
12788 var noteDef = {
12789 descriptions: [],
12790 id: stateDef.id + '-note',
12791 note: stateDef.note,
12792 type: 'note'
12793 };
12794 var note = Object(_shapes__WEBPACK_IMPORTED_MODULE_6__["drawState"])(diagram, noteDef, graph); // graph.setNode(node.id, node);
12795
12796 if (stateDef.note.position === 'left of') {
12797 graph.setNode(node.id + '-note', note);
12798 graph.setNode(node.id, node);
12799 } else {
12800 graph.setNode(node.id, node);
12801 graph.setNode(node.id + '-note', note);
12802 } // graph.setNode(node.id);
12803
12804
12805 graph.setParent(node.id, node.id + '-group');
12806 graph.setParent(node.id + '-note', node.id + '-group');
12807 } else {
12808 // Add nodes to the graph. The first argument is the node id. The second is
12809 // metadata about the node. In this case we're going to add labels to each of
12810 // our nodes.
12811 graph.setNode(node.id, node);
12812 }
12813 }
12814
12815 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Count=', graph.nodeCount());
12816 relations.forEach(function (relation) {
12817 graph.setEdge(relation.id1, relation.id2, {
12818 relation: relation,
12819 width: getLabelWidth(relation.title),
12820 height: conf.labelHeight * getRows(relation.title).length,
12821 labelpos: 'c'
12822 });
12823 });
12824 dagre__WEBPACK_IMPORTED_MODULE_1___default.a.layout(graph);
12825 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Graph after layout', graph.nodes());
12826 var svgElem = diagram.node();
12827 graph.nodes().forEach(function (v) {
12828 if (typeof v !== 'undefined' && typeof graph.node(v) !== 'undefined') {
12829 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].warn('Node ' + v + ': ' + JSON.stringify(graph.node(v)));
12830 d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#' + svgElem.id + ' #' + v).attr('transform', 'translate(' + (graph.node(v).x - graph.node(v).width / 2) + ',' + (graph.node(v).y + (transformationLog[v] ? transformationLog[v].y : 0) - graph.node(v).height / 2) + ' )');
12831 d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#' + svgElem.id + ' #' + v).attr('data-x-shift', graph.node(v).x - graph.node(v).width / 2);
12832 var dividers = document.querySelectorAll('#' + svgElem.id + ' #' + v + ' .divider');
12833 dividers.forEach(function (divider) {
12834 var parent = divider.parentElement;
12835 var pWidth = 0;
12836 var pShift = 0;
12837
12838 if (parent) {
12839 if (parent.parentElement) pWidth = parent.parentElement.getBBox().width;
12840 pShift = parseInt(parent.getAttribute('data-x-shift'), 10);
12841
12842 if (Number.isNaN(pShift)) {
12843 pShift = 0;
12844 }
12845 }
12846
12847 divider.setAttribute('x1', 0 - pShift + 8);
12848 divider.setAttribute('x2', pWidth - pShift - 8);
12849 });
12850 } else {
12851 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('No Node ' + v + ': ' + JSON.stringify(graph.node(v)));
12852 }
12853 });
12854 var stateBox = svgElem.getBBox();
12855 graph.edges().forEach(function (e) {
12856 if (typeof e !== 'undefined' && typeof graph.edge(e) !== 'undefined') {
12857 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(graph.edge(e)));
12858 Object(_shapes__WEBPACK_IMPORTED_MODULE_6__["drawEdge"])(diagram, graph.edge(e), graph.edge(e).relation);
12859 }
12860 });
12861 stateBox = svgElem.getBBox();
12862 var stateInfo = {
12863 id: parentId ? parentId : 'root',
12864 label: parentId ? parentId : 'root',
12865 width: 0,
12866 height: 0
12867 };
12868 stateInfo.width = stateBox.width + 2 * conf.padding;
12869 stateInfo.height = stateBox.height + 2 * conf.padding;
12870 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Doc rendered', stateInfo, graph);
12871 return stateInfo;
12872};
12873
12874/* harmony default export */ __webpack_exports__["default"] = ({
12875 setConf: setConf,
12876 draw: draw
12877});
12878
12879/***/ }),
12880
12881/***/ "./src/logger.js":
12882/*!***********************!*\
12883 !*** ./src/logger.js ***!
12884 \***********************/
12885/*! exports provided: LEVELS, logger, setLogLevel */
12886/***/ (function(module, __webpack_exports__, __webpack_require__) {
12887
12888"use strict";
12889__webpack_require__.r(__webpack_exports__);
12890/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LEVELS", function() { return LEVELS; });
12891/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logger", function() { return logger; });
12892/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLogLevel", function() { return setLogLevel; });
12893/* harmony import */ var moment_mini__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment-mini */ "moment-mini");
12894/* harmony import */ var moment_mini__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment_mini__WEBPACK_IMPORTED_MODULE_0__);
12895
12896var LEVELS = {
12897 debug: 1,
12898 info: 2,
12899 warn: 3,
12900 error: 4,
12901 fatal: 5
12902};
12903var logger = {
12904 debug: function debug() {},
12905 info: function info() {},
12906 warn: function warn() {},
12907 error: function error() {},
12908 fatal: function fatal() {}
12909};
12910var setLogLevel = function setLogLevel(level) {
12911 logger.debug = function () {};
12912
12913 logger.info = function () {};
12914
12915 logger.warn = function () {};
12916
12917 logger.error = function () {};
12918
12919 logger.fatal = function () {};
12920
12921 if (level <= LEVELS.fatal) {
12922 logger.fatal = console.log.bind(console, '\x1b[35m', format('FATAL'));
12923 }
12924
12925 if (level <= LEVELS.error) {
12926 logger.error = console.log.bind(console, '\x1b[31m', format('ERROR'));
12927 }
12928
12929 if (level <= LEVELS.warn) {
12930 logger.warn = console.log.bind(console, "\x1B[33m", format('WARN'));
12931 }
12932
12933 if (level <= LEVELS.info) {
12934 logger.info = console.log.bind(console, '\x1b[34m', format('INFO'));
12935 }
12936
12937 if (level <= LEVELS.debug) {
12938 logger.debug = console.log.bind(console, '\x1b[32m', format('DEBUG'));
12939 }
12940};
12941
12942var format = function format(level) {
12943 var time = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()().format('HH:mm:ss.SSS');
12944 return "".concat(time, " : ").concat(level, " : ");
12945};
12946
12947/***/ }),
12948
12949/***/ "./src/mermaid.js":
12950/*!************************!*\
12951 !*** ./src/mermaid.js ***!
12952 \************************/
12953/*! exports provided: default */
12954/***/ (function(module, __webpack_exports__, __webpack_require__) {
12955
12956"use strict";
12957__webpack_require__.r(__webpack_exports__);
12958/* harmony import */ var he__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! he */ "he");
12959/* harmony import */ var he__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(he__WEBPACK_IMPORTED_MODULE_0__);
12960/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mermaidAPI */ "./src/mermaidAPI.js");
12961/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./logger */ "./src/logger.js");
12962/**
12963 * Web page integration module for the mermaid framework. It uses the mermaidAPI for mermaid functionality and to render
12964 * the diagrams to svg code.
12965 */
12966
12967
12968
12969/**
12970 * ## init
12971 * Function that goes through the document to find the chart definitions in there and render them.
12972 *
12973 * The function tags the processed attributes with the attribute data-processed and ignores found elements with the
12974 * attribute already set. This way the init function can be triggered several times.
12975 *
12976 * Optionally, `init` can accept in the second argument one of the following:
12977 * - a DOM Node
12978 * - an array of DOM nodes (as would come from a jQuery selector)
12979 * - a W3C selector, a la `.mermaid`
12980 *
12981 * ```mermaid
12982 * graph LR;
12983 * a(Find elements)-->b{Processed}
12984 * b-->|Yes|c(Leave element)
12985 * b-->|No |d(Transform)
12986 * ```
12987 * Renders the mermaid diagrams
12988 * @param nodes a css selector or an array of nodes
12989 */
12990
12991var init = function init() {
12992 var conf = _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].getConfig();
12993 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Starting rendering diagrams');
12994 var nodes;
12995
12996 if (arguments.length >= 2) {
12997 /*! sequence config was passed as #1 */
12998 if (typeof arguments[0] !== 'undefined') {
12999 mermaid.sequenceConfig = arguments[0];
13000 }
13001
13002 nodes = arguments[1];
13003 } else {
13004 nodes = arguments[0];
13005 } // if last argument is a function this is the callback function
13006
13007
13008 var callback;
13009
13010 if (typeof arguments[arguments.length - 1] === 'function') {
13011 callback = arguments[arguments.length - 1];
13012 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Callback function found');
13013 } else {
13014 if (typeof conf.mermaid !== 'undefined') {
13015 if (typeof conf.mermaid.callback === 'function') {
13016 callback = conf.mermaid.callback;
13017 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Callback function found');
13018 } else {
13019 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('No Callback function found');
13020 }
13021 }
13022 }
13023
13024 nodes = nodes === undefined ? document.querySelectorAll('.mermaid') : typeof nodes === 'string' ? document.querySelectorAll(nodes) : nodes instanceof window.Node ? [nodes] : nodes; // Last case - sequence config was passed pick next
13025
13026 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Start On Load before: ' + mermaid.startOnLoad);
13027
13028 if (typeof mermaid.startOnLoad !== 'undefined') {
13029 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Start On Load inner: ' + mermaid.startOnLoad);
13030 _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].initialize({
13031 startOnLoad: mermaid.startOnLoad
13032 });
13033 }
13034
13035 if (typeof mermaid.ganttConfig !== 'undefined') {
13036 _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].initialize({
13037 gantt: mermaid.ganttConfig
13038 });
13039 }
13040
13041 var txt;
13042
13043 var _loop = function _loop(i) {
13044 var element = nodes[i];
13045 /*! Check if previously processed */
13046
13047 if (!element.getAttribute('data-processed')) {
13048 element.setAttribute('data-processed', true);
13049 } else {
13050 return "continue";
13051 }
13052
13053 var id = "mermaid-".concat(Date.now()); // Fetch the graph definition including tags
13054
13055 txt = element.innerHTML; // transforms the html to pure text
13056
13057 txt = he__WEBPACK_IMPORTED_MODULE_0___default.a.decode(txt).trim().replace(/<br>/gi, '<br/>');
13058 _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].render(id, txt, function (svgCode, bindFunctions) {
13059 element.innerHTML = svgCode;
13060
13061 if (typeof callback !== 'undefined') {
13062 callback(id);
13063 }
13064
13065 if (bindFunctions) bindFunctions(element);
13066 }, element);
13067 };
13068
13069 for (var i = 0; i < nodes.length; i++) {
13070 var _ret = _loop(i);
13071
13072 if (_ret === "continue") continue;
13073 }
13074};
13075
13076var initialize = function initialize(config) {
13077 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Initializing mermaid ');
13078
13079 if (typeof config.mermaid !== 'undefined') {
13080 if (typeof config.mermaid.startOnLoad !== 'undefined') {
13081 mermaid.startOnLoad = config.mermaid.startOnLoad;
13082 }
13083
13084 if (typeof config.mermaid.htmlLabels !== 'undefined') {
13085 mermaid.htmlLabels = config.mermaid.htmlLabels;
13086 }
13087 }
13088
13089 _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].initialize(config);
13090};
13091/**
13092 * ##contentLoaded
13093 * Callback function that is called when page is loaded. This functions fetches configuration for mermaid rendering and
13094 * calls init for rendering the mermaid diagrams on the page.
13095 */
13096
13097
13098var contentLoaded = function contentLoaded() {
13099 var config;
13100
13101 if (mermaid.startOnLoad) {
13102 // No config found, do check API config
13103 config = _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].getConfig();
13104
13105 if (config.startOnLoad) {
13106 mermaid.init();
13107 }
13108 } else {
13109 if (typeof mermaid.startOnLoad === 'undefined') {
13110 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('In start, no config');
13111 config = _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].getConfig();
13112
13113 if (config.startOnLoad) {
13114 mermaid.init();
13115 }
13116 }
13117 }
13118};
13119
13120if (typeof document !== 'undefined') {
13121 /*!
13122 * Wait for document loaded before starting the execution
13123 */
13124 window.addEventListener('load', function () {
13125 contentLoaded();
13126 }, false);
13127}
13128
13129var mermaid = {
13130 startOnLoad: true,
13131 htmlLabels: true,
13132 mermaidAPI: _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"],
13133 parse: _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].parse,
13134 render: _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].render,
13135 init: init,
13136 initialize: initialize,
13137 contentLoaded: contentLoaded
13138};
13139/* harmony default export */ __webpack_exports__["default"] = (mermaid);
13140
13141/***/ }),
13142
13143/***/ "./src/mermaidAPI.js":
13144/*!***************************!*\
13145 !*** ./src/mermaidAPI.js ***!
13146 \***************************/
13147/*! exports provided: encodeEntities, decodeEntities, default */
13148/***/ (function(module, __webpack_exports__, __webpack_require__) {
13149
13150"use strict";
13151__webpack_require__.r(__webpack_exports__);
13152/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "encodeEntities", function() { return encodeEntities; });
13153/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "decodeEntities", function() { return decodeEntities; });
13154/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
13155/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
13156/* harmony import */ var scope_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! scope-css */ "scope-css");
13157/* harmony import */ var scope_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(scope_css__WEBPACK_IMPORTED_MODULE_1__);
13158/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../package.json */ "./package.json");
13159var _package_json__WEBPACK_IMPORTED_MODULE_2___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../package.json */ "./package.json", 1);
13160/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./config */ "./src/config.js");
13161/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./logger */ "./src/logger.js");
13162/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./src/utils.js");
13163/* harmony import */ var _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./diagrams/flowchart/flowRenderer */ "./src/diagrams/flowchart/flowRenderer.js");
13164/* harmony import */ var _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./diagrams/flowchart/parser/flow */ "./src/diagrams/flowchart/parser/flow.jison");
13165/* harmony import */ var _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7__);
13166/* harmony import */ var _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./diagrams/flowchart/flowDb */ "./src/diagrams/flowchart/flowDb.js");
13167/* harmony import */ var _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./diagrams/sequence/sequenceRenderer */ "./src/diagrams/sequence/sequenceRenderer.js");
13168/* harmony import */ var _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./diagrams/sequence/parser/sequenceDiagram */ "./src/diagrams/sequence/parser/sequenceDiagram.jison");
13169/* harmony import */ var _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10__);
13170/* harmony import */ var _diagrams_sequence_sequenceDb__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./diagrams/sequence/sequenceDb */ "./src/diagrams/sequence/sequenceDb.js");
13171/* harmony import */ var _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./diagrams/gantt/ganttRenderer */ "./src/diagrams/gantt/ganttRenderer.js");
13172/* harmony import */ var _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./diagrams/gantt/parser/gantt */ "./src/diagrams/gantt/parser/gantt.jison");
13173/* harmony import */ var _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13__);
13174/* harmony import */ var _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./diagrams/gantt/ganttDb */ "./src/diagrams/gantt/ganttDb.js");
13175/* harmony import */ var _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./diagrams/class/classRenderer */ "./src/diagrams/class/classRenderer.js");
13176/* harmony import */ var _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./diagrams/class/parser/classDiagram */ "./src/diagrams/class/parser/classDiagram.jison");
13177/* harmony import */ var _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_16__);
13178/* harmony import */ var _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./diagrams/class/classDb */ "./src/diagrams/class/classDb.js");
13179/* harmony import */ var _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./diagrams/state/stateRenderer */ "./src/diagrams/state/stateRenderer.js");
13180/* harmony import */ var _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./diagrams/state/parser/stateDiagram */ "./src/diagrams/state/parser/stateDiagram.jison");
13181/* harmony import */ var _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_19__);
13182/* harmony import */ var _diagrams_state_stateDb__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./diagrams/state/stateDb */ "./src/diagrams/state/stateDb.js");
13183/* harmony import */ var _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./diagrams/git/gitGraphRenderer */ "./src/diagrams/git/gitGraphRenderer.js");
13184/* harmony import */ var _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./diagrams/git/parser/gitGraph */ "./src/diagrams/git/parser/gitGraph.jison");
13185/* harmony import */ var _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_22__);
13186/* harmony import */ var _diagrams_git_gitGraphAst__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./diagrams/git/gitGraphAst */ "./src/diagrams/git/gitGraphAst.js");
13187/* harmony import */ var _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./diagrams/info/infoRenderer */ "./src/diagrams/info/infoRenderer.js");
13188/* harmony import */ var _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./diagrams/info/parser/info */ "./src/diagrams/info/parser/info.jison");
13189/* harmony import */ var _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(_diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_25__);
13190/* harmony import */ var _diagrams_info_infoDb__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./diagrams/info/infoDb */ "./src/diagrams/info/infoDb.js");
13191/* harmony import */ var _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./diagrams/pie/pieRenderer */ "./src/diagrams/pie/pieRenderer.js");
13192/* harmony import */ var _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./diagrams/pie/parser/pie */ "./src/diagrams/pie/parser/pie.jison");
13193/* harmony import */ var _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(_diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_28__);
13194/* harmony import */ var _diagrams_pie_pieDb__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./diagrams/pie/pieDb */ "./src/diagrams/pie/pieDb.js");
13195function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
13196
13197/**
13198 * This is the api to be used when optionally handling the integration with the web page, instead of using the default integration provided by mermaid.js.
13199 *
13200 * The core of this api is the [**render**](https://github.com/knsv/mermaid/blob/master/docs/mermaidAPI.md#render) function which, given a graph
13201 * definition as text, renders the graph/diagram and returns an svg element for the graph.
13202 *
13203 * It is is then up to the user of the API to make use of the svg, either insert it somewhere in the page or do something completely different.
13204 *
13205 * In addition to the render function, a number of behavioral configuration options are available.
13206 *
13207 * @name mermaidAPI
13208 */
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239var themes = {};
13240
13241for (var _i = 0, _arr = ['default', 'forest', 'dark', 'neutral']; _i < _arr.length; _i++) {
13242 var themeName = _arr[_i];
13243 themes[themeName] = __webpack_require__("./src/themes sync recursive ^\\.\\/.*\\/index\\.scss$")("./".concat(themeName, "/index.scss"));
13244}
13245/**
13246 * These are the default options which can be overridden with the initialization call like so:
13247 * **Example 1:**
13248 * <pre>
13249 * mermaid.initialize({
13250 * flowchart:{
13251 * htmlLabels: false
13252 * }
13253 * });
13254 * </pre>
13255 *
13256 * **Example 2:**
13257 * <pre>
13258 * <script>
13259 * var config = {
13260 * startOnLoad:true,
13261 * flowchart:{
13262 * useMaxWidth:true,
13263 * htmlLabels:true,
13264 * curve:'cardinal',
13265 * },
13266 *
13267 * securityLevel:'loose',
13268 * };
13269 * mermaid.initialize(config);
13270 * </script>
13271 * </pre>
13272 * A summary of all options and their defaults is found [here](https://github.com/knsv/mermaid/blob/master/docs/mermaidAPI.md#mermaidapi-configuration-defaults). A description of each option follows below.
13273 *
13274 * @name Configuration
13275 */
13276
13277
13278var config = {
13279 /** theme , the CSS style sheet
13280 *
13281 * **theme** - Choose one of the built-in themes:
13282 * * default
13283 * * forest
13284 * * dark
13285 * * neutral.
13286 * To disable any pre-defined mermaid theme, use "null".
13287 *
13288 * **themeCSS** - Use your own CSS. This overrides **theme**.
13289 * <pre>
13290 * "theme": "forest",
13291 * "themeCSS": ".node rect { fill: red; }"
13292 * </pre>
13293 */
13294 theme: 'default',
13295 themeCSS: undefined,
13296
13297 /**
13298 * **fontFamily** The font to be used for the rendered diagrams. Default value is \"trebuchet ms\", verdana, arial;
13299 */
13300 fontFamily: '"trebuchet ms", verdana, arial;',
13301
13302 /**
13303 * This option decides the amount of logging to be used.
13304 * * debug: 1
13305 * * info: 2
13306 * * warn: 3
13307 * * error: 4
13308 * * fatal: (**default**) 5
13309 */
13310 logLevel: 5,
13311
13312 /**
13313 * Sets the level of trust to be used on the parsed diagrams.
13314 * * **strict**: (**default**) tags in text are encoded, click functionality is disabeled
13315 * * **loose**: tags in text are allowed, click functionality is enabled
13316 */
13317 securityLevel: 'strict',
13318
13319 /**
13320 * This options controls whether or mermaid starts when the page loads
13321 * **Default value true**.
13322 */
13323 startOnLoad: true,
13324
13325 /**
13326 * This options controls whether or arrow markers in html code will be absolute paths or
13327 * an anchor, #. This matters if you are using base tag settings.
13328 * **Default value false**.
13329 */
13330 arrowMarkerAbsolute: false,
13331
13332 /**
13333 * The object containing configurations specific for flowcharts
13334 */
13335 flowchart: {
13336 /**
13337 * Flag for setting whether or not a html tag should be used for rendering labels
13338 * on the edges.
13339 * **Default value true**.
13340 */
13341 htmlLabels: true,
13342
13343 /**
13344 * How mermaid renders curves for flowcharts. Possible values are
13345 * * basis
13346 * * linear **default**
13347 * * cardinal
13348 */
13349 curve: 'linear'
13350 },
13351
13352 /**
13353 * The object containing configurations specific for sequence diagrams
13354 */
13355 sequence: {
13356 /**
13357 * margin to the right and left of the sequence diagram.
13358 * **Default value 50**.
13359 */
13360 diagramMarginX: 50,
13361
13362 /**
13363 * margin to the over and under the sequence diagram.
13364 * **Default value 10**.
13365 */
13366 diagramMarginY: 10,
13367
13368 /**
13369 * Margin between actors.
13370 * **Default value 50**.
13371 */
13372 actorMargin: 50,
13373
13374 /**
13375 * Width of actor boxes
13376 * **Default value 150**.
13377 */
13378 width: 150,
13379
13380 /**
13381 * Height of actor boxes
13382 * **Default value 65**.
13383 */
13384 height: 65,
13385
13386 /**
13387 * Margin around loop boxes
13388 * **Default value 10**.
13389 */
13390 boxMargin: 10,
13391
13392 /**
13393 * margin around the text in loop/alt/opt boxes
13394 * **Default value 5**.
13395 */
13396 boxTextMargin: 5,
13397
13398 /**
13399 * margin around notes.
13400 * **Default value 10**.
13401 */
13402 noteMargin: 10,
13403
13404 /**
13405 * Space between messages.
13406 * **Default value 35**.
13407 */
13408 messageMargin: 35,
13409
13410 /**
13411 * mirror actors under diagram.
13412 * **Default value true**.
13413 */
13414 mirrorActors: true,
13415
13416 /**
13417 * Depending on css styling this might need adjustment.
13418 * Prolongs the edge of the diagram downwards.
13419 * **Default value 1**.
13420 */
13421 bottomMarginAdj: 1,
13422
13423 /**
13424 * when this flag is set the height and width is set to 100% and is then scaling with the
13425 * available space if not the absolute space required is used.
13426 * **Default value true**.
13427 */
13428 useMaxWidth: true,
13429
13430 /**
13431 * This will display arrows that start and begin at the same node as right angles, rather than a curve
13432 * **Default value false**.
13433 */
13434 rightAngles: false,
13435
13436 /**
13437 * This will show the node numbers
13438 * **Default value false**.
13439 */
13440 showSequenceNumbers: false
13441 },
13442
13443 /**
13444 * The object containing configurations specific for gantt diagrams*
13445 */
13446 gantt: {
13447 /**
13448 * Margin top for the text over the gantt diagram
13449 * **Default value 25**.
13450 */
13451 titleTopMargin: 25,
13452
13453 /**
13454 * The height of the bars in the graph
13455 * **Default value 20**.
13456 */
13457 barHeight: 20,
13458
13459 /**
13460 * The margin between the different activities in the gantt diagram.
13461 * **Default value 4**.
13462 */
13463 barGap: 4,
13464
13465 /**
13466 * Margin between title and gantt diagram and between axis and gantt diagram.
13467 * **Default value 50**.
13468 */
13469 topPadding: 50,
13470
13471 /**
13472 * The space allocated for the section name to the left of the activities.
13473 * **Default value 75**.
13474 */
13475 leftPadding: 75,
13476
13477 /**
13478 * Vertical starting position of the grid lines.
13479 * **Default value 35**.
13480 */
13481 gridLineStartPadding: 35,
13482
13483 /**
13484 * Font size ...
13485 * **Default value 11**.
13486 */
13487 fontSize: 11,
13488
13489 /**
13490 * font family ...
13491 * **Default value '"Open-Sans", "sans-serif"'**.
13492 */
13493 fontFamily: '"Open-Sans", "sans-serif"',
13494
13495 /**
13496 * The number of alternating section styles.
13497 * **Default value 4**.
13498 */
13499 numberSectionStyles: 4,
13500
13501 /**
13502 * Datetime format of the axis. This might need adjustment to match your locale and preferences
13503 * **Default value '%Y-%m-%d'**.
13504 */
13505 axisFormat: '%Y-%m-%d'
13506 },
13507 class: {},
13508 git: {},
13509 state: {
13510 dividerMargin: 10,
13511 sizeUnit: 5,
13512 padding: 8,
13513 textHeight: 10,
13514 titleShift: -15,
13515 noteMargin: 10,
13516 forkWidth: 70,
13517 forkHeight: 7,
13518 // Used
13519 miniPadding: 2,
13520 // Font size factor, this is used to guess the width of the edges labels before rendering by dagre
13521 // layout. This might need updating if/when switching font
13522 fontSizeFactor: 5.02,
13523 fontSize: 24,
13524 labelHeight: 16,
13525 edgeLengthFactor: '20',
13526 compositTitleSize: 35,
13527 radius: 5
13528 }
13529};
13530Object(_logger__WEBPACK_IMPORTED_MODULE_4__["setLogLevel"])(config.logLevel);
13531Object(_config__WEBPACK_IMPORTED_MODULE_3__["setConfig"])(config);
13532
13533function parse(text) {
13534 var graphType = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].detectType(text);
13535 var parser;
13536 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('Type ' + graphType);
13537
13538 switch (graphType) {
13539 case 'git':
13540 parser = _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_22___default.a;
13541 parser.parser.yy = _diagrams_git_gitGraphAst__WEBPACK_IMPORTED_MODULE_23__["default"];
13542 break;
13543
13544 case 'flowchart':
13545 _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"].clear();
13546 parser = _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7___default.a;
13547 parser.parser.yy = _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"];
13548 break;
13549
13550 case 'sequence':
13551 parser = _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10___default.a;
13552 parser.parser.yy = _diagrams_sequence_sequenceDb__WEBPACK_IMPORTED_MODULE_11__["default"];
13553 break;
13554
13555 case 'gantt':
13556 parser = _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13___default.a;
13557 parser.parser.yy = _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__["default"];
13558 break;
13559
13560 case 'class':
13561 parser = _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_16___default.a;
13562 parser.parser.yy = _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_17__["default"];
13563 break;
13564
13565 case 'state':
13566 parser = _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_19___default.a;
13567 parser.parser.yy = _diagrams_state_stateDb__WEBPACK_IMPORTED_MODULE_20__["default"];
13568 break;
13569
13570 case 'info':
13571 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('info info info');
13572 parser = _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_25___default.a;
13573 parser.parser.yy = _diagrams_info_infoDb__WEBPACK_IMPORTED_MODULE_26__["default"];
13574 break;
13575
13576 case 'pie':
13577 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('pie');
13578 parser = _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_28___default.a;
13579 parser.parser.yy = _diagrams_pie_pieDb__WEBPACK_IMPORTED_MODULE_29__["default"];
13580 break;
13581 }
13582
13583 parser.parser.yy.parseError = function (str, hash) {
13584 var error = {
13585 str: str,
13586 hash: hash
13587 };
13588 throw error;
13589 };
13590
13591 parser.parse(text);
13592}
13593
13594var encodeEntities = function encodeEntities(text) {
13595 var txt = text;
13596 txt = txt.replace(/style.*:\S*#.*;/g, function (s) {
13597 var innerTxt = s.substring(0, s.length - 1);
13598 return innerTxt;
13599 });
13600 txt = txt.replace(/classDef.*:\S*#.*;/g, function (s) {
13601 var innerTxt = s.substring(0, s.length - 1);
13602 return innerTxt;
13603 });
13604 txt = txt.replace(/#\w+;/g, function (s) {
13605 var innerTxt = s.substring(1, s.length - 1);
13606 var isInt = /^\+?\d+$/.test(innerTxt);
13607
13608 if (isInt) {
13609 return 'fl°°' + innerTxt + '¶ß';
13610 } else {
13611 return 'fl°' + innerTxt + '¶ß';
13612 }
13613 });
13614 return txt;
13615};
13616var decodeEntities = function decodeEntities(text) {
13617 var txt = text;
13618 txt = txt.replace(/fl°°/g, function () {
13619 return '&#';
13620 });
13621 txt = txt.replace(/fl°/g, function () {
13622 return '&';
13623 });
13624 txt = txt.replace(/¶ß/g, function () {
13625 return ';';
13626 });
13627 return txt;
13628};
13629/**
13630 * Function that renders an svg with a graph from a chart definition. Usage example below.
13631 *
13632 * ```js
13633 * mermaidAPI.initialize({
13634 * startOnLoad:true
13635 * });
13636 * $(function(){
13637 * const graphDefinition = 'graph TB\na-->b';
13638 * const cb = function(svgGraph){
13639 * console.log(svgGraph);
13640 * };
13641 * mermaidAPI.render('id1',graphDefinition,cb);
13642 * });
13643 *```
13644 * @param id the id of the element to be rendered
13645 * @param txt the graph definition
13646 * @param cb callback which is called after rendering is finished with the svg code as inparam.
13647 * @param container selector to element in which a div with the graph temporarily will be inserted. In one is
13648 * provided a hidden div will be inserted in the body of the page instead. The element will be removed when rendering is
13649 * completed.
13650 */
13651
13652var render = function render(id, txt, cb, container) {
13653 if (typeof container !== 'undefined') {
13654 container.innerHTML = '';
13655 d3__WEBPACK_IMPORTED_MODULE_0__["select"](container).append('div').attr('id', 'd' + id).attr('style', 'font-family: ' + config.fontFamily).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g');
13656 } else {
13657 var existingSvg = document.getElementById(id);
13658
13659 if (existingSvg) {
13660 existingSvg.remove();
13661 }
13662
13663 var _element = document.querySelector('#' + 'd' + id);
13664
13665 if (_element) {
13666 _element.innerHTML = '';
13667 }
13668
13669 d3__WEBPACK_IMPORTED_MODULE_0__["select"]('body').append('div').attr('id', 'd' + id).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g');
13670 }
13671
13672 window.txt = txt;
13673 txt = encodeEntities(txt);
13674 var element = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#d' + id).node();
13675 var graphType = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].detectType(txt); // insert inline style into svg
13676
13677 var svg = element.firstChild;
13678 var firstChild = svg.firstChild; // pre-defined theme
13679
13680 var style = themes[config.theme];
13681
13682 if (style === undefined) {
13683 style = '';
13684 } // user provided theme CSS
13685
13686
13687 if (config.themeCSS !== undefined) {
13688 style += "\n".concat(config.themeCSS);
13689 } // user provided theme CSS
13690
13691
13692 if (config.fontFamily !== undefined) {
13693 style += "\n:root { --mermaid-font-family: ".concat(config.fontFamily, "}");
13694 } // user provided theme CSS
13695
13696
13697 if (config.altFontFamily !== undefined) {
13698 style += "\n:root { --mermaid-alt-font-family: ".concat(config.altFontFamily, "}");
13699 } // classDef
13700
13701
13702 if (graphType === 'flowchart') {
13703 var classes = _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_6__["default"].getClasses(txt);
13704
13705 for (var className in classes) {
13706 style += "\n.".concat(className, " > * { ").concat(classes[className].styles.join(' !important; '), " !important; }");
13707 }
13708 }
13709
13710 var style1 = document.createElement('style');
13711 style1.innerHTML = scope_css__WEBPACK_IMPORTED_MODULE_1___default()(style, "#".concat(id));
13712 svg.insertBefore(style1, firstChild);
13713 var style2 = document.createElement('style');
13714 var cs = window.getComputedStyle(svg);
13715 style2.innerHTML = "#".concat(id, " {\n color: ").concat(cs.color, ";\n font: ").concat(cs.font, ";\n }");
13716 svg.insertBefore(style2, firstChild);
13717
13718 switch (graphType) {
13719 case 'git':
13720 config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
13721 _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_21__["default"].setConf(config.git);
13722 _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_21__["default"].draw(txt, id, false);
13723 break;
13724
13725 case 'flowchart':
13726 config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
13727 _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_6__["default"].setConf(config.flowchart);
13728 _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_6__["default"].draw(txt, id, false);
13729 break;
13730
13731 case 'sequence':
13732 config.sequence.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
13733
13734 if (config.sequenceDiagram) {
13735 // backwards compatibility
13736 _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].setConf(Object.assign(config.sequence, config.sequenceDiagram));
13737 console.error('`mermaid config.sequenceDiagram` has been renamed to `config.sequence`. Please update your mermaid config.');
13738 } else {
13739 _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].setConf(config.sequence);
13740 }
13741
13742 _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].draw(txt, id);
13743 break;
13744
13745 case 'gantt':
13746 config.gantt.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
13747 _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__["default"].setConf(config.gantt);
13748 _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__["default"].draw(txt, id);
13749 break;
13750
13751 case 'class':
13752 config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
13753 _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__["default"].setConf(config.class);
13754 _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__["default"].draw(txt, id);
13755 break;
13756
13757 case 'state':
13758 // config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
13759 _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_18__["default"].setConf(config.state);
13760 _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_18__["default"].draw(txt, id);
13761 break;
13762
13763 case 'info':
13764 config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
13765 _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_24__["default"].setConf(config.class);
13766 _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_24__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version);
13767 break;
13768
13769 case 'pie':
13770 config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
13771 _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_27__["default"].setConf(config.class);
13772 _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_27__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version);
13773 break;
13774 }
13775
13776 d3__WEBPACK_IMPORTED_MODULE_0__["select"]("[id=\"".concat(id, "\"]")).selectAll('foreignobject > *').attr('xmlns', 'http://www.w3.org/1999/xhtml'); // if (config.arrowMarkerAbsolute) {
13777 // url =
13778 // window.location.protocol +
13779 // '//' +
13780 // window.location.host +
13781 // window.location.pathname +
13782 // window.location.search;
13783 // url = url.replace(/\(/g, '\\(');
13784 // url = url.replace(/\)/g, '\\)');
13785 // }
13786 // Fix for when the base tag is used
13787
13788 var svgCode = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#d' + id).node().innerHTML;
13789
13790 if (!config.arrowMarkerAbsolute || config.arrowMarkerAbsolute === 'false') {
13791 svgCode = svgCode.replace(/marker-end="url\(.*?#/g, 'marker-end="url(#', 'g');
13792 }
13793
13794 svgCode = decodeEntities(svgCode);
13795
13796 if (typeof cb !== 'undefined') {
13797 switch (graphType) {
13798 case 'flowchart':
13799 cb(svgCode, _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"].bindFunctions);
13800 break;
13801
13802 case 'gantt':
13803 cb(svgCode, _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__["default"].bindFunctions);
13804 break;
13805
13806 default:
13807 cb(svgCode);
13808 }
13809 } else {
13810 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('CB = undefined!');
13811 }
13812
13813 var node = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#d' + id).node();
13814
13815 if (node !== null && typeof node.remove === 'function') {
13816 d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#d' + id).node().remove();
13817 }
13818
13819 return svgCode;
13820};
13821
13822var setConf = function setConf(cnf) {
13823 // Top level initially mermaid, gflow, sequenceDiagram and gantt
13824 var lvl1Keys = Object.keys(cnf);
13825
13826 for (var i = 0; i < lvl1Keys.length; i++) {
13827 if (_typeof(cnf[lvl1Keys[i]]) === 'object' && cnf[lvl1Keys[i]] != null) {
13828 var lvl2Keys = Object.keys(cnf[lvl1Keys[i]]);
13829
13830 for (var j = 0; j < lvl2Keys.length; j++) {
13831 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('Setting conf ', lvl1Keys[i], '-', lvl2Keys[j]);
13832
13833 if (typeof config[lvl1Keys[i]] === 'undefined') {
13834 config[lvl1Keys[i]] = {};
13835 }
13836
13837 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('Setting config: ' + lvl1Keys[i] + ' ' + lvl2Keys[j] + ' to ' + cnf[lvl1Keys[i]][lvl2Keys[j]]);
13838 config[lvl1Keys[i]][lvl2Keys[j]] = cnf[lvl1Keys[i]][lvl2Keys[j]];
13839 }
13840 } else {
13841 config[lvl1Keys[i]] = cnf[lvl1Keys[i]];
13842 }
13843 }
13844};
13845
13846function initialize(options) {
13847 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('Initializing mermaidAPI ', _package_json__WEBPACK_IMPORTED_MODULE_2__.version); // Update default config with options supplied at initialization
13848
13849 if (_typeof(options) === 'object') {
13850 setConf(options);
13851 }
13852
13853 Object(_config__WEBPACK_IMPORTED_MODULE_3__["setConfig"])(config);
13854 Object(_logger__WEBPACK_IMPORTED_MODULE_4__["setLogLevel"])(config.logLevel);
13855} // function getConfig () {
13856// console.warn('get config')
13857// return config
13858// }
13859
13860
13861var mermaidAPI = {
13862 render: render,
13863 parse: parse,
13864 initialize: initialize,
13865 getConfig: _config__WEBPACK_IMPORTED_MODULE_3__["getConfig"]
13866};
13867/* harmony default export */ __webpack_exports__["default"] = (mermaidAPI);
13868/**
13869 * ## mermaidAPI configuration defaults
13870 * <pre>
13871 *
13872 * &lt;script>
13873 * var config = {
13874 * theme:'default',
13875 * logLevel:'fatal',
13876 * securityLevel:'strict',
13877 * startOnLoad:true,
13878 * arrowMarkerAbsolute:false,
13879 *
13880 * flowchart:{
13881 * htmlLabels:true,
13882 * curve:'linear',
13883 * },
13884 * sequence:{
13885 * diagramMarginX:50,
13886 * diagramMarginY:10,
13887 * actorMargin:50,
13888 * width:150,
13889 * height:65,
13890 * boxMargin:10,
13891 * boxTextMargin:5,
13892 * noteMargin:10,
13893 * messageMargin:35,
13894 * mirrorActors:true,
13895 * bottomMarginAdj:1,
13896 * useMaxWidth:true,
13897 * rightAngles:false,
13898 * showSequenceNumbers:false,
13899 * },
13900 * gantt:{
13901 * titleTopMargin:25,
13902 * barHeight:20,
13903 * barGap:4,
13904 * topPadding:50,
13905 * leftPadding:75,
13906 * gridLineStartPadding:35,
13907 * fontSize:11,
13908 * fontFamily:'"Open-Sans", "sans-serif"',
13909 * numberSectionStyles:4,
13910 * axisFormat:'%Y-%m-%d',
13911 * }
13912 * };
13913 * mermaid.initialize(config);
13914 * &lt;/script>
13915 *</pre>
13916 */
13917
13918/***/ }),
13919
13920/***/ "./src/themes sync recursive ^\\.\\/.*\\/index\\.scss$":
13921/*!***********************************************!*\
13922 !*** ./src/themes sync ^\.\/.*\/index\.scss$ ***!
13923 \***********************************************/
13924/*! no static exports found */
13925/***/ (function(module, exports, __webpack_require__) {
13926
13927var map = {
13928 "./dark/index.scss": "./src/themes/dark/index.scss",
13929 "./default/index.scss": "./src/themes/default/index.scss",
13930 "./forest/index.scss": "./src/themes/forest/index.scss",
13931 "./neutral/index.scss": "./src/themes/neutral/index.scss"
13932};
13933
13934
13935function webpackContext(req) {
13936 var id = webpackContextResolve(req);
13937 return __webpack_require__(id);
13938}
13939function webpackContextResolve(req) {
13940 if(!__webpack_require__.o(map, req)) {
13941 var e = new Error("Cannot find module '" + req + "'");
13942 e.code = 'MODULE_NOT_FOUND';
13943 throw e;
13944 }
13945 return map[req];
13946}
13947webpackContext.keys = function webpackContextKeys() {
13948 return Object.keys(map);
13949};
13950webpackContext.resolve = webpackContextResolve;
13951module.exports = webpackContext;
13952webpackContext.id = "./src/themes sync recursive ^\\.\\/.*\\/index\\.scss$";
13953
13954/***/ }),
13955
13956/***/ "./src/themes/dark/index.scss":
13957/*!************************************!*\
13958 !*** ./src/themes/dark/index.scss ***!
13959 \************************************/
13960/*! no static exports found */
13961/***/ (function(module, exports, __webpack_require__) {
13962
13963// css-to-string-loader: transforms styles from css-loader to a string output
13964
13965// Get the styles
13966var styles = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./index.scss */ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/dark/index.scss");
13967
13968if (typeof styles === 'string') {
13969 // Return an existing string
13970 module.exports = styles;
13971} else {
13972 // Call the custom toString method from css-loader module
13973 module.exports = styles.toString();
13974}
13975
13976/***/ }),
13977
13978/***/ "./src/themes/default/index.scss":
13979/*!***************************************!*\
13980 !*** ./src/themes/default/index.scss ***!
13981 \***************************************/
13982/*! no static exports found */
13983/***/ (function(module, exports, __webpack_require__) {
13984
13985// css-to-string-loader: transforms styles from css-loader to a string output
13986
13987// Get the styles
13988var styles = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./index.scss */ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/default/index.scss");
13989
13990if (typeof styles === 'string') {
13991 // Return an existing string
13992 module.exports = styles;
13993} else {
13994 // Call the custom toString method from css-loader module
13995 module.exports = styles.toString();
13996}
13997
13998/***/ }),
13999
14000/***/ "./src/themes/forest/index.scss":
14001/*!**************************************!*\
14002 !*** ./src/themes/forest/index.scss ***!
14003 \**************************************/
14004/*! no static exports found */
14005/***/ (function(module, exports, __webpack_require__) {
14006
14007// css-to-string-loader: transforms styles from css-loader to a string output
14008
14009// Get the styles
14010var styles = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./index.scss */ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/forest/index.scss");
14011
14012if (typeof styles === 'string') {
14013 // Return an existing string
14014 module.exports = styles;
14015} else {
14016 // Call the custom toString method from css-loader module
14017 module.exports = styles.toString();
14018}
14019
14020/***/ }),
14021
14022/***/ "./src/themes/neutral/index.scss":
14023/*!***************************************!*\
14024 !*** ./src/themes/neutral/index.scss ***!
14025 \***************************************/
14026/*! no static exports found */
14027/***/ (function(module, exports, __webpack_require__) {
14028
14029// css-to-string-loader: transforms styles from css-loader to a string output
14030
14031// Get the styles
14032var styles = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./index.scss */ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/neutral/index.scss");
14033
14034if (typeof styles === 'string') {
14035 // Return an existing string
14036 module.exports = styles;
14037} else {
14038 // Call the custom toString method from css-loader module
14039 module.exports = styles.toString();
14040}
14041
14042/***/ }),
14043
14044/***/ "./src/utils.js":
14045/*!**********************!*\
14046 !*** ./src/utils.js ***!
14047 \**********************/
14048/*! exports provided: detectType, isSubstringInArray, interpolateToCurve, default */
14049/***/ (function(module, __webpack_exports__, __webpack_require__) {
14050
14051"use strict";
14052__webpack_require__.r(__webpack_exports__);
14053/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "detectType", function() { return detectType; });
14054/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSubstringInArray", function() { return isSubstringInArray; });
14055/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "interpolateToCurve", function() { return interpolateToCurve; });
14056/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
14057/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
14058/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./logger */ "./src/logger.js");
14059
14060
14061/**
14062 * @function detectType
14063 * Detects the type of the graph text.
14064 * ```mermaid
14065 * graph LR
14066 * a-->b
14067 * b-->c
14068 * c-->d
14069 * d-->e
14070 * e-->f
14071 * f-->g
14072 * g-->h
14073 * ```
14074 *
14075 * @param {string} text The text defining the graph
14076 * @returns {string} A graph definition key
14077 */
14078
14079var detectType = function detectType(text) {
14080 text = text.replace(/^\s*%%.*\n/g, '\n');
14081 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('Detecting diagram type based on the text ' + text);
14082
14083 if (text.match(/^\s*sequenceDiagram/)) {
14084 return 'sequence';
14085 }
14086
14087 if (text.match(/^\s*gantt/)) {
14088 return 'gantt';
14089 }
14090
14091 if (text.match(/^\s*classDiagram/)) {
14092 return 'class';
14093 }
14094
14095 if (text.match(/^\s*stateDiagram/)) {
14096 return 'state';
14097 }
14098
14099 if (text.match(/^\s*gitGraph/)) {
14100 return 'git';
14101 }
14102
14103 if (text.match(/^\s*info/)) {
14104 return 'info';
14105 }
14106
14107 if (text.match(/^\s*pie/)) {
14108 return 'pie';
14109 }
14110
14111 return 'flowchart';
14112};
14113/**
14114 * @function isSubstringInArray
14115 * Detects whether a substring in present in a given array
14116 * @param {string} str The substring to detect
14117 * @param {array} arr The array to search
14118 * @returns {number} the array index containing the substring or -1 if not present
14119 **/
14120
14121var isSubstringInArray = function isSubstringInArray(str, arr) {
14122 for (var i = 0; i < arr.length; i++) {
14123 if (arr[i].match(str)) return i;
14124 }
14125
14126 return -1;
14127};
14128var interpolateToCurve = function interpolateToCurve(interpolate, defaultCurve) {
14129 if (!interpolate) {
14130 return defaultCurve;
14131 }
14132
14133 var curveName = "curve".concat(interpolate.charAt(0).toUpperCase() + interpolate.slice(1));
14134 return d3__WEBPACK_IMPORTED_MODULE_0__[curveName] || defaultCurve;
14135};
14136
14137var distance = function distance(p1, p2) {
14138 return p1 && p2 ? Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)) : 0;
14139};
14140
14141var traverseEdge = function traverseEdge(points) {
14142 var prevPoint;
14143 var totalDistance = 0;
14144 points.forEach(function (point) {
14145 totalDistance += distance(point, prevPoint);
14146 prevPoint = point;
14147 }); // Traverse half of total distance along points
14148
14149 var distanceToLabel = totalDistance / 2;
14150 var remainingDistance = distanceToLabel;
14151 var center;
14152 prevPoint = undefined;
14153 points.forEach(function (point) {
14154 if (prevPoint && !center) {
14155 var vectorDistance = distance(point, prevPoint);
14156
14157 if (vectorDistance < remainingDistance) {
14158 remainingDistance -= vectorDistance;
14159 } else {
14160 // The point is remainingDistance from prevPoint in the vector between prevPoint and point
14161 // Calculate the coordinates
14162 var distanceRatio = remainingDistance / vectorDistance;
14163 if (distanceRatio <= 0) center = prevPoint;
14164 if (distanceRatio >= 1) center = {
14165 x: point.x,
14166 y: point.y
14167 };
14168
14169 if (distanceRatio > 0 && distanceRatio < 1) {
14170 center = {
14171 x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x,
14172 y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y
14173 };
14174 }
14175 }
14176 }
14177
14178 prevPoint = point;
14179 });
14180 return center;
14181};
14182
14183var calcLabelPosition = function calcLabelPosition(points) {
14184 var p = traverseEdge(points);
14185 return p;
14186};
14187
14188var calcCardinalityPosition = function calcCardinalityPosition(isRelationTypePresent, points, initialPosition) {
14189 var prevPoint;
14190 var totalDistance = 0; // eslint-disable-line
14191
14192 if (points[0] !== initialPosition) {
14193 points = points.reverse();
14194 }
14195
14196 points.forEach(function (point) {
14197 totalDistance += distance(point, prevPoint);
14198 prevPoint = point;
14199 }); // Traverse only 25 total distance along points to find cardinality point
14200
14201 var distanceToCardinalityPoint = 25;
14202 var remainingDistance = distanceToCardinalityPoint;
14203 var center;
14204 prevPoint = undefined;
14205 points.forEach(function (point) {
14206 if (prevPoint && !center) {
14207 var vectorDistance = distance(point, prevPoint);
14208
14209 if (vectorDistance < remainingDistance) {
14210 remainingDistance -= vectorDistance;
14211 } else {
14212 // The point is remainingDistance from prevPoint in the vector between prevPoint and point
14213 // Calculate the coordinates
14214 var distanceRatio = remainingDistance / vectorDistance;
14215 if (distanceRatio <= 0) center = prevPoint;
14216 if (distanceRatio >= 1) center = {
14217 x: point.x,
14218 y: point.y
14219 };
14220
14221 if (distanceRatio > 0 && distanceRatio < 1) {
14222 center = {
14223 x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x,
14224 y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y
14225 };
14226 }
14227 }
14228 }
14229
14230 prevPoint = point;
14231 }); // if relation is present (Arrows will be added), change cardinality point off-set distance (d)
14232
14233 var d = isRelationTypePresent ? 10 : 5; //Calculate Angle for x and y axis
14234
14235 var angle = Math.atan2(points[0].y - center.y, points[0].x - center.x);
14236 var cardinalityPosition = {
14237 x: 0,
14238 y: 0
14239 }; //Calculation cardinality position using angle, center point on the line/curve but pendicular and with offset-distance
14240
14241 cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2;
14242 cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2;
14243 return cardinalityPosition;
14244};
14245
14246/* harmony default export */ __webpack_exports__["default"] = ({
14247 detectType: detectType,
14248 isSubstringInArray: isSubstringInArray,
14249 interpolateToCurve: interpolateToCurve,
14250 calcLabelPosition: calcLabelPosition,
14251 calcCardinalityPosition: calcCardinalityPosition
14252});
14253
14254/***/ }),
14255
14256/***/ "@braintree/sanitize-url":
14257/*!******************************************!*\
14258 !*** external "@braintree/sanitize-url" ***!
14259 \******************************************/
14260/*! no static exports found */
14261/***/ (function(module, exports) {
14262
14263module.exports = require("@braintree/sanitize-url");
14264
14265/***/ }),
14266
14267/***/ "crypto-random-string":
14268/*!***************************************!*\
14269 !*** external "crypto-random-string" ***!
14270 \***************************************/
14271/*! no static exports found */
14272/***/ (function(module, exports) {
14273
14274module.exports = require("crypto-random-string");
14275
14276/***/ }),
14277
14278/***/ "d3":
14279/*!*********************!*\
14280 !*** external "d3" ***!
14281 \*********************/
14282/*! no static exports found */
14283/***/ (function(module, exports) {
14284
14285module.exports = require("d3");
14286
14287/***/ }),
14288
14289/***/ "dagre":
14290/*!************************!*\
14291 !*** external "dagre" ***!
14292 \************************/
14293/*! no static exports found */
14294/***/ (function(module, exports) {
14295
14296module.exports = require("dagre");
14297
14298/***/ }),
14299
14300/***/ "dagre-d3":
14301/*!***************************!*\
14302 !*** external "dagre-d3" ***!
14303 \***************************/
14304/*! no static exports found */
14305/***/ (function(module, exports) {
14306
14307module.exports = require("dagre-d3");
14308
14309/***/ }),
14310
14311/***/ "dagre-d3/lib/label/add-html-label.js":
14312/*!*******************************************************!*\
14313 !*** external "dagre-d3/lib/label/add-html-label.js" ***!
14314 \*******************************************************/
14315/*! no static exports found */
14316/***/ (function(module, exports) {
14317
14318module.exports = require("dagre-d3/lib/label/add-html-label.js");
14319
14320/***/ }),
14321
14322/***/ "graphlib":
14323/*!***************************!*\
14324 !*** external "graphlib" ***!
14325 \***************************/
14326/*! no static exports found */
14327/***/ (function(module, exports) {
14328
14329module.exports = require("graphlib");
14330
14331/***/ }),
14332
14333/***/ "he":
14334/*!*********************!*\
14335 !*** external "he" ***!
14336 \*********************/
14337/*! no static exports found */
14338/***/ (function(module, exports) {
14339
14340module.exports = require("he");
14341
14342/***/ }),
14343
14344/***/ "lodash":
14345/*!*************************!*\
14346 !*** external "lodash" ***!
14347 \*************************/
14348/*! no static exports found */
14349/***/ (function(module, exports) {
14350
14351module.exports = require("lodash");
14352
14353/***/ }),
14354
14355/***/ "moment-mini":
14356/*!******************************!*\
14357 !*** external "moment-mini" ***!
14358 \******************************/
14359/*! no static exports found */
14360/***/ (function(module, exports) {
14361
14362module.exports = require("moment-mini");
14363
14364/***/ }),
14365
14366/***/ "scope-css":
14367/*!****************************!*\
14368 !*** external "scope-css" ***!
14369 \****************************/
14370/*! no static exports found */
14371/***/ (function(module, exports) {
14372
14373module.exports = require("scope-css");
14374
14375/***/ })
14376
14377/******/ })["default"];
14378});
14379//# sourceMappingURL=mermaid.core.js.map
\No newline at end of file