package com.lynx.tasm;

import X.C2964L3b;
import X.C4267LhC;
import X.L4U;
import X.QmZ;
import android.text.TextUtils;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import java.lang.ref.WeakReference;

public class TemplateAssembler$2 extends C2964L3b<String> {
    public final WeakReference<TemplateAssembler> LIZ;
    public final /* synthetic */ String LIZIZ;
    public final /* synthetic */ TemplateAssembler LIZJ;

    static {
        Covode.recordClassIndex(46358);
    }

    public final void LIZ(final L4U<String> l4u) {
        super.LIZ(l4u);
        if (!C4267LhC.LIZ()) {
            C4267LhC.LIZ(new Runnable() {
                static {
                    Covode.recordClassIndex(46359);
                }

                public final void run() {
                    TemplateAssembler$2.this.LIZIZ(l4u);
                }
            });
        } else {
            LIZIZ(l4u);
        }
    }

    public final void LIZIZ(L4U<String> l4u) {
        QmZ qmZ;
        MethodCollector.i(4523);
        TemplateAssembler templateAssembler = (TemplateAssembler) this.LIZ.get();
        if (templateAssembler != null && !templateAssembler.LJI) {
            if (!TextUtils.isEmpty((CharSequence) l4u.LIZJ) || (qmZ = (QmZ) templateAssembler.LJIIIIZZ.get()) == null) {
                templateAssembler.nativeUpdateI18nResource(this.LIZJ.LIZ, this.LIZIZ, (String) l4u.LIZJ, l4u.LIZIZ);
            } else {
                qmZ.LIZ(this.LIZIZ, "I18nResource", "empty i18n resource return");
                templateAssembler.nativeUpdateI18nResource(this.LIZJ.LIZ, this.LIZIZ, "", -1);
                MethodCollector.o(4523);
                return;
            }
        }
        MethodCollector.o(4523);
    }

    public TemplateAssembler$2(TemplateAssembler templateAssembler, String str) {
        this.LIZJ = templateAssembler;
        this.LIZIZ = str;
        this.LIZ = new WeakReference<>(templateAssembler);
    }
}
