import { PluginContainerData } from "./common.js";
import { DividerData_LineStyle, DividerData_Width, DividerData_Alignment } from "./plugin_divider.enums.js";
function dividerData_LineStyleFromJSON(object) {
  switch (object) {
    case 0:
    case "SINGLE":
      return DividerData_LineStyle.SINGLE;
    case 1:
    case "DOUBLE":
      return DividerData_LineStyle.DOUBLE;
    case 2:
    case "DASHED":
      return DividerData_LineStyle.DASHED;
    case 3:
    case "DOTTED":
      return DividerData_LineStyle.DOTTED;
    case -1:
    case "UNRECOGNIZED":
    default:
      return DividerData_LineStyle.UNRECOGNIZED;
  }
}
function dividerData_LineStyleToJSON(object) {
  switch (object) {
    case DividerData_LineStyle.SINGLE:
      return "SINGLE";
    case DividerData_LineStyle.DOUBLE:
      return "DOUBLE";
    case DividerData_LineStyle.DASHED:
      return "DASHED";
    case DividerData_LineStyle.DOTTED:
      return "DOTTED";
    default:
      return "UNKNOWN";
  }
}
function dividerData_WidthFromJSON(object) {
  switch (object) {
    case 0:
    case "LARGE":
      return DividerData_Width.LARGE;
    case 1:
    case "MEDIUM":
      return DividerData_Width.MEDIUM;
    case 2:
    case "SMALL":
      return DividerData_Width.SMALL;
    case -1:
    case "UNRECOGNIZED":
    default:
      return DividerData_Width.UNRECOGNIZED;
  }
}
function dividerData_WidthToJSON(object) {
  switch (object) {
    case DividerData_Width.LARGE:
      return "LARGE";
    case DividerData_Width.MEDIUM:
      return "MEDIUM";
    case DividerData_Width.SMALL:
      return "SMALL";
    default:
      return "UNKNOWN";
  }
}
function dividerData_AlignmentFromJSON(object) {
  switch (object) {
    case 0:
    case "CENTER":
      return DividerData_Alignment.CENTER;
    case 1:
    case "LEFT":
      return DividerData_Alignment.LEFT;
    case 2:
    case "RIGHT":
      return DividerData_Alignment.RIGHT;
    case -1:
    case "UNRECOGNIZED":
    default:
      return DividerData_Alignment.UNRECOGNIZED;
  }
}
function dividerData_AlignmentToJSON(object) {
  switch (object) {
    case DividerData_Alignment.CENTER:
      return "CENTER";
    case DividerData_Alignment.LEFT:
      return "LEFT";
    case DividerData_Alignment.RIGHT:
      return "RIGHT";
    default:
      return "UNKNOWN";
  }
}
const baseDividerData = {
  lineStyle: DividerData_LineStyle.SINGLE,
  width: DividerData_Width.LARGE,
  alignment: DividerData_Alignment.CENTER
};
const DividerData = {
  fromJSON(object) {
    const message = { ...baseDividerData };
    message.containerData = object.containerData !== void 0 && object.containerData !== null ? PluginContainerData.fromJSON(object.containerData) : void 0;
    message.lineStyle = object.lineStyle !== void 0 && object.lineStyle !== null ? dividerData_LineStyleFromJSON(object.lineStyle) : DividerData_LineStyle.SINGLE;
    message.width = object.width !== void 0 && object.width !== null ? dividerData_WidthFromJSON(object.width) : DividerData_Width.LARGE;
    message.alignment = object.alignment !== void 0 && object.alignment !== null ? dividerData_AlignmentFromJSON(object.alignment) : DividerData_Alignment.CENTER;
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.containerData !== void 0 && (obj.containerData = message.containerData ? PluginContainerData.toJSON(message.containerData) : void 0);
    message.lineStyle !== void 0 && (obj.lineStyle = dividerData_LineStyleToJSON(message.lineStyle));
    message.width !== void 0 && (obj.width = dividerData_WidthToJSON(message.width));
    message.alignment !== void 0 && (obj.alignment = dividerData_AlignmentToJSON(message.alignment));
    return obj;
  }
};
export {
  DividerData,
  dividerData_AlignmentFromJSON,
  dividerData_AlignmentToJSON,
  dividerData_LineStyleFromJSON,
  dividerData_LineStyleToJSON,
  dividerData_WidthFromJSON,
  dividerData_WidthToJSON
};
//# sourceMappingURL=plugin_divider.js.map
