package com.l7tech.policy.wsp;

import com.l7tech.policy.assertion.xmlsec.RequireWssSignedElement;
import com.l7tech.policy.assertion.xmlsec.XmlSecurityAssertionBase;
import com.l7tech.util.SoapConstants;
import org.w3c.dom.Element;

class e extends AssertionMapping {
   private final af d;
   private final XmlSecurityAssertionBase e;
   private final boolean f;
   private static final String[] k;

   e(XmlSecurityAssertionBase var1, String var2, boolean var3, String var4) {
      super(var1, var2, var4);
      String[] var5 = k;
      this.d = new af(var5[0], SoapConstants.SECURITY_NAMESPACE, var5[14]);
      this.e = var1;
      this.f = var3;
      if (!(var1 instanceof RequireWssSignedElement)) {
         throw new IllegalArgumentException(var5[1]);
      }
   }

   @Override
   public Element freeze(WspWriter param1, TypedReference param2, Element param3) {
      // $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:
      // 000: aload 0
      // 001: getfield com/l7tech/policy/wsp/e.f Z
      // 004: ifeq 015
      // 007: aload 2
      // 008: getfield com/l7tech/policy/wsp/TypedReference.target Ljava/lang/Object;
      // 00b: ifnonnull 021
      // 00e: goto 015
      // 011: invokestatic com/l7tech/policy/wsp/e.d (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 014: athrow
      // 015: aload 0
      // 016: aload 1
      // 017: aload 2
      // 018: aload 3
      // 019: invokespecial com/l7tech/policy/wsp/AssertionMapping.freeze (Lcom/l7tech/policy/wsp/WspWriter;Lcom/l7tech/policy/wsp/TypedReference;Lorg/w3c/dom/Element;)Lorg/w3c/dom/Element;
      // 01c: areturn
      // 01d: invokestatic com/l7tech/policy/wsp/e.d (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 020: athrow
      // 021: aload 2
      // 022: getfield com/l7tech/policy/wsp/TypedReference.target Ljava/lang/Object;
      // 025: instanceof com/l7tech/policy/assertion/xmlsec/RequireWssSignedElement
      // 028: ifne 04d
      // 02b: new com/l7tech/policy/wsp/InvalidPolicyTreeException
      // 02e: dup
      // 02f: aload 2
      // 030: getfield com/l7tech/policy/wsp/TypedReference.target Ljava/lang/Object;
      // 033: invokevirtual java/lang/Object.getClass ()Ljava/lang/Class;
      // 036: invokestatic java/lang/String.valueOf (Ljava/lang/Object;)Ljava/lang/String;
      // 039: getstatic com/l7tech/policy/wsp/e.k [Ljava/lang/String;
      // 03c: bipush 6
      // 03e: aaload
      // 03f: swap
      // 040: invokedynamic makeConcatWithConstants (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" ]
      // 045: invokespecial com/l7tech/policy/wsp/InvalidPolicyTreeException.<init> (Ljava/lang/String;)V
      // 048: athrow
      // 049: invokestatic com/l7tech/policy/wsp/e.d (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 04c: athrow
      // 04d: aload 2
      // 04e: getfield com/l7tech/policy/wsp/TypedReference.target Ljava/lang/Object;
      // 051: checkcast com/l7tech/policy/assertion/xmlsec/RequireWssSignedElement
      // 054: astore 4
      // 056: aload 3
      // 057: getstatic com/l7tech/policy/wsp/e.k [Ljava/lang/String;
      // 05a: astore 9
      // 05c: aload 9
      // 05e: bipush 7
      // 060: aaload
      // 061: getstatic com/l7tech/util/SoapConstants.SECURITY_NAMESPACE Ljava/lang/String;
      // 064: aload 9
      // 066: bipush 12
      // 068: aaload
      // 069: invokestatic com/l7tech/util/DomUtils.createAndAppendElementNS (Lorg/w3c/dom/Node;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/w3c/dom/Element;
      // 06c: astore 5
      // 06e: aload 4
      // 070: invokevirtual com/l7tech/policy/assertion/xmlsec/RequireWssSignedElement.getRecipientContext ()Lcom/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext;
      // 073: ifnull 0c1
      // 076: aload 4
      // 078: invokevirtual com/l7tech/policy/assertion/xmlsec/RequireWssSignedElement.getRecipientContext ()Lcom/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext;
      // 07b: aload 0
      // 07c: getfield com/l7tech/policy/wsp/e.e Lcom/l7tech/policy/assertion/xmlsec/XmlSecurityAssertionBase;
      // 07f: invokevirtual com/l7tech/policy/assertion/xmlsec/XmlSecurityAssertionBase.getRecipientContext ()Lcom/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext;
      // 082: invokevirtual com/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext.equals (Ljava/lang/Object;)Z
      // 085: ifne 0c1
      // 088: goto 08f
      // 08b: invokestatic com/l7tech/policy/wsp/e.d (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 08e: athrow
      // 08f: new com/l7tech/policy/wsp/BeanTypeMapping
      // 092: dup
      // 093: ldc com/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext
      // 095: getstatic com/l7tech/policy/wsp/e.k [Ljava/lang/String;
      // 098: astore 9
      // 09a: aload 9
      // 09c: bipush 8
      // 09e: aaload
      // 09f: invokespecial com/l7tech/policy/wsp/BeanTypeMapping.<init> (Ljava/lang/Class;Ljava/lang/String;)V
      // 0a2: astore 6
      // 0a4: aload 6
      // 0a6: aload 1
      // 0a7: new com/l7tech/policy/wsp/TypedReference
      // 0aa: dup
      // 0ab: ldc com/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext
      // 0ad: aload 4
      // 0af: invokevirtual com/l7tech/policy/assertion/xmlsec/RequireWssSignedElement.getRecipientContext ()Lcom/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext;
      // 0b2: aload 9
      // 0b4: bipush 2
      // 0b5: aaload
      // 0b6: invokespecial com/l7tech/policy/wsp/TypedReference.<init> (Ljava/lang/reflect/Type;Ljava/lang/Object;Ljava/lang/String;)V
      // 0b9: aload 5
      // 0bb: invokeinterface com/l7tech/policy/wsp/TypeMapping.freeze (Lcom/l7tech/policy/wsp/WspWriter;Lcom/l7tech/policy/wsp/TypedReference;Lorg/w3c/dom/Element;)Lorg/w3c/dom/Element; 4
      // 0c0: pop
      // 0c1: new com/l7tech/policy/wsp/TypedReference
      // 0c4: dup
      // 0c5: ldc com/l7tech/xml/xpath/XpathExpression
      // 0c7: aload 4
      // 0c9: invokevirtual com/l7tech/policy/assertion/xmlsec/RequireWssSignedElement.getXpathExpression ()Lcom/l7tech/xml/xpath/XpathExpression;
      // 0cc: invokespecial com/l7tech/policy/wsp/TypedReference.<init> (Ljava/lang/Class;Ljava/lang/Object;)V
      // 0cf: astore 6
      // 0d1: aload 0
      // 0d2: getfield com/l7tech/policy/wsp/e.d Lcom/l7tech/policy/wsp/af;
      // 0d5: aload 1
      // 0d6: aload 6
      // 0d8: aload 5
      // 0da: invokevirtual com/l7tech/policy/wsp/af.freeze (Lcom/l7tech/policy/wsp/WspWriter;Lcom/l7tech/policy/wsp/TypedReference;Lorg/w3c/dom/Element;)Lorg/w3c/dom/Element;
      // 0dd: pop
      // 0de: aload 5
      // 0e0: getstatic com/l7tech/policy/wsp/e.k [Ljava/lang/String;
      // 0e3: astore 9
      // 0e5: aload 9
      // 0e7: bipush 15
      // 0e9: aaload
      // 0ea: getstatic com/l7tech/util/SoapConstants.WSP_NAMESPACE Ljava/lang/String;
      // 0ed: invokestatic com/l7tech/policy/wsp/y.a (Lorg/w3c/dom/Element;Ljava/lang/String;Ljava/lang/String;)V
      // 0f0: aload 4
      // 0f2: invokevirtual com/l7tech/policy/assertion/xmlsec/RequireWssSignedElement.isEnabled ()Z
      // 0f5: istore 7
      // 0f7: iload 7
      // 0f9: ifne 12b
      // 0fc: new com/l7tech/policy/wsp/BasicTypeMapping
      // 0ff: dup
      // 100: getstatic java/lang/Boolean.TYPE Ljava/lang/Class;
      // 103: aload 9
      // 105: bipush 11
      // 107: aaload
      // 108: invokespecial com/l7tech/policy/wsp/BasicTypeMapping.<init> (Ljava/lang/Class;Ljava/lang/String;)V
      // 10b: astore 8
      // 10d: aload 8
      // 10f: aload 1
      // 110: new com/l7tech/policy/wsp/TypedReference
      // 113: dup
      // 114: getstatic java/lang/Boolean.TYPE Ljava/lang/Class;
      // 117: iload 7
      // 119: invokestatic java/lang/Boolean.valueOf (Z)Ljava/lang/Boolean;
      // 11c: aload 9
      // 11e: bipush 3
      // 11f: aaload
      // 120: invokespecial com/l7tech/policy/wsp/TypedReference.<init> (Ljava/lang/reflect/Type;Ljava/lang/Object;Ljava/lang/String;)V
      // 123: aload 5
      // 125: invokeinterface com/l7tech/policy/wsp/TypeMapping.freeze (Lcom/l7tech/policy/wsp/WspWriter;Lcom/l7tech/policy/wsp/TypedReference;Lorg/w3c/dom/Element;)Lorg/w3c/dom/Element; 4
      // 12a: pop
      // 12b: aload 5
      // 12d: areturn
      // try (0 -> 6): 7 java/lang/IllegalArgumentException
      // try (3 -> 15): 15 java/lang/IllegalArgumentException
      // try (17 -> 34): 34 java/lang/IllegalArgumentException
      // try (52 -> 62): 63 java/lang/IllegalArgumentException
   }

