/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.service.PublishedService
 *  com.l7tech.util.ExceptionUtils
 *  javax.wsdl.WSDLException
 */
package com.l7tech.server.policy.variable;

import com.l7tech.gateway.common.service.PublishedService;
import com.l7tech.server.message.PolicyEnforcementContext;
import com.l7tech.server.policy.variable.ServerVariables;
import com.l7tech.server.policy.variable.bg;
import com.l7tech.util.ExceptionUtils;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Level;
import javax.wsdl.WSDLException;

class c0
extends bg {
    private static final String[] a;

    c0() {
    }

    @Override
    public Object get(String string, PolicyEnforcementContext policyEnforcementContext) {
        String string2 = null;
        try {
            String string3;
            PublishedService publishedService = policyEnforcementContext.getService();
            if (publishedService == null) {
                return null;
            }
            URL uRL = publishedService.serviceUrl();
            try {
                string3 = uRL == null ? null : uRL.toString();
            }
            catch (WSDLException wSDLException) {
                throw c0.a(wSDLException);
            }
            string2 = string3;
        }
        catch (MalformedURLException | WSDLException throwable) {
            String[] stringArray = a;
            ServerVariables.a.log(Level.WARNING, stringArray[1] + policyEnforcementContext.getService().displayName() + stringArray[0] + ExceptionUtils.getMessage((Throwable)throwable) + stringArray[2], ExceptionUtils.getDebugException((Throwable)throwable));
        }
        return string2;
    }

    private static WSDLException a(WSDLException wSDLException) {
        return wSDLException;
    }

    /*
     * Enabled aggressive block sorting
     */
    static {
        String[] stringArray = new String[3];
        int n2 = 0;
        String string = "\nq\b\u0003\u000er3Y2\b@2n2]\u000b\u001f7}B)\b\u0006\u0018tv^.\b\u0003\u001eqrX1\\G\txfY4F\u0000[BAa}N\b\t7`H/^\u000e\u0018r3\n\u0002\ns";
        int n3 = "\nq\b\u0003\u000er3Y2\b@2n2]\u000b\u001f7}B)\b\u0006\u0018tv^.\b\u0003\u001eqrX1\\G\txfY4F\u0000[BAa}N\b\t7`H/^\u000e\u0018r3\n\u0002\ns".length();
        int n4 = 11;
        int n5 = -1;
        while (true) {
            int n6 = ++n5;
            stringArray[n2++] = c0.a(59, c0.a(string.substring(n6, n6 + n4)));
            if ((n5 += n4) >= n3) {
                a = stringArray;
                return;
            }
            n4 = string.charAt(n5);
        }
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x28);
        }
        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 -> 22;
                    case 1 -> 102;
                    case 2 -> 19;
                    case 3 -> 92;
                    case 4 -> 64;
                    case 5 -> 44;
                    default -> 40;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

