"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const index_esm = require("../../../min-dash/dist/index.esm.js");
const ModelUtil = require("../util/ModelUtil.js");
const RenderUtil = require("../../../diagram-js/lib/util/RenderUtil.js");
var m = "hsl(225, 10%, 15%)";
function x(t, n, i) {
  function c(o, l) {
    return index_esm.every(l, function(e, h) {
      return o[h] == e;
    });
  }
  return index_esm.some(t.eventDefinitions, function(o) {
    return o.$type === n && c(t, i);
  });
}
function P(t) {
  return t.$type === "bpmn:IntermediateThrowEvent" || t.$type === "bpmn:EndEvent";
}
function C(t) {
  var n = t.dataObjectRef;
  return t.isCollection || n && n.isCollection;
}
function E(t) {
  return t.businessObject;
}
function k(t, n) {
  var i = ModelUtil.getDi(t);
  return i.get("color:background-color") || i.get("bioc:fill") || n || "white";
}
function u(t, n) {
  var i = ModelUtil.getDi(t);
  return i.get("color:border-color") || i.get("bioc:stroke") || n || m;
}
function z(t, n, i) {
  var c = ModelUtil.getDi(t), o = c.get("label");
  return o && o.get("color:color") || n || u(t, i);
}
function M(t) {
  var n = t.x + t.width / 2, i = t.y + t.height / 2, c = t.width / 2, o = [
    ["M", n, i],
    ["m", 0, -c],
    ["a", c, c, 0, 1, 1, 0, 2 * c],
    ["a", c, c, 0, 1, 1, 0, -2 * c],
    ["z"]
  ];
  return RenderUtil.componentsToPath(o);
}
function T$1(t, n) {
  var i = t.x, c = t.y, o = t.width, l = t.height, e = [
    ["M", i + n, c],
    ["l", o - n * 2, 0],
    ["a", n, n, 0, 0, 1, n, n],
    ["l", 0, l - n * 2],
    ["a", n, n, 0, 0, 1, -n, n],
    ["l", n * 2 - o, 0],
    ["a", n, n, 0, 0, 1, -n, -n],
    ["l", 0, n * 2 - l],
    ["a", n, n, 0, 0, 1, n, -n],
    ["z"]
  ];
  return RenderUtil.componentsToPath(e);
}
function j(t) {
  var n = t.width, i = t.height, c = t.x, o = t.y, l = n / 2, e = i / 2, h = [
    ["M", c + l, o],
    ["l", l, e],
    ["l", -l, e],
    ["l", -l, -e],
    ["z"]
  ];
  return RenderUtil.componentsToPath(h);
}
function D(t) {
  var n = t.x, i = t.y, c = t.width, o = t.height, l = [
    ["M", n, i],
    ["l", c, 0],
    ["l", 0, o],
    ["l", -c, 0],
    ["z"]
  ];
  return RenderUtil.componentsToPath(l);
}
exports.getDi = ModelUtil.getDi;
exports.black = m;
exports.getCirclePath = M;
exports.getDiamondPath = j;
exports.getFillColor = k;
exports.getLabelColor = z;
exports.getRectPath = D;
exports.getRoundRectPath = T$1;
exports.getSemantic = E;
exports.getStrokeColor = u;
exports.isCollection = C;
exports.isThrowEvent = P;
exports.isTypedEvent = x;
