"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var plugin_table_cell_exports = {};
__export(plugin_table_cell_exports, {
  TableCellData: () => TableCellData,
  TableCellData_BorderColors: () => TableCellData_BorderColors,
  TableCellData_BorderWidths: () => TableCellData_BorderWidths,
  TableCellData_CellStyle: () => TableCellData_CellStyle,
  tableCellData_VerticalAlignmentFromJSON: () => tableCellData_VerticalAlignmentFromJSON,
  tableCellData_VerticalAlignmentToJSON: () => tableCellData_VerticalAlignmentToJSON
});
module.exports = __toCommonJS(plugin_table_cell_exports);
var import_plugin_table_cell_enums = require("./plugin_table_cell.enums.js");
function tableCellData_VerticalAlignmentFromJSON(object) {
  switch (object) {
    case 0:
    case "TOP":
      return import_plugin_table_cell_enums.TableCellData_VerticalAlignment.TOP;
    case 1:
    case "MIDDLE":
      return import_plugin_table_cell_enums.TableCellData_VerticalAlignment.MIDDLE;
    case 2:
    case "BOTTOM":
      return import_plugin_table_cell_enums.TableCellData_VerticalAlignment.BOTTOM;
    case -1:
    case "UNRECOGNIZED":
    default:
      return import_plugin_table_cell_enums.TableCellData_VerticalAlignment.UNRECOGNIZED;
  }
}
function tableCellData_VerticalAlignmentToJSON(object) {
  switch (object) {
    case import_plugin_table_cell_enums.TableCellData_VerticalAlignment.TOP:
      return "TOP";
    case import_plugin_table_cell_enums.TableCellData_VerticalAlignment.MIDDLE:
      return "MIDDLE";
    case import_plugin_table_cell_enums.TableCellData_VerticalAlignment.BOTTOM:
      return "BOTTOM";
    default:
      return "UNKNOWN";
  }
}
const baseTableCellData = {};
const TableCellData = {
  fromJSON(object) {
    const message = { ...baseTableCellData };
    message.cellStyle = object.cellStyle !== void 0 && object.cellStyle !== null ? TableCellData_CellStyle.fromJSON(object.cellStyle) : void 0;
    message.borderColors = object.borderColors !== void 0 && object.borderColors !== null ? TableCellData_BorderColors.fromJSON(object.borderColors) : void 0;
    message.colspan = object.colspan !== void 0 && object.colspan !== null ? Number(object.colspan) : void 0;
    message.rowspan = object.rowspan !== void 0 && object.rowspan !== null ? Number(object.rowspan) : void 0;
    message.borderWidths = object.borderWidths !== void 0 && object.borderWidths !== null ? TableCellData_BorderWidths.fromJSON(object.borderWidths) : void 0;
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.cellStyle !== void 0 && (obj.cellStyle = message.cellStyle ? TableCellData_CellStyle.toJSON(message.cellStyle) : void 0);
    message.borderColors !== void 0 && (obj.borderColors = message.borderColors ? TableCellData_BorderColors.toJSON(message.borderColors) : void 0);
    message.colspan !== void 0 && (obj.colspan = message.colspan);
    message.rowspan !== void 0 && (obj.rowspan = message.rowspan);
    message.borderWidths !== void 0 && (obj.borderWidths = message.borderWidths ? TableCellData_BorderWidths.toJSON(message.borderWidths) : void 0);
    return obj;
  }
};
const baseTableCellData_CellStyle = {
  verticalAlignment: import_plugin_table_cell_enums.TableCellData_VerticalAlignment.TOP
};
const TableCellData_CellStyle = {
  fromJSON(object) {
    const message = {
      ...baseTableCellData_CellStyle
    };
    message.verticalAlignment = object.verticalAlignment !== void 0 && object.verticalAlignment !== null ? tableCellData_VerticalAlignmentFromJSON(object.verticalAlignment) : import_plugin_table_cell_enums.TableCellData_VerticalAlignment.TOP;
    message.backgroundColor = object.backgroundColor !== void 0 && object.backgroundColor !== null ? String(object.backgroundColor) : void 0;
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.verticalAlignment !== void 0 && (obj.verticalAlignment = tableCellData_VerticalAlignmentToJSON(
      message.verticalAlignment
    ));
    message.backgroundColor !== void 0 && (obj.backgroundColor = message.backgroundColor);
    return obj;
  }
};
const baseTableCellData_BorderColors = {};
const TableCellData_BorderColors = {
  fromJSON(object) {
    const message = {
      ...baseTableCellData_BorderColors
    };
    message.left = object.left !== void 0 && object.left !== null ? String(object.left) : void 0;
    message.right = object.right !== void 0 && object.right !== null ? String(object.right) : void 0;
    message.top = object.top !== void 0 && object.top !== null ? String(object.top) : void 0;
    message.bottom = object.bottom !== void 0 && object.bottom !== null ? String(object.bottom) : void 0;
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.left !== void 0 && (obj.left = message.left);
    message.right !== void 0 && (obj.right = message.right);
    message.top !== void 0 && (obj.top = message.top);
    message.bottom !== void 0 && (obj.bottom = message.bottom);
    return obj;
  }
};
const baseTableCellData_BorderWidths = {};
const TableCellData_BorderWidths = {
  fromJSON(object) {
    const message = {
      ...baseTableCellData_BorderWidths
    };
    message.left = object.left !== void 0 && object.left !== null ? Number(object.left) : void 0;
    message.right = object.right !== void 0 && object.right !== null ? Number(object.right) : void 0;
    message.top = object.top !== void 0 && object.top !== null ? Number(object.top) : void 0;
    message.bottom = object.bottom !== void 0 && object.bottom !== null ? Number(object.bottom) : void 0;
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.left !== void 0 && (obj.left = message.left);
    message.right !== void 0 && (obj.right = message.right);
    message.top !== void 0 && (obj.top = message.top);
    message.bottom !== void 0 && (obj.bottom = message.bottom);
    return obj;
  }
};
//# sourceMappingURL=plugin_table_cell.js.map
