EditorRepository$fetchReleasedGames$1.smali

.class final Lcom/sandboxol/editor/domain/EditorRepository$fetchReleasedGames$1;
.super Lkotlin/coroutines/jvm/internal/SuspendLambda;
.source "EditorRepository.kt"

# interfaces
.implements Lkotlin/jvm/a/p;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/sandboxol/editor/domain/d;->b(Lcom/sandboxol/editor/c/a/a;Landroid/content/Context;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x18
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lkotlin/coroutines/jvm/internal/SuspendLambda;",
        "Lkotlin/jvm/a/p<",
        "Lkotlinx/coroutines/F;",
        "Lkotlin/coroutines/c<",
        "-",
        "Lkotlin/n;",
        ">;",
        "Ljava/lang/Object;",
        ">;"
    }
.end annotation

.annotation runtime Lkotlin/coroutines/jvm/internal/d;
    c = "com.sandboxol.editor.domain.EditorRepository$fetchReleasedGames$1"
    f = "EditorRepository.kt"
    l = {
        0x38
    }
    m = "invokeSuspend"
.end annotation


# instance fields
.field final synthetic $context:Landroid/content/Context;

.field final synthetic $model:Lcom/sandboxol/editor/c/a/a;

.field label:I


# direct methods
.method constructor <init>(Lcom/sandboxol/editor/c/a/a;Landroid/content/Context;Lkotlin/coroutines/c;)V
    .registers 4

    iput-object p1, p0, Lcom/sandboxol/editor/domain/EditorRepository$fetchReleasedGames$1;->$model:Lcom/sandboxol/editor/c/a/a;

    iput-object p2, p0, Lcom/sandboxol/editor/domain/EditorRepository$fetchReleasedGames$1;->$context:Landroid/content/Context;

    const/4 p1, 0x2

    invoke-direct {p0, p1, p3}, Lkotlin/coroutines/jvm/internal/SuspendLambda;-><init>(ILkotlin/coroutines/c;)V

    return-void
.end method


# virtual methods
.method public final create(Ljava/lang/Object;Lkotlin/coroutines/c;)Lkotlin/coroutines/c;
    .registers 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/Object;",
            "Lkotlin/coroutines/c<",
            "*>;)",
            "Lkotlin/coroutines/c<",
            "Lkotlin/n;",
            ">;"
        }
    .end annotation

    const-string p1, "completion"

    invoke-static {p2, p1}, Lkotlin/jvm/internal/i;->c(Ljava/lang/Object;Ljava/lang/String;)V

    new-instance p1, Lcom/sandboxol/editor/domain/EditorRepository$fetchReleasedGames$1;

    iget-object v0, p0, Lcom/sandboxol/editor/domain/EditorRepository$fetchReleasedGames$1;->$model:Lcom/sandboxol/editor/c/a/a;

    iget-object v1, p0, Lcom/sandboxol/editor/domain/EditorRepository$fetchReleasedGames$1;->$context:Landroid/content/Context;

    invoke-direct {p1, v0, v1, p2}, Lcom/sandboxol/editor/domain/EditorRepository$fetchReleasedGames$1;-><init>(Lcom/sandboxol/editor/c/a/a;Landroid/content/Context;Lkotlin/coroutines/c;)V

    return-object p1
.end method

.method public final invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    .registers 3

    check-cast p2, Lkotlin/coroutines/c;

    invoke-virtual {p0, p1, p2}, Lcom/sandboxol/editor/domain/EditorRepository$fetchReleasedGames$1;->create(Ljava/lang/Object;Lkotlin/coroutines/c;)Lkotlin/coroutines/c;

    move-result-object p1

    check-cast p1, Lcom/sandboxol/editor/domain/EditorRepository$fetchReleasedGames$1;

    sget-object p2, Lkotlin/n;->a:Lkotlin/n;

    invoke-virtual {p1, p2}, Lcom/sandboxol/editor/domain/EditorRepository$fetchReleasedGames$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    return-object p1
.end method

