package com.l7tech.server.policy.bundle;

import com.l7tech.common.io.XmlUtil;
import com.l7tech.common.mime.ContentTypeHeader;
import com.l7tech.gateway.common.AsyncAdminMethods.JobId;
import com.l7tech.gateway.common.AsyncAdminMethods.JobResult;
import com.l7tech.gateway.common.AsyncAdminMethods.JobStillActiveException;
import com.l7tech.gateway.common.AsyncAdminMethods.UnknownJobException;
import com.l7tech.gateway.common.admin.PolicyBundleInstallerAdmin;
import com.l7tech.gateway.common.admin.PolicyBundleInstallerAdmin.PolicyBundleInstallerException;
import com.l7tech.identity.User;
import com.l7tech.identity.UserBean;
import com.l7tech.message.Message;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.folder.Folder;
import com.l7tech.policy.assertion.Assertion;
import com.l7tech.policy.assertion.AssertionStatus;
import com.l7tech.policy.assertion.PolicyAssertionException;
import com.l7tech.policy.bundle.BundleInfo;
import com.l7tech.policy.bundle.BundleMapping;
import com.l7tech.policy.bundle.PolicyBundleDryRunResult;
import com.l7tech.policy.bundle.BundleMapping.Type;
import com.l7tech.policy.bundle.PolicyBundleDryRunResult.UnknownBundleIdException;
import com.l7tech.policy.variable.NoSuchVariableException;
import com.l7tech.server.StashManagerFactory;
import com.l7tech.server.message.PolicyEnforcementContext;
import com.l7tech.server.policy.assertion.AbstractServerAssertion;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.Functions.UnaryVoidThrows;
import jakarta.inject.Inject;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.jetbrains.annotations.NotNull;
import org.springframework.context.ApplicationContext;
import org.w3c.dom.Document;

public abstract class PolicyBundleInstallerAbstractServerAssertion<AT extends Assertion> extends AbstractServerAssertion<AT> {
   public static final String CONTEXT_VARIABLE_PREFIX = "";
   public static final String REQUEST_HTTP_PARAMETER;
   protected static final String L7;
   protected static final char COMPONENT_ID_SEPARATOR_CHAR = ';';
   protected static final String COMPONENT_ID_SEPARATOR;
   @Inject
   protected StashManagerFactory stashManagerFactory;
   protected final PolicyBundleInstallerAdmin policyBundleInstallerAdmin;
   private PolicyEnforcementContext d;
   private Map<String, BundleInfo> e;
   private boolean f;
   private static final String[] g;

