package V2;

import com.debridstream.tv.DebridStreamApp;
import m3.AbstractC2467b;
import w4.C3137A;

/* JADX INFO: renamed from: V2.d1, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0649d1 extends C4.j implements J4.e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public /* synthetic */ Object f7730a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ DebridStreamApp f7731b;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C0649d1(DebridStreamApp debridStreamApp, A4.d dVar) {
        super(2, dVar);
        this.f7731b = debridStreamApp;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        C0649d1 c0649d1 = new C0649d1(this.f7731b, dVar);
        c0649d1.f7730a = obj;
        return c0649d1;
    }

    @Override // J4.e
    public final Object invoke(Object obj, Object obj2) {
        C0649d1 c0649d1 = (C0649d1) create((V4.C) obj, (A4.d) obj2);
        C3137A c3137a = C3137A.f25453a;
        c0649d1.invokeSuspend(c3137a);
        return c3137a;
    }

    @Override // C4.a
    public final Object invokeSuspend(Object obj) {
        B4.a aVar = B4.a.f492a;
        AbstractC2467b.l(obj);
        try {
            W.c.D(this.f7731b);
        } catch (Throwable th) {
            AbstractC2467b.d(th);
        }
        return C3137A.f25453a;
    }
}
package V2;

import com.debridstream.tv.DebridStreamApp;
import m3.AbstractC2467b;
import w4.C3137A;

/**
 * This class implements a coroutine factory and dispatcher for the DebridStreamApp.
 * It extends C4.j (likely a CoroutineDispatcher or similar base class) and implements J4.e (likely a CoroutineFactory interface).
 * 
 * The primary purpose is to create instances of C0649d1 (this class itself) with a specific parent object (f7730a) and then
 * invoke a suspend function on them using a specific dispatcher (C3137A.f25453a).
 * 
 * It handles the lifecycle of creating the coroutine context, invoking the suspend function, and properly
 * propagating any exceptions that occur during the suspend function execution.
 */
public final class C0649d1 extends C4.j implements J4.e {

    /**
     * The parent object passed to the constructor. This is likely a reference to the
     * coroutine context or a parent coroutine that this instance is associated with.
     * Renamed from 'a' to 'parentObject' for clarity.
     */
    public Object parentObject;

    /**
     * The DebridStreamApp instance associated with this coroutine factory.
     * Renamed from 'b' to 'debridStreamApp' for clarity.
     */
    public final DebridStreamApp debridStreamApp;

    /**
     * Constructor for C0649d1.
     * 
     * @param debridStreamApp The DebridStreamApp instance to associate with this factory.
     * @param dVar The parent coroutine dispatcher/context (A4.d).
     */
    public C0649d1(DebridStreamApp debridStreamApp, A4.d dVar) {
        // Initialize the super class with the dispatcher and parent context.
        super(2, dVar);
        // Store the DebridStreamApp instance.
        this.debridStreamApp = debridStreamApp;
    }

    /**
     * Factory method to create a new instance of C0649d1.
     * This is called by the coroutine framework to instantiate the coroutine.
     * 
     * @param obj The parent object (likely a CoroutineContext or similar).
     * @param dVar The parent coroutine dispatcher/context.
     * @return A new instance of C0649d1 with the provided parent object.
     */
    @Override // C4.a (CoroutineFactory)
    public final A4.d create(Object obj, A4.d dVar) {
        // Create a new instance of this class.
        C0649d1 newInstance = new C0649d1(this.debridStreamApp, dVar);
        // Set the parent object for the new instance.
        newInstance.parentObject = obj;
        // Return the new instance.
        return newInstance;
    }

    /**
     * The main entry point for the coroutine logic.
     * This method is invoked by the coroutine framework after the coroutine is created.
     * It sets up the dispatcher and calls the actual suspend function.
     * 
     * @param obj The parent object (likely a CoroutineContext or similar).
     * @param obj2 The parent coroutine dispatcher/context.
     * @return The result of the suspend function (likely a Unit or similar).
     */
    @Override // J4.e (CoroutineFactory)
    public final Object invoke(Object obj, Object obj2) {
        // Create the coroutine instance with the provided parent object and dispatcher.
        C0649d1 coroutineInstance = (C0649d1) create((V4.C) obj, (A4.d) obj2);
        
        // Get the specific dispatcher to use for this coroutine.
        // C3137A.f25453a is likely a predefined dispatcher (e.g., Main dispatcher).
        C3137A dispatcher = C3137A.f25453a;
        
        // Invoke the suspend function on the coroutine instance using the dispatcher.
        coroutineInstance.invokeSuspend(dispatcher);
        
        // Return the result of the dispatcher (likely a Unit or similar).
        return dispatcher;
    }

    /**
     * The suspend function that performs the actual work.
     * This method is called by the coroutine framework when the coroutine is resumed.
     * 
     * @param obj The parent object (likely a CoroutineContext or similar).
     * @return The result of the suspend function (likely a Unit or similar).
     */
    @Override // C4.a (CoroutineFactory)
    public final Object invokeSuspend(Object obj) {
        // Get the default dispatcher (likely the Main dispatcher).
        B4.a defaultDispatcher = B4.a.f492a;
        
        // Validate the parent object (likely checking if it's a valid CoroutineContext).
        AbstractC2467b.validateParentObject(obj);
        
        try {
            // Execute the suspend function logic.
            // W.c.D(this.debridStreamApp) is the actual work being done.
            // W.c is likely a helper class for suspend functions.
            // D is the suspend function being called on the DebridStreamApp.
            W.c.D(this.debridStreamApp);
        } catch (Throwable throwable) {
            // Handle any exceptions that occur during the suspend function execution.
            // AbstractC2467b.d is likely a helper method to rethrow or handle exceptions.
            AbstractC2467b.handleException(throwable);
        }
        
        // Return the result of the dispatcher (likely a Unit or similar).
        return C3137A.f25453a;
    }
}
