package com.strmr.ps.data.local.entity;

import android.content.Context;
import androidx.media3.container.NalUnitUtil;
import defpackage.cr4;
import defpackage.gf1;
import defpackage.kp6;
import defpackage.x78;
import java.util.ArrayList;
import kotlin.Metadata;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0003\u001a\u0011\u0010\u0002\u001a\u00020\u0001*\u00020\u0000¢\u0006\u0004\b\u0002\u0010\u0003\u001a\u0019\u0010\u0007\u001a\u00020\u0006*\u00020\u00002\u0006\u0010\u0005\u001a\u00020\u0004¢\u0006\u0004\b\u0007\u0010\b¨\u0006\t"}, d2 = {"Lcom/strmr/ps/data/local/entity/RowConfigEntity;", "Lgf1;", "toRowState", "(Lcom/strmr/ps/data/local/entity/RowConfigEntity;)Lgf1;", "Landroid/content/Context;", "context", "", "resolveTitle", "(Lcom/strmr/ps/data/local/entity/RowConfigEntity;Landroid/content/Context;)Ljava/lang/String;", "app_sideloadRelease"}, k = 2, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
public final class RowConfigExtensionsKt {
    @kp6
    public static final String resolveTitle(@kp6 RowConfigEntity rowConfigEntity, @kp6 Context context) {
        int identifier;
        cr4.g(rowConfigEntity, "<this>");
        cr4.g(context, "context");
        String titleResKey = rowConfigEntity.getTitleResKey();
        if (titleResKey != null && (identifier = context.getResources().getIdentifier(titleResKey, "string", context.getPackageName())) != 0) {
            String string = context.getString(identifier);
            cr4.f(string, "getString(...)");
            return string;
        }
        return rowConfigEntity.getTitle();
    }

    @kp6
    public static final gf1 toRowState(@kp6 RowConfigEntity rowConfigEntity) {
        cr4.g(rowConfigEntity, "<this>");
        String id = rowConfigEntity.getId();
        String title = rowConfigEntity.getTitle();
        String rowType = rowConfigEntity.getRowType();
        String contentType = rowConfigEntity.getContentType();
        String dataSourceUrl = rowConfigEntity.getDataSourceUrl();
        String presentation = rowConfigEntity.getPresentation();
        return new gf1(id, title, rowType, contentType, dataSourceUrl, cr4.b(presentation, "landscape") ? x78.b : cr4.b(presentation, "calendar") ? x78.c : x78.a, rowConfigEntity.getPageSize(), rowConfigEntity.getSortBy(), rowConfigEntity.getSortHow(), rowConfigEntity.getTitleResKey(), new ArrayList(), 0, true, false, null);
    }
}