   public PolicyBundleInstallerAbstractServerAssertion(AT param1, ApplicationContext param2) throws PolicyAssertionException {
      // $VF: Couldn't be decompiled
      // 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!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 0
      // 01: aload 1
      // 02: invokespecial com/l7tech/server/policy/assertion/AbstractServerAssertion.<init> (Lcom/l7tech/policy/assertion/Assertion;)V
      // 05: aload 1
      // 06: invokevirtual com/l7tech/policy/assertion/Assertion.meta ()Lcom/l7tech/policy/assertion/AssertionMetadata;
      // 09: astore 3
      // 0a: aload 3
      // 0b: getstatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.g [Ljava/lang/String;
      // 0e: astore 7
      // 10: aload 7
      // 12: bipush 2
      // 13: aaload
      // 14: invokeinterface com/l7tech/policy/assertion/AssertionMetadata.get (Ljava/lang/String;)Ljava/lang/Object; 2
      // 19: checkcast com/l7tech/util/Functions$Unary
      // 1c: astore 4
      // 1e: aload 4
      // 20: ifnonnull 35
      // 23: new com/l7tech/policy/assertion/PolicyAssertionException
      // 26: dup
      // 27: aload 1
      // 28: aload 7
      // 2a: bipush 28
      // 2c: aaload
      // 2d: invokespecial com/l7tech/policy/assertion/PolicyAssertionException.<init> (Lcom/l7tech/policy/assertion/Assertion;Ljava/lang/String;)V
      // 30: athrow
      // 31: invokestatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 34: athrow
      // 35: aload 4
      // 37: aload 2
      // 38: invokeinterface com/l7tech/util/Functions$Unary.call (Ljava/lang/Object;)Ljava/lang/Object; 2
      // 3d: checkcast java/util/Collection
      // 40: astore 5
      // 42: aload 5
      // 44: ifnull 59
      // 47: aload 5
      // 49: invokeinterface java/util/Collection.size ()I 1
      // 4e: bipush 1
      // 4f: if_icmpeq 6c
      // 52: goto 59
      // 55: invokestatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 58: athrow
      // 59: new com/l7tech/policy/assertion/PolicyAssertionException
      // 5c: dup
      // 5d: aload 1
      // 5e: getstatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.g [Ljava/lang/String;
      // 61: bipush 14
      // 63: aaload
      // 64: invokespecial com/l7tech/policy/assertion/PolicyAssertionException.<init> (Lcom/l7tech/policy/assertion/Assertion;Ljava/lang/String;)V
      // 67: athrow
      // 68: invokestatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 6b: athrow
      // 6c: aload 5
      // 6e: invokeinterface java/util/Collection.iterator ()Ljava/util/Iterator; 1
      // 73: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 78: checkcast com/l7tech/policy/assertion/ExtensionInterfaceBinding
      // 7b: astore 6
      // 7d: aload 0
      // 7e: aload 6
      // 80: invokevirtual com/l7tech/policy/assertion/ExtensionInterfaceBinding.getImplementationObject ()Ljava/lang/Object;
      // 83: checkcast com/l7tech/gateway/common/admin/PolicyBundleInstallerAdmin
      // 86: putfield com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.policyBundleInstallerAdmin Lcom/l7tech/gateway/common/admin/PolicyBundleInstallerAdmin;
      // 89: return
      // try (15 -> 25): 25 com/l7tech/policy/assertion/PolicyAssertionException
      // try (32 -> 38): 39 com/l7tech/policy/assertion/PolicyAssertionException
      // try (34 -> 49): 49 com/l7tech/policy/assertion/PolicyAssertionException
   }

   @Override
   public AssertionStatus checkRequest(PolicyEnforcementContext var1) throws IOException, PolicyAssertionException {
      this.setContext(var1);
      User var2 = this.getContext().getDefaultAuthenticationContext().getLastAuthenticatedUser();
      UserBean var3 = new UserBean(var2.getProviderId(), var2.getLogin());
      var3.setUniqueIdentifier(var2.getId());
      this.policyBundleInstallerAdmin.setAuthenticatedUser(var3);

      try {
         if (this.getAvailableComponents() == null) {
            List var4 = this.policyBundleInstallerAdmin.getAllComponents();
            this.setAvailableComponents(new HashMap<>(var4.size()));

            for (BundleInfo var6 : var4) {
               this.getAvailableComponents().put(var6.getId(), var6);
            }
         }

         PolicyBundleInstallerAbstractServerAssertion.Action var13;
         try {
            String[] var7 = g;
            var13 = PolicyBundleInstallerAbstractServerAssertion.Action.valueOf(this.getContextVariable(var7[10]));
         } catch (NoSuchVariableException var8) {
            var13 = PolicyBundleInstallerAbstractServerAssertion.Action.list;
         } catch (IllegalArgumentException var9) {
            throw new PolicyAssertionException(this.assertion, g[7], var9);
         }

         label72: {
            label73: {
               label74: {
                  try {
                     switch (var13) {
                        case list:
                           this.a();
                           return AssertionStatus.NONE;
                        case restman_get:
                           break label72;
                        case wsman_dry_run:
                           break label73;
                        case wsman_install:
                           break label74;
                     }
                  } catch (NoSuchVariableException var10) {
                     throw a(var10);
                  }

                  this.customActionCallback();
                  return AssertionStatus.NONE;
               }

               this.d();
               return AssertionStatus.NONE;
            }

            this.c();
            return AssertionStatus.NONE;
         }

         this.b();
      } catch (PolicyBundleInstallerServerAssertionException var11) {
         throw var11;
      } catch (Exception var12) {
         throw new PolicyAssertionException(this.assertion, ExceptionUtils.getMessage(var12));
      }

      return AssertionStatus.NONE;
   }

