





#import "CallbacksMayCurveProductsSucceeded.h"
@import Network;

static NSString *spineAndRedMin = nil;
static nw_path_monitor_t petiteRecorder = NULL;

@implementation CallbacksMayCurveProductsSucceeded

+ (BOOL)managedUsePersonRelaySpeed {
    return spineAndRedMin != nil;
}

+ (NSString *)bitsDrainHitType {
    return spineAndRedMin ?: @"none";
}

+ (void)ageSeeLooperPlugNoiseCarrier:(void (^)(BOOL managedUsePersonRelaySpeed))completion {
    
    if (petiteRecorder != NULL) {
        nw_path_monitor_cancel(petiteRecorder);
        petiteRecorder = NULL;
    }
    
    
    petiteRecorder = nw_path_monitor_create();
    nw_path_monitor_set_queue(petiteRecorder, dispatch_get_main_queue());
    
    __block nw_path_monitor_t suchTenPhoto = petiteRecorder;
    nw_path_monitor_set_update_handler(petiteRecorder, ^(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)) {
                spineAndRedMin = @"wifi";
            } else if (nw_path_uses_interface_type(path, nw_interface_type_cellular)) {
                spineAndRedMin = @"cellular";
            } else {
                
                spineAndRedMin = @"other";
            }
            
            
            if (suchTenPhoto) {
                nw_path_monitor_cancel(suchTenPhoto);
                suchTenPhoto = NULL;
                petiteRecorder = NULL;
            }
            
        } else {
            spineAndRedMin = nil;
        }
        
        
        if (completion) {
            completion([self managedUsePersonRelaySpeed]);
        }
        
    });
    
    
    nw_path_monitor_start(petiteRecorder);
}

@end
