"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.calcTableWidth = void 0;
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
var calcTableWidth = exports.calcTableWidth = function calcTableWidth(layout, containerWidth) {
  var addControllerPadding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  switch (layout) {
    case 'full-width':
      return containerWidth ? Math.min(containerWidth - (addControllerPadding ? _editorSharedStyles.akEditorBreakoutPadding : 0), _editorSharedStyles.akEditorFullWidthLayoutWidth) : _editorSharedStyles.akEditorFullWidthLayoutWidth;
    case 'wide':
      if (containerWidth) {
        return Math.min(containerWidth - (addControllerPadding ? _editorSharedStyles.akEditorBreakoutPadding : 0), _editorSharedStyles.akEditorWideLayoutWidth);
      }
      return _editorSharedStyles.akEditorWideLayoutWidth;
    default:
      return 'inherit';
  }
};