   public void setUsesRequestHttpParams(boolean var1) {
      this.f = var1;
   }

   protected String getContextVariable(@NotNull String var1) throws NoSuchVariableException {
      try {
         if (var1 == null) {
            b(0);
         }
      } catch (NoSuchVariableException var2) {
         throw a(var2);
      }

      try {
         if (this.f) {
            return this.getContext().getVariable(g[25] + var1).toString();
         }
      } catch (NoSuchVariableException var3) {
         throw a(var3);
      }

      return this.getContext().getVariable(var1).toString();
   }

   protected void customActionCallback() throws PolicyBundleInstallerException {
   }

   protected JobId<PolicyBundleDryRunResult> callAdminDryRun(List<String> var1, Goid var2, HashMap<String, BundleMapping> var3, String var4) throws PolicyBundleInstallerException {
      return this.policyBundleInstallerAdmin.dryRunInstall(var1, var3, var2, var4);
   }

   protected JobId<ArrayList> callAdminInstall(List<String> var1, Goid var2, HashMap<String, BundleMapping> var3, String var4) throws PolicyBundleInstallerException {
      return this.policyBundleInstallerAdmin.install(var1, var2, var3, var4, null);
   }

   protected void writeResponse(Document var1) throws PolicyBundleInstallerException {
      try {
         this.writeResponse(XmlUtil.nodeToFormattedString(var1));
      } catch (IOException var3) {
         throw new PolicyBundleInstallerException(var3);
      }
   }

   protected void writeResponse(String var1) throws PolicyBundleInstallerException {
      try {
         Message var2 = this.getContext().getResponse();
         ByteArrayInputStream var3 = new ByteArrayInputStream(var1.getBytes());
         var2.initialize(this.getStashManagerFactory().createStashManager(), ContentTypeHeader.XML_DEFAULT, var3);
         var2.getMimeKnob().getContentLength();
         var2.getHttpResponseKnob().setStatus(200);
      } catch (IOException var4) {
         throw new PolicyBundleInstallerException(var4);
      }
   }

   protected Map<String, BundleInfo> getAvailableComponents() {
      return this.e;
   }

   protected void setAvailableComponents(Map<String, BundleInfo> var1) {
      this.e = var1;
   }

   protected PolicyEnforcementContext getContext() {
      return this.d;
   }

   protected void setContext(PolicyEnforcementContext var1) {
      this.d = var1;
   }

   protected StashManagerFactory getStashManagerFactory() {
      return this.stashManagerFactory;
   }

   void a() throws PolicyBundleInstallerException {
      StringBuilder var1 = new StringBuilder();

      for (String var3 : this.getAvailableComponents().keySet()) {
         var1.append(var3);
         var1.append(COMPONENT_ID_SEPARATOR);
      }

      this.writeResponse(var1.toString());
   }

   void b() throws InterruptedException, PolicyBundleInstallerException, NoSuchVariableException, UnknownJobException, JobStillActiveException, PolicyAssertionException {
      List var1 = this.a(PolicyBundleInstallerAbstractServerAssertion.Action.restman_get);
      JobId var2 = this.callAdminDryRun(var1, this.f(), this.a(var1), this.e());
      this.a(var2, new b(this));
   }

   private void a(JobId<? extends Serializable> var1, UnaryVoidThrows<Object, Exception> var2) throws InterruptedException, PolicyBundleInstallerException, UnknownJobException, JobStillActiveException, PolicyBundleInstallerServerAssertionException {
      while (true) {
         String var3 = this.policyBundleInstallerAdmin.getJobStatus(var1);

         try {
            if (var3 == null) {
               throw new PolicyBundleInstallerException(g[11] + var1);
            }
         } catch (PolicyBundleInstallerServerAssertionException var8) {
            throw a(var8);
         }

         if (!var3.startsWith("a")) {
            JobResult var4 = this.policyBundleInstallerAdmin.getJobResult(var1);
            if (var4.result != null) {
               try {
                  var2.call(var4.result);
                  return;
               } catch (PolicyBundleInstallerServerAssertionException var6) {
                  throw var6;
               } catch (Exception var7) {
                  throw new PolicyBundleInstallerException(var7);
               }
            }

            throw new PolicyBundleInstallerException(var4.throwableMessage);
         }

         Thread.sleep(5000L);
      }
   }

