// Path: src/protocolsupportpocketstuff/packet/PEPacket.java
// public abstract class PEPacket {
// 
// 	public abstract int getPacketId();
// 
// 	public abstract void toData(ConnectionImpl connection, ByteBuf serializer);
// 
// 	public abstract void readFromClientData(ConnectionImpl connection, ByteBuf clientdata);
// 	
// 	public ByteBuf encode(ConnectionImpl connection) {
// 		ByteBuf serializer = Unpooled.buffer();
// 		PEPacketEncoder.sWritePacketId(serializer, getPacketId());
// 		toData(connection, serializer);
// 		return serializer;
// 	}
// 
// 	public void decode(ConnectionImpl connection, ByteBuf clientdata) {
// 		readFromClientData(connection, clientdata);
// 	}
// 
// }
// 
// Path: src/protocolsupportpocketstuff/util/GsonUtils.java
// public class GsonUtils {
// 	public static final Gson GSON = new Gson();
// 	public static final JsonParser JSON_PARSER = new JsonParser();
// }


import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufInputStream;
import io.netty.buffer.Unpooled;
import protocolsupport.libs.com.google.gson.JsonObject;
import protocolsupport.protocol.ConnectionImpl;
import protocolsupport.protocol.serializer.ArraySerializer;
import protocolsupport.protocol.typeremapper.pe.PEPacketIDs;
import protocolsupport.utils.JsonUtils;
import protocolsupportpocketstuff.packet.PEPacket;
import protocolsupportpocketstuff.util.GsonUtils;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.ParseException;
import java.util.Base64;
import java.util.List;
import java.util.Map;
import com.google.common.reflect.TypeToken;
import protocolsupport.libs.com.nimbusds.jose.JWSObject;
package protocolsupportpocketstuff.packet.handshake;





public class ClientLoginPacket extends PEPacket {

	protected int protocolVersion;
	protected Map<String, List<String>> chainData;
	protected JsonObject chainPayload;
	protected JsonObject jsonPayload;

	public ClientLoginPacket() { }

	@Override
	public int getPacketId() {
		return PEPacketIDs.LOGIN;
	}

	@Override
	public void toData(ConnectionImpl connection, ByteBuf serializer) {
		throw new UnsupportedOperationException();
	}

	private JsonObject decodeToken(String token) {
		String[] base = token.split("\\.");
		if (base.length < 2) {
			return null;
		}
// Path: src/protocolsupportpocketstuff/packet/PEPacket.java
// public abstract class PEPacket {
// 
// 	public abstract int getPacketId();
// 
// 	public abstract void toData(ConnectionImpl connection, ByteBuf serializer);
// 
// 	public abstract void readFromClientData(ConnectionImpl connection, ByteBuf clientdata);
// 	
// 	public ByteBuf encode(ConnectionImpl connection) {
// 		ByteBuf serializer = Unpooled.buffer();
// 		PEPacketEncoder.sWritePacketId(serializer, getPacketId());
// 		toData(connection, serializer);
// 		return serializer;
// 	}
// 
// 	public void decode(ConnectionImpl connection, ByteBuf clientdata) {
// 		readFromClientData(connection, clientdata);
// 	}
// 
// }
// 
// Path: src/protocolsupportpocketstuff/util/GsonUtils.java
// public class GsonUtils {
// 	public static final Gson GSON = new Gson();
// 	public static final JsonParser JSON_PARSER = new JsonParser();
// }


// Path: src/protocolsupportpocketstuff/packet/handshake/ClientLoginPacket.java
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufInputStream;
import io.netty.buffer.Unpooled;
import protocolsupport.libs.com.google.gson.JsonObject;
import protocolsupport.protocol.ConnectionImpl;
import protocolsupport.protocol.serializer.ArraySerializer;
import protocolsupport.protocol.typeremapper.pe.PEPacketIDs;
import protocolsupport.utils.JsonUtils;
import protocolsupportpocketstuff.packet.PEPacket;
import protocolsupportpocketstuff.util.GsonUtils;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.ParseException;
import java.util.Base64;
import java.util.List;
import java.util.Map;
import com.google.common.reflect.TypeToken;
import protocolsupport.libs.com.nimbusds.jose.JWSObject;

package protocolsupportpocketstuff.packet.handshake;





public class ClientLoginPacket extends PEPacket {

	protected int protocolVersion;
	protected Map<String, List<String>> chainData;
	protected JsonObject chainPayload;
	protected JsonObject jsonPayload;

	public ClientLoginPacket() { }

	@Override
	public int getPacketId() {
		return PEPacketIDs.LOGIN;
	}

	@Override
	public void toData(ConnectionImpl connection, ByteBuf serializer) {
		throw new UnsupportedOperationException();
	}

	private JsonObject decodeToken(String token) {
		String[] base = token.split("\\.");
		if (base.length < 2) {
			return null;
		}
		return GsonUtils.GSON.fromJson(new InputStreamReader(new ByteArrayInputStream(Base64.getDecoder().decode(base[1]))), JsonObject.class);