.method public final invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
    .registers 22

    move-object/from16 v0, p0

    invoke-static {}, Lkotlin/coroutines/intrinsics/a;->a()Ljava/lang/Object;

    move-result-object v1

    .line 1
    iget v2, v0, Lcom/sandboxol/editor/domain/EditorRepository$fetchReleasedGames$1;->label:I

    const/4 v3, 0x1

    if-eqz v2, :cond_1b

    if-ne v2, v3, :cond_13

    invoke-static/range {p1 .. p1}, Lkotlin/k;->a(Ljava/lang/Object;)V

    move-object/from16 v2, p1

    goto :goto_29

    .line 2
    :cond_13
    new-instance v1, Ljava/lang/IllegalStateException;

    const-string v2, "call to \'resume\' before \'invoke\' with coroutine"

    invoke-direct {v1, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v1

    .line 3
    :cond_1b
    invoke-static/range {p1 .. p1}, Lkotlin/k;->a(Ljava/lang/Object;)V

    .line 4
    sget-object v2, Lcom/sandboxol/editor/api/a;->b:Lcom/sandboxol/editor/api/a;

    iput v3, v0, Lcom/sandboxol/editor/domain/EditorRepository$fetchReleasedGames$1;->label:I

    invoke-virtual {v2, v0}, Lcom/sandboxol/editor/api/a;->b(Lkotlin/coroutines/c;)Ljava/lang/Object;

    move-result-object v2

    if-ne v2, v1, :cond_29

    return-object v1

    .line 5
    :cond_29
    :goto_29
    check-cast v2, Lcom/sandboxol/editor/api/a/b;

    .line 6
    instance-of v1, v2, Lcom/sandboxol/editor/api/a/b$c;

    if-eqz v1, :cond_ac

    .line 7
    check-cast v2, Lcom/sandboxol/editor/api/a/b$c;

    invoke-virtual {v2}, Lcom/sandboxol/editor/api/a/b$c;->a()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/sandboxol/common/base/web/HttpResponse;

    invoke-virtual {v1}, Lcom/sandboxol/common/base/web/HttpResponse;->getData()Ljava/lang/Object;

    move-result-object v1

    if-nez v1, :cond_4a

    .line 8
    invoke-virtual {v2}, Lcom/sandboxol/editor/api/a/b$c;->a()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/sandboxol/common/base/web/HttpResponse;

    invoke-static {}, Lkotlin/collections/l;->a()Ljava/util/List;

    move-result-object v3

    invoke-virtual {v1, v3}, Lcom/sandboxol/common/base/web/HttpResponse;->setData(Ljava/lang/Object;)V

    .line 9
    :cond_4a
    iget-object v1, v0, Lcom/sandboxol/editor/domain/EditorRepository$fetchReleasedGames$1;->$model:Lcom/sandboxol/editor/c/a/a;

    invoke-virtual {v1}, Lcom/sandboxol/editor/c/a/a;->d()Landroidx/lifecycle/p;

    move-result-object v1

    .line 10
    invoke-virtual {v2}, Lcom/sandboxol/editor/api/a/b$c;->a()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/sandboxol/common/base/web/HttpResponse;

    invoke-virtual {v2}, Lcom/sandboxol/common/base/web/HttpResponse;->getData()Ljava/lang/Object;

    move-result-object v2

    const-string v3, "result.body.data"

    invoke-static {v2, v3}, Lkotlin/jvm/internal/i;->b(Ljava/lang/Object;Ljava/lang/String;)V

    check-cast v2, Ljava/lang/Iterable;

    .line 11
    new-instance v3, Ljava/util/ArrayList;

    const/16 v4, 0xa

    invoke-static {v2, v4}, Lkotlin/collections/l;->a(Ljava/lang/Iterable;I)I

    move-result v4

    invoke-direct {v3, v4}, Ljava/util/ArrayList;-><init>(I)V

    .line 12
    invoke-interface {v2}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_70
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_a2

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    .line 13
    check-cast v4, Lcom/sandboxol/center/entity/response/ReleasedGameResponse;

    .line 14
    new-instance v15, Lcom/sandboxol/center/entity/PublishedGame;

    const/4 v6, 0x0

    const/4 v7, 0x0

    const-wide/16 v8, 0x0

    const-wide/16 v10, 0x0

    const-wide/16 v12, 0x0

    const/4 v14, 0x0

    const/16 v16, 0x0

    const/16 v17, 0x7f

    const/16 v18, 0x0

    move-object v5, v15

    move-object/from16 v19, v15

    move-object/from16 v15, v16

    move/from16 v16, v17

    move-object/from16 v17, v18

    invoke-direct/range {v5 .. v17}, Lcom/sandboxol/center/entity/PublishedGame;-><init>(IZJJJILjava/util/List;ILkotlin/jvm/internal/f;)V

    move-object/from16 v5, v19

    .line 15
    invoke-virtual {v5, v4}, Lcom/sandboxol/center/entity/PublishedGame;->convertFrom(Lcom/sandboxol/center/entity/response/ReleasedGameResponse;)V

    .line 16
    invoke-interface {v3, v5}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z

    goto :goto_70

    .line 17
    :cond_a2
    sget-object v2, Lcom/sandboxol/editor/domain/b;->a:Lcom/sandboxol/editor/domain/b;

    invoke-static {v3, v2}, Lkotlin/collections/l;->a(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroidx/lifecycle/p;->b(Ljava/lang/Object;)V

    goto :goto_cf

    .line 18
    :cond_ac
    instance-of v1, v2, Lcom/sandboxol/editor/api/a/b$a;

    if-eqz v1, :cond_b8

    .line 19
    iget-object v1, v0, Lcom/sandboxol/editor/domain/EditorRepository$fetchReleasedGames$1;->$context:Landroid/content/Context;

    sget v2, Lcom/sandboxol/editor/R$string;->inner_error:I

    invoke-static {v1, v2}, Lcom/sandboxol/common/utils/AppToastUtils;->showLongNegativeTipToast(Landroid/content/Context;I)V

    goto :goto_cf

    .line 20
    :cond_b8
    instance-of v1, v2, Lcom/sandboxol/editor/api/a/b$b;

    if-eqz v1, :cond_c4

    .line 21
    iget-object v1, v0, Lcom/sandboxol/editor/domain/EditorRepository$fetchReleasedGames$1;->$context:Landroid/content/Context;

    sget v2, Lcom/sandboxol/editor/R$string;->network_connection_failed:I

    invoke-static {v1, v2}, Lcom/sandboxol/common/utils/AppToastUtils;->showLongNegativeTipToast(Landroid/content/Context;I)V

    goto :goto_cf

    .line 22
    :cond_c4
    instance-of v1, v2, Lcom/sandboxol/editor/api/a/b$d;

    if-eqz v1, :cond_cf

    .line 23
    iget-object v1, v0, Lcom/sandboxol/editor/domain/EditorRepository$fetchReleasedGames$1;->$context:Landroid/content/Context;

    sget v2, Lcom/sandboxol/editor/R$string;->inner_error:I

    invoke-static {v1, v2}, Lcom/sandboxol/common/utils/AppToastUtils;->showLongNegativeTipToast(Landroid/content/Context;I)V

    .line 24
    :cond_cf
    :goto_cf
    sget-object v1, Lkotlin/n;->a:Lkotlin/n;

    return-object v1
.end method