   void c() throws InterruptedException, PolicyBundleInstallerException, NoSuchVariableException, UnknownJobException, JobStillActiveException, UnknownBundleIdException, PolicyBundleInstallerServerAssertionException {
      List var1 = this.a(PolicyBundleInstallerAbstractServerAssertion.Action.wsman_dry_run);
      JobId var2 = this.callAdminDryRun(var1, this.f(), this.a(var1), this.e());
      this.a(var2, new c(this, var1));
   }

   void d() throws InterruptedException, PolicyBundleInstallerException, NoSuchVariableException, UnknownJobException, JobStillActiveException, UnknownBundleIdException, PolicyBundleInstallerServerAssertionException {
      List var1 = this.a(PolicyBundleInstallerAbstractServerAssertion.Action.wsman_install);
      JobId var2 = this.callAdminInstall(var1, this.f(), this.a(var1), this.e());
      this.a(var2, new d(this));
   }

   List<String> a(@NotNull PolicyBundleInstallerAbstractServerAssertion.Action var1) throws NoSuchVariableException, PolicyBundleInstallerServerAssertionException {
      try {
         if (var1 == null) {
            b(1);
         }
      } catch (NoSuchVariableException var11) {
         throw a(var11);
      }

      String[] var8 = g;
      String var2 = this.getContextVariable(var8[4]);
      ArrayList var3;
      if (var8[16].equalsIgnoreCase(var2)) {
         var3 = new ArrayList(this.getAvailableComponents().size());

         for (BundleInfo var5 : this.getAvailableComponents().values()) {
            this.a(var3, var1, var5);
         }
      } else {
         List var12 = Arrays.asList(var2.split(COMPONENT_ID_SEPARATOR));
         var3 = new ArrayList(var12.size());

         for (String var6 : var12) {
            BundleInfo var7 = this.getAvailableComponents().get(var6);

            try {
               if (var7 != null) {
                  this.a(var3, var1, var7);
               }
            } catch (NoSuchVariableException var10) {
               throw a(var10);
            }
         }
      }

      try {
         if (var3.size() <= 0) {
            throw new PolicyBundleInstallerServerAssertionException(this.assertion, g[9], 404);
         } else {
            return var3;
         }
      } catch (NoSuchVariableException var9) {
         throw a(var9);
      }
   }