   @Override
   public TypedReference thaw(Element param1, WspVisitor param2) throws InvalidPolicyStreamException {
      // $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:
      // 000: aload 1
      // 001: invokeinterface org/w3c/dom/Element.getLocalName ()Ljava/lang/String; 1
      // 006: getstatic com/l7tech/policy/wsp/e.k [Ljava/lang/String;
      // 009: bipush 9
      // 00b: aaload
      // 00c: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 00f: ifne 01d
      // 012: aload 0
      // 013: aload 1
      // 014: aload 2
      // 015: invokespecial com/l7tech/policy/wsp/AssertionMapping.thaw (Lorg/w3c/dom/Element;Lcom/l7tech/policy/wsp/WspVisitor;)Lcom/l7tech/policy/wsp/TypedReference;
      // 018: areturn
      // 019: invokestatic com/l7tech/policy/wsp/e.d (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 01c: athrow
      // 01d: aload 1
      // 01e: invokestatic com/l7tech/policy/wsp/y.a (Lorg/w3c/dom/Element;)V
      // 021: new com/l7tech/policy/assertion/xmlsec/RequireWssSignedElement
      // 024: dup
      // 025: invokespecial com/l7tech/policy/assertion/xmlsec/RequireWssSignedElement.<init> ()V
      // 028: astore 3
      // 029: new com/l7tech/policy/wsp/TypedReference
      // 02c: dup
      // 02d: ldc com/l7tech/policy/assertion/xmlsec/RequireWssSignedElement
      // 02f: aload 3
      // 030: invokespecial com/l7tech/policy/wsp/TypedReference.<init> (Ljava/lang/Class;Ljava/lang/Object;)V
      // 033: astore 4
      // 035: aload 1
      // 036: aconst_null
      // 037: checkcast java/lang/String
      // 03a: getstatic com/l7tech/policy/wsp/e.k [Ljava/lang/String;
      // 03d: astore 10
      // 03f: aload 10
      // 041: bipush 2
      // 042: aaload
      // 043: invokestatic com/l7tech/util/DomUtils.findFirstChildElementByName (Lorg/w3c/dom/Node;Ljava/lang/String;Ljava/lang/String;)Lorg/w3c/dom/Element;
      // 046: astore 5
      // 048: aload 5
      // 04a: ifnull 07d
      // 04d: new com/l7tech/policy/wsp/BeanTypeMapping
      // 050: dup
      // 051: ldc com/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext
      // 053: aload 10
      // 055: bipush 2
      // 056: aaload
      // 057: invokespecial com/l7tech/policy/wsp/BeanTypeMapping.<init> (Ljava/lang/Class;Ljava/lang/String;)V
      // 05a: aload 5
      // 05c: aload 2
      // 05d: invokevirtual com/l7tech/policy/wsp/BeanTypeMapping.thaw (Lorg/w3c/dom/Element;Lcom/l7tech/policy/wsp/WspVisitor;)Lcom/l7tech/policy/wsp/TypedReference;
      // 060: astore 6
      // 062: aload 6
      // 064: getfield com/l7tech/policy/wsp/TypedReference.target Ljava/lang/Object;
      // 067: instanceof com/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext
      // 06a: ifeq 07d
      // 06d: aload 6
      // 06f: getfield com/l7tech/policy/wsp/TypedReference.target Ljava/lang/Object;
      // 072: checkcast com/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext
      // 075: astore 7
      // 077: aload 3
      // 078: aload 7
      // 07a: invokevirtual com/l7tech/policy/assertion/xmlsec/RequireWssSignedElement.setRecipientContext (Lcom/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext;)V
      // 07d: aload 1
      // 07e: aconst_null
      // 07f: checkcast java/lang/String
      // 082: getstatic com/l7tech/policy/wsp/e.k [Ljava/lang/String;
      // 085: astore 10
      // 087: aload 10
      // 089: bipush 5
      // 08a: aaload
      // 08b: invokestatic com/l7tech/util/DomUtils.findFirstChildElementByName (Lorg/w3c/dom/Node;Ljava/lang/String;Ljava/lang/String;)Lorg/w3c/dom/Element;
      // 08e: astore 6
      // 090: aload 0
      // 091: getfield com/l7tech/policy/wsp/e.d Lcom/l7tech/policy/wsp/af;
      // 094: aload 6
      // 096: aload 2
      // 097: invokevirtual com/l7tech/policy/wsp/af.thaw (Lorg/w3c/dom/Element;Lcom/l7tech/policy/wsp/WspVisitor;)Lcom/l7tech/policy/wsp/TypedReference;
      // 09a: astore 7
      // 09c: aload 7
      // 09e: ifnull 0b3
      // 0a1: aload 7
      // 0a3: getfield com/l7tech/policy/wsp/TypedReference.target Ljava/lang/Object;
      // 0a6: instanceof com/l7tech/xml/xpath/XpathExpression
      // 0a9: ifne 0c4
      // 0ac: goto 0b3
      // 0af: invokestatic com/l7tech/policy/wsp/e.d (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0b2: athrow
      // 0b3: new com/l7tech/policy/wsp/InvalidPolicyStreamException
      // 0b6: dup
      // 0b7: getstatic com/l7tech/policy/wsp/e.k [Ljava/lang/String;
      // 0ba: bipush 4
      // 0bb: aaload
      // 0bc: invokespecial com/l7tech/policy/wsp/InvalidPolicyStreamException.<init> (Ljava/lang/String;)V
      // 0bf: athrow
      // 0c0: invokestatic com/l7tech/policy/wsp/e.d (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0c3: athrow
      // 0c4: aload 3
      // 0c5: aload 7
      // 0c7: getfield com/l7tech/policy/wsp/TypedReference.target Ljava/lang/Object;
      // 0ca: checkcast com/l7tech/xml/xpath/XpathExpression
      // 0cd: invokevirtual com/l7tech/policy/assertion/xmlsec/RequireWssSignedElement.setXpathExpression (Lcom/l7tech/xml/xpath/XpathExpression;)V
      // 0d0: aload 1
      // 0d1: aconst_null
      // 0d2: checkcast java/lang/String
      // 0d5: getstatic com/l7tech/policy/wsp/e.k [Ljava/lang/String;
      // 0d8: astore 10
      // 0da: aload 10
      // 0dc: bipush 13
      // 0de: aaload
      // 0df: invokestatic com/l7tech/util/DomUtils.findFirstChildElementByName (Lorg/w3c/dom/Node;Ljava/lang/String;Ljava/lang/String;)Lorg/w3c/dom/Element;
      // 0e2: astore 8
      // 0e4: aload 8
      // 0e6: ifnull 10c
      // 0e9: aload 8
      // 0eb: aload 10
      // 0ed: bipush 10
      // 0ef: aaload
      // 0f0: invokeinterface org/w3c/dom/Element.getAttribute (Ljava/lang/String;)Ljava/lang/String; 2
      // 0f5: astore 9
      // 0f7: aload 9
      // 0f9: ifnull 10c
      // 0fc: aload 3
      // 0fd: aload 9
      // 0ff: invokestatic java/lang/Boolean.parseBoolean (Ljava/lang/String;)Z
      // 102: invokevirtual com/l7tech/policy/assertion/xmlsec/RequireWssSignedElement.setEnabled (Z)V
      // 105: goto 10c
      // 108: invokestatic com/l7tech/policy/wsp/e.d (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 10b: athrow
      // 10c: aload 4
      // 10e: areturn
      // try (0 -> 12): 12 com/l7tech/policy/wsp/InvalidPolicyStreamException
      // try (76 -> 82): 83 com/l7tech/policy/wsp/InvalidPolicyStreamException
      // try (78 -> 92): 92 com/l7tech/policy/wsp/InvalidPolicyStreamException
      // try (117 -> 123): 124 com/l7tech/policy/wsp/InvalidPolicyStreamException
   }

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

