"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.eventNode = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _icons = require("../icons");
var _type = require("../type");
/**
 * 事件节点，接口之后的节点
 */

var eventNode = exports.eventNode = {
  options: {
    style: {
      fill: "#E6F7FF",
      radius: 8,
      lineWidth: 1,
      stroke: "#1890FF",
      fillOpacity: "0.95"
    },
    stateStyles: {
      hover: {},
      selected: {}
    },
    labelCfg: {
      style: {
        fill: "#000000",
        fontSize: 14,
        fontWeight: 400,
        fillOpacity: "0.7"
      }
    },
    size: [120, 40]
  },
  drawShape: function drawShape(cfg, group) {
    var styles = this.getShapeStyle(cfg);
    var h = styles.height;
    var w = styles.width;
    var keyShape = group.addShape("rect", {
      attrs: (0, _extends2["default"])({
        x: 0,
        y: 0
      }, styles)
    });
    group.addShape("marker", {
      attrs: {
        x: w / 2 - 20,
        y: 0,
        r: 6,
        stroke: "#ff4d4f",
        cursor: "pointer",
        symbol: _icons.COLLAPSE_ICON
      },
      name: _type.FlowEvent.removeItem
    });
    group.addShape("marker", {
      attrs: {
        x: 0,
        y: h / 2 + 7,
        r: 6,
        stroke: "#73d13d",
        cursor: "pointer",
        symbol: _icons.EXPAND_ICON
      },
      // must be assigned in G6 3.3 and later versions. it can be any string you want, but should be unique in a custom item type
      name: _type.FlowEvent.addItem
    });
    return keyShape;
  }
};