   private void a(@NotNull List<String> param1, @NotNull PolicyBundleInstallerAbstractServerAssertion.Action param2, @NotNull BundleInfo param3) throws PolicyBundleInstallerServerAssertionException {
      // $VF: Couldn't be decompiled
      // 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!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 1
      // 01: ifnonnull 0f
      // 04: bipush 2
      // 05: invokestatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.b (I)V
      // 08: goto 0f
      // 0b: invokestatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0e: athrow
      // 0f: aload 2
      // 10: ifnonnull 1e
      // 13: bipush 3
      // 14: invokestatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.b (I)V
      // 17: goto 1e
      // 1a: invokestatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 1d: athrow
      // 1e: aload 3
      // 1f: ifnonnull 2d
      // 22: bipush 4
      // 23: invokestatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.b (I)V
      // 26: goto 2d
      // 29: invokestatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 2c: athrow
      // 2d: aload 3
      // 2e: invokevirtual com/l7tech/policy/bundle/BundleInfo.hasActiveVersionMigrationBundleFile ()Ljava/lang/Boolean;
      // 31: invokevirtual java/lang/Boolean.booleanValue ()Z
      // 34: ifeq 45
      // 37: aload 2
      // 38: getstatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion$Action.restman_get Lcom/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion$Action;
      // 3b: if_acmpeq 72
      // 3e: goto 45
      // 41: invokestatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 44: athrow
      // 45: aload 3
      // 46: invokevirtual com/l7tech/policy/bundle/BundleInfo.hasWsmanFile ()Ljava/lang/Boolean;
      // 49: invokevirtual java/lang/Boolean.booleanValue ()Z
      // 4c: ifeq 84
      // 4f: goto 56
      // 52: invokestatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 55: athrow
      // 56: aload 2
      // 57: getstatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion$Action.wsman_dry_run Lcom/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion$Action;
      // 5a: if_acmpeq 72
      // 5d: goto 64
      // 60: invokestatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 63: athrow
      // 64: aload 2
      // 65: getstatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion$Action.wsman_install Lcom/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion$Action;
      // 68: if_acmpne 84
      // 6b: goto 72
      // 6e: invokestatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 71: athrow
      // 72: aload 1
      // 73: aload 3
      // 74: invokevirtual com/l7tech/policy/bundle/BundleInfo.getId ()Ljava/lang/String;
      // 77: invokeinterface java/util/List.add (Ljava/lang/Object;)Z 2
      // 7c: pop
      // 7d: goto b1
      // 80: invokestatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 83: athrow
      // 84: new com/l7tech/server/policy/bundle/PolicyBundleInstallerServerAssertionException
      // 87: dup
      // 88: aload 0
      // 89: getfield com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.assertion Lcom/l7tech/policy/assertion/Assertion;
      // 8c: aload 3
      // 8d: invokevirtual com/l7tech/policy/bundle/BundleInfo.getId ()Ljava/lang/String;
      // 90: aload 2
      // 91: invokestatic java/lang/String.valueOf (Ljava/lang/Object;)Ljava/lang/String;
      // 94: getstatic com/l7tech/server/policy/bundle/PolicyBundleInstallerAbstractServerAssertion.g [Ljava/lang/String;
      // 97: astore 4
      // 99: aload 4
      // 9b: bipush 0
      // 9c: aaload
      // 9d: dup_x2
      // 9e: pop
      // 9f: aload 4
      // a1: bipush 22
      // a3: aaload
      // a4: swap
      // a5: invokedynamic makeConcatWithConstants (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; bsm=java/lang/invoke/StringConcatFactory.makeConcatWithConstants (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite; args=[ "\u0001\u0001\u0001\u0001" ]
      // aa: sipush 400
      // ad: invokespecial com/l7tech/server/policy/bundle/PolicyBundleInstallerServerAssertionException.<init> (Lcom/l7tech/policy/assertion/Assertion;Ljava/lang/String;I)V
      // b0: athrow
      // b1: return
      // try (0 -> 4): 5 com/l7tech/server/policy/bundle/PolicyBundleInstallerServerAssertionException
      // try (7 -> 11): 12 com/l7tech/server/policy/bundle/PolicyBundleInstallerServerAssertionException
      // try (14 -> 18): 19 com/l7tech/server/policy/bundle/PolicyBundleInstallerServerAssertionException
      // try (21 -> 28): 29 com/l7tech/server/policy/bundle/PolicyBundleInstallerServerAssertionException
      // try (25 -> 35): 36 com/l7tech/server/policy/bundle/PolicyBundleInstallerServerAssertionException
      // try (31 -> 41): 42 com/l7tech/server/policy/bundle/PolicyBundleInstallerServerAssertionException
      // try (38 -> 47): 48 com/l7tech/server/policy/bundle/PolicyBundleInstallerServerAssertionException
      // try (44 -> 56): 56 com/l7tech/server/policy/bundle/PolicyBundleInstallerServerAssertionException
   }

   private String e() {
      try {
         return this.getContextVariable(g[24]);
      } catch (NoSuchVariableException var2) {
         return null;
      }
   }

   private Goid f() {
      try {
         return new Goid(this.getContextVariable(g[15]));
      } catch (NoSuchVariableException var2) {
         return Folder.ROOT_FOLDER_ID;
      }
   }

