.class public final synthetic Lz5/pn0;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Ljava/util/concurrent/Callable;


# instance fields
.field public final synthetic a:I

.field public final b:Ljava/lang/Object;

.field public final c:Ljava/lang/Object;

.field public final d:Ljava/lang/Object;

.field public final e:Ljava/lang/Object;


# direct methods
.method public constructor <init>(Lcom/google/android/gms/internal/ads/r3;Lz5/fc1;Lz5/fc1;Lcom/google/android/gms/internal/ads/k1;)V
    .registers 6

    const/4 v0, 0x1

    iput v0, p0, Lz5/pn0;->a:I

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lz5/pn0;->b:Ljava/lang/Object;

    iput-object p2, p0, Lz5/pn0;->c:Ljava/lang/Object;

    iput-object p3, p0, Lz5/pn0;->d:Ljava/lang/Object;

    iput-object p4, p0, Lz5/pn0;->e:Ljava/lang/Object;

    return-void
.end method

.method public constructor <init>(Lz5/g90;Lz5/i31;Lz5/b31;Lorg/json/JSONObject;)V
    .registers 6

    const/4 v0, 0x0

    iput v0, p0, Lz5/pn0;->a:I

    .line 2
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lz5/pn0;->b:Ljava/lang/Object;

    iput-object p2, p0, Lz5/pn0;->c:Ljava/lang/Object;

    iput-object p3, p0, Lz5/pn0;->d:Ljava/lang/Object;

    iput-object p4, p0, Lz5/pn0;->e:Ljava/lang/Object;

    return-void
.end method


