import { _ as o, aB as ut, bl as Ot, bm as Rt, bn as At, g as pt, l as k, aU as Bt, aV as Pt, bo as gt, a5 as Z, aA as zt, bp as Wt, av as jt } from "./index-Bh-wTBlD.js";
import { h as st } from "./arc-Da5qnJCa-D1fJq9Ga.js";
var K = function() {
  var e = /* @__PURE__ */ o(function(m, i, d, p) {
    for (d = d || {}, p = m.length; p--; d[m[p]] = i) ;
    return d;
  }, "o"), t = [6, 11, 13, 14, 15, 17, 19, 20, 23, 24], n = [1, 12], a = [1, 13], r = [1, 14], l = [1, 15], c = [1, 16], h = [1, 19], u = [1, 20], y = {
    trace: /* @__PURE__ */ o(function() {
    }, "trace"),
    yy: {},
    symbols_: { error: 2, start: 3, timeline_header: 4, document: 5, EOF: 6, timeline: 7, timeline_lr: 8, timeline_td: 9, line: 10, SPACE: 11, statement: 12, NEWLINE: 13, title: 14, acc_title: 15, acc_title_value: 16, acc_descr: 17, acc_descr_value: 18, acc_descr_multiline_value: 19, section: 20, period_statement: 21, event_statement: 22, period: 23, event: 24, $accept: 0, $end: 1 },
    terminals_: { 2: "error", 6: "EOF", 7: "timeline", 8: "timeline_lr", 9: "timeline_td", 11: "SPACE", 13: "NEWLINE", 14: "title", 15: "acc_title", 16: "acc_title_value", 17: "acc_descr", 18: "acc_descr_value", 19: "acc_descr_multiline_value", 20: "section", 23: "period", 24: "event" },
    productions_: [0, [3, 3], [4, 1], [4, 1], [4, 1], [5, 0], [5, 2], [10, 2], [10, 1], [10, 1], [10, 1], [12, 1], [12, 2], [12, 2], [12, 1], [12, 1], [12, 1], [12, 1], [21, 1], [22, 1]],
    performAction: /* @__PURE__ */ o(function(m, i, d, p, g, s, x) {
      var _ = s.length - 1;
      switch (g) {
        case 1:
          return s[_ - 1];
        case 3:
          p.setDirection("LR");
          break;
        case 4:
          p.setDirection("TD");
          break;
        case 5:
          this.$ = [];
          break;
        case 6:
          s[_ - 1].push(s[_]), this.$ = s[_ - 1];
          break;
        case 7:
        case 8:
          this.$ = s[_];
          break;
        case 9:
        case 10:
          this.$ = [];
          break;
        case 11:
          p.getCommonDb().setDiagramTitle(s[_].substr(6)), this.$ = s[_].substr(6);
          break;
        case 12:
          this.$ = s[_].trim(), p.getCommonDb().setAccTitle(this.$);
          break;
        case 13:
        case 14:
          this.$ = s[_].trim(), p.getCommonDb().setAccDescription(this.$);
          break;
        case 15:
          p.addSection(s[_].substr(8)), this.$ = s[_].substr(8);
          break;
        case 18:
          p.addTask(s[_], 0, ""), this.$ = s[_];
          break;
        case 19:
          p.addEvent(s[_].substr(2)), this.$ = s[_];
          break;
      }
    }, "anonymous"),
    table: [{ 3: 1, 4: 2, 7: [1, 3], 8: [1, 4], 9: [1, 5] }, { 1: [3] }, e(t, [2, 5], { 5: 6 }), e(t, [2, 2]), e(t, [2, 3]), e(t, [2, 4]), { 6: [1, 7], 10: 8, 11: [1, 9], 12: 10, 13: [1, 11], 14: n, 15: a, 17: r, 19: l, 20: c, 21: 17, 22: 18, 23: h, 24: u }, e(t, [2, 10], { 1: [2, 1] }), e(t, [2, 6]), { 12: 21, 14: n, 15: a, 17: r, 19: l, 20: c, 21: 17, 22: 18, 23: h, 24: u }, e(t, [2, 8]), e(t, [2, 9]), e(t, [2, 11]), { 16: [1, 22] }, { 18: [1, 23] }, e(t, [2, 14]), e(t, [2, 15]), e(t, [2, 16]), e(t, [2, 17]), e(t, [2, 18]), e(t, [2, 19]), e(t, [2, 7]), e(t, [2, 12]), e(t, [2, 13])],
    defaultActions: {},
    parseError: /* @__PURE__ */ o(function(m, i) {
      if (i.recoverable)
        this.trace(m);
      else {
        var d = new Error(m);
        throw d.hash = i, d;
      }
    }, "parseError"),
    parse: /* @__PURE__ */ o(function(m) {
      var i = this, d = [0], p = [], g = [null], s = [], x = this.table, _ = "", A = 0, T = 0, N = 2, P = 1, H = s.slice.call(arguments, 1), v = Object.create(this.lexer), M = { yy: {} };
      for (var O in this.yy)
        Object.prototype.hasOwnProperty.call(this.yy, O) && (M.yy[O] = this.yy[O]);
      v.setInput(m, M.yy), M.yy.lexer = v, M.yy.parser = this, typeof v.yylloc > "u" && (v.yylloc = {});
      var z = v.yylloc;
      s.push(z);
      var W = v.options && v.options.ranges;
      typeof M.yy.parseError == "function" ? this.parseError = M.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
      function R(D) {
        d.length = d.length - 2 * D, g.length = g.length - D, s.length = s.length - D;
      }
      o(R, "popStack");
      function j() {
        var D;
        return D = p.pop() || v.lex() || P, typeof D != "number" && (D instanceof Array && (p = D, D = p.pop()), D = i.symbols_[D] || D), D;
      }
      o(j, "lex");
      for (var $, w, E, I, S = {}, L, C, F, G; ; ) {
        if (w = d[d.length - 1], this.defaultActions[w] ? E = this.defaultActions[w] : (($ === null || typeof $ > "u") && ($ = j()), E = x[w] && x[w][$]), typeof E > "u" || !E.length || !E[0]) {
          var U = "";
          G = [];
          for (L in x[w])
            this.terminals_[L] && L > N && G.push("'" + this.terminals_[L] + "'");
          v.showPosition ? U = "Parse error on line " + (A + 1) + `:
` + v.showPosition() + `
Expecting ` + G.join(", ") + ", got '" + (this.terminals_[$] || $) + "'" : U = "Parse error on line " + (A + 1) + ": Unexpected " + ($ == P ? "end of input" : "'" + (this.terminals_[$] || $) + "'"), this.parseError(U, {
            text: v.match,
            token: this.terminals_[$] || $,
            line: v.yylineno,
            loc: z,
            expected: G
          });
        }
        if (E[0] instanceof Array && E.length > 1)
          throw new Error("Parse Error: multiple actions possible at state: " + w + ", token: " + $);
        switch (E[0]) {
          case 1:
            d.push($), g.push(v.yytext), s.push(v.yylloc), d.push(E[1]), $ = null, T = v.yyleng, _ = v.yytext, A = v.yylineno, z = v.yylloc;
            break;
          case 2:
            if (C = this.productions_[E[1]][1], S.$ = g[g.length - C], S._$ = {
              first_line: s[s.length - (C || 1)].first_line,
              last_line: s[s.length - 1].last_line,
              first_column: s[s.length - (C || 1)].first_column,
              last_column: s[s.length - 1].last_column
            }, W && (S._$.range = [
              s[s.length - (C || 1)].range[0],
              s[s.length - 1].range[1]
            ]), I = this.performAction.apply(S, [
              _,
              T,
              A,
              M.yy,
              E[1],
              g,
              s
            ].concat(H)), typeof I < "u")
              return I;
            C && (d = d.slice(0, -1 * C * 2), g = g.slice(0, -1 * C), s = s.slice(0, -1 * C)), d.push(this.productions_[E[1]][0]), g.push(S.$), s.push(S._$), F = x[d[d.length - 2]][d[d.length - 1]], d.push(F);
            break;
          case 3:
            return !0;
        }
      }
      return !0;
    }, "parse")
  }, b = /* @__PURE__ */ function() {
    var m = {
      EOF: 1,
      parseError: /* @__PURE__ */ o(function(i, d) {
        if (this.yy.parser)
          this.yy.parser.parseError(i, d);
        else
          throw new Error(i);
      }, "parseError"),
      // resets the lexer, sets new input
      setInput: /* @__PURE__ */ o(function(i, d) {
        return this.yy = d || this.yy || {}, this._input = i, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
          first_line: 1,
          first_column: 0,
          last_line: 1,
          last_column: 0
        }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
      }, "setInput"),
      // consumes and returns one char from the input
      input: /* @__PURE__ */ o(function() {
        var i = this._input[0];
        this.yytext += i, this.yyleng++, this.offset++, this.match += i, this.matched += i;
        var d = i.match(/(?:\r\n?|\n).*/g);
        return d ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), i;
      }, "input"),
      // unshifts one char (or a string) into the input
      unput: /* @__PURE__ */ o(function(i) {
        var d = i.length, p = i.split(/(?:\r\n?|\n)/g);
        this._input = i + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - d), this.offset -= d;
        var g = this.match.split(/(?:\r\n?|\n)/g);
        this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), p.length - 1 && (this.yylineno -= p.length - 1);
        var s = this.yylloc.range;
        return this.yylloc = {
          first_line: this.yylloc.first_line,
          last_line: this.yylineno + 1,
          first_column: this.yylloc.first_column,
          last_column: p ? (p.length === g.length ? this.yylloc.first_column : 0) + g[g.length - p.length].length - p[0].length : this.yylloc.first_column - d
        }, this.options.ranges && (this.yylloc.range = [s[0], s[0] + this.yyleng - d]), this.yyleng = this.yytext.length, this;
      }, "unput"),
      // When called from action, caches matched text and appends it on next action
      more: /* @__PURE__ */ o(function() {
        return this._more = !0, this;
      }, "more"),
      // 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.
      reject: /* @__PURE__ */ o(function() {
        if (this.options.backtrack_lexer)
          this._backtrack = !0;
        else
          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).
` + this.showPosition(), {
            text: "",
            token: null,
            line: this.yylineno
          });
        return this;
      }, "reject"),
      // retain first n characters of the match
      less: /* @__PURE__ */ o(function(i) {
        this.unput(this.match.slice(i));
      }, "less"),
      // displays already matched input, i.e. for error messages
      pastInput: /* @__PURE__ */ o(function() {
        var i = this.matched.substr(0, this.matched.length - this.match.length);
        return (i.length > 20 ? "..." : "") + i.substr(-20).replace(/\n/g, "");
      }, "pastInput"),
      // displays upcoming input, i.e. for error messages
      upcomingInput: /* @__PURE__ */ o(function() {
        var i = this.match;
        return i.length < 20 && (i += this._input.substr(0, 20 - i.length)), (i.substr(0, 20) + (i.length > 20 ? "..." : "")).replace(/\n/g, "");
      }, "upcomingInput"),
      // displays the character position where the lexing error occurred, i.e. for error messages
      showPosition: /* @__PURE__ */ o(function() {
        var i = this.pastInput(), d = new Array(i.length + 1).join("-");
        return i + this.upcomingInput() + `
` + d + "^";
      }, "showPosition"),
      // test the lexed token: return FALSE when not a match, otherwise return token
      test_match: /* @__PURE__ */ o(function(i, d) {
        var p, g, s;
        if (this.options.backtrack_lexer && (s = {
          yylineno: this.yylineno,
          yylloc: {
            first_line: this.yylloc.first_line,
            last_line: this.last_line,
            first_column: this.yylloc.first_column,
            last_column: this.yylloc.last_column
          },
          yytext: this.yytext,
          match: this.match,
          matches: this.matches,
          matched: this.matched,
          yyleng: this.yyleng,
          offset: this.offset,
          _more: this._more,
          _input: this._input,
          yy: this.yy,
          conditionStack: this.conditionStack.slice(0),
          done: this.done
        }, this.options.ranges && (s.yylloc.range = this.yylloc.range.slice(0))), g = i[0].match(/(?:\r\n?|\n).*/g), g && (this.yylineno += g.length), this.yylloc = {
          first_line: this.yylloc.last_line,
          last_line: this.yylineno + 1,
          first_column: this.yylloc.last_column,
          last_column: g ? g[g.length - 1].length - g[g.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + i[0].length
        }, this.yytext += i[0], this.match += i[0], this.matches = i, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(i[0].length), this.matched += i[0], p = this.performAction.call(this, this.yy, this, d, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), p)
          return p;
        if (this._backtrack) {
          for (var x in s)
            this[x] = s[x];
          return !1;
        }
        return !1;
      }, "test_match"),
      // return next match in input
      next: /* @__PURE__ */ o(function() {
        if (this.done)
          return this.EOF;
        this._input || (this.done = !0);
        var i, d, p, g;
        this._more || (this.yytext = "", this.match = "");
        for (var s = this._currentRules(), x = 0; x < s.length; x++)
          if (p = this._input.match(this.rules[s[x]]), p && (!d || p[0].length > d[0].length)) {
            if (d = p, g = x, this.options.backtrack_lexer) {
              if (i = this.test_match(p, s[x]), i !== !1)
                return i;
              if (this._backtrack) {
                d = !1;
                continue;
              } else
                return !1;
            } else if (!this.options.flex)
              break;
          }
        return d ? (i = this.test_match(d, s[g]), i !== !1 ? i : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
` + this.showPosition(), {
          text: "",
          token: null,
          line: this.yylineno
        });
      }, "next"),
      // return next match that has a token
      lex: /* @__PURE__ */ o(function() {
        var i = this.next();
        return i || this.lex();
      }, "lex"),
      // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
      begin: /* @__PURE__ */ o(function(i) {
        this.conditionStack.push(i);
      }, "begin"),
      // pop the previously active lexer condition state off the condition stack
      popState: /* @__PURE__ */ o(function() {
        var i = this.conditionStack.length - 1;
        return i > 0 ? this.conditionStack.pop() : this.conditionStack[0];
      }, "popState"),
      // produce the lexer rule set which is active for the currently active lexer condition state
      _currentRules: /* @__PURE__ */ o(function() {
        return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
      }, "_currentRules"),
      // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
      topState: /* @__PURE__ */ o(function(i) {
        return i = this.conditionStack.length - 1 - Math.abs(i || 0), i >= 0 ? this.conditionStack[i] : "INITIAL";
      }, "topState"),
      // alias for begin(condition)
      pushState: /* @__PURE__ */ o(function(i) {
        this.begin(i);
      }, "pushState"),
      // return the number of states currently on the stack
      stateStackSize: /* @__PURE__ */ o(function() {
        return this.conditionStack.length;
      }, "stateStackSize"),
      options: { "case-insensitive": !0 },
      performAction: /* @__PURE__ */ o(function(i, d, p, g) {
        switch (p) {
          case 0:
            break;
          case 1:
            break;
          case 2:
            return 13;
          case 3:
            break;
          case 4:
            break;
          case 5:
            return 8;
          case 6:
            return 9;
          case 7:
            return 7;
          case 8:
            return 14;
          case 9:
            return this.begin("acc_title"), 15;
          case 10:
            return this.popState(), "acc_title_value";
          case 11:
            return this.begin("acc_descr"), 17;
          case 12:
            return this.popState(), "acc_descr_value";
          case 13:
            this.begin("acc_descr_multiline");
            break;
          case 14:
            this.popState();
            break;
          case 15:
            return "acc_descr_multiline_value";
          case 16:
            return 20;
          case 17:
            return 24;
          case 18:
            return 23;
          case 19:
            return 6;
          case 20:
            return "INVALID";
        }
      }, "anonymous"),
      rules: [/^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:timeline[ \t]+LR\b)/i, /^(?:timeline[ \t]+TD\b)/i, /^(?:timeline\b)/i, /^(?:title\s[^\n]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:section\s[^:\n]+)/i, /^(?::\s(?:[^:\n]|:(?!\s))+)/i, /^(?:[^#:\n]+)/i, /^(?:$)/i, /^(?:.)/i],
      conditions: { acc_descr_multiline: { rules: [14, 15], inclusive: !1 }, acc_descr: { rules: [12], inclusive: !1 }, acc_title: { rules: [10], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 16, 17, 18, 19, 20], inclusive: !0 } }
    };
    return m;
  }();
  y.lexer = b;
  function f() {
    this.yy = {};
  }
  return o(f, "Parser"), f.prototype = y, y.Parser = f, new f();
}();
K.parser = K;
var Ft = K, ft = {};
zt(ft, {
  addEvent: () => St,
  addSection: () => wt,
  addTask: () => $t,
  addTaskOrg: () => Et,
  clear: () => xt,
  default: () => Vt,
  getCommonDb: () => mt,
  getDirection: () => kt,
  getSections: () => _t,
  getTasks: () => vt,
  setDirection: () => bt
});
var q = "", yt = 0, et = "LR", nt = [], Y = [], X = [], mt = /* @__PURE__ */ o(() => Wt, "getCommonDb"), xt = /* @__PURE__ */ o(function() {
  nt.length = 0, Y.length = 0, q = "", X.length = 0, et = "LR", jt();
}, "clear"), bt = /* @__PURE__ */ o(function(e) {
  et = e;
}, "setDirection"), kt = /* @__PURE__ */ o(function() {
  return et;
}, "getDirection"), wt = /* @__PURE__ */ o(function(e) {
  q = e, nt.push(e);
}, "addSection"), _t = /* @__PURE__ */ o(function() {
  return nt;
}, "getSections"), vt = /* @__PURE__ */ o(function() {
  let e = ot();
  const t = 100;
  let n = 0;
  for (; !e && n < t; )
    e = ot(), n++;
  return Y.push(...X), Y;
}, "getTasks"), $t = /* @__PURE__ */ o(function(e, t, n) {
  const a = {
    id: yt++,
    section: q,
    type: q,
    task: e,
    score: t || 0,
    //if event is defined, then add it the events array
    events: n ? [n] : []
  };
  X.push(a);
}, "addTask"), St = /* @__PURE__ */ o(function(e) {
  X.find((t) => t.id === yt - 1).events.push(e);
}, "addEvent"), Et = /* @__PURE__ */ o(function(e) {
  const t = {
    section: q,
    type: q,
    description: e,
    task: e,
    classes: []
  };
  Y.push(t);
}, "addTaskOrg"), ot = /* @__PURE__ */ o(function() {
  const e = /* @__PURE__ */ o(function(n) {
    return X[n].processed;
  }, "compileTask");
  let t = !0;
  for (const [n, a] of X.entries())
    e(n), t = t && a.processed;
  return t;
}, "compileTasks"), Vt = {
  clear: xt,
  getCommonDb: mt,
  getDirection: kt,
  setDirection: bt,
  addSection: wt,
  getSections: _t,
  getTasks: vt,
  addTask: $t,
  addTaskOrg: Et,
  addEvent: St
}, Tt = 0, Q = /* @__PURE__ */ o(function(e, t) {
  const n = e.append("rect");
  return n.attr("x", t.x), n.attr("y", t.y), n.attr("fill", t.fill), n.attr("stroke", t.stroke), n.attr("width", t.width), n.attr("height", t.height), n.attr("rx", t.rx), n.attr("ry", t.ry), t.class !== void 0 && n.attr("class", t.class), n;
}, "drawRect"), Gt = /* @__PURE__ */ o(function(e, t) {
  const n = e.append("circle").attr("cx", t.cx).attr("cy", t.cy).attr("class", "face").attr("r", 15).attr("stroke-width", 2).attr("overflow", "visible"), a = e.append("g");
  a.append("circle").attr("cx", t.cx - 15 / 3).attr("cy", t.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"), a.append("circle").attr("cx", t.cx + 15 / 3).attr("cy", t.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
  function r(h) {
    const u = st().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
    h.append("path").attr("class", "mouth").attr("d", u).attr("transform", "translate(" + t.cx + "," + (t.cy + 2) + ")");
  }
  o(r, "smile");
  function l(h) {
    const u = st().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
    h.append("path").attr("class", "mouth").attr("d", u).attr("transform", "translate(" + t.cx + "," + (t.cy + 7) + ")");
  }
  o(l, "sad");
  function c(h) {
    h.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", t.cx - 5).attr("y1", t.cy + 7).attr("x2", t.cx + 5).attr("y2", t.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666");
  }
  return o(c, "ambivalent"), t.score > 3 ? r(a) : t.score < 3 ? l(a) : c(a), n;
}, "drawFace"), Ut = /* @__PURE__ */ o(function(e, t) {
  const n = e.append("circle");
  return n.attr("cx", t.cx), n.attr("cy", t.cy), n.attr("class", "actor-" + t.pos), n.attr("fill", t.fill), n.attr("stroke", t.stroke), n.attr("r", t.r), n.class !== void 0 && n.attr("class", n.class), t.title !== void 0 && n.append("title").text(t.title), n;
}, "drawCircle"), Mt = /* @__PURE__ */ o(function(e, t) {
  const n = t.text.replace(/<br\s*\/?>/gi, " "), a = e.append("text");
  a.attr("x", t.x), a.attr("y", t.y), a.attr("class", "legend"), a.style("text-anchor", t.anchor), t.class !== void 0 && a.attr("class", t.class);
  const r = a.append("tspan");
  return r.attr("x", t.x + t.textMargin * 2), r.text(n), a;
}, "drawText"), qt = /* @__PURE__ */ o(function(e, t) {
  function n(r, l, c, h, u) {
    return r + "," + l + " " + (r + c) + "," + l + " " + (r + c) + "," + (l + h - u) + " " + (r + c - u * 1.2) + "," + (l + h) + " " + r + "," + (l + h);
  }
  o(n, "genPoints");
  const a = e.append("polygon");
  a.attr("points", n(t.x, t.y, 50, 20, 7)), a.attr("class", "labelBox"), t.y = t.y + t.labelMargin, t.x = t.x + 0.5 * t.labelMargin, Mt(e, t);
}, "drawLabel"), Xt = /* @__PURE__ */ o(function(e, t, n) {
  const a = e.append("g"), r = rt();
  r.x = t.x, r.y = t.y, r.fill = t.fill, r.width = n.width, r.height = n.height, r.class = "journey-section section-type-" + t.num, r.rx = 3, r.ry = 3, Q(a, r), Ht(n)(
    t.text,
    a,
    r.x,
    r.y,
    r.width,
    r.height,
    { class: "journey-section section-type-" + t.num },
    n,
    t.colour
  );
}, "drawSection"), tt = -1, Zt = /* @__PURE__ */ o(function(e, t, n, a) {
  const r = t.x + n.width / 2, l = e.append("g");
  tt++, l.append("line").attr("id", a + "-task" + tt).attr("x1", r).attr("y1", t.y).attr("x2", r).attr("y2", 450).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666"), Gt(l, {
    cx: r,
    cy: 300 + (5 - t.score) * 30,
    score: t.score
  });
  const c = rt();
  c.x = t.x, c.y = t.y, c.fill = t.fill, c.width = n.width, c.height = n.height, c.class = "task task-type-" + t.num, c.rx = 3, c.ry = 3, Q(l, c), Ht(n)(
    t.task,
    l,
    c.x,
    c.y,
    c.width,
    c.height,
    { class: "task" },
    n,
    t.colour
  );
}, "drawTask"), Yt = /* @__PURE__ */ o(function(e, t) {
  Q(e, {
    x: t.startx,
    y: t.starty,
    width: t.stopx - t.startx,
    height: t.stopy - t.starty,
    fill: t.fill,
    class: "rect"
  }).lower();
}, "drawBackgroundRect"), Qt = /* @__PURE__ */ o(function() {
  return {
    x: 0,
    y: 0,
    fill: void 0,
    "text-anchor": "start",
    width: 100,
    height: 100,
    textMargin: 0,
    rx: 0,
    ry: 0
  };
}, "getTextObj"), rt = /* @__PURE__ */ o(function() {
  return {
    x: 0,
    y: 0,
    width: 100,
    anchor: "start",
    height: 100,
    rx: 0,
    ry: 0
  };
}, "getNoteRect"), Ht = /* @__PURE__ */ function() {
  function e(r, l, c, h, u, y, b, f) {
    const m = l.append("text").attr("x", c + u / 2).attr("y", h + y / 2 + 5).style("font-color", f).style("text-anchor", "middle").text(r);
    a(m, b);
  }
  o(e, "byText");
  function t(r, l, c, h, u, y, b, f, m) {
    const { taskFontSize: i, taskFontFamily: d } = f, p = r.split(/<br\s*\/?>/gi);
    for (let g = 0; g < p.length; g++) {
      const s = g * i - i * (p.length - 1) / 2, x = l.append("text").attr("x", c + u / 2).attr("y", h).attr("fill", m).style("text-anchor", "middle").style("font-size", i).style("font-family", d);
      x.append("tspan").attr("x", c + u / 2).attr("dy", s).text(p[g]), x.attr("y", h + y / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), a(x, b);
    }
  }
  o(t, "byTspan");
  function n(r, l, c, h, u, y, b, f) {
    const m = l.append("switch"), i = m.append("foreignObject").attr("x", c).attr("y", h).attr("width", u).attr("height", y).attr("position", "fixed").append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
    i.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(r), t(r, m, c, h, u, y, b, f), a(i, b);
  }
  o(n, "byFo");
  function a(r, l) {
    for (const c in l)
      c in l && r.attr(c, l[c]);
  }
  return o(a, "_setTextAttrs"), function(r) {
    return r.textPlacement === "fo" ? n : r.textPlacement === "old" ? e : t;
  };
}(), Jt = /* @__PURE__ */ o(function(e, t) {
  Tt = 0, tt = -1, e.append("defs").append("marker").attr("id", t + "-arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z");
}, "initGraphics");
function it(e, t) {
  e.each(function() {
    var n = Z(this), a = n.text().split(/(\s+|<br>)/).reverse(), r, l = [], c = 1.1, h = n.attr("y"), u = parseFloat(n.attr("dy")), y = n.text(null).append("tspan").attr("x", 0).attr("y", h).attr("dy", u + "em");
    for (let b = 0; b < a.length; b++)
      r = a[a.length - 1 - b], l.push(r), y.text(l.join(" ").trim()), (y.node().getComputedTextLength() > t || r === "<br>") && (l.pop(), y.text(l.join(" ").trim()), r === "<br>" ? l = [""] : l = [r], y = n.append("tspan").attr("x", 0).attr("y", h).attr("dy", c + "em").text(r));
  });
}
o(it, "wrap");
var Kt = /* @__PURE__ */ o(function(e, t, n, a, r, l = !1) {
  var c, h, u;
  const { theme: y, look: b } = a, f = y == null ? void 0 : y.includes("redux"), m = ((c = a == null ? void 0 : a.themeVariables) == null ? void 0 : c.THEME_COLOR_LIMIT) ?? 12, i = n % m - 1, d = e.append("g");
  t.section = i, d.attr(
    "class",
    (t.class ? t.class + " " : "") + "timeline-node " + ("section-" + i)
  );
  const p = d.append("g"), g = d.append("g"), s = g.append("text").text(t.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(it, t.width).node().getBBox(), x = (h = a.fontSize) != null && h.replace ? a.fontSize.replace("px", "") : a.fontSize;
  if (t.height = s.height + x * 1.1 * 0.5 + t.padding, t.height = Math.max(t.height, t.maxHeight), t.width = t.width + 2 * t.padding, g.attr("transform", "translate(" + t.width / 2 + ", " + t.padding / 2 + ")"), f && g.attr(
    "transform",
    `translate(${t.width / 2}, ${l ? t.padding / 2 + 3 : t.padding})`
  ), ee(p, t, i, r, a), b === "neo" && (d.attr("data-look", "neo"), f)) {
    const _ = y.includes("dark"), A = ((u = e.node()) == null ? void 0 : u.ownerSVGElement) ?? e.node(), T = Z(A), N = T.attr("id") ?? "", P = N ? `${N}-drop-shadow` : "drop-shadow";
    if (T.select(`#${P}`).empty()) {
      const H = T.select("defs");
      (H.empty() ? T.append("defs") : H).append("filter").attr("id", P).attr("height", "130%").attr("width", "130%").append("feDropShadow").attr("dx", "4").attr("dy", "4").attr("stdDeviation", 0).attr("flood-opacity", _ ? "0.2" : "0.06").attr("flood-color", _ ? "#FFFFFF" : "#000000");
    }
  }
  return t;
}, "drawNode"), te = /* @__PURE__ */ o(function(e, t, n) {
  var a;
  const r = e.append("g"), l = r.append("text").text(t.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(it, t.width).node().getBBox(), c = (a = n.fontSize) != null && a.replace ? n.fontSize.replace("px", "") : n.fontSize;
  return r.remove(), l.height + c * 1.1 * 0.5 + t.padding;
}, "getVirtualNodeHeight"), ee = /* @__PURE__ */ o(function(e, t, n, a, r) {
  const { theme: l } = r, c = l != null && l.includes("redux") ? 0 : 5, h = 5, u = c > 0 ? `M0 ${t.height - h} v${-t.height + 2 * h} q0,-${c},${c},-${c} h${t.width - 2 * h} q${c},0,${c},${c} v${t.height - h} H0 Z` : `M0 ${t.height - h} v${-(t.height - h)} h${t.width} v${t.height} H0 Z`;
  e.append("path").attr("id", a + "-node-" + Tt++).attr("class", "node-bkg node-" + t.type).attr("d", u), l != null && l.includes("redux") || e.append("line").attr("class", "node-line-" + n).attr("x1", 0).attr("y1", t.height).attr("x2", t.width).attr("y2", t.height);
}, "defaultBkg"), B = {
  drawRect: Q,
  drawCircle: Ut,
  drawSection: Xt,
  drawText: Mt,
  drawLabel: qt,
  drawTask: Zt,
  drawBackgroundRect: Yt,
  getTextObj: Qt,
  getNoteRect: rt,
  initGraphics: Jt,
  drawNode: Kt,
  getVirtualNodeHeight: te
}, ne = /* @__PURE__ */ o(function(e, t, n, a) {
  var r, l, c;
  const h = pt(), { look: u, theme: y, themeVariables: b } = h, { useGradient: f, gradientStart: m, gradientStop: i } = b, d = ((r = h.timeline) == null ? void 0 : r.leftMargin) ?? 50;
  k.debug("timeline", a.db);
  const p = h.securityLevel;
  let g;
  p === "sandbox" && (g = Z("#i" + t));
  const s = (p === "sandbox" ? Z(g.nodes()[0].contentDocument.body) : Z("body")).select("#" + t);
  s.append("g");
  const x = a.db.getTasks(), _ = a.db.getCommonDb().getDiagramTitle();
  k.debug("task", x), B.initGraphics(s, t);
  const A = a.db.getSections();
  k.debug("sections", A);
  let T = 0, N = 0, P = 0, H = 0, v = 50 + d, M = 50;
  H = 50;
  let O = 0, z = !0;
  A.forEach(function($) {
    const w = {
      number: O,
      descr: $,
      section: O,
      width: 150,
      padding: 20,
      maxHeight: T
    }, E = B.getVirtualNodeHeight(s, w, h);
    k.debug("sectionHeight before draw", E), T = Math.max(T, E + 20);
  });
  let W = 0, R = 0;
  k.debug("tasks.length", x.length);
  for (const [$, w] of x.entries()) {
    const E = {
      number: $,
      descr: w,
      section: w.section,
      width: 150,
      padding: 20,
      maxHeight: N
    }, I = B.getVirtualNodeHeight(s, E, h);
    k.debug("taskHeight before draw", I), N = Math.max(N, I + 20), W = Math.max(W, w.events.length);
    let S = 0;
    for (const L of w.events) {
      const C = {
        descr: L,
        section: w.section,
        number: w.section,
        width: 150,
        padding: 20,
        maxHeight: 50
      };
      S += B.getVirtualNodeHeight(s, C, h);
    }
    w.events.length > 0 && (S += (w.events.length - 1) * 10), R = Math.max(R, S);
  }
  k.debug("maxSectionHeight before draw", T), k.debug("maxTaskHeight before draw", N), A && A.length > 0 ? A.forEach(($) => {
    const w = x.filter((L) => L.section === $), E = {
      number: O,
      descr: $,
      section: O,
      width: 200 * Math.max(w.length, 1) - 50,
      padding: 20,
      maxHeight: T
    };
    k.debug("sectionNode", E);
    const I = s.append("g"), S = B.drawNode(I, E, O, h, t);
    k.debug("sectionNode output", S), I.attr("transform", `translate(${v}, ${H})`), M += T + 50, w.length > 0 && lt(
      s,
      w,
      O,
      v,
      M,
      N,
      h,
      W,
      R,
      T,
      !1,
      t
    ), v += 200 * Math.max(w.length, 1), M = H, O++;
  }) : (z = !1, lt(
    s,
    x,
    O,
    v,
    M,
    N,
    h,
    W,
    R,
    T,
    !0,
    t
  ));
  const j = s.node().getBBox();
  if (k.debug("bounds", j), _ && s.append("text").text(_).attr("x", u === "neo" ? j.x * 2 + d : j.width / 2 - d).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20), P = z ? T + N + 150 : N + 100, s.append("g").attr("class", "lineWrapper").append("line").attr("x1", d).attr("y1", P).attr("x2", j.width + 3 * d).attr("y2", P).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", `url(#${t}-arrowhead)`), u === "neo" && f && y !== "neutral") {
    const $ = s.select("defs"), w = ($.empty() ? s.append("defs") : $).append("linearGradient").attr("id", s.attr("id") + "-gradient").attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
    w.append("stop").attr("offset", "0%").attr("stop-color", m).attr("stop-opacity", 1), w.append("stop").attr("offset", "100%").attr("stop-color", i).attr("stop-opacity", 1);
  }
  gt(
    void 0,
    s,
    ((l = h.timeline) == null ? void 0 : l.padding) ?? 50,
    ((c = h.timeline) == null ? void 0 : c.useMaxWidth) ?? !1
  );
}, "draw"), lt = /* @__PURE__ */ o(function(e, t, n, a, r, l, c, h, u, y, b, f) {
  var m;
  for (const i of t) {
    const d = {
      descr: i.task,
      section: n,
      number: n,
      width: 150,
      padding: 20,
      maxHeight: l
    };
    k.debug("taskNode", d);
    const p = e.append("g").attr("class", "taskWrapper"), g = B.drawNode(p, d, n, c, f).height;
    if (k.debug("taskHeight after draw", g), p.attr("transform", `translate(${a}, ${r})`), l = Math.max(l, g), i.events) {
      const s = e.append("g").attr("class", "lineWrapper");
      let x = l;
      r += 100, x = x + re(e, i.events, n, a, r, c, f), r -= 100, s.append("line").attr("x1", a + 190 / 2).attr("y1", r + l).attr("x2", a + 190 / 2).attr("y2", r + l + 100 + u + 100).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", `url(#${f}-arrowhead)`).attr("stroke-dasharray", "5,5");
    }
    a = a + 200, b && !((m = c.timeline) != null && m.disableMulticolor) && n++;
  }
  r = r - 10;
}, "drawTasks"), re = /* @__PURE__ */ o(function(e, t, n, a, r, l, c) {
  let h = 0;
  const u = r;
  r = r + 100;
  for (const y of t) {
    const b = {
      descr: y,
      section: n,
      number: n,
      width: 150,
      padding: 20,
      maxHeight: 50
    };
    k.debug("eventNode", b);
    const f = e.append("g").attr("class", "eventWrapper"), m = B.drawNode(f, b, n, l, c, !0).height;
    h = h + m, f.attr("transform", `translate(${a}, ${r})`), r = r + 10 + m;
  }
  return r = u, h;
}, "drawEvents"), ie = {
  setConf: /* @__PURE__ */ o(() => {
  }, "setConf"),
  draw: ne
}, J = 200, V = 5, ae = J + V * 2, at = J + 100, se = at + V * 2, Ct = 10, oe = 0, ct = 20, It = 20, ht = 30, Lt = 50, le = /* @__PURE__ */ o(function(e, t, n, a) {
  var r, l, c, h, u;
  const y = pt(), b = ((r = y.timeline) == null ? void 0 : r.leftMargin) ?? 50;
  k.debug("timeline", a.db);
  const f = Bt(t);
  f.append("g");
  const m = a.db.getTasks(), i = a.db.getCommonDb().getDiagramTitle();
  k.debug("task", m), B.initGraphics(f);
  const d = a.db.getSections();
  k.debug("sections", d);
  let p = 0, g = 0;
  const s = 50 + b;
  let x = 50;
  const _ = x, A = s, T = ae + It, N = se + Lt, P = A + T;
  let H = 0;
  const v = d && d.length > 0, M = v ? P : s + T, O = Math.max(50, T + N - V * 2);
  d.forEach(function(I) {
    const S = {
      number: H,
      descr: I,
      section: H,
      width: O,
      padding: V,
      maxHeight: p
    }, L = B.getVirtualNodeHeight(f, S, y);
    k.debug("sectionHeight before draw", L), p = Math.max(p, L);
  });
  let z = 0;
  k.debug("tasks.length", m.length);
  for (const [I, S] of m.entries()) {
    const L = {
      number: I,
      descr: S,
      section: S.section,
      width: J,
      padding: V,
      maxHeight: g
    }, C = B.getVirtualNodeHeight(f, L, y);
    k.debug("taskHeight before draw", C), g = Math.max(g, C);
    let F = 0;
    for (const G of S.events) {
      const U = {
        descr: G,
        section: S.section,
        number: S.section,
        width: at,
        padding: V,
        maxHeight: 50
      };
      F += B.getVirtualNodeHeight(f, U, y);
    }
    S.events.length > 0 && (F += (S.events.length - 1) * Ct), z = Math.max(z, F) + oe;
  }
  k.debug("maxSectionHeight before draw", p), k.debug("maxTaskHeight before draw", g);
  const W = Math.max(g, z) + ht;
  v ? d.forEach((I) => {
    const S = m.filter((Nt) => Nt.section === I), L = {
      number: H,
      descr: I,
      section: H,
      width: O,
      padding: V,
      maxHeight: p
    };
    k.debug("sectionNode", L);
    const C = f.append("g"), F = B.drawNode(C, L, H, y);
    k.debug("sectionNode output", F);
    const G = M - T;
    C.attr("transform", `translate(${G}, ${x})`);
    const U = x + F.height + ct;
    S.length > 0 && dt(
      f,
      S,
      H,
      M,
      U,
      g,
      y,
      W,
      !1
    );
    const D = S.length, Dt = F.height + ct + W * Math.max(D, 1) - (D > 0 ? ht * 2 : 0);
    x += Dt, H++;
  }) : dt(
    f,
    m,
    H,
    M,
    x,
    g,
    y,
    W,
    !0
  );
  let R = (l = f.node()) == null ? void 0 : l.getBBox();
  if (!R)
    throw new Error("bbox not found");
  if (k.debug("bounds", R), i) {
    if (f.append("text").text(i).attr("x", R.width / 2 - b).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20), R = (c = f.node()) == null ? void 0 : c.getBBox(), !R)
      throw new Error("bbox not found");
    k.debug("bounds after title", R);
  }
  const [j] = Pt(y.fontSize), $ = (j ?? 16) * 2, w = (j ?? 16) * 0.5 + 20, E = f.append("g").attr("class", "lineWrapper");
  E.append("line").attr("x1", M).attr("y1", _ - $).attr("x2", M).attr("y2", R.y + R.height + w).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)"), E.lower(), gt(
    void 0,
    f,
    ((h = y.timeline) == null ? void 0 : h.padding) ?? 50,
    ((u = y.timeline) == null ? void 0 : u.useMaxWidth) ?? !1
  );
}, "draw"), dt = /* @__PURE__ */ o(function(e, t, n, a, r, l, c, h, u) {
  var y;
  for (const b of t) {
    const f = {
      descr: b.task,
      section: n,
      number: n,
      width: J,
      padding: V,
      maxHeight: l
    };
    k.debug("taskNode", f);
    const m = e.append("g").attr("class", "taskWrapper"), i = B.drawNode(m, f, n, c), d = i.height;
    k.debug("taskHeight after draw", d);
    const p = a - It - i.width;
    if (m.attr("transform", `translate(${p}, ${r})`), l = Math.max(l, d), b.events && b.events.length > 0) {
      const g = r, s = a + Lt;
      ce(e, b.events, n, a, s, g, c);
    }
    r = r + h, u && !((y = c.timeline) != null && y.disableMulticolor) && n++;
  }
}, "drawTasks"), ce = /* @__PURE__ */ o(function(e, t, n, a, r, l, c) {
  let h = l;
  for (const u of t) {
    const y = {
      descr: u,
      section: n,
      number: n,
      width: at,
      padding: V,
      maxHeight: 0
    };
    k.debug("eventNode", y);
    const b = e.append("g").attr("class", "eventWrapper"), f = B.drawNode(b, y, n, c).height;
    b.attr("transform", `translate(${r}, ${h})`);
    const m = e.append("g").attr("class", "lineWrapper"), i = h + f / 2;
    m.append("line").attr("x1", a).attr("y1", i).attr("x2", r).attr("y2", i).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", "url(#arrowhead)").attr("stroke-dasharray", "5,5"), h = h + f + Ct;
  }
  return h - l;
}, "drawEvents"), he = {
  setConf: /* @__PURE__ */ o(() => {
  }, "setConf"),
  draw: le
}, de = /* @__PURE__ */ o((e) => {
  var t;
  const { theme: n } = ut(), a = n == null ? void 0 : n.includes("dark"), r = n == null ? void 0 : n.includes("color"), l = ((t = e.svgId) == null ? void 0 : t.replace(/^#/, "")) ?? "", c = l ? `url(#${l}-drop-shadow)` : e.dropShadow ?? "none";
  let h = "";
  for (let u = 0; u < e.THEME_COLOR_LIMIT; u++) {
    const y = `${17 - 3 * u}`, b = r ? e.borderColorArray[u] : e.mainBkg, f = r ? e.borderColorArray[u] : e.nodeBorder;
    h += `
    .section-${u - 1} rect,
    .section-${u - 1} path,
    .section-${u - 1} circle {
      fill: ${a && r ? e.mainBkg : b};
      stroke: ${f};
      stroke-width: ${e.strokeWidth};
      filter: ${c};
    }

    .section-${u - 1} text {
      fill: ${e.nodeBorder};
      font-weight: ${e.fontWeight}
    }

    .node-icon-${u - 1} {
      font-size: 40px;
      color: ${e["cScaleLabel" + u]};
    }

    .section-edge-${u - 1} {
      stroke: ${e["cScale" + u]};
    }

    .edge-depth-${u - 1} {
      stroke-width: ${y};
    }

    .section-${u - 1} line {
      stroke: ${e["cScaleInv" + u]};
      stroke-width: 3;
    }

    .lineWrapper line {
      stroke: ${e.nodeBorder};
      stroke-width:${e.strokeWidth}
    }

    .disabled,
    .disabled circle,
    .disabled text {
      fill: ${e.tertiaryColor ?? "lightgray"};
    }

    .disabled text {
      fill: ${e.clusterBorder ?? "#efefef"};
    }
    `;
  }
  return h;
}, "genReduxSections"), ue = /* @__PURE__ */ o((e) => {
  let t = "";
  for (let n = 0; n < e.THEME_COLOR_LIMIT; n++)
    e["lineColor" + n] = e["lineColor" + n] || e["cScaleInv" + n], Ot(e["lineColor" + n]) ? e["lineColor" + n] = Rt(e["lineColor" + n], 20) : e["lineColor" + n] = At(e["lineColor" + n], 20);
  for (let n = 0; n < e.THEME_COLOR_LIMIT; n++) {
    const a = "" + (17 - 3 * n);
    t += `
    .section-${n - 1} rect, .section-${n - 1} path, .section-${n - 1} circle, .section-${n - 1} path  {
      fill: ${e["cScale" + n]};
    }
    .section-${n - 1} text {
     fill: ${e["cScaleLabel" + n]};
    }
    .node-icon-${n - 1} {
      font-size: 40px;
      color: ${e["cScaleLabel" + n]};
    }
    .section-edge-${n - 1}{
      stroke: ${e["cScale" + n]};
    }
    .edge-depth-${n - 1}{
      stroke-width: ${a};
    }
    .section-${n - 1} line {
      stroke: ${e["cScaleInv" + n]} ;
      stroke-width: 3;
    }

    .lineWrapper line{
      stroke: ${e["cScaleLabel" + n]} ;
    }

    .disabled, .disabled circle, .disabled text {
      fill: ${e.tertiaryColor ?? "lightgray"};
    }
    .disabled text {
      fill: ${e.clusterBorder ?? "#efefef"};
    }
    `;
  }
  return t;
}, "genSections"), pe = /* @__PURE__ */ o((e) => {
  var t;
  const { theme: n } = ut(), a = n == null ? void 0 : n.includes("redux"), r = n === "neutral", l = ((t = e.svgId) == null ? void 0 : t.replace(/^#/, "")) ?? "";
  let c = "";
  if (e.useGradient && l && e.THEME_COLOR_LIMIT && !r)
    for (let h = 0; h < e.THEME_COLOR_LIMIT; h++)
      c += `
      .section-${h - 1}[data-look="neo"] rect,
      .section-${h - 1}[data-look="neo"] path,
      .section-${h - 1}[data-look="neo"] circle {
        fill: ${e.mainBkg};
        stroke: url(#${l}-gradient);
        stroke-width: 2;
      }
      .section-${h - 1}[data-look="neo"] line {
        stroke: url(#${l}-gradient);
        stroke-width: 2;
      }`;
  return `
  .edge {
    stroke-width: 3;
  }
  ${a ? de(e) : ue(e)}
  ${c}
  .section-root rect, .section-root path, .section-root circle  {
    fill: ${e.git0};
  }
  .section-root text {
    fill: ${e.gitBranchLabel0};
  }
  .icon-container {
    height:100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .edge {
    fill: none;
  }
  .eventWrapper  {
   filter: brightness(120%);
  }
`;
}, "getStyles"), ge = pe, fe = {
  setConf: /* @__PURE__ */ o(() => {
  }, "setConf"),
  draw: /* @__PURE__ */ o((e, t, n, a) => {
    var r, l;
    return (((l = (r = a == null ? void 0 : a.db) == null ? void 0 : r.getDirection) == null ? void 0 : l.call(r)) ?? "LR") === "TD" ? he.draw(e, t, n, a) : ie.draw(e, t, n, a);
  }, "draw")
}, xe = {
  db: ft,
  renderer: fe,
  parser: Ft,
  styles: ge
};
export {
  xe as diagram
};
