import { Q as ft, D as wt, x as M, H as O, al as At, Z as rt, q as w, am as R, d as j, C as L, an as Ct, L as b, T, m as E, w as I, R as ct, $ as mt, t as q, e as y, P as ht, h as Q, a4 as G, aj as bt, ao as Tt, a as H, ap as tt, _ as et, z as ot, aq as Bt, B as S, G as V, ar as Pt, as as vt, at as xt, au as Rt, av as Xt, aw as Vt, ax as dt, r as Lt } from "./am-chart.H2jnOzFc.js";
import { L as J, a as Ot, P as St, N as Gt, C as zt } from "./ProgressPie.DlCwXN17.js";
import { C as yt } from "./ColumnSeries.DGazbfza.js";
import { T as gt } from "./Triangle.BaOef7HV.js";
import { C as ut } from "./Circle.DBa5Ok8V.js";
import { C as kt, E as Mt } from "./EditableAxisLabel.wN0t_G2B.js";
import { ColorPickerButton as Ht, ColorPicker as It } from "./colorPicker.06n6P3aK.js";
import { S as pt } from "./Scrollbar.BdZVb_Z-.js";
class Z extends ft {
}
Z.className = "GanttDateAxis";
Z.classNames = ft.classNames.concat([Z.className]);
class Nt extends wt {
  setupDefaultRules() {
    super.setupDefaultRules();
    const t = this._root.language, i = this._root.interfaceColors, e = this.rule.bind(this), s = t.translate("_date_day_full");
    e("Gantt").setAll({
      editable: !0,
      layout: this._root.verticalLayout,
      colors: At.new(this._root, {}),
      snapThreshold: 0.5,
      linkNewTasks: !0,
      durationUnit: "day",
      sidebarWidth: O(30),
      weekends: [0, 6],
      width: M,
      height: M,
      gridIntervals: {
        year: [
          { timeUnit: "week", count: 1 },
          { timeUnit: "month", count: 1 },
          { timeUnit: "month", count: 2 },
          { timeUnit: "month", count: 6 }
        ],
        month: [
          { timeUnit: "week", count: 1 },
          { timeUnit: "week", count: 2 }
        ],
        week: [
          { timeUnit: "day", count: 1 }
        ],
        day: [
          { timeUnit: "hour", count: 1 },
          { timeUnit: "hour", count: 3 },
          { timeUnit: "hour", count: 6 },
          { timeUnit: "hour", count: 12 }
        ],
        hour: [
          { timeUnit: "minute", count: 1 },
          { timeUnit: "minute", count: 5 },
          { timeUnit: "minute", count: 15 },
          { timeUnit: "minute", count: 30 }
        ]
      }
    }), e("Container", ["zoomcontrols"]).setAll({
      x: O(100),
      centerX: O(100),
      y: 10,
      layout: this._root.verticalLayout
    }), e("XYChart", ["gantt"]).setAll({
      panX: !0,
      panY: !0,
      paddingRight: 0,
      wheelY: "panY"
    });
    {
      const n = e("Rectangle", ["axisresizer"]);
      n.setAll({
        width: 12,
        height: M,
        fillOpacity: 0.05,
        fill: i.get("alternativeBackground"),
        cursorOverStyle: "col-resize",
        interactive: !0
      }), n.states.create("hover", { fillOpacity: 0.1 });
    }
    e("EditableLabel", ["axis"]).setAll({
      paddingBottom: 3,
      paddingTop: 3,
      paddingLeft: 5,
      paddingRight: 5,
      cursorOverStyle: "text"
    }), e("GanttCategoryAxis").setAll({
      maxDeviation: 0,
      zoomOut: !1,
      childShift: 25,
      childCellSize: 0.8,
      minCellHeight: 70
    }), e("GanttCategoryAxisRenderer").setAll({
      inversed: !0,
      minGridDistance: 10
    }), e("GanttDateAxis").setAll({
      maxZoomFactor: 1e7,
      extraMax: 0.03,
      extraMin: 0.02,
      autoZoom: !1,
      //strictMinMaxSelection: false,
      //strictMinMax: false,
      markUnitChange: !1,
      weekLabelLocation: 0.5,
      cursorOverStyle: "pointer",
      gridIntervals: [
        { timeUnit: "hour", count: 1 },
        { timeUnit: "day", count: 1 },
        { timeUnit: "week", count: 1 },
        { timeUnit: "month", count: 1 },
        { timeUnit: "year", count: 1 },
        { timeUnit: "year", count: 2 },
        { timeUnit: "year", count: 5 },
        { timeUnit: "year", count: 10 }
      ],
      dateFormats: {
        hour: t.translate("_date_hour_full"),
        day: t.translate("_date_day"),
        week: s,
        month: t.translate("_date_month_full"),
        year: t.translate("_date_year")
      }
    }), e("GanttDateAxis", ["minor"]).setAll({
      dateFormats: {
        millisecond: "SSS",
        second: "ss",
        minute: "mm",
        hour: t.translate("_date_hour_short"),
        day: "EEEEE",
        week: t.translate("_date_day"),
        month: t.translate("_date_month"),
        year: t.translate("_date_year")
      },
      fillRule: (n) => {
        var o;
        const r = n.get("axisFill");
        if (r) {
          const a = n.component, l = n.get("value", 0), c = n.get("endValue", 0), h = a.getPrivate("baseInterval"), g = a.getPrivate("gridInterval", h), u = (o = a.gantt) === null || o === void 0 ? void 0 : o.get("weekends", [0, 6]);
          if (r.set("visible", !1), g.timeUnit == "day") {
            let d = new Date(l).getDay();
            const m = c - l, v = rt("day", 1);
            u && u.indexOf(d) != -1 && m >= v * 0.9 && m <= v * 1.1 ? r.set("visible", !0) : r.set("visible", !1);
          }
        }
      }
    }), e("GanttDateAxisRenderer").setAll({
      minGridDistance: 150,
      opposite: !0
    }), e("GanttDateAxisRenderer", ["minor"]).setAll({
      minGridDistance: 50,
      opposite: !0
    }), e("Grid", ["cursor", "x"]).setAll({
      forceHidden: !0
    }), e("Grid", ["cursor", "y"]).setAll({
      forceHidden: !0
    }), e("Grid", ["range"]).setAll({
      stroke: i.get("negative"),
      strokeOpacity: 1,
      strokeWidth: 2,
      strokeDasharray: [4, 2]
    }), e("AxisLabel", ["x"]).setAll({
      paddingBottom: 15,
      multiLocation: 0.5
    }), e("EditableAxisLabel").setAll({
      y: w,
      populateText: !0,
      text: "{name}",
      centerY: w,
      oversizedBehavior: "truncate",
      marginRight: 10
    }), e("AxisTick", ["gantt", "renderer", "x"]).setAll({
      strokeOpacity: 0.1,
      visible: !0,
      location: 1,
      length: 29
    }), e("AxisTick", ["gantt", "axis", "y"]).states.create("hover", {
      stroke: i.get("primaryButton"),
      strokeOpacity: 1,
      strokeWidth: 3
    }), e("AxisTick", ["gantt", "renderer", "y"]).setAll({
      strokeOpacity: 0.1,
      visible: !0,
      location: 1
    }), e("Grid", ["gantt", "renderer", "x"]).setAll({
      forceHidden: !0
    });
    {
      const n = e("Grid", ["gantt", "renderer", "x", "minor"]);
      n.setAll({
        forceHidden: !1,
        location: 1
      }), n.states.create("hover", {
        stroke: i.get("primaryButton"),
        strokeOpacity: 1,
        strokeWidth: 2
      });
    }
    e("Grid", ["gantt", "renderer", "y"]).setAll({
      location: 1
    }), e("Container", ["axislabelcontainer"]).setAll({
      minWidth: 150,
      draggable: !0
    }), e("Rectangle", ["axislabelcontainer", "background"]).setAll({
      fill: i.get("alternativeBackground"),
      fillOpacity: 0,
      interactive: !0
    }), e("Rectangle", ["axislabelcontainer", "background"]).states.create("hover", {
      fillOpacity: 0.05
    }), e("Rectangle", ["axislabelcontainer", "background"]).states.create("active", {
      fillOpacity: 0.07
    }), e("EditableLabel", ["categorylabel"]).setAll({
      minWidth: 100,
      multiLine: !1
    }), e("Container", ["axislabelcontrols"]).setAll({
      height: M,
      layout: this._root.horizontalLayout
    }), e("Rectangle", ["gantt", "grip", "axislabel"]).setAll({
      width: 18,
      height: 25,
      cursorOverStyle: "ns-resize",
      interactive: !0,
      centerY: w,
      y: w,
      fillPattern: J.new(this._root, {
        color: i.get("alternativeBackground"),
        colorOpacity: 0.2,
        rotation: 0,
        gap: 3
      })
    }), e("ProgressPie").setAll({
      y: w,
      centerY: 0,
      width: 32,
      height: 32,
      marginLeft: 15,
      cursorOverStyle: "pointer"
    }), e("NumericStepper").setAll({
      y: w,
      centerY: w
    }), e("GanttSeries").setAll({
      linkHorizontalOffset: 25,
      snapCount: 1,
      exactLocationX: !0
    }), e("RoundedRectangle", ["series", "column", "gantt"]).setAll({
      maxHeight: 60,
      draggable: !0,
      cornerRadiusBL: 5,
      cornerRadiusTL: 5,
      cornerRadiusBR: 5,
      cornerRadiusTR: 5,
      fillOpacity: 0.8,
      strokeWidth: 2,
      tooltipY: 0,
      tooltipText: "{name}: {openValueX.formatDate('" + s + "')} - {valueX.formatDate('" + s + "')}"
    }), e("RoundedRectangle", ["column", "series", "gantt"]).states.create("hover", {
      strokeWidth: 3,
      cornerRadiusBL: 0,
      cornerRadiusTL: 0,
      cornerRadiusBR: 0,
      cornerRadiusTR: 0,
      fillOpacity: 1
    }), e("RoundedRectangle", ["column", "series", "gantt"]).states.create("disabled", {
      opacity: 0.2,
      forceInactive: !0
    }), e("RoundedRectangle", ["series", "column", "gantt"]).states.create("hidden", {
      opacity: 0,
      visible: !1,
      strokeOpacity: 0
    }), e("Container", ["columncontainer"]).states.create("disabled", {
      opacity: 0.2,
      forceInactive: !0
    }), e("Container", ["maskedcontainer"]).setAll({
      position: "absolute"
    }), e("RoundedRectangle", ["zerorectangle"]).setAll({
      draggable: !0,
      cornerRadiusBL: 2,
      cornerRadiusTL: 2,
      cornerRadiusBR: 2,
      cornerRadiusTR: 2,
      strokeWidth: 2,
      rotation: 45,
      fillOpacity: 0.8,
      centerX: w,
      centerY: w,
      y: w,
      tooltipText: "{name}: {openValueX.formatDate('" + s + "')}"
    }), e("RoundedRectangle", ["zerorectangle"]).states.create("disabled", {
      opacity: 0.5,
      forceInactive: !0
    }), e("Circle", ["connectorbullet", "start", "gantt"]).setAll({
      strokeWidth: 2,
      strokeOpacity: 1,
      radius: 8,
      y: w,
      fill: i.get("background"),
      stroke: i.get("alternativeBackground"),
      fillOpacity: 1,
      cursorOverStyle: "pointer",
      role: "figure",
      interactive: !0,
      visible: !1
    }), e("Circle", ["connectorbullet", "end", "gantt"]).setAll({
      strokeWidth: 2,
      strokeOpacity: 1,
      radius: 8,
      y: w,
      fill: i.get("background"),
      stroke: i.get("alternativeBackground"),
      fillOpacity: 1,
      cursorOverStyle: "pointer",
      role: "figure",
      interactive: !0
    }), e("Circle", ["connectorbullet", "gantt", "end"]).states.create("hover", {
      scale: 1.2
    }), e("Circle", ["connectorbullet", "gantt", "end"]).states.create("activehover", {
      scale: 1.2,
      strokeWidth: 4
    }), e("Rectangle", ["progressrectangle", "gantt"]).setAll({
      forceInactive: !0,
      width: 1,
      fill: i.get("background"),
      fillOpacity: 0.2,
      strokeOpacity: 0,
      fillPattern: J.new(this._root, {
        width: 3e3,
        height: 100,
        angle: -45,
        gap: 4,
        color: i.get("background")
      })
    }), e("Triangle", ["progressgrip", "gantt"]).setAll({
      draggable: !0,
      cursorOverStyle: "ew-resize",
      width: 22,
      height: 11,
      fill: i.get("background"),
      stroke: i.get("background"),
      strokeOpacity: 0,
      fillOpacity: 1,
      y: M,
      centerY: M
    }), e("Rectangle", ["resizegrip", "start", "gantt"]).setAll({
      width: 9,
      centerX: 19,
      fill: i.get("background"),
      stroke: i.get("alternativeBackground"),
      fillPattern: J.new(this._root, {
        color: i.get("alternativeBackground"),
        colorOpacity: 0.2,
        rotation: 90,
        gap: 2
      }),
      draggable: !0,
      fillOpacity: 0,
      strokeOpacity: 0,
      cursorOverStyle: "ew-resize"
    }), e("Rectangle", ["resizegrip", "end", "gantt"]).setAll({
      width: 9,
      centerX: -10,
      fill: i.get("background"),
      stroke: i.get("alternativeBackground"),
      fillPattern: J.new(this._root, {
        color: i.get("alternativeBackground"),
        colorOpacity: 0.2,
        rotation: 90,
        gap: 2
      }),
      draggable: !0,
      fillOpacity: 0,
      strokeOpacity: 0,
      cursorOverStyle: "ew-resize"
    }), e("Line", ["connectorline", "gantt"]).setAll({
      strokeWidth: 1,
      strokeDasharray: [2, 2],
      strokeOpacity: 1,
      stroke: i.get("alternativeBackground")
    }), e("Triangle", ["connectorarrow", "gantt"]).setAll({
      width: 10,
      height: 10,
      fill: i.get("alternativeBackground"),
      stroke: i.get("alternativeBackground"),
      rotation: 90,
      centerX: w,
      centerY: w,
      fillOpacity: 1,
      strokeOpacity: 1
    }), e("Triangle", ["link", "start"]).setAll({
      forceHidden: !0
    }), e("Link", ["gantt"]).setAll({
      toggleKey: "active",
      cursorOverStyle: "pointer"
    }), e("Link", ["gantt"]).states.create("active", {}), e("Button", ["secondary"]).setAll({
      height: 35,
      marginLeft: 6,
      tooltipX: O(90)
    }), e("Graphics", ["icon", "button", "fixedwidth"]).setAll({
      x: w,
      centerX: w
    }), e("Button", ["fixedwidth"]).setAll({
      width: 35
    }), e("Button", ["zoombutton", "secondary"]).setAll({
      height: 35,
      width: 35,
      y: void 0,
      marginLeft: 0,
      marginBottom: 6,
      tooltipX: O(10)
    });
    {
      const n = e("Graphics", ["icon", "button", "secondary"]);
      n.setAll({
        centerY: w,
        y: w
      }), R(n, "stroke", i, "secondaryButtonText");
    }
    {
      const n = e("Graphics", ["icon", "button", "secondary"]);
      n.states.create("hover", {
        stroke: i.get("alternativeBackground")
      }), n.states.create("active", {
        stroke: i.get("alternativeBackground")
      });
    }
    {
      const n = e("RoundedRectangle", ["background", "secondary", "button"]);
      R(n, "fill", i, "background"), R(n, "stroke", i, "secondaryButton");
    }
    e("RoundedRectangle", ["background", "secondary", "button"]).states.create("hover", {
      strokeOpacity: 1,
      fillOpacity: 0.2,
      fill: i.get("secondaryButtonHover")
    }), e("RoundedRectangle", ["background", "secondary", "button"]).states.create("active", {
      strokeOpacity: 1,
      fillOpacity: 0.2,
      fill: i.get("secondaryButtonActive")
    });
    {
      const n = e("RoundedRectangle", ["background", "secondary", "button"]).states.create("down", { stateAnimationDuration: 0 });
      R(n, "fill", i, "secondaryButtonDown");
    }
    {
      const n = e("Graphics", ["icon", "secondary", "button"]);
      R(n, "stroke", i, "secondaryButton");
    }
    e("Button", ["taskbullet"]).setAll({
      centerX: w,
      centerY: w,
      y: w,
      width: 30,
      height: 30,
      cursorOverStyle: "pointer"
    }), e("Graphics", ["taskbullet", "icon"]).states.create("default", {
      stateAnimationDuration: 0
    }), e("Graphics", ["taskbullet", "icon"]).states.create("hover", {
      fill: i.get("secondaryButtonHover")
    }), e("Graphics", ["taskbullet", "icon"]).states.create("active", {
      fill: i.get("secondaryButton"),
      stateAnimationDuration: 0,
      rotation: 90
    }), e("Graphics", ["taskbullet", "icon"]).states.create("disabled", {
      // draw circle
      marginLeft: 3,
      stateAnimationDuration: 0,
      fill: i.get("secondaryButton"),
      draw: (n) => {
        n.moveTo(0, 0), n.arc(0, 0, 4, 0, 360, !1);
      }
    }), e("RoundedRectangle", ["button", "taskbullet", "background"]).setAll({
      opacity: 0
    }), e("RoundedRectangle", ["button", "taskbullet", "background"]).states.create("default", {
      opacity: 0
    }), e("Button", ["taskbullet"]).states.create("disabled", {
      stateAnimationDuration: 0
    }), e("Graphics", ["taskbullet", "icon"]).setAll({
      fill: i.get("secondaryButton"),
      stateAnimationDuration: 0,
      strokeOpacity: 0,
      y: w,
      // draw triangle that points left
      draw: (n) => {
        n.moveTo(-5, -8), n.lineTo(4, 0), n.lineTo(-5, 8), n.lineTo(-5, -8), n.closePath();
      }
    }), e("Button", ["add"]).setAll({
      width: 35,
      height: 35,
      tooltipText: t.translateAny("Add task"),
      tooltipX: O(90)
    }), e("RoundedRectangle", ["button", "add", "background"]).setAll({
      stroke: i.get("primaryButton"),
      strokeWidth: 0
    }), e("Button", ["edit"]).setAll({
      visible: !1,
      tooltipText: t.translateAny("Edit mode"),
      toggleKey: "active"
    });
    {
      const n = e("Graphics", ["icon", "edit", "button"]);
      n.setAll({
        svgPath: "M 11 -1 L 17 5 L 8 14 L 2 14 L 2 8 L 11 -1 M 7 11 L 15 3 M 5 9 L 13 1 M 2 8 L 5 9 L 5 11 L 7 11 L 8 14 M 2 12 L 4 14"
      }), R(n, "stroke", i, "secondaryButton");
    }
    e("Button", ["expand"]).setAll({
      tooltipText: t.translateAny("Expand all")
    });
    {
      const n = e("Graphics", ["icon", "expand", "button"]);
      n.setAll({
        svgPath: "M -6 -4 L 0 2 L 6 -4 M -6 2 L 0 8 L 6 2"
      }), R(n, "stroke", i, "secondaryButton");
    }
    e("Button", ["collapse"]).setAll({
      tooltipText: t.translateAny("Collapse all")
    });
    {
      const n = e("Graphics", ["icon", "collapse", "button"]);
      n.setAll({
        svgPath: "M -6 6 L 0 0 L 6 6 M -6 0 L 0 -6 L 6 0"
      }), R(n, "stroke", i, "secondaryButton");
    }
    e("Button", ["link"]).setAll({
      tooltipText: t.translateAny("Link new tasks"),
      toggleKey: "active"
    });
    {
      const n = e("Graphics", ["icon", "link", "button"]);
      n.setAll({
        dy: 1,
        svgPath: "M 5 4 L 13 4 C 17 4 17 11 13 11 L 8 11 C 4 11 4 18 8 18 L 16 18 L 14 16 L 14 20 L 16 18"
      }), R(n, "stroke", i, "secondaryButton");
    }
    e("Button", ["clear"]).setAll({
      tooltipText: t.translateAny("Clear all")
    });
    {
      const n = e("Graphics", ["icon", "clear", "button"]);
      n.setAll({
        marginLeft: 1,
        marginRight: 1,
        svgPath: "M 2.4 4 L 4.8 19.2 L 15.2 19.2 L 17.6 4 L 2.4 4 M 5.6 5.6 L 7.2 17.2 M 10 5.6 L 10 17.2 M 14.4 5.6 L 12.8 17.2 M 2.4 3.2 L 17.6 3.2 M 8.4 3.2 L 8.4 1.2 L 12 1.2 L 12 3.2"
      }), R(n, "stroke", i, "secondaryButton");
    }
    e("Button", ["fit"]).setAll({
      tooltipText: t.translateAny("Fit to view")
    });
    {
      const n = e("Graphics", ["icon", "fit", "button"]);
      n.setAll({
        svgPath: "M 8 0 L 2 0 M 6 -4 L 2 0 L 6 4 M -2 0 L -8 0 M -6 -4 L -2 0 L -6 4"
      }), R(n, "stroke", i, "secondaryButton");
    }
    e("Button", ["zoomout"]).setAll({
      tooltipText: t.translateAny("Zoom out")
    });
    {
      const n = e("Graphics", ["icon", "zoomout", "button"]);
      n.setAll({
        svgPath: "M 8 0 L 2 0 M 4 -4 L 8 0 L 4 4 M -2 0 L -8 0 M -4 -4 L -8 0 L -4 4"
      }), R(n, "stroke", i, "secondaryButton");
    }
    e("Button", ["xbutton"]).setAll({
      width: 35,
      height: 35,
      centerX: w,
      centerY: w
    }), e("RoundedRectangle", ["xbutton", "background"]).setAll({
      fillOpacity: 0,
      strokeOpacity: 0
    }), e("Graphics", ["xbutton", "icon"]).setAll({
      fill: i.get("negative"),
      isMeasured: !1,
      forceInactive: !0,
      stroke: j(16777215),
      strokeWidth: 2,
      cursorOverStyle: "pointer",
      centerX: w,
      centerY: w,
      x: w,
      y: w,
      draw: (n) => {
        n.arc(0, 0, 16, 0, Math.PI * 2), n.moveTo(-6, -6), n.lineTo(6, 6), n.moveTo(6, -6), n.lineTo(-6, 6);
      }
    }), e("ColorPickerButton").setAll({
      width: 35,
      height: 35,
      marginLeft: 6,
      tooltipX: O(90),
      tooltipText: t.translateAny("Set color")
    });
  }
}
class it extends yt {
  constructor() {
    super(...arguments), this._xPan = !1, this._yPan = !1, this.linksContainer = this.children.push(L.new(this._root, {})), this.connectorLine = this.children.push(Ct.new(this._root, {
      themeTags: ["connectorline"],
      visible: !1,
      forceInactive: !0
    })), this.connectorArrow = this.children.push(gt.new(this._root, {
      themeTags: ["connectorarrow"],
      visible: !1,
      forceInactive: !0
    })), this.links = this.addDisposer(new b(T.new({}), () => Ot._new(this._root, {
      themeTags: E(this.containers.template.get("themeTags", []), ["link"])
    }, [this.links.template]))), this.containers = this.addDisposer(new b(T.new({}), () => L._new(this._root, {
      position: "absolute",
      themeTagsSelf: ["columncontainer"]
    }, [this.containers.template]))), this.maskedContainers = this.addDisposer(new b(T.new({}), () => L._new(this._root, {
      position: "absolute",
      themeTagsSelf: ["maskedcontainer"]
    }, [this.maskedContainers.template]))), this.startBullets = this.addDisposer(new b(T.new({}), () => ut._new(this._root, {
      x: -1e3,
      themeTagsSelf: ["connectorbullet", "start"]
    }, [this.startBullets.template]))), this.endBullets = this.addDisposer(new b(T.new({}), () => ut._new(this._root, {
      x: -1e3,
      themeTagsSelf: ["connectorbullet", "end"]
    }, [this.endBullets.template]))), this.startGrips = this.addDisposer(new b(T.new({}), () => I._new(this._root, {
      themeTagsSelf: ["resizegrip", "start"]
    }, [this.startGrips.template]))), this.endGrips = this.addDisposer(new b(T.new({}), () => I._new(this._root, {
      themeTagsSelf: ["resizegrip", "end"]
    }, [this.endGrips.template]))), this.zeroRectangles = this.addDisposer(new b(T.new({}), () => ct._new(this._root, {
      themeTagsSelf: ["zerorectangle"]
    }, [this.zeroRectangles.template]))), this.progressRectangles = this.addDisposer(new b(T.new({}), () => I._new(this._root, {
      themeTagsSelf: ["progressrectangle"]
    }, [this.progressRectangles.template]))), this.progressGrips = this.addDisposer(new b(T.new({}), () => gt._new(this._root, {
      themeTagsSelf: ["progressgrip"]
    }, [this.progressGrips.template])));
  }
  _afterNew() {
    this.fields.push("linkTo", "categoryId"), this.valueFields.push("progress", "duration"), this.set("exactLocationX", !0), super._afterNew(), this._disposers.push(this.events.on("globalpointermove", (t) => {
      if (this.connectorLine.isVisible()) {
        const i = this.toLocal(t.point);
        this._updateConnector(i);
      }
    })), this.events.on("globalpointerup", (t) => {
      this.connectorLine.isVisible() && this._endConnector();
    }), this.columns.template.events.on("dragstart", (t) => {
      this._columnDragStartX = t.target.x(), this._columnDragStartY = t.target.y();
    }), this.columns.template.events.on("dragged", (t) => {
      this._handleColumnDragged(t);
    }), this.columns.template.events.on("dragstop", (t) => {
      const i = this.get("xAxis"), e = t.target.dataItem, s = e.get("openValueX", 0);
      let n = i.positionToValue(i.coordinateToPosition(t.target.x()));
      const o = e.get("valueX", 0);
      let r = n - s;
      e.set("openValueX", n), e.set("valueX", o + r), e.set("openValueXWorking", n), e.set("valueXWorking", o + r), this._fixValues(e, "duration"), this._moveChildValues(e, r);
    });
  }
  /**
   * @ignore
   */
  roundValue(t, i) {
    let e = this.gantt.get("snapThreshold", 0.8);
    i && (e = 1 - e);
    const s = this.get("snapCount", 1), o = this.get("xAxis").get("baseInterval");
    return mt(t + this.getUnitDuration() * e, o.timeUnit, o.count * s, this._root);
  }
  /**
   * @ignore
   */
  makeColumn(t, i) {
    const e = super.makeColumn(t, i), s = this.get("yAxis");
    e.events.on("click", () => {
      s.selectDataItem(t.get("categoryAxisDataItem"));
    });
    const n = this.mainContainer.children.push(this.containers.make());
    n._setDataItem(t), this.containers.push(n);
    const o = this.zeroRectangles.make();
    t.set("zeroRectangle", o), this.zeroRectangles.push(o), n.children.unshift(o), t.get("duration", 0) > 0 && o.hide(0);
    let r = 0;
    o.events.on("pointerdown", (p) => {
      r = p.target.y(), e.dragStart(p);
    }), o.events.on("dragstart", (p) => {
      this._handleColumnDragged(p), p.target.setAll({
        x: 0,
        y: r
      });
    }), o.events.on("dragged", (p) => {
      this._handleColumnDragged(p), p.target.setAll({
        x: 0,
        y: r
      });
    }), o.events.on("dragstop", (p) => {
      e.dragStop(p);
    }), o.events.on("pointerover", (p) => {
      this._handleColumnHover(p);
    }), o.adapters.add("fillPattern", (p, x) => x.dataItem.get("progress", 0) < 1 ? c.get("fillPattern") : p);
    const a = n.children.push(this.maskedContainers.make());
    t.setRaw("maskedContainer", a);
    const l = n.children.push(ct.new(this._root, {
      fill: j(16777215),
      forceInactive: !0,
      fillOpacity: 0
    }));
    t.setRaw("mask", l), a.set("mask", l);
    const c = a.children.push(this.progressRectangles.make());
    this.progressRectangles.push(c);
    const h = this.progressGrips.make();
    this.progressGrips.push(h), a.children.push(h), h.events.on("dragged", () => {
      let p = h.x();
      p = q(p, 0, e.getPrivate("width", 0)), h.setAll({ x: p, y: e.getPrivate("height", 0) }), t.set("progress", h.x() / e.getPrivate("width", 0));
    });
    const g = this.startGrips.make();
    this.startGrips.push(g), n.children.push(g);
    const u = this.endGrips.make();
    this.endGrips.push(u), n.children.push(u), t.setRaw("startGrip", g), t.setRaw("endGrip", u);
    const d = this.get("xAxis");
    let m = 0;
    g.events.on("dragstart", () => {
      m = e.x(), e.show(), o.hide(), a.show();
    }), g.events.on("pointerover", () => {
      e.states.applyAnimate("hover");
    }), g.events.on("pointerout", () => {
      e.isVisible() && e.states.applyAnimate("default");
    }), g.events.on("dragged", () => {
      g.set("y", 0);
      const p = g.x() + m;
      let x = d.positionToValue(d.coordinateToPosition(p)), D = this._findMinStart(t);
      x = Math.max(x, D), x = Math.min(x, t.get("valueX", x)), t.set("openValueX", x), g.set("x", 0);
    }), g.events.on("dragstop", () => {
      this._fixValues(t, "end"), this.markDirtyValues();
    });
    let v = 0;
    u.events.on("dragstart", () => {
      v = e.x(), e.show(), o.hide(), a.show();
    }), u.events.on("pointerover", () => {
      e.states.applyAnimate("hover");
    }), u.events.on("pointerout", () => {
      e.isVisible() && e.states.applyAnimate("default");
    }), u.events.on("dragged", () => {
      u.set("y", 0);
      const p = u.x() + v;
      let x = d.positionToValue(d.coordinateToPosition(p));
      x = Math.max(x, t.get("openValueX", 0)), t.set("valueX", x), t.set("valueXWorking", x);
      const D = t.get("graphics");
      D && u.set("x", D.width());
    }), u.events.on("dragstop", () => {
      this._fixValues(t, "start"), this.markDirtyValues();
    });
    const f = this.startBullets.make();
    f.events.on("pointerout", () => {
      e.isVisible() && e.states.applyAnimate("default");
    }), this.startBullets.push(f), n.children.push(f);
    const _ = this.endBullets.make();
    this.endBullets.push(_), n.children.push(_);
    const C = (p) => {
      this._startConnector(p);
    };
    f.events.on("pointerdown", () => C(f)), _.events.on("pointerdown", () => C(_)), e.events.on("pointerover", (p) => {
      this._handleColumnHover(p);
    }), e.events.on("pointerout", () => {
      this._hoveredDataItem = void 0, this.connectorLine.isVisible() && f.hide();
    }), t.setRaw("container", n), t.setRaw("startBullet", f), t.setRaw("endBullet", _), t.setRaw("progressRectangle", c), t.setRaw("progressGrip", h);
    const k = (p, x) => {
      e.on(p, (D) => {
        x.set(p, D);
      });
    };
    return k("x", n), k("y", n), k("dx", n), k("dy", n), k("cornerRadiusBL", l), k("cornerRadiusBR", l), k("cornerRadiusTL", l), k("cornerRadiusTR", l), this.isCollapsed(t) ? (t.hide(0), e.hide(0), a.hide(0)) : t.get("duration", 0) > 0 && (e.appear(), a.appear()), e;
  }
  _handleColumnDragged(t) {
    const i = t.target, e = i.dataItem;
    if (this._columnDragStartY !== void 0 && i.set("y", this._columnDragStartY), e && this._columnDragStartX !== void 0) {
      const s = i.x() - this._columnDragStartX;
      this._dragChildValues(e, s), this._updateLinks();
    }
  }
  _handleColumnHover(t) {
    var i;
    if (!this.connectorLine.isVisible())
      return;
    const s = t.target.dataItem;
    if (!s)
      return;
    const n = s.get("startBullet"), o = (i = this._startBullet) === null || i === void 0 ? void 0 : i.dataItem;
    n && o && this.getDepth(o) === this.getDepth(s) && o !== s && (n.show(), this._hoveredDataItem = s);
  }
  /**
   * Checks if the task is collapsed.
   *
   * @param  dataItem  Data item
   * @return           Collapsed?
   */
  isCollapsed(t) {
    const i = t.get("categoryAxisDataItem");
    if (i) {
      const e = i.get("parent");
      if (e)
        return e.get("collapsed") ? !0 : this.isCollapsed(e);
    }
    return !1;
  }
  /**
   * Updates the series, recalculating values and updating children.
   *
   * @ignore Exclude from docs
   */
  _updateChildren() {
    if (this._valuesDirty) {
      this.setPrivateRaw("minX", void 0), this.setPrivateRaw("maxX", void 0);
      const t = this.get("yAxis"), i = t.get("renderer");
      y(this.dataItems, (s) => {
        const n = s.dataContext, o = s.get("categoryAxisDataItem");
        if (o) {
          const r = s.get("children");
          r && r.length > 0 ? (s.set("openValueX", void 0), s.set("valueX", void 0), s.set("openValueXWorking", void 0), s.set("valueXWorking", void 0), delete n[this.get("openValueXField")], delete n[this.get("durationField")]) : (n[this.get("openValueXField")] = s.get("openValueX"), n[this.get("durationField")] = s.get("duration"), n[this.get("progressField")] = s.get("progress")), n[this.get("linkToField")] = s.get("linkTo");
          const a = s.get("categoryY"), l = this.get("categoryYField", "category");
          n[l] = a;
          const c = o.dataContext, h = t.get("categoryField", "category"), g = o.get("parent");
          c[h] = a, g && (c[t.get("parentIdField", "parentId")] = g.get("id"), c[t.get("collapsedField", "collapsed")] = o.get("collapsed", !1));
        }
      }), y(this.dataItems, (s) => {
        this._adjustParentValues(s);
        const n = s.get("children"), o = s.get("startGrip"), r = s.get("endGrip"), a = s.get("progressGrip");
        let l = !0;
        n && n.length > 0 && (l = !1), o && o.setPrivate("visible", l), r && r.set("visible", l), a && a.set("visible", l);
        const c = s.get("categoryAxisDataItem");
        let h = 0;
        if (c) {
          const f = c.get("durationStepper");
          f && f.set("disabled", !l), h = c.get("index", 0);
        }
        const g = s.get("duration", 0);
        let u = s.get("zeroRectangle");
        const d = s.get("graphics"), m = s.get("maskedContainer"), v = c.get("customColor", c.get("color"));
        if (u) {
          let f = 20, _ = t.indexToPosition(h, 0), C = t.indexToPosition(h, 1);
          _ = i.positionToCoordinate(_), C = i.positionToCoordinate(C);
          const k = d.get("height", 0);
          let p = 1;
          k instanceof ht && (p *= k.value * Q(45)), f = (C - _) * p;
          const x = d.get("maxHeight", 1 / 0) * Q(45), D = d.get("minHeight", 0) * Q(45);
          f = q(f, D, x), u.setPrivate("height", f), u.setPrivate("width", f);
        }
        d && m && !this.isCollapsed(s) && (g === 0 && u ? !d.isHidden() && !d.isHiding() && (u.setAll({
          fill: v,
          stroke: v
        }), !o?.isDragging() && !r?.isDragging() && (d.hide(), m.hide(), u.show())) : (u && u.hide(), d.show(), m.show()));
      }), y(this.dataItems, (s) => {
        this._adjustLinkValues(s);
      }), y(this.dataItems, (s) => {
        this._adjustParentValues(s);
        const n = s.get("categoryAxisDataItem");
        n && (n.set("duration", s.get("duration")), n.set("progress", s.get("progress")));
      });
      const e = "valueschanged";
      this.events.isEnabled(e) && this.events.dispatch(e, {
        type: e,
        target: this
      });
    }
    super._updateChildren(), this._columnsUpdated && this._updateLinks();
  }
  _getParentOpen(t) {
    const i = t.get("parent");
    return i ? this._getParentOpen(i) : t.get("openValueX", -1 / 0);
  }
  _adjustLinkValues(t) {
    const i = t.get("linkTo");
    if (i) {
      const e = t.get("valueX", 0);
      y(i, (s) => {
        const n = this.getDataItemById(s);
        if (n && n !== t) {
          const o = n.get("openValueX", 0);
          o !== void 0 && o < e && (n.set("openValueX", e), this._fixValues(n, "duration"), this._adjustChildValues(n));
        }
      });
    }
  }
  _adjustChildValues(t) {
    const i = t.get("children", []);
    if (i && i.length > 0) {
      let e = t.get("openValueX", 0);
      y(i, (s) => {
        const n = s.get("openValueX", 0);
        (n === void 0 || n < e) && (s.set("openValueX", e), this._fixValues(s, "duration")), this._adjustChildValues(s);
      });
    }
  }
  _dragChildValues(t, i) {
    const e = t.get("children");
    e && e.length > 0 && y(e, (s) => {
      const n = s.get("graphics");
      n && n.set("dx", i), this._dragChildValues(s, i);
    });
  }
  _moveChildValues(t, i) {
    const e = t.get("children");
    e && e.length > 0 && y(e, (s) => {
      s.set("openValueX", s.get("openValueX", 0) + i), s.set("valueX", s.get("valueX", 0) + i), s.set("openValueXWorking", s.get("openValueX")), s.set("valueXWorking", s.get("openValueX"));
      const n = s.get("graphics");
      n && n.set("dx", 0), this._fixValues(s, "duration"), this._moveChildValues(s, i);
    });
  }
  _findMinStart(t) {
    let i = -1 / 0;
    y(this.dataItems, (s) => {
      const n = s.get("linkTo");
      n && y(n, (o) => {
        if (o === t.get("id")) {
          const r = s.get("valueX", 0);
          r > i && (i = r);
        }
      });
    });
    const e = t.get("parent");
    return e && (i = Math.max(i, this._findMinStart(e))), i;
  }
  _adjustParentValues(t) {
    const i = t.get("categoryAxisDataItem");
    if (i) {
      const e = t.get("graphics");
      let s = i.get("customColor", i.get("color"));
      e && e.setAll({
        fill: s,
        stroke: s
      });
      const n = t.get("zeroRectangle");
      n && n.setAll({
        fill: s,
        stroke: s
      });
      const o = t.get("children");
      if (o && o.length > 0) {
        let r = 0;
        y(o, (a) => {
          const l = a.get("progress", 0);
          l !== void 0 && (r += l);
        }), r /= o.length, t.set("progress", r);
      }
      if (i) {
        let r = t.get("valueX"), a = t.get("openValueX");
        const l = t.get("duration", 0);
        r === void 0 && a !== void 0 && (a = this.getOpenValue(a), r = this.getEndValue(a, l), t.setRaw("openValueX", a), t.setRaw("valueX", r));
        let c = t.get("parent");
        if (a !== void 0 && r !== void 0 && c) {
          const h = c.get("openValueX"), g = c.get("valueX");
          (h === void 0 || h > a) && c.set("openValueX", a), (g === void 0 || g < r) && (c.set("valueX", r), c.set("valueXWorking", r)), c.set("duration", this.getDataItemDuration(c)), this._adjustParentValues(c);
        }
      }
    }
  }
  _startConnector(t) {
    var i, e, s, n;
    this._startBullet = t, this.connectorLine.show(), this.connectorArrow.show(), this._xPan = (i = this.chart) === null || i === void 0 ? void 0 : i.get("panX"), this._yPan = (e = this.chart) === null || e === void 0 ? void 0 : e.get("panY"), (s = this.chart) === null || s === void 0 || s.set("panX", !1), (n = this.chart) === null || n === void 0 || n.set("panY", !1);
    const o = t.dataItem, r = this.getDepth(o), a = [];
    y(this.dataItems, (g) => {
      this.getDepth(g) != r && G(a, g);
      const u = o.get("links");
      u && u[g.get("id")] && G(a, g);
    });
    const l = o.get("parent");
    l && y(this.dataItems, (g) => {
      g.get("parent") !== l && G(a, g);
    });
    const c = o.get("id"), h = (g) => {
      y(this.dataItems, (u) => {
        const d = u.get("links");
        d && d[g] && (a.push(u), h(u.get("id")));
      });
    };
    h(c), y(a, (g) => {
      const u = g.get("graphics");
      u && u.states.applyAnimate("disabled");
      const d = g.get("container");
      d && d.states.applyAnimate("disabled");
      const m = g.get("zeroRectangle");
      m && m.states.applyAnimate("disabled");
    });
  }
  _updateConnector(t) {
    var i;
    let e = (i = this._startBullet) === null || i === void 0 ? void 0 : i.toGlobal({ x: 0, y: 0 });
    e && (e = this.toLocal(e), this.connectorLine.setAll({
      segments: [[[{ x: e.x, y: e.y }, { x: t.x, y: t.y }]]]
    }), this.connectorArrow.setAll({
      x: t.x,
      y: t.y,
      rotation: bt(e, t) + 90
    }));
  }
  _endConnector() {
    var t, i, e, s, n;
    let o = (t = this._startBullet) === null || t === void 0 ? void 0 : t.toGlobal({ x: 0, y: 0 });
    if (o) {
      o = this.toLocal(o), this.connectorLine.hide(), this.connectorArrow.hide(), y(this.dataItems, (a) => {
        const l = a.get("graphics");
        l && l.isVisible() && l.states.applyAnimate("default");
        const c = a.get("container");
        c && c.isVisible() && c.states.applyAnimate("default");
        const h = a.get("zeroRectangle");
        h && h.isVisible() && h.states.applyAnimate("default");
      });
      let r = this._hoveredDataItem;
      if (r && r !== ((i = this._startBullet) === null || i === void 0 ? void 0 : i.dataItem)) {
        const a = r.get("id");
        if (a) {
          const l = (e = this._startBullet) === null || e === void 0 ? void 0 : e.dataItem;
          if (l) {
            const c = l.get("linkTo", []);
            Tt(c, a) === -1 && (c.push(a), l.set("linkTo", c), this.markDirtyValues());
          }
        }
      }
      this._updateLinks();
    }
    this.endBullets.each((r) => {
      r.show();
    }), this.startBullets.each((r) => {
      r.hide();
    }), (s = this.chart) === null || s === void 0 || s.set("panX", this._xPan), (n = this.chart) === null || n === void 0 || n.set("panY", this._yPan);
  }
  /**
   * Fixes values of a data item, adjusting start, end, or duration as needed.
   */
  _fixValues(t, i) {
    let e = t.get("valueX"), s = t.get("openValueX"), n = t.get("duration", 0);
    if (H(e) && H(s)) {
      i === "start" ? (e = this.roundValue(e), n = this.getDataItemDuration(t), t.set("duration", n)) : i === "end" ? (s = this.roundValue(s, !0), n = this.getDataItemDuration(t), t.set("duration", n)) : i === "duration" && (s = this.roundValue(s, !0), e = s + n * this.getUnitDuration()), s = this.getOpenValue(s), e = this.getEndValue(s, n);
      const o = this.get("interpolationDuration", 0), r = this.get("interpolationEasing"), a = this.dataItems.indexOf(t);
      a >= this.startIndex() && a <= this.endIndex() ? (t.animate({ key: "openValueXWorking", to: s, duration: o, easing: r }), t.animate({ key: "valueXWorking", to: e, duration: o, easing: r }), t.animate({ key: "openValueX", to: s, duration: o, easing: r }), t.animate({ key: "valueX", to: e, duration: o, easing: r })) : (t.set("openValueXWorking", s), t.set("valueXWorking", e), t.set("openValueX", s), t.set("valueX", e));
    }
  }
  _toggleColumn(t, i) {
    super._toggleColumn(t, i);
    const e = t.get("container");
    e && e.setPrivate("visible", i);
  }
  _afterDataChange() {
    const t = this.get("yAxis");
    y(this.dataItems, (i) => {
      this._fixValues(i, "duration");
      const e = i.get("categoryY");
      if (e) {
        const s = t.dataItems.find((n) => n.get("category") === e);
        i.set("categoryAxisDataItem", s), s && s.on("duration", () => {
          const n = s.get("duration"), o = i.get("children");
          (!o || o.length === 0) && n !== void 0 && (i.set("duration", n), this._fixValues(i, "duration"));
        });
      }
    }), this.get("yAxis").markDirtyTree(), super._afterDataChange();
  }
  _updateLinks() {
    const t = this.get("xAxis"), i = this.get("yAxis"), e = i.get("renderer");
    let s = 0;
    const n = this.endBullets.getIndex(0);
    n && n.isVisible() && (s = n.get("radius", 0));
    let o = O(60), r = 0, a = 1 / 0, l = this.columns.getIndex(0), c = 1;
    if (l) {
      o = l.get("height", 0);
      const h = Q(45);
      o instanceof ht && (c = o.value * h * h), r = l.get("minHeight", 0) * h * h, a = l.get("maxHeight", 1 / 0) * h * h;
    }
    y(this.dataItems, (h) => {
      const g = h.get("linkTo"), u = h.get("categoryAxisDataItem");
      if (g) {
        let d = h.get("links");
        const m = this.get("linkHorizontalOffset", 25);
        y(g, (v) => {
          d || (d = h.set("links", {}));
          let f = d[v];
          f || (f = this.links.make(), d[v] = f, this.links.push(f), this.linksContainer.children.push(f), f.appear(), f.events.on("click", () => {
            if (f.get("active")) {
              this.links.removeValue(f);
              const A = h.get("links");
              A && delete A[v], tt(g, v), this.markDirtyValues(), f.dispose();
            }
          }), f.events.on("globalpointerup", () => {
            f.get("active") && !f.isHover() && f.set("active", !1);
          }));
          const _ = [], C = t.valueToPosition(h.get("valueX", 0)), k = i.categoryToPosition(h.get("categoryY")), p = this.getPoint(C, k);
          let x = { x: p.x + s, y: p.y };
          if (h.get("duration", 0) === 0) {
            let A = i.indexToPosition(u.get("index", 0), 0), B = i.indexToPosition(u.get("index", 0), 1);
            A = e.positionToCoordinate(A), B = e.positionToCoordinate(B);
            let P = (B - A) * c;
            P = q(P, r, a), x.x += P - s;
          }
          _.push(x), _.push({ x: x.x + m, y: x.y });
          const D = this.getDataItemById(v);
          if (D) {
            const A = t.valueToPosition(D.get("openValueX", 0)), B = i.categoryToPosition(D.get("categoryY")), P = this.getPoint(A, B);
            let U = P.x, $ = P.y, Y = { x: U, y: $ };
            if (D.get("duration", 0) === 0) {
              let z = D.get("categoryAxisDataItem");
              if (z) {
                let X = i.indexToPosition(z.get("index", 0), 0), W = i.indexToPosition(z.get("index", 0), 1);
                X = e.positionToCoordinate(X), W = e.positionToCoordinate(W);
                let F = (W - X) * c;
                F = q(F, r, a), Y.x -= F;
              }
            }
            if (Y.x - m < x.x + m) {
              const z = h.get("categoryY"), X = this.get("yAxis");
              if (z) {
                let W = X.categoryToIndex(z);
                const F = X.indexToPosition(W), _t = X.indexToPosition(W, 1);
                if (X && z) {
                  let lt = -1;
                  Y.y > x.y && (lt = 1);
                  let Dt = X.get("renderer").positionToCoordinate(X.categoryToPosition(z) + (_t - F) * lt);
                  _.push({ x: x.x + m, y: Dt });
                }
              }
            }
            _.push({ x: Y.x - m, y: Y.y }), _.push(Y);
          }
          f.set("points", _);
        });
      }
    });
  }
  /**
   * Updates series graphics.
   */
  _updateSeriesGraphics(t, i, e, s, n, o, r, a) {
    super._updateSeriesGraphics(t, i, e, s, n, o, !1, a);
    let l = t.get("left", 0), c = t.get("top", 0), h = t.get("right", 0) - l, g = t.get("bottom", 0) - c;
    const u = t.get("container"), d = t.get("mask"), m = t.get("categoryAxisDataItem"), v = m ? m.get("customColor", m.get("color")) : void 0;
    t.setRaw("name", m.dataContext.name);
    const f = t.get("startBullet");
    f?.setAll({
      x: 0,
      stroke: v
    });
    const _ = t.get("endBullet");
    _?.setAll({
      stroke: v,
      x: h
    }), u && u.setAll({
      x: l,
      y: c,
      width: h,
      height: g
    });
    const C = t.get("maskedContainer");
    C && C.setAll({
      x: 0,
      y: 0,
      width: h,
      height: g
    }), d && d.setAll({
      x: 0,
      y: 0,
      width: h,
      height: g
    });
    const k = t.get("startGrip");
    k && k.setAll({
      height: g
    });
    const p = t.get("endGrip");
    p && p.setAll({
      x: h,
      height: g
    });
    const x = t.get("progressRectangle");
    if (x) {
      const D = t.get("progress", 0), A = h - h * D;
      x.setAll({
        x: h - A,
        width: A,
        height: g
      });
      const B = t.get("progressGrip");
      B && B.setAll({
        x: h - A
      });
      const P = t.get("zeroRectangle");
      P && P.markDirtyKey("fillPattern");
    }
  }
  /**
   * Hides series's data item.
   *
   * @param   dataItem  Data item
   * @param   duration  Animation duration in milliseconds
   * @return            Promise
   */
  hideDataItem(t, i) {
    const e = Object.create(null, {
      hideDataItem: { get: () => super.hideDataItem }
    });
    return et(this, void 0, void 0, function* () {
      const s = [e.hideDataItem.call(this, t, i)], n = t.get("container");
      n && s.push(n.hide(i));
      const o = t.get("links", {});
      o && ot(o, (a, l) => {
        l.hide(i);
      });
      const r = t.get("id");
      r && y(this.dataItems, (a) => {
        const l = a.get("linkTo");
        if (l && l.includes(r)) {
          const c = a.get("links");
          c && c[r] && c[r].hide(i);
        }
      }), yield Promise.all(s);
    });
  }
  /**
   * Shows series's data item.
   *
   * @param   dataItem  Data item
   * @param   duration  Animation duration in milliseconds
   * @return            Promise
   */
  showDataItem(t, i) {
    const e = Object.create(null, {
      showDataItem: { get: () => super.showDataItem }
    });
    return et(this, void 0, void 0, function* () {
      const s = [e.showDataItem.call(this, t, i)], n = t.get("container");
      n && s.push(n.show(i));
      const o = t.get("links", {});
      o && ot(o, (a, l) => {
        l.show(i);
      });
      const r = t.get("id");
      r && y(this.dataItems, (a) => {
        const l = a.get("linkTo");
        if (l && l.includes(r)) {
          const c = a.get("links");
          c && c[r] && c[r].show(i);
        }
      }), yield Promise.all(s);
    });
  }
  /**
   * Disposes a data item and removes it from the series.
   *
   * @param dataItem  Data item
   */
  disposeDataItem(t) {
    super.disposeDataItem(t);
    const i = t.get("container");
    i && (this.containers.removeValue(i), i.dispose());
    const e = t.get("startBullet");
    e && (this.startBullets.removeValue(e), e.dispose());
    const s = t.get("endBullet");
    s && (this.endBullets.removeValue(s), s.dispose());
    const n = t.get("startGrip");
    n && (this.startGrips.removeValue(n), n.dispose());
    const o = t.get("endGrip");
    o && (this.endGrips.removeValue(o), o.dispose());
    const r = t.get("progressRectangle");
    r && (this.progressRectangles.removeValue(r), r.dispose());
    const a = t.get("zeroRectangle");
    a && (this.zeroRectangles.removeValue(a), a.dispose());
    const l = t.get("progressGrip");
    l && (this.progressGrips.removeValue(l), l.dispose()), this.disposeLinks(t);
  }
  /**
   * Disposes all links of a data item and removes them from the series.
   *
   * @param dataItem  Data item
   */
  disposeLinks(t) {
    const i = t.get("links", {});
    i && (ot(i, (s, n) => {
      n.dispose(), delete i[s];
    }), t.set("linkTo", []));
    const e = t.get("id", "");
    e && y(this.dataItems, (s) => {
      const n = s.get("linkTo");
      if (n && n.includes(e)) {
        tt(n, e);
        const o = s.get("links");
        if (o && o[e]) {
          const r = o[e];
          this.links.removeValue(r), delete o[e], r.dispose();
        }
      }
    });
  }
  /**
   * Returns the duration of a data item in units.
   *
   * @param dataItem  Data item
   * @return Duration in units
   */
  getDataItemDuration(t) {
    const i = t.get("openValueX", 0);
    let e = t.get("valueX", 0);
    return Math.round((e - i) / this.getUnitDuration()) - this.getHolidayCount(i, e);
  }
  /**
   * Returns the depth of a data item in the hierarchy.
   *
   * @param dataItem  Data item
   * @return Depth level
   */
  getDepth(t) {
    let i = 0, e = t.get("parent");
    for (; e; )
      i++, e = e.get("parent");
    return i;
  }
  /**
   * Returns the end value of a data item, adjusting for holidays and weekends.
   *
   * @param openValue  Open value in milliseconds
   * @param duration   Duration in units
   * @return           Adjusted end value in milliseconds
   */
  getEndValue(t, i) {
    let e = i;
    const s = this.getUnitDuration();
    if (this.gantt.get("excludeWeekends", !0))
      for (let n = 0; n < e; n++)
        this.isHoliday(t + n * s) && e++;
    return t + e * s;
  }
  /**
   * Returns the open value of a data item, adjusting for holidays and weekends.
   *
   * @param openValue  Open value in milliseconds
   * @return           Adjusted open value
   */
  getOpenValue(t) {
    if (this.gantt.get("excludeWeekends", !0))
      for (; this.isHoliday(t); )
        t += this.getUnitDuration();
    return t;
  }
  /**
   * Returns the duration of a unit in milliseconds.
   *
   * @return Duration in milliseconds
   */
  getUnitDuration() {
    return rt(this.gantt.get("durationUnit", "day"));
  }
  /**
   * Returns the count of holidays between two dates.
   *
   * @param start  Start date in milliseconds
   * @param end    End date in milliseconds
   * @return       Count of holidays
   */
  getHolidayCount(t, i) {
    let e = 0, s = !0;
    for (let n = i; n >= t; n -= this.getUnitDuration())
      this.isHoliday(n) ? !s && this.isHoliday(n) && e++ : s = !1;
    return e;
  }
  /**
       * Checks if a given date is a holiday or weekend.
       *
       * @param value  Date value in milliseconds
       * @return       `true` if the date is a holiday or weekend, otherwise `false`
       */
  isHoliday(t) {
    if (this.gantt.get("excludeWeekends", !0)) {
      const i = this.gantt.get("holidays", []), e = this.gantt.get("weekends", [0, 6]), s = new Date(t);
      if (e.includes(s.getDay()))
        return !0;
      if (i && i.length > 0) {
        let n = !1;
        return Bt(i, (o) => {
          if (o instanceof Date) {
            const r = o.getTime(), a = o.getTime() + rt("day");
            if (t >= r && t < a)
              return n = !0, !1;
          }
          return !0;
        }), n;
      }
    }
    return !1;
  }
}
it.className = "GanttSeries";
it.classNames = yt.classNames.concat([it.className]);
class st extends kt {
  constructor() {
    super(...arguments), this._treeDirty = !1, this.xButton = this.children.push(S.new(this._root, {
      themeTags: ["xbutton"],
      icon: V.new(this._root, {
        themeTags: ["icon"]
      })
    }));
  }
  _afterNew() {
    this.fields.push("parentId", "collapsed", "name"), super._afterNew(), this.events.on("wheel", (r) => {
      this.chart.handleWheel(r);
    }), this.xButton.hide(0);
    const t = this.get("renderer");
    this._firstDataItem = this.makeDataItem({ cellSize: 1e-4 }), t.makeTick(this._firstDataItem, []).set("dy", 0.5), t.makeGrid(this._firstDataItem, []).set("dy", 0.5), this.labelsContainer.setAll({
      maskContent: !0
    });
    const s = this.children.push(I.new(this._root, {
      themeTags: ["axisresizer"]
    }));
    this.axisResizer = s, s.events.on("pointerdown", (r) => {
      this._downX = this.toLocal(r.point).x, this._downW = this.width();
    }), s.events.on("globalpointermove", (r) => {
      if (this._downX !== void 0) {
        const l = this.toLocal(r.point).x - this._downX;
        if (this._downW !== void 0) {
          let c = this._downW + l;
          c = Math.max(c, this.get("minWidth", 100)), this.labelsContainer.set("width", c);
        }
      }
    }), s.events.on("globalpointerup", () => {
      this._downX = void 0;
    });
    const n = t.containers.template;
    n.events.on("dragged", (r) => {
      var a, l;
      this.xButton.hide(0);
      const c = r.target.dataItem, h = r.target;
      if (c) {
        const g = (r.target.y() - o) / this.chart.plotContainer.height() * (this.get("end", 1) - this.get("start", 0));
        c.set("deltaPosition", g);
        const u = (f, _) => {
          const C = f.get("children");
          C && y(C, (k) => {
            k.set("deltaPosition", _), u(k, _);
          });
        };
        u(c, g);
        const d = c.get("tick"), m = c.get("grid"), v = Math.ceil(o - h.y());
        if (d) {
          const f = c.get("children");
          (!f || f.length == 0) && (d.set("dy", v), m && m.set("dy", v));
          const _ = h.y(), C = t.containers;
          this._makeChildOf && ((l = (a = this._makeChildOf.get("container")) === null || a === void 0 ? void 0 : a.get("background")) === null || l === void 0 || l.unhover()), this._makeChildOf = void 0;
          for (let k = 0; k < C.length; k++) {
            const p = C.getIndex(k);
            if (p && p.isVisible() && p !== h) {
              const x = p.dataItem;
              if (x.get("cellSize", 0) > 0) {
                const D = x.get("children");
                if (D && D.indexOf(c) !== -1)
                  continue;
                const A = p.get("background");
                if (A) {
                  const B = p.y();
                  Math.abs(_ + h.height() / 2 - (B + p.height() / 2)) < 5 && (A.hover(), this._makeChildOf = x);
                }
              }
            }
          }
          if (this._makeChildOf)
            this._previousTick && (this._previousTick.unhover(), this._previousTick = void 0);
          else {
            this._previousTick && (this._previousTick.states.applyAnimate("default"), this._previousTick = void 0);
            let k, p = 1 / 0;
            for (let x = t.ticks.length; x >= 0; x--) {
              const D = t.ticks.getIndex(x);
              if (D && d.isVisible()) {
                const A = D.dataItem;
                if (A) {
                  const B = A.get("index", 0);
                  if (B >= this.startIndex() && B <= this.endIndex()) {
                    if (A.get("cellSize", 0) == 0)
                      continue;
                    let P = !1, U = A.get("parent");
                    for (; U; ) {
                      if (U === A) {
                        P = !0;
                        break;
                      }
                      U = U.get("parent");
                    }
                    if (P)
                      continue;
                    const $ = Math.abs(D.y() + D.get("dy", 0) - _ - h.height() / 2);
                    $ < p && (p = $, k = D.dataItem);
                  }
                }
              }
            }
            if (Math.abs(v) < 10 && (k = void 0, this._insertAfter = void 0), k && k !== c) {
              let x = !1, D = k.get("parent");
              for (; D; ) {
                if (D === c) {
                  x = !0;
                  break;
                }
                D = D.get("parent");
              }
              if (x)
                return;
              const A = k.get("tick");
              A && (A.hover(), this._previousTick = A), this._insertAfter = k;
            }
          }
        }
      }
    }), n.events.on("dragstop", (r) => {
      var a, l;
      this._draggedItem = r.target.dataItem, this._sortCategoryAxis(), this._makeChildOf && ((l = (a = this._makeChildOf.get("container")) === null || a === void 0 ? void 0 : a.get("background")) === null || l === void 0 || l.unhover(), this._makeChildOf.get("collapsed") && this.toggleCollapse(this._makeChildOf, !0), this._updateCellSizes()), this.get("renderer").containers.each((h) => {
        h.set("forceInactive", !1);
      });
    });
    let o = 0;
    n.events.on("dragstart", (r) => {
      this.get("renderer").containers.each((l) => {
        l.set("forceInactive", !0);
      }), o = r.target.y();
    });
  }
  _changed() {
    super._changed(), this.isDirty("selectedDataItem") && this.selectDataItem(this.get("selectedDataItem"));
  }
  _processBullet(t) {
    var i, e, s;
    super._processBullet(t);
    const n = t.get("parent");
    n && n.get("collapsed") && ((i = t.get("container")) === null || i === void 0 || i.hide(), (e = t.get("tick")) === null || e === void 0 || e.hide(), (s = t.get("grid")) === null || s === void 0 || s.hide(), t.set("finalCellSize", 0));
  }
  _updateChildren() {
    super._updateChildren(), this._dataChanged && (y(this.dataItems, (e) => {
      var s;
      if (!e.get("parentId")) {
        let o = e.get("customColor", e.get("color"));
        const r = e.dataContext;
        o === void 0 && r && r.color !== void 0 && (o = j(r.color)), o || (o = (s = this.gantt) === null || s === void 0 ? void 0 : s._nextColor()), e.setRaw("color", o);
      }
    }), y(this.dataItems, (e) => {
      const s = e.get("parentId");
      if (s) {
        const n = this.getDataItemById(s);
        if (n) {
          e.setRaw("parent", n), e.setRaw("cellSize", Math.pow(this.get("childCellSize", 1), this._getItemDepth(e))), e.setRaw("finalCellSize", e.get("cellSize"));
          let o = e.get("customColor", e.get("color"));
          const r = e.dataContext;
          o === void 0 && r && r.color !== void 0 && (o = j(r.color)), o == null ? e.setRaw("color", n.get("customColor", n.get("color"))) : e.setRaw("color", o);
          let a = n.get("children");
          a || (a = [], n.set("children", a)), G(a, e);
        }
      } else
        e.setRaw("cellSize", 1), e.setRaw("finalCellSize", 1);
    }), y(this.dataItems, (e) => {
      this.toggleCollapse(e, e.get("collapsed", !1), 0);
    })), this._treeDirty && this._updateTree();
    const t = this.get("renderer"), i = this._firstDataItem;
    i && (t.updateTick(i.get("tick"), 0), t.updateGrid(i.get("grid"), 0)), y(this.dataItems, (e) => {
      const s = e.get("progressPie");
      if (s) {
        const r = e.get("progress", 0);
        s.set("value", r);
        const a = e.get("customColor", e.get("color"));
        e.dataContext.color = a?.toString(), s.slice.set("fill", a), s.backgroundSlice.set("fill", a), s.label.set("fill", a);
      }
      const n = e.get("cellSize", 1), o = e.get("container");
      if (o) {
        n < 1e-4 ? o.setPrivate("visible", !1) : o.setPrivate("visible", !0);
        const r = e.get("index", 0), a = this.indexToPosition(r, 0), l = this.indexToPosition(r, 1), c = t.positionToCoordinate(a), h = t.positionToCoordinate(l);
        o.set("height", Math.abs(h - c));
      }
    });
  }
  _clearDirty() {
    super._clearDirty(), this._treeDirty = !1;
  }
  getSeriesDataItem(t) {
    if (t.get("seriesDataItem"))
      return t.get("seriesDataItem");
    const i = this.gantt;
    if (i) {
      const e = i.series.getDataItemById(t.get("id"));
      if (e)
        return t.set("seriesDataItem", e), e;
    }
  }
  /**
   * Zooms the axis to relative locations.
   *
   * Both `start` and `end` are relative: 0 means start of the axis, 1 - end.
   *
   * @param   start     Relative start
   * @param   end       Relative end
   * @param   duration  Duration of the zoom animation in milliseconds
   * @return            Zoom animation
   */
  zoom(t, i, e) {
    if (this.get("zoomable", !0))
      if (this._updateFinals(t, i), this.get("start") !== t || this.get("end") != i) {
        let s = this._sAnimation, n = this._eAnimation;
        t > i && ([t, i] = [i, t]);
        let o = this.get("maxDeviation", 0.5) * Math.min(1, i - t);
        if (t < -o && (t = -o), i > 1 + o && (i = 1 + o), H(e) || (e = this.get("interpolationDuration", 0)), (s && s.playing && s.to == t || this.get("start") == t) && (n && n.playing && n.to == i || this.get("end") == i))
          return;
        if (e > 0) {
          let r = this.get("interpolationEasing"), a, l;
          if (this.get("start") != t && (a = this.animate({ key: "start", to: t, duration: e, easing: r })), this.get("end") != i && (l = this.animate({ key: "end", to: i, duration: e, easing: r })), this._sAnimation = a, this._eAnimation = l, a)
            return a;
          if (l)
            return l;
        } else
          this.set("start", t), this.set("end", i), this.root.events.once("frameended", () => {
            this.markDirtyKey("start");
          });
      } else
        this._sAnimation && this._sAnimation.stop(), this._eAnimation && this._eAnimation.stop();
  }
  _afterDataChange() {
    super._afterDataChange();
    const t = this.chart;
    if (t) {
      const i = t.plotContainer.height(), e = this.get("minCellHeight", 70), s = Math.floor(i / e);
      this.set("maxZoomCount", s), this.set("minZoomCount", s), this.get("start") == 0 && this.get("end") == 1 && (this.zoomToIndexes(0, s), this._dataChangeDp && this._dataChangeDp.dispose(), this._dataChangeDp = this.root.events.once("frameended", () => {
        this.adjustZoom();
      }));
    }
  }
  markDirtyTree() {
    this._treeDirty = !0, this.markDirty();
  }
  _sortCategoryAxis() {
    var t;
    let i = this._insertAfter;
    const e = this._draggedItem;
    if (this._previousTick && (this._previousTick.states.applyAnimate("default"), this._previousTick = void 0), !e)
      return;
    const s = e.get("parent"), n = this._getItemDepth(e);
    if (this._makeChildOf) {
      if (this._makeChildOf && e !== this._makeChildOf) {
        e.set("parent", this._makeChildOf);
        let a = this._makeChildOf.get("children");
        if (a || (a = this._makeChildOf.set("children", [])), a && !a.includes(e) && a.unshift(e), !e.get("customColor")) {
          const c = this._makeChildOf.get("customColor", this._makeChildOf.get("color"));
          e.setRaw("color", c);
        }
        const l = this.getSeriesDataItem(this._makeChildOf);
        l && l.setAll({
          openValueX: void 0,
          valueX: void 0,
          duration: e.get("duration", 0)
        });
      }
      i = this._makeChildOf;
    } else if (i && e !== i) {
      const a = i.get("children"), l = i.get("parent");
      if (a && a.length > 0 && !i.get("collapsed", !1))
        e.set("parent", i);
      else if (l) {
        const h = l.get("children");
        if (h) {
          const g = h[h.length - 1];
          if (i == g) {
            if (e.get("parent") !== l) {
              const u = l.get("parent");
              u ? u.get("children") && e.set("parent", u) : e.get("parent") !== void 0 && (e.set("parent", void 0), this._setNewColor(e));
            }
          } else
            a && !i.get("collapsed", !1) ? e.set("parent", i) : e.set("parent", l);
        }
      } else
        e.get("parent") !== void 0 && (e.set("parent", void 0), this._setNewColor(e));
      const c = e.get("parent");
      if (c) {
        if (!e.get("customColor")) {
          const g = c.get("customColor", c.get("color"));
          e.setRaw("color", g);
        }
        const h = c.get("children");
        h && (h.indexOf(i) !== -1 ? G(h, e, h.indexOf(i) + 1) : c == i ? h.unshift(e) : h.push(e));
      }
    }
    if (s && s != e.get("parent")) {
      const a = s.get("children");
      a && a.indexOf(e) !== -1 && tt(a, e);
    }
    if (i) {
      const a = this.dataItems.indexOf(i), l = this.dataItems.indexOf(e), c = (h, g) => {
        if (l >= a) {
          g++, G(this.dataItems, h, g);
          const u = h.get("children");
          u && Pt(u, (d) => {
            c(d, g);
          });
        } else {
          G(this.dataItems, h, g);
          const u = h.get("children");
          u && y(u, (d) => {
            c(d, g);
          });
        }
      };
      if (this._getItemDepth(e) != n) {
        const h = this.getSeriesDataItem(e);
        h && ((t = this.gantt) === null || t === void 0 || t.series.disposeLinks(h));
      }
      c(e, a);
    }
    this.markDirtyTree();
    const o = this.get("interpolationEasing"), r = this.get("interpolationDuration", 0);
    y(this.dataItems, (a, l) => {
      var c, h;
      const g = a.get("container");
      if (g) {
        let u = this.coordinateToPosition(g.y() + g.height() / 2), m = this.indexToPosition(l) - a.get("deltaPosition", 0) - u;
        a.set("deltaPosition", -m), a.animate({ key: "deltaPosition", to: 0, duration: r, easing: o }), (c = a.get("tick")) === null || c === void 0 || c.animate({ key: "dy", to: 0, duration: r, easing: o }), (h = a.get("grid")) === null || h === void 0 || h.animate({ key: "dy", to: 0, duration: r, easing: o });
      }
    });
  }
  _setNewColor(t, i) {
    var e;
    i || (i = (e = this.gantt) === null || e === void 0 ? void 0 : e._nextColor()), t.set("color", i);
    const s = t.get("children");
    s && s.length > 0 && y(s, (n) => {
      this._setNewColor(n, i);
    });
  }
  _updateTree() {
    const t = this.gantt;
    t && (y(t.series.dataItems, (i) => {
      i.set("children", []), i.set("parent", void 0);
    }), y(this.dataItems, (i) => {
      const e = i.get("parent");
      if (e) {
        const s = i.get("id"), n = e.get("id"), o = t.series.getDataItemById(s);
        i.set("parentId", n);
        const r = t.series.getDataItemById(n);
        if (o && r) {
          o.set("parent", r);
          let a = r.get("children", []);
          G(a, o);
        }
      }
    }), y(t.series.dataItems, (i) => {
      const e = i.get("children"), s = i.get("startGrip"), n = i.get("endGrip");
      s && n && (!e || e.length === 0 ? (s.set("forceHidden", !1), n.set("forceHidden", !1)) : (s.set("forceHidden", !0), n.set("forceHidden", !0)));
    }), this.data.values.length = 0, t.series.data.values.length = 0, y(this.dataItems, (i, e) => {
      i.setRaw("index", e), this.data.values.push(i.dataContext);
      const s = this.getSeriesDataItem(i);
      s && (t.series.data.values.push(s?.dataContext), G(t.series.dataItems, s));
    }), this._updateCellSizes(), y(this.dataItems, (i) => {
      this._updateBullet(i);
    }));
  }
  _updateCellSizes(t) {
    y(this.dataItems, (i) => {
      t === void 0 && (t = this.get("interpolationDuration", 0));
      const e = this._getItemDepth(i);
      let s = this.get("childCellSize", 1);
      const n = i.get("parent");
      n && n.get("collapsed", !1) && (s = 0), s = Math.pow(s, e), i.get("deleting") && (s = 0), i.get("cellSize", 1) != s && (i.set("finalCellSize", s), i.animate({ key: "cellSize", to: s, duration: t, easing: this.get("interpolationEasing") }));
    }), this._dataChangeDp && this._dataChangeDp.dispose(), this._dataChangeDp = this.root.events.once("frameended", () => {
      this.adjustZoom();
    });
  }
  _updateBullet(t) {
    const i = t.get("taskBullet");
    if (i) {
      const e = this._getItemDepth(t), s = t.get("children");
      i.setAll({
        marginLeft: this.get("childShift", 20) * e
      });
      const n = t.get("collapsed", !1), o = i.get("icon");
      let r = !1;
      s && s.length > 0 && (r = !0), o && (r ? (i.set("disabled", !1), this.root.events.once("frameended", () => {
        i.set("active", !n);
      })) : i.set("disabled", !0));
    }
  }
  /**
   * Toggles collapse state of a data item.
   * @param dataItem
   * @param collapse
   * @param duration
   */
  toggleCollapse(t, i, e) {
    if (t && t.get("collapsed", !1) !== i) {
      const s = t.get("children");
      t.set("collapsed", i), s && s.length > 0 && y(s, (n) => {
        const o = n.get("container"), r = n.get("grid"), a = n.get("tick");
        o && (i ? (o.hide(), r.hide(), a.hide()) : (o.show(), r.show(), a.show()));
        const l = this.gantt;
        if (l && l.series) {
          const h = l.series.dataItems.find((g) => g.get("categoryY") === n.get("category"));
          h && (i ? h.hide() : h.show());
        }
        this.toggleCollapse(n, i, e);
      }), this._updateBullet(t), this._updDP && this._updDP.dispose(), this._updDP = this.root.events.once("frameended", () => {
        this._updateCellSizes(e);
      });
    }
  }
  /**
   * Expands all categories in the axis.
   */
  expandAll() {
    y(this.dataItems, (t) => {
      t.get("collapsed", !1) && this.toggleCollapse(t, !1);
    });
  }
  /**
   * Collapses all categories in the axis.
   */
  collapseAll() {
    y(this.dataItems, (t) => {
      t.get("collapsed", !1) || this.toggleCollapse(t, !0);
    });
  }
  /**
   * Deletes all data items from the axis.
   */
  deleteAll() {
    var t;
    this.data.clear(), (t = this.gantt) === null || t === void 0 || t.series.data.clear(), this.selectDataItem(void 0);
  }
  /**
   * Deletes a data item from the axis.
   *
   * @param dataItem  Data item to delete
   */
  deleteDataItem(t, i) {
    var e;
    const s = (e = this.gantt) === null || e === void 0 ? void 0 : e.series, n = t.get("children");
    if (n && n.length > 0)
      for (let a = n.length - 1; a >= 0; a--)
        this.deleteDataItem(n[a], !0);
    t.set("deleting", !0), i || this._updateCellSizes();
    const o = t.get("container");
    o && o.hide().then(() => {
      s && r && (s.setPrivate("minX", void 0), s.setPrivate("maxX", void 0), s.data.removeValue(r.dataContext)), this.data.removeValue(t.dataContext);
    });
    let r;
    s && (r = this.getSeriesDataItem(t), r && r.hide());
  }
  /**
   * Toggles progress pie for a data item. Toggling means that progress pie
   * will animate to 1 if it was less than 1, or animate to previous progress
   * value if it was 1.
   *
   * @param dataItem  Data item to toggle progress pie for
   */
  toggleProgressPie(t, i) {
    if (t) {
      const e = t.get("children");
      if (e && e.length > 0) {
        const s = t.get("progress", 0);
        let n;
        s !== 1 && (n = 1), y(e, (o) => {
          this.toggleProgressPie(o, n);
        });
      } else {
        const s = this.getSeriesDataItem(t);
        if (s) {
          const n = s.get("progress", 0), o = s.get("prevProgress", 0);
          let r = 1;
          n == 1 && o != null && (r = o), i !== void 0 && (r = i), s.set("prevProgress", n), s.animate({
            key: "progress",
            to: r,
            duration: this.get("interpolationDuration", 0),
            easing: this.get("interpolationEasing")
          });
        }
      }
    }
  }
  /**
   * Sets a custom color for a data item.
   *
   * @param dataItem  Data item to set color for
   * @param c         Color to set
   */
  setDataItemColor(t, i) {
    var e;
    if (t) {
      const s = t.get("color");
      i && s && i.hex === s.hex && (i = void 0), t.set("customColor", i);
      const n = t.get("children");
      n && n.length > 0 && y(n, (o) => {
        this.setDataItemColor(o, i);
      }), (e = this.gantt) === null || e === void 0 || e.series.markDirtyValues();
    }
  }
  /**
   * Hides axis's data item.
   *
   * @param   dataItem  Data item
   * @param   duration  Animation duration in milliseconds
   * @return            Promise
   */
  hideDataItem(t) {
    const i = Object.create(null, {
      hideDataItem: { get: () => super.hideDataItem }
    });
    return et(this, void 0, void 0, function* () {
      const e = i.hideDataItem.call(this, t), s = t.get("container");
      return s && s.hide(), e;
    });
  }
  /**
   * Shows axis's data item.
   *
   * @param   dataItem  Data item
   * @param   duration  Animation duration in milliseconds
   * @return            Promise
   */
  showDataItem(t) {
    const i = Object.create(null, {
      showDataItem: { get: () => super.showDataItem }
    });
    return et(this, void 0, void 0, function* () {
      const e = i.showDataItem.call(this, t), s = t.get("container");
      return s && s.show(), e;
    });
  }
  _toggleFHDataItem(t, i) {
    const e = "forceHidden", s = t.get("container");
    s && s.set(e, i);
  }
  _toggleDataItem(t, i) {
    super._toggleDataItem(t, i);
    const e = t.get("container");
    e && e.set("visible", i);
  }
  /**
   * Disposes a data item.
   *
   * @param dataItem  Data item to dispose
   */
  disposeDataItem(t) {
    super.disposeDataItem(t);
    const i = this.get("renderer"), e = t.get("container");
    e && (i.containers.removeValue(e), e.dispose());
    const s = t.get("progressPie");
    s && (i.progressPies.removeValue(s), s.dispose());
    const n = t.get("grip");
    n && (i.grips.removeValue(n), n.dispose());
    const o = t.get("durationStepper");
    o && (i.durationSteppers.removeValue(o), o.dispose());
    const r = t.get("taskBullet");
    r && (i.taskBullets.removeValue(r), r.dispose());
    const a = t.get("parent");
    if (a) {
      const l = a.get("children");
      l && tt(l, t), this._updateBullet(a);
    }
    this._updateCellSizes();
  }
  /**
   * Selects a data item and shows the delete button. If the data item is
   * already selected, it will unselect it.
   *
   * @param dataItem  Data item to select
   */
  selectDataItem(t) {
    var i, e;
    if (!(!((i = this.gantt) === null || i === void 0) && i.get("editable", !0)))
      return;
    if (t === this.get("selectedDataItem")) {
      this.unselectDataItems();
      return;
    }
    if (this.unselectDataItems(), !t) {
      this.setRaw("selectedDataItem", void 0);
      return;
    }
    const s = t.get("container");
    if (s) {
      const n = s.get("background");
      n && n.set("active", !0);
      const o = t.get("progressPie");
      o?.children.push(this.xButton), this.setRaw("selectedDataItem", t), this._xHideDP && this._xHideDP.dispose(), (e = this.gantt) === null || e === void 0 || e.colorPickerButton.set("color", t.get("customColor", t.get("color"))), this.setTimeout(() => {
        this._xHideDP = this.events.once("globalpointerup", () => {
          this.unselectDataItems();
        });
      }, 200), this._delDp && this._delDp.dispose(), this._delDp = this.xButton.events.once("click", () => {
        const r = this.xButton.parent;
        r && r.children.removeValue(this.xButton), this.deleteDataItem(t), this.unselectDataItems();
      }), this.xButton.show();
    } else
      this.unselectDataItems();
  }
  /**
   * Unselects all data items.
   */
  unselectDataItems() {
    this.setRaw("selectedDataItem", void 0), this.xButton.hide(0), y(this.dataItems, (t) => {
      const i = t.get("container");
      if (i) {
        const e = i.get("background");
        e && e.set("active", !1);
      }
    });
  }
  /**
   * @ignore
   */
  _disposeXHideDP() {
    this._xHideDP && (this._xHideDP.dispose(), this._xHideDP = void 0);
  }
  /**
   * @ignore
   * @param dataItem
   * @returns depth of the data item in the hierarchy
   */
  _getItemDepth(t) {
    let i = 0, e = t.get("parent");
    for (; e; )
      i++, e = e.get("parent");
    return i;
  }
  /**
   * @ignore
   * Overrides original method so that a ghost label is not created.
   */
  _createGhostLabel() {
  }
}
st.className = "GanttCategoryAxis";
st.classNames = kt.classNames.concat([st.className]);
class nt extends vt {
  constructor() {
    super(...arguments), this.labels = this.addDisposer(new b(T.new({}), () => Mt._new(this._root, {
      themeTagsSelf: ["categorylabel"]
    }, [this.labels.template]))), this.containers = this.addDisposer(new b(T.new({}), () => L._new(this._root, {
      themeTagsSelf: ["axislabelcontainer"]
    }, [this.containers.template]))), this.controlsContainers = this.addDisposer(new b(T.new({}), () => L._new(this._root, {
      themeTagsSelf: ["axislabelcontrols"]
    }, [this.controlsContainers.template]))), this.grips = this.addDisposer(new b(T.new({}), () => I._new(this._root, {
      themeTags: E(this.grips.template.get("themeTags", ["grip", "axislabel"]), this.get("themeTags", []))
    }, [this.grips.template]))), this.progressPies = this.addDisposer(new b(T.new({}), () => St._new(this._root, {
      themeTags: E(this.progressPies.template.get("themeTags", ["progresspie"]), this.get("themeTags", []))
    }, [this.progressPies.template]))), this.taskBullets = this.addDisposer(new b(T.new({}), () => S._new(this._root, {
      toggleKey: "active",
      icon: V.new(this._root, {
        themeTags: ["icon"]
      }),
      themeTags: E(this.taskBullets.template.get("themeTags", ["taskbullet"]), this.get("themeTags", []))
    }, [this.taskBullets.template]))), this.durationSteppers = this.addDisposer(new b(T.new({}), () => Gt._new(this._root, {
      themeTags: E(this.durationSteppers.template.get("themeTags", ["durationstepper"]), this.get("themeTags", []))
    }, [this.durationSteppers.template])));
  }
  /**
   * @ignore
   */
  makeLabel(t, i) {
    const e = this.axis, s = this.containers.make(), n = t.dataContext;
    s.set("layout", this._root.horizontalLayout), s.set("width", M), s._setDataItem(t), this.containers.push(s), t.setRaw("container", s);
    const o = s.set("background", I.new(this._root, {
      themeTags: ["background", "axislabelcontainer"],
      interactive: !0
    }));
    o.events.on("click", (v) => {
      e.selectDataItem(v.target.dataItem);
    });
    const r = this.grips.make();
    s.children.push(r), this.grips.push(r), t.setRaw("grip", r);
    const a = this.taskBullets.make();
    s.children.push(a), this.taskBullets.push(a), t.setRaw("taskBullet", a), a.events.on("click", (v) => {
      const f = v.target.dataItem;
      f && e.toggleCollapse(f, !f.get("collapsed", !1));
    });
    const l = s.children.push(L.new(this._root, {
      width: M,
      centerY: w,
      y: w
    })), c = super.makeLabel(t, i);
    l.children.push(c), c.events.on("pointerover", () => {
      o.hover();
    }), c.events.on("pointerout", () => {
      o.unhover();
    }), c.events.on("click", () => {
      c.set("maxWidth", void 0);
    }), s.events.on("boundschanged", () => {
      c.set("maxWidth", l.width());
    });
    let h;
    c.on("active", (v) => {
      v && (h = c.get("text", ""), c.set("text", t.get("name")));
    }), c.on("text", (v) => {
      h != null && v != h && (t.set("name", v), n && (n[this.axis.get("nameField", "name")] = v));
    });
    const g = this.controlsContainers.make();
    this.controlsContainers.push(g), t.setRaw("controlsContainer", g), s.children.push(g);
    const u = this.durationSteppers.make();
    g.children.push(u), t.setRaw("durationStepper", u), this.durationSteppers.push(u), u.on("value", (v) => {
      const f = u.dataItem;
      f && H(v) && f.set("duration", v);
    });
    const d = t.get("duration");
    H(d) && u.set("value", d), t.on("duration", (v) => {
      u.set("value", v);
    });
    const m = this.progressPies.make();
    return g.children.push(m), t.setRaw("progressPie", m), m.events.on("click", (v) => {
      this.axis.toggleProgressPie(v.target.dataItem);
    }), this.progressPies.push(m), this.axis.labelsContainer.children.moveValue(s, 0), e._updateBullet(t), s.appear(), c;
  }
  /**
   * @ignore
   */
  updateLabel(t, i, e) {
    if (t) {
      const s = t.dataItem;
      if (s) {
        const n = s.get("container");
        n && (H(i) || (i = 0), H(e) && e != i && (i = i + (e - i) * 0), n.set("y", this.positionToCoordinate(i)), this.toggleVisibility(n, i, t.get("minPosition", 0), t.get("maxPosition", 1)));
      }
    }
  }
  /**
   * @ignore
   */
  updateTick(t, i, e, s) {
    super.updateTick(t, i, e, s), t && t.set("length", -this.axis.labelsContainer.width());
  }
}
nt.className = "GanttCategoryAxisRenderer";
nt.classNames = vt.classNames.concat([nt.className]);
class K extends xt {
}
K.className = "GanttDateAxisRenderer";
K.classNames = xt.classNames.concat([K.className]);
class at extends L {
  constructor() {
    super(...arguments), this.scrollbarX = pt.new(this._root, {
      orientation: "horizontal"
    }), this.scrollbarY = pt.new(this._root, {
      orientation: "vertical"
    }), this.controls = L.new(this._root, {
      themeTags: ["controls"],
      layout: this._root.horizontalLayout
    }), this.zoomControls = L.new(this._root, {
      themeTagsSelf: ["zoomcontrols"]
    }), this.addButton = this.controls.children.push(S.new(this._root, {
      themeTags: ["add", "plus"],
      tooltip: this.root.systemTooltip,
      icon: V.new(this._root, { themeTags: ["icon"] })
    })), this.colorPickerButton = this.controls.children.push(Ht.new(this._root, {
      disableOpacity: !0,
      tooltip: this.root.systemTooltip
    })), this.expandButton = this.controls.children.push(S.new(this._root, {
      themeTags: ["expand", "secondary", "fixedwidth"],
      icon: V.new(this._root, { themeTags: ["icon"] }),
      tooltip: this.root.systemTooltip
    })), this.collapseButton = this.controls.children.push(S.new(this._root, {
      themeTags: ["collapse", "secondary", "fixedwidth"],
      icon: V.new(this._root, { themeTags: ["icon"] }),
      tooltip: this.root.systemTooltip
    })), this.linkButton = this.controls.children.push(S.new(this._root, {
      themeTags: ["link", "secondary", "fixedwidth"],
      icon: V.new(this._root, { themeTags: ["icon"] }),
      tooltip: this.root.systemTooltip
    })), this.fitButton = this.zoomControls.children.push(S.new(this._root, {
      themeTags: ["fit", "secondary", "zoombutton"],
      icon: V.new(this._root, { themeTags: ["icon"] }),
      tooltip: this.root.systemTooltip
    })), this.zoomOutButton = this.zoomControls.children.push(S.new(this._root, {
      themeTags: ["zoomout", "secondary", "zoombutton"],
      icon: V.new(this._root, { themeTags: ["icon"] }),
      tooltip: this.root.systemTooltip
    })), this.editButton = this.controls.children.push(S.new(this._root, {
      themeTags: ["edit", "secondary", "fixedwidth"],
      icon: V.new(this._root, { themeTags: ["icon"] }),
      tooltip: this.root.systemTooltip
    })), this.clearButton = this.controls.children.push(zt.new(this._root, {
      themeTags: ["clear", "secondary", "confirm"],
      icon: V.new(this._root, { themeTags: ["icon"] }),
      tooltip: this.root.systemTooltip,
      active: !1
    })), this.colorPicker = this.children.push(It.new(this._root, { visible: !1 }));
  }
  _applyThemes(t = !1) {
    const i = this.get("colors");
    return i && i.reset(), super._applyThemes(t);
  }
  _afterNew() {
    this.addTag("gantt"), this._defaultThemes.push(Nt.new(this._root)), super._afterNew();
    const t = this._root;
    this.colorPickerButton.events.on("click", () => {
      this.yAxis.xButton.hide(0), this.colorPicker.setAll({
        colorButton: this.colorPickerButton
      }), this.children.moveValue(this.colorPicker, this.children.length - 1), this.yAxis._disposeXHideDP();
    }), this.colorPicker.events.on("colorchanged", () => {
      this._customColor = this.colorPicker.get("color"), this.yAxis.unselectDataItems();
    }), this.addButton.events.on("click", () => {
      this.addNewTask();
    });
    const i = this.children.push(Rt.new(t, {}));
    i.plotContainer.children.push(this.zoomControls), i.zoomOutButton.set("forceHidden", !0), i.children.push(this.controls), i.set("cursor", Xt.new(t, {
      xAxis: this.xAxis,
      yAxis: this.yAxis
    }));
    const e = nt.new(t, {});
    e.containers.template.adapters.add("x", () => 0);
    const s = i.yAxes.push(st.new(t, {
      categoryField: "id",
      cellSizeField: "cellSize",
      collapsedField: "collapsed",
      parentIdField: "parentId",
      colorField: "color",
      idField: "id",
      nameField: "name",
      renderer: e
    }));
    s.gantt = this, s.events.on("boundschanged", () => {
      this._updateScrollbar();
    }), i.plotContainer.events.on("boundschanged", () => {
      this._updateScrollbar();
    }), this.on("visible", () => {
      this.root.events.once("frameended", () => {
        this._updateScrollbar();
      });
    });
    const n = K.new(t, { themeTags: ["minor"] });
    n.grid.template.adapters.add("forceHidden", (d, m) => {
      const v = m.dataItem;
      return v && v.get("active") ? !0 : d;
    });
    const o = i.xAxes.push(Z.new(t, {
      themeTags: ["minor"],
      baseInterval: { timeUnit: "day", count: 1 },
      renderer: n,
      background: I.new(t, {
        fill: j(4095),
        fillOpacity: 0
      })
    }));
    o.gantt = this, o.events.on("pointerout", () => {
      n.grid.each((d) => {
        d.unhover();
      });
    }), o.events.on("click", () => {
      if (r) {
        const d = r.dataItem;
        if (d) {
          const m = d.get("endValue");
          if (m !== void 0) {
            let v = !1;
            o.axisRanges.each((f) => {
              f.get("value") === m && (this.unmarkDate(m), v = !0);
            }), v || (d.set("active", !0), this.markDate(m));
          }
        }
      }
    });
    let r;
    o.events.on("globalpointermove", (d) => {
      if (o.isHover()) {
        const m = o.toLocal({ x: d.point.x, y: d.point.y });
        let v = 1 / 0;
        n.grid.each((f) => {
          if (f.isVisible()) {
            const _ = f.dataItem;
            if (_ && !_.get("isRange")) {
              let C = Math.abs(f.x() - m.x);
              f.get("active") || f.unhover(), C < v && (v = C, r = f);
            }
          }
        }), r && r.hover();
      }
    });
    const a = K.new(t, {}), l = i.xAxes.push(Z.new(t, {
      baseInterval: { timeUnit: "day", count: 1 },
      renderer: a,
      tooltip: Vt.new(t, {})
    }));
    l.gantt = this, l.onPrivate("min", (d) => {
      o.setPrivate("min", d);
    }), l.onPrivate("max", (d) => {
      o.setPrivate("max", d);
    }), l.on("start", (d) => {
      o.set("start", d);
    }), l.on("end", (d) => {
      o.set("end", d);
    });
    const c = l.baseDuration();
    l.getPrivate("min") === void 0 && l.setPrivate("min", (/* @__PURE__ */ new Date()).getTime()), l.getPrivate("max") === void 0 && l.setPrivate("max", (/* @__PURE__ */ new Date()).getTime() + c * 3), l.onPrivate("gridInterval", (d) => {
      const m = this.get("gridIntervals");
      m && m[d.timeUnit] && o.set("gridIntervals", m[d.timeUnit]);
    });
    var h = i.series.push(it.new(t, {
      xAxis: l,
      yAxis: s,
      baseAxis: s,
      openValueXField: "start",
      valueXField: "end",
      progressField: "progress",
      durationField: "duration",
      linkToField: "linkTo",
      categoryYField: "id",
      idField: "id"
    }));
    h.gantt = this, this.scrollbarX = i.set("scrollbarX", this.scrollbarX), this.scrollbarY = i.set("scrollbarY", this.scrollbarY), this.scrollbarY.startGrip.set("forceHidden", !0), this.scrollbarY.endGrip.set("forceHidden", !0), this.children.push(this.scrollbarX), this.xyChart = i, this.series = h, this.xAxis = l, this.yAxis = s, this.xAxisMinor = o;
    const g = "valueschanged";
    this.series.events.on(g, () => {
      this.get("editable") && this.events.isEnabled(g) && this.events.dispatch(g, { type: g, target: this });
    }), this.expandButton.events.on("click", () => {
      this.yAxis.expandAll();
    }), this.collapseButton.events.on("click", () => {
      this.yAxis.collapseAll();
    }), this.clearButton.events.on("confirmed", () => {
      this.clearAll();
    }), this.linkButton.on("active", (d) => {
      this.set("linkNewTasks", d);
    }), this.colorPicker.on("color", (d) => {
      this.yAxis.setDataItemColor(this.yAxis.get("selectedDataItem"), d);
    }), this.editButton.on("active", (d) => {
      this.set("editable", d);
    }), this.fitButton.events.on("click", () => {
      let d = h.getPrivate("selectionMinX", 0), m = h.getPrivate("selectionMaxX", 0);
      const v = l.get("extraMin", 0.1), f = l.get("extraMax", 0.1);
      l.zoomToValues(d - (m - d) * v, m + (m - d) * f);
    }), this.zoomOutButton.events.on("click", () => {
      l.zoom(0, 1);
    });
    let u = !1;
    for (let d = 0; d < dt.licenses.length; d++)
      dt.licenses[d].match(/^AM5G.{5,}/i) && (u = !0);
    u ? this._root._licenseApplied() : this._root._showBranding();
  }
  // end _afterNew()
  _prepareChildren() {
    super._prepareChildren(), this.isDirty("editable") && this._toggleEditable(this.get("editable", !0));
  }
  clearAll() {
    var t;
    this.yAxis.deleteAll(), this._customColor = void 0, (t = this.get("colors")) === null || t === void 0 || t.reset(), this.colorPickerButton.set("color", void 0), this._nextColor();
    const i = /* @__PURE__ */ new Date();
    i.setHours(0, 0, 0, 0), this.xAxis.setPrivate("min", i.getTime()), this.xAxis.setPrivate("max", i.getTime() + this.xAxis.baseDuration() * 5);
    for (let e = this.xAxisMinor.axisRanges.length - 1; e >= 0; e--) {
      const s = this.xAxisMinor.axisRanges.getIndex(e);
      s && this.unmarkDate(s.get("value"));
    }
  }
  _updateChildren() {
    if (super._updateChildren(), this.isDirty("linkNewTasks") && this.linkButton.set("active", this.get("linkNewTasks", !1)), this.isDirty("editable") && this.editButton.set("active", this.get("editable", !0)), this._sizeDirty || this.isDirty("sidebarWidth")) {
      let t = Lt(this.get("sidebarWidth", O(20)), this.innerWidth());
      t = Math.max(t, this.yAxis.get("minWidth", 100)), this.yAxis.labelsContainer.set("width", t), this._updateScrollbar();
    }
    if (this.isDirty("durationUnit")) {
      const t = this.get("durationUnit");
      t && (this.xAxis.set("baseInterval", { timeUnit: t, count: 1 }), this.xAxisMinor.set("baseInterval", { timeUnit: t, count: 1 }));
    }
    this.colorPickerButton.getPrivate("color") === void 0 && this._nextColor();
  }
  _updateScrollbar() {
    const t = this.xyChart.plotContainer.toGlobal({ x: 0, y: 0 });
    this.scrollbarX.setAll({
      x: t.x,
      width: this.xyChart.plotContainer.width()
    });
  }
  /**
   * Adds a new task to the Gantt chart.
   *
   * @param category        The category name for the task. If not provided, will be auto-generated.
   * @param start           The start time of the task in milliseconds. If not provided, will be determined based on context.
   * @param duration        The duration of the task. If not provided, defaults to 1.
   * @param parentId        The parent category if this is a subtask.
   * @param progress        The initial progress of the task (0-1). Defaults to 0.
   * @param linkToPrevious  Should the task automatically link to the previous one?
   */
  addNewTask(t, i, e = 1, s, n = 0, o) {
    let r = this.series.dataItems.length, a = this.yAxis.dataItems.length;
    y(this.yAxis.dataItems, (p) => {
      p.get("id") == "gantt_" + a && a++;
    });
    const l = "gantt_" + a;
    t || (t = "New Task"), o === void 0 && (o = this.get("linkNewTasks", !1));
    let c;
    s != null ? c = this.yAxis.getDataItemById(s) : c = this.yAxis.get("selectedDataItem");
    let h = 0;
    if (c) {
      if (s = c.get("id"), s && i === void 0) {
        const x = this.series.getDataItemById(s);
        x && (i = x.get("valueX", (/* @__PURE__ */ new Date()).getTime()));
      }
      let p = c.get("children");
      p || (p = c.set("children", [])), h = p.length;
    }
    i === void 0 && (i = mt(this.xAxis.getPrivate("min", 0), this.get("durationUnit", "day"), 1, this.root), this.series.dataItems.length > 0 && (i = this.series.dataItems[r - 1].get("valueX", (/* @__PURE__ */ new Date()).getTime())));
    const g = {
      name: t,
      id: l
    };
    s && (g.parentId = s);
    let u = 0, d;
    if (c) {
      u = this.yAxis.dataItems.indexOf(c) + 1 + h;
      const p = c.get("children", []);
      let x = this.yAxis.dataItems.length;
      u >= x ? (p.length > 0 && (d = p[p.length - 1]), this.yAxis.data.push(g)) : (p.length > 0 && (d = this.yAxis.dataItems[u - 1]), this.yAxis.data.insertIndex(u, g)), u++;
    } else {
      for (let p = this.yAxis.dataItems.length - 1; p >= 0; p--) {
        const x = this.yAxis.dataItems[p];
        if (!x.get("parentId")) {
          d = x;
          break;
        }
      }
      this.yAxis.data.push(g), u = this.yAxis.dataItems.length;
    }
    const m = this.xAxis.baseDuration(), v = {
      start: i,
      end: i + 1,
      duration: e,
      progress: n,
      id: l,
      name: t
    };
    if (o && d) {
      const p = this.series.getDataItemById(d.get("id"));
      if (p) {
        const x = p.get("linkTo", []);
        x.includes(l) || (x.push(l), p.set("linkTo", x));
      }
    }
    this.series.data.moveValue(v, u - 1), this.series.dataItems[u - 1].animate({ key: "valueX", to: i + m * e, duration: this.series.get("interpolationDuration", 0), easing: this.series.get("interpolationEasing") }), this.yAxis._disposeXHideDP(), this.yAxis.xButton.hide(0);
    const _ = this.yAxis.get("maxZoomCount", 20);
    let C = Math.max(0, Math.round(u - _ / 2)), k = C + _;
    r = this.yAxis.dataItems.length, k > r && (k = r, C = Math.max(0, k - _)), this.yAxis.zoomToIndexes(C, k), this.yAxis.adjustZoom();
  }
  // Get next color from the color set
  _nextColor() {
    var t;
    if (this._customColor)
      return this._customColor;
    const i = (t = this.get("colors")) === null || t === void 0 ? void 0 : t.next();
    return this.colorPickerButton.setPrivate("color", i), i;
  }
  /**
   * Marks a date on the minor date axis.
   *
   * @param date  Date to be marked
   */
  markDate(t) {
    const i = this.xAxisMinor, e = i.createAxisRange(i.makeDataItem({
      value: t
    })), s = "datemarked";
    this.events.isEnabled(s) && this.events.dispatch(s, { type: s, target: this, dataItem: e, date: t });
  }
  /**
   * Unmarks a date on the minor date axis.
   *
   * @param date  Date to be unmarked
   */
  unmarkDate(t) {
    const i = this.xAxisMinor;
    let e;
    i.axisRanges.each((n) => {
      n && n.get("value") === t && (i.axisRanges.removeValue(n), e = n);
    });
    const s = "dateunmarked";
    this.events.isEnabled(s) && this.events.dispatch(s, { type: s, target: this, dataItem: e, date: t });
  }
  _toggleEditable(t) {
    const i = "forceHidden", e = "forceInactive", s = "draggable";
    this.series.markDirtyValues(), this.addButton.set(i, !t), this.colorPickerButton.set(i, !t), this.clearButton.set(i, !t), this.linkButton.set(i, !t);
    const n = this.yAxis.get("renderer");
    n.labels.template.set(e, !t), n.grips.template.set(i, !t), n.containers.template.set(s, t), n.controlsContainers.template.set(e, !t), this.series.columns.template.set(s, t), this.series.startGrips.template.set(i, !t), this.series.endGrips.template.set(i, !t), this.series.progressGrips.template.set(i, !t), this.series.startBullets.template.set(i, !t), this.series.endBullets.template.set(i, !t), this.series.links.template.set(e, !t), this.xAxisMinor.set(e, !t);
  }
}
at.className = "Gantt";
at.classNames = L.classNames.concat([at.className]);
export {
  Nt as DefaultTheme,
  at as Gantt,
  st as GanttCategoryAxis,
  nt as GanttCategoryAxisRenderer,
  Z as GanttDateAxis,
  K as GanttDateAxisRenderer,
  it as GanttSeries
};
