/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.log.SinkConfiguration
 *  com.l7tech.objectmodel.EntityHeader
 *  com.l7tech.objectmodel.EntityType
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.objectmodel.IdentityHeader
 *  com.l7tech.util.Functions$BinaryThrows
 */
package com.l7tech.server.search.processors;

import com.l7tech.gateway.common.log.SinkConfiguration;
import com.l7tech.objectmodel.EntityHeader;
import com.l7tech.objectmodel.EntityType;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.IdentityHeader;
import com.l7tech.server.search.exceptions.CannotRetrieveDependenciesException;
import com.l7tech.server.search.processors.LogSinkDependencyProcessor;
import com.l7tech.util.Functions;

class ae
implements Functions.BinaryThrows<EntityHeader, String, EntityType, CannotRetrieveDependenciesException> {
    private static final String a = ae.a(5, ae.a("|\u0015N\u001c\u001bN\tT\u0010\u0002/\u0007Y\u0016\u0011=fZ\u0012U\bE\u0011PZ\u0002]\bD\u0011\u0018Z"));

    ae(LogSinkDependencyProcessor logSinkDependencyProcessor) {
    }

    public EntityHeader call(String string, EntityType entityType) throws CannotRetrieveDependenciesException {
        String[] stringArray = string.split(":");
        try {
            if (stringArray.length == 2) {
                return new IdentityHeader(Goid.parseGoid((String)stringArray[0]), new EntityHeader(stringArray[1], entityType, null, null));
            }
        }
        catch (CannotRetrieveDependenciesException cannotRetrieveDependenciesException) {
            throw ae.a(cannotRetrieveDependenciesException);
        }
        throw new CannotRetrieveDependenciesException(SinkConfiguration.class, a + string);
    }

    private static CannotRetrieveDependenciesException a(CannotRetrieveDependenciesException cannotRetrieveDependenciesException) {
        return cannotRetrieveDependenciesException;
    }

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

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String a(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 -> 52;
                    case 1 -> 113;
                    case 2 -> 39;
                    case 3 -> 127;
                    case 4 -> 113;
                    case 5 -> 57;
                    default -> 97;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

