package com.l7tech.gateway.pm2.graphql.beans.entity;

import io.leangen.graphql.annotations.GraphQLQuery;
import java.util.List;

public class CustomPropertyDTO {
   private final String a;
   private final String b;
   private final String c;
   private final CustomPropertyDTO.PropertyType d;
   private final CustomPropertyDTO.ControlType e;
   private final String f;
   private final Boolean g;
   private final List<String> h;
   private final PropertyValidationDTO i;

   public CustomPropertyDTO(
      String var1,
      String var2,
      String var3,
      CustomPropertyDTO.PropertyType var4,
      CustomPropertyDTO.ControlType var5,
      String var6,
      Boolean var7,
      List<String> var8,
      PropertyValidationDTO var9
   ) {
      this.a = var1;
      this.b = var2;
      this.c = var3;
      this.d = var4;
      this.e = var5;
      this.f = var6;
      this.g = var7;
      this.h = var8;
      this.i = var9;
   }

   @GraphQLQuery(name = "name", description = "Property name (key in connector properties map)")
   public String getName() {
      return this.a;
   }

   @GraphQLQuery(name = "displayName", description = "Human-readable display name")
   public String getDisplayName() {
      return this.b;
   }

   @GraphQLQuery(name = "description", description = "Property description/help text")
   public String getDescription() {
      return this.c;
   }

   @GraphQLQuery(name = "type", description = "Data type of the property")
   public CustomPropertyDTO.PropertyType getType() {
      return this.d;
   }

   @GraphQLQuery(name = "controlType", description = "UI control type to render")
   public CustomPropertyDTO.ControlType getControlType() {
      return this.e;
   }

   @GraphQLQuery(name = "defaultValue", description = "Default value for the property")
   public String getDefaultValue() {
      return this.f;
   }

   @GraphQLQuery(name = "defaultOption", description = "Default boolean option (for checkboxes)")
   public Boolean getDefaultOption() {
      return this.g;
   }

   @GraphQLQuery(name = "options", description = "List of options (for dropdowns/radio buttons)")
   public List<String> getOptions() {
      return this.h;
   }

   @GraphQLQuery(name = "validation", description = "Validation rules for the property")
   public PropertyValidationDTO getValidation() {
      return this.i;
   }

   public enum ControlType {
      CHECKBOX,
      TEXTFIELD,
      TEXTAREA,
      DROPDOWN,
      RADIO,
      SPINNER;

      // $VF: Failed to inline enum fields
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      static {
         String[] var0 = new String[6];
         int var4 = 0;
         String var3 = "\u0000]\u0007\u0015Xz'\t\u0007H\u0016\u000fPv0\u001fI\u0005\u0001L\n\u0012Y\b\u0010E\u000b\u0018]}:\u000b";
         int var5 = "\u0000]\u0007\u0015Xz'\t\u0007H\u0016\u000fPv0\u001fI\u0005\u0001L\n\u0012Y\b\u0010E\u000b\u0018]}:\u000b".length();
         char var2 = 7;
         int var7 = -1;

         label25:
         while (true) {
            String var10000 = var3.substring(++var7, var7 + var2);
            byte var10001 = -1;

            while (true) {
               String var12 = a(a(var10000));
               switch (var10001) {
                  case 0:
                     var0[var4++] = var12;
                     if ((var7 += var2) >= var5) {
                        CHECKBOX = new CustomPropertyDTO.ControlType();
                        TEXTFIELD = new CustomPropertyDTO.ControlType();
                        TEXTAREA = new CustomPropertyDTO.ControlType();
                        DROPDOWN = new CustomPropertyDTO.ControlType();
                        RADIO = new CustomPropertyDTO.ControlType();
                        SPINNER = new CustomPropertyDTO.ControlType();
                        return;
                     }

                     var2 = var3.charAt(var7);
                     break;
                  default:
                     var0[var4++] = var12;
                     if ((var7 += var2) < var5) {
                        var2 = var3.charAt(var7);
                        continue label25;
                     }

                     var3 = "\u0007H\u0016\u000fWm0\u0012\b\u0017_\u0001\u000bRp\"\u001d";
                     var5 = "\u0007H\u0016\u000fWm0\u0012\b\u0017_\u0001\u000bRp\"\u001d".length();
                     var2 = '\b';
                     var7 = -1;
               }

               var10000 = var3.substring(++var7, var7 + var2);
               var10001 = 0;
            }
         }
      }

      private static char[] a(String var0) {
         char[] var10000 = var0.toCharArray();
         if (var10000.length < 2) {
            var10000[0] = (char)(var10000[0] ^ 117);
         }

         return var10000;
      }

      private static String a(char[] var0) {
         int var10002 = var0.length;
         char[] var10001 = var0;
         int var10000 = var10002;

         for (int var1 = 0; var10000 > var1; var1++) {
            var10001[var1] = (char)(var10001[var1] ^ switch (var1 % 7) {
               case 0 -> 83;
               case 1 -> 13;
               case 2 -> 78;
               case 3 -> 91;
               case 4 -> 22;
               case 5 -> 63;
               default -> 117;
            });
         }

         return new String(var10001).intern();
      }
   }

   public enum PropertyType {
      BOOLEAN,
      INTEGER,
      LONG,
      STRING,
      ENUM;

      // $VF: Failed to inline enum fields
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      static {
         String[] var0 = new String[5];
         int var4 = 0;
         String var3 = "\u0012~bo)l\u0007\u0003e\u007fj\"jc\u0004\re~a";
         int var5 = "\u0012~bo)l\u0007\u0003e\u007fj\"jc\u0004\re~a".length();
         char var2 = 6;
         int var7 = -1;

         label25:
         while (true) {
            String var10000 = var3.substring(++var7, var7 + var2);
            byte var10001 = -1;

            while (true) {
               String var12 = a(a(var10000));
               switch (var10001) {
                  case 0:
                     var0[var4++] = var12;
                     if ((var7 += var2) >= var5) {
                        BOOLEAN = new CustomPropertyDTO.PropertyType();
                        INTEGER = new CustomPropertyDTO.PropertyType();
                        LONG = new CustomPropertyDTO.PropertyType();
                        STRING = new CustomPropertyDTO.PropertyType();
                        ENUM = new CustomPropertyDTO.PropertyType();
                        return;
                     }

                     var2 = var3.charAt(var7);
                     break;
                  default:
                     var0[var4++] = var12;
                     if ((var7 += var2) < var5) {
                        var2 = var3.charAt(var7);
                        continue label25;
                     }

                     var3 = "\u0004dek\u0007\bddc n\u007f";
                     var5 = "\u0004dek\u0007\bddc n\u007f".length();
                     var2 = 4;
                     var7 = -1;
               }

               var10000 = var3.substring(++var7, var7 + var2);
               var10001 = 0;
            }
         }
      }

      private static char[] a(String var0) {
         char[] var10000 = var0.toCharArray();
         if (var10000.length < 2) {
            var10000[0] = (char)(var10000[0] ^ 45);
         }

         return var10000;
      }

      private static String a(char[] var0) {
         int var10002 = var0.length;
         char[] var10001 = var0;
         int var10000 = var10002;

         for (int var1 = 0; var10000 > var1; var1++) {
            var10001[var1] = (char)(var10001[var1] ^ switch (var1 % 7) {
               case 0 -> 65;
               case 1 -> 42;
               case 2 -> 48;
               case 3 -> 38;
               case 4 -> 103;
               case 5 -> 43;
               default -> 45;
            });
         }

         return new String(var10001).intern();
      }
   }
}
