/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.common.io.XmlUtil
 *  com.l7tech.gateway.api.Bundle
 *  com.l7tech.gateway.api.impl.MarshallingUtils
 *  com.l7tech.gateway.common.LicenseException
 *  com.l7tech.gateway.common.solutionkit.BadRequestException
 *  com.l7tech.gateway.common.solutionkit.EntityOwnershipDescriptor
 *  com.l7tech.gateway.common.solutionkit.InstanceModifier
 *  com.l7tech.gateway.common.solutionkit.SolutionKit
 *  com.l7tech.gateway.common.solutionkit.SolutionKitException
 *  com.l7tech.gateway.common.solutionkit.SolutionKitHeader
 *  com.l7tech.gateway.common.solutionkit.SolutionKitImportInfo
 *  com.l7tech.gateway.common.solutionkit.SolutionKitUtils
 *  com.l7tech.objectmodel.DeleteException
 *  com.l7tech.objectmodel.Entity
 *  com.l7tech.objectmodel.EntityManager$UniqueType
 *  com.l7tech.objectmodel.EntityType
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.objectmodel.SaveException
 *  com.l7tech.objectmodel.UpdateException
 *  com.l7tech.policy.assertion.Assertion
 *  com.l7tech.policy.assertion.AssertionStatus
 *  com.l7tech.policy.wsp.WspReader
 *  com.l7tech.policy.wsp.WspReader$Visibility
 *  com.l7tech.util.ExceptionUtils
 *  com.l7tech.util.MissingRequiredElementException
 *  com.l7tech.util.Pair
 *  com.l7tech.util.TooManyChildElementsException
 *  jakarta.inject.Inject
 *  org.apache.commons.lang3.StringUtils
 *  org.jetbrains.annotations.NotNull
 *  org.jetbrains.annotations.Nullable
 *  org.springframework.context.ApplicationListener
 *  org.springframework.dao.IncorrectResultSizeDataAccessException
 *  org.springframework.orm.hibernate5.HibernateCallback
 *  org.springframework.transaction.annotation.Propagation
 *  org.springframework.transaction.annotation.Transactional
 */
package com.l7tech.server.solutionkit;

import com.l7tech.common.io.XmlUtil;
import com.l7tech.gateway.api.Bundle;
import com.l7tech.gateway.api.impl.MarshallingUtils;
import com.l7tech.gateway.common.LicenseException;
import com.l7tech.gateway.common.solutionkit.BadRequestException;
import com.l7tech.gateway.common.solutionkit.EntityOwnershipDescriptor;
import com.l7tech.gateway.common.solutionkit.InstanceModifier;
import com.l7tech.gateway.common.solutionkit.SolutionKit;
import com.l7tech.gateway.common.solutionkit.SolutionKitException;
import com.l7tech.gateway.common.solutionkit.SolutionKitHeader;
import com.l7tech.gateway.common.solutionkit.SolutionKitImportInfo;
import com.l7tech.gateway.common.solutionkit.SolutionKitUtils;
import com.l7tech.objectmodel.DeleteException;
import com.l7tech.objectmodel.Entity;
import com.l7tech.objectmodel.EntityManager;
import com.l7tech.objectmodel.EntityType;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.SaveException;
import com.l7tech.objectmodel.UpdateException;
import com.l7tech.policy.assertion.Assertion;
import com.l7tech.policy.assertion.AssertionStatus;
import com.l7tech.policy.wsp.WspReader;
import com.l7tech.server.HibernateEntityManager;
import com.l7tech.server.message.PolicyEnforcementContext;
import com.l7tech.server.policy.ServerPolicyException;
import com.l7tech.server.policy.ServerPolicyFactory;
import com.l7tech.server.policy.assertion.ServerAssertion;
import com.l7tech.server.policy.bundle.GatewayManagementDocumentUtilities;
import com.l7tech.server.policy.bundle.ssgman.restman.RestmanInvoker;
import com.l7tech.server.policy.bundle.ssgman.restman.RestmanMessage;
import com.l7tech.server.security.rbac.ProtectedEntityTracker;
import com.l7tech.server.solutionkit.SolutionKitManager;
import com.l7tech.server.solutionkit.f;
import com.l7tech.server.solutionkit.g;
import com.l7tech.server.solutionkit.h;
import com.l7tech.server.solutionkit.i;
import com.l7tech.server.solutionkit.j;
import com.l7tech.server.solutionkit.k;
import com.l7tech.server.solutionkit.l;
import com.l7tech.server.solutionkit.m;
import com.l7tech.server.util.PostStartupTransactionalApplicationListener;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.MissingRequiredElementException;
import com.l7tech.util.Pair;
import com.l7tech.util.TooManyChildElementsException;
import jakarta.inject.Inject;
import java.io.IOException;
import java.io.StringReader;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.context.ApplicationListener;
import org.springframework.dao.IncorrectResultSizeDataAccessException;
import org.springframework.orm.hibernate5.HibernateCallback;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;

/*
 * Exception performing whole class analysis ignored.
 */
