package com.mojang.launcher;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.mojang.authlib.properties.Property;
import com.mojang.authlib.properties.PropertyMap;
import java.lang.reflect.Type;
import java.util.Iterator;

public class LegacyPropertyMapSerializer implements JsonSerializer<PropertyMap> {
   public JsonElement serialize(PropertyMap src, Type typeOfSrc, JsonSerializationContext context) {
      JsonObject result = new JsonObject();
      Iterator var5 = src.keySet().iterator();

      while(var5.hasNext()) {
         String key = (String)var5.next();
         JsonArray values = new JsonArray();
         Iterator var8 = src.get(key).iterator();

         while(var8.hasNext()) {
            Property property = (Property)var8.next();
            values.add(new JsonPrimitive(property.getValue()));
         }

         result.add(key, values);
      }

      return result;
   }
}