   private HashMap<String, BundleMapping> a(List<String> var1) throws PolicyBundleInstallerException {
      HashMap var2 = new HashMap();

      for (String var4 : var1) {
         try {
            String[] var8 = g;
            String var5 = this.getContextVariable(var8[26] + var4 + var8[17]);
            String var6 = this.getContextVariable(var8[23] + var4 + var8[13]);
            BundleMapping var7 = new BundleMapping();
            var7.addMapping(Type.JDBC_CONNECTION_NAME, var5, var6);
            var2.put(var4, var7);
         } catch (NoSuchVariableException var9) {
         }
      }

      return var2;
   }

   static {
      String[] var5 = new String[29];
      int var3 = 0;
      String var2 = "c\u0017\u0007KF\\\u0015N\fJrm\bP\u0002LO\u001aE\u0000\u001e^GA\u0019O\u0016#U]W\u0002F\u0019\t^Zt\u0011C\f\u0005IP\u0004N\u0019\u0007^\rC\u0017\u0007KF\\\u0015N\f5RMA\u0017R\u001d\u001bNLA\u0004\u000e\u0010\u001eOY\u001c\u0000A\n\u000bVLF\u0015RV>a\n\rNDW\u001eTX\fT[\u00120n\u0017\u001eu\\^\u001c\u0000\b\u000bIH_\u0015T\u001d\u0018\u001b\u000e\u0017\u0003\u0007X\u0005]\t\u0017\u0003\u000e]\u0019\u001bDG\u0003TX\u0004T]\u0012\u0012EX\u0004NE^+aX\u001cZE[\u0014\u0000\u0011\u0004H]S\u001cL\u001d\u0018\u001bHQ\u0004I\u0017\u0004\u001bDG\u0003TX\b^\tA\u0000E\u001b\u0003]@W\u0014\u000e\u0012G\u001d\u001exF\\\u0004E\u0000\u001emH@\u0019A\u001a\u0006^2n\u0017JVHF\u0013H\u0011\u0004\\\tQ\u001fM\b\u0005UL\\\u0004\u00001.\u001bO]\u0005N\u001cJ]F@PT\u0010\u0003H\t[\u001eS\f\u000bWEW\u0002\u000e\u0006A\u001b\u001eRF\\\u000fu\u0016\u0001UFE\u001e\u0000\u0012\u0005Y@VJ\u0000\u0006A\u001b\u001eRF\\\t\u000e\u0016\u000fLv\\\u0011M\u001dIu\u0016\u000fCYW\u0013T\u001d\u000e\u001bLJ\u0013E\b\u001eRF\\\\\u0000\u0015\u001fH]\u0012\u0018A\u000e\u000f\u001bLJ\u0011C\f\u0006B\t]\u001eEX/C]W\u001eS\u0011\u0005U\t{\u001eT\u001d\u0018]HQ\u0015SX(RGV\u0019N\u001fD\u000bF\u0017\u0006_L@/G\u0017\u0003_\u0003A\u0014\u0006\u0005\u000e\u0016\u000bVL\u000eA\u001c\u000exF_\u0000O\u0016\u000fU]{\u0014\nB\r\u0004_EW9N\u001e\u0005LC\u0017\u0007\u0014E\u0005\u0004E\u001b\u0002\u0014ZW\u0002V\u001d\u0018\u0014Y]\u001cI\u001b\u0013\u0014KG\u001eD\u0014\u000f\u0014y]\u001cI\u001b\u0013y\\\\\u0014L\u001d#UZF\u0011L\u0014\u000fIhP\u0003T\n\u000bX]a\u0015R\u000e\u000fIhA\u0003E\n\u001eRF\\\u000fG\u001d\u001exF_\u0000O\u0016\u000fU]{\u0014S\u001d\u0000\u0016\u0005O\tQ\u001fM\b\u000bO@P\u001cEX\u001dR]ZPA\u001b\u001eRF\\J\u0000\u0010J\u001c\bXvQ\u001fN\u0016\u000fX][\u001fNV\u0010V\u001d\u0018H@]\u001e\u007f\u0015\u0005_@T\u0019E\n\u0017R\u001d\u001bNLA\u0004\u000e\u0010\u001eOY\u001c\u0000A\n\u000bVLF\u0015RV\u0010J\u001c\bXvQ\u001fN\u0016\u000fX][\u001fNV";
      int var4 = "c\u0017\u0007KF\\\u0015N\fJrm\bP\u0002LO\u001aE\u0000\u001e^GA\u0019O\u0016#U]W\u0002F\u0019\t^Zt\u0011C\f\u0005IP\u0004N\u0019\u0007^\rC\u0017\u0007KF\\\u0015N\f5RMA\u0017R\u001d\u001bNLA\u0004\u000e\u0010\u001eOY\u001c\u0000A\n\u000bVLF\u0015RV>a\n\rNDW\u001eTX\fT[\u00120n\u0017\u001eu\\^\u001c\u0000\b\u000bIH_\u0015T\u001d\u0018\u001b\u000e\u0017\u0003\u0007X\u0005]\t\u0017\u0003\u000e]\u0019\u001bDG\u0003TX\u0004T]\u0012\u0012EX\u0004NE^+aX\u001cZE[\u0014\u0000\u0011\u0004H]S\u001cL\u001d\u0018\u001bHQ\u0004I\u0017\u0004\u001bDG\u0003TX\b^\tA\u0000E\u001b\u0003]@W\u0014\u000e\u0012G\u001d\u001exF\\\u0004E\u0000\u001emH@\u0019A\u001a\u0006^2n\u0017JVHF\u0013H\u0011\u0004\\\tQ\u001fM\b\u0005UL\\\u0004\u00001.\u001bO]\u0005N\u001cJ]F@PT\u0010\u0003H\t[\u001eS\f\u000bWEW\u0002\u000e\u0006A\u001b\u001eRF\\\u000fu\u0016\u0001UFE\u001e\u0000\u0012\u0005Y@VJ\u0000\u0006A\u001b\u001eRF\\\t\u000e\u0016\u000fLv\\\u0011M\u001dIu\u0016\u000fCYW\u0013T\u001d\u000e\u001bLJ\u0013E\b\u001eRF\\\\\u0000\u0015\u001fH]\u0012\u0018A\u000e\u000f\u001bLJ\u0011C\f\u0006B\t]\u001eEX/C]W\u001eS\u0011\u0005U\t{\u001eT\u001d\u0018]HQ\u0015SX(RGV\u0019N\u001fD\u000bF\u0017\u0006_L@/G\u0017\u0003_\u0003A\u0014\u0006\u0005\u000e\u0016\u000bVL\u000eA\u001c\u000exF_\u0000O\u0016\u000fU]{\u0014\nB\r\u0004_EW9N\u001e\u0005LC\u0017\u0007\u0014E\u0005\u0004E\u001b\u0002\u0014ZW\u0002V\u001d\u0018\u0014Y]\u001cI\u001b\u0013\u0014KG\u001eD\u0014\u000f\u0014y]\u001cI\u001b\u0013y\\\\\u0014L\u001d#UZF\u0011L\u0014\u000fIhP\u0003T\n\u000bX]a\u0015R\u000e\u000fIhA\u0003E\n\u001eRF\\\u000fG\u001d\u001exF_\u0000O\u0016\u000fU]{\u0014S\u001d\u0000\u0016\u0005O\tQ\u001fM\b\u000bO@P\u001cEX\u001dR]ZPA\u001b\u001eRF\\J\u0000\u0010J\u001c\bXvQ\u001fN\u0016\u000fX][\u001fNV\u0010V\u001d\u0018H@]\u001e\u007f\u0015\u0005_@T\u0019E\n\u0017R\u001d\u001bNLA\u0004\u000e\u0010\u001eOY\u001c\u0000A\n\u000bVLF\u0015RV\u0010J\u001c\bXvQ\u001fN\u0016\u000fX][\u001fNV"
         .length();
      char var1 = 14;
      int var7 = -1;

      label24:
      while (true) {
         byte var10000 = 99;
         String var10001 = var2.substring(++var7, var7 + var1);
         byte var10002 = -1;

         while (true) {
            String var8 = b(var10000, a(var10001));
            switch (var10002) {
               case 0:
                  var5[var3++] = var8;
                  if ((var7 += var1) >= var4) {
                     g = var5;
                     String[] var9 = g;
                     L7 = g[1];
                     REQUEST_HTTP_PARAMETER = var9[5];
                     COMPONENT_ID_SEPARATOR = String.valueOf(';');
                     return;
                  }

                  var1 = var2.charAt(var7);
                  break;
               default:
                  var5[var3++] = var8;
                  if ((var7 += var1) < var4) {
                     var1 = var2.charAt(var7);
                     continue label24;
                  }

                  var2 = "\u001bO_\u0013\u001e\u0004M\u0016T{\u0007\u0002D-NW\u001b\u0001\u000fK\fEVC\u0014\u0012K\u001dPF\n\u001e\u0004\u0004XeJ\u0017\u0014\u0004[\u0011O\\C8\u0004\\\u001dRT\u0002\u0012\u000f[XfS\u0000\u0005\u0005Z\u0001\u0000_\u0016\u0002\u001e\b\u0016OFC\u0013\u000f\b\u0016U^\u000f_";
                  var4 = "\u001bO_\u0013\u001e\u0004M\u0016T{\u0007\u0002D-NW\u001b\u0001\u000fK\fEVC\u0014\u0012K\u001dPF\n\u001e\u0004\u0004XeJ\u0017\u0014\u0004[\u0011O\\C8\u0004\\\u001dRT\u0002\u0012\u000f[XfS\u0000\u0005\u0005Z\u0001\u0000_\u0016\u0002\u001e\b\u0016OFC\u0013\u000f\b\u0016U^\u000f_"
                     .length();
                  var1 = '\f';
                  var7 = -1;
            }

            var10000 = 59;
            var10001 = var2.substring(++var7, var7 + var1);
            var10002 = 0;
         }
      }
   }

