/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.common.io.IOExceptionThrowingInputStream
 *  com.l7tech.gateway.common.service.ServiceDocument
 *  javax.wsdl.xml.WSDLLocator
 *  org.jetbrains.annotations.NotNull
 */
package com.l7tech.server.service;

import com.l7tech.common.io.IOExceptionThrowingInputStream;
import com.l7tech.gateway.common.service.ServiceDocument;
import com.l7tech.server.service.ServiceWsdlImportChecker;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Map;
import javax.wsdl.xml.WSDLLocator;
import org.jetbrains.annotations.NotNull;
import org.xml.sax.InputSource;

class ah
implements WSDLLocator {
    @NotNull
    private final InputSource a;
    @NotNull
    private final Map<String, ServiceDocument> b;
    private String c;
    private static final String[] d;

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    private ah(@NotNull ServiceWsdlImportChecker serviceWsdlImportChecker, @NotNull InputSource inputSource, Map map) {
        if (inputSource == null) {
            ah.a(0);
        }
        if (map == null) {
            ah.a(1);
        }
        this.c = null;
        this.a = inputSource;
        this.b = map;
    }

    public InputSource getBaseInputSource() {
        this.c = this.getBaseURI();
        return this.a;
    }

    public String getBaseURI() {
        return this.a.getSystemId();
    }

    public InputSource getImportInputSource(String string, String string2) {
        InputSource inputSource;
        block7: {
            inputSource = null;
            this.c = string2;
            try {
                URI uRI;
                block8: {
                    if (string != null) {
                        URI uRI2 = new URI(string);
                        URI uRI3 = new URI(string2);
                        uRI = uRI2.resolve(uRI3);
                    } else {
                        uRI = new URI(string2);
                    }
                    this.c = uRI.toString();
                    if (this.b.containsKey(uRI.toString())) {
                        inputSource = new InputSource();
                        inputSource.setSystemId(uRI.toString());
                        inputSource.setCharacterStream(new StringReader(this.b.get(uRI.toString()).getContents()));
                        break block7;
                    }
                    try {
                        if (!uRI.isAbsolute()) break block7;
                        if (d[5].equals(uRI.getScheme())) break block8;
                    }
                    catch (URISyntaxException uRISyntaxException) {
                        throw ah.a(uRISyntaxException);
                    }
                    inputSource = new InputSource();
                    inputSource.setSystemId(uRI.toString());
                    break block7;
                }
                inputSource = new InputSource();
                inputSource.setSystemId(uRI.toString());
                String[] stringArray = d;
                inputSource.setByteStream((InputStream)new IOExceptionThrowingInputStream(new IOException(stringArray[0] + uRI.toString() + stringArray[7])));
            }
            catch (URISyntaxException uRISyntaxException) {
                // empty catch block
            }
        }
        return inputSource;
    }

    public String getLatestImportURI() {
        return this.c;
    }

    public void close() {
    }

    /*
     * Exception decompiling
     */
    private static void a(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 1[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:1055)
         *     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;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[8];
                var3_1 = 0;
                var2_2 = "uH\u0011N{\u000eOTW\u001d]c\u000eHVSR_r\\KPS\u0006Js\u000e\u0001\u0006ZF\u0011GrJ>xU\u0015ZzKHM\u0007\u0014@e\u000efwH\u0006abBJ\u0019W\u0013]vCCMB\u0000\u000f0\u000bU\u001e\u0007\u001dI7\u000bU\u0017\u0002\u0001\u000fz[UM\u0007\u001c@c\u000eD\\\u0007\u001cZ{B\u0006\u0005N\u001cFc\u0010\u000bPI\u0002Zc}ILU\u0011J\u0004_N\u001eJ";
                var4_3 = "uH\u0011N{\u000eOTW\u001d]c\u000eHVSR_r\\KPS\u0006Js\u000e\u0001\u0006ZF\u0011GrJ>xU\u0015ZzKHM\u0007\u0014@e\u000efwH\u0006abBJ\u0019W\u0013]vCCMB\u0000\u000f0\u000bU\u001e\u0007\u001dI7\u000bU\u0017\u0002\u0001\u000fz[UM\u0007\u001c@c\u000eD\\\u0007\u001cZ{B\u0006\u0005N\u001cFc\u0010\u000bPI\u0002Zc}ILU\u0011J\u0004_N\u001eJ".length();
                var1_4 = 28;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = ah.a(v0, ah.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "i{,3H*aow)3Wxg|q33Wxg|}\"y\u000b|}\u0002-:";
                    var4_3 = "i{,3H*aow)3Wxg|q33Wxg|}\"y\u000b|}\u0002-:".length();
                    var1_4 = 28;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 124;
                        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++] = ah.a(v0, ah.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;
            }
        }
        ah.d = var5;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x69);
        }
        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 -> 118;
                    case 1 -> 104;
                    case 2 -> 61;
                    case 3 -> 96;
                    case 4 -> 88;
                    case 5 -> 97;
                    default -> 105;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

