import { upperFirst } from "lodash";
import { getSingular } from "./annotationTypes";
export default function getAnnotationNameAndStartStopString(_ref, _temp) {
  var name = _ref.name,
    start = _ref.start,
    end = _ref.end,
    type = _ref.type,
    message = _ref.message,
    annotationTypePlural = _ref.annotationTypePlural,
    overlapsSelf = _ref.overlapsSelf,
    isWrappedAddon = _ref.isWrappedAddon;
  var _ref2 = _temp === void 0 ? {} : _temp,
    startText = _ref2.startText,
    isProtein = _ref2.isProtein,
    readOnly = _ref2.readOnly;
  var typeToUse = function () {
    if (annotationTypePlural) {
      var singularKey = getSingular(annotationTypePlural);
      if (singularKey === "cutsite") {
        return "Cut site" + (annotationTypePlural === "features" ? " (" + type + ")" : "");
      }
      if (singularKey === "orf") {
        return "ORF" + (annotationTypePlural === "features" ? " (" + type + ")" : "");
      }
      return upperFirst(getSingular(annotationTypePlural)) + (annotationTypePlural === "features" ? " (" + type + ")" : "");
    }
    return "";
  }();
  if (isWrappedAddon) {
    var oldEnd = end;
    end = start - 1;
    start = oldEnd + 1;
  }
  return (startText ? startText : "") + " " + (typeToUse ? typeToUse + " -" : "") + " " + (name ? name : "") + " - Start: " + (isProtein ? (start + 3) / 3 : start + 1) + " End: " + (isProtein ? (end + 1) / 3 : end + 1) + " " + (overlapsSelf ? "(Overlaps Self) " : "") + (message ? "\n" + message : "") + " " + (readOnly ? "" : annotationTypePlural === "cutsites" ? "\n\n click --> top cut position\n alt/option+click --> bottom cut position\n cmd/ctrl+click --> recognition range" : "\n\nalt/option+click --> jump row view to start/end\ndouble click --> edit");
}