/*
 * Decompiled with CFR 0.152.
 */
import java.util.Enumeration;
import java.util.Hashtable;

public final class mp
extends a
implements mt {
    private static final cq w = cq.a("Cancel", cq.c, 0);
    private static final cq x = cq.a("Ok", cq.c, 0);
    private static bq y;
    private int A;
    private String B;
    private no C;
    private int z;

    private pv d() {
        pv pv2 = this.b.b;
        while (pv2 != null && !"form".equals(pv2.c)) {
            pv2 = pv2.b;
        }
        return pv2;
    }

    public final void c(ht ht2, int n, int n2) {
        if (null == this) {
            super.c(ht2, n, n2);
        }
    }

    private static void a(ht ht2, int n, int n2, int n3, int n4, boolean bl2, boolean bl3) {
        if (!bl3) {
            if (bl2) {
                a.a(ht2, 0xFFFFFF, -3618616, n + 2, n2 + 2, n3 - 4, n4 - 4);
            }
            n3 = n + n3 - 2;
            n4 = n2 + n4 - 2;
            ht2.a(-8355712);
            ht2.e(n3, ++n2 + 1, n3, n4 - 1);
            int n5 = n + 1;
            ht2.e(n5 + 1, n4, n3 - 1, n4);
            n = n5;
            ht2.a(-5000269);
            ht2.e(n + 1, n2, n3 - 1, n2);
            ht2.e(n, n2 + 1, n, n4 - 1);
            return;
        }
        if (!bl2) {
            a.b(ht2, n, n2, n3, n4);
            return;
        }
        a.d(ht2, n, n2, n3, n4);
    }

    private static void b(ht ht2, int n, int n2, int n3, int n4, boolean bl2) {
        ht2.a(-1);
        ht2.c(n + 3, n2 + 3, n3 - 5, n4 - 5);
        if (bl2) {
            mp.a(ht2, n, n2, n3, n4, true);
            return;
        }
        ht2.a(-5000269);
        int n5 = n + n3 - 2;
        int n6 = n2 + n4 - 2;
        int n7 = n2 + 1;
        ht2.e(n5, n7, n5, n6);
        int n8 = n7;
        int n9 = n2 + 2;
        int n10 = n + 1;
        ht2.e(n10, n6, n5, n6);
        ht2.a(-8355712);
        ht2.e(n10, n8, n5, n8);
        ht2.e(n10, n8, n10, n6);
        ht2.a(-1579033);
        int n11 = n + 2;
        ht2.e(n11, n9, n + n3 - 3, n9);
        int n12 = n11;
        ht2.e(n12, n9, n12, n2 + n4 - 3);
        ht2.a(-2500135);
        ht2.e(n12, n9, n12, n9);
    }

    private static void a(ht ht2, int n, int n2, int n3, int n4, boolean bl2) {
        ht2.a(-11103760);
        ht2.d(n + 1, n2 + 1, n3 - 3, n4 - 3);
        ht2.a(-3942408);
        ht2.d(n, n2, n3 - 1, n4 - 1);
        if (bl2) {
            ht2.a(-2759427);
            int n5 = n2 + 2;
            int n6 = n + 2;
            ht2.e(n6, n5, n + n3 - 3, n5);
            int n7 = n6;
            ht2.e(n7, n5, n7, n2 + n4 - 3);
            ht2.a(-4270599);
            ht2.e(n7, n5, n7, n5);
        }
    }

    private void f(int n) {
        this.b.b(this.A).a("selected", null);
        do {
            this.A += n;
            if (this.A != -1) {
                if (this.A != this.b.a()) continue;
                this.A = 0;
                continue;
            }
            this.A = this.b.a() - 1;
        } while (this.b.a(this.A) != 1);
        this.B = this.b.b(this.A).e();
        this.b.b(this.A).a("selected", "true");
        this.t();
    }

    public final void a(cq cq2, Object object) {
        if (cq2 == x) {
            this.B = y.b();
            if (this.z != 9) {
                this.b.a("value", this.B);
            } else {
                while (this.b.a() > 0) {
                    this.b.d(this.b.a() - 1);
                }
                this.b.a(this.B);
            }
            this.t();
        }
    }

    public mp(pv pv2) {
        super(pv2, true);
        this.C = pv2.a;
        String string = pv2.c;
        if (!string.equals("select")) {
            if (!string.equals("option")) {
                if (!string.equals("textarea")) {
                    string = pv2.d("type");
                    this.B = pv2.d("value");
                    if (!"password".equals(string)) {
                        if (!"submit".equals(string)) {
                            if (!"checkbox".equals(string)) {
                                if (!"radio".equals(string)) {
                                    if ("reset".equals(string)) {
                                        this.z = 3;
                                        if (this.B == null) {
                                            this.B = "Reset";
                                        }
                                    } else {
                                        this.z = 0;
                                    }
                                } else {
                                    this.z = 6;
                                }
                            } else {
                                this.z = 7;
                            }
                        } else {
                            this.z = 2;
                            if (this.B == null) {
                                this.B = "Submit";
                            }
                        }
                    } else {
                        this.z = 1;
                    }
                } else {
                    this.z = 9;
                    this.B = pv2.e();
                }
            } else {
                this.z = 8;
                this.B = pv2.e();
            }
        } else {
            this.z = 5;
        }
        if (this.B == null) {
            this.B = "";
        }
    }

    private void a(pv pv2, String string) {
        if (string != null) {
            if (string.equals(pv2.d("name"))) {
                pv2.a("checked", null);
            }
            for (int i = 0; i < pv2.a(); ++i) {
                if (pv2.a(i) != 1) continue;
                this.a(pv2.b(i), string);
            }
        }
    }

    private void a(pv pv2, Hashtable hashtable) {
        String string = pv2.c;
        if ("input".equals(string)) {
            string = pv2.d("type");
            if (!("submit".equals(string) || "reset".equals(string) || ("radio".equals(string) || "checkbox".equals(string)) && !pv2.c("checked"))) {
                String string2 = pv2.d("name");
                string = pv2.d("value");
                if (string2 != null) {
                    if (string == null) {
                        string = "";
                    }
                    hashtable.put(string2, string);
                }
            }
        } else if (!"textarea".equals(string)) {
            if ("option".equals(string) && pv2.c("selected")) {
                if (pv2.d("value") == null) {
                    pv2.e();
                }
                if ((string = pv2.b.d("name")) != null) {
                    hashtable.put(string, pv2.e());
                }
            }
        } else {
            string = pv2.d("name");
            if (string != null) {
                hashtable.put(string, pv2.e());
            }
        }
        for (int i = 0; i < pv2.a(); ++i) {
            if (pv2.a(i) != 1) continue;
            this.a(pv2.b(i), hashtable);
        }
    }

    /*
     * Enabled force condition propagation
     * Lifted jumps to return sites
     */
    public final int a(pb pb2) {
        int n = pb2.c;
        if (this.z != 5) {
            if (n != 7) return super.a(pb2);
            switch (this.z) {
                case 2: {
                    String string;
                    String string2;
                    pv pv2 = this.d();
                    Hashtable hashtable = new Hashtable();
                    this.a(pv2, hashtable);
                    StringBuffer stringBuffer = new StringBuffer();
                    Enumeration enumeration = hashtable.keys();
                    while (enumeration.hasMoreElements()) {
                        string2 = (String)enumeration.nextElement();
                        string = (String)hashtable.get(string2);
                        stringBuffer.append(ar.a(string2));
                        stringBuffer.append('=');
                        stringBuffer.append(ar.a(string));
                        if (!enumeration.hasMoreElements()) continue;
                        stringBuffer.append('&');
                    }
                    string2 = this.C.c(pv2.d("action"));
                    string = pv2.d("method");
                    if (string != null && string.toLowerCase().equals("post")) {
                        this.C.x.a(this.C, 2, string2, 1, stringBuffer.toString().getBytes());
                        return -2;
                    }
                    this.C.x.a(this.C, 1, string2 + '?' + stringBuffer.toString(), 1, null);
                    return -2;
                }
                case 8: {
                    pv pv3 = this.b;
                    String string = !this.b.c("selected") ? "true" : null;
                    pv3.a("selected", string);
                    return super.a(pb2);
                }
                case 6: {
                    this.a(this.d(), this.b.d("name"));
                }
                case 7: {
                    pv pv4 = this.b;
                    String string = this.b.c("checked") ? "false" : "true";
                    pv4.a("checked", string);
                    this.t();
                    return -2;
                }
                case 0: 
                case 1: 
                case 9: {
                    if (y == null) {
                        y = lh.k().i().a(this, "Input", x, w);
                    }
                    if (this.z != 1) {
                        if (this.z != 9) {
                            y.b(0);
                        } else {
                            y.b(0x1000000);
                        }
                    } else {
                        y.b(65536);
                    }
                    y.a(this.B);
                    y.a();
                    y.a(this);
                    return -2;
                }
                default: {
                    return super.a(pb2);
                }
            }
        }
        switch (n) {
            case 3: {
                this.f(-1);
                return -2;
            }
            case 4: 
            case 7: {
                this.f(1);
                return -2;
            }
        }
        return super.a(pb2);
    }

    /*
     * Enabled aggressive block sorting
     * Lifted jumps to return sites
     */
    public final void a_(ht ht2, int n, int n2) {
        on on2 = this.b.d;
        int n3 = on2.a(38, this.e);
        int n4 = on2.a(39, this.e);
        int n5 = on2.a(40, this.e);
        int n6 = on2.a(41, this.e);
        n4 = this.j - n6 - n4;
        n5 = this.k - n5 - n3;
        n6 = n + (n6 + this.h);
        n2 += n3 + this.i;
        w w2 = on2.a();
        n3 = w2.l();
        switch (this.z) {
            case 5: {
                mp.a(ht2, n6, n2, n4, n5, false, this.t_());
                ht2.a(0);
                w2.a(ht2, a.a(this.B, w2, n4 - 6 - n3, false), n6 + 3 + n3 / 2, n2 + 3);
                ht2.e(n6 + 4, n2 + n5 / 2, n6 + 4 + n3 / 4, n2 + n5 / 2 - n3 / 4, n6 + 4 + n3 / 4, n2 + n5 / 2 + n3 / 4);
                ht2.e(n6 + n4 - 4, n2 + n5 / 2, n6 + n4 - 4 - n3 / 4, n2 + n5 / 2 - n3 / 4, n6 + n4 - 4 - n3 / 4, n2 + n5 / 2 + n3 / 4);
                return;
            }
            case 9: {
                mp.b(ht2, n6, n2, n4, n5, this.t_());
                ht2.a(0);
                n = (n5 - 6) / n3;
                String[] stringArray = bk.a(w2, this.B, n4, n, null, true);
                n4 = Math.min(n, stringArray.length);
                n = 0;
                while (n < n4) {
                    w2.a(ht2, stringArray[n], n6 + 3, n2 + 3 + n * n3);
                    ++n;
                }
                return;
            }
            case 8: {
                ht2.a(on2.d(4));
                w2.a(ht2, a.a(this.B, w2, n4 - n3, false), n6 + n3, n2);
                a.a(ht2, n6 + 2, n2 + 2, n3 - 5, this.b.c("selected"), true);
                if (!this.t_()) return;
                mp.a(ht2, n6 + 1, n2 + 1, n3 - 2, n3 - 2, false);
                return;
            }
            case 7: {
                a.a(ht2, n6 + 1, n2 + 1, n4 - 3, this.b.c("checked"), true);
                if (!this.t_()) return;
                mp.a(ht2, n6, n2, n4, n5, false);
                return;
            }
            case 6: {
                mp.a(ht2, n6, n2, n4, n5, true, this.t_());
                if (!this.b.c("checked")) return;
                ht2.a(0);
                ht2.a(n6 + 3, n2 + 3, n4 - 7, n5 - 7, 4, 4);
            }
            default: {
                return;
            }
            case 2: 
            case 3: 
            case 4: {
                mp.a(ht2, n6, n2, n4, n5, true, this.t_());
                ht2.a(on2.d(4));
                w2.a(ht2, a.a(this.B, w2, n4 - 6, false), n6 + 3, n2 + 3);
                return;
            }
            case 0: 
            case 1: 
        }
        mp.b(ht2, n6, n2, n4, n5, this.t_());
        ht2.a(on2.d(4));
        String string = this.z == 1 && this.B.length() > 0 ? "*****" : this.B;
        w2.a(ht2, a.a(string, w2, n4 - 6, false), n6 + 3, n2 + 3);
    }

    public final void e(int n) {
        on on2 = this.b.d;
        int n2 = on2.a().l();
        int n3 = on2.a(39, n);
        int n4 = on2.a(41, n);
        if (!on2.a(52, false)) {
            switch (this.z) {
                case 5: {
                    int n5 = 0;
                    for (n = 0; n < this.b.a(); ++n) {
                        if (this.b.a(n) != 1) continue;
                        pv pv2 = this.b.b(n);
                        String string = pv2.e();
                        if (this.B == null || pv2.c("selected")) {
                            this.B = string;
                            this.A = n;
                        }
                        n5 = Math.max(n5, on2.a().a(string));
                    }
                    n = n5 + (n2 + 6 + n4 + n3);
                    break;
                }
                case 9: {
                    n = this.b.a("cols", 40) * n2 / 2;
                    break;
                }
                case 8: {
                    n = n2 + on2.a().a(this.B);
                    break;
                }
                case 6: 
                case 7: {
                    n = n2 - 2 + n4 + n3;
                    break;
                }
                case 2: 
                case 3: {
                    n = 6 + on2.a().a(this.B) + n4 + n3;
                    break;
                }
                default: {
                    String string = this.b.d("size");
                    n = string == null ? 20 : Integer.parseInt(string);
                    n = n * n2 / 2 + n4 + n3;
                    break;
                }
            }
        } else {
            n = n4 + on2.a(52, n) + n3;
        }
        this.m = n;
        this.l = n;
    }

    /*
     * WARNING - void declaration
     */
    public final void a(int n, az az2, boolean bl2) {
        if (this.e != n || !this.c) {
            void var3_6;
            this.e = n;
            on on2 = this.b.d;
            int n2 = on2.a(38, n);
            int n3 = on2.a(40, n);
            int n4 = on2.a().l();
            if (!on2.a(52, true)) {
                int n5 = this.b(n);
            } else {
                int n6 = this.d(n);
            }
            this.j = Math.min(n, (int)var3_6);
            switch (this.z) {
                case 9: {
                    void var3_9;
                    String string = this.b.d("rows");
                    if (string == null) {
                        int n7 = 3;
                    } else {
                        int n8 = Integer.parseInt(string);
                    }
                    this.k = var3_9 * n4 + 6 + n2 + n3;
                    break;
                }
                case 8: {
                    this.k = n4 + n2 + n3;
                    break;
                }
                case 6: 
                case 7: {
                    this.k = n4 - 2 + n2 + n3;
                    break;
                }
                default: {
                    this.k = n4 + 6 + n2 + n3;
                }
            }
            this.l(this.j);
            this.m(this.k);
        }
    }
}