# virtual methods
.method public final call()Ljava/lang/Object;
    .registers 11

    iget v0, p0, Lz5/pn0;->a:I

    packed-switch v0, :pswitch_data_190

    goto/16 :goto_12c

    .line 1
    :pswitch_7
    iget-object v0, p0, Lz5/pn0;->c:Ljava/lang/Object;

    check-cast v0, Lz5/i31;

    iget-object v1, p0, Lz5/pn0;->d:Ljava/lang/Object;

    check-cast v1, Lz5/b31;

    iget-object v2, p0, Lz5/pn0;->e:Ljava/lang/Object;

    check-cast v2, Lorg/json/JSONObject;

    new-instance v3, Lz5/hm0;

    invoke-direct {v3}, Lz5/hm0;-><init>()V

    const-string v4, "template_id"

    const/4 v5, -0x1

    invoke-virtual {v2, v4, v5}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I

    move-result v4

    .line 2
    monitor-enter v3

    :try_start_20
    iput v4, v3, Lz5/hm0;->a:I
    :try_end_22
    .catchall {:try_start_20 .. :try_end_22} :catchall_129

    monitor-exit v3

    const-string v4, "custom_template_id"

    .line 3
    invoke-virtual {v2, v4}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    .line 4
    monitor-enter v3

    :try_start_2a
    iput-object v4, v3, Lz5/hm0;->s:Ljava/lang/String;
    :try_end_2c
    .catchall {:try_start_2a .. :try_end_2c} :catchall_126

    monitor-exit v3

    const-string v4, "omid_settings"

    .line 5
    invoke-virtual {v2, v4}, Lorg/json/JSONObject;->optJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v4

    const/4 v5, 0x0

    if-eqz v4, :cond_3d

    const-string v6, "omid_partner_name"

    invoke-virtual {v4, v6}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    goto :goto_3e

    :cond_3d
    move-object v4, v5

    .line 6
    :goto_3e
    monitor-enter v3

    :try_start_3f
    iput-object v4, v3, Lz5/hm0;->w:Ljava/lang/String;
    :try_end_41
    .catchall {:try_start_3f .. :try_end_41} :catchall_123

    monitor-exit v3

    .line 7
    iget-object v0, v0, Lz5/i31;->a:Lz5/ge0;

    iget-object v0, v0, Lz5/ge0;->s:Ljava/lang/Object;

    check-cast v0, Lz5/m31;

    iget-object v4, v0, Lz5/m31;->g:Ljava/util/ArrayList;

    invoke-virtual {v3}, Lz5/hm0;->t()I

    move-result v6

    invoke-static {v6}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v4, v6}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z

    move-result v4

    const/4 v6, 0x1

    if-eqz v4, :cond_106

    invoke-virtual {v3}, Lz5/hm0;->t()I

    move-result v4

    const/4 v7, 0x3

    if-ne v4, v7, :cond_83

    invoke-virtual {v3}, Lz5/hm0;->j()Ljava/lang/String;

    move-result-object v4

    if-eqz v4, :cond_7b

    iget-object v0, v0, Lz5/m31;->h:Ljava/util/ArrayList;

    invoke-virtual {v3}, Lz5/hm0;->j()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v0, v4}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_73

    goto :goto_83

    :cond_73
    new-instance v0, Lz5/kw0;

    const-string v1, "Unexpected custom template id in the response."

    invoke-direct {v0, v6, v1}, Lz5/kw0;-><init>(ILjava/lang/String;)V

    throw v0

    :cond_7b
    new-instance v0, Lz5/kw0;

    const-string v1, "No custom template id for custom template ad response."

    invoke-direct {v0, v6, v1}, Lz5/kw0;-><init>(ILjava/lang/String;)V

    throw v0

    :cond_83
    :goto_83
    const-string v0, "rating"

    const-wide/high16 v8, -0x4010000000000000L    # -1.0

    invoke-virtual {v2, v0, v8, v9}, Lorg/json/JSONObject;->optDouble(Ljava/lang/String;D)D

    move-result-wide v8

    .line 8
    monitor-enter v3

    :try_start_8c
    iput-wide v8, v3, Lz5/hm0;->p:D
    :try_end_8e
    .catchall {:try_start_8c .. :try_end_8e} :catchall_103

    monitor-exit v3

    const-string v0, "headline"

    .line 9
    invoke-virtual {v2, v0, v5}, Lorg/json/JSONObject;->optString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iget-boolean v1, v1, Lz5/b31;->I:Z

    if-eqz v1, :cond_c6

    invoke-static {}, Lcom/google/android/gms/ads/internal/zzt;->zzc()Lcom/google/android/gms/ads/internal/util/zzs;

    invoke-static {}, Lcom/google/android/gms/ads/internal/util/zzs;->zzC()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/String;->length()I

    move-result v4

    invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/String;->length()I

    move-result v6

    new-instance v8, Ljava/lang/StringBuilder;

    add-int/2addr v4, v7

    add-int/2addr v4, v6

    invoke-direct {v8, v4}, Ljava/lang/StringBuilder;-><init>(I)V

    invoke-virtual {v8, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v1, " : "

    invoke-virtual {v8, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v8, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    :cond_c6
    const-string v1, "headline"

    invoke-virtual {v3, v1, v0}, Lz5/hm0;->r(Ljava/lang/String;Ljava/lang/String;)V

    const-string v0, "body"

    const-string v1, "body"

    invoke-virtual {v2, v1, v5}, Lorg/json/JSONObject;->optString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v3, v0, v1}, Lz5/hm0;->r(Ljava/lang/String;Ljava/lang/String;)V

    const-string v0, "call_to_action"

    const-string v1, "call_to_action"

    invoke-virtual {v2, v1, v5}, Lorg/json/JSONObject;->optString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v3, v0, v1}, Lz5/hm0;->r(Ljava/lang/String;Ljava/lang/String;)V

    const-string v0, "store"

    const-string v1, "store"

    invoke-virtual {v2, v1, v5}, Lorg/json/JSONObject;->optString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v3, v0, v1}, Lz5/hm0;->r(Ljava/lang/String;Ljava/lang/String;)V

    const-string v0, "price"

    const-string v1, "price"

    invoke-virtual {v2, v1, v5}, Lorg/json/JSONObject;->optString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v3, v0, v1}, Lz5/hm0;->r(Ljava/lang/String;Ljava/lang/String;)V

    const-string v0, "advertiser"

    const-string v1, "advertiser"

    invoke-virtual {v2, v1, v5}, Lorg/json/JSONObject;->optString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v3, v0, v1}, Lz5/hm0;->r(Ljava/lang/String;Ljava/lang/String;)V

    return-object v3

    :catchall_103
    move-exception v0

    .line 10
    monitor-exit v3

    throw v0

    .line 11
    :cond_106
    new-instance v0, Lz5/kw0;

    invoke-virtual {v3}, Lz5/hm0;->t()I

    move-result v1

    new-instance v2, Ljava/lang/StringBuilder;

    const/16 v3, 0x20

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(I)V

    const-string v3, "Invalid template ID: "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v6, v1}, Lz5/kw0;-><init>(ILjava/lang/String;)V

    throw v0

    :catchall_123
    move-exception v0

    .line 12
    monitor-exit v3

    throw v0

    :catchall_126
    move-exception v0

    .line 13
    monitor-exit v3

    throw v0

    :catchall_129
    move-exception v0

    .line 14
    monitor-exit v3

    throw v0

    .line 15
    :goto_12c
    iget-object v0, p0, Lz5/pn0;->b:Ljava/lang/Object;

    check-cast v0, Lcom/google/android/gms/internal/ads/r3;

    iget-object v1, p0, Lz5/pn0;->c:Ljava/lang/Object;

    check-cast v1, Lz5/fc1;

    iget-object v2, p0, Lz5/pn0;->d:Ljava/lang/Object;

    check-cast v2, Lz5/fc1;

    iget-object v3, p0, Lz5/pn0;->e:Ljava/lang/Object;

    check-cast v3, Lcom/google/android/gms/internal/ads/k1;

    invoke-static {v0}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    .line 16
    invoke-interface {v1}, Ljava/util/concurrent/Future;->get()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lz5/t10;

    .line 17
    iget-object v4, v4, Lz5/t10;->i:Ljava/lang/String;

    .line 18
    invoke-interface {v2}, Ljava/util/concurrent/Future;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lorg/json/JSONObject;

    iget-object v3, v3, Lcom/google/android/gms/internal/ads/k1;->y:Ljava/lang/String;

    new-instance v5, Lz5/kt0;

    invoke-interface {v1}, Ljava/util/concurrent/Future;->get()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lz5/t10;

    invoke-direct {v5, v1, v2, v3, v4}, Lz5/kt0;-><init>(Lz5/t10;Lorg/json/JSONObject;Ljava/lang/String;Ljava/lang/String;)V

    .line 19
    monitor-enter v0

    .line 20
    :try_start_15b
    monitor-enter v0
    :try_end_15c
    .catchall {:try_start_15b .. :try_end_15c} :catchall_18c

    :try_start_15c
    sget-object v1, Lz5/yp;->b:Lcom/google/android/gms/internal/ads/k;

    invoke-virtual {v1}, Lcom/google/android/gms/internal/ads/k;->l()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/Long;

    invoke-virtual {v1}, Ljava/lang/Long;->intValue()I

    move-result v1

    :goto_168
    iget-object v2, v0, Lcom/google/android/gms/internal/ads/r3;->v:Ljava/util/ArrayDeque;

    invoke-virtual {v2}, Ljava/util/ArrayDeque;->size()I

    move-result v2

    if-lt v2, v1, :cond_176

    iget-object v2, v0, Lcom/google/android/gms/internal/ads/r3;->v:Ljava/util/ArrayDeque;

    invoke-virtual {v2}, Ljava/util/ArrayDeque;->removeFirst()Ljava/lang/Object;
    :try_end_175
    .catchall {:try_start_15c .. :try_end_175} :catchall_189

    goto :goto_168

    :cond_176
    :try_start_176
    monitor-exit v0

    .line 21
    iget-object v1, v0, Lcom/google/android/gms/internal/ads/r3;->v:Ljava/util/ArrayDeque;

    invoke-virtual {v1, v5}, Ljava/util/ArrayDeque;->addLast(Ljava/lang/Object;)V
    :try_end_17c
    .catchall {:try_start_176 .. :try_end_17c} :catchall_18c

    monitor-exit v0

    .line 22
    new-instance v0, Ljava/io/ByteArrayInputStream;

    sget-object v1, Lz5/m91;->b:Ljava/nio/charset/Charset;

    invoke-virtual {v4, v1}, Ljava/lang/String;->getBytes(Ljava/nio/charset/Charset;)[B

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/io/ByteArrayInputStream;-><init>([B)V

    return-object v0

    :catchall_189
    move-exception v1

    .line 23
    :try_start_18a
    monitor-exit v0

    throw v1
    :try_end_18c
    .catchall {:try_start_18a .. :try_end_18c} :catchall_18c

    :catchall_18c
    move-exception v1

    monitor-exit v0

    throw v1

    nop

    :pswitch_data_190
    .packed-switch 0x0
        :pswitch_7
    .end packed-switch
.end method
