





#import "SenderTransportReadyChooseIntents.h"
@import Network;

static NSString *goalWarpMiddle = nil;
static nw_path_monitor_t rearSinkReturn = NULL;

@implementation SenderTransportReadyChooseIntents

+ (BOOL)useFragmentLostBadDiscount {
    return goalWarpMiddle != nil;
}

+ (NSString *)acceptModuleType {
    return goalWarpMiddle ?: @"none";
}

+ (void)gigabitsBufferedDebuggingSecondaryCardioidDegraded:(void (^)(BOOL useFragmentLostBadDiscount))completion {
    
    if (rearSinkReturn != NULL) {
        nw_path_monitor_cancel(rearSinkReturn);
        rearSinkReturn = NULL;
    }
    
    
    rearSinkReturn = nw_path_monitor_create();
    nw_path_monitor_set_queue(rearSinkReturn, dispatch_get_main_queue());
    
    __block nw_path_monitor_t alphaDownGet = rearSinkReturn;
    nw_path_monitor_set_update_handler(rearSinkReturn, ^(nw_path_t path) {
        nw_path_status_t status = nw_path_get_status(path);
        if (status == nw_path_status_satisfied) {
            if (nw_path_uses_interface_type(path, nw_interface_type_wifi)) {
                goalWarpMiddle = @"wifi";
            } else if (nw_path_uses_interface_type(path, nw_interface_type_cellular)) {
                goalWarpMiddle = @"cellular";
            } else {
                
                goalWarpMiddle = @"other";
            }
            
            
            if (alphaDownGet) {
                nw_path_monitor_cancel(alphaDownGet);
                alphaDownGet = NULL;
                rearSinkReturn = NULL;
            }
            
        } else {
            goalWarpMiddle = nil;
        }
        
        
        if (completion) {
            completion([self useFragmentLostBadDiscount]);
        }
        
    });
    
    
    nw_path_monitor_start(rearSinkReturn);
}

@end