public class SolutionKitManagerImpl
extends HibernateEntityManager<SolutionKit, SolutionKitHeader>
implements SolutionKitManager,
PostStartupTransactionalApplicationListener {
    private static final Logger m;
    private static final String n;
    private final String o;
    private final String p;
    private final String q;
    private final String r;
    private final String s;
    private ServerAssertion t;
    private RestmanInvoker u;
    @Inject
    private ProtectedEntityTracker protectedEntityTracker;
    private Callable<Pair<AssertionStatus, RestmanMessage>> v;
    private static final String w;
    private static final String[] x;

    public SolutionKitManagerImpl() {
        String[] stringArray = x;
        this.o = stringArray[27];
        this.p = stringArray[39];
        String string = this.getTableName();
        String string2 = this.getImpClass().getName();
        String string3 = this.getTableName();
        this.q = stringArray[75] + string3 + stringArray[32] + string2 + stringArray[69] + string + stringArray[65];
        String string4 = this.getTableName();
        String string5 = this.getImpClass().getName();
        String string6 = this.getTableName();
        this.r = stringArray[5] + string6 + stringArray[50] + string5 + stringArray[25] + string4 + stringArray[40];
        String string7 = this.getTableName();
        String string8 = this.getImpClass().getName();
        String string9 = this.getTableName();
        this.s = stringArray[5] + string9 + stringArray[50] + string8 + stringArray[25] + string7 + stringArray[2];
        this.t = null;
    }

    public void initDao() throws Exception {
        try {
            super.initDao();
            if (null == this.protectedEntityTracker) {
                throw new IllegalStateException(x[7]);
            }
        }
        catch (Exception exception) {
            throw SolutionKitManagerImpl.a(exception);
        }
        this.a();
    }

    public Class<? extends Entity> getImpClass() {
        return SolutionKit.class;
    }

    @Override
    public Goid save(SolutionKit solutionKit) throws SaveException {
        try {
            solutionKit.setLastUpdateTime(System.currentTimeMillis());
            if (null != solutionKit.getProperty(SolutionKit.SK_PROP_INSTANCE_MODIFIER_KEY)) {
                m.log(Level.INFO, x[57] + solutionKit.getName() + x[52] + solutionKit.getProperty(SolutionKit.SK_PROP_INSTANCE_MODIFIER_KEY));
            }
        }
        catch (SaveException saveException) {
            throw SolutionKitManagerImpl.a((Exception)((Object)saveException));
        }
        return super.save(solutionKit);
    }

    @Override
    public void update(SolutionKit solutionKit) throws UpdateException {
        try {
            solutionKit.setLastUpdateTime(System.currentTimeMillis());
            super.update(solutionKit);
            if (null != solutionKit.getProperty(SolutionKit.SK_PROP_INSTANCE_MODIFIER_KEY)) {
                m.log(Level.INFO, x[42] + solutionKit.getName() + x[29] + solutionKit.getProperty(SolutionKit.SK_PROP_INSTANCE_MODIFIER_KEY));
            }
        }
        catch (UpdateException updateException) {
            throw SolutionKitManagerImpl.a((Exception)((Object)updateException));
        }
    }

    @Override
    public void delete(SolutionKit solutionKit) throws DeleteException {
        try {
            solutionKit.setLastUpdateTime(System.currentTimeMillis());
            super.delete(solutionKit);
            if (null != solutionKit.getProperty(SolutionKit.SK_PROP_INSTANCE_MODIFIER_KEY)) {
                m.log(Level.INFO, x[57] + solutionKit.getName() + x[35] + solutionKit.getProperty(SolutionKit.SK_PROP_INSTANCE_MODIFIER_KEY));
            }
        }
        catch (DeleteException deleteException) {
            throw SolutionKitManagerImpl.a((Exception)((Object)deleteException));
        }
    }

    private void a() throws FindException {
        ArrayList<Pair<EntityType, String>> arrayList = new ArrayList<Pair<EntityType, String>>();
        HashMap<String, EntityOwnershipDescriptor> hashMap = new HashMap<String, EntityOwnershipDescriptor>();
        for (SolutionKit solutionKit : this.findAll()) {
            for (EntityOwnershipDescriptor entityOwnershipDescriptor : solutionKit.getEntityOwnershipDescriptors()) {
                block9: {
                    EntityOwnershipDescriptor entityOwnershipDescriptor2 = (EntityOwnershipDescriptor)hashMap.get(entityOwnershipDescriptor.getEntityId());
                    try {
                        try {
                            if (entityOwnershipDescriptor2 == null) break block9;
                            if (entityOwnershipDescriptor.getVersionStamp() < entityOwnershipDescriptor2.getVersionStamp()) continue;
                        }
                        catch (FindException findException) {
                            throw SolutionKitManagerImpl.a((Exception)((Object)findException));
                        }
                        hashMap.put(entityOwnershipDescriptor.getEntityId(), entityOwnershipDescriptor);
                        continue;
                    }
                    catch (FindException findException) {
                        throw SolutionKitManagerImpl.a((Exception)((Object)findException));
                    }
                }
                hashMap.put(entityOwnershipDescriptor.getEntityId(), entityOwnershipDescriptor);
            }
        }
        for (SolutionKit solutionKit : hashMap.values()) {
            try {
                if (!solutionKit.isReadOnly()) continue;
                arrayList.add((Pair<EntityType, String>)Pair.pair((Object)solutionKit.getEntityType(), (Object)solutionKit.getEntityId()));
            }
            catch (FindException findException) {
                throw SolutionKitManagerImpl.a((Exception)((Object)findException));
            }
        }
        this.protectedEntityTracker.bulkUpdateReadOnlyEntitiesList(arrayList);
    }

    @Override
    @Transactional(propagation=Propagation.NOT_SUPPORTED)
    @NotNull
    public String importBundles(@NotNull SolutionKitImportInfo solutionKitImportInfo, boolean bl2) throws Exception {
        String string;
        try {
            if (solutionKitImportInfo == null) {
                SolutionKitManagerImpl.b(0);
            }
        }
        catch (GatewayManagementDocumentUtilities.AccessDeniedManagementResponse accessDeniedManagementResponse) {
            throw SolutionKitManagerImpl.a(accessDeniedManagementResponse);
        }
        RestmanInvoker restmanInvoker = this.getRestmanInvoker();
        List list = solutionKitImportInfo.getSolutionKitsToDelete();
        Map map = solutionKitImportInfo.getSolutionKitsToInstall();
        SolutionKit solutionKit = SolutionKitUtils.solutionKitToDisplayForUpgrade(map.keySet(), (SolutionKit)solutionKitImportInfo.getParentSolutionKit());
        try {
            Pair<AssertionStatus, RestmanMessage> pair;
            block17: {
                Object object;
                String[] stringArray;
                Object object322;
                ArrayList<Bundle> arrayList = new ArrayList<Bundle>();
                for (Object object322 : list) {
                    Bundle object22 = (Bundle)MarshallingUtils.unmarshal(Bundle.class, (Source)new StreamSource(new StringReader(object322.getUninstallBundle())), (boolean)true);
                    stringArray = x;
                    object22.setName(object322.getName() + stringArray[11]);
                    arrayList.add(object22);
                }
                ArrayList arrayList2 = new ArrayList();
                for (Map.Entry entry : map.entrySet()) {
                    Object object2;
                    pair = ((SolutionKit)entry.getKey()).getProperty(SolutionKit.SK_PROP_INSTANCE_MODIFIER_KEY);
                    object = (String)entry.getValue();
                    if (InstanceModifier.isValidVersionModifier((String)pair)) {
                        stringArray = x;
                        m.fine(stringArray[45] + (String)pair + stringArray[46] + ((SolutionKit)entry.getKey()).getName());
                        object2 = new RestmanMessage((String)object);
                        new InstanceModifier(((RestmanMessage)object2).getBundleReferenceItems(), ((RestmanMessage)object2).getMappings(), pair).apply();
                        object = ((RestmanMessage)object2).getAsString();
                    }
                    object2 = (Bundle)MarshallingUtils.unmarshal(Bundle.class, (Source)new StreamSource(new StringReader((String)object)), (boolean)true);
                    stringArray = x;
                    object2.setName(((SolutionKit)entry.getKey()).getName() + stringArray[68]);
                    arrayList2.add(object2);
                }
                object322 = SolutionKitUtils.generateBundleListPayload(arrayList, (List)arrayList2);
                PolicyEnforcementContext policyEnforcementContext = restmanInvoker.getContext((String)object322);
                stringArray = x;
                policyEnforcementContext.setVariable(stringArray[41], stringArray[21] + this.a(solutionKit, bl2));
                try {
                    pair = this.protectedEntityTracker.doWithEntityProtectionDisabled(this.a(restmanInvoker, policyEnforcementContext, (String)object322));
                }
                catch (GatewayManagementDocumentUtilities.AccessDeniedManagementResponse | GatewayManagementDocumentUtilities.UnexpectedManagementResponse | InterruptedException exception) {
                    throw exception;
                }
                catch (Exception exception) {
                    throw new RuntimeException(exception);
                }
                if (AssertionStatus.NONE != pair.left) {
                    stringArray = x;
                    object = stringArray[34] + ((AssertionStatus)pair.left).getMessage();
                    m.log(Level.WARNING, (String)object);
                    throw new SolutionKitException(((AssertionStatus)pair.left).getMessage());
                }
                try {
                    if (bl2 || !((RestmanMessage)pair.right).hasMappingErrorFromBundles()) break block17;
                }
                catch (GatewayManagementDocumentUtilities.AccessDeniedManagementResponse accessDeniedManagementResponse) {
                    throw SolutionKitManagerImpl.a(accessDeniedManagementResponse);
                }
                object = x[17] + ((RestmanMessage)pair.right).getAsString();
                m.log(Level.WARNING, (String)object);
                throw new BadRequestException(((RestmanMessage)pair.right).getAsString());
            }
            string = ((RestmanMessage)pair.right).getAsString();
        }
        catch (GatewayManagementDocumentUtilities.AccessDeniedManagementResponse | IOException | SAXException exception) {
            m.log(Level.WARNING, ExceptionUtils.getMessage((Throwable)exception), ExceptionUtils.getDebugException((Throwable)exception));
            throw new SolutionKitException(ExceptionUtils.getMessage((Throwable)exception), (Throwable)exception);
        }
        catch (GatewayManagementDocumentUtilities.UnexpectedManagementResponse unexpectedManagementResponse) {
            m.log(Level.WARNING, ExceptionUtils.getMessage((Throwable)unexpectedManagementResponse), ExceptionUtils.getDebugException((Throwable)unexpectedManagementResponse));
            throw this.a(unexpectedManagementResponse);
        }
        catch (InterruptedException interruptedException) {
            return "";
        }
        if (string == null) {
            SolutionKitManagerImpl.b(1);
        }
        return string;
    }

    @Override
    @Transactional(propagation=Propagation.NOT_SUPPORTED)
    @NotNull
    public String importBundle(@NotNull String string, @NotNull SolutionKit solutionKit, boolean bl2) throws Exception {
        String string2;
        try {
            if (string == null) {
                SolutionKitManagerImpl.b(2);
            }
        }
        catch (GatewayManagementDocumentUtilities.AccessDeniedManagementResponse accessDeniedManagementResponse) {
            throw SolutionKitManagerImpl.a(accessDeniedManagementResponse);
        }
        try {
            if (solutionKit == null) {
                SolutionKitManagerImpl.b(3);
            }
        }
        catch (GatewayManagementDocumentUtilities.AccessDeniedManagementResponse accessDeniedManagementResponse) {
            throw SolutionKitManagerImpl.a(accessDeniedManagementResponse);
        }
        RestmanInvoker restmanInvoker = this.getRestmanInvoker();
        try {
            Pair<AssertionStatus, RestmanMessage> pair;
            block19: {
                String string3;
                Object object;
                String string4 = solutionKit.getProperty(SolutionKit.SK_PROP_INSTANCE_MODIFIER_KEY);
                if (InstanceModifier.isValidVersionModifier((String)string4)) {
                    object = new RestmanMessage(string);
                    new InstanceModifier(((RestmanMessage)object).getBundleReferenceItems(), ((RestmanMessage)object).getMappings(), string4).apply();
                    string3 = ((RestmanMessage)object).getAsString();
                } else {
                    string3 = string;
                }
                object = restmanInvoker.getContext(string3);
                String[] stringArray = x;
                object.setVariable(stringArray[44], stringArray[54] + this.a(solutionKit, bl2));
                try {
                    pair = this.protectedEntityTracker.doWithEntityProtectionDisabled(this.a(restmanInvoker, (PolicyEnforcementContext)object, string3));
                }
                catch (GatewayManagementDocumentUtilities.AccessDeniedManagementResponse | GatewayManagementDocumentUtilities.UnexpectedManagementResponse | InterruptedException exception) {
                    throw exception;
                }
                catch (Exception exception) {
                    throw new RuntimeException(exception);
                }
                if (AssertionStatus.NONE != pair.left) {
                    stringArray = x;
                    String string5 = stringArray[66] + ((AssertionStatus)pair.left).getMessage();
                    m.log(Level.WARNING, string5);
                    throw new SolutionKitException(((AssertionStatus)pair.left).getMessage());
                }
                try {
                    if (bl2 || !((RestmanMessage)pair.right).hasMappingError()) break block19;
                }
                catch (GatewayManagementDocumentUtilities.AccessDeniedManagementResponse accessDeniedManagementResponse) {
                    throw SolutionKitManagerImpl.a(accessDeniedManagementResponse);
                }
                String string6 = x[10] + ((RestmanMessage)pair.right).getAsString();
                m.log(Level.WARNING, string6);
                throw new BadRequestException(((RestmanMessage)pair.right).getAsString());
            }
            string2 = ((RestmanMessage)pair.right).getAsString();
        }
        catch (GatewayManagementDocumentUtilities.AccessDeniedManagementResponse | IOException | SAXException exception) {
            m.log(Level.WARNING, ExceptionUtils.getMessage((Throwable)exception), ExceptionUtils.getDebugException((Throwable)exception));
            throw new SolutionKitException(ExceptionUtils.getMessage((Throwable)exception), (Throwable)exception);
        }
        catch (GatewayManagementDocumentUtilities.UnexpectedManagementResponse unexpectedManagementResponse) {
            m.log(Level.WARNING, ExceptionUtils.getMessage((Throwable)unexpectedManagementResponse), ExceptionUtils.getDebugException((Throwable)unexpectedManagementResponse));
            throw this.a(unexpectedManagementResponse);
        }
        catch (InterruptedException interruptedException) {
            return "";
        }
        if (string2 == null) {
            SolutionKitManagerImpl.b(4);
        }
        return string2;
    }

    private SolutionKitException a(@NotNull GatewayManagementDocumentUtilities.UnexpectedManagementResponse unexpectedManagementResponse) throws Exception {
        try {
            if (unexpectedManagementResponse == null) {
                SolutionKitManagerImpl.b(5);
            }
        }
        catch (SAXException sAXException) {
            throw SolutionKitManagerImpl.a(sAXException);
        }
        try {
            Document document = XmlUtil.parse((String)ExceptionUtils.getMessage((Throwable)unexpectedManagementResponse));
            String[] stringArray = x;
            Element element = XmlUtil.findExactlyOneChildElementByName((Element)document.getDocumentElement(), (String)document.getNamespaceURI(), (String)stringArray[24]);
            String string = XmlUtil.getTextValue((Element)element, (boolean)true);
            Element element2 = XmlUtil.findExactlyOneChildElementByName((Element)document.getDocumentElement(), (String)document.getNamespaceURI(), (String)stringArray[63]);
            String string2 = XmlUtil.getTextValue((Element)element2, (boolean)true);
            if (stringArray[36].equalsIgnoreCase(string)) {
                return new BadRequestException(string2);
            }
            try {
                if (string2.contains(x[8])) {
                    throw new Exception(string2);
                }
            }
            catch (SAXException sAXException) {
                throw SolutionKitManagerImpl.a(sAXException);
            }
            return new SolutionKitException(string2);
        }
        catch (MissingRequiredElementException | TooManyChildElementsException | SAXException throwable) {
            throw unexpectedManagementResponse;
        }
    }

    @Override
    @Transactional(readOnly=true)
    @NotNull
    public List<SolutionKit> findBySolutionKitGuid(@NotNull String string) throws FindException {
        List<SolutionKit> list;
        try {
            if (string == null) {
                SolutionKitManagerImpl.b(6);
            }
        }
        catch (Exception exception) {
            throw SolutionKitManagerImpl.a(exception);
        }
        try {
            list = this.a(this.q, x[74], string);
        }
        catch (Exception exception) {
            throw new FindException(exception.toString(), (Throwable)exception);
        }
        if (list == null) {
            SolutionKitManagerImpl.b(7);
        }
        return list;
    }

    private List<SolutionKit> a(@NotNull String string, @NotNull String string2, @NotNull String string3) throws FindException {
        try {
            if (string == null) {
                SolutionKitManagerImpl.b(8);
            }
        }
        catch (Exception exception) {
            throw SolutionKitManagerImpl.a(exception);
        }
        try {
            if (string2 == null) {
                SolutionKitManagerImpl.b(9);
            }
        }
        catch (Exception exception) {
            throw SolutionKitManagerImpl.a(exception);
        }
        try {
            if (string3 == null) {
                SolutionKitManagerImpl.b(10);
            }
        }
        catch (Exception exception) {
            throw SolutionKitManagerImpl.a(exception);
        }
        try {
            return (List)this.getHibernateTemplate().execute((HibernateCallback)new k(this, string, string2, string3));
        }
        catch (Exception exception) {
            throw new FindException(exception.toString(), (Throwable)exception);
        }
    }

    @Override
    @Transactional(readOnly=true)
    public SolutionKit findBySolutionKitNameAndIM(@NotNull String string, @Nullable String string2) throws FindException {
        try {
            if (string == null) {
                SolutionKitManagerImpl.b(11);
            }
        }
        catch (Exception exception) {
            throw SolutionKitManagerImpl.a(exception);
        }
        try {
            return this.a(this.a(this.r, x[16], string), string2);
        }
        catch (Exception exception) {
            throw new FindException(exception.getMessage(), (Throwable)exception);
        }
    }

    @Override
    public SolutionKit findBySolutionKitGuidAndIM(@NotNull String string, @Nullable String string2) throws FindException {
        try {
            if (string == null) {
                SolutionKitManagerImpl.b(12);
            }
        }
        catch (FindException findException) {
            throw SolutionKitManagerImpl.a((Exception)((Object)findException));
        }
        return this.a(this.findBySolutionKitGuid(string), string2);
    }

    @Nullable
    private SolutionKit a(@NotNull List<SolutionKit> list, @Nullable String string) throws IncorrectResultSizeDataAccessException {
        try {
            if (list == null) {
                SolutionKitManagerImpl.b(13);
            }
        }
        catch (IncorrectResultSizeDataAccessException incorrectResultSizeDataAccessException) {
            throw SolutionKitManagerImpl.a((Exception)((Object)incorrectResultSizeDataAccessException));
        }
        SolutionKit solutionKit = null;
        for (SolutionKit solutionKit2 : list) {
            block13: {
                String string2 = solutionKit2.getProperty(SolutionKit.SK_PROP_INSTANCE_MODIFIER_KEY);
                try {
                    block12: {
                        try {
                            try {
                                try {
                                    if (StringUtils.isBlank((CharSequence)string) && StringUtils.isBlank((CharSequence)string2)) break block12;
                                }
                                catch (IncorrectResultSizeDataAccessException incorrectResultSizeDataAccessException) {
                                    throw SolutionKitManagerImpl.a((Exception)((Object)incorrectResultSizeDataAccessException));
                                }
                                if (string == null) continue;
                            }
                            catch (IncorrectResultSizeDataAccessException incorrectResultSizeDataAccessException) {
                                throw SolutionKitManagerImpl.a((Exception)((Object)incorrectResultSizeDataAccessException));
                            }
                            if (!string.equals(string2)) continue;
                        }
                        catch (IncorrectResultSizeDataAccessException incorrectResultSizeDataAccessException) {
                            throw SolutionKitManagerImpl.a((Exception)((Object)incorrectResultSizeDataAccessException));
                        }
                    }
                    if (solutionKit != null) break block13;
                }
                catch (IncorrectResultSizeDataAccessException incorrectResultSizeDataAccessException) {
                    throw SolutionKitManagerImpl.a((Exception)((Object)incorrectResultSizeDataAccessException));
                }
                solutionKit = solutionKit2;
                continue;
            }
            throw new IncorrectResultSizeDataAccessException(x[38], 1);
        }
        return solutionKit;
    }

    @Override
    public List<SolutionKitHeader> findAllChildrenHeadersByParentGoid(@NotNull Goid goid) throws FindException {
        try {
            if (goid == null) {
                SolutionKitManagerImpl.b(14);
            }
        }
        catch (Exception exception) {
            throw SolutionKitManagerImpl.a(exception);
        }
        try {
            return (List)this.getHibernateTemplate().execute((HibernateCallback)new l(this, goid));
        }
        catch (Exception exception) {
            throw new FindException(exception.toString(), (Throwable)exception);
        }
    }

    @Override
    @NotNull
    public Collection<SolutionKit> findAllChildrenByParentGoid(@NotNull Goid goid) throws FindException {
        Collection collection;
        try {
            if (goid == null) {
                SolutionKitManagerImpl.b(15);
            }
        }
        catch (Exception exception) {
            throw SolutionKitManagerImpl.a(exception);
        }
        try {
            collection = (Collection)this.getHibernateTemplate().execute((HibernateCallback)new m(this, goid));
        }
        catch (Exception exception) {
            throw new FindException(exception.toString(), (Throwable)exception);
        }
        if (collection == null) {
            SolutionKitManagerImpl.b(16);
        }
        return collection;
    }

    @Override
    @Transactional(readOnly=false)
    public void decrementEntitiesVersionStamp(@NotNull Collection<String> collection, @NotNull Goid goid) throws UpdateException {
        try {
            if (collection == null) {
                SolutionKitManagerImpl.b(17);
            }
        }
        catch (Exception exception) {
            throw SolutionKitManagerImpl.a(exception);
        }
        try {
            if (goid == null) {
                SolutionKitManagerImpl.b(18);
            }
        }
        catch (Exception exception) {
            throw SolutionKitManagerImpl.a(exception);
        }
        if (!collection.isEmpty()) {
            try {
                this.getHibernateTemplate().execute((HibernateCallback)new f(this, collection, goid));
            }
            catch (Exception exception) {
                throw new UpdateException(exception.toString(), (Throwable)exception);
            }
        }
    }

    @NotNull
    public ApplicationListener getListener() {
        return new g(this);
    }

    @Override
    protected SolutionKitHeader newHeader(SolutionKit solutionKit) {
        return new SolutionKitHeader(solutionKit);
    }

    @Override
    protected EntityManager.UniqueType getUniqueType() {
        return EntityManager.UniqueType.NONE;
    }

    protected void setRestmanInvoker(RestmanInvoker restmanInvoker) {
        this.u = restmanInvoker;
    }

    protected void setProtectedEntityTracker(ProtectedEntityTracker protectedEntityTracker) {
        this.protectedEntityTracker = protectedEntityTracker;
    }

    protected void setProtectedEntityTrackerCallable(Callable<Pair<AssertionStatus, RestmanMessage>> callable) {
        this.v = callable;
    }

    private Callable<Pair<AssertionStatus, RestmanMessage>> a(RestmanInvoker restmanInvoker, PolicyEnforcementContext policyEnforcementContext, String string) {
        try {
            if (this.v != null) {
                return this.v;
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw SolutionKitManagerImpl.a(illegalStateException);
        }
        return new h(this, restmanInvoker, policyEnforcementContext, string);
    }

    protected RestmanInvoker getRestmanInvoker() throws SolutionKitException {
        i i2;
        try {
            if (this.u != null) {
                return this.u;
            }
        }
        catch (IOException iOException) {
            throw SolutionKitManagerImpl.a(iOException);
        }
        if (this.t == null) {
            String[] stringArray = x;
            i2 = (WspReader)this.applicationContext.getBean(stringArray[6], WspReader.class);
            ServerPolicyFactory serverPolicyFactory = (ServerPolicyFactory)this.applicationContext.getBean(stringArray[43], ServerPolicyFactory.class);
            try {
                Assertion assertion = i2.parseStrictly(stringArray[55], WspReader.Visibility.omitDisabled);
                this.t = serverPolicyFactory.compilePolicy(assertion, false);
            }
            catch (LicenseException | ServerPolicyException | IOException object) {
                m.log(Level.WARNING, ExceptionUtils.getMessage((Throwable)object), ExceptionUtils.getDebugException((Throwable)object));
                throw new SolutionKitException(x[70], (Throwable)object);
            }
        }
        i2 = new i(this);
        return new RestmanInvoker(new j(this), i2);
    }

    protected List<SolutionKitHeader> convertToHTList(@NotNull List<SolutionKit> list) {
        try {
            if (list == null) {
                SolutionKitManagerImpl.b(19);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw SolutionKitManagerImpl.a(illegalStateException);
        }
        ArrayList<SolutionKitHeader> arrayList = new ArrayList<SolutionKitHeader>(list.size());
        for (SolutionKit solutionKit : list) {
            arrayList.add(new SolutionKitHeader(solutionKit));
        }
        return arrayList;
    }

    private String a(SolutionKit solutionKit, boolean bl2) throws UnsupportedEncodingException {
        String[] stringArray = x;
        String string = MessageFormat.format(stringArray[64], solutionKit.getName(), solutionKit.getSolutionKitVersion());
        StringBuilder stringBuilder = new StringBuilder().append("?");
        try {
            stringBuilder.append(stringArray[33]).append(URLEncoder.encode(string, stringArray[56]));
        }
        catch (UnsupportedEncodingException unsupportedEncodingException) {
            stringArray = x;
            m.warning(stringArray[23] + string + stringArray[22]);
            throw unsupportedEncodingException;
        }
        try {
            if (bl2) {
                stringBuilder.append(x[37]);
            }
        }
        catch (UnsupportedEncodingException unsupportedEncodingException) {
            throw SolutionKitManagerImpl.a(unsupportedEncodingException);
        }
        return stringBuilder.toString();
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[82];
                var3_1 = 0;
                var2_2 = "P\u001aQ}\u0006IRL\u0019E~\u0011\u0015^\u0012U@\u0011NdT\u0016OW\u0006O\u007fK3Df\u0015T|\u0019\u0017\u0007@`\u0011Sd~\u0018HvT\u00000\u0003\u0007@`\u0011Sd~\u0018Hv\fP\u001aQ}\u0006IRL\u0019E~\u0011\fJ\u0018Mg\u0000T\u007fW<Hf\u0007\u0005\u007f%n_T\tN\u0004Q@\u0011\\t\\\u0005/i\u0005Nf\u0011^d\\\u0013\u0001W\u001aIyM\u000e\u0001F\u0006\\sR\u0012S2\u0017R}I\u0018Ow\u001aI0P\u0004\u0001`\u0011LeP\u0005DvZ\t|\u000fBw\u0004IyV\u0019\u0017\\\u000fDq\u0001Iuh\u0002D`\rnyW\u0010Mw$\\bX\u001a0l\u0019@p\u0018X0M\u0018\u0001{\u001aNdX\u001bM2\u0016H~]\u001bD2\u0010Hu\u0019\u0003N2\u0019\\`I\u001eOuTXbK\u0018SaN7\u000e\u00193D~\u0011Iu\u00195T|\u0010Qu>x\u0005Fg\u0019X~MWG}\u0006\u001dPw\u0018U\\\u0001Q|\u0019\u0007@`\u0015PuM\u0012S2S\u0018c\u001eWNtT\u0018c\u0017RR2\u0019HcMWO}\u0000\u001dr\\WOg\u0018Q\bT\u0012Us\u0010\\dX\u001a_\u001eOv6DCV\u001bTf\u001dR~r\u001eUU\u0001Ttx\u0019E[9\u000fJ\u0018Mg\u0000T\u007fW<Hf:\\}\\\u000fJ\u0018Mg\u0000T\u007fW<Hf:\\}\\1l\u0019@p\u0018X0M\u0018\u0001{\u001aNdX\u001bM2\u0016H~]\u001bDaTYe\\WU}TPqI\u0007H|\u0013\u001duK\u0005N`\u0007\u0007\u001a\u001d]\u0012B`\u0011PuW\u0003d|\u0000TdP\u0012RD\u0011OcP\u0018OA\u0000\\}I4Z\u0018L=\u0018\nd\\\u0014I=\u0007XbO\u0012S=\u0007R|L\u0003H}\u001aVyMXr}\u0018HdP\u0018OY\u001dI]X\u0019@u\u0011OYT\u0007M\rP\u001aQ}\u0006IRL\u0019E~\u0011N\u0010\bY\u0011=\u0016H~]\u001bD=\u0016\\dZ\u001f\r\u001eWTa\u001dSw\u0019\"uTY\u00057l\u0019Dj\u0004XsM\u0012E2\u0011Es\\\u0007U{\u001bS0\\\u0019B}\u0010T~^WQ}\u0018Ts@WSw\u0002TcP\u0018O2\u0017R}T\u0012OfT\u001a\u0004m\u000eQw\u0007\u0019 iW&x0\u0006[\u0002Ov\u0018X\r}\u0012Mw\u0000X0{\u0002Ov\u0018X\u001b_\u001eOv5Q|z\u001fH~\u0010OuW5XB\u0015OuW\u0003f}\u001dY+\u0010WIs\u0007\u001dr\\\u0012O2\u0001MwK\u0016Ew\u0010\u001d\u007fWWh|\u0007IqW\u0014D29RtP\u0011Hw\u0006\u001d*\u0019\u0015_\u001eOv6DCV\u001bTf\u001dR~r\u001eUU\u0001Tt\u000fZ\u0018Od\u0011Odm\u0018iF8TcM\n\u0019>o27qQj$\u0001\u000fO\u0012Sa\u001dR~z\u0018L\u007f\u0011Sd\u0004Ol\u0019@p\u0018X0M\u0018\u0001{\u001aNdX\u001bM2\u0016H~]\u001bDaZ\u001dVX\u001eMw\u0010\u001ddVWH|\u0002R{\\WsW'i0~\u0016Uw\u0003\\i\u0019:@|\u0015ZuT\u0012OfT\\cJ\u0012Sf\u001dR~\u0003W*\u0010WIs\u0007\u001dr\\\u0012O2\u0010X|\\\u0003DvTR~\u0019>Oa\u0000\\~Z\u0012\u0001_\u001bYy_\u001eD`T\u00070\u000fp\u0019Ws\u0018Ttk\u0012R}\u0001Os\\\n\u001f\u0003Da\u0000\u0000dK\u0002D%h\u0002D`\r\u001dtP\u0013\u0001|\u001bI0K\u0012Ug\u0006S0XWT|\u001dLe\\WSw\u0007H|MY\u000ep\u0019Rf\u0015Q|\u00195T|\u0010Qu\u0018\u0017\u0019@\u007f\u0011\u001d-\u0019MR}\u0018HdP\u0018OY\u001dI^X\u001aD\u0012k\u0012Rf3\\d\\\u0000@k9\\~\u0017\u0002S{\u000ej\u0018Mg\u0000T\u007fWWj{\u0000\u001d8\rI\u0018M{\u0017DVX\u0014U}\u0006D\u0012k\u0012Rf3\\d\\\u0000@k9\\~\u0017\u0002S{\u001bx\u0007Q~\u001dXt\u0019\u001eOa\u0000\\~Z\u0012\u0001\u007f\u001bYy_\u001eD`T\u0015\u0014\u0010WL}\u0010TvP\u0014@f\u001dR~JWG}\u0006\u001d\u000bJ\u0018Mg\u0000T\u007fW<Hf\rP\u001aQ}\u0006IRL\u0019E~\u0011N\"_\u001eOv5Q|z\u001fH~\u0010OuW?Ds\u0010XbJ5XB\u0015OuW\u0003f}\u001dY\n\u0019>o27qQj$\u0001\u0015_\u001eOv6DCV\u001bTf\u001dR~r\u001eUU\u0001Tt2\u0010WHaT\\rV\u0002U2\u0000R0[\u0012\u0001{\u001aNdX\u001bMw\u0010\u001d\u007fWWh|\u0007IqW\u0014D29RtP\u0011Hw\u0006\u001d*\u0019\u001b^\u0012UP\rh~P\u0006Tw=ScM\u0016Oq\u0011p\u007f]\u001eG{\u0011O\n\bY\u0011=\u0016H~]\u001bD\u0134\u0005\u0000RbNm\u007fU\u001eBkTE}U\u0019R(8\n`\u0004UIf\u0000M*\u0016XVe\u0003\u0013|X\u000eD`CIuZ\u001f\u000fq\u001bP?N\u0004\u000eb\u001bQyZ\u000e\u00032\fP|W\u0004\u001be\u0007M-\u001b\u001fUf\u0004\u0007?\u0016\u0004Bz\u0011PqJYY\u007f\u0018N\u007fX\u0007\u000f}\u0006Z?N\u0004\u000e D\r\"\u0016F\u0013=\u0004R|P\u0014X0J\u0001gJ\u0007\u001bS\u0018Q0N\u0004Q(!Nq^\u0012\u001c0&XaL\u001eSw\u0010\u001f.\u0005;\u0016bNoUj#fs\u0000XgX\u000els\u001a\\w\\\u001aD|\u0000\u0003,u@Q(;Ix\\\u0005us\u0006ZuM:Da\u0007\\w\\!@`\u001d\\rU\u0012\u0001a\u0000OyW\u0010ws\u0018Hu\u0004USw\u0005HuJ\u0003\u0003=J\u0001\\\u000e\u0007\u001bF\u0015Ow\\\u0003\u0001f\u0015Ow\\\u0003\u001c0;iX|%\u0003=J\u0001?u@Q(&xCm0@f\u0011Jq@:@|\u0015ZuT\u0012OfJ\u0001?N\u0004Q(5Q|\u0007K\u000ee\u0007M*i\u0018M{\u0017D.\u0005l#g?L\u000ej\u0018Mg\u0000T\u007fWWj{\u0000\u001d8\nI\u0016Sw\u001aIWV\u001eE\u0015J\u0018Mg\u0000T\u007fW<Hf=P`V\u0005U[\u001a[\u007f\u0006J\u001cm{\u0007Isl'eS x0J\u0018Mg\u0000T\u007fW(J{\u0000b}\\\u0003@2\u0007Xd\u0019\u0001D`\u0007T\u007fW(Rf\u0015P`\u0004\u0001D`\u0007T\u007fW(Rf\u0015P`\u0014F\u0001E<xB|WD|\u0000Td@(HvTT~\u0019_\u001b{\u0010N9\u0019\u0016OvTN\u007fU\u0002U{\u001bSOR\u001eUM\u0013Ry]K\u001f(\u0007VWV\u001eE\t\\\u0019U{\u0000DY]\u0004\u0006}\u0012Us\u001dQ\nBG\\2\\Kk\b\n\b#\u0017\u0004N~\u0001IyV\u0019j{\u0000zeP\u0013\u0001/T\u0007cV\u001bTf\u001dR~r\u001eUU\u0001TtNl\u0019@p\u0018X0M\u0018\u0001{\u001aNdX\u001bM2\u0016H~]\u001bD<T{qP\u001bDvTI\u007f\u0019\u001eOd\u001bVu\u0019%dA \u001dWX\u0003De\u0015D0t\u0016Os\u0013X}\\\u0019U2\u0015Nc\\\u0005U{\u001bS*\u0019\u0134\u0005\u0000RbNm\u007fU\u001eBkTE}U\u0019R(8\n`\u0004UIf\u0000M*\u0016XVe\u0003\u0013|X\u000eD`CIuZ\u001f\u000fq\u001bP?N\u0004\u000eb\u001bQyZ\u000e\u00032\fP|W\u0004\u001be\u0007M-\u001b\u001fUf\u0004\u0007?\u0016\u0004Bz\u0011PqJYY\u007f\u0018N\u007fX\u0007\u000f}\u0006Z?N\u0004\u000e D\r\"\u0016F\u0013=\u0004R|P\u0014X0J\u0001gJ\u0007\u001bS\u0018Q0N\u0004Q(!Nq^\u0012\u001c0&XaL\u001eSw\u0010\u001f.\u0005;\u0016bNoUj#fs\u0000XgX\u000els\u001a\\w\\\u001aD|\u0000\u0003,u@Q(;Ix\\\u0005us\u0006ZuM:Da\u0007\\w\\!@`\u001d\\rU\u0012\u0001a\u0000OyW\u0010ws\u0018Hu\u0004USw\u0005HuJ\u0003\u0003=J\u0001\\\u000e\u0007\u001bF\u0015Ow\\\u0003\u0001f\u0015Ow\\\u0003\u001c0;iX|%\u0003=J\u0001?u@Q(&xCm0@f\u0011Jq@:@|\u0015ZuT\u0012OfJ\u0001?N\u0004Q(5Q|\u0007K\u000ee\u0007M*i\u0018M{\u0017D.\u000f\u0019>Oa\u0000\\|UWcg\u001aY|\\\u0007\u0019 iW&x0:l\u0019@p\u0018X0M\u0018\u0001{\u001aTdP\u0016M{\u000eX0j\u0012Sd\u0011OB|$uU\u0015IuN\u0016X_\u0015Sq^\u0012Lw\u001aIQJ\u0004D`\u0000T\u007fWY4Z\u0018L=\u0018\nd\\\u0014I=\u0007XbO\u0012S=\u0007R|L\u0003H}\u001aVyMXr}\u0018HdP\u0018OY\u001dI]X\u0019@u\u0011OYT\u0007M\u0002\\\u000f\nI\u0016Ss\u0019kqU\u0002D\u000fJ\u0018Mg\u0000T\u007fW<Hf3Hy]\u0005\u007f%n_T\u000fJ\u0018Mg\u0000T\u007fW<Hf3Hy]\u001b_\u001eOv5Q|z\u001fH~\u0010OuW5XB\u0015OuW\u0003f}\u001dY\tI\u0016Ss\u0019sqT\u0012\u0003Q\u0006M";
                var4_3 = "P\u001aQ}\u0006IRL\u0019E~\u0011\u0015^\u0012U@\u0011NdT\u0016OW\u0006O\u007fK3Df\u0015T|\u0019\u0017\u0007@`\u0011Sd~\u0018HvT\u00000\u0003\u0007@`\u0011Sd~\u0018Hv\fP\u001aQ}\u0006IRL\u0019E~\u0011\fJ\u0018Mg\u0000T\u007fW<Hf\u0007\u0005\u007f%n_T\tN\u0004Q@\u0011\\t\\\u0005/i\u0005Nf\u0011^d\\\u0013\u0001W\u001aIyM\u000e\u0001F\u0006\\sR\u0012S2\u0017R}I\u0018Ow\u001aI0P\u0004\u0001`\u0011LeP\u0005DvZ\t|\u000fBw\u0004IyV\u0019\u0017\\\u000fDq\u0001Iuh\u0002D`\rnyW\u0010Mw$\\bX\u001a0l\u0019@p\u0018X0M\u0018\u0001{\u001aNdX\u001bM2\u0016H~]\u001bD2\u0010Hu\u0019\u0003N2\u0019\\`I\u001eOuTXbK\u0018SaN7\u000e\u00193D~\u0011Iu\u00195T|\u0010Qu>x\u0005Fg\u0019X~MWG}\u0006\u001dPw\u0018U\\\u0001Q|\u0019\u0007@`\u0015PuM\u0012S2S\u0018c\u001eWNtT\u0018c\u0017RR2\u0019HcMWO}\u0000\u001dr\\WOg\u0018Q\bT\u0012Us\u0010\\dX\u001a_\u001eOv6DCV\u001bTf\u001dR~r\u001eUU\u0001Ttx\u0019E[9\u000fJ\u0018Mg\u0000T\u007fW<Hf:\\}\\\u000fJ\u0018Mg\u0000T\u007fW<Hf:\\}\\1l\u0019@p\u0018X0M\u0018\u0001{\u001aNdX\u001bM2\u0016H~]\u001bDaTYe\\WU}TPqI\u0007H|\u0013\u001duK\u0005N`\u0007\u0007\u001a\u001d]\u0012B`\u0011PuW\u0003d|\u0000TdP\u0012RD\u0011OcP\u0018OA\u0000\\}I4Z\u0018L=\u0018\nd\\\u0014I=\u0007XbO\u0012S=\u0007R|L\u0003H}\u001aVyMXr}\u0018HdP\u0018OY\u001dI]X\u0019@u\u0011OYT\u0007M\rP\u001aQ}\u0006IRL\u0019E~\u0011N\u0010\bY\u0011=\u0016H~]\u001bD=\u0016\\dZ\u001f\r\u001eWTa\u001dSw\u0019\"uTY\u00057l\u0019Dj\u0004XsM\u0012E2\u0011Es\\\u0007U{\u001bS0\\\u0019B}\u0010T~^WQ}\u0018Ts@WSw\u0002TcP\u0018O2\u0017R}T\u0012OfT\u001a\u0004m\u000eQw\u0007\u0019 iW&x0\u0006[\u0002Ov\u0018X\r}\u0012Mw\u0000X0{\u0002Ov\u0018X\u001b_\u001eOv5Q|z\u001fH~\u0010OuW5XB\u0015OuW\u0003f}\u001dY+\u0010WIs\u0007\u001dr\\\u0012O2\u0001MwK\u0016Ew\u0010\u001d\u007fWWh|\u0007IqW\u0014D29RtP\u0011Hw\u0006\u001d*\u0019\u0015_\u001eOv6DCV\u001bTf\u001dR~r\u001eUU\u0001Tt\u000fZ\u0018Od\u0011Odm\u0018iF8TcM\n\u0019>o27qQj$\u0001\u000fO\u0012Sa\u001dR~z\u0018L\u007f\u0011Sd\u0004Ol\u0019@p\u0018X0M\u0018\u0001{\u001aNdX\u001bM2\u0016H~]\u001bDaZ\u001dVX\u001eMw\u0010\u001ddVWH|\u0002R{\\WsW'i0~\u0016Uw\u0003\\i\u0019:@|\u0015ZuT\u0012OfT\\cJ\u0012Sf\u001dR~\u0003W*\u0010WIs\u0007\u001dr\\\u0012O2\u0010X|\\\u0003DvTR~\u0019>Oa\u0000\\~Z\u0012\u0001_\u001bYy_\u001eD`T\u00070\u000fp\u0019Ws\u0018Ttk\u0012R}\u0001Os\\\n\u001f\u0003Da\u0000\u0000dK\u0002D%h\u0002D`\r\u001dtP\u0013\u0001|\u001bI0K\u0012Ug\u0006S0XWT|\u001dLe\\WSw\u0007H|MY\u000ep\u0019Rf\u0015Q|\u00195T|\u0010Qu\u0018\u0017\u0019@\u007f\u0011\u001d-\u0019MR}\u0018HdP\u0018OY\u001dI^X\u001aD\u0012k\u0012Rf3\\d\\\u0000@k9\\~\u0017\u0002S{\u000ej\u0018Mg\u0000T\u007fWWj{\u0000\u001d8\rI\u0018M{\u0017DVX\u0014U}\u0006D\u0012k\u0012Rf3\\d\\\u0000@k9\\~\u0017\u0002S{\u001bx\u0007Q~\u001dXt\u0019\u001eOa\u0000\\~Z\u0012\u0001\u007f\u001bYy_\u001eD`T\u0015\u0014\u0010WL}\u0010TvP\u0014@f\u001dR~JWG}\u0006\u001d\u000bJ\u0018Mg\u0000T\u007fW<Hf\rP\u001aQ}\u0006IRL\u0019E~\u0011N\"_\u001eOv5Q|z\u001fH~\u0010OuW?Ds\u0010XbJ5XB\u0015OuW\u0003f}\u001dY\n\u0019>o27qQj$\u0001\u0015_\u001eOv6DCV\u001bTf\u001dR~r\u001eUU\u0001Tt2\u0010WHaT\\rV\u0002U2\u0000R0[\u0012\u0001{\u001aNdX\u001bMw\u0010\u001d\u007fWWh|\u0007IqW\u0014D29RtP\u0011Hw\u0006\u001d*\u0019\u001b^\u0012UP\rh~P\u0006Tw=ScM\u0016Oq\u0011p\u007f]\u001eG{\u0011O\n\bY\u0011=\u0016H~]\u001bD\u0134\u0005\u0000RbNm\u007fU\u001eBkTE}U\u0019R(8\n`\u0004UIf\u0000M*\u0016XVe\u0003\u0013|X\u000eD`CIuZ\u001f\u000fq\u001bP?N\u0004\u000eb\u001bQyZ\u000e\u00032\fP|W\u0004\u001be\u0007M-\u001b\u001fUf\u0004\u0007?\u0016\u0004Bz\u0011PqJYY\u007f\u0018N\u007fX\u0007\u000f}\u0006Z?N\u0004\u000e D\r\"\u0016F\u0013=\u0004R|P\u0014X0J\u0001gJ\u0007\u001bS\u0018Q0N\u0004Q(!Nq^\u0012\u001c0&XaL\u001eSw\u0010\u001f.\u0005;\u0016bNoUj#fs\u0000XgX\u000els\u001a\\w\\\u001aD|\u0000\u0003,u@Q(;Ix\\\u0005us\u0006ZuM:Da\u0007\\w\\!@`\u001d\\rU\u0012\u0001a\u0000OyW\u0010ws\u0018Hu\u0004USw\u0005HuJ\u0003\u0003=J\u0001\\\u000e\u0007\u001bF\u0015Ow\\\u0003\u0001f\u0015Ow\\\u0003\u001c0;iX|%\u0003=J\u0001?u@Q(&xCm0@f\u0011Jq@:@|\u0015ZuT\u0012OfJ\u0001?N\u0004Q(5Q|\u0007K\u000ee\u0007M*i\u0018M{\u0017D.\u0005l#g?L\u000ej\u0018Mg\u0000T\u007fWWj{\u0000\u001d8\nI\u0016Sw\u001aIWV\u001eE\u0015J\u0018Mg\u0000T\u007fW<Hf=P`V\u0005U[\u001a[\u007f\u0006J\u001cm{\u0007Isl'eS x0J\u0018Mg\u0000T\u007fW(J{\u0000b}\\\u0003@2\u0007Xd\u0019\u0001D`\u0007T\u007fW(Rf\u0015P`\u0004\u0001D`\u0007T\u007fW(Rf\u0015P`\u0014F\u0001E<xB|WD|\u0000Td@(HvTT~\u0019_\u001b{\u0010N9\u0019\u0016OvTN\u007fU\u0002U{\u001bSOR\u001eUM\u0013Ry]K\u001f(\u0007VWV\u001eE\t\\\u0019U{\u0000DY]\u0004\u0006}\u0012Us\u001dQ\nBG\\2\\Kk\b\n\b#\u0017\u0004N~\u0001IyV\u0019j{\u0000zeP\u0013\u0001/T\u0007cV\u001bTf\u001dR~r\u001eUU\u0001TtNl\u0019@p\u0018X0M\u0018\u0001{\u001aNdX\u001bM2\u0016H~]\u001bD<T{qP\u001bDvTI\u007f\u0019\u001eOd\u001bVu\u0019%dA \u001dWX\u0003De\u0015D0t\u0016Os\u0013X}\\\u0019U2\u0015Nc\\\u0005U{\u001bS*\u0019\u0134\u0005\u0000RbNm\u007fU\u001eBkTE}U\u0019R(8\n`\u0004UIf\u0000M*\u0016XVe\u0003\u0013|X\u000eD`CIuZ\u001f\u000fq\u001bP?N\u0004\u000eb\u001bQyZ\u000e\u00032\fP|W\u0004\u001be\u0007M-\u001b\u001fUf\u0004\u0007?\u0016\u0004Bz\u0011PqJYY\u007f\u0018N\u007fX\u0007\u000f}\u0006Z?N\u0004\u000e D\r\"\u0016F\u0013=\u0004R|P\u0014X0J\u0001gJ\u0007\u001bS\u0018Q0N\u0004Q(!Nq^\u0012\u001c0&XaL\u001eSw\u0010\u001f.\u0005;\u0016bNoUj#fs\u0000XgX\u000els\u001a\\w\\\u001aD|\u0000\u0003,u@Q(;Ix\\\u0005us\u0006ZuM:Da\u0007\\w\\!@`\u001d\\rU\u0012\u0001a\u0000OyW\u0010ws\u0018Hu\u0004USw\u0005HuJ\u0003\u0003=J\u0001\\\u000e\u0007\u001bF\u0015Ow\\\u0003\u0001f\u0015Ow\\\u0003\u001c0;iX|%\u0003=J\u0001?u@Q(&xCm0@f\u0011Jq@:@|\u0015ZuT\u0012OfJ\u0001?N\u0004Q(5Q|\u0007K\u000ee\u0007M*i\u0018M{\u0017D.\u000f\u0019>Oa\u0000\\|UWcg\u001aY|\\\u0007\u0019 iW&x0:l\u0019@p\u0018X0M\u0018\u0001{\u001aTdP\u0016M{\u000eX0j\u0012Sd\u0011OB|$uU\u0015IuN\u0016X_\u0015Sq^\u0012Lw\u001aIQJ\u0004D`\u0000T\u007fWY4Z\u0018L=\u0018\nd\\\u0014I=\u0007XbO\u0012S=\u0007R|L\u0003H}\u001aVyMXr}\u0018HdP\u0018OY\u001dI]X\u0019@u\u0011OYT\u0007M\u0002\\\u000f\nI\u0016Ss\u0019kqU\u0002D\u000fJ\u0018Mg\u0000T\u007fW<Hf3Hy]\u0005\u007f%n_T\u000fJ\u0018Mg\u0000T\u007fW<Hf3Hy]\u001b_\u001eOv5Q|z\u001fH~\u0010OuW5XB\u0015OuW\u0003f}\u001dY\tI\u0016Ss\u0019sqT\u0012\u0003Q\u0006M".length();
                var1_4 = 12;
                var0_5 = -1;
lbl7:
                // 2 sources

                while (true) {
                    v0 = 105;
                    v1 = ++var0_5;
                    v2 = var2_2.substring(v1, v1 + var1_4);
                    v3 = -1;
                    break block9;
                    break;
                }
lbl13:
                // 1 sources

                while (true) {
                    var5[var3_1++] = SolutionKitManagerImpl.b(v0, SolutionKitManagerImpl.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "\fM\u001c%e\u0017\u0010\u0005H\u00075N\u0001-!M\u0006\u000fF\u0003&+J\u0016\bj**j\u001d5i\u001b/\u0006\u0004\u001f$S\u0006,\u000e\u0004W2\tK0JI\u00072SN-\u0005PR3B\u001a6\u0018JR/R\u0002/";
                    var4_3 = "\fM\u001c%e\u0017\u0010\u0005H\u00075N\u0001-!M\u0006\u000fF\u0003&+J\u0016\bj**j\u001d5i\u001b/\u0006\u0004\u001f$S\u0006,\u000e\u0004W2\tK0JI\u00072SN-\u0005PR3B\u001a6\u0018JR/R\u0002/".length();
                    var1_4 = 26;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 58;
                        v4 = ++var0_5;
                        v2 = var2_2.substring(v4, v4 + var1_4);
                        v3 = 0;
                        break block9;
                        break;
                    }
                    break;
                }
lbl28:
                // 1 sources

                while (true) {
                    var5[var3_1++] = SolutionKitManagerImpl.b(v0, SolutionKitManagerImpl.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    break block10;
                    break;
                }
            }
            switch (v3) {
                default: {
                    ** continue;
                }
                ** case 0:
lbl39:
                // 1 sources

                ** continue;
            }
        }
        SolutionKitManagerImpl.x = var5;
        SolutionKitManagerImpl.w = SolutionKitManagerImpl.x[61];
        SolutionKitManagerImpl.n = SolutionKitManagerImpl.x[67];
        SolutionKitManagerImpl.m = Logger.getLogger(SolutionKitManagerImpl.class.getName());
    }

    /*
     * Exception decompiling
     */
    private static /* synthetic */ void b(int var0) {
        /*
         * This method has failed to decompile.  When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file.
         * 
         * org.benf.cfr.reader.util.ConfusedCFRException: Tried to end blocks [0[TRYBLOCK]], but top level block is 6[SWITCH]
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.processEndingBlocks(Op04StructuredStatement.java:435)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:484)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:736)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:850)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201)
         *     at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94)
         *     at org.benf.cfr.reader.entities.Method.analyse(Method.java:531)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1050)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942)
         *     at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257)
         *     at org.benf.cfr.reader.Driver.doJar(Driver.java:139)
         *     at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76)
         *     at org.benf.cfr.reader.Main.main(Main.java:54)
         */
        throw new IllegalStateException("Decompilation failed");
    }

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

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x79);
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String b(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 80;
                    case 1 -> 30;
                    case 2 -> 72;
                    case 3 -> 123;
                    case 4 -> 29;
                    case 5 -> 84;
                    default -> 121;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