   static {
      String[] var5 = new String[16];
      int var3 = 0;
      String var2 = "\u000e3ObI'W\u00137Ne[$\u00007R1G.^:vQpX``&'IxZ%e0%oxO.W'\u0013PtE%\\7\u001b;;PBM#G1?Hhz%Q*&UtF4q,8HtP4\u0007\u00068]sD%V>\u00009I}L`\\,\"\u001ccM#]53N1P0S7>\u001ctP0@&%OxG.\u0012%$S|\b\t\\73[cA4Kl\u001bYb[!U&\u0006]c\\3\f\u000e3ObI'W\u00137Ne[4\n8HtO2[7/qpX0[-1\u001cx[`G-7^}M`F,vZcM%H&vSsB%Q7vSw\b4K33\u001c\t\n8HtO2[7/\u001b;;PBM#G1?Hhz%Q*&UtF4q,8HtP4\t\n8HtO2[7/\f!9S}M!\\\u00157PdM\f!9S}M!\\\u00157PdM\u00044%Ot\u0007\u00068]sD%V";
      int var4 = "\u000e3ObI'W\u00137Ne[$\u00007R1G.^:vQpX``&'IxZ%e0%oxO.W'\u0013PtE%\\7\u001b;;PBM#G1?Hhz%Q*&UtF4q,8HtP4\u0007\u00068]sD%V>\u00009I}L`\\,\"\u001ccM#]53N1P0S7>\u001ctP0@&%OxG.\u0012%$S|\b\t\\73[cA4Kl\u001bYb[!U&\u0006]c\\3\f\u000e3ObI'W\u00137Ne[4\n8HtO2[7/qpX0[-1\u001cx[`G-7^}M`F,vZcM%H&vSsB%Q7vSw\b4K33\u001c\t\n8HtO2[7/\u001b;;PBM#G1?Hhz%Q*&UtF4q,8HtP4\t\n8HtO2[7/\f!9S}M!\\\u00157PdM\f!9S}M!\\\u00157PdM\u00044%Ot\u0007\u00068]sD%V"
         .length();
      char var1 = '\f';
      int var7 = -1;

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

         while (true) {
            String var8 = e(var10000, e(var10001));
            switch (var10002) {
               case 0:
                  var5[var3++] = var8;
                  if ((var7 += var1) >= var4) {
                     k = var5;
                     return;
                  }

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

                  var2 = "#2Xc\u0003#2[";
                  var4 = "#2Xc\u0003#2[".length();
                  var1 = 4;
                  var7 = -1;
            }

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

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

      return var10000;
   }

   private static String e(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 -> 78;
            case 1 -> 91;
            case 2 -> 49;
            case 3 -> 28;
            case 4 -> 37;
            case 5 -> 77;
            default -> 63;
         });
      }

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