   private static Exception a(Exception var0) {
      return var0;
   }

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

      return var10000;
   }

   private static String b(int var0, char[] var1) {
      int var10003 = var1.length;
      int var10002 = var0;
      char[] var10001 = var1;
      int var10000 = var10003;

      for (int var2 = 0; var10000 > var2; var2++) {
         var10001[var2] = (char)(var10001[var2] ^ var10002 ^ switch (var2 % 7) {
            case 0 -> 67;
            case 1 -> 27;
            case 2 -> 9;
            case 3 -> 88;
            case 4 -> 74;
            case 5 -> 81;
            default -> 19;
         });
      }

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

   protected enum Action {
      list,
      restman_get,
      wsman_dry_run,
      wsman_install,
      custom;

      // $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 = "1?D0\u001a\u000b}\u001c=R0\r4)Z%\u00195w1#h6\u0002\u0004\u0006 /D0\u0018\u0007";
         int var5 = "1?D0\u001a\u000b}\u001c=R0\r4)Z%\u00195w1#h6\u0002\u0004\u0006 /D0\u0018\u0007".length();
         char var2 = 11;
         int var7 = -1;

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

            while (true) {
               String var8 = a(var10000, a(var10001));
               switch (var10002) {
                  case 0:
                     var0[var4++] = var8;
                     if ((var7 += var2) >= var5) {
                        list = new PolicyBundleInstallerAbstractServerAssertion.Action();
                        restman_get = new PolicyBundleInstallerAbstractServerAssertion.Action();
                        wsman_dry_run = new PolicyBundleInstallerAbstractServerAssertion.Action();
                        wsman_install = new PolicyBundleInstallerAbstractServerAssertion.Action();
                        custom = new PolicyBundleInstallerAbstractServerAssertion.Action();
                        return;
                     }

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

                     var3 = "7+\\(\r,1B=\u0001-b51[=\u0003\u001e";
                     var5 = "7+\\(\r,1B=\u0001-b51[=\u0003\u001e".length();
                     var2 = 4;
                     var7 = -1;
               }

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

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

         return var10000;
      }

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

         for (int var2 = 0; var10000 > var2; var2++) {
            var10001[var2] = (char)(var10001[var2] ^ var10002 ^ switch (var2 % 7) {
               case 0 -> 87;
               case 1 -> 78;
               case 2 -> 35;
               case 3 -> 80;
               case 4 -> 99;
               case 5 -> 126;
               default -> 7;
            });
         }

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