"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_map_exports = {};
__export(plugin_map_exports, {
  MapData: () => MapData,
  MapSettings: () => MapSettings,
  mapTypeFromJSON: () => mapTypeFromJSON,
  mapTypeToJSON: () => mapTypeToJSON
});
module.exports = __toCommonJS(plugin_map_exports);
var import_common = require("./common.js");
var import_plugin_map_enums = require("./plugin_map.enums.js");
function mapTypeFromJSON(object) {
  switch (object) {
    case 0:
    case "ROADMAP":
      return import_plugin_map_enums.MapType.ROADMAP;
    case 1:
    case "SATELITE":
      return import_plugin_map_enums.MapType.SATELITE;
    case 2:
    case "HYBRID":
      return import_plugin_map_enums.MapType.HYBRID;
    case 3:
    case "TERRAIN":
      return import_plugin_map_enums.MapType.TERRAIN;
    case -1:
    case "UNRECOGNIZED":
    default:
      return import_plugin_map_enums.MapType.UNRECOGNIZED;
  }
}
function mapTypeToJSON(object) {
  switch (object) {
    case import_plugin_map_enums.MapType.ROADMAP:
      return "ROADMAP";
    case import_plugin_map_enums.MapType.SATELITE:
      return "SATELITE";
    case import_plugin_map_enums.MapType.HYBRID:
      return "HYBRID";
    case import_plugin_map_enums.MapType.TERRAIN:
      return "TERRAIN";
    default:
      return "UNKNOWN";
  }
}
const baseMapData = {};
const MapData = {
  fromJSON(object) {
    const message = { ...baseMapData };
    message.containerData = object.containerData !== void 0 && object.containerData !== null ? import_common.PluginContainerData.fromJSON(object.containerData) : void 0;
    message.mapSettings = object.mapSettings !== void 0 && object.mapSettings !== null ? MapSettings.fromJSON(object.mapSettings) : void 0;
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.containerData !== void 0 && (obj.containerData = message.containerData ? import_common.PluginContainerData.toJSON(message.containerData) : void 0);
    message.mapSettings !== void 0 && (obj.mapSettings = message.mapSettings ? MapSettings.toJSON(message.mapSettings) : void 0);
    return obj;
  }
};
const baseMapSettings = { mapType: import_plugin_map_enums.MapType.ROADMAP };
const MapSettings = {
  fromJSON(object) {
    const message = { ...baseMapSettings };
    message.address = object.address !== void 0 && object.address !== null ? String(object.address) : void 0;
    message.draggable = object.draggable !== void 0 && object.draggable !== null ? Boolean(object.draggable) : void 0;
    message.marker = object.marker !== void 0 && object.marker !== null ? Boolean(object.marker) : void 0;
    message.streetViewControl = object.streetViewControl !== void 0 && object.streetViewControl !== null ? Boolean(object.streetViewControl) : void 0;
    message.zoomControl = object.zoomControl !== void 0 && object.zoomControl !== null ? Boolean(object.zoomControl) : void 0;
    message.lat = object.lat !== void 0 && object.lat !== null ? Number(object.lat) : void 0;
    message.lng = object.lng !== void 0 && object.lng !== null ? Number(object.lng) : void 0;
    message.locationName = object.locationName !== void 0 && object.locationName !== null ? String(object.locationName) : void 0;
    message.viewModeControl = object.viewModeControl !== void 0 && object.viewModeControl !== null ? Boolean(object.viewModeControl) : void 0;
    message.initialZoom = object.initialZoom !== void 0 && object.initialZoom !== null ? Number(object.initialZoom) : void 0;
    message.mapType = object.mapType !== void 0 && object.mapType !== null ? mapTypeFromJSON(object.mapType) : import_plugin_map_enums.MapType.ROADMAP;
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.address !== void 0 && (obj.address = message.address);
    message.draggable !== void 0 && (obj.draggable = message.draggable);
    message.marker !== void 0 && (obj.marker = message.marker);
    message.streetViewControl !== void 0 && (obj.streetViewControl = message.streetViewControl);
    message.zoomControl !== void 0 && (obj.zoomControl = message.zoomControl);
    message.lat !== void 0 && (obj.lat = message.lat);
    message.lng !== void 0 && (obj.lng = message.lng);
    message.locationName !== void 0 && (obj.locationName = message.locationName);
    message.viewModeControl !== void 0 && (obj.viewModeControl = message.viewModeControl);
    message.initialZoom !== void 0 && (obj.initialZoom = message.initialZoom);
    message.mapType !== void 0 && (obj.mapType = mapTypeToJSON(message.mapType));
    return obj;
  }
};
//# sourceMappingURL=plugin_map.js.map
