/**
 * ldesign v0.4.6
 * (c) 2023 ldesign
 * @license MIT
 */

import '../_common/js/log/index.js';
import log from '../_common/js/log/log.js';

var DefaultAlign = {
  vertical: ["left", "right"],
  horizontal: ["top", "bottom"]
};
function getRenderAlign(align) {
  var layout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "vertical";
  var renderAlign = layout === "vertical" ? "left" : "top";
  if (layout === "vertical" && align) {
    var index = DefaultAlign.horizontal.indexOf(align);
    var isError = index !== -1;
    isError && log.warn("Timeline", 'If layout is vertical, align should be "left","alternate" or "right" ');
    renderAlign = isError ? DefaultAlign.vertical[index] : align;
  }
  if (layout === "horizontal" && align) {
    var _index = DefaultAlign.vertical.indexOf(align);
    var _isError = _index !== -1;
    _isError && log.warn("Timeline", 'If layout is horizontal, align should be "top","alternate" or "bottom" ');
    renderAlign = _isError ? DefaultAlign.horizontal[_index] : align;
  }
  return renderAlign;
}

export { getRenderAlign as default };
//# sourceMappingURL=utils.js.map
