"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const index_esm = require("../../../min-dash/dist/index.esm.js");
const Text = require("../../../diagram-js/lib/util/Text.js");
var f = 12, y = 1.2, s = 30;
function g(r) {
  var e = index_esm.assign({
    fontFamily: "Arial, sans-serif",
    fontSize: f,
    fontWeight: "normal",
    lineHeight: y
  }, r && r.defaultStyle || {}), o = parseInt(e.fontSize, 10) - 1, h = index_esm.assign({}, e, {
    fontSize: o
  }, r && r.externalStyle || {}), a = new Text.default({
    style: e
  });
  this.getExternalLabelBounds = function(t, i) {
    var n = a.getDimensions(i, {
      box: {
        width: 90,
        height: 30,
        x: t.width / 2 + t.x,
        y: t.height / 2 + t.y
      },
      style: h
    });
    return {
      x: Math.round(t.x + t.width / 2 - n.width / 2),
      y: Math.round(t.y),
      width: Math.ceil(n.width),
      height: Math.ceil(n.height)
    };
  }, this.getTextAnnotationBounds = function(t, i) {
    var n = a.getDimensions(i, {
      box: t,
      style: e,
      align: "left-top",
      padding: 5
    });
    return {
      x: t.x,
      y: t.y,
      width: t.width,
      height: Math.max(s, Math.round(n.height))
    };
  }, this.createText = function(t, i) {
    return a.createText(t, i || {});
  }, this.getDefaultStyle = function() {
    return e;
  }, this.getExternalStyle = function() {
    return h;
  };
}
g.$inject = [
  "config.textRenderer"
];
exports.